2021-10-24 00:42:20 +00:00
|
|
|
import { AdminAboutAPI } from "./admin/admin-about";
|
|
|
|
import { AdminTaskAPI } from "./admin/admin-tasks";
|
2021-11-24 03:57:24 +00:00
|
|
|
import { AdminUsersApi } from "./admin/admin-users";
|
2021-10-24 00:42:20 +00:00
|
|
|
import { ApiRequestInstance } from "~/types/api";
|
|
|
|
|
|
|
|
export class AdminAPI {
|
|
|
|
private static instance: AdminAPI;
|
|
|
|
public about: AdminAboutAPI;
|
|
|
|
public serverTasks: AdminTaskAPI;
|
2021-11-24 03:57:24 +00:00
|
|
|
public users: AdminUsersApi;
|
2021-10-24 00:42:20 +00:00
|
|
|
|
|
|
|
constructor(requests: ApiRequestInstance) {
|
|
|
|
if (AdminAPI.instance instanceof AdminAPI) {
|
|
|
|
return AdminAPI.instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.about = new AdminAboutAPI(requests);
|
|
|
|
this.serverTasks = new AdminTaskAPI(requests);
|
2021-11-24 03:57:24 +00:00
|
|
|
this.users = new AdminUsersApi(requests);
|
2021-10-24 00:42:20 +00:00
|
|
|
|
|
|
|
Object.freeze(this);
|
|
|
|
AdminAPI.instance = this;
|
|
|
|
}
|
|
|
|
}
|