export = PluginsManager; /** * @class PluginsManager * @param {Kuzzle} kuzzle */ declare class PluginsManager { _plugins: Map; controllers: Map; strategies: {}; routes: any[]; pluginsEnabledDir: string; pluginsAvailableDir: string; /** * @example * { * pluginName: { * authName: , * authname2: , * ... * }, * pluginName2: { * ... * } * } * * This structure prevents authenticator names collisions between * multiple auth. plugins */ authenticators: {}; config: import("../../..").PluginsConfiguration; logger: import("../../kuzzle/Logger").Logger; loadedPlugins: any[]; set application(plugin: any); get application(): any; get plugins(): any[]; /** * Giving a controller name, tells if exists * * @param {string} controller * @returns {Boolean} */ isController(controller: string): boolean; /** * Giving a controller name and an action, tells if action exists * * @param {string} controller * @param {string} action * @returns {Boolean} */ isAction(controller: string, action: string): boolean; /** * Giving a controller name, returns its actions * * @param {string} controller * @returns {Array} */ getActions(controller: string): any[]; /** * Returns an array filled with controller names * * @returns {Array} */ getControllerNames(): any[]; /** * Giving a plugin name, tell if it exists * * @param {string} pluginName * @returns {boolean} */ exists(pluginName: string): boolean; /** * Used to dump loaded plugin feature into serverInfo route / cli * * @returns {object} */ getPluginsDescription(): object; /** * Register plugins feature to Kuzzle * * @returns {Promise} * * @throws PluginImplementationError - Throws when an error occurs when registering a plugin */ init(plugins?: {}): Promise; /** * @param {string} strategyName * @returns {string[]} */ getStrategyFields(strategyName: string): string[]; /** * @param {string} strategyName * @param {string} methodName * @returns {boolean} */ hasStrategyMethod(strategyName: string, methodName: string): boolean; /** * @param {string} strategyName * @param {string} methodName * @returns {function} */ getStrategyMethod(strategyName: string, methodName: string): Function; /** * Returns the list of registered passport strategies * @returns {string[]} */ listStrategies(): string[]; /** * Checks if a strategy is well-formed * * @param {string} pluginName * @param {string} strategyName * @param {object} strategy * @throws {PluginImplementationError} If the strategy is invalid */ validateStrategy(pluginName: string, strategyName: string, strategy: object): void; /** * Register a pipe function on an event * * @param {object} plugin * @param {number} warnDelay - delay before a warning is issued * @param {string} event name * @param {Function} handler - function to attach * * @returns {string} pipeId */ registerPipe(plugin: object, event: string, handler: Function): string; unregisterPipe(pipeId: any): void; /** * Registers an authentication strategy. * If the plugin init method has not been called yet, add the strategy to * the plugin.instance.strategies object. * * @param {string} pluginName - plugin name * @param {string} strategyName - strategy name * @param {object} strategy - strategy properties * @throws {PluginImplementationError} If the strategy is invalid or if * registration fails */ registerStrategy(pluginName: string, strategyName: string, strategy: object): void; /** * Unregister * @param {string} pluginName * @param {string} strategyName * @throws {PluginImplementationError} If not the owner of the strategy or if strategy * does not exist */ unregisterStrategy(pluginName: string, strategyName: string): void; /** * @param {object} plugin * @param {number} pipeWarnTime */ _initPipes(plugin: object): void; /** * @param {object} plugin */ _initHooks(plugin: object): void; _initApi(plugin: any): Promise; /** * Init plugin controllers * * @param {object} plugin * @returns {boolean} */ _initControllers(plugin: object): boolean; /** * @param {object} plugin * @throws {PluginImplementationError} If strategies registration fails */ _initStrategies(plugin: object): void; /** * @param {object} plugin * @throws {PluginImplementationError} If strategies registration fails */ _initAuthenticators(plugin: object): void; /** * Load detected plugins in memory * * @returns {object} list of loaded plugin */ loadPlugins(plugins?: {}): object; /** * Wraps a strategy plugin's verify function. * * @param {String} pluginName * @param {String} strategyName * @param {Function} verifyMethod - Strategy plugin's verify method * @returns {Function} */ wrapStrategyVerify(pluginName: string, strategyName: string, verifyMethod: Function): Function; }