1 | import { ParamData } from '@nestjs/common';
|
2 | import { ContextType, Controller, PipeTransform } from '@nestjs/common/interfaces';
|
3 | import { ExternalExceptionFilterContext } from '../exceptions/external-exception-filter-context';
|
4 | import { GuardsConsumer, GuardsContextCreator } from '../guards';
|
5 | import { NestContainer } from '../injector/container';
|
6 | import { ContextId } from '../injector/instance-wrapper';
|
7 | import { ModulesContainer } from '../injector/modules-container';
|
8 | import { InterceptorsConsumer, InterceptorsContextCreator } from '../interceptors';
|
9 | import { PipesConsumer, PipesContextCreator } from '../pipes';
|
10 | import { ParamProperties } from './context-utils';
|
11 | import { ExternalHandlerMetadata } from './interfaces/external-handler-metadata.interface';
|
12 | import { ParamsMetadata } from './interfaces/params-metadata.interface';
|
13 | export interface ParamsFactory {
|
14 | exchangeKeyForValue(type: number, data: ParamData, args: any): any;
|
15 | }
|
16 | export interface ExternalContextOptions {
|
17 | guards?: boolean;
|
18 | interceptors?: boolean;
|
19 | filters?: boolean;
|
20 | }
|
21 | export declare class ExternalContextCreator {
|
22 | private readonly guardsContextCreator;
|
23 | private readonly guardsConsumer;
|
24 | private readonly interceptorsContextCreator;
|
25 | private readonly interceptorsConsumer;
|
26 | private readonly modulesContainer;
|
27 | private readonly pipesContextCreator;
|
28 | private readonly pipesConsumer;
|
29 | private readonly filtersContextCreator;
|
30 | private readonly contextUtils;
|
31 | private readonly externalErrorProxy;
|
32 | private readonly handlerMetadataStorage;
|
33 | private container;
|
34 | constructor(guardsContextCreator: GuardsContextCreator, guardsConsumer: GuardsConsumer, interceptorsContextCreator: InterceptorsContextCreator, interceptorsConsumer: InterceptorsConsumer, modulesContainer: ModulesContainer, pipesContextCreator: PipesContextCreator, pipesConsumer: PipesConsumer, filtersContextCreator: ExternalExceptionFilterContext);
|
35 | static fromContainer(container: NestContainer): ExternalContextCreator;
|
36 | create<TParamsMetadata extends ParamsMetadata = ParamsMetadata, TContext extends string = ContextType>(instance: Controller, callback: (...args: unknown[]) => unknown, methodName: string, metadataKey?: string, paramsFactory?: ParamsFactory, contextId?: ContextId, inquirerId?: string, options?: ExternalContextOptions, contextType?: TContext): (...args: any[]) => Promise<any>;
|
37 | getMetadata<TMetadata, TContext extends string = ContextType>(instance: Controller, methodName: string, metadataKey?: string, paramsFactory?: ParamsFactory, contextType?: TContext): ExternalHandlerMetadata;
|
38 | getContextModuleKey(moduleCtor: Function | undefined): string;
|
39 | exchangeKeysForValues<TMetadata = any>(keys: string[], metadata: TMetadata, moduleContext: string, paramsFactory: ParamsFactory, contextId?: ContextId, inquirerId?: string, contextFactory?: (args: unknown[]) => import("./execution-context-host").ExecutionContextHost): ParamProperties[];
|
40 | createPipesFn(pipes: PipeTransform[], paramsOptions: (ParamProperties & {
|
41 | metatype?: unknown;
|
42 | })[]): (args: unknown[], ...params: unknown[]) => Promise<void>;
|
43 | getParamValue<T>(value: T, { metatype, type, data }: {
|
44 | metatype: any;
|
45 | type: any;
|
46 | data: any;
|
47 | }, pipes: PipeTransform[]): Promise<any>;
|
48 | transformToResult(resultOrDeferred: any): Promise<any>;
|
49 | createGuardsFn<TContext extends string = ContextType>(guards: any[], instance: Controller, callback: (...args: any[]) => any, contextType?: TContext): Function | null;
|
50 | registerRequestProvider<T = any>(request: T, contextId: ContextId): void;
|
51 | }
|