Skip to main content

Class: TsRestHandlerInterceptor

@ts-rest/nest.TsRestHandlerInterceptor

Implements

  • NestInterceptor

Constructors

constructor

new TsRestHandlerInterceptor(reflector, globalOptions)

Parameters

NameType
reflectorReflector
globalOptionsMaybeTsRestOptions

Defined in

libs/ts-rest/nest/src/lib/ts-rest-nest-handler.ts:295

Properties

globalOptions

Private globalOptions: MaybeTsRestOptions

Defined in

libs/ts-rest/nest/src/lib/ts-rest-nest-handler.ts:299


reflector

Private reflector: Reflector

Defined in

libs/ts-rest/nest/src/lib/ts-rest-nest-handler.ts:296

Methods

getAppRouteFromContext

Private getAppRouteFromContext(ctx): TsRestAppRouteMetadata

We use metadata to store the route, and the key of the route in a router on a given method

Parameters

NameType
ctxExecutionContext

Returns

TsRestAppRouteMetadata

Defined in

libs/ts-rest/nest/src/lib/ts-rest-nest-handler.ts:305


intercept

intercept(ctx, next): Observable<any>

Parameters

NameType
ctxExecutionContext
nextCallHandler<any>

Returns

Observable<any>

Implementation of

NestInterceptor.intercept

Defined in

libs/ts-rest/nest/src/lib/ts-rest-nest-handler.ts:325