UNPKG

@whook/whook

Version:

Build strong and efficient REST web services.

51 lines (50 loc) 2.6 kB
import { type LogService } from 'common-services'; import { type OpenAPIComponents, type OpenAPIExtension, type OpenAPIPaths } from 'ya-open-api-types'; import { type WhookPluginName } from './WHOOK_RESOLVED_PLUGINS.js'; import { type ExpressiveJSONSchema } from 'ya-json-schema-types'; import { type WhookRouteDefinition } from '../types/routes.js'; import { type WhookCommandDefinition } from '../types/commands.js'; import { type WhookCronDefinition } from '../types/crons.js'; import { type WhookTransformerDefinition } from '../types/transformers.js'; import { type WhookRoutesDefinitionsService } from './ROUTES_DEFINITIONS.js'; import { type WhookCommandsDefinitionsService } from './COMMANDS_DEFINITIONS.js'; import { type WhookCronsDefinitionsService } from './CRONS_DEFINITIONS.js'; import { type WhookConsumersDefinitionsService } from './CONSUMERS_DEFINITIONS.js'; import { type WhookTransformersDefinitionsService } from './TRANSFORMERS_DEFINITIONS.js'; import { type WhookOpenAPI } from '../types/openapi.js'; import { type WhookConsumerDefinition } from '../types/consumers.js'; export declare const DEFAULT_SECURITY_DEFINITIONS: WhookSecurityDefinitions; export interface WhookSecurityDefinitions { securitySchemes: NonNullable<NonNullable<WhookOpenAPI['components']>['securitySchemes']>; security: NonNullable<WhookOpenAPI['security']>; } export interface WhookDefinitionsConfig { WHOOK_PLUGINS?: WhookPluginName[]; } export type WhookDefinitionsDependencies = WhookDefinitionsConfig & { ROUTES_DEFINITIONS: WhookRoutesDefinitionsService; COMMANDS_DEFINITIONS: WhookCommandsDefinitionsService; CRONS_DEFINITIONS: WhookCronsDefinitionsService; CONSUMERS_DEFINITIONS: WhookConsumersDefinitionsService; TRANSFORMERS_DEFINITIONS: WhookTransformersDefinitionsService; SECURITY_DEFINITIONS?: WhookSecurityDefinitions; log?: LogService; }; export interface WhookDefinitions { paths: OpenAPIPaths<ExpressiveJSONSchema, OpenAPIExtension>; components: OpenAPIComponents<ExpressiveJSONSchema, OpenAPIExtension>; security: NonNullable<WhookOpenAPI['security']>; configs: Record<string, ({ type: 'command'; } & WhookCommandDefinition) | ({ type: 'route'; } & WhookRouteDefinition) | (WhookCronDefinition & { type: 'cron'; }) | (WhookConsumerDefinition & { type: 'consumer'; }) | (WhookTransformerDefinition & { type: 'transformer'; })>; } declare const _default: import("knifecycle").ServiceInitializer<WhookDefinitionsDependencies, WhookDefinitions>; export default _default;