import { Koncorde } from "koncorde"; import Funnel from "../api/funnel"; import PassportWrapper from "../core/auth/passportWrapper"; import { TokenManager } from "../core/auth/tokenManager"; import EntryPoint from "../core/network/entryPoint"; import Router from "../core/network/router"; import PluginsManager from "../core/plugin/pluginsManager"; import Validation from "../core/validation/validation"; import { KuzzleConfiguration } from "../types/config/KuzzleConfiguration"; import AsyncStore from "../util/asyncStore"; import { ImportConfig, InstallationConfig, StartOptions, SupportConfig } from "./../types/Kuzzle"; import KuzzleEventEmitter from "./event/KuzzleEventEmitter"; import InternalIndexHandler from "./internalIndexHandler"; import kuzzleStateEnum from "./kuzzleStateEnum"; import { Logger } from "./Logger"; declare class Kuzzle extends KuzzleEventEmitter { config: KuzzleConfiguration; private _state; log: Logger; private rootPath; /** * Internal index bootstrapper and accessor */ internalIndex: InternalIndexHandler; pluginsManager: PluginsManager; tokenManager: TokenManager; passport: PassportWrapper; /** * The funnel dispatches messages to API controllers */ funnel: Funnel; /** * The router listens to client requests and pass them to the funnel */ router: Router; /** * Statistics core component */ private statistics; /** * Network entry point */ entryPoint: EntryPoint; /** * Validation core component */ validation: Validation; /** * Dump generator */ private dumpGenerator; /** * Vault component (will be initialized after bootstrap) */ vault: any; /** * AsyncLocalStorage wrapper */ asyncStore: AsyncStore; /** * Kuzzle internal debugger */ private debugger; /** * Kuzzle version */ private version; private openApiManager; /** * List of differents imports types and their associated method */ private importTypes; koncorde: Koncorde; secret: string; /** * Node unique ID amongst other cluster nodes */ id: string; constructor(config: KuzzleConfiguration); /** * Initializes all the needed components of Kuzzle. * * @param {Application} - Application Plugin instance * @param {Object} - Additional options (import, installations, plugins, secretsFile, support, vaultKey) * * @this {Kuzzle} */ start(application: any, options?: StartOptions): Promise; /** * Generates the node ID. * * This will init the cluster if it's enabled. */ private initKuzzleNode; /** * Gracefully exits after processing remaining requests * * @returns {Promise} */ shutdown(): Promise; /** * Execute multiple handlers only once on any given environment * * @param {Array<{ id: string, handler: () => void, description?: string }>} installations - Array of unique methods to execute * * @returns {Promise} */ install(installations: InstallationConfig[]): Promise; ask(event: string, ...args: [payload?: any, ...rest: any]): Promise; emit(event: string, ...args: any[]): boolean; pipe(event: string, ...args: any[]): Promise; private importUserMappings; private importMappings; private importFixtures; private importPermissions; /** * Check if every import has been done, if one of them is not finished yet, wait for it */ private _waitForImportToFinish; private isConfigsEmpty; private persistHashedImport; /** * Load into the app several imports * * @param {Object} toImport - Contains `mappings`, `onExistingUsers`, `profiles`, `roles`, `userMappings`, `users` * @param {Object} toSupport - Contains `fixtures`, `mappings`, `securities` (`profiles`, `roles`, `users`) * * @returns {Promise} */ loadInitialState(toImport?: ImportConfig, toSupport?: SupportConfig): Promise; dump(suffix: any): Promise; hash(input: any): number; get state(): kuzzleStateEnum; set state(value: kuzzleStateEnum); /** * Register handlers and do a kuzzle dump for: * - system signals * - unhandled-rejection * - uncaught-exception */ registerSignalHandlers(): void; dumpAndExit(suffix: any): Promise; } export { Kuzzle }; export default Kuzzle;