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