@whook/whook
Version:
Build strong and efficient REST web services.
139 lines (138 loc) • 7.05 kB
TypeScript
import { Knifecycle, type Dependencies } from 'knifecycle';
import { argv as _argv } from 'node:process';
import initQueryParserBuilder from './services/queryParserBuilder.js';
import initHTTPRouter, { SEARCH_SEPARATOR, PATH_SEPARATOR } from './services/httpRouter.js';
import initErrorHandler from './services/errorHandler.js';
import initHTTPTransaction from './services/httpTransaction.js';
import initObfuscatorService from './services/obfuscator.js';
import initAPMService from './services/apm.js';
export { DEFAULT_ERROR_URI, DEFAULT_HELP_URI, DEFAULT_ERRORS_DESCRIPTORS, DEFAULT_DEFAULT_ERROR_CODE, } from './services/errorHandler.js';
import initPort from './services/PORT.js';
import initHost from './services/HOST.js';
import initProxiedENV from './services/PROXIED_ENV.js';
import initWhookResolvedPlugins, { WHOOK_DEFAULT_PLUGINS, WHOOK_PROJECT_PLUGIN_NAME } from './services/WHOOK_RESOLVED_PLUGINS.js';
import initDefinitions from './services/DEFINITIONS.js';
export * from './services/DEFINITIONS.js';
export type * from './services/DEFINITIONS.js';
import initRoutesDefinitions from './services/ROUTES_DEFINITIONS.js';
export { initRoutesDefinitions };
export * from './services/ROUTES_DEFINITIONS.js';
export type * from './services/ROUTES_DEFINITIONS.js';
import initRoutesWrappers from './services/ROUTES_WRAPPERS.js';
export { initRoutesWrappers };
export * from './services/ROUTES_WRAPPERS.js';
import initMainHandler from './services/MAIN_HANDLER.js';
export { initMainHandler };
import initRoutesHandlers from './services/ROUTES_HANDLERS.js';
export { initRoutesHandlers };
export * from './services/ROUTES_HANDLERS.js';
import initCommandsDefinitions from './services/COMMANDS_DEFINITIONS.js';
export { initCommandsDefinitions };
export * from './services/COMMANDS_DEFINITIONS.js';
export type * from './services/COMMANDS_DEFINITIONS.js';
import initCronsDefinitions from './services/CRONS_DEFINITIONS.js';
export { initCronsDefinitions };
export * from './services/CRONS_DEFINITIONS.js';
export type * from './services/CRONS_DEFINITIONS.js';
import initCronsWrappers from './services/CRONS_WRAPPERS.js';
export { initCronsWrappers };
export * from './services/CRONS_WRAPPERS.js';
import initCronsHandlers from './services/CRONS_HANDLERS.js';
export { initCronsHandlers };
export * from './services/CRONS_HANDLERS.js';
import initConsumersDefinitions from './services/CONSUMERS_DEFINITIONS.js';
export { initConsumersDefinitions };
export * from './services/CONSUMERS_DEFINITIONS.js';
export type * from './services/CONSUMERS_DEFINITIONS.js';
import initConsumersWrappers from './services/CONSUMERS_WRAPPERS.js';
export { initConsumersWrappers };
export * from './services/CONSUMERS_WRAPPERS.js';
import initConsumersHandlers from './services/CONSUMERS_HANDLERS.js';
export { initConsumersHandlers };
export * from './services/CONSUMERS_HANDLERS.js';
import initTransformersDefinitions from './services/TRANSFORMERS_DEFINITIONS.js';
export { initTransformersDefinitions };
export * from './services/TRANSFORMERS_DEFINITIONS.js';
export type * from './services/TRANSFORMERS_DEFINITIONS.js';
import initTransformersWrappers from './services/TRANSFORMERS_WRAPPERS.js';
export { initTransformersWrappers };
export * from './services/TRANSFORMERS_WRAPPERS.js';
import initTransformersHandlers from './services/TRANSFORMERS_HANDLERS.js';
export { initTransformersHandlers };
export * from './services/TRANSFORMERS_HANDLERS.js';
import initRouteInvoker from './services/routeInvoker.js';
export { initRouteInvoker };
export * from './services/routeInvoker.js';
export * from './services/schemaValidators.js';
import initAutoload from './services/_autoload.js';
import initGetPing, { definition as getPingDefinition } from './routes/getPing.js';
import initGetOpenAPI, { definition as getOpenAPIDefinition } from './routes/getOpenAPI.js';
import './types/errors.js';
export * from './libs/args.js';
export * from './libs/body.js';
export * from './libs/coercion.js';
export * from './libs/constants.js';
export * from './libs/environments.js';
export * from './libs/headers.js';
export * from './libs/openapi.js';
export * from './libs/router.js';
export * from './libs/utils.js';
export * from './libs/hash.js';
export * from './libs/validation.js';
export * from './libs/wrappers.js';
export * from './services/queryParserBuilder.js';
export type * from './types/wrappers.js';
export type * from './types/routes.js';
export type * from './types/commands.js';
export type * from './types/http.js';
export type * from './types/base.js';
export type * from './types/openapi.js';
export type * from './types/crons.js';
export type * from './types/transformers.js';
export type * from './types/consumers.js';
export type * from './libs/openapi.js';
export type * from './libs/validation.js';
export type * from './libs/args.js';
export type * from './libs/environments.js';
export type * from './services/PORT.js';
export type * from './services/httpServer.js';
export type * from './services/HOST.js';
export type * from './services/PROXIED_ENV.js';
export type * from './services/WHOOK_RESOLVED_PLUGINS.js';
export type * from './services/DEFINITIONS.js';
export type * from './services/_autoload.js';
export type * from './services/routeInvoker.js';
export type * from './services/schemaValidators.js';
export { SEARCH_SEPARATOR, PATH_SEPARATOR, initHTTPRouter };
export type * from './services/httpRouter.js';
export { initHTTPTransaction };
export type * from './services/httpTransaction.js';
export type * from './services/obfuscator.js';
export { initObfuscatorService };
export type * from './services/apm.js';
export { initAPMService };
export type * from './services/errorHandler.js';
export { initErrorHandler };
export { initQueryParserBuilder };
export type * from './services/BASE_URL.js';
export { WHOOK_DEFAULT_PLUGINS, WHOOK_PROJECT_PLUGIN_NAME, initWhookResolvedPlugins, initGetPing, getPingDefinition, initGetOpenAPI, getOpenAPIDefinition, initAutoload, initDefinitions, initProxiedENV, initPort, initHost, };
export declare const WHOOK_DEFAULT_INJECTED_NAMES: string[];
export declare function runProcess<D extends Dependencies, T extends Knifecycle = Knifecycle>(innerPrepareEnvironment?: ($?: T) => Promise<T>, innerPrepareProcess?: (injectedNames: string[], $: T) => Promise<D>, injectedNames?: string[], argv?: typeof _argv): Promise<D>;
/**
* Runs the Whook's process
* @param {Array<String>} servicesNames
* Root dependencies names to instanciate and return
* @param {Knifecycle} $
* The Knifecycle instance to use for the run
* @returns Object
* A promise of the injected services
*/
export declare function prepareProcess<D extends Dependencies, T extends Knifecycle>(servicesNames: string[], $: T): Promise<D>;
/**
* Prepare the Whook process environment
* @param {Knifecycle} $
* The Knifecycle instance to set the various services
* @returns Promise<Knifecycle>
* A promise of the Knifecycle instance
*/
export declare function prepareEnvironment<T extends Knifecycle>($?: T): Promise<T>;