UNPKG

@whook/whook

Version:

Build strong and efficient REST web services.

144 lines (143 loc) 7.56 kB
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'; import initBuildConstantFilter from './services/BUILD_CONSTANT_FILTER.js'; export { initBuildConstantFilter }; export type * from './services/BUILD_CONSTANT_FILTER.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'; import initAutoload from './services/_autoload.js'; import initBuildAutoload from './services/_buildAutoload.js'; import initGetPing, { definition as getPingDefinition } from './routes/getPing.js'; import initGetOpenAPI, { definition as getOpenAPIDefinition } from './routes/getOpenAPI.js'; import { prepareBuildEnvironment, runBuild } from './build.js'; export { DEFAULT_BUILD_INITIALIZER_PATH_MAP } from './build.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/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/BUILD_CONSTANT_FILTER.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'; import initCompiler from './services/compiler.js'; export { DEFAULT_COMPILER_OPTIONS, type WhookCompilerOptions, type WhookCompilerService, type WhookCompilerConfig, } from './services/compiler.js'; export { WHOOK_DEFAULT_PLUGINS, WHOOK_PROJECT_PLUGIN_NAME, initWhookResolvedPlugins, initGetPing, getPingDefinition, initGetOpenAPI, getOpenAPIDefinition, initAutoload, initBuildAutoload, initDefinitions, initProxiedENV, initPort, initHost, initCompiler, prepareBuildEnvironment, runBuild, }; 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>;