1 | import { HttpServer } from '@nestjs/common';
|
2 | import { RequestMethod } from '@nestjs/common/enums/request-method.enum';
|
3 | import { Controller } from '@nestjs/common/interfaces/controllers/controller.interface';
|
4 | import { Type } from '@nestjs/common/interfaces/type.interface';
|
5 | import { VersionValue } from '@nestjs/common/interfaces/version-options.interface';
|
6 | import { ApplicationConfig } from '../application-config';
|
7 | import { NestContainer } from '../injector/container';
|
8 | import { Injector } from '../injector/injector';
|
9 | import { InstanceWrapper } from '../injector/instance-wrapper';
|
10 | import { Module } from '../injector/module';
|
11 | import { MetadataScanner } from '../metadata-scanner';
|
12 | import { ExceptionsFilter } from './interfaces/exceptions-filter.interface';
|
13 | import { RoutePathMetadata } from './interfaces/route-path-metadata.interface';
|
14 | import { RoutePathFactory } from './route-path-factory';
|
15 | import { RouterProxy, RouterProxyCallback } from './router-proxy';
|
16 | export interface RouteDefinition {
|
17 | path: string[];
|
18 | requestMethod: RequestMethod;
|
19 | targetCallback: RouterProxyCallback;
|
20 | methodName: string;
|
21 | version?: VersionValue;
|
22 | }
|
23 | export declare class RouterExplorer {
|
24 | private readonly metadataScanner;
|
25 | private readonly container;
|
26 | private readonly injector?;
|
27 | private readonly routerProxy?;
|
28 | private readonly exceptionsFilter?;
|
29 | private readonly config?;
|
30 | private readonly routePathFactory?;
|
31 | private readonly executionContextCreator;
|
32 | private readonly routerMethodFactory;
|
33 | private readonly logger;
|
34 | private readonly exceptionFiltersCache;
|
35 | constructor(metadataScanner: MetadataScanner, container: NestContainer, injector?: Injector, routerProxy?: RouterProxy, exceptionsFilter?: ExceptionsFilter, config?: ApplicationConfig, routePathFactory?: RoutePathFactory);
|
36 | explore<T extends HttpServer = any>(instanceWrapper: InstanceWrapper, moduleKey: string, applicationRef: T, host: string | RegExp | Array<string | RegExp>, routePathMetadata: RoutePathMetadata): void;
|
37 | extractRouterPath(metatype: Type<Controller>): string[];
|
38 | scanForPaths(instance: Controller, prototype?: object): RouteDefinition[];
|
39 | exploreMethodMetadata(instance: Controller, prototype: object, methodName: string): RouteDefinition;
|
40 | applyPathsToRouterProxy<T extends HttpServer>(router: T, routeDefinitions: RouteDefinition[], instanceWrapper: InstanceWrapper, moduleKey: string, routePathMetadata: RoutePathMetadata, host: string | RegExp | Array<string | RegExp>): void;
|
41 | private applyCallbackToRouter;
|
42 | private applyHostFilter;
|
43 | private applyVersionFilter;
|
44 | private createCallbackProxy;
|
45 | createRequestScopedHandler(instanceWrapper: InstanceWrapper, requestMethod: RequestMethod, moduleRef: Module, moduleKey: string, methodName: string): <TRequest extends Record<any, any>, TResponse>(req: TRequest, res: TResponse, next: () => void) => Promise<void>;
|
46 | private getContextId;
|
47 | }
|