import { EndpointBrokerManagerFS } from "$lib/server/broker-utils/FileSystem/Endpoint" import type { IEndpoint } from "./endpoints-interfaces" // UGLY: refactor this export class EndpointManagerApp { private static initialized = false /** Here we store all endpoints * - Key: path * - Value: any IEndpointFS */ public static get ready() { return EndpointManagerApp.initialized } public static init() { // TODO: Read all files // TODO: QUICK parse them // TODO: Initialize a file watcher } public static async activateEndpoint(path: string): Promise { return await EndpointBrokerManagerFS.activateEndpoint(path) } public static async deactivateEndpoint(path: string): Promise { return await EndpointBrokerManagerFS.deactivateEndpoint(path) } public static getEndpointByPath(path: string): IEndpoint | null { // UGLY: parse return EndpointBrokerManagerFS.getEndpointByPath(path) } public static async getAll(): Promise { // UGLY: parse return await EndpointBrokerManagerFS.getAll() } }