import { IObjectManager } from '../database/IObjectManager'; import { IExtensionEvents } from './IExtension'; import * as express from 'express'; import { ExtensionObject } from './ExtensionObject'; import { ExtensionRepository } from './ExtensionRepository'; import { ExtensionListItem } from '../../../common/entities/extension/ExtensionListItem'; import { UIExtensionDTO } from '../../../common/entities/extension/IClientUIConfig'; export declare class ExtensionManager implements IObjectManager { static EXTENSION_API_PATH: string; repository: ExtensionRepository; /** * The manager that serves the extension REST API. * The app mounts the API only once (ObjectManagers creates a new manager on every reset), and this is where it goes. */ private static active; private static mountedApps; events: IExtensionEvents; extObjects: Record>; private serverModules; constructor(); init(): Promise; /** * Passes the request through the routers of the current extension objects. * Every extension has its own router, so the routes of a cleaned up extension are gone with its object. */ handleRequest(req: express.Request, res: express.Response, next: express.NextFunction): void; getExtensionListWithInstallStatus(): Promise; cleanUp(): Promise; /** * Install an extension from the repository * @param extensionId - The repository extension ID (not to be confused with the unique internal extensionId used in extObjects) */ installExtension(extensionId: string): Promise; /** * Reload an extension by cleaning up and re-initializing it * @param configKey - The key used in Config.Extensions.extensions map (typically the folder name) */ reloadExtension(configKey: string): Promise; /** * Delete an extension by cleaning up, removing its folder, and removing it from configuration * @param configKey - The key used in Config.Extensions.extensions map (typically the folder name) */ deleteExtension(configKey: string): Promise; /** * Drops the modules of the extension folder (incl. its node_modules) from the require cache. * Native addons stay: Node can't load them twice. */ private static clearRequireCache; /** * An extension folder is a single, plain folder name inside the extension folder. */ private static isFolderName; getUIExtensionConfigs(): UIExtensionDTO[]; private initEvents; private createUniqueExtensionObject; /** * Initialize a single extension * @param configKey The key used in Config.Extensions.extensions map (typically the folder name) * @returns Promise that resolves when the extension is initialized */ private initSingleExtension; /** * Initialize all extensions */ private initExtensions; private cleanUpSingleExtension; private cleanUpExtensions; private downloadFile; private unzipFile; }