2021-09-02 19:24:17 +00:00
|
|
|
import { BaseAPI } from "./_base";
|
|
|
|
|
|
|
|
const prefix = "/api";
|
|
|
|
|
|
|
|
const routes = {
|
|
|
|
about: `${prefix}/admin/about`,
|
|
|
|
aboutStatistics: `${prefix}/admin/about/statistics`,
|
2021-10-05 04:16:37 +00:00
|
|
|
check: `${prefix}/admin/about/check`,
|
2021-09-02 19:24:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export interface AdminAboutInfo {
|
|
|
|
production: boolean;
|
|
|
|
version: string;
|
|
|
|
demoStatus: boolean;
|
|
|
|
apiPort: number;
|
|
|
|
apiDocs: boolean;
|
|
|
|
dbType: string;
|
|
|
|
dbUrl: string;
|
|
|
|
defaultGroup: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AdminStatistics {
|
|
|
|
totalRecipes: number;
|
|
|
|
totalUsers: number;
|
|
|
|
totalGroups: number;
|
|
|
|
uncategorizedRecipes: number;
|
|
|
|
untaggedRecipes: number;
|
|
|
|
}
|
|
|
|
|
2021-10-05 04:16:37 +00:00
|
|
|
export interface CheckAppConfig {
|
|
|
|
emailReady: boolean;
|
|
|
|
baseUrlSet: boolean;
|
|
|
|
}
|
|
|
|
|
2021-09-02 19:24:17 +00:00
|
|
|
export class AdminAboutAPI extends BaseAPI {
|
|
|
|
async about() {
|
|
|
|
return await this.requests.get<AdminAboutInfo>(routes.about);
|
|
|
|
}
|
|
|
|
|
|
|
|
async statistics() {
|
|
|
|
return await this.requests.get(routes.aboutStatistics);
|
|
|
|
}
|
2021-10-05 04:16:37 +00:00
|
|
|
|
|
|
|
async checkApp() {
|
|
|
|
return await this.requests.get<CheckAppConfig>(routes.check);
|
|
|
|
}
|
2021-09-02 19:24:17 +00:00
|
|
|
}
|