Class ExternalContextCreator
Properties
Private Readonly contextUtils
Private Readonly externalErrorProxy
Private Readonly filtersContextCreator
Private Readonly guardsConsumer
Private Readonly guardsContextCreator
Private Readonly handlerMetadataStorage
Private Readonly interceptorsConsumer
Private Readonly interceptorsContextCreator
Private Readonly modulesContainer
Private Readonly pipesConsumer
Private Readonly pipesContextCreator
Methods
create
- create<TParamsMetadata, TContext>(instance: Controller, callback: (...args: unknown[]) => unknown, methodName: string, metadataKey?: string, paramsFactory?: ParamsFactory, contextId?: ContextId, inquirerId?: string, options?: ExternalContextOptions, contextType?: TContext): target
-
Type parameters
-
TParamsMetadata: ParamsMetadata = ParamsMetadata
-
TContext: string = ContextType
Parameters
-
-
callback: (...args: unknown[]) => unknown
-
- (...args: unknown[]): unknown
-
Parameters
Returns unknown
-
methodName: string
-
Optional metadataKey: string
-
-
Default value contextId: ContextId = STATIC_CONTEXT
-
Optional inquirerId: string
-
Default value options: ExternalContextOptions = {interceptors: true,guards: true,filters: true,}
-
Default value contextType: TContext = 'http' as TContext
Returns target
createGuardsFn
- createGuardsFn<TContext>(guards: any[], instance: Controller, callback: (...args: any[]) => any, contextType?: TContext): Function | null
-
Type parameters
-
TContext: string = ContextType
Parameters
-
guards: any[]
-
-
callback: (...args: any[]) => any
-
Optional contextType: TContext
createPipesFn
- createPipesFn(pipes: PipeTransform[], paramsOptions: (ParamProperties & { metatype?: unknown })[]): pipesFn
-
Parameters
-
pipes: PipeTransform[]
-
paramsOptions: (ParamProperties & { metatype?: unknown })[]
Returns pipesFn
exchangeKeysForValues
-
Type parameters
Parameters
-
keys: string[]
-
metadata: TMetadata
-
moduleContext: string
-
-
Default value contextId: ContextId = STATIC_CONTEXT
-
Optional inquirerId: string
-
Default value contextFactory: (args: unknown[]) => ExecutionContextHost = this.contextUtils.getContextFactory('http')
getContextModuleName
- getContextModuleName(constructor: Function): string
-
Parameters
Returns string
getMetadata
-
Type parameters
-
TMetadata
-
TContext: string = ContextType
Parameters
-
-
methodName: string
-
Optional metadataKey: string
-
-
Optional contextType: TContext
getParamValue
- getParamValue<T>(value: T, __namedParameters: { data: any; metatype: any; type: any }, pipes: PipeTransform[]): Promise<any>
-
Type parameters
Parameters
-
value: T
-
__namedParameters: { data: any; metatype: any; type: any }
-
data: any
-
metatype: any
-
type: any
-
pipes: PipeTransform[]
Returns Promise<any>
getProviderByClassName
- getProviderByClassName(module: Module, className: string): boolean
-
Parameters
Returns boolean
registerRequestProvider
- registerRequestProvider<T>(request: T, contextId: ContextId): void
-
Type parameters
Parameters
Returns void
transformToResult
- transformToResult(resultOrDeffered: any): Promise<any>
-
Parameters
Returns Promise<any>