import { APIClient } from "./ApiClient"; export interface ServerConfig { auth_disabled: boolean; } let config: ServerConfig | null = null; export class ServerApi { /** * Get server configuration */ static async LoadConfig(): Promise { config = ( await APIClient.exec({ uri: "/server/config", method: "GET", }) ).data; } /** * Get cached configuration */ static get Config(): ServerConfig { if (config === null) throw new Error("Missing configuration!"); return config; } }