diff --git a/node_modules/@nestjs/common/interfaces/nest-application-context.interface.d.ts b/node_modules/@nestjs/common/interfaces/nest-application-context.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e5c334b7f95f65b23589dc03f4d7ed4daeb6d00 --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/nest-application-context.interface.d.ts @@ -0,0 +1,139 @@ +import { ShutdownSignal } from '../enums/shutdown-signal.enum'; +import { LoggerService, LogLevel } from '../services/logger.service'; +import { DynamicModule } from './modules'; +import { NestApplicationContextOptions } from './nest-application-context-options.interface'; +import { ShutdownHooksOptions } from './shutdown-hooks-options.interface'; +import { Type } from './type.interface'; +export type SelectOptions = Pick; +export interface GetOrResolveOptions { + /** + * If enabled, lookup will only be performed in the host module. + * @default false + */ + strict?: boolean; + /** + * If enabled, instead of returning a first instance registered under a given token, + * a list of instances will be returned. + * @default false + */ + each?: boolean; +} +/** + * Interface defining NestApplicationContext. + * + * @publicApi + */ +export interface INestApplicationContext { + /** + * Allows navigating through the modules tree, for example, to pull out a specific instance from the selected module. + * @returns {INestApplicationContext} + */ + select(module: Type | DynamicModule, options?: SelectOptions): INestApplicationContext; + /** + * Retrieves an instance of either injectable or controller, otherwise, throws exception. + * @returns {TResult} + */ + get(typeOrToken: Type | Function | string | symbol): TResult; + /** + * Retrieves an instance of either injectable or controller, otherwise, throws exception. + * @returns {TResult} + */ + get(typeOrToken: Type | Function | string | symbol, options: { + strict?: boolean; + each?: undefined | false; + }): TResult; + /** + * Retrieves a list of instances of either injectables or controllers, otherwise, throws exception. + * @returns {Array} + */ + get(typeOrToken: Type | Function | string | symbol, options: { + strict?: boolean; + each: true; + }): Array; + /** + * Retrieves an instance (or a list of instances) of either injectable or controller, otherwise, throws exception. + * @returns {TResult | Array} + */ + get(typeOrToken: Type | Function | string | symbol, options?: GetOrResolveOptions): TResult | Array; + /** + * Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception. + * @returns {Array} + */ + resolve(typeOrToken: Type | Function | string | symbol): Promise; + /** + * Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception. + * @returns {Array} + */ + resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }): Promise; + /** + * Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception. + * @returns {Array} + */ + resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }, options?: { + strict?: boolean; + each?: undefined | false; + }): Promise; + /** + * Resolves transient or request-scoped instances of either injectables or controllers, otherwise, throws exception. + * @returns {Array} + */ + resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }, options?: { + strict?: boolean; + each: true; + }): Promise>; + /** + * Resolves transient or request-scoped instance (or a list of instances) of either injectable or controller, otherwise, throws exception. + * @returns {Promise>} + */ + resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }, options?: GetOrResolveOptions): Promise>; + /** + * Registers the request/context object for a given context ID (DI container sub-tree). + * @returns {void} + */ + registerRequestByContextId(request: T, contextId: { + id: number; + }): void; + /** + * Terminates the application + * @returns {Promise} + */ + close(): Promise; + /** + * Sets custom logger service. + * Flushes buffered logs if auto flush is on. + * @returns {void} + */ + useLogger(logger: LoggerService | LogLevel[] | false): void; + /** + * Prints buffered logs and detaches buffer. + * @returns {void} + */ + flushLogs(): void; + /** + * Enables the usage of shutdown hooks. Will call the + * `onApplicationShutdown` function of a provider if the + * process receives a shutdown signal. + * + * @param {ShutdownSignal[] | string[]} [signals] The system signals to listen to + * @param {ShutdownHooksOptions} [options] Options for configuring shutdown hooks behavior + * + * @returns {this} The Nest application context instance + */ + enableShutdownHooks(signals?: ShutdownSignal[] | string[], options?: ShutdownHooksOptions): this; + /** + * Initializes the Nest application. + * Calls the Nest lifecycle events. + * It isn't mandatory to call this method directly. + * + * @returns {Promise} The NestApplicationContext instance as Promise + */ + init(): Promise; +} diff --git a/node_modules/@nestjs/common/interfaces/nest-application-context.interface.js b/node_modules/@nestjs/common/interfaces/nest-application-context.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/nest-application-context.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/interfaces/nest-application-options.interface.d.ts b/node_modules/@nestjs/common/interfaces/nest-application-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ade8fc3238555753b7d4029e73c50072bf93b469 --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/nest-application-options.interface.d.ts @@ -0,0 +1,29 @@ +import { CorsOptions, CorsOptionsDelegate } from './external/cors-options.interface'; +import { HttpsOptions } from './external/https-options.interface'; +import { NestApplicationContextOptions } from './nest-application-context-options.interface'; +/** + * @publicApi + */ +export interface NestApplicationOptions extends NestApplicationContextOptions { + /** + * CORS options from [CORS package](https://github.com/expressjs/cors#configuration-options) + */ + cors?: boolean | CorsOptions | CorsOptionsDelegate; + /** + * Whether to use underlying platform body parser. + */ + bodyParser?: boolean; + /** + * Set of configurable HTTPS options + */ + httpsOptions?: HttpsOptions; + /** + * Whether to register the raw request body on the request. Use `req.rawBody`. + */ + rawBody?: boolean; + /** + * Force close open HTTP connections. Useful if restarting your application hangs due to + * keep-alive connections in the HTTP adapter. + */ + forceCloseConnections?: boolean; +} diff --git a/node_modules/@nestjs/common/interfaces/nest-application-options.interface.js b/node_modules/@nestjs/common/interfaces/nest-application-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/nest-application-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/interfaces/nest-application.interface.d.ts b/node_modules/@nestjs/common/interfaces/nest-application.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6e7fff8c727970e862129b1aa70d8e43402573ea --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/nest-application.interface.d.ts @@ -0,0 +1,135 @@ +import { CanActivate } from './features/can-activate.interface'; +import { NestInterceptor } from './features/nest-interceptor.interface'; +import { GlobalPrefixOptions } from './global-prefix-options.interface'; +import { HttpServer } from './http/http-server.interface'; +import { ExceptionFilter, INestMicroservice, NestHybridApplicationOptions, PipeTransform } from './index'; +import { INestApplicationContext } from './nest-application-context.interface'; +import { VersioningOptions } from './version-options.interface'; +import { WebSocketAdapter } from './websockets/web-socket-adapter.interface'; +/** + * Interface defining the core NestApplication object. + * + * @publicApi + */ +export interface INestApplication extends INestApplicationContext { + /** + * A wrapper function around HTTP adapter method: `adapter.use()`. + * Example `app.use(cors())` + * + * @returns {this} + */ + use(...args: any[]): this; + /** + * Enables CORS (Cross-Origin Resource Sharing) + * + * @returns {void} + */ + enableCors(options?: any): void; + /** + * Enables Versioning for the application. + * By default, URI-based versioning is used. + * + * @param {VersioningOptions} options + * @returns {this} + */ + enableVersioning(options?: VersioningOptions): this; + /** + * Starts the application. + * + * @param {number|string} port + * @param {string} [hostname] + * @param {Function} [callback] Optional callback + * @returns {Promise} A Promise that, when resolved, is a reference to the underlying HttpServer. + */ + listen(port: number | string, callback?: () => void): Promise; + listen(port: number | string, hostname: string, callback?: () => void): Promise; + /** + * Returns the url the application is listening at, based on OS and IP version. Returns as an IP value either in IPv6 or IPv4 + * + * @returns {Promise} The IP where the server is listening + */ + getUrl(): Promise; + /** + * Registers a prefix for every HTTP route path. + * + * @param {string} prefix The prefix for every HTTP route path (for example `/v1/api`) + * @param {GlobalPrefixOptions} options Global prefix options object + * @returns {this} + */ + setGlobalPrefix(prefix: string, options?: GlobalPrefixOptions): this; + /** + * Register Ws Adapter which will be used inside Gateways. + * Use when you want to override default `socket.io` library. + * + * @param {WebSocketAdapter} adapter + * @returns {this} + */ + useWebSocketAdapter(adapter: WebSocketAdapter): this; + /** + * Connects microservice to the NestApplication instance. Transforms application + * to a hybrid instance. + * + * @template {object} T + * @param {T} options Microservice options object + * @param {NestHybridApplicationOptions} hybridOptions Hybrid options object + * @returns {INestMicroservice} + */ + connectMicroservice(options: T, hybridOptions?: NestHybridApplicationOptions): INestMicroservice; + /** + * Returns array of the microservices connected to the NestApplication. + * + * @returns {INestMicroservice[]} + */ + getMicroservices(): INestMicroservice[]; + /** + * Returns the underlying native HTTP server. + * + * @returns {TServer} + */ + getHttpServer(): TServer; + /** + * Returns the underlying HTTP adapter. + * + * @returns {HttpServer} + */ + getHttpAdapter(): HttpServer; + /** + * Starts all connected microservices asynchronously. + * + * @returns {Promise} + */ + startAllMicroservices(): Promise; + /** + * Registers exception filters as global filters (will be used within + * every HTTP route handler) + * + * @param {...ExceptionFilter} filters + */ + useGlobalFilters(...filters: ExceptionFilter[]): this; + /** + * Registers pipes as global pipes (will be used within every HTTP route handler) + * + * @param {...PipeTransform} pipes + */ + useGlobalPipes(...pipes: PipeTransform[]): this; + /** + * Registers interceptors as global interceptors (will be used within + * every HTTP route handler) + * + * @param {...NestInterceptor} interceptors + */ + useGlobalInterceptors(...interceptors: NestInterceptor[]): this; + /** + * Registers guards as global guards (will be used within every HTTP route handler) + * + * @param {...CanActivate} guards + */ + useGlobalGuards(...guards: CanActivate[]): this; + /** + * Terminates the application (including NestApplication, Gateways, and each connected + * microservice) + * + * @returns {Promise} + */ + close(): Promise; +} diff --git a/node_modules/@nestjs/common/interfaces/nest-application.interface.js b/node_modules/@nestjs/common/interfaces/nest-application.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/nest-application.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/interfaces/nest-microservice.interface.d.ts b/node_modules/@nestjs/common/interfaces/nest-microservice.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1b4e3439fb32aa8b45b04c7fc4b0a2f0039ba3a8 --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/nest-microservice.interface.d.ts @@ -0,0 +1,75 @@ +import { Observable } from 'rxjs'; +import { ExceptionFilter } from './exceptions/exception-filter.interface'; +import { CanActivate } from './features/can-activate.interface'; +import { NestInterceptor } from './features/nest-interceptor.interface'; +import { PipeTransform } from './features/pipe-transform.interface'; +import { INestApplicationContext } from './nest-application-context.interface'; +import { WebSocketAdapter } from './websockets/web-socket-adapter.interface'; +/** + * Interface describing Microservice Context. + * + * @publicApi + */ +export interface INestMicroservice extends INestApplicationContext { + /** + * Starts the microservice. + * + * @returns {void} + */ + listen(): Promise; + /** + * Registers a web socket adapter that will be used for Gateways. + * Use to override the default `socket.io` library. + * + * @param {WebSocketAdapter} adapter + * @returns {this} + */ + useWebSocketAdapter(adapter: WebSocketAdapter): this; + /** + * Registers global exception filters (will be used for every pattern handler). + * + * @param {...ExceptionFilter} filters + */ + useGlobalFilters(...filters: ExceptionFilter[]): this; + /** + * Registers global pipes (will be used for every pattern handler). + * + * @param {...PipeTransform} pipes + */ + useGlobalPipes(...pipes: PipeTransform[]): this; + /** + * Registers global interceptors (will be used for every pattern handler). + * + * @param {...NestInterceptor} interceptors + */ + useGlobalInterceptors(...interceptors: NestInterceptor[]): this; + /** + * Registers global guards (will be used for every pattern handler). + * + * @param {...CanActivate} guards + */ + useGlobalGuards(...guards: CanActivate[]): this; + /** + * Terminates the application. + * + * @returns {Promise} + */ + close(): Promise; + /** + * Returns an observable that emits status changes. + * + * @returns {Observable} + */ + status: Observable; + /** + * Registers an event listener for the given event. + * @param event Event name + * @param callback Callback to be executed when the event is emitted + */ + on = Record, EventKey extends keyof EventsMap = keyof EventsMap, EventCallback extends EventsMap[EventKey] = EventsMap[EventKey]>(event: EventKey, callback: EventCallback): void; + /** + * Returns an instance of the underlying server/broker instance, + * or a group of servers if there are more than one. + */ + unwrap(): T; +} diff --git a/node_modules/@nestjs/common/interfaces/nest-microservice.interface.js b/node_modules/@nestjs/common/interfaces/nest-microservice.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/nest-microservice.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/interfaces/router-options.interface.d.ts b/node_modules/@nestjs/common/interfaces/router-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..de2f4af4a60497ce6b608410c4fc8b9a89317b40 --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/router-options.interface.d.ts @@ -0,0 +1,28 @@ +/** + * Severity level applied to a single kind of route conflict detected at + * bootstrap. + * + * @publicApi + */ +export type RouteConflictPolicyLevel = 'off' | 'warn' | 'error'; +/** + * Per-kind policy for overlapping routes detected at bootstrap. + * `duplicate` covers identical (method, path, host, version) registrations. + * `shadow` covers patterns that can match the same request (for example + * `/users/me` vs `/users/:id`). Each kind defaults to `'off'`. + * + * @publicApi + */ +export interface RouteConflictPolicy { + duplicate?: RouteConflictPolicyLevel; + shadow?: RouteConflictPolicyLevel; +} +/** + * Order in which routes are registered on the underlying HTTP adapter. + * `'specificity'` registers literal segments before parametric and + * wildcard ones on order-sensitive adapters (such as Express). Defaults + * to `'declaration'`. + * + * @publicApi + */ +export type RouteResolutionStrategy = 'declaration' | 'specificity'; diff --git a/node_modules/@nestjs/common/interfaces/router-options.interface.js b/node_modules/@nestjs/common/interfaces/router-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/router-options.interface.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@nestjs/common/interfaces/scope-options.interface.d.ts b/node_modules/@nestjs/common/interfaces/scope-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2305f467117abdcc530a9719ec49b3bddda36db7 --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/scope-options.interface.d.ts @@ -0,0 +1,37 @@ +/** + * @publicApi + */ +export declare enum Scope { + /** + * The provider can be shared across multiple classes. The provider lifetime + * is strictly tied to the application lifecycle. Once the application has + * bootstrapped, all providers have been instantiated. + */ + DEFAULT = 0, + /** + * A new private instance of the provider is instantiated for every use + */ + TRANSIENT = 1, + /** + * A new instance is instantiated for each request processing pipeline + */ + REQUEST = 2 +} +/** + * @publicApi + * + * @see [Injection Scopes](https://docs.nestjs.com/fundamentals/injection-scopes) + */ +export interface ScopeOptions { + /** + * Specifies the lifetime of an injected Provider or Controller. + */ + scope?: Scope; + /** + * Flags provider as durable. This flag can be used in combination with custom context id + * factory strategy to construct lazy DI subtrees. + * + * This flag can be used only in conjunction with scope = Scope.REQUEST. + */ + durable?: boolean; +} diff --git a/node_modules/@nestjs/common/interfaces/scope-options.interface.js b/node_modules/@nestjs/common/interfaces/scope-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..bb16590ea3d1a93d492638e7ea19098b1292705e --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/scope-options.interface.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Scope = void 0; +/** + * @publicApi + */ +var Scope; +(function (Scope) { + /** + * The provider can be shared across multiple classes. The provider lifetime + * is strictly tied to the application lifecycle. Once the application has + * bootstrapped, all providers have been instantiated. + */ + Scope[Scope["DEFAULT"] = 0] = "DEFAULT"; + /** + * A new private instance of the provider is instantiated for every use + */ + Scope[Scope["TRANSIENT"] = 1] = "TRANSIENT"; + /** + * A new instance is instantiated for each request processing pipeline + */ + Scope[Scope["REQUEST"] = 2] = "REQUEST"; +})(Scope || (exports.Scope = Scope = {})); diff --git a/node_modules/@nestjs/common/interfaces/shutdown-hooks-options.interface.d.ts b/node_modules/@nestjs/common/interfaces/shutdown-hooks-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6629a5d0d3aad75f73420679b7e046274f3feb7b --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/shutdown-hooks-options.interface.d.ts @@ -0,0 +1,21 @@ +/** + * Options for configuring shutdown hooks behavior. + * + * @publicApi + */ +export interface ShutdownHooksOptions { + /** + * If true, uses `process.exit()` instead of `process.kill(process.pid, signal)` + * after shutdown hooks complete. This ensures the 'exit' event is properly + * triggered, which is required for async loggers (like Pino with transports) + * to flush their buffers before the process terminates. + * + * Note: Using `process.exit()` will: + * - Change the exit code (e.g., SIGTERM: 143 → 0) + * - May not trigger other signal handlers from third-party libraries + * - May affect orchestrator (Kubernetes, Docker) behavior + * + * @default false + */ + useProcessExit?: boolean; +} diff --git a/node_modules/@nestjs/common/interfaces/shutdown-hooks-options.interface.js b/node_modules/@nestjs/common/interfaces/shutdown-hooks-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/shutdown-hooks-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/interfaces/type.interface.d.ts b/node_modules/@nestjs/common/interfaces/type.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c04ad1946878ef7d69399f690c21bda73a79fe21 --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/type.interface.d.ts @@ -0,0 +1,3 @@ +export interface Type extends Function { + new (...args: any[]): T; +} diff --git a/node_modules/@nestjs/common/interfaces/type.interface.js b/node_modules/@nestjs/common/interfaces/type.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/type.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/interfaces/version-options.interface.d.ts b/node_modules/@nestjs/common/interfaces/version-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e04a15545a809c0b28a64ff87de4de88cbbbd89 --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/version-options.interface.d.ts @@ -0,0 +1,92 @@ +import { VersioningType } from '../enums/version-type.enum'; +/** + * Indicates that this will work for any version passed in the request, or no version. + * + * @publicApi + */ +export declare const VERSION_NEUTRAL: unique symbol; +/** + * @publicApi + */ +export type VersionValue = string | typeof VERSION_NEUTRAL | Array; +/** + * @publicApi + */ +export interface VersionOptions { + /** + * Specifies an optional API Version. When configured, methods + * within the controller will only be routed if the request version + * matches the specified value. + * + * Supported only by HTTP-based applications (does not apply to non-HTTP microservices). + * + * @see [Versioning](https://docs.nestjs.com/techniques/versioning) + */ + version?: VersionValue; +} +/** + * @publicApi + */ +export interface HeaderVersioningOptions { + type: VersioningType.HEADER; + /** + * The name of the Request Header that contains the version. + */ + header: string; +} +/** + * @publicApi + */ +export interface UriVersioningOptions { + type: VersioningType.URI; + /** + * Optional prefix that will prepend the version within the URI. + * + * Defaults to `v`. + * + * Ex. Assuming a version of `1`, for `/api/v1/route`, `v` is the prefix. + */ + prefix?: string | false; +} +/** + * @publicApi + */ +export interface MediaTypeVersioningOptions { + type: VersioningType.MEDIA_TYPE; + /** + * The key within the Media Type Header to determine the version from. + * + * Ex. For `application/json;v=1`, the key is `v=`. + */ + key: string; +} +/** + * @publicApi + */ +export interface CustomVersioningOptions { + type: VersioningType.CUSTOM; + /** + * A function that accepts a request object (specific to the underlying platform, ie Express or Fastify) + * and returns a single version value or an ordered array of versions, in order from HIGHEST to LOWEST. + * + * Ex. Returned version array = ['3.1', '3.0', '2.5', '2', '1.9'] + * + * Use type assertion or narrowing to identify the specific request type. + */ + extractor: (request: unknown) => string | string[]; +} +/** + * @publicApi + */ +interface VersioningCommonOptions { + /** + * The default version to be used as a fallback when you did not provide some + * version to `@Controller()` nor `@Version()`. + */ + defaultVersion?: VersionOptions['version']; +} +/** + * @publicApi + */ +export type VersioningOptions = VersioningCommonOptions & (HeaderVersioningOptions | UriVersioningOptions | MediaTypeVersioningOptions | CustomVersioningOptions); +export {}; diff --git a/node_modules/@nestjs/common/interfaces/version-options.interface.js b/node_modules/@nestjs/common/interfaces/version-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..f801cafe6c4cc855750eaa4a864d162058ab550b --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/version-options.interface.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VERSION_NEUTRAL = void 0; +/** + * Indicates that this will work for any version passed in the request, or no version. + * + * @publicApi + */ +exports.VERSION_NEUTRAL = Symbol('VERSION_NEUTRAL'); diff --git a/node_modules/@nestjs/common/interfaces/websockets/web-socket-adapter.interface.d.ts b/node_modules/@nestjs/common/interfaces/websockets/web-socket-adapter.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5724d50138d1013bdbe398c03b61be4a4654a622 --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/websockets/web-socket-adapter.interface.d.ts @@ -0,0 +1,19 @@ +import { Observable } from 'rxjs'; +/** + * @publicApi + */ +export interface WsMessageHandler { + message: T; + callback: (...args: any[]) => Observable | Promise; + isAckHandledManually: boolean; +} +/** + * @publicApi + */ +export interface WebSocketAdapter { + create(port: number, options?: TOptions): TServer; + bindClientConnect(server: TServer, callback: Function): any; + bindClientDisconnect?(client: TClient, callback: Function): any; + bindMessageHandlers(client: TClient, handlers: WsMessageHandler[], transform: (data: any) => Observable): any; + close(server: TServer): any; +} diff --git a/node_modules/@nestjs/common/interfaces/websockets/web-socket-adapter.interface.js b/node_modules/@nestjs/common/interfaces/websockets/web-socket-adapter.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/interfaces/websockets/web-socket-adapter.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/internal.d.ts b/node_modules/@nestjs/common/internal.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bc49bb3744fabb646993052765e747fa2ad49d5e --- /dev/null +++ b/node_modules/@nestjs/common/internal.d.ts @@ -0,0 +1,30 @@ +/** + * Internal module - not part of the public API. + * These exports are used by sibling @nestjs packages. + * Do not depend on these in your application code. + * @internal + * @module + */ +export * from './constants.js'; +export { RouteParamtypes } from './enums/route-paramtypes.enum.js'; +export * from './utils/shared.utils.js'; +export * from './utils/load-package.util.js'; +export * from './utils/cli-colors.util.js'; +export * from './utils/random-string-generator.util.js'; +export * from './utils/select-exception-filter-metadata.util.js'; +export type { Controller, Injectable } from './interfaces/index.js'; +export type { NestApplicationContextOptions } from './interfaces/nest-application-context-options.interface.js'; +export type { NestMicroserviceOptions } from './interfaces/microservices/nest-microservice-options.interface.js'; +export type { CorsOptions, CorsOptionsDelegate, CustomOrigin, } from './interfaces/external/cors-options.interface.js'; +export type { ExceptionFilterMetadata } from './interfaces/exceptions/exception-filter-metadata.interface.js'; +export type { RpcExceptionFilterMetadata } from './interfaces/exceptions/rpc-exception-filter-metadata.interface.js'; +export type { VersionValue } from './interfaces/version-options.interface.js'; +export type { GlobalPrefixOptions } from './interfaces/global-prefix-options.interface.js'; +export type { MiddlewareConfiguration, RouteInfo, } from './interfaces/middleware/middleware-configuration.interface.js'; +export type { MiddlewareConfigProxy } from './interfaces/middleware/middleware-config-proxy.interface.js'; +export type { ModuleMetadata } from './interfaces/modules/module-metadata.interface.js'; +export type { HttpArgumentsHost, RpcArgumentsHost, WsArgumentsHost, } from './interfaces/features/arguments-host.interface.js'; +export type { RequestHandler } from './interfaces/http/http-server.interface.js'; +export type { GetOrResolveOptions, SelectOptions, } from './interfaces/nest-application-context.interface.js'; +export type { ShutdownHooksOptions } from './interfaces/shutdown-hooks-options.interface.js'; +export { assignMetadata } from './decorators/http/route-params.decorator.js'; diff --git a/node_modules/@nestjs/common/internal.js b/node_modules/@nestjs/common/internal.js new file mode 100644 index 0000000000000000000000000000000000000000..0904c94a042795bf6c7f1e9d210f37eaf8a4f943 --- /dev/null +++ b/node_modules/@nestjs/common/internal.js @@ -0,0 +1,19 @@ +/** + * Internal module - not part of the public API. + * These exports are used by sibling @nestjs packages. + * Do not depend on these in your application code. + * @internal + * @module + */ +// Constants +export * from './constants.js'; +// Enums (internal) +export { RouteParamtypes } from './enums/route-paramtypes.enum.js'; +// Utils +export * from './utils/shared.utils.js'; +export * from './utils/load-package.util.js'; +export * from './utils/cli-colors.util.js'; +export * from './utils/random-string-generator.util.js'; +export * from './utils/select-exception-filter-metadata.util.js'; +// Decorators (internal) +export { assignMetadata } from './decorators/http/route-params.decorator.js'; diff --git a/node_modules/@nestjs/common/module-utils/configurable-module.builder.d.ts b/node_modules/@nestjs/common/module-utils/configurable-module.builder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97691540b5a084e8b463a9782fcf226b2b69ee60 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/configurable-module.builder.d.ts @@ -0,0 +1,93 @@ +import { DynamicModule } from '../interfaces'; +import { Logger } from '../services/logger.service'; +import { DEFAULT_FACTORY_CLASS_METHOD_KEY, DEFAULT_METHOD_KEY } from './constants'; +import { ConfigurableModuleHost } from './interfaces'; +/** + * @publicApi + */ +export interface ConfigurableModuleBuilderOptions { + /** + * Specifies what injection token should be used for the module options provider. + * By default, an auto-generated UUID will be used. + */ + optionsInjectionToken?: string | symbol; + /** + * By default, an UUID will be used as a module options provider token. + * Explicitly specifying the "moduleName" will instruct the "ConfigurableModuleBuilder" + * to use a more descriptive provider token. + * + * For example, `moduleName: "Cache"` will auto-generate the provider token: "CACHE_MODULE_OPTIONS". + */ + moduleName?: string; + /** + * Indicates whether module should always be "transient" - meaning, + * every time you call the static method to construct a dynamic module, + * regardless of what arguments you pass in, a new "unique" module will be created. + * + * @default false + */ + alwaysTransient?: boolean; +} +/** + * Factory that lets you create configurable modules and + * provides a way to reduce the majority of dynamic module boilerplate. + * + * @publicApi + */ +export declare class ConfigurableModuleBuilder { + protected readonly options: ConfigurableModuleBuilderOptions; + protected staticMethodKey: StaticMethodKey; + protected factoryClassMethodKey: FactoryClassMethodKey; + protected extras: ExtraModuleDefinitionOptions; + protected transformModuleDefinition: (definition: DynamicModule, extraOptions: ExtraModuleDefinitionOptions) => DynamicModule; + protected readonly logger: Logger; + constructor(options?: ConfigurableModuleBuilderOptions, parentBuilder?: ConfigurableModuleBuilder); + /** + * Registers the "extras" object (a set of extra options that can be used to modify the dynamic module definition). + * Values you specify within the "extras" object will be used as default values (that can be overridden by module consumers). + * + * This method also applies the so-called "module definition transform function" that takes the auto-generated + * dynamic module object ("DynamicModule") and the actual consumer "extras" object as input parameters. + * The "extras" object consists of values explicitly specified by module consumers and default values. + * + * @example + * ```typescript + * .setExtras<{ isGlobal?: boolean }>({ isGlobal: false }, (definition, extras) => + * ({ ...definition, global: extras.isGlobal }) + * ) + * ``` + */ + setExtras(extras: ExtraModuleDefinitionOptions, transformDefinition?: (definition: DynamicModule, extras: ExtraModuleDefinitionOptions) => DynamicModule): ConfigurableModuleBuilder; + /** + * Dynamic modules must expose public static methods that let you pass in + * configuration parameters (control the module's behavior from the outside). + * Some frequently used names that you may have seen in other modules are: + * "forRoot", "forFeature", "register", "configure". + * + * This method "setClassMethodName" lets you specify the name of the + * method that will be auto-generated. + * + * @param key name of the method + */ + setClassMethodName(key: StaticMethodKey): ConfigurableModuleBuilder; + /** + * Asynchronously configured modules (that rely on other modules, i.e. "ConfigModule") + * let you pass the configuration factory class that will be registered and instantiated as a provider. + * This provider then will be used to retrieve the module's configuration. To provide the configuration, + * the corresponding factory method must be implemented. + * + * This method ("setFactoryMethodName") lets you control what method name will have to be + * implemented by the config factory (default is "create"). + * + * @param key name of the method + */ + setFactoryMethodName(key: FactoryClassMethodKey): ConfigurableModuleBuilder; + /** + * Returns an object consisting of multiple properties that lets you + * easily construct dynamic configurable modules. See "ConfigurableModuleHost" interface for more details. + */ + build(): ConfigurableModuleHost; + private constructInjectionTokenString; + private createConfigurableModuleCls; + private createTypeProxy; +} diff --git a/node_modules/@nestjs/common/module-utils/configurable-module.builder.js b/node_modules/@nestjs/common/module-utils/configurable-module.builder.js new file mode 100644 index 0000000000000000000000000000000000000000..136bfd451a87091cc7a04a8c322263e873f4d0b9 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/configurable-module.builder.js @@ -0,0 +1,219 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConfigurableModuleBuilder = void 0; +const logger_service_1 = require("../services/logger.service"); +const random_string_generator_util_1 = require("../utils/random-string-generator.util"); +const constants_1 = require("./constants"); +const utils_1 = require("./utils"); +/** + * Factory that lets you create configurable modules and + * provides a way to reduce the majority of dynamic module boilerplate. + * + * @publicApi + */ +class ConfigurableModuleBuilder { + constructor(options = {}, parentBuilder) { + this.options = options; + this.logger = new logger_service_1.Logger(ConfigurableModuleBuilder.name); + if (parentBuilder) { + this.staticMethodKey = parentBuilder.staticMethodKey; + this.factoryClassMethodKey = + parentBuilder.factoryClassMethodKey; + this.transformModuleDefinition = + parentBuilder.transformModuleDefinition; + this.extras = parentBuilder.extras; + } + } + /** + * Registers the "extras" object (a set of extra options that can be used to modify the dynamic module definition). + * Values you specify within the "extras" object will be used as default values (that can be overridden by module consumers). + * + * This method also applies the so-called "module definition transform function" that takes the auto-generated + * dynamic module object ("DynamicModule") and the actual consumer "extras" object as input parameters. + * The "extras" object consists of values explicitly specified by module consumers and default values. + * + * @example + * ```typescript + * .setExtras<{ isGlobal?: boolean }>({ isGlobal: false }, (definition, extras) => + * ({ ...definition, global: extras.isGlobal }) + * ) + * ``` + */ + setExtras(extras, transformDefinition = def => def) { + const builder = new ConfigurableModuleBuilder(this.options, this); + builder.extras = extras; + builder.transformModuleDefinition = transformDefinition; + return builder; + } + /** + * Dynamic modules must expose public static methods that let you pass in + * configuration parameters (control the module's behavior from the outside). + * Some frequently used names that you may have seen in other modules are: + * "forRoot", "forFeature", "register", "configure". + * + * This method "setClassMethodName" lets you specify the name of the + * method that will be auto-generated. + * + * @param key name of the method + */ + setClassMethodName(key) { + const builder = new ConfigurableModuleBuilder(this.options, this); + builder.staticMethodKey = key; + return builder; + } + /** + * Asynchronously configured modules (that rely on other modules, i.e. "ConfigModule") + * let you pass the configuration factory class that will be registered and instantiated as a provider. + * This provider then will be used to retrieve the module's configuration. To provide the configuration, + * the corresponding factory method must be implemented. + * + * This method ("setFactoryMethodName") lets you control what method name will have to be + * implemented by the config factory (default is "create"). + * + * @param key name of the method + */ + setFactoryMethodName(key) { + const builder = new ConfigurableModuleBuilder(this.options, this); + builder.factoryClassMethodKey = key; + return builder; + } + /** + * Returns an object consisting of multiple properties that lets you + * easily construct dynamic configurable modules. See "ConfigurableModuleHost" interface for more details. + */ + build() { + this.staticMethodKey ??= constants_1.DEFAULT_METHOD_KEY; + this.factoryClassMethodKey ??= + constants_1.DEFAULT_FACTORY_CLASS_METHOD_KEY; + this.options.optionsInjectionToken ??= this.options.moduleName + ? this.constructInjectionTokenString() + : (0, utils_1.generateOptionsInjectionToken)(); + this.transformModuleDefinition ??= definition => definition; + return { + ConfigurableModuleClass: this.createConfigurableModuleCls(), + MODULE_OPTIONS_TOKEN: this.options.optionsInjectionToken, + ASYNC_OPTIONS_TYPE: this.createTypeProxy('ASYNC_OPTIONS_TYPE'), + OPTIONS_TYPE: this.createTypeProxy('OPTIONS_TYPE'), + }; + } + constructInjectionTokenString() { + const moduleNameInSnakeCase = this.options + .moduleName.trim() + .split(/(?=[A-Z])/) + .join('_') + .toUpperCase(); + return `${moduleNameInSnakeCase}_MODULE_OPTIONS`; + } + createConfigurableModuleCls() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this; + const asyncMethodKey = this.staticMethodKey + constants_1.ASYNC_METHOD_SUFFIX; + class InternalModuleClass { + static [self.staticMethodKey](options) { + const providers = [ + { + provide: self.options.optionsInjectionToken, + useValue: this.omitExtras(options, self.extras), + }, + ]; + if (self.options.alwaysTransient) { + providers.push({ + provide: constants_1.CONFIGURABLE_MODULE_ID, + useValue: (0, random_string_generator_util_1.randomStringGenerator)(), + }); + } + return self.transformModuleDefinition({ + module: this, + providers, + }, { + ...self.extras, + ...options, + }); + } + static [asyncMethodKey](options) { + const providers = this.createAsyncProviders(options); + if (self.options.alwaysTransient) { + providers.push({ + provide: constants_1.CONFIGURABLE_MODULE_ID, + useValue: (0, random_string_generator_util_1.randomStringGenerator)(), + }); + } + return self.transformModuleDefinition({ + module: this, + imports: options.imports || [], + providers, + }, { + ...self.extras, + ...this.extractExtrasFromAsyncOptions(options, self.extras), + }); + } + static omitExtras(input, extras) { + if (!extras) { + return input; + } + const moduleOptions = {}; + const extrasKeys = Object.keys(extras); + Object.keys(input) + .filter(key => !extrasKeys.includes(key)) + .forEach(key => { + moduleOptions[key] = input[key]; + }); + return moduleOptions; + } + static extractExtrasFromAsyncOptions(input, extras) { + if (!extras) { + return {}; + } + const extrasOptions = {}; + Object.keys(input) + .filter(key => !constants_1.ASYNC_OPTIONS_METADATA_KEYS.includes(key)) + .forEach(key => { + extrasOptions[key] = input[key]; + }); + return extrasOptions; + } + static createAsyncProviders(options) { + if (options.useExisting || options.useFactory) { + if (options.inject && options.provideInjectionTokensFrom) { + return [ + this.createAsyncOptionsProvider(options), + ...(0, utils_1.getInjectionProviders)(options.provideInjectionTokensFrom, options.inject), + ]; + } + return [this.createAsyncOptionsProvider(options)]; + } + return [ + this.createAsyncOptionsProvider(options), + { + provide: options.useClass, + useClass: options.useClass, + }, + ]; + } + static createAsyncOptionsProvider(options) { + if (options.useFactory) { + return { + provide: self.options.optionsInjectionToken, + useFactory: options.useFactory, + inject: options.inject || [], + }; + } + return { + provide: self.options.optionsInjectionToken, + useFactory: async (optionsFactory) => await optionsFactory[self.factoryClassMethodKey](), + inject: [options.useExisting || options.useClass], + }; + } + } + return InternalModuleClass; + } + createTypeProxy(typeName) { + const proxy = new Proxy({}, { + get: () => { + throw new Error(`"${typeName}" is not supposed to be used as a value.`); + }, + }); + return proxy; + } +} +exports.ConfigurableModuleBuilder = ConfigurableModuleBuilder; diff --git a/node_modules/@nestjs/common/module-utils/constants.d.ts b/node_modules/@nestjs/common/module-utils/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a81f627f667e75421f89179d229e1bc96c27c964 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/constants.d.ts @@ -0,0 +1,9 @@ +export declare const DEFAULT_METHOD_KEY = "register"; +export declare const DEFAULT_FACTORY_CLASS_METHOD_KEY = "create"; +export declare const ASYNC_METHOD_SUFFIX = "Async"; +export declare const CONFIGURABLE_MODULE_ID = "CONFIGURABLE_MODULE_ID"; +/** + * List of keys that are specific to ConfigurableModuleAsyncOptions + * and should be excluded when extracting user-defined extras. + */ +export declare const ASYNC_OPTIONS_METADATA_KEYS: readonly ["useFactory", "useClass", "useExisting", "inject", "imports", "provideInjectionTokensFrom"]; diff --git a/node_modules/@nestjs/common/module-utils/constants.js b/node_modules/@nestjs/common/module-utils/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..453b267d8af7171a92b55c142281f5ef81680f17 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/constants.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ASYNC_OPTIONS_METADATA_KEYS = exports.CONFIGURABLE_MODULE_ID = exports.ASYNC_METHOD_SUFFIX = exports.DEFAULT_FACTORY_CLASS_METHOD_KEY = exports.DEFAULT_METHOD_KEY = void 0; +exports.DEFAULT_METHOD_KEY = 'register'; +exports.DEFAULT_FACTORY_CLASS_METHOD_KEY = 'create'; +exports.ASYNC_METHOD_SUFFIX = 'Async'; +exports.CONFIGURABLE_MODULE_ID = 'CONFIGURABLE_MODULE_ID'; +/** + * List of keys that are specific to ConfigurableModuleAsyncOptions + * and should be excluded when extracting user-defined extras. + */ +exports.ASYNC_OPTIONS_METADATA_KEYS = [ + 'useFactory', + 'useClass', + 'useExisting', + 'inject', + 'imports', + 'provideInjectionTokensFrom', +]; diff --git a/node_modules/@nestjs/common/module-utils/index.d.ts b/node_modules/@nestjs/common/module-utils/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4393992bd154dd0a72a7084890f8dab708442fe0 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/index.d.ts @@ -0,0 +1,2 @@ +export * from './configurable-module.builder'; +export * from './interfaces'; diff --git a/node_modules/@nestjs/common/module-utils/index.js b/node_modules/@nestjs/common/module-utils/index.js new file mode 100644 index 0000000000000000000000000000000000000000..be437f637cd06b532ebded8dc3cf001286f4b927 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./configurable-module.builder"), exports); +tslib_1.__exportStar(require("./interfaces"), exports); diff --git a/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-async-options.interface.d.ts b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-async-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5ae5fef9093e6e075a3c25fdedf445e9203c48e5 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-async-options.interface.d.ts @@ -0,0 +1,42 @@ +import { FactoryProvider, ModuleMetadata, Provider, Type } from '../../interfaces'; +import { DEFAULT_FACTORY_CLASS_METHOD_KEY } from '../constants'; +/** + * Interface that must be implemented by the module options factory class. + * Method key varies depending on the "FactoryClassMethodKey" type argument. + * + * @publicApi + */ +export type ConfigurableModuleOptionsFactory = Record<`${FactoryClassMethodKey}`, () => Promise | ModuleOptions>; +/** + * Interface that represents the module async options object + * Factory method name varies depending on the "FactoryClassMethodKey" type argument. + * + * @publicApi + */ +export interface ConfigurableModuleAsyncOptions extends Pick { + /** + * Injection token resolving to an existing provider. The provider must implement + * the corresponding interface. + */ + useExisting?: Type>; + /** + * Injection token resolving to a class that will be instantiated as a provider. + * The class must implement the corresponding interface. + */ + useClass?: Type>; + /** + * Function returning options (or a Promise resolving to options) to configure the + * module. + */ + useFactory?: (...args: any[]) => Promise | ModuleOptions; + /** + * Dependencies that a Factory may inject. + */ + inject?: FactoryProvider['inject']; + /** + * List of parent module's providers that will be filtered to only provide necessary + * providers for the 'inject' array + * useful to pass options to nested async modules + */ + provideInjectionTokensFrom?: Provider[]; +} diff --git a/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-async-options.interface.js b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-async-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-async-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-cls.interface.d.ts b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-cls.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a53bda3af0b4a762ee286c35826f94ccc5f2d88b --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-cls.interface.d.ts @@ -0,0 +1,13 @@ +import { DynamicModule } from '../../interfaces'; +import { DEFAULT_FACTORY_CLASS_METHOD_KEY, DEFAULT_METHOD_KEY } from '../constants'; +import { ConfigurableModuleAsyncOptions } from './configurable-module-async-options.interface'; +/** + * Class that represents a blueprint/prototype for a configurable Nest module. + * This class provides static methods for constructing dynamic modules. Their names + * can be controlled through the "MethodKey" type argument. + * + * @publicApi + */ +export type ConfigurableModuleCls = { + new (): any; +} & Record<`${MethodKey}`, (options: ModuleOptions & Partial) => DynamicModule> & Record<`${MethodKey}Async`, (options: ConfigurableModuleAsyncOptions & Partial) => DynamicModule>; diff --git a/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-cls.interface.js b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-cls.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-cls.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-host.interface.d.ts b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-host.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..564b3de4d7e4d21551badaab97ef0f4ac20684bc --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-host.interface.d.ts @@ -0,0 +1,62 @@ +import { ConfigurableModuleAsyncOptions } from './configurable-module-async-options.interface'; +import { ConfigurableModuleCls } from './configurable-module-cls.interface'; +/** + * Configurable module host. See properties for more details + * + * @publicApi + */ +export interface ConfigurableModuleHost, MethodKey extends string = string, FactoryClassMethodKey extends string = string, ExtraModuleDefinitionOptions = {}> { + /** + * Class that represents a blueprint/prototype for a configurable Nest module. + * This class provides static methods for constructing dynamic modules. Their names + * can be controlled through the "MethodKey" type argument. + * + * Your module class should inherit from this class to make the static methods available. + * + * @example + * ```typescript + * @Module({}) + * class IntegrationModule extends ConfigurableModuleCls { + * // ... + * } + * ``` + */ + ConfigurableModuleClass: ConfigurableModuleCls; + /** + * Module options provider token. Can be used to inject the "options object" to + * providers registered within the host module. + */ + MODULE_OPTIONS_TOKEN: string | symbol; + /** + * Can be used to auto-infer the compound "async module options" type. + * Note: this property is not supposed to be used as a value. + * + * @example + * ```typescript + * @Module({}) + * class IntegrationModule extends ConfigurableModuleCls { + * static module = initializer(IntegrationModule); + * + * static registerAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule { + * return super.registerAsync(options); + * } + * ``` + */ + ASYNC_OPTIONS_TYPE: ConfigurableModuleAsyncOptions & Partial; + /** + * Can be used to auto-infer the compound "module options" type (options interface + extra module definition options). + * Note: this property is not supposed to be used as a value. + * + * @example + * ```typescript + * @Module({}) + * class IntegrationModule extends ConfigurableModuleCls { + * static module = initializer(IntegrationModule); + * + * static register(options: typeof OPTIONS_TYPE): DynamicModule { + * return super.register(options); + * } + * ``` + */ + OPTIONS_TYPE: ModuleOptions & Partial; +} diff --git a/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-host.interface.js b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-host.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/interfaces/configurable-module-host.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/module-utils/interfaces/index.d.ts b/node_modules/@nestjs/common/module-utils/interfaces/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..35c5230763868b08fb82fb64fff6be7f44a4e948 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/interfaces/index.d.ts @@ -0,0 +1,3 @@ +export * from './configurable-module-async-options.interface'; +export * from './configurable-module-cls.interface'; +export * from './configurable-module-host.interface'; diff --git a/node_modules/@nestjs/common/module-utils/interfaces/index.js b/node_modules/@nestjs/common/module-utils/interfaces/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f030ac6cc8b61f70395f5fbe8cb3c149ea34030e --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/interfaces/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./configurable-module-async-options.interface"), exports); +tslib_1.__exportStar(require("./configurable-module-cls.interface"), exports); +tslib_1.__exportStar(require("./configurable-module-host.interface"), exports); diff --git a/node_modules/@nestjs/common/module-utils/utils/generate-options-injection-token.util.d.ts b/node_modules/@nestjs/common/module-utils/utils/generate-options-injection-token.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..309890c379b1ed16eda928d79a840bd283c60771 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/utils/generate-options-injection-token.util.d.ts @@ -0,0 +1 @@ +export declare function generateOptionsInjectionToken(): string; diff --git a/node_modules/@nestjs/common/module-utils/utils/generate-options-injection-token.util.js b/node_modules/@nestjs/common/module-utils/utils/generate-options-injection-token.util.js new file mode 100644 index 0000000000000000000000000000000000000000..bf4cc710c18f4d122204f48df6649e0cba8aa2f7 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/utils/generate-options-injection-token.util.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.generateOptionsInjectionToken = generateOptionsInjectionToken; +const random_string_generator_util_1 = require("../../utils/random-string-generator.util"); +function generateOptionsInjectionToken() { + const hash = (0, random_string_generator_util_1.randomStringGenerator)(); + return `CONFIGURABLE_MODULE_OPTIONS[${hash}]`; +} diff --git a/node_modules/@nestjs/common/module-utils/utils/get-injection-providers.util.d.ts b/node_modules/@nestjs/common/module-utils/utils/get-injection-providers.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2fd5479d8957dc478176f57480717460ba482038 --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/utils/get-injection-providers.util.d.ts @@ -0,0 +1,8 @@ +import { FactoryProvider, Provider } from '../../interfaces'; +/** + * + * @param providers List of a module's providers + * @param tokens Injection tokens needed for a useFactory function (usually the module's options' token) + * @returns All the providers needed for the tokens' injection (searched recursively) + */ +export declare function getInjectionProviders(providers: Provider[], tokens: FactoryProvider['inject']): Provider[]; diff --git a/node_modules/@nestjs/common/module-utils/utils/get-injection-providers.util.js b/node_modules/@nestjs/common/module-utils/utils/get-injection-providers.util.js new file mode 100644 index 0000000000000000000000000000000000000000..1069b1edec652240a238e2289afdccc32162802e --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/utils/get-injection-providers.util.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getInjectionProviders = getInjectionProviders; +const shared_utils_1 = require("../../utils/shared.utils"); +/** + * @param value + * @returns `true` if value is `OptionalFactoryDependency` + */ +function isOptionalFactoryDependency(value) { + return (!(0, shared_utils_1.isUndefined)(value.token) && + !(0, shared_utils_1.isUndefined)(value.optional) && + !value.prototype); +} +const mapInjectToTokens = (t) => isOptionalFactoryDependency(t) ? t.token : t; +/** + * + * @param providers List of a module's providers + * @param tokens Injection tokens needed for a useFactory function (usually the module's options' token) + * @returns All the providers needed for the tokens' injection (searched recursively) + */ +function getInjectionProviders(providers, tokens) { + const result = []; + let search = tokens.map(mapInjectToTokens); + while (search.length > 0) { + const match = (providers ?? []).filter(p => !result.includes(p) && // this prevents circular loops and duplication + (search.includes(p) || search.includes(p?.provide))); + result.push(...match); + // get injection tokens of the matched providers, if any + search = match + .filter(p => p?.inject) + .flatMap(p => p.inject) + .map(mapInjectToTokens); + } + return result; +} diff --git a/node_modules/@nestjs/common/module-utils/utils/index.d.ts b/node_modules/@nestjs/common/module-utils/utils/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7125be0f7483d24257206781ef1d3517617871fc --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/utils/index.d.ts @@ -0,0 +1,2 @@ +export * from './generate-options-injection-token.util'; +export * from './get-injection-providers.util'; diff --git a/node_modules/@nestjs/common/module-utils/utils/index.js b/node_modules/@nestjs/common/module-utils/utils/index.js new file mode 100644 index 0000000000000000000000000000000000000000..88efd09ef9e9575d484e8dda434ebefc06bc4c8e --- /dev/null +++ b/node_modules/@nestjs/common/module-utils/utils/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./generate-options-injection-token.util"), exports); +tslib_1.__exportStar(require("./get-injection-providers.util"), exports); diff --git a/node_modules/@nestjs/common/package.json b/node_modules/@nestjs/common/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b293afa559c2c572c6fe84713944d2bfb43d655f --- /dev/null +++ b/node_modules/@nestjs/common/package.json @@ -0,0 +1,42 @@ +{ + "name": "@nestjs/common", + "version": "11.1.27", + "description": "Nest - modern, fast, powerful node.js web framework (@common)", + "author": "Kamil Mysliwiec", + "homepage": "https://nestjs.com", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "repository": { + "type": "git", + "url": "https://github.com/nestjs/nest.git", + "directory": "packages/common" + }, + "publishConfig": { + "access": "public" + }, + "license": "MIT", + "dependencies": { + "file-type": "21.3.4", + "iterare": "1.2.1", + "load-esm": "1.0.3", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "peerDependencies": { + "class-transformer": ">=0.4.1", + "class-validator": ">=0.13.2", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "class-validator": { + "optional": true + }, + "class-transformer": { + "optional": true + } + }, + "gitHead": "660a1249e32e7701cdd7e5ccb20b7f695e721bce" +} diff --git a/node_modules/@nestjs/common/pipes/default-value.pipe.d.ts b/node_modules/@nestjs/common/pipes/default-value.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a4af7adc753430d504ca1bbae64d5bbaa0c92bcf --- /dev/null +++ b/node_modules/@nestjs/common/pipes/default-value.pipe.d.ts @@ -0,0 +1,13 @@ +import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface'; +/** + * Defines the built-in DefaultValue Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +export declare class DefaultValuePipe implements PipeTransform { + protected readonly defaultValue: R; + constructor(defaultValue: R); + transform(value?: T, _metadata?: ArgumentMetadata): T | R; +} diff --git a/node_modules/@nestjs/common/pipes/default-value.pipe.js b/node_modules/@nestjs/common/pipes/default-value.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..1c7eee9366599f5bae659a798d67d71205b68576 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/default-value.pipe.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DefaultValuePipe = void 0; +const tslib_1 = require("tslib"); +const injectable_decorator_1 = require("../decorators/core/injectable.decorator"); +const shared_utils_1 = require("../utils/shared.utils"); +/** + * Defines the built-in DefaultValue Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +let DefaultValuePipe = class DefaultValuePipe { + constructor(defaultValue) { + this.defaultValue = defaultValue; + } + transform(value, _metadata) { + if ((0, shared_utils_1.isNil)(value) || + ((0, shared_utils_1.isNumber)(value) && isNaN(value))) { + return this.defaultValue; + } + return value; + } +}; +exports.DefaultValuePipe = DefaultValuePipe; +exports.DefaultValuePipe = DefaultValuePipe = tslib_1.__decorate([ + (0, injectable_decorator_1.Injectable)(), + tslib_1.__metadata("design:paramtypes", [Object]) +], DefaultValuePipe); diff --git a/node_modules/@nestjs/common/pipes/file/file-type.validator.d.ts b/node_modules/@nestjs/common/pipes/file/file-type.validator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..96dbd7c6cf40a253654b1c7acfb2708b60679dfa --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/file-type.validator.d.ts @@ -0,0 +1,62 @@ +import { FileValidatorContext } from './file-validator-context.interface'; +import { FileValidator } from './file-validator.interface'; +import { IFile } from './interfaces'; +type FileTypeValidatorContext = FileValidatorContext>; +export type FileTypeValidatorOptions = { + /** + * Expected file type(s) for validation. Can be a string (MIME type) + * or a regular expression to match multiple types. + * + * @example + * // Match a single MIME type + * fileType: 'image/png' + * + * @example + * // Match multiple types using RegExp + * fileType: /^image\/(png|jpeg)$/ + */ + fileType: string | RegExp; + /** + * Custom error message displayed when file type validation fails + * Can be provided as a static string, or as a factory function + * that receives the validation context (file and validator configuration) + * and returns a dynamic error message. + * + * @example + * // Static message + * new FileTypeValidator({ fileType: 'image/png', errorMessage: 'Only PNG allowed' }) + * + * @example + * // Dynamic message based on file object and validator configuration + * new FileTypeValidator({ + * fileType: 'image/png', + * errorMessage: ctx => `Received file type '${ctx.file?.mimetype}', but expected '${ctx.config.fileType}'` + * }) + */ + errorMessage?: string | ((ctx: FileTypeValidatorContext) => string); + /** + * If `true`, the validator will skip the magic numbers validation. + * This can be useful when you can't identify some files as there are no common magic numbers available for some file types. + * @default false + */ + skipMagicNumbersValidation?: boolean; + /** + * If `true`, and magic number check fails, fallback to mimetype comparison. + * @default false + */ + fallbackToMimetype?: boolean; +}; +/** + * Defines the built-in FileTypeValidator. It validates incoming files by examining + * their magic numbers using the file-type package, providing more reliable file type validation + * than just checking the mimetype string. + * + * @see [File Validators](https://docs.nestjs.com/techniques/file-upload#validators) + * + * @publicApi + */ +export declare class FileTypeValidator extends FileValidator { + buildErrorMessage(file?: IFile): string; + isValid(file?: IFile): Promise; +} +export {}; diff --git a/node_modules/@nestjs/common/pipes/file/file-type.validator.js b/node_modules/@nestjs/common/pipes/file/file-type.validator.js new file mode 100644 index 0000000000000000000000000000000000000000..ff9d3cd3cd439a0575a3590d3f1475633fef5c7c --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/file-type.validator.js @@ -0,0 +1,114 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FileTypeValidator = void 0; +const url_1 = require("url"); +const logger_service_1 = require("../../services/logger.service"); +const file_validator_interface_1 = require("./file-validator.interface"); +const load_esm_1 = require("load-esm"); +const logger = new logger_service_1.Logger('FileTypeValidator'); +/** + * Defines the built-in FileTypeValidator. It validates incoming files by examining + * their magic numbers using the file-type package, providing more reliable file type validation + * than just checking the mimetype string. + * + * @see [File Validators](https://docs.nestjs.com/techniques/file-upload#validators) + * + * @publicApi + */ +class FileTypeValidator extends file_validator_interface_1.FileValidator { + buildErrorMessage(file) { + const { errorMessage, ...config } = this.validationOptions; + if (errorMessage) { + return typeof errorMessage === 'function' + ? errorMessage({ file, config }) + : errorMessage; + } + /** + * If the file buffer is not available, and fallbackToMimetype is not enabled, + * we cannot perform magic number validation, + * so we return a specific error message indicating + * that validation could not be performed due to missing buffer. + */ + if (file?.mimetype && + !file.buffer && + !this.validationOptions?.fallbackToMimetype && + !this.validationOptions?.skipMagicNumbersValidation) { + return `Validation failed (file buffer is not available; file type validation could not be performed; expected type is ${this.validationOptions.fileType})`; + } + if (file?.mimetype) { + const baseMessage = `Validation failed (current file type is ${file.mimetype}, expected type is ${this.validationOptions.fileType})`; + /** + * If fallbackToMimetype is enabled, this means the validator failed to detect the file type + * via magic number inspection (e.g. due to an unknown or too short buffer), + * and instead used the mimetype string provided by the client as a fallback. + * + * This message clarifies that fallback logic was used, in case users rely on file signatures. + */ + if (this.validationOptions.fallbackToMimetype) { + return `${baseMessage} - magic number detection failed, used mimetype fallback`; + } + return baseMessage; + } + return `Validation failed (expected type is ${this.validationOptions.fileType})`; + } + async isValid(file) { + if (!this.validationOptions) { + return true; + } + const isFileValid = !!file && 'mimetype' in file; + // Skip magic number validation if set + if (this.validationOptions.skipMagicNumbersValidation) { + return (isFileValid && !!file.mimetype.match(this.validationOptions.fileType)); + } + if (!isFileValid) + return false; + if (!file.buffer) { + if (this.validationOptions.fallbackToMimetype) { + return !!file.mimetype.match(this.validationOptions.fileType); + } + return false; + } + try { + let fileTypeModule; + try { + const resolvedPath = require.resolve('file-type'); + fileTypeModule = (0, url_1.pathToFileURL)(resolvedPath).href; + } + catch { + fileTypeModule = 'file-type'; + } + const { fileTypeFromBuffer } = await (0, load_esm_1.loadEsm)(fileTypeModule); + const fileType = await fileTypeFromBuffer(file.buffer); + if (fileType) { + // Match detected mime type against allowed type + return !!fileType.mime.match(this.validationOptions.fileType); + } + /** + * Fallback logic: If file-type cannot detect magic number (e.g. file too small), + * Optionally fall back to mimetype string for compatibility. + * This is useful for plain text, CSVs, or files without recognizable signatures. + */ + if (this.validationOptions.fallbackToMimetype) { + return !!file.mimetype.match(this.validationOptions.fileType); + } + return false; + } + catch (error) { + const errorMessage = error instanceof Error ? error.message : String(error); + // Check for common ESM loading issues + if (errorMessage.includes('ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING') || + errorMessage.includes('Cannot find module') || + errorMessage.includes('ERR_MODULE_NOT_FOUND')) { + logger.warn(`Failed to load the "file-type" package for magic number validation. ` + + `If you are using Jest, run it with NODE_OPTIONS="--experimental-vm-modules". ` + + `Error: ${errorMessage}`); + } + // Fallback to mimetype if enabled + if (this.validationOptions.fallbackToMimetype) { + return !!file.mimetype.match(this.validationOptions.fileType); + } + return false; + } + } +} +exports.FileTypeValidator = FileTypeValidator; diff --git a/node_modules/@nestjs/common/pipes/file/file-validator-context.interface.d.ts b/node_modules/@nestjs/common/pipes/file/file-validator-context.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3c01e67e67d59f45b28e1eb67e6dd1de862193d --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/file-validator-context.interface.d.ts @@ -0,0 +1,5 @@ +import { IFile } from './interfaces'; +export type FileValidatorContext = { + file?: IFile; + config: TConfig; +}; diff --git a/node_modules/@nestjs/common/pipes/file/file-validator-context.interface.js b/node_modules/@nestjs/common/pipes/file/file-validator-context.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/file-validator-context.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/pipes/file/file-validator.interface.d.ts b/node_modules/@nestjs/common/pipes/file/file-validator.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1d1198d401a2d6587a644347b19ab49d7b4d69e9 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/file-validator.interface.d.ts @@ -0,0 +1,21 @@ +import { IFile } from './interfaces'; +/** + * Interface describing FileValidators, which can be added to a ParseFilePipe + * + * @see {ParseFilePipe} + * @publicApi + */ +export declare abstract class FileValidator, TFile extends IFile = IFile> { + protected readonly validationOptions: TValidationOptions; + constructor(validationOptions: TValidationOptions); + /** + * Indicates if this file should be considered valid, according to the options passed in the constructor. + * @param file the file from the request object + */ + abstract isValid(file?: TFile | TFile[] | Record): boolean | Promise; + /** + * Builds an error message in case the validation fails. + * @param file the file from the request object + */ + abstract buildErrorMessage(file: any): string; +} diff --git a/node_modules/@nestjs/common/pipes/file/file-validator.interface.js b/node_modules/@nestjs/common/pipes/file/file-validator.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..51accc65936cfe1854bc889cd26c51f9b82b98a9 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/file-validator.interface.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FileValidator = void 0; +/** + * Interface describing FileValidators, which can be added to a ParseFilePipe + * + * @see {ParseFilePipe} + * @publicApi + */ +class FileValidator { + constructor(validationOptions) { + this.validationOptions = validationOptions; + } +} +exports.FileValidator = FileValidator; diff --git a/node_modules/@nestjs/common/pipes/file/index.d.ts b/node_modules/@nestjs/common/pipes/file/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..11d19e3188edbc01243444fdcca80975f447ea3c --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/index.d.ts @@ -0,0 +1,6 @@ +export * from './file-type.validator'; +export * from './file-validator.interface'; +export * from './max-file-size.validator'; +export * from './parse-file-options.interface'; +export * from './parse-file.pipe'; +export * from './parse-file-pipe.builder'; diff --git a/node_modules/@nestjs/common/pipes/file/index.js b/node_modules/@nestjs/common/pipes/file/index.js new file mode 100644 index 0000000000000000000000000000000000000000..123009313cf0d05ad0da7a5f36401ab57027514b --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./file-type.validator"), exports); +tslib_1.__exportStar(require("./file-validator.interface"), exports); +tslib_1.__exportStar(require("./max-file-size.validator"), exports); +tslib_1.__exportStar(require("./parse-file-options.interface"), exports); +tslib_1.__exportStar(require("./parse-file.pipe"), exports); +tslib_1.__exportStar(require("./parse-file-pipe.builder"), exports); diff --git a/node_modules/@nestjs/common/pipes/file/interfaces/file.interface.d.ts b/node_modules/@nestjs/common/pipes/file/interfaces/file.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d6162e2cee32837270443ac12944898b84909a2 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/interfaces/file.interface.d.ts @@ -0,0 +1,5 @@ +export interface IFile { + mimetype: string; + size: number; + buffer?: Buffer; +} diff --git a/node_modules/@nestjs/common/pipes/file/interfaces/file.interface.js b/node_modules/@nestjs/common/pipes/file/interfaces/file.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/interfaces/file.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/pipes/file/interfaces/index.d.ts b/node_modules/@nestjs/common/pipes/file/interfaces/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..09d8f3ca8f111fddd155422ec316ac29996d5a97 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/interfaces/index.d.ts @@ -0,0 +1 @@ +export * from './file.interface'; diff --git a/node_modules/@nestjs/common/pipes/file/interfaces/index.js b/node_modules/@nestjs/common/pipes/file/interfaces/index.js new file mode 100644 index 0000000000000000000000000000000000000000..465358b7b646dd8c7d15d7b3ab7122070cba5483 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/interfaces/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./file.interface"), exports); diff --git a/node_modules/@nestjs/common/pipes/file/max-file-size.validator.d.ts b/node_modules/@nestjs/common/pipes/file/max-file-size.validator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3557da0277929ef9ccf3304c457038e8aa9782f5 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/max-file-size.validator.d.ts @@ -0,0 +1,44 @@ +import { FileValidatorContext } from './file-validator-context.interface'; +import { FileValidator } from './file-validator.interface'; +import { IFile } from './interfaces'; +type MaxFileSizeValidatorContext = FileValidatorContext>; +export type MaxFileSizeValidatorOptions = { + /** + * Maximum allowed file size in bytes. + */ + maxSize: number; + /** + * @deprecated Use `errorMessage` instead. + */ + message?: string | ((maxSize: number) => string); + /** + * Custom error message returned when file size validation fails. + * Can be provided as a static string, or as a factory function + * that receives the validation context (file and validator configuration) + * and returns a dynamic error message. + * + * @example + * // Static message + * new MaxFileSizeValidator({ maxSize: 1000, errorMessage: 'File size exceeds the limit' }) + * + * @example + * // Dynamic message based on file object and validator configuration + * new MaxFileSizeValidator({ + * maxSize: 1000, + * errorMessage: ctx => `Received file size is ${ctx.file?.size}, but it must be smaller than ${ctx.config.maxSize}.` + * }) + */ + errorMessage?: string | ((ctx: MaxFileSizeValidatorContext) => string); +}; +/** + * Defines the built-in MaxSize File Validator + * + * @see [File Validators](https://docs.nestjs.com/techniques/file-upload#file-validation) + * + * @publicApi + */ +export declare class MaxFileSizeValidator extends FileValidator { + buildErrorMessage(file?: IFile): string; + isValid(file?: IFile): boolean; +} +export {}; diff --git a/node_modules/@nestjs/common/pipes/file/max-file-size.validator.js b/node_modules/@nestjs/common/pipes/file/max-file-size.validator.js new file mode 100644 index 0000000000000000000000000000000000000000..af3b01615ac8cdf39a0653dc979bb6e5c3935e4b --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/max-file-size.validator.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MaxFileSizeValidator = void 0; +const file_validator_interface_1 = require("./file-validator.interface"); +/** + * Defines the built-in MaxSize File Validator + * + * @see [File Validators](https://docs.nestjs.com/techniques/file-upload#file-validation) + * + * @publicApi + */ +class MaxFileSizeValidator extends file_validator_interface_1.FileValidator { + buildErrorMessage(file) { + const { errorMessage, message, ...config } = this.validationOptions; + if (errorMessage) { + return typeof errorMessage === 'function' + ? errorMessage({ file, config }) + : errorMessage; + } + if (message) { + return typeof message === 'function' + ? message(this.validationOptions.maxSize) + : message; + } + if (file?.size) { + return `Validation failed (current file size is ${file.size}, expected size is less than ${this.validationOptions.maxSize})`; + } + return `Validation failed (expected size is less than ${this.validationOptions.maxSize})`; + } + isValid(file) { + if (!this.validationOptions || !file) { + return true; + } + return 'size' in file && file.size < this.validationOptions.maxSize; + } +} +exports.MaxFileSizeValidator = MaxFileSizeValidator; diff --git a/node_modules/@nestjs/common/pipes/file/parse-file-options.interface.d.ts b/node_modules/@nestjs/common/pipes/file/parse-file-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..55fa9cf8172d9d5272371f563567ba65c5c37050 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/parse-file-options.interface.d.ts @@ -0,0 +1,15 @@ +import { ErrorHttpStatusCode } from '../../utils/http-error-by-code.util'; +import { FileValidator } from './file-validator.interface'; +/** + * @publicApi + */ +export interface ParseFileOptions { + validators?: FileValidator[]; + errorHttpStatusCode?: ErrorHttpStatusCode; + exceptionFactory?: (error: string) => any; + /** + * Defines if file parameter is required. + * @default true + */ + fileIsRequired?: boolean; +} diff --git a/node_modules/@nestjs/common/pipes/file/parse-file-options.interface.js b/node_modules/@nestjs/common/pipes/file/parse-file-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/parse-file-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/pipes/file/parse-file-pipe.builder.d.ts b/node_modules/@nestjs/common/pipes/file/parse-file-pipe.builder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..282b6f613dd9e5ace2795ab45004ec2be32090df --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/parse-file-pipe.builder.d.ts @@ -0,0 +1,15 @@ +import { FileTypeValidatorOptions } from './file-type.validator'; +import { FileValidator } from './file-validator.interface'; +import { MaxFileSizeValidatorOptions } from './max-file-size.validator'; +import { ParseFileOptions } from './parse-file-options.interface'; +import { ParseFilePipe } from './parse-file.pipe'; +/** + * @publicApi + */ +export declare class ParseFilePipeBuilder { + private validators; + addMaxSizeValidator(options: MaxFileSizeValidatorOptions): this; + addFileTypeValidator(options: FileTypeValidatorOptions): this; + addValidator(validator: FileValidator): this; + build(additionalOptions?: Omit): ParseFilePipe; +} diff --git a/node_modules/@nestjs/common/pipes/file/parse-file-pipe.builder.js b/node_modules/@nestjs/common/pipes/file/parse-file-pipe.builder.js new file mode 100644 index 0000000000000000000000000000000000000000..a33995a195d3ed79e4cdea1897cc501905711a7b --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/parse-file-pipe.builder.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParseFilePipeBuilder = void 0; +const file_type_validator_1 = require("./file-type.validator"); +const max_file_size_validator_1 = require("./max-file-size.validator"); +const parse_file_pipe_1 = require("./parse-file.pipe"); +/** + * @publicApi + */ +class ParseFilePipeBuilder { + constructor() { + this.validators = []; + } + addMaxSizeValidator(options) { + return this.addValidator(new max_file_size_validator_1.MaxFileSizeValidator(options)); + } + addFileTypeValidator(options) { + return this.addValidator(new file_type_validator_1.FileTypeValidator(options)); + } + addValidator(validator) { + this.validators.push(validator); + return this; + } + build(additionalOptions) { + const parseFilePipe = new parse_file_pipe_1.ParseFilePipe({ + ...additionalOptions, + validators: this.validators, + }); + this.validators = []; + return parseFilePipe; + } +} +exports.ParseFilePipeBuilder = ParseFilePipeBuilder; diff --git a/node_modules/@nestjs/common/pipes/file/parse-file.pipe.d.ts b/node_modules/@nestjs/common/pipes/file/parse-file.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1c2796c609ca0cacd196e200586bc05e90270345 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/parse-file.pipe.d.ts @@ -0,0 +1,28 @@ +import { PipeTransform } from '../../interfaces/features/pipe-transform.interface'; +import { FileValidator } from './file-validator.interface'; +import { ParseFileOptions } from './parse-file-options.interface'; +/** + * Defines the built-in ParseFile Pipe. This pipe can be used to validate incoming files + * with `@UploadedFile()` decorator. You can use either other specific built-in validators + * or provide one of your own, simply implementing it through FileValidator interface + * and adding it to ParseFilePipe's constructor. + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +export declare class ParseFilePipe implements PipeTransform { + protected exceptionFactory: (error: string) => any; + private readonly validators; + private readonly fileIsRequired; + constructor(options?: ParseFileOptions); + transform(value: any): Promise; + private validateFilesOrFile; + private thereAreNoFilesIn; + protected validate(file: any): Promise; + private validateOrThrow; + /** + * @returns list of validators used in this pipe. + */ + getValidators(): FileValidator, import("./interfaces").IFile>[]; +} diff --git a/node_modules/@nestjs/common/pipes/file/parse-file.pipe.js b/node_modules/@nestjs/common/pipes/file/parse-file.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..63fec9370d6a844df8cd787ec311bb11449af52a --- /dev/null +++ b/node_modules/@nestjs/common/pipes/file/parse-file.pipe.js @@ -0,0 +1,76 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParseFilePipe = void 0; +const tslib_1 = require("tslib"); +const core_1 = require("../../decorators/core"); +const enums_1 = require("../../enums"); +const http_error_by_code_util_1 = require("../../utils/http-error-by-code.util"); +const shared_utils_1 = require("../../utils/shared.utils"); +/** + * Defines the built-in ParseFile Pipe. This pipe can be used to validate incoming files + * with `@UploadedFile()` decorator. You can use either other specific built-in validators + * or provide one of your own, simply implementing it through FileValidator interface + * and adding it to ParseFilePipe's constructor. + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +let ParseFilePipe = class ParseFilePipe { + constructor(options = {}) { + const { exceptionFactory, errorHttpStatusCode = enums_1.HttpStatus.BAD_REQUEST, validators = [], fileIsRequired, } = options; + this.exceptionFactory = + exceptionFactory || + (error => new http_error_by_code_util_1.HttpErrorByCode[errorHttpStatusCode](error)); + this.validators = validators; + this.fileIsRequired = fileIsRequired ?? true; + } + async transform(value) { + const areThereAnyFilesIn = this.thereAreNoFilesIn(value); + if (areThereAnyFilesIn && this.fileIsRequired) { + throw this.exceptionFactory('File is required'); + } + if (!areThereAnyFilesIn && this.validators.length) { + await this.validateFilesOrFile(value); + } + return value; + } + async validateFilesOrFile(value) { + if (Array.isArray(value)) { + await Promise.all(value.map(f => this.validate(f))); + } + else { + await this.validate(value); + } + } + thereAreNoFilesIn(value) { + const isEmptyArray = Array.isArray(value) && (0, shared_utils_1.isEmpty)(value); + const isEmptyObject = (0, shared_utils_1.isObject)(value) && (0, shared_utils_1.isEmpty)(Object.keys(value)); + return (0, shared_utils_1.isUndefined)(value) || isEmptyArray || isEmptyObject; + } + async validate(file) { + for (const validator of this.validators) { + await this.validateOrThrow(file, validator); + } + return file; + } + async validateOrThrow(file, validator) { + const isValid = await validator.isValid(file); + if (!isValid) { + const errorMessage = validator.buildErrorMessage(file); + throw this.exceptionFactory(errorMessage); + } + } + /** + * @returns list of validators used in this pipe. + */ + getValidators() { + return this.validators; + } +}; +exports.ParseFilePipe = ParseFilePipe; +exports.ParseFilePipe = ParseFilePipe = tslib_1.__decorate([ + (0, core_1.Injectable)(), + tslib_1.__param(0, (0, core_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [Object]) +], ParseFilePipe); diff --git a/node_modules/@nestjs/common/pipes/index.d.ts b/node_modules/@nestjs/common/pipes/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f416b9467a782930e1cd1cab5df562951e8e3e5e --- /dev/null +++ b/node_modules/@nestjs/common/pipes/index.d.ts @@ -0,0 +1,10 @@ +export * from './default-value.pipe'; +export * from './file'; +export * from './parse-array.pipe'; +export * from './parse-bool.pipe'; +export * from './parse-date.pipe'; +export * from './parse-enum.pipe'; +export * from './parse-float.pipe'; +export * from './parse-int.pipe'; +export * from './parse-uuid.pipe'; +export * from './validation.pipe'; diff --git a/node_modules/@nestjs/common/pipes/index.js b/node_modules/@nestjs/common/pipes/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cb4ddf8f265690744d9b3b655df142ecd0ccdd48 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/index.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./default-value.pipe"), exports); +tslib_1.__exportStar(require("./file"), exports); +tslib_1.__exportStar(require("./parse-array.pipe"), exports); +tslib_1.__exportStar(require("./parse-bool.pipe"), exports); +tslib_1.__exportStar(require("./parse-date.pipe"), exports); +tslib_1.__exportStar(require("./parse-enum.pipe"), exports); +tslib_1.__exportStar(require("./parse-float.pipe"), exports); +tslib_1.__exportStar(require("./parse-int.pipe"), exports); +tslib_1.__exportStar(require("./parse-uuid.pipe"), exports); +tslib_1.__exportStar(require("./validation.pipe"), exports); diff --git a/node_modules/@nestjs/common/pipes/parse-array.pipe.d.ts b/node_modules/@nestjs/common/pipes/parse-array.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e842ec91c2f3d99d26de4f3c63fa1c512d0b3990 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-array.pipe.d.ts @@ -0,0 +1,52 @@ +import { Type } from '../interfaces'; +import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface'; +import { ValidationPipe, ValidationPipeOptions } from './validation.pipe'; +/** + * @publicApi + */ +export interface ParseArrayOptions extends Omit { + /** + * Type for items to be converted into + */ + items?: Type; + /** + * Items separator to split string by + * @default ',' + */ + separator?: string; + /** + * If true, the pipe will return null or undefined if the value is not provided + * @default false + */ + optional?: boolean; + /** + * A factory function that returns an exception object to be thrown + * if validation fails. + * @param error Error message or object + * @returns The exception object + */ + exceptionFactory?: (error: any) => any; +} +/** + * Defines the built-in ParseArray Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +export declare class ParseArrayPipe implements PipeTransform { + protected readonly options: ParseArrayOptions; + protected readonly validationPipe: ValidationPipe; + protected exceptionFactory: (error: string) => any; + constructor(options?: ParseArrayOptions); + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + transform(value: any, metadata: ArgumentMetadata): Promise; + protected isExpectedTypePrimitive(): boolean; + protected validatePrimitive(originalValue: any, index?: number): any; +} diff --git a/node_modules/@nestjs/common/pipes/parse-array.pipe.js b/node_modules/@nestjs/common/pipes/parse-array.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..1a38b4fe0393c6e1c187593a807ce45bb239b718 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-array.pipe.js @@ -0,0 +1,148 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParseArrayPipe = void 0; +const tslib_1 = require("tslib"); +const injectable_decorator_1 = require("../decorators/core/injectable.decorator"); +const optional_decorator_1 = require("../decorators/core/optional.decorator"); +const http_status_enum_1 = require("../enums/http-status.enum"); +const http_error_by_code_util_1 = require("../utils/http-error-by-code.util"); +const shared_utils_1 = require("../utils/shared.utils"); +const validation_pipe_1 = require("./validation.pipe"); +const VALIDATION_ERROR_MESSAGE = 'Validation failed (parsable array expected)'; +const DEFAULT_ARRAY_SEPARATOR = ','; +/** + * Defines the built-in ParseArray Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +let ParseArrayPipe = class ParseArrayPipe { + constructor(options = {}) { + this.options = options; + this.validationPipe = new validation_pipe_1.ValidationPipe({ + transform: true, + validateCustomDecorators: true, + ...options, + }); + const { exceptionFactory, errorHttpStatusCode = http_status_enum_1.HttpStatus.BAD_REQUEST } = options; + this.exceptionFactory = + exceptionFactory || + (error => new http_error_by_code_util_1.HttpErrorByCode[errorHttpStatusCode](error)); + } + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + async transform(value, metadata) { + if (!value && !this.options.optional) { + throw this.exceptionFactory(VALIDATION_ERROR_MESSAGE); + } + else if ((0, shared_utils_1.isNil)(value) && this.options.optional) { + return value; + } + if (!Array.isArray(value)) { + if (!(0, shared_utils_1.isString)(value)) { + throw this.exceptionFactory(VALIDATION_ERROR_MESSAGE); + } + else { + try { + value = value + .trim() + .split(this.options.separator || DEFAULT_ARRAY_SEPARATOR); + } + catch { + throw this.exceptionFactory(VALIDATION_ERROR_MESSAGE); + } + } + } + if (this.options.items) { + const validationMetadata = { + metatype: this.options.items, + type: 'query', + }; + const isExpectedTypePrimitive = this.isExpectedTypePrimitive(); + const toClassInstance = (item, index) => { + if (this.options.items !== String) { + try { + item = JSON.parse(item); + } + catch { + // Do nothing + } + } + if (isExpectedTypePrimitive) { + return this.validatePrimitive(item, index); + } + return this.validationPipe.transform(item, validationMetadata); + }; + if (this.options.stopAtFirstError === false) { + // strict compare to "false" to make sure + // that this option is disabled by default + let errors = []; + const targetArray = value; + for (let i = 0; i < targetArray.length; i++) { + try { + targetArray[i] = await toClassInstance(targetArray[i]); + } + catch (err) { + let message; + if (err.getResponse) { + const response = err.getResponse(); + if (Array.isArray(response.message)) { + message = response.message.map((item) => `[${i}] ${item}`); + } + else { + message = `[${i}] ${response.message}`; + } + } + else { + message = err; + } + errors = errors.concat(message); + } + } + if (errors.length > 0) { + throw this.exceptionFactory(errors); + } + return targetArray; + } + else { + value = await Promise.all(value.map(toClassInstance)); + } + } + return value; + } + isExpectedTypePrimitive() { + return [Boolean, Number, String].includes(this.options.items); + } + validatePrimitive(originalValue, index) { + if (this.options.items === Number) { + const value = originalValue !== null && originalValue !== '' ? +originalValue : NaN; + if (isNaN(value)) { + throw this.exceptionFactory(`${(0, shared_utils_1.isUndefined)(index) ? '' : `[${index}] `}item must be a number`); + } + return value; + } + else if (this.options.items === String) { + if (!(0, shared_utils_1.isString)(originalValue)) { + return `${originalValue}`; + } + } + else if (this.options.items === Boolean) { + if (typeof originalValue !== 'boolean') { + throw this.exceptionFactory(`${(0, shared_utils_1.isUndefined)(index) ? '' : `[${index}] `}item must be a boolean value`); + } + } + return originalValue; + } +}; +exports.ParseArrayPipe = ParseArrayPipe; +exports.ParseArrayPipe = ParseArrayPipe = tslib_1.__decorate([ + (0, injectable_decorator_1.Injectable)(), + tslib_1.__param(0, (0, optional_decorator_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [Object]) +], ParseArrayPipe); diff --git a/node_modules/@nestjs/common/pipes/parse-bool.pipe.d.ts b/node_modules/@nestjs/common/pipes/parse-bool.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a2fe2348747bc866e1f161ffddd234c3e4a9adb --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-bool.pipe.d.ts @@ -0,0 +1,55 @@ +import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface'; +import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util'; +/** + * @publicApi + */ +export interface ParseBoolPipeOptions { + /** + * The HTTP status code to be used in the response when the validation fails. + */ + errorHttpStatusCode?: ErrorHttpStatusCode; + /** + * A factory function that returns an exception object to be thrown + * if validation fails. + * @param error Error message + * @returns The exception object + */ + exceptionFactory?: (error: string) => any; + /** + * If true, the pipe will return null or undefined if the value is not provided + * @default false + */ + optional?: boolean; +} +/** + * Defines the built-in ParseBool Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +export declare class ParseBoolPipe implements PipeTransform> { + protected readonly options?: ParseBoolPipeOptions | undefined; + protected exceptionFactory: (error: string) => any; + constructor(options?: ParseBoolPipeOptions | undefined); + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + transform(value: string | boolean, metadata: ArgumentMetadata): Promise; + /** + * @param value currently processed route argument + * @returns `true` if `value` is said 'true', ie., if it is equal to the boolean + * `true` or the string `"true"` + */ + protected isTrue(value: string | boolean): boolean; + /** + * @param value currently processed route argument + * @returns `true` if `value` is said 'false', ie., if it is equal to the boolean + * `false` or the string `"false"` + */ + protected isFalse(value: string | boolean): boolean; +} diff --git a/node_modules/@nestjs/common/pipes/parse-bool.pipe.js b/node_modules/@nestjs/common/pipes/parse-bool.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..058aa42565ce26bb4121296ae1fd1a218a8c6967 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-bool.pipe.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParseBoolPipe = void 0; +const tslib_1 = require("tslib"); +const injectable_decorator_1 = require("../decorators/core/injectable.decorator"); +const optional_decorator_1 = require("../decorators/core/optional.decorator"); +const http_status_enum_1 = require("../enums/http-status.enum"); +const http_error_by_code_util_1 = require("../utils/http-error-by-code.util"); +const shared_utils_1 = require("../utils/shared.utils"); +/** + * Defines the built-in ParseBool Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +let ParseBoolPipe = class ParseBoolPipe { + constructor(options) { + this.options = options; + options = options || {}; + const { exceptionFactory, errorHttpStatusCode = http_status_enum_1.HttpStatus.BAD_REQUEST } = options; + this.exceptionFactory = + exceptionFactory || + (error => new http_error_by_code_util_1.HttpErrorByCode[errorHttpStatusCode](error)); + } + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + async transform(value, metadata) { + if ((0, shared_utils_1.isNil)(value) && this.options?.optional) { + return value; + } + if (this.isTrue(value)) { + return true; + } + if (this.isFalse(value)) { + return false; + } + throw this.exceptionFactory('Validation failed (boolean string is expected)'); + } + /** + * @param value currently processed route argument + * @returns `true` if `value` is said 'true', ie., if it is equal to the boolean + * `true` or the string `"true"` + */ + isTrue(value) { + return value === true || value === 'true'; + } + /** + * @param value currently processed route argument + * @returns `true` if `value` is said 'false', ie., if it is equal to the boolean + * `false` or the string `"false"` + */ + isFalse(value) { + return value === false || value === 'false'; + } +}; +exports.ParseBoolPipe = ParseBoolPipe; +exports.ParseBoolPipe = ParseBoolPipe = tslib_1.__decorate([ + (0, injectable_decorator_1.Injectable)(), + tslib_1.__param(0, (0, optional_decorator_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [Object]) +], ParseBoolPipe); diff --git a/node_modules/@nestjs/common/pipes/parse-date.pipe.d.ts b/node_modules/@nestjs/common/pipes/parse-date.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..79e1df777adcc75f61d935ed87aa42af05f5aaae --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-date.pipe.d.ts @@ -0,0 +1,37 @@ +import { PipeTransform } from '../interfaces/features/pipe-transform.interface'; +import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util'; +export interface ParseDatePipeOptions { + /** + * If true, the pipe will return null or undefined if the value is not provided + * @default false + */ + optional?: boolean; + /** + * Default value for the date + */ + default?: () => Date; + /** + * The HTTP status code to be used in the response when the validation fails. + */ + errorHttpStatusCode?: ErrorHttpStatusCode; + /** + * A factory function that returns an exception object to be thrown + * if validation fails. + * @param error Error message + * @returns The exception object + */ + exceptionFactory?: (error: string) => any; +} +export declare class ParseDatePipe implements PipeTransform { + private readonly options; + protected exceptionFactory: (error: string) => any; + constructor(options?: ParseDatePipeOptions); + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + transform(value: string | number | undefined | null): Date | null | undefined; +} diff --git a/node_modules/@nestjs/common/pipes/parse-date.pipe.js b/node_modules/@nestjs/common/pipes/parse-date.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..71e25352de6e084ccfa331e3013f40a35867f7bf --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-date.pipe.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParseDatePipe = void 0; +const tslib_1 = require("tslib"); +const injectable_decorator_1 = require("../decorators/core/injectable.decorator"); +const http_status_enum_1 = require("../enums/http-status.enum"); +const http_error_by_code_util_1 = require("../utils/http-error-by-code.util"); +const shared_utils_1 = require("../utils/shared.utils"); +let ParseDatePipe = class ParseDatePipe { + constructor(options = {}) { + this.options = options; + const { exceptionFactory, errorHttpStatusCode = http_status_enum_1.HttpStatus.BAD_REQUEST } = options; + this.exceptionFactory = + exceptionFactory || + (error => new http_error_by_code_util_1.HttpErrorByCode[errorHttpStatusCode](error)); + } + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + transform(value) { + if (this.options.optional && (0, shared_utils_1.isNil)(value)) { + return this.options.default ? this.options.default() : value; + } + if ((0, shared_utils_1.isNil)(value) || value === '') { + throw this.exceptionFactory('Validation failed (no Date provided)'); + } + const transformedValue = new Date(value); + if (isNaN(transformedValue.getTime())) { + throw this.exceptionFactory('Validation failed (invalid date format)'); + } + return transformedValue; + } +}; +exports.ParseDatePipe = ParseDatePipe; +exports.ParseDatePipe = ParseDatePipe = tslib_1.__decorate([ + (0, injectable_decorator_1.Injectable)(), + tslib_1.__metadata("design:paramtypes", [Object]) +], ParseDatePipe); diff --git a/node_modules/@nestjs/common/pipes/parse-enum.pipe.d.ts b/node_modules/@nestjs/common/pipes/parse-enum.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8d97932a874e644e37443952d0018562d02e45a --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-enum.pipe.d.ts @@ -0,0 +1,46 @@ +import { ArgumentMetadata } from '../index'; +import { PipeTransform } from '../interfaces/features/pipe-transform.interface'; +import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util'; +/** + * @publicApi + */ +export interface ParseEnumPipeOptions { + /** + * If true, the pipe will return null or undefined if the value is not provided + * @default false + */ + optional?: boolean; + /** + * The HTTP status code to be used in the response when the validation fails. + */ + errorHttpStatusCode?: ErrorHttpStatusCode; + /** + * A factory function that returns an exception object to be thrown + * if validation fails. + * @param error Error message + * @returns The exception object + */ + exceptionFactory?: (error: string) => any; +} +/** + * Defines the built-in ParseEnum Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +export declare class ParseEnumPipe implements PipeTransform { + protected readonly enumType: T; + protected readonly options?: ParseEnumPipeOptions | undefined; + protected exceptionFactory: (error: string) => any; + constructor(enumType: T, options?: ParseEnumPipeOptions | undefined); + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + transform(value: T, metadata: ArgumentMetadata): Promise; + protected isEnum(value: T): boolean; +} diff --git a/node_modules/@nestjs/common/pipes/parse-enum.pipe.js b/node_modules/@nestjs/common/pipes/parse-enum.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..1c92bd4bed5cd3d317f1b9e05864b7c72f685f6c --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-enum.pipe.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParseEnumPipe = void 0; +const tslib_1 = require("tslib"); +const core_1 = require("../decorators/core"); +const index_1 = require("../index"); +const http_error_by_code_util_1 = require("../utils/http-error-by-code.util"); +const shared_utils_1 = require("../utils/shared.utils"); +/** + * Defines the built-in ParseEnum Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +let ParseEnumPipe = class ParseEnumPipe { + constructor(enumType, options) { + this.enumType = enumType; + this.options = options; + if (!enumType) { + throw new Error(`"ParseEnumPipe" requires "enumType" argument specified (to validate input values).`); + } + options = options || {}; + const { exceptionFactory, errorHttpStatusCode = index_1.HttpStatus.BAD_REQUEST } = options; + this.exceptionFactory = + exceptionFactory || + (error => new http_error_by_code_util_1.HttpErrorByCode[errorHttpStatusCode](error)); + } + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + async transform(value, metadata) { + if ((0, shared_utils_1.isNil)(value) && this.options?.optional) { + return value; + } + if (!this.isEnum(value)) { + throw this.exceptionFactory('Validation failed (enum string is expected)'); + } + return value; + } + isEnum(value) { + const enumValues = Object.keys(this.enumType).map(item => this.enumType[item]); + return enumValues.includes(value); + } +}; +exports.ParseEnumPipe = ParseEnumPipe; +exports.ParseEnumPipe = ParseEnumPipe = tslib_1.__decorate([ + (0, core_1.Injectable)(), + tslib_1.__param(1, (0, core_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [Object, Object]) +], ParseEnumPipe); diff --git a/node_modules/@nestjs/common/pipes/parse-float.pipe.d.ts b/node_modules/@nestjs/common/pipes/parse-float.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8096f1579f9370e03367adc3fa2bbd10dbd5e02a --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-float.pipe.d.ts @@ -0,0 +1,49 @@ +import { ArgumentMetadata } from '../index'; +import { PipeTransform } from '../interfaces/features/pipe-transform.interface'; +import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util'; +/** + * @publicApi + */ +export interface ParseFloatPipeOptions { + /** + * The HTTP status code to be used in the response when the validation fails. + */ + errorHttpStatusCode?: ErrorHttpStatusCode; + /** + * A factory function that returns an exception object to be thrown + * if validation fails. + * @param error Error message + * @returns The exception object + */ + exceptionFactory?: (error: string) => any; + /** + * If true, the pipe will return null or undefined if the value is not provided + * @default false + */ + optional?: boolean; +} +/** + * Defines the built-in ParseFloat Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +export declare class ParseFloatPipe implements PipeTransform { + protected readonly options?: ParseFloatPipeOptions | undefined; + protected exceptionFactory: (error: string) => any; + constructor(options?: ParseFloatPipeOptions | undefined); + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + transform(value: string, metadata: ArgumentMetadata): Promise; + /** + * @param value currently processed route argument + * @returns `true` if `value` is a valid float number + */ + protected isNumeric(value: string): boolean; +} diff --git a/node_modules/@nestjs/common/pipes/parse-float.pipe.js b/node_modules/@nestjs/common/pipes/parse-float.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..fbf2488c0a1d44d4e611128bc5e1c064cac44906 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-float.pipe.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParseFloatPipe = void 0; +const tslib_1 = require("tslib"); +const core_1 = require("../decorators/core"); +const index_1 = require("../index"); +const http_error_by_code_util_1 = require("../utils/http-error-by-code.util"); +const shared_utils_1 = require("../utils/shared.utils"); +/** + * Defines the built-in ParseFloat Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +let ParseFloatPipe = class ParseFloatPipe { + constructor(options) { + this.options = options; + options = options || {}; + const { exceptionFactory, errorHttpStatusCode = index_1.HttpStatus.BAD_REQUEST } = options; + this.exceptionFactory = + exceptionFactory || + (error => new http_error_by_code_util_1.HttpErrorByCode[errorHttpStatusCode](error)); + } + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + async transform(value, metadata) { + if ((0, shared_utils_1.isNil)(value) && this.options?.optional) { + return value; + } + if (!this.isNumeric(value)) { + throw this.exceptionFactory('Validation failed (numeric string is expected)'); + } + return parseFloat(value); + } + /** + * @param value currently processed route argument + * @returns `true` if `value` is a valid float number + */ + isNumeric(value) { + return (['string', 'number'].includes(typeof value) && + !isNaN(parseFloat(value)) && + isFinite(value)); + } +}; +exports.ParseFloatPipe = ParseFloatPipe; +exports.ParseFloatPipe = ParseFloatPipe = tslib_1.__decorate([ + (0, core_1.Injectable)(), + tslib_1.__param(0, (0, core_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [Object]) +], ParseFloatPipe); diff --git a/node_modules/@nestjs/common/pipes/parse-int.pipe.d.ts b/node_modules/@nestjs/common/pipes/parse-int.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aeb40b2e214f9b35b468e1907e264ab9d4b92984 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-int.pipe.d.ts @@ -0,0 +1,48 @@ +import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface'; +import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util'; +/** + * @publicApi + */ +export interface ParseIntPipeOptions { + /** + * The HTTP status code to be used in the response when the validation fails. + */ + errorHttpStatusCode?: ErrorHttpStatusCode; + /** + * A factory function that returns an exception object to be thrown + * if validation fails. + * @param error Error message + * @returns The exception object + */ + exceptionFactory?: (error: string) => any; + /** + * If true, the pipe will return null or undefined if the value is not provided + * @default false + */ + optional?: boolean; +} +/** + * Defines the built-in ParseInt Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +export declare class ParseIntPipe implements PipeTransform { + protected readonly options?: ParseIntPipeOptions | undefined; + protected exceptionFactory: (error: string) => any; + constructor(options?: ParseIntPipeOptions | undefined); + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + transform(value: string, metadata: ArgumentMetadata): Promise; + /** + * @param value currently processed route argument + * @returns `true` if `value` is a valid integer number + */ + protected isNumeric(value: string): boolean; +} diff --git a/node_modules/@nestjs/common/pipes/parse-int.pipe.js b/node_modules/@nestjs/common/pipes/parse-int.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..7a30ed94eaa894fed02aaefc9af933e37c242ef9 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-int.pipe.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParseIntPipe = void 0; +const tslib_1 = require("tslib"); +const injectable_decorator_1 = require("../decorators/core/injectable.decorator"); +const optional_decorator_1 = require("../decorators/core/optional.decorator"); +const http_status_enum_1 = require("../enums/http-status.enum"); +const http_error_by_code_util_1 = require("../utils/http-error-by-code.util"); +const shared_utils_1 = require("../utils/shared.utils"); +/** + * Defines the built-in ParseInt Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +let ParseIntPipe = class ParseIntPipe { + constructor(options) { + this.options = options; + options = options || {}; + const { exceptionFactory, errorHttpStatusCode = http_status_enum_1.HttpStatus.BAD_REQUEST } = options; + this.exceptionFactory = + exceptionFactory || + (error => new http_error_by_code_util_1.HttpErrorByCode[errorHttpStatusCode](error)); + } + /** + * Method that accesses and performs optional transformation on argument for + * in-flight requests. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + async transform(value, metadata) { + if ((0, shared_utils_1.isNil)(value) && this.options?.optional) { + return value; + } + if (!this.isNumeric(value)) { + throw this.exceptionFactory('Validation failed (numeric string is expected)'); + } + return parseInt(value, 10); + } + /** + * @param value currently processed route argument + * @returns `true` if `value` is a valid integer number + */ + isNumeric(value) { + return (['string', 'number'].includes(typeof value) && + /^-?\d+$/.test(value) && + isFinite(value)); + } +}; +exports.ParseIntPipe = ParseIntPipe; +exports.ParseIntPipe = ParseIntPipe = tslib_1.__decorate([ + (0, injectable_decorator_1.Injectable)(), + tslib_1.__param(0, (0, optional_decorator_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [Object]) +], ParseIntPipe); diff --git a/node_modules/@nestjs/common/pipes/parse-uuid.pipe.d.ts b/node_modules/@nestjs/common/pipes/parse-uuid.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7075223ae3060941b3030625e7be7d251be624f7 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-uuid.pipe.d.ts @@ -0,0 +1,49 @@ +import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface'; +import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util'; +/** + * @publicApi + */ +export interface ParseUUIDPipeOptions { + /** + * UUID version to validate + */ + version?: '3' | '4' | '5' | '7'; + /** + * The HTTP status code to be used in the response when the validation fails. + */ + errorHttpStatusCode?: ErrorHttpStatusCode; + /** + * A factory function that returns an exception object to be thrown + * if validation fails. + * @param error Error message + * @returns The exception object + */ + exceptionFactory?: (errors: string) => any; + /** + * If true, the pipe will return null or undefined if the value is not provided + * @default false + */ + optional?: boolean; +} +/** + * Defines the built-in ParseUUID Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +export declare class ParseUUIDPipe implements PipeTransform { + protected readonly options?: ParseUUIDPipeOptions | undefined; + protected static uuidRegExps: { + 3: RegExp; + 4: RegExp; + 5: RegExp; + 7: RegExp; + all: RegExp; + }; + private readonly version; + protected exceptionFactory: (errors: string) => any; + constructor(options?: ParseUUIDPipeOptions | undefined); + transform(value: string, metadata: ArgumentMetadata): Promise; + protected isUUID(str: unknown, version?: string): any; +} diff --git a/node_modules/@nestjs/common/pipes/parse-uuid.pipe.js b/node_modules/@nestjs/common/pipes/parse-uuid.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..88aa76c706dd70f3b46a303471917ff05be4902b --- /dev/null +++ b/node_modules/@nestjs/common/pipes/parse-uuid.pipe.js @@ -0,0 +1,57 @@ +"use strict"; +var ParseUUIDPipe_1; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParseUUIDPipe = void 0; +const tslib_1 = require("tslib"); +const injectable_decorator_1 = require("../decorators/core/injectable.decorator"); +const optional_decorator_1 = require("../decorators/core/optional.decorator"); +const http_status_enum_1 = require("../enums/http-status.enum"); +const http_error_by_code_util_1 = require("../utils/http-error-by-code.util"); +const shared_utils_1 = require("../utils/shared.utils"); +/** + * Defines the built-in ParseUUID Pipe + * + * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes) + * + * @publicApi + */ +let ParseUUIDPipe = ParseUUIDPipe_1 = class ParseUUIDPipe { + constructor(options) { + this.options = options; + options = options || {}; + const { exceptionFactory, errorHttpStatusCode = http_status_enum_1.HttpStatus.BAD_REQUEST, version, } = options; + this.version = version; + this.exceptionFactory = + exceptionFactory || + (error => new http_error_by_code_util_1.HttpErrorByCode[errorHttpStatusCode](error)); + } + async transform(value, metadata) { + if ((0, shared_utils_1.isNil)(value) && this.options?.optional) { + return value; + } + if (!this.isUUID(value, this.version)) { + throw this.exceptionFactory(`Validation failed (uuid${this.version ? ` v ${this.version}` : ''} is expected)`); + } + return value; + } + isUUID(str, version = 'all') { + if (!(0, shared_utils_1.isString)(str)) { + throw this.exceptionFactory('The value passed as UUID is not a string'); + } + const pattern = ParseUUIDPipe_1.uuidRegExps[version]; + return pattern?.test(str); + } +}; +exports.ParseUUIDPipe = ParseUUIDPipe; +ParseUUIDPipe.uuidRegExps = { + 3: /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i, + 4: /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i, + 5: /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i, + 7: /^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i, + all: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i, +}; +exports.ParseUUIDPipe = ParseUUIDPipe = ParseUUIDPipe_1 = tslib_1.__decorate([ + (0, injectable_decorator_1.Injectable)(), + tslib_1.__param(0, (0, optional_decorator_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [Object]) +], ParseUUIDPipe); diff --git a/node_modules/@nestjs/common/pipes/standard-schema-validation.pipe.d.ts b/node_modules/@nestjs/common/pipes/standard-schema-validation.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8288118aee56cb102aca1e3d71276ac4b323dd93 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/standard-schema-validation.pipe.d.ts @@ -0,0 +1,86 @@ +import type { StandardSchemaV1 } from '@standard-schema/spec'; +import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface.js'; +import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util.js'; +/** + * @publicApi + */ +export interface StandardSchemaValidationPipeOptions { + /** + * If true, the pipe will return the value produced by the schema + * (which may differ from the input if the schema coerces/transforms values). + * If false, the original input value is returned after successful validation. + * @default true + */ + transform?: boolean; + /** + * If true, the pipe will also validate parameters decorated with custom decorators + * (created with `createParamDecorator`). When false, custom parameters are skipped. + * @default false + */ + validateCustomDecorators?: boolean; + /** + * Options to pass to the standard schema `validate` function. + * These options are forwarded as the second argument to the schema's `~standard.validate` method. + */ + validateOptions?: Record; + /** + * The HTTP status code to be used in the response when the validation fails. + * @default HttpStatus.BAD_REQUEST + */ + errorHttpStatusCode?: ErrorHttpStatusCode; + /** + * A factory function that returns an exception object to be thrown + * if validation fails. + * @param issues The issues returned by the standard schema validation + * @returns The exception object + */ + exceptionFactory?: (issues: readonly StandardSchemaV1.Issue[]) => any; +} +/** + * Defines the built-in StandardSchemaValidation Pipe. + * + * Uses a standard schema object (conforming to the Standard Schema spec) + * attached to the parameter metadata to validate incoming values. + * + * @see [Standard Schema](https://github.com/standard-schema/standard-schema) + * + * @publicApi + */ +export declare class StandardSchemaValidationPipe implements PipeTransform { + protected readonly options?: StandardSchemaValidationPipeOptions | undefined; + protected isTransformEnabled: boolean; + protected validateCustomDecorators: boolean; + protected validateOptions: Record | undefined; + protected exceptionFactory: (issues: readonly StandardSchemaV1.Issue[]) => any; + constructor(options?: StandardSchemaValidationPipeOptions | undefined); + /** + * Method that validates the incoming value against the standard schema + * provided in the parameter metadata. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + transform(value: T, metadata: ArgumentMetadata): Promise; + /** + * Determines whether validation should be performed for the given metadata. + * Skips validation for custom decorators unless `validateCustomDecorators` is enabled. + * + * @param metadata contains metadata about the currently processed route argument + * @returns `true` if validation should be performed + */ + protected toValidate(metadata: ArgumentMetadata): boolean; + /** + * Validates a value against a standard schema. + * Can be overridden to customize validation behavior. + * + * @param value The value to validate + * @param schema The standard schema to validate against + * @param options Optional options forwarded to the schema's validate method + * @returns The validation result + */ + protected validate(value: unknown, schema: StandardSchemaV1, options?: Record): Promise> | StandardSchemaV1.Result; + /** + * Strips dangerous prototype pollution keys from an object. + */ + protected stripProtoKeys(value: any): void; +} diff --git a/node_modules/@nestjs/common/pipes/standard-schema-validation.pipe.js b/node_modules/@nestjs/common/pipes/standard-schema-validation.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..4f6ddb29afb0b534b83cb12e99fc582cc05e33fe --- /dev/null +++ b/node_modules/@nestjs/common/pipes/standard-schema-validation.pipe.js @@ -0,0 +1,120 @@ +import { __decorate, __metadata, __param } from "tslib"; +import { types } from 'util'; +import { Injectable } from '../decorators/core/injectable.decorator.js'; +import { Optional } from '../decorators/core/optional.decorator.js'; +import { HttpStatus } from '../enums/http-status.enum.js'; +import { HttpErrorByCode, } from '../utils/http-error-by-code.util.js'; +/** + * Built-in JavaScript types that should be excluded from prototype stripping + * to avoid conflicts with test frameworks like Jest's useFakeTimers + */ +const BUILT_IN_TYPES = [Date, RegExp, Error, Map, Set, WeakMap, WeakSet]; +/** + * Defines the built-in StandardSchemaValidation Pipe. + * + * Uses a standard schema object (conforming to the Standard Schema spec) + * attached to the parameter metadata to validate incoming values. + * + * @see [Standard Schema](https://github.com/standard-schema/standard-schema) + * + * @publicApi + */ +let StandardSchemaValidationPipe = class StandardSchemaValidationPipe { + options; + isTransformEnabled; + validateCustomDecorators; + validateOptions; + exceptionFactory; + constructor(options) { + this.options = options; + const { transform = true, validateCustomDecorators = false, validateOptions, exceptionFactory, errorHttpStatusCode = HttpStatus.BAD_REQUEST, } = options || {}; + this.isTransformEnabled = transform; + this.validateCustomDecorators = validateCustomDecorators; + this.validateOptions = validateOptions; + this.exceptionFactory = + exceptionFactory || + (issues => { + const messages = issues.map(issue => issue.message); + return new HttpErrorByCode[errorHttpStatusCode](messages); + }); + } + /** + * Method that validates the incoming value against the standard schema + * provided in the parameter metadata. + * + * @param value currently processed route argument + * @param metadata contains metadata about the currently processed route argument + */ + async transform(value, metadata) { + const schema = metadata.schema; + if (!schema || !this.toValidate(metadata)) { + return value; + } + this.stripProtoKeys(value); + const result = await this.validate(value, schema, this.validateOptions); + if (result.issues) { + throw this.exceptionFactory(result.issues); + } + return this.isTransformEnabled ? result.value : value; + } + /** + * Determines whether validation should be performed for the given metadata. + * Skips validation for custom decorators unless `validateCustomDecorators` is enabled. + * + * @param metadata contains metadata about the currently processed route argument + * @returns `true` if validation should be performed + */ + toValidate(metadata) { + const { type } = metadata; + if (type === 'custom' && !this.validateCustomDecorators) { + return false; + } + return true; + } + /** + * Validates a value against a standard schema. + * Can be overridden to customize validation behavior. + * + * @param value The value to validate + * @param schema The standard schema to validate against + * @param options Optional options forwarded to the schema's validate method + * @returns The validation result + */ + validate(value, schema, options) { + return schema['~standard'].validate(value, options); + } + /** + * Strips dangerous prototype pollution keys from an object. + */ + stripProtoKeys(value) { + if (value == null || + typeof value !== 'object' || + types.isTypedArray(value)) { + return; + } + if (BUILT_IN_TYPES.some(type => value instanceof type)) { + return; + } + if (Array.isArray(value)) { + for (const v of value) { + this.stripProtoKeys(v); + } + return; + } + delete value.__proto__; + delete value.prototype; + const constructorType = value?.constructor; + if (constructorType && !BUILT_IN_TYPES.includes(constructorType)) { + delete value.constructor; + } + for (const key in value) { + this.stripProtoKeys(value[key]); + } + } +}; +StandardSchemaValidationPipe = __decorate([ + Injectable(), + __param(0, Optional()), + __metadata("design:paramtypes", [Object]) +], StandardSchemaValidationPipe); +export { StandardSchemaValidationPipe }; diff --git a/node_modules/@nestjs/common/pipes/validation.pipe.d.ts b/node_modules/@nestjs/common/pipes/validation.pipe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b809fc6bf3763711d39444798ac83df21aebd491 --- /dev/null +++ b/node_modules/@nestjs/common/pipes/validation.pipe.d.ts @@ -0,0 +1,51 @@ +import { ClassTransformOptions } from '../interfaces/external/class-transform-options.interface'; +import { TransformerPackage } from '../interfaces/external/transformer-package.interface'; +import { ValidationError } from '../interfaces/external/validation-error.interface'; +import { ValidatorOptions } from '../interfaces/external/validator-options.interface'; +import { ValidatorPackage } from '../interfaces/external/validator-package.interface'; +import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface'; +import { Type } from '../interfaces/type.interface'; +import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util'; +/** + * @publicApi + */ +export interface ValidationPipeOptions extends ValidatorOptions { + transform?: boolean; + disableErrorMessages?: boolean; + transformOptions?: ClassTransformOptions; + errorHttpStatusCode?: ErrorHttpStatusCode; + exceptionFactory?: (errors: ValidationError[]) => any; + validateCustomDecorators?: boolean; + expectedType?: Type; + validatorPackage?: ValidatorPackage; + transformerPackage?: TransformerPackage; +} +/** + * @see [Validation](https://docs.nestjs.com/techniques/validation) + * + * @publicApi + */ +export declare class ValidationPipe implements PipeTransform { + protected isTransformEnabled: boolean; + protected isDetailedOutputDisabled?: boolean; + protected validatorOptions: ValidatorOptions; + protected transformOptions: ClassTransformOptions | undefined; + protected errorHttpStatusCode: ErrorHttpStatusCode; + protected expectedType: Type | undefined; + protected exceptionFactory: (errors: ValidationError[]) => any; + protected validateCustomDecorators: boolean; + constructor(options?: ValidationPipeOptions); + protected loadValidator(validatorPackage?: ValidatorPackage): ValidatorPackage; + protected loadTransformer(transformerPackage?: TransformerPackage): TransformerPackage; + transform(value: any, metadata: ArgumentMetadata): Promise; + createExceptionFactory(): (validationErrors?: ValidationError[]) => unknown; + protected toValidate(metadata: ArgumentMetadata): boolean; + protected transformPrimitive(value: any, metadata: ArgumentMetadata): any; + protected toEmptyIfNil(value: T, metatype: Type | object): R | object | string; + protected stripProtoKeys(value: any): void; + protected isPrimitive(value: unknown): boolean; + protected validate(object: object, validatorOptions?: ValidatorOptions): Promise | ValidationError[]; + protected flattenValidationErrors(validationErrors: ValidationError[]): string[]; + protected mapChildrenToValidationErrors(error: ValidationError, parentPath?: string): ValidationError[]; + protected prependConstraintsWithParentProp(parentPath: string, error: ValidationError): ValidationError; +} diff --git a/node_modules/@nestjs/common/pipes/validation.pipe.js b/node_modules/@nestjs/common/pipes/validation.pipe.js new file mode 100644 index 0000000000000000000000000000000000000000..bd6472964c4ec9bd9ccee8be2050957c0a6446cd --- /dev/null +++ b/node_modules/@nestjs/common/pipes/validation.pipe.js @@ -0,0 +1,245 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValidationPipe = void 0; +const tslib_1 = require("tslib"); +const iterare_1 = require("iterare"); +const util_1 = require("util"); +const decorators_1 = require("../decorators"); +const core_1 = require("../decorators/core"); +const http_status_enum_1 = require("../enums/http-status.enum"); +const http_error_by_code_util_1 = require("../utils/http-error-by-code.util"); +const load_package_util_1 = require("../utils/load-package.util"); +const shared_utils_1 = require("../utils/shared.utils"); +let classValidator = {}; +let classTransformer = {}; +/** + * Built-in JavaScript types that should be excluded from prototype stripping + * to avoid conflicts with test frameworks like Jest's useFakeTimers + */ +const BUILT_IN_TYPES = [Date, RegExp, Error, Map, Set, WeakMap, WeakSet]; +/** + * @see [Validation](https://docs.nestjs.com/techniques/validation) + * + * @publicApi + */ +let ValidationPipe = class ValidationPipe { + constructor(options) { + options = options || {}; + const { transform, disableErrorMessages, errorHttpStatusCode, expectedType, transformOptions, validateCustomDecorators, ...validatorOptions } = options; + // @see [https://github.com/nestjs/nest/issues/10683#issuecomment-1413690508](https://github.com/nestjs/nest/issues/10683#issuecomment-1413690508) + this.validatorOptions = { forbidUnknownValues: false, ...validatorOptions }; + this.isTransformEnabled = !!transform; + this.transformOptions = transformOptions; + this.isDetailedOutputDisabled = disableErrorMessages; + this.validateCustomDecorators = validateCustomDecorators || false; + this.errorHttpStatusCode = errorHttpStatusCode || http_status_enum_1.HttpStatus.BAD_REQUEST; + this.expectedType = expectedType; + this.exceptionFactory = + options.exceptionFactory || this.createExceptionFactory(); + classValidator = this.loadValidator(options.validatorPackage); + classTransformer = this.loadTransformer(options.transformerPackage); + } + loadValidator(validatorPackage) { + return (validatorPackage ?? + (0, load_package_util_1.loadPackage)('class-validator', 'ValidationPipe', () => require('class-validator'))); + } + loadTransformer(transformerPackage) { + return (transformerPackage ?? + (0, load_package_util_1.loadPackage)('class-transformer', 'ValidationPipe', () => require('class-transformer'))); + } + async transform(value, metadata) { + if (this.expectedType) { + metadata = { ...metadata, metatype: this.expectedType }; + } + const metatype = metadata.metatype; + if (!metatype || !this.toValidate(metadata)) { + return this.isTransformEnabled + ? this.transformPrimitive(value, metadata) + : value; + } + const originalValue = value; + value = this.toEmptyIfNil(value, metatype); + const isNil = value !== originalValue; + const isPrimitive = this.isPrimitive(value); + this.stripProtoKeys(value); + let entity = classTransformer.plainToInstance(metatype, value, this.transformOptions); + const originalEntity = entity; + const isCtorNotEqual = entity.constructor !== metatype; + if (isCtorNotEqual && !isPrimitive) { + entity.constructor = metatype; + } + else if (isCtorNotEqual) { + // when "entity" is a primitive value, we have to temporarily + // replace the entity to perform the validation against the original + // metatype defined inside the handler + entity = { constructor: metatype }; + } + const errors = await this.validate(entity, this.validatorOptions); + if (errors.length > 0) { + throw await this.exceptionFactory(errors); + } + if (originalValue === undefined && originalEntity === '') { + // Since SWC requires empty string for validation (to avoid an error), + // a fallback is needed to revert to the original value (when undefined). + // @see [https://github.com/nestjs/nest/issues/14430](https://github.com/nestjs/nest/issues/14430) + return originalValue; + } + if (isPrimitive) { + // if the value is a primitive value and the validation process has been successfully completed + // we have to revert the original value passed through the pipe + entity = originalEntity; + } + if (this.isTransformEnabled) { + return entity; + } + if (isNil) { + // if the value was originally undefined or null, revert it back + return originalValue; + } + // we check if the number of keys of the "validatorOptions" is higher than 1 (instead of 0) + // because the "forbidUnknownValues" now fallbacks to "false" (in case it wasn't explicitly specified) + const shouldTransformToPlain = Object.keys(this.validatorOptions).length > 1; + return shouldTransformToPlain + ? classTransformer.classToPlain(entity, this.transformOptions) + : value; + } + createExceptionFactory() { + return (validationErrors = []) => { + if (this.isDetailedOutputDisabled) { + return new http_error_by_code_util_1.HttpErrorByCode[this.errorHttpStatusCode](); + } + const errors = this.flattenValidationErrors(validationErrors); + return new http_error_by_code_util_1.HttpErrorByCode[this.errorHttpStatusCode](errors); + }; + } + toValidate(metadata) { + const { metatype, type } = metadata; + if (type === 'custom' && !this.validateCustomDecorators) { + return false; + } + const types = [String, Boolean, Number, Array, Object, Buffer, Date]; + return !types.some(t => metatype === t) && !(0, shared_utils_1.isNil)(metatype); + } + transformPrimitive(value, metadata) { + if (!metadata.data) { + // leave top-level query/param objects unmodified + return value; + } + const { type, metatype } = metadata; + if (type !== 'param' && type !== 'query') { + return value; + } + if (metatype === Boolean) { + if ((0, shared_utils_1.isUndefined)(value)) { + // This is an workaround to deal with optional boolean values since + // optional booleans shouldn't be parsed to a valid boolean when + // they were not defined + return undefined; + } + // Any fasly value but `undefined` will be parsed to `false` + return value === true || value === 'true'; + } + if (metatype === Number) { + if ((0, shared_utils_1.isUndefined)(value)) { + // This is a workaround to deal with optional numeric values since + // optional numerics shouldn't be parsed to a valid number when + // they were not defined + return undefined; + } + return +value; + } + if (metatype === String && !(0, shared_utils_1.isUndefined)(value)) { + return String(value); + } + return value; + } + toEmptyIfNil(value, metatype) { + if (!(0, shared_utils_1.isNil)(value)) { + return value; + } + if (typeof metatype === 'function' || + (metatype && 'prototype' in metatype && metatype.prototype?.constructor)) { + return {}; + } + // SWC requires empty string to be returned instead of an empty object + // when the value is nil and the metatype is not a class instance, but a plain object (enum, for example). + // Otherwise, the error will be thrown. + // @see [https://github.com/nestjs/nest/issues/12680](https://github.com/nestjs/nest/issues/12680) + return ''; + } + stripProtoKeys(value) { + if (value == null || + typeof value !== 'object' || + util_1.types.isTypedArray(value)) { + return; + } + // Skip built-in JavaScript primitives to avoid Jest useFakeTimers conflicts + if (BUILT_IN_TYPES.some(type => value instanceof type)) { + return; + } + if (Array.isArray(value)) { + for (const v of value) { + this.stripProtoKeys(v); + } + return; + } + // Delete dangerous prototype pollution keys + delete value.__proto__; + delete value.prototype; + // Only delete constructor if it's NOT a built-in type + const constructorType = value?.constructor; + if (constructorType && !BUILT_IN_TYPES.includes(constructorType)) { + delete value.constructor; + } + for (const key in value) { + this.stripProtoKeys(value[key]); + } + } + isPrimitive(value) { + return ['number', 'boolean', 'string'].includes(typeof value); + } + validate(object, validatorOptions) { + return classValidator.validate(object, validatorOptions); + } + flattenValidationErrors(validationErrors) { + return (0, iterare_1.iterate)(validationErrors) + .map(error => this.mapChildrenToValidationErrors(error)) + .flatten() + .filter(item => !!item.constraints) + .map(item => Object.values(item.constraints)) + .flatten() + .toArray(); + } + mapChildrenToValidationErrors(error, parentPath) { + if (!(error.children && error.children.length)) { + return [error]; + } + const validationErrors = []; + parentPath = parentPath + ? `${parentPath}.${error.property}` + : error.property; + for (const item of error.children) { + if (item.children && item.children.length) { + validationErrors.push(...this.mapChildrenToValidationErrors(item, parentPath)); + } + validationErrors.push(this.prependConstraintsWithParentProp(parentPath, item)); + } + return validationErrors; + } + prependConstraintsWithParentProp(parentPath, error) { + const constraints = {}; + for (const key in error.constraints) { + constraints[key] = `${parentPath}.${error.constraints[key]}`; + } + return { + ...error, + constraints, + }; + } +}; +exports.ValidationPipe = ValidationPipe; +exports.ValidationPipe = ValidationPipe = tslib_1.__decorate([ + (0, core_1.Injectable)(), + tslib_1.__param(0, (0, decorators_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [Object]) +], ValidationPipe); diff --git a/node_modules/@nestjs/common/serializer/class-serializer.constants.d.ts b/node_modules/@nestjs/common/serializer/class-serializer.constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3de1155a5f3d3972d6e2b6c52e093413b326eba7 --- /dev/null +++ b/node_modules/@nestjs/common/serializer/class-serializer.constants.d.ts @@ -0,0 +1 @@ +export declare const CLASS_SERIALIZER_OPTIONS = "class_serializer:options"; diff --git a/node_modules/@nestjs/common/serializer/class-serializer.constants.js b/node_modules/@nestjs/common/serializer/class-serializer.constants.js new file mode 100644 index 0000000000000000000000000000000000000000..61fe53177b5943121514bf29a4647229e4d41159 --- /dev/null +++ b/node_modules/@nestjs/common/serializer/class-serializer.constants.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CLASS_SERIALIZER_OPTIONS = void 0; +exports.CLASS_SERIALIZER_OPTIONS = 'class_serializer:options'; diff --git a/node_modules/@nestjs/common/serializer/class-serializer.interceptor.d.ts b/node_modules/@nestjs/common/serializer/class-serializer.interceptor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..630ac64d9670dde867ffe582dd2d806a9400bac2 --- /dev/null +++ b/node_modules/@nestjs/common/serializer/class-serializer.interceptor.d.ts @@ -0,0 +1,29 @@ +import { ClassSerializerContextOptions } from './class-serializer.interfaces'; +import { Observable } from 'rxjs'; +import { CallHandler, ExecutionContext, NestInterceptor } from '../interfaces'; +import { ClassTransformOptions } from '../interfaces/external/class-transform-options.interface'; +import { TransformerPackage } from '../interfaces/external/transformer-package.interface'; +export interface PlainLiteralObject { + [key: string]: any; +} +/** + * @publicApi + */ +export interface ClassSerializerInterceptorOptions extends ClassTransformOptions { + transformerPackage?: TransformerPackage; +} +/** + * @publicApi + */ +export declare class ClassSerializerInterceptor implements NestInterceptor { + protected readonly reflector: any; + protected readonly defaultOptions: ClassSerializerInterceptorOptions; + constructor(reflector: any, defaultOptions?: ClassSerializerInterceptorOptions); + intercept(context: ExecutionContext, next: CallHandler): Observable; + /** + * Serializes responses that are non-null objects nor streamable files. + */ + serialize(response: PlainLiteralObject | Array, options: ClassSerializerContextOptions): PlainLiteralObject | Array; + transformToPlain(plainOrClass: any, options: ClassSerializerContextOptions): PlainLiteralObject; + protected getContextOptions(context: ExecutionContext): ClassSerializerContextOptions | undefined; +} diff --git a/node_modules/@nestjs/common/serializer/class-serializer.interceptor.js b/node_modules/@nestjs/common/serializer/class-serializer.interceptor.js new file mode 100644 index 0000000000000000000000000000000000000000..0a1a607354d132e655f90e01f14306e822924cff --- /dev/null +++ b/node_modules/@nestjs/common/serializer/class-serializer.interceptor.js @@ -0,0 +1,77 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassSerializerInterceptor = void 0; +const tslib_1 = require("tslib"); +const operators_1 = require("rxjs/operators"); +const core_1 = require("../decorators/core"); +const file_stream_1 = require("../file-stream"); +const load_package_util_1 = require("../utils/load-package.util"); +const shared_utils_1 = require("../utils/shared.utils"); +const class_serializer_constants_1 = require("./class-serializer.constants"); +let classTransformer = {}; +// NOTE (external) +// We need to deduplicate them here due to the circular dependency +// between core and common packages +const REFLECTOR = 'Reflector'; +/** + * @publicApi + */ +let ClassSerializerInterceptor = class ClassSerializerInterceptor { + constructor(reflector, defaultOptions = {}) { + this.reflector = reflector; + this.defaultOptions = defaultOptions; + classTransformer = + defaultOptions?.transformerPackage ?? + (0, load_package_util_1.loadPackage)('class-transformer', 'ClassSerializerInterceptor', () => require('class-transformer')); + if (!defaultOptions?.transformerPackage) { + require('class-transformer'); + } + } + intercept(context, next) { + const contextOptions = this.getContextOptions(context); + const options = { + ...this.defaultOptions, + ...contextOptions, + }; + return next + .handle() + .pipe((0, operators_1.map)((res) => this.serialize(res, options))); + } + /** + * Serializes responses that are non-null objects nor streamable files. + */ + serialize(response, options) { + if (!(0, shared_utils_1.isObject)(response) || response instanceof file_stream_1.StreamableFile) { + return response; + } + return Array.isArray(response) + ? response.map(item => this.transformToPlain(item, options)) + : this.transformToPlain(response, options); + } + transformToPlain(plainOrClass, options) { + if (!plainOrClass) { + return plainOrClass; + } + if (!options.type) { + return classTransformer.classToPlain(plainOrClass, options); + } + if (plainOrClass instanceof options.type) { + return classTransformer.classToPlain(plainOrClass, options); + } + const instance = classTransformer.plainToInstance(options.type, plainOrClass, options); + return classTransformer.classToPlain(instance, options); + } + getContextOptions(context) { + return this.reflector.getAllAndOverride(class_serializer_constants_1.CLASS_SERIALIZER_OPTIONS, [ + context.getHandler(), + context.getClass(), + ]); + } +}; +exports.ClassSerializerInterceptor = ClassSerializerInterceptor; +exports.ClassSerializerInterceptor = ClassSerializerInterceptor = tslib_1.__decorate([ + (0, core_1.Injectable)(), + tslib_1.__param(0, (0, core_1.Inject)(REFLECTOR)), + tslib_1.__param(1, (0, core_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [Object, Object]) +], ClassSerializerInterceptor); diff --git a/node_modules/@nestjs/common/serializer/class-serializer.interfaces.d.ts b/node_modules/@nestjs/common/serializer/class-serializer.interfaces.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..60df5d4d4ab5c5f26a44724599a9dbbd4a0362c5 --- /dev/null +++ b/node_modules/@nestjs/common/serializer/class-serializer.interfaces.d.ts @@ -0,0 +1,8 @@ +import { ClassTransformOptions } from '../interfaces/external/class-transform-options.interface'; +import { Type } from '../interfaces'; +/** + * @publicApi + */ +export interface ClassSerializerContextOptions extends ClassTransformOptions { + type?: Type; +} diff --git a/node_modules/@nestjs/common/serializer/class-serializer.interfaces.js b/node_modules/@nestjs/common/serializer/class-serializer.interfaces.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/common/serializer/class-serializer.interfaces.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/common/serializer/decorators/index.d.ts b/node_modules/@nestjs/common/serializer/decorators/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eff9f6fe4aa7ba34f3a68e88e0b51f591b04e431 --- /dev/null +++ b/node_modules/@nestjs/common/serializer/decorators/index.d.ts @@ -0,0 +1 @@ +export * from './serialize-options.decorator'; diff --git a/node_modules/@nestjs/common/serializer/decorators/index.js b/node_modules/@nestjs/common/serializer/decorators/index.js new file mode 100644 index 0000000000000000000000000000000000000000..db1daffe89a00a379ec0822d489fd29c0d7d5bdb --- /dev/null +++ b/node_modules/@nestjs/common/serializer/decorators/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./serialize-options.decorator"), exports); diff --git a/node_modules/@nestjs/common/serializer/decorators/serialize-options.decorator.d.ts b/node_modules/@nestjs/common/serializer/decorators/serialize-options.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cd547e028c046b4a7990d36c11c962851c7b91c6 --- /dev/null +++ b/node_modules/@nestjs/common/serializer/decorators/serialize-options.decorator.d.ts @@ -0,0 +1,5 @@ +import { ClassSerializerContextOptions } from '../class-serializer.interfaces'; +/** + * @publicApi + */ +export declare const SerializeOptions: (options: ClassSerializerContextOptions) => import("../../decorators").CustomDecorator; diff --git a/node_modules/@nestjs/common/serializer/decorators/serialize-options.decorator.js b/node_modules/@nestjs/common/serializer/decorators/serialize-options.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..0d1232a2498f7adae2f9602a245e412c7ffadfbe --- /dev/null +++ b/node_modules/@nestjs/common/serializer/decorators/serialize-options.decorator.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SerializeOptions = void 0; +const decorators_1 = require("../../decorators"); +const class_serializer_constants_1 = require("../class-serializer.constants"); +/** + * @publicApi + */ +const SerializeOptions = (options) => (0, decorators_1.SetMetadata)(class_serializer_constants_1.CLASS_SERIALIZER_OPTIONS, options); +exports.SerializeOptions = SerializeOptions; diff --git a/node_modules/@nestjs/common/serializer/index.d.ts b/node_modules/@nestjs/common/serializer/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..828c4aec44e6d999d9bae7b1d7ce32f98e7c18b1 --- /dev/null +++ b/node_modules/@nestjs/common/serializer/index.d.ts @@ -0,0 +1,3 @@ +export * from './class-serializer.interceptor'; +export * from './decorators'; +export * from './class-serializer.interfaces'; diff --git a/node_modules/@nestjs/common/serializer/index.js b/node_modules/@nestjs/common/serializer/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b0d74250e61ec54299762ebe7f5f956487a280d3 --- /dev/null +++ b/node_modules/@nestjs/common/serializer/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./class-serializer.interceptor"), exports); +tslib_1.__exportStar(require("./decorators"), exports); +tslib_1.__exportStar(require("./class-serializer.interfaces"), exports); diff --git a/node_modules/@nestjs/common/serializer/standard-schema-serializer.interceptor.d.ts b/node_modules/@nestjs/common/serializer/standard-schema-serializer.interceptor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a9420e07977ef15846b34801b87d8b052bf1d769 --- /dev/null +++ b/node_modules/@nestjs/common/serializer/standard-schema-serializer.interceptor.d.ts @@ -0,0 +1,50 @@ +import type { StandardSchemaV1 } from '@standard-schema/spec'; +import { Observable } from 'rxjs'; +import { CallHandler, ExecutionContext, NestInterceptor } from '../interfaces/index.js'; +import { StandardSchemaSerializerContextOptions } from './standard-schema-serializer.interfaces.js'; +interface PlainLiteralObject { + [key: string]: any; +} +/** + * @publicApi + */ +export interface StandardSchemaSerializerInterceptorOptions { + /** + * A default standard schema to use for serialization when no schema + * is provided via `@SerializeOptions()`. + */ + schema?: StandardSchemaV1; + /** + * Default options forwarded to the schema's `~standard.validate()` call. + * Can be overridden per-handler via `@SerializeOptions({ validateOptions })`. + */ + validateOptions?: StandardSchemaV1.Options; +} +/** + * An interceptor that serializes outgoing responses using a Standard Schema. + * + * The schema can be provided either: + * - As a default option in the interceptor constructor + * - Per-handler or per-class via `@SerializeOptions({ schema })` decorator + * + * When a schema is present, the interceptor validates/transforms the response + * through the schema's `~standard.validate()` method. If validation fails, + * the issues are thrown as an error. + * + * @see [Standard Schema](https://github.com/standard-schema/standard-schema) + * + * @publicApi + */ +export declare class StandardSchemaSerializerInterceptor implements NestInterceptor { + protected readonly reflector: any; + protected readonly defaultOptions: StandardSchemaSerializerInterceptorOptions; + constructor(reflector: any, defaultOptions?: StandardSchemaSerializerInterceptorOptions); + intercept(context: ExecutionContext, next: CallHandler): Observable; + /** + * Serializes responses that are non-null objects nor streamable files. + */ + serialize(response: PlainLiteralObject | Array, schema: StandardSchemaV1 | undefined, validateOptions?: StandardSchemaV1.Options): PlainLiteralObject | Array | Promise>; + transformToPlain(plainOrClass: any, schema: StandardSchemaV1, validateOptions?: StandardSchemaV1.Options): Promise; + protected getContextOptions(context: ExecutionContext): StandardSchemaSerializerContextOptions | undefined; +} +export {}; diff --git a/node_modules/@nestjs/common/serializer/standard-schema-serializer.interceptor.js b/node_modules/@nestjs/common/serializer/standard-schema-serializer.interceptor.js new file mode 100644 index 0000000000000000000000000000000000000000..bba704f0f75996c7e1514fd29a64f9c7a2c3d89e --- /dev/null +++ b/node_modules/@nestjs/common/serializer/standard-schema-serializer.interceptor.js @@ -0,0 +1,75 @@ +import { __decorate, __metadata, __param } from "tslib"; +import { map } from 'rxjs/operators'; +import { Inject, Injectable, Optional } from '../decorators/core/index.js'; +import { StreamableFile } from '../file-stream/index.js'; +import { isObject } from '../utils/shared.utils.js'; +import { CLASS_SERIALIZER_OPTIONS } from './class-serializer.constants.js'; +// NOTE (external) +// We need to deduplicate them here due to the circular dependency +// between core and common packages +const REFLECTOR = 'Reflector'; +/** + * An interceptor that serializes outgoing responses using a Standard Schema. + * + * The schema can be provided either: + * - As a default option in the interceptor constructor + * - Per-handler or per-class via `@SerializeOptions({ schema })` decorator + * + * When a schema is present, the interceptor validates/transforms the response + * through the schema's `~standard.validate()` method. If validation fails, + * the issues are thrown as an error. + * + * @see [Standard Schema](https://github.com/standard-schema/standard-schema) + * + * @publicApi + */ +let StandardSchemaSerializerInterceptor = class StandardSchemaSerializerInterceptor { + reflector; + defaultOptions; + constructor(reflector, defaultOptions = {}) { + this.reflector = reflector; + this.defaultOptions = defaultOptions; + } + intercept(context, next) { + const contextOptions = this.getContextOptions(context); + const schema = contextOptions?.schema ?? this.defaultOptions.schema; + const validateOptions = contextOptions?.validateOptions ?? this.defaultOptions.validateOptions; + return next + .handle() + .pipe(map((res) => this.serialize(res, schema, validateOptions))); + } + /** + * Serializes responses that are non-null objects nor streamable files. + */ + serialize(response, schema, validateOptions) { + if (!schema || !isObject(response) || response instanceof StreamableFile) { + return response; + } + return Array.isArray(response) + ? Promise.all(response.map(item => this.transformToPlain(item, schema, validateOptions))) + : this.transformToPlain(response, schema, validateOptions); + } + async transformToPlain(plainOrClass, schema, validateOptions) { + if (!plainOrClass) { + return plainOrClass; + } + const result = await schema['~standard'].validate(plainOrClass, validateOptions); + if (result.issues) { + throw new Error(`Serialization failed: ${result.issues.map(i => i.message).join(', ')}`); + } + return result.value; + } + getContextOptions(context) { + return this.reflector.getAllAndOverride(CLASS_SERIALIZER_OPTIONS, [ + context.getHandler(), + context.getClass(), + ]); + } +}; +StandardSchemaSerializerInterceptor = __decorate([ + Injectable(), + __param(0, Inject(REFLECTOR)), + __param(1, Optional()), + __metadata("design:paramtypes", [Object, Object]) +], StandardSchemaSerializerInterceptor); +export { StandardSchemaSerializerInterceptor }; diff --git a/node_modules/@nestjs/common/serializer/standard-schema-serializer.interfaces.d.ts b/node_modules/@nestjs/common/serializer/standard-schema-serializer.interfaces.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1aad5f92693f8e124b1cc7fb5f28fd4ac40a8fe5 --- /dev/null +++ b/node_modules/@nestjs/common/serializer/standard-schema-serializer.interfaces.d.ts @@ -0,0 +1,18 @@ +import type { StandardSchemaV1 } from '@standard-schema/spec'; +/** + * Options for the `StandardSchemaSerializerInterceptor`, passed via + * `@SerializeOptions({ schema })`. + * + * @publicApi + */ +export interface StandardSchemaSerializerContextOptions { + /** + * A standard schema to use for serialization. + * Used by `StandardSchemaSerializerInterceptor` to validate/transform the response. + */ + schema?: StandardSchemaV1; + /** + * Optional options forwarded to the schema's `~standard.validate()` call. + */ + validateOptions?: StandardSchemaV1.Options; +} diff --git a/node_modules/@nestjs/common/serializer/standard-schema-serializer.interfaces.js b/node_modules/@nestjs/common/serializer/standard-schema-serializer.interfaces.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/node_modules/@nestjs/common/serializer/standard-schema-serializer.interfaces.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@nestjs/common/services/console-logger.service.d.ts b/node_modules/@nestjs/common/services/console-logger.service.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..68eb1945d67df7f1450285ffc780e7675c7ce7dc --- /dev/null +++ b/node_modules/@nestjs/common/services/console-logger.service.d.ts @@ -0,0 +1,213 @@ +import { InspectOptions } from 'util'; +import { LoggerService, LogLevel } from './logger.service'; +/** + * @publicApi + */ +export interface ConsoleLoggerOptions { + /** + * Enabled log levels. + */ + logLevels?: LogLevel[]; + /** + * If enabled, will print timestamp (time difference) between current and previous log message. + * Note: This option is not used when `json` is enabled. + */ + timestamp?: boolean; + /** + * A prefix to be used for each log message. + * Note: This option is not used when `json` is enabled. + */ + prefix?: string; + /** + * If enabled, will print the log message in JSON format. + */ + json?: boolean; + /** + * If enabled, will print the log message in color. + * Default true if json is disabled, false otherwise + */ + colors?: boolean; + /** + * The context of the logger. + */ + context?: string; + /** + * If enabled, will force the use of console.log/console.error instead of process.stdout/stderr.write. + * This is useful for test environments like Jest that can buffer console calls. + * @default false + */ + forceConsole?: boolean; + /** + * If enabled, will print the log message in a single line, even if it is an object with multiple properties. + * If set to a number, the most n inner elements are united on a single line as long as all properties fit into breakLength. Short array elements are also grouped together. + * Default true when `json` is enabled, false otherwise. + */ + compact?: boolean | number; + /** + * Specifies the maximum number of Array, TypedArray, Map, Set, WeakMap, and WeakSet elements to include when formatting. + * Set to null or Infinity to show all elements. Set to 0 or negative to show no elements. + * Ignored when `json` is enabled, colors are disabled, and `compact` is set to true as it produces a parseable JSON output. + * @default 100 + */ + maxArrayLength?: number; + /** + * Specifies the maximum number of characters to include when formatting. + * Set to null or Infinity to show all elements. Set to 0 or negative to show no characters. + * Ignored when `json` is enabled, colors are disabled, and `compact` is set to true as it produces a parseable JSON output. + * @default 10000. + */ + maxStringLength?: number; + /** + * If enabled, will sort keys while formatting objects. + * Can also be a custom sorting function. + * Ignored when `json` is enabled, colors are disabled, and `compact` is set to true as it produces a parseable JSON output. + * @default false + */ + sorted?: boolean | ((a: string, b: string) => number); + /** + * Specifies the number of times to recurse while formatting object. + * This is useful for inspecting large objects. To recurse up to the maximum call stack size pass Infinity or null. + * Ignored when `json` is enabled, colors are disabled, and `compact` is set to true as it produces a parseable JSON output. + * @default 5 + */ + depth?: number; + /** + * If true, object's non-enumerable symbols and properties are included in the formatted result. + * WeakMap and WeakSet entries are also included as well as user defined prototype properties + * @default false + */ + showHidden?: boolean; + /** + * The length at which input values are split across multiple lines. Set to Infinity to format the input as a single line (in combination with "compact" set to true). + * Default Infinity when "compact" is true, 80 otherwise. + * Ignored when `json` is enabled, colors are disabled, and `compact` is set to true as it produces a parseable JSON output. + */ + breakLength?: number; +} +/** + * @publicApi + */ +export declare class ConsoleLogger implements LoggerService { + /** + * The options of the logger. + */ + protected options: ConsoleLoggerOptions; + /** + * The context of the logger (can be set manually or automatically inferred). + */ + protected context?: string; + /** + * The original context of the logger (set in the constructor). + */ + protected originalContext?: string; + /** + * The options used for the "inspect" method. + */ + protected inspectOptions: InspectOptions; + /** + * The last timestamp at which the log message was printed. + */ + protected static lastTimestampAt?: number; + constructor(); + constructor(context: string); + constructor(options: ConsoleLoggerOptions); + constructor(context: string, options: ConsoleLoggerOptions); + /** + * Write a 'log' level log, if the configured level allows for it. + * Prints to `stdout` with newline. + */ + log(message: any, context?: string): void; + log(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write an 'error' level log, if the configured level allows for it. + * Prints to `stderr` with newline. + */ + error(message: any, stackOrContext?: string): void; + error(message: any, stack?: string, context?: string): void; + error(message: any, ...optionalParams: [...any, string?, string?]): void; + /** + * Write a 'warn' level log, if the configured level allows for it. + * Prints to `stdout` with newline. + */ + warn(message: any, context?: string): void; + warn(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'debug' level log, if the configured level allows for it. + * Prints to `stdout` with newline. + */ + debug(message: any, context?: string): void; + debug(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'verbose' level log, if the configured level allows for it. + * Prints to `stdout` with newline. + */ + verbose(message: any, context?: string): void; + verbose(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'fatal' level log, if the configured level allows for it. + * Prints to `stdout` with newline. + */ + fatal(message: any, context?: string): void; + fatal(message: any, ...optionalParams: [...any, string?]): void; + /** + * Set log levels + * @param levels log levels + */ + setLogLevels(levels: LogLevel[]): void; + /** + * Set logger context + * @param context context + */ + setContext(context: string): void; + /** + * Resets the logger context to the value that was passed in the constructor. + */ + resetContext(): void; + isLevelEnabled(level: LogLevel): boolean; + protected getTimestamp(): string; + protected printMessages(messages: unknown[], context?: string, logLevel?: LogLevel, writeStreamType?: 'stdout' | 'stderr', errorStack?: unknown): void; + protected printAsJson(message: unknown, options: { + context: string; + logLevel: LogLevel; + writeStreamType?: 'stdout' | 'stderr'; + errorStack?: unknown; + }): void; + protected getJsonLogObject(message: unknown, options: { + context: string; + logLevel: LogLevel; + writeStreamType?: 'stdout' | 'stderr'; + errorStack?: unknown; + }): { + level: LogLevel; + pid: number; + timestamp: number; + message: unknown; + context?: string; + stack?: unknown; + }; + protected formatPid(pid: number): string; + protected formatContext(context: string): string; + protected formatMessage(logLevel: LogLevel, message: unknown, pidMessage: string, formattedLogLevel: string, contextMessage: string, timestampDiff: string): string; + protected stringifyMessage(message: unknown, logLevel: LogLevel): any; + protected colorize(message: string, logLevel: LogLevel): string; + protected printStackTrace(stack: string): void; + protected updateAndGetTimestampDiff(): string; + protected formatTimestampDiff(timestampDiff: number): string; + protected getInspectOptions(): InspectOptions; + protected stringifyReplacer(key: string, value: unknown): unknown; + protected getContextAndMessagesToPrint(args: unknown[]): { + messages: unknown[]; + context: string | undefined; + }; + protected getContextAndStackAndMessagesToPrint(args: unknown[]): { + messages: unknown[]; + context: string | undefined; + stack?: undefined; + } | { + stack: string | undefined; + messages: unknown[]; + context: string | undefined; + }; + protected isStackFormat(stack: unknown): boolean; + protected getColorByLogLevel(level: LogLevel): (text: string) => string; +} diff --git a/node_modules/@nestjs/common/services/console-logger.service.js b/node_modules/@nestjs/common/services/console-logger.service.js new file mode 100644 index 0000000000000000000000000000000000000000..26713f7a3765659efd8f1059efe6cbb2b9438ee4 --- /dev/null +++ b/node_modules/@nestjs/common/services/console-logger.service.js @@ -0,0 +1,379 @@ +"use strict"; +var ConsoleLogger_1; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConsoleLogger = void 0; +const tslib_1 = require("tslib"); +const util_1 = require("util"); +const core_1 = require("../decorators/core"); +const cli_colors_util_1 = require("../utils/cli-colors.util"); +const shared_utils_1 = require("../utils/shared.utils"); +const is_log_level_enabled_util_1 = require("./utils/is-log-level-enabled.util"); +const DEFAULT_DEPTH = 5; +const DEFAULT_LOG_LEVELS = [ + 'log', + 'error', + 'warn', + 'debug', + 'verbose', + 'fatal', +]; +const dateTimeFormatter = new Intl.DateTimeFormat(undefined, { + year: 'numeric', + hour: 'numeric', + minute: 'numeric', + second: 'numeric', + day: '2-digit', + month: '2-digit', +}); +/** + * @publicApi + */ +let ConsoleLogger = ConsoleLogger_1 = class ConsoleLogger { + constructor(contextOrOptions, options) { + // eslint-disable-next-line prefer-const + let [context, opts] = (0, shared_utils_1.isString)(contextOrOptions) + ? [contextOrOptions, options] + : options + ? [undefined, options] + : [contextOrOptions?.context, contextOrOptions]; + opts = opts ?? {}; + opts.logLevels ??= DEFAULT_LOG_LEVELS; + opts.colors ??= opts.colors ?? (opts.json ? false : (0, cli_colors_util_1.isColorAllowed)()); + opts.prefix ??= 'Nest'; + this.options = opts; + this.inspectOptions = this.getInspectOptions(); + if (context) { + this.context = context; + this.originalContext = context; + } + } + log(message, ...optionalParams) { + if (!this.isLevelEnabled('log')) { + return; + } + const { messages, context } = this.getContextAndMessagesToPrint([ + message, + ...optionalParams, + ]); + this.printMessages(messages, context, 'log'); + } + error(message, ...optionalParams) { + if (!this.isLevelEnabled('error')) { + return; + } + const { messages, context, stack } = this.getContextAndStackAndMessagesToPrint([message, ...optionalParams]); + this.printMessages(messages, context, 'error', 'stderr', stack); + this.printStackTrace(stack); + } + warn(message, ...optionalParams) { + if (!this.isLevelEnabled('warn')) { + return; + } + const { messages, context } = this.getContextAndMessagesToPrint([ + message, + ...optionalParams, + ]); + this.printMessages(messages, context, 'warn'); + } + debug(message, ...optionalParams) { + if (!this.isLevelEnabled('debug')) { + return; + } + const { messages, context } = this.getContextAndMessagesToPrint([ + message, + ...optionalParams, + ]); + this.printMessages(messages, context, 'debug'); + } + verbose(message, ...optionalParams) { + if (!this.isLevelEnabled('verbose')) { + return; + } + const { messages, context } = this.getContextAndMessagesToPrint([ + message, + ...optionalParams, + ]); + this.printMessages(messages, context, 'verbose'); + } + fatal(message, ...optionalParams) { + if (!this.isLevelEnabled('fatal')) { + return; + } + const { messages, context } = this.getContextAndMessagesToPrint([ + message, + ...optionalParams, + ]); + this.printMessages(messages, context, 'fatal'); + } + /** + * Set log levels + * @param levels log levels + */ + setLogLevels(levels) { + if (!this.options) { + this.options = {}; + } + this.options.logLevels = levels; + } + /** + * Set logger context + * @param context context + */ + setContext(context) { + this.context = context; + } + /** + * Resets the logger context to the value that was passed in the constructor. + */ + resetContext() { + this.context = this.originalContext; + } + isLevelEnabled(level) { + const logLevels = this.options?.logLevels; + return (0, is_log_level_enabled_util_1.isLogLevelEnabled)(level, logLevels); + } + getTimestamp() { + return dateTimeFormatter.format(Date.now()); + } + printMessages(messages, context = '', logLevel = 'log', writeStreamType, errorStack) { + messages.forEach(message => { + if (this.options.json) { + this.printAsJson(message, { + context, + logLevel, + writeStreamType, + errorStack, + }); + return; + } + const pidMessage = this.formatPid(process.pid); + const contextMessage = this.formatContext(context); + const timestampDiff = this.updateAndGetTimestampDiff(); + const formattedLogLevel = logLevel.toUpperCase().padStart(7, ' '); + const formattedMessage = this.formatMessage(logLevel, message, pidMessage, formattedLogLevel, contextMessage, timestampDiff); + if (this.options.forceConsole) { + if (writeStreamType === 'stderr') { + console.error(formattedMessage.trim()); + } + else { + console.log(formattedMessage.trim()); + } + } + else { + process[writeStreamType ?? 'stdout'].write(formattedMessage); + } + }); + } + printAsJson(message, options) { + const logObject = this.getJsonLogObject(message, options); + const formattedMessage = !this.options.colors && this.inspectOptions.compact === true + ? JSON.stringify(logObject, this.stringifyReplacer) + : (0, util_1.inspect)(logObject, this.inspectOptions); + if (this.options.forceConsole) { + if (options.writeStreamType === 'stderr') { + console.error(formattedMessage); + } + else { + console.log(formattedMessage); + } + } + else { + process[options.writeStreamType ?? 'stdout'].write(`${formattedMessage}\n`); + } + } + getJsonLogObject(message, options) { + const logObject = { + level: options.logLevel, + pid: process.pid, + timestamp: Date.now(), + message, + }; + if (options.context) { + logObject.context = options.context; + } + if (options.errorStack) { + logObject.stack = options.errorStack; + } + return logObject; + } + formatPid(pid) { + return `[${this.options.prefix}] ${pid} - `; + } + formatContext(context) { + if (!context) { + return ''; + } + context = `[${context}] `; + return this.options.colors ? (0, cli_colors_util_1.yellow)(context) : context; + } + formatMessage(logLevel, message, pidMessage, formattedLogLevel, contextMessage, timestampDiff) { + const output = this.stringifyMessage(message, logLevel); + pidMessage = this.colorize(pidMessage, logLevel); + formattedLogLevel = this.colorize(formattedLogLevel, logLevel); + return `${pidMessage}${this.getTimestamp()} ${formattedLogLevel} ${contextMessage}${output}${timestampDiff}\n`; + } + stringifyMessage(message, logLevel) { + if ((0, shared_utils_1.isFunction)(message)) { + const messageAsStr = Function.prototype.toString.call(message); + const isClass = messageAsStr.startsWith('class '); + if (isClass) { + // If the message is a class, we will display the class name. + return this.stringifyMessage(message.name, logLevel); + } + // If the message is a non-class function, call it and re-resolve its value. + return this.stringifyMessage(message(), logLevel); + } + if (typeof message === 'string') { + return this.colorize(message, logLevel); + } + const outputText = (0, util_1.inspect)(message, this.inspectOptions); + if ((0, shared_utils_1.isPlainObject)(message)) { + return `Object(${Object.keys(message).length}) ${outputText}`; + } + if (Array.isArray(message)) { + return `Array(${message.length}) ${outputText}`; + } + return outputText; + } + colorize(message, logLevel) { + if (!this.options.colors || this.options.json) { + return message; + } + const color = this.getColorByLogLevel(logLevel); + return color(message); + } + printStackTrace(stack) { + if (!stack || this.options.json) { + return; + } + if (this.options.forceConsole) { + console.error(stack); + } + else { + process.stderr.write(`${stack}\n`); + } + } + updateAndGetTimestampDiff() { + const includeTimestamp = ConsoleLogger_1.lastTimestampAt && this.options?.timestamp; + const result = includeTimestamp + ? this.formatTimestampDiff(Date.now() - ConsoleLogger_1.lastTimestampAt) + : ''; + ConsoleLogger_1.lastTimestampAt = Date.now(); + return result; + } + formatTimestampDiff(timestampDiff) { + const formattedDiff = ` +${timestampDiff}ms`; + return this.options.colors ? (0, cli_colors_util_1.yellow)(formattedDiff) : formattedDiff; + } + getInspectOptions() { + let breakLength = this.options.breakLength; + if (typeof breakLength === 'undefined') { + breakLength = this.options.colors + ? this.options.compact + ? Infinity + : undefined + : this.options.compact === false + ? undefined + : Infinity; // default breakLength to Infinity if inline is not set and colors is false + } + const inspectOptions = { + depth: this.options.depth ?? DEFAULT_DEPTH, + sorted: this.options.sorted, + showHidden: this.options.showHidden, + compact: this.options.compact ?? (this.options.json ? true : false), + colors: this.options.colors, + breakLength, + }; + if (typeof this.options.maxArrayLength !== 'undefined') { + inspectOptions.maxArrayLength = this.options.maxArrayLength; + } + if (typeof this.options.maxStringLength !== 'undefined') { + inspectOptions.maxStringLength = this.options.maxStringLength; + } + return inspectOptions; + } + stringifyReplacer(key, value) { + // Mimic util.inspect behavior for JSON logger with compact on and colors off + if (typeof value === 'bigint') { + return value.toString(); + } + if (typeof value === 'symbol') { + return value.toString(); + } + if (value instanceof Map || + value instanceof Set || + value instanceof Error) { + return `${(0, util_1.inspect)(value, this.inspectOptions)}`; + } + return value; + } + getContextAndMessagesToPrint(args) { + if (args?.length <= 1) { + return { messages: args, context: this.context }; + } + const lastElement = args[args.length - 1]; + const isContext = (0, shared_utils_1.isString)(lastElement); + if (!isContext) { + return { messages: args, context: this.context }; + } + return { + context: lastElement, + messages: args.slice(0, args.length - 1), + }; + } + getContextAndStackAndMessagesToPrint(args) { + if (args.length === 2) { + return this.isStackFormat(args[1]) + ? { + messages: [args[0]], + stack: args[1], + context: this.context, + } + : { ...this.getContextAndMessagesToPrint(args) }; + } + const { messages, context } = this.getContextAndMessagesToPrint(args); + if (messages?.length <= 1) { + return { messages, context }; + } + const lastElement = messages[messages.length - 1]; + const isStack = (0, shared_utils_1.isString)(lastElement); + // https://github.com/nestjs/nest/issues/11074#issuecomment-1421680060 + if (!isStack && !(0, shared_utils_1.isUndefined)(lastElement)) { + return { messages, context }; + } + return { + stack: lastElement, + messages: messages.slice(0, messages.length - 1), + context, + }; + } + isStackFormat(stack) { + if (!(0, shared_utils_1.isString)(stack) && !(0, shared_utils_1.isUndefined)(stack)) { + return false; + } + return /^(.)+\n\s+at .+:\d+:\d+/.test(stack); + } + getColorByLogLevel(level) { + switch (level) { + case 'debug': + return cli_colors_util_1.clc.magentaBright; + case 'warn': + return cli_colors_util_1.clc.yellow; + case 'error': + return cli_colors_util_1.clc.red; + case 'verbose': + return cli_colors_util_1.clc.cyanBright; + case 'fatal': + return cli_colors_util_1.clc.bold; + default: + return cli_colors_util_1.clc.green; + } + } +}; +exports.ConsoleLogger = ConsoleLogger; +exports.ConsoleLogger = ConsoleLogger = ConsoleLogger_1 = tslib_1.__decorate([ + (0, core_1.Injectable)(), + tslib_1.__param(0, (0, core_1.Optional)()), + tslib_1.__param(1, (0, core_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [Object, Object]) +], ConsoleLogger); diff --git a/node_modules/@nestjs/common/services/index.d.ts b/node_modules/@nestjs/common/services/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c1cad965b63a5be8391a7d72da29e7b61b03b5cd --- /dev/null +++ b/node_modules/@nestjs/common/services/index.d.ts @@ -0,0 +1,3 @@ +export * from './console-logger.service'; +export * from './logger.service'; +export * from './utils/filter-log-levels.util'; diff --git a/node_modules/@nestjs/common/services/index.js b/node_modules/@nestjs/common/services/index.js new file mode 100644 index 0000000000000000000000000000000000000000..95e99180e4912771efa1a75da638ca9a265032d7 --- /dev/null +++ b/node_modules/@nestjs/common/services/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./console-logger.service"), exports); +tslib_1.__exportStar(require("./logger.service"), exports); +tslib_1.__exportStar(require("./utils/filter-log-levels.util"), exports); diff --git a/node_modules/@nestjs/common/services/logger.service.d.ts b/node_modules/@nestjs/common/services/logger.service.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..917ec98662499c8e9f54a495517308afdaffe806 --- /dev/null +++ b/node_modules/@nestjs/common/services/logger.service.d.ts @@ -0,0 +1,152 @@ +export declare const LOG_LEVELS: ["verbose", "debug", "log", "warn", "error", "fatal"]; +/** + * @publicApi + */ +export type LogLevel = (typeof LOG_LEVELS)[number]; +/** + * @publicApi + */ +export interface LoggerService { + /** + * Write a 'log' level log. + */ + log(message: any, ...optionalParams: any[]): any; + /** + * Write an 'error' level log. + */ + error(message: any, ...optionalParams: any[]): any; + /** + * Write a 'warn' level log. + */ + warn(message: any, ...optionalParams: any[]): any; + /** + * Write a 'debug' level log. + */ + debug?(message: any, ...optionalParams: any[]): any; + /** + * Write a 'verbose' level log. + */ + verbose?(message: any, ...optionalParams: any[]): any; + /** + * Write a 'fatal' level log. + */ + fatal?(message: any, ...optionalParams: any[]): any; + /** + * Set log levels. + * @param levels log levels + */ + setLogLevels?(levels: LogLevel[]): any; +} +interface LogBufferRecord { + /** + * Method to execute. + */ + methodRef: Function; + /** + * Arguments to pass to the method. + */ + arguments: unknown[]; +} +/** + * @publicApi + */ +export declare class Logger implements LoggerService { + protected context?: string | undefined; + protected options: { + timestamp?: boolean; + }; + protected static logBuffer: LogBufferRecord[]; + protected static staticInstanceRef?: LoggerService; + protected static logLevels?: LogLevel[]; + private static isBufferAttached; + protected localInstanceRef?: LoggerService; + private static WrapBuffer; + constructor(); + constructor(context: string); + constructor(context: string, options?: { + timestamp?: boolean; + }); + get localInstance(): LoggerService; + /** + * Write an 'error' level log. + */ + error(message: any, stack?: string, context?: string): void; + error(message: any, ...optionalParams: [...any, string?, string?]): void; + /** + * Write a 'log' level log. + */ + log(message: any, context?: string): void; + log(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'warn' level log. + */ + warn(message: any, context?: string): void; + warn(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'debug' level log. + */ + debug(message: any, context?: string): void; + debug(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'verbose' level log. + */ + verbose(message: any, context?: string): void; + verbose(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'fatal' level log. + */ + fatal(message: any, context?: string): void; + fatal(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write an 'error' level log. + */ + static error(message: any, stackOrContext?: string): void; + static error(message: any, context?: string): void; + static error(message: any, stack?: string, context?: string): void; + static error(message: any, ...optionalParams: [...any, string?, string?]): void; + /** + * Write a 'log' level log. + */ + static log(message: any, context?: string): void; + static log(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'warn' level log. + */ + static warn(message: any, context?: string): void; + static warn(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'debug' level log, if the configured level allows for it. + * Prints to `stdout` with newline. + */ + static debug(message: any, context?: string): void; + static debug(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'verbose' level log. + */ + static verbose(message: any, context?: string): void; + static verbose(message: any, ...optionalParams: [...any, string?]): void; + /** + * Write a 'fatal' level log. + */ + static fatal(message: any, context?: string): void; + static fatal(message: any, ...optionalParams: [...any, string?]): void; + /** + * Print buffered logs and detach buffer. + */ + static flush(): void; + /** + * Attach buffer. + * Turns on initialization logs buffering. + */ + static attachBuffer(): void; + /** + * Detach buffer. + * Turns off initialization logs buffering. + */ + static detachBuffer(): void; + static getTimestamp(): string; + static overrideLogger(logger: LoggerService | LogLevel[] | boolean): any; + static isLevelEnabled(level: LogLevel): boolean; + private registerLocalInstanceRef; +} +export {}; diff --git a/node_modules/@nestjs/common/services/logger.service.js b/node_modules/@nestjs/common/services/logger.service.js new file mode 100644 index 0000000000000000000000000000000000000000..ca906737a6c50ad0fc13ae0fe47409cd7c80117e --- /dev/null +++ b/node_modules/@nestjs/common/services/logger.service.js @@ -0,0 +1,251 @@ +"use strict"; +var Logger_1; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Logger = exports.LOG_LEVELS = void 0; +const tslib_1 = require("tslib"); +const core_1 = require("../decorators/core"); +const shared_utils_1 = require("../utils/shared.utils"); +const console_logger_service_1 = require("./console-logger.service"); +const utils_1 = require("./utils"); +exports.LOG_LEVELS = [ + 'verbose', + 'debug', + 'log', + 'warn', + 'error', + 'fatal', +]; +const DEFAULT_LOGGER = new console_logger_service_1.ConsoleLogger(); +const dateTimeFormatter = new Intl.DateTimeFormat(undefined, { + year: 'numeric', + hour: 'numeric', + minute: 'numeric', + second: 'numeric', + day: '2-digit', + month: '2-digit', +}); +/** + * @publicApi + */ +let Logger = Logger_1 = class Logger { + constructor(context, options = {}) { + this.context = context; + this.options = options; + } + get localInstance() { + if (Logger_1.staticInstanceRef === DEFAULT_LOGGER) { + return this.registerLocalInstanceRef(); + } + else if (Logger_1.staticInstanceRef instanceof Logger_1) { + const prototype = Object.getPrototypeOf(Logger_1.staticInstanceRef); + if (prototype.constructor === Logger_1) { + return this.registerLocalInstanceRef(); + } + } + return Logger_1.staticInstanceRef; + } + error(message, ...optionalParams) { + optionalParams = this.context + ? (optionalParams.length ? optionalParams : [undefined]).concat(this.context) + : optionalParams; + this.localInstance?.error(message, ...optionalParams); + } + log(message, ...optionalParams) { + optionalParams = this.context + ? optionalParams.concat(this.context) + : optionalParams; + this.localInstance?.log(message, ...optionalParams); + } + warn(message, ...optionalParams) { + optionalParams = this.context + ? optionalParams.concat(this.context) + : optionalParams; + this.localInstance?.warn(message, ...optionalParams); + } + debug(message, ...optionalParams) { + optionalParams = this.context + ? optionalParams.concat(this.context) + : optionalParams; + this.localInstance?.debug?.(message, ...optionalParams); + } + verbose(message, ...optionalParams) { + optionalParams = this.context + ? optionalParams.concat(this.context) + : optionalParams; + this.localInstance?.verbose?.(message, ...optionalParams); + } + fatal(message, ...optionalParams) { + optionalParams = this.context + ? optionalParams.concat(this.context) + : optionalParams; + this.localInstance?.fatal?.(message, ...optionalParams); + } + static error(message, ...optionalParams) { + this.staticInstanceRef?.error(message, ...optionalParams); + } + static log(message, ...optionalParams) { + this.staticInstanceRef?.log(message, ...optionalParams); + } + static warn(message, ...optionalParams) { + this.staticInstanceRef?.warn(message, ...optionalParams); + } + static debug(message, ...optionalParams) { + this.staticInstanceRef?.debug?.(message, ...optionalParams); + } + static verbose(message, ...optionalParams) { + this.staticInstanceRef?.verbose?.(message, ...optionalParams); + } + static fatal(message, ...optionalParams) { + this.staticInstanceRef?.fatal?.(message, ...optionalParams); + } + /** + * Print buffered logs and detach buffer. + */ + static flush() { + this.isBufferAttached = false; + this.logBuffer.forEach(item => item.methodRef(...item.arguments)); + this.logBuffer = []; + } + /** + * Attach buffer. + * Turns on initialization logs buffering. + */ + static attachBuffer() { + this.isBufferAttached = true; + } + /** + * Detach buffer. + * Turns off initialization logs buffering. + */ + static detachBuffer() { + this.isBufferAttached = false; + } + static getTimestamp() { + return dateTimeFormatter.format(Date.now()); + } + static overrideLogger(logger) { + if (Array.isArray(logger)) { + Logger_1.logLevels = logger; + return this.staticInstanceRef?.setLogLevels?.(logger); + } + if ((0, shared_utils_1.isObject)(logger)) { + if (logger instanceof Logger_1 && logger.constructor !== Logger_1) { + const errorMessage = `Using the "extends Logger" instruction is not allowed in Nest v9. Please, use "extends ConsoleLogger" instead.`; + this.staticInstanceRef?.error(errorMessage); + throw new Error(errorMessage); + } + this.staticInstanceRef = logger; + } + else { + this.staticInstanceRef = undefined; + } + } + static isLevelEnabled(level) { + const logLevels = Logger_1.logLevels; + return (0, utils_1.isLogLevelEnabled)(level, logLevels); + } + registerLocalInstanceRef() { + if (this.localInstanceRef) { + return this.localInstanceRef; + } + this.localInstanceRef = new console_logger_service_1.ConsoleLogger(this.context, { + timestamp: this.options?.timestamp, + logLevels: Logger_1.logLevels, + }); + return this.localInstanceRef; + } +}; +exports.Logger = Logger; +Logger.logBuffer = new Array(); +Logger.staticInstanceRef = DEFAULT_LOGGER; +Logger.WrapBuffer = (target, propertyKey, descriptor) => { + const originalFn = descriptor.value; + descriptor.value = function (...args) { + if (Logger_1.isBufferAttached) { + Logger_1.logBuffer.push({ + methodRef: originalFn.bind(this), + arguments: args, + }); + return; + } + return originalFn.call(this, ...args); + }; +}; +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger.prototype, "error", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger.prototype, "log", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger.prototype, "warn", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger.prototype, "debug", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger.prototype, "verbose", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger.prototype, "fatal", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger, "error", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger, "log", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger, "warn", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger, "debug", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger, "verbose", null); +tslib_1.__decorate([ + Logger.WrapBuffer, + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Object, Object]), + tslib_1.__metadata("design:returntype", void 0) +], Logger, "fatal", null); +exports.Logger = Logger = Logger_1 = tslib_1.__decorate([ + (0, core_1.Injectable)(), + tslib_1.__param(0, (0, core_1.Optional)()), + tslib_1.__param(1, (0, core_1.Optional)()), + tslib_1.__metadata("design:paramtypes", [String, Object]) +], Logger); diff --git a/node_modules/@nestjs/common/services/utils/filter-log-levels.util.d.ts b/node_modules/@nestjs/common/services/utils/filter-log-levels.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d85f9846ccd029f8cc908ee07c4cb661148a54a5 --- /dev/null +++ b/node_modules/@nestjs/common/services/utils/filter-log-levels.util.d.ts @@ -0,0 +1,5 @@ +import { LogLevel } from '../logger.service'; +/** + * @publicApi + */ +export declare function filterLogLevels(parseableString?: string): LogLevel[]; diff --git a/node_modules/@nestjs/common/services/utils/filter-log-levels.util.js b/node_modules/@nestjs/common/services/utils/filter-log-levels.util.js new file mode 100644 index 0000000000000000000000000000000000000000..6586b865eab5bf0e106d2bb109dd7bd71ee7258f --- /dev/null +++ b/node_modules/@nestjs/common/services/utils/filter-log-levels.util.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.filterLogLevels = filterLogLevels; +const logger_service_1 = require("../logger.service"); +const is_log_level_util_1 = require("./is-log-level.util"); +/** + * @publicApi + */ +function filterLogLevels(parseableString = '') { + const sanitizedString = parseableString.replaceAll(' ', '').toLowerCase(); + if (sanitizedString[0] === '>') { + const orEqual = sanitizedString[1] === '='; + const logLevelIndex = logger_service_1.LOG_LEVELS.indexOf(sanitizedString.substring(orEqual ? 2 : 1)); + if (logLevelIndex === -1) { + throw new Error(`parse error (unknown log level): ${sanitizedString}`); + } + return logger_service_1.LOG_LEVELS.slice(orEqual ? logLevelIndex : logLevelIndex + 1); + } + else if (sanitizedString.includes(',')) { + return sanitizedString.split(',').filter(is_log_level_util_1.isLogLevel); + } + return (0, is_log_level_util_1.isLogLevel)(sanitizedString) ? [sanitizedString] : logger_service_1.LOG_LEVELS; +} diff --git a/node_modules/@nestjs/common/services/utils/index.d.ts b/node_modules/@nestjs/common/services/utils/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e6ad9430160cb5c067f975aead9e249e9bf26a14 --- /dev/null +++ b/node_modules/@nestjs/common/services/utils/index.d.ts @@ -0,0 +1,3 @@ +export * from './filter-log-levels.util'; +export * from './is-log-level-enabled.util'; +export * from './is-log-level.util'; diff --git a/node_modules/@nestjs/common/services/utils/index.js b/node_modules/@nestjs/common/services/utils/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a2d51ae220cb83db1da2c8b8550181090e9242ee --- /dev/null +++ b/node_modules/@nestjs/common/services/utils/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./filter-log-levels.util"), exports); +tslib_1.__exportStar(require("./is-log-level-enabled.util"), exports); +tslib_1.__exportStar(require("./is-log-level.util"), exports); diff --git a/node_modules/@nestjs/common/services/utils/is-log-level-enabled.util.d.ts b/node_modules/@nestjs/common/services/utils/is-log-level-enabled.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57b9b3f13f9cb81501909b8b82fd7e2b9d0f9aed --- /dev/null +++ b/node_modules/@nestjs/common/services/utils/is-log-level-enabled.util.d.ts @@ -0,0 +1,7 @@ +import { LogLevel } from '../logger.service'; +/** + * Checks if target level is enabled. + * @param targetLevel target level + * @param logLevels array of enabled log levels + */ +export declare function isLogLevelEnabled(targetLevel: LogLevel, logLevels: LogLevel[] | undefined): boolean; diff --git a/node_modules/@nestjs/common/services/utils/is-log-level-enabled.util.js b/node_modules/@nestjs/common/services/utils/is-log-level-enabled.util.js new file mode 100644 index 0000000000000000000000000000000000000000..515e39ff71cc105aa2d07201fad55eff4bdfb4e6 --- /dev/null +++ b/node_modules/@nestjs/common/services/utils/is-log-level-enabled.util.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isLogLevelEnabled = isLogLevelEnabled; +const LOG_LEVEL_VALUES = { + verbose: 0, + debug: 1, + log: 2, + warn: 3, + error: 4, + fatal: 5, +}; +/** + * Checks if target level is enabled. + * @param targetLevel target level + * @param logLevels array of enabled log levels + */ +function isLogLevelEnabled(targetLevel, logLevels) { + if (!logLevels || (Array.isArray(logLevels) && logLevels?.length === 0)) { + return false; + } + if (logLevels.includes(targetLevel)) { + return true; + } + let highestLogLevelValue = -Infinity; + for (const level of logLevels) { + const v = LOG_LEVEL_VALUES[level]; + if (v > highestLogLevelValue) + highestLogLevelValue = v; + } + const targetLevelValue = LOG_LEVEL_VALUES[targetLevel]; + return targetLevelValue >= highestLogLevelValue; +} diff --git a/node_modules/@nestjs/common/services/utils/is-log-level.util.d.ts b/node_modules/@nestjs/common/services/utils/is-log-level.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..761c23b4bbe42840d4464ce0b553706804ed26a4 --- /dev/null +++ b/node_modules/@nestjs/common/services/utils/is-log-level.util.d.ts @@ -0,0 +1,5 @@ +import { LogLevel } from '../logger.service'; +/** + * @publicApi + */ +export declare function isLogLevel(maybeLogLevel: any): maybeLogLevel is LogLevel; diff --git a/node_modules/@nestjs/common/services/utils/is-log-level.util.js b/node_modules/@nestjs/common/services/utils/is-log-level.util.js new file mode 100644 index 0000000000000000000000000000000000000000..ff502d9f8a9f13af41130085c34e8b6446ee8a15 --- /dev/null +++ b/node_modules/@nestjs/common/services/utils/is-log-level.util.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isLogLevel = isLogLevel; +const logger_service_1 = require("../logger.service"); +/** + * @publicApi + */ +function isLogLevel(maybeLogLevel) { + return logger_service_1.LOG_LEVELS.includes(maybeLogLevel); +} diff --git a/node_modules/@nestjs/common/tsconfig.build.json b/node_modules/@nestjs/common/tsconfig.build.json new file mode 100644 index 0000000000000000000000000000000000000000..2d16c3a204b0c0c7ce53cd78193a7551ecf7504a --- /dev/null +++ b/node_modules/@nestjs/common/tsconfig.build.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.build.json", + "compilerOptions": { + "outDir": ".", + "rootDir": ".", + "paths": {} + }, + "exclude": ["node_modules", "dist", "test/**/*", "*.spec.ts"], + "references": [] +} diff --git a/node_modules/@nestjs/common/utils/assign-custom-metadata.util.d.ts b/node_modules/@nestjs/common/utils/assign-custom-metadata.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ade986032f54bcc9a9ad5c107d94a51567c92a59 --- /dev/null +++ b/node_modules/@nestjs/common/utils/assign-custom-metadata.util.d.ts @@ -0,0 +1,4 @@ +import { ParamData, RouteParamMetadata } from '../decorators/http/route-params.decorator'; +import { PipeTransform, Type } from '../interfaces'; +import { CustomParamFactory } from '../interfaces/features/custom-route-param-factory.interface'; +export declare function assignCustomParameterMetadata(args: Record, paramtype: number | string, index: number, factory: CustomParamFactory, data?: ParamData, ...pipes: (Type | PipeTransform)[]): {}; diff --git a/node_modules/@nestjs/common/utils/assign-custom-metadata.util.js b/node_modules/@nestjs/common/utils/assign-custom-metadata.util.js new file mode 100644 index 0000000000000000000000000000000000000000..312e9788850704f78ede82a3db96ed5f8ecbecdc --- /dev/null +++ b/node_modules/@nestjs/common/utils/assign-custom-metadata.util.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assignCustomParameterMetadata = assignCustomParameterMetadata; +const constants_1 = require("../constants"); +function assignCustomParameterMetadata(args, paramtype, index, factory, data, ...pipes) { + return { + ...args, + [`${paramtype}${constants_1.CUSTOM_ROUTE_ARGS_METADATA}:${index}`]: { + index, + factory, + data, + pipes, + }, + }; +} diff --git a/node_modules/@nestjs/common/utils/cli-colors.util.d.ts b/node_modules/@nestjs/common/utils/cli-colors.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aff85ad1e02a84ec5740861a667bc35c625bf430 --- /dev/null +++ b/node_modules/@nestjs/common/utils/cli-colors.util.d.ts @@ -0,0 +1,10 @@ +export declare const isColorAllowed: () => boolean; +export declare const clc: { + bold: (text: string) => string; + green: (text: string) => string; + yellow: (text: string) => string; + red: (text: string) => string; + magentaBright: (text: string) => string; + cyanBright: (text: string) => string; +}; +export declare const yellow: (text: string) => string; diff --git a/node_modules/@nestjs/common/utils/cli-colors.util.js b/node_modules/@nestjs/common/utils/cli-colors.util.js new file mode 100644 index 0000000000000000000000000000000000000000..2813867ba38d5b78cc0eeef6f5b1419caa5ffc57 --- /dev/null +++ b/node_modules/@nestjs/common/utils/cli-colors.util.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.yellow = exports.clc = exports.isColorAllowed = void 0; +const isColorAllowed = () => !process.env.NO_COLOR; +exports.isColorAllowed = isColorAllowed; +const colorIfAllowed = (colorFn) => (text) => (0, exports.isColorAllowed)() ? colorFn(text) : text; +exports.clc = { + bold: colorIfAllowed((text) => `\x1B[1m${text}\x1B[0m`), + green: colorIfAllowed((text) => `\x1B[32m${text}\x1B[39m`), + yellow: colorIfAllowed((text) => `\x1B[33m${text}\x1B[39m`), + red: colorIfAllowed((text) => `\x1B[31m${text}\x1B[39m`), + magentaBright: colorIfAllowed((text) => `\x1B[95m${text}\x1B[39m`), + cyanBright: colorIfAllowed((text) => `\x1B[96m${text}\x1B[39m`), +}; +exports.yellow = colorIfAllowed((text) => `\x1B[38;5;3m${text}\x1B[39m`); diff --git a/node_modules/@nestjs/common/utils/extend-metadata.util.d.ts b/node_modules/@nestjs/common/utils/extend-metadata.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2911201c813a6e7ee3c1b49302fbf1d63fa98e4b --- /dev/null +++ b/node_modules/@nestjs/common/utils/extend-metadata.util.d.ts @@ -0,0 +1 @@ +export declare function extendArrayMetadata>(key: string, metadata: T, target: Function): void; diff --git a/node_modules/@nestjs/common/utils/extend-metadata.util.js b/node_modules/@nestjs/common/utils/extend-metadata.util.js new file mode 100644 index 0000000000000000000000000000000000000000..6534bbb7bdc7940054551a8d9194ea6232773607 --- /dev/null +++ b/node_modules/@nestjs/common/utils/extend-metadata.util.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extendArrayMetadata = extendArrayMetadata; +function extendArrayMetadata(key, metadata, target) { + const previousValue = Reflect.getMetadata(key, target) || []; + const value = [...previousValue, ...metadata]; + Reflect.defineMetadata(key, value, target); +} diff --git a/node_modules/@nestjs/common/utils/forward-ref.util.d.ts b/node_modules/@nestjs/common/utils/forward-ref.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ccec016dacb97771558f34975e64572552f8c325 --- /dev/null +++ b/node_modules/@nestjs/common/utils/forward-ref.util.d.ts @@ -0,0 +1,5 @@ +import { ForwardReference } from '../interfaces/modules/forward-reference.interface'; +/** + * @publicApi + */ +export declare const forwardRef: (fn: () => any) => ForwardReference; diff --git a/node_modules/@nestjs/common/utils/forward-ref.util.js b/node_modules/@nestjs/common/utils/forward-ref.util.js new file mode 100644 index 0000000000000000000000000000000000000000..80f89d33d994ceecf8a04ed1700400f661ba2c22 --- /dev/null +++ b/node_modules/@nestjs/common/utils/forward-ref.util.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.forwardRef = void 0; +/** + * @publicApi + */ +const forwardRef = (fn) => ({ + forwardRef: fn, +}); +exports.forwardRef = forwardRef; diff --git a/node_modules/@nestjs/common/utils/http-error-by-code.util.d.ts b/node_modules/@nestjs/common/utils/http-error-by-code.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..89ed9e18aa9bada07b38213f759dba1324b4a919 --- /dev/null +++ b/node_modules/@nestjs/common/utils/http-error-by-code.util.d.ts @@ -0,0 +1,4 @@ +import { HttpStatus } from '../enums'; +import { Type } from '../interfaces'; +export type ErrorHttpStatusCode = HttpStatus.BAD_GATEWAY | HttpStatus.BAD_REQUEST | HttpStatus.CONFLICT | HttpStatus.FORBIDDEN | HttpStatus.GATEWAY_TIMEOUT | HttpStatus.GONE | HttpStatus.I_AM_A_TEAPOT | HttpStatus.INTERNAL_SERVER_ERROR | HttpStatus.METHOD_NOT_ALLOWED | HttpStatus.NOT_ACCEPTABLE | HttpStatus.NOT_FOUND | HttpStatus.NOT_IMPLEMENTED | HttpStatus.PAYLOAD_TOO_LARGE | HttpStatus.PRECONDITION_FAILED | HttpStatus.REQUEST_TIMEOUT | HttpStatus.SERVICE_UNAVAILABLE | HttpStatus.UNAUTHORIZED | HttpStatus.UNPROCESSABLE_ENTITY | HttpStatus.UNSUPPORTED_MEDIA_TYPE; +export declare const HttpErrorByCode: Record>; diff --git a/node_modules/@nestjs/common/utils/http-error-by-code.util.js b/node_modules/@nestjs/common/utils/http-error-by-code.util.js new file mode 100644 index 0000000000000000000000000000000000000000..ca52883234ef065f5198a93e307d35b9d556dd20 --- /dev/null +++ b/node_modules/@nestjs/common/utils/http-error-by-code.util.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HttpErrorByCode = void 0; +const enums_1 = require("../enums"); +const exceptions_1 = require("../exceptions"); +exports.HttpErrorByCode = { + [enums_1.HttpStatus.BAD_GATEWAY]: exceptions_1.BadGatewayException, + [enums_1.HttpStatus.BAD_REQUEST]: exceptions_1.BadRequestException, + [enums_1.HttpStatus.CONFLICT]: exceptions_1.ConflictException, + [enums_1.HttpStatus.FORBIDDEN]: exceptions_1.ForbiddenException, + [enums_1.HttpStatus.GATEWAY_TIMEOUT]: exceptions_1.GatewayTimeoutException, + [enums_1.HttpStatus.GONE]: exceptions_1.GoneException, + [enums_1.HttpStatus.I_AM_A_TEAPOT]: exceptions_1.ImATeapotException, + [enums_1.HttpStatus.INTERNAL_SERVER_ERROR]: exceptions_1.InternalServerErrorException, + [enums_1.HttpStatus.METHOD_NOT_ALLOWED]: exceptions_1.MethodNotAllowedException, + [enums_1.HttpStatus.NOT_ACCEPTABLE]: exceptions_1.NotAcceptableException, + [enums_1.HttpStatus.NOT_FOUND]: exceptions_1.NotFoundException, + [enums_1.HttpStatus.NOT_IMPLEMENTED]: exceptions_1.NotImplementedException, + [enums_1.HttpStatus.PAYLOAD_TOO_LARGE]: exceptions_1.PayloadTooLargeException, + [enums_1.HttpStatus.PRECONDITION_FAILED]: exceptions_1.PreconditionFailedException, + [enums_1.HttpStatus.REQUEST_TIMEOUT]: exceptions_1.RequestTimeoutException, + [enums_1.HttpStatus.SERVICE_UNAVAILABLE]: exceptions_1.ServiceUnavailableException, + [enums_1.HttpStatus.UNAUTHORIZED]: exceptions_1.UnauthorizedException, + [enums_1.HttpStatus.UNPROCESSABLE_ENTITY]: exceptions_1.UnprocessableEntityException, + [enums_1.HttpStatus.UNSUPPORTED_MEDIA_TYPE]: exceptions_1.UnsupportedMediaTypeException, +}; diff --git a/node_modules/@nestjs/common/utils/index.d.ts b/node_modules/@nestjs/common/utils/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8719691cd3216a98ca4d3b55cd8cabcf8987ed1 --- /dev/null +++ b/node_modules/@nestjs/common/utils/index.d.ts @@ -0,0 +1 @@ +export * from './forward-ref.util'; diff --git a/node_modules/@nestjs/common/utils/index.js b/node_modules/@nestjs/common/utils/index.js new file mode 100644 index 0000000000000000000000000000000000000000..33b61c6ca77b0e95faa6dfc67f700eefcdb09d9a --- /dev/null +++ b/node_modules/@nestjs/common/utils/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./forward-ref.util"), exports); diff --git a/node_modules/@nestjs/common/utils/load-package.util.d.ts b/node_modules/@nestjs/common/utils/load-package.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d0eb841ed3d96dc3df4afd5d0d7e50d78f1fd5c --- /dev/null +++ b/node_modules/@nestjs/common/utils/load-package.util.d.ts @@ -0,0 +1 @@ +export declare function loadPackage(packageName: string, context: string, loaderFn?: Function): any; diff --git a/node_modules/@nestjs/common/utils/load-package.util.js b/node_modules/@nestjs/common/utils/load-package.util.js new file mode 100644 index 0000000000000000000000000000000000000000..9d60598693a34c7725696bc604a1a25eceec756c --- /dev/null +++ b/node_modules/@nestjs/common/utils/load-package.util.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadPackage = loadPackage; +const logger_service_1 = require("../services/logger.service"); +const MISSING_REQUIRED_DEPENDENCY = (name, reason) => `The "${name}" package is missing. Please, make sure to install it to take advantage of ${reason}.`; +const logger = new logger_service_1.Logger('PackageLoader'); +function loadPackage(packageName, context, loaderFn) { + try { + return loaderFn ? loaderFn() : require(packageName); + } + catch (e) { + logger.error(MISSING_REQUIRED_DEPENDENCY(packageName, context)); + logger_service_1.Logger.flush(); + process.exit(1); + } +} diff --git a/node_modules/@nestjs/common/utils/merge-with-values.util.d.ts b/node_modules/@nestjs/common/utils/merge-with-values.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39178723b3fdd2d166a19dc1bbc4ce59cf76355d --- /dev/null +++ b/node_modules/@nestjs/common/utils/merge-with-values.util.d.ts @@ -0,0 +1,4 @@ +export type Constructor = new (...args: any[]) => T; +export declare const MergeWithValues: >(data: { + [param: string]: any; +}) => (Metatype: T) => any; diff --git a/node_modules/@nestjs/common/utils/merge-with-values.util.js b/node_modules/@nestjs/common/utils/merge-with-values.util.js new file mode 100644 index 0000000000000000000000000000000000000000..8dc3c79ea2d26ac394080a75d1e0d18cd8328827 --- /dev/null +++ b/node_modules/@nestjs/common/utils/merge-with-values.util.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MergeWithValues = void 0; +/* eslint-disable @typescript-eslint/no-empty-object-type */ +const MergeWithValues = (data) => { + return (Metatype) => { + const Type = class extends Metatype { + constructor(...args) { + super(...args); + } + }; + const token = Metatype.name + JSON.stringify(data); + Object.defineProperty(Type, 'name', { value: token }); + Object.assign(Type.prototype, data); + return Type; + }; +}; +exports.MergeWithValues = MergeWithValues; diff --git a/node_modules/@nestjs/common/utils/random-string-generator.util.d.ts b/node_modules/@nestjs/common/utils/random-string-generator.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e14a1eee1ba64c03fd67f016092c7e7c483ccb28 --- /dev/null +++ b/node_modules/@nestjs/common/utils/random-string-generator.util.d.ts @@ -0,0 +1 @@ +export declare const randomStringGenerator: () => string; diff --git a/node_modules/@nestjs/common/utils/random-string-generator.util.js b/node_modules/@nestjs/common/utils/random-string-generator.util.js new file mode 100644 index 0000000000000000000000000000000000000000..eb0b0228d2ad7b457fb79a6b2cad5f0eaaa6dd24 --- /dev/null +++ b/node_modules/@nestjs/common/utils/random-string-generator.util.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.randomStringGenerator = void 0; +const uid_1 = require("uid"); +const randomStringGenerator = () => (0, uid_1.uid)(21); +exports.randomStringGenerator = randomStringGenerator; diff --git a/node_modules/@nestjs/common/utils/select-exception-filter-metadata.util.d.ts b/node_modules/@nestjs/common/utils/select-exception-filter-metadata.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9bbe1e1e8977acf373c661ecfcc5a846771e380f --- /dev/null +++ b/node_modules/@nestjs/common/utils/select-exception-filter-metadata.util.d.ts @@ -0,0 +1,2 @@ +import { ExceptionFilterMetadata } from '../interfaces/exceptions'; +export declare const selectExceptionFilterMetadata: (filters: ExceptionFilterMetadata[], exception: T) => ExceptionFilterMetadata | undefined; diff --git a/node_modules/@nestjs/common/utils/select-exception-filter-metadata.util.js b/node_modules/@nestjs/common/utils/select-exception-filter-metadata.util.js new file mode 100644 index 0000000000000000000000000000000000000000..28200e70efaa43c185df0412acbc6ed894a154f9 --- /dev/null +++ b/node_modules/@nestjs/common/utils/select-exception-filter-metadata.util.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.selectExceptionFilterMetadata = void 0; +const selectExceptionFilterMetadata = (filters, exception) => filters.find(({ exceptionMetatypes }) => !exceptionMetatypes.length || + exceptionMetatypes.some(ExceptionMetaType => exception instanceof ExceptionMetaType)); +exports.selectExceptionFilterMetadata = selectExceptionFilterMetadata; diff --git a/node_modules/@nestjs/common/utils/shared.utils.d.ts b/node_modules/@nestjs/common/utils/shared.utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..329ae4ef7f21b48a769753f78e3d537b582c5944 --- /dev/null +++ b/node_modules/@nestjs/common/utils/shared.utils.d.ts @@ -0,0 +1,13 @@ +export declare const isUndefined: (obj: any) => obj is undefined; +export declare const isObject: (fn: any) => fn is object; +export declare const isPlainObject: (fn: any) => fn is object; +export declare const addLeadingSlash: (path?: string) => string; +export declare const normalizePath: (path?: string) => string; +export declare const stripEndSlash: (path: string) => string; +export declare const isFunction: (val: any) => val is Function; +export declare const isString: (val: any) => val is string; +export declare const isNumber: (val: any) => val is number; +export declare const isConstructor: (val: any) => boolean; +export declare const isNil: (val: any) => val is null | undefined; +export declare const isEmpty: (array: any) => boolean; +export declare const isSymbol: (val: any) => val is symbol; diff --git a/node_modules/@nestjs/common/utils/shared.utils.js b/node_modules/@nestjs/common/utils/shared.utils.js new file mode 100644 index 0000000000000000000000000000000000000000..2d0fe619bb372a032a88035688e4762da42f9b85 --- /dev/null +++ b/node_modules/@nestjs/common/utils/shared.utils.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSymbol = exports.isEmpty = exports.isNil = exports.isConstructor = exports.isNumber = exports.isString = exports.isFunction = exports.stripEndSlash = exports.normalizePath = exports.addLeadingSlash = exports.isPlainObject = exports.isObject = exports.isUndefined = void 0; +const isUndefined = (obj) => typeof obj === 'undefined'; +exports.isUndefined = isUndefined; +const isObject = (fn) => !(0, exports.isNil)(fn) && typeof fn === 'object'; +exports.isObject = isObject; +const isPlainObject = (fn) => { + if (!(0, exports.isObject)(fn)) { + return false; + } + const proto = Object.getPrototypeOf(fn); + if (proto === null) { + return true; + } + const ctor = Object.prototype.hasOwnProperty.call(proto, 'constructor') && + proto.constructor; + return (typeof ctor === 'function' && + ctor instanceof ctor && + Function.prototype.toString.call(ctor) === + Function.prototype.toString.call(Object)); +}; +exports.isPlainObject = isPlainObject; +const addLeadingSlash = (path) => path && typeof path === 'string' + ? path.charAt(0) !== '/' && path.substring(0, 2) !== '{/' + ? '/' + path + : path + : ''; +exports.addLeadingSlash = addLeadingSlash; +const normalizePath = (path) => path + ? path.startsWith('/') + ? ('/' + path.replace(/\/+$/, '')).replace(/\/+/g, '/') + : '/' + path.replace(/\/+$/, '') + : '/'; +exports.normalizePath = normalizePath; +const stripEndSlash = (path) => path[path.length - 1] === '/' ? path.slice(0, path.length - 1) : path; +exports.stripEndSlash = stripEndSlash; +const isFunction = (val) => typeof val === 'function'; +exports.isFunction = isFunction; +const isString = (val) => typeof val === 'string'; +exports.isString = isString; +const isNumber = (val) => typeof val === 'number'; +exports.isNumber = isNumber; +const isConstructor = (val) => val === 'constructor'; +exports.isConstructor = isConstructor; +const isNil = (val) => (0, exports.isUndefined)(val) || val === null; +exports.isNil = isNil; +const isEmpty = (array) => !(array && array.length > 0); +exports.isEmpty = isEmpty; +const isSymbol = (val) => typeof val === 'symbol'; +exports.isSymbol = isSymbol; diff --git a/node_modules/@nestjs/common/utils/validate-each.util.d.ts b/node_modules/@nestjs/common/utils/validate-each.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e723991e6c8b61b870a4cb1b53957d7146dc16b2 --- /dev/null +++ b/node_modules/@nestjs/common/utils/validate-each.util.d.ts @@ -0,0 +1,8 @@ +export declare class InvalidDecoratorItemException extends Error { + private readonly msg; + constructor(decorator: string, item: string, context: string); + what(): string; +} +export declare function validateEach(context: { + name: string; +}, arr: any[], predicate: Function, decorator: string, item: string): boolean; diff --git a/node_modules/@nestjs/common/utils/validate-each.util.js b/node_modules/@nestjs/common/utils/validate-each.util.js new file mode 100644 index 0000000000000000000000000000000000000000..8fb9c20b4432144a784300af83815565bdb3854e --- /dev/null +++ b/node_modules/@nestjs/common/utils/validate-each.util.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvalidDecoratorItemException = void 0; +exports.validateEach = validateEach; +class InvalidDecoratorItemException extends Error { + constructor(decorator, item, context) { + const message = `Invalid ${item} passed to ${decorator}() decorator (${context}).`; + super(message); + this.msg = message; + } + what() { + return this.msg; + } +} +exports.InvalidDecoratorItemException = InvalidDecoratorItemException; +function validateEach(context, arr, predicate, decorator, item) { + if (!context || !context.name) { + return true; + } + const errors = arr.some(str => !predicate(str)); + if (errors) { + throw new InvalidDecoratorItemException(decorator, item, context.name); + } + return true; +} diff --git a/node_modules/@nestjs/common/utils/validate-module-keys.util.d.ts b/node_modules/@nestjs/common/utils/validate-module-keys.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..356b4f16dc106dc689e9a881a44f5b0eb79bacfa --- /dev/null +++ b/node_modules/@nestjs/common/utils/validate-module-keys.util.d.ts @@ -0,0 +1,2 @@ +export declare const INVALID_MODULE_CONFIG_MESSAGE: (text: TemplateStringsArray, property: string) => string; +export declare function validateModuleKeys(keys: string[]): void; diff --git a/node_modules/@nestjs/common/utils/validate-module-keys.util.js b/node_modules/@nestjs/common/utils/validate-module-keys.util.js new file mode 100644 index 0000000000000000000000000000000000000000..be73a2f121c4a99ae78702640493a461127425fc --- /dev/null +++ b/node_modules/@nestjs/common/utils/validate-module-keys.util.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.INVALID_MODULE_CONFIG_MESSAGE = void 0; +exports.validateModuleKeys = validateModuleKeys; +const constants_1 = require("../constants"); +const INVALID_MODULE_CONFIG_MESSAGE = (text, property) => `Invalid property '${property}' passed into the @Module() decorator.`; +exports.INVALID_MODULE_CONFIG_MESSAGE = INVALID_MODULE_CONFIG_MESSAGE; +const metadataKeys = [ + constants_1.MODULE_METADATA.IMPORTS, + constants_1.MODULE_METADATA.EXPORTS, + constants_1.MODULE_METADATA.CONTROLLERS, + constants_1.MODULE_METADATA.PROVIDERS, +]; +function validateModuleKeys(keys) { + const validateKey = (key) => { + if (metadataKeys.includes(key)) { + return; + } + throw new Error((0, exports.INVALID_MODULE_CONFIG_MESSAGE) `${key}`); + }; + keys.forEach(validateKey); +} diff --git a/node_modules/@nestjs/core/LICENSE b/node_modules/@nestjs/core/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d209764d20a03be35896a1ad8ebf6aba30bc7172 --- /dev/null +++ b/node_modules/@nestjs/core/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2017-present Kamil Mysliwiec + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/core/PACKAGE.md b/node_modules/@nestjs/core/PACKAGE.md new file mode 100644 index 0000000000000000000000000000000000000000..8559cad3797302eb6faa0dbf6742416b6bcafa1d --- /dev/null +++ b/node_modules/@nestjs/core/PACKAGE.md @@ -0,0 +1 @@ +Implements Nest's core functionality, low-level services, and utilities. diff --git a/node_modules/@nestjs/core/Readme.md b/node_modules/@nestjs/core/Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..d1631aae1b84b50b74ce4464d1c55dc12837e497 --- /dev/null +++ b/node_modules/@nestjs/core/Readme.md @@ -0,0 +1,150 @@ +

+ Nest Logo +

+ +[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 +[circleci-url]: https://circleci.com/gh/nestjs/nest + +

A progressive Node.js framework for building efficient and scalable server-side applications.

+

+NPM Version +Package License +NPM Downloads +CircleCI +Discord +Backers on Open Collective +Sponsors on Open Collective + + Support us + +

+ + +## Description + +Nest is a framework for building efficient, scalable Node.js server-side applications. It uses modern JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming). + +

Under the hood, Nest makes use of Express, but also provides compatibility with a wide range of other libraries, like Fastify, allowing for easy use of the myriad of third-party plugins which are available.

+ +## Philosophy + +

In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front-end and back-end applications, giving rise to awesome projects like Angular, React, and Vue, which improve developer productivity and enable the construction of fast, testable, and extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers, and tools for Node, none of them effectively solve the main problem - the architecture.

+

Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, and loosely coupled and easily maintainable applications. The architecture is heavily inspired by Angular.

+ +## Getting started + +- To check out the [guide](https://docs.nestjs.com), visit [docs.nestjs.com](https://docs.nestjs.com). :books: +- 要查看中文 [指南](readme_zh.md), 请访问 [docs.nestjs.cn](https://docs.nestjs.cn). :books: +- [가이드](readme_kr.md) 문서는 [docs.nestjs.com](https://docs.nestjs.com)에서 확인하실 수 있습니다. :books: +- [ガイド](readme_jp.md)は [docs.nestjs.com](https://docs.nestjs.com)でご確認ください。 :books: + +## Questions + +For questions and support please use the official [Discord channel](https://discord.gg/G7Qnnhy). The issue list of this repo is **exclusively** for bug reports and feature requests. + +## Issues + +Please make sure to read the [Issue Reporting Checklist](https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md#-submitting-an-issue) before opening an issue. Issues not conforming to the guidelines may be closed immediately. + +## Consulting + +With official support, you can get expert help straight from the Nest core team. We provide dedicated technical support, migration strategies, advice on best practices (and design decisions), PR reviews, and team augmentation. Read more about [support here](https://enterprise.nestjs.com). + +## Support + +Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support from the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). + +#### Principal Sponsors + + + + + + + + + +
+ +#### Gold Sponsors + + + + + + + + + + + + + +
+ +#### Silver Sponsors + + + + + + + + + + + + + + + +
+ +#### Sponsors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +## Backers + + + +## Stay in touch + +- Author - [Kamil Myśliwiec](https://x.com/kammysliwiec) +- Website - [https://nestjs.com](https://nestjs.com/) +- X - [@nestframework](https://x.com/nestframework) + +## License + +Nest is [MIT licensed](LICENSE). diff --git a/node_modules/@nestjs/core/adapters/http-adapter.d.ts b/node_modules/@nestjs/core/adapters/http-adapter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..99ec8dcf121e0846b367dd3b367c5040f5293454 --- /dev/null +++ b/node_modules/@nestjs/core/adapters/http-adapter.d.ts @@ -0,0 +1,80 @@ +import { HttpServer, RequestMethod, VersioningOptions } from '@nestjs/common'; +import { RequestHandler, VersionValue } from '@nestjs/common/interfaces'; +import { NestApplicationOptions } from '@nestjs/common/interfaces/nest-application-options.interface'; +/** + * @publicApi + */ +export declare abstract class AbstractHttpAdapter implements HttpServer { + protected instance?: any | undefined; + protected httpServer: TServer; + protected onRouteTriggered: ((requestMethod: RequestMethod, path: string) => void) | undefined; + constructor(instance?: any | undefined); + init(): Promise; + use(...args: any[]): any; + get(handler: RequestHandler): any; + get(path: any, handler: RequestHandler): any; + post(handler: RequestHandler): any; + post(path: any, handler: RequestHandler): any; + head(handler: RequestHandler): any; + head(path: any, handler: RequestHandler): any; + delete(handler: RequestHandler): any; + delete(path: any, handler: RequestHandler): any; + put(handler: RequestHandler): any; + put(path: any, handler: RequestHandler): any; + patch(handler: RequestHandler): any; + patch(path: any, handler: RequestHandler): any; + propfind(handler: RequestHandler): any; + propfind(path: any, handler: RequestHandler): any; + proppatch(handler: RequestHandler): any; + proppatch(path: any, handler: RequestHandler): any; + mkcol(handler: RequestHandler): any; + mkcol(path: any, handler: RequestHandler): any; + copy(handler: RequestHandler): any; + copy(path: any, handler: RequestHandler): any; + move(handler: RequestHandler): any; + move(path: any, handler: RequestHandler): any; + lock(handler: RequestHandler): any; + lock(path: any, handler: RequestHandler): any; + unlock(handler: RequestHandler): any; + unlock(path: any, handler: RequestHandler): any; + all(handler: RequestHandler): any; + all(path: any, handler: RequestHandler): any; + search(handler: RequestHandler): any; + search(path: any, handler: RequestHandler): any; + options(handler: RequestHandler): any; + options(path: any, handler: RequestHandler): any; + listen(port: string | number, callback?: () => void): any; + listen(port: string | number, hostname: string, callback?: () => void): any; + getHttpServer(): TServer; + setHttpServer(httpServer: TServer): void; + setInstance(instance: T): void; + getInstance(): T; + normalizePath(path: string): string; + setOnRouteTriggered(onRouteTriggered: (requestMethod: RequestMethod, path: string) => void): void; + getOnRouteTriggered(): ((requestMethod: RequestMethod, path: string) => void) | undefined; + setOnRequestHook(onRequestHook: Function): void; + setOnResponseHook(onResponseHook: Function): void; + abstract close(): any; + abstract initHttpServer(options: NestApplicationOptions): any; + abstract useStaticAssets(...args: any[]): any; + abstract setViewEngine(engine: string): any; + abstract getRequestHostname(request: any): any; + abstract getRequestMethod(request: any): any; + abstract getRequestUrl(request: any): any; + abstract status(response: any, statusCode: number): any; + abstract reply(response: any, body: any, statusCode?: number): any; + abstract end(response: any, message?: string): any; + abstract render(response: any, view: string, options: any): any; + abstract redirect(response: any, statusCode: number, url: string): any; + abstract setErrorHandler(handler: Function, prefix?: string): any; + abstract setNotFoundHandler(handler: Function, prefix?: string): any; + abstract isHeadersSent(response: any): any; + abstract getHeader(response: any, name: string): any; + abstract setHeader(response: any, name: string, value: string): any; + abstract appendHeader(response: any, name: string, value: string): any; + abstract registerParserMiddleware(prefix?: string, rawBody?: boolean): any; + abstract enableCors(options?: any, prefix?: string): any; + abstract createMiddlewareFactory(requestMethod: RequestMethod): ((path: string, callback: Function) => any) | Promise<(path: string, callback: Function) => any>; + abstract getType(): string; + abstract applyVersionFilter(handler: Function, version: VersionValue, versioningOptions: VersioningOptions): (req: TRequest, res: TResponse, next: () => void) => Function; +} diff --git a/node_modules/@nestjs/core/adapters/http-adapter.js b/node_modules/@nestjs/core/adapters/http-adapter.js new file mode 100644 index 0000000000000000000000000000000000000000..c7a285a00332d4ba40d2f273f4668cbd94879915 --- /dev/null +++ b/node_modules/@nestjs/core/adapters/http-adapter.js @@ -0,0 +1,90 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AbstractHttpAdapter = void 0; +/** + * @publicApi + */ +class AbstractHttpAdapter { + constructor(instance) { + this.instance = instance; + } + async init() { } + use(...args) { + return this.instance.use(...args); + } + get(...args) { + return this.instance.get(...args); + } + post(...args) { + return this.instance.post(...args); + } + head(...args) { + return this.instance.head(...args); + } + delete(...args) { + return this.instance.delete(...args); + } + put(...args) { + return this.instance.put(...args); + } + patch(...args) { + return this.instance.patch(...args); + } + propfind(...args) { + return this.instance.propfind(...args); + } + proppatch(...args) { + return this.instance.proppatch(...args); + } + mkcol(...args) { + return this.instance.mkcol(...args); + } + copy(...args) { + return this.instance.copy(...args); + } + move(...args) { + return this.instance.move(...args); + } + lock(...args) { + return this.instance.lock(...args); + } + unlock(...args) { + return this.instance.unlock(...args); + } + all(...args) { + return this.instance.all(...args); + } + search(...args) { + return this.instance.search(...args); + } + options(...args) { + return this.instance.options(...args); + } + listen(port, hostname, callback) { + return this.instance.listen(port, hostname, callback); + } + getHttpServer() { + return this.httpServer; + } + setHttpServer(httpServer) { + this.httpServer = httpServer; + } + setInstance(instance) { + this.instance = instance; + } + getInstance() { + return this.instance; + } + normalizePath(path) { + return path; + } + setOnRouteTriggered(onRouteTriggered) { + this.onRouteTriggered = onRouteTriggered; + } + getOnRouteTriggered() { + return this.onRouteTriggered; + } + setOnRequestHook(onRequestHook) { } + setOnResponseHook(onResponseHook) { } +} +exports.AbstractHttpAdapter = AbstractHttpAdapter; diff --git a/node_modules/@nestjs/core/adapters/index.d.ts b/node_modules/@nestjs/core/adapters/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8063987a060627860c41bb0cf76e1fe85e05f934 --- /dev/null +++ b/node_modules/@nestjs/core/adapters/index.d.ts @@ -0,0 +1 @@ +export * from './http-adapter'; diff --git a/node_modules/@nestjs/core/adapters/index.js b/node_modules/@nestjs/core/adapters/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4ad34559cc05e61f6bd3ffb8b2965fb51225f78f --- /dev/null +++ b/node_modules/@nestjs/core/adapters/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./http-adapter"), exports); diff --git a/node_modules/@nestjs/core/application-config.d.ts b/node_modules/@nestjs/core/application-config.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40b0e028022ddc19937f7118ea4edd0c96e37d4a --- /dev/null +++ b/node_modules/@nestjs/core/application-config.d.ts @@ -0,0 +1,47 @@ +import { CanActivate, ExceptionFilter, NestInterceptor, PipeTransform, VersioningOptions, WebSocketAdapter } from '@nestjs/common'; +import { GlobalPrefixOptions } from '@nestjs/common/interfaces'; +import { InstanceWrapper } from './injector/instance-wrapper'; +import { ExcludeRouteMetadata } from './router/interfaces/exclude-route-metadata.interface'; +export declare class ApplicationConfig { + private ioAdapter; + private globalPrefix; + private globalPrefixOptions; + private globalPipes; + private globalFilters; + private globalInterceptors; + private globalGuards; + private versioningOptions; + private readonly globalRequestPipes; + private readonly globalRequestFilters; + private readonly globalRequestInterceptors; + private readonly globalRequestGuards; + constructor(ioAdapter?: WebSocketAdapter | null); + setGlobalPrefix(prefix: string): void; + getGlobalPrefix(): string; + setGlobalPrefixOptions(options: GlobalPrefixOptions): void; + getGlobalPrefixOptions(): GlobalPrefixOptions; + setIoAdapter(ioAdapter: WebSocketAdapter): void; + getIoAdapter(): WebSocketAdapter; + addGlobalPipe(pipe: PipeTransform): void; + useGlobalPipes(...pipes: PipeTransform[]): void; + getGlobalFilters(): ExceptionFilter[]; + addGlobalFilter(filter: ExceptionFilter): void; + useGlobalFilters(...filters: ExceptionFilter[]): void; + getGlobalPipes(): PipeTransform[]; + getGlobalInterceptors(): NestInterceptor[]; + addGlobalInterceptor(interceptor: NestInterceptor): void; + useGlobalInterceptors(...interceptors: NestInterceptor[]): void; + getGlobalGuards(): CanActivate[]; + addGlobalGuard(guard: CanActivate): void; + useGlobalGuards(...guards: CanActivate[]): void; + addGlobalRequestInterceptor(wrapper: InstanceWrapper): void; + getGlobalRequestInterceptors(): InstanceWrapper[]; + addGlobalRequestPipe(wrapper: InstanceWrapper): void; + getGlobalRequestPipes(): InstanceWrapper[]; + addGlobalRequestFilter(wrapper: InstanceWrapper): void; + getGlobalRequestFilters(): InstanceWrapper[]; + addGlobalRequestGuard(wrapper: InstanceWrapper): void; + getGlobalRequestGuards(): InstanceWrapper[]; + enableVersioning(options: VersioningOptions): void; + getVersioning(): VersioningOptions | undefined; +} diff --git a/node_modules/@nestjs/core/application-config.js b/node_modules/@nestjs/core/application-config.js new file mode 100644 index 0000000000000000000000000000000000000000..4fd27ed7dcfa93c6d8bb601a4199e7e68aa85ad2 --- /dev/null +++ b/node_modules/@nestjs/core/application-config.js @@ -0,0 +1,107 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApplicationConfig = void 0; +class ApplicationConfig { + constructor(ioAdapter = null) { + this.ioAdapter = ioAdapter; + this.globalPrefix = ''; + this.globalPrefixOptions = {}; + this.globalPipes = []; + this.globalFilters = []; + this.globalInterceptors = []; + this.globalGuards = []; + this.globalRequestPipes = []; + this.globalRequestFilters = []; + this.globalRequestInterceptors = []; + this.globalRequestGuards = []; + } + setGlobalPrefix(prefix) { + this.globalPrefix = prefix; + } + getGlobalPrefix() { + return this.globalPrefix; + } + setGlobalPrefixOptions(options) { + this.globalPrefixOptions = options; + } + getGlobalPrefixOptions() { + return this.globalPrefixOptions; + } + setIoAdapter(ioAdapter) { + this.ioAdapter = ioAdapter; + } + getIoAdapter() { + return this.ioAdapter; + } + addGlobalPipe(pipe) { + this.globalPipes.push(pipe); + } + useGlobalPipes(...pipes) { + this.globalPipes = this.globalPipes.concat(pipes); + } + getGlobalFilters() { + return this.globalFilters; + } + addGlobalFilter(filter) { + this.globalFilters.push(filter); + } + useGlobalFilters(...filters) { + this.globalFilters = this.globalFilters.concat(filters); + } + getGlobalPipes() { + return this.globalPipes; + } + getGlobalInterceptors() { + return this.globalInterceptors; + } + addGlobalInterceptor(interceptor) { + this.globalInterceptors.push(interceptor); + } + useGlobalInterceptors(...interceptors) { + this.globalInterceptors = this.globalInterceptors.concat(interceptors); + } + getGlobalGuards() { + return this.globalGuards; + } + addGlobalGuard(guard) { + this.globalGuards.push(guard); + } + useGlobalGuards(...guards) { + this.globalGuards = this.globalGuards.concat(guards); + } + addGlobalRequestInterceptor(wrapper) { + this.globalRequestInterceptors.push(wrapper); + } + getGlobalRequestInterceptors() { + return this.globalRequestInterceptors; + } + addGlobalRequestPipe(wrapper) { + this.globalRequestPipes.push(wrapper); + } + getGlobalRequestPipes() { + return this.globalRequestPipes; + } + addGlobalRequestFilter(wrapper) { + this.globalRequestFilters.push(wrapper); + } + getGlobalRequestFilters() { + return this.globalRequestFilters; + } + addGlobalRequestGuard(wrapper) { + this.globalRequestGuards.push(wrapper); + } + getGlobalRequestGuards() { + return this.globalRequestGuards; + } + enableVersioning(options) { + if (Array.isArray(options.defaultVersion)) { + // Drop duplicated versions + options.defaultVersion = Array.from(new Set(options.defaultVersion)); + } + this.versioningOptions = options; + } + getVersioning() { + return this.versioningOptions; + } +} +exports.ApplicationConfig = ApplicationConfig; diff --git a/node_modules/@nestjs/core/constants.d.ts b/node_modules/@nestjs/core/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5eca221e23914905fbf57f70d5d30fbb85dff03c --- /dev/null +++ b/node_modules/@nestjs/core/constants.d.ts @@ -0,0 +1,14 @@ +import { EnhancerSubtype } from '@nestjs/common/constants'; +export declare const MESSAGES: { + APPLICATION_START: string; + APPLICATION_READY: string; + MICROSERVICE_READY: string; + UNKNOWN_EXCEPTION_MESSAGE: string; + ERROR_DURING_SHUTDOWN: string; + CALL_LISTEN_FIRST: string; +}; +export declare const APP_INTERCEPTOR = "APP_INTERCEPTOR"; +export declare const APP_PIPE = "APP_PIPE"; +export declare const APP_GUARD = "APP_GUARD"; +export declare const APP_FILTER = "APP_FILTER"; +export declare const ENHANCER_TOKEN_TO_SUBTYPE_MAP: Record; diff --git a/node_modules/@nestjs/core/constants.js b/node_modules/@nestjs/core/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..1ad27d7cdbcbde2b2ed48eb714c99aba4f65c1cd --- /dev/null +++ b/node_modules/@nestjs/core/constants.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ENHANCER_TOKEN_TO_SUBTYPE_MAP = exports.APP_FILTER = exports.APP_GUARD = exports.APP_PIPE = exports.APP_INTERCEPTOR = exports.MESSAGES = void 0; +exports.MESSAGES = { + APPLICATION_START: `Starting Nest application...`, + APPLICATION_READY: `Nest application successfully started`, + MICROSERVICE_READY: `Nest microservice successfully started`, + UNKNOWN_EXCEPTION_MESSAGE: 'Internal server error', + ERROR_DURING_SHUTDOWN: 'Error happened during shutdown', + CALL_LISTEN_FIRST: 'app.listen() needs to be called before calling app.getUrl()', +}; +exports.APP_INTERCEPTOR = 'APP_INTERCEPTOR'; +exports.APP_PIPE = 'APP_PIPE'; +exports.APP_GUARD = 'APP_GUARD'; +exports.APP_FILTER = 'APP_FILTER'; +exports.ENHANCER_TOKEN_TO_SUBTYPE_MAP = { + [exports.APP_GUARD]: 'guard', + [exports.APP_INTERCEPTOR]: 'interceptor', + [exports.APP_PIPE]: 'pipe', + [exports.APP_FILTER]: 'filter', +}; diff --git a/node_modules/@nestjs/core/discovery/discoverable-meta-host-collection.d.ts b/node_modules/@nestjs/core/discovery/discoverable-meta-host-collection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d49b83692c4d28a160f2d1472adfb09436ed8714 --- /dev/null +++ b/node_modules/@nestjs/core/discovery/discoverable-meta-host-collection.d.ts @@ -0,0 +1,46 @@ +import { Type } from '@nestjs/common'; +import { InstanceWrapper } from '../injector/instance-wrapper'; +import { ModulesContainer } from '../injector/modules-container'; +export declare class DiscoverableMetaHostCollection { + /** + * A map of class references to metadata keys. + */ + static readonly metaHostLinks: Map, string>; + /** + * A map of metadata keys to instance wrappers (providers) with the corresponding metadata key. + * The map is weakly referenced by the modules container (unique per application). + */ + private static readonly providersByMetaKey; + /** + * A map of metadata keys to instance wrappers (controllers) with the corresponding metadata key. + * The map is weakly referenced by the modules container (unique per application). + */ + private static readonly controllersByMetaKey; + /** + * Adds a link between a class reference and a metadata key. + * @param target The class reference. + * @param metadataKey The metadata key. + */ + static addClassMetaHostLink(target: Type | Function, metadataKey: string): void; + /** + * Inspects a provider instance wrapper and adds it to the collection of providers + * if it has a metadata key. + * @param hostContainerRef A reference to the modules container. + * @param instanceWrapper A provider instance wrapper. + * @returns void + */ + static inspectProvider(hostContainerRef: ModulesContainer, instanceWrapper: InstanceWrapper): void; + /** + * Inspects a controller instance wrapper and adds it to the collection of controllers + * if it has a metadata key. + * @param hostContainerRef A reference to the modules container. + * @param instanceWrapper A controller's instance wrapper. + * @returns void + */ + static inspectController(hostContainerRef: ModulesContainer, instanceWrapper: InstanceWrapper): void; + static insertByMetaKey(metaKey: string, instanceWrapper: InstanceWrapper, collection: Map>): void; + static getProvidersByMetaKey(hostContainerRef: ModulesContainer, metaKey: string): Set; + static getControllersByMetaKey(hostContainerRef: ModulesContainer, metaKey: string): Set; + private static inspectInstanceWrapper; + private static getMetaKeyByInstanceWrapper; +} diff --git a/node_modules/@nestjs/core/discovery/discoverable-meta-host-collection.js b/node_modules/@nestjs/core/discovery/discoverable-meta-host-collection.js new file mode 100644 index 0000000000000000000000000000000000000000..6590a6bdebd2e331131462ab63e9660817ef691c --- /dev/null +++ b/node_modules/@nestjs/core/discovery/discoverable-meta-host-collection.js @@ -0,0 +1,98 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DiscoverableMetaHostCollection = void 0; +class DiscoverableMetaHostCollection { + /** + * Adds a link between a class reference and a metadata key. + * @param target The class reference. + * @param metadataKey The metadata key. + */ + static addClassMetaHostLink(target, metadataKey) { + this.metaHostLinks.set(target, metadataKey); + } + /** + * Inspects a provider instance wrapper and adds it to the collection of providers + * if it has a metadata key. + * @param hostContainerRef A reference to the modules container. + * @param instanceWrapper A provider instance wrapper. + * @returns void + */ + static inspectProvider(hostContainerRef, instanceWrapper) { + return this.inspectInstanceWrapper(hostContainerRef, instanceWrapper, this.providersByMetaKey); + } + /** + * Inspects a controller instance wrapper and adds it to the collection of controllers + * if it has a metadata key. + * @param hostContainerRef A reference to the modules container. + * @param instanceWrapper A controller's instance wrapper. + * @returns void + */ + static inspectController(hostContainerRef, instanceWrapper) { + return this.inspectInstanceWrapper(hostContainerRef, instanceWrapper, this.controllersByMetaKey); + } + static insertByMetaKey(metaKey, instanceWrapper, collection) { + if (collection.has(metaKey)) { + const wrappers = collection.get(metaKey); + wrappers.add(instanceWrapper); + } + else { + const wrappers = new Set(); + wrappers.add(instanceWrapper); + collection.set(metaKey, wrappers); + } + } + static getProvidersByMetaKey(hostContainerRef, metaKey) { + const wrappersByMetaKey = this.providersByMetaKey.get(hostContainerRef); + return wrappersByMetaKey?.get(metaKey) ?? new Set(); + } + static getControllersByMetaKey(hostContainerRef, metaKey) { + const wrappersByMetaKey = this.controllersByMetaKey.get(hostContainerRef); + return wrappersByMetaKey?.get(metaKey) ?? new Set(); + } + static inspectInstanceWrapper(hostContainerRef, instanceWrapper, wrapperByMetaKeyMap) { + const metaKey = DiscoverableMetaHostCollection.getMetaKeyByInstanceWrapper(instanceWrapper); + if (!metaKey) { + return; + } + let collection; + if (wrapperByMetaKeyMap.has(hostContainerRef)) { + collection = wrapperByMetaKeyMap.get(hostContainerRef); + } + else { + collection = new Map(); + wrapperByMetaKeyMap.set(hostContainerRef, collection); + } + this.insertByMetaKey(metaKey, instanceWrapper, collection); + } + static getMetaKeyByInstanceWrapper(instanceWrapper) { + return this.metaHostLinks.get( + // NOTE: Regarding the ternary statement below, + // - The condition `!wrapper.metatype` is needed because when we use `useValue` + // the value of `wrapper.metatype` will be `null`. + // - The condition `wrapper.inject` is needed here because when we use + // `useFactory`, the value of `wrapper.metatype` will be the supplied + // factory function. + // For both cases, we should use `wrapper.instance.constructor` instead + // of `wrapper.metatype` to resolve processor's class properly. + // But since calling `wrapper.instance` could degrade overall performance + // we must defer it as much we can. + instanceWrapper.metatype || instanceWrapper.inject + ? (instanceWrapper.instance?.constructor ?? instanceWrapper.metatype) + : instanceWrapper.metatype); + } +} +exports.DiscoverableMetaHostCollection = DiscoverableMetaHostCollection; +/** + * A map of class references to metadata keys. + */ +DiscoverableMetaHostCollection.metaHostLinks = new Map(); +/** + * A map of metadata keys to instance wrappers (providers) with the corresponding metadata key. + * The map is weakly referenced by the modules container (unique per application). + */ +DiscoverableMetaHostCollection.providersByMetaKey = new WeakMap(); +/** + * A map of metadata keys to instance wrappers (controllers) with the corresponding metadata key. + * The map is weakly referenced by the modules container (unique per application). + */ +DiscoverableMetaHostCollection.controllersByMetaKey = new WeakMap(); diff --git a/node_modules/@nestjs/core/discovery/discovery-module.d.ts b/node_modules/@nestjs/core/discovery/discovery-module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9d530bd6a6c4b1395b301bdfe92ab58ae83c220 --- /dev/null +++ b/node_modules/@nestjs/core/discovery/discovery-module.d.ts @@ -0,0 +1,5 @@ +/** + * @publicApi + */ +export declare class DiscoveryModule { +} diff --git a/node_modules/@nestjs/core/discovery/discovery-module.js b/node_modules/@nestjs/core/discovery/discovery-module.js new file mode 100644 index 0000000000000000000000000000000000000000..d853494e7d7977b8ceaeab43ee9cedcf783a6fe8 --- /dev/null +++ b/node_modules/@nestjs/core/discovery/discovery-module.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DiscoveryModule = void 0; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const metadata_scanner_1 = require("../metadata-scanner"); +const discovery_service_1 = require("./discovery-service"); +/** + * @publicApi + */ +let DiscoveryModule = class DiscoveryModule { +}; +exports.DiscoveryModule = DiscoveryModule; +exports.DiscoveryModule = DiscoveryModule = tslib_1.__decorate([ + (0, common_1.Module)({ + providers: [metadata_scanner_1.MetadataScanner, discovery_service_1.DiscoveryService], + exports: [metadata_scanner_1.MetadataScanner, discovery_service_1.DiscoveryService], + }) +], DiscoveryModule); diff --git a/node_modules/@nestjs/core/discovery/discovery-service.d.ts b/node_modules/@nestjs/core/discovery/discovery-service.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b07e67ae2f29066df003d1722eeedd1d4cf8900 --- /dev/null +++ b/node_modules/@nestjs/core/discovery/discovery-service.d.ts @@ -0,0 +1,76 @@ +import { CustomDecorator } from '@nestjs/common'; +import { InstanceWrapper } from '../injector/instance-wrapper'; +import { Module } from '../injector/module'; +import { ModulesContainer } from '../injector/modules-container'; +/** + * @publicApi + */ +export interface FilterByInclude { + /** + * List of modules to include (whitelist) into the discovery process. + */ + include?: Function[]; +} +/** + * @publicApi + */ +export interface FilterByMetadataKey { + /** + * A key to filter controllers and providers by. + * Only instance wrappers with the specified metadata key will be returned. + */ + metadataKey?: string; +} +/** + * @publicApi + */ +export type DiscoveryOptions = FilterByInclude | FilterByMetadataKey; +/** + * @publicApi + */ +export type DiscoverableDecorator = ((opts?: T) => CustomDecorator) & { + KEY: string; +}; +/** + * @publicApi + */ +export declare class DiscoveryService { + private readonly modulesContainer; + constructor(modulesContainer: ModulesContainer); + /** + * Creates a decorator that can be used to decorate classes and methods with metadata. + * The decorator will also add the class to the collection of discoverable classes (by metadata key). + * Decorated classes can be discovered using the `getProviders` and `getControllers` methods. + * @returns A decorator function. + */ + static createDecorator(): DiscoverableDecorator; + /** + * Returns an array of instance wrappers (providers). + * Depending on the options, the array will contain either all providers or only providers with the specified metadata key. + * @param options Discovery options. + * @param modules A list of modules to filter by. + * @returns An array of instance wrappers (providers). + */ + getProviders(options?: DiscoveryOptions, modules?: Module[]): InstanceWrapper[]; + /** + * Returns an array of instance wrappers (controllers). + * Depending on the options, the array will contain either all controllers or only controllers with the specified metadata key. + * @param options Discovery options. + * @param modules A list of modules to filter by. + * @returns An array of instance wrappers (controllers). + */ + getControllers(options?: DiscoveryOptions, modules?: Module[]): InstanceWrapper[]; + /** + * Retrieves metadata from the specified instance wrapper. + * @param decorator The decorator to retrieve metadata of. + * @param instanceWrapper Reference to the instance wrapper. + * @param methodKey An optional method key to retrieve metadata from. + * @returns Discovered metadata. + */ + getMetadataByDecorator>(decorator: T, instanceWrapper: InstanceWrapper, methodKey?: string): T extends DiscoverableDecorator ? R | undefined : T | undefined; + /** + * Returns a list of modules to be used for discovery. + */ + protected getModules(options?: DiscoveryOptions): Module[]; + private includeWhitelisted; +} diff --git a/node_modules/@nestjs/core/discovery/discovery-service.js b/node_modules/@nestjs/core/discovery/discovery-service.js new file mode 100644 index 0000000000000000000000000000000000000000..93716ab383ae0c21ee623931002918ad8d0e40f5 --- /dev/null +++ b/node_modules/@nestjs/core/discovery/discovery-service.js @@ -0,0 +1,98 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DiscoveryService = void 0; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const uid_1 = require("uid"); +const modules_container_1 = require("../injector/modules-container"); +const discoverable_meta_host_collection_1 = require("./discoverable-meta-host-collection"); +/** + * @publicApi + */ +let DiscoveryService = class DiscoveryService { + constructor(modulesContainer) { + this.modulesContainer = modulesContainer; + } + /** + * Creates a decorator that can be used to decorate classes and methods with metadata. + * The decorator will also add the class to the collection of discoverable classes (by metadata key). + * Decorated classes can be discovered using the `getProviders` and `getControllers` methods. + * @returns A decorator function. + */ + static createDecorator() { + const metadataKey = (0, uid_1.uid)(21); + const decoratorFn = (opts) => (target, key, descriptor) => { + if (!descriptor) { + discoverable_meta_host_collection_1.DiscoverableMetaHostCollection.addClassMetaHostLink(target, metadataKey); + } + (0, common_1.SetMetadata)(metadataKey, opts ?? {})(target, key, descriptor); + }; + decoratorFn.KEY = metadataKey; + return decoratorFn; + } + /** + * Returns an array of instance wrappers (providers). + * Depending on the options, the array will contain either all providers or only providers with the specified metadata key. + * @param options Discovery options. + * @param modules A list of modules to filter by. + * @returns An array of instance wrappers (providers). + */ + getProviders(options = {}, modules = this.getModules(options)) { + if ('metadataKey' in options) { + const providers = discoverable_meta_host_collection_1.DiscoverableMetaHostCollection.getProvidersByMetaKey(this.modulesContainer, options.metadataKey); + return Array.from(providers); + } + const providers = modules.map(item => [...item.providers.values()]); + return (0, common_1.flatten)(providers); + } + /** + * Returns an array of instance wrappers (controllers). + * Depending on the options, the array will contain either all controllers or only controllers with the specified metadata key. + * @param options Discovery options. + * @param modules A list of modules to filter by. + * @returns An array of instance wrappers (controllers). + */ + getControllers(options = {}, modules = this.getModules(options)) { + if ('metadataKey' in options) { + const controllers = discoverable_meta_host_collection_1.DiscoverableMetaHostCollection.getControllersByMetaKey(this.modulesContainer, options.metadataKey); + return Array.from(controllers); + } + const controllers = modules.map(item => [...item.controllers.values()]); + return (0, common_1.flatten)(controllers); + } + /** + * Retrieves metadata from the specified instance wrapper. + * @param decorator The decorator to retrieve metadata of. + * @param instanceWrapper Reference to the instance wrapper. + * @param methodKey An optional method key to retrieve metadata from. + * @returns Discovered metadata. + */ + getMetadataByDecorator(decorator, instanceWrapper, methodKey) { + if (methodKey) { + return Reflect.getMetadata(decorator.KEY, instanceWrapper.instance[methodKey]); + } + const clsRef = instanceWrapper.instance?.constructor ?? instanceWrapper.metatype; + return Reflect.getMetadata(decorator.KEY, clsRef); + } + /** + * Returns a list of modules to be used for discovery. + */ + getModules(options = {}) { + const includeInOpts = 'include' in options; + if (!includeInOpts) { + const moduleRefs = [...this.modulesContainer.values()]; + return moduleRefs; + } + const whitelisted = this.includeWhitelisted(options.include); + return whitelisted; + } + includeWhitelisted(include) { + const moduleRefs = [...this.modulesContainer.values()]; + return moduleRefs.filter(({ metatype }) => include.some(item => item === metatype)); + } +}; +exports.DiscoveryService = DiscoveryService; +exports.DiscoveryService = DiscoveryService = tslib_1.__decorate([ + (0, common_1.Injectable)(), + tslib_1.__metadata("design:paramtypes", [modules_container_1.ModulesContainer]) +], DiscoveryService); diff --git a/node_modules/@nestjs/core/discovery/index.d.ts b/node_modules/@nestjs/core/discovery/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e4a750525516e80ce9cb6291d34c40d3c27ed4c --- /dev/null +++ b/node_modules/@nestjs/core/discovery/index.d.ts @@ -0,0 +1,2 @@ +export * from './discovery-module'; +export * from './discovery-service'; diff --git a/node_modules/@nestjs/core/discovery/index.js b/node_modules/@nestjs/core/discovery/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0750bd53a0defb506d8c40a4284fda9625ce0e98 --- /dev/null +++ b/node_modules/@nestjs/core/discovery/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./discovery-module"), exports); +tslib_1.__exportStar(require("./discovery-service"), exports); diff --git a/node_modules/@nestjs/core/errors/exception-handler.d.ts b/node_modules/@nestjs/core/errors/exception-handler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c0cf9240579243f8c2b0aa64e72fdeadea6cc83 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exception-handler.d.ts @@ -0,0 +1,4 @@ +export declare class ExceptionHandler { + private static readonly logger; + handle(exception: Error): void; +} diff --git a/node_modules/@nestjs/core/errors/exception-handler.js b/node_modules/@nestjs/core/errors/exception-handler.js new file mode 100644 index 0000000000000000000000000000000000000000..646a1427a16c23c8ff20a2b8f77d61107d8ce965 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exception-handler.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExceptionHandler = void 0; +const logger_service_1 = require("@nestjs/common/services/logger.service"); +class ExceptionHandler { + handle(exception) { + ExceptionHandler.logger.error(exception); + } +} +exports.ExceptionHandler = ExceptionHandler; +ExceptionHandler.logger = new logger_service_1.Logger(ExceptionHandler.name); diff --git a/node_modules/@nestjs/core/errors/exceptions-zone.d.ts b/node_modules/@nestjs/core/errors/exceptions-zone.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..621b773d145f8de1e6baca712023bff15cd54983 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions-zone.d.ts @@ -0,0 +1,5 @@ +export declare class ExceptionsZone { + private static readonly exceptionHandler; + static run(callback: () => void, teardown: ((err: any) => void) | undefined, autoFlushLogs: boolean): void; + static asyncRun(callback: () => Promise, teardown: ((err: any) => void) | undefined, autoFlushLogs: boolean): Promise; +} diff --git a/node_modules/@nestjs/core/errors/exceptions-zone.js b/node_modules/@nestjs/core/errors/exceptions-zone.js new file mode 100644 index 0000000000000000000000000000000000000000..4f370892274c6c6ea3e7ae6faa506a0afbd65ebc --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions-zone.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExceptionsZone = void 0; +const common_1 = require("@nestjs/common"); +const exception_handler_1 = require("./exception-handler"); +const DEFAULT_TEARDOWN = () => process.exit(1); +class ExceptionsZone { + static run(callback, teardown = DEFAULT_TEARDOWN, autoFlushLogs) { + try { + callback(); + } + catch (e) { + this.exceptionHandler.handle(e); + if (autoFlushLogs) { + common_1.Logger.flush(); + } + teardown(e); + } + } + static async asyncRun(callback, teardown = DEFAULT_TEARDOWN, autoFlushLogs) { + try { + await callback(); + } + catch (e) { + this.exceptionHandler.handle(e); + if (autoFlushLogs) { + common_1.Logger.flush(); + } + teardown(e); + } + } +} +exports.ExceptionsZone = ExceptionsZone; +ExceptionsZone.exceptionHandler = new exception_handler_1.ExceptionHandler(); diff --git a/node_modules/@nestjs/core/errors/exceptions/circular-dependency.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/circular-dependency.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..947b717765210f29b5b2343f0c903dc9d31be915 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/circular-dependency.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class CircularDependencyException extends RuntimeException { + constructor(context?: string); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/circular-dependency.exception.js b/node_modules/@nestjs/core/errors/exceptions/circular-dependency.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..5f99ca807c7069504ee9277daa90c14a8cefb432 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/circular-dependency.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CircularDependencyException = void 0; +const runtime_exception_1 = require("./runtime.exception"); +class CircularDependencyException extends runtime_exception_1.RuntimeException { + constructor(context) { + const ctx = context ? ` inside ${context}` : ``; + super(`A circular dependency has been detected${ctx}. Please, make sure that each side of a bidirectional relationships are decorated with "forwardRef()". Note that circular relationships between custom providers (e.g., factories) are not supported since functions cannot be called more than once.`); + } +} +exports.CircularDependencyException = CircularDependencyException; diff --git a/node_modules/@nestjs/core/errors/exceptions/index.d.ts b/node_modules/@nestjs/core/errors/exceptions/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..530968b2f593883a82c33a730452ed77c68f9925 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/index.d.ts @@ -0,0 +1,8 @@ +export * from './circular-dependency.exception'; +export * from './runtime.exception'; +export * from './unknown-element.exception'; +export * from './invalid-class-scope.exception'; +export * from './invalid-class.exception'; +export * from './unknown-export.exception'; +export * from './unknown-module.exception'; +export * from './undefined-forwardref.exception'; diff --git a/node_modules/@nestjs/core/errors/exceptions/index.js b/node_modules/@nestjs/core/errors/exceptions/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0e629a2523a74c058bca3956310eacdf841b77eb --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./circular-dependency.exception"), exports); +tslib_1.__exportStar(require("./runtime.exception"), exports); +tslib_1.__exportStar(require("./unknown-element.exception"), exports); +tslib_1.__exportStar(require("./invalid-class-scope.exception"), exports); +tslib_1.__exportStar(require("./invalid-class.exception"), exports); +tslib_1.__exportStar(require("./unknown-export.exception"), exports); +tslib_1.__exportStar(require("./unknown-module.exception"), exports); +tslib_1.__exportStar(require("./undefined-forwardref.exception"), exports); diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-class-module.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/invalid-class-module.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f4f87a0bcc524f5ee042d3b480f2cfba6b1b60b --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-class-module.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class InvalidClassModuleException extends RuntimeException { + constructor(metatypeUsedAsAModule: any, scope: any[], classKind: 'provider' | 'controller' | 'filter'); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-class-module.exception.js b/node_modules/@nestjs/core/errors/exceptions/invalid-class-module.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..65102839219534a465a0115f9a40eb3bb86907e0 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-class-module.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvalidClassModuleException = void 0; +const messages_1 = require("../messages"); +const runtime_exception_1 = require("./runtime.exception"); +class InvalidClassModuleException extends runtime_exception_1.RuntimeException { + constructor(metatypeUsedAsAModule, scope, classKind) { + super((0, messages_1.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE)(metatypeUsedAsAModule, scope, classKind)); + } +} +exports.InvalidClassModuleException = InvalidClassModuleException; diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-class-scope.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/invalid-class-scope.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..09a1b0ee428f52f16b33a617d5e39abaaac6339e --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-class-scope.exception.d.ts @@ -0,0 +1,5 @@ +import { Abstract, Type } from '@nestjs/common/interfaces'; +import { RuntimeException } from './runtime.exception'; +export declare class InvalidClassScopeException extends RuntimeException { + constructor(metatypeOrToken: Type | Abstract | string | symbol); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-class-scope.exception.js b/node_modules/@nestjs/core/errors/exceptions/invalid-class-scope.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..6d2227ea4fe0a001400f704ecec37dea90847ac7 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-class-scope.exception.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvalidClassScopeException = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const messages_1 = require("../messages"); +const runtime_exception_1 = require("./runtime.exception"); +class InvalidClassScopeException extends runtime_exception_1.RuntimeException { + constructor(metatypeOrToken) { + let name = (0, shared_utils_1.isFunction)(metatypeOrToken) + ? metatypeOrToken.name + : metatypeOrToken; + name = name && name.toString(); + super((0, messages_1.INVALID_CLASS_SCOPE_MESSAGE) `${name}`); + } +} +exports.InvalidClassScopeException = InvalidClassScopeException; diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-class.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/invalid-class.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ce9498c142f9e69d52e1c13b2264a13a35c6c84d --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-class.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class InvalidClassException extends RuntimeException { + constructor(value: any); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-class.exception.js b/node_modules/@nestjs/core/errors/exceptions/invalid-class.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..529407c953f1e2bed90c8047f84c79aef7b6f530 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-class.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvalidClassException = void 0; +const messages_1 = require("../messages"); +const runtime_exception_1 = require("./runtime.exception"); +class InvalidClassException extends runtime_exception_1.RuntimeException { + constructor(value) { + super((0, messages_1.INVALID_CLASS_MESSAGE) `${value}`); + } +} +exports.InvalidClassException = InvalidClassException; diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-exception-filter.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/invalid-exception-filter.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a2ed936da89b68611b610da5b6e0a686d8f53d3d --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-exception-filter.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class InvalidExceptionFilterException extends RuntimeException { + constructor(); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-exception-filter.exception.js b/node_modules/@nestjs/core/errors/exceptions/invalid-exception-filter.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..9e2439edb0ba9c4600ad9dde2fd1d0b255838603 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-exception-filter.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvalidExceptionFilterException = void 0; +const runtime_exception_1 = require("./runtime.exception"); +const messages_1 = require("../messages"); +class InvalidExceptionFilterException extends runtime_exception_1.RuntimeException { + constructor() { + super(messages_1.INVALID_EXCEPTION_FILTER); + } +} +exports.InvalidExceptionFilterException = InvalidExceptionFilterException; diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-middleware-configuration.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/invalid-middleware-configuration.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a4bbaaa03ea68fb0faf36cb6c61c360da43b02de --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-middleware-configuration.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class InvalidMiddlewareConfigurationException extends RuntimeException { + constructor(); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-middleware-configuration.exception.js b/node_modules/@nestjs/core/errors/exceptions/invalid-middleware-configuration.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..fadbe531e30c710c8311686114b63b2d811414ad --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-middleware-configuration.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvalidMiddlewareConfigurationException = void 0; +const runtime_exception_1 = require("./runtime.exception"); +const messages_1 = require("../messages"); +class InvalidMiddlewareConfigurationException extends runtime_exception_1.RuntimeException { + constructor() { + super(messages_1.INVALID_MIDDLEWARE_CONFIGURATION); + } +} +exports.InvalidMiddlewareConfigurationException = InvalidMiddlewareConfigurationException; diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-middleware.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/invalid-middleware.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..acb777c38ac848b119751e654bc574076cf9349f --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-middleware.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class InvalidMiddlewareException extends RuntimeException { + constructor(name: string); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-middleware.exception.js b/node_modules/@nestjs/core/errors/exceptions/invalid-middleware.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..7dbbe88728941ead84e9d72c626615492314a160 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-middleware.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvalidMiddlewareException = void 0; +const messages_1 = require("../messages"); +const runtime_exception_1 = require("./runtime.exception"); +class InvalidMiddlewareException extends runtime_exception_1.RuntimeException { + constructor(name) { + super((0, messages_1.INVALID_MIDDLEWARE_MESSAGE) `${name}`); + } +} +exports.InvalidMiddlewareException = InvalidMiddlewareException; diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-module.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/invalid-module.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e5388167a7522c96a61ad7ba9a3fe22fd7fc19f --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-module.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class InvalidModuleException extends RuntimeException { + constructor(parentModule: any, index: number, scope: any[], receivedValue: unknown); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/invalid-module.exception.js b/node_modules/@nestjs/core/errors/exceptions/invalid-module.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..5762a7f833f033856c585e11a97f7a8a44da40f4 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/invalid-module.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InvalidModuleException = void 0; +const messages_1 = require("../messages"); +const runtime_exception_1 = require("./runtime.exception"); +class InvalidModuleException extends runtime_exception_1.RuntimeException { + constructor(parentModule, index, scope, receivedValue) { + super((0, messages_1.INVALID_MODULE_MESSAGE)(parentModule, index, scope, receivedValue)); + } +} +exports.InvalidModuleException = InvalidModuleException; diff --git a/node_modules/@nestjs/core/errors/exceptions/route-conflict.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/route-conflict.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2818b5cabf986f99f446906910d1d13a40e22228 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/route-conflict.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception.js'; +export declare class RouteConflictException extends RuntimeException { + constructor(messages: string[]); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/route-conflict.exception.js b/node_modules/@nestjs/core/errors/exceptions/route-conflict.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..d40407dc6483593c0dfee4aa607ff0af16281e94 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/route-conflict.exception.js @@ -0,0 +1,7 @@ +import { ROUTE_CONFLICT_MESSAGE } from '../messages.js'; +import { RuntimeException } from './runtime.exception.js'; +export class RouteConflictException extends RuntimeException { + constructor(messages) { + super(ROUTE_CONFLICT_MESSAGE(messages)); + } +} diff --git a/node_modules/@nestjs/core/errors/exceptions/runtime.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/runtime.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad4339f1608701a94231ef398b4257e0daa918fb --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/runtime.exception.d.ts @@ -0,0 +1,4 @@ +export declare class RuntimeException extends Error { + constructor(message?: string); + what(): string; +} diff --git a/node_modules/@nestjs/core/errors/exceptions/runtime.exception.js b/node_modules/@nestjs/core/errors/exceptions/runtime.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..bc248e5ade18d19f54ac1d5f64bbdf380727c0d8 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/runtime.exception.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RuntimeException = void 0; +class RuntimeException extends Error { + constructor(message = ``) { + super(message); + } + what() { + return this.message; + } +} +exports.RuntimeException = RuntimeException; diff --git a/node_modules/@nestjs/core/errors/exceptions/undefined-dependency.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/undefined-dependency.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..74156ce733328b9d1fe4fe9758fe2b6d21657f9f --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/undefined-dependency.exception.d.ts @@ -0,0 +1,6 @@ +import { InjectorDependencyContext } from '../../injector/injector'; +import { Module } from '../../injector/module'; +import { RuntimeException } from './runtime.exception'; +export declare class UndefinedDependencyException extends RuntimeException { + constructor(type: string, undefinedDependencyContext: InjectorDependencyContext, moduleRef?: Module); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/undefined-dependency.exception.js b/node_modules/@nestjs/core/errors/exceptions/undefined-dependency.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..661e8fe257937d49ed78e024ae198766d0abf6d3 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/undefined-dependency.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UndefinedDependencyException = void 0; +const messages_1 = require("../messages"); +const runtime_exception_1 = require("./runtime.exception"); +class UndefinedDependencyException extends runtime_exception_1.RuntimeException { + constructor(type, undefinedDependencyContext, moduleRef) { + super((0, messages_1.UNKNOWN_DEPENDENCIES_MESSAGE)(type, undefinedDependencyContext, moduleRef)); + } +} +exports.UndefinedDependencyException = UndefinedDependencyException; diff --git a/node_modules/@nestjs/core/errors/exceptions/undefined-forwardref.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/undefined-forwardref.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3269ddab382605773ad4396c3565cb873e556169 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/undefined-forwardref.exception.d.ts @@ -0,0 +1,5 @@ +import { RuntimeException } from './runtime.exception'; +import { Type } from '@nestjs/common'; +export declare class UndefinedForwardRefException extends RuntimeException { + constructor(scope: Type[]); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/undefined-forwardref.exception.js b/node_modules/@nestjs/core/errors/exceptions/undefined-forwardref.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..a35e069edeafbf7e5e495a116df8400fb2528a1c --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/undefined-forwardref.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UndefinedForwardRefException = void 0; +const messages_1 = require("../messages"); +const runtime_exception_1 = require("./runtime.exception"); +class UndefinedForwardRefException extends runtime_exception_1.RuntimeException { + constructor(scope) { + super((0, messages_1.UNDEFINED_FORWARDREF_MESSAGE)(scope)); + } +} +exports.UndefinedForwardRefException = UndefinedForwardRefException; diff --git a/node_modules/@nestjs/core/errors/exceptions/undefined-module.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/undefined-module.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f0e929be5ef31727db66e6d42e161c4f8c74720f --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/undefined-module.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class UndefinedModuleException extends RuntimeException { + constructor(parentModule: any, index: number, scope: any[]); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/undefined-module.exception.js b/node_modules/@nestjs/core/errors/exceptions/undefined-module.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..df5f9ec7efd8c22c1db160c36cbefd7b42b71544 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/undefined-module.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UndefinedModuleException = void 0; +const runtime_exception_1 = require("./runtime.exception"); +const messages_1 = require("../messages"); +class UndefinedModuleException extends runtime_exception_1.RuntimeException { + constructor(parentModule, index, scope) { + super((0, messages_1.UNDEFINED_MODULE_MESSAGE)(parentModule, index, scope)); + } +} +exports.UndefinedModuleException = UndefinedModuleException; diff --git a/node_modules/@nestjs/core/errors/exceptions/unknown-dependencies.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/unknown-dependencies.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..716750eeb0b433d313980bef436a8f4dd601c6ee --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/unknown-dependencies.exception.d.ts @@ -0,0 +1,16 @@ +import { InjectorDependencyContext } from '../../injector/injector'; +import { Module } from '../../injector/module'; +import { RuntimeException } from './runtime.exception'; +export declare class UnknownDependenciesException extends RuntimeException { + readonly type: string | symbol; + readonly context: InjectorDependencyContext; + readonly metadata?: { + id: string; + } | undefined; + readonly moduleRef: { + id: string; + } | undefined; + constructor(type: string | symbol, context: InjectorDependencyContext, moduleRef?: Module, metadata?: { + id: string; + } | undefined); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/unknown-dependencies.exception.js b/node_modules/@nestjs/core/errors/exceptions/unknown-dependencies.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..98c408e303b87222adaea079b22643be0313eab7 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/unknown-dependencies.exception.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnknownDependenciesException = void 0; +const messages_1 = require("../messages"); +const runtime_exception_1 = require("./runtime.exception"); +class UnknownDependenciesException extends runtime_exception_1.RuntimeException { + constructor(type, context, moduleRef, metadata) { + super((0, messages_1.UNKNOWN_DEPENDENCIES_MESSAGE)(type, context, moduleRef)); + this.type = type; + this.context = context; + this.metadata = metadata; + this.moduleRef = moduleRef && { id: moduleRef.id }; + } +} +exports.UnknownDependenciesException = UnknownDependenciesException; diff --git a/node_modules/@nestjs/core/errors/exceptions/unknown-element.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/unknown-element.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f189c815688c6128dec053eb657b5672ca463d4c --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/unknown-element.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class UnknownElementException extends RuntimeException { + constructor(name?: string | symbol); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/unknown-element.exception.js b/node_modules/@nestjs/core/errors/exceptions/unknown-element.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..ede2284fd6e8c95bda95bd19a90002d7e466f255 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/unknown-element.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnknownElementException = void 0; +const runtime_exception_1 = require("./runtime.exception"); +class UnknownElementException extends runtime_exception_1.RuntimeException { + constructor(name) { + name = name && name.toString(); + super(`Nest could not find ${name || 'given'} element (this provider does not exist in the current context)`); + } +} +exports.UnknownElementException = UnknownElementException; diff --git a/node_modules/@nestjs/core/errors/exceptions/unknown-export.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/unknown-export.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..92b683f59597070a7f5e3e65665d6534c75f9ed4 --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/unknown-export.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class UnknownExportException extends RuntimeException { + constructor(token: string | symbol, moduleName: string); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/unknown-export.exception.js b/node_modules/@nestjs/core/errors/exceptions/unknown-export.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..cb8e313d5fa13c4d4a9f7690535a3b57cca9937b --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/unknown-export.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnknownExportException = void 0; +const messages_1 = require("../messages"); +const runtime_exception_1 = require("./runtime.exception"); +class UnknownExportException extends runtime_exception_1.RuntimeException { + constructor(token, moduleName) { + super((0, messages_1.UNKNOWN_EXPORT_MESSAGE)(token, moduleName)); + } +} +exports.UnknownExportException = UnknownExportException; diff --git a/node_modules/@nestjs/core/errors/exceptions/unknown-module.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/unknown-module.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..51a3bec5025644b037e81f7b225af044e375c48b --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/unknown-module.exception.d.ts @@ -0,0 +1,4 @@ +import { RuntimeException } from './runtime.exception'; +export declare class UnknownModuleException extends RuntimeException { + constructor(moduleName?: string); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/unknown-module.exception.js b/node_modules/@nestjs/core/errors/exceptions/unknown-module.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..ea12014826d61325eac533a058d79ca52b57217e --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/unknown-module.exception.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnknownModuleException = void 0; +const runtime_exception_1 = require("./runtime.exception"); +class UnknownModuleException extends runtime_exception_1.RuntimeException { + constructor(moduleName) { + super(`Nest could not select the given module (${moduleName ? `"${moduleName}"` : 'it'} does not exist in current context).`); + } +} +exports.UnknownModuleException = UnknownModuleException; diff --git a/node_modules/@nestjs/core/errors/exceptions/unknown-request-mapping.exception.d.ts b/node_modules/@nestjs/core/errors/exceptions/unknown-request-mapping.exception.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..22c15a9a86ce1a49ba431dc2825dc77a579f3c0d --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/unknown-request-mapping.exception.d.ts @@ -0,0 +1,5 @@ +import type { Type } from '@nestjs/common'; +import { RuntimeException } from './runtime.exception'; +export declare class UnknownRequestMappingException extends RuntimeException { + constructor(metatype: Type); +} diff --git a/node_modules/@nestjs/core/errors/exceptions/unknown-request-mapping.exception.js b/node_modules/@nestjs/core/errors/exceptions/unknown-request-mapping.exception.js new file mode 100644 index 0000000000000000000000000000000000000000..f052caf7ee948e2c54d8fb067cfb8c7a520a54de --- /dev/null +++ b/node_modules/@nestjs/core/errors/exceptions/unknown-request-mapping.exception.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnknownRequestMappingException = void 0; +const runtime_exception_1 = require("./runtime.exception"); +const messages_1 = require("../messages"); +class UnknownRequestMappingException extends runtime_exception_1.RuntimeException { + constructor(metatype) { + super((0, messages_1.UNKNOWN_REQUEST_MAPPING)(metatype)); + } +} +exports.UnknownRequestMappingException = UnknownRequestMappingException; diff --git a/node_modules/@nestjs/core/errors/messages.d.ts b/node_modules/@nestjs/core/errors/messages.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6ccfaf1748819879379c2b7816287bbd59b30be --- /dev/null +++ b/node_modules/@nestjs/core/errors/messages.d.ts @@ -0,0 +1,17 @@ +import type { ForwardReference, Type } from '@nestjs/common'; +import { InjectorDependencyContext } from '../injector/injector'; +import { Module } from '../injector/module'; +export declare const UNKNOWN_DEPENDENCIES_MESSAGE: (type: string | symbol, unknownDependencyContext: InjectorDependencyContext, moduleRef: Module | undefined) => string; +export declare const INVALID_MIDDLEWARE_MESSAGE: (text: TemplateStringsArray, name: string) => string; +export declare const UNDEFINED_FORWARDREF_MESSAGE: (scope: Type[]) => string; +export declare const INVALID_MODULE_MESSAGE: (parentModule: any, index: number, scope: any[], receivedValue: unknown) => string; +export declare const USING_INVALID_CLASS_AS_A_MODULE_MESSAGE: (metatypeUsedAsAModule: Type | ForwardReference, scope: any[], classKind: "provider" | "controller" | "filter") => string; +export declare const UNDEFINED_MODULE_MESSAGE: (parentModule: any, index: number, scope: any[]) => string; +export declare const UNKNOWN_EXPORT_MESSAGE: (token: string | symbol | undefined, module: string) => string; +export declare const INVALID_CLASS_MESSAGE: (text: TemplateStringsArray, value: any) => string; +export declare const INVALID_CLASS_SCOPE_MESSAGE: (text: TemplateStringsArray, name: string | undefined) => string; +export declare const UNKNOWN_REQUEST_MAPPING: (metatype: Type) => string; +export declare const INVALID_MIDDLEWARE_CONFIGURATION = "An invalid middleware configuration has been passed inside the module 'configure()' method."; +export declare const UNHANDLED_RUNTIME_EXCEPTION = "Unhandled Runtime Exception."; +export declare const INVALID_EXCEPTION_FILTER = "Invalid exception filters (@UseFilters())."; +export declare const MICROSERVICES_PACKAGE_NOT_FOUND_EXCEPTION = "Unable to load @nestjs/microservices package. (Please make sure that it's already installed.)"; diff --git a/node_modules/@nestjs/core/errors/messages.js b/node_modules/@nestjs/core/errors/messages.js new file mode 100644 index 0000000000000000000000000000000000000000..c076fae71c1bfe5b7091b9dd671540d6741703aa --- /dev/null +++ b/node_modules/@nestjs/core/errors/messages.js @@ -0,0 +1,200 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MICROSERVICES_PACKAGE_NOT_FOUND_EXCEPTION = exports.INVALID_EXCEPTION_FILTER = exports.UNHANDLED_RUNTIME_EXCEPTION = exports.INVALID_MIDDLEWARE_CONFIGURATION = exports.UNKNOWN_REQUEST_MAPPING = exports.INVALID_CLASS_SCOPE_MESSAGE = exports.INVALID_CLASS_MESSAGE = exports.UNKNOWN_EXPORT_MESSAGE = exports.UNDEFINED_MODULE_MESSAGE = exports.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = exports.INVALID_MODULE_MESSAGE = exports.UNDEFINED_FORWARDREF_MESSAGE = exports.INVALID_MIDDLEWARE_MESSAGE = exports.UNKNOWN_DEPENDENCIES_MESSAGE = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +/** + * Returns the name of an instance or `undefined` + * @param instance The instance which should get the name from + */ +const getInstanceName = (instance) => { + if (instance?.forwardRef) { + return instance.forwardRef()?.name; + } + if (instance?.module) { + return instance.module?.name; + } + return instance?.name; +}; +/** + * Returns the name of the dependency. + * Tries to get the class name, otherwise the string value + * (= injection token). As fallback to any falsy value for `dependency`, it + * returns `fallbackValue` + * @param dependency The name of the dependency to be displayed + * @param fallbackValue The fallback value if the dependency is falsy + * @param disambiguated Whether dependency's name is disambiguated with double quotes + */ +const getDependencyName = (dependency, fallbackValue, disambiguated = true) => +// use class name +getInstanceName(dependency) || + // use injection token (symbol) + ((0, shared_utils_1.isSymbol)(dependency) && dependency.toString()) || + // use string directly + (dependency + ? disambiguated + ? `"${dependency}"` + : dependency + : undefined) || + // otherwise + fallbackValue; +/** + * Returns the name of the module + * Tries to get the class name. As fallback it returns 'current'. + * @param module The module which should get displayed + */ +const getModuleName = (module) => (module && getInstanceName(module.metatype)) || 'current'; +const stringifyScope = (scope) => (scope || []).map(getInstanceName).join(' -> '); +const UNKNOWN_DEPENDENCIES_MESSAGE = (type, unknownDependencyContext, moduleRef) => { + const { index, name, dependencies, key } = unknownDependencyContext; + const moduleName = getModuleName(moduleRef); + const dependencyName = getDependencyName(name, 'dependency'); + const isImportTypeIssue = !(0, shared_utils_1.isNil)(index) && + dependencies && + (dependencies[index] === undefined || + dependencies[index] === Object || + (typeof dependencies[index] === 'function' && + dependencies[index].name === 'Object')); + let potentialSolutions; + if (isImportTypeIssue) { + potentialSolutions = `\n +Potential solutions: +- The dependency at index [${index}] appears to be undefined at runtime +- This commonly occurs when using 'import type' instead of 'import' for injectable classes +- Check your imports and change: + ❌ import type { SomeService } from './some.service'; + ✅ import { SomeService } from './some.service'; +- Ensure the imported class is decorated with @Injectable() or is a valid provider +- If using dynamic imports, ensure the class is available at runtime, not just for type checking + +For more common dependency resolution issues, see: https://docs.nestjs.com/faq/common-errors`; + } + else { + potentialSolutions = + // If module's name is well defined + moduleName !== 'current' + ? `\n +Potential solutions: +- Is ${moduleName} a valid NestJS module? +- If ${dependencyName} is a provider, is it part of the current ${moduleName}? +- If ${dependencyName} is exported from a separate @Module, is that module imported within ${moduleName}? + @Module({ + imports: [ /* the Module containing ${dependencyName} */ ] + }) + +For more common dependency resolution issues, see: https://docs.nestjs.com/faq/common-errors` + : `\n +Potential solutions: +- If ${dependencyName} is a provider, is it part of the current Module? +- If ${dependencyName} is exported from a separate @Module, is that module imported within Module? + @Module({ + imports: [ /* the Module containing ${dependencyName} */ ] + }) + +For more common dependency resolution issues, see: https://docs.nestjs.com/faq/common-errors`; + } + let message = `Nest can't resolve dependencies of the ${type.toString()}`; + if ((0, shared_utils_1.isNil)(index)) { + message += `. Please make sure that the "${key.toString()}" property is available in the current context.${potentialSolutions}`; + return message; + } + const dependenciesName = (dependencies || []).map(dependencyName => getDependencyName(dependencyName, '+', false)); + dependenciesName[index] = '?'; + const tokenFragment = !isImportTypeIssue && name !== undefined ? ` ${dependencyName}` : ''; + const contextLabel = isImportTypeIssue ? 'current' : moduleName; + message += ` (`; + message += dependenciesName.join(', '); + message += `). Please make sure that the argument${tokenFragment} at index [${index}]`; + message += ` is available in the ${contextLabel} module.`; + message += potentialSolutions; + return message; +}; +exports.UNKNOWN_DEPENDENCIES_MESSAGE = UNKNOWN_DEPENDENCIES_MESSAGE; +const INVALID_MIDDLEWARE_MESSAGE = (text, name) => `The middleware doesn't provide the 'use' method (${name})`; +exports.INVALID_MIDDLEWARE_MESSAGE = INVALID_MIDDLEWARE_MESSAGE; +const UNDEFINED_FORWARDREF_MESSAGE = (scope) => `Nest cannot create the module instance. Often, this is because of a circular dependency between modules. Use forwardRef() to avoid it. + +(Read more: https://docs.nestjs.com/fundamentals/circular-dependency) +Scope [${stringifyScope(scope)}] +`; +exports.UNDEFINED_FORWARDREF_MESSAGE = UNDEFINED_FORWARDREF_MESSAGE; +const INVALID_MODULE_MESSAGE = (parentModule, index, scope, receivedValue) => { + const parentModuleName = parentModule?.name || 'module'; + let formattedValue; + let receivedType; + if (receivedValue === null) { + formattedValue = 'null'; + receivedType = 'null'; + } + else if (typeof receivedValue === 'string') { + formattedValue = `"${receivedValue}"`; + receivedType = 'string'; + } + else { + formattedValue = String(receivedValue); + receivedType = typeof receivedValue; + } + return `Nest cannot create the ${parentModuleName} instance. +Received an unexpected value at index [${index}] of the ${parentModuleName} "imports" array. +The received value \`${formattedValue}\` is of type "${receivedType}". + +Scope [${stringifyScope(scope)}]`; +}; +exports.INVALID_MODULE_MESSAGE = INVALID_MODULE_MESSAGE; +const USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = (metatypeUsedAsAModule, scope, classKind) => { + const metatypeNameQuote = `"${getInstanceName(metatypeUsedAsAModule)}"`; + let hint; + switch (classKind) { + case 'controller': + hint = `${metatypeNameQuote} is decorated with @Controller() and cannot appear in the "imports" array of a module. Please move ${metatypeNameQuote} to the "controllers" array of the importing module instead.`; + break; + case 'provider': + hint = `${metatypeNameQuote} is decorated with @Injectable() and cannot appear in the "imports" array of a module. Please move ${metatypeNameQuote} to the "providers" array of the importing module instead.`; + break; + case 'filter': + hint = `${metatypeNameQuote} is decorated with @Catch() and cannot appear in the "imports" array of a module. Please move ${metatypeNameQuote} to the "providers" array (using the APP_FILTER token to apply it globally) or apply it via @UseFilters() instead.`; + break; + } + return `${hint} + +Scope [${stringifyScope(scope)}] +`; +}; +exports.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = USING_INVALID_CLASS_AS_A_MODULE_MESSAGE; +const UNDEFINED_MODULE_MESSAGE = (parentModule, index, scope) => { + const parentModuleName = parentModule?.name || 'module'; + return `Nest cannot create the ${parentModuleName} instance. +The module at index [${index}] of the ${parentModuleName} "imports" array is undefined. + +Potential causes: +- A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency +- The module at index [${index}] is of type "undefined". Check your import statements and the type of the module. + +Scope [${stringifyScope(scope)}]`; +}; +exports.UNDEFINED_MODULE_MESSAGE = UNDEFINED_MODULE_MESSAGE; +const UNKNOWN_EXPORT_MESSAGE = (token = 'item', module) => { + token = (0, shared_utils_1.isSymbol)(token) ? token.toString() : token; + return `Nest cannot export a provider/module that is not a part of the currently processed module (${module}). Please verify whether the exported ${token} is available in this particular context. + +Possible Solutions: +- Is ${token} part of the relevant providers/imports within ${module}? + +For more common dependency resolution issues, see: https://docs.nestjs.com/faq/common-errors +`; +}; +exports.UNKNOWN_EXPORT_MESSAGE = UNKNOWN_EXPORT_MESSAGE; +const INVALID_CLASS_MESSAGE = (text, value) => `ModuleRef cannot instantiate class (${value} is not constructable).`; +exports.INVALID_CLASS_MESSAGE = INVALID_CLASS_MESSAGE; +const INVALID_CLASS_SCOPE_MESSAGE = (text, name) => `${name || 'This class'} is marked as a scoped provider. Request and transient-scoped providers can't be used in combination with "get()" method. Please, use "resolve()" instead.`; +exports.INVALID_CLASS_SCOPE_MESSAGE = INVALID_CLASS_SCOPE_MESSAGE; +const UNKNOWN_REQUEST_MAPPING = (metatype) => { + const className = metatype.name; + return className + ? `An invalid controller has been detected. "${className}" does not have the @Controller() decorator but it is being listed in the "controllers" array of some module.` + : `An invalid controller has been detected. Perhaps, one of your controllers is missing the @Controller() decorator.`; +}; +exports.UNKNOWN_REQUEST_MAPPING = UNKNOWN_REQUEST_MAPPING; +exports.INVALID_MIDDLEWARE_CONFIGURATION = `An invalid middleware configuration has been passed inside the module 'configure()' method.`; +exports.UNHANDLED_RUNTIME_EXCEPTION = `Unhandled Runtime Exception.`; +exports.INVALID_EXCEPTION_FILTER = `Invalid exception filters (@UseFilters()).`; +exports.MICROSERVICES_PACKAGE_NOT_FOUND_EXCEPTION = `Unable to load @nestjs/microservices package. (Please make sure that it's already installed.)`; diff --git a/node_modules/@nestjs/core/exceptions/base-exception-filter-context.d.ts b/node_modules/@nestjs/core/exceptions/base-exception-filter-context.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2f333e9cb01460dbe4a781ca39aa191f2540c1e4 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/base-exception-filter-context.d.ts @@ -0,0 +1,14 @@ +import { Type } from '@nestjs/common/interfaces'; +import { ExceptionFilter } from '@nestjs/common/interfaces/exceptions/exception-filter.interface'; +import { ContextCreator } from '../helpers/context-creator'; +import { NestContainer } from '../injector/container'; +import { InstanceWrapper } from '../injector/instance-wrapper'; +export declare class BaseExceptionFilterContext extends ContextCreator { + private readonly container; + protected moduleContext: string; + constructor(container: NestContainer); + createConcreteContext(metadata: T, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): R; + getFilterInstance(filter: Function | ExceptionFilter, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): ExceptionFilter | null; + getInstanceByMetatype(metatype: Type): InstanceWrapper | undefined; + reflectCatchExceptions(instance: ExceptionFilter): Type[]; +} diff --git a/node_modules/@nestjs/core/exceptions/base-exception-filter-context.js b/node_modules/@nestjs/core/exceptions/base-exception-filter-context.js new file mode 100644 index 0000000000000000000000000000000000000000..b05f3a72690b9a72b4205acf89736a2d3a967b56 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/base-exception-filter-context.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BaseExceptionFilterContext = void 0; +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const context_creator_1 = require("../helpers/context-creator"); +const constants_2 = require("../injector/constants"); +class BaseExceptionFilterContext extends context_creator_1.ContextCreator { + constructor(container) { + super(); + this.container = container; + } + createConcreteContext(metadata, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + if ((0, shared_utils_1.isEmpty)(metadata)) { + return []; + } + return (0, iterare_1.iterate)(metadata) + .filter(instance => instance && ((0, shared_utils_1.isFunction)(instance.catch) || instance.name)) + .map(filter => this.getFilterInstance(filter, contextId, inquirerId)) + .filter(item => !!item) + .map(instance => ({ + func: instance.catch.bind(instance), + exceptionMetatypes: this.reflectCatchExceptions(instance), + })) + .toArray(); + } + getFilterInstance(filter, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + const isObject = !!filter.catch; + if (isObject) { + return filter; + } + const instanceWrapper = this.getInstanceByMetatype(filter); + if (!instanceWrapper) { + return null; + } + const instanceHost = instanceWrapper.getInstanceByContextId(this.getContextId(contextId, instanceWrapper), inquirerId); + return instanceHost && instanceHost.instance; + } + getInstanceByMetatype(metatype) { + if (!this.moduleContext) { + return; + } + const collection = this.container.getModules(); + const moduleRef = collection.get(this.moduleContext); + if (!moduleRef) { + return; + } + return moduleRef.injectables.get(metatype); + } + reflectCatchExceptions(instance) { + const prototype = Object.getPrototypeOf(instance); + return (Reflect.getMetadata(constants_1.FILTER_CATCH_EXCEPTIONS, prototype.constructor) || []); + } +} +exports.BaseExceptionFilterContext = BaseExceptionFilterContext; diff --git a/node_modules/@nestjs/core/exceptions/base-exception-filter.d.ts b/node_modules/@nestjs/core/exceptions/base-exception-filter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..91670864c27c09dd661a2e3da98812c6ecfea13c --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/base-exception-filter.d.ts @@ -0,0 +1,20 @@ +import { ArgumentsHost, ExceptionFilter, HttpServer } from '@nestjs/common'; +import { AbstractHttpAdapter } from '../adapters'; +import { HttpAdapterHost } from '../helpers/http-adapter-host'; +export declare class BaseExceptionFilter implements ExceptionFilter { + protected readonly applicationRef?: HttpServer | undefined; + private static readonly logger; + protected readonly httpAdapterHost?: HttpAdapterHost; + constructor(applicationRef?: HttpServer | undefined); + catch(exception: T, host: ArgumentsHost): void; + handleUnknownError(exception: T, host: ArgumentsHost, applicationRef: AbstractHttpAdapter | HttpServer): void; + isExceptionObject(err: any): err is Error; + /** + * Checks if the thrown error comes from the "http-errors" library. + * @param err error object + */ + isHttpError(err: any): err is { + statusCode: number; + message: string; + }; +} diff --git a/node_modules/@nestjs/core/exceptions/base-exception-filter.js b/node_modules/@nestjs/core/exceptions/base-exception-filter.js new file mode 100644 index 0000000000000000000000000000000000000000..b3db345a5e35452b6f5f7c692613f12e6805929f --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/base-exception-filter.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BaseExceptionFilter = void 0; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const constants_1 = require("../constants"); +const http_adapter_host_1 = require("../helpers/http-adapter-host"); +class BaseExceptionFilter { + constructor(applicationRef) { + this.applicationRef = applicationRef; + } + catch(exception, host) { + const applicationRef = this.applicationRef || + (this.httpAdapterHost && this.httpAdapterHost.httpAdapter); + if (!(exception instanceof common_1.HttpException)) { + return this.handleUnknownError(exception, host, applicationRef); + } + const res = exception.getResponse(); + const message = (0, shared_utils_1.isObject)(res) + ? res + : { + statusCode: exception.getStatus(), + message: res, + }; + const response = host.getArgByIndex(1); + if (!applicationRef.isHeadersSent(response)) { + applicationRef.reply(response, message, exception.getStatus()); + } + else { + applicationRef.end(response); + } + } + handleUnknownError(exception, host, applicationRef) { + const body = this.isHttpError(exception) + ? { + statusCode: exception.statusCode, + message: exception.message, + } + : { + statusCode: common_1.HttpStatus.INTERNAL_SERVER_ERROR, + message: constants_1.MESSAGES.UNKNOWN_EXCEPTION_MESSAGE, + }; + const response = host.getArgByIndex(1); + if (!applicationRef.isHeadersSent(response)) { + applicationRef.reply(response, body, body.statusCode); + } + else { + applicationRef.end(response); + } + if (!(exception instanceof common_1.IntrinsicException)) { + BaseExceptionFilter.logger.error(exception); + } + } + isExceptionObject(err) { + return (0, shared_utils_1.isObject)(err) && !!err.message; + } + /** + * Checks if the thrown error comes from the "http-errors" library. + * @param err error object + */ + isHttpError(err) { + return err?.statusCode && err?.message; + } +} +exports.BaseExceptionFilter = BaseExceptionFilter; +BaseExceptionFilter.logger = new common_1.Logger('ExceptionsHandler'); +tslib_1.__decorate([ + (0, common_1.Optional)(), + (0, common_1.Inject)(), + tslib_1.__metadata("design:type", http_adapter_host_1.HttpAdapterHost) +], BaseExceptionFilter.prototype, "httpAdapterHost", void 0); diff --git a/node_modules/@nestjs/core/exceptions/exceptions-handler.d.ts b/node_modules/@nestjs/core/exceptions/exceptions-handler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1fd6e332fa66582ba1e8eb46d86b99a3cb914156 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/exceptions-handler.d.ts @@ -0,0 +1,10 @@ +import { HttpException } from '@nestjs/common'; +import { ExceptionFilterMetadata } from '@nestjs/common/interfaces/exceptions/exception-filter-metadata.interface'; +import { ArgumentsHost } from '@nestjs/common/interfaces/features/arguments-host.interface'; +import { BaseExceptionFilter } from './base-exception-filter'; +export declare class ExceptionsHandler extends BaseExceptionFilter { + private filters; + next(exception: Error | HttpException, ctx: ArgumentsHost): void; + setCustomFilters(filters: ExceptionFilterMetadata[]): void; + invokeCustomFilters(exception: T, ctx: ArgumentsHost): boolean; +} diff --git a/node_modules/@nestjs/core/exceptions/exceptions-handler.js b/node_modules/@nestjs/core/exceptions/exceptions-handler.js new file mode 100644 index 0000000000000000000000000000000000000000..f9166d8f07367e5ba5bdc6bedfa98e28fcfa71a7 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/exceptions-handler.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExceptionsHandler = void 0; +const select_exception_filter_metadata_util_1 = require("@nestjs/common/utils/select-exception-filter-metadata.util"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const invalid_exception_filter_exception_1 = require("../errors/exceptions/invalid-exception-filter.exception"); +const base_exception_filter_1 = require("./base-exception-filter"); +class ExceptionsHandler extends base_exception_filter_1.BaseExceptionFilter { + constructor() { + super(...arguments); + this.filters = []; + } + next(exception, ctx) { + if (this.invokeCustomFilters(exception, ctx)) { + return; + } + super.catch(exception, ctx); + } + setCustomFilters(filters) { + if (!Array.isArray(filters)) { + throw new invalid_exception_filter_exception_1.InvalidExceptionFilterException(); + } + this.filters = filters; + } + invokeCustomFilters(exception, ctx) { + if ((0, shared_utils_1.isEmpty)(this.filters)) { + return false; + } + const filter = (0, select_exception_filter_metadata_util_1.selectExceptionFilterMetadata)(this.filters, exception); + filter && filter.func(exception, ctx); + return !!filter; + } +} +exports.ExceptionsHandler = ExceptionsHandler; diff --git a/node_modules/@nestjs/core/exceptions/external-exception-filter-context.d.ts b/node_modules/@nestjs/core/exceptions/external-exception-filter-context.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3f5c3709219e5ba5a5d890ae9d7966e0619d0366 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/external-exception-filter-context.d.ts @@ -0,0 +1,12 @@ +import { Controller } from '@nestjs/common/interfaces'; +import { ApplicationConfig } from '../application-config'; +import { NestContainer } from '../injector/container'; +import { RouterProxyCallback } from '../router/router-proxy'; +import { BaseExceptionFilterContext } from './base-exception-filter-context'; +import { ExternalExceptionsHandler } from './external-exceptions-handler'; +export declare class ExternalExceptionFilterContext extends BaseExceptionFilterContext { + private readonly config?; + constructor(container: NestContainer, config?: ApplicationConfig | undefined); + create(instance: Controller, callback: RouterProxyCallback, module: string, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): ExternalExceptionsHandler; + getGlobalMetadata(contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): T; +} diff --git a/node_modules/@nestjs/core/exceptions/external-exception-filter-context.js b/node_modules/@nestjs/core/exceptions/external-exception-filter-context.js new file mode 100644 index 0000000000000000000000000000000000000000..a2b2582350dbd81d660f48048dd3691662ecd759 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/external-exception-filter-context.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExternalExceptionFilterContext = void 0; +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const constants_2 = require("../injector/constants"); +const base_exception_filter_context_1 = require("./base-exception-filter-context"); +const external_exceptions_handler_1 = require("./external-exceptions-handler"); +class ExternalExceptionFilterContext extends base_exception_filter_context_1.BaseExceptionFilterContext { + constructor(container, config) { + super(container); + this.config = config; + } + create(instance, callback, module, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + this.moduleContext = module; + const exceptionHandler = new external_exceptions_handler_1.ExternalExceptionsHandler(); + const filters = this.createContext(instance, callback, constants_1.EXCEPTION_FILTERS_METADATA, contextId, inquirerId); + if ((0, shared_utils_1.isEmpty)(filters)) { + return exceptionHandler; + } + exceptionHandler.setCustomFilters(filters.reverse()); + return exceptionHandler; + } + getGlobalMetadata(contextId = constants_2.STATIC_CONTEXT, inquirerId) { + if (!this.config) { + return []; + } + const globalFilters = this.config.getGlobalFilters(); + if (contextId === constants_2.STATIC_CONTEXT && !inquirerId) { + return globalFilters; + } + const scopedFilterWrappers = this.config.getGlobalRequestFilters(); + const scopedFilters = (0, iterare_1.iterate)(scopedFilterWrappers) + .map(wrapper => wrapper.getInstanceByContextId(contextId, inquirerId)) + .filter(host => !!host) + .map(host => host.instance) + .toArray(); + return globalFilters.concat(scopedFilters); + } +} +exports.ExternalExceptionFilterContext = ExternalExceptionFilterContext; diff --git a/node_modules/@nestjs/core/exceptions/external-exception-filter.d.ts b/node_modules/@nestjs/core/exceptions/external-exception-filter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b99282b002eccdaaebe48c895b0eeb4a8b2ad93 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/external-exception-filter.d.ts @@ -0,0 +1,5 @@ +import { ArgumentsHost } from '@nestjs/common'; +export declare class ExternalExceptionFilter { + private static readonly logger; + catch(exception: T, host: ArgumentsHost): R | Promise; +} diff --git a/node_modules/@nestjs/core/exceptions/external-exception-filter.js b/node_modules/@nestjs/core/exceptions/external-exception-filter.js new file mode 100644 index 0000000000000000000000000000000000000000..2713a8b88798845affd76f4423017baeb31967e1 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/external-exception-filter.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExternalExceptionFilter = void 0; +const common_1 = require("@nestjs/common"); +class ExternalExceptionFilter { + catch(exception, host) { + if (exception instanceof Error && + !(exception instanceof common_1.IntrinsicException)) { + ExternalExceptionFilter.logger.error(exception); + } + throw exception; + } +} +exports.ExternalExceptionFilter = ExternalExceptionFilter; +ExternalExceptionFilter.logger = new common_1.Logger('ExceptionsHandler'); diff --git a/node_modules/@nestjs/core/exceptions/external-exceptions-handler.d.ts b/node_modules/@nestjs/core/exceptions/external-exceptions-handler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f1daf2e7bb0f34246e479dcacebcb39559ce796c --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/external-exceptions-handler.d.ts @@ -0,0 +1,9 @@ +import { ExceptionFilterMetadata } from '@nestjs/common/interfaces/exceptions'; +import { ArgumentsHost } from '@nestjs/common/interfaces/features/arguments-host.interface'; +import { ExternalExceptionFilter } from './external-exception-filter'; +export declare class ExternalExceptionsHandler extends ExternalExceptionFilter { + private filters; + next(exception: Error, host: ArgumentsHost): Promise; + setCustomFilters(filters: ExceptionFilterMetadata[]): void; + invokeCustomFilters(exception: T, host: ArgumentsHost): Promise | null; +} diff --git a/node_modules/@nestjs/core/exceptions/external-exceptions-handler.js b/node_modules/@nestjs/core/exceptions/external-exceptions-handler.js new file mode 100644 index 0000000000000000000000000000000000000000..649173ad16d9fc1aceb533b622dfffb342080b94 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/external-exceptions-handler.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExternalExceptionsHandler = void 0; +const select_exception_filter_metadata_util_1 = require("@nestjs/common/utils/select-exception-filter-metadata.util"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const invalid_exception_filter_exception_1 = require("../errors/exceptions/invalid-exception-filter.exception"); +const external_exception_filter_1 = require("./external-exception-filter"); +class ExternalExceptionsHandler extends external_exception_filter_1.ExternalExceptionFilter { + constructor() { + super(...arguments); + this.filters = []; + } + next(exception, host) { + const result = this.invokeCustomFilters(exception, host); + if (result) { + return result; + } + return super.catch(exception, host); + } + setCustomFilters(filters) { + if (!Array.isArray(filters)) { + throw new invalid_exception_filter_exception_1.InvalidExceptionFilterException(); + } + this.filters = filters; + } + invokeCustomFilters(exception, host) { + if ((0, shared_utils_1.isEmpty)(this.filters)) { + return null; + } + const filter = (0, select_exception_filter_metadata_util_1.selectExceptionFilterMetadata)(this.filters, exception); + return filter ? filter.func(exception, host) : null; + } +} +exports.ExternalExceptionsHandler = ExternalExceptionsHandler; diff --git a/node_modules/@nestjs/core/exceptions/index.d.ts b/node_modules/@nestjs/core/exceptions/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc19dee05adced47502331821d066ccaca39b791 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/index.d.ts @@ -0,0 +1 @@ +export * from './base-exception-filter'; diff --git a/node_modules/@nestjs/core/exceptions/index.js b/node_modules/@nestjs/core/exceptions/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e8f1ade280047603f87908b03df4a7c03b39c035 --- /dev/null +++ b/node_modules/@nestjs/core/exceptions/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./base-exception-filter"), exports); diff --git a/node_modules/@nestjs/core/guards/constants.d.ts b/node_modules/@nestjs/core/guards/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4c98c0f485ac8b57d0fc6ab9960761444106375 --- /dev/null +++ b/node_modules/@nestjs/core/guards/constants.d.ts @@ -0,0 +1 @@ +export declare const FORBIDDEN_MESSAGE = "Forbidden resource"; diff --git a/node_modules/@nestjs/core/guards/constants.js b/node_modules/@nestjs/core/guards/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..60053ec9d4f1f2cdb9a5e2b24f55d5d9f997774b --- /dev/null +++ b/node_modules/@nestjs/core/guards/constants.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FORBIDDEN_MESSAGE = void 0; +exports.FORBIDDEN_MESSAGE = 'Forbidden resource'; diff --git a/node_modules/@nestjs/core/guards/guards-consumer.d.ts b/node_modules/@nestjs/core/guards/guards-consumer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f927d7667a24393eaea7ba22e1b3c1af587c417b --- /dev/null +++ b/node_modules/@nestjs/core/guards/guards-consumer.d.ts @@ -0,0 +1,9 @@ +import { CanActivate } from '@nestjs/common'; +import { ContextType, Controller } from '@nestjs/common/interfaces'; +import { Observable } from 'rxjs'; +import { ExecutionContextHost } from '../helpers/execution-context-host'; +export declare class GuardsConsumer { + tryActivate(guards: CanActivate[], args: unknown[], instance: Controller, callback: (...args: unknown[]) => unknown, type?: TContext): Promise; + createContext(args: unknown[], instance: Controller, callback: (...args: unknown[]) => unknown): ExecutionContextHost; + pickResult(result: boolean | Promise | Observable): Promise; +} diff --git a/node_modules/@nestjs/core/guards/guards-consumer.js b/node_modules/@nestjs/core/guards/guards-consumer.js new file mode 100644 index 0000000000000000000000000000000000000000..16087c0733513c7eea22a1c3e9f794f8715af1cb --- /dev/null +++ b/node_modules/@nestjs/core/guards/guards-consumer.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GuardsConsumer = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const rxjs_1 = require("rxjs"); +const execution_context_host_1 = require("../helpers/execution-context-host"); +class GuardsConsumer { + async tryActivate(guards, args, instance, callback, type) { + if (!guards || (0, shared_utils_1.isEmpty)(guards)) { + return true; + } + const context = this.createContext(args, instance, callback); + context.setType(type); + for (const guard of guards) { + const result = guard.canActivate(context); + if (typeof result === 'boolean') { + if (!result) { + return false; + } + continue; + } + if (await this.pickResult(result)) { + continue; + } + return false; + } + return true; + } + createContext(args, instance, callback) { + return new execution_context_host_1.ExecutionContextHost(args, instance.constructor, callback); + } + async pickResult(result) { + if (result instanceof rxjs_1.Observable) { + return (0, rxjs_1.lastValueFrom)(result); + } + return result; + } +} +exports.GuardsConsumer = GuardsConsumer; diff --git a/node_modules/@nestjs/core/guards/guards-context-creator.d.ts b/node_modules/@nestjs/core/guards/guards-context-creator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c52f8dbd9fd56834f55b2c265dc01457824f7552 --- /dev/null +++ b/node_modules/@nestjs/core/guards/guards-context-creator.d.ts @@ -0,0 +1,17 @@ +import { CanActivate } from '@nestjs/common'; +import { Controller, Type } from '@nestjs/common/interfaces'; +import { ApplicationConfig } from '../application-config'; +import { ContextCreator } from '../helpers/context-creator'; +import { NestContainer } from '../injector/container'; +import { InstanceWrapper } from '../injector/instance-wrapper'; +export declare class GuardsContextCreator extends ContextCreator { + private readonly container; + private readonly config?; + private moduleContext; + constructor(container: NestContainer, config?: ApplicationConfig | undefined); + create(instance: Controller, callback: (...args: unknown[]) => unknown, module: string, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): CanActivate[]; + createConcreteContext(metadata: T, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): R; + getGuardInstance(metatype: Function | CanActivate, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): CanActivate | null; + getInstanceByMetatype(metatype: Type): InstanceWrapper | undefined; + getGlobalMetadata(contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): T; +} diff --git a/node_modules/@nestjs/core/guards/guards-context-creator.js b/node_modules/@nestjs/core/guards/guards-context-creator.js new file mode 100644 index 0000000000000000000000000000000000000000..078b8f95a145502248deef99d239e8006ac684b9 --- /dev/null +++ b/node_modules/@nestjs/core/guards/guards-context-creator.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GuardsContextCreator = void 0; +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const context_creator_1 = require("../helpers/context-creator"); +const constants_2 = require("../injector/constants"); +class GuardsContextCreator extends context_creator_1.ContextCreator { + constructor(container, config) { + super(); + this.container = container; + this.config = config; + } + create(instance, callback, module, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + this.moduleContext = module; + return this.createContext(instance, callback, constants_1.GUARDS_METADATA, contextId, inquirerId); + } + createConcreteContext(metadata, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + if ((0, shared_utils_1.isEmpty)(metadata)) { + return []; + } + return (0, iterare_1.iterate)(metadata) + .filter((guard) => guard && (guard.name || guard.canActivate)) + .map(guard => this.getGuardInstance(guard, contextId, inquirerId)) + .filter((guard) => !!guard && (0, shared_utils_1.isFunction)(guard.canActivate)) + .toArray(); + } + getGuardInstance(metatype, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + const isObject = !!metatype.canActivate; + if (isObject) { + return metatype; + } + const instanceWrapper = this.getInstanceByMetatype(metatype); + if (!instanceWrapper) { + return null; + } + const instanceHost = instanceWrapper.getInstanceByContextId(this.getContextId(contextId, instanceWrapper), inquirerId); + return instanceHost && instanceHost.instance; + } + getInstanceByMetatype(metatype) { + if (!this.moduleContext) { + return; + } + const collection = this.container.getModules(); + const moduleRef = collection.get(this.moduleContext); + if (!moduleRef) { + return; + } + const injectables = moduleRef.injectables; + return injectables.get(metatype); + } + getGlobalMetadata(contextId = constants_2.STATIC_CONTEXT, inquirerId) { + if (!this.config) { + return []; + } + const globalGuards = this.config.getGlobalGuards(); + if (contextId === constants_2.STATIC_CONTEXT && !inquirerId) { + return globalGuards; + } + const scopedGuardWrappers = this.config.getGlobalRequestGuards(); + const scopedGuards = (0, iterare_1.iterate)(scopedGuardWrappers) + .map(wrapper => wrapper.getInstanceByContextId(this.getContextId(contextId, wrapper), inquirerId)) + .filter(host => !!host) + .map(host => host.instance) + .toArray(); + return globalGuards.concat(scopedGuards); + } +} +exports.GuardsContextCreator = GuardsContextCreator; diff --git a/node_modules/@nestjs/core/guards/index.d.ts b/node_modules/@nestjs/core/guards/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..61a8b775a332783e69599192ffa597781ad2e3e5 --- /dev/null +++ b/node_modules/@nestjs/core/guards/index.d.ts @@ -0,0 +1,3 @@ +export * from './constants'; +export * from './guards-consumer'; +export * from './guards-context-creator'; diff --git a/node_modules/@nestjs/core/guards/index.js b/node_modules/@nestjs/core/guards/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2c55ce287f69a44f3653d7c37d61f745a9260def --- /dev/null +++ b/node_modules/@nestjs/core/guards/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./constants"), exports); +tslib_1.__exportStar(require("./guards-consumer"), exports); +tslib_1.__exportStar(require("./guards-context-creator"), exports); diff --git a/node_modules/@nestjs/core/helpers/barrier.d.ts b/node_modules/@nestjs/core/helpers/barrier.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c1e7dd399bfbbada266e6f9d6a5d017b17f571f5 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/barrier.d.ts @@ -0,0 +1,30 @@ +/** + * A simple barrier to synchronize flow of multiple async operations. + */ +export declare class Barrier { + private currentCount; + private targetCount; + private promise; + private resolve; + constructor(targetCount: number); + /** + * Signal that a participant has reached the barrier. + * + * The barrier will be resolved once `targetCount` participants have reached it. + */ + signal(): void; + /** + * Wait for the barrier to be resolved. + * + * @returns A promise that resolves when the barrier is resolved. + */ + wait(): Promise; + /** + * Signal that a participant has reached the barrier and wait for the barrier to be resolved. + * + * The barrier will be resolved once `targetCount` participants have reached it. + * + * @returns A promise that resolves when the barrier is resolved. + */ + signalAndWait(): Promise; +} diff --git a/node_modules/@nestjs/core/helpers/barrier.js b/node_modules/@nestjs/core/helpers/barrier.js new file mode 100644 index 0000000000000000000000000000000000000000..44dec625da57eb62974561002e9fddbb5e0af0ca --- /dev/null +++ b/node_modules/@nestjs/core/helpers/barrier.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Barrier = void 0; +/** + * A simple barrier to synchronize flow of multiple async operations. + */ +class Barrier { + constructor(targetCount) { + this.currentCount = 0; + this.targetCount = targetCount; + this.promise = new Promise(resolve => { + this.resolve = resolve; + }); + } + /** + * Signal that a participant has reached the barrier. + * + * The barrier will be resolved once `targetCount` participants have reached it. + */ + signal() { + this.currentCount += 1; + if (this.currentCount === this.targetCount) { + this.resolve(); + } + } + /** + * Wait for the barrier to be resolved. + * + * @returns A promise that resolves when the barrier is resolved. + */ + async wait() { + return this.promise; + } + /** + * Signal that a participant has reached the barrier and wait for the barrier to be resolved. + * + * The barrier will be resolved once `targetCount` participants have reached it. + * + * @returns A promise that resolves when the barrier is resolved. + */ + async signalAndWait() { + this.signal(); + return this.wait(); + } +} +exports.Barrier = Barrier; diff --git a/node_modules/@nestjs/core/helpers/context-creator.d.ts b/node_modules/@nestjs/core/helpers/context-creator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..198f852ae56dad132aac4f4845d60cfc3aae5867 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/context-creator.d.ts @@ -0,0 +1,10 @@ +import { Controller } from '@nestjs/common/interfaces'; +import { ContextId, InstanceWrapper } from '../injector/instance-wrapper'; +export declare abstract class ContextCreator { + abstract createConcreteContext(metadata: T, contextId?: ContextId, inquirerId?: string): R; + getGlobalMetadata?(contextId?: ContextId, inquirerId?: string): T; + createContext(instance: Controller, callback: (...args: any[]) => void, metadataKey: string, contextId?: ContextId, inquirerId?: string): R; + reflectClassMetadata(instance: Controller, metadataKey: string): T; + reflectMethodMetadata(callback: (...args: unknown[]) => unknown, metadataKey: string): T; + protected getContextId(contextId: ContextId, instanceWrapper: InstanceWrapper): ContextId; +} diff --git a/node_modules/@nestjs/core/helpers/context-creator.js b/node_modules/@nestjs/core/helpers/context-creator.js new file mode 100644 index 0000000000000000000000000000000000000000..04b8952172cd755dd6272cd6a9f6178c9effd6e1 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/context-creator.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ContextCreator = void 0; +const constants_1 = require("../injector/constants"); +class ContextCreator { + createContext(instance, callback, metadataKey, contextId = constants_1.STATIC_CONTEXT, inquirerId) { + const globalMetadata = this.getGlobalMetadata && + this.getGlobalMetadata(contextId, inquirerId); + const classMetadata = this.reflectClassMetadata(instance, metadataKey); + const methodMetadata = this.reflectMethodMetadata(callback, metadataKey); + return [ + ...this.createConcreteContext(globalMetadata || [], contextId, inquirerId), + ...this.createConcreteContext(classMetadata, contextId, inquirerId), + ...this.createConcreteContext(methodMetadata, contextId, inquirerId), + ]; + } + reflectClassMetadata(instance, metadataKey) { + const prototype = Object.getPrototypeOf(instance); + return Reflect.getMetadata(metadataKey, prototype.constructor); + } + reflectMethodMetadata(callback, metadataKey) { + return Reflect.getMetadata(metadataKey, callback); + } + getContextId(contextId, instanceWrapper) { + return contextId.getParent + ? contextId.getParent({ + token: instanceWrapper.token, + isTreeDurable: instanceWrapper.isDependencyTreeDurable(), + }) + : contextId; + } +} +exports.ContextCreator = ContextCreator; diff --git a/node_modules/@nestjs/core/helpers/context-id-factory.d.ts b/node_modules/@nestjs/core/helpers/context-id-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa0a951867ee2be94cde8335de85cca8d654a8c2 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/context-id-factory.d.ts @@ -0,0 +1,41 @@ +import { ContextId, HostComponentInfo } from '../injector/instance-wrapper'; +export declare function createContextId(): ContextId; +export type ContextIdResolverFn = (info: HostComponentInfo) => ContextId; +export interface ContextIdResolver { + /** + * Payload associated with the custom context id + */ + payload: unknown; + /** + * A context id resolver function + */ + resolve: ContextIdResolverFn; +} +export interface ContextIdStrategy { + /** + * Allows to attach a parent context id to the existing child context id. + * This lets you construct durable DI sub-trees that can be shared between contexts. + * @param contextId auto-generated child context id + * @param request request object + */ + attach(contextId: ContextId, request: T): ContextIdResolverFn | ContextIdResolver | undefined; +} +export declare class ContextIdFactory { + private static strategy?; + /** + * Generates a context identifier based on the request object. + */ + static create(): ContextId; + /** + * Generates a random identifier to track asynchronous execution context. + * @param request request object + */ + static getByRequest = any>(request: T, propsToInspect?: string[]): ContextId; + /** + * Registers a custom context id strategy that lets you attach + * a parent context id to the existing context id object. + * @param strategy strategy instance + */ + static apply(strategy: ContextIdStrategy): void; + private static isContextIdResolverWithPayload; +} diff --git a/node_modules/@nestjs/core/helpers/context-id-factory.js b/node_modules/@nestjs/core/helpers/context-id-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..8c1b4bab989ed43d52dd97ed82071436c01620be --- /dev/null +++ b/node_modules/@nestjs/core/helpers/context-id-factory.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ContextIdFactory = void 0; +exports.createContextId = createContextId; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const request_constants_1 = require("../router/request/request-constants"); +function createContextId() { + /** + * We are generating random identifier to track asynchronous + * execution context. An identifier does not have to be neither unique + * nor unpredictable because WeakMap uses objects as keys (reference comparison). + * Thus, even though identifier number might be equal, WeakMap would properly + * associate asynchronous context with its internal map values using object reference. + * Object is automatically removed once request has been processed (closure). + */ + return { id: Math.random() }; +} +class ContextIdFactory { + /** + * Generates a context identifier based on the request object. + */ + static create() { + return createContextId(); + } + /** + * Generates a random identifier to track asynchronous execution context. + * @param request request object + */ + static getByRequest(request, propsToInspect = ['raw']) { + if (!request) { + return ContextIdFactory.create(); + } + if (request[request_constants_1.REQUEST_CONTEXT_ID]) { + return request[request_constants_1.REQUEST_CONTEXT_ID]; + } + for (const key of propsToInspect) { + if (request[key]?.[request_constants_1.REQUEST_CONTEXT_ID]) { + return request[key][request_constants_1.REQUEST_CONTEXT_ID]; + } + } + if (!this.strategy) { + return ContextIdFactory.create(); + } + const contextId = createContextId(); + const resolverObjectOrFunction = this.strategy.attach(contextId, request); + if (this.isContextIdResolverWithPayload(resolverObjectOrFunction)) { + contextId.getParent = resolverObjectOrFunction.resolve; + contextId.payload = resolverObjectOrFunction.payload; + } + else { + contextId.getParent = resolverObjectOrFunction; + } + return contextId; + } + /** + * Registers a custom context id strategy that lets you attach + * a parent context id to the existing context id object. + * @param strategy strategy instance + */ + static apply(strategy) { + this.strategy = strategy; + } + static isContextIdResolverWithPayload(resolverOrResolverFn) { + return (0, shared_utils_1.isObject)(resolverOrResolverFn); + } +} +exports.ContextIdFactory = ContextIdFactory; diff --git a/node_modules/@nestjs/core/helpers/context-utils.d.ts b/node_modules/@nestjs/core/helpers/context-utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..191ee4b62d9c72a5155a9a9fbcd41f53de3f28a2 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/context-utils.d.ts @@ -0,0 +1,23 @@ +import { ParamData } from '@nestjs/common'; +import { ContextType, Controller, PipeTransform } from '@nestjs/common/interfaces'; +import { ExecutionContextHost } from './execution-context-host'; +export interface ParamProperties { + index: number; + type: T | string; + data: ParamData; + pipes: PipeTransform[]; + extractValue: IExtractor; +} +export declare class ContextUtils { + mapParamType(key: string): string; + reflectCallbackParamtypes(instance: Controller, methodName: string): any[]; + reflectCallbackMetadata(instance: Controller, methodName: string, metadataKey: string): T; + reflectPassthrough(instance: Controller, methodName: string): boolean; + getArgumentsLength(keys: string[], metadata: T): number; + createNullArray(length: number): any[]; + mergeParamsMetatypes(paramsProperties: ParamProperties[], paramtypes: any[]): (ParamProperties & { + metatype?: any; + })[]; + getCustomFactory(factory: (...args: unknown[]) => void, data: unknown, contextFactory: (args: unknown[]) => ExecutionContextHost): (...args: unknown[]) => unknown; + getContextFactory(contextType: TContext, instance?: object, callback?: Function): (args: unknown[]) => ExecutionContextHost; +} diff --git a/node_modules/@nestjs/core/helpers/context-utils.js b/node_modules/@nestjs/core/helpers/context-utils.js new file mode 100644 index 0000000000000000000000000000000000000000..0c746598e193c9d04ce2311716131d300d6ca648 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/context-utils.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ContextUtils = void 0; +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const execution_context_host_1 = require("./execution-context-host"); +class ContextUtils { + mapParamType(key) { + const keyPair = key.split(':'); + return keyPair[0]; + } + reflectCallbackParamtypes(instance, methodName) { + return Reflect.getMetadata(constants_1.PARAMTYPES_METADATA, instance, methodName); + } + reflectCallbackMetadata(instance, methodName, metadataKey) { + return Reflect.getMetadata(metadataKey, instance.constructor, methodName); + } + reflectPassthrough(instance, methodName) { + return Reflect.getMetadata(constants_1.RESPONSE_PASSTHROUGH_METADATA, instance.constructor, methodName); + } + getArgumentsLength(keys, metadata) { + return keys.length + ? Math.max(...keys.map(key => metadata[key].index)) + 1 + : 0; + } + createNullArray(length) { + const a = new Array(length); + for (let i = 0; i < length; ++i) + a[i] = undefined; + return a; + } + mergeParamsMetatypes(paramsProperties, paramtypes) { + if (!paramtypes) { + return paramsProperties; + } + return paramsProperties.map(param => ({ + ...param, + metatype: paramtypes[param.index], + })); + } + getCustomFactory(factory, data, contextFactory) { + return (0, shared_utils_1.isFunction)(factory) + ? (...args) => factory(data, contextFactory(args)) + : () => null; + } + getContextFactory(contextType, instance, callback) { + const type = instance && instance.constructor; + return (args) => { + const ctx = new execution_context_host_1.ExecutionContextHost(args, type, callback); + ctx.setType(contextType); + return ctx; + }; + } +} +exports.ContextUtils = ContextUtils; diff --git a/node_modules/@nestjs/core/helpers/execution-context-host.d.ts b/node_modules/@nestjs/core/helpers/execution-context-host.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15d2b8fea7ab69ebe6193d26782a41921695047e --- /dev/null +++ b/node_modules/@nestjs/core/helpers/execution-context-host.d.ts @@ -0,0 +1,19 @@ +import { ExecutionContext } from '@nestjs/common'; +import { Type } from '@nestjs/common/interfaces'; +import { ContextType, HttpArgumentsHost, RpcArgumentsHost, WsArgumentsHost } from '@nestjs/common/interfaces/features/arguments-host.interface'; +export declare class ExecutionContextHost implements ExecutionContext { + private readonly args; + private readonly constructorRef; + private readonly handler; + private contextType; + constructor(args: any[], constructorRef?: Type | null, handler?: Function | null); + setType(type: TContext): void; + getType(): TContext; + getClass(): Type; + getHandler(): Function; + getArgs = any[]>(): T; + getArgByIndex(index: number): T; + switchToRpc(): RpcArgumentsHost; + switchToHttp(): HttpArgumentsHost; + switchToWs(): WsArgumentsHost; +} diff --git a/node_modules/@nestjs/core/helpers/execution-context-host.js b/node_modules/@nestjs/core/helpers/execution-context-host.js new file mode 100644 index 0000000000000000000000000000000000000000..ec96b9e79f485cce4f1109d3929a138e5a06418f --- /dev/null +++ b/node_modules/@nestjs/core/helpers/execution-context-host.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExecutionContextHost = void 0; +class ExecutionContextHost { + constructor(args, constructorRef = null, handler = null) { + this.args = args; + this.constructorRef = constructorRef; + this.handler = handler; + this.contextType = 'http'; + } + setType(type) { + type && (this.contextType = type); + } + getType() { + return this.contextType; + } + getClass() { + return this.constructorRef; + } + getHandler() { + return this.handler; + } + getArgs() { + return this.args; + } + getArgByIndex(index) { + return this.args[index]; + } + switchToRpc() { + return Object.assign(this, { + getData: () => this.getArgByIndex(0), + getContext: () => this.getArgByIndex(1), + }); + } + switchToHttp() { + return Object.assign(this, { + getRequest: () => this.getArgByIndex(0), + getResponse: () => this.getArgByIndex(1), + getNext: () => this.getArgByIndex(2), + }); + } + switchToWs() { + return Object.assign(this, { + getClient: () => this.getArgByIndex(0), + getData: () => this.getArgByIndex(1), + getPattern: () => this.getArgByIndex(this.getArgs().length - 1), + }); + } +} +exports.ExecutionContextHost = ExecutionContextHost; diff --git a/node_modules/@nestjs/core/helpers/external-context-creator.d.ts b/node_modules/@nestjs/core/helpers/external-context-creator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc575d814a55298f1cbebf8fde7ead13770b5080 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/external-context-creator.d.ts @@ -0,0 +1,51 @@ +import { ParamData } from '@nestjs/common'; +import { ContextType, Controller, PipeTransform } from '@nestjs/common/interfaces'; +import { ExternalExceptionFilterContext } from '../exceptions/external-exception-filter-context'; +import { GuardsConsumer, GuardsContextCreator } from '../guards'; +import { NestContainer } from '../injector/container'; +import { ContextId } from '../injector/instance-wrapper'; +import { ModulesContainer } from '../injector/modules-container'; +import { InterceptorsConsumer, InterceptorsContextCreator } from '../interceptors'; +import { PipesConsumer, PipesContextCreator } from '../pipes'; +import { ParamProperties } from './context-utils'; +import { ExternalHandlerMetadata } from './interfaces/external-handler-metadata.interface'; +import { ParamsMetadata } from './interfaces/params-metadata.interface'; +export interface ParamsFactory { + exchangeKeyForValue(type: number, data: ParamData, args: any): any; +} +export interface ExternalContextOptions { + guards?: boolean; + interceptors?: boolean; + filters?: boolean; +} +export declare class ExternalContextCreator { + private readonly guardsContextCreator; + private readonly guardsConsumer; + private readonly interceptorsContextCreator; + private readonly interceptorsConsumer; + private readonly modulesContainer; + private readonly pipesContextCreator; + private readonly pipesConsumer; + private readonly filtersContextCreator; + private readonly contextUtils; + private readonly externalErrorProxy; + private readonly handlerMetadataStorage; + private container; + constructor(guardsContextCreator: GuardsContextCreator, guardsConsumer: GuardsConsumer, interceptorsContextCreator: InterceptorsContextCreator, interceptorsConsumer: InterceptorsConsumer, modulesContainer: ModulesContainer, pipesContextCreator: PipesContextCreator, pipesConsumer: PipesConsumer, filtersContextCreator: ExternalExceptionFilterContext); + static fromContainer(container: NestContainer): ExternalContextCreator; + create(instance: Controller, callback: (...args: unknown[]) => unknown, methodName: string, metadataKey?: string, paramsFactory?: ParamsFactory, contextId?: ContextId, inquirerId?: string, options?: ExternalContextOptions, contextType?: TContext): (...args: any[]) => Promise; + getMetadata(instance: Controller, methodName: string, metadataKey?: string, paramsFactory?: ParamsFactory, contextType?: TContext): ExternalHandlerMetadata; + getContextModuleKey(moduleCtor: Function | undefined): string; + exchangeKeysForValues(keys: string[], metadata: TMetadata, moduleContext: string, paramsFactory: ParamsFactory, contextId?: ContextId, inquirerId?: string, contextFactory?: (args: unknown[]) => import("./execution-context-host").ExecutionContextHost): ParamProperties[]; + createPipesFn(pipes: PipeTransform[], paramsOptions: (ParamProperties & { + metatype?: unknown; + })[]): ((args: unknown[], ...params: unknown[]) => Promise) | null; + getParamValue(value: T, { metatype, type, data }: { + metatype: any; + type: any; + data: any; + }, pipes: PipeTransform[]): Promise; + transformToResult(resultOrDeferred: any): Promise; + createGuardsFn(guards: any[], instance: Controller, callback: (...args: any[]) => any, contextType?: TContext): Function | null; + registerRequestProvider(request: T, contextId: ContextId): void; +} diff --git a/node_modules/@nestjs/core/helpers/external-context-creator.js b/node_modules/@nestjs/core/helpers/external-context-creator.js new file mode 100644 index 0000000000000000000000000000000000000000..3ca9d0e296abf93ad66deb25c4a4e2ab7f966eea --- /dev/null +++ b/node_modules/@nestjs/core/helpers/external-context-creator.js @@ -0,0 +1,166 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExternalContextCreator = void 0; +const common_1 = require("@nestjs/common"); +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const rxjs_1 = require("rxjs"); +const external_exception_filter_context_1 = require("../exceptions/external-exception-filter-context"); +const guards_1 = require("../guards"); +const constants_2 = require("../guards/constants"); +const constants_3 = require("../injector/constants"); +const interceptors_1 = require("../interceptors"); +const pipes_1 = require("../pipes"); +const context_utils_1 = require("./context-utils"); +const external_proxy_1 = require("./external-proxy"); +const handler_metadata_storage_1 = require("./handler-metadata-storage"); +class ExternalContextCreator { + constructor(guardsContextCreator, guardsConsumer, interceptorsContextCreator, interceptorsConsumer, modulesContainer, pipesContextCreator, pipesConsumer, filtersContextCreator) { + this.guardsContextCreator = guardsContextCreator; + this.guardsConsumer = guardsConsumer; + this.interceptorsContextCreator = interceptorsContextCreator; + this.interceptorsConsumer = interceptorsConsumer; + this.modulesContainer = modulesContainer; + this.pipesContextCreator = pipesContextCreator; + this.pipesConsumer = pipesConsumer; + this.filtersContextCreator = filtersContextCreator; + this.contextUtils = new context_utils_1.ContextUtils(); + this.externalErrorProxy = new external_proxy_1.ExternalErrorProxy(); + this.handlerMetadataStorage = new handler_metadata_storage_1.HandlerMetadataStorage(); + } + static fromContainer(container) { + const guardsContextCreator = new guards_1.GuardsContextCreator(container, container.applicationConfig); + const guardsConsumer = new guards_1.GuardsConsumer(); + const interceptorsContextCreator = new interceptors_1.InterceptorsContextCreator(container, container.applicationConfig); + const interceptorsConsumer = new interceptors_1.InterceptorsConsumer(); + const pipesContextCreator = new pipes_1.PipesContextCreator(container, container.applicationConfig); + const pipesConsumer = new pipes_1.PipesConsumer(); + const filtersContextCreator = new external_exception_filter_context_1.ExternalExceptionFilterContext(container, container.applicationConfig); + const externalContextCreator = new ExternalContextCreator(guardsContextCreator, guardsConsumer, interceptorsContextCreator, interceptorsConsumer, container.getModules(), pipesContextCreator, pipesConsumer, filtersContextCreator); + externalContextCreator.container = container; + return externalContextCreator; + } + create(instance, callback, methodName, metadataKey, paramsFactory, contextId = constants_3.STATIC_CONTEXT, inquirerId, options = { + interceptors: true, + guards: true, + filters: true, + }, contextType = 'http') { + const moduleKey = this.getContextModuleKey(instance.constructor); + const { argsLength, paramtypes, getParamsMetadata } = this.getMetadata(instance, methodName, metadataKey, paramsFactory, contextType); + const pipes = this.pipesContextCreator.create(instance, callback, moduleKey, contextId, inquirerId); + const guards = this.guardsContextCreator.create(instance, callback, moduleKey, contextId, inquirerId); + const exceptionFilter = this.filtersContextCreator.create(instance, callback, moduleKey, contextId, inquirerId); + const interceptors = options.interceptors + ? this.interceptorsContextCreator.create(instance, callback, moduleKey, contextId, inquirerId) + : []; + const paramsMetadata = getParamsMetadata(moduleKey, contextId, inquirerId); + const paramsOptions = paramsMetadata + ? this.contextUtils.mergeParamsMetatypes(paramsMetadata, paramtypes) + : []; + const fnCanActivate = options.guards + ? this.createGuardsFn(guards, instance, callback, contextType) + : null; + const fnApplyPipes = this.createPipesFn(pipes, paramsOptions); + const handler = (initialArgs, ...args) => async () => { + if (fnApplyPipes) { + await fnApplyPipes(initialArgs, ...args); + return callback.apply(instance, initialArgs); + } + return callback.apply(instance, args); + }; + const target = async (...args) => { + const initialArgs = this.contextUtils.createNullArray(argsLength); + fnCanActivate && (await fnCanActivate(args)); + const result = await this.interceptorsConsumer.intercept(interceptors, args, instance, callback, handler(initialArgs, ...args), contextType); + return this.transformToResult(result); + }; + return options.filters + ? this.externalErrorProxy.createProxy(target, exceptionFilter, contextType) + : target; + } + getMetadata(instance, methodName, metadataKey, paramsFactory, contextType) { + const cacheMetadata = this.handlerMetadataStorage.get(instance, methodName); + if (cacheMetadata) { + return cacheMetadata; + } + const metadata = this.contextUtils.reflectCallbackMetadata(instance, methodName, metadataKey || '') || {}; + const keys = Object.keys(metadata); + const argsLength = this.contextUtils.getArgumentsLength(keys, metadata); + const paramtypes = this.contextUtils.reflectCallbackParamtypes(instance, methodName); + const contextFactory = this.contextUtils.getContextFactory(contextType, instance, instance[methodName]); + const getParamsMetadata = (moduleKey, contextId = constants_3.STATIC_CONTEXT, inquirerId) => paramsFactory + ? this.exchangeKeysForValues(keys, metadata, moduleKey, paramsFactory, contextId, inquirerId, contextFactory) + : null; + const handlerMetadata = { + argsLength, + paramtypes, + getParamsMetadata: getParamsMetadata, + }; + this.handlerMetadataStorage.set(instance, methodName, handlerMetadata); + return handlerMetadata; + } + getContextModuleKey(moduleCtor) { + const emptyModuleKey = ''; + if (!moduleCtor) { + return emptyModuleKey; + } + const moduleContainerEntries = this.modulesContainer.entries(); + for (const [key, moduleRef] of moduleContainerEntries) { + if (moduleRef.hasProvider(moduleCtor)) { + return key; + } + } + return emptyModuleKey; + } + exchangeKeysForValues(keys, metadata, moduleContext, paramsFactory, contextId = constants_3.STATIC_CONTEXT, inquirerId, contextFactory = this.contextUtils.getContextFactory('http')) { + this.pipesContextCreator.setModuleContext(moduleContext); + return keys.map(key => { + const { index, data, pipes: pipesCollection } = metadata[key]; + const pipes = this.pipesContextCreator.createConcreteContext(pipesCollection, contextId, inquirerId); + const type = this.contextUtils.mapParamType(key); + if (key.includes(constants_1.CUSTOM_ROUTE_ARGS_METADATA)) { + const { factory } = metadata[key]; + const customExtractValue = this.contextUtils.getCustomFactory(factory, data, contextFactory); + return { index, extractValue: customExtractValue, type, data, pipes }; + } + const numericType = Number(type); + const extractValue = (...args) => paramsFactory.exchangeKeyForValue(numericType, data, args); + return { index, extractValue, type: numericType, data, pipes }; + }); + } + createPipesFn(pipes, paramsOptions) { + const pipesFn = async (args, ...params) => { + const resolveParamValue = async (param) => { + const { index, extractValue, type, data, metatype, pipes: paramPipes, } = param; + const value = extractValue(...params); + args[index] = await this.getParamValue(value, { metatype, type, data }, pipes.concat(paramPipes)); + }; + await Promise.all(paramsOptions.map(resolveParamValue)); + }; + return paramsOptions.length ? pipesFn : null; + } + async getParamValue(value, { metatype, type, data }, pipes) { + return (0, shared_utils_1.isEmpty)(pipes) + ? value + : this.pipesConsumer.apply(value, { metatype, type, data }, pipes); + } + async transformToResult(resultOrDeferred) { + if ((0, rxjs_1.isObservable)(resultOrDeferred)) { + return (0, rxjs_1.lastValueFrom)(resultOrDeferred); + } + return resultOrDeferred; + } + createGuardsFn(guards, instance, callback, contextType) { + const canActivateFn = async (args) => { + const canActivate = await this.guardsConsumer.tryActivate(guards, args, instance, callback, contextType); + if (!canActivate) { + throw new common_1.ForbiddenException(constants_2.FORBIDDEN_MESSAGE); + } + }; + return guards.length ? canActivateFn : null; + } + registerRequestProvider(request, contextId) { + this.container.registerRequestProvider(request, contextId); + } +} +exports.ExternalContextCreator = ExternalContextCreator; diff --git a/node_modules/@nestjs/core/helpers/external-proxy.d.ts b/node_modules/@nestjs/core/helpers/external-proxy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7ffd1216d1c0c99678b1aece0e0876247cc8615 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/external-proxy.d.ts @@ -0,0 +1,5 @@ +import { ContextType } from '@nestjs/common/interfaces'; +import { ExternalExceptionsHandler } from '../exceptions/external-exceptions-handler'; +export declare class ExternalErrorProxy { + createProxy(targetCallback: (...args: any[]) => any, exceptionsHandler: ExternalExceptionsHandler, type?: TContext): (...args: any[]) => Promise; +} diff --git a/node_modules/@nestjs/core/helpers/external-proxy.js b/node_modules/@nestjs/core/helpers/external-proxy.js new file mode 100644 index 0000000000000000000000000000000000000000..d66c0918c443ae95b50bf777c01e9c55be6e4f9a --- /dev/null +++ b/node_modules/@nestjs/core/helpers/external-proxy.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExternalErrorProxy = void 0; +const execution_context_host_1 = require("../helpers/execution-context-host"); +class ExternalErrorProxy { + createProxy(targetCallback, exceptionsHandler, type) { + return async (...args) => { + try { + return await targetCallback(...args); + } + catch (e) { + const host = new execution_context_host_1.ExecutionContextHost(args); + host.setType(type); + return exceptionsHandler.next(e, host); + } + }; + } +} +exports.ExternalErrorProxy = ExternalErrorProxy; diff --git a/node_modules/@nestjs/core/helpers/get-class-scope.d.ts b/node_modules/@nestjs/core/helpers/get-class-scope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..628d47b681630cdc392b2aa94b8590c3ecb3d898 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/get-class-scope.d.ts @@ -0,0 +1,3 @@ +import { Scope } from '@nestjs/common'; +import { Type } from '@nestjs/common/interfaces/type.interface'; +export declare function getClassScope(provider: Type): Scope; diff --git a/node_modules/@nestjs/core/helpers/get-class-scope.js b/node_modules/@nestjs/core/helpers/get-class-scope.js new file mode 100644 index 0000000000000000000000000000000000000000..d449718583867d6015b56d9e8878bf662750bc63 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/get-class-scope.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getClassScope = getClassScope; +const constants_1 = require("@nestjs/common/constants"); +function getClassScope(provider) { + const metadata = Reflect.getMetadata(constants_1.SCOPE_OPTIONS_METADATA, provider); + return metadata && metadata.scope; +} diff --git a/node_modules/@nestjs/core/helpers/handler-metadata-storage.d.ts b/node_modules/@nestjs/core/helpers/handler-metadata-storage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..098bd1ba772dcb3c60137c444f976797c43967d7 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/handler-metadata-storage.d.ts @@ -0,0 +1,28 @@ +import { Type } from '@nestjs/common/interfaces'; +import { IncomingMessage } from 'http'; +import { Observable } from 'rxjs'; +import { ContextId } from '../injector/instance-wrapper'; +import { HeaderStream } from '../router/sse-stream'; +import { ParamProperties } from './context-utils'; +export declare const HANDLER_METADATA_SYMBOL: unique symbol; +export type HandleResponseFn = HandlerResponseBasicFn | HandleSseResponseFn; +export type HandlerResponseBasicFn = (result: TResult, res: TResponse, req?: any) => any; +export type HandleSseResponseFn = = any, TResponse extends HeaderStream = any, TRequest extends IncomingMessage = any>(result: TResult, res: TResponse, req: TRequest) => any; +export interface HandlerMetadata { + argsLength: number; + isSseHandler: boolean; + paramtypes: any[]; + httpStatusCode: number; + responseHeaders: any[]; + hasCustomHeaders: boolean; + getParamsMetadata: (moduleKey: string, contextId?: ContextId, inquirerId?: string) => (ParamProperties & { + metatype?: any; + })[]; + fnHandleResponse: HandleResponseFn; +} +export declare class HandlerMetadataStorage = any> { + private readonly [HANDLER_METADATA_SYMBOL]; + set(controller: TKey, methodName: string, metadata: TValue): void; + get(controller: TKey, methodName: string): TValue | undefined; + private getMetadataKey; +} diff --git a/node_modules/@nestjs/core/helpers/handler-metadata-storage.js b/node_modules/@nestjs/core/helpers/handler-metadata-storage.js new file mode 100644 index 0000000000000000000000000000000000000000..a3a4200d777fc479239de3cb28fbab63f1efa705 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/handler-metadata-storage.js @@ -0,0 +1,26 @@ +"use strict"; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HandlerMetadataStorage = exports.HANDLER_METADATA_SYMBOL = void 0; +const constants_1 = require("../injector/constants"); +exports.HANDLER_METADATA_SYMBOL = Symbol.for('handler_metadata:cache'); +class HandlerMetadataStorage { + constructor() { + this[_a] = new Map(); + } + set(controller, methodName, metadata) { + const metadataKey = this.getMetadataKey(controller, methodName); + this[exports.HANDLER_METADATA_SYMBOL].set(metadataKey, metadata); + } + get(controller, methodName) { + const metadataKey = this.getMetadataKey(controller, methodName); + return this[exports.HANDLER_METADATA_SYMBOL].get(metadataKey); + } + getMetadataKey(controller, methodName) { + const ctor = controller.constructor; + const controllerKey = ctor && (ctor[constants_1.CONTROLLER_ID_KEY] || ctor.name); + return controllerKey + methodName; + } +} +exports.HandlerMetadataStorage = HandlerMetadataStorage; +_a = exports.HANDLER_METADATA_SYMBOL; diff --git a/node_modules/@nestjs/core/helpers/http-adapter-host.d.ts b/node_modules/@nestjs/core/helpers/http-adapter-host.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1150da5342f52dc4c1956c8faba176f9835fefbc --- /dev/null +++ b/node_modules/@nestjs/core/helpers/http-adapter-host.d.ts @@ -0,0 +1,51 @@ +import { Observable } from 'rxjs'; +import { AbstractHttpAdapter } from '../adapters/http-adapter'; +/** + * Defines the `HttpAdapterHost` object. + * + * `HttpAdapterHost` wraps the underlying + * platform-specific `HttpAdapter`. The `HttpAdapter` is a wrapper around the underlying + * native HTTP server library (e.g., Express). The `HttpAdapterHost` object + * provides methods to `get` and `set` the underlying HttpAdapter. + * + * @see [Http adapter](https://docs.nestjs.com/faq/http-adapter) + * + * @publicApi + */ +export declare class HttpAdapterHost { + private _httpAdapter?; + private _listen$; + private _init$; + private isListening; + /** + * Accessor for the underlying `HttpAdapter` + * + * @param httpAdapter reference to the `HttpAdapter` to be set + */ + set httpAdapter(httpAdapter: T); + /** + * Accessor for the underlying `HttpAdapter` + * + * @example + * `const httpAdapter = adapterHost.httpAdapter;` + */ + get httpAdapter(): T; + /** + * Observable that allows to subscribe to the `listen` event. + * This event is emitted when the HTTP application is listening for incoming requests. + */ + get listen$(): Observable; + /** + * Observable that allows to subscribe to the `init` event. + * This event is emitted when the HTTP application is initialized. + */ + get init$(): Observable; + /** + * Sets the listening state of the application. + */ + set listening(listening: boolean); + /** + * Returns a boolean indicating whether the application is listening for incoming requests. + */ + get listening(): boolean; +} diff --git a/node_modules/@nestjs/core/helpers/http-adapter-host.js b/node_modules/@nestjs/core/helpers/http-adapter-host.js new file mode 100644 index 0000000000000000000000000000000000000000..d75dd7574d560a9fae3c0ee332817e160ebdc882 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/http-adapter-host.js @@ -0,0 +1,73 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HttpAdapterHost = void 0; +const rxjs_1 = require("rxjs"); +/** + * Defines the `HttpAdapterHost` object. + * + * `HttpAdapterHost` wraps the underlying + * platform-specific `HttpAdapter`. The `HttpAdapter` is a wrapper around the underlying + * native HTTP server library (e.g., Express). The `HttpAdapterHost` object + * provides methods to `get` and `set` the underlying HttpAdapter. + * + * @see [Http adapter](https://docs.nestjs.com/faq/http-adapter) + * + * @publicApi + */ +class HttpAdapterHost { + constructor() { + this._listen$ = new rxjs_1.Subject(); + this._init$ = new rxjs_1.ReplaySubject(); + this.isListening = false; + } + /** + * Accessor for the underlying `HttpAdapter` + * + * @param httpAdapter reference to the `HttpAdapter` to be set + */ + set httpAdapter(httpAdapter) { + this._httpAdapter = httpAdapter; + this._init$.next(); + this._init$.complete(); + } + /** + * Accessor for the underlying `HttpAdapter` + * + * @example + * `const httpAdapter = adapterHost.httpAdapter;` + */ + get httpAdapter() { + return this._httpAdapter; + } + /** + * Observable that allows to subscribe to the `listen` event. + * This event is emitted when the HTTP application is listening for incoming requests. + */ + get listen$() { + return this._listen$.asObservable(); + } + /** + * Observable that allows to subscribe to the `init` event. + * This event is emitted when the HTTP application is initialized. + */ + get init$() { + return this._init$.asObservable(); + } + /** + * Sets the listening state of the application. + */ + set listening(listening) { + this.isListening = listening; + if (listening) { + this._listen$.next(); + this._listen$.complete(); + } + } + /** + * Returns a boolean indicating whether the application is listening for incoming requests. + */ + get listening() { + return this.isListening; + } +} +exports.HttpAdapterHost = HttpAdapterHost; diff --git a/node_modules/@nestjs/core/helpers/index.d.ts b/node_modules/@nestjs/core/helpers/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..76f854606029f624161d885350732a71b6c1e5ec --- /dev/null +++ b/node_modules/@nestjs/core/helpers/index.d.ts @@ -0,0 +1,3 @@ +export * from './context-id-factory'; +export * from './external-context-creator'; +export * from './http-adapter-host'; diff --git a/node_modules/@nestjs/core/helpers/index.js b/node_modules/@nestjs/core/helpers/index.js new file mode 100644 index 0000000000000000000000000000000000000000..38ef85e17169299db6ebc7b72f5a4bf966073b67 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./context-id-factory"), exports); +tslib_1.__exportStar(require("./external-context-creator"), exports); +tslib_1.__exportStar(require("./http-adapter-host"), exports); diff --git a/node_modules/@nestjs/core/helpers/interfaces/external-handler-metadata.interface.d.ts b/node_modules/@nestjs/core/helpers/interfaces/external-handler-metadata.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..682411be98072ad8dbede3140b31e42f168b1a6a --- /dev/null +++ b/node_modules/@nestjs/core/helpers/interfaces/external-handler-metadata.interface.d.ts @@ -0,0 +1,11 @@ +import { ContextId } from '../../injector'; +import { ParamProperties } from '../context-utils'; +type ParamPropertiesWithMetatype = ParamProperties & { + metatype?: T; +}; +export interface ExternalHandlerMetadata { + argsLength: number; + paramtypes: any[]; + getParamsMetadata: (moduleKey: string, contextId?: ContextId, inquirerId?: string) => ParamPropertiesWithMetatype[]; +} +export {}; diff --git a/node_modules/@nestjs/core/helpers/interfaces/external-handler-metadata.interface.js b/node_modules/@nestjs/core/helpers/interfaces/external-handler-metadata.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/helpers/interfaces/external-handler-metadata.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/helpers/interfaces/index.d.ts b/node_modules/@nestjs/core/helpers/interfaces/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..85e62522683ea61dddfb87b8b239087bb788366c --- /dev/null +++ b/node_modules/@nestjs/core/helpers/interfaces/index.d.ts @@ -0,0 +1,2 @@ +export * from './external-handler-metadata.interface'; +export * from './params-metadata.interface'; diff --git a/node_modules/@nestjs/core/helpers/interfaces/index.js b/node_modules/@nestjs/core/helpers/interfaces/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fac61f96ddbbfecba2aa70166f1df76506ac2823 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/interfaces/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./external-handler-metadata.interface"), exports); +tslib_1.__exportStar(require("./params-metadata.interface"), exports); diff --git a/node_modules/@nestjs/core/helpers/interfaces/params-metadata.interface.d.ts b/node_modules/@nestjs/core/helpers/interfaces/params-metadata.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d39802ce532363a59f946d59db35d0c81197b929 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/interfaces/params-metadata.interface.d.ts @@ -0,0 +1,6 @@ +import { ParamData } from '@nestjs/common'; +export type ParamsMetadata = Record; +export interface ParamMetadata { + index: number; + data?: ParamData; +} diff --git a/node_modules/@nestjs/core/helpers/interfaces/params-metadata.interface.js b/node_modules/@nestjs/core/helpers/interfaces/params-metadata.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/helpers/interfaces/params-metadata.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/helpers/is-durable.d.ts b/node_modules/@nestjs/core/helpers/is-durable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d480507815266f10f47a76ff80758e17ff19c189 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/is-durable.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common/interfaces/type.interface'; +export declare function isDurable(provider: Type): boolean | undefined; diff --git a/node_modules/@nestjs/core/helpers/is-durable.js b/node_modules/@nestjs/core/helpers/is-durable.js new file mode 100644 index 0000000000000000000000000000000000000000..b25d84f19807b6eb099dcab4cad0c58538163098 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/is-durable.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isDurable = isDurable; +const constants_1 = require("@nestjs/common/constants"); +function isDurable(provider) { + const metadata = Reflect.getMetadata(constants_1.SCOPE_OPTIONS_METADATA, provider); + return metadata && metadata.durable; +} diff --git a/node_modules/@nestjs/core/helpers/load-adapter.d.ts b/node_modules/@nestjs/core/helpers/load-adapter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8c8b45227ac9b63f6d72e184256de752193c8792 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/load-adapter.d.ts @@ -0,0 +1 @@ +export declare function loadAdapter(defaultPlatform: string, transport: string, loaderFn?: Function): any; diff --git a/node_modules/@nestjs/core/helpers/load-adapter.js b/node_modules/@nestjs/core/helpers/load-adapter.js new file mode 100644 index 0000000000000000000000000000000000000000..cc6224e954272b437e4e89ec8896830b0c9f051b --- /dev/null +++ b/node_modules/@nestjs/core/helpers/load-adapter.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadAdapter = loadAdapter; +const common_1 = require("@nestjs/common"); +const MISSING_REQUIRED_DEPENDENCY = (defaultPlatform, transport) => `No driver (${transport}) has been selected. In order to take advantage of the default driver, please, ensure to install the "${defaultPlatform}" package ($ npm install ${defaultPlatform}).`; +const logger = new common_1.Logger('PackageLoader'); +function loadAdapter(defaultPlatform, transport, loaderFn) { + try { + return loaderFn ? loaderFn() : require(defaultPlatform); + } + catch (e) { + logger.error(MISSING_REQUIRED_DEPENDENCY(defaultPlatform, transport)); + process.exit(1); + } +} diff --git a/node_modules/@nestjs/core/helpers/messages.d.ts b/node_modules/@nestjs/core/helpers/messages.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9f91f9709b5d37426d43b5aaab2ea2d81d9950ee --- /dev/null +++ b/node_modules/@nestjs/core/helpers/messages.d.ts @@ -0,0 +1,7 @@ +import { VersionValue } from '@nestjs/common/interfaces/version-options.interface'; +export declare const MODULE_INIT_MESSAGE: (text: TemplateStringsArray, module: string) => string; +export declare const ROUTE_MAPPED_MESSAGE: (path: string, method: string | number) => string; +export declare const VERSIONED_ROUTE_MAPPED_MESSAGE: (path: string, method: string | number, version: VersionValue) => string; +export declare const CONTROLLER_MAPPING_MESSAGE: (name: string, path: string) => string; +export declare const VERSIONED_CONTROLLER_MAPPING_MESSAGE: (name: string, path: string, version: VersionValue) => string; +export declare const INVALID_EXECUTION_CONTEXT: (methodName: string, currentContext: string) => string; diff --git a/node_modules/@nestjs/core/helpers/messages.js b/node_modules/@nestjs/core/helpers/messages.js new file mode 100644 index 0000000000000000000000000000000000000000..6c00ed9c6f391c4235f94417a569c897ba82b4d3 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/messages.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.INVALID_EXECUTION_CONTEXT = exports.VERSIONED_CONTROLLER_MAPPING_MESSAGE = exports.CONTROLLER_MAPPING_MESSAGE = exports.VERSIONED_ROUTE_MAPPED_MESSAGE = exports.ROUTE_MAPPED_MESSAGE = exports.MODULE_INIT_MESSAGE = void 0; +const request_method_enum_1 = require("@nestjs/common/enums/request-method.enum"); +const version_options_interface_1 = require("@nestjs/common/interfaces/version-options.interface"); +const MODULE_INIT_MESSAGE = (text, module) => `${module} dependencies initialized`; +exports.MODULE_INIT_MESSAGE = MODULE_INIT_MESSAGE; +const ROUTE_MAPPED_MESSAGE = (path, method) => `Mapped {${path}, ${request_method_enum_1.RequestMethod[method]}} route`; +exports.ROUTE_MAPPED_MESSAGE = ROUTE_MAPPED_MESSAGE; +const VERSIONED_ROUTE_MAPPED_MESSAGE = (path, method, version) => { + const controllerVersions = Array.isArray(version) ? version : [version]; + const versions = controllerVersions + .map(version => (version === version_options_interface_1.VERSION_NEUTRAL ? 'Neutral' : version)) + .join(','); + return `Mapped {${path}, ${request_method_enum_1.RequestMethod[method]}} (version: ${versions}) route`; +}; +exports.VERSIONED_ROUTE_MAPPED_MESSAGE = VERSIONED_ROUTE_MAPPED_MESSAGE; +const CONTROLLER_MAPPING_MESSAGE = (name, path) => `${name} {${path}}:`; +exports.CONTROLLER_MAPPING_MESSAGE = CONTROLLER_MAPPING_MESSAGE; +const VERSIONED_CONTROLLER_MAPPING_MESSAGE = (name, path, version) => { + const controllerVersions = Array.isArray(version) ? version : [version]; + const versions = controllerVersions + .map(version => (version === version_options_interface_1.VERSION_NEUTRAL ? 'Neutral' : version)) + .join(','); + return `${name} {${path}} (version: ${versions}):`; +}; +exports.VERSIONED_CONTROLLER_MAPPING_MESSAGE = VERSIONED_CONTROLLER_MAPPING_MESSAGE; +const INVALID_EXECUTION_CONTEXT = (methodName, currentContext) => `Calling ${methodName} is not allowed in this context. Your current execution context is "${currentContext}".`; +exports.INVALID_EXECUTION_CONTEXT = INVALID_EXECUTION_CONTEXT; diff --git a/node_modules/@nestjs/core/helpers/optional-require.d.ts b/node_modules/@nestjs/core/helpers/optional-require.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a590eb870334b5c760e68c1354da013e73765009 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/optional-require.d.ts @@ -0,0 +1 @@ +export declare function optionalRequire(packageName: string, loaderFn?: Function): any; diff --git a/node_modules/@nestjs/core/helpers/optional-require.js b/node_modules/@nestjs/core/helpers/optional-require.js new file mode 100644 index 0000000000000000000000000000000000000000..f6af572693425f1d00ee96cae39d1815f81852ed --- /dev/null +++ b/node_modules/@nestjs/core/helpers/optional-require.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.optionalRequire = optionalRequire; +function optionalRequire(packageName, loaderFn) { + try { + return loaderFn ? loaderFn() : require(packageName); + } + catch (e) { + return {}; + } +} diff --git a/node_modules/@nestjs/core/helpers/rethrow.d.ts b/node_modules/@nestjs/core/helpers/rethrow.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..605d5de4264a29e5aa68d6bb0f62f13bd680eb98 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/rethrow.d.ts @@ -0,0 +1 @@ +export declare const rethrow: (err: unknown) => never; diff --git a/node_modules/@nestjs/core/helpers/rethrow.js b/node_modules/@nestjs/core/helpers/rethrow.js new file mode 100644 index 0000000000000000000000000000000000000000..835cf24d3a773a9cbaefe70c80e47c8e9af9c2fc --- /dev/null +++ b/node_modules/@nestjs/core/helpers/rethrow.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.rethrow = void 0; +const rethrow = (err) => { + throw err; +}; +exports.rethrow = rethrow; diff --git a/node_modules/@nestjs/core/helpers/router-method-factory.d.ts b/node_modules/@nestjs/core/helpers/router-method-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b4ae38c42ad5b5d1f8ab606d065ca92921cfbd34 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/router-method-factory.d.ts @@ -0,0 +1,23 @@ +import { HttpServer } from '@nestjs/common'; +import { RequestMethod } from '@nestjs/common/enums/request-method.enum'; +export declare const REQUEST_METHOD_MAP: { + readonly 0: "get"; + readonly 1: "post"; + readonly 2: "put"; + readonly 3: "delete"; + readonly 4: "patch"; + readonly 5: "all"; + readonly 6: "options"; + readonly 7: "head"; + readonly 8: "search"; + readonly 9: "propfind"; + readonly 10: "proppatch"; + readonly 11: "mkcol"; + readonly 12: "copy"; + readonly 13: "move"; + readonly 14: "lock"; + readonly 15: "unlock"; +}; +export declare class RouterMethodFactory { + get(target: HttpServer, requestMethod: RequestMethod): Function; +} diff --git a/node_modules/@nestjs/core/helpers/router-method-factory.js b/node_modules/@nestjs/core/helpers/router-method-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..4d8516c846d387a8189f8d901da8f4a1c600ca02 --- /dev/null +++ b/node_modules/@nestjs/core/helpers/router-method-factory.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RouterMethodFactory = exports.REQUEST_METHOD_MAP = void 0; +const request_method_enum_1 = require("@nestjs/common/enums/request-method.enum"); +exports.REQUEST_METHOD_MAP = { + [request_method_enum_1.RequestMethod.GET]: 'get', + [request_method_enum_1.RequestMethod.POST]: 'post', + [request_method_enum_1.RequestMethod.PUT]: 'put', + [request_method_enum_1.RequestMethod.DELETE]: 'delete', + [request_method_enum_1.RequestMethod.PATCH]: 'patch', + [request_method_enum_1.RequestMethod.ALL]: 'all', + [request_method_enum_1.RequestMethod.OPTIONS]: 'options', + [request_method_enum_1.RequestMethod.HEAD]: 'head', + [request_method_enum_1.RequestMethod.SEARCH]: 'search', + [request_method_enum_1.RequestMethod.PROPFIND]: 'propfind', + [request_method_enum_1.RequestMethod.PROPPATCH]: 'proppatch', + [request_method_enum_1.RequestMethod.MKCOL]: 'mkcol', + [request_method_enum_1.RequestMethod.COPY]: 'copy', + [request_method_enum_1.RequestMethod.MOVE]: 'move', + [request_method_enum_1.RequestMethod.LOCK]: 'lock', + [request_method_enum_1.RequestMethod.UNLOCK]: 'unlock', +}; +class RouterMethodFactory { + get(target, requestMethod) { + const methodName = exports.REQUEST_METHOD_MAP[requestMethod]; + const method = target[methodName]; + if (!method) { + return target.use; + } + return method; + } +} +exports.RouterMethodFactory = RouterMethodFactory; diff --git a/node_modules/@nestjs/core/hooks/before-app-shutdown.hook.d.ts b/node_modules/@nestjs/core/hooks/before-app-shutdown.hook.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..03f9750a637daca7105b833f93396bd2f2575e34 --- /dev/null +++ b/node_modules/@nestjs/core/hooks/before-app-shutdown.hook.d.ts @@ -0,0 +1,9 @@ +import { Module } from '../injector/module'; +/** + * Calls the `beforeApplicationShutdown` function on the module and its children + * (providers / controllers). + * + * @param module The module which will be initialized + * @param signal The signal which caused the shutdown + */ +export declare function callBeforeAppShutdownHook(module: Module, signal?: string): Promise; diff --git a/node_modules/@nestjs/core/hooks/before-app-shutdown.hook.js b/node_modules/@nestjs/core/hooks/before-app-shutdown.hook.js new file mode 100644 index 0000000000000000000000000000000000000000..5c5e531fddbffe63b7243f7fd00d6e42c22e578a --- /dev/null +++ b/node_modules/@nestjs/core/hooks/before-app-shutdown.hook.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.callBeforeAppShutdownHook = callBeforeAppShutdownHook; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const transient_instances_1 = require("../injector/helpers/transient-instances"); +/** + * Checks if the given instance has the `beforeApplicationShutdown` function + * + * @param instance The instance which should be checked + */ +function hasBeforeApplicationShutdownHook(instance) { + return (0, shared_utils_1.isFunction)(instance.beforeApplicationShutdown); +} +/** + * Calls the given instances + */ +function callOperator(instances, signal) { + return (0, iterare_1.iterate)(instances) + .filter(instance => !(0, shared_utils_1.isNil)(instance)) + .filter(hasBeforeApplicationShutdownHook) + .map(async (instance) => instance.beforeApplicationShutdown(signal)) + .toArray(); +} +/** + * Calls the `beforeApplicationShutdown` function on the module and its children + * (providers / controllers). + * + * @param module The module which will be initialized + * @param signal The signal which caused the shutdown + */ +async function callBeforeAppShutdownHook(module, signal) { + const providers = module.getNonAliasProviders(); + const [_, moduleClassHost] = providers.shift(); + const instances = [ + ...module.controllers, + ...providers, + ...module.injectables, + ...module.middlewares, + ]; + const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances); + await Promise.all(callOperator(nonTransientInstances, signal)); + const transientInstances = (0, transient_instances_1.getTransientInstances)(instances); + await Promise.all(callOperator(transientInstances, signal)); + const moduleClassInstance = moduleClassHost.instance; + if (moduleClassInstance && + hasBeforeApplicationShutdownHook(moduleClassInstance) && + moduleClassHost.isDependencyTreeStatic()) { + await moduleClassInstance.beforeApplicationShutdown(signal); + } +} diff --git a/node_modules/@nestjs/core/hooks/index.d.ts b/node_modules/@nestjs/core/hooks/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e7a3ac0833845c623bfa49c7f89ba0304aebba2 --- /dev/null +++ b/node_modules/@nestjs/core/hooks/index.d.ts @@ -0,0 +1,5 @@ +export * from './on-app-bootstrap.hook'; +export * from './on-app-shutdown.hook'; +export * from './on-module-destroy.hook'; +export * from './on-module-init.hook'; +export * from './before-app-shutdown.hook'; diff --git a/node_modules/@nestjs/core/hooks/index.js b/node_modules/@nestjs/core/hooks/index.js new file mode 100644 index 0000000000000000000000000000000000000000..78155459dc8229a73c1fae53d97d22cc582461c7 --- /dev/null +++ b/node_modules/@nestjs/core/hooks/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./on-app-bootstrap.hook"), exports); +tslib_1.__exportStar(require("./on-app-shutdown.hook"), exports); +tslib_1.__exportStar(require("./on-module-destroy.hook"), exports); +tslib_1.__exportStar(require("./on-module-init.hook"), exports); +tslib_1.__exportStar(require("./before-app-shutdown.hook"), exports); diff --git a/node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.d.ts b/node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..be4783aea9105794647cc4982b60b1d423950fab --- /dev/null +++ b/node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.d.ts @@ -0,0 +1,8 @@ +import { Module } from '../injector/module'; +/** + * Calls the `onApplicationBootstrap` function on the module and its children + * (providers / controllers). + * + * @param module The module which will be initialized + */ +export declare function callModuleBootstrapHook(module: Module): Promise; diff --git a/node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.js b/node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.js new file mode 100644 index 0000000000000000000000000000000000000000..827a90b8d8bc9f821a803ff7929afa5436a15c86 --- /dev/null +++ b/node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.callModuleBootstrapHook = callModuleBootstrapHook; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const transient_instances_1 = require("../injector/helpers/transient-instances"); +/** + * Checks if the given instance has the `onApplicationBootstrap` function + * + * @param instance The instance which should be checked + */ +function hasOnAppBootstrapHook(instance) { + return (0, shared_utils_1.isFunction)(instance.onApplicationBootstrap); +} +/** + * Calls the given instances + */ +function callOperator(instances) { + return (0, iterare_1.iterate)(instances) + .filter(instance => !(0, shared_utils_1.isNil)(instance)) + .filter(hasOnAppBootstrapHook) + .map(async (instance) => instance.onApplicationBootstrap()) + .toArray(); +} +/** + * Calls the `onApplicationBootstrap` function on the module and its children + * (providers / controllers). + * + * @param module The module which will be initialized + */ +async function callModuleBootstrapHook(module) { + const providers = module.getNonAliasProviders(); + // Module (class) instance is the first element of the providers array + // Lifecycle hook has to be called once all classes are properly initialized + const [_, moduleClassHost] = providers.shift(); + const instances = [ + ...module.controllers, + ...providers, + ...module.injectables, + ...module.middlewares, + ]; + const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances); + await Promise.all(callOperator(nonTransientInstances)); + const transientInstances = (0, transient_instances_1.getTransientInstances)(instances); + await Promise.all(callOperator(transientInstances)); + // Call the instance itself + const moduleClassInstance = moduleClassHost.instance; + if (moduleClassInstance && + hasOnAppBootstrapHook(moduleClassInstance) && + moduleClassHost.isDependencyTreeStatic()) { + await moduleClassInstance.onApplicationBootstrap(); + } +} diff --git a/node_modules/@nestjs/core/hooks/on-app-shutdown.hook.d.ts b/node_modules/@nestjs/core/hooks/on-app-shutdown.hook.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..847d25316e9e2e2c6effce2c453e440d19b9e528 --- /dev/null +++ b/node_modules/@nestjs/core/hooks/on-app-shutdown.hook.d.ts @@ -0,0 +1,9 @@ +import { Module } from '../injector/module'; +/** + * Calls the `onApplicationShutdown` function on the module and its children + * (providers / controllers). + * + * @param module The module which will be initialized + * @param signal + */ +export declare function callAppShutdownHook(module: Module, signal?: string): Promise; diff --git a/node_modules/@nestjs/core/hooks/on-app-shutdown.hook.js b/node_modules/@nestjs/core/hooks/on-app-shutdown.hook.js new file mode 100644 index 0000000000000000000000000000000000000000..3c3cd1fed56f9f199a99e052d5cdbd605202cc65 --- /dev/null +++ b/node_modules/@nestjs/core/hooks/on-app-shutdown.hook.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.callAppShutdownHook = callAppShutdownHook; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const transient_instances_1 = require("../injector/helpers/transient-instances"); +/** + * Checks if the given instance has the `onApplicationShutdown` function + * + * @param instance The instance which should be checked + */ +function hasOnAppShutdownHook(instance) { + return (0, shared_utils_1.isFunction)(instance.onApplicationShutdown); +} +/** + * Calls the given instances + */ +function callOperator(instances, signal) { + return (0, iterare_1.iterate)(instances) + .filter(instance => !(0, shared_utils_1.isNil)(instance)) + .filter(hasOnAppShutdownHook) + .map(async (instance) => instance.onApplicationShutdown(signal)) + .toArray(); +} +/** + * Calls the `onApplicationShutdown` function on the module and its children + * (providers / controllers). + * + * @param module The module which will be initialized + * @param signal + */ +async function callAppShutdownHook(module, signal) { + const providers = module.getNonAliasProviders(); + // Module (class) instance is the first element of the providers array + // Lifecycle hook has to be called once all classes are properly initialized + const [_, moduleClassHost] = providers.shift(); + const instances = [ + ...module.controllers, + ...providers, + ...module.injectables, + ...module.middlewares, + ]; + const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances); + await Promise.all(callOperator(nonTransientInstances, signal)); + const transientInstances = (0, transient_instances_1.getTransientInstances)(instances); + await Promise.all(callOperator(transientInstances, signal)); + // Call the instance itself + const moduleClassInstance = moduleClassHost.instance; + if (moduleClassInstance && + hasOnAppShutdownHook(moduleClassInstance) && + moduleClassHost.isDependencyTreeStatic()) { + await moduleClassInstance.onApplicationShutdown(signal); + } +} diff --git a/node_modules/@nestjs/core/hooks/on-module-destroy.hook.d.ts b/node_modules/@nestjs/core/hooks/on-module-destroy.hook.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..10a96686e1e769bc9afd90f3da04456e3abc4b0d --- /dev/null +++ b/node_modules/@nestjs/core/hooks/on-module-destroy.hook.d.ts @@ -0,0 +1,8 @@ +import { Module } from '../injector/module'; +/** + * Calls the `onModuleDestroy` function on the module and its children + * (providers / controllers). + * + * @param module The module which will be initialized + */ +export declare function callModuleDestroyHook(module: Module): Promise; diff --git a/node_modules/@nestjs/core/hooks/on-module-destroy.hook.js b/node_modules/@nestjs/core/hooks/on-module-destroy.hook.js new file mode 100644 index 0000000000000000000000000000000000000000..fddd32803d67c467baad2c08dd525b631ca3b39b --- /dev/null +++ b/node_modules/@nestjs/core/hooks/on-module-destroy.hook.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.callModuleDestroyHook = callModuleDestroyHook; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const transient_instances_1 = require("../injector/helpers/transient-instances"); +/** + * Returns true or false if the given instance has a `onModuleDestroy` function + * + * @param instance The instance which should be checked + */ +function hasOnModuleDestroyHook(instance) { + return (0, shared_utils_1.isFunction)(instance.onModuleDestroy); +} +/** + * Calls the given instances onModuleDestroy hook + */ +function callOperator(instances) { + return (0, iterare_1.iterate)(instances) + .filter(instance => !(0, shared_utils_1.isNil)(instance)) + .filter(hasOnModuleDestroyHook) + .map(async (instance) => instance.onModuleDestroy()) + .toArray(); +} +/** + * Calls the `onModuleDestroy` function on the module and its children + * (providers / controllers). + * + * @param module The module which will be initialized + */ +async function callModuleDestroyHook(module) { + const providers = module.getNonAliasProviders(); + // Module (class) instance is the first element of the providers array + // Lifecycle hook has to be called once all classes are properly destroyed + const [_, moduleClassHost] = providers.shift(); + const instances = [ + ...module.controllers, + ...providers, + ...module.injectables, + ...module.middlewares, + ]; + const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances); + await Promise.all(callOperator(nonTransientInstances)); + const transientInstances = (0, transient_instances_1.getTransientInstances)(instances); + await Promise.all(callOperator(transientInstances)); + // Call the module instance itself + const moduleClassInstance = moduleClassHost.instance; + if (moduleClassInstance && + hasOnModuleDestroyHook(moduleClassInstance) && + moduleClassHost.isDependencyTreeStatic()) { + await moduleClassInstance.onModuleDestroy(); + } +} diff --git a/node_modules/@nestjs/core/hooks/on-module-init.hook.d.ts b/node_modules/@nestjs/core/hooks/on-module-init.hook.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2d9ef3780ddb23f56f3a9d3c13a7f063b2cc0d31 --- /dev/null +++ b/node_modules/@nestjs/core/hooks/on-module-init.hook.d.ts @@ -0,0 +1,8 @@ +import { Module } from '../injector/module'; +/** + * Calls the `onModuleInit` function on the module and its children + * (providers / controllers). + * + * @param module The module which will be initialized + */ +export declare function callModuleInitHook(module: Module): Promise; diff --git a/node_modules/@nestjs/core/hooks/on-module-init.hook.js b/node_modules/@nestjs/core/hooks/on-module-init.hook.js new file mode 100644 index 0000000000000000000000000000000000000000..53f94b1c8414054cadc39a6f28c48e7693e89cc5 --- /dev/null +++ b/node_modules/@nestjs/core/hooks/on-module-init.hook.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.callModuleInitHook = callModuleInitHook; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const transient_instances_1 = require("../injector/helpers/transient-instances"); +/** + * Returns true or false if the given instance has a `onModuleInit` function + * + * @param instance The instance which should be checked + */ +function hasOnModuleInitHook(instance) { + return (0, shared_utils_1.isFunction)(instance.onModuleInit); +} +/** + * Calls the given instances + */ +function callOperator(instances) { + return (0, iterare_1.iterate)(instances) + .filter(instance => !(0, shared_utils_1.isNil)(instance)) + .filter(hasOnModuleInitHook) + .map(async (instance) => instance.onModuleInit()) + .toArray(); +} +/** + * Calls the `onModuleInit` function on the module and its children + * (providers / controllers). + * + * @param module The module which will be initialized + */ +async function callModuleInitHook(module) { + const providers = module.getNonAliasProviders(); + // Module (class) instance is the first element of the providers array + // Lifecycle hook has to be called once all classes are properly initialized + const [_, moduleClassHost] = providers.shift(); + const instances = [ + ...module.controllers, + ...providers, + ...module.injectables, + ...module.middlewares, + ]; + const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances); + await Promise.all(callOperator(nonTransientInstances)); + const transientInstances = (0, transient_instances_1.getTransientInstances)(instances); + await Promise.all(callOperator(transientInstances)); + // Call the instance itself + const moduleClassInstance = moduleClassHost.instance; + if (moduleClassInstance && + hasOnModuleInitHook(moduleClassInstance) && + moduleClassHost.isDependencyTreeStatic()) { + await moduleClassInstance.onModuleInit(); + } +} diff --git a/node_modules/@nestjs/core/hooks/utils/get-instances-grouped-by-hierarchy-level.d.ts b/node_modules/@nestjs/core/hooks/utils/get-instances-grouped-by-hierarchy-level.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fff47443f928e942f3b99fdf9fdfece6650494b --- /dev/null +++ b/node_modules/@nestjs/core/hooks/utils/get-instances-grouped-by-hierarchy-level.d.ts @@ -0,0 +1,3 @@ +import { InjectionToken } from '@nestjs/common'; +import { InstanceWrapper } from '../../injector/instance-wrapper.js'; +export declare function getInstancesGroupedByHierarchyLevel(...collections: Array | Array<[InjectionToken, InstanceWrapper]>>): Map; diff --git a/node_modules/@nestjs/core/hooks/utils/get-instances-grouped-by-hierarchy-level.js b/node_modules/@nestjs/core/hooks/utils/get-instances-grouped-by-hierarchy-level.js new file mode 100644 index 0000000000000000000000000000000000000000..e2f699b94f061474529751aca0650e56e38bbfab --- /dev/null +++ b/node_modules/@nestjs/core/hooks/utils/get-instances-grouped-by-hierarchy-level.js @@ -0,0 +1,27 @@ +export function getInstancesGroupedByHierarchyLevel(...collections) { + const groupedByHierarchyLevel = new Map(); + for (const collection of collections) { + for (const [_, wrapper] of collection) { + if (!wrapper.isDependencyTreeStatic()) { + continue; + } + const level = wrapper.hierarchyLevel; + if (!groupedByHierarchyLevel.has(level)) { + groupedByHierarchyLevel.set(level, []); + } + const byHierarchyLevelGroup = groupedByHierarchyLevel.get(level); + if (wrapper.isTransient) { + const staticTransientInstances = wrapper + .getStaticTransientInstances() + .filter(i => !!i) + .map(i => i.instance); + byHierarchyLevelGroup.push(...staticTransientInstances); + continue; + } + if (wrapper.instance) { + byHierarchyLevelGroup.push(wrapper.instance); + } + } + } + return groupedByHierarchyLevel; +} diff --git a/node_modules/@nestjs/core/hooks/utils/get-sorted-hierarchy-levels.d.ts b/node_modules/@nestjs/core/hooks/utils/get-sorted-hierarchy-levels.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97554767db8dc76fdd0f11685a24b84f5a000062 --- /dev/null +++ b/node_modules/@nestjs/core/hooks/utils/get-sorted-hierarchy-levels.d.ts @@ -0,0 +1 @@ +export declare function getSortedHierarchyLevels(groups: Map, order?: 'ASC' | 'DESC'): number[]; diff --git a/node_modules/@nestjs/core/hooks/utils/get-sorted-hierarchy-levels.js b/node_modules/@nestjs/core/hooks/utils/get-sorted-hierarchy-levels.js new file mode 100644 index 0000000000000000000000000000000000000000..725766826898e21383500d1fa274a70b374ca74d --- /dev/null +++ b/node_modules/@nestjs/core/hooks/utils/get-sorted-hierarchy-levels.js @@ -0,0 +1,7 @@ +export function getSortedHierarchyLevels(groups, order = 'ASC') { + const comparator = order === 'ASC' + ? (a, b) => a - b + : (a, b) => b - a; + const levels = Array.from(groups.keys()).sort(comparator); + return levels; +} diff --git a/node_modules/@nestjs/core/index.d.ts b/node_modules/@nestjs/core/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39e2c49b2ce8815f4c9db411a2c83ba47dd92a08 --- /dev/null +++ b/node_modules/@nestjs/core/index.d.ts @@ -0,0 +1,17 @@ +import 'reflect-metadata'; +export * from './adapters'; +export * from './application-config'; +export { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_PIPE } from './constants'; +export * from './discovery'; +export * from './exceptions'; +export * from './helpers'; +export * from './injector'; +export * from './inspector'; +export * from './metadata-scanner'; +export * from './middleware'; +export * from './nest-application'; +export * from './nest-application-context'; +export { IEntryNestModule, NestFactory } from './nest-factory'; +export * from './repl'; +export * from './router'; +export * from './services'; diff --git a/node_modules/@nestjs/core/index.js b/node_modules/@nestjs/core/index.js new file mode 100644 index 0000000000000000000000000000000000000000..18fcb8b0b815ba55c5ca4a9091fd591500714cea --- /dev/null +++ b/node_modules/@nestjs/core/index.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NestFactory = exports.APP_PIPE = exports.APP_INTERCEPTOR = exports.APP_GUARD = exports.APP_FILTER = void 0; +const tslib_1 = require("tslib"); +/* + * Nest @core + * Copyright(c) 2017 - 2025 Kamil Mysliwiec + * https://nestjs.com + * MIT Licensed + */ +require("reflect-metadata"); +tslib_1.__exportStar(require("./adapters"), exports); +tslib_1.__exportStar(require("./application-config"), exports); +var constants_1 = require("./constants"); +Object.defineProperty(exports, "APP_FILTER", { enumerable: true, get: function () { return constants_1.APP_FILTER; } }); +Object.defineProperty(exports, "APP_GUARD", { enumerable: true, get: function () { return constants_1.APP_GUARD; } }); +Object.defineProperty(exports, "APP_INTERCEPTOR", { enumerable: true, get: function () { return constants_1.APP_INTERCEPTOR; } }); +Object.defineProperty(exports, "APP_PIPE", { enumerable: true, get: function () { return constants_1.APP_PIPE; } }); +tslib_1.__exportStar(require("./discovery"), exports); +tslib_1.__exportStar(require("./exceptions"), exports); +tslib_1.__exportStar(require("./helpers"), exports); +tslib_1.__exportStar(require("./injector"), exports); +tslib_1.__exportStar(require("./inspector"), exports); +tslib_1.__exportStar(require("./metadata-scanner"), exports); +tslib_1.__exportStar(require("./middleware"), exports); +tslib_1.__exportStar(require("./nest-application"), exports); +tslib_1.__exportStar(require("./nest-application-context"), exports); +var nest_factory_1 = require("./nest-factory"); +Object.defineProperty(exports, "NestFactory", { enumerable: true, get: function () { return nest_factory_1.NestFactory; } }); +tslib_1.__exportStar(require("./repl"), exports); +tslib_1.__exportStar(require("./router"), exports); +tslib_1.__exportStar(require("./services"), exports); diff --git a/node_modules/@nestjs/core/injector/abstract-instance-resolver.d.ts b/node_modules/@nestjs/core/injector/abstract-instance-resolver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..23332e57acc1c583c85ef4cdc3afe75cd7386a4b --- /dev/null +++ b/node_modules/@nestjs/core/injector/abstract-instance-resolver.d.ts @@ -0,0 +1,16 @@ +import { Abstract, Type } from '@nestjs/common'; +import { GetOrResolveOptions } from '@nestjs/common/interfaces'; +import { Injector } from './injector'; +import { InstanceLinksHost } from './instance-links-host'; +import { ContextId } from './instance-wrapper'; +import { Module } from './module'; +export declare abstract class AbstractInstanceResolver { + protected abstract instanceLinksHost: InstanceLinksHost; + protected abstract injector: Injector; + protected abstract get(typeOrToken: Type | Function | string | symbol, options?: GetOrResolveOptions): TResult | Array; + protected find(typeOrToken: Type | Abstract | string | symbol, options: { + moduleId?: string; + each?: boolean; + }): TResult | Array; + protected resolvePerContext(typeOrToken: Type | Abstract | string | symbol, contextModule: Module, contextId: ContextId, options?: GetOrResolveOptions): Promise>; +} diff --git a/node_modules/@nestjs/core/injector/abstract-instance-resolver.js b/node_modules/@nestjs/core/injector/abstract-instance-resolver.js new file mode 100644 index 0000000000000000000000000000000000000000..e82974eea289bca10f1e5011aa6fd0d17f765a44 --- /dev/null +++ b/node_modules/@nestjs/core/injector/abstract-instance-resolver.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AbstractInstanceResolver = void 0; +const common_1 = require("@nestjs/common"); +const exceptions_1 = require("../errors/exceptions"); +class AbstractInstanceResolver { + find(typeOrToken, options) { + const instanceLinkOrArray = this.instanceLinksHost.get(typeOrToken, options); + const pluckInstance = ({ wrapperRef }) => { + if (wrapperRef.scope === common_1.Scope.REQUEST || + wrapperRef.scope === common_1.Scope.TRANSIENT || + !wrapperRef.isDependencyTreeStatic()) { + throw new exceptions_1.InvalidClassScopeException(typeOrToken); + } + return wrapperRef.instance; + }; + if (Array.isArray(instanceLinkOrArray)) { + return instanceLinkOrArray.map(pluckInstance); + } + return pluckInstance(instanceLinkOrArray); + } + async resolvePerContext(typeOrToken, contextModule, contextId, options) { + const instanceLinkOrArray = options?.strict + ? this.instanceLinksHost.get(typeOrToken, { + moduleId: contextModule.id, + each: options.each, + }) + : this.instanceLinksHost.get(typeOrToken, { + each: options?.each, + }); + const pluckInstance = async (instanceLink) => { + const { wrapperRef, collection } = instanceLink; + if (wrapperRef.isDependencyTreeStatic() && !wrapperRef.isTransient) { + return wrapperRef.instance; + } + const ctorHost = wrapperRef.instance || { constructor: typeOrToken }; + const instance = await this.injector.loadPerContext(ctorHost, wrapperRef.host, collection, contextId, wrapperRef); + if (!instance) { + throw new exceptions_1.UnknownElementException(); + } + return instance; + }; + if (Array.isArray(instanceLinkOrArray)) { + return Promise.all(instanceLinkOrArray.map(instanceLink => pluckInstance(instanceLink))); + } + return pluckInstance(instanceLinkOrArray); + } +} +exports.AbstractInstanceResolver = AbstractInstanceResolver; diff --git a/node_modules/@nestjs/core/injector/compiler.d.ts b/node_modules/@nestjs/core/injector/compiler.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15aecb6f4d37202f3547b56b9aed2a5bf68bbfec --- /dev/null +++ b/node_modules/@nestjs/core/injector/compiler.d.ts @@ -0,0 +1,18 @@ +import { DynamicModule, ForwardReference, Type } from '@nestjs/common/interfaces'; +import { ModuleOpaqueKeyFactory } from './opaque-key-factory/interfaces/module-opaque-key-factory.interface'; +export interface ModuleFactory { + type: Type; + token: string; + dynamicMetadata?: Partial; +} +export declare class ModuleCompiler { + private readonly _moduleOpaqueKeyFactory; + constructor(_moduleOpaqueKeyFactory: ModuleOpaqueKeyFactory); + get moduleOpaqueKeyFactory(): ModuleOpaqueKeyFactory; + compile(moduleClsOrDynamic: Type | DynamicModule | ForwardReference | Promise): Promise; + extractMetadata(moduleClsOrDynamic: Type | ForwardReference | DynamicModule): { + type: Type; + dynamicMetadata: Omit | undefined; + }; + isDynamicModule(moduleClsOrDynamic: Type | DynamicModule | ForwardReference): moduleClsOrDynamic is DynamicModule; +} diff --git a/node_modules/@nestjs/core/injector/compiler.js b/node_modules/@nestjs/core/injector/compiler.js new file mode 100644 index 0000000000000000000000000000000000000000..581affef0028e634d2fd11d2a5ac7a163ac459b3 --- /dev/null +++ b/node_modules/@nestjs/core/injector/compiler.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ModuleCompiler = void 0; +class ModuleCompiler { + constructor(_moduleOpaqueKeyFactory) { + this._moduleOpaqueKeyFactory = _moduleOpaqueKeyFactory; + } + get moduleOpaqueKeyFactory() { + return this._moduleOpaqueKeyFactory; + } + async compile(moduleClsOrDynamic) { + moduleClsOrDynamic = await moduleClsOrDynamic; + const { type, dynamicMetadata } = this.extractMetadata(moduleClsOrDynamic); + const token = dynamicMetadata + ? this._moduleOpaqueKeyFactory.createForDynamic(type, dynamicMetadata, moduleClsOrDynamic) + : this._moduleOpaqueKeyFactory.createForStatic(type, moduleClsOrDynamic); + return { type, dynamicMetadata, token }; + } + extractMetadata(moduleClsOrDynamic) { + if (!this.isDynamicModule(moduleClsOrDynamic)) { + return { + type: moduleClsOrDynamic?.forwardRef + ? moduleClsOrDynamic.forwardRef() + : moduleClsOrDynamic, + dynamicMetadata: undefined, + }; + } + const { module: type, ...dynamicMetadata } = moduleClsOrDynamic; + return { type, dynamicMetadata }; + } + isDynamicModule(moduleClsOrDynamic) { + return !!moduleClsOrDynamic.module; + } +} +exports.ModuleCompiler = ModuleCompiler; diff --git a/node_modules/@nestjs/core/injector/constants.d.ts b/node_modules/@nestjs/core/injector/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d54338b423068140009d12740b41b9f8f56c9a7 --- /dev/null +++ b/node_modules/@nestjs/core/injector/constants.d.ts @@ -0,0 +1,3 @@ +import { ContextId } from './instance-wrapper'; +export declare const CONTROLLER_ID_KEY = "CONTROLLER_ID"; +export declare const STATIC_CONTEXT: ContextId; diff --git a/node_modules/@nestjs/core/injector/constants.js b/node_modules/@nestjs/core/injector/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..7bf96e0a7edcfe6498b34ce26b232b981497dc77 --- /dev/null +++ b/node_modules/@nestjs/core/injector/constants.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.STATIC_CONTEXT = exports.CONTROLLER_ID_KEY = void 0; +exports.CONTROLLER_ID_KEY = 'CONTROLLER_ID'; +const STATIC_CONTEXT_ID = 1; +exports.STATIC_CONTEXT = Object.freeze({ + id: STATIC_CONTEXT_ID, +}); diff --git a/node_modules/@nestjs/core/injector/container.d.ts b/node_modules/@nestjs/core/injector/container.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf3be0579bad2b579b7edf9be14c404dfff9a8eb --- /dev/null +++ b/node_modules/@nestjs/core/injector/container.d.ts @@ -0,0 +1,67 @@ +import { DynamicModule, Provider } from '@nestjs/common'; +import { EnhancerSubtype } from '@nestjs/common/constants'; +import { Injectable, Type } from '@nestjs/common/interfaces'; +import { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface'; +import { ApplicationConfig } from '../application-config'; +import { SerializedGraph } from '../inspector/serialized-graph'; +import { ModuleCompiler } from './compiler'; +import { ContextId } from './instance-wrapper'; +import { Module } from './module'; +import { ModulesContainer } from './modules-container'; +import { ModuleOpaqueKeyFactory } from './opaque-key-factory/interfaces/module-opaque-key-factory.interface'; +type ModuleMetatype = Type | DynamicModule | Promise; +type ModuleScope = Type[]; +export declare class NestContainer { + private readonly _applicationConfig; + private readonly _contextOptions; + private readonly globalModules; + private readonly modules; + private readonly dynamicModulesMetadata; + private readonly internalProvidersStorage; + private readonly _serializedGraph; + private moduleCompiler; + private internalCoreModule; + constructor(_applicationConfig?: ApplicationConfig | undefined, _contextOptions?: NestApplicationContextOptions | undefined); + get serializedGraph(): SerializedGraph; + get applicationConfig(): ApplicationConfig | undefined; + get contextOptions(): NestApplicationContextOptions | undefined; + setHttpAdapter(httpAdapter: any): void; + getHttpAdapterRef(): import("..").AbstractHttpAdapter; + getHttpAdapterHostRef(): import("..").HttpAdapterHost>; + addModule(metatype: ModuleMetatype, scope: ModuleScope): Promise<{ + moduleRef: Module; + inserted: boolean; + } | undefined>; + replaceModule(metatypeToReplace: ModuleMetatype, newMetatype: ModuleMetatype, scope: ModuleScope): Promise<{ + moduleRef: Module; + inserted: boolean; + } | undefined>; + private setModule; + addDynamicMetadata(token: string, dynamicModuleMetadata: Partial, scope: Type[]): Promise; + addDynamicModules(modules: any[], scope: Type[]): Promise; + isGlobalModule(metatype: Type, dynamicMetadata?: Partial): boolean; + addGlobalModule(module: Module): void; + getModules(): ModulesContainer; + getModuleCompiler(): ModuleCompiler; + getModuleByKey(moduleKey: string): Module | undefined; + getInternalCoreModuleRef(): Module | undefined; + addImport(relatedModule: Type | DynamicModule, token: string): Promise; + addProvider(provider: Provider, token: string, enhancerSubtype?: EnhancerSubtype): string | symbol | Function; + addInjectable(injectable: Provider, token: string, enhancerSubtype: EnhancerSubtype, host?: Type): string | symbol | Function | import("./instance-wrapper").InstanceWrapper; + addExportedProviderOrModule(toExport: Type | DynamicModule, token: string): void; + addController(controller: Type, token: string): void; + clear(): void; + replace(toReplace: any, options: { + scope: any[] | null; + }): void; + bindGlobalScope(): void; + bindGlobalsToImports(moduleRef: Module): void; + bindGlobalModuleToModule(target: Module, globalModule: Module): void; + getDynamicMetadataByToken(token: string): Partial; + getDynamicMetadataByToken>(token: string, metadataKey: K): DynamicModule[K]; + registerCoreModuleRef(moduleRef: Module): void; + getModuleTokenFactory(): ModuleOpaqueKeyFactory; + registerRequestProvider(request: T, contextId: ContextId): void; + private shouldInitOnPreview; +} +export {}; diff --git a/node_modules/@nestjs/core/injector/container.js b/node_modules/@nestjs/core/injector/container.js new file mode 100644 index 0000000000000000000000000000000000000000..17bc0212dfa1663397bef3f49ffe9b93a57786cc --- /dev/null +++ b/node_modules/@nestjs/core/injector/container.js @@ -0,0 +1,233 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NestContainer = void 0; +const constants_1 = require("@nestjs/common/constants"); +const discoverable_meta_host_collection_1 = require("../discovery/discoverable-meta-host-collection"); +const exceptions_1 = require("../errors/exceptions"); +const initialize_on_preview_allowlist_1 = require("../inspector/initialize-on-preview.allowlist"); +const serialized_graph_1 = require("../inspector/serialized-graph"); +const request_constants_1 = require("../router/request/request-constants"); +const compiler_1 = require("./compiler"); +const internal_core_module_1 = require("./internal-core-module/internal-core-module"); +const internal_providers_storage_1 = require("./internal-providers-storage"); +const module_1 = require("./module"); +const modules_container_1 = require("./modules-container"); +const by_reference_module_opaque_key_factory_1 = require("./opaque-key-factory/by-reference-module-opaque-key-factory"); +const deep_hashed_module_opaque_key_factory_1 = require("./opaque-key-factory/deep-hashed-module-opaque-key-factory"); +class NestContainer { + constructor(_applicationConfig = undefined, _contextOptions = undefined) { + this._applicationConfig = _applicationConfig; + this._contextOptions = _contextOptions; + this.globalModules = new Set(); + this.modules = new modules_container_1.ModulesContainer(); + this.dynamicModulesMetadata = new Map(); + this.internalProvidersStorage = new internal_providers_storage_1.InternalProvidersStorage(); + this._serializedGraph = new serialized_graph_1.SerializedGraph(); + const moduleOpaqueKeyFactory = this._contextOptions?.moduleIdGeneratorAlgorithm === 'deep-hash' + ? new deep_hashed_module_opaque_key_factory_1.DeepHashedModuleOpaqueKeyFactory() + : new by_reference_module_opaque_key_factory_1.ByReferenceModuleOpaqueKeyFactory({ + keyGenerationStrategy: this._contextOptions?.snapshot + ? 'shallow' + : 'random', + }); + this.moduleCompiler = new compiler_1.ModuleCompiler(moduleOpaqueKeyFactory); + } + get serializedGraph() { + return this._serializedGraph; + } + get applicationConfig() { + return this._applicationConfig; + } + get contextOptions() { + return this._contextOptions; + } + setHttpAdapter(httpAdapter) { + this.internalProvidersStorage.httpAdapter = httpAdapter; + if (!this.internalProvidersStorage.httpAdapterHost) { + return; + } + const host = this.internalProvidersStorage.httpAdapterHost; + host.httpAdapter = httpAdapter; + } + getHttpAdapterRef() { + return this.internalProvidersStorage.httpAdapter; + } + getHttpAdapterHostRef() { + return this.internalProvidersStorage.httpAdapterHost; + } + async addModule(metatype, scope) { + // In DependenciesScanner#scanForModules we already check for undefined or invalid modules + // We still need to catch the edge-case of `forwardRef(() => undefined)` + if (!metatype) { + throw new exceptions_1.UndefinedForwardRefException(scope); + } + const { type, dynamicMetadata, token } = await this.moduleCompiler.compile(metatype); + if (this.modules.has(token)) { + return { + moduleRef: this.modules.get(token), + inserted: true, + }; + } + return { + moduleRef: await this.setModule({ + token, + type, + dynamicMetadata, + }, scope), + inserted: true, + }; + } + async replaceModule(metatypeToReplace, newMetatype, scope) { + // In DependenciesScanner#scanForModules we already check for undefined or invalid modules + // We still need to catch the edge-case of `forwardRef(() => undefined)` + if (!metatypeToReplace || !newMetatype) { + throw new exceptions_1.UndefinedForwardRefException(scope); + } + const { token } = await this.moduleCompiler.compile(metatypeToReplace); + const { type, dynamicMetadata } = await this.moduleCompiler.compile(newMetatype); + return { + moduleRef: await this.setModule({ + token, + type, + dynamicMetadata, + }, scope), + inserted: false, + }; + } + async setModule({ token, dynamicMetadata, type }, scope) { + const moduleRef = new module_1.Module(type, this); + moduleRef.token = token; + moduleRef.initOnPreview = this.shouldInitOnPreview(type); + this.modules.set(token, moduleRef); + const updatedScope = [].concat(scope, type); + await this.addDynamicMetadata(token, dynamicMetadata, updatedScope); + if (this.isGlobalModule(type, dynamicMetadata)) { + moduleRef.isGlobal = true; + // Set global module distance to MAX_VALUE to ensure their lifecycle hooks + // are always executed first (when initializing the application) + moduleRef.distance = Number.MAX_VALUE; + this.addGlobalModule(moduleRef); + } + return moduleRef; + } + async addDynamicMetadata(token, dynamicModuleMetadata, scope) { + if (!dynamicModuleMetadata) { + return; + } + this.dynamicModulesMetadata.set(token, dynamicModuleMetadata); + const { imports } = dynamicModuleMetadata; + await this.addDynamicModules(imports, scope); + } + async addDynamicModules(modules, scope) { + if (!modules) { + return; + } + await Promise.all(modules.map(module => this.addModule(module, scope))); + } + isGlobalModule(metatype, dynamicMetadata) { + if (dynamicMetadata && dynamicMetadata.global) { + return true; + } + return !!Reflect.getMetadata(constants_1.GLOBAL_MODULE_METADATA, metatype); + } + addGlobalModule(module) { + this.globalModules.add(module); + } + getModules() { + return this.modules; + } + getModuleCompiler() { + return this.moduleCompiler; + } + getModuleByKey(moduleKey) { + return this.modules.get(moduleKey); + } + getInternalCoreModuleRef() { + return this.internalCoreModule; + } + async addImport(relatedModule, token) { + if (!this.modules.has(token)) { + return; + } + const moduleRef = this.modules.get(token); + const { token: relatedModuleToken } = await this.moduleCompiler.compile(relatedModule); + const related = this.modules.get(relatedModuleToken); + moduleRef.addImport(related); + } + addProvider(provider, token, enhancerSubtype) { + const moduleRef = this.modules.get(token); + if (!provider) { + throw new exceptions_1.CircularDependencyException(moduleRef?.metatype.name); + } + if (!moduleRef) { + throw new exceptions_1.UnknownModuleException(); + } + const providerKey = moduleRef.addProvider(provider, enhancerSubtype); + const providerRef = moduleRef.getProviderByKey(providerKey); + discoverable_meta_host_collection_1.DiscoverableMetaHostCollection.inspectProvider(this.modules, providerRef); + return providerKey; + } + addInjectable(injectable, token, enhancerSubtype, host) { + if (!this.modules.has(token)) { + throw new exceptions_1.UnknownModuleException(); + } + const moduleRef = this.modules.get(token); + return moduleRef.addInjectable(injectable, enhancerSubtype, host); + } + addExportedProviderOrModule(toExport, token) { + if (!this.modules.has(token)) { + throw new exceptions_1.UnknownModuleException(); + } + const moduleRef = this.modules.get(token); + moduleRef.addExportedProviderOrModule(toExport); + } + addController(controller, token) { + if (!this.modules.has(token)) { + throw new exceptions_1.UnknownModuleException(); + } + const moduleRef = this.modules.get(token); + moduleRef.addController(controller); + const controllerRef = moduleRef.controllers.get(controller); + discoverable_meta_host_collection_1.DiscoverableMetaHostCollection.inspectController(this.modules, controllerRef); + } + clear() { + this.modules.clear(); + } + replace(toReplace, options) { + this.modules.forEach(moduleRef => moduleRef.replace(toReplace, options)); + } + bindGlobalScope() { + this.modules.forEach(moduleRef => this.bindGlobalsToImports(moduleRef)); + } + bindGlobalsToImports(moduleRef) { + this.globalModules.forEach(globalModule => this.bindGlobalModuleToModule(moduleRef, globalModule)); + } + bindGlobalModuleToModule(target, globalModule) { + if (target === globalModule || target === this.internalCoreModule) { + return; + } + target.addImport(globalModule); + } + getDynamicMetadataByToken(token, metadataKey) { + const metadata = this.dynamicModulesMetadata.get(token); + return metadataKey ? (metadata?.[metadataKey] ?? []) : metadata; + } + registerCoreModuleRef(moduleRef) { + this.internalCoreModule = moduleRef; + this.modules[internal_core_module_1.InternalCoreModule.name] = moduleRef; + } + getModuleTokenFactory() { + return this.moduleCompiler.moduleOpaqueKeyFactory; + } + registerRequestProvider(request, contextId) { + const wrapper = this.internalCoreModule.getProviderByKey(request_constants_1.REQUEST); + wrapper.setInstanceByContextId(contextId, { + instance: request, + isResolved: true, + }); + } + shouldInitOnPreview(type) { + return initialize_on_preview_allowlist_1.InitializeOnPreviewAllowlist.has(type); + } +} +exports.NestContainer = NestContainer; diff --git a/node_modules/@nestjs/core/injector/helpers/provider-classifier.d.ts b/node_modules/@nestjs/core/injector/helpers/provider-classifier.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..098d2cda5ace6951569283e94e4aa8e2bd5c1361 --- /dev/null +++ b/node_modules/@nestjs/core/injector/helpers/provider-classifier.d.ts @@ -0,0 +1,4 @@ +import { ClassProvider, FactoryProvider, Provider, ValueProvider } from '@nestjs/common'; +export declare function isClassProvider(provider: Provider): provider is ClassProvider; +export declare function isValueProvider(provider: Provider): provider is ValueProvider; +export declare function isFactoryProvider(provider: Provider): provider is FactoryProvider; diff --git a/node_modules/@nestjs/core/injector/helpers/provider-classifier.js b/node_modules/@nestjs/core/injector/helpers/provider-classifier.js new file mode 100644 index 0000000000000000000000000000000000000000..1bd27284c4065baf9dee6ee9cc76ac043cc132c8 --- /dev/null +++ b/node_modules/@nestjs/core/injector/helpers/provider-classifier.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isClassProvider = isClassProvider; +exports.isValueProvider = isValueProvider; +exports.isFactoryProvider = isFactoryProvider; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +function isClassProvider(provider) { + return Boolean(provider?.useClass); +} +function isValueProvider(provider) { + const providerValue = provider?.useValue; + return !(0, shared_utils_1.isUndefined)(providerValue); +} +function isFactoryProvider(provider) { + return Boolean(provider.useFactory); +} diff --git a/node_modules/@nestjs/core/injector/helpers/silent-logger.d.ts b/node_modules/@nestjs/core/injector/helpers/silent-logger.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f209ebabc5bca645a764694a25b03fd028531376 --- /dev/null +++ b/node_modules/@nestjs/core/injector/helpers/silent-logger.d.ts @@ -0,0 +1,10 @@ +import { Logger } from '@nestjs/common'; +export declare class SilentLogger extends Logger { + log: () => void; + error: () => void; + warn: () => void; + debug: () => void; + verbose: () => void; + fatal: () => void; + setLogLevels: () => void; +} diff --git a/node_modules/@nestjs/core/injector/helpers/silent-logger.js b/node_modules/@nestjs/core/injector/helpers/silent-logger.js new file mode 100644 index 0000000000000000000000000000000000000000..588eabb65edbea70cc25327099158951616af0fc --- /dev/null +++ b/node_modules/@nestjs/core/injector/helpers/silent-logger.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SilentLogger = void 0; +const common_1 = require("@nestjs/common"); +const noop = () => { }; +class SilentLogger extends common_1.Logger { + constructor() { + super(...arguments); + this.log = noop; + this.error = noop; + this.warn = noop; + this.debug = noop; + this.verbose = noop; + this.fatal = noop; + this.setLogLevels = noop; + } +} +exports.SilentLogger = SilentLogger; diff --git a/node_modules/@nestjs/core/injector/helpers/transient-instances.d.ts b/node_modules/@nestjs/core/injector/helpers/transient-instances.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8b9131cee143553b839c67ded5c7b535c0dbbb5a --- /dev/null +++ b/node_modules/@nestjs/core/injector/helpers/transient-instances.d.ts @@ -0,0 +1,12 @@ +import { InjectionToken } from '@nestjs/common'; +import { InstanceWrapper } from '../instance-wrapper'; +/** + * Returns the instances which are transient + * @param instances The instances which should be checked whether they are transient + */ +export declare function getTransientInstances(instances: [InjectionToken, InstanceWrapper][]): InstanceWrapper[]; +/** + * Returns the instances which are not transient + * @param instances The instances which should be checked whether they are transient + */ +export declare function getNonTransientInstances(instances: [InjectionToken, InstanceWrapper][]): InstanceWrapper[]; diff --git a/node_modules/@nestjs/core/injector/helpers/transient-instances.js b/node_modules/@nestjs/core/injector/helpers/transient-instances.js new file mode 100644 index 0000000000000000000000000000000000000000..976d30cc14d8e30be21d9984e73e834b4ceb02f0 --- /dev/null +++ b/node_modules/@nestjs/core/injector/helpers/transient-instances.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTransientInstances = getTransientInstances; +exports.getNonTransientInstances = getNonTransientInstances; +const iterare_1 = require("iterare"); +/** + * Returns the instances which are transient + * @param instances The instances which should be checked whether they are transient + */ +function getTransientInstances(instances) { + return (0, iterare_1.iterate)(instances) + .filter(([_, wrapper]) => wrapper.isDependencyTreeStatic()) + .map(([_, wrapper]) => wrapper.getStaticTransientInstances()) + .flatten() + .filter(item => !!item) + .map(({ instance }) => instance) + .toArray(); +} +/** + * Returns the instances which are not transient + * @param instances The instances which should be checked whether they are transient + */ +function getNonTransientInstances(instances) { + return (0, iterare_1.iterate)(instances) + .filter(([key, wrapper]) => wrapper.isDependencyTreeStatic() && !wrapper.isTransient) + .map(([key, { instance }]) => instance) + .toArray(); +} diff --git a/node_modules/@nestjs/core/injector/index.d.ts b/node_modules/@nestjs/core/injector/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..21e406d0661bb52285e285186b31b3af278d9d4a --- /dev/null +++ b/node_modules/@nestjs/core/injector/index.d.ts @@ -0,0 +1,6 @@ +export * from './container'; +export * from './inquirer'; +export { ContextId, HostComponentInfo } from './instance-wrapper'; +export * from './lazy-module-loader/lazy-module-loader'; +export * from './module-ref'; +export * from './modules-container'; diff --git a/node_modules/@nestjs/core/injector/index.js b/node_modules/@nestjs/core/injector/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6d2c476f7cf15a996b423051daa484c7052ae010 --- /dev/null +++ b/node_modules/@nestjs/core/injector/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./container"), exports); +tslib_1.__exportStar(require("./inquirer"), exports); +tslib_1.__exportStar(require("./lazy-module-loader/lazy-module-loader"), exports); +tslib_1.__exportStar(require("./module-ref"), exports); +tslib_1.__exportStar(require("./modules-container"), exports); diff --git a/node_modules/@nestjs/core/injector/injector.d.ts b/node_modules/@nestjs/core/injector/injector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..36c837782d571f046ad1d051f4e7213e1387b7bf --- /dev/null +++ b/node_modules/@nestjs/core/injector/injector.d.ts @@ -0,0 +1,122 @@ +import { InjectionToken } from '@nestjs/common'; +import { Controller, ForwardReference, Injectable, Type } from '@nestjs/common/interfaces'; +import { ContextId, InstancePerContext, InstanceWrapper, PropertyMetadata } from './instance-wrapper'; +import { Module } from './module'; +import { SettlementSignal } from './settlement-signal'; +/** + * The type of an injectable dependency + */ +export type InjectorDependency = InjectionToken; +/** + * The property-based dependency + */ +export interface PropertyDependency { + key: symbol | string; + name: InjectorDependency; + isOptional?: boolean; + instance?: any; +} +/** + * Context of a dependency which gets injected by + * the injector + */ +export interface InjectorDependencyContext { + /** + * The name of the property key (property-based injection) + */ + key?: string | symbol; + /** + * The function itself, the name of the function, or injection token. + */ + name?: Function | string | symbol; + /** + * The index of the dependency which gets injected + * from the dependencies array + */ + index?: number; + /** + * The dependency array which gets injected + */ + dependencies?: InjectorDependency[]; +} +interface ResolutionContext { + contextId: ContextId; + inquirer?: InstanceWrapper; + effectiveInquirerId?: string; +} +export declare class Injector { + private readonly options?; + private logger; + private readonly instanceDecorator; + constructor(options?: { + /** + * Whether to enable preview mode. + */ + preview: boolean; + /** + * Whether to enable deterministic graph snapshot generation. + */ + snapshot?: boolean; + /** + * Function to decorate a freshly created instance. + */ + instanceDecorator?: (target: unknown) => unknown; + } | undefined); + loadPrototype({ token }: InstanceWrapper, collection: Map>, contextId?: ContextId): void; + loadInstance(wrapper: InstanceWrapper, collection: Map, moduleRef: Module, resolutionContext?: ResolutionContext): Promise; + loadMiddleware(wrapper: InstanceWrapper, collection: Map, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise; + loadController(wrapper: InstanceWrapper, moduleRef: Module, contextId?: ContextId): Promise; + loadInjectable(wrapper: InstanceWrapper, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise; + loadProvider(wrapper: InstanceWrapper, moduleRef: Module, resolutionContext?: ResolutionContext): Promise; + applySettlementSignal(instancePerContext: InstancePerContext, host: InstanceWrapper): SettlementSignal; + resolveConstructorParams(wrapper: InstanceWrapper, moduleRef: Module, inject: InjectorDependency[] | undefined, callback: (args: unknown[]) => void | Promise, resolutionContext?: ResolutionContext, parentInquirer?: InstanceWrapper): Promise; + getClassDependencies(wrapper: InstanceWrapper): [InjectorDependency[], number[]]; + getFactoryProviderDependencies(wrapper: InstanceWrapper): [InjectorDependency[], number[]]; + reflectConstructorParams(type: Type | Function): any[]; + reflectOptionalParams(type: Type | Function): any[]; + reflectSelfParams(type: Type | Function): any[]; + resolveSingleParam(wrapper: InstanceWrapper, param: Type | string | symbol, dependencyContext: InjectorDependencyContext, moduleRef: Module, resolutionContext?: ResolutionContext, keyOrIndex?: symbol | string | number): Promise>; + resolveParamToken(wrapper: InstanceWrapper, param: Type | string | symbol | ForwardReference): any; + resolveComponentWrapper(moduleRef: Module, token: InjectionToken, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper, resolutionContext?: ResolutionContext, keyOrIndex?: symbol | string | number): Promise; + resolveComponentHost(moduleRef: Module, instanceWrapper: InstanceWrapper>, resolutionContext?: ResolutionContext): Promise; + lookupComponent(providers: Map, moduleRef: Module, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper, resolutionContext?: ResolutionContext, keyOrIndex?: symbol | string | number): Promise>; + lookupComponentInParentModules(dependencyContext: InjectorDependencyContext, moduleRef: Module, wrapper: InstanceWrapper, resolutionContext?: ResolutionContext, keyOrIndex?: symbol | string | number): Promise; + lookupComponentInImports(moduleRef: Module, name: InjectionToken, wrapper: InstanceWrapper, moduleRegistry?: Set, resolutionContext?: ResolutionContext, keyOrIndex?: symbol | string | number, isTraversing?: boolean): Promise; + resolveProperties(wrapper: InstanceWrapper, moduleRef: Module, inject?: InjectorDependency[], resolutionContext?: ResolutionContext, parentInquirer?: InstanceWrapper): Promise; + reflectProperties(type: Type): PropertyDependency[]; + applyProperties(instance: T, properties: PropertyDependency[]): void; + instantiateClass(instances: any[], wrapper: InstanceWrapper, targetMetatype: InstanceWrapper, resolutionContext?: ResolutionContext): Promise; + loadPerContext(instance: T, moduleRef: Module, collection: Map, ctx: ContextId, wrapper?: InstanceWrapper): Promise; + loadEnhancersPerContext(wrapper: InstanceWrapper, ctx: ContextId, inquirer?: InstanceWrapper): Promise; + loadCtorMetadata(metadata: InstanceWrapper[], contextId: ContextId, inquirer?: InstanceWrapper, parentInquirer?: InstanceWrapper): Promise; + loadPropertiesMetadata(metadata: PropertyMetadata[], contextId: ContextId, inquirer?: InstanceWrapper): Promise; + private getInquirerId; + private createResolutionContext; + private getContextInquirerId; + private isInContext; + private shouldSkipProviderLoading; + /** + * For nested TRANSIENT dependencies (TRANSIENT -> TRANSIENT) in non-static contexts, + * returns parentInquirer to ensure each parent TRANSIENT gets its own instance. + * This is necessary because in REQUEST/DURABLE scopes, the same TRANSIENT wrapper + * can be used by multiple parents, causing nested TRANSIENTs to be shared incorrectly. + * For non-TRANSIENT -> TRANSIENT, returns inquirer (current wrapper being created). + */ + private getEffectiveInquirer; + private getEffectiveInquirerId; + private getStaticTransientResolutionContext; + private getEffectiveResolutionContext; + private hasDenseCtorMetadata; + private resolveScopedComponentHost; + private isInquirerRequest; + private isInquirer; + protected addDependencyMetadata(keyOrIndex: symbol | string | number, hostWrapper: InstanceWrapper, instanceWrapper: InstanceWrapper): void; + private getTokenName; + private printResolvingDependenciesLog; + private printLookingForProviderLog; + private printFoundInModuleLog; + private isDebugMode; + private getContextId; + private getNowTimestamp; +} +export {}; diff --git a/node_modules/@nestjs/core/injector/injector.js b/node_modules/@nestjs/core/injector/injector.js new file mode 100644 index 0000000000000000000000000000000000000000..1b310f3b5697e94399a87d9568342cabc4b3dab6 --- /dev/null +++ b/node_modules/@nestjs/core/injector/injector.js @@ -0,0 +1,644 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Injector = void 0; +const common_1 = require("@nestjs/common"); +const constants_1 = require("@nestjs/common/constants"); +const cli_colors_util_1 = require("@nestjs/common/utils/cli-colors.util"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const perf_hooks_1 = require("perf_hooks"); +const exceptions_1 = require("../errors/exceptions"); +const runtime_exception_1 = require("../errors/exceptions/runtime.exception"); +const undefined_dependency_exception_1 = require("../errors/exceptions/undefined-dependency.exception"); +const unknown_dependencies_exception_1 = require("../errors/exceptions/unknown-dependencies.exception"); +const barrier_1 = require("../helpers/barrier"); +const constants_2 = require("./constants"); +const inquirer_1 = require("./inquirer"); +const instance_wrapper_1 = require("./instance-wrapper"); +const settlement_signal_1 = require("./settlement-signal"); +class Injector { + constructor(options) { + this.options = options; + this.logger = new common_1.Logger('InjectorLogger'); + this.instanceDecorator = (target) => target; + if (options?.instanceDecorator) { + this.instanceDecorator = options.instanceDecorator; + } + } + loadPrototype({ token }, collection, contextId = constants_2.STATIC_CONTEXT) { + if (!collection) { + return; + } + const target = collection.get(token); + const instance = target.createPrototype(contextId); + if (instance) { + const wrapper = new instance_wrapper_1.InstanceWrapper({ + ...target, + instance, + }); + collection.set(token, wrapper); + } + } + async loadInstance(wrapper, collection, moduleRef, resolutionContext = { contextId: constants_2.STATIC_CONTEXT }) { + const inquirerId = this.getContextInquirerId(resolutionContext); + const instanceHost = wrapper.getInstanceByContextId(this.getContextId(resolutionContext.contextId, wrapper), inquirerId); + if (instanceHost.isPending) { + const settlementSignal = wrapper.settlementSignal; + if (resolutionContext.inquirer && + settlementSignal?.isCycle(resolutionContext.inquirer.id)) { + throw new exceptions_1.CircularDependencyException(`"${wrapper.name}"`); + } + return instanceHost.donePromise.then((err) => { + if (err) { + throw err; + } + }); + } + const settlementSignal = this.applySettlementSignal(instanceHost, wrapper); + const token = wrapper.token || wrapper.name; + const { inject } = wrapper; + const targetWrapper = collection.get(token); + if ((0, shared_utils_1.isUndefined)(targetWrapper)) { + throw new runtime_exception_1.RuntimeException(); + } + if (instanceHost.isResolved) { + return settlementSignal.complete(); + } + try { + const t0 = this.getNowTimestamp(); + const localResolutionContext = this.createResolutionContext(resolutionContext.contextId, wrapper, inquirerId); + const callback = async (instances) => { + const properties = await this.resolveProperties(wrapper, moduleRef, inject, localResolutionContext, resolutionContext.inquirer); + const instance = await this.instantiateClass(instances, wrapper, targetWrapper, wrapper.isTransient ? localResolutionContext : resolutionContext); + this.applyProperties(instance, properties); + wrapper.initTime = this.getNowTimestamp() - t0; + settlementSignal.complete(); + }; + await this.resolveConstructorParams(wrapper, moduleRef, inject, callback, localResolutionContext, resolutionContext.inquirer); + if (!instanceHost.isResolved) { + settlementSignal.complete(); + } + } + catch (err) { + wrapper.removeInstanceByContextId(this.getContextId(resolutionContext.contextId, wrapper), inquirerId); + settlementSignal.error(err); + throw err; + } + } + async loadMiddleware(wrapper, collection, moduleRef, contextId = constants_2.STATIC_CONTEXT, inquirer) { + const { metatype, token } = wrapper; + const targetWrapper = collection.get(token); + if (!(0, shared_utils_1.isUndefined)(targetWrapper.instance)) { + return; + } + targetWrapper.instance = Object.create(metatype.prototype); + await this.loadInstance(wrapper, collection, moduleRef, this.createResolutionContext(contextId, inquirer || wrapper)); + } + async loadController(wrapper, moduleRef, contextId = constants_2.STATIC_CONTEXT) { + const controllers = moduleRef.controllers; + await this.loadInstance(wrapper, controllers, moduleRef, this.createResolutionContext(contextId, wrapper)); + await this.loadEnhancersPerContext(wrapper, contextId, wrapper); + } + async loadInjectable(wrapper, moduleRef, contextId = constants_2.STATIC_CONTEXT, inquirer) { + const injectables = moduleRef.injectables; + await this.loadInstance(wrapper, injectables, moduleRef, this.createResolutionContext(contextId, inquirer)); + } + async loadProvider(wrapper, moduleRef, resolutionContext = { contextId: constants_2.STATIC_CONTEXT }) { + if (this.shouldSkipProviderLoading(wrapper, resolutionContext)) { + return; + } + const providers = moduleRef.providers; + await this.loadInstance(wrapper, providers, moduleRef, resolutionContext); + await this.loadEnhancersPerContext(wrapper, resolutionContext.contextId, wrapper); + } + applySettlementSignal(instancePerContext, host) { + const settlementSignal = new settlement_signal_1.SettlementSignal(); + instancePerContext.donePromise = settlementSignal.asPromise(); + instancePerContext.isPending = true; + host.settlementSignal = settlementSignal; + return settlementSignal; + } + async resolveConstructorParams(wrapper, moduleRef, inject, callback, resolutionContext = { contextId: constants_2.STATIC_CONTEXT }, parentInquirer) { + const metadata = wrapper.getCtorMetadata(); + if (resolutionContext.contextId !== constants_2.STATIC_CONTEXT && + this.hasDenseCtorMetadata(wrapper, inject, metadata)) { + const deps = await this.loadCtorMetadata(metadata, resolutionContext.contextId, resolutionContext.inquirer, parentInquirer); + return callback(deps); + } + const isFactoryProvider = !(0, shared_utils_1.isNil)(inject); + const [dependencies, optionalDependenciesIds] = isFactoryProvider + ? this.getFactoryProviderDependencies(wrapper) + : this.getClassDependencies(wrapper); + const paramBarrier = new barrier_1.Barrier(dependencies.length); + let isResolved = true; + const resolveParam = async (param, index) => { + try { + if (this.isInquirer(param, parentInquirer)) { + /* + * Signal the barrier to make sure other dependencies do not get stuck waiting forever. + */ + paramBarrier.signal(); + return parentInquirer && parentInquirer.instance; + } + if (resolutionContext.inquirer?.isTransient && parentInquirer) { + // When `inquirer` is transient too, inherit the parent inquirer + // This is required to ensure that transient providers are only resolved + // when requested + resolutionContext.inquirer.attachRootInquirer(parentInquirer); + } + const nestedResolutionContext = this.getStaticTransientResolutionContext(resolutionContext, parentInquirer); + const paramWrapper = await this.resolveSingleParam(wrapper, param, { index, dependencies }, moduleRef, nestedResolutionContext, index); + /* + * Ensure that all instance wrappers are resolved at this point before we continue. + * Otherwise the staticity of `wrapper`'s dependency tree may be evaluated incorrectly + * and result in undefined / null injection. + */ + await paramBarrier.signalAndWait(); + const effectiveResolutionContext = this.getEffectiveResolutionContext(paramWrapper, resolutionContext, parentInquirer); + const paramWrapperWithInstance = await this.resolveComponentHost(moduleRef, paramWrapper, effectiveResolutionContext); + const instanceHost = paramWrapperWithInstance.getInstanceByContextId(this.getContextId(effectiveResolutionContext.contextId, paramWrapperWithInstance), effectiveResolutionContext.effectiveInquirerId); + if (!instanceHost.isResolved && !paramWrapperWithInstance.forwardRef) { + isResolved = false; + } + return instanceHost?.instance; + } + catch (err) { + /* + * Signal the barrier to make sure other dependencies do not get stuck waiting forever. We + * do not care if this occurs after `Barrier.signalAndWait()` is called in the `try` block + * because the barrier will always have been resolved by then. + */ + paramBarrier.signal(); + const isOptional = optionalDependenciesIds.includes(index); + if (!isOptional) { + throw err; + } + return undefined; + } + }; + const instances = await Promise.all(dependencies.map(resolveParam)); + isResolved && (await callback(instances)); + } + getClassDependencies(wrapper) { + const ctorRef = wrapper.metatype; + return [ + this.reflectConstructorParams(ctorRef), + this.reflectOptionalParams(ctorRef), + ]; + } + getFactoryProviderDependencies(wrapper) { + const optionalDependenciesIds = []; + /** + * Same as the internal utility function `isOptionalFactoryDependency` from `@nestjs/common`. + * We are duplicating it here because that one is not supposed to be exported. + */ + function isOptionalFactoryDependency(value) { + return (!(0, shared_utils_1.isUndefined)(value.token) && + !(0, shared_utils_1.isUndefined)(value.optional) && + !value.prototype); + } + const mapFactoryProviderInjectArray = (item, index) => { + if (typeof item !== 'object') { + return item; + } + if (isOptionalFactoryDependency(item)) { + if (item.optional) { + optionalDependenciesIds.push(index); + } + return item?.token; + } + return item; + }; + return [ + wrapper.inject?.map?.(mapFactoryProviderInjectArray), + optionalDependenciesIds, + ]; + } + reflectConstructorParams(type) { + const paramtypes = [ + ...(Reflect.getMetadata(constants_1.PARAMTYPES_METADATA, type) || []), + ]; + const selfParams = this.reflectSelfParams(type); + selfParams.forEach(({ index, param }) => (paramtypes[index] = param)); + return Array.from(paramtypes); + } + reflectOptionalParams(type) { + return Reflect.getMetadata(constants_1.OPTIONAL_DEPS_METADATA, type) || []; + } + reflectSelfParams(type) { + return Reflect.getMetadata(constants_1.SELF_DECLARED_DEPS_METADATA, type) || []; + } + async resolveSingleParam(wrapper, param, dependencyContext, moduleRef, resolutionContext = { contextId: constants_2.STATIC_CONTEXT }, keyOrIndex) { + if ((0, shared_utils_1.isUndefined)(param)) { + this.logger.log('Nest encountered an undefined dependency. This may be due to a circular import or a missing dependency declaration.'); + throw new undefined_dependency_exception_1.UndefinedDependencyException(wrapper.name, dependencyContext, moduleRef); + } + const token = this.resolveParamToken(wrapper, param); + return this.resolveComponentWrapper(moduleRef, token, dependencyContext, wrapper, resolutionContext, keyOrIndex); + } + resolveParamToken(wrapper, param) { + if (typeof param === 'object' && 'forwardRef' in param) { + wrapper.forwardRef = true; + return param.forwardRef(); + } + return param; + } + async resolveComponentWrapper(moduleRef, token, dependencyContext, wrapper, resolutionContext = { contextId: constants_2.STATIC_CONTEXT }, keyOrIndex) { + this.printResolvingDependenciesLog(token, resolutionContext.inquirer); + this.printLookingForProviderLog(token, moduleRef); + const providers = moduleRef.providers; + return this.lookupComponent(providers, moduleRef, { ...dependencyContext, name: token }, wrapper, resolutionContext, keyOrIndex); + } + async resolveComponentHost(moduleRef, instanceWrapper, resolutionContext = { contextId: constants_2.STATIC_CONTEXT }) { + const inquirerId = this.getContextInquirerId(resolutionContext); + const instanceHost = instanceWrapper.getInstanceByContextId(this.getContextId(resolutionContext.contextId, instanceWrapper), inquirerId); + if (!instanceHost.isResolved && !instanceWrapper.forwardRef) { + resolutionContext.inquirer?.settlementSignal?.insertRef(instanceWrapper.id); + await this.loadProvider(instanceWrapper, instanceWrapper.host ?? moduleRef, resolutionContext); + } + else if (!instanceHost.isResolved && + instanceWrapper.forwardRef && + (resolutionContext.contextId !== constants_2.STATIC_CONTEXT || !!inquirerId)) { + /** + * When circular dependency has been detected between + * either request/transient providers, we have to asynchronously + * resolve instance host for a specific contextId or inquirer, to ensure + * that eventual lazily created instance will be merged with the prototype + * instantiated beforehand. + */ + instanceHost.donePromise && + void instanceHost.donePromise + .then(() => this.loadProvider(instanceWrapper, moduleRef, resolutionContext)) + .catch(err => { + instanceWrapper.settlementSignal?.error(err); + }); + } + if (instanceWrapper.async) { + const host = instanceWrapper.getInstanceByContextId(this.getContextId(resolutionContext.contextId, instanceWrapper), inquirerId); + host.instance = await host.instance; + instanceWrapper.setInstanceByContextId(resolutionContext.contextId, host, inquirerId); + } + return instanceWrapper; + } + async lookupComponent(providers, moduleRef, dependencyContext, wrapper, resolutionContext = { contextId: constants_2.STATIC_CONTEXT }, keyOrIndex) { + const token = wrapper.token || wrapper.name; + const { name } = dependencyContext; + if (wrapper && token === name) { + throw new unknown_dependencies_exception_1.UnknownDependenciesException(wrapper.name, dependencyContext, moduleRef, { id: wrapper.id }); + } + if (name && providers.has(name)) { + const instanceWrapper = providers.get(name); + this.printFoundInModuleLog(name, moduleRef); + this.addDependencyMetadata(keyOrIndex, wrapper, instanceWrapper); + return instanceWrapper; + } + return this.lookupComponentInParentModules(dependencyContext, moduleRef, wrapper, resolutionContext, keyOrIndex); + } + async lookupComponentInParentModules(dependencyContext, moduleRef, wrapper, resolutionContext = { contextId: constants_2.STATIC_CONTEXT }, keyOrIndex) { + const instanceWrapper = await this.lookupComponentInImports(moduleRef, dependencyContext.name, wrapper, new Set(), resolutionContext, keyOrIndex); + if ((0, shared_utils_1.isNil)(instanceWrapper)) { + throw new unknown_dependencies_exception_1.UnknownDependenciesException(wrapper.name, dependencyContext, moduleRef, { id: wrapper.id }); + } + return instanceWrapper; + } + async lookupComponentInImports(moduleRef, name, wrapper, moduleRegistry = new Set(), resolutionContext = { contextId: constants_2.STATIC_CONTEXT }, keyOrIndex, isTraversing) { + let instanceWrapperRef = null; + const imports = moduleRef.imports || new Set(); + const identity = (item) => item; + let children = [...imports.values()].filter(identity); + if (isTraversing) { + const contextModuleExports = moduleRef.exports; + children = children.filter(child => contextModuleExports.has(child.metatype)); + } + for (const relatedModule of children) { + if (moduleRegistry.has(relatedModule.id)) { + continue; + } + this.printLookingForProviderLog(name, relatedModule); + moduleRegistry.add(relatedModule.id); + const { providers, exports } = relatedModule; + if (!exports.has(name) || !providers.has(name)) { + const instanceRef = await this.lookupComponentInImports(relatedModule, name, wrapper, moduleRegistry, resolutionContext, keyOrIndex, true); + if (instanceRef) { + this.addDependencyMetadata(keyOrIndex, wrapper, instanceRef); + return instanceRef; + } + continue; + } + this.printFoundInModuleLog(name, relatedModule); + instanceWrapperRef = providers.get(name); + this.addDependencyMetadata(keyOrIndex, wrapper, instanceWrapperRef); + const inquirerId = this.getContextInquirerId(resolutionContext); + const instanceHost = instanceWrapperRef.getInstanceByContextId(this.getContextId(resolutionContext.contextId, instanceWrapperRef), inquirerId); + if (!instanceHost.isResolved && !instanceWrapperRef.forwardRef) { + /* + * Provider will be loaded shortly in resolveComponentHost() once we pass the current + * Barrier. We cannot load it here because doing so could incorrectly evaluate the + * staticity of the dependency tree and lead to undefined / null injection. + */ + break; + } + } + return instanceWrapperRef; + } + async resolveProperties(wrapper, moduleRef, inject, resolutionContext = { contextId: constants_2.STATIC_CONTEXT }, parentInquirer) { + if (!(0, shared_utils_1.isNil)(inject)) { + return []; + } + const metadata = wrapper.getPropertiesMetadata(); + if (metadata && resolutionContext.contextId !== constants_2.STATIC_CONTEXT) { + return this.loadPropertiesMetadata(metadata, resolutionContext.contextId, resolutionContext.inquirer); + } + const properties = this.reflectProperties(wrapper.metatype); + const propertyBarrier = new barrier_1.Barrier(properties.length); + const instances = await Promise.all(properties.map(async (item) => { + try { + const dependencyContext = { + key: item.key, + name: item.name, + }; + if (this.isInquirer(item.name, parentInquirer)) { + /* + * Signal the barrier to make sure other dependencies do not get stuck waiting forever. + */ + propertyBarrier.signal(); + return parentInquirer && parentInquirer.instance; + } + const nestedResolutionContext = this.getStaticTransientResolutionContext(resolutionContext, parentInquirer); + const paramWrapper = await this.resolveSingleParam(wrapper, item.name, dependencyContext, moduleRef, nestedResolutionContext, item.key); + /* + * Ensure that all instance wrappers are resolved at this point before we continue. + * Otherwise the staticity of `wrapper`'s dependency tree may be evaluated incorrectly + * and result in undefined / null injection. + */ + await propertyBarrier.signalAndWait(); + const effectivePropertyResolutionContext = this.getEffectiveResolutionContext(paramWrapper, resolutionContext, parentInquirer); + const paramWrapperWithInstance = await this.resolveComponentHost(moduleRef, paramWrapper, effectivePropertyResolutionContext); + if (!paramWrapperWithInstance) { + return undefined; + } + const instanceHost = paramWrapperWithInstance.getInstanceByContextId(this.getContextId(effectivePropertyResolutionContext.contextId, paramWrapperWithInstance), effectivePropertyResolutionContext.effectiveInquirerId); + return instanceHost.instance; + } + catch (err) { + /* + * Signal the barrier to make sure other dependencies do not get stuck waiting forever. We + * do not care if this occurs after `Barrier.signalAndWait()` is called in the `try` block + * because the barrier will always have been resolved by then. + */ + propertyBarrier.signal(); + if (!item.isOptional) { + throw err; + } + return undefined; + } + })); + return properties.map((item, index) => ({ + ...item, + instance: instances[index], + })); + } + reflectProperties(type) { + const properties = Reflect.getMetadata(constants_1.PROPERTY_DEPS_METADATA, type) || []; + const optionalKeys = Reflect.getMetadata(constants_1.OPTIONAL_PROPERTY_DEPS_METADATA, type) || []; + return properties.map((item) => ({ + ...item, + name: item.type, + isOptional: optionalKeys.includes(item.key), + })); + } + applyProperties(instance, properties) { + if (!(0, shared_utils_1.isObject)(instance)) { + return undefined; + } + (0, iterare_1.iterate)(properties) + .filter(item => !(0, shared_utils_1.isNil)(item.instance)) + .forEach(item => (instance[item.key] = item.instance)); + } + async instantiateClass(instances, wrapper, targetMetatype, resolutionContext = { contextId: constants_2.STATIC_CONTEXT }) { + const { metatype, inject } = wrapper; + const inquirerId = this.getContextInquirerId(resolutionContext); + const instanceHost = targetMetatype.getInstanceByContextId(this.getContextId(resolutionContext.contextId, targetMetatype), inquirerId); + const isInContext = this.isInContext(wrapper, resolutionContext); + if (this.options?.preview && !wrapper.host?.initOnPreview) { + instanceHost.isResolved = true; + return instanceHost.instance; + } + if ((0, shared_utils_1.isNil)(inject) && isInContext) { + instanceHost.instance = wrapper.forwardRef + ? Object.assign(instanceHost.instance, new metatype(...instances)) + : new metatype(...instances); + instanceHost.instance = this.instanceDecorator(instanceHost.instance); + instanceHost.isConstructorCalled = true; + } + else if (isInContext) { + const factoryReturnValue = targetMetatype.metatype(...instances); + instanceHost.instance = await factoryReturnValue; + instanceHost.instance = this.instanceDecorator(instanceHost.instance); + instanceHost.isConstructorCalled = true; + } + instanceHost.isResolved = true; + return instanceHost.instance; + } + async loadPerContext(instance, moduleRef, collection, ctx, wrapper) { + if (!wrapper) { + const injectionToken = instance.constructor; + wrapper = collection.get(injectionToken); + } + else { + wrapper = collection.get(wrapper.token) ?? wrapper; + } + await this.loadInstance(wrapper, collection, moduleRef, this.createResolutionContext(ctx, wrapper)); + await this.loadEnhancersPerContext(wrapper, ctx, wrapper); + const host = wrapper.getInstanceByContextId(this.getContextId(ctx, wrapper), wrapper.id); + return host && host.instance; + } + async loadEnhancersPerContext(wrapper, ctx, inquirer) { + if (ctx === constants_2.STATIC_CONTEXT) { + return; + } + const enhancers = wrapper.getEnhancersMetadata() || []; + const loadEnhancer = (item) => { + const hostModule = item.host; + return this.loadInstance(item, hostModule.injectables, hostModule, this.createResolutionContext(ctx, inquirer)); + }; + await Promise.all(enhancers.map(loadEnhancer)); + } + async loadCtorMetadata(metadata, contextId, inquirer, parentInquirer) { + const hosts = await Promise.all(metadata.map(async (item) => this.resolveScopedComponentHost(item, contextId, inquirer, parentInquirer))); + return hosts.map((item, index) => { + const dependency = metadata[index]; + const effectiveInquirerId = this.getEffectiveInquirerId(dependency, this.createResolutionContext(contextId, inquirer), parentInquirer); + return item?.getInstanceByContextId(this.getContextId(contextId, item), effectiveInquirerId).instance; + }); + } + async loadPropertiesMetadata(metadata, contextId, inquirer) { + const dependenciesHosts = await Promise.all(metadata.map(async ({ wrapper: item, key }) => ({ + key, + host: await this.resolveComponentHost(item.host, item, this.createResolutionContext(contextId, inquirer)), + }))); + const inquirerId = this.getInquirerId(inquirer); + return dependenciesHosts.map(({ key, host }) => ({ + key, + name: key, + instance: host.getInstanceByContextId(this.getContextId(contextId, host), inquirerId).instance, + })); + } + getInquirerId(inquirer) { + return inquirer ? inquirer.id : undefined; + } + createResolutionContext(contextId, inquirer, effectiveInquirerId) { + return { + contextId, + inquirer, + effectiveInquirerId, + }; + } + getContextInquirerId({ inquirer, effectiveInquirerId, }) { + return effectiveInquirerId ?? this.getInquirerId(inquirer); + } + isInContext(wrapper, resolutionContext) { + return (wrapper.isStatic(resolutionContext.contextId, resolutionContext.inquirer) || + wrapper.isInRequestScope(resolutionContext.contextId, resolutionContext.inquirer) || + wrapper.isLazyTransient(resolutionContext.contextId, resolutionContext.inquirer) || + wrapper.isExplicitlyRequested(resolutionContext.contextId, resolutionContext.inquirer)); + } + shouldSkipProviderLoading(wrapper, resolutionContext) { + const isStaticContext = resolutionContext.contextId === constants_2.STATIC_CONTEXT; + const hasNoInquirer = !resolutionContext.inquirer; + const isTopLevelStaticTransientOrRequestProvider = hasNoInquirer && (wrapper.isTransient || wrapper.scope === common_1.Scope.REQUEST); + const isStaticInquirerOutsideResolutionContext = !!resolutionContext.inquirer && + !this.isInContext(resolutionContext.inquirer, this.createResolutionContext(resolutionContext.contextId, resolutionContext.inquirer)); + const shouldSkipForStaticBootstrap = isStaticContext && + (isTopLevelStaticTransientOrRequestProvider || + isStaticInquirerOutsideResolutionContext); + return shouldSkipForStaticBootstrap; + } + /** + * For nested TRANSIENT dependencies (TRANSIENT -> TRANSIENT) in non-static contexts, + * returns parentInquirer to ensure each parent TRANSIENT gets its own instance. + * This is necessary because in REQUEST/DURABLE scopes, the same TRANSIENT wrapper + * can be used by multiple parents, causing nested TRANSIENTs to be shared incorrectly. + * For non-TRANSIENT -> TRANSIENT, returns inquirer (current wrapper being created). + */ + getEffectiveInquirer(dependency, resolutionContext, parentInquirer) { + const { inquirer, contextId } = resolutionContext; + if (dependency?.isTransient && inquirer?.isTransient && parentInquirer) { + if (contextId === constants_2.STATIC_CONTEXT) { + return inquirer.getRootInquirer() ?? parentInquirer; + } + return parentInquirer; + } + return inquirer; + } + getEffectiveInquirerId(dependency, resolutionContext, parentInquirer) { + const { contextId, inquirer, effectiveInquirerId } = resolutionContext; + if (contextId === constants_2.STATIC_CONTEXT && + dependency?.isTransient && + inquirer?.isTransient && + parentInquirer) { + const baseInquirerId = effectiveInquirerId ?? this.getInquirerId(parentInquirer); + return `${baseInquirerId}:${inquirer.id}`; + } + const effectiveInquirer = this.getEffectiveInquirer(dependency, resolutionContext, parentInquirer); + return this.getInquirerId(effectiveInquirer); + } + getStaticTransientResolutionContext(resolutionContext, parentInquirer) { + const { contextId, inquirer, effectiveInquirerId } = resolutionContext; + if (contextId === constants_2.STATIC_CONTEXT && + inquirer?.isTransient && + parentInquirer) { + const baseInquirerId = effectiveInquirerId ?? this.getInquirerId(parentInquirer); + return this.createResolutionContext(contextId, inquirer, `${baseInquirerId}:${inquirer.id}`); + } + return resolutionContext; + } + getEffectiveResolutionContext(dependency, resolutionContext, parentInquirer) { + return this.createResolutionContext(resolutionContext.contextId, this.getEffectiveInquirer(dependency, resolutionContext, parentInquirer), this.getEffectiveInquirerId(dependency, resolutionContext, parentInquirer)); + } + hasDenseCtorMetadata(wrapper, inject, metadata) { + if (!metadata) { + return false; + } + // The fast path requires a fully populated metadata array. + // While another request is still registering dependency metadata, + // sparse entries here would feed request-scoped factories `undefined`. + const expectedDepsLength = !(0, shared_utils_1.isNil)(inject) + ? inject.length + : wrapper.metatype + ? this.reflectConstructorParams(wrapper.metatype).length + : 0; + if (metadata.length !== expectedDepsLength) { + return false; + } + for (let index = 0; index < expectedDepsLength; index++) { + if (metadata[index] === undefined) { + return false; + } + } + return true; + } + resolveScopedComponentHost(item, contextId, inquirer, parentInquirer) { + return this.isInquirerRequest(item, parentInquirer) + ? parentInquirer + : this.resolveComponentHost(item.host, item, this.getEffectiveResolutionContext(item, this.createResolutionContext(contextId, inquirer), parentInquirer)); + } + isInquirerRequest(item, parentInquirer) { + return item.isTransient && item.name === inquirer_1.INQUIRER && parentInquirer; + } + isInquirer(param, parentInquirer) { + return param === inquirer_1.INQUIRER && parentInquirer; + } + addDependencyMetadata(keyOrIndex, hostWrapper, instanceWrapper) { + if ((0, shared_utils_1.isSymbol)(keyOrIndex) || (0, shared_utils_1.isString)(keyOrIndex)) { + hostWrapper.addPropertiesMetadata(keyOrIndex, instanceWrapper); + } + else { + hostWrapper.addCtorMetadata(keyOrIndex, instanceWrapper); + } + } + getTokenName(token) { + return (0, shared_utils_1.isFunction)(token) ? token.name : token.toString(); + } + printResolvingDependenciesLog(token, inquirer) { + if (!this.isDebugMode()) { + return; + } + const tokenName = this.getTokenName(token); + const dependentName = (inquirer?.name && inquirer.name.toString?.()) ?? 'unknown'; + const isAlias = dependentName === tokenName; + const messageToPrint = `Resolving dependency ${cli_colors_util_1.clc.cyanBright(tokenName)}${cli_colors_util_1.clc.green(' in the ')}${cli_colors_util_1.clc.yellow(dependentName)}${cli_colors_util_1.clc.green(` provider ${isAlias ? '(alias)' : ''}`)}`; + this.logger.log(messageToPrint); + } + printLookingForProviderLog(token, moduleRef) { + if (!this.isDebugMode()) { + return; + } + const tokenName = this.getTokenName(token); + const moduleRefName = moduleRef?.metatype?.name ?? 'unknown'; + this.logger.log(`Looking for ${cli_colors_util_1.clc.cyanBright(tokenName)}${cli_colors_util_1.clc.green(' in ')}${cli_colors_util_1.clc.magentaBright(moduleRefName)}`); + } + printFoundInModuleLog(token, moduleRef) { + if (!this.isDebugMode()) { + return; + } + const tokenName = this.getTokenName(token); + const moduleRefName = moduleRef?.metatype?.name ?? 'unknown'; + this.logger.log(`Found ${cli_colors_util_1.clc.cyanBright(tokenName)}${cli_colors_util_1.clc.green(' in ')}${cli_colors_util_1.clc.magentaBright(moduleRefName)}`); + } + isDebugMode() { + return !!process.env.NEST_DEBUG; + } + getContextId(contextId, instanceWrapper) { + return contextId.getParent + ? contextId.getParent({ + token: instanceWrapper.token, + isTreeDurable: instanceWrapper.isDependencyTreeDurable(), + }) + : contextId; + } + getNowTimestamp() { + return perf_hooks_1.performance.now(); + } +} +exports.Injector = Injector; diff --git a/node_modules/@nestjs/core/injector/inquirer/index.d.ts b/node_modules/@nestjs/core/injector/inquirer/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cec511a330fc6e1f459c266c34ed0b6d8a2fe11f --- /dev/null +++ b/node_modules/@nestjs/core/injector/inquirer/index.d.ts @@ -0,0 +1 @@ +export * from './inquirer-constants'; diff --git a/node_modules/@nestjs/core/injector/inquirer/index.js b/node_modules/@nestjs/core/injector/inquirer/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cb2d7de11b26a806f187ecde050985a7b6da4ebb --- /dev/null +++ b/node_modules/@nestjs/core/injector/inquirer/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./inquirer-constants"), exports); diff --git a/node_modules/@nestjs/core/injector/inquirer/inquirer-constants.d.ts b/node_modules/@nestjs/core/injector/inquirer/inquirer-constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8812636f7737abc65c040e5ee28f353c8d166c6e --- /dev/null +++ b/node_modules/@nestjs/core/injector/inquirer/inquirer-constants.d.ts @@ -0,0 +1 @@ +export declare const INQUIRER = "INQUIRER"; diff --git a/node_modules/@nestjs/core/injector/inquirer/inquirer-constants.js b/node_modules/@nestjs/core/injector/inquirer/inquirer-constants.js new file mode 100644 index 0000000000000000000000000000000000000000..ba023a10c81df8cf8bbc3df82cda74ab8c7714d8 --- /dev/null +++ b/node_modules/@nestjs/core/injector/inquirer/inquirer-constants.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.INQUIRER = void 0; +exports.INQUIRER = 'INQUIRER'; diff --git a/node_modules/@nestjs/core/injector/inquirer/inquirer-providers.d.ts b/node_modules/@nestjs/core/injector/inquirer/inquirer-providers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a1d98d11aa089c9bb79c88d5a9fd75de0028de3 --- /dev/null +++ b/node_modules/@nestjs/core/injector/inquirer/inquirer-providers.d.ts @@ -0,0 +1,2 @@ +import { Provider } from '@nestjs/common'; +export declare const inquirerProvider: Provider; diff --git a/node_modules/@nestjs/core/injector/inquirer/inquirer-providers.js b/node_modules/@nestjs/core/injector/inquirer/inquirer-providers.js new file mode 100644 index 0000000000000000000000000000000000000000..f70e4eefb13d2ce97c72a75475e99b8097d04831 --- /dev/null +++ b/node_modules/@nestjs/core/injector/inquirer/inquirer-providers.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.inquirerProvider = void 0; +const common_1 = require("@nestjs/common"); +const inquirer_constants_1 = require("./inquirer-constants"); +const noop = () => { }; +exports.inquirerProvider = { + provide: inquirer_constants_1.INQUIRER, + scope: common_1.Scope.TRANSIENT, + useFactory: noop, +}; diff --git a/node_modules/@nestjs/core/injector/instance-links-host.d.ts b/node_modules/@nestjs/core/injector/instance-links-host.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..afcbc7a4b84ba16882e9510958f81e8ea93d4a85 --- /dev/null +++ b/node_modules/@nestjs/core/injector/instance-links-host.d.ts @@ -0,0 +1,22 @@ +import { InjectionToken } from '@nestjs/common'; +import { NestContainer } from './container'; +import { InstanceWrapper } from './instance-wrapper'; +export interface InstanceLink { + token: InjectionToken; + wrapperRef: InstanceWrapper; + collection: Map; + moduleId: string; +} +export declare class InstanceLinksHost { + private readonly container; + private readonly instanceLinks; + constructor(container: NestContainer); + get(token: InjectionToken): InstanceLink; + get(token: InjectionToken, options?: { + moduleId?: string; + each?: boolean; + }): InstanceLink | Array>; + private initialize; + private addLink; + private getInstanceNameByToken; +} diff --git a/node_modules/@nestjs/core/injector/instance-links-host.js b/node_modules/@nestjs/core/injector/instance-links-host.js new file mode 100644 index 0000000000000000000000000000000000000000..6a1b7e4c67b4b9ade54b8ff1a1c7adf486d7ba47 --- /dev/null +++ b/node_modules/@nestjs/core/injector/instance-links-host.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InstanceLinksHost = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const unknown_element_exception_1 = require("../errors/exceptions/unknown-element.exception"); +class InstanceLinksHost { + constructor(container) { + this.container = container; + this.instanceLinks = new Map(); + this.initialize(); + } + get(token, options = {}) { + const instanceLinksForGivenToken = this.instanceLinks.get(token); + if (!instanceLinksForGivenToken) { + throw new unknown_element_exception_1.UnknownElementException(this.getInstanceNameByToken(token)); + } + if (options.each) { + return instanceLinksForGivenToken; + } + const instanceLink = options.moduleId + ? instanceLinksForGivenToken.find(item => item.moduleId === options.moduleId) + : instanceLinksForGivenToken[instanceLinksForGivenToken.length - 1]; + if (!instanceLink) { + throw new unknown_element_exception_1.UnknownElementException(this.getInstanceNameByToken(token)); + } + return instanceLink; + } + initialize() { + const modules = this.container.getModules(); + modules.forEach(moduleRef => { + const { providers, injectables, controllers } = moduleRef; + providers.forEach((wrapper, token) => this.addLink(wrapper, token, moduleRef, 'providers')); + injectables.forEach((wrapper, token) => this.addLink(wrapper, token, moduleRef, 'injectables')); + controllers.forEach((wrapper, token) => this.addLink(wrapper, token, moduleRef, 'controllers')); + }); + } + addLink(wrapper, token, moduleRef, collectionName) { + const instanceLink = { + moduleId: moduleRef.id, + wrapperRef: wrapper, + collection: moduleRef[collectionName], + token, + }; + const existingLinks = this.instanceLinks.get(token); + if (!existingLinks) { + this.instanceLinks.set(token, [instanceLink]); + } + else { + existingLinks.push(instanceLink); + } + } + getInstanceNameByToken(token) { + return (0, shared_utils_1.isFunction)(token) ? token?.name : token; + } +} +exports.InstanceLinksHost = InstanceLinksHost; diff --git a/node_modules/@nestjs/core/injector/instance-loader.d.ts b/node_modules/@nestjs/core/injector/instance-loader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d0a8fe505a4301cf6c8b48ed6c0920aa85f978c3 --- /dev/null +++ b/node_modules/@nestjs/core/injector/instance-loader.d.ts @@ -0,0 +1,23 @@ +import { Logger, LoggerService } from '@nestjs/common'; +import { GraphInspector } from '../inspector/graph-inspector'; +import { NestContainer } from './container'; +import { Injector } from './injector'; +import { Module } from './module'; +export declare class InstanceLoader { + protected readonly container: NestContainer; + protected readonly injector: TInjector; + protected readonly graphInspector: GraphInspector; + private logger; + constructor(container: NestContainer, injector: TInjector, graphInspector: GraphInspector, logger?: LoggerService); + setLogger(logger: Logger): void; + createInstancesOfDependencies(modules?: Map): Promise; + private createPrototypes; + private createInstances; + private createPrototypesOfProviders; + private createInstancesOfProviders; + private createPrototypesOfControllers; + private createInstancesOfControllers; + private createPrototypesOfInjectables; + private createInstancesOfInjectables; + private isModuleWhitelisted; +} diff --git a/node_modules/@nestjs/core/injector/instance-loader.js b/node_modules/@nestjs/core/injector/instance-loader.js new file mode 100644 index 0000000000000000000000000000000000000000..33e149ae354674b9c5e355708612844fca4b514a --- /dev/null +++ b/node_modules/@nestjs/core/injector/instance-loader.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InstanceLoader = void 0; +const common_1 = require("@nestjs/common"); +const messages_1 = require("../helpers/messages"); +const internal_core_module_1 = require("./internal-core-module/internal-core-module"); +class InstanceLoader { + constructor(container, injector, graphInspector, logger = new common_1.Logger(InstanceLoader.name, { + timestamp: true, + })) { + this.container = container; + this.injector = injector; + this.graphInspector = graphInspector; + this.logger = logger; + } + setLogger(logger) { + this.logger = logger; + } + async createInstancesOfDependencies(modules = this.container.getModules()) { + this.createPrototypes(modules); + try { + await this.createInstances(modules); + } + catch (err) { + this.graphInspector.inspectModules(modules); + this.graphInspector.registerPartial(err); + throw err; + } + this.graphInspector.inspectModules(modules); + } + createPrototypes(modules) { + modules.forEach(moduleRef => { + this.createPrototypesOfProviders(moduleRef); + this.createPrototypesOfInjectables(moduleRef); + this.createPrototypesOfControllers(moduleRef); + }); + } + async createInstances(modules) { + await Promise.all([...modules.values()].map(async (moduleRef) => { + await this.createInstancesOfProviders(moduleRef); + await this.createInstancesOfInjectables(moduleRef); + await this.createInstancesOfControllers(moduleRef); + const { name } = moduleRef; + this.isModuleWhitelisted(name) && + this.logger.log((0, messages_1.MODULE_INIT_MESSAGE) `${name}`); + })); + } + createPrototypesOfProviders(moduleRef) { + const { providers } = moduleRef; + providers.forEach(wrapper => this.injector.loadPrototype(wrapper, providers)); + } + async createInstancesOfProviders(moduleRef) { + const { providers } = moduleRef; + const wrappers = [...providers.values()]; + await Promise.all(wrappers.map(async (item) => { + await this.injector.loadProvider(item, moduleRef); + this.graphInspector.inspectInstanceWrapper(item, moduleRef); + })); + } + createPrototypesOfControllers(moduleRef) { + const { controllers } = moduleRef; + controllers.forEach(wrapper => this.injector.loadPrototype(wrapper, controllers)); + } + async createInstancesOfControllers(moduleRef) { + const { controllers } = moduleRef; + const wrappers = [...controllers.values()]; + await Promise.all(wrappers.map(async (item) => { + await this.injector.loadController(item, moduleRef); + this.graphInspector.inspectInstanceWrapper(item, moduleRef); + })); + } + createPrototypesOfInjectables(moduleRef) { + const { injectables } = moduleRef; + injectables.forEach(wrapper => this.injector.loadPrototype(wrapper, injectables)); + } + async createInstancesOfInjectables(moduleRef) { + const { injectables } = moduleRef; + const wrappers = [...injectables.values()]; + await Promise.all(wrappers.map(async (item) => { + await this.injector.loadInjectable(item, moduleRef); + this.graphInspector.inspectInstanceWrapper(item, moduleRef); + })); + } + isModuleWhitelisted(name) { + return name !== internal_core_module_1.InternalCoreModule.name; + } +} +exports.InstanceLoader = InstanceLoader; diff --git a/node_modules/@nestjs/core/injector/instance-wrapper.d.ts b/node_modules/@nestjs/core/injector/instance-wrapper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7b5485b902123722bddd9fd703250f3a4a605d4e --- /dev/null +++ b/node_modules/@nestjs/core/injector/instance-wrapper.d.ts @@ -0,0 +1,101 @@ +import { Provider, Scope, Type } from '@nestjs/common'; +import { EnhancerSubtype } from '@nestjs/common/constants'; +import { FactoryProvider, InjectionToken } from '@nestjs/common/interfaces'; +import { Module } from './module'; +import { SettlementSignal } from './settlement-signal'; +export declare const INSTANCE_METADATA_SYMBOL: unique symbol; +export declare const INSTANCE_ID_SYMBOL: unique symbol; +export interface HostComponentInfo { + /** + * Injection token (or class reference) + */ + token: InjectionToken; + /** + * Flag that indicates whether DI subtree is durable + */ + isTreeDurable: boolean; +} +export interface ContextId { + readonly id: number; + payload?: unknown; + getParent?(info: HostComponentInfo): ContextId; +} +export interface InstancePerContext { + instance: T; + isResolved?: boolean; + isPending?: boolean; + donePromise?: Promise; + isConstructorCalled?: boolean; +} +export interface PropertyMetadata { + key: symbol | string; + wrapper: InstanceWrapper; +} +export declare class InstanceWrapper { + readonly name: any; + readonly token: InjectionToken; + readonly async?: boolean; + readonly host?: Module; + readonly isAlias: boolean; + readonly subtype?: EnhancerSubtype; + scope?: Scope; + metatype: Type | Function | null; + inject?: FactoryProvider['inject'] | null; + forwardRef?: boolean; + durable?: boolean; + initTime?: number; + settlementSignal?: SettlementSignal; + private static logger; + private readonly values; + private readonly [INSTANCE_METADATA_SYMBOL]; + private readonly [INSTANCE_ID_SYMBOL]; + private transientMap?; + private isTreeStatic; + private isTreeDurable; + /** + * The root inquirer reference. Present only if child instance wrapper + * is transient and has a parent inquirer. + */ + private rootInquirer; + constructor(metadata?: Partial> & Partial>); + get id(): string; + set instance(value: T); + get instance(): T; + get isNotMetatype(): boolean; + get isFactory(): boolean; + get isTransient(): boolean; + getInstanceByContextId(contextId: ContextId, inquirerId?: string): InstancePerContext; + getInstanceByInquirerId(contextId: ContextId, inquirerId: string): InstancePerContext; + setInstanceByContextId(contextId: ContextId, value: InstancePerContext, inquirerId?: string): void; + setInstanceByInquirerId(contextId: ContextId, inquirerId: string, value: InstancePerContext): void; + removeInstanceByContextId(contextId: ContextId, inquirerId?: string): void; + removeInstanceByInquirerId(contextId: ContextId, inquirerId: string): void; + addCtorMetadata(index: number, wrapper: InstanceWrapper): void; + getCtorMetadata(): InstanceWrapper[]; + addPropertiesMetadata(key: symbol | string, wrapper: InstanceWrapper): void; + getPropertiesMetadata(): PropertyMetadata[]; + addEnhancerMetadata(wrapper: InstanceWrapper): void; + getEnhancersMetadata(): InstanceWrapper[]; + isDependencyTreeDurable(lookupRegistry?: string[]): boolean; + introspectDepsAttribute(callback: (collection: InstanceWrapper[], lookupRegistry: string[]) => boolean, lookupRegistry?: string[]): boolean; + isDependencyTreeStatic(lookupRegistry?: string[]): boolean; + cloneStaticInstance(contextId: ContextId): InstancePerContext; + cloneTransientInstance(contextId: ContextId, inquirerId: string): InstancePerContext; + createPrototype(contextId: ContextId): any; + isInRequestScope(contextId: ContextId, inquirer?: InstanceWrapper): boolean; + isLazyTransient(contextId: ContextId, inquirer: InstanceWrapper | undefined): boolean; + isExplicitlyRequested(contextId: ContextId, inquirer?: InstanceWrapper): boolean; + isStatic(contextId: ContextId, inquirer: InstanceWrapper | undefined): boolean; + attachRootInquirer(inquirer: InstanceWrapper): void; + getRootInquirer(): InstanceWrapper | undefined; + getStaticTransientInstances(): (InstancePerContext | undefined)[]; + mergeWith(provider: Provider): void; + private isNewable; + private registerDependencyTreeParent; + private resetDependencyTreeState; + private initialize; + private printIntrospectedAsRequestScoped; + private printIntrospectedAsDurable; + private isDebugMode; + private generateUuid; +} diff --git a/node_modules/@nestjs/core/injector/instance-wrapper.js b/node_modules/@nestjs/core/injector/instance-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..9fc73c3f1606fa290aafced5bf4a9436b023a728 --- /dev/null +++ b/node_modules/@nestjs/core/injector/instance-wrapper.js @@ -0,0 +1,375 @@ +"use strict"; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InstanceWrapper = exports.INSTANCE_ID_SYMBOL = exports.INSTANCE_METADATA_SYMBOL = void 0; +const common_1 = require("@nestjs/common"); +const cli_colors_util_1 = require("@nestjs/common/utils/cli-colors.util"); +const random_string_generator_util_1 = require("@nestjs/common/utils/random-string-generator.util"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const uuid_factory_1 = require("../inspector/uuid-factory"); +const constants_1 = require("./constants"); +const provider_classifier_1 = require("./helpers/provider-classifier"); +exports.INSTANCE_METADATA_SYMBOL = Symbol.for('instance_metadata:cache'); +exports.INSTANCE_ID_SYMBOL = Symbol.for('instance_metadata:id'); +const dependencyTreeParents = new WeakMap(); +class InstanceWrapper { + constructor(metadata = {}) { + this.isAlias = false; + this.scope = common_1.Scope.DEFAULT; + this.values = new WeakMap(); + this[_a] = {}; + this.initialize(metadata); + this[exports.INSTANCE_ID_SYMBOL] = + metadata[exports.INSTANCE_ID_SYMBOL] ?? this.generateUuid(); + } + get id() { + return this[exports.INSTANCE_ID_SYMBOL]; + } + set instance(value) { + this.values.set(constants_1.STATIC_CONTEXT, { instance: value }); + } + get instance() { + const instancePerContext = this.getInstanceByContextId(constants_1.STATIC_CONTEXT); + return instancePerContext.instance; + } + get isNotMetatype() { + return !this.metatype || this.isFactory; + } + get isFactory() { + return !!this.metatype && !(0, shared_utils_1.isNil)(this.inject); + } + get isTransient() { + return this.scope === common_1.Scope.TRANSIENT; + } + getInstanceByContextId(contextId, inquirerId) { + if (this.scope === common_1.Scope.TRANSIENT && inquirerId) { + return this.getInstanceByInquirerId(contextId, inquirerId); + } + const instancePerContext = this.values.get(contextId); + return instancePerContext + ? instancePerContext + : contextId !== constants_1.STATIC_CONTEXT + ? this.cloneStaticInstance(contextId) + : { + instance: null, + isResolved: true, + isPending: false, + }; + } + getInstanceByInquirerId(contextId, inquirerId) { + let collectionPerContext = this.transientMap.get(inquirerId); + if (!collectionPerContext) { + collectionPerContext = new WeakMap(); + this.transientMap.set(inquirerId, collectionPerContext); + } + const instancePerContext = collectionPerContext.get(contextId); + return instancePerContext + ? instancePerContext + : this.cloneTransientInstance(contextId, inquirerId); + } + setInstanceByContextId(contextId, value, inquirerId) { + if (this.scope === common_1.Scope.TRANSIENT && inquirerId) { + return this.setInstanceByInquirerId(contextId, inquirerId, value); + } + this.values.set(contextId, value); + } + setInstanceByInquirerId(contextId, inquirerId, value) { + let collection = this.transientMap.get(inquirerId); + if (!collection) { + collection = new WeakMap(); + this.transientMap.set(inquirerId, collection); + } + collection.set(contextId, value); + } + removeInstanceByContextId(contextId, inquirerId) { + if (this.scope === common_1.Scope.TRANSIENT && inquirerId) { + return this.removeInstanceByInquirerId(contextId, inquirerId); + } + this.values.delete(contextId); + } + removeInstanceByInquirerId(contextId, inquirerId) { + const collection = this.transientMap.get(inquirerId); + if (!collection) { + return; + } + collection.delete(contextId); + } + addCtorMetadata(index, wrapper) { + if (!this[exports.INSTANCE_METADATA_SYMBOL].dependencies) { + this[exports.INSTANCE_METADATA_SYMBOL].dependencies = []; + } + this[exports.INSTANCE_METADATA_SYMBOL].dependencies[index] = wrapper; + this.registerDependencyTreeParent(wrapper); + this.resetDependencyTreeState(); + } + getCtorMetadata() { + return this[exports.INSTANCE_METADATA_SYMBOL].dependencies; + } + addPropertiesMetadata(key, wrapper) { + if (!this[exports.INSTANCE_METADATA_SYMBOL].properties) { + this[exports.INSTANCE_METADATA_SYMBOL].properties = []; + } + this[exports.INSTANCE_METADATA_SYMBOL].properties.push({ + key, + wrapper, + }); + this.registerDependencyTreeParent(wrapper); + this.resetDependencyTreeState(); + } + getPropertiesMetadata() { + return this[exports.INSTANCE_METADATA_SYMBOL].properties; + } + addEnhancerMetadata(wrapper) { + if (!this[exports.INSTANCE_METADATA_SYMBOL].enhancers) { + this[exports.INSTANCE_METADATA_SYMBOL].enhancers = []; + } + this[exports.INSTANCE_METADATA_SYMBOL].enhancers.push(wrapper); + this.registerDependencyTreeParent(wrapper); + this.resetDependencyTreeState(); + } + getEnhancersMetadata() { + return this[exports.INSTANCE_METADATA_SYMBOL].enhancers; + } + isDependencyTreeDurable(lookupRegistry = []) { + if (!(0, shared_utils_1.isUndefined)(this.isTreeDurable)) { + return this.isTreeDurable; + } + if (this.scope === common_1.Scope.REQUEST) { + this.isTreeDurable = this.durable === undefined ? false : this.durable; + if (this.isTreeDurable) { + this.printIntrospectedAsDurable(); + } + return this.isTreeDurable; + } + const isStatic = this.isDependencyTreeStatic(); + if (isStatic) { + return false; + } + const isTreeNonDurable = this.introspectDepsAttribute((collection, registry) => collection.some((item) => !item.isDependencyTreeStatic() && + !item.isDependencyTreeDurable(registry)), lookupRegistry); + this.isTreeDurable = !isTreeNonDurable; + if (this.isTreeDurable) { + this.printIntrospectedAsDurable(); + } + return this.isTreeDurable; + } + introspectDepsAttribute(callback, lookupRegistry = []) { + if (lookupRegistry.includes(this[exports.INSTANCE_ID_SYMBOL])) { + return false; + } + lookupRegistry = lookupRegistry.concat(this[exports.INSTANCE_ID_SYMBOL]); + const { dependencies, properties, enhancers } = this[exports.INSTANCE_METADATA_SYMBOL]; + let introspectionResult = dependencies + ? callback(dependencies, lookupRegistry) + : false; + if (introspectionResult || !(properties || enhancers)) { + return introspectionResult; + } + introspectionResult = properties + ? callback(properties.map(item => item.wrapper), lookupRegistry) + : false; + if (introspectionResult || !enhancers) { + return introspectionResult; + } + return enhancers ? callback(enhancers, lookupRegistry) : false; + } + isDependencyTreeStatic(lookupRegistry = []) { + if (!(0, shared_utils_1.isUndefined)(this.isTreeStatic)) { + return this.isTreeStatic; + } + if (this.scope === common_1.Scope.REQUEST) { + this.isTreeStatic = false; + this.printIntrospectedAsRequestScoped(); + return this.isTreeStatic; + } + this.isTreeStatic = !this.introspectDepsAttribute((collection, registry) => collection.some((item) => !item.isDependencyTreeStatic(registry)), lookupRegistry); + if (!this.isTreeStatic) { + this.printIntrospectedAsRequestScoped(); + } + return this.isTreeStatic; + } + cloneStaticInstance(contextId) { + const staticInstance = this.getInstanceByContextId(constants_1.STATIC_CONTEXT); + if (this.isDependencyTreeStatic()) { + return staticInstance; + } + const instancePerContext = { + ...staticInstance, + instance: undefined, + isResolved: false, + isPending: false, + }; + if (this.isNewable()) { + instancePerContext.instance = Object.create(this.metatype.prototype); + } + this.setInstanceByContextId(contextId, instancePerContext); + return instancePerContext; + } + cloneTransientInstance(contextId, inquirerId) { + const staticInstance = this.getInstanceByContextId(constants_1.STATIC_CONTEXT); + const instancePerContext = { + ...staticInstance, + instance: undefined, + isResolved: false, + isPending: false, + }; + if (this.isNewable()) { + instancePerContext.instance = Object.create(this.metatype.prototype); + } + this.setInstanceByInquirerId(contextId, inquirerId, instancePerContext); + return instancePerContext; + } + createPrototype(contextId) { + const host = this.getInstanceByContextId(contextId); + if (!this.isNewable() || host.isResolved) { + return; + } + return Object.create(this.metatype.prototype); + } + isInRequestScope(contextId, inquirer) { + const isDependencyTreeStatic = this.isDependencyTreeStatic(); + return (!isDependencyTreeStatic && + contextId !== constants_1.STATIC_CONTEXT && + (!this.isTransient || (this.isTransient && !!inquirer))); + } + isLazyTransient(contextId, inquirer) { + const isInquirerRequestScoped = !!(inquirer && !inquirer.isDependencyTreeStatic()); + return (this.isDependencyTreeStatic() && + contextId !== constants_1.STATIC_CONTEXT && + this.isTransient && + isInquirerRequestScoped); + } + isExplicitlyRequested(contextId, inquirer) { + const isSelfRequested = inquirer === this; + return (this.isDependencyTreeStatic() && + contextId !== constants_1.STATIC_CONTEXT && + (isSelfRequested || !!(inquirer && inquirer.scope === common_1.Scope.TRANSIENT))); + } + isStatic(contextId, inquirer) { + if (!this.isDependencyTreeStatic() || contextId !== constants_1.STATIC_CONTEXT) { + return false; + } + // Non-transient provider in static context + if (!this.isTransient) { + return true; + } + const isInquirerRequestScoped = inquirer && !inquirer.isDependencyTreeStatic(); + const isStaticTransient = this.isTransient && !isInquirerRequestScoped; + const rootInquirer = inquirer?.getRootInquirer(); + // Transient provider inquired by non-transient (e.g., DEFAULT -> TRANSIENT) + if (isStaticTransient && inquirer && !inquirer.isTransient) { + return true; + } + // Nested transient with non-transient root (e.g., DEFAULT -> TRANSIENT -> TRANSIENT) + if (isStaticTransient && rootInquirer && !rootInquirer.isTransient) { + return true; + } + // Nested transient during initial instantiation (rootInquirer not yet set) + if (isStaticTransient && inquirer?.isTransient && !rootInquirer) { + return true; + } + return false; + } + attachRootInquirer(inquirer) { + if (!this.isTransient) { + // Only attach root inquirer if the instance wrapper is transient + return; + } + this.rootInquirer = inquirer.getRootInquirer() ?? inquirer; + } + getRootInquirer() { + return this.rootInquirer; + } + getStaticTransientInstances() { + if (!this.transientMap) { + return []; + } + const instances = [...this.transientMap.values()]; + return (0, iterare_1.iterate)(instances) + .map(item => item.get(constants_1.STATIC_CONTEXT)) + .filter(item => { + // Only return items where constructor has been actually called + // This prevents calling lifecycle hooks on non-instantiated transient services + return !!(item && item.isConstructorCalled); + }) + .toArray(); + } + mergeWith(provider) { + if ((0, provider_classifier_1.isValueProvider)(provider)) { + this.metatype = null; + this.inject = null; + this.scope = common_1.Scope.DEFAULT; + this.setInstanceByContextId(constants_1.STATIC_CONTEXT, { + instance: provider.useValue, + isResolved: true, + isPending: false, + }); + } + else if ((0, provider_classifier_1.isClassProvider)(provider)) { + this.inject = null; + this.metatype = provider.useClass; + } + else if ((0, provider_classifier_1.isFactoryProvider)(provider)) { + this.metatype = provider.useFactory; + this.inject = provider.inject || []; + } + } + isNewable() { + return (0, shared_utils_1.isNil)(this.inject) && this.metatype && this.metatype.prototype; + } + registerDependencyTreeParent(wrapper) { + if (wrapper instanceof InstanceWrapper) { + const parents = dependencyTreeParents.get(wrapper) ?? new Set(); + parents.add(this); + dependencyTreeParents.set(wrapper, parents); + } + } + resetDependencyTreeState(lookupRegistry = new Set()) { + if (lookupRegistry.has(this[exports.INSTANCE_ID_SYMBOL])) { + return; + } + lookupRegistry.add(this[exports.INSTANCE_ID_SYMBOL]); + this.isTreeStatic = undefined; + this.isTreeDurable = undefined; + dependencyTreeParents + .get(this) + ?.forEach(parent => parent.resetDependencyTreeState(lookupRegistry)); + } + initialize(metadata) { + const { instance, isResolved, ...wrapperPartial } = metadata; + Object.assign(this, wrapperPartial); + this.setInstanceByContextId(constants_1.STATIC_CONTEXT, { + instance: instance, + isResolved, + }); + this.scope === common_1.Scope.TRANSIENT && (this.transientMap = new Map()); + } + printIntrospectedAsRequestScoped() { + if (!this.isDebugMode() || this.name === 'REQUEST') { + return; + } + if ((0, shared_utils_1.isString)(this.name)) { + InstanceWrapper.logger.log(`${cli_colors_util_1.clc.cyanBright(this.name)}${cli_colors_util_1.clc.green(' introspected as ')}${cli_colors_util_1.clc.magentaBright('request-scoped')}`); + } + } + printIntrospectedAsDurable() { + if (!this.isDebugMode()) { + return; + } + if ((0, shared_utils_1.isString)(this.name)) { + InstanceWrapper.logger.log(`${cli_colors_util_1.clc.cyanBright(this.name)}${cli_colors_util_1.clc.green(' introspected as ')}${cli_colors_util_1.clc.magentaBright('durable')}`); + } + } + isDebugMode() { + return !!process.env.NEST_DEBUG; + } + generateUuid() { + let key = this.name?.toString() ?? this.token?.toString(); + key += this.host?.name ?? ''; + return key ? uuid_factory_1.UuidFactory.get(key) : (0, random_string_generator_util_1.randomStringGenerator)(); + } +} +exports.InstanceWrapper = InstanceWrapper; +_a = exports.INSTANCE_METADATA_SYMBOL; +InstanceWrapper.logger = new common_1.Logger(InstanceWrapper.name); diff --git a/node_modules/@nestjs/core/injector/internal-core-module/index.d.ts b/node_modules/@nestjs/core/injector/internal-core-module/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a863c2132aee01484a60c61184b0d0b1539d6422 --- /dev/null +++ b/node_modules/@nestjs/core/injector/internal-core-module/index.d.ts @@ -0,0 +1 @@ +export * from './internal-core-module'; diff --git a/node_modules/@nestjs/core/injector/internal-core-module/index.js b/node_modules/@nestjs/core/injector/internal-core-module/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6f75711c7c0f8452aaf39b4706906ff07c69671f --- /dev/null +++ b/node_modules/@nestjs/core/injector/internal-core-module/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./internal-core-module"), exports); diff --git a/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module-factory.d.ts b/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..18f50158f020b750c10b5dab92a254217bbfa183 --- /dev/null +++ b/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module-factory.d.ts @@ -0,0 +1,9 @@ +import { HttpAdapterHost } from '../../helpers/http-adapter-host'; +import { GraphInspector } from '../../inspector/graph-inspector'; +import { ModuleOverride } from '../../interfaces/module-override.interface'; +import { DependenciesScanner } from '../../scanner'; +import { ModuleCompiler } from '../compiler'; +import { NestContainer } from '../container'; +export declare class InternalCoreModuleFactory { + static create(container: NestContainer, scanner: DependenciesScanner, moduleCompiler: ModuleCompiler, httpAdapterHost: HttpAdapterHost, graphInspector: GraphInspector, moduleOverrides?: ModuleOverride[]): import("@nestjs/common").DynamicModule; +} diff --git a/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module-factory.js b/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..17765e56e7e9a25f73b62aa11639998ebfa31735 --- /dev/null +++ b/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module-factory.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InternalCoreModuleFactory = void 0; +const common_1 = require("@nestjs/common"); +const external_context_creator_1 = require("../../helpers/external-context-creator"); +const http_adapter_host_1 = require("../../helpers/http-adapter-host"); +const initialize_on_preview_allowlist_1 = require("../../inspector/initialize-on-preview.allowlist"); +const serialized_graph_1 = require("../../inspector/serialized-graph"); +const injector_1 = require("../injector"); +const instance_loader_1 = require("../instance-loader"); +const lazy_module_loader_1 = require("../lazy-module-loader/lazy-module-loader"); +const modules_container_1 = require("../modules-container"); +const internal_core_module_1 = require("./internal-core-module"); +class InternalCoreModuleFactory { + static create(container, scanner, moduleCompiler, httpAdapterHost, graphInspector, moduleOverrides) { + const lazyModuleLoaderFactory = () => { + const logger = new common_1.Logger(lazy_module_loader_1.LazyModuleLoader.name, { + timestamp: false, + }); + const injector = new injector_1.Injector({ + preview: container.contextOptions?.preview, + instanceDecorator: container.contextOptions?.instrument?.instanceDecorator, + }); + const instanceLoader = new instance_loader_1.InstanceLoader(container, injector, graphInspector, logger); + return new lazy_module_loader_1.LazyModuleLoader(scanner, instanceLoader, moduleCompiler, container.getModules(), moduleOverrides); + }; + initialize_on_preview_allowlist_1.InitializeOnPreviewAllowlist.add(internal_core_module_1.InternalCoreModule); + return internal_core_module_1.InternalCoreModule.register([ + { + provide: external_context_creator_1.ExternalContextCreator, + useFactory: () => external_context_creator_1.ExternalContextCreator.fromContainer(container), + }, + { + provide: modules_container_1.ModulesContainer, + useFactory: () => container.getModules(), + }, + { + provide: http_adapter_host_1.HttpAdapterHost, + useFactory: () => httpAdapterHost, + }, + { + provide: lazy_module_loader_1.LazyModuleLoader, + useFactory: lazyModuleLoaderFactory, + }, + { + provide: serialized_graph_1.SerializedGraph, + useFactory: () => container.serializedGraph, + }, + ]); + } +} +exports.InternalCoreModuleFactory = InternalCoreModuleFactory; diff --git a/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module.d.ts b/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39f4d50e62eca719a19de2d5ef5370a9bf806d36 --- /dev/null +++ b/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module.d.ts @@ -0,0 +1,5 @@ +import { DynamicModule } from '@nestjs/common'; +import { ExistingProvider, FactoryProvider, ValueProvider } from '@nestjs/common/interfaces'; +export declare class InternalCoreModule { + static register(providers: Array): DynamicModule; +} diff --git a/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module.js b/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module.js new file mode 100644 index 0000000000000000000000000000000000000000..e8eda19aeb5e935ef47de10b0d596b498d185f46 --- /dev/null +++ b/node_modules/@nestjs/core/injector/internal-core-module/internal-core-module.js @@ -0,0 +1,40 @@ +"use strict"; +var InternalCoreModule_1; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InternalCoreModule = void 0; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const request_providers_1 = require("../../router/request/request-providers"); +const services_1 = require("../../services"); +const inquirer_providers_1 = require("../inquirer/inquirer-providers"); +const ReflectorAliasProvider = { + provide: services_1.Reflector.name, + useExisting: services_1.Reflector, +}; +let InternalCoreModule = InternalCoreModule_1 = class InternalCoreModule { + static register(providers) { + return { + module: InternalCoreModule_1, + providers: [...providers], + exports: [...providers.map(item => item.provide)], + }; + } +}; +exports.InternalCoreModule = InternalCoreModule; +exports.InternalCoreModule = InternalCoreModule = InternalCoreModule_1 = tslib_1.__decorate([ + (0, common_1.Global)(), + (0, common_1.Module)({ + providers: [ + services_1.Reflector, + ReflectorAliasProvider, + request_providers_1.requestProvider, + inquirer_providers_1.inquirerProvider, + ], + exports: [ + services_1.Reflector, + ReflectorAliasProvider, + request_providers_1.requestProvider, + inquirer_providers_1.inquirerProvider, + ], + }) +], InternalCoreModule); diff --git a/node_modules/@nestjs/core/injector/internal-providers-storage.d.ts b/node_modules/@nestjs/core/injector/internal-providers-storage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cba56097c16cede64ebe8a1b79f2ccb821a41209 --- /dev/null +++ b/node_modules/@nestjs/core/injector/internal-providers-storage.d.ts @@ -0,0 +1,9 @@ +import { AbstractHttpAdapter } from '../adapters'; +import { HttpAdapterHost } from '../helpers/http-adapter-host'; +export declare class InternalProvidersStorage { + private readonly _httpAdapterHost; + private _httpAdapter; + get httpAdapterHost(): HttpAdapterHost; + get httpAdapter(): AbstractHttpAdapter; + set httpAdapter(httpAdapter: AbstractHttpAdapter); +} diff --git a/node_modules/@nestjs/core/injector/internal-providers-storage.js b/node_modules/@nestjs/core/injector/internal-providers-storage.js new file mode 100644 index 0000000000000000000000000000000000000000..c9dbdacf5890c319714929a6026f5a2d69cad483 --- /dev/null +++ b/node_modules/@nestjs/core/injector/internal-providers-storage.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InternalProvidersStorage = void 0; +const http_adapter_host_1 = require("../helpers/http-adapter-host"); +class InternalProvidersStorage { + constructor() { + this._httpAdapterHost = new http_adapter_host_1.HttpAdapterHost(); + } + get httpAdapterHost() { + return this._httpAdapterHost; + } + get httpAdapter() { + return this._httpAdapter; + } + set httpAdapter(httpAdapter) { + this._httpAdapter = httpAdapter; + } +} +exports.InternalProvidersStorage = InternalProvidersStorage; diff --git a/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader-options.interface.d.ts b/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc2d3d5e1c740526bc3fbf2d860efea248468ebc --- /dev/null +++ b/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader-options.interface.d.ts @@ -0,0 +1,6 @@ +export interface LazyModuleLoaderLoadOptions { + /** + * If `false`, no logs will be generated when loading some module lazily. + */ + logger?: boolean; +} diff --git a/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader-options.interface.js b/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader.d.ts b/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..72590d86eb29aa4b9be30aa1009a488dc57bcc54 --- /dev/null +++ b/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader.d.ts @@ -0,0 +1,20 @@ +import { DynamicModule, Type } from '@nestjs/common'; +import { ModuleOverride } from '../../interfaces/module-override.interface'; +import { DependenciesScanner } from '../../scanner'; +import { ModuleCompiler } from '../compiler'; +import { InstanceLoader } from '../instance-loader'; +import { ModuleRef } from '../module-ref'; +import { ModulesContainer } from '../modules-container'; +import { LazyModuleLoaderLoadOptions } from './lazy-module-loader-options.interface'; +export declare class LazyModuleLoader { + private readonly dependenciesScanner; + private readonly instanceLoader; + private readonly moduleCompiler; + private readonly modulesContainer; + private readonly moduleOverrides?; + constructor(dependenciesScanner: DependenciesScanner, instanceLoader: InstanceLoader, moduleCompiler: ModuleCompiler, modulesContainer: ModulesContainer, moduleOverrides?: ModuleOverride[] | undefined); + load(loaderFn: () => Promise | DynamicModule> | Type | DynamicModule, loadOpts?: LazyModuleLoaderLoadOptions): Promise; + private registerLoggerConfiguration; + private createLazyModulesContainer; + private getTargetModuleRef; +} diff --git a/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader.js b/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader.js new file mode 100644 index 0000000000000000000000000000000000000000..f6f52e8c0c07666ac982f3eb2a1f837c1ecdf37c --- /dev/null +++ b/node_modules/@nestjs/core/injector/lazy-module-loader/lazy-module-loader.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LazyModuleLoader = void 0; +const silent_logger_1 = require("../helpers/silent-logger"); +const module_ref_1 = require("../module-ref"); +class LazyModuleLoader { + constructor(dependenciesScanner, instanceLoader, moduleCompiler, modulesContainer, moduleOverrides) { + this.dependenciesScanner = dependenciesScanner; + this.instanceLoader = instanceLoader; + this.moduleCompiler = moduleCompiler; + this.modulesContainer = modulesContainer; + this.moduleOverrides = moduleOverrides; + } + async load(loaderFn, loadOpts) { + this.registerLoggerConfiguration(loadOpts); + const moduleClassOrDynamicDefinition = await loaderFn(); + const moduleInstances = await this.dependenciesScanner.scanForModules({ + moduleDefinition: moduleClassOrDynamicDefinition, + overrides: this.moduleOverrides, + lazy: true, + }); + if (moduleInstances.length === 0) { + // The module has been loaded already. In this case, we must + // retrieve a module reference from the existing container. + const { token } = await this.moduleCompiler.compile(moduleClassOrDynamicDefinition); + const moduleInstance = this.modulesContainer.get(token); + return moduleInstance && this.getTargetModuleRef(moduleInstance); + } + const lazyModulesContainer = this.createLazyModulesContainer(moduleInstances); + await this.dependenciesScanner.scanModulesForDependencies(lazyModulesContainer); + await this.instanceLoader.createInstancesOfDependencies(lazyModulesContainer); + const [targetModule] = moduleInstances; + return this.getTargetModuleRef(targetModule); + } + registerLoggerConfiguration(loadOpts) { + if (loadOpts?.logger === false) { + this.instanceLoader.setLogger(new silent_logger_1.SilentLogger()); + } + } + createLazyModulesContainer(moduleInstances) { + moduleInstances = Array.from(new Set(moduleInstances)); + return new Map(moduleInstances.map(ref => [ref.token, ref])); + } + getTargetModuleRef(moduleInstance) { + const moduleRefInstanceWrapper = moduleInstance.getProviderByKey(module_ref_1.ModuleRef); + return moduleRefInstanceWrapper.instance; + } +} +exports.LazyModuleLoader = LazyModuleLoader; diff --git a/node_modules/@nestjs/core/injector/module-ref.d.ts b/node_modules/@nestjs/core/injector/module-ref.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b846f078bcad33fe30243a6373eaaf25f7ac2b2a --- /dev/null +++ b/node_modules/@nestjs/core/injector/module-ref.d.ts @@ -0,0 +1,106 @@ +import { IntrospectionResult, Type } from '@nestjs/common'; +import { AbstractInstanceResolver } from './abstract-instance-resolver'; +import { NestContainer } from './container'; +import { Injector } from './injector'; +import { InstanceLinksHost } from './instance-links-host'; +import { ContextId } from './instance-wrapper'; +import { Module } from './module'; +export interface ModuleRefGetOrResolveOpts { + /** + * If enabled, lookup will only be performed in the host module. + * @default true + */ + strict?: boolean; + /** + * If enabled, instead of returning a first instance registered under a given token, + * a list of instances will be returned. + * @default false + */ + each?: boolean; +} +export declare abstract class ModuleRef extends AbstractInstanceResolver { + protected readonly container: NestContainer; + protected readonly injector: Injector; + private _instanceLinksHost; + protected get instanceLinksHost(): InstanceLinksHost; + constructor(container: NestContainer); + /** + * Retrieves an instance of either injectable or controller, otherwise, throws exception. + * @returns {TResult} + */ + abstract get(typeOrToken: Type | Function | string | symbol): TResult; + /** + * Retrieves an instance of either injectable or controller, otherwise, throws exception. + * @returns {TResult} + */ + abstract get(typeOrToken: Type | Function | string | symbol, options: { + /** + * If enabled, lookup will only be performed in the host module. + * @default true + */ + strict?: boolean; + /** This indicates that only the first instance registered will be returned. */ + each?: undefined | false; + }): TResult; + /** + * Retrieves a list of instances of either injectables or controllers, otherwise, throws exception. + * @returns {Array} + */ + abstract get(typeOrToken: Type | Function | string | symbol, options: { + /** + * If enabled, lookup will only be performed in the host module. + * @default true + */ + strict?: boolean; + /** This indicates that a list of instances will be returned. */ + each: true; + }): Array; + /** + * Retrieves an instance (or a list of instances) of either injectable or controller, otherwise, throws exception. + * @returns {TResult | Array} + */ + abstract get(typeOrToken: Type | Function | string | symbol, options?: ModuleRefGetOrResolveOpts): TResult | Array; + /** + * Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception. + * @returns {Array} + */ + abstract resolve(typeOrToken: Type | Function | string | symbol): Promise; + /** + * Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception. + * @returns {Array} + */ + abstract resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }): Promise; + /** + * Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception. + * @returns {Array} + */ + abstract resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }, options?: { + strict?: boolean; + each?: undefined | false; + }): Promise; + /** + * Resolves transient or request-scoped instances of either injectables or controllers, otherwise, throws exception. + * @returns {Array} + */ + abstract resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }, options?: { + strict?: boolean; + each: true; + }): Promise>; + /** + * Resolves transient or request-scoped instance (or a list of instances) of either injectable or controller, otherwise, throws exception. + * @returns {Promise>} + */ + abstract resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }, options?: ModuleRefGetOrResolveOpts): Promise>; + abstract create(type: Type, contextId?: ContextId): Promise; + introspect(token: Type | string | symbol): IntrospectionResult; + registerRequestByContextId(request: T, contextId: ContextId): void; + protected instantiateClass(type: Type, moduleRef: Module, contextId?: ContextId): Promise; +} diff --git a/node_modules/@nestjs/core/injector/module-ref.js b/node_modules/@nestjs/core/injector/module-ref.js new file mode 100644 index 0000000000000000000000000000000000000000..d41b04876f52ff7a50784c7137be1bccdf56707f --- /dev/null +++ b/node_modules/@nestjs/core/injector/module-ref.js @@ -0,0 +1,81 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ModuleRef = void 0; +const common_1 = require("@nestjs/common"); +const get_class_scope_1 = require("../helpers/get-class-scope"); +const is_durable_1 = require("../helpers/is-durable"); +const abstract_instance_resolver_1 = require("./abstract-instance-resolver"); +const constants_1 = require("./constants"); +const injector_1 = require("./injector"); +const instance_links_host_1 = require("./instance-links-host"); +const instance_wrapper_1 = require("./instance-wrapper"); +class ModuleRef extends abstract_instance_resolver_1.AbstractInstanceResolver { + get instanceLinksHost() { + if (!this._instanceLinksHost) { + this._instanceLinksHost = new instance_links_host_1.InstanceLinksHost(this.container); + } + return this._instanceLinksHost; + } + constructor(container) { + super(); + this.container = container; + const contextOptions = container.contextOptions; + this.injector = new injector_1.Injector({ + preview: contextOptions?.preview ?? false, + snapshot: contextOptions?.snapshot, + instanceDecorator: contextOptions?.instrument?.instanceDecorator, + }); + } + introspect(token) { + const { wrapperRef } = this.instanceLinksHost.get(token); + let scope = common_1.Scope.DEFAULT; + if (!wrapperRef.isDependencyTreeStatic()) { + scope = common_1.Scope.REQUEST; + } + else if (wrapperRef.isTransient) { + scope = common_1.Scope.TRANSIENT; + } + return { scope }; + } + registerRequestByContextId(request, contextId) { + this.container.registerRequestProvider(request, contextId); + } + async instantiateClass(type, moduleRef, contextId) { + const wrapper = new instance_wrapper_1.InstanceWrapper({ + name: type && type.name, + metatype: type, + isResolved: false, + scope: (0, get_class_scope_1.getClassScope)(type), + durable: (0, is_durable_1.isDurable)(type), + host: moduleRef, + }); + if (type?.prototype) { + wrapper.setInstanceByContextId(contextId ?? constants_1.STATIC_CONTEXT, { + instance: Object.create(type.prototype), + isResolved: false, + isPending: false, + }); + } + return new Promise(async (resolve, reject) => { + try { + const callback = async (instances) => { + const properties = await this.injector.resolveProperties(wrapper, moduleRef, undefined, { + contextId: contextId ?? constants_1.STATIC_CONTEXT, + inquirer: wrapper, + }); + const instance = new type(...instances); + this.injector.applyProperties(instance, properties); + resolve(instance); + }; + await this.injector.resolveConstructorParams(wrapper, moduleRef, undefined, callback, { + contextId: contextId ?? constants_1.STATIC_CONTEXT, + inquirer: wrapper, + }); + } + catch (err) { + reject(err); + } + }); + } +} +exports.ModuleRef = ModuleRef; diff --git a/node_modules/@nestjs/core/injector/module.d.ts b/node_modules/@nestjs/core/injector/module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..200d54c50e8776d183ef61cffef777e881aaa287 --- /dev/null +++ b/node_modules/@nestjs/core/injector/module.d.ts @@ -0,0 +1,82 @@ +import { EnhancerSubtype } from '@nestjs/common/constants'; +import { ClassProvider, Controller, DynamicModule, ExistingProvider, FactoryProvider, Injectable, InjectionToken, NestModule, Provider, Type, ValueProvider } from '@nestjs/common/interfaces'; +import { NestContainer } from './container'; +import { InstanceWrapper } from './instance-wrapper'; +import { ModuleRef } from './module-ref'; +export declare class Module { + private readonly _metatype; + private readonly container; + private readonly _id; + private readonly _imports; + private readonly _providers; + private readonly _injectables; + private readonly _middlewares; + private readonly _controllers; + private readonly _entryProviderKeys; + private readonly _exports; + private _distance; + private _initOnPreview; + private _isGlobal; + private _token; + constructor(_metatype: Type, container: NestContainer); + get id(): string; + get token(): string; + set token(token: string); + get name(): string; + get isGlobal(): boolean; + set isGlobal(global: boolean); + get initOnPreview(): boolean; + set initOnPreview(initOnPreview: boolean); + get providers(): Map>; + get middlewares(): Map>; + get imports(): Set; + get injectables(): Map>; + get controllers(): Map>; + get entryProviders(): Array>; + get exports(): Set; + get instance(): NestModule; + get metatype(): Type; + get distance(): number; + set distance(value: number); + addCoreProviders(): void; + addModuleRef(): void; + addModuleAsProvider(): void; + addApplicationConfig(): void; + addInjectable(injectable: Provider, enhancerSubtype: EnhancerSubtype, host?: Type): string | symbol | Function | InstanceWrapper; + addProvider(provider: Provider): InjectionToken; + addProvider(provider: Provider, enhancerSubtype: EnhancerSubtype): InjectionToken; + isCustomProvider(provider: Provider): provider is ClassProvider | FactoryProvider | ValueProvider | ExistingProvider; + addCustomProvider(provider: ClassProvider | FactoryProvider | ValueProvider | ExistingProvider, collection: Map, enhancerSubtype?: EnhancerSubtype): InjectionToken; + isCustomClass(provider: any): provider is ClassProvider; + isCustomValue(provider: any): provider is ValueProvider; + isCustomFactory(provider: any): provider is FactoryProvider; + isCustomUseExisting(provider: any): provider is ExistingProvider; + isDynamicModule(exported: any): exported is DynamicModule; + addCustomClass(provider: ClassProvider, collection: Map, enhancerSubtype?: EnhancerSubtype): void; + addCustomValue(provider: ValueProvider, collection: Map, enhancerSubtype?: EnhancerSubtype): void; + addCustomFactory(provider: FactoryProvider, collection: Map, enhancerSubtype?: EnhancerSubtype): void; + addCustomUseExisting(provider: ExistingProvider, collection: Map, enhancerSubtype?: EnhancerSubtype): void; + addExportedProviderOrModule(toExport: Provider | string | symbol | DynamicModule): Set | undefined; + addCustomExportedProvider(provider: FactoryProvider | ValueProvider | ClassProvider | ExistingProvider): Set | undefined; + validateExportedProvider(token: InjectionToken): InjectionToken; + addController(controller: Type): void; + assignControllerUniqueId(controller: Type): void; + addImport(moduleRef: Module): void; + replace(toReplace: InjectionToken, options: any): void; + hasProvider(token: InjectionToken): boolean; + hasInjectable(token: InjectionToken): boolean; + getProviderByKey(name: InjectionToken): InstanceWrapper; + getProviderById(id: string): InstanceWrapper | undefined; + getControllerById(id: string): InstanceWrapper | undefined; + getInjectableById(id: string): InstanceWrapper | undefined; + getMiddlewareById(id: string): InstanceWrapper | undefined; + getNonAliasProviders(): Array<[ + InjectionToken, + InstanceWrapper + ]>; + createModuleReferenceType(): Type; + private isEntryProvider; + private generateUuid; + private isTransientProvider; + private isRequestScopeProvider; +} diff --git a/node_modules/@nestjs/core/injector/module.js b/node_modules/@nestjs/core/injector/module.js new file mode 100644 index 0000000000000000000000000000000000000000..b208a827b517fc7066ace28facc4da3c51aff5ad --- /dev/null +++ b/node_modules/@nestjs/core/injector/module.js @@ -0,0 +1,432 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Module = void 0; +const constants_1 = require("@nestjs/common/constants"); +const interfaces_1 = require("@nestjs/common/interfaces"); +const random_string_generator_util_1 = require("@nestjs/common/utils/random-string-generator.util"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const application_config_1 = require("../application-config"); +const exceptions_1 = require("../errors/exceptions"); +const context_id_factory_1 = require("../helpers/context-id-factory"); +const get_class_scope_1 = require("../helpers/get-class-scope"); +const is_durable_1 = require("../helpers/is-durable"); +const uuid_factory_1 = require("../inspector/uuid-factory"); +const constants_2 = require("./constants"); +const instance_wrapper_1 = require("./instance-wrapper"); +const module_ref_1 = require("./module-ref"); +class Module { + constructor(_metatype, container) { + this._metatype = _metatype; + this.container = container; + this._imports = new Set(); + this._providers = new Map(); + this._injectables = new Map(); + this._middlewares = new Map(); + this._controllers = new Map(); + this._entryProviderKeys = new Set(); + this._exports = new Set(); + this._distance = 0; + this._initOnPreview = false; + this._isGlobal = false; + this.addCoreProviders(); + this._id = this.generateUuid(); + } + get id() { + return this._id; + } + get token() { + return this._token; + } + set token(token) { + this._token = token; + } + get name() { + return this.metatype.name; + } + get isGlobal() { + return this._isGlobal; + } + set isGlobal(global) { + this._isGlobal = global; + } + get initOnPreview() { + return this._initOnPreview; + } + set initOnPreview(initOnPreview) { + this._initOnPreview = initOnPreview; + } + get providers() { + return this._providers; + } + get middlewares() { + return this._middlewares; + } + get imports() { + return this._imports; + } + get injectables() { + return this._injectables; + } + get controllers() { + return this._controllers; + } + get entryProviders() { + return Array.from(this._entryProviderKeys).map(token => this.providers.get(token)); + } + get exports() { + return this._exports; + } + get instance() { + if (!this._providers.has(this._metatype)) { + throw new exceptions_1.RuntimeException(); + } + const moduleRef = this._providers.get(this._metatype); + return moduleRef.instance; + } + get metatype() { + return this._metatype; + } + get distance() { + return this._distance; + } + set distance(value) { + this._distance = value; + } + addCoreProviders() { + this.addModuleAsProvider(); + this.addModuleRef(); + this.addApplicationConfig(); + } + addModuleRef() { + const moduleRef = this.createModuleReferenceType(); + this._providers.set(module_ref_1.ModuleRef, new instance_wrapper_1.InstanceWrapper({ + token: module_ref_1.ModuleRef, + name: module_ref_1.ModuleRef.name, + metatype: module_ref_1.ModuleRef, + isResolved: true, + instance: new moduleRef(), + host: this, + })); + } + addModuleAsProvider() { + this._providers.set(this._metatype, new instance_wrapper_1.InstanceWrapper({ + token: this._metatype, + name: this._metatype.name, + metatype: this._metatype, + isResolved: false, + instance: null, + host: this, + })); + } + addApplicationConfig() { + this._providers.set(application_config_1.ApplicationConfig, new instance_wrapper_1.InstanceWrapper({ + token: application_config_1.ApplicationConfig, + name: application_config_1.ApplicationConfig.name, + isResolved: true, + instance: this.container.applicationConfig, + host: this, + })); + } + addInjectable(injectable, enhancerSubtype, host) { + if (this.isCustomProvider(injectable)) { + return this.addCustomProvider(injectable, this._injectables, enhancerSubtype); + } + let instanceWrapper = this.injectables.get(injectable); + if (!instanceWrapper) { + instanceWrapper = new instance_wrapper_1.InstanceWrapper({ + token: injectable, + name: injectable.name, + metatype: injectable, + instance: null, + isResolved: false, + scope: (0, get_class_scope_1.getClassScope)(injectable), + durable: (0, is_durable_1.isDurable)(injectable), + subtype: enhancerSubtype, + host: this, + }); + this._injectables.set(injectable, instanceWrapper); + } + if (host) { + const hostWrapper = this._controllers.get(host) || this._providers.get(host); + hostWrapper && hostWrapper.addEnhancerMetadata(instanceWrapper); + } + return instanceWrapper; + } + addProvider(provider, enhancerSubtype) { + if (this.isCustomProvider(provider)) { + if (this.isEntryProvider(provider.provide)) { + this._entryProviderKeys.add(provider.provide); + } + return this.addCustomProvider(provider, this._providers, enhancerSubtype); + } + const isAlreadyDeclared = this._providers.has(provider); + if ((this.isTransientProvider(provider) || + this.isRequestScopeProvider(provider)) && + isAlreadyDeclared) { + return provider; + } + this._providers.set(provider, new instance_wrapper_1.InstanceWrapper({ + token: provider, + name: provider.name, + metatype: provider, + instance: null, + isResolved: false, + scope: (0, get_class_scope_1.getClassScope)(provider), + durable: (0, is_durable_1.isDurable)(provider), + host: this, + })); + if (this.isEntryProvider(provider)) { + this._entryProviderKeys.add(provider); + } + return provider; + } + isCustomProvider(provider) { + return !(0, shared_utils_1.isNil)(provider.provide); + } + addCustomProvider(provider, collection, enhancerSubtype) { + if (this.isCustomClass(provider)) { + this.addCustomClass(provider, collection, enhancerSubtype); + } + else if (this.isCustomValue(provider)) { + this.addCustomValue(provider, collection, enhancerSubtype); + } + else if (this.isCustomFactory(provider)) { + this.addCustomFactory(provider, collection, enhancerSubtype); + } + else if (this.isCustomUseExisting(provider)) { + this.addCustomUseExisting(provider, collection, enhancerSubtype); + } + return provider.provide; + } + isCustomClass(provider) { + return !(0, shared_utils_1.isUndefined)(provider.useClass); + } + isCustomValue(provider) { + return ((0, shared_utils_1.isObject)(provider) && + Object.prototype.hasOwnProperty.call(provider, 'useValue')); + } + isCustomFactory(provider) { + return !(0, shared_utils_1.isUndefined)(provider.useFactory); + } + isCustomUseExisting(provider) { + return !(0, shared_utils_1.isUndefined)(provider.useExisting); + } + isDynamicModule(exported) { + return exported && exported.module; + } + addCustomClass(provider, collection, enhancerSubtype) { + let { scope, durable } = provider; + const { useClass } = provider; + if ((0, shared_utils_1.isUndefined)(scope)) { + scope = (0, get_class_scope_1.getClassScope)(useClass); + } + if ((0, shared_utils_1.isUndefined)(durable)) { + durable = (0, is_durable_1.isDurable)(useClass); + } + const token = provider.provide; + collection.set(token, new instance_wrapper_1.InstanceWrapper({ + token, + name: useClass?.name || useClass, + metatype: useClass, + instance: null, + isResolved: false, + scope, + durable, + host: this, + subtype: enhancerSubtype, + })); + } + addCustomValue(provider, collection, enhancerSubtype) { + const { useValue: value, provide: providerToken } = provider; + const instanceDecorator = this.container.contextOptions?.instrument?.instanceDecorator; + collection.set(providerToken, new instance_wrapper_1.InstanceWrapper({ + token: providerToken, + name: providerToken?.name || providerToken, + metatype: null, + instance: instanceDecorator ? instanceDecorator(value) : value, + isResolved: true, + async: value instanceof Promise, + host: this, + subtype: enhancerSubtype, + })); + } + addCustomFactory(provider, collection, enhancerSubtype) { + const { useFactory: factory, inject, scope, durable, provide: providerToken, } = provider; + collection.set(providerToken, new instance_wrapper_1.InstanceWrapper({ + token: providerToken, + name: providerToken?.name || providerToken, + metatype: factory, + instance: null, + isResolved: false, + inject: inject || [], + scope, + durable, + host: this, + subtype: enhancerSubtype, + })); + } + addCustomUseExisting(provider, collection, enhancerSubtype) { + const { useExisting, provide: providerToken } = provider; + collection.set(providerToken, new instance_wrapper_1.InstanceWrapper({ + token: providerToken, + name: providerToken?.name || providerToken, + metatype: (instance => instance), + instance: null, + isResolved: false, + inject: [useExisting], + host: this, + isAlias: true, + subtype: enhancerSubtype, + })); + } + addExportedProviderOrModule(toExport) { + const addExportedUnit = (token) => this._exports.add(this.validateExportedProvider(token)); + if (this.isCustomProvider(toExport)) { + return this.addCustomExportedProvider(toExport); + } + else if ((0, shared_utils_1.isString)(toExport) || (0, shared_utils_1.isSymbol)(toExport)) { + return addExportedUnit(toExport); + } + else if (this.isDynamicModule(toExport)) { + const { module: moduleClassRef } = toExport; + return addExportedUnit(moduleClassRef); + } + addExportedUnit(toExport); + } + addCustomExportedProvider(provider) { + const provide = provider.provide; + if ((0, shared_utils_1.isString)(provide) || (0, shared_utils_1.isSymbol)(provide)) { + return this._exports.add(this.validateExportedProvider(provide)); + } + this._exports.add(this.validateExportedProvider(provide)); + } + validateExportedProvider(token) { + if (this._providers.has(token)) { + return token; + } + const imports = (0, iterare_1.iterate)(this._imports.values()) + .filter(item => !!item) + .map(({ metatype }) => metatype) + .filter(metatype => !!metatype) + .toArray(); + if (!imports.includes(token)) { + const { name } = this.metatype; + const providerName = (0, shared_utils_1.isFunction)(token) ? token.name : token; + throw new exceptions_1.UnknownExportException(providerName, name); + } + return token; + } + addController(controller) { + this._controllers.set(controller, new instance_wrapper_1.InstanceWrapper({ + token: controller, + name: controller.name, + metatype: controller, + instance: null, + isResolved: false, + scope: (0, get_class_scope_1.getClassScope)(controller), + durable: (0, is_durable_1.isDurable)(controller), + host: this, + })); + this.assignControllerUniqueId(controller); + } + assignControllerUniqueId(controller) { + Object.defineProperty(controller, constants_2.CONTROLLER_ID_KEY, { + enumerable: false, + writable: false, + configurable: true, + value: (0, random_string_generator_util_1.randomStringGenerator)(), + }); + } + addImport(moduleRef) { + this._imports.add(moduleRef); + } + replace(toReplace, options) { + if (options.isProvider && this.hasProvider(toReplace)) { + const originalProvider = this._providers.get(toReplace); + return originalProvider.mergeWith({ provide: toReplace, ...options }); + } + else if (!options.isProvider && this.hasInjectable(toReplace)) { + const originalInjectable = this._injectables.get(toReplace); + return originalInjectable.mergeWith({ + provide: toReplace, + ...options, + }); + } + } + hasProvider(token) { + return this._providers.has(token); + } + hasInjectable(token) { + return this._injectables.has(token); + } + getProviderByKey(name) { + return this._providers.get(name); + } + getProviderById(id) { + return Array.from(this._providers.values()).find(item => item.id === id); + } + getControllerById(id) { + return Array.from(this._controllers.values()).find(item => item.id === id); + } + getInjectableById(id) { + return Array.from(this._injectables.values()).find(item => item.id === id); + } + getMiddlewareById(id) { + return Array.from(this._middlewares.values()).find(item => item.id === id); + } + getNonAliasProviders() { + return [...this._providers].filter(([_, wrapper]) => !wrapper.isAlias); + } + createModuleReferenceType() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this; + return class extends module_ref_1.ModuleRef { + constructor() { + super(self.container); + } + get(typeOrToken, options = {}) { + options.strict ??= true; + options.each ??= false; + return this.find(typeOrToken, options.strict + ? { + moduleId: self.id, + each: options.each, + } + : options); + } + resolve(typeOrToken, contextId = (0, context_id_factory_1.createContextId)(), options = {}) { + options.strict ??= true; + options.each ??= false; + return this.resolvePerContext(typeOrToken, self, contextId, options); + } + async create(type, contextId) { + if (!(type && (0, shared_utils_1.isFunction)(type) && type.prototype)) { + throw new exceptions_1.InvalidClassException(type); + } + return this.instantiateClass(type, self, contextId); + } + }; + } + isEntryProvider(metatype) { + return typeof metatype === 'function' + ? !!Reflect.getMetadata(constants_1.ENTRY_PROVIDER_WATERMARK, metatype) + : false; + } + generateUuid() { + const prefix = 'M_'; + const key = this.token + ? this.token.includes(':') + ? this.token.split(':')[1] + : this.token + : this.name; + return key ? uuid_factory_1.UuidFactory.get(`${prefix}_${key}`) : (0, random_string_generator_util_1.randomStringGenerator)(); + } + isTransientProvider(provider) { + return (0, get_class_scope_1.getClassScope)(provider) === interfaces_1.Scope.TRANSIENT; + } + isRequestScopeProvider(provider) { + return (0, get_class_scope_1.getClassScope)(provider) === interfaces_1.Scope.REQUEST; + } +} +exports.Module = Module; diff --git a/node_modules/@nestjs/core/injector/modules-container.d.ts b/node_modules/@nestjs/core/injector/modules-container.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..738b958a98ca98540c0bbbee1691fcf808ff771a --- /dev/null +++ b/node_modules/@nestjs/core/injector/modules-container.d.ts @@ -0,0 +1,27 @@ +import { Observable } from 'rxjs'; +import { Module } from './module'; +export declare class ModulesContainer extends Map { + private readonly _applicationId; + private readonly _rpcTargetRegistry$; + /** + * Unique identifier of the application instance. + */ + get applicationId(): string; + /** + * Retrieves a module by its identifier. + * @param id The identifier of the module to retrieve. + * @returns The module instance if found, otherwise undefined. + */ + getById(id: string): Module | undefined; + /** + * Returns the RPC target registry as an observable. + * This registry contains all RPC targets registered in the application. + * @returns An observable that emits the RPC target registry. + */ + getRpcTargetRegistry(): Observable; + /** + * Adds an RPC target to the registry. + * @param target The RPC target to add. + */ + addRpcTarget(target: T): void; +} diff --git a/node_modules/@nestjs/core/injector/modules-container.js b/node_modules/@nestjs/core/injector/modules-container.js new file mode 100644 index 0000000000000000000000000000000000000000..bf5bf0d80c724144932174ba269f87c62ed4abc5 --- /dev/null +++ b/node_modules/@nestjs/core/injector/modules-container.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ModulesContainer = void 0; +const rxjs_1 = require("rxjs"); +const uid_1 = require("uid"); +class ModulesContainer extends Map { + constructor() { + super(...arguments); + this._applicationId = (0, uid_1.uid)(21); + this._rpcTargetRegistry$ = new rxjs_1.ReplaySubject(); + } + /** + * Unique identifier of the application instance. + */ + get applicationId() { + return this._applicationId; + } + /** + * Retrieves a module by its identifier. + * @param id The identifier of the module to retrieve. + * @returns The module instance if found, otherwise undefined. + */ + getById(id) { + return Array.from(this.values()).find(moduleRef => moduleRef.id === id); + } + /** + * Returns the RPC target registry as an observable. + * This registry contains all RPC targets registered in the application. + * @returns An observable that emits the RPC target registry. + */ + getRpcTargetRegistry() { + return this._rpcTargetRegistry$.asObservable(); + } + /** + * Adds an RPC target to the registry. + * @param target The RPC target to add. + */ + addRpcTarget(target) { + this._rpcTargetRegistry$.next(target); + } +} +exports.ModulesContainer = ModulesContainer; diff --git a/node_modules/@nestjs/core/injector/opaque-key-factory/by-reference-module-opaque-key-factory.d.ts b/node_modules/@nestjs/core/injector/opaque-key-factory/by-reference-module-opaque-key-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..beaaabb46e0d71625d0bfcd46ddc2bb1ac6bdde1 --- /dev/null +++ b/node_modules/@nestjs/core/injector/opaque-key-factory/by-reference-module-opaque-key-factory.d.ts @@ -0,0 +1,15 @@ +import { DynamicModule } from '@nestjs/common/interfaces/modules/dynamic-module.interface'; +import { ForwardReference } from '@nestjs/common/interfaces/modules/forward-reference.interface'; +import { Type } from '@nestjs/common/interfaces/type.interface'; +import { ModuleOpaqueKeyFactory } from './interfaces/module-opaque-key-factory.interface'; +export declare class ByReferenceModuleOpaqueKeyFactory implements ModuleOpaqueKeyFactory { + private readonly keyGenerationStrategy; + constructor(options?: { + keyGenerationStrategy: 'random' | 'shallow'; + }); + createForStatic(moduleCls: Type, originalRef?: Type | ForwardReference): string; + createForDynamic(moduleCls: Type, dynamicMetadata: Omit, originalRef: DynamicModule | ForwardReference): string; + private getOrCreateModuleId; + private hashString; + private generateRandomString; +} diff --git a/node_modules/@nestjs/core/injector/opaque-key-factory/by-reference-module-opaque-key-factory.js b/node_modules/@nestjs/core/injector/opaque-key-factory/by-reference-module-opaque-key-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..bbd1d2dacac799c606860696573b21345bbd20b6 --- /dev/null +++ b/node_modules/@nestjs/core/injector/opaque-key-factory/by-reference-module-opaque-key-factory.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ByReferenceModuleOpaqueKeyFactory = void 0; +const random_string_generator_util_1 = require("@nestjs/common/utils/random-string-generator.util"); +const crypto_1 = require("crypto"); +const K_MODULE_ID = Symbol('K_MODULE_ID'); +class ByReferenceModuleOpaqueKeyFactory { + constructor(options) { + this.keyGenerationStrategy = options?.keyGenerationStrategy ?? 'random'; + } + createForStatic(moduleCls, originalRef = moduleCls) { + return this.getOrCreateModuleId(moduleCls, undefined, originalRef); + } + createForDynamic(moduleCls, dynamicMetadata, originalRef) { + return this.getOrCreateModuleId(moduleCls, dynamicMetadata, originalRef); + } + getOrCreateModuleId(moduleCls, dynamicMetadata, originalRef) { + if (originalRef[K_MODULE_ID]) { + return originalRef[K_MODULE_ID]; + } + let moduleId; + if (this.keyGenerationStrategy === 'random') { + moduleId = this.generateRandomString(); + } + else { + const delimiter = ':'; + moduleId = dynamicMetadata + ? `${this.generateRandomString()}${delimiter}${this.hashString(moduleCls.name + JSON.stringify(dynamicMetadata))}` + : `${this.generateRandomString()}${delimiter}${this.hashString(moduleCls.toString())}`; + } + originalRef[K_MODULE_ID] = moduleId; + return moduleId; + } + hashString(value) { + return (0, crypto_1.createHash)('sha256').update(value).digest('hex'); + } + generateRandomString() { + return (0, random_string_generator_util_1.randomStringGenerator)(); + } +} +exports.ByReferenceModuleOpaqueKeyFactory = ByReferenceModuleOpaqueKeyFactory; diff --git a/node_modules/@nestjs/core/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.d.ts b/node_modules/@nestjs/core/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a5789a1a10cba1b3bea72d2375bbc859d520554e --- /dev/null +++ b/node_modules/@nestjs/core/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.d.ts @@ -0,0 +1,15 @@ +import { DynamicModule } from '@nestjs/common/interfaces/modules/dynamic-module.interface'; +import { Type } from '@nestjs/common/interfaces/type.interface'; +import { ModuleOpaqueKeyFactory } from './interfaces/module-opaque-key-factory.interface'; +export declare class DeepHashedModuleOpaqueKeyFactory implements ModuleOpaqueKeyFactory { + private readonly moduleIdsCache; + private readonly moduleTokenCache; + private readonly logger; + createForStatic(moduleCls: Type): string; + createForDynamic(moduleCls: Type, dynamicMetadata: Omit): string; + getStringifiedOpaqueToken(opaqueToken: object | undefined): string; + getModuleId(metatype: Type): string; + getModuleName(metatype: Type): string; + private hashString; + private replacer; +} diff --git a/node_modules/@nestjs/core/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.js b/node_modules/@nestjs/core/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..d01dec8bfabc9589c6a9f76796f23e793364b82d --- /dev/null +++ b/node_modules/@nestjs/core/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeepHashedModuleOpaqueKeyFactory = void 0; +const logger_service_1 = require("@nestjs/common/services/logger.service"); +const random_string_generator_util_1 = require("@nestjs/common/utils/random-string-generator.util"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const crypto_1 = require("crypto"); +const fast_safe_stringify_1 = require("fast-safe-stringify"); +const CLASS_STR = 'class '; +const CLASS_STR_LEN = CLASS_STR.length; +class DeepHashedModuleOpaqueKeyFactory { + constructor() { + this.moduleIdsCache = new WeakMap(); + this.moduleTokenCache = new Map(); + this.logger = new logger_service_1.Logger(DeepHashedModuleOpaqueKeyFactory.name, { + timestamp: true, + }); + } + createForStatic(moduleCls) { + const moduleId = this.getModuleId(moduleCls); + const moduleName = this.getModuleName(moduleCls); + const key = `${moduleId}_${moduleName}`; + if (this.moduleTokenCache.has(key)) { + return this.moduleTokenCache.get(key); + } + const hash = this.hashString(key); + this.moduleTokenCache.set(key, hash); + return hash; + } + createForDynamic(moduleCls, dynamicMetadata) { + const moduleId = this.getModuleId(moduleCls); + const moduleName = this.getModuleName(moduleCls); + const opaqueToken = { + id: moduleId, + module: moduleName, + dynamic: dynamicMetadata, + }; + const start = performance.now(); + const opaqueTokenString = this.getStringifiedOpaqueToken(opaqueToken); + const timeSpentInMs = performance.now() - start; + if (timeSpentInMs > 10) { + const formattedTimeSpent = timeSpentInMs.toFixed(2); + this.logger.warn(`The module "${opaqueToken.module}" is taking ${formattedTimeSpent}ms to serialize, this may be caused by larger objects statically assigned to the module. Consider changing the "moduleIdGeneratorAlgorithm" option to "reference" to improve the performance.`); + } + return this.hashString(opaqueTokenString); + } + getStringifiedOpaqueToken(opaqueToken) { + // Uses safeStringify instead of JSON.stringify to support circular dynamic modules + // The replacer function is also required in order to obtain real class names + // instead of the unified "Function" key + return opaqueToken ? (0, fast_safe_stringify_1.default)(opaqueToken, this.replacer) : ''; + } + getModuleId(metatype) { + let moduleId = this.moduleIdsCache.get(metatype); + if (moduleId) { + return moduleId; + } + moduleId = (0, random_string_generator_util_1.randomStringGenerator)(); + this.moduleIdsCache.set(metatype, moduleId); + return moduleId; + } + getModuleName(metatype) { + return metatype.name; + } + hashString(value) { + return (0, crypto_1.createHash)('sha256').update(value).digest('hex'); + } + replacer(key, value) { + if ((0, shared_utils_1.isFunction)(value)) { + const funcAsString = value.toString(); + const isClass = funcAsString.slice(0, CLASS_STR_LEN) === CLASS_STR; + if (isClass) { + return value.name; + } + return funcAsString; + } + if ((0, shared_utils_1.isSymbol)(value)) { + return value.toString(); + } + return value; + } +} +exports.DeepHashedModuleOpaqueKeyFactory = DeepHashedModuleOpaqueKeyFactory; diff --git a/node_modules/@nestjs/core/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.d.ts b/node_modules/@nestjs/core/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3585b20f80c149cba628423ee139fb9ff90e383 --- /dev/null +++ b/node_modules/@nestjs/core/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.d.ts @@ -0,0 +1,18 @@ +import { DynamicModule } from '@nestjs/common/interfaces/modules/dynamic-module.interface'; +import { ForwardReference } from '@nestjs/common/interfaces/modules/forward-reference.interface'; +import { Type } from '@nestjs/common/interfaces/type.interface'; +export interface ModuleOpaqueKeyFactory { + /** + * Creates a unique opaque key for the given static module. + * @param moduleCls A static module class. + * @param originalRef Original object reference. In most cases, it's the same as `moduleCls`. + */ + createForStatic(moduleCls: Type, originalRef: Type | ForwardReference): string; + /** + * Creates a unique opaque key for the given dynamic module. + * @param moduleCls A dynamic module class reference. + * @param dynamicMetadata Dynamic module metadata. + * @param originalRef Original object reference. + */ + createForDynamic(moduleCls: Type, dynamicMetadata: Omit, originalRef: DynamicModule | ForwardReference): string; +} diff --git a/node_modules/@nestjs/core/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.js b/node_modules/@nestjs/core/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/injector/settlement-signal.d.ts b/node_modules/@nestjs/core/injector/settlement-signal.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a04ccbe75cf052a79414a5627aa5593c3f6d5da5 --- /dev/null +++ b/node_modules/@nestjs/core/injector/settlement-signal.d.ts @@ -0,0 +1,37 @@ +/** + * SettlementSignal is used to signal the resolution of a provider/instance. + * Calling `complete` or `error` will resolve the promise returned by `asPromise`. + * Can be used to detect circular dependencies. + */ +export declare class SettlementSignal { + private readonly _refs; + private readonly settledPromise; + private settleFn; + private completed; + constructor(); + /** + * Resolves the promise returned by `asPromise`. + */ + complete(): void; + /** + * Rejects the promise returned by `asPromise` with the given error. + * @param err Error to reject the promise returned by `asPromise` with. + */ + error(err: unknown): void; + /** + * Returns a promise that will be resolved when `complete` or `error` is called. + * @returns Promise that will be resolved when `complete` or `error` is called. + */ + asPromise(): Promise; + /** + * Inserts a wrapper id that the host of this signal depends on. + * @param wrapperId Wrapper id to insert. + */ + insertRef(wrapperId: string): void; + /** + * Check if relationship is circular. + * @param wrapperId Wrapper id to check. + * @returns True if relationship is circular, false otherwise. + */ + isCycle(wrapperId: string): boolean; +} diff --git a/node_modules/@nestjs/core/injector/settlement-signal.js b/node_modules/@nestjs/core/injector/settlement-signal.js new file mode 100644 index 0000000000000000000000000000000000000000..8878288f385a052e78b14b0d968346919b9ba6b6 --- /dev/null +++ b/node_modules/@nestjs/core/injector/settlement-signal.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SettlementSignal = void 0; +/** + * SettlementSignal is used to signal the resolution of a provider/instance. + * Calling `complete` or `error` will resolve the promise returned by `asPromise`. + * Can be used to detect circular dependencies. + */ +class SettlementSignal { + constructor() { + this._refs = new Set(); + this.completed = false; + this.settledPromise = new Promise(resolve => { + this.settleFn = resolve; + }); + } + /** + * Resolves the promise returned by `asPromise`. + */ + complete() { + this.completed = true; + this.settleFn(); + } + /** + * Rejects the promise returned by `asPromise` with the given error. + * @param err Error to reject the promise returned by `asPromise` with. + */ + error(err) { + this.completed = true; + this.settleFn(err); + } + /** + * Returns a promise that will be resolved when `complete` or `error` is called. + * @returns Promise that will be resolved when `complete` or `error` is called. + */ + asPromise() { + return this.settledPromise; + } + /** + * Inserts a wrapper id that the host of this signal depends on. + * @param wrapperId Wrapper id to insert. + */ + insertRef(wrapperId) { + this._refs.add(wrapperId); + } + /** + * Check if relationship is circular. + * @param wrapperId Wrapper id to check. + * @returns True if relationship is circular, false otherwise. + */ + isCycle(wrapperId) { + return !this.completed && this._refs.has(wrapperId); + } +} +exports.SettlementSignal = SettlementSignal; diff --git a/node_modules/@nestjs/core/injector/topology-tree/topology-tree.d.ts b/node_modules/@nestjs/core/injector/topology-tree/topology-tree.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f97216e0004db9035a716097ebc81a1a2e773887 --- /dev/null +++ b/node_modules/@nestjs/core/injector/topology-tree/topology-tree.d.ts @@ -0,0 +1,8 @@ +import { Module } from '../module'; +export declare class TopologyTree { + private root; + private links; + constructor(moduleRef: Module); + walk(callback: (value: Module, depth: number) => void): void; + private traverseAndMapToTree; +} diff --git a/node_modules/@nestjs/core/injector/topology-tree/topology-tree.js b/node_modules/@nestjs/core/injector/topology-tree/topology-tree.js new file mode 100644 index 0000000000000000000000000000000000000000..00a4ca603861504a98952a3c6c4c535096e3e25a --- /dev/null +++ b/node_modules/@nestjs/core/injector/topology-tree/topology-tree.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TopologyTree = void 0; +const tree_node_1 = require("./tree-node"); +class TopologyTree { + constructor(moduleRef) { + this.links = new Map(); + this.root = new tree_node_1.TreeNode({ + value: moduleRef, + parent: null, + }); + this.links.set(moduleRef, this.root); + this.traverseAndMapToTree(this.root); + } + walk(callback) { + function walkNode(node, depth = 1) { + callback(node.value, depth); + node.children.forEach(child => walkNode(child, depth + 1)); + } + walkNode(this.root); + } + traverseAndMapToTree(node, depth = 1) { + if (!node.value.imports) { + return; + } + node.value.imports.forEach(child => { + if (!child) { + return; + } + if (this.links.has(child)) { + const existingSubtree = this.links.get(child); + if (node.hasCycleWith(child)) { + return; + } + const existingDepth = existingSubtree.getDepth(); + if (existingDepth < depth) { + existingSubtree.relink(node); + } + return; + } + const childNode = new tree_node_1.TreeNode({ + value: child, + parent: node, + }); + node.addChild(childNode); + this.links.set(child, childNode); + this.traverseAndMapToTree(childNode, depth + 1); + }); + } +} +exports.TopologyTree = TopologyTree; diff --git a/node_modules/@nestjs/core/injector/topology-tree/tree-node.d.ts b/node_modules/@nestjs/core/injector/topology-tree/tree-node.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7ea92fd72e190ff1ddf4ef55257540fcdeb31b59 --- /dev/null +++ b/node_modules/@nestjs/core/injector/topology-tree/tree-node.d.ts @@ -0,0 +1,14 @@ +export declare class TreeNode { + readonly value: T; + readonly children: Set>; + private parent; + constructor({ value, parent }: { + value: T; + parent: TreeNode | null; + }); + addChild(child: TreeNode): void; + removeChild(child: TreeNode): void; + relink(parent: TreeNode): void; + getDepth(): number; + hasCycleWith(target: T): boolean; +} diff --git a/node_modules/@nestjs/core/injector/topology-tree/tree-node.js b/node_modules/@nestjs/core/injector/topology-tree/tree-node.js new file mode 100644 index 0000000000000000000000000000000000000000..591e310718987b6a7aaf3b172bf80487bc0b78b2 --- /dev/null +++ b/node_modules/@nestjs/core/injector/topology-tree/tree-node.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TreeNode = void 0; +class TreeNode { + constructor({ value, parent }) { + this.children = new Set(); + this.value = value; + this.parent = parent; + } + addChild(child) { + this.children.add(child); + } + removeChild(child) { + this.children.delete(child); + } + relink(parent) { + this.parent?.removeChild(this); + this.parent = parent; + this.parent.addChild(this); + } + getDepth() { + const visited = new Set(); + let depth = 0; + // eslint-disable-next-line @typescript-eslint/no-this-alias + let current = this; + while (current) { + depth++; + current = current.parent; + // Stop on cycle + if (visited.has(current)) { + return -1; + } + visited.add(current); + } + return depth; + } + hasCycleWith(target) { + const visited = new Set(); + // eslint-disable-next-line @typescript-eslint/no-this-alias + let current = this; + while (current) { + if (current.value === target) { + return true; + } + current = current.parent; + if (visited.has(current)) { + return false; + } + visited.add(current); + } + return false; + } +} +exports.TreeNode = TreeNode; diff --git a/node_modules/@nestjs/core/inspector/deterministic-uuid-registry.d.ts b/node_modules/@nestjs/core/inspector/deterministic-uuid-registry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d9db1b092b2cddfd84cbb8ad8749660274eb3ba1 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/deterministic-uuid-registry.d.ts @@ -0,0 +1,6 @@ +export declare class DeterministicUuidRegistry { + private static readonly registry; + static get(str: string, inc?: number): any; + static clear(): void; + private static hashCode; +} diff --git a/node_modules/@nestjs/core/inspector/deterministic-uuid-registry.js b/node_modules/@nestjs/core/inspector/deterministic-uuid-registry.js new file mode 100644 index 0000000000000000000000000000000000000000..f2d3a8593c5a55555069e86f0badb97698b7de60 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/deterministic-uuid-registry.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeterministicUuidRegistry = void 0; +class DeterministicUuidRegistry { + static get(str, inc = 0) { + const id = inc ? this.hashCode(`${str}_${inc}`) : this.hashCode(str); + if (this.registry.has(id)) { + return this.get(str, inc + 1); + } + this.registry.set(id, true); + return id; + } + static clear() { + this.registry.clear(); + } + static hashCode(s) { + let h = 0; + for (let i = 0; i < s.length; i++) + h = (Math.imul(31, h) + s.charCodeAt(i)) | 0; + return h.toString(); + } +} +exports.DeterministicUuidRegistry = DeterministicUuidRegistry; +DeterministicUuidRegistry.registry = new Map(); diff --git a/node_modules/@nestjs/core/inspector/graph-inspector.d.ts b/node_modules/@nestjs/core/inspector/graph-inspector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a9e9177c65345e09eeb88b131d218d95566fcfbc --- /dev/null +++ b/node_modules/@nestjs/core/inspector/graph-inspector.d.ts @@ -0,0 +1,26 @@ +import { NestContainer } from '../injector/container'; +import { InstanceWrapper } from '../injector/instance-wrapper'; +import { Module } from '../injector/module'; +import { EnhancerMetadataCacheEntry } from './interfaces/enhancer-metadata-cache-entry.interface'; +import { Entrypoint } from './interfaces/entrypoint.interface'; +import { OrphanedEnhancerDefinition } from './interfaces/extras.interface'; +import { Node } from './interfaces/node.interface'; +export declare class GraphInspector { + private readonly container; + private readonly graph; + private readonly enhancersMetadataCache; + constructor(container: NestContainer); + inspectModules(modules?: Map): void; + registerPartial(error: unknown): void; + inspectInstanceWrapper(source: InstanceWrapper, moduleRef: Module): void; + insertEnhancerMetadataCache(entry: EnhancerMetadataCacheEntry): void; + insertOrphanedEnhancer(entry: OrphanedEnhancerDefinition): void; + insertAttachedEnhancer(wrapper: InstanceWrapper): void; + insertEntrypointDefinition(definition: Entrypoint, parentId: string): void; + insertClassNode(moduleRef: Module, wrapper: InstanceWrapper, type: Exclude): void; + private insertModuleNode; + private insertModuleToModuleEdges; + private insertEnhancerEdge; + private insertClassToClassEdge; + private insertClassNodes; +} diff --git a/node_modules/@nestjs/core/inspector/graph-inspector.js b/node_modules/@nestjs/core/inspector/graph-inspector.js new file mode 100644 index 0000000000000000000000000000000000000000..596ac9d7722db8aa0c649ad4815933eed3807e15 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/graph-inspector.js @@ -0,0 +1,166 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GraphInspector = void 0; +const unknown_dependencies_exception_1 = require("../errors/exceptions/unknown-dependencies.exception"); +const deterministic_uuid_registry_1 = require("./deterministic-uuid-registry"); +const partial_graph_host_1 = require("./partial-graph.host"); +class GraphInspector { + constructor(container) { + this.container = container; + this.enhancersMetadataCache = new Array(); + this.graph = container.serializedGraph; + } + inspectModules(modules = this.container.getModules()) { + for (const moduleRef of modules.values()) { + this.insertModuleNode(moduleRef); + this.insertClassNodes(moduleRef); + this.insertModuleToModuleEdges(moduleRef); + } + this.enhancersMetadataCache.forEach(entry => this.insertEnhancerEdge(entry)); + deterministic_uuid_registry_1.DeterministicUuidRegistry.clear(); + } + registerPartial(error) { + this.graph.status = 'partial'; + if (error instanceof unknown_dependencies_exception_1.UnknownDependenciesException) { + this.graph.metadata = { + cause: { + type: 'unknown-dependencies', + context: error.context, + moduleId: error.moduleRef?.id, + nodeId: error.metadata?.id, + }, + }; + } + else { + this.graph.metadata = { + cause: { + type: 'unknown', + error, + }, + }; + } + partial_graph_host_1.PartialGraphHost.register(this.graph); + } + inspectInstanceWrapper(source, moduleRef) { + const ctorMetadata = source.getCtorMetadata(); + ctorMetadata?.forEach((target, index) => this.insertClassToClassEdge(source, target, moduleRef, index, 'constructor')); + const propertiesMetadata = source.getPropertiesMetadata(); + propertiesMetadata?.forEach(({ key, wrapper: target }) => this.insertClassToClassEdge(source, target, moduleRef, key, 'property')); + } + insertEnhancerMetadataCache(entry) { + this.enhancersMetadataCache.push(entry); + } + insertOrphanedEnhancer(entry) { + this.graph.insertOrphanedEnhancer({ + ...entry, + ref: entry.ref?.constructor?.name ?? 'Object', + }); + } + insertAttachedEnhancer(wrapper) { + const existingNode = this.graph.getNodeById(wrapper.id); + existingNode.metadata.global = true; + this.graph.insertAttachedEnhancer(existingNode.id); + } + insertEntrypointDefinition(definition, parentId) { + definition = { + ...definition, + id: `${definition.classNodeId}_${definition.methodName}`, + }; + this.graph.insertEntrypoint(definition, parentId); + } + insertClassNode(moduleRef, wrapper, type) { + this.graph.insertNode({ + id: wrapper.id, + label: wrapper.name, + parent: moduleRef.id, + metadata: { + type, + internal: wrapper.metatype === moduleRef.metatype, + sourceModuleName: moduleRef.name, + durable: wrapper.isDependencyTreeDurable(), + static: wrapper.isDependencyTreeStatic(), + scope: wrapper.scope, + transient: wrapper.isTransient, + exported: moduleRef.exports.has(wrapper.token), + token: wrapper.token, + subtype: wrapper.subtype, + initTime: wrapper.initTime, + }, + }); + } + insertModuleNode(moduleRef) { + const dynamicMetadata = this.container.getDynamicMetadataByToken(moduleRef.token); + const node = { + id: moduleRef.id, + label: moduleRef.name, + metadata: { + type: 'module', + global: moduleRef.isGlobal, + dynamic: !!dynamicMetadata, + internal: moduleRef.name === 'InternalCoreModule', + }, + }; + this.graph.insertNode(node); + } + insertModuleToModuleEdges(moduleRef) { + for (const targetModuleRef of moduleRef.imports) { + this.graph.insertEdge({ + source: moduleRef.id, + target: targetModuleRef.id, + metadata: { + type: 'module-to-module', + sourceModuleName: moduleRef.name, + targetModuleName: targetModuleRef.name, + }, + }); + } + } + insertEnhancerEdge(entry) { + const moduleRef = this.container.getModuleByKey(entry.moduleToken); + const sourceInstanceWrapper = moduleRef.controllers.get(entry.classRef) ?? + moduleRef.providers.get(entry.classRef); + const existingSourceNode = this.graph.getNodeById(sourceInstanceWrapper.id); + const enhancers = existingSourceNode.metadata.enhancers ?? []; + if (entry.enhancerInstanceWrapper) { + this.insertClassToClassEdge(sourceInstanceWrapper, entry.enhancerInstanceWrapper, moduleRef, undefined, 'decorator'); + enhancers.push({ + id: entry.enhancerInstanceWrapper.id, + methodKey: entry.methodKey, + subtype: entry.subtype, + }); + } + else { + const name = entry.enhancerRef.constructor?.name ?? + entry.enhancerRef.name; + enhancers.push({ + name, + methodKey: entry.methodKey, + subtype: entry.subtype, + }); + } + existingSourceNode.metadata.enhancers = enhancers; + } + insertClassToClassEdge(source, target, moduleRef, keyOrIndex, injectionType) { + this.graph.insertEdge({ + source: source.id, + target: target.id, + metadata: { + type: 'class-to-class', + sourceModuleName: moduleRef.name, + sourceClassName: source.name, + targetClassName: target.name, + sourceClassToken: source.token, + targetClassToken: target.token, + targetModuleName: target.host?.name, + keyOrIndex, + injectionType, + }, + }); + } + insertClassNodes(moduleRef) { + moduleRef.providers.forEach(value => this.insertClassNode(moduleRef, value, 'provider')); + moduleRef.injectables.forEach(value => this.insertClassNode(moduleRef, value, 'injectable')); + moduleRef.controllers.forEach(value => this.insertClassNode(moduleRef, value, 'controller')); + } +} +exports.GraphInspector = GraphInspector; diff --git a/node_modules/@nestjs/core/inspector/index.d.ts b/node_modules/@nestjs/core/inspector/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..db830f6e7115665940dd2461a204d564e601a8cb --- /dev/null +++ b/node_modules/@nestjs/core/inspector/index.d.ts @@ -0,0 +1,4 @@ +export * from './graph-inspector'; +export * from './initialize-on-preview.allowlist'; +export * from './partial-graph.host'; +export * from './serialized-graph'; diff --git a/node_modules/@nestjs/core/inspector/index.js b/node_modules/@nestjs/core/inspector/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9e6c5242e6fe285226b951f9e2b7bec1e6e71c92 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./graph-inspector"), exports); +tslib_1.__exportStar(require("./initialize-on-preview.allowlist"), exports); +tslib_1.__exportStar(require("./partial-graph.host"), exports); +tslib_1.__exportStar(require("./serialized-graph"), exports); diff --git a/node_modules/@nestjs/core/inspector/initialize-on-preview.allowlist.d.ts b/node_modules/@nestjs/core/inspector/initialize-on-preview.allowlist.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8dbd9b83503aa92dc07b4342d7e75f380167d153 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/initialize-on-preview.allowlist.d.ts @@ -0,0 +1,6 @@ +import { Type } from '@nestjs/common'; +export declare class InitializeOnPreviewAllowlist { + private static readonly allowlist; + static add(type: Type): void; + static has(type: Type): boolean; +} diff --git a/node_modules/@nestjs/core/inspector/initialize-on-preview.allowlist.js b/node_modules/@nestjs/core/inspector/initialize-on-preview.allowlist.js new file mode 100644 index 0000000000000000000000000000000000000000..9f3713b3d549df2ff7ed295199192472d023a509 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/initialize-on-preview.allowlist.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InitializeOnPreviewAllowlist = void 0; +class InitializeOnPreviewAllowlist { + static add(type) { + this.allowlist.set(type, true); + } + static has(type) { + return this.allowlist.has(type); + } +} +exports.InitializeOnPreviewAllowlist = InitializeOnPreviewAllowlist; +InitializeOnPreviewAllowlist.allowlist = new WeakMap(); diff --git a/node_modules/@nestjs/core/inspector/interfaces/edge.interface.d.ts b/node_modules/@nestjs/core/inspector/interfaces/edge.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a809cc23675bcc448ebaa5df0451cafb7185a7b --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/edge.interface.d.ts @@ -0,0 +1,28 @@ +import { InjectionToken } from '@nestjs/common'; +type CommonEdgeMetadata = { + sourceModuleName: string; + targetModuleName: string; +}; +type ModuleToModuleEdgeMetadata = { + type: 'module-to-module'; +} & CommonEdgeMetadata; +type ClassToClassEdgeMetadata = { + type: 'class-to-class'; + sourceClassName: string; + targetClassName: string; + sourceClassToken: InjectionToken; + targetClassToken: InjectionToken; + injectionType: 'constructor' | 'property' | 'decorator'; + keyOrIndex?: string | number | symbol; + /** + * If true, indicates that this edge represents an internal providers connection + */ + internal?: boolean; +} & CommonEdgeMetadata; +export interface Edge { + id: string; + source: string; + target: string; + metadata: ModuleToModuleEdgeMetadata | ClassToClassEdgeMetadata; +} +export {}; diff --git a/node_modules/@nestjs/core/inspector/interfaces/edge.interface.js b/node_modules/@nestjs/core/inspector/interfaces/edge.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/edge.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/inspector/interfaces/enhancer-metadata-cache-entry.interface.d.ts b/node_modules/@nestjs/core/inspector/interfaces/enhancer-metadata-cache-entry.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..410a2788c06de6f631b903cd8a4389b94a8129bf --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/enhancer-metadata-cache-entry.interface.d.ts @@ -0,0 +1,12 @@ +import { Type } from '@nestjs/common'; +import { EnhancerSubtype } from '@nestjs/common/constants'; +import { InstanceWrapper } from '../../injector/instance-wrapper'; +export interface EnhancerMetadataCacheEntry { + targetNodeId?: string; + moduleToken: string; + classRef: Type; + methodKey: string | undefined; + enhancerRef?: unknown; + enhancerInstanceWrapper?: InstanceWrapper; + subtype: EnhancerSubtype; +} diff --git a/node_modules/@nestjs/core/inspector/interfaces/enhancer-metadata-cache-entry.interface.js b/node_modules/@nestjs/core/inspector/interfaces/enhancer-metadata-cache-entry.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/enhancer-metadata-cache-entry.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/inspector/interfaces/entrypoint.interface.d.ts b/node_modules/@nestjs/core/inspector/interfaces/entrypoint.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..078360a730a2dc15b8a3549cfecd0353f3ae63dc --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/entrypoint.interface.d.ts @@ -0,0 +1,23 @@ +import { RequestMethod } from '@nestjs/common'; +import { VersionValue } from '@nestjs/common/interfaces'; +export type HttpEntrypointMetadata = { + path: string; + requestMethod: keyof typeof RequestMethod; + methodVersion?: VersionValue; + controllerVersion?: VersionValue; +}; +export type MiddlewareEntrypointMetadata = { + path: string; + requestMethod: keyof typeof RequestMethod; + version?: VersionValue; +}; +export type Entrypoint = { + id?: string; + type: string; + methodName: string; + className: string; + classNodeId: string; + metadata: { + key: string; + } & T; +}; diff --git a/node_modules/@nestjs/core/inspector/interfaces/entrypoint.interface.js b/node_modules/@nestjs/core/inspector/interfaces/entrypoint.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/entrypoint.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/inspector/interfaces/extras.interface.d.ts b/node_modules/@nestjs/core/inspector/interfaces/extras.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..424b7b74a8f8d259c88782d4fcd620fa39bf40dd --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/extras.interface.d.ts @@ -0,0 +1,18 @@ +import { EnhancerSubtype } from '@nestjs/common/constants'; +/** + * Enhancers attached through APP_PIPE, APP_GUARD, APP_INTERCEPTOR, and APP_FILTER tokens. + */ +export interface AttachedEnhancerDefinition { + nodeId: string; +} +/** + * Enhancers registered through "app.useGlobalPipes()", "app.useGlobalGuards()", "app.useGlobalInterceptors()", and "app.useGlobalFilters()" methods. + */ +export interface OrphanedEnhancerDefinition { + subtype: EnhancerSubtype; + ref: unknown; +} +export interface Extras { + orphanedEnhancers: Array; + attachedEnhancers: Array; +} diff --git a/node_modules/@nestjs/core/inspector/interfaces/extras.interface.js b/node_modules/@nestjs/core/inspector/interfaces/extras.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/extras.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/inspector/interfaces/node.interface.d.ts b/node_modules/@nestjs/core/inspector/interfaces/node.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bfe42280088391cd17452a64ccd9455eee59f01d --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/node.interface.d.ts @@ -0,0 +1,48 @@ +import { InjectionToken, Scope } from '@nestjs/common'; +import { EnhancerSubtype } from '@nestjs/common/constants'; +export type ModuleNode = { + metadata: { + type: 'module'; + global: boolean; + dynamic: boolean; + internal: boolean; + }; +}; +export type ClassNode = { + parent: string; + metadata: { + type: 'provider' | 'controller' | 'middleware' | 'injectable'; + subtype?: EnhancerSubtype; + sourceModuleName: string; + durable: boolean; + static: boolean; + transient: boolean; + exported: boolean; + scope: Scope; + token: InjectionToken; + initTime: number; + /** + * Enhancers metadata collection + */ + enhancers?: Array<{ + id: string; + subtype: EnhancerSubtype; + } | { + name: string; + methodKey?: string; + subtype: EnhancerSubtype; + }>; + /** + * If true, node is a globally registered enhancer + */ + global?: boolean; + /** + * If true, indicates that this node represents an internal provider + */ + internal?: boolean; + }; +}; +export type Node = { + id: string; + label: string; +} & (ClassNode | ModuleNode); diff --git a/node_modules/@nestjs/core/inspector/interfaces/node.interface.js b/node_modules/@nestjs/core/inspector/interfaces/node.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/node.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-json.interface.d.ts b/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-json.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..22e9367e6c7f1d74682cf002a9ff93c33d3b3fc9 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-json.interface.d.ts @@ -0,0 +1,14 @@ +import { SerializedGraphStatus } from '../serialized-graph'; +import { Edge } from './edge.interface'; +import { Entrypoint } from './entrypoint.interface'; +import { Extras } from './extras.interface'; +import { Node } from './node.interface'; +import { SerializedGraphMetadata } from './serialized-graph-metadata.interface'; +export interface SerializedGraphJson { + nodes: Record; + edges: Record; + entrypoints: Record[]>; + extras: Extras; + status?: SerializedGraphStatus; + metadata?: SerializedGraphMetadata; +} diff --git a/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-json.interface.js b/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-json.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-json.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-metadata.interface.d.ts b/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-metadata.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1d480f87545b3f37eaec150b92cf1f537c052d35 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-metadata.interface.d.ts @@ -0,0 +1,10 @@ +import { InjectorDependencyContext } from '../../injector/injector'; +export interface SerializedGraphMetadata { + cause: { + type: 'unknown-dependencies' | 'unknown'; + context?: InjectorDependencyContext; + moduleId?: string; + nodeId?: string; + error?: any; + }; +} diff --git a/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-metadata.interface.js b/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-metadata.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/inspector/interfaces/serialized-graph-metadata.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/inspector/noop-graph-inspector.d.ts b/node_modules/@nestjs/core/inspector/noop-graph-inspector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c7e02c8d3c83ee703dd5f3841c0c4785065cc7bd --- /dev/null +++ b/node_modules/@nestjs/core/inspector/noop-graph-inspector.d.ts @@ -0,0 +1,2 @@ +import { GraphInspector } from './graph-inspector'; +export declare const NoopGraphInspector: GraphInspector; diff --git a/node_modules/@nestjs/core/inspector/noop-graph-inspector.js b/node_modules/@nestjs/core/inspector/noop-graph-inspector.js new file mode 100644 index 0000000000000000000000000000000000000000..ac7a865b6757f50250069b107c84454b87965f07 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/noop-graph-inspector.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoopGraphInspector = void 0; +const graph_inspector_1 = require("./graph-inspector"); +const noop = () => { }; +exports.NoopGraphInspector = new Proxy(graph_inspector_1.GraphInspector.prototype, { + get: () => noop, +}); diff --git a/node_modules/@nestjs/core/inspector/partial-graph.host.d.ts b/node_modules/@nestjs/core/inspector/partial-graph.host.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3729721ae853293bdbf65d24c9b80743c3d989e --- /dev/null +++ b/node_modules/@nestjs/core/inspector/partial-graph.host.d.ts @@ -0,0 +1,7 @@ +import { SerializedGraph } from './serialized-graph'; +export declare class PartialGraphHost { + private static partialGraph; + static toJSON(): import("./interfaces/serialized-graph-json.interface").SerializedGraphJson; + static toString(): string; + static register(partialGraph: SerializedGraph): void; +} diff --git a/node_modules/@nestjs/core/inspector/partial-graph.host.js b/node_modules/@nestjs/core/inspector/partial-graph.host.js new file mode 100644 index 0000000000000000000000000000000000000000..8ea5e2cfbff2d1ee46e84a52000ccafbcaa74e87 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/partial-graph.host.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PartialGraphHost = void 0; +class PartialGraphHost { + static toJSON() { + return this.partialGraph?.toJSON(); + } + static toString() { + return this.partialGraph?.toString(); + } + static register(partialGraph) { + this.partialGraph = partialGraph; + } +} +exports.PartialGraphHost = PartialGraphHost; diff --git a/node_modules/@nestjs/core/inspector/serialized-graph.d.ts b/node_modules/@nestjs/core/inspector/serialized-graph.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9bc261ed70c3915e5778719d26d3f7e967432bf0 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/serialized-graph.d.ts @@ -0,0 +1,52 @@ +import { InjectionToken } from '@nestjs/common'; +import { Edge } from './interfaces/edge.interface'; +import { Entrypoint } from './interfaces/entrypoint.interface'; +import { OrphanedEnhancerDefinition } from './interfaces/extras.interface'; +import { Node } from './interfaces/node.interface'; +import { SerializedGraphJson } from './interfaces/serialized-graph-json.interface'; +import { SerializedGraphMetadata } from './interfaces/serialized-graph-metadata.interface'; +export type SerializedGraphStatus = 'partial' | 'complete'; +type WithOptionalId> = Omit & Partial>; +export declare class SerializedGraph { + private readonly nodes; + private readonly edges; + private readonly entrypoints; + private readonly extras; + private _status; + private _metadata?; + private static readonly INTERNAL_PROVIDERS; + set status(status: SerializedGraphStatus); + set metadata(metadata: SerializedGraphMetadata); + insertNode(nodeDefinition: Node): Node | undefined; + insertEdge(edgeDefinition: WithOptionalId): { + id: string; + source: string; + target: string; + metadata: ({ + type: "module-to-module"; + } & { + sourceModuleName: string; + targetModuleName: string; + }) | ({ + type: "class-to-class"; + sourceClassName: string; + targetClassName: string; + sourceClassToken: InjectionToken; + targetClassToken: InjectionToken; + injectionType: "constructor" | "property" | "decorator"; + keyOrIndex?: string | number | symbol; + internal?: boolean; + } & { + sourceModuleName: string; + targetModuleName: string; + }); + }; + insertEntrypoint(definition: Entrypoint, parentId: string): void; + insertOrphanedEnhancer(entry: OrphanedEnhancerDefinition): void; + insertAttachedEnhancer(nodeId: string): void; + getNodeById(id: string): Node | undefined; + toJSON(): SerializedGraphJson; + toString(): string; + private generateUuidByEdgeDefinition; +} +export {}; diff --git a/node_modules/@nestjs/core/inspector/serialized-graph.js b/node_modules/@nestjs/core/inspector/serialized-graph.js new file mode 100644 index 0000000000000000000000000000000000000000..92a47f0b744b860795ddfd2eaa3519773c1e37aa --- /dev/null +++ b/node_modules/@nestjs/core/inspector/serialized-graph.js @@ -0,0 +1,124 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SerializedGraph = void 0; +const application_config_1 = require("../application-config"); +const external_context_creator_1 = require("../helpers/external-context-creator"); +const http_adapter_host_1 = require("../helpers/http-adapter-host"); +const inquirer_constants_1 = require("../injector/inquirer/inquirer-constants"); +const lazy_module_loader_1 = require("../injector/lazy-module-loader/lazy-module-loader"); +const module_ref_1 = require("../injector/module-ref"); +const modules_container_1 = require("../injector/modules-container"); +const request_constants_1 = require("../router/request/request-constants"); +const reflector_service_1 = require("../services/reflector.service"); +const deterministic_uuid_registry_1 = require("./deterministic-uuid-registry"); +class SerializedGraph { + constructor() { + this.nodes = new Map(); + this.edges = new Map(); + this.entrypoints = new Map(); + this.extras = { + orphanedEnhancers: [], + attachedEnhancers: [], + }; + this._status = 'complete'; + } + set status(status) { + this._status = status; + } + set metadata(metadata) { + this._metadata = metadata; + } + insertNode(nodeDefinition) { + if (nodeDefinition.metadata.type === 'provider' && + SerializedGraph.INTERNAL_PROVIDERS.includes(nodeDefinition.metadata.token)) { + nodeDefinition.metadata = { + ...nodeDefinition.metadata, + internal: true, + }; + } + if (this.nodes.has(nodeDefinition.id)) { + return this.nodes.get(nodeDefinition.id); + } + this.nodes.set(nodeDefinition.id, nodeDefinition); + return nodeDefinition; + } + insertEdge(edgeDefinition) { + if (edgeDefinition.metadata.type === 'class-to-class' && + (SerializedGraph.INTERNAL_PROVIDERS.includes(edgeDefinition.metadata.sourceClassToken) || + SerializedGraph.INTERNAL_PROVIDERS.includes(edgeDefinition.metadata.targetClassToken))) { + edgeDefinition.metadata = { + ...edgeDefinition.metadata, + internal: true, + }; + } + const id = edgeDefinition.id ?? this.generateUuidByEdgeDefinition(edgeDefinition); + const edge = { + ...edgeDefinition, + id, + }; + this.edges.set(id, edge); + return edge; + } + insertEntrypoint(definition, parentId) { + if (this.entrypoints.has(parentId)) { + const existingCollection = this.entrypoints.get(parentId); + existingCollection.push(definition); + } + else { + this.entrypoints.set(parentId, [definition]); + } + } + insertOrphanedEnhancer(entry) { + this.extras.orphanedEnhancers.push(entry); + } + insertAttachedEnhancer(nodeId) { + this.extras.attachedEnhancers.push({ + nodeId, + }); + } + getNodeById(id) { + return this.nodes.get(id); + } + toJSON() { + const json = { + nodes: Object.fromEntries(this.nodes), + edges: Object.fromEntries(this.edges), + entrypoints: Object.fromEntries(this.entrypoints), + extras: this.extras, + }; + if (this._status) { + json['status'] = this._status; + } + if (this._metadata) { + json['metadata'] = this._metadata; + } + return json; + } + toString() { + const replacer = (key, value) => { + if (typeof value === 'symbol') { + return value.toString(); + } + return typeof value === 'function' ? (value.name ?? 'Function') : value; + }; + return JSON.stringify(this.toJSON(), replacer, 2); + } + generateUuidByEdgeDefinition(edgeDefinition) { + return deterministic_uuid_registry_1.DeterministicUuidRegistry.get(JSON.stringify(edgeDefinition)); + } +} +exports.SerializedGraph = SerializedGraph; +SerializedGraph.INTERNAL_PROVIDERS = [ + application_config_1.ApplicationConfig, + module_ref_1.ModuleRef, + http_adapter_host_1.HttpAdapterHost, + lazy_module_loader_1.LazyModuleLoader, + external_context_creator_1.ExternalContextCreator, + modules_container_1.ModulesContainer, + reflector_service_1.Reflector, + SerializedGraph, + http_adapter_host_1.HttpAdapterHost.name, + reflector_service_1.Reflector.name, + request_constants_1.REQUEST, + inquirer_constants_1.INQUIRER, +]; diff --git a/node_modules/@nestjs/core/inspector/uuid-factory.d.ts b/node_modules/@nestjs/core/inspector/uuid-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..43039d04261da2db2ac0a382e53bfe0d12fb6703 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/uuid-factory.d.ts @@ -0,0 +1,9 @@ +export declare enum UuidFactoryMode { + Random = "random", + Deterministic = "deterministic" +} +export declare class UuidFactory { + private static _mode; + static set mode(value: UuidFactoryMode); + static get(key?: string): any; +} diff --git a/node_modules/@nestjs/core/inspector/uuid-factory.js b/node_modules/@nestjs/core/inspector/uuid-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..5cfe1b316a58ac2e10245b64f28102fddd83e659 --- /dev/null +++ b/node_modules/@nestjs/core/inspector/uuid-factory.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UuidFactory = exports.UuidFactoryMode = void 0; +const random_string_generator_util_1 = require("@nestjs/common/utils/random-string-generator.util"); +const deterministic_uuid_registry_1 = require("./deterministic-uuid-registry"); +var UuidFactoryMode; +(function (UuidFactoryMode) { + UuidFactoryMode["Random"] = "random"; + UuidFactoryMode["Deterministic"] = "deterministic"; +})(UuidFactoryMode || (exports.UuidFactoryMode = UuidFactoryMode = {})); +class UuidFactory { + static set mode(value) { + this._mode = value; + } + static get(key = '') { + return this._mode === UuidFactoryMode.Deterministic + ? deterministic_uuid_registry_1.DeterministicUuidRegistry.get(key) + : (0, random_string_generator_util_1.randomStringGenerator)(); + } +} +exports.UuidFactory = UuidFactory; +UuidFactory._mode = UuidFactoryMode.Random; diff --git a/node_modules/@nestjs/core/interceptors/index.d.ts b/node_modules/@nestjs/core/interceptors/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7835bb29b4772301b910d89c31c3141a1e93d571 --- /dev/null +++ b/node_modules/@nestjs/core/interceptors/index.d.ts @@ -0,0 +1,2 @@ +export * from './interceptors-consumer'; +export * from './interceptors-context-creator'; diff --git a/node_modules/@nestjs/core/interceptors/index.js b/node_modules/@nestjs/core/interceptors/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4889ba326a9fddf4f99223dd315aded5126a114c --- /dev/null +++ b/node_modules/@nestjs/core/interceptors/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./interceptors-consumer"), exports); +tslib_1.__exportStar(require("./interceptors-context-creator"), exports); diff --git a/node_modules/@nestjs/core/interceptors/interceptors-consumer.d.ts b/node_modules/@nestjs/core/interceptors/interceptors-consumer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..af852433ff07406d6fd824fec3d4a53905e0230d --- /dev/null +++ b/node_modules/@nestjs/core/interceptors/interceptors-consumer.d.ts @@ -0,0 +1,9 @@ +import { NestInterceptor } from '@nestjs/common'; +import { ContextType, Controller } from '@nestjs/common/interfaces'; +import { Observable } from 'rxjs'; +import { ExecutionContextHost } from '../helpers/execution-context-host'; +export declare class InterceptorsConsumer { + intercept(interceptors: NestInterceptor[], args: unknown[], instance: Controller, callback: (...args: unknown[]) => unknown, next: () => Promise, type?: TContext): Promise; + createContext(args: unknown[], instance: Controller, callback: (...args: unknown[]) => unknown): ExecutionContextHost; + transformDeferred(next: () => Promise): Observable; +} diff --git a/node_modules/@nestjs/core/interceptors/interceptors-consumer.js b/node_modules/@nestjs/core/interceptors/interceptors-consumer.js new file mode 100644 index 0000000000000000000000000000000000000000..7c5130c61c1a8d5ee4e1bd10f540d905032d9ecc --- /dev/null +++ b/node_modules/@nestjs/core/interceptors/interceptors-consumer.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InterceptorsConsumer = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const async_hooks_1 = require("async_hooks"); +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const execution_context_host_1 = require("../helpers/execution-context-host"); +class InterceptorsConsumer { + async intercept(interceptors, args, instance, callback, next, type) { + if ((0, shared_utils_1.isEmpty)(interceptors)) { + return next(); + } + const context = this.createContext(args, instance, callback); + context.setType(type); + const nextFn = async (i = 0) => { + if (i >= interceptors.length) { + return (0, rxjs_1.defer)(async_hooks_1.AsyncResource.bind(() => this.transformDeferred(next))); + } + const handler = { + handle: () => (0, rxjs_1.defer)(async_hooks_1.AsyncResource.bind(() => nextFn(i + 1))).pipe((0, operators_1.mergeAll)()), + }; + return interceptors[i].intercept(context, handler); + }; + return (0, rxjs_1.defer)(() => nextFn()).pipe((0, operators_1.mergeAll)()); + } + createContext(args, instance, callback) { + return new execution_context_host_1.ExecutionContextHost(args, instance.constructor, callback); + } + transformDeferred(next) { + return (0, rxjs_1.from)(next()).pipe((0, operators_1.switchMap)(res => { + const isDeferred = res instanceof Promise || res instanceof rxjs_1.Observable; + return isDeferred ? res : Promise.resolve(res); + })); + } +} +exports.InterceptorsConsumer = InterceptorsConsumer; diff --git a/node_modules/@nestjs/core/interceptors/interceptors-context-creator.d.ts b/node_modules/@nestjs/core/interceptors/interceptors-context-creator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..573176d8f9380bfa8c3ad66ed6bbafa770f140c1 --- /dev/null +++ b/node_modules/@nestjs/core/interceptors/interceptors-context-creator.d.ts @@ -0,0 +1,16 @@ +import { Controller, NestInterceptor, Type } from '@nestjs/common/interfaces'; +import { ApplicationConfig } from '../application-config'; +import { ContextCreator } from '../helpers/context-creator'; +import { NestContainer } from '../injector/container'; +import { InstanceWrapper } from '../injector/instance-wrapper'; +export declare class InterceptorsContextCreator extends ContextCreator { + private readonly container; + private readonly config?; + private moduleContext; + constructor(container: NestContainer, config?: ApplicationConfig | undefined); + create(instance: Controller, callback: (...args: unknown[]) => unknown, module: string, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): NestInterceptor[]; + createConcreteContext(metadata: T, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): R; + getInterceptorInstance(metatype: Function | NestInterceptor, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): NestInterceptor | null; + getInstanceByMetatype(metatype: Type): InstanceWrapper | undefined; + getGlobalMetadata(contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): T; +} diff --git a/node_modules/@nestjs/core/interceptors/interceptors-context-creator.js b/node_modules/@nestjs/core/interceptors/interceptors-context-creator.js new file mode 100644 index 0000000000000000000000000000000000000000..02d19cca3f54de67cfea79f37b80c4aedd2b5eaa --- /dev/null +++ b/node_modules/@nestjs/core/interceptors/interceptors-context-creator.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InterceptorsContextCreator = void 0; +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const context_creator_1 = require("../helpers/context-creator"); +const constants_2 = require("../injector/constants"); +class InterceptorsContextCreator extends context_creator_1.ContextCreator { + constructor(container, config) { + super(); + this.container = container; + this.config = config; + } + create(instance, callback, module, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + this.moduleContext = module; + return this.createContext(instance, callback, constants_1.INTERCEPTORS_METADATA, contextId, inquirerId); + } + createConcreteContext(metadata, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + if ((0, shared_utils_1.isEmpty)(metadata)) { + return []; + } + return (0, iterare_1.iterate)(metadata) + .filter(interceptor => interceptor && (interceptor.name || interceptor.intercept)) + .map(interceptor => this.getInterceptorInstance(interceptor, contextId, inquirerId)) + .filter((interceptor) => interceptor ? (0, shared_utils_1.isFunction)(interceptor.intercept) : false) + .toArray(); + } + getInterceptorInstance(metatype, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + const isObject = !!metatype.intercept; + if (isObject) { + return metatype; + } + const instanceWrapper = this.getInstanceByMetatype(metatype); + if (!instanceWrapper) { + return null; + } + const instanceHost = instanceWrapper.getInstanceByContextId(this.getContextId(contextId, instanceWrapper), inquirerId); + return instanceHost && instanceHost.instance; + } + getInstanceByMetatype(metatype) { + if (!this.moduleContext) { + return; + } + const collection = this.container.getModules(); + const moduleRef = collection.get(this.moduleContext); + if (!moduleRef) { + return; + } + return moduleRef.injectables.get(metatype); + } + getGlobalMetadata(contextId = constants_2.STATIC_CONTEXT, inquirerId) { + if (!this.config) { + return []; + } + const globalInterceptors = this.config.getGlobalInterceptors(); + if (contextId === constants_2.STATIC_CONTEXT && !inquirerId) { + return globalInterceptors; + } + const scopedInterceptorWrappers = this.config.getGlobalRequestInterceptors(); + const scopedInterceptors = (0, iterare_1.iterate)(scopedInterceptorWrappers) + .map(wrapper => wrapper.getInstanceByContextId(this.getContextId(contextId, wrapper), inquirerId)) + .filter(host => !!host) + .map(host => host.instance) + .toArray(); + return globalInterceptors.concat(scopedInterceptors); + } +} +exports.InterceptorsContextCreator = InterceptorsContextCreator; diff --git a/node_modules/@nestjs/core/interfaces/index.d.ts b/node_modules/@nestjs/core/interfaces/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..448bd8e425cc877eebfd9c128343e1f9c0db1339 --- /dev/null +++ b/node_modules/@nestjs/core/interfaces/index.d.ts @@ -0,0 +1,2 @@ +export * from './module-definition.interface.js'; +export * from './module-override.interface.js'; diff --git a/node_modules/@nestjs/core/interfaces/index.js b/node_modules/@nestjs/core/interfaces/index.js new file mode 100644 index 0000000000000000000000000000000000000000..448bd8e425cc877eebfd9c128343e1f9c0db1339 --- /dev/null +++ b/node_modules/@nestjs/core/interfaces/index.js @@ -0,0 +1,2 @@ +export * from './module-definition.interface.js'; +export * from './module-override.interface.js'; diff --git a/node_modules/@nestjs/core/interfaces/module-definition.interface.d.ts b/node_modules/@nestjs/core/interfaces/module-definition.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8537d645d30de6ee319bf7850ce5012dc98ad145 --- /dev/null +++ b/node_modules/@nestjs/core/interfaces/module-definition.interface.d.ts @@ -0,0 +1,3 @@ +import { DynamicModule, ForwardReference } from '@nestjs/common'; +import { Type } from '@nestjs/common/interfaces'; +export type ModuleDefinition = ForwardReference | Type | DynamicModule | Promise; diff --git a/node_modules/@nestjs/core/interfaces/module-definition.interface.js b/node_modules/@nestjs/core/interfaces/module-definition.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/interfaces/module-definition.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/interfaces/module-override.interface.d.ts b/node_modules/@nestjs/core/interfaces/module-override.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8d33e72c710c73116ce98aa25f4564b925342bcd --- /dev/null +++ b/node_modules/@nestjs/core/interfaces/module-override.interface.d.ts @@ -0,0 +1,5 @@ +import { ModuleDefinition } from './module-definition.interface'; +export interface ModuleOverride { + moduleToReplace: ModuleDefinition; + newModule: ModuleDefinition; +} diff --git a/node_modules/@nestjs/core/interfaces/module-override.interface.js b/node_modules/@nestjs/core/interfaces/module-override.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/interfaces/module-override.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/internal.d.ts b/node_modules/@nestjs/core/internal.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..358cee2c4330a2e3e18de14e4ea6aae219fdcf48 --- /dev/null +++ b/node_modules/@nestjs/core/internal.d.ts @@ -0,0 +1,38 @@ +/** + * Internal module - not part of the public API. + * These exports are used by sibling @nestjs packages. + * Do not depend on these in your application code. + * @internal + * @module + */ +export { RuntimeException } from './errors/exceptions/runtime.exception.js'; +export { InvalidExceptionFilterException } from './errors/exceptions/invalid-exception-filter.exception.js'; +export { MESSAGES } from './constants.js'; +export { DependenciesScanner } from './scanner.js'; +export { Injector, InjectorDependencyContext } from './injector/injector.js'; +export { InstanceLoader } from './injector/instance-loader.js'; +export { InstanceWrapper } from './injector/instance-wrapper.js'; +export { Module } from './injector/module.js'; +export { STATIC_CONTEXT } from './injector/constants.js'; +export { ExecutionContextHost } from './helpers/execution-context-host.js'; +export { ContextUtils, ParamProperties } from './helpers/context-utils.js'; +export { HandlerMetadataStorage } from './helpers/handler-metadata-storage.js'; +export { RouterMethodFactory } from './helpers/router-method-factory.js'; +export { loadAdapter } from './helpers/load-adapter.js'; +export { optionalRequire } from './helpers/optional-require.js'; +export { ParamsMetadata } from './helpers/interfaces/index.js'; +export { GuardsConsumer } from './guards/guards-consumer.js'; +export { GuardsContextCreator } from './guards/guards-context-creator.js'; +export { FORBIDDEN_MESSAGE } from './guards/constants.js'; +export { PipesConsumer } from './pipes/pipes-consumer.js'; +export { PipesContextCreator } from './pipes/pipes-context-creator.js'; +export { ParamsTokenFactory } from './pipes/params-token-factory.js'; +export { InterceptorsConsumer } from './interceptors/interceptors-consumer.js'; +export { InterceptorsContextCreator } from './interceptors/interceptors-context-creator.js'; +export { BaseExceptionFilterContext } from './exceptions/base-exception-filter-context.js'; +export { LegacyRouteConverter } from './router/legacy-route-converter.js'; +export { REQUEST_CONTEXT_ID } from './router/request/request-constants.js'; +export { NoopGraphInspector } from './inspector/noop-graph-inspector.js'; +export { UuidFactory, UuidFactoryMode } from './inspector/uuid-factory.js'; +export { ModuleDefinition } from './interfaces/module-definition.interface.js'; +export { ModuleOverride } from './interfaces/module-override.interface.js'; diff --git a/node_modules/@nestjs/core/internal.js b/node_modules/@nestjs/core/internal.js new file mode 100644 index 0000000000000000000000000000000000000000..bc3531aaca855c76214f34bab0b09ab22a8dcee3 --- /dev/null +++ b/node_modules/@nestjs/core/internal.js @@ -0,0 +1,46 @@ +/** + * Internal module - not part of the public API. + * These exports are used by sibling @nestjs packages. + * Do not depend on these in your application code. + * @internal + * @module + */ +// Errors +export { RuntimeException } from './errors/exceptions/runtime.exception.js'; +export { InvalidExceptionFilterException } from './errors/exceptions/invalid-exception-filter.exception.js'; +// Constants +export { MESSAGES } from './constants.js'; +// Scanner +export { DependenciesScanner } from './scanner.js'; +// Injector +export { Injector } from './injector/injector.js'; +export { InstanceLoader } from './injector/instance-loader.js'; +export { InstanceWrapper } from './injector/instance-wrapper.js'; +export { Module } from './injector/module.js'; +export { STATIC_CONTEXT } from './injector/constants.js'; +// Helpers +export { ExecutionContextHost } from './helpers/execution-context-host.js'; +export { ContextUtils } from './helpers/context-utils.js'; +export { HandlerMetadataStorage } from './helpers/handler-metadata-storage.js'; +export { RouterMethodFactory } from './helpers/router-method-factory.js'; +export { loadAdapter } from './helpers/load-adapter.js'; +export { optionalRequire } from './helpers/optional-require.js'; +// Guards +export { GuardsConsumer } from './guards/guards-consumer.js'; +export { GuardsContextCreator } from './guards/guards-context-creator.js'; +export { FORBIDDEN_MESSAGE } from './guards/constants.js'; +// Pipes +export { PipesConsumer } from './pipes/pipes-consumer.js'; +export { PipesContextCreator } from './pipes/pipes-context-creator.js'; +export { ParamsTokenFactory } from './pipes/params-token-factory.js'; +// Interceptors +export { InterceptorsConsumer } from './interceptors/interceptors-consumer.js'; +export { InterceptorsContextCreator } from './interceptors/interceptors-context-creator.js'; +// Exceptions +export { BaseExceptionFilterContext } from './exceptions/base-exception-filter-context.js'; +// Router +export { LegacyRouteConverter } from './router/legacy-route-converter.js'; +export { REQUEST_CONTEXT_ID } from './router/request/request-constants.js'; +// Inspector +export { NoopGraphInspector } from './inspector/noop-graph-inspector.js'; +export { UuidFactory, UuidFactoryMode } from './inspector/uuid-factory.js'; diff --git a/node_modules/@nestjs/core/metadata-scanner.d.ts b/node_modules/@nestjs/core/metadata-scanner.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9593e7792b595a9be9437fcd3e638ad1d62bb58e --- /dev/null +++ b/node_modules/@nestjs/core/metadata-scanner.d.ts @@ -0,0 +1,17 @@ +import { Injectable } from '@nestjs/common/interfaces/injectable.interface'; +export declare class MetadataScanner { + private readonly cachedScannedPrototypes; + /** + * @deprecated + * @see {@link getAllMethodNames} + * @see getAllMethodNames + */ + scanFromPrototype(instance: T, prototype: object | null, callback: (name: string) => R): R[]; + /** + * @deprecated + * @see {@link getAllMethodNames} + * @see getAllMethodNames + */ + getAllFilteredMethodNames(prototype: object): IterableIterator; + getAllMethodNames(prototype: object | null): string[]; +} diff --git a/node_modules/@nestjs/core/metadata-scanner.js b/node_modules/@nestjs/core/metadata-scanner.js new file mode 100644 index 0000000000000000000000000000000000000000..84f9648b3e3fd162deb676168d622e1d612f2611 --- /dev/null +++ b/node_modules/@nestjs/core/metadata-scanner.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MetadataScanner = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +class MetadataScanner { + constructor() { + this.cachedScannedPrototypes = new Map(); + } + /** + * @deprecated + * @see {@link getAllMethodNames} + * @see getAllMethodNames + */ + scanFromPrototype(instance, prototype, callback) { + if (!prototype) { + return []; + } + const visitedNames = new Map(); + const result = []; + do { + for (const property of Object.getOwnPropertyNames(prototype)) { + if (visitedNames.has(property)) { + continue; + } + visitedNames.set(property, true); + // reason: https://github.com/nestjs/nest/pull/10821#issuecomment-1411916533 + const descriptor = Object.getOwnPropertyDescriptor(prototype, property); + if (descriptor.set || + descriptor.get || + (0, shared_utils_1.isConstructor)(property) || + !(0, shared_utils_1.isFunction)(prototype[property])) { + continue; + } + const value = callback(property); + if ((0, shared_utils_1.isNil)(value)) { + continue; + } + result.push(value); + } + } while ((prototype = Reflect.getPrototypeOf(prototype)) && + prototype !== Object.prototype); + return result; + } + /** + * @deprecated + * @see {@link getAllMethodNames} + * @see getAllMethodNames + */ + *getAllFilteredMethodNames(prototype) { + yield* this.getAllMethodNames(prototype); + } + getAllMethodNames(prototype) { + if (!prototype) { + return []; + } + if (this.cachedScannedPrototypes.has(prototype)) { + return this.cachedScannedPrototypes.get(prototype); + } + const visitedNames = new Map(); + const result = []; + this.cachedScannedPrototypes.set(prototype, result); + do { + for (const property of Object.getOwnPropertyNames(prototype)) { + if (visitedNames.has(property)) { + continue; + } + visitedNames.set(property, true); + // reason: https://github.com/nestjs/nest/pull/10821#issuecomment-1411916533 + const descriptor = Object.getOwnPropertyDescriptor(prototype, property); + if (descriptor.set || + descriptor.get || + (0, shared_utils_1.isConstructor)(property) || + !(0, shared_utils_1.isFunction)(prototype[property])) { + continue; + } + result.push(property); + } + } while ((prototype = Reflect.getPrototypeOf(prototype)) && + prototype !== Object.prototype); + return result; + } +} +exports.MetadataScanner = MetadataScanner; diff --git a/node_modules/@nestjs/core/middleware/builder.d.ts b/node_modules/@nestjs/core/middleware/builder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..789710f9a497cb071477be17084ebff0bf8fd4d5 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/builder.d.ts @@ -0,0 +1,15 @@ +import { HttpServer, MiddlewareConsumer, Type } from '@nestjs/common/interfaces'; +import { MiddlewareConfigProxy, MiddlewareConfiguration } from '@nestjs/common/interfaces/middleware'; +import { RouteInfoPathExtractor } from './route-info-path-extractor'; +import { RoutesMapper } from './routes-mapper'; +export declare class MiddlewareBuilder implements MiddlewareConsumer { + private readonly routesMapper; + private readonly httpAdapter; + private readonly routeInfoPathExtractor; + private readonly middlewareCollection; + constructor(routesMapper: RoutesMapper, httpAdapter: HttpServer, routeInfoPathExtractor: RouteInfoPathExtractor); + apply(...middleware: Array | Function | Array | Function>>): MiddlewareConfigProxy; + build(): MiddlewareConfiguration[]; + getHttpAdapter(): HttpServer; + private static readonly ConfigProxy; +} diff --git a/node_modules/@nestjs/core/middleware/builder.js b/node_modules/@nestjs/core/middleware/builder.js new file mode 100644 index 0000000000000000000000000000000000000000..3aacb2915d2b3ceca40d3119edd698c90b62ad08 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/builder.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MiddlewareBuilder = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const utils_1 = require("./utils"); +class MiddlewareBuilder { + constructor(routesMapper, httpAdapter, routeInfoPathExtractor) { + this.routesMapper = routesMapper; + this.httpAdapter = httpAdapter; + this.routeInfoPathExtractor = routeInfoPathExtractor; + this.middlewareCollection = new Set(); + } + apply(...middleware) { + return new MiddlewareBuilder.ConfigProxy(this, middleware.flat(), this.routeInfoPathExtractor); + } + build() { + return [...this.middlewareCollection]; + } + getHttpAdapter() { + return this.httpAdapter; + } +} +exports.MiddlewareBuilder = MiddlewareBuilder; +MiddlewareBuilder.ConfigProxy = class { + constructor(builder, middleware, routeInfoPathExtractor) { + this.builder = builder; + this.middleware = middleware; + this.routeInfoPathExtractor = routeInfoPathExtractor; + this.excludedRoutes = []; + } + getExcludedRoutes() { + return this.excludedRoutes; + } + exclude(...routes) { + this.excludedRoutes = [ + ...this.excludedRoutes, + ...this.getRoutesFlatList(routes).reduce((excludedRoutes, route) => { + for (const routePath of this.routeInfoPathExtractor.extractPathFrom(route)) { + excludedRoutes.push({ + ...route, + path: routePath, + }); + } + return excludedRoutes; + }, []), + ]; + return this; + } + forRoutes(...routes) { + const { middlewareCollection } = this.builder; + const flattedRoutes = this.getRoutesFlatList(routes); + const forRoutes = this.removeOverlappedRoutes(flattedRoutes); + const configuration = { + middleware: (0, utils_1.filterMiddleware)(this.middleware, this.excludedRoutes, this.builder.getHttpAdapter()), + forRoutes, + }; + middlewareCollection.add(configuration); + return this.builder; + } + getRoutesFlatList(routes) { + const { routesMapper } = this.builder; + return (0, iterare_1.iterate)(routes) + .map(route => routesMapper.mapRouteToRouteInfo(route)) + .flatten() + .toArray(); + } + removeOverlappedRoutes(routes) { + const regexMatchParams = /(:[^/]*)/g; + const wildcard = '([^/]*)'; + const routesWithRegex = routes + .filter(route => route.path.includes(':')) + .map(route => ({ + method: route.method, + path: route.path, + regex: new RegExp('^(' + route.path.replace(regexMatchParams, wildcard) + ')$', 'g'), + })); + return routes.filter(route => { + const isOverlapped = (item) => { + if (route.method !== item.method) { + return false; + } + const normalizedRoutePath = (0, shared_utils_1.stripEndSlash)(route.path); + return (normalizedRoutePath !== item.path && + item.regex.test(normalizedRoutePath)); + }; + const routeMatch = routesWithRegex.find(isOverlapped); + return routeMatch === undefined; + }); + } +}; diff --git a/node_modules/@nestjs/core/middleware/container.d.ts b/node_modules/@nestjs/core/middleware/container.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad464df89e51a61289a7b8eaaed6faa8553a621e --- /dev/null +++ b/node_modules/@nestjs/core/middleware/container.d.ts @@ -0,0 +1,14 @@ +import { InjectionToken } from '@nestjs/common'; +import { MiddlewareConfiguration } from '@nestjs/common/interfaces/middleware/middleware-configuration.interface'; +import { NestContainer } from '../injector/container'; +import { InstanceWrapper } from '../injector/instance-wrapper'; +export declare class MiddlewareContainer { + private readonly container; + private readonly middleware; + private readonly configurationSets; + constructor(container: NestContainer); + getMiddlewareCollection(moduleKey: string): Map; + getConfigurations(): Map>; + insertConfig(configList: MiddlewareConfiguration[], moduleKey: string): void; + private getTargetConfig; +} diff --git a/node_modules/@nestjs/core/middleware/container.js b/node_modules/@nestjs/core/middleware/container.js new file mode 100644 index 0000000000000000000000000000000000000000..98c0793765ad2a9d7925b4d7d5207d82145ed1e0 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/container.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MiddlewareContainer = void 0; +const get_class_scope_1 = require("../helpers/get-class-scope"); +const is_durable_1 = require("../helpers/is-durable"); +const instance_wrapper_1 = require("../injector/instance-wrapper"); +class MiddlewareContainer { + constructor(container) { + this.container = container; + this.middleware = new Map(); + this.configurationSets = new Map(); + } + getMiddlewareCollection(moduleKey) { + if (!this.middleware.has(moduleKey)) { + const moduleRef = this.container.getModuleByKey(moduleKey); + this.middleware.set(moduleKey, moduleRef.middlewares); + } + return this.middleware.get(moduleKey); + } + getConfigurations() { + return this.configurationSets; + } + insertConfig(configList, moduleKey) { + const middleware = this.getMiddlewareCollection(moduleKey); + const targetConfig = this.getTargetConfig(moduleKey); + const configurations = configList || []; + const insertMiddleware = (metatype) => { + const token = metatype; + middleware.set(token, new instance_wrapper_1.InstanceWrapper({ + scope: (0, get_class_scope_1.getClassScope)(metatype), + durable: (0, is_durable_1.isDurable)(metatype), + name: token?.name ?? token, + metatype, + token, + })); + }; + configurations.forEach(config => { + [].concat(config.middleware).map(insertMiddleware); + targetConfig.add(config); + }); + } + getTargetConfig(moduleName) { + if (!this.configurationSets.has(moduleName)) { + this.configurationSets.set(moduleName, new Set()); + } + return this.configurationSets.get(moduleName); + } +} +exports.MiddlewareContainer = MiddlewareContainer; diff --git a/node_modules/@nestjs/core/middleware/index.d.ts b/node_modules/@nestjs/core/middleware/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ecea700bcde573c2573d4ebb8a0aa61e1a27d169 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/index.d.ts @@ -0,0 +1 @@ +export * from './builder'; diff --git a/node_modules/@nestjs/core/middleware/index.js b/node_modules/@nestjs/core/middleware/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a0aa0aac649ed7e391d8619a00d5acd8792b85d6 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./builder"), exports); diff --git a/node_modules/@nestjs/core/middleware/middleware-module.d.ts b/node_modules/@nestjs/core/middleware/middleware-module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ac3b172ef2ca4860628c39bcff496e0f58241e11 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/middleware-module.d.ts @@ -0,0 +1,33 @@ +import { HttpServer } from '@nestjs/common'; +import { MiddlewareConfiguration, RouteInfo } from '@nestjs/common/interfaces/middleware'; +import { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface'; +import { ApplicationConfig } from '../application-config'; +import { NestContainer } from '../injector/container'; +import { Injector } from '../injector/injector'; +import { Module } from '../injector/module'; +import { GraphInspector } from '../inspector/graph-inspector'; +import { MiddlewareContainer } from './container'; +export declare class MiddlewareModule { + private readonly routerProxy; + private readonly exceptionFiltersCache; + private readonly logger; + private injector; + private routerExceptionFilter; + private routesMapper; + private resolver; + private container; + private httpAdapter; + private graphInspector; + private appOptions; + private routeInfoPathExtractor; + register(middlewareContainer: MiddlewareContainer, container: NestContainer, config: ApplicationConfig, injector: Injector, httpAdapter: HttpServer, graphInspector: GraphInspector, options: TAppOptions): Promise; + resolveMiddleware(middlewareContainer: MiddlewareContainer, modules: Map): Promise; + loadConfiguration(middlewareContainer: MiddlewareContainer, moduleRef: Module, moduleKey: string): Promise; + registerMiddleware(middlewareContainer: MiddlewareContainer, applicationRef: any): Promise; + registerMiddlewareConfig(middlewareContainer: MiddlewareContainer, config: MiddlewareConfiguration, moduleKey: string, applicationRef: any): Promise; + registerRouteMiddleware(middlewareContainer: MiddlewareContainer, routeInfo: RouteInfo, config: MiddlewareConfiguration, moduleKey: string, applicationRef: any): Promise; + private bindHandler; + private createProxy; + private registerHandler; + private getContextId; +} diff --git a/node_modules/@nestjs/core/middleware/middleware-module.js b/node_modules/@nestjs/core/middleware/middleware-module.js new file mode 100644 index 0000000000000000000000000000000000000000..ec9603f3fc2e57d53309ade37adaeb1a8bc0d767 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/middleware-module.js @@ -0,0 +1,208 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MiddlewareModule = void 0; +const common_1 = require("@nestjs/common"); +const request_method_enum_1 = require("@nestjs/common/enums/request-method.enum"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const invalid_middleware_exception_1 = require("../errors/exceptions/invalid-middleware.exception"); +const runtime_exception_1 = require("../errors/exceptions/runtime.exception"); +const context_id_factory_1 = require("../helpers/context-id-factory"); +const execution_context_host_1 = require("../helpers/execution-context-host"); +const constants_1 = require("../injector/constants"); +const request_constants_1 = require("../router/request/request-constants"); +const router_exception_filters_1 = require("../router/router-exception-filters"); +const router_proxy_1 = require("../router/router-proxy"); +const utils_1 = require("../router/utils"); +const builder_1 = require("./builder"); +const resolver_1 = require("./resolver"); +const route_info_path_extractor_1 = require("./route-info-path-extractor"); +const routes_mapper_1 = require("./routes-mapper"); +class MiddlewareModule { + constructor() { + this.routerProxy = new router_proxy_1.RouterProxy(); + this.exceptionFiltersCache = new WeakMap(); + this.logger = new common_1.Logger(MiddlewareModule.name); + } + async register(middlewareContainer, container, config, injector, httpAdapter, graphInspector, options) { + this.appOptions = options; + const appRef = container.getHttpAdapterRef(); + this.routerExceptionFilter = new router_exception_filters_1.RouterExceptionFilters(container, config, appRef); + this.routesMapper = new routes_mapper_1.RoutesMapper(container, config); + this.resolver = new resolver_1.MiddlewareResolver(middlewareContainer, injector); + this.routeInfoPathExtractor = new route_info_path_extractor_1.RouteInfoPathExtractor(config); + this.injector = injector; + this.container = container; + this.httpAdapter = httpAdapter; + this.graphInspector = graphInspector; + const modules = container.getModules(); + await this.resolveMiddleware(middlewareContainer, modules); + } + async resolveMiddleware(middlewareContainer, modules) { + const moduleEntries = [...modules.entries()]; + const loadMiddlewareConfiguration = async ([moduleName, moduleRef]) => { + await this.loadConfiguration(middlewareContainer, moduleRef, moduleName); + await this.resolver.resolveInstances(moduleRef, moduleName); + }; + await Promise.all(moduleEntries.map(loadMiddlewareConfiguration)); + } + async loadConfiguration(middlewareContainer, moduleRef, moduleKey) { + const { instance } = moduleRef; + if (!instance.configure) { + return; + } + const middlewareBuilder = new builder_1.MiddlewareBuilder(this.routesMapper, this.httpAdapter, this.routeInfoPathExtractor); + try { + await instance.configure(middlewareBuilder); + } + catch (err) { + if (!this.appOptions.preview) { + throw err; + } + const warningMessage = `Warning! "${moduleRef.name}" module exposes a "configure" method that throws an exception in the preview mode` + + ` (possibly due to missing dependencies). Note: you can ignore this message, just be aware that some of those conditional middlewares will not be reflected in your graph.`; + this.logger.warn(warningMessage); + } + if (!(middlewareBuilder instanceof builder_1.MiddlewareBuilder)) { + return; + } + const config = middlewareBuilder.build(); + middlewareContainer.insertConfig(config, moduleKey); + } + async registerMiddleware(middlewareContainer, applicationRef) { + const configs = middlewareContainer.getConfigurations(); + const registerAllConfigs = async (moduleKey, middlewareConfig) => { + for (const config of middlewareConfig) { + await this.registerMiddlewareConfig(middlewareContainer, config, moduleKey, applicationRef); + } + }; + const entriesSortedByDistance = [...configs.entries()].sort(([moduleA], [moduleB]) => { + const moduleARef = this.container.getModuleByKey(moduleA); + const moduleBRef = this.container.getModuleByKey(moduleB); + const isModuleAGlobal = moduleARef.distance === Number.MAX_VALUE; + const isModuleBGlobal = moduleBRef.distance === Number.MAX_VALUE; + if (isModuleAGlobal && isModuleBGlobal) { + return 0; + } + if (isModuleAGlobal) { + return -1; + } + if (isModuleBGlobal) { + return 1; + } + return moduleARef.distance - moduleBRef.distance; + }); + for (const [moduleRef, moduleConfigurations] of entriesSortedByDistance) { + await registerAllConfigs(moduleRef, [...moduleConfigurations]); + } + } + async registerMiddlewareConfig(middlewareContainer, config, moduleKey, applicationRef) { + const { forRoutes } = config; + for (const routeInfo of forRoutes) { + await this.registerRouteMiddleware(middlewareContainer, routeInfo, config, moduleKey, applicationRef); + } + } + async registerRouteMiddleware(middlewareContainer, routeInfo, config, moduleKey, applicationRef) { + const middlewareCollection = [].concat(config.middleware); + const moduleRef = this.container.getModuleByKey(moduleKey); + for (const metatype of middlewareCollection) { + const collection = middlewareContainer.getMiddlewareCollection(moduleKey); + const instanceWrapper = collection.get(metatype); + if ((0, shared_utils_1.isUndefined)(instanceWrapper)) { + throw new runtime_exception_1.RuntimeException(); + } + if (instanceWrapper.isTransient) { + return; + } + this.graphInspector.insertClassNode(moduleRef, instanceWrapper, 'middleware'); + const middlewareDefinition = { + type: 'middleware', + methodName: 'use', + className: instanceWrapper.name, + classNodeId: instanceWrapper.id, + metadata: { + key: routeInfo.path, + path: routeInfo.path, + requestMethod: request_method_enum_1.RequestMethod[routeInfo.method] ?? + 'ALL', + version: routeInfo.version, + }, + }; + this.graphInspector.insertEntrypointDefinition(middlewareDefinition, instanceWrapper.id); + await this.bindHandler(instanceWrapper, applicationRef, routeInfo, moduleRef, collection); + } + } + async bindHandler(wrapper, applicationRef, routeInfo, moduleRef, collection) { + const { instance, metatype } = wrapper; + if ((0, shared_utils_1.isUndefined)(instance?.use)) { + throw new invalid_middleware_exception_1.InvalidMiddlewareException(metatype.name); + } + const isStatic = wrapper.isDependencyTreeStatic(); + if (isStatic) { + const proxy = await this.createProxy(instance); + return this.registerHandler(applicationRef, routeInfo, proxy); + } + const isTreeDurable = wrapper.isDependencyTreeDurable(); + await this.registerHandler(applicationRef, routeInfo, async (req, res, next) => { + try { + const contextId = this.getContextId(req, isTreeDurable); + const contextInstance = await this.injector.loadPerContext(instance, moduleRef, collection, contextId); + const proxy = await this.createProxy(contextInstance, contextId); + return proxy(req, res, next); + } + catch (err) { + let exceptionsHandler = this.exceptionFiltersCache.get(instance.use); + if (!exceptionsHandler) { + exceptionsHandler = this.routerExceptionFilter.create(instance, instance.use, undefined); + this.exceptionFiltersCache.set(instance.use, exceptionsHandler); + } + const host = new execution_context_host_1.ExecutionContextHost([req, res, next]); + exceptionsHandler.next(err, host); + } + }); + } + async createProxy(instance, contextId = constants_1.STATIC_CONTEXT) { + const exceptionsHandler = this.routerExceptionFilter.create(instance, instance.use, undefined, contextId); + const middleware = instance.use.bind(instance); + return this.routerProxy.createProxy(middleware, exceptionsHandler); + } + async registerHandler(applicationRef, routeInfo, proxy) { + const { method } = routeInfo; + const paths = this.routeInfoPathExtractor.extractPathsFrom(routeInfo); + const isMethodAll = (0, utils_1.isRequestMethodAll)(method); + const requestMethod = request_method_enum_1.RequestMethod[method]; + const router = await applicationRef.createMiddlewareFactory(method); + const middlewareFunction = isMethodAll + ? proxy + : (req, res, next) => { + const actualRequestMethod = applicationRef.getRequestMethod?.(req); + if (actualRequestMethod === requestMethod || + (actualRequestMethod === request_method_enum_1.RequestMethod[request_method_enum_1.RequestMethod.HEAD] && + requestMethod === request_method_enum_1.RequestMethod[request_method_enum_1.RequestMethod.GET])) { + return proxy(req, res, next); + } + return next(); + }; + const pathsToApplyMiddleware = []; + paths.some(path => path.match(/^\/?$/)) + ? pathsToApplyMiddleware.push('/') + : pathsToApplyMiddleware.push(...paths); + pathsToApplyMiddleware.forEach(path => router(path, middlewareFunction)); + } + getContextId(request, isTreeDurable) { + const contextId = context_id_factory_1.ContextIdFactory.getByRequest(request); + if (!request[request_constants_1.REQUEST_CONTEXT_ID]) { + Object.defineProperty(request, request_constants_1.REQUEST_CONTEXT_ID, { + value: contextId, + enumerable: false, + writable: false, + configurable: false, + }); + const requestProviderValue = isTreeDurable + ? contextId.payload + : Object.assign(request, contextId.payload); + this.container.registerRequestProvider(requestProviderValue, contextId); + } + return contextId; + } +} +exports.MiddlewareModule = MiddlewareModule; diff --git a/node_modules/@nestjs/core/middleware/resolver.d.ts b/node_modules/@nestjs/core/middleware/resolver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f9c0f3a689073060f190e3ed4cc14d83da979aa9 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/resolver.d.ts @@ -0,0 +1,10 @@ +import { Injector } from '../injector/injector'; +import { Module } from '../injector/module'; +import { MiddlewareContainer } from './container'; +export declare class MiddlewareResolver { + private readonly middlewareContainer; + private readonly injector; + constructor(middlewareContainer: MiddlewareContainer, injector: Injector); + resolveInstances(moduleRef: Module, moduleName: string): Promise; + private resolveMiddlewareInstance; +} diff --git a/node_modules/@nestjs/core/middleware/resolver.js b/node_modules/@nestjs/core/middleware/resolver.js new file mode 100644 index 0000000000000000000000000000000000000000..e8df718972f37077527ef0655e816952546249d6 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/resolver.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MiddlewareResolver = void 0; +class MiddlewareResolver { + constructor(middlewareContainer, injector) { + this.middlewareContainer = middlewareContainer; + this.injector = injector; + } + async resolveInstances(moduleRef, moduleName) { + const middlewareMap = this.middlewareContainer.getMiddlewareCollection(moduleName); + const resolveInstance = async (wrapper) => this.resolveMiddlewareInstance(wrapper, middlewareMap, moduleRef); + await Promise.all([...middlewareMap.values()].map(resolveInstance)); + } + async resolveMiddlewareInstance(wrapper, middlewareMap, moduleRef) { + await this.injector.loadMiddleware(wrapper, middlewareMap, moduleRef); + } +} +exports.MiddlewareResolver = MiddlewareResolver; diff --git a/node_modules/@nestjs/core/middleware/route-info-path-extractor.d.ts b/node_modules/@nestjs/core/middleware/route-info-path-extractor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fa7af651b3f312dddf1887a651e7a9f4bc871d4 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/route-info-path-extractor.d.ts @@ -0,0 +1,15 @@ +import { RouteInfo } from '@nestjs/common/interfaces'; +import { ApplicationConfig } from '../application-config'; +export declare class RouteInfoPathExtractor { + private readonly applicationConfig; + private readonly routePathFactory; + private readonly prefixPath; + private readonly excludedGlobalPrefixRoutes; + private readonly versioningConfig?; + constructor(applicationConfig: ApplicationConfig); + extractPathsFrom({ path, method, version }: RouteInfo): string[]; + extractPathFrom(route: RouteInfo): string[]; + private isAWildcard; + private extractNonWildcardPathsFrom; + private extractVersionPathFrom; +} diff --git a/node_modules/@nestjs/core/middleware/route-info-path-extractor.js b/node_modules/@nestjs/core/middleware/route-info-path-extractor.js new file mode 100644 index 0000000000000000000000000000000000000000..0d4777ebaede0f84ce575384aa7b2f301bf77655 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/route-info-path-extractor.js @@ -0,0 +1,81 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RouteInfoPathExtractor = void 0; +const common_1 = require("@nestjs/common"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const utils_1 = require("../router/utils"); +const route_path_factory_1 = require("./../router/route-path-factory"); +class RouteInfoPathExtractor { + constructor(applicationConfig) { + this.applicationConfig = applicationConfig; + this.routePathFactory = new route_path_factory_1.RoutePathFactory(applicationConfig); + this.prefixPath = (0, shared_utils_1.stripEndSlash)((0, shared_utils_1.addLeadingSlash)(this.applicationConfig.getGlobalPrefix())); + this.excludedGlobalPrefixRoutes = + this.applicationConfig.getGlobalPrefixOptions().exclude; + this.versioningConfig = this.applicationConfig.getVersioning(); + } + extractPathsFrom({ path, method, version }) { + const versionPaths = this.extractVersionPathFrom(version); + if (this.isAWildcard(path)) { + const entries = versionPaths.length > 0 + ? versionPaths + .map(versionPath => [ + this.prefixPath + versionPath + '$', + this.prefixPath + versionPath + (0, shared_utils_1.addLeadingSlash)(path), + ]) + .flat() + : this.prefixPath + ? [this.prefixPath + '$', this.prefixPath + (0, shared_utils_1.addLeadingSlash)(path)] + : [(0, shared_utils_1.addLeadingSlash)(path)]; + return Array.isArray(this.excludedGlobalPrefixRoutes) + ? [ + ...entries, + ...this.excludedGlobalPrefixRoutes + .map(route => Array.isArray(versionPaths) && versionPaths.length > 0 + ? versionPaths.map(v => v + (0, shared_utils_1.addLeadingSlash)(route.path)) + : (0, shared_utils_1.addLeadingSlash)(route.path)) + .flat(), + ] + : entries; + } + return this.extractNonWildcardPathsFrom({ path, method, version }); + } + extractPathFrom(route) { + if (this.isAWildcard(route.path) && !route.version) { + return [(0, shared_utils_1.addLeadingSlash)(route.path)]; + } + return this.extractNonWildcardPathsFrom(route); + } + isAWildcard(path) { + const isSimpleWildcard = ['*', '/*', '/*/', '(.*)', '/(.*)']; + if (isSimpleWildcard.includes(path)) { + return true; + } + const wildcardRegexp = /^\/\{.*\}.*|^\/\*.*$/; + return wildcardRegexp.test(path); + } + extractNonWildcardPathsFrom({ path, method, version, }) { + const versionPaths = this.extractVersionPathFrom(version); + if (Array.isArray(this.excludedGlobalPrefixRoutes) && + (0, utils_1.isRouteExcluded)(this.excludedGlobalPrefixRoutes, path, method)) { + if (!versionPaths.length) { + return [(0, shared_utils_1.addLeadingSlash)(path)]; + } + return versionPaths.map(versionPath => versionPath + (0, shared_utils_1.addLeadingSlash)(path)); + } + if (!versionPaths.length) { + return [this.prefixPath + (0, shared_utils_1.addLeadingSlash)(path)]; + } + return versionPaths.map(versionPath => this.prefixPath + versionPath + (0, shared_utils_1.addLeadingSlash)(path)); + } + extractVersionPathFrom(versionValue) { + if (!versionValue || this.versioningConfig?.type !== common_1.VersioningType.URI) + return []; + const versionPrefix = this.routePathFactory.getVersionPrefix(this.versioningConfig); + if (Array.isArray(versionValue)) { + return versionValue.map(version => (0, shared_utils_1.addLeadingSlash)(versionPrefix + version.toString())); + } + return [(0, shared_utils_1.addLeadingSlash)(versionPrefix + versionValue.toString())]; + } +} +exports.RouteInfoPathExtractor = RouteInfoPathExtractor; diff --git a/node_modules/@nestjs/core/middleware/routes-mapper.d.ts b/node_modules/@nestjs/core/middleware/routes-mapper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dfd9bceb7426fcc5e20884de0fbf550a017f7c53 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/routes-mapper.d.ts @@ -0,0 +1,19 @@ +import { RouteInfo, Type } from '@nestjs/common/interfaces'; +import { ApplicationConfig } from '../application-config'; +import { NestContainer } from '../injector/container'; +export declare class RoutesMapper { + private readonly container; + private readonly applicationConfig; + private readonly pathsExplorer; + constructor(container: NestContainer, applicationConfig: ApplicationConfig); + mapRouteToRouteInfo(controllerOrRoute: Type | RouteInfo | string): RouteInfo[]; + private getRouteInfoFromPath; + private getRouteInfoFromObject; + private getRouteInfoFromController; + private isRouteInfo; + private normalizeGlobalPath; + private getRoutePath; + private getHostModuleOfController; + private getModulePath; + private getVersionMetadata; +} diff --git a/node_modules/@nestjs/core/middleware/routes-mapper.js b/node_modules/@nestjs/core/middleware/routes-mapper.js new file mode 100644 index 0000000000000000000000000000000000000000..62045a09c4764c2dc53a63c0d1fe7a779517d776 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/routes-mapper.js @@ -0,0 +1,117 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RoutesMapper = void 0; +const constants_1 = require("@nestjs/common/constants"); +const interfaces_1 = require("@nestjs/common/interfaces"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const metadata_scanner_1 = require("../metadata-scanner"); +const paths_explorer_1 = require("../router/paths-explorer"); +const router_module_1 = require("../router/router-module"); +class RoutesMapper { + constructor(container, applicationConfig) { + this.container = container; + this.applicationConfig = applicationConfig; + this.pathsExplorer = new paths_explorer_1.PathsExplorer(new metadata_scanner_1.MetadataScanner()); + } + mapRouteToRouteInfo(controllerOrRoute) { + if ((0, shared_utils_1.isString)(controllerOrRoute)) { + return this.getRouteInfoFromPath(controllerOrRoute); + } + const routePathOrPaths = this.getRoutePath(controllerOrRoute); + if (this.isRouteInfo(routePathOrPaths, controllerOrRoute)) { + return this.getRouteInfoFromObject(controllerOrRoute); + } + return this.getRouteInfoFromController(controllerOrRoute, routePathOrPaths); + } + getRouteInfoFromPath(routePath) { + const defaultRequestMethod = -1; + return [ + { + path: (0, shared_utils_1.addLeadingSlash)(routePath), + method: defaultRequestMethod, + }, + ]; + } + getRouteInfoFromObject(routeInfoObject) { + const routeInfo = { + path: (0, shared_utils_1.addLeadingSlash)(routeInfoObject.path), + method: routeInfoObject.method, + }; + if (routeInfoObject.version) { + routeInfo.version = routeInfoObject.version; + } + return [routeInfo]; + } + getRouteInfoFromController(controller, routePath) { + const controllerPaths = this.pathsExplorer.scanForPaths(Object.create(controller), controller.prototype); + const controllerVersion = this.getVersionMetadata(controller); + const versioningConfig = this.applicationConfig.getVersioning(); + const moduleRef = this.getHostModuleOfController(controller); + const modulePath = this.getModulePath(moduleRef?.metatype); + const concatPaths = (acc, currentValue) => acc.concat(currentValue); + const toUndefinedIfNeural = (version) => version === interfaces_1.VERSION_NEUTRAL ? undefined : version; + const toRouteInfo = (item, prefix) => item.path?.flatMap(p => { + let endpointPath = modulePath ?? ''; + endpointPath += this.normalizeGlobalPath(prefix) + (0, shared_utils_1.addLeadingSlash)(p); + const routeInfo = { + path: endpointPath, + method: item.requestMethod, + }; + const version = item.version ?? controllerVersion; + if (version && versioningConfig) { + if (typeof version !== 'string' && Array.isArray(version)) { + return version.map(v => ({ + ...routeInfo, + version: toUndefinedIfNeural(v), + })); + } + routeInfo.version = toUndefinedIfNeural(version); + } + return routeInfo; + }); + return [] + .concat(routePath) + .map(routePath => controllerPaths + .map(item => toRouteInfo(item, routePath)) + .reduce(concatPaths, [])) + .reduce(concatPaths, []); + } + isRouteInfo(path, objectOrClass) { + return (0, shared_utils_1.isUndefined)(path); + } + normalizeGlobalPath(path) { + const prefix = (0, shared_utils_1.addLeadingSlash)(path); + return prefix === '/' ? '' : prefix; + } + getRoutePath(route) { + return Reflect.getMetadata(constants_1.PATH_METADATA, route); + } + getHostModuleOfController(metatype) { + if (!metatype) { + return; + } + const modulesContainer = this.container.getModules(); + const moduleRefsSet = router_module_1.targetModulesByContainer.get(modulesContainer); + if (!moduleRefsSet) { + return; + } + const modules = Array.from(modulesContainer.values()).filter(moduleRef => moduleRefsSet.has(moduleRef)); + return modules.find(({ controllers }) => controllers.has(metatype)); + } + getModulePath(metatype) { + if (!metatype) { + return; + } + const modulesContainer = this.container.getModules(); + const modulePath = Reflect.getMetadata(constants_1.MODULE_PATH + modulesContainer.applicationId, metatype); + return modulePath ?? Reflect.getMetadata(constants_1.MODULE_PATH, metatype); + } + getVersionMetadata(metatype) { + const versioningConfig = this.applicationConfig.getVersioning(); + if (versioningConfig) { + return (Reflect.getMetadata(constants_1.VERSION_METADATA, metatype) ?? + versioningConfig.defaultVersion); + } + } +} +exports.RoutesMapper = RoutesMapper; diff --git a/node_modules/@nestjs/core/middleware/utils.d.ts b/node_modules/@nestjs/core/middleware/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f6cc2bbc9b2dfa58551ad3bb04562fe3c281644 --- /dev/null +++ b/node_modules/@nestjs/core/middleware/utils.d.ts @@ -0,0 +1,8 @@ +import { HttpServer, RouteInfo, Type } from '@nestjs/common/interfaces'; +import { ExcludeRouteMetadata } from '../router/interfaces/exclude-route-metadata.interface'; +export declare const mapToExcludeRoute: (routes: (string | RouteInfo)[]) => ExcludeRouteMetadata[]; +export declare const filterMiddleware: = any>(middleware: T[], routes: RouteInfo[], httpAdapter: HttpServer) => Type[]; +export declare const mapToClass: >(middleware: T, excludedRoutes: ExcludeRouteMetadata[], httpAdapter: HttpServer) => Type; +export declare function isMiddlewareClass(middleware: any): middleware is Type; +export declare function assignToken(metatype: Type, token?: string): Type; +export declare function isMiddlewareRouteExcluded(req: Record, excludedRoutes: ExcludeRouteMetadata[], httpAdapter: HttpServer): boolean; diff --git a/node_modules/@nestjs/core/middleware/utils.js b/node_modules/@nestjs/core/middleware/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..e132deef9b59f980fabe7d957a8f944db7c67b5d --- /dev/null +++ b/node_modules/@nestjs/core/middleware/utils.js @@ -0,0 +1,106 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mapToClass = exports.filterMiddleware = exports.mapToExcludeRoute = void 0; +exports.isMiddlewareClass = isMiddlewareClass; +exports.assignToken = assignToken; +exports.isMiddlewareRouteExcluded = isMiddlewareRouteExcluded; +const common_1 = require("@nestjs/common"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const path_to_regexp_1 = require("path-to-regexp"); +const uid_1 = require("uid"); +const legacy_route_converter_1 = require("../router/legacy-route-converter"); +const utils_1 = require("../router/utils"); +const mapToExcludeRoute = (routes) => { + return routes.map(route => { + const originalPath = (0, shared_utils_1.isString)(route) ? route : route.path; + const path = legacy_route_converter_1.LegacyRouteConverter.tryConvert(originalPath); + try { + if ((0, shared_utils_1.isString)(route)) { + return { + path, + requestMethod: common_1.RequestMethod.ALL, + pathRegex: (0, path_to_regexp_1.pathToRegexp)((0, shared_utils_1.addLeadingSlash)(path)).regexp, + }; + } + return { + path, + requestMethod: route.method, + pathRegex: (0, path_to_regexp_1.pathToRegexp)((0, shared_utils_1.addLeadingSlash)(path)).regexp, + }; + } + catch (e) { + if (e instanceof TypeError) { + legacy_route_converter_1.LegacyRouteConverter.printError(originalPath); + } + throw e; + } + }); +}; +exports.mapToExcludeRoute = mapToExcludeRoute; +const filterMiddleware = (middleware, routes, httpAdapter) => { + const excludedRoutes = (0, exports.mapToExcludeRoute)(routes); + return (0, iterare_1.iterate)([]) + .concat(middleware) + .filter(shared_utils_1.isFunction) + .map((item) => (0, exports.mapToClass)(item, excludedRoutes, httpAdapter)) + .toArray(); +}; +exports.filterMiddleware = filterMiddleware; +const mapToClass = (middleware, excludedRoutes, httpAdapter) => { + if (isMiddlewareClass(middleware)) { + if (excludedRoutes.length <= 0) { + return middleware; + } + const MiddlewareHost = class extends middleware { + use(...params) { + const [req, _, next] = params; + const isExcluded = isMiddlewareRouteExcluded(req, excludedRoutes, httpAdapter); + if (isExcluded) { + return next(); + } + return super.use(...params); + } + }; + return assignToken(MiddlewareHost, middleware.name); + } + return assignToken(class { + constructor() { + this.use = (...params) => { + const [req, _, next] = params; + const isExcluded = isMiddlewareRouteExcluded(req, excludedRoutes, httpAdapter); + if (isExcluded) { + return next(); + } + return middleware(...params); + }; + } + }); +}; +exports.mapToClass = mapToClass; +function isMiddlewareClass(middleware) { + const middlewareStr = middleware.toString(); + if (middlewareStr.substring(0, 5) === 'class') { + return true; + } + const middlewareArr = middlewareStr.split(' '); + return (middlewareArr[0] === 'function' && + /[A-Z]/.test(middlewareArr[1]?.[0]) && + (0, shared_utils_1.isFunction)(middleware.prototype?.use)); +} +function assignToken(metatype, token = (0, uid_1.uid)(21)) { + Object.defineProperty(metatype, 'name', { value: token }); + return metatype; +} +function isMiddlewareRouteExcluded(req, excludedRoutes, httpAdapter) { + if (excludedRoutes.length <= 0) { + return false; + } + const reqMethod = httpAdapter.getRequestMethod(req); + const originalUrl = httpAdapter.getRequestUrl(req); + const queryParamsIndex = originalUrl ? originalUrl.indexOf('?') : -1; + const pathname = queryParamsIndex >= 0 + ? originalUrl.slice(0, queryParamsIndex) + : originalUrl; + return (0, utils_1.isRouteExcluded)(excludedRoutes, pathname, common_1.RequestMethod[reqMethod]); +} diff --git a/node_modules/@nestjs/core/nest-application-context.d.ts b/node_modules/@nestjs/core/nest-application-context.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d26ebfb02279896442277ab16a3c405459cba2f --- /dev/null +++ b/node_modules/@nestjs/core/nest-application-context.d.ts @@ -0,0 +1,173 @@ +import { INestApplicationContext, Logger, LoggerService, LogLevel, ShutdownSignal } from '@nestjs/common'; +import { DynamicModule, SelectOptions, ShutdownHooksOptions, Type } from '@nestjs/common/interfaces'; +import { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface'; +import { AbstractInstanceResolver } from './injector/abstract-instance-resolver'; +import { NestContainer } from './injector/container'; +import { Injector } from './injector/injector'; +import { InstanceLinksHost } from './injector/instance-links-host'; +import { ContextId } from './injector/instance-wrapper'; +import { Module } from './injector/module'; +/** + * @publicApi + */ +export declare class NestApplicationContext extends AbstractInstanceResolver implements INestApplicationContext { + protected readonly container: NestContainer; + protected readonly appOptions: TOptions; + private contextModule; + private readonly scope; + protected isInitialized: boolean; + protected injector: Injector; + protected readonly logger: Logger; + private shouldFlushLogsOnOverride; + private readonly activeShutdownSignals; + private readonly moduleCompiler; + private shutdownCleanupRef?; + private _instanceLinksHost; + private _moduleRefsForHooksByDistance?; + private initializationPromise?; + protected get instanceLinksHost(): InstanceLinksHost; + constructor(container: NestContainer, appOptions?: TOptions, contextModule?: Module | null, scope?: Type[]); + selectContextModule(): void; + /** + * Allows navigating through the modules tree, for example, to pull out a specific instance from the selected module. + * @returns {INestApplicationContext} + */ + select(moduleType: Type | DynamicModule, selectOptions?: SelectOptions): INestApplicationContext; + /** + * Retrieves an instance of either injectable or controller, otherwise, throws exception. + * @returns {TResult} + */ + get(typeOrToken: Type | Function | string | symbol): TResult; + /** + * Retrieves an instance of either injectable or controller, otherwise, throws exception. + * @returns {TResult} + */ + get(typeOrToken: Type | Function | string | symbol, options: { + strict?: boolean; + each?: undefined | false; + }): TResult; + /** + * Retrieves a list of instances of either injectables or controllers, otherwise, throws exception. + * @returns {Array} + */ + get(typeOrToken: Type | Function | string | symbol, options: { + strict?: boolean; + each: true; + }): Array; + /** + * Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception. + * @returns {Array} + */ + resolve(typeOrToken: Type | Function | string | symbol): Promise; + /** + * Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception. + * @returns {Array} + */ + resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }): Promise; + /** + * Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception. + * @returns {Array} + */ + resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }, options?: { + strict?: boolean; + each?: undefined | false; + }): Promise; + /** + * Resolves transient or request-scoped instances of either injectables or controllers, otherwise, throws exception. + * @returns {Array} + */ + resolve(typeOrToken: Type | Function | string | symbol, contextId?: { + id: number; + }, options?: { + strict?: boolean; + each: true; + }): Promise>; + /** + * Registers the request/context object for a given context ID (DI container sub-tree). + * @returns {void} + */ + registerRequestByContextId(request: T, contextId: ContextId): void; + /** + * Initializes the Nest application. + * Calls the Nest lifecycle events. + * + * @returns {Promise} The NestApplicationContext instance as Promise + */ + init(): Promise; + /** + * Terminates the application + * @returns {Promise} + */ + close(signal?: string): Promise; + /** + * Sets custom logger service. + * Flushes buffered logs if auto flush is on. + * @returns {void} + */ + useLogger(logger: LoggerService | LogLevel[] | false): void; + /** + * Prints buffered logs and detaches buffer. + * @returns {void} + */ + flushLogs(): void; + /** + * Define that it must flush logs right after defining a custom logger. + */ + flushLogsOnOverride(): void; + /** + * Enables the usage of shutdown hooks. Will call the + * `onApplicationShutdown` function of a provider if the + * process receives a shutdown signal. + * + * @param {ShutdownSignal[]} [signals=[]] The system signals it should listen to + * @param {ShutdownHooksOptions} [options={}] Options for configuring shutdown hooks behavior + * + * @returns {this} The Nest application context instance + */ + enableShutdownHooks(signals?: (ShutdownSignal | string)[], options?: ShutdownHooksOptions): this; + protected dispose(): Promise; + /** + * Listens to shutdown signals by listening to + * process events + * + * @param {string[]} signals The system signals it should listen to + * @param {ShutdownHooksOptions} options Options for configuring shutdown hooks behavior + */ + protected listenToShutdownSignals(signals: string[], options?: ShutdownHooksOptions): void; + /** + * Unsubscribes from shutdown signals (process events) + */ + protected unsubscribeFromProcessSignals(): void; + /** + * Calls the `onModuleInit` function on the registered + * modules and its children. + */ + protected callInitHook(): Promise; + /** + * Calls the `onModuleDestroy` function on the registered + * modules and its children. + */ + protected callDestroyHook(): Promise; + /** + * Calls the `onApplicationBootstrap` function on the registered + * modules and its children. + */ + protected callBootstrapHook(): Promise; + /** + * Calls the `onApplicationShutdown` function on the registered + * modules and children. + */ + protected callShutdownHook(signal?: string): Promise; + /** + * Calls the `beforeApplicationShutdown` function on the registered + * modules and children. + */ + protected callBeforeShutdownHook(signal?: string): Promise; + protected assertNotInPreviewMode(methodName: string): void; + private getModulesToTriggerHooksOn; + private printInPreviewModeWarning; +} diff --git a/node_modules/@nestjs/core/nest-application-context.js b/node_modules/@nestjs/core/nest-application-context.js new file mode 100644 index 0000000000000000000000000000000000000000..bc289a0a45bbaaaea13194d296a885c91da952fd --- /dev/null +++ b/node_modules/@nestjs/core/nest-application-context.js @@ -0,0 +1,327 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NestApplicationContext = void 0; +const common_1 = require("@nestjs/common"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const constants_1 = require("./constants"); +const exceptions_1 = require("./errors/exceptions"); +const context_id_factory_1 = require("./helpers/context-id-factory"); +const hooks_1 = require("./hooks"); +const abstract_instance_resolver_1 = require("./injector/abstract-instance-resolver"); +const injector_1 = require("./injector/injector"); +const instance_links_host_1 = require("./injector/instance-links-host"); +/** + * @publicApi + */ +class NestApplicationContext extends abstract_instance_resolver_1.AbstractInstanceResolver { + get instanceLinksHost() { + if (!this._instanceLinksHost) { + this._instanceLinksHost = new instance_links_host_1.InstanceLinksHost(this.container); + } + return this._instanceLinksHost; + } + constructor(container, appOptions = {}, contextModule = null, scope = new Array()) { + super(); + this.container = container; + this.appOptions = appOptions; + this.contextModule = contextModule; + this.scope = scope; + this.isInitialized = false; + this.logger = new common_1.Logger(NestApplicationContext.name, { + timestamp: true, + }); + this.shouldFlushLogsOnOverride = false; + this.activeShutdownSignals = new Array(); + this.injector = new injector_1.Injector(); + this.moduleCompiler = container.getModuleCompiler(); + if (this.appOptions.preview) { + this.printInPreviewModeWarning(); + } + } + selectContextModule() { + const modules = this.container.getModules().values(); + this.contextModule = modules.next().value; + } + /** + * Allows navigating through the modules tree, for example, to pull out a specific instance from the selected module. + * @returns {INestApplicationContext} + */ + select(moduleType, selectOptions) { + const modulesContainer = this.container.getModules(); + const contextModuleCtor = this.contextModule.metatype; + const scope = this.scope.concat(contextModuleCtor); + const moduleTokenFactory = this.container.getModuleTokenFactory(); + const { type, dynamicMetadata } = this.moduleCompiler.extractMetadata(moduleType); + const token = dynamicMetadata + ? moduleTokenFactory.createForDynamic(type, dynamicMetadata, moduleType) + : moduleTokenFactory.createForStatic(type, moduleType); + const selectedModule = modulesContainer.get(token); + if (!selectedModule) { + throw new exceptions_1.UnknownModuleException(type.name); + } + const options = typeof selectOptions?.abortOnError !== 'undefined' + ? { + ...this.appOptions, + ...selectOptions, + } + : this.appOptions; + return new NestApplicationContext(this.container, options, selectedModule, scope); + } + /** + * Retrieves an instance (or a list of instances) of either injectable or controller, otherwise, throws exception. + * @returns {TResult | Array} + */ + get(typeOrToken, options = { strict: false }) { + return !(options && options.strict) + ? this.find(typeOrToken, options) + : this.find(typeOrToken, { + moduleId: this.contextModule?.id, + each: options.each, + }); + } + /** + * Resolves transient or request-scoped instance (or a list of instances) of either injectable or controller, otherwise, throws exception. + * @returns {Promise>} + */ + resolve(typeOrToken, contextId = (0, context_id_factory_1.createContextId)(), options = { strict: false }) { + return this.resolvePerContext(typeOrToken, this.contextModule, contextId, options); + } + /** + * Registers the request/context object for a given context ID (DI container sub-tree). + * @returns {void} + */ + registerRequestByContextId(request, contextId) { + this.container.registerRequestProvider(request, contextId); + } + /** + * Initializes the Nest application. + * Calls the Nest lifecycle events. + * + * @returns {Promise} The NestApplicationContext instance as Promise + */ + async init() { + if (this.isInitialized) { + return this; + } + /* eslint-disable-next-line no-async-promise-executor */ + this.initializationPromise = new Promise(async (resolve, reject) => { + try { + await this.callInitHook(); + await this.callBootstrapHook(); + resolve(); + } + catch (err) { + reject(err); + } + }); + await this.initializationPromise; + this.isInitialized = true; + return this; + } + /** + * Terminates the application + * @returns {Promise} + */ + async close(signal) { + await this.initializationPromise; + await this.callDestroyHook(); + await this.callBeforeShutdownHook(signal); + await this.dispose(); + await this.callShutdownHook(signal); + this.unsubscribeFromProcessSignals(); + } + /** + * Sets custom logger service. + * Flushes buffered logs if auto flush is on. + * @returns {void} + */ + useLogger(logger) { + common_1.Logger.overrideLogger(logger); + if (this.shouldFlushLogsOnOverride) { + this.flushLogs(); + } + } + /** + * Prints buffered logs and detaches buffer. + * @returns {void} + */ + flushLogs() { + common_1.Logger.flush(); + } + /** + * Define that it must flush logs right after defining a custom logger. + */ + flushLogsOnOverride() { + this.shouldFlushLogsOnOverride = true; + } + /** + * Enables the usage of shutdown hooks. Will call the + * `onApplicationShutdown` function of a provider if the + * process receives a shutdown signal. + * + * @param {ShutdownSignal[]} [signals=[]] The system signals it should listen to + * @param {ShutdownHooksOptions} [options={}] Options for configuring shutdown hooks behavior + * + * @returns {this} The Nest application context instance + */ + enableShutdownHooks(signals = [], options = {}) { + if ((0, shared_utils_1.isEmpty)(signals)) { + signals = Object.keys(common_1.ShutdownSignal).map((key) => common_1.ShutdownSignal[key]); + } + else { + // given signals array should be unique because + // process shouldn't listen to the same signal more than once. + signals = Array.from(new Set(signals)); + } + signals = (0, iterare_1.iterate)(signals) + .map((signal) => signal.toString().toUpperCase().trim()) + // filter out the signals which is already listening to + .filter(signal => !this.activeShutdownSignals.includes(signal)) + .toArray(); + this.listenToShutdownSignals(signals, options); + return this; + } + async dispose() { + // Nest application context has no server + // to dispose, therefore just call a noop + return Promise.resolve(); + } + /** + * Listens to shutdown signals by listening to + * process events + * + * @param {string[]} signals The system signals it should listen to + * @param {ShutdownHooksOptions} options Options for configuring shutdown hooks behavior + */ + listenToShutdownSignals(signals, options = {}) { + let receivedSignal = false; + const cleanup = async (signal) => { + try { + if (receivedSignal) { + // If we receive another signal while we're waiting + // for the server to stop, just ignore it. + return; + } + receivedSignal = true; + await this.initializationPromise; + await this.callDestroyHook(); + await this.callBeforeShutdownHook(signal); + await this.dispose(); + await this.callShutdownHook(signal); + signals.forEach(sig => process.removeListener(sig, cleanup)); + if (options.useProcessExit) { + // Use process.exit() to ensure the 'exit' event is properly triggered. + // This is required for async loggers (like Pino with transports) + // to flush their buffers before the process terminates. + process.exit(0); + } + else { + process.kill(process.pid, signal); + } + } + catch (err) { + common_1.Logger.error(constants_1.MESSAGES.ERROR_DURING_SHUTDOWN, err?.stack, NestApplicationContext.name); + process.exit(1); + } + }; + this.shutdownCleanupRef = cleanup; + signals.forEach((signal) => { + this.activeShutdownSignals.push(signal); + process.on(signal, cleanup); + }); + } + /** + * Unsubscribes from shutdown signals (process events) + */ + unsubscribeFromProcessSignals() { + if (!this.shutdownCleanupRef) { + return; + } + this.activeShutdownSignals.forEach(signal => { + process.removeListener(signal, this.shutdownCleanupRef); + }); + } + /** + * Calls the `onModuleInit` function on the registered + * modules and its children. + */ + async callInitHook() { + const modulesSortedByDistance = this.getModulesToTriggerHooksOn(); + for (const module of modulesSortedByDistance) { + await (0, hooks_1.callModuleInitHook)(module); + } + } + /** + * Calls the `onModuleDestroy` function on the registered + * modules and its children. + */ + async callDestroyHook() { + const modulesSortedByDistance = [ + ...this.getModulesToTriggerHooksOn(), + ].reverse(); + for (const module of modulesSortedByDistance) { + await (0, hooks_1.callModuleDestroyHook)(module); + } + } + /** + * Calls the `onApplicationBootstrap` function on the registered + * modules and its children. + */ + async callBootstrapHook() { + const modulesSortedByDistance = this.getModulesToTriggerHooksOn(); + for (const module of modulesSortedByDistance) { + await (0, hooks_1.callModuleBootstrapHook)(module); + } + } + /** + * Calls the `onApplicationShutdown` function on the registered + * modules and children. + */ + async callShutdownHook(signal) { + const modulesSortedByDistance = [ + ...this.getModulesToTriggerHooksOn(), + ].reverse(); + for (const module of modulesSortedByDistance) { + await (0, hooks_1.callAppShutdownHook)(module, signal); + } + } + /** + * Calls the `beforeApplicationShutdown` function on the registered + * modules and children. + */ + async callBeforeShutdownHook(signal) { + const modulesSortedByDistance = [ + ...this.getModulesToTriggerHooksOn(), + ].reverse(); + for (const module of modulesSortedByDistance) { + await (0, hooks_1.callBeforeAppShutdownHook)(module, signal); + } + } + assertNotInPreviewMode(methodName) { + if (this.appOptions.preview) { + const error = `Calling the "${methodName}" in the preview mode is not supported.`; + this.logger.error(error); + throw new Error(error); + } + } + getModulesToTriggerHooksOn() { + if (this._moduleRefsForHooksByDistance) { + return this._moduleRefsForHooksByDistance; + } + const modulesContainer = this.container.getModules(); + const compareFn = (a, b) => b.distance - a.distance; + const modulesSortedByDistance = Array.from(modulesContainer.values()).sort(compareFn); + this._moduleRefsForHooksByDistance = this.appOptions?.preview + ? modulesSortedByDistance.filter(moduleRef => moduleRef.initOnPreview) + : modulesSortedByDistance; + return this._moduleRefsForHooksByDistance; + } + printInPreviewModeWarning() { + this.logger.warn('------------------------------------------------'); + this.logger.warn('Application is running in the PREVIEW mode!'); + this.logger.warn('Providers/controllers will not be instantiated.'); + this.logger.warn('------------------------------------------------'); + } +} +exports.NestApplicationContext = NestApplicationContext; diff --git a/node_modules/@nestjs/core/nest-application.d.ts b/node_modules/@nestjs/core/nest-application.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..32249476b4b38c46f2225378d9af6257170394f0 --- /dev/null +++ b/node_modules/@nestjs/core/nest-application.d.ts @@ -0,0 +1,65 @@ +import { CanActivate, ExceptionFilter, HttpServer, INestApplication, INestMicroservice, NestHybridApplicationOptions, NestInterceptor, PipeTransform, VersioningOptions, WebSocketAdapter } from '@nestjs/common'; +import { GlobalPrefixOptions, NestApplicationOptions } from '@nestjs/common/interfaces'; +import { Logger } from '@nestjs/common/services/logger.service'; +import { AbstractHttpAdapter } from './adapters'; +import { ApplicationConfig } from './application-config'; +import { NestContainer } from './injector/container'; +import { GraphInspector } from './inspector/graph-inspector'; +import { NestApplicationContext } from './nest-application-context'; +/** + * @publicApi + */ +export declare class NestApplication extends NestApplicationContext implements INestApplication { + private readonly httpAdapter; + private readonly config; + private readonly graphInspector; + protected readonly logger: Logger; + private readonly middlewareModule; + private readonly middlewareContainer; + private readonly microservicesModule; + private readonly socketModule; + private readonly routesResolver; + private readonly microservices; + private httpServer; + private isListening; + private isWsModuleRegistered; + constructor(container: NestContainer, httpAdapter: HttpServer, config: ApplicationConfig, graphInspector: GraphInspector, appOptions?: NestApplicationOptions); + protected dispose(): Promise; + getHttpAdapter(): AbstractHttpAdapter; + registerHttpServer(): void; + getUnderlyingHttpServer(): T; + applyOptions(): void; + createServer(): T; + registerModules(): Promise; + registerWsModule(): void; + init(): Promise; + registerParserMiddleware(): void; + registerRouter(): Promise; + registerRouterHooks(): Promise; + connectMicroservice(microserviceOptions: T, hybridAppOptions?: NestHybridApplicationOptions): INestMicroservice; + getMicroservices(): INestMicroservice[]; + getHttpServer(): any; + startAllMicroservices(): Promise; + use(...args: [any, any?]): this; + useBodyParser(...args: [any, any?]): this; + enableCors(options?: any): void; + enableVersioning(options?: VersioningOptions): this; + listen(port: number | string): Promise; + listen(port: number | string, hostname: string): Promise; + getUrl(): Promise; + private formatAddress; + setGlobalPrefix(prefix: string, options?: GlobalPrefixOptions): this; + useWebSocketAdapter(adapter: WebSocketAdapter): this; + useGlobalFilters(...filters: ExceptionFilter[]): this; + useGlobalPipes(...pipes: PipeTransform[]): this; + useGlobalInterceptors(...interceptors: NestInterceptor[]): this; + useGlobalGuards(...guards: CanActivate[]): this; + useStaticAssets(options: any): this; + useStaticAssets(path: string, options?: any): this; + setBaseViewsDir(path: string | string[]): this; + setViewEngine(engineOrOptions: any): this; + private host; + private getProtocol; + private registerMiddleware; + private applyInstanceDecoratorIfRegistered; +} diff --git a/node_modules/@nestjs/core/nest-application.js b/node_modules/@nestjs/core/nest-application.js new file mode 100644 index 0000000000000000000000000000000000000000..6bd4140cdc9e58f390c794121eb371731b625219 --- /dev/null +++ b/node_modules/@nestjs/core/nest-application.js @@ -0,0 +1,333 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NestApplication = void 0; +const common_1 = require("@nestjs/common"); +const logger_service_1 = require("@nestjs/common/services/logger.service"); +const load_package_util_1 = require("@nestjs/common/utils/load-package.util"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const os_1 = require("os"); +const application_config_1 = require("./application-config"); +const constants_1 = require("./constants"); +const optional_require_1 = require("./helpers/optional-require"); +const injector_1 = require("./injector/injector"); +const container_1 = require("./middleware/container"); +const middleware_module_1 = require("./middleware/middleware-module"); +const utils_1 = require("./middleware/utils"); +const nest_application_context_1 = require("./nest-application-context"); +const routes_resolver_1 = require("./router/routes-resolver"); +const { SocketModule } = (0, optional_require_1.optionalRequire)('@nestjs/websockets/socket-module', () => require('@nestjs/websockets/socket-module')); +const { MicroservicesModule } = (0, optional_require_1.optionalRequire)('@nestjs/microservices/microservices-module', () => require('@nestjs/microservices/microservices-module')); +/** + * @publicApi + */ +class NestApplication extends nest_application_context_1.NestApplicationContext { + constructor(container, httpAdapter, config, graphInspector, appOptions = {}) { + super(container, appOptions); + this.httpAdapter = httpAdapter; + this.config = config; + this.graphInspector = graphInspector; + this.logger = new logger_service_1.Logger(NestApplication.name, { + timestamp: true, + }); + this.middlewareContainer = new container_1.MiddlewareContainer(this.container); + this.microservicesModule = MicroservicesModule && new MicroservicesModule(); + this.socketModule = SocketModule && new SocketModule(); + this.microservices = []; + this.isListening = false; + this.isWsModuleRegistered = false; + this.selectContextModule(); + this.registerHttpServer(); + this.injector = new injector_1.Injector({ + preview: this.appOptions.preview, + instanceDecorator: appOptions.instrument?.instanceDecorator, + }); + this.middlewareModule = new middleware_module_1.MiddlewareModule(); + this.routesResolver = new routes_resolver_1.RoutesResolver(this.container, this.config, this.injector, this.graphInspector); + } + async dispose() { + this.socketModule && (await this.socketModule.close()); + this.microservicesModule && (await this.microservicesModule.close()); + this.httpAdapter && (await this.httpAdapter.close()); + await Promise.all((0, iterare_1.iterate)(this.microservices).map(async (microservice) => { + microservice.setIsTerminated(true); + await microservice.close(); + })); + } + getHttpAdapter() { + return this.httpAdapter; + } + registerHttpServer() { + this.httpServer = this.createServer(); + } + getUnderlyingHttpServer() { + return this.httpAdapter.getHttpServer(); + } + applyOptions() { + if (!this.appOptions || !this.appOptions.cors) { + return undefined; + } + const passCustomOptions = (0, shared_utils_1.isObject)(this.appOptions.cors) || (0, shared_utils_1.isFunction)(this.appOptions.cors); + if (!passCustomOptions) { + return this.enableCors(); + } + return this.enableCors(this.appOptions.cors); + } + createServer() { + this.httpAdapter.initHttpServer(this.appOptions); + return this.httpAdapter.getHttpServer(); + } + async registerModules() { + this.registerWsModule(); + if (this.microservicesModule) { + this.microservicesModule.register(this.container, this.graphInspector, this.config, this.appOptions); + this.microservicesModule.setupClients(this.container); + } + await this.middlewareModule.register(this.middlewareContainer, this.container, this.config, this.injector, this.httpAdapter, this.graphInspector, this.appOptions); + } + registerWsModule() { + if (!this.socketModule) { + return; + } + this.socketModule.register(this.container, this.config, this.graphInspector, this.appOptions, this.httpServer); + this.isWsModuleRegistered = true; + } + async init() { + if (this.isInitialized) { + return this; + } + this.applyOptions(); + await this.httpAdapter?.init?.(); + const useBodyParser = this.appOptions && this.appOptions.bodyParser !== false; + useBodyParser && this.registerParserMiddleware(); + await this.registerModules(); + await this.registerRouter(); + await this.callInitHook(); + await this.registerRouterHooks(); + await this.callBootstrapHook(); + this.isInitialized = true; + this.logger.log(constants_1.MESSAGES.APPLICATION_READY); + return this; + } + registerParserMiddleware() { + const prefix = this.config.getGlobalPrefix(); + const rawBody = !!this.appOptions?.rawBody; + this.httpAdapter.registerParserMiddleware(prefix, rawBody); + } + async registerRouter() { + await this.registerMiddleware(this.httpAdapter); + const prefix = this.config.getGlobalPrefix(); + const basePath = (0, shared_utils_1.addLeadingSlash)(prefix); + this.routesResolver.resolve(this.httpAdapter, basePath); + } + async registerRouterHooks() { + this.routesResolver.registerNotFoundHandler(); + this.routesResolver.registerExceptionHandler(); + } + connectMicroservice(microserviceOptions, hybridAppOptions = {}) { + const { NestMicroservice } = (0, load_package_util_1.loadPackage)('@nestjs/microservices', 'NestFactory', () => require('@nestjs/microservices')); + const { inheritAppConfig } = hybridAppOptions; + const applicationConfig = inheritAppConfig + ? this.config + : new application_config_1.ApplicationConfig(); + const instance = new NestMicroservice(this.container, microserviceOptions, this.graphInspector, applicationConfig); + if (!hybridAppOptions.deferInitialization) { + instance.registerListeners(); + instance.setIsInitialized(true); + instance.setIsInitHookCalled(true); + } + this.microservices.push(instance); + return instance; + } + getMicroservices() { + return this.microservices; + } + getHttpServer() { + return this.httpServer; + } + async startAllMicroservices() { + this.assertNotInPreviewMode('startAllMicroservices'); + await Promise.all(this.microservices.map(msvc => msvc.listen())); + return this; + } + use(...args) { + this.httpAdapter.use(...args); + return this; + } + useBodyParser(...args) { + if (!('useBodyParser' in this.httpAdapter)) { + this.logger.warn('Your HTTP Adapter does not support `.useBodyParser`.'); + return this; + } + const [parserType, ...otherArgs] = args; + const rawBody = !!this.appOptions.rawBody; + this.httpAdapter.useBodyParser?.(...[parserType, rawBody, ...otherArgs]); + return this; + } + enableCors(options) { + this.httpAdapter.enableCors(options); + } + enableVersioning(options = { type: common_1.VersioningType.URI }) { + this.config.enableVersioning(options); + return this; + } + async listen(port, ...args) { + this.assertNotInPreviewMode('listen'); + if (!this.isInitialized) { + await this.init(); + } + const httpAdapterHost = this.container.getHttpAdapterHostRef(); + return new Promise((resolve, reject) => { + const errorHandler = (e) => { + this.logger.error(e?.toString?.()); + reject(e); + }; + this.httpServer.once('error', errorHandler); + const isCallbackInOriginalArgs = (0, shared_utils_1.isFunction)(args[args.length - 1]); + const listenFnArgs = isCallbackInOriginalArgs + ? args.slice(0, args.length - 1) + : args; + this.httpAdapter.listen(port, ...listenFnArgs, (...originalCallbackArgs) => { + if (this.appOptions?.autoFlushLogs ?? true) { + this.flushLogs(); + } + if (originalCallbackArgs[0] instanceof Error) { + return reject(originalCallbackArgs[0]); + } + const address = this.httpServer.address(); + if (address) { + this.httpServer.removeListener('error', errorHandler); + this.isListening = true; + httpAdapterHost.listening = true; + resolve(this.httpServer); + } + if (isCallbackInOriginalArgs) { + args[args.length - 1](...originalCallbackArgs); + } + }); + }); + } + async getUrl() { + return new Promise((resolve, reject) => { + if (!this.isListening) { + this.logger.error(constants_1.MESSAGES.CALL_LISTEN_FIRST); + reject(constants_1.MESSAGES.CALL_LISTEN_FIRST); + return; + } + const address = this.httpServer.address(); + resolve(this.formatAddress(address)); + }); + } + formatAddress(address) { + if ((0, shared_utils_1.isString)(address)) { + if ((0, os_1.platform)() === 'win32') { + return address; + } + const basePath = encodeURIComponent(address); + return `${this.getProtocol()}+unix://${basePath}`; + } + let host = this.host(); + if (address && address.family === 'IPv6') { + if (host === '::') { + host = '[::1]'; + } + else { + host = `[${host}]`; + } + } + else if (host === '0.0.0.0') { + host = '127.0.0.1'; + } + return `${this.getProtocol()}://${host}:${address.port}`; + } + setGlobalPrefix(prefix, options) { + this.config.setGlobalPrefix(prefix); + if (options) { + const exclude = options?.exclude + ? (0, utils_1.mapToExcludeRoute)(options.exclude) + : []; + this.config.setGlobalPrefixOptions({ + ...options, + exclude, + }); + } + return this; + } + useWebSocketAdapter(adapter) { + if (this.isWsModuleRegistered) { + this.logger.warn('useWebSocketAdapter() was called after WebSocket gateways were already initialized. The provided adapter will be stored but will NOT be applied to existing gateways — they remain bound to the previously installed adapter. To install a custom adapter, call app.useWebSocketAdapter(...) BEFORE app.init() (or app.listen()).'); + } + this.config.setIoAdapter(adapter); + return this; + } + useGlobalFilters(...filters) { + filters = this.applyInstanceDecoratorIfRegistered(...filters); + this.config.useGlobalFilters(...filters); + filters.forEach(item => this.graphInspector.insertOrphanedEnhancer({ + subtype: 'filter', + ref: item, + })); + return this; + } + useGlobalPipes(...pipes) { + pipes = this.applyInstanceDecoratorIfRegistered(...pipes); + this.config.useGlobalPipes(...pipes); + pipes.forEach(item => this.graphInspector.insertOrphanedEnhancer({ + subtype: 'pipe', + ref: item, + })); + return this; + } + useGlobalInterceptors(...interceptors) { + interceptors = this.applyInstanceDecoratorIfRegistered(...interceptors); + this.config.useGlobalInterceptors(...interceptors); + interceptors.forEach(item => this.graphInspector.insertOrphanedEnhancer({ + subtype: 'interceptor', + ref: item, + })); + return this; + } + useGlobalGuards(...guards) { + guards = this.applyInstanceDecoratorIfRegistered(...guards); + this.config.useGlobalGuards(...guards); + guards.forEach(item => this.graphInspector.insertOrphanedEnhancer({ + subtype: 'guard', + ref: item, + })); + return this; + } + useStaticAssets(pathOrOptions, options) { + this.httpAdapter.useStaticAssets && + this.httpAdapter.useStaticAssets(pathOrOptions, options); + return this; + } + setBaseViewsDir(path) { + this.httpAdapter.setBaseViewsDir && this.httpAdapter.setBaseViewsDir(path); + return this; + } + setViewEngine(engineOrOptions) { + this.httpAdapter.setViewEngine && + this.httpAdapter.setViewEngine(engineOrOptions); + return this; + } + host() { + const address = this.httpServer.address(); + if ((0, shared_utils_1.isString)(address)) { + return undefined; + } + return address && address.address; + } + getProtocol() { + return this.appOptions && this.appOptions.httpsOptions ? 'https' : 'http'; + } + async registerMiddleware(instance) { + await this.middlewareModule.registerMiddleware(this.middlewareContainer, instance); + } + applyInstanceDecoratorIfRegistered(...instances) { + if (this.appOptions.instrument?.instanceDecorator) { + return instances.map(instance => this.appOptions.instrument.instanceDecorator(instance)); + } + return instances; + } +} +exports.NestApplication = NestApplication; diff --git a/node_modules/@nestjs/core/nest-factory.d.ts b/node_modules/@nestjs/core/nest-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95309663f2af9a176be438ebafa1511ee299c326 --- /dev/null +++ b/node_modules/@nestjs/core/nest-factory.d.ts @@ -0,0 +1,87 @@ +import { DynamicModule, ForwardReference, INestApplication, INestApplicationContext, INestMicroservice, Type } from '@nestjs/common'; +import { NestMicroserviceOptions } from '@nestjs/common/interfaces/microservices/nest-microservice-options.interface'; +import { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface'; +import { NestApplicationOptions } from '@nestjs/common/interfaces/nest-application-options.interface'; +import { AbstractHttpAdapter } from './adapters/http-adapter'; +/** + * Represents the entry (root) module type accepted by the NestFactory methods. + * + * @publicApi + */ +export type IEntryNestModule = Type | DynamicModule | ForwardReference | Promise; +/** + * @publicApi + */ +export declare class NestFactoryStatic { + private readonly logger; + private abortOnError; + private autoFlushLogs; + /** + * Creates an instance of NestApplication. + * + * @param module Entry (root) application module class + * @param options List of options to initialize NestApplication + * + * @returns A promise that, when resolved, + * contains a reference to the NestApplication instance. + */ + create(module: IEntryNestModule, options?: NestApplicationOptions): Promise; + /** + * Creates an instance of NestApplication with the specified `httpAdapter`. + * + * @param module Entry (root) application module class + * @param httpAdapter Adapter to proxy the request/response cycle to + * the underlying HTTP server + * @param options List of options to initialize NestApplication + * + * @returns A promise that, when resolved, + * contains a reference to the NestApplication instance. + */ + create(module: IEntryNestModule, httpAdapter: AbstractHttpAdapter, options?: NestApplicationOptions): Promise; + /** + * Creates an instance of NestMicroservice. + * + * @param moduleCls Entry (root) application module class + * @param options Optional microservice configuration + * + * @returns A promise that, when resolved, + * contains a reference to the NestMicroservice instance. + */ + createMicroservice(moduleCls: IEntryNestModule, options?: NestMicroserviceOptions & T): Promise; + /** + * Creates an instance of NestApplicationContext. + * + * @param moduleCls Entry (root) application module class + * @param options Optional Nest application configuration + * + * @returns A promise that, when resolved, + * contains a reference to the NestApplicationContext instance. + */ + createApplicationContext(moduleCls: IEntryNestModule, options?: NestApplicationContextOptions): Promise; + private createNestInstance; + private initialize; + private handleInitializationError; + private createProxy; + private createExceptionProxy; + private createExceptionZone; + private registerLoggerConfiguration; + private createHttpAdapter; + private isHttpServer; + private setAbortOnError; + private createAdapterProxy; + private createGraphInspector; +} +/** + * Use NestFactory to create an application instance. + * + * ### Specifying an entry module + * + * Pass the required *root module* for the application via the module parameter. + * By convention, it is usually called `ApplicationModule`. Starting with this + * module, Nest assembles the dependency graph and begins the process of + * Dependency Injection and instantiates the classes needed to launch your + * application. + * + * @publicApi + */ +export declare const NestFactory: NestFactoryStatic; diff --git a/node_modules/@nestjs/core/nest-factory.js b/node_modules/@nestjs/core/nest-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..d3f546bff10807500585f426f954aeb5449832c1 --- /dev/null +++ b/node_modules/@nestjs/core/nest-factory.js @@ -0,0 +1,233 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NestFactory = exports.NestFactoryStatic = void 0; +const console_logger_service_1 = require("@nestjs/common/services/console-logger.service"); +const logger_service_1 = require("@nestjs/common/services/logger.service"); +const load_package_util_1 = require("@nestjs/common/utils/load-package.util"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const application_config_1 = require("./application-config"); +const constants_1 = require("./constants"); +const exceptions_zone_1 = require("./errors/exceptions-zone"); +const load_adapter_1 = require("./helpers/load-adapter"); +const rethrow_1 = require("./helpers/rethrow"); +const container_1 = require("./injector/container"); +const injector_1 = require("./injector/injector"); +const instance_loader_1 = require("./injector/instance-loader"); +const graph_inspector_1 = require("./inspector/graph-inspector"); +const noop_graph_inspector_1 = require("./inspector/noop-graph-inspector"); +const uuid_factory_1 = require("./inspector/uuid-factory"); +const metadata_scanner_1 = require("./metadata-scanner"); +const nest_application_1 = require("./nest-application"); +const nest_application_context_1 = require("./nest-application-context"); +const scanner_1 = require("./scanner"); +/** + * @publicApi + */ +class NestFactoryStatic { + constructor() { + this.logger = new logger_service_1.Logger('NestFactory', { + timestamp: true, + }); + this.abortOnError = true; + this.autoFlushLogs = false; + } + async create(moduleCls, serverOrOptions, options) { + const [httpServer, appOptions] = this.isHttpServer(serverOrOptions) + ? [serverOrOptions, options] + : [this.createHttpAdapter(), serverOrOptions]; + const applicationConfig = new application_config_1.ApplicationConfig(); + const container = new container_1.NestContainer(applicationConfig, appOptions); + const graphInspector = this.createGraphInspector(appOptions, container); + this.setAbortOnError(serverOrOptions, options); + this.registerLoggerConfiguration(appOptions); + await this.initialize(moduleCls, container, graphInspector, applicationConfig, appOptions, httpServer); + const instance = new nest_application_1.NestApplication(container, httpServer, applicationConfig, graphInspector, appOptions); + const target = this.createNestInstance(instance); + return this.createAdapterProxy(target, httpServer); + } + /** + * Creates an instance of NestMicroservice. + * + * @param moduleCls Entry (root) application module class + * @param options Optional microservice configuration + * + * @returns A promise that, when resolved, + * contains a reference to the NestMicroservice instance. + */ + async createMicroservice(moduleCls, options) { + const { NestMicroservice } = (0, load_package_util_1.loadPackage)('@nestjs/microservices', 'NestFactory', () => require('@nestjs/microservices')); + const applicationConfig = new application_config_1.ApplicationConfig(); + const container = new container_1.NestContainer(applicationConfig, options); + const graphInspector = this.createGraphInspector(options, container); + this.setAbortOnError(options); + this.registerLoggerConfiguration(options); + await this.initialize(moduleCls, container, graphInspector, applicationConfig, options); + return this.createNestInstance(new NestMicroservice(container, options, graphInspector, applicationConfig)); + } + /** + * Creates an instance of NestApplicationContext. + * + * @param moduleCls Entry (root) application module class + * @param options Optional Nest application configuration + * + * @returns A promise that, when resolved, + * contains a reference to the NestApplicationContext instance. + */ + async createApplicationContext(moduleCls, options) { + const applicationConfig = new application_config_1.ApplicationConfig(); + const container = new container_1.NestContainer(applicationConfig, options); + const graphInspector = this.createGraphInspector(options, container); + this.setAbortOnError(options); + this.registerLoggerConfiguration(options); + await this.initialize(moduleCls, container, graphInspector, applicationConfig, options); + const modules = container.getModules().values(); + const root = modules.next().value; + const context = this.createNestInstance(new nest_application_context_1.NestApplicationContext(container, options, root)); + if (this.autoFlushLogs) { + context.flushLogsOnOverride(); + } + return context.init(); + } + createNestInstance(instance) { + return this.createProxy(instance); + } + async initialize(module, container, graphInspector, config = new application_config_1.ApplicationConfig(), options = {}, httpServer = null) { + uuid_factory_1.UuidFactory.mode = options.snapshot + ? uuid_factory_1.UuidFactoryMode.Deterministic + : uuid_factory_1.UuidFactoryMode.Random; + const injector = new injector_1.Injector({ + preview: options.preview, + snapshot: options.snapshot, + instanceDecorator: options.instrument?.instanceDecorator, + }); + const instanceLoader = new instance_loader_1.InstanceLoader(container, injector, graphInspector); + const metadataScanner = new metadata_scanner_1.MetadataScanner(); + const dependenciesScanner = new scanner_1.DependenciesScanner(container, metadataScanner, graphInspector, config); + container.setHttpAdapter(httpServer); + const teardown = this.abortOnError === false ? rethrow_1.rethrow : undefined; + await httpServer?.init?.(); + try { + this.logger.log(constants_1.MESSAGES.APPLICATION_START); + await exceptions_zone_1.ExceptionsZone.asyncRun(async () => { + await dependenciesScanner.scan(module); + await instanceLoader.createInstancesOfDependencies(); + dependenciesScanner.applyApplicationProviders(); + }, teardown, this.autoFlushLogs); + } + catch (e) { + this.handleInitializationError(e); + } + } + handleInitializationError(err) { + if (this.abortOnError) { + process.abort(); + } + (0, rethrow_1.rethrow)(err); + } + createProxy(target) { + const proxy = this.createExceptionProxy(); + return new Proxy(target, { + get: proxy, + set: proxy, + }); + } + createExceptionProxy() { + return (receiver, prop) => { + if (!(prop in receiver)) { + return; + } + if ((0, shared_utils_1.isFunction)(receiver[prop])) { + return this.createExceptionZone(receiver, prop); + } + return receiver[prop]; + }; + } + createExceptionZone(receiver, prop) { + const teardown = this.abortOnError === false ? rethrow_1.rethrow : undefined; + return (...args) => { + let result; + exceptions_zone_1.ExceptionsZone.run(() => { + result = receiver[prop](...args); + }, teardown, this.autoFlushLogs); + return result; + }; + } + registerLoggerConfiguration(options) { + if (!options) { + return; + } + const { logger, bufferLogs, autoFlushLogs, forceConsole } = options; + if (logger !== true && !(0, shared_utils_1.isNil)(logger)) { + logger_service_1.Logger.overrideLogger(logger); + } + else if (forceConsole) { + // If no custom logger is provided but forceConsole is true, + // create a ConsoleLogger with forceConsole option + const consoleLogger = new console_logger_service_1.ConsoleLogger({ forceConsole: true }); + logger_service_1.Logger.overrideLogger(consoleLogger); + } + if (bufferLogs) { + logger_service_1.Logger.attachBuffer(); + } + this.autoFlushLogs = autoFlushLogs ?? true; + } + createHttpAdapter(httpServer) { + const { ExpressAdapter } = (0, load_adapter_1.loadAdapter)('@nestjs/platform-express', 'HTTP', () => require('@nestjs/platform-express')); + return new ExpressAdapter(httpServer); + } + isHttpServer(serverOrOptions) { + return !!(serverOrOptions && serverOrOptions.patch); + } + setAbortOnError(serverOrOptions, options) { + this.abortOnError = this.isHttpServer(serverOrOptions) + ? !(options && options.abortOnError === false) + : !(serverOrOptions && serverOrOptions.abortOnError === false); + } + createAdapterProxy(app, adapter) { + const proxy = new Proxy(app, { + get: (receiver, prop) => { + const mapToProxy = (result) => { + return result instanceof Promise + ? result.then(mapToProxy) + : result instanceof nest_application_1.NestApplication + ? proxy + : result; + }; + if (!(prop in receiver) && prop in adapter) { + return (...args) => { + const result = this.createExceptionZone(adapter, prop)(...args); + return mapToProxy(result); + }; + } + if ((0, shared_utils_1.isFunction)(receiver[prop])) { + return (...args) => { + const result = receiver[prop](...args); + return mapToProxy(result); + }; + } + return receiver[prop]; + }, + }); + return proxy; + } + createGraphInspector(appOptions, container) { + return appOptions?.snapshot + ? new graph_inspector_1.GraphInspector(container) + : noop_graph_inspector_1.NoopGraphInspector; + } +} +exports.NestFactoryStatic = NestFactoryStatic; +/** + * Use NestFactory to create an application instance. + * + * ### Specifying an entry module + * + * Pass the required *root module* for the application via the module parameter. + * By convention, it is usually called `ApplicationModule`. Starting with this + * module, Nest assembles the dependency graph and begins the process of + * Dependency Injection and instantiates the classes needed to launch your + * application. + * + * @publicApi + */ +exports.NestFactory = new NestFactoryStatic(); diff --git a/node_modules/@nestjs/core/package.json b/node_modules/@nestjs/core/package.json new file mode 100644 index 0000000000000000000000000000000000000000..45b5072a39ec83a1155bfd93af849ca1055953a5 --- /dev/null +++ b/node_modules/@nestjs/core/package.json @@ -0,0 +1,53 @@ +{ + "name": "@nestjs/core", + "version": "11.1.27", + "description": "Nest - modern, fast, powerful node.js web framework (@core)", + "author": "Kamil Mysliwiec", + "license": "MIT", + "homepage": "https://nestjs.com", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "engines": { + "node": ">= 20" + }, + "repository": { + "type": "git", + "url": "https://github.com/nestjs/nest.git", + "directory": "packages/core" + }, + "publishConfig": { + "access": "public" + }, + "dependencies": { + "fast-safe-stringify": "2.1.1", + "iterare": "1.2.1", + "path-to-regexp": "8.4.2", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "devDependencies": { + "@nestjs/common": "11.1.27" + }, + "peerDependencies": { + "@nestjs/common": "^11.0.0", + "@nestjs/microservices": "^11.0.0", + "@nestjs/platform-express": "^11.0.0", + "@nestjs/websockets": "^11.0.0", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "@nestjs/websockets": { + "optional": true + }, + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + } + }, + "gitHead": "660a1249e32e7701cdd7e5ccb20b7f695e721bce" +} diff --git a/node_modules/@nestjs/core/pipes/index.d.ts b/node_modules/@nestjs/core/pipes/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ce7301a1d1b47a09c77963453d2560f3361fa925 --- /dev/null +++ b/node_modules/@nestjs/core/pipes/index.d.ts @@ -0,0 +1,3 @@ +export * from './params-token-factory'; +export * from './pipes-consumer'; +export * from './pipes-context-creator'; diff --git a/node_modules/@nestjs/core/pipes/index.js b/node_modules/@nestjs/core/pipes/index.js new file mode 100644 index 0000000000000000000000000000000000000000..07d3e5f1f010429c8c7bfd1d6c87ba90474c49bb --- /dev/null +++ b/node_modules/@nestjs/core/pipes/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./params-token-factory"), exports); +tslib_1.__exportStar(require("./pipes-consumer"), exports); +tslib_1.__exportStar(require("./pipes-context-creator"), exports); diff --git a/node_modules/@nestjs/core/pipes/params-token-factory.d.ts b/node_modules/@nestjs/core/pipes/params-token-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a4483c5c87dde6bff22a4f4149e71739bea6608 --- /dev/null +++ b/node_modules/@nestjs/core/pipes/params-token-factory.d.ts @@ -0,0 +1,5 @@ +import { Paramtype } from '@nestjs/common'; +import { RouteParamtypes } from '@nestjs/common/enums/route-paramtypes.enum'; +export declare class ParamsTokenFactory { + exchangeEnumForString(type: RouteParamtypes): Paramtype; +} diff --git a/node_modules/@nestjs/core/pipes/params-token-factory.js b/node_modules/@nestjs/core/pipes/params-token-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..84f482eae4e00f3c9e9c87d329ef6e127150dc08 --- /dev/null +++ b/node_modules/@nestjs/core/pipes/params-token-factory.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParamsTokenFactory = void 0; +const route_paramtypes_enum_1 = require("@nestjs/common/enums/route-paramtypes.enum"); +class ParamsTokenFactory { + exchangeEnumForString(type) { + switch (type) { + case route_paramtypes_enum_1.RouteParamtypes.BODY: + return 'body'; + case route_paramtypes_enum_1.RouteParamtypes.PARAM: + return 'param'; + case route_paramtypes_enum_1.RouteParamtypes.QUERY: + return 'query'; + default: + return 'custom'; + } + } +} +exports.ParamsTokenFactory = ParamsTokenFactory; diff --git a/node_modules/@nestjs/core/pipes/pipes-consumer.d.ts b/node_modules/@nestjs/core/pipes/pipes-consumer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..02a07fc78947e2df6d985f5f73cd546ecee3f3a2 --- /dev/null +++ b/node_modules/@nestjs/core/pipes/pipes-consumer.d.ts @@ -0,0 +1,10 @@ +import { ArgumentMetadata, PipeTransform } from '@nestjs/common/interfaces'; +export declare class PipesConsumer { + private readonly paramsTokenFactory; + apply(value: TInput, { metatype, type, data }: ArgumentMetadata, pipes: PipeTransform[]): Promise; + applyPipes(value: TInput, { metatype, type, data }: { + metatype: any; + type?: any; + data?: any; + }, transforms: PipeTransform[]): Promise; +} diff --git a/node_modules/@nestjs/core/pipes/pipes-consumer.js b/node_modules/@nestjs/core/pipes/pipes-consumer.js new file mode 100644 index 0000000000000000000000000000000000000000..278ec1ecb639e81907ea7969fdf245a28661c74f --- /dev/null +++ b/node_modules/@nestjs/core/pipes/pipes-consumer.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PipesConsumer = void 0; +const params_token_factory_1 = require("./params-token-factory"); +class PipesConsumer { + constructor() { + this.paramsTokenFactory = new params_token_factory_1.ParamsTokenFactory(); + } + async apply(value, { metatype, type, data }, pipes) { + const token = this.paramsTokenFactory.exchangeEnumForString(type); + return this.applyPipes(value, { metatype, type: token, data }, pipes); + } + async applyPipes(value, { metatype, type, data }, transforms) { + return transforms.reduce(async (deferredValue, pipe) => { + const val = await deferredValue; + const result = pipe.transform(val, { metatype, type, data }); + return result; + }, Promise.resolve(value)); + } +} +exports.PipesConsumer = PipesConsumer; diff --git a/node_modules/@nestjs/core/pipes/pipes-context-creator.d.ts b/node_modules/@nestjs/core/pipes/pipes-context-creator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e5152a607c3c21acd26cc6f65581b57f7ba4cf6f --- /dev/null +++ b/node_modules/@nestjs/core/pipes/pipes-context-creator.d.ts @@ -0,0 +1,17 @@ +import { Controller, PipeTransform, Type } from '@nestjs/common/interfaces'; +import { ApplicationConfig } from '../application-config'; +import { ContextCreator } from '../helpers/context-creator'; +import { NestContainer } from '../injector/container'; +import { InstanceWrapper } from '../injector/instance-wrapper'; +export declare class PipesContextCreator extends ContextCreator { + private readonly container; + private readonly config?; + private moduleContext; + constructor(container: NestContainer, config?: ApplicationConfig | undefined); + create(instance: Controller, callback: (...args: unknown[]) => unknown, moduleKey: string, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): PipeTransform[]; + createConcreteContext(metadata: T, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): R; + getPipeInstance(pipe: Function | PipeTransform, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): PipeTransform | null; + getInstanceByMetatype(metatype: Type): InstanceWrapper | undefined; + getGlobalMetadata(contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): T; + setModuleContext(context: string): void; +} diff --git a/node_modules/@nestjs/core/pipes/pipes-context-creator.js b/node_modules/@nestjs/core/pipes/pipes-context-creator.js new file mode 100644 index 0000000000000000000000000000000000000000..cd72bd9fad889d8454b8e3fcbd9ff5598424a468 --- /dev/null +++ b/node_modules/@nestjs/core/pipes/pipes-context-creator.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PipesContextCreator = void 0; +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const context_creator_1 = require("../helpers/context-creator"); +const constants_2 = require("../injector/constants"); +class PipesContextCreator extends context_creator_1.ContextCreator { + constructor(container, config) { + super(); + this.container = container; + this.config = config; + } + create(instance, callback, moduleKey, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + this.moduleContext = moduleKey; + return this.createContext(instance, callback, constants_1.PIPES_METADATA, contextId, inquirerId); + } + createConcreteContext(metadata, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + if ((0, shared_utils_1.isEmpty)(metadata)) { + return []; + } + return (0, iterare_1.iterate)(metadata) + .filter((pipe) => pipe && (pipe.name || pipe.transform)) + .map(pipe => this.getPipeInstance(pipe, contextId, inquirerId)) + .filter(pipe => !!pipe && pipe.transform && (0, shared_utils_1.isFunction)(pipe.transform)) + .toArray(); + } + getPipeInstance(pipe, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + const isObject = !!pipe.transform; + if (isObject) { + return pipe; + } + const instanceWrapper = this.getInstanceByMetatype(pipe); + if (!instanceWrapper) { + return null; + } + const instanceHost = instanceWrapper.getInstanceByContextId(this.getContextId(contextId, instanceWrapper), inquirerId); + return instanceHost && instanceHost.instance; + } + getInstanceByMetatype(metatype) { + if (!this.moduleContext) { + return; + } + const collection = this.container.getModules(); + const moduleRef = collection.get(this.moduleContext); + if (!moduleRef) { + return; + } + return moduleRef.injectables.get(metatype); + } + getGlobalMetadata(contextId = constants_2.STATIC_CONTEXT, inquirerId) { + if (!this.config) { + return []; + } + const globalPipes = this.config.getGlobalPipes(); + if (contextId === constants_2.STATIC_CONTEXT && !inquirerId) { + return globalPipes; + } + const scopedPipeWrappers = this.config.getGlobalRequestPipes(); + const scopedPipes = (0, iterare_1.iterate)(scopedPipeWrappers) + .map(wrapper => wrapper.getInstanceByContextId(this.getContextId(contextId, wrapper), inquirerId)) + .filter(host => !!host) + .map(host => host.instance) + .toArray(); + return globalPipes.concat(scopedPipes); + } + setModuleContext(context) { + this.moduleContext = context; + } +} +exports.PipesContextCreator = PipesContextCreator; diff --git a/node_modules/@nestjs/core/repl/assign-to-object.util.d.ts b/node_modules/@nestjs/core/repl/assign-to-object.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..85c24a1e8e1af003ab1a9e57a82785e2d76ec396 --- /dev/null +++ b/node_modules/@nestjs/core/repl/assign-to-object.util.d.ts @@ -0,0 +1,5 @@ +/** + * Similar to `Object.assign` but copying properties descriptors from `source` + * as well. + */ +export declare function assignToObject(target: T, source: U): T & U; diff --git a/node_modules/@nestjs/core/repl/assign-to-object.util.js b/node_modules/@nestjs/core/repl/assign-to-object.util.js new file mode 100644 index 0000000000000000000000000000000000000000..3b751e020e0acb4c0e46dc9c7b66a47e844e66e8 --- /dev/null +++ b/node_modules/@nestjs/core/repl/assign-to-object.util.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assignToObject = assignToObject; +/** + * Similar to `Object.assign` but copying properties descriptors from `source` + * as well. + */ +function assignToObject(target, source) { + Object.defineProperties(target, Object.keys(source).reduce((descriptors, key) => { + descriptors[key] = Object.getOwnPropertyDescriptor(source, key); + return descriptors; + }, Object.create(null))); + return target; +} diff --git a/node_modules/@nestjs/core/repl/constants.d.ts b/node_modules/@nestjs/core/repl/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..708d91ac175cfc1731793a936c3d54e7dc8ada07 --- /dev/null +++ b/node_modules/@nestjs/core/repl/constants.d.ts @@ -0,0 +1 @@ +export declare const REPL_INITIALIZED_MESSAGE = "REPL initialized"; diff --git a/node_modules/@nestjs/core/repl/constants.js b/node_modules/@nestjs/core/repl/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..9f191a70b048d2f3c544d0b7185a41ef90f74c85 --- /dev/null +++ b/node_modules/@nestjs/core/repl/constants.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.REPL_INITIALIZED_MESSAGE = void 0; +exports.REPL_INITIALIZED_MESSAGE = 'REPL initialized'; diff --git a/node_modules/@nestjs/core/repl/index.d.ts b/node_modules/@nestjs/core/repl/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8a399bd09a5f02291852435eac15105e3ff530ad --- /dev/null +++ b/node_modules/@nestjs/core/repl/index.d.ts @@ -0,0 +1 @@ +export * from './repl'; diff --git a/node_modules/@nestjs/core/repl/index.js b/node_modules/@nestjs/core/repl/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ca8ee874564cfbdb1e661a9eea63a7d8c6cbb613 --- /dev/null +++ b/node_modules/@nestjs/core/repl/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./repl"), exports); diff --git a/node_modules/@nestjs/core/repl/native-functions/debug-repl-fn.d.ts b/node_modules/@nestjs/core/repl/native-functions/debug-repl-fn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..03b540357786b045a06feaa31c902988ba87f36f --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/debug-repl-fn.d.ts @@ -0,0 +1,9 @@ +import type { Type } from '@nestjs/common'; +import { ReplFunction } from '../repl-function'; +import type { ReplFnDefinition } from '../repl.interfaces'; +export declare class DebugReplFn extends ReplFunction { + fnDefinition: ReplFnDefinition; + action(moduleCls?: Type | string): void; + private printCtrlsAndProviders; + private printCollection; +} diff --git a/node_modules/@nestjs/core/repl/native-functions/debug-repl-fn.js b/node_modules/@nestjs/core/repl/native-functions/debug-repl-fn.js new file mode 100644 index 0000000000000000000000000000000000000000..36860049223e55595d7e841d834a515e1402dbdd --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/debug-repl-fn.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DebugReplFn = void 0; +const cli_colors_util_1 = require("@nestjs/common/utils/cli-colors.util"); +const repl_function_1 = require("../repl-function"); +class DebugReplFn extends repl_function_1.ReplFunction { + constructor() { + super(...arguments); + this.fnDefinition = { + name: 'debug', + description: 'Print all registered modules as a list together with their controllers and providers.\nIf the argument is passed in, for example, "debug(MyModule)" then it will only print components of this specific module.', + signature: '(moduleCls?: ClassRef | string) => void', + }; + } + action(moduleCls) { + this.ctx.writeToStdout('\n'); + if (moduleCls) { + const token = typeof moduleCls === 'function' ? moduleCls.name : moduleCls; + const moduleEntry = this.ctx.debugRegistry[token]; + if (!moduleEntry) { + return this.logger.error(`"${token}" has not been found in the modules registry`); + } + this.printCtrlsAndProviders(token, moduleEntry); + } + else { + Object.keys(this.ctx.debugRegistry).forEach(moduleKey => { + this.printCtrlsAndProviders(moduleKey, this.ctx.debugRegistry[moduleKey]); + }); + } + this.ctx.writeToStdout('\n'); + } + printCtrlsAndProviders(moduleName, moduleDebugEntry) { + this.ctx.writeToStdout(`${cli_colors_util_1.clc.green(moduleName)}:\n`); + this.printCollection('controllers', moduleDebugEntry['controllers']); + this.printCollection('providers', moduleDebugEntry['providers']); + } + printCollection(title, collectionValue) { + const collectionEntries = Object.keys(collectionValue); + if (collectionEntries.length <= 0) { + return; + } + this.ctx.writeToStdout(` ${cli_colors_util_1.clc.yellow(`- ${title}`)}:\n`); + collectionEntries.forEach(provider => this.ctx.writeToStdout(` ${cli_colors_util_1.clc.green('◻')} ${provider}\n`)); + } +} +exports.DebugReplFn = DebugReplFn; diff --git a/node_modules/@nestjs/core/repl/native-functions/get-repl-fn.d.ts b/node_modules/@nestjs/core/repl/native-functions/get-repl-fn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..27dbcb3a6b2b4293b460a9f34ae2a099e7ceb2c7 --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/get-repl-fn.d.ts @@ -0,0 +1,7 @@ +import type { Type } from '@nestjs/common'; +import { ReplFunction } from '../repl-function'; +import type { ReplFnDefinition } from '../repl.interfaces'; +export declare class GetReplFn extends ReplFunction { + fnDefinition: ReplFnDefinition; + action(token: string | symbol | Function | Type): any; +} diff --git a/node_modules/@nestjs/core/repl/native-functions/get-repl-fn.js b/node_modules/@nestjs/core/repl/native-functions/get-repl-fn.js new file mode 100644 index 0000000000000000000000000000000000000000..b2aaeb4d59e34098508ddc1d12e151d4207bba86 --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/get-repl-fn.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetReplFn = void 0; +const repl_function_1 = require("../repl-function"); +class GetReplFn extends repl_function_1.ReplFunction { + constructor() { + super(...arguments); + this.fnDefinition = { + name: 'get', + signature: '(token: InjectionToken) => any', + description: 'Retrieves an instance of either injectable or controller, otherwise, throws exception.', + aliases: ['$'], + }; + } + action(token) { + return this.ctx.app.get(token); + } +} +exports.GetReplFn = GetReplFn; diff --git a/node_modules/@nestjs/core/repl/native-functions/help-repl-fn.d.ts b/node_modules/@nestjs/core/repl/native-functions/help-repl-fn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e370e36e6e0e275b8b5e2b87170cd8ea49a02d23 --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/help-repl-fn.d.ts @@ -0,0 +1,7 @@ +import { ReplFunction } from '../repl-function'; +import type { ReplFnDefinition } from '../repl.interfaces'; +export declare class HelpReplFn extends ReplFunction { + fnDefinition: ReplFnDefinition; + static buildHelpMessage: ({ name, description }: ReplFnDefinition) => string; + action(): void; +} diff --git a/node_modules/@nestjs/core/repl/native-functions/help-repl-fn.js b/node_modules/@nestjs/core/repl/native-functions/help-repl-fn.js new file mode 100644 index 0000000000000000000000000000000000000000..7e1a067f6b68e7042577eb1359fd0d375097955c --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/help-repl-fn.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HelpReplFn = void 0; +const iterare_1 = require("iterare"); +const cli_colors_util_1 = require("@nestjs/common/utils/cli-colors.util"); +const repl_function_1 = require("../repl-function"); +class HelpReplFn extends repl_function_1.ReplFunction { + constructor() { + super(...arguments); + this.fnDefinition = { + name: 'help', + signature: '() => void', + description: 'Display all available REPL native functions.', + }; + } + action() { + const sortedNativeFunctions = (0, iterare_1.iterate)(this.ctx.nativeFunctions) + .map(([, nativeFunction]) => nativeFunction.fnDefinition) + .toArray() + .sort((a, b) => (a.name < b.name ? -1 : 1)); + this.ctx.writeToStdout(`You can call ${cli_colors_util_1.clc.bold('.help')} on any function listed below (e.g.: ${cli_colors_util_1.clc.bold('help.help')}):\n\n` + + sortedNativeFunctions.map(HelpReplFn.buildHelpMessage).join('\n') + + // Without the following LF the last item won't be displayed + '\n'); + } +} +exports.HelpReplFn = HelpReplFn; +HelpReplFn.buildHelpMessage = ({ name, description }) => cli_colors_util_1.clc.cyanBright(name) + + (description ? ` ${cli_colors_util_1.clc.bold('-')} ${description}` : ''); diff --git a/node_modules/@nestjs/core/repl/native-functions/index.d.ts b/node_modules/@nestjs/core/repl/native-functions/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b552bc502f5b1725b1c1d290bb6787bef970f946 --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/index.d.ts @@ -0,0 +1,6 @@ +export * from './help-repl-fn'; +export * from './get-repl-fn'; +export * from './resolve-repl-fn'; +export * from './select-relp-fn'; +export * from './debug-repl-fn'; +export * from './methods-repl-fn'; diff --git a/node_modules/@nestjs/core/repl/native-functions/index.js b/node_modules/@nestjs/core/repl/native-functions/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6e694c6236b1a4605cfab082f9cc97feefc45823 --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./help-repl-fn"), exports); +tslib_1.__exportStar(require("./get-repl-fn"), exports); +tslib_1.__exportStar(require("./resolve-repl-fn"), exports); +tslib_1.__exportStar(require("./select-relp-fn"), exports); +tslib_1.__exportStar(require("./debug-repl-fn"), exports); +tslib_1.__exportStar(require("./methods-repl-fn"), exports); diff --git a/node_modules/@nestjs/core/repl/native-functions/methods-repl-fn.d.ts b/node_modules/@nestjs/core/repl/native-functions/methods-repl-fn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c8dcb7d263133e1050797c315ffdef187207b49 --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/methods-repl-fn.d.ts @@ -0,0 +1,8 @@ +import type { Type } from '@nestjs/common'; +import { ReplFunction } from '../repl-function'; +import type { ReplFnDefinition } from '../repl.interfaces'; +export declare class MethodsReplFn extends ReplFunction { + fnDefinition: ReplFnDefinition; + private readonly metadataScanner; + action(token: Type | string): void; +} diff --git a/node_modules/@nestjs/core/repl/native-functions/methods-repl-fn.js b/node_modules/@nestjs/core/repl/native-functions/methods-repl-fn.js new file mode 100644 index 0000000000000000000000000000000000000000..d5a05ce01540eb0e4899ef5f04ccac0b5369ff58 --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/methods-repl-fn.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MethodsReplFn = void 0; +const cli_colors_util_1 = require("@nestjs/common/utils/cli-colors.util"); +const metadata_scanner_1 = require("../../metadata-scanner"); +const repl_function_1 = require("../repl-function"); +class MethodsReplFn extends repl_function_1.ReplFunction { + constructor() { + super(...arguments); + this.fnDefinition = { + name: 'methods', + description: 'Display all public methods available on a given provider or controller.', + signature: '(token: ClassRef | string) => void', + }; + this.metadataScanner = new metadata_scanner_1.MetadataScanner(); + } + action(token) { + const proto = typeof token !== 'function' + ? Object.getPrototypeOf(this.ctx.app.get(token)) + : token?.prototype; + const methods = this.metadataScanner.getAllMethodNames(proto); + this.ctx.writeToStdout('\n'); + this.ctx.writeToStdout(`${cli_colors_util_1.clc.green('Methods')}:\n`); + methods.forEach(methodName => this.ctx.writeToStdout(` ${cli_colors_util_1.clc.yellow('◻')} ${methodName}\n`)); + this.ctx.writeToStdout('\n'); + } +} +exports.MethodsReplFn = MethodsReplFn; diff --git a/node_modules/@nestjs/core/repl/native-functions/resolve-repl-fn.d.ts b/node_modules/@nestjs/core/repl/native-functions/resolve-repl-fn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2271e2f8be157b6585641d093afb0b8d3d92a3a7 --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/resolve-repl-fn.d.ts @@ -0,0 +1,7 @@ +import type { Type } from '@nestjs/common'; +import { ReplFunction } from '../repl-function'; +import type { ReplFnDefinition } from '../repl.interfaces'; +export declare class ResolveReplFn extends ReplFunction { + fnDefinition: ReplFnDefinition; + action(token: string | symbol | Function | Type, contextId: any): Promise; +} diff --git a/node_modules/@nestjs/core/repl/native-functions/resolve-repl-fn.js b/node_modules/@nestjs/core/repl/native-functions/resolve-repl-fn.js new file mode 100644 index 0000000000000000000000000000000000000000..88563331dfa70453354bf3154117ee047a27684a --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/resolve-repl-fn.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ResolveReplFn = void 0; +const repl_function_1 = require("../repl-function"); +class ResolveReplFn extends repl_function_1.ReplFunction { + constructor() { + super(...arguments); + this.fnDefinition = { + name: 'resolve', + description: 'Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception.', + signature: '(token: InjectionToken, contextId: any) => Promise', + }; + } + action(token, contextId) { + return this.ctx.app.resolve(token, contextId); + } +} +exports.ResolveReplFn = ResolveReplFn; diff --git a/node_modules/@nestjs/core/repl/native-functions/select-relp-fn.d.ts b/node_modules/@nestjs/core/repl/native-functions/select-relp-fn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e633b096be3389493828cefd220a56777d369b2d --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/select-relp-fn.d.ts @@ -0,0 +1,7 @@ +import type { DynamicModule, INestApplicationContext, Type } from '@nestjs/common'; +import { ReplFunction } from '../repl-function'; +import type { ReplFnDefinition } from '../repl.interfaces'; +export declare class SelectReplFn extends ReplFunction { + fnDefinition: ReplFnDefinition; + action(token: DynamicModule | Type): INestApplicationContext; +} diff --git a/node_modules/@nestjs/core/repl/native-functions/select-relp-fn.js b/node_modules/@nestjs/core/repl/native-functions/select-relp-fn.js new file mode 100644 index 0000000000000000000000000000000000000000..dfca2ce28c0dfd25de2a73587a41f4837726ddf7 --- /dev/null +++ b/node_modules/@nestjs/core/repl/native-functions/select-relp-fn.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SelectReplFn = void 0; +const repl_function_1 = require("../repl-function"); +class SelectReplFn extends repl_function_1.ReplFunction { + constructor() { + super(...arguments); + this.fnDefinition = { + name: 'select', + description: 'Allows navigating through the modules tree, for example, to pull out a specific instance from the selected module.', + signature: '(token: DynamicModule | ClassRef) => INestApplicationContext', + }; + } + action(token) { + return this.ctx.app.select(token); + } +} +exports.SelectReplFn = SelectReplFn; diff --git a/node_modules/@nestjs/core/repl/repl-context.d.ts b/node_modules/@nestjs/core/repl/repl-context.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d71c2191006ea28fed1f4779e0c518bf5f30717 --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl-context.d.ts @@ -0,0 +1,26 @@ +import { INestApplicationContext, InjectionToken, Logger } from '@nestjs/common'; +import { ReplFunction } from './repl-function'; +import type { ReplFunctionClass } from './repl.interfaces'; +type ModuleKey = string; +export type ModuleDebugEntry = { + controllers: Record; + providers: Record; +}; +type ReplScope = Record; +export declare class ReplContext { + readonly app: INestApplicationContext; + readonly logger: Logger; + debugRegistry: Record; + readonly globalScope: ReplScope; + readonly nativeFunctions: Map>; + private readonly container; + constructor(app: INestApplicationContext, nativeFunctionsClassRefs?: ReplFunctionClass[]); + writeToStdout(text: string): void; + private initializeContext; + private introspectCollection; + private stringifyToken; + private addNativeFunction; + private registerFunctionIntoGlobalScope; + private initializeNativeFunctions; +} +export {}; diff --git a/node_modules/@nestjs/core/repl/repl-context.js b/node_modules/@nestjs/core/repl/repl-context.js new file mode 100644 index 0000000000000000000000000000000000000000..53f1b56b24b1851ade37d2c43d7a3d6e4383415d --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl-context.js @@ -0,0 +1,126 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReplContext = void 0; +const common_1 = require("@nestjs/common"); +const application_config_1 = require("../application-config"); +const injector_1 = require("../injector"); +const internal_core_module_1 = require("../injector/internal-core-module/internal-core-module"); +const native_functions_1 = require("./native-functions"); +class ReplContext { + constructor(app, nativeFunctionsClassRefs) { + this.app = app; + this.logger = new common_1.Logger(ReplContext.name); + this.debugRegistry = {}; + this.globalScope = Object.create(null); + this.nativeFunctions = new Map(); + this.container = app.container; // Using `any` because `app.container` is not public. + this.initializeContext(); + this.initializeNativeFunctions(nativeFunctionsClassRefs || []); + } + writeToStdout(text) { + process.stdout.write(text); + } + initializeContext() { + const modules = this.container.getModules(); + modules.forEach(moduleRef => { + let moduleName = moduleRef.metatype.name; + if (moduleName === internal_core_module_1.InternalCoreModule.name) { + return; + } + if (this.globalScope[moduleName]) { + moduleName += ` (${moduleRef.token})`; + } + this.introspectCollection(moduleRef, moduleName, 'providers'); + this.introspectCollection(moduleRef, moduleName, 'controllers'); + // For in REPL auto-complete functionality + Object.defineProperty(this.globalScope, moduleName, { + value: moduleRef.metatype, + configurable: false, + enumerable: true, + }); + }); + } + introspectCollection(moduleRef, moduleKey, collection) { + const moduleDebugEntry = {}; + moduleRef[collection].forEach(({ token }) => { + const stringifiedToken = this.stringifyToken(token); + if (stringifiedToken === application_config_1.ApplicationConfig.name || + stringifiedToken === moduleRef.metatype.name) { + return; + } + if (!this.globalScope[stringifiedToken]) { + // For in REPL auto-complete functionality + Object.defineProperty(this.globalScope, stringifiedToken, { + value: token, + configurable: false, + enumerable: true, + }); + } + if (stringifiedToken === injector_1.ModuleRef.name) { + return; + } + moduleDebugEntry[stringifiedToken] = token; + }); + this.debugRegistry[moduleKey] = { + ...this.debugRegistry?.[moduleKey], + [collection]: moduleDebugEntry, + }; + } + stringifyToken(token) { + return typeof token !== 'string' + ? typeof token === 'function' + ? token.name + : token?.toString() + : `"${token}"`; + } + addNativeFunction(NativeFunctionRef) { + const nativeFunction = new NativeFunctionRef(this); + const nativeFunctions = [nativeFunction]; + this.nativeFunctions.set(nativeFunction.fnDefinition.name, nativeFunction); + nativeFunction.fnDefinition.aliases?.forEach(aliasName => { + const aliasNativeFunction = Object.create(nativeFunction); + aliasNativeFunction.fnDefinition = { + name: aliasName, + description: aliasNativeFunction.fnDefinition.description, + signature: aliasNativeFunction.fnDefinition.signature, + }; + this.nativeFunctions.set(aliasName, aliasNativeFunction); + nativeFunctions.push(aliasNativeFunction); + }); + return nativeFunctions; + } + registerFunctionIntoGlobalScope(nativeFunction) { + // Bind the method to REPL's context: + this.globalScope[nativeFunction.fnDefinition.name] = + nativeFunction.action.bind(nativeFunction); + // Load the help trigger as a `help` getter on each native function: + const functionBoundRef = this.globalScope[nativeFunction.fnDefinition.name]; + Object.defineProperty(functionBoundRef, 'help', { + enumerable: false, + configurable: false, + get: () => + // Dynamically builds the help message as will unlikely to be called + // several times. + this.writeToStdout(nativeFunction.makeHelpMessage()), + }); + } + initializeNativeFunctions(nativeFunctionsClassRefs) { + const builtInFunctionsClassRefs = [ + native_functions_1.HelpReplFn, + native_functions_1.GetReplFn, + native_functions_1.ResolveReplFn, + native_functions_1.SelectReplFn, + native_functions_1.DebugReplFn, + native_functions_1.MethodsReplFn, + ]; + builtInFunctionsClassRefs + .concat(nativeFunctionsClassRefs) + .forEach(NativeFunction => { + const nativeFunctions = this.addNativeFunction(NativeFunction); + nativeFunctions.forEach(nativeFunction => { + this.registerFunctionIntoGlobalScope(nativeFunction); + }); + }); + } +} +exports.ReplContext = ReplContext; diff --git a/node_modules/@nestjs/core/repl/repl-function.d.ts b/node_modules/@nestjs/core/repl/repl-function.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a693e82b217b1779dfe1069c2b85cc6f57dff66 --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl-function.d.ts @@ -0,0 +1,18 @@ +import { Logger } from '@nestjs/common'; +import { ReplContext } from './repl-context'; +import type { ReplFnDefinition } from './repl.interfaces'; +export declare abstract class ReplFunction = Array, ActionReturn = any> { + protected readonly ctx: ReplContext; + /** Metadata that describes the built-in function itself. */ + abstract fnDefinition: ReplFnDefinition; + protected readonly logger: Logger; + constructor(ctx: ReplContext); + /** + * Method called when the function is invoked from the REPL by the user. + */ + abstract action(...args: ActionParams): ActionReturn; + /** + * @returns A message displayed by calling `.help` + */ + makeHelpMessage(): string; +} diff --git a/node_modules/@nestjs/core/repl/repl-function.js b/node_modules/@nestjs/core/repl/repl-function.js new file mode 100644 index 0000000000000000000000000000000000000000..ef706875d19ab5ed58660b4f5524527c5f647982 --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl-function.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReplFunction = void 0; +const cli_colors_util_1 = require("@nestjs/common/utils/cli-colors.util"); +class ReplFunction { + constructor(ctx) { + this.ctx = ctx; + this.logger = ctx.logger; + } + /** + * @returns A message displayed by calling `.help` + */ + makeHelpMessage() { + const { description, name, signature } = this.fnDefinition; + const fnSignatureWithName = `${name}${signature}`; + return `${cli_colors_util_1.clc.yellow(description)}\n${cli_colors_util_1.clc.magentaBright('Interface:')} ${cli_colors_util_1.clc.bold(fnSignatureWithName)}\n`; + } +} +exports.ReplFunction = ReplFunction; diff --git a/node_modules/@nestjs/core/repl/repl-logger.d.ts b/node_modules/@nestjs/core/repl/repl-logger.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cd03587fd83f8f6ad6e3ac6895d67b36f2ffab3d --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl-logger.d.ts @@ -0,0 +1,5 @@ +import { ConsoleLogger } from '@nestjs/common'; +export declare class ReplLogger extends ConsoleLogger { + private static readonly ignoredContexts; + log(_message: any, context?: string): void; +} diff --git a/node_modules/@nestjs/core/repl/repl-logger.js b/node_modules/@nestjs/core/repl/repl-logger.js new file mode 100644 index 0000000000000000000000000000000000000000..f95a2e18e92e36e1f004a27967c17f5c83732052 --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl-logger.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReplLogger = void 0; +const common_1 = require("@nestjs/common"); +const nest_application_1 = require("../nest-application"); +const router_explorer_1 = require("../router/router-explorer"); +const routes_resolver_1 = require("../router/routes-resolver"); +class ReplLogger extends common_1.ConsoleLogger { + log(_message, context) { + if (ReplLogger.ignoredContexts.includes(context)) { + return; + } + // eslint-disable-next-line + return super.log.apply(this, Array.from(arguments)); + } +} +exports.ReplLogger = ReplLogger; +ReplLogger.ignoredContexts = [ + routes_resolver_1.RoutesResolver.name, + router_explorer_1.RouterExplorer.name, + nest_application_1.NestApplication.name, +]; diff --git a/node_modules/@nestjs/core/repl/repl-native-commands.d.ts b/node_modules/@nestjs/core/repl/repl-native-commands.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87bffd77e8cba2ecae794177d2ab876ba65deb15 --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl-native-commands.d.ts @@ -0,0 +1,2 @@ +import type { REPLServer } from 'repl'; +export declare function defineDefaultCommandsOnRepl(replServer: REPLServer): void; diff --git a/node_modules/@nestjs/core/repl/repl-native-commands.js b/node_modules/@nestjs/core/repl/repl-native-commands.js new file mode 100644 index 0000000000000000000000000000000000000000..02b11bdbb719ceda13b4e3d4e9730f45e391bd04 --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl-native-commands.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defineDefaultCommandsOnRepl = defineDefaultCommandsOnRepl; +/** + * Displays a list of available commands in the REPL alongside with their + * descriptions. + * (c) This code was inspired by the 'help' command from Node.js core: + * {@link https://github.com/nodejs/node/blob/58b60c1393dd65cd228a8b0084a19acd2c1d16aa/lib/repl.js#L1741-L1759} + */ +function listAllCommands(replServer) { + Object.keys(replServer.commands) + .sort() + .forEach(name => { + const cmd = replServer.commands[name]; + if (cmd) { + replServer.output.write(`${name}\t${cmd.help || ''}\n`); + } + }); +} +function defineDefaultCommandsOnRepl(replServer) { + replServer.defineCommand('help', { + help: 'Show REPL options', + action(name) { + this.clearBufferedCommand(); + if (name) { + // Considering native commands before native nestjs injected functions. + const nativeCommandOrFunction = this.commands[name] || this.context[name]; + // NOTE: If the command was retrieve from the context, it will have a `help` + // getter property that outputs the helper message and returns undefined. + // But if the command was retrieve from the `commands` object, it will + // have a `help` property that returns the helper message. + const helpMessage = nativeCommandOrFunction?.help; + if (helpMessage) { + this.output.write(`${helpMessage}\n`); + } + } + else { + listAllCommands(this); + this.output.write('\n\n'); + this.context.help(); + this.output.write('\nPress Ctrl+C to abort current expression, Ctrl+D to exit the REPL\n'); + } + this.displayPrompt(); + }, + }); +} diff --git a/node_modules/@nestjs/core/repl/repl.d.ts b/node_modules/@nestjs/core/repl/repl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6fce6f72dda23dfb9647efbe4875fba9181ac8ce --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl.d.ts @@ -0,0 +1,3 @@ +import { DynamicModule, Type } from '@nestjs/common'; +import type { ReplOptions } from 'repl'; +export declare function repl(module: Type | DynamicModule, replOptions?: ReplOptions): Promise; diff --git a/node_modules/@nestjs/core/repl/repl.interfaces.d.ts b/node_modules/@nestjs/core/repl/repl.interfaces.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..778fa6ccd16b43b2ed23fcd330ed28325097a4ca --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl.interfaces.d.ts @@ -0,0 +1,16 @@ +import type { ReplContext } from './repl-context'; +import type { ReplFunction } from './repl-function'; +export type ReplFnDefinition = { + /** Function's name. Note that this should be a valid JavaScript function name. */ + name: string; + /** Alternative names to the function. */ + aliases?: ReplFnDefinition['name'][]; + /** Function's description to display when `.help` is entered. */ + description: string; + /** + * Function's signature following TypeScript _function type expression_ syntax. + * @example '(token: InjectionToken) => any' + */ + signature: string; +}; +export type ReplFunctionClass = new (replContext: ReplContext) => ReplFunction; diff --git a/node_modules/@nestjs/core/repl/repl.interfaces.js b/node_modules/@nestjs/core/repl/repl.interfaces.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl.interfaces.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/repl/repl.js b/node_modules/@nestjs/core/repl/repl.js new file mode 100644 index 0000000000000000000000000000000000000000..6fd80a4bc7dbe58ce15c3700d18bc0ddbbaf8c40 --- /dev/null +++ b/node_modules/@nestjs/core/repl/repl.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.repl = repl; +const common_1 = require("@nestjs/common"); +const cli_colors_util_1 = require("@nestjs/common/utils/cli-colors.util"); +const nest_factory_1 = require("../nest-factory"); +const assign_to_object_util_1 = require("./assign-to-object.util"); +const constants_1 = require("./constants"); +const repl_context_1 = require("./repl-context"); +const repl_logger_1 = require("./repl-logger"); +const repl_native_commands_1 = require("./repl-native-commands"); +async function repl(module, replOptions = {}) { + const app = await nest_factory_1.NestFactory.createApplicationContext(module, { + abortOnError: false, + logger: new repl_logger_1.ReplLogger(), + }); + await app.init(); + const replContext = new repl_context_1.ReplContext(app); + common_1.Logger.log(constants_1.REPL_INITIALIZED_MESSAGE); + const _repl = await Promise.resolve().then(() => require('repl')); + const replServer = _repl.start({ + prompt: cli_colors_util_1.clc.green('> '), + ignoreUndefined: true, + ...replOptions, + }); + (0, assign_to_object_util_1.assignToObject)(replServer.context, replContext.globalScope); + (0, repl_native_commands_1.defineDefaultCommandsOnRepl)(replServer); + replServer.on('exit', async () => { + await app.close(); + }); + return replServer; +} diff --git a/node_modules/@nestjs/core/router/index.d.ts b/node_modules/@nestjs/core/router/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5e2cc66bd72d07d4f88b6d9efa7f876f3d4a5f7b --- /dev/null +++ b/node_modules/@nestjs/core/router/index.d.ts @@ -0,0 +1,3 @@ +export * from './interfaces'; +export * from './request'; +export { RouterModule } from './router-module'; diff --git a/node_modules/@nestjs/core/router/index.js b/node_modules/@nestjs/core/router/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d4ac4395d4af23ef47bfe6e81750c66906a6ed53 --- /dev/null +++ b/node_modules/@nestjs/core/router/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RouterModule = void 0; +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./interfaces"), exports); +tslib_1.__exportStar(require("./request"), exports); +var router_module_1 = require("./router-module"); +Object.defineProperty(exports, "RouterModule", { enumerable: true, get: function () { return router_module_1.RouterModule; } }); diff --git a/node_modules/@nestjs/core/router/interfaces/exceptions-filter.interface.d.ts b/node_modules/@nestjs/core/router/interfaces/exceptions-filter.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..61e6b10da2b5a72306842b6a8afb2f319e27a2fa --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/exceptions-filter.interface.d.ts @@ -0,0 +1,6 @@ +import { Controller } from '@nestjs/common/interfaces/controllers/controller.interface'; +import { ExceptionsHandler } from '../../exceptions/exceptions-handler'; +import { ContextId } from '../../injector/instance-wrapper'; +export interface ExceptionsFilter { + create(instance: Controller, callback: Function, module: string, contextId?: ContextId, inquirerId?: string): ExceptionsHandler; +} diff --git a/node_modules/@nestjs/core/router/interfaces/exceptions-filter.interface.js b/node_modules/@nestjs/core/router/interfaces/exceptions-filter.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/exceptions-filter.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/router/interfaces/exclude-route-metadata.interface.d.ts b/node_modules/@nestjs/core/router/interfaces/exclude-route-metadata.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..850b611b9d4b8aeee4e97bb0e7bc7cb3d66ad1c6 --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/exclude-route-metadata.interface.d.ts @@ -0,0 +1,15 @@ +import { RequestMethod } from '@nestjs/common'; +export interface ExcludeRouteMetadata { + /** + * Route path. + */ + path: string; + /** + * Regular expression representing the route path. + */ + pathRegex: RegExp; + /** + * HTTP request method (e.g., GET, POST). + */ + requestMethod: RequestMethod; +} diff --git a/node_modules/@nestjs/core/router/interfaces/exclude-route-metadata.interface.js b/node_modules/@nestjs/core/router/interfaces/exclude-route-metadata.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/exclude-route-metadata.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/router/interfaces/index.d.ts b/node_modules/@nestjs/core/router/interfaces/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65ccbce89db346388870fa83d1ad39659afb4dd3 --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/index.d.ts @@ -0,0 +1 @@ +export * from './routes.interface'; diff --git a/node_modules/@nestjs/core/router/interfaces/index.js b/node_modules/@nestjs/core/router/interfaces/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9d938ae12df168d22ee46e259fb7d2a93a805432 --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./routes.interface"), exports); diff --git a/node_modules/@nestjs/core/router/interfaces/resolved-route.interface.d.ts b/node_modules/@nestjs/core/router/interfaces/resolved-route.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4cb3c21b564d52d9f3794cab427220e0bdf4f721 --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/resolved-route.interface.d.ts @@ -0,0 +1,32 @@ +import { RequestMethod } from '@nestjs/common'; +import { type VersionValue } from '@nestjs/common/internal'; +import { InstanceWrapper } from '../../injector/instance-wrapper.js'; +import { RouterProxyCallback } from '../router-proxy.js'; +/** + * Loose callable signature shared by the various handler wrappers that + * are composed before adapter registration (host filter, version + * filter, request-scoped handler, etc.). They all accept the (req, res, + * next) trio but may be invoked variadically by adapter shims. + */ +export type ResolvedRouteHandler = (...args: unknown[]) => unknown; +/** + * Final route description produced during the "collect" phase of the + * router pipeline and consumed during the "register" phase. Holds the + * fully composed path, the pre-built handler chain (proxy + host filter + * + optional version filter), and the metadata needed to register the + * route on the HTTP adapter and to insert an entrypoint into the graph + * inspector. + */ +export interface ResolvedRoute { + method: RequestMethod; + path: string; + rawPath?: string; + host: string | RegExp | Array | undefined; + version: VersionValue | undefined; + methodVersion: VersionValue | undefined; + controllerVersion: VersionValue | undefined; + handler: ResolvedRouteHandler; + targetCallback: RouterProxyCallback; + methodName: string; + instanceWrapper: InstanceWrapper; +} diff --git a/node_modules/@nestjs/core/router/interfaces/resolved-route.interface.js b/node_modules/@nestjs/core/router/interfaces/resolved-route.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/resolved-route.interface.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@nestjs/core/router/interfaces/resolver.interface.d.ts b/node_modules/@nestjs/core/router/interfaces/resolver.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..318a01237527622809bc234634c4bddeb1445786 --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/resolver.interface.d.ts @@ -0,0 +1,5 @@ +export interface Resolver { + resolve(instance: any, basePath: string): void; + registerNotFoundHandler(): void; + registerExceptionHandler(): void; +} diff --git a/node_modules/@nestjs/core/router/interfaces/resolver.interface.js b/node_modules/@nestjs/core/router/interfaces/resolver.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/resolver.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/router/interfaces/route-conflict.interface.d.ts b/node_modules/@nestjs/core/router/interfaces/route-conflict.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1eb1a2c9b0aaf8bbd1c15e9ad895865195f854b2 --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/route-conflict.interface.d.ts @@ -0,0 +1,14 @@ +import { ResolvedRoute } from './resolved-route.interface.js'; +/** + * Distinguishes the two flavors of route overlap. + * - `duplicate` — identical method + path + version + host registered twice. + * - `shadow` — patterns can match the same request but are not identical. + */ +export type ConflictKind = 'duplicate' | 'shadow'; +export interface RouteConflict { + /** Route registered first; on order-sensitive adapters this wins. */ + winner: ResolvedRoute; + /** Route registered later; on order-sensitive adapters this never matches. */ + shadowed: ResolvedRoute; + kind: ConflictKind; +} diff --git a/node_modules/@nestjs/core/router/interfaces/route-conflict.interface.js b/node_modules/@nestjs/core/router/interfaces/route-conflict.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/route-conflict.interface.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@nestjs/core/router/interfaces/route-params-factory.interface.d.ts b/node_modules/@nestjs/core/router/interfaces/route-params-factory.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a1e08435819b75837b5650b62f0c3da9d407fe62 --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/route-params-factory.interface.d.ts @@ -0,0 +1,8 @@ +import { RouteParamtypes } from '@nestjs/common/enums/route-paramtypes.enum'; +export interface IRouteParamsFactory { + exchangeKeyForValue = any, TResponse = any, TResult = any>(key: RouteParamtypes | string, data: any, { req, res, next }: { + req: TRequest; + res: TResponse; + next: Function; + }): TResult | null; +} diff --git a/node_modules/@nestjs/core/router/interfaces/route-params-factory.interface.js b/node_modules/@nestjs/core/router/interfaces/route-params-factory.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/route-params-factory.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/router/interfaces/route-path-metadata.interface.d.ts b/node_modules/@nestjs/core/router/interfaces/route-path-metadata.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9862c107df7a3f98d5c1df98dade3e8fcab071be --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/route-path-metadata.interface.d.ts @@ -0,0 +1,32 @@ +import { VersioningOptions } from '@nestjs/common'; +import { VersionValue } from '@nestjs/common/interfaces'; +export interface RoutePathMetadata { + /** + * Controller-level path (e.g., @Controller('resource') = "resource"). + */ + ctrlPath?: string; + /** + * Method-level path (e.g., @Get('resource') = "resource"). + */ + methodPath?: string; + /** + * Global route prefix specified with the "NestApplication#setGlobalPrefix" method. + */ + globalPrefix?: string; + /** + * Module-level path registered through the "RouterModule". + */ + modulePath?: string; + /** + * Controller-level version (e.g., @Controller({ version: '1.0' }) = "1.0"). + */ + controllerVersion?: VersionValue; + /** + * Method-level version (e.g., @Version('1.0') = "1.0"). + */ + methodVersion?: VersionValue; + /** + * API versioning options object. + */ + versioningOptions?: VersioningOptions; +} diff --git a/node_modules/@nestjs/core/router/interfaces/route-path-metadata.interface.js b/node_modules/@nestjs/core/router/interfaces/route-path-metadata.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/route-path-metadata.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/router/interfaces/route-resolution-options.interface.d.ts b/node_modules/@nestjs/core/router/interfaces/route-resolution-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3422dc9bdc6f4872f72b30465f59bdedd299f64 --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/route-resolution-options.interface.d.ts @@ -0,0 +1,24 @@ +import { ResolvedRoute } from './resolved-route.interface.js'; +/** + * Options that control how `Resolver.resolve` walks the controller + * graph and registers routes on the HTTP adapter. Used internally to + * thread route-collection and deferred-registration concerns through + * the resolver chain without bloating individual method signatures. + */ +export interface RouteResolutionOptions { + /** + * Invoked once for each route after its final path, host and version + * have been composed. Lets the caller observe resolved routes (for + * conflict detection, specificity sorting, etc.) without coupling + * those concerns to the resolver itself. + */ + onRouteResolved?: (route: ResolvedRoute) => void; + /** + * When `true`, the resolver still walks every controller and emits + * `onRouteResolved` callbacks but skips the actual adapter + * registration step. The caller is then responsible for ordering and + * installing the collected routes via `registerResolvedRoute`. + * Defaults to `false`. + */ + deferRegistration?: boolean; +} diff --git a/node_modules/@nestjs/core/router/interfaces/route-resolution-options.interface.js b/node_modules/@nestjs/core/router/interfaces/route-resolution-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/route-resolution-options.interface.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@nestjs/core/router/interfaces/routes.interface.d.ts b/node_modules/@nestjs/core/router/interfaces/routes.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ab62e52eabcaf65bb5ba41b79f023870ea9ffab2 --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/routes.interface.d.ts @@ -0,0 +1,7 @@ +import { Type } from '@nestjs/common'; +export interface RouteTree { + path: string; + module?: Type; + children?: (RouteTree | Type)[]; +} +export type Routes = RouteTree[]; diff --git a/node_modules/@nestjs/core/router/interfaces/routes.interface.js b/node_modules/@nestjs/core/router/interfaces/routes.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/core/router/interfaces/routes.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/core/router/legacy-route-converter.d.ts b/node_modules/@nestjs/core/router/legacy-route-converter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6fb46b4aafe9b35515cce4a1fa2bbe21b5830279 --- /dev/null +++ b/node_modules/@nestjs/core/router/legacy-route-converter.d.ts @@ -0,0 +1,16 @@ +export declare class LegacyRouteConverter { + private static readonly logger; + /** + * Convert legacy routes to the new format (syntax). + * path-to-regexp used by Express>=v5 and @fastify/middie>=v9 no longer support unnamed wildcards. + * This method attempts to convert the old syntax to the new one, and logs an error if it fails. + * @param route The route to convert. + * @param options Options object. + * @returns The converted route, or the original route if it cannot be converted. + */ + static tryConvert(route: string, options?: { + logs?: boolean; + }): string; + static printError(route: string): void; + static printWarning(route: string): void; +} diff --git a/node_modules/@nestjs/core/router/legacy-route-converter.js b/node_modules/@nestjs/core/router/legacy-route-converter.js new file mode 100644 index 0000000000000000000000000000000000000000..889cc802f009098282ac7211e21ab09decdb9e09 --- /dev/null +++ b/node_modules/@nestjs/core/router/legacy-route-converter.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LegacyRouteConverter = void 0; +const common_1 = require("@nestjs/common"); +const UNSUPPORTED_PATH_MESSAGE = (text, route) => `Unsupported route path: "${route}". In previous versions, the symbols ?, *, and + were used to denote optional or repeating path parameters. The latest version of "path-to-regexp" now requires the use of named parameters. For example, instead of using a route like /users/* to capture all routes starting with "/users", you should use /users/*path. For more details, refer to the migration guide.`; +class LegacyRouteConverter { + /** + * Convert legacy routes to the new format (syntax). + * path-to-regexp used by Express>=v5 and @fastify/middie>=v9 no longer support unnamed wildcards. + * This method attempts to convert the old syntax to the new one, and logs an error if it fails. + * @param route The route to convert. + * @param options Options object. + * @returns The converted route, or the original route if it cannot be converted. + */ + static tryConvert(route, options) { + // Normalize path to eliminate additional if statements. + const routeWithLeadingSlash = route.startsWith('/') ? route : `/${route}`; + const normalizedRoute = route.endsWith('/') + ? routeWithLeadingSlash + : `${routeWithLeadingSlash}/`; + const loggingEnabled = options?.logs ?? true; + const printWarning = loggingEnabled + ? this.printWarning.bind(this) + : () => { }; + if (normalizedRoute.endsWith('/(.*)/')) { + // Skip printing warning for the "all" wildcard. + if (normalizedRoute !== '/(.*)/') { + printWarning(route); + } + return route.replace('(.*)', '{*path}'); + } + if (normalizedRoute.endsWith('/*/')) { + // Skip printing warning for the "all" wildcard. + if (normalizedRoute !== '/*/') { + printWarning(route); + } + return route.replace('*', '{*path}'); + } + if (normalizedRoute.endsWith('/+/')) { + printWarning(route); + return route.replace('/+', '/*path'); + } + // When route includes any wildcard segments in the middle. + if (normalizedRoute.includes('/*/')) { + printWarning(route); + // Replace each /*/ segment with a named parameter using different name for each segment. + return route.replaceAll('/*/', (match, offset) => { + return `/*path${offset}/`; + }); + } + return route; + } + static printError(route) { + this.logger.error(UNSUPPORTED_PATH_MESSAGE `${route}`); + } + static printWarning(route) { + this.logger.warn(UNSUPPORTED_PATH_MESSAGE `${route}` + ' Attempting to auto-convert...'); + } +} +exports.LegacyRouteConverter = LegacyRouteConverter; +LegacyRouteConverter.logger = new common_1.Logger(LegacyRouteConverter.name); diff --git a/node_modules/@nestjs/core/router/paths-explorer.d.ts b/node_modules/@nestjs/core/router/paths-explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4451e748e96eb25d0ff9e243a422f25a8fe635d0 --- /dev/null +++ b/node_modules/@nestjs/core/router/paths-explorer.d.ts @@ -0,0 +1,18 @@ +import { RequestMethod } from '@nestjs/common/enums'; +import { Controller } from '@nestjs/common/interfaces/controllers/controller.interface'; +import { VersionValue } from '@nestjs/common/interfaces/version-options.interface'; +import { MetadataScanner } from '../metadata-scanner'; +import { RouterProxyCallback } from './router-proxy'; +export interface RouteDefinition { + path: string[]; + requestMethod: RequestMethod; + targetCallback: RouterProxyCallback; + methodName: string; + version?: VersionValue; +} +export declare class PathsExplorer { + private readonly metadataScanner; + constructor(metadataScanner: MetadataScanner); + scanForPaths(instance: Controller, prototype?: object): RouteDefinition[]; + exploreMethodMetadata(instance: Controller, prototype: object, methodName: string): RouteDefinition | null; +} diff --git a/node_modules/@nestjs/core/router/paths-explorer.js b/node_modules/@nestjs/core/router/paths-explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..fe08bf285c20f20a391224dddbf4b7fc9057ad0a --- /dev/null +++ b/node_modules/@nestjs/core/router/paths-explorer.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PathsExplorer = void 0; +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +class PathsExplorer { + constructor(metadataScanner) { + this.metadataScanner = metadataScanner; + } + scanForPaths(instance, prototype) { + const instancePrototype = (0, shared_utils_1.isUndefined)(prototype) + ? Object.getPrototypeOf(instance) + : prototype; + return this.metadataScanner + .getAllMethodNames(instancePrototype) + .reduce((acc, method) => { + const route = this.exploreMethodMetadata(instance, instancePrototype, method); + if (route) { + acc.push(route); + } + return acc; + }, []); + } + exploreMethodMetadata(instance, prototype, methodName) { + const instanceCallback = instance[methodName]; + const prototypeCallback = prototype[methodName]; + const routePath = Reflect.getMetadata(constants_1.PATH_METADATA, prototypeCallback); + if ((0, shared_utils_1.isUndefined)(routePath)) { + return null; + } + const requestMethod = Reflect.getMetadata(constants_1.METHOD_METADATA, prototypeCallback); + const version = Reflect.getMetadata(constants_1.VERSION_METADATA, prototypeCallback); + const path = (0, shared_utils_1.isString)(routePath) + ? [(0, shared_utils_1.addLeadingSlash)(routePath)] + : routePath.map((p) => (0, shared_utils_1.addLeadingSlash)(p)); + return { + path, + requestMethod, + targetCallback: instanceCallback, + methodName, + version, + }; + } +} +exports.PathsExplorer = PathsExplorer; diff --git a/node_modules/@nestjs/core/router/request/index.d.ts b/node_modules/@nestjs/core/router/request/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9424999aaa247dc9e1a7dde0a6ed0dba11b7c2ff --- /dev/null +++ b/node_modules/@nestjs/core/router/request/index.d.ts @@ -0,0 +1 @@ +export { REQUEST } from './request-constants'; diff --git a/node_modules/@nestjs/core/router/request/index.js b/node_modules/@nestjs/core/router/request/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6b63e4aee9d1dc820f17240a9e38c8a4c2d1a116 --- /dev/null +++ b/node_modules/@nestjs/core/router/request/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.REQUEST = void 0; +var request_constants_1 = require("./request-constants"); +Object.defineProperty(exports, "REQUEST", { enumerable: true, get: function () { return request_constants_1.REQUEST; } }); diff --git a/node_modules/@nestjs/core/router/request/request-constants.d.ts b/node_modules/@nestjs/core/router/request/request-constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..abb7a2813a8d0259ac16b977c5bdab889cfe78f5 --- /dev/null +++ b/node_modules/@nestjs/core/router/request/request-constants.d.ts @@ -0,0 +1,2 @@ +export declare const REQUEST = "REQUEST"; +export declare const REQUEST_CONTEXT_ID: unique symbol; diff --git a/node_modules/@nestjs/core/router/request/request-constants.js b/node_modules/@nestjs/core/router/request/request-constants.js new file mode 100644 index 0000000000000000000000000000000000000000..db9383dc5f8390d2639b5c9b3af001c3ea482b22 --- /dev/null +++ b/node_modules/@nestjs/core/router/request/request-constants.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.REQUEST_CONTEXT_ID = exports.REQUEST = void 0; +exports.REQUEST = 'REQUEST'; +exports.REQUEST_CONTEXT_ID = Symbol('REQUEST_CONTEXT_ID'); diff --git a/node_modules/@nestjs/core/router/request/request-providers.d.ts b/node_modules/@nestjs/core/router/request/request-providers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40b9cbbe8d583a5e9750a63d6a6f11840c5dd102 --- /dev/null +++ b/node_modules/@nestjs/core/router/request/request-providers.d.ts @@ -0,0 +1,2 @@ +import { Provider } from '@nestjs/common'; +export declare const requestProvider: Provider; diff --git a/node_modules/@nestjs/core/router/request/request-providers.js b/node_modules/@nestjs/core/router/request/request-providers.js new file mode 100644 index 0000000000000000000000000000000000000000..9c63757aba1903fc85ceed27d35bfad074c6ea87 --- /dev/null +++ b/node_modules/@nestjs/core/router/request/request-providers.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.requestProvider = void 0; +const common_1 = require("@nestjs/common"); +const request_constants_1 = require("./request-constants"); +const noop = () => { }; +exports.requestProvider = { + provide: request_constants_1.REQUEST, + scope: common_1.Scope.REQUEST, + useFactory: noop, +}; diff --git a/node_modules/@nestjs/core/router/route-conflict-detector.d.ts b/node_modules/@nestjs/core/router/route-conflict-detector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..441b7fd733606a4d95ff94a4bbe1a1121893827d --- /dev/null +++ b/node_modules/@nestjs/core/router/route-conflict-detector.d.ts @@ -0,0 +1,71 @@ +import { Logger, type RouteConflictPolicy, type VersioningOptions } from '@nestjs/common'; +import { ResolvedRoute } from './interfaces/resolved-route.interface.js'; +import { RouteConflict } from './interfaces/route-conflict.interface.js'; +type SegmentKind = 'literal' | 'param' | 'wildcard'; +interface PathSegment { + kind: SegmentKind; + value: string; +} +/** + * Static utility class that detects overlapping HTTP routes and reports + * them according to a per-kind policy. Stateless — every method takes + * everything it needs as parameters. + */ +export declare class RouteConflictDetector { + /** + * Strips the leading `:` / `*` marker (if present) and tags each + * segment as a literal, named param, or named wildcard. Supports both + * bare named wildcards (`*path`) and adapter-normalized path-to-regexp + * wildcard groups (`{*path}`). + */ + static tokenizePath(rawPath: string): PathSegment[]; + /** + * Decides whether two paths can match the same incoming request, given + * only their declared patterns (no host/method/version considered). + */ + static pathsCanOverlap(leftPath: string, rightPath: string): boolean; + /** + * Walks every unique pair of resolved routes and produces a conflict + * record for each pair whose (method, host, version, path) tuples can + * collide at runtime. + */ + static detect(routes: ResolvedRoute[], versioningOptions: VersioningOptions | undefined): RouteConflict[]; + /** + * Applies the per-kind policy to a set of conflicts: silences `'off'`, + * logs `'warn'` once per conflict, and aggregates every `'error'`-level + * conflict into a single `RouteConflictException`. + */ + static handle(conflicts: RouteConflict[], policy: RouteConflictPolicy | undefined, logger: Logger): void; + /** + * Removes shadow conflicts that specificity sorting has already resolved. + * + * When `routeResolutionStrategy: 'specificity'` is active, the sort + * promotes more-specific routes ahead of less-specific ones. A shadow + * where the sort promoted the winner (it was declared *later* but sorted + * *first*) is handled correctly at runtime — the more-specific route is + * registered first and handles its requests while the less-specific route + * handles the rest. Retaining such a conflict would cause `shadow: 'error'` + * to abort an application whose routes actually work as intended. + * + * Shadows where the winner was already first in declaration order (the + * sort did not swap them) are genuine and are kept unchanged. Duplicate + * conflicts are always kept. + * + * @param conflicts Conflicts detected on the sorted route list. + * @param declarationOrder Routes in their original declaration order + * (i.e. before specificity sorting was applied). + */ + static filterSortResolvedShadows(conflicts: RouteConflict[], declarationOrder: ResolvedRoute[]): RouteConflict[]; + private static segmentsCanOverlap; + private static methodsCanOverlap; + private static versionsCanOverlap; + private static hostsCanOverlap; + private static hostValuesCanMatchSameRequest; + private static routesAreIdentical; + private static hostsAreIdentical; + private static hostValuesAreIdentical; + private static versionsAreIdentical; + private static forEachUniquePair; + private static describeConflict; +} +export {}; diff --git a/node_modules/@nestjs/core/router/route-conflict-detector.js b/node_modules/@nestjs/core/router/route-conflict-detector.js new file mode 100644 index 0000000000000000000000000000000000000000..964be133bbee6ca3b4c2a32101fb284f5b1a5a6f --- /dev/null +++ b/node_modules/@nestjs/core/router/route-conflict-detector.js @@ -0,0 +1,276 @@ +import { RequestMethod, VERSION_NEUTRAL, VersioningType, } from '@nestjs/common'; +import { RouteConflictException } from '../errors/exceptions/route-conflict.exception.js'; +import { DUPLICATE_ROUTE_MESSAGE, SHADOWED_ROUTE_MESSAGE, } from '../errors/messages.js'; +/** + * Static utility class that detects overlapping HTTP routes and reports + * them according to a per-kind policy. Stateless — every method takes + * everything it needs as parameters. + */ +export class RouteConflictDetector { + /** + * Strips the leading `:` / `*` marker (if present) and tags each + * segment as a literal, named param, or named wildcard. Supports both + * bare named wildcards (`*path`) and adapter-normalized path-to-regexp + * wildcard groups (`{*path}`). + */ + static tokenizePath(rawPath) { + const segments = []; + rawPath + .split('/') + .filter(rawSegment => rawSegment.length > 0) + .forEach(rawSegment => { + if (rawSegment.startsWith('*')) { + segments.push({ kind: 'wildcard', value: rawSegment.slice(1) }); + return; + } + if (rawSegment.startsWith('{*') && rawSegment.endsWith('}')) { + segments.push({ + kind: 'wildcard', + value: rawSegment.slice(2, -1), + }); + return; + } + if (rawSegment.startsWith(':')) { + segments.push({ kind: 'param', value: rawSegment.slice(1) }); + return; + } + segments.push({ kind: 'literal', value: rawSegment }); + }); + return segments; + } + /** + * Decides whether two paths can match the same incoming request, given + * only their declared patterns (no host/method/version considered). + */ + static pathsCanOverlap(leftPath, rightPath) { + const leftSegments = RouteConflictDetector.tokenizePath(leftPath); + const rightSegments = RouteConflictDetector.tokenizePath(rightPath); + const leftEndsInWildcard = leftSegments[leftSegments.length - 1]?.kind === 'wildcard'; + const rightEndsInWildcard = rightSegments[rightSegments.length - 1]?.kind === 'wildcard'; + // A named wildcard like `*path` requires at least one matched segment, + // so only the *shorter* side's trailing wildcard can absorb the + // difference. If the longer side has the wildcard, the other side + // simply does not have enough segments to ever reach that position. + if (leftSegments.length !== rightSegments.length) { + const shorterEndsInWildcard = leftSegments.length < rightSegments.length + ? leftEndsInWildcard + : rightEndsInWildcard; + if (!shorterEndsInWildcard) { + return false; + } + } + const sharedLength = Math.min(leftSegments.length, rightSegments.length); + let canOverlap = true; + leftSegments.slice(0, sharedLength).forEach((leftSegment, segmentIndex) => { + if (!canOverlap) + return; + if (!RouteConflictDetector.segmentsCanOverlap(leftSegment, rightSegments[segmentIndex])) { + canOverlap = false; + } + }); + return canOverlap; + } + /** + * Walks every unique pair of resolved routes and produces a conflict + * record for each pair whose (method, host, version, path) tuples can + * collide at runtime. + */ + static detect(routes, versioningOptions) { + const conflicts = []; + RouteConflictDetector.forEachUniquePair(routes, (earlierRoute, laterRoute) => { + if (!RouteConflictDetector.methodsCanOverlap(earlierRoute.method, laterRoute.method)) { + return; + } + if (!RouteConflictDetector.versionsCanOverlap(earlierRoute.version, laterRoute.version, versioningOptions)) { + return; + } + if (!RouteConflictDetector.hostsCanOverlap(earlierRoute.host, laterRoute.host)) { + return; + } + if (!RouteConflictDetector.pathsCanOverlap(earlierRoute.path, laterRoute.path)) { + return; + } + const isIdentical = RouteConflictDetector.routesAreIdentical(earlierRoute, laterRoute, versioningOptions); + conflicts.push({ + winner: earlierRoute, + shadowed: laterRoute, + kind: isIdentical ? 'duplicate' : 'shadow', + }); + }); + return conflicts; + } + /** + * Applies the per-kind policy to a set of conflicts: silences `'off'`, + * logs `'warn'` once per conflict, and aggregates every `'error'`-level + * conflict into a single `RouteConflictException`. + */ + static handle(conflicts, policy, logger) { + if (conflicts.length === 0 || policy === undefined) + return; + const errorMessages = []; + conflicts.forEach(conflict => { + const policyForKind = policy[conflict.kind] ?? 'off'; + if (policyForKind === 'off') + return; + const message = RouteConflictDetector.describeConflict(conflict); + if (policyForKind === 'warn') { + logger.warn(message); + return; + } + errorMessages.push(message); + }); + if (errorMessages.length > 0) { + throw new RouteConflictException(errorMessages); + } + } + /** + * Removes shadow conflicts that specificity sorting has already resolved. + * + * When `routeResolutionStrategy: 'specificity'` is active, the sort + * promotes more-specific routes ahead of less-specific ones. A shadow + * where the sort promoted the winner (it was declared *later* but sorted + * *first*) is handled correctly at runtime — the more-specific route is + * registered first and handles its requests while the less-specific route + * handles the rest. Retaining such a conflict would cause `shadow: 'error'` + * to abort an application whose routes actually work as intended. + * + * Shadows where the winner was already first in declaration order (the + * sort did not swap them) are genuine and are kept unchanged. Duplicate + * conflicts are always kept. + * + * @param conflicts Conflicts detected on the sorted route list. + * @param declarationOrder Routes in their original declaration order + * (i.e. before specificity sorting was applied). + */ + static filterSortResolvedShadows(conflicts, declarationOrder) { + const declarationIndex = new Map(declarationOrder.map((route, idx) => [route, idx])); + return conflicts.filter(conflict => { + if (conflict.kind !== 'shadow') + return true; + const winnerDeclIdx = declarationIndex.get(conflict.winner) ?? -1; + const shadowedDeclIdx = declarationIndex.get(conflict.shadowed) ?? -1; + // The sort promoted the winner (declared later, but sorted to the + // front because it is more specific). The shadow is resolved at + // runtime — drop it. Keep only genuine shadows where the winner was + // already first in declaration order. + return winnerDeclIdx < shadowedDeclIdx; + }); + } + static segmentsCanOverlap(leftSegment, rightSegment) { + if (leftSegment.kind === 'wildcard' || rightSegment.kind === 'wildcard') { + return true; + } + if (leftSegment.kind === 'param' || rightSegment.kind === 'param') { + return true; + } + return leftSegment.value === rightSegment.value; + } + static methodsCanOverlap(leftMethod, rightMethod) { + if (leftMethod === RequestMethod.ALL || rightMethod === RequestMethod.ALL) { + return true; + } + return leftMethod === rightMethod; + } + static versionsCanOverlap(leftVersion, rightVersion, versioningOptions) { + if (!versioningOptions) + return true; + if (versioningOptions.type === VersioningType.URI) + return true; + const leftMatchesAnyVersion = leftVersion === undefined || leftVersion === VERSION_NEUTRAL; + const rightMatchesAnyVersion = rightVersion === undefined || rightVersion === VERSION_NEUTRAL; + if (leftMatchesAnyVersion || rightMatchesAnyVersion) + return true; + const leftValues = Array.isArray(leftVersion) ? leftVersion : [leftVersion]; + const rightValues = Array.isArray(rightVersion) + ? rightVersion + : [rightVersion]; + return leftValues.some(versionValue => rightValues.includes(versionValue)); + } + static hostsCanOverlap(leftHost, rightHost) { + if (leftHost === undefined || rightHost === undefined) + return true; + const leftHosts = Array.isArray(leftHost) ? leftHost : [leftHost]; + const rightHosts = Array.isArray(rightHost) ? rightHost : [rightHost]; + return leftHosts.some(leftValue => rightHosts.some(rightValue => RouteConflictDetector.hostValuesCanMatchSameRequest(leftValue, rightValue))); + } + static hostValuesCanMatchSameRequest(leftValue, rightValue) { + const leftIsRegExp = leftValue instanceof RegExp; + const rightIsRegExp = rightValue instanceof RegExp; + if (leftIsRegExp && rightIsRegExp) + return true; + // Reset lastIndex before calling test() to guard against RegExps with the + // `g` or `y` flags: those are stateful and would produce inconsistent + // results (false negatives) when the same instance is reused across the + // multiple pair comparisons that a single detect() run performs. + if (leftIsRegExp) { + leftValue.lastIndex = 0; + return leftValue.test(rightValue); + } + if (rightIsRegExp) { + rightValue.lastIndex = 0; + return rightValue.test(leftValue); + } + return leftValue === rightValue; + } + static routesAreIdentical(leftRoute, rightRoute, versioningOptions) { + return (leftRoute.method === rightRoute.method && + leftRoute.path === rightRoute.path && + RouteConflictDetector.hostsAreIdentical(leftRoute.host, rightRoute.host) && + RouteConflictDetector.versionsAreIdentical(leftRoute.version, rightRoute.version, versioningOptions)); + } + static hostsAreIdentical(leftHost, rightHost) { + if (leftHost === undefined && rightHost === undefined) + return true; + if (leftHost === undefined || rightHost === undefined) + return false; + const leftHosts = Array.isArray(leftHost) ? leftHost : [leftHost]; + const rightHosts = Array.isArray(rightHost) ? rightHost : [rightHost]; + if (leftHosts.length !== rightHosts.length) + return false; + // Order-insensitive set comparison: ['a', 'b'] and ['b', 'a'] + // describe the same allowed-host set, so they are identical for + // duplicate-classification purposes. + return leftHosts.every(leftValue => rightHosts.some(rightValue => RouteConflictDetector.hostValuesAreIdentical(leftValue, rightValue))); + } + static hostValuesAreIdentical(leftValue, rightValue) { + if (leftValue instanceof RegExp && rightValue instanceof RegExp) { + return (leftValue.source === rightValue.source && + leftValue.flags === rightValue.flags); + } + return leftValue === rightValue; + } + static versionsAreIdentical(leftVersion, rightVersion, versioningOptions) { + // When versioning is not configured (or URI-based, where the + // version is encoded in the path), version metadata does not + // gate request matching at runtime, so two routes that differ + // only in their declared `version` are runtime duplicates. + if (!versioningOptions || versioningOptions.type === VersioningType.URI) { + return true; + } + if (leftVersion === rightVersion) + return true; + const leftValues = Array.isArray(leftVersion) ? leftVersion : [leftVersion]; + const rightValues = Array.isArray(rightVersion) + ? rightVersion + : [rightVersion]; + if (leftValues.length !== rightValues.length) + return false; + return leftValues.every(value => rightValues.includes(value)); + } + static forEachUniquePair(items, visit) { + items.forEach((leftItem, leftIndex) => { + items.slice(leftIndex + 1).forEach(rightItem => { + visit(leftItem, rightItem); + }); + }); + } + static describeConflict(conflict) { + const method = RequestMethod[conflict.winner.method]; + const winnerLabel = `${conflict.winner.instanceWrapper.name}#${conflict.winner.methodName}`; + const shadowedLabel = `${conflict.shadowed.instanceWrapper.name}#${conflict.shadowed.methodName}`; + if (conflict.kind === 'duplicate') { + return DUPLICATE_ROUTE_MESSAGE(method, conflict.winner.path, winnerLabel, shadowedLabel); + } + return SHADOWED_ROUTE_MESSAGE(method, conflict.shadowed.path, shadowedLabel, conflict.winner.path, winnerLabel); + } +} diff --git a/node_modules/@nestjs/core/router/route-params-factory.d.ts b/node_modules/@nestjs/core/router/route-params-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c0079e58e9ff7a1934adc16680facb0337ccf383 --- /dev/null +++ b/node_modules/@nestjs/core/router/route-params-factory.d.ts @@ -0,0 +1,9 @@ +import { RouteParamtypes } from '@nestjs/common/enums/route-paramtypes.enum'; +import { IRouteParamsFactory } from './interfaces/route-params-factory.interface'; +export declare class RouteParamsFactory implements IRouteParamsFactory { + exchangeKeyForValue = any, TResponse = any, TResult = any>(key: RouteParamtypes | string, data: string, { req, res, next }: { + req: TRequest; + res: TResponse; + next: Function; + }): TResult | null; +} diff --git a/node_modules/@nestjs/core/router/route-params-factory.js b/node_modules/@nestjs/core/router/route-params-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..dde5bf84a3b6967891315ca1030ade85599d46e6 --- /dev/null +++ b/node_modules/@nestjs/core/router/route-params-factory.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RouteParamsFactory = void 0; +const route_paramtypes_enum_1 = require("@nestjs/common/enums/route-paramtypes.enum"); +class RouteParamsFactory { + exchangeKeyForValue(key, data, { req, res, next }) { + switch (key) { + case route_paramtypes_enum_1.RouteParamtypes.NEXT: + return next; + case route_paramtypes_enum_1.RouteParamtypes.REQUEST: + return req; + case route_paramtypes_enum_1.RouteParamtypes.RESPONSE: + return res; + case route_paramtypes_enum_1.RouteParamtypes.BODY: + return data && req.body ? req.body[data] : req.body; + case route_paramtypes_enum_1.RouteParamtypes.RAW_BODY: + return req.rawBody; + case route_paramtypes_enum_1.RouteParamtypes.PARAM: + return data ? req.params[data] : req.params; + case route_paramtypes_enum_1.RouteParamtypes.HOST: + /* eslint-disable-next-line no-case-declarations */ + const hosts = req.hosts || {}; + return data ? hosts[data] : hosts; + case route_paramtypes_enum_1.RouteParamtypes.QUERY: + return data ? req.query[data] : req.query; + case route_paramtypes_enum_1.RouteParamtypes.HEADERS: + return data ? req.headers[data.toLowerCase()] : req.headers; + case route_paramtypes_enum_1.RouteParamtypes.SESSION: + return req.session; + case route_paramtypes_enum_1.RouteParamtypes.FILE: + return req[data || 'file']; + case route_paramtypes_enum_1.RouteParamtypes.FILES: + return req.files; + case route_paramtypes_enum_1.RouteParamtypes.IP: + return req.ip; + default: + return null; + } + } +} +exports.RouteParamsFactory = RouteParamsFactory; diff --git a/node_modules/@nestjs/core/router/route-path-factory.d.ts b/node_modules/@nestjs/core/router/route-path-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..527166e1804f19655d9f3e7449c9ef8c2dd26ce1 --- /dev/null +++ b/node_modules/@nestjs/core/router/route-path-factory.d.ts @@ -0,0 +1,14 @@ +import { RequestMethod, VersioningOptions } from '@nestjs/common'; +import { VersionValue } from '@nestjs/common/interfaces'; +import { ApplicationConfig } from '../application-config'; +import { RoutePathMetadata } from './interfaces/route-path-metadata.interface'; +export declare class RoutePathFactory { + private readonly applicationConfig; + constructor(applicationConfig: ApplicationConfig); + create(metadata: RoutePathMetadata, requestMethod?: RequestMethod): string[]; + getVersion(metadata: RoutePathMetadata): VersionValue | undefined; + getVersionPrefix(versioningOptions: VersioningOptions): string; + appendToAllIfDefined(paths: string[], fragmentToAppend: string | string[] | undefined): string[]; + isExcludedFromGlobalPrefix(path: string, requestMethod?: RequestMethod, versionOrVersions?: VersionValue, versioningOptions?: VersioningOptions): boolean; + private truncateVersionPrefixFromPath; +} diff --git a/node_modules/@nestjs/core/router/route-path-factory.js b/node_modules/@nestjs/core/router/route-path-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..c022cda4c20f5421e428b6671d729a08c8476c41 --- /dev/null +++ b/node_modules/@nestjs/core/router/route-path-factory.js @@ -0,0 +1,101 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RoutePathFactory = void 0; +const common_1 = require("@nestjs/common"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const utils_1 = require("./utils"); +class RoutePathFactory { + constructor(applicationConfig) { + this.applicationConfig = applicationConfig; + } + create(metadata, requestMethod) { + let paths = ['']; + const versionOrVersions = this.getVersion(metadata); + if (versionOrVersions && + metadata.versioningOptions?.type === common_1.VersioningType.URI) { + const versionPrefix = this.getVersionPrefix(metadata.versioningOptions); + if (Array.isArray(versionOrVersions)) { + paths = (0, common_1.flatten)(paths.map(path => versionOrVersions.map(version => + // Version Neutral - Do not include version in URL + version === common_1.VERSION_NEUTRAL + ? path + : `${path}/${versionPrefix}${version}`))); + } + else { + // Version Neutral - Do not include version in URL + if (versionOrVersions !== common_1.VERSION_NEUTRAL) { + paths = paths.map(path => `${path}/${versionPrefix}${versionOrVersions}`); + } + } + } + paths = this.appendToAllIfDefined(paths, metadata.modulePath); + paths = this.appendToAllIfDefined(paths, metadata.ctrlPath); + paths = this.appendToAllIfDefined(paths, metadata.methodPath); + if (metadata.globalPrefix) { + paths = paths.map(path => { + if (this.isExcludedFromGlobalPrefix(path, requestMethod, versionOrVersions, metadata.versioningOptions)) { + return path; + } + return (0, shared_utils_1.stripEndSlash)(metadata.globalPrefix || '') + path; + }); + } + return paths + .map(path => (0, shared_utils_1.addLeadingSlash)(path || '/')) + .map(path => (path !== '/' ? (0, shared_utils_1.stripEndSlash)(path) : path)); + } + getVersion(metadata) { + // The version will be either the path version or the controller version, + // with the pathVersion taking priority. + return metadata.methodVersion || metadata.controllerVersion; + } + getVersionPrefix(versioningOptions) { + const defaultPrefix = 'v'; + if (versioningOptions.type === common_1.VersioningType.URI) { + if (versioningOptions.prefix === false) { + return ''; + } + else if (versioningOptions.prefix !== undefined) { + return versioningOptions.prefix; + } + } + return defaultPrefix; + } + appendToAllIfDefined(paths, fragmentToAppend) { + if (!fragmentToAppend) { + return paths; + } + const concatPaths = (a, b) => (0, shared_utils_1.stripEndSlash)(a) + (0, shared_utils_1.addLeadingSlash)(b); + if (Array.isArray(fragmentToAppend)) { + const paths2dArray = paths.map(path => fragmentToAppend.map(fragment => concatPaths(path, fragment))); + return (0, common_1.flatten)(paths2dArray); + } + return paths.map(path => concatPaths(path, fragmentToAppend)); + } + isExcludedFromGlobalPrefix(path, requestMethod, versionOrVersions, versioningOptions) { + if ((0, shared_utils_1.isUndefined)(requestMethod)) { + return false; + } + const options = this.applicationConfig.getGlobalPrefixOptions(); + const excludedRoutes = options.exclude; + if (versionOrVersions && + versionOrVersions !== common_1.VERSION_NEUTRAL && + versioningOptions?.type === common_1.VersioningType.URI) { + path = this.truncateVersionPrefixFromPath(path, versionOrVersions, versioningOptions); + } + return (Array.isArray(excludedRoutes) && + (0, utils_1.isRouteExcluded)(excludedRoutes, path, requestMethod)); + } + truncateVersionPrefixFromPath(path, versionValue, versioningOptions) { + if (typeof versionValue !== 'string') { + versionValue.forEach(version => { + if (typeof version === 'string') { + path = this.truncateVersionPrefixFromPath(path, version, versioningOptions); + } + }); + return path; + } + const prefix = `/${this.getVersionPrefix(versioningOptions)}${versionValue}`; + return path.startsWith(prefix) ? path.replace(prefix, '') : path; + } +} +exports.RoutePathFactory = RoutePathFactory; diff --git a/node_modules/@nestjs/core/router/route-specificity-sorter.d.ts b/node_modules/@nestjs/core/router/route-specificity-sorter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9f92d17d3f31ebdfa96f8698a9fa3b53afe89e65 --- /dev/null +++ b/node_modules/@nestjs/core/router/route-specificity-sorter.d.ts @@ -0,0 +1,23 @@ +import { ResolvedRoute } from './interfaces/resolved-route.interface.js'; +/** + * Static utility class that orders resolved routes by specificity so the + * underlying HTTP adapter registers more specific patterns first. + * Stateless — every method takes everything it needs as parameters. + */ +export declare class RouteSpecificitySorter { + /** + * Lower rank means more specific. A literal segment beats a named + * param, which beats a named wildcard. A position that is absent on + * one side is the least specific of all (it means the path is shorter + * at that point). + */ + private static readonly SEGMENT_KIND_RANK; + /** + * Returns a new array of routes sorted from most-specific to + * least-specific. Routes that tie on specificity keep their original + * declaration order. + */ + static sort(routes: ResolvedRoute[]): ResolvedRoute[]; + private static comparePathSpecificity; + private static rankSegmentByKind; +} diff --git a/node_modules/@nestjs/core/router/route-specificity-sorter.js b/node_modules/@nestjs/core/router/route-specificity-sorter.js new file mode 100644 index 0000000000000000000000000000000000000000..f998f7d2d25ee9afa781ad7fb741ea4e9b5b0767 --- /dev/null +++ b/node_modules/@nestjs/core/router/route-specificity-sorter.js @@ -0,0 +1,59 @@ +import { RouteConflictDetector } from './route-conflict-detector.js'; +/** + * Static utility class that orders resolved routes by specificity so the + * underlying HTTP adapter registers more specific patterns first. + * Stateless — every method takes everything it needs as parameters. + */ +export class RouteSpecificitySorter { + /** + * Lower rank means more specific. A literal segment beats a named + * param, which beats a named wildcard. A position that is absent on + * one side is the least specific of all (it means the path is shorter + * at that point). + */ + static SEGMENT_KIND_RANK = { + literal: 0, + param: 1, + wildcard: 2, + missing: 3, + }; + /** + * Returns a new array of routes sorted from most-specific to + * least-specific. Routes that tie on specificity keep their original + * declaration order. + */ + static sort(routes) { + const decoratedRoutes = routes.map((route, declarationIndex) => ({ + route, + declarationIndex, + })); + decoratedRoutes.sort((leftEntry, rightEntry) => { + const specificityDelta = RouteSpecificitySorter.comparePathSpecificity(leftEntry.route.path, rightEntry.route.path); + if (specificityDelta !== 0) + return specificityDelta; + return leftEntry.declarationIndex - rightEntry.declarationIndex; + }); + return decoratedRoutes.map(decoratedEntry => decoratedEntry.route); + } + static comparePathSpecificity(leftPath, rightPath) { + const leftSegments = RouteConflictDetector.tokenizePath(leftPath); + const rightSegments = RouteConflictDetector.tokenizePath(rightPath); + const longestPathLength = Math.max(leftSegments.length, rightSegments.length); + let specificityDelta = 0; + Array.from({ length: longestPathLength }).forEach((_, segmentIndex) => { + if (specificityDelta !== 0) + return; + const leftKind = leftSegments[segmentIndex]?.kind ?? 'missing'; + const rightKind = rightSegments[segmentIndex]?.kind ?? 'missing'; + const leftRank = RouteSpecificitySorter.rankSegmentByKind(leftKind); + const rightRank = RouteSpecificitySorter.rankSegmentByKind(rightKind); + if (leftRank !== rightRank) { + specificityDelta = leftRank - rightRank; + } + }); + return specificityDelta; + } + static rankSegmentByKind(kind) { + return RouteSpecificitySorter.SEGMENT_KIND_RANK[kind]; + } +} diff --git a/node_modules/@nestjs/core/router/router-exception-filters.d.ts b/node_modules/@nestjs/core/router/router-exception-filters.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..58e20ddfc9163db58731bf401e5a150253b5e1d7 --- /dev/null +++ b/node_modules/@nestjs/core/router/router-exception-filters.d.ts @@ -0,0 +1,14 @@ +import { HttpServer } from '@nestjs/common'; +import { Controller } from '@nestjs/common/interfaces/controllers/controller.interface'; +import { ApplicationConfig } from '../application-config'; +import { BaseExceptionFilterContext } from '../exceptions/base-exception-filter-context'; +import { ExceptionsHandler } from '../exceptions/exceptions-handler'; +import { NestContainer } from '../injector/container'; +import { RouterProxyCallback } from './router-proxy'; +export declare class RouterExceptionFilters extends BaseExceptionFilterContext { + private readonly config; + private readonly applicationRef; + constructor(container: NestContainer, config: ApplicationConfig, applicationRef: HttpServer); + create(instance: Controller, callback: RouterProxyCallback, moduleKey: string | undefined, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): ExceptionsHandler; + getGlobalMetadata(contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): T; +} diff --git a/node_modules/@nestjs/core/router/router-exception-filters.js b/node_modules/@nestjs/core/router/router-exception-filters.js new file mode 100644 index 0000000000000000000000000000000000000000..605be22e72f99e5997d702c0bf4415b53edcec8b --- /dev/null +++ b/node_modules/@nestjs/core/router/router-exception-filters.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RouterExceptionFilters = void 0; +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const base_exception_filter_context_1 = require("../exceptions/base-exception-filter-context"); +const exceptions_handler_1 = require("../exceptions/exceptions-handler"); +const constants_2 = require("../injector/constants"); +class RouterExceptionFilters extends base_exception_filter_context_1.BaseExceptionFilterContext { + constructor(container, config, applicationRef) { + super(container); + this.config = config; + this.applicationRef = applicationRef; + } + create(instance, callback, moduleKey, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + this.moduleContext = moduleKey; + const exceptionHandler = new exceptions_handler_1.ExceptionsHandler(this.applicationRef); + const filters = this.createContext(instance, callback, constants_1.EXCEPTION_FILTERS_METADATA, contextId, inquirerId); + if ((0, shared_utils_1.isEmpty)(filters)) { + return exceptionHandler; + } + exceptionHandler.setCustomFilters(filters.reverse()); + return exceptionHandler; + } + getGlobalMetadata(contextId = constants_2.STATIC_CONTEXT, inquirerId) { + const globalFilters = this.config.getGlobalFilters(); + if (contextId === constants_2.STATIC_CONTEXT && !inquirerId) { + return globalFilters; + } + const scopedFilterWrappers = this.config.getGlobalRequestFilters(); + const scopedFilters = (0, iterare_1.iterate)(scopedFilterWrappers) + .map(wrapper => wrapper.getInstanceByContextId(contextId, inquirerId)) + .filter(host => !!host) + .map(host => host.instance) + .toArray(); + return globalFilters.concat(scopedFilters); + } +} +exports.RouterExceptionFilters = RouterExceptionFilters; diff --git a/node_modules/@nestjs/core/router/router-execution-context.d.ts b/node_modules/@nestjs/core/router/router-execution-context.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ee10ab0f384f4625abd104999a06efe5f94007ca --- /dev/null +++ b/node_modules/@nestjs/core/router/router-execution-context.d.ts @@ -0,0 +1,54 @@ +import { CanActivate, HttpServer, ParamData, PipeTransform, RequestMethod } from '@nestjs/common'; +import { RouteParamMetadata } from '@nestjs/common/decorators'; +import { RouteParamtypes } from '@nestjs/common/enums/route-paramtypes.enum'; +import { ContextType, Controller } from '@nestjs/common/interfaces'; +import { GuardsConsumer, GuardsContextCreator } from '../guards'; +import { ExecutionContextHost } from '../helpers/execution-context-host'; +import { HandleResponseFn, HandlerMetadata } from '../helpers/handler-metadata-storage'; +import { InterceptorsConsumer } from '../interceptors/interceptors-consumer'; +import { InterceptorsContextCreator } from '../interceptors/interceptors-context-creator'; +import { PipesConsumer } from '../pipes/pipes-consumer'; +import { PipesContextCreator } from '../pipes/pipes-context-creator'; +import { IRouteParamsFactory } from './interfaces/route-params-factory.interface'; +import { CustomHeader, RedirectResponse } from './router-response-controller'; +export interface ParamProperties { + index: number; + type: RouteParamtypes | string; + data: ParamData; + pipes: PipeTransform[]; + extractValue: (req: TRequest, res: TResponse, next: Function) => any; +} +export declare class RouterExecutionContext { + private readonly paramsFactory; + private readonly pipesContextCreator; + private readonly pipesConsumer; + private readonly guardsContextCreator; + private readonly guardsConsumer; + private readonly interceptorsContextCreator; + private readonly interceptorsConsumer; + readonly applicationRef: HttpServer; + private readonly handlerMetadataStorage; + private readonly contextUtils; + private readonly responseController; + constructor(paramsFactory: IRouteParamsFactory, pipesContextCreator: PipesContextCreator, pipesConsumer: PipesConsumer, guardsContextCreator: GuardsContextCreator, guardsConsumer: GuardsConsumer, interceptorsContextCreator: InterceptorsContextCreator, interceptorsConsumer: InterceptorsConsumer, applicationRef: HttpServer); + create(instance: Controller, callback: (...args: any[]) => unknown, methodName: string, moduleKey: string, requestMethod: RequestMethod, contextId?: import("..").ContextId, inquirerId?: string): (req: TRequest, res: TResponse, next: Function) => Promise; + getMetadata(instance: Controller, callback: (...args: any[]) => any, methodName: string, moduleKey: string, requestMethod: RequestMethod, contextType: TContext): HandlerMetadata; + reflectRedirect(callback: (...args: unknown[]) => unknown): RedirectResponse; + reflectHttpStatusCode(callback: (...args: unknown[]) => unknown): number; + reflectRenderTemplate(callback: (...args: unknown[]) => unknown): string; + reflectResponseHeaders(callback: (...args: unknown[]) => unknown): CustomHeader[]; + reflectSse(callback: (...args: unknown[]) => unknown): string; + exchangeKeysForValues(keys: string[], metadata: Record, moduleContext: string, contextId?: import("..").ContextId, inquirerId?: string, contextFactory?: (args: unknown[]) => ExecutionContextHost): ParamProperties[]; + getParamValue(value: T, { metatype, type, data, }: { + metatype: unknown; + type: RouteParamtypes; + data: unknown; + }, pipes: PipeTransform[]): Promise; + isPipeable(type: number | string): boolean; + createGuardsFn(guards: CanActivate[], instance: Controller, callback: (...args: any[]) => any, contextType?: TContext): ((args: any[]) => Promise) | null; + createPipesFn(pipes: PipeTransform[], paramsOptions: (ParamProperties & { + metatype?: any; + })[]): ((args: any[], req: TRequest, res: TResponse, next: Function) => Promise) | null; + createHandleResponseFn(callback: (...args: unknown[]) => unknown, isResponseHandled: boolean, redirectResponse?: RedirectResponse, httpStatusCode?: number): HandleResponseFn; + private isResponseHandled; +} diff --git a/node_modules/@nestjs/core/router/router-execution-context.js b/node_modules/@nestjs/core/router/router-execution-context.js new file mode 100644 index 0000000000000000000000000000000000000000..2e1a5b00bc9f1bb330ef87fefdfb9f1c8ef10b72 --- /dev/null +++ b/node_modules/@nestjs/core/router/router-execution-context.js @@ -0,0 +1,194 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RouterExecutionContext = void 0; +const common_1 = require("@nestjs/common"); +const constants_1 = require("@nestjs/common/constants"); +const route_paramtypes_enum_1 = require("@nestjs/common/enums/route-paramtypes.enum"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const guards_1 = require("../guards"); +const context_utils_1 = require("../helpers/context-utils"); +const handler_metadata_storage_1 = require("../helpers/handler-metadata-storage"); +const constants_2 = require("../injector/constants"); +const router_response_controller_1 = require("./router-response-controller"); +class RouterExecutionContext { + constructor(paramsFactory, pipesContextCreator, pipesConsumer, guardsContextCreator, guardsConsumer, interceptorsContextCreator, interceptorsConsumer, applicationRef) { + this.paramsFactory = paramsFactory; + this.pipesContextCreator = pipesContextCreator; + this.pipesConsumer = pipesConsumer; + this.guardsContextCreator = guardsContextCreator; + this.guardsConsumer = guardsConsumer; + this.interceptorsContextCreator = interceptorsContextCreator; + this.interceptorsConsumer = interceptorsConsumer; + this.applicationRef = applicationRef; + this.handlerMetadataStorage = new handler_metadata_storage_1.HandlerMetadataStorage(); + this.contextUtils = new context_utils_1.ContextUtils(); + this.responseController = new router_response_controller_1.RouterResponseController(applicationRef); + } + create(instance, callback, methodName, moduleKey, requestMethod, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + const contextType = 'http'; + const { argsLength, fnHandleResponse, isSseHandler, paramtypes, getParamsMetadata, httpStatusCode, responseHeaders, hasCustomHeaders, } = this.getMetadata(instance, callback, methodName, moduleKey, requestMethod, contextType); + const paramsOptions = this.contextUtils.mergeParamsMetatypes(getParamsMetadata(moduleKey, contextId, inquirerId), paramtypes); + const pipes = this.pipesContextCreator.create(instance, callback, moduleKey, contextId, inquirerId); + const guards = this.guardsContextCreator.create(instance, callback, moduleKey, contextId, inquirerId); + const interceptors = this.interceptorsContextCreator.create(instance, callback, moduleKey, contextId, inquirerId); + const fnCanActivate = this.createGuardsFn(guards, instance, callback, contextType); + const fnApplyPipes = this.createPipesFn(pipes, paramsOptions); + const handler = (args, req, res, next) => async () => { + fnApplyPipes && (await fnApplyPipes(args, req, res, next)); + return callback.apply(instance, args); + }; + return async (req, res, next) => { + const args = this.contextUtils.createNullArray(argsLength); + fnCanActivate && (await fnCanActivate([req, res, next])); + this.responseController.setStatus(res, httpStatusCode); + hasCustomHeaders && + this.responseController.setHeaders(res, responseHeaders); + const resultOrDeferred = this.interceptorsConsumer.intercept(interceptors, [req, res, next], instance, callback, handler(args, req, res, next), contextType); + const result = isSseHandler ? resultOrDeferred : await resultOrDeferred; + await fnHandleResponse(result, res, req); + }; + } + getMetadata(instance, callback, methodName, moduleKey, requestMethod, contextType) { + const cacheMetadata = this.handlerMetadataStorage.get(instance, methodName); + if (cacheMetadata) { + return cacheMetadata; + } + const metadata = this.contextUtils.reflectCallbackMetadata(instance, methodName, constants_1.ROUTE_ARGS_METADATA) || {}; + const keys = Object.keys(metadata); + const argsLength = this.contextUtils.getArgumentsLength(keys, metadata); + const paramtypes = this.contextUtils.reflectCallbackParamtypes(instance, methodName); + const contextFactory = this.contextUtils.getContextFactory(contextType, instance, callback); + const getParamsMetadata = (moduleKey, contextId = constants_2.STATIC_CONTEXT, inquirerId) => this.exchangeKeysForValues(keys, metadata, moduleKey, contextId, inquirerId, contextFactory); + const paramsMetadata = getParamsMetadata(moduleKey); + const isResponseHandled = this.isResponseHandled(instance, methodName, paramsMetadata); + const httpRedirectResponse = this.reflectRedirect(callback); + const fnHandleResponse = this.createHandleResponseFn(callback, isResponseHandled, httpRedirectResponse); + const isSseHandler = !!this.reflectSse(callback); + const httpCode = this.reflectHttpStatusCode(callback); + const httpStatusCode = httpCode + ? httpCode + : this.responseController.getStatusByMethod(requestMethod); + const responseHeaders = this.reflectResponseHeaders(callback); + const hasCustomHeaders = !(0, shared_utils_1.isEmpty)(responseHeaders); + const handlerMetadata = { + argsLength, + fnHandleResponse, + isSseHandler, + paramtypes, + getParamsMetadata, + httpStatusCode, + hasCustomHeaders, + responseHeaders, + }; + this.handlerMetadataStorage.set(instance, methodName, handlerMetadata); + return handlerMetadata; + } + reflectRedirect(callback) { + return Reflect.getMetadata(constants_1.REDIRECT_METADATA, callback); + } + reflectHttpStatusCode(callback) { + return Reflect.getMetadata(constants_1.HTTP_CODE_METADATA, callback); + } + reflectRenderTemplate(callback) { + return Reflect.getMetadata(constants_1.RENDER_METADATA, callback); + } + reflectResponseHeaders(callback) { + return Reflect.getMetadata(constants_1.HEADERS_METADATA, callback) || []; + } + reflectSse(callback) { + return Reflect.getMetadata(constants_1.SSE_METADATA, callback); + } + exchangeKeysForValues(keys, metadata, moduleContext, contextId = constants_2.STATIC_CONTEXT, inquirerId, contextFactory) { + this.pipesContextCreator.setModuleContext(moduleContext); + return keys.map(key => { + const { index, data, pipes: pipesCollection } = metadata[key]; + const pipes = this.pipesContextCreator.createConcreteContext(pipesCollection, contextId, inquirerId); + const type = this.contextUtils.mapParamType(key); + if (key.includes(constants_1.CUSTOM_ROUTE_ARGS_METADATA)) { + const { factory } = metadata[key]; + const customExtractValue = this.contextUtils.getCustomFactory(factory, data, contextFactory); + return { index, extractValue: customExtractValue, type, data, pipes }; + } + const numericType = Number(type); + const extractValue = (req, res, next) => this.paramsFactory.exchangeKeyForValue(numericType, data, { + req: req, + res, + next, + }); + return { index, extractValue, type: numericType, data, pipes }; + }); + } + async getParamValue(value, { metatype, type, data, }, pipes) { + if (!(0, shared_utils_1.isEmpty)(pipes)) { + return this.pipesConsumer.apply(value, { metatype, type, data }, pipes); + } + return value; + } + isPipeable(type) { + return (type === route_paramtypes_enum_1.RouteParamtypes.BODY || + type === route_paramtypes_enum_1.RouteParamtypes.RAW_BODY || + type === route_paramtypes_enum_1.RouteParamtypes.QUERY || + type === route_paramtypes_enum_1.RouteParamtypes.PARAM || + type === route_paramtypes_enum_1.RouteParamtypes.FILE || + type === route_paramtypes_enum_1.RouteParamtypes.FILES || + (0, shared_utils_1.isString)(type)); + } + createGuardsFn(guards, instance, callback, contextType) { + const canActivateFn = async (args) => { + const canActivate = await this.guardsConsumer.tryActivate(guards, args, instance, callback, contextType); + if (!canActivate) { + throw new common_1.ForbiddenException(guards_1.FORBIDDEN_MESSAGE); + } + }; + return guards.length ? canActivateFn : null; + } + createPipesFn(pipes, paramsOptions) { + const pipesFn = async (args, req, res, next) => { + const resolveParamValue = async (param) => { + const { index, extractValue, type, data, metatype, pipes: paramPipes, } = param; + const value = extractValue(req, res, next); + args[index] = this.isPipeable(type) + ? await this.getParamValue(value, { metatype, type, data }, pipes.concat(paramPipes)) + : value; + }; + await Promise.all(paramsOptions.map(resolveParamValue)); + }; + return paramsOptions.length ? pipesFn : null; + } + createHandleResponseFn(callback, isResponseHandled, redirectResponse, httpStatusCode) { + const renderTemplate = this.reflectRenderTemplate(callback); + if (renderTemplate) { + return async (result, res) => { + return await this.responseController.render(result, res, renderTemplate); + }; + } + if (redirectResponse && (0, shared_utils_1.isString)(redirectResponse.url)) { + return async (result, res) => { + await this.responseController.redirect(result, res, redirectResponse); + }; + } + const isSseHandler = !!this.reflectSse(callback); + if (isSseHandler) { + return async (result, res, req) => { + const rawResponse = res.raw ?? res; + await this.responseController.sse(result, rawResponse, req.raw || req, { + additionalHeaders: res.getHeaders?.(), + statusCode: res.statusCode ?? + rawResponse.statusCode, + }); + }; + } + return async (result, res) => { + result = await this.responseController.transformToResult(result); + !isResponseHandled && + (await this.responseController.apply(result, res, httpStatusCode)); + return res; + }; + } + isResponseHandled(instance, methodName, paramsMetadata) { + const hasResponseOrNextDecorator = paramsMetadata.some(({ type }) => type === route_paramtypes_enum_1.RouteParamtypes.RESPONSE || type === route_paramtypes_enum_1.RouteParamtypes.NEXT); + const isPassthroughEnabled = this.contextUtils.reflectPassthrough(instance, methodName); + return hasResponseOrNextDecorator && !isPassthroughEnabled; + } +} +exports.RouterExecutionContext = RouterExecutionContext; diff --git a/node_modules/@nestjs/core/router/router-explorer.d.ts b/node_modules/@nestjs/core/router/router-explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7ff095b67bc4b339408f90528c4cd875a9177b51 --- /dev/null +++ b/node_modules/@nestjs/core/router/router-explorer.d.ts @@ -0,0 +1,47 @@ +import { HttpServer } from '@nestjs/common'; +import { RequestMethod } from '@nestjs/common/enums'; +import { Controller } from '@nestjs/common/interfaces/controllers/controller.interface'; +import { Type } from '@nestjs/common/interfaces/type.interface'; +import { VersionValue } from '@nestjs/common/interfaces/version-options.interface'; +import { ApplicationConfig } from '../application-config'; +import { NestContainer } from '../injector/container'; +import { Injector } from '../injector/injector'; +import { InstanceWrapper } from '../injector/instance-wrapper'; +import { Module } from '../injector/module'; +import { GraphInspector } from '../inspector/graph-inspector'; +import { MetadataScanner } from '../metadata-scanner'; +import { ExceptionsFilter } from './interfaces/exceptions-filter.interface'; +import { RoutePathMetadata } from './interfaces/route-path-metadata.interface'; +import { RoutePathFactory } from './route-path-factory'; +import { RouterProxy, RouterProxyCallback } from './router-proxy'; +export interface RouteDefinition { + path: string[]; + requestMethod: RequestMethod; + targetCallback: RouterProxyCallback; + methodName: string; + version?: VersionValue; +} +export declare class RouterExplorer { + private readonly container; + private readonly injector; + private readonly routerProxy; + private readonly exceptionsFilter; + private readonly routePathFactory; + private readonly graphInspector; + private readonly executionContextCreator; + private readonly pathsExplorer; + private readonly routerMethodFactory; + private readonly logger; + private readonly exceptionFiltersCache; + constructor(metadataScanner: MetadataScanner, container: NestContainer, injector: Injector, routerProxy: RouterProxy, exceptionsFilter: ExceptionsFilter, config: ApplicationConfig, routePathFactory: RoutePathFactory, graphInspector: GraphInspector); + explore(instanceWrapper: InstanceWrapper, moduleKey: string, httpAdapterRef: T, host: string | RegExp | Array, routePathMetadata: RoutePathMetadata): void; + extractRouterPath(metatype: Type): string[]; + applyPathsToRouterProxy(router: T, routeDefinitions: RouteDefinition[], instanceWrapper: InstanceWrapper, moduleKey: string, routePathMetadata: RoutePathMetadata, host: string | RegExp | Array): void; + private applyCallbackToRouter; + private applyHostFilter; + private applyVersionFilter; + private createCallbackProxy; + createRequestScopedHandler(instanceWrapper: InstanceWrapper, requestMethod: RequestMethod, moduleRef: Module, moduleKey: string, methodName: string): , TResponse>(req: TRequest, res: TResponse, next: () => void) => Promise; + private getContextId; + private copyMetadataToCallback; +} diff --git a/node_modules/@nestjs/core/router/router-explorer.js b/node_modules/@nestjs/core/router/router-explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..6a6182f85743b32ef8b6ac4eb233a159d4212d66 --- /dev/null +++ b/node_modules/@nestjs/core/router/router-explorer.js @@ -0,0 +1,234 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RouterExplorer = void 0; +const constants_1 = require("@nestjs/common/constants"); +const enums_1 = require("@nestjs/common/enums"); +const exceptions_1 = require("@nestjs/common/exceptions"); +const logger_service_1 = require("@nestjs/common/services/logger.service"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const path_to_regexp_1 = require("path-to-regexp"); +const unknown_request_mapping_exception_1 = require("../errors/exceptions/unknown-request-mapping.exception"); +const guards_1 = require("../guards"); +const context_id_factory_1 = require("../helpers/context-id-factory"); +const execution_context_host_1 = require("../helpers/execution-context-host"); +const messages_1 = require("../helpers/messages"); +const router_method_factory_1 = require("../helpers/router-method-factory"); +const constants_2 = require("../injector/constants"); +const interceptors_1 = require("../interceptors"); +const pipes_1 = require("../pipes"); +const paths_explorer_1 = require("./paths-explorer"); +const request_constants_1 = require("./request/request-constants"); +const route_params_factory_1 = require("./route-params-factory"); +const router_execution_context_1 = require("./router-execution-context"); +class RouterExplorer { + constructor(metadataScanner, container, injector, routerProxy, exceptionsFilter, config, routePathFactory, graphInspector) { + this.container = container; + this.injector = injector; + this.routerProxy = routerProxy; + this.exceptionsFilter = exceptionsFilter; + this.routePathFactory = routePathFactory; + this.graphInspector = graphInspector; + this.routerMethodFactory = new router_method_factory_1.RouterMethodFactory(); + this.logger = new logger_service_1.Logger(RouterExplorer.name, { + timestamp: true, + }); + this.exceptionFiltersCache = new WeakMap(); + this.pathsExplorer = new paths_explorer_1.PathsExplorer(metadataScanner); + const routeParamsFactory = new route_params_factory_1.RouteParamsFactory(); + const pipesContextCreator = new pipes_1.PipesContextCreator(container, config); + const pipesConsumer = new pipes_1.PipesConsumer(); + const guardsContextCreator = new guards_1.GuardsContextCreator(container, config); + const guardsConsumer = new guards_1.GuardsConsumer(); + const interceptorsContextCreator = new interceptors_1.InterceptorsContextCreator(container, config); + const interceptorsConsumer = new interceptors_1.InterceptorsConsumer(); + this.executionContextCreator = new router_execution_context_1.RouterExecutionContext(routeParamsFactory, pipesContextCreator, pipesConsumer, guardsContextCreator, guardsConsumer, interceptorsContextCreator, interceptorsConsumer, container.getHttpAdapterRef()); + } + explore(instanceWrapper, moduleKey, httpAdapterRef, host, routePathMetadata) { + const { instance } = instanceWrapper; + const routerPaths = this.pathsExplorer.scanForPaths(instance); + this.applyPathsToRouterProxy(httpAdapterRef, routerPaths, instanceWrapper, moduleKey, routePathMetadata, host); + } + extractRouterPath(metatype) { + const path = Reflect.getMetadata(constants_1.PATH_METADATA, metatype); + if ((0, shared_utils_1.isUndefined)(path)) { + throw new unknown_request_mapping_exception_1.UnknownRequestMappingException(metatype); + } + if (Array.isArray(path)) { + return path.map(p => (0, shared_utils_1.addLeadingSlash)(p)); + } + return [(0, shared_utils_1.addLeadingSlash)(path)]; + } + applyPathsToRouterProxy(router, routeDefinitions, instanceWrapper, moduleKey, routePathMetadata, host) { + (routeDefinitions || []).forEach(routeDefinition => { + const { version: methodVersion } = routeDefinition; + routePathMetadata.methodVersion = methodVersion; + this.applyCallbackToRouter(router, routeDefinition, instanceWrapper, moduleKey, routePathMetadata, host); + }); + } + applyCallbackToRouter(router, routeDefinition, instanceWrapper, moduleKey, routePathMetadata, host) { + const { path: paths, requestMethod, targetCallback, methodName, } = routeDefinition; + const { instance } = instanceWrapper; + const routerMethodRef = this.routerMethodFactory + .get(router, requestMethod) + .bind(router); + const isRequestScoped = !instanceWrapper.isDependencyTreeStatic(); + const proxy = isRequestScoped + ? this.createRequestScopedHandler(instanceWrapper, requestMethod, this.container.getModuleByKey(moduleKey), moduleKey, methodName) + : this.createCallbackProxy(instance, targetCallback, methodName, moduleKey, requestMethod); + const isVersioned = (routePathMetadata.methodVersion || + routePathMetadata.controllerVersion) && + routePathMetadata.versioningOptions; + let routeHandler = this.applyHostFilter(host, proxy); + paths.forEach(path => { + if (isVersioned && + routePathMetadata.versioningOptions.type !== enums_1.VersioningType.URI) { + // All versioning (except for URI Versioning) is done via the "Version Filter" + routeHandler = this.applyVersionFilter(router, routePathMetadata, routeHandler); + } + routePathMetadata.methodPath = path; + const pathsToRegister = this.routePathFactory.create(routePathMetadata, requestMethod); + pathsToRegister.forEach(path => { + const entrypointDefinition = { + type: 'http-endpoint', + methodName, + className: instanceWrapper.name, + classNodeId: instanceWrapper.id, + metadata: { + key: path, + path, + requestMethod: enums_1.RequestMethod[requestMethod], + methodVersion: routePathMetadata.methodVersion, + controllerVersion: routePathMetadata.controllerVersion, + }, + }; + this.copyMetadataToCallback(targetCallback, routeHandler); + const normalizedPath = router.normalizePath + ? router.normalizePath(path) + : path; + const httpAdapter = this.container.getHttpAdapterRef(); + const onRouteTriggered = httpAdapter.getOnRouteTriggered?.(); + if (onRouteTriggered) { + routerMethodRef(normalizedPath, (...args) => { + onRouteTriggered(requestMethod, path); + return routeHandler(...args); + }); + } + else { + routerMethodRef(normalizedPath, routeHandler); + } + this.graphInspector.insertEntrypointDefinition(entrypointDefinition, instanceWrapper.id); + }); + const pathsToLog = this.routePathFactory.create({ + ...routePathMetadata, + versioningOptions: undefined, + }, requestMethod); + pathsToLog.forEach(path => { + if (isVersioned) { + const version = this.routePathFactory.getVersion(routePathMetadata); + this.logger.log((0, messages_1.VERSIONED_ROUTE_MAPPED_MESSAGE)(path, requestMethod, version)); + } + else { + this.logger.log((0, messages_1.ROUTE_MAPPED_MESSAGE)(path, requestMethod)); + } + }); + }); + } + applyHostFilter(host, handler) { + if (!host) { + return handler; + } + const httpAdapterRef = this.container.getHttpAdapterRef(); + const hosts = Array.isArray(host) ? host : [host]; + const hostRegExps = hosts.map((host) => { + if (typeof host === 'string') { + try { + return (0, path_to_regexp_1.pathToRegexp)(host); + } + catch (e) { + if (e instanceof TypeError) { + this.logger.error(`Unsupported host "${host}" syntax. In past releases, ?, *, and + were used to denote optional or repeating path parameters. The latest version of "path-to-regexp" now requires the use of named parameters. For example, instead of using a route like /users/* to capture all routes starting with "/users", you should use /users/*path. Please see the migration guide for more information.`); + } + throw e; + } + } + return { regexp: host, keys: [] }; + }); + const unsupportedFilteringErrorMessage = Array.isArray(host) + ? `HTTP adapter does not support filtering on hosts: ["${host.join('", "')}"]` + : `HTTP adapter does not support filtering on host: "${host}"`; + return (req, res, next) => { + req.hosts = {}; + const hostname = httpAdapterRef.getRequestHostname(req) || ''; + for (const exp of hostRegExps) { + const match = hostname.match(exp.regexp); + if (match) { + if (exp.keys.length > 0) { + exp.keys.forEach((key, i) => (req.hosts[key.name] = match[i + 1])); + } + else if (exp.regexp && match.groups) { + for (const groupName in match.groups) { + req.hosts[groupName] = match.groups[groupName]; + } + } + return handler(req, res, next); + } + } + if (!next) { + throw new exceptions_1.InternalServerErrorException(unsupportedFilteringErrorMessage); + } + return next(); + }; + } + applyVersionFilter(router, routePathMetadata, handler) { + const version = this.routePathFactory.getVersion(routePathMetadata); + return router.applyVersionFilter(handler, version, routePathMetadata.versioningOptions); + } + createCallbackProxy(instance, callback, methodName, moduleRef, requestMethod, contextId = constants_2.STATIC_CONTEXT, inquirerId) { + const executionContext = this.executionContextCreator.create(instance, callback, methodName, moduleRef, requestMethod, contextId, inquirerId); + const exceptionFilter = this.exceptionsFilter.create(instance, callback, moduleRef, contextId, inquirerId); + return this.routerProxy.createProxy(executionContext, exceptionFilter); + } + createRequestScopedHandler(instanceWrapper, requestMethod, moduleRef, moduleKey, methodName) { + const { instance } = instanceWrapper; + const collection = moduleRef.controllers; + const isTreeDurable = instanceWrapper.isDependencyTreeDurable(); + return async (req, res, next) => { + try { + const contextId = this.getContextId(req, isTreeDurable); + const contextInstance = await this.injector.loadPerContext(instance, moduleRef, collection, contextId); + await this.createCallbackProxy(contextInstance, contextInstance[methodName], methodName, moduleKey, requestMethod, contextId, instanceWrapper.id)(req, res, next); + } + catch (err) { + let exceptionFilter = this.exceptionFiltersCache.get(instance[methodName]); + if (!exceptionFilter) { + exceptionFilter = this.exceptionsFilter.create(instance, instance[methodName], moduleKey); + this.exceptionFiltersCache.set(instance[methodName], exceptionFilter); + } + const host = new execution_context_host_1.ExecutionContextHost([req, res, next]); + exceptionFilter.next(err, host); + } + }; + } + getContextId(request, isTreeDurable) { + const contextId = context_id_factory_1.ContextIdFactory.getByRequest(request); + if (!request[request_constants_1.REQUEST_CONTEXT_ID]) { + Object.defineProperty(request, request_constants_1.REQUEST_CONTEXT_ID, { + value: contextId, + enumerable: false, + writable: false, + configurable: false, + }); + const requestProviderValue = isTreeDurable + ? contextId.payload + : Object.assign(request, contextId.payload); + this.container.registerRequestProvider(requestProviderValue, contextId); + } + return contextId; + } + copyMetadataToCallback(originalCallback, targetCallback) { + for (const key of Reflect.getMetadataKeys(originalCallback)) { + Reflect.defineMetadata(key, Reflect.getMetadata(key, originalCallback), targetCallback); + } + } +} +exports.RouterExplorer = RouterExplorer; diff --git a/node_modules/@nestjs/core/router/router-module.d.ts b/node_modules/@nestjs/core/router/router-module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f5c8e73f30da379b44bfbecd6ee26a84c661cb8 --- /dev/null +++ b/node_modules/@nestjs/core/router/router-module.d.ts @@ -0,0 +1,19 @@ +import { DynamicModule } from '@nestjs/common'; +import { Module as ModuleClass } from '../injector/module'; +import { ModulesContainer } from '../injector/modules-container'; +import { Routes } from './interfaces'; +export declare const ROUTES: unique symbol; +export declare const targetModulesByContainer: WeakMap>; +/** + * @publicApi + */ +export declare class RouterModule { + private readonly modulesContainer; + private readonly routes; + constructor(modulesContainer: ModulesContainer, routes: Routes); + static register(routes: Routes): DynamicModule; + private deepCloneRoutes; + private initialize; + private registerModulePathMetadata; + private updateTargetModulesCache; +} diff --git a/node_modules/@nestjs/core/router/router-module.js b/node_modules/@nestjs/core/router/router-module.js new file mode 100644 index 0000000000000000000000000000000000000000..27c9dc993ca00c16dd09c67f1d0fcdd689f99ee0 --- /dev/null +++ b/node_modules/@nestjs/core/router/router-module.js @@ -0,0 +1,80 @@ +"use strict"; +var RouterModule_1; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RouterModule = exports.targetModulesByContainer = exports.ROUTES = void 0; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const modules_container_1 = require("../injector/modules-container"); +const utils_1 = require("./utils"); +exports.ROUTES = Symbol('ROUTES'); +exports.targetModulesByContainer = new WeakMap(); +/** + * @publicApi + */ +let RouterModule = RouterModule_1 = class RouterModule { + constructor(modulesContainer, routes) { + this.modulesContainer = modulesContainer; + this.routes = routes; + this.routes = this.deepCloneRoutes(routes); + this.initialize(); + } + static register(routes) { + return { + module: RouterModule_1, + providers: [ + { + provide: exports.ROUTES, + useValue: routes, + }, + ], + }; + } + deepCloneRoutes(routes) { + return routes.map((routeOrType) => { + if (typeof routeOrType === 'function') { + return routeOrType; + } + if (routeOrType.children) { + return { + ...routeOrType, + children: this.deepCloneRoutes(routeOrType.children), + }; + } + return { ...routeOrType }; + }); + } + initialize() { + const flattenedRoutes = (0, utils_1.flattenRoutePaths)(this.routes); + flattenedRoutes.forEach(route => { + const modulePath = (0, shared_utils_1.normalizePath)(route.path); + this.registerModulePathMetadata(route.module, modulePath); + this.updateTargetModulesCache(route.module); + }); + } + registerModulePathMetadata(moduleCtor, modulePath) { + Reflect.defineMetadata(constants_1.MODULE_PATH + this.modulesContainer.applicationId, modulePath, moduleCtor); + } + updateTargetModulesCache(moduleCtor) { + let moduleClassSet; + if (exports.targetModulesByContainer.has(this.modulesContainer)) { + moduleClassSet = exports.targetModulesByContainer.get(this.modulesContainer); + } + else { + moduleClassSet = new WeakSet(); + exports.targetModulesByContainer.set(this.modulesContainer, moduleClassSet); + } + const moduleRef = Array.from(this.modulesContainer.values()).find(item => item?.metatype === moduleCtor); + if (!moduleRef) { + return; + } + moduleClassSet.add(moduleRef); + } +}; +exports.RouterModule = RouterModule; +exports.RouterModule = RouterModule = RouterModule_1 = tslib_1.__decorate([ + (0, common_1.Module)({}), + tslib_1.__param(1, (0, common_1.Inject)(exports.ROUTES)), + tslib_1.__metadata("design:paramtypes", [modules_container_1.ModulesContainer, Array]) +], RouterModule); diff --git a/node_modules/@nestjs/core/router/router-proxy.d.ts b/node_modules/@nestjs/core/router/router-proxy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0cfdbccdb202c6c0d69e23267308e008f417ae3a --- /dev/null +++ b/node_modules/@nestjs/core/router/router-proxy.d.ts @@ -0,0 +1,6 @@ +import { ExceptionsHandler } from '../exceptions/exceptions-handler'; +export type RouterProxyCallback = (req: TRequest, res: TResponse, next: () => void) => void | Promise; +export declare class RouterProxy { + createProxy(targetCallback: RouterProxyCallback, exceptionsHandler: ExceptionsHandler): (req: TRequest, res: TResponse, next: () => void) => Promise; + createExceptionLayerProxy(targetCallback: (err: TError, req: TRequest, res: TResponse, next: () => void) => void | Promise, exceptionsHandler: ExceptionsHandler): (err: TError, req: TRequest, res: TResponse, next: () => void) => Promise; +} diff --git a/node_modules/@nestjs/core/router/router-proxy.js b/node_modules/@nestjs/core/router/router-proxy.js new file mode 100644 index 0000000000000000000000000000000000000000..1bf15779f7d0e0658e9d50c67c9924ffc7a70867 --- /dev/null +++ b/node_modules/@nestjs/core/router/router-proxy.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RouterProxy = void 0; +const execution_context_host_1 = require("../helpers/execution-context-host"); +class RouterProxy { + createProxy(targetCallback, exceptionsHandler) { + return async (req, res, next) => { + try { + await targetCallback(req, res, next); + } + catch (e) { + const host = new execution_context_host_1.ExecutionContextHost([req, res, next]); + exceptionsHandler.next(e, host); + return res; + } + }; + } + createExceptionLayerProxy(targetCallback, exceptionsHandler) { + return async (err, req, res, next) => { + try { + await targetCallback(err, req, res, next); + } + catch (e) { + const host = new execution_context_host_1.ExecutionContextHost([req, res, next]); + exceptionsHandler.next(e, host); + return res; + } + }; + } +} +exports.RouterProxy = RouterProxy; diff --git a/node_modules/@nestjs/core/router/router-response-controller.d.ts b/node_modules/@nestjs/core/router/router-response-controller.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a7cd53fe6cf9deabc63a0fb1e69d25466510949 --- /dev/null +++ b/node_modules/@nestjs/core/router/router-response-controller.d.ts @@ -0,0 +1,29 @@ +import { HttpServer, RequestMethod } from '@nestjs/common'; +import { IncomingMessage } from 'http'; +import { Observable } from 'rxjs'; +import { AdditionalHeaders, WritableHeaderStream } from './sse-stream'; +export interface CustomHeader { + name: string; + value: string | (() => string); +} +export interface RedirectResponse { + url: string; + statusCode?: number; +} +export declare class RouterResponseController { + private readonly applicationRef; + private readonly logger; + constructor(applicationRef: HttpServer); + apply(result: TInput, response: TResponse, httpStatusCode?: number): Promise; + redirect(resultOrDeferred: TInput, response: TResponse, redirectResponse: RedirectResponse): Promise; + render(resultOrDeferred: TInput, response: TResponse, template: string): Promise; + transformToResult(resultOrDeferred: any): Promise; + getStatusByMethod(requestMethod: RequestMethod): number; + setHeaders(response: TResponse, headers: CustomHeader[]): void; + setStatus(response: TResponse, statusCode: number): void; + sse = any, TResponse extends WritableHeaderStream = any, TRequest extends IncomingMessage = any>(result: TInput | Promise, response: TResponse, request: TRequest, options?: { + additionalHeaders?: AdditionalHeaders; + statusCode?: number; + }): Promise; + private assertObservable; +} diff --git a/node_modules/@nestjs/core/router/router-response-controller.js b/node_modules/@nestjs/core/router/router-response-controller.js new file mode 100644 index 0000000000000000000000000000000000000000..9a0f1114de61e075a827f8e92e421f747e2a7b59 --- /dev/null +++ b/node_modules/@nestjs/core/router/router-response-controller.js @@ -0,0 +1,182 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RouterResponseController = void 0; +const common_1 = require("@nestjs/common"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const rxjs_1 = require("rxjs"); +const operators_1 = require("rxjs/operators"); +const sse_stream_1 = require("./sse-stream"); +class RouterResponseController { + constructor(applicationRef) { + this.applicationRef = applicationRef; + this.logger = new common_1.Logger(RouterResponseController.name); + } + async apply(result, response, httpStatusCode) { + return this.applicationRef.reply(response, result, httpStatusCode); + } + async redirect(resultOrDeferred, response, redirectResponse) { + const result = await this.transformToResult(resultOrDeferred); + const statusCode = result && result.statusCode + ? result.statusCode + : redirectResponse.statusCode + ? redirectResponse.statusCode + : common_1.HttpStatus.FOUND; + const url = result && result.url ? result.url : redirectResponse.url; + this.applicationRef.redirect(response, statusCode, url); + } + async render(resultOrDeferred, response, template) { + const result = await this.transformToResult(resultOrDeferred); + return this.applicationRef.render(response, template, result); + } + async transformToResult(resultOrDeferred) { + if ((0, rxjs_1.isObservable)(resultOrDeferred)) { + return (0, rxjs_1.lastValueFrom)(resultOrDeferred); + } + return resultOrDeferred; + } + getStatusByMethod(requestMethod) { + switch (requestMethod) { + case common_1.RequestMethod.POST: + return common_1.HttpStatus.CREATED; + default: + return common_1.HttpStatus.OK; + } + } + setHeaders(response, headers) { + headers.forEach(({ name, value }) => this.applicationRef.setHeader(response, name, typeof value === 'function' ? value() : value)); + } + setStatus(response, statusCode) { + this.applicationRef.status(response, statusCode); + } + async sse(result, response, request, options) { + // It's possible that we sent headers already so don't use a stream + if (response.writableEnded) { + return; + } + const stream = new sse_stream_1.SseStream(request); + const statusCode = options?.statusCode ?? + response.statusCode ?? + 200; + return new Promise((resolve, reject) => { + let settled = false; + let closeRequested = false; + let subscription; + const disconnectSource = request.socket ?? response; + const cleanup = () => disconnectSource.removeListener('close', onClose); + const endStream = () => { + if (!stream.writableEnded) { + stream.end(); + } + }; + const onClose = () => { + if (settled || closeRequested) { + return; + } + closeRequested = true; + if (!subscription) { + cleanup(); + return; + } + settled = true; + cleanup(); + subscription?.unsubscribe(); + endStream(); + response.end(); + resolve(); + }; + disconnectSource.once('close', onClose); + Promise.resolve(result) + .then(observableResult => { + if (settled) { + return; + } + this.assertObservable(observableResult); + if (closeRequested) { + const cleanupSubscription = observableResult.subscribe({ + error: () => undefined, + }); + cleanupSubscription.unsubscribe(); + settled = true; + endStream(); + response.end(); + resolve(); + return; + } + stream.pipe(response, { + additionalHeaders: options?.additionalHeaders, + statusCode, + }); + subscription = observableResult + .pipe((0, operators_1.map)((message) => { + if ((0, shared_utils_1.isObject)(message)) { + return message; + } + return { data: message }; + }), (0, operators_1.concatMap)(message => new Promise(resolve => stream.writeMessage(message, () => resolve()))), (0, operators_1.catchError)(err => { + if (!stream.headersCommitted) { + throw err; + } + const data = err instanceof Error ? err.message : err; + stream.writeMessage({ type: 'error', data }, writeError => { + if (writeError) { + this.logger.error(writeError); + } + }); + return rxjs_1.EMPTY; + })) + .subscribe({ + error: err => { + if (settled) { + return; + } + settled = true; + cleanup(); + endStream(); + reject(err); + }, + complete: () => { + if (settled) { + return; + } + settled = true; + cleanup(); + endStream(); + resolve(); + }, + }); + // Commit SSE headers on the next macrotask. Pipe validation errors + // propagate through microtasks (which complete before macrotasks), + // so if the lifecycle errored, `settled` is already true and we + // skip the write. Otherwise headers are sent immediately rather + // than waiting for the first Observable emission. + setTimeout(() => { + if (!settled) { + stream.commitHeaders(); + } + }, 0); + }) + .catch(err => { + if (settled) { + return; + } + if (closeRequested) { + settled = true; + endStream(); + response.end(); + resolve(); + return; + } + settled = true; + cleanup(); + endStream(); + reject(err); + }); + }); + } + assertObservable(value) { + if (!(0, rxjs_1.isObservable)(value)) { + throw new ReferenceError('You must return an Observable stream to use Server-Sent Events (SSE).'); + } + } +} +exports.RouterResponseController = RouterResponseController; diff --git a/node_modules/@nestjs/core/router/routes-resolver.d.ts b/node_modules/@nestjs/core/router/routes-resolver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9d6865f59ebc4ae9bf5a2d40215fb022cdd0743 --- /dev/null +++ b/node_modules/@nestjs/core/router/routes-resolver.d.ts @@ -0,0 +1,27 @@ +import { Controller, HttpServer } from '@nestjs/common/interfaces'; +import { ApplicationConfig } from '../application-config'; +import { NestContainer } from '../injector/container'; +import { Injector } from '../injector/injector'; +import { InstanceWrapper } from '../injector/instance-wrapper'; +import { GraphInspector } from '../inspector/graph-inspector'; +import { Resolver } from './interfaces/resolver.interface'; +export declare class RoutesResolver implements Resolver { + private readonly container; + private readonly applicationConfig; + private readonly injector; + private readonly logger; + private readonly routerProxy; + private readonly routePathFactory; + private readonly routerExceptionsFilter; + private readonly routerExplorer; + constructor(container: NestContainer, applicationConfig: ApplicationConfig, injector: Injector, graphInspector: GraphInspector); + resolve(applicationRef: T, globalPrefix: string): void; + registerRouters(routes: Map>, moduleName: string, globalPrefix: string, modulePath: string, applicationRef: HttpServer): void; + registerNotFoundHandler(): void; + registerExceptionHandler(): void; + mapExternalException(err: any): any; + private isHttpFastifyError; + private getModulePathMetadata; + private getHostMetadata; + private getVersionMetadata; +} diff --git a/node_modules/@nestjs/core/router/routes-resolver.js b/node_modules/@nestjs/core/router/routes-resolver.js new file mode 100644 index 0000000000000000000000000000000000000000..55d31eec1b072975a750439395f380e6abca9123 --- /dev/null +++ b/node_modules/@nestjs/core/router/routes-resolver.js @@ -0,0 +1,129 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RoutesResolver = void 0; +const common_1 = require("@nestjs/common"); +const constants_1 = require("@nestjs/common/constants"); +const logger_service_1 = require("@nestjs/common/services/logger.service"); +const messages_1 = require("../helpers/messages"); +const metadata_scanner_1 = require("../metadata-scanner"); +const route_path_factory_1 = require("./route-path-factory"); +const router_exception_filters_1 = require("./router-exception-filters"); +const router_explorer_1 = require("./router-explorer"); +const router_proxy_1 = require("./router-proxy"); +class RoutesResolver { + constructor(container, applicationConfig, injector, graphInspector) { + this.container = container; + this.applicationConfig = applicationConfig; + this.injector = injector; + this.logger = new logger_service_1.Logger(RoutesResolver.name, { + timestamp: true, + }); + this.routerProxy = new router_proxy_1.RouterProxy(); + const httpAdapterRef = container.getHttpAdapterRef(); + this.routerExceptionsFilter = new router_exception_filters_1.RouterExceptionFilters(container, applicationConfig, httpAdapterRef); + this.routePathFactory = new route_path_factory_1.RoutePathFactory(this.applicationConfig); + const metadataScanner = new metadata_scanner_1.MetadataScanner(); + this.routerExplorer = new router_explorer_1.RouterExplorer(metadataScanner, this.container, this.injector, this.routerProxy, this.routerExceptionsFilter, this.applicationConfig, this.routePathFactory, graphInspector); + } + resolve(applicationRef, globalPrefix) { + const modules = this.container.getModules(); + modules.forEach(({ controllers, metatype }, moduleName) => { + const modulePath = this.getModulePathMetadata(metatype); + this.registerRouters(controllers, moduleName, globalPrefix, modulePath, applicationRef); + }); + } + registerRouters(routes, moduleName, globalPrefix, modulePath, applicationRef) { + routes.forEach(instanceWrapper => { + const { metatype } = instanceWrapper; + const host = this.getHostMetadata(metatype); + const routerPaths = this.routerExplorer.extractRouterPath(metatype); + const controllerVersion = this.getVersionMetadata(metatype); + const controllerName = metatype.name; + routerPaths.forEach(path => { + const pathsToLog = this.routePathFactory.create({ + ctrlPath: path, + modulePath, + globalPrefix, + }); + if (!controllerVersion) { + pathsToLog.forEach(path => { + const logMessage = (0, messages_1.CONTROLLER_MAPPING_MESSAGE)(controllerName, path); + this.logger.log(logMessage); + }); + } + else { + pathsToLog.forEach(path => { + const logMessage = (0, messages_1.VERSIONED_CONTROLLER_MAPPING_MESSAGE)(controllerName, path, controllerVersion); + this.logger.log(logMessage); + }); + } + const versioningOptions = this.applicationConfig.getVersioning(); + const routePathMetadata = { + ctrlPath: path, + modulePath, + globalPrefix, + controllerVersion, + versioningOptions, + }; + this.routerExplorer.explore(instanceWrapper, moduleName, applicationRef, host, routePathMetadata); + }); + }); + } + registerNotFoundHandler() { + const applicationRef = this.container.getHttpAdapterRef(); + const callback = (req, res) => { + const method = applicationRef.getRequestMethod(req); + const url = applicationRef.getRequestUrl(req); + throw new common_1.NotFoundException(`Cannot ${method} ${url}`); + }; + const handler = this.routerExceptionsFilter.create({}, callback, undefined); + const proxy = this.routerProxy.createProxy(callback, handler); + applicationRef.setNotFoundHandler && + applicationRef.setNotFoundHandler(proxy, this.applicationConfig.getGlobalPrefix()); + } + registerExceptionHandler() { + const callback = (err, req, res, next) => { + throw this.mapExternalException(err); + }; + const handler = this.routerExceptionsFilter.create({}, callback, undefined); + const proxy = this.routerProxy.createExceptionLayerProxy(callback, handler); + const applicationRef = this.container.getHttpAdapterRef(); + applicationRef.setErrorHandler && + applicationRef.setErrorHandler(proxy, this.applicationConfig.getGlobalPrefix()); + } + mapExternalException(err) { + switch (true) { + // SyntaxError is thrown by Express body-parser when given invalid JSON (#422, #430) + // URIError is thrown by Express when given a path parameter with an invalid percentage + // encoding, e.g. '%FF' (#8915) + case err instanceof SyntaxError || err instanceof URIError: + return new common_1.BadRequestException(err.message); + case this.isHttpFastifyError(err): + return new common_1.HttpException(err.message, err.statusCode); + default: + return err; + } + } + isHttpFastifyError(error) { + // condition based on this code - https://github.com/fastify/fastify-error/blob/d669b150a82968322f9f7be992b2f6b463272de3/index.js#L22 + return (error.statusCode !== undefined && + error instanceof Error && + error.name === 'FastifyError'); + } + getModulePathMetadata(metatype) { + const modulesContainer = this.container.getModules(); + const modulePath = Reflect.getMetadata(constants_1.MODULE_PATH + modulesContainer.applicationId, metatype); + return modulePath ?? Reflect.getMetadata(constants_1.MODULE_PATH, metatype); + } + getHostMetadata(metatype) { + return Reflect.getMetadata(constants_1.HOST_METADATA, metatype); + } + getVersionMetadata(metatype) { + const versioningConfig = this.applicationConfig.getVersioning(); + if (versioningConfig) { + return (Reflect.getMetadata(constants_1.VERSION_METADATA, metatype) ?? + versioningConfig.defaultVersion); + } + } +} +exports.RoutesResolver = RoutesResolver; diff --git a/node_modules/@nestjs/core/router/sse-stream.d.ts b/node_modules/@nestjs/core/router/sse-stream.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1410f9335a3d5aaf9981f754a9db41fb57245af1 --- /dev/null +++ b/node_modules/@nestjs/core/router/sse-stream.d.ts @@ -0,0 +1,55 @@ +import { MessageEvent } from '@nestjs/common/interfaces'; +import { IncomingMessage, OutgoingHttpHeaders } from 'http'; +import { Transform } from 'stream'; +export type AdditionalHeaders = Record; +interface ReadHeaders { + getHeaders?(): AdditionalHeaders; +} +interface WriteHeaders { + writableEnded?: boolean; + writeHead?(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): void; + writeHead?(statusCode: number, headers?: OutgoingHttpHeaders): void; + flushHeaders?(): void; +} +export type WritableHeaderStream = NodeJS.WritableStream & WriteHeaders; +export type HeaderStream = WritableHeaderStream & ReadHeaders; +/** + * Adapted from https://raw.githubusercontent.com/EventSource/node-ssestream + * Transforms "messages" to W3C event stream content. + * See https://html.spec.whatwg.org/multipage/server-sent-events.html + * A message is an object with one or more of the following properties: + * - data (String or object, which gets turned into JSON) + * - type + * - id + * - retry + * + * If constructed with a HTTP Request, it will optimise the socket for streaming. + * If this stream is piped to an HTTP Response, it will set appropriate headers. + */ +export declare class SseStream extends Transform { + private lastEventId; + private _headersCommitted; + private _destination; + private _statusCode; + private _additionalHeaders; + constructor(req?: IncomingMessage); + get headersCommitted(): boolean; + pipe(destination: T, options?: { + additionalHeaders?: AdditionalHeaders; + statusCode?: number; + end?: boolean; + }): T; + /** + * Writes SSE headers to the destination if they have not been sent yet. + * Headers are deferred until the first message so that, if the observable + * errors before any data is emitted, the HTTP status code can still be + * changed by an exception filter. + */ + commitHeaders(): void; + _transform(message: MessageEvent, encoding: string, callback: (error?: Error | null, data?: any) => void): void; + /** + * Calls `.write` but handles the drain if needed + */ + writeMessage(message: MessageEvent, cb: (error: Error | null | undefined) => void): void; +} +export {}; diff --git a/node_modules/@nestjs/core/router/sse-stream.js b/node_modules/@nestjs/core/router/sse-stream.js new file mode 100644 index 0000000000000000000000000000000000000000..798c0022505887e6daaecdfa047944572fe51cfd --- /dev/null +++ b/node_modules/@nestjs/core/router/sse-stream.js @@ -0,0 +1,113 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SseStream = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const stream_1 = require("stream"); +function toDataString(data) { + if ((0, shared_utils_1.isObject)(data)) { + return toDataString(JSON.stringify(data)); + } + return data + .split(/\r\n|\r|\n/) + .map(line => `data: ${line}\n`) + .join(''); +} +/** + * Adapted from https://raw.githubusercontent.com/EventSource/node-ssestream + * Transforms "messages" to W3C event stream content. + * See https://html.spec.whatwg.org/multipage/server-sent-events.html + * A message is an object with one or more of the following properties: + * - data (String or object, which gets turned into JSON) + * - type + * - id + * - retry + * + * If constructed with a HTTP Request, it will optimise the socket for streaming. + * If this stream is piped to an HTTP Response, it will set appropriate headers. + */ +class SseStream extends stream_1.Transform { + constructor(req) { + super({ objectMode: true }); + this.lastEventId = null; + this._headersCommitted = false; + this._destination = null; + this._statusCode = 200; + if (req && req.socket) { + req.socket.setKeepAlive(true); + req.socket.setNoDelay(true); + req.socket.setTimeout(0); + } + } + get headersCommitted() { + return this._headersCommitted; + } + pipe(destination, options) { + this._destination = destination; + this._statusCode = options?.statusCode ?? 200; + this._additionalHeaders = options?.additionalHeaders; + return super.pipe(destination, options); + } + /** + * Writes SSE headers to the destination if they have not been sent yet. + * Headers are deferred until the first message so that, if the observable + * errors before any data is emitted, the HTTP status code can still be + * changed by an exception filter. + */ + commitHeaders() { + if (this._headersCommitted || !this._destination) { + return; + } + if (this._destination.writableEnded) { + return; + } + this._headersCommitted = true; + const statusCode = this._statusCode ?? 200; + const additionalHeaders = this._additionalHeaders; + if (this._destination.writeHead) { + this._destination.writeHead(statusCode, { + ...additionalHeaders, + // See https://github.com/dunglas/mercure/blob/master/hub/subscribe.go#L124-L130 + 'Content-Type': 'text/event-stream', + Connection: 'keep-alive', + // Disable cache, even for old browsers and proxies + 'Cache-Control': 'private, no-cache, no-store, must-revalidate, max-age=0, no-transform', + Pragma: 'no-cache', + Expire: '0', + // NGINX support https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/#x-accel-buffering + 'X-Accel-Buffering': 'no', + }); + this._destination.flushHeaders?.(); + } + this._destination.write('\n'); + } + _transform(message, encoding, callback) { + this.commitHeaders(); + const sanitize = (val) => String(val).replace(/[\r\n]/g, ''); + let data = message.type ? `event: ${sanitize(message.type)}\n` : ''; + data += + message.id !== undefined && message.id !== null + ? `id: ${sanitize(message.id)}\n` + : ''; + data += message.retry ? `retry: ${sanitize(message.retry)}\n` : ''; + data += message.data ? toDataString(message.data) : ''; + data += '\n'; + this.push(data); + callback(); + } + /** + * Calls `.write` but handles the drain if needed + */ + writeMessage(message, cb) { + if (message.id === undefined || message.id === null) { + this.lastEventId++; + message.id = this.lastEventId.toString(); + } + if (!this.write(message, 'utf-8')) { + this.once('drain', cb); + } + else { + process.nextTick(cb); + } + } +} +exports.SseStream = SseStream; diff --git a/node_modules/@nestjs/core/router/utils/exclude-route.util.d.ts b/node_modules/@nestjs/core/router/utils/exclude-route.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1c76db5dcd759b4a2499838f22b14a10b10150ed --- /dev/null +++ b/node_modules/@nestjs/core/router/utils/exclude-route.util.d.ts @@ -0,0 +1,4 @@ +import { RequestMethod } from '@nestjs/common'; +import { ExcludeRouteMetadata } from '../interfaces/exclude-route-metadata.interface'; +export declare const isRequestMethodAll: (method: RequestMethod) => boolean; +export declare function isRouteExcluded(excludedRoutes: ExcludeRouteMetadata[], path: string, requestMethod?: RequestMethod): boolean; diff --git a/node_modules/@nestjs/core/router/utils/exclude-route.util.js b/node_modules/@nestjs/core/router/utils/exclude-route.util.js new file mode 100644 index 0000000000000000000000000000000000000000..2d341e420af016c6d3980dedf75700fa15605037 --- /dev/null +++ b/node_modules/@nestjs/core/router/utils/exclude-route.util.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isRequestMethodAll = void 0; +exports.isRouteExcluded = isRouteExcluded; +const common_1 = require("@nestjs/common"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const isRequestMethodAll = (method) => { + return common_1.RequestMethod.ALL === method || method === -1; +}; +exports.isRequestMethodAll = isRequestMethodAll; +function isRouteExcluded(excludedRoutes, path, requestMethod) { + return excludedRoutes.some(route => { + if ((0, exports.isRequestMethodAll)(route.requestMethod) || + route.requestMethod === requestMethod) { + return route.pathRegex.exec((0, shared_utils_1.addLeadingSlash)(path)); + } + return false; + }); +} diff --git a/node_modules/@nestjs/core/router/utils/flatten-route-paths.util.d.ts b/node_modules/@nestjs/core/router/utils/flatten-route-paths.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1ba9ad1e54193fc9257f4c9e7bfae7c638982d64 --- /dev/null +++ b/node_modules/@nestjs/core/router/utils/flatten-route-paths.util.d.ts @@ -0,0 +1,6 @@ +import { Type } from '@nestjs/common'; +import { Routes } from '../interfaces/routes.interface'; +export declare function flattenRoutePaths(routes: Routes): { + module: Type; + path: string; +}[]; diff --git a/node_modules/@nestjs/core/router/utils/flatten-route-paths.util.js b/node_modules/@nestjs/core/router/utils/flatten-route-paths.util.js new file mode 100644 index 0000000000000000000000000000000000000000..4f0e3a9cdf6d16d22f4637b6c182c950da76654b --- /dev/null +++ b/node_modules/@nestjs/core/router/utils/flatten-route-paths.util.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.flattenRoutePaths = flattenRoutePaths; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +function flattenRoutePaths(routes) { + const result = []; + routes.forEach(item => { + if (item.module && item.path) { + result.push({ module: item.module, path: item.path }); + } + if (item.children) { + const childrenRef = item.children; + childrenRef.forEach(child => { + if (!(0, shared_utils_1.isString)(child) && (0, shared_utils_1.isString)(child.path)) { + child.path = (0, shared_utils_1.normalizePath)((0, shared_utils_1.normalizePath)(item.path) + (0, shared_utils_1.normalizePath)(child.path)); + } + else { + result.push({ path: item.path, module: child }); + } + }); + result.push(...flattenRoutePaths(childrenRef)); + } + }); + return result; +} diff --git a/node_modules/@nestjs/core/router/utils/index.d.ts b/node_modules/@nestjs/core/router/utils/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3524ed9063a1be066d3a323a46879dd3f703009 --- /dev/null +++ b/node_modules/@nestjs/core/router/utils/index.d.ts @@ -0,0 +1,2 @@ +export * from './exclude-route.util'; +export * from './flatten-route-paths.util'; diff --git a/node_modules/@nestjs/core/router/utils/index.js b/node_modules/@nestjs/core/router/utils/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6ac6c862c0a45d9fc4560acb8b51644554185e43 --- /dev/null +++ b/node_modules/@nestjs/core/router/utils/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./exclude-route.util"), exports); +tslib_1.__exportStar(require("./flatten-route-paths.util"), exports); diff --git a/node_modules/@nestjs/core/scanner.d.ts b/node_modules/@nestjs/core/scanner.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..970bd95e992eb89bd2620b96be0162db3a153b76 --- /dev/null +++ b/node_modules/@nestjs/core/scanner.d.ts @@ -0,0 +1,89 @@ +import { DynamicModule, ForwardReference, Provider } from '@nestjs/common'; +import { EnhancerSubtype } from '@nestjs/common/constants'; +import { ClassProvider, Controller, ExistingProvider, FactoryProvider, Injectable, Type, ValueProvider } from '@nestjs/common/interfaces'; +import { ApplicationConfig } from './application-config'; +import { NestContainer } from './injector/container'; +import { InstanceWrapper } from './injector/instance-wrapper'; +import { Module } from './injector/module'; +import { GraphInspector } from './inspector/graph-inspector'; +import { ModuleDefinition } from './interfaces/module-definition.interface'; +import { ModuleOverride } from './interfaces/module-override.interface'; +import { MetadataScanner } from './metadata-scanner'; +interface ModulesScanParameters { + moduleDefinition: ModuleDefinition; + scope?: Type[]; + ctxRegistry?: (ForwardReference | DynamicModule | Type)[]; + overrides?: ModuleOverride[]; + lazy?: boolean; +} +export declare class DependenciesScanner { + private readonly container; + private readonly metadataScanner; + private readonly graphInspector; + private readonly applicationConfig; + private readonly applicationProvidersApplyMap; + constructor(container: NestContainer, metadataScanner: MetadataScanner, graphInspector: GraphInspector, applicationConfig?: ApplicationConfig); + scan(module: Type, options?: { + overrides?: ModuleOverride[]; + }): Promise; + scanForModules({ moduleDefinition, lazy, scope, ctxRegistry, overrides, }: ModulesScanParameters): Promise; + insertModule(moduleDefinition: any, scope: Type[]): Promise<{ + moduleRef: Module; + inserted: boolean; + } | undefined>; + scanModulesForDependencies(modules?: Map): Promise; + reflectImports(module: Type, token: string, context: string): Promise; + reflectProviders(module: Type, token: string): void; + reflectControllers(module: Type, token: string): void; + reflectDynamicMetadata(cls: Type, token: string): void; + reflectExports(module: Type, token: string): void; + reflectInjectables(component: Type, token: string, metadataKey: string): void; + reflectParamInjectables(component: Type, token: string, metadataKey: string): void; + reflectKeyMetadata(component: Type, key: string, methodKey: string): { + methodKey: string; + metadata: any; + } | undefined; + calculateModulesDistance(): void; + insertImport(related: any, token: string, context: string): Promise; + isCustomProvider(provider: Provider): provider is ClassProvider | ValueProvider | FactoryProvider | ExistingProvider; + insertProvider(provider: Provider, token: string): string | symbol | Function | InstanceWrapper | undefined; + insertInjectable(injectable: Type | object, token: string, host: Type, subtype: EnhancerSubtype, methodKey?: string): InstanceWrapper | undefined; + insertExportedProviderOrModule(toExport: ForwardReference | DynamicModule | Type, token: string): void; + insertController(controller: Type, token: string): void; + private insertOrOverrideModule; + private getOverrideModuleByModule; + private overrideModule; + reflectMetadata(metadataKey: string, metatype: Type): T[]; + registerCoreModule(overrides?: ModuleOverride[]): Promise; + /** + * Add either request or transient globally scoped enhancers + * to all controllers metadata storage + */ + addScopedEnhancersMetadata(): void; + applyApplicationProviders(): void; + getApplyProvidersMap(): { + [type: string]: Function; + }; + getApplyRequestProvidersMap(): { + [type: string]: Function; + }; + isDynamicModule(module: Type | DynamicModule): module is DynamicModule; + /** + * @param metatype + * @returns `true` if `metatype` is annotated with the `@Injectable()` decorator. + */ + private isInjectable; + /** + * @param metatype + * @returns `true` if `metatype` is annotated with the `@Controller()` decorator. + */ + private isController; + /** + * @param metatype + * @returns `true` if `metatype` is annotated with the `@Catch()` decorator. + */ + private isExceptionFilter; + private isForwardReference; + private isRequestOrTransient; +} +export {}; diff --git a/node_modules/@nestjs/core/scanner.js b/node_modules/@nestjs/core/scanner.js new file mode 100644 index 0000000000000000000000000000000000000000..298a2c01ebd3a50ac92f821a88341d4e0a71dd3c --- /dev/null +++ b/node_modules/@nestjs/core/scanner.js @@ -0,0 +1,420 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DependenciesScanner = void 0; +const constants_1 = require("@nestjs/common/constants"); +const interfaces_1 = require("@nestjs/common/interfaces"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const iterare_1 = require("iterare"); +const application_config_1 = require("./application-config"); +const constants_2 = require("./constants"); +const circular_dependency_exception_1 = require("./errors/exceptions/circular-dependency.exception"); +const invalid_class_module_exception_1 = require("./errors/exceptions/invalid-class-module.exception"); +const invalid_module_exception_1 = require("./errors/exceptions/invalid-module.exception"); +const undefined_module_exception_1 = require("./errors/exceptions/undefined-module.exception"); +const get_class_scope_1 = require("./helpers/get-class-scope"); +const internal_core_module_factory_1 = require("./injector/internal-core-module/internal-core-module-factory"); +const topology_tree_1 = require("./injector/topology-tree/topology-tree"); +const uuid_factory_1 = require("./inspector/uuid-factory"); +class DependenciesScanner { + constructor(container, metadataScanner, graphInspector, applicationConfig = new application_config_1.ApplicationConfig()) { + this.container = container; + this.metadataScanner = metadataScanner; + this.graphInspector = graphInspector; + this.applicationConfig = applicationConfig; + this.applicationProvidersApplyMap = []; + } + async scan(module, options) { + await this.registerCoreModule(options?.overrides); + await this.scanForModules({ + moduleDefinition: module, + overrides: options?.overrides, + }); + await this.scanModulesForDependencies(); + this.addScopedEnhancersMetadata(); + // Modules distance calculation should be done after all modules are scanned + // but before global modules are registered (linked to all modules). + // Global modules have their distance set to MAX anyway. + this.calculateModulesDistance(); + this.container.bindGlobalScope(); + } + async scanForModules({ moduleDefinition, lazy, scope = [], ctxRegistry = [], overrides = [], }) { + const { moduleRef: moduleInstance, inserted: moduleInserted } = (await this.insertOrOverrideModule(moduleDefinition, overrides, scope)) ?? + {}; + moduleDefinition = + this.getOverrideModuleByModule(moduleDefinition, overrides)?.newModule ?? + moduleDefinition; + moduleDefinition = + moduleDefinition instanceof Promise + ? await moduleDefinition + : moduleDefinition; + ctxRegistry.push(moduleDefinition); + if (this.isForwardReference(moduleDefinition)) { + moduleDefinition = moduleDefinition.forwardRef(); + } + const modules = !this.isDynamicModule(moduleDefinition) + ? this.reflectMetadata(constants_1.MODULE_METADATA.IMPORTS, moduleDefinition) + : [ + ...this.reflectMetadata(constants_1.MODULE_METADATA.IMPORTS, moduleDefinition.module), + ...(moduleDefinition.imports || []), + ]; + let registeredModuleRefs = []; + for (const [index, innerModule] of modules.entries()) { + // In case of a circular dependency (ES module system), JavaScript will resolve the type to `undefined`. + if (innerModule === undefined) { + throw new undefined_module_exception_1.UndefinedModuleException(moduleDefinition, index, scope); + } + if (!innerModule) { + throw new invalid_module_exception_1.InvalidModuleException(moduleDefinition, index, scope, innerModule); + } + if (ctxRegistry.includes(innerModule)) { + continue; + } + const moduleRefs = await this.scanForModules({ + moduleDefinition: innerModule, + scope: [].concat(scope, moduleDefinition), + ctxRegistry, + overrides, + lazy, + }); + registeredModuleRefs = registeredModuleRefs.concat(moduleRefs); + } + if (!moduleInstance) { + return registeredModuleRefs; + } + if (lazy && moduleInserted) { + this.container.bindGlobalsToImports(moduleInstance); + } + return [moduleInstance].concat(registeredModuleRefs); + } + async insertModule(moduleDefinition, scope) { + const moduleToAdd = this.isForwardReference(moduleDefinition) + ? moduleDefinition.forwardRef() + : moduleDefinition; + if (this.isInjectable(moduleToAdd)) { + throw new invalid_class_module_exception_1.InvalidClassModuleException(moduleDefinition, scope, 'provider'); + } + if (this.isController(moduleToAdd)) { + throw new invalid_class_module_exception_1.InvalidClassModuleException(moduleDefinition, scope, 'controller'); + } + if (this.isExceptionFilter(moduleToAdd)) { + throw new invalid_class_module_exception_1.InvalidClassModuleException(moduleDefinition, scope, 'filter'); + } + return this.container.addModule(moduleToAdd, scope); + } + async scanModulesForDependencies(modules = this.container.getModules()) { + for (const [token, { metatype }] of modules) { + await this.reflectImports(metatype, token, metatype.name); + this.reflectProviders(metatype, token); + this.reflectControllers(metatype, token); + this.reflectExports(metatype, token); + } + } + async reflectImports(module, token, context) { + const modules = [ + ...this.reflectMetadata(constants_1.MODULE_METADATA.IMPORTS, module), + ...this.container.getDynamicMetadataByToken(token, constants_1.MODULE_METADATA.IMPORTS), + ]; + for (const related of modules) { + await this.insertImport(related, token, context); + } + } + reflectProviders(module, token) { + const providers = [ + ...this.reflectMetadata(constants_1.MODULE_METADATA.PROVIDERS, module), + ...this.container.getDynamicMetadataByToken(token, constants_1.MODULE_METADATA.PROVIDERS), + ]; + providers.forEach(provider => { + this.insertProvider(provider, token); + this.reflectDynamicMetadata(provider, token); + }); + } + reflectControllers(module, token) { + const controllers = [ + ...this.reflectMetadata(constants_1.MODULE_METADATA.CONTROLLERS, module), + ...this.container.getDynamicMetadataByToken(token, constants_1.MODULE_METADATA.CONTROLLERS), + ]; + controllers.forEach(item => { + this.insertController(item, token); + this.reflectDynamicMetadata(item, token); + }); + } + reflectDynamicMetadata(cls, token) { + if (!cls || !cls.prototype) { + return; + } + this.reflectInjectables(cls, token, constants_1.GUARDS_METADATA); + this.reflectInjectables(cls, token, constants_1.INTERCEPTORS_METADATA); + this.reflectInjectables(cls, token, constants_1.EXCEPTION_FILTERS_METADATA); + this.reflectInjectables(cls, token, constants_1.PIPES_METADATA); + this.reflectParamInjectables(cls, token, constants_1.ROUTE_ARGS_METADATA); + } + reflectExports(module, token) { + const exports = [ + ...this.reflectMetadata(constants_1.MODULE_METADATA.EXPORTS, module), + ...this.container.getDynamicMetadataByToken(token, constants_1.MODULE_METADATA.EXPORTS), + ]; + exports.forEach(exportedProvider => this.insertExportedProviderOrModule(exportedProvider, token)); + } + reflectInjectables(component, token, metadataKey) { + const controllerInjectables = this.reflectMetadata(metadataKey, component); + const methodInjectables = this.metadataScanner + .getAllMethodNames(component.prototype) + .reduce((acc, method) => { + const methodInjectable = this.reflectKeyMetadata(component, metadataKey, method); + if (methodInjectable) { + acc.push(methodInjectable); + } + return acc; + }, []); + controllerInjectables.forEach(injectable => this.insertInjectable(injectable, token, component, constants_1.ENHANCER_KEY_TO_SUBTYPE_MAP[metadataKey])); + methodInjectables.forEach(methodInjectable => { + methodInjectable.metadata.forEach(injectable => this.insertInjectable(injectable, token, component, constants_1.ENHANCER_KEY_TO_SUBTYPE_MAP[metadataKey], methodInjectable.methodKey)); + }); + } + reflectParamInjectables(component, token, metadataKey) { + const paramsMethods = this.metadataScanner.getAllMethodNames(component.prototype); + paramsMethods.forEach(methodKey => { + const metadata = Reflect.getMetadata(metadataKey, component, methodKey); + if (!metadata) { + return; + } + const params = Object.values(metadata); + params + .map(item => item.pipes) + .flat(1) + .forEach(injectable => this.insertInjectable(injectable, token, component, 'pipe', methodKey)); + }); + } + reflectKeyMetadata(component, key, methodKey) { + let prototype = component.prototype; + do { + const descriptor = Reflect.getOwnPropertyDescriptor(prototype, methodKey); + if (!descriptor) { + continue; + } + const metadata = Reflect.getMetadata(key, descriptor.value); + if (!metadata) { + return; + } + return { methodKey, metadata }; + } while ((prototype = Reflect.getPrototypeOf(prototype)) && + prototype !== Object.prototype && + prototype); + return undefined; + } + calculateModulesDistance() { + const modulesGenerator = this.container.getModules().values(); + // Skip "InternalCoreModule" + // The second element is the actual root module + modulesGenerator.next(); + const rootModule = modulesGenerator.next().value; + if (!rootModule) { + return; + } + // Convert modules to an acyclic connected graph + const tree = new topology_tree_1.TopologyTree(rootModule); + tree.walk((moduleRef, depth) => { + if (moduleRef.isGlobal) { + return; + } + moduleRef.distance = depth; + }); + } + async insertImport(related, token, context) { + if ((0, shared_utils_1.isUndefined)(related)) { + throw new circular_dependency_exception_1.CircularDependencyException(context); + } + if (this.isForwardReference(related)) { + return this.container.addImport(related.forwardRef(), token); + } + await this.container.addImport(related, token); + } + isCustomProvider(provider) { + return provider && !(0, shared_utils_1.isNil)(provider.provide); + } + insertProvider(provider, token) { + const isCustomProvider = this.isCustomProvider(provider); + if (!isCustomProvider) { + return this.container.addProvider(provider, token); + } + const applyProvidersMap = this.getApplyProvidersMap(); + const providersKeys = Object.keys(applyProvidersMap); + const type = provider.provide; + if (!providersKeys.includes(type)) { + return this.container.addProvider(provider, token); + } + const uuid = uuid_factory_1.UuidFactory.get(type.toString()); + const providerToken = `${type} (UUID: ${uuid})`; + let scope = provider.scope; + if ((0, shared_utils_1.isNil)(scope) && provider.useClass) { + scope = (0, get_class_scope_1.getClassScope)(provider.useClass); + } + this.applicationProvidersApplyMap.push({ + type, + moduleKey: token, + providerKey: providerToken, + scope, + }); + const newProvider = { + ...provider, + provide: providerToken, + scope, + }; + const enhancerSubtype = constants_2.ENHANCER_TOKEN_TO_SUBTYPE_MAP[type]; + const factoryOrClassProvider = newProvider; + if (this.isRequestOrTransient(factoryOrClassProvider.scope)) { + return this.container.addInjectable(newProvider, token, enhancerSubtype); + } + this.container.addProvider(newProvider, token, enhancerSubtype); + } + insertInjectable(injectable, token, host, subtype, methodKey) { + if ((0, shared_utils_1.isFunction)(injectable)) { + const instanceWrapper = this.container.addInjectable(injectable, token, subtype, host); + this.graphInspector.insertEnhancerMetadataCache({ + moduleToken: token, + classRef: host, + enhancerInstanceWrapper: instanceWrapper, + targetNodeId: instanceWrapper.id, + subtype, + methodKey, + }); + return instanceWrapper; + } + else { + this.graphInspector.insertEnhancerMetadataCache({ + moduleToken: token, + classRef: host, + enhancerRef: injectable, + methodKey, + subtype, + }); + } + } + insertExportedProviderOrModule(toExport, token) { + const fulfilledProvider = this.isForwardReference(toExport) + ? toExport.forwardRef() + : toExport; + this.container.addExportedProviderOrModule(fulfilledProvider, token); + } + insertController(controller, token) { + this.container.addController(controller, token); + } + insertOrOverrideModule(moduleDefinition, overrides, scope) { + const overrideModule = this.getOverrideModuleByModule(moduleDefinition, overrides); + if (overrideModule !== undefined) { + return this.overrideModule(moduleDefinition, overrideModule.newModule, scope); + } + return this.insertModule(moduleDefinition, scope); + } + getOverrideModuleByModule(module, overrides) { + if (this.isForwardReference(module)) { + return overrides.find(moduleToOverride => { + return (moduleToOverride.moduleToReplace === module.forwardRef() || + moduleToOverride.moduleToReplace.forwardRef?.() === module.forwardRef()); + }); + } + return overrides.find(moduleToOverride => moduleToOverride.moduleToReplace === module); + } + async overrideModule(moduleToOverride, newModule, scope) { + return this.container.replaceModule(this.isForwardReference(moduleToOverride) + ? moduleToOverride.forwardRef() + : moduleToOverride, this.isForwardReference(newModule) ? newModule.forwardRef() : newModule, scope); + } + reflectMetadata(metadataKey, metatype) { + return Reflect.getMetadata(metadataKey, metatype) || []; + } + async registerCoreModule(overrides) { + const moduleDefinition = internal_core_module_factory_1.InternalCoreModuleFactory.create(this.container, this, this.container.getModuleCompiler(), this.container.getHttpAdapterHostRef(), this.graphInspector, overrides); + const [instance] = await this.scanForModules({ + moduleDefinition, + overrides, + }); + this.container.registerCoreModuleRef(instance); + } + /** + * Add either request or transient globally scoped enhancers + * to all controllers metadata storage + */ + addScopedEnhancersMetadata() { + (0, iterare_1.iterate)(this.applicationProvidersApplyMap) + .filter(wrapper => this.isRequestOrTransient(wrapper.scope)) + .forEach(({ moduleKey, providerKey }) => { + const modulesContainer = this.container.getModules(); + const { injectables } = modulesContainer.get(moduleKey); + const instanceWrapper = injectables.get(providerKey); + const iterableIterator = modulesContainer.values(); + (0, iterare_1.iterate)(iterableIterator) + .map(moduleRef => Array.from(moduleRef.controllers.values()).concat(moduleRef.entryProviders)) + .flatten() + .forEach(controllerOrEntryProvider => controllerOrEntryProvider.addEnhancerMetadata(instanceWrapper)); + }); + } + applyApplicationProviders() { + const applyProvidersMap = this.getApplyProvidersMap(); + const applyRequestProvidersMap = this.getApplyRequestProvidersMap(); + const getInstanceWrapper = (moduleKey, providerKey, collectionKey) => { + const modules = this.container.getModules(); + const collection = modules.get(moduleKey)[collectionKey]; + return collection.get(providerKey); + }; + // Add global enhancers to the application config + this.applicationProvidersApplyMap.forEach(({ moduleKey, providerKey, type, scope }) => { + let instanceWrapper; + if (this.isRequestOrTransient(scope)) { + instanceWrapper = getInstanceWrapper(moduleKey, providerKey, 'injectables'); + this.graphInspector.insertAttachedEnhancer(instanceWrapper); + return applyRequestProvidersMap[type](instanceWrapper); + } + instanceWrapper = getInstanceWrapper(moduleKey, providerKey, 'providers'); + this.graphInspector.insertAttachedEnhancer(instanceWrapper); + applyProvidersMap[type](instanceWrapper.instance); + }); + } + getApplyProvidersMap() { + return { + [constants_2.APP_INTERCEPTOR]: (interceptor) => this.applicationConfig.addGlobalInterceptor(interceptor), + [constants_2.APP_PIPE]: (pipe) => this.applicationConfig.addGlobalPipe(pipe), + [constants_2.APP_GUARD]: (guard) => this.applicationConfig.addGlobalGuard(guard), + [constants_2.APP_FILTER]: (filter) => this.applicationConfig.addGlobalFilter(filter), + }; + } + getApplyRequestProvidersMap() { + return { + [constants_2.APP_INTERCEPTOR]: (interceptor) => this.applicationConfig.addGlobalRequestInterceptor(interceptor), + [constants_2.APP_PIPE]: (pipe) => this.applicationConfig.addGlobalRequestPipe(pipe), + [constants_2.APP_GUARD]: (guard) => this.applicationConfig.addGlobalRequestGuard(guard), + [constants_2.APP_FILTER]: (filter) => this.applicationConfig.addGlobalRequestFilter(filter), + }; + } + isDynamicModule(module) { + return module && !!module.module; + } + /** + * @param metatype + * @returns `true` if `metatype` is annotated with the `@Injectable()` decorator. + */ + isInjectable(metatype) { + return !!Reflect.getMetadata(constants_1.INJECTABLE_WATERMARK, metatype); + } + /** + * @param metatype + * @returns `true` if `metatype` is annotated with the `@Controller()` decorator. + */ + isController(metatype) { + return !!Reflect.getMetadata(constants_1.CONTROLLER_WATERMARK, metatype); + } + /** + * @param metatype + * @returns `true` if `metatype` is annotated with the `@Catch()` decorator. + */ + isExceptionFilter(metatype) { + return !!Reflect.getMetadata(constants_1.CATCH_WATERMARK, metatype); + } + isForwardReference(module) { + return module && !!module.forwardRef; + } + isRequestOrTransient(scope) { + return scope === interfaces_1.Scope.REQUEST || scope === interfaces_1.Scope.TRANSIENT; + } +} +exports.DependenciesScanner = DependenciesScanner; diff --git a/node_modules/@nestjs/core/services/index.d.ts b/node_modules/@nestjs/core/services/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b81014ca8e837564de87553eb223835275c2f16a --- /dev/null +++ b/node_modules/@nestjs/core/services/index.d.ts @@ -0,0 +1 @@ +export * from './reflector.service'; diff --git a/node_modules/@nestjs/core/services/index.js b/node_modules/@nestjs/core/services/index.js new file mode 100644 index 0000000000000000000000000000000000000000..99f6ba9b12730cddf7c67e2a633d02b1ab3b270d --- /dev/null +++ b/node_modules/@nestjs/core/services/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./reflector.service"), exports); diff --git a/node_modules/@nestjs/core/services/reflector.service.d.ts b/node_modules/@nestjs/core/services/reflector.service.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0c989c78cf2e372a1b5efbed69a560699f672669 --- /dev/null +++ b/node_modules/@nestjs/core/services/reflector.service.d.ts @@ -0,0 +1,111 @@ +import { CustomDecorator, Type } from '@nestjs/common'; +/** + * @publicApi + */ +export interface CreateDecoratorOptions { + /** + * The key for the metadata. + * @default uid(21) + */ + key?: string; + /** + * The transform function to apply to the metadata value. + * @default value => value + */ + transform?: (value: TParam) => TTransformed; +} +type CreateDecoratorWithTransformOptions = CreateDecoratorOptions & Required, 'transform'>>; +/** + * @publicApi + */ +export type ReflectableDecorator = ((opts?: TParam) => CustomDecorator) & { + KEY: string; +}; +/** + * Helper class providing Nest reflection capabilities. + * + * @see [Reflection](https://docs.nestjs.com/guards#putting-it-all-together) + * + * @publicApi + */ +export declare class Reflector { + /** + * Creates a decorator that can be used to decorate classes and methods with metadata. + * Can be used as a strongly-typed alternative to `@SetMetadata`. + * @param options Decorator options. + * @returns A decorator function. + */ + static createDecorator(options?: CreateDecoratorOptions): ReflectableDecorator; + static createDecorator(options: CreateDecoratorWithTransformOptions): ReflectableDecorator; + /** + * Retrieve metadata for a reflectable decorator for a specified target. + * + * @example + * `const roles = this.reflector.get(Roles, context.getHandler());` + * + * @param decorator reflectable decorator created through `Reflector.createDecorator` + * @param target context (decorated object) to retrieve metadata from + * + */ + get>(decorator: T, target: Type | Function): T extends ReflectableDecorator ? R : unknown; + /** + * Retrieve metadata for a specified key for a specified target. + * + * @example + * `const roles = this.reflector.get('roles', context.getHandler());` + * + * @param metadataKey lookup key for metadata to retrieve + * @param target context (decorated object) to retrieve metadata from + * + */ + get(metadataKey: TKey, target: Type | Function): TResult; + /** + * Retrieve metadata for a specified decorator for a specified set of targets. + * + * @param decorator lookup decorator for metadata to retrieve + * @param targets context (decorated objects) to retrieve metadata from + * + */ + getAll(decorator: ReflectableDecorator, targets: (Type | Function)[]): TTransformed extends Array ? TTransformed : TTransformed[]; + /** + * Retrieve metadata for a specified key for a specified set of targets. + * + * @param metadataKey lookup key for metadata to retrieve + * @param targets context (decorated objects) to retrieve metadata from + * + */ + getAll(metadataKey: TKey, targets: (Type | Function)[]): TResult; + /** + * Retrieve metadata for a specified decorator for a specified set of targets and merge results. + * + * @param decorator lookup decorator for metadata to retrieve + * @param targets context (decorated objects) to retrieve metadata from + * + */ + getAllAndMerge(decorator: ReflectableDecorator, targets: (Type | Function)[]): TTransformed extends Array ? TTransformed : TTransformed extends object ? TTransformed : TTransformed[]; + /** + * Retrieve metadata for a specified key for a specified set of targets and merge results. + * + * @param metadataKey lookup key for metadata to retrieve + * @param targets context (decorated objects) to retrieve metadata from + * + */ + getAllAndMerge(metadataKey: TKey, targets: (Type | Function)[]): TResult; + /** + * Retrieve metadata for a specified decorator for a specified set of targets and return a first not undefined value. + * + * @param decorator lookup decorator for metadata to retrieve + * @param targets context (decorated objects) to retrieve metadata from + * + */ + getAllAndOverride(decorator: ReflectableDecorator, targets: (Type | Function)[]): TTransformed; + /** + * Retrieve metadata for a specified key for a specified set of targets and return a first not undefined value. + * + * @param metadataKey lookup key for metadata to retrieve + * @param targets context (decorated objects) to retrieve metadata from + * + */ + getAllAndOverride(metadataKey: TKey, targets: (Type | Function)[]): TResult; +} +export {}; diff --git a/node_modules/@nestjs/core/services/reflector.service.js b/node_modules/@nestjs/core/services/reflector.service.js new file mode 100644 index 0000000000000000000000000000000000000000..f0f97f4a60fb9c6ca61c8b262af0283024a61cf0 --- /dev/null +++ b/node_modules/@nestjs/core/services/reflector.service.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Reflector = void 0; +const common_1 = require("@nestjs/common"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const uid_1 = require("uid"); +/** + * Helper class providing Nest reflection capabilities. + * + * @see [Reflection](https://docs.nestjs.com/guards#putting-it-all-together) + * + * @publicApi + */ +class Reflector { + static createDecorator(options = {}) { + const metadataKey = options.key ?? (0, uid_1.uid)(21); + const decoratorFn = (metadataValue) => (target, key, descriptor) => { + const value = options.transform + ? options.transform(metadataValue) + : metadataValue; + (0, common_1.SetMetadata)(metadataKey, value ?? {})(target, key, descriptor); + }; + decoratorFn.KEY = metadataKey; + return decoratorFn; + } + /** + * Retrieve metadata for a specified key or decorator for a specified target. + * + * @example + * `const roles = this.reflector.get('roles', context.getHandler());` + * + * @param metadataKey lookup key or decorator for metadata to retrieve + * @param target context (decorated object) to retrieve metadata from + * + */ + get(metadataKeyOrDecorator, target) { + const metadataKey = metadataKeyOrDecorator.KEY ?? + metadataKeyOrDecorator; + return Reflect.getMetadata(metadataKey, target); + } + /** + * Retrieve metadata for a specified key or decorator for a specified set of targets. + * + * @param metadataKeyOrDecorator lookup key or decorator for metadata to retrieve + * @param targets context (decorated objects) to retrieve metadata from + * + */ + getAll(metadataKeyOrDecorator, targets) { + return (targets || []).map(target => this.get(metadataKeyOrDecorator, target)); + } + /** + * Retrieve metadata for a specified key or decorator for a specified set of targets and merge results. + * + * @param metadataKeyOrDecorator lookup key for metadata to retrieve + * @param targets context (decorated objects) to retrieve metadata from + * + */ + getAllAndMerge(metadataKeyOrDecorator, targets) { + const metadataCollection = this.getAll(metadataKeyOrDecorator, targets).filter(item => item !== undefined); + if ((0, shared_utils_1.isEmpty)(metadataCollection)) { + return metadataCollection; + } + if (metadataCollection.length === 1) { + const value = metadataCollection[0]; + if ((0, shared_utils_1.isObject)(value)) { + return value; + } + return metadataCollection; + } + return metadataCollection.reduce((a, b) => { + if (Array.isArray(a)) { + return a.concat(b); + } + if ((0, shared_utils_1.isObject)(a) && (0, shared_utils_1.isObject)(b)) { + return { + ...a, + ...b, + }; + } + return [a, b]; + }); + } + /** + * Retrieve metadata for a specified key or decorator for a specified set of targets and return a first not undefined value. + * + * @param metadataKeyOrDecorator lookup key or metadata for metadata to retrieve + * @param targets context (decorated objects) to retrieve metadata from + * + */ + getAllAndOverride(metadataKeyOrDecorator, targets) { + for (const target of targets) { + const result = this.get(metadataKeyOrDecorator, target); + if (result !== undefined) { + return result; + } + } + return undefined; + } +} +exports.Reflector = Reflector; diff --git a/node_modules/@nestjs/core/tsconfig.build.json b/node_modules/@nestjs/core/tsconfig.build.json new file mode 100644 index 0000000000000000000000000000000000000000..99c13372dc89891c60a9050b36c61c4b28831c00 --- /dev/null +++ b/node_modules/@nestjs/core/tsconfig.build.json @@ -0,0 +1,21 @@ +{ + "extends": "../tsconfig.build.json", + "compilerOptions": { + "outDir": ".", + "rootDir": ".", + "paths": { + "@nestjs/common": ["../common"], + "@nestjs/common/*": ["../common/*"], + "@nestjs/microservices": ["../microservices"], + "@nestjs/microservices/*": ["../microservices/*"], + "@nestjs/websockets": ["../websockets"], + "@nestjs/websockets/*": ["../websockets/*"] + } + }, + "exclude": ["node_modules", "dist", "test/**/*", "*.spec.ts"], + "references": [ + { + "path": "../common/tsconfig.build.json" + } + ] +} diff --git a/node_modules/@nestjs/mapped-types/.commitlintrc.json b/node_modules/@nestjs/mapped-types/.commitlintrc.json new file mode 100644 index 0000000000000000000000000000000000000000..5c5e64d4b5dcff8303ac084087876c6d6de67d15 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/.commitlintrc.json @@ -0,0 +1,28 @@ +{ + "extends": ["@commitlint/config-angular"], + "rules": { + "subject-case": [ + 2, + "always", + ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"] + ], + "type-enum": [ + 2, + "always", + [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "perf", + "refactor", + "revert", + "style", + "test", + "sample" + ] + ] + } +} diff --git a/node_modules/@nestjs/mapped-types/.husky/commit-msg b/node_modules/@nestjs/mapped-types/.husky/commit-msg new file mode 100644 index 0000000000000000000000000000000000000000..d468455ff37973e47d802d208b74d83cd055387e --- /dev/null +++ b/node_modules/@nestjs/mapped-types/.husky/commit-msg @@ -0,0 +1 @@ +npx --no-install commitlint --edit $1 \ No newline at end of file diff --git a/node_modules/@nestjs/mapped-types/.husky/pre-commit b/node_modules/@nestjs/mapped-types/.husky/pre-commit new file mode 100644 index 0000000000000000000000000000000000000000..40672d9ff32516afd5e6792c3a255c3c31f973c1 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/.husky/pre-commit @@ -0,0 +1 @@ +npx --no-install lint-staged \ No newline at end of file diff --git a/node_modules/@nestjs/mapped-types/.release-it.json b/node_modules/@nestjs/mapped-types/.release-it.json new file mode 100644 index 0000000000000000000000000000000000000000..40451bf9d0f64da0e5a6f5a7690c706017afd92f --- /dev/null +++ b/node_modules/@nestjs/mapped-types/.release-it.json @@ -0,0 +1,8 @@ +{ + "git": { + "commitMessage": "chore(): release v${version}" + }, + "github": { + "release": true + } +} diff --git a/node_modules/@nestjs/mapped-types/LICENSE b/node_modules/@nestjs/mapped-types/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..132cc1d2107da180fcde427bc3daf67123d2eb49 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2020-2022 Kamil Mysliwiec + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/mapped-types/README.md b/node_modules/@nestjs/mapped-types/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7ecfa1bf0a3c249bc723b172eb0ab129c32ae0f2 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/README.md @@ -0,0 +1,67 @@ +

+ Nest Logo +

+ +[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master +[travis-url]: https://travis-ci.org/nestjs/nest +[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux +[linux-url]: https://travis-ci.org/nestjs/nest + +

A progressive Node.js framework for building efficient and scalable server-side applications.

+

+NPM Version +Package License +NPM Downloads +Discord +Backers on Open Collective +Sponsors on Open Collective + + +

+ + +## Description + +Mapped Types module for [Nest](https://github.com/nestjs/nest) used by the `@nestjs/graphql` and `@nestjs/swagger` packages. + +## Installation + +```bash +$ npm i --save @nestjs/mapped-types +``` + +## Quick Start + +As you build out features, it's often useful to construct variants on a base entity type. A good example of such a variant is a **Data Transfer Object** (DTO). A Data Transfer Object is an object that is used to encapsulate data, and send it from one part of your application to another. DTO’s help us define the input and output interfaces of our system. + +Let's imagine a real-world example, where we typically need to build both a **create** and **update** variations for the same entity type. + +The create variant may require all fields, while the update variant may make all fields **optional**. Not to mention, both these types can also be variants of an entity type (to some extent). + +That's a lot of redundant code! + +Thus, [NestJS](https://github.com/nestjs/nest) now provides several utility functions that perform type transformations to help us avoid doing this, and make life a little bit easier. + +Available mapped types: + +- `PartialType` - returns a type (class) with all the properties of the input type set to optional (requirement: at least 1 validation decorator applied to each property) +- `PickType` - constructs a new type (class) by picking a set of properties from an input type +- `OmitType` - constructs a type by picking all properties from an input type and then removing a particular set of keys +- `IntersectionType` - combines two types into one new type (class) + +Read more in [this article](https://trilon.io/blog/introducing-mapped-types-for-nestjs). + +## Support + +Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). + +## Stay in touch + +- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec) +- Website - [https://nestjs.com](https://nestjs.com/) +- Twitter - [@nestframework](https://twitter.com/nestframework) + +## License + +Nest is [MIT licensed](LICENSE). diff --git a/node_modules/@nestjs/mapped-types/dist/index.d.ts b/node_modules/@nestjs/mapped-types/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9fc7f8a38307467e4b0901fc42841eb3c07abcf3 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/index.d.ts @@ -0,0 +1,6 @@ +export * from './intersection-type.helper'; +export * from './mapped-type.interface'; +export * from './omit-type.helper'; +export * from './partial-type.helper'; +export * from './pick-type.helper'; +export { applyIsOptionalDecorator, applyValidateIfDefinedDecorator, inheritPropertyInitializers, inheritTransformationMetadata, inheritValidationMetadata, } from './type-helpers.utils'; diff --git a/node_modules/@nestjs/mapped-types/dist/index.js b/node_modules/@nestjs/mapped-types/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e851f3abedaad8d40d4d34b9e8ed7924373e6c28 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/index.js @@ -0,0 +1,28 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.inheritValidationMetadata = exports.inheritTransformationMetadata = exports.inheritPropertyInitializers = exports.applyValidateIfDefinedDecorator = exports.applyIsOptionalDecorator = void 0; +__exportStar(require("./intersection-type.helper"), exports); +__exportStar(require("./mapped-type.interface"), exports); +__exportStar(require("./omit-type.helper"), exports); +__exportStar(require("./partial-type.helper"), exports); +__exportStar(require("./pick-type.helper"), exports); +var type_helpers_utils_1 = require("./type-helpers.utils"); +Object.defineProperty(exports, "applyIsOptionalDecorator", { enumerable: true, get: function () { return type_helpers_utils_1.applyIsOptionalDecorator; } }); +Object.defineProperty(exports, "applyValidateIfDefinedDecorator", { enumerable: true, get: function () { return type_helpers_utils_1.applyValidateIfDefinedDecorator; } }); +Object.defineProperty(exports, "inheritPropertyInitializers", { enumerable: true, get: function () { return type_helpers_utils_1.inheritPropertyInitializers; } }); +Object.defineProperty(exports, "inheritTransformationMetadata", { enumerable: true, get: function () { return type_helpers_utils_1.inheritTransformationMetadata; } }); +Object.defineProperty(exports, "inheritValidationMetadata", { enumerable: true, get: function () { return type_helpers_utils_1.inheritValidationMetadata; } }); diff --git a/node_modules/@nestjs/mapped-types/dist/intersection-type.helper.d.ts b/node_modules/@nestjs/mapped-types/dist/intersection-type.helper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..159e12d7935a4c80092ee68ae5598e099b37ab69 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/intersection-type.helper.d.ts @@ -0,0 +1,10 @@ +import type { Type } from '@nestjs/common'; +import { MappedType } from './mapped-type.interface'; +import type { RemoveFieldsWithType } from './types/remove-fields-with-type.type'; +type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; +type ClassRefsToConstructors = { + [U in keyof T]: T[U] extends Type ? V : never; +}; +type Intersection = MappedType[number]>, Function>>; +export declare function IntersectionType(...classRefs: T): Intersection; +export {}; diff --git a/node_modules/@nestjs/mapped-types/dist/intersection-type.helper.js b/node_modules/@nestjs/mapped-types/dist/intersection-type.helper.js new file mode 100644 index 0000000000000000000000000000000000000000..0c9369daadef7dc6d29b59a01923c8416b606eff --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/intersection-type.helper.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IntersectionType = IntersectionType; +const type_helpers_utils_1 = require("./type-helpers.utils"); +function IntersectionType(...classRefs) { + class IntersectionClassType { + constructor() { + classRefs.forEach((classRef) => { + (0, type_helpers_utils_1.inheritPropertyInitializers)(this, classRef); + }); + } + } + classRefs.forEach((classRef) => { + (0, type_helpers_utils_1.inheritValidationMetadata)(classRef, IntersectionClassType); + (0, type_helpers_utils_1.inheritTransformationMetadata)(classRef, IntersectionClassType, undefined, false); + }); + const intersectedNames = classRefs.reduce((prev, ref) => prev + ref.name, ''); + Object.defineProperty(IntersectionClassType, 'name', { + value: `Intersection${intersectedNames}`, + }); + return IntersectionClassType; +} diff --git a/node_modules/@nestjs/mapped-types/dist/mapped-type.interface.d.ts b/node_modules/@nestjs/mapped-types/dist/mapped-type.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..abce4cf67294030ac8e3de3be25ae89c328d9e28 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/mapped-type.interface.d.ts @@ -0,0 +1,4 @@ +import type { Type } from '@nestjs/common'; +export interface MappedType extends Type { + new (): T; +} diff --git a/node_modules/@nestjs/mapped-types/dist/mapped-type.interface.js b/node_modules/@nestjs/mapped-types/dist/mapped-type.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/mapped-type.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/mapped-types/dist/omit-type.helper.d.ts b/node_modules/@nestjs/mapped-types/dist/omit-type.helper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..936079e0506cfcae0ee3303a9a7527f22a54bee2 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/omit-type.helper.d.ts @@ -0,0 +1,4 @@ +import type { Type } from '@nestjs/common'; +import type { MappedType } from './mapped-type.interface'; +import type { RemoveFieldsWithType } from './types/remove-fields-with-type.type'; +export declare function OmitType(classRef: Type, keys: readonly K[]): MappedType, Function>>; diff --git a/node_modules/@nestjs/mapped-types/dist/omit-type.helper.js b/node_modules/@nestjs/mapped-types/dist/omit-type.helper.js new file mode 100644 index 0000000000000000000000000000000000000000..df9381c17c486d2df75ae02d6b18fe980f172daa --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/omit-type.helper.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OmitType = OmitType; +const type_helpers_utils_1 = require("./type-helpers.utils"); +function OmitType(classRef, keys) { + const isInheritedPredicate = (propertyKey) => !keys.includes(propertyKey); + class OmitClassType { + constructor() { + (0, type_helpers_utils_1.inheritPropertyInitializers)(this, classRef, isInheritedPredicate); + } + } + (0, type_helpers_utils_1.inheritValidationMetadata)(classRef, OmitClassType, isInheritedPredicate); + (0, type_helpers_utils_1.inheritTransformationMetadata)(classRef, OmitClassType, isInheritedPredicate); + return OmitClassType; +} diff --git a/node_modules/@nestjs/mapped-types/dist/partial-type.helper.d.ts b/node_modules/@nestjs/mapped-types/dist/partial-type.helper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7fd98feea3dd992e91622c07402151f977dae324 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/partial-type.helper.d.ts @@ -0,0 +1,6 @@ +import type { Type } from '@nestjs/common'; +import type { MappedType } from './mapped-type.interface'; +import type { RemoveFieldsWithType } from './types/remove-fields-with-type.type'; +export declare function PartialType(classRef: Type, options?: { + skipNullProperties?: boolean; +}): MappedType, Function>>; diff --git a/node_modules/@nestjs/mapped-types/dist/partial-type.helper.js b/node_modules/@nestjs/mapped-types/dist/partial-type.helper.js new file mode 100644 index 0000000000000000000000000000000000000000..184779b757f0a5259cbb9d8678c8df00dd1248b8 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/partial-type.helper.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PartialType = PartialType; +const type_helpers_utils_1 = require("./type-helpers.utils"); +function PartialType(classRef, options = {}) { + class PartialClassType { + constructor() { + (0, type_helpers_utils_1.inheritPropertyInitializers)(this, classRef); + } + } + const propertyKeys = (0, type_helpers_utils_1.inheritValidationMetadata)(classRef, PartialClassType); + (0, type_helpers_utils_1.inheritTransformationMetadata)(classRef, PartialClassType); + if (propertyKeys) { + propertyKeys.forEach((key) => { + options.skipNullProperties === false + ? (0, type_helpers_utils_1.applyValidateIfDefinedDecorator)(PartialClassType, key) + : (0, type_helpers_utils_1.applyIsOptionalDecorator)(PartialClassType, key); + }); + } + Object.defineProperty(PartialClassType, 'name', { + value: `Partial${classRef.name}`, + }); + return PartialClassType; +} diff --git a/node_modules/@nestjs/mapped-types/dist/pick-type.helper.d.ts b/node_modules/@nestjs/mapped-types/dist/pick-type.helper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bbfbd38962bf8343b5ddaeb9ea78cc8ea64f7910 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/pick-type.helper.d.ts @@ -0,0 +1,4 @@ +import type { Type } from '@nestjs/common'; +import type { MappedType } from './mapped-type.interface'; +import type { RemoveFieldsWithType } from './types/remove-fields-with-type.type'; +export declare function PickType(classRef: Type, keys: readonly K[]): MappedType, Function>>; diff --git a/node_modules/@nestjs/mapped-types/dist/pick-type.helper.js b/node_modules/@nestjs/mapped-types/dist/pick-type.helper.js new file mode 100644 index 0000000000000000000000000000000000000000..9139d2429b83e772a789248ec2f33f31da2c5b27 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/pick-type.helper.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PickType = PickType; +const type_helpers_utils_1 = require("./type-helpers.utils"); +function PickType(classRef, keys) { + const isInheritedPredicate = (propertyKey) => keys.includes(propertyKey); + class PickClassType { + constructor() { + (0, type_helpers_utils_1.inheritPropertyInitializers)(this, classRef, isInheritedPredicate); + } + } + (0, type_helpers_utils_1.inheritValidationMetadata)(classRef, PickClassType, isInheritedPredicate); + (0, type_helpers_utils_1.inheritTransformationMetadata)(classRef, PickClassType, isInheritedPredicate); + return PickClassType; +} diff --git a/node_modules/@nestjs/mapped-types/dist/type-helpers.utils.d.ts b/node_modules/@nestjs/mapped-types/dist/type-helpers.utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..99681f2f60f21431770fe76d52b523cf70f70b1a --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/type-helpers.utils.d.ts @@ -0,0 +1,6 @@ +import { type Type } from '@nestjs/common'; +export declare function applyIsOptionalDecorator(targetClass: Function, propertyKey: string): void; +export declare function applyValidateIfDefinedDecorator(targetClass: Function, propertyKey: string): void; +export declare function inheritValidationMetadata(parentClass: Type, targetClass: Function, isPropertyInherited?: (key: string) => boolean): string[] | undefined; +export declare function inheritTransformationMetadata(parentClass: Type, targetClass: Function, isPropertyInherited?: (key: string) => boolean, stackDecorators?: boolean): void; +export declare function inheritPropertyInitializers(target: Record, sourceClass: Type, isPropertyInherited?: (key: string) => boolean): void; diff --git a/node_modules/@nestjs/mapped-types/dist/type-helpers.utils.js b/node_modules/@nestjs/mapped-types/dist/type-helpers.utils.js new file mode 100644 index 0000000000000000000000000000000000000000..022378a66b9dcdf6cd2f29b207566b3602818240 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/type-helpers.utils.js @@ -0,0 +1,156 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.applyIsOptionalDecorator = applyIsOptionalDecorator; +exports.applyValidateIfDefinedDecorator = applyValidateIfDefinedDecorator; +exports.inheritValidationMetadata = inheritValidationMetadata; +exports.inheritTransformationMetadata = inheritTransformationMetadata; +exports.inheritPropertyInitializers = inheritPropertyInitializers; +const common_1 = require("@nestjs/common"); +const logger = new common_1.Logger('MappedTypes'); +function applyIsOptionalDecorator(targetClass, propertyKey) { + if (!isClassValidatorAvailable()) { + return; + } + const classValidator = require('class-validator'); + const decoratorFactory = classValidator.IsOptional(); + decoratorFactory(targetClass.prototype, propertyKey); +} +function applyValidateIfDefinedDecorator(targetClass, propertyKey) { + if (!isClassValidatorAvailable()) { + return; + } + const classValidator = require('class-validator'); + const decoratorFactory = classValidator.ValidateIf((_, value) => value !== undefined); + decoratorFactory(targetClass.prototype, propertyKey); +} +function inheritValidationMetadata(parentClass, targetClass, isPropertyInherited) { + if (!isClassValidatorAvailable()) { + return; + } + try { + const classValidator = require('class-validator'); + const metadataStorage = classValidator.getMetadataStorage + ? classValidator.getMetadataStorage() + : classValidator.getFromContainer(classValidator.MetadataStorage); + const getTargetValidationMetadatasArgs = [parentClass, null, false, false]; + const targetMetadata = metadataStorage.getTargetValidationMetadatas(...getTargetValidationMetadatasArgs); + return targetMetadata + .filter(({ propertyName }) => !isPropertyInherited || isPropertyInherited(propertyName)) + .map((value) => { + const originalType = Reflect.getMetadata('design:type', parentClass.prototype, value.propertyName); + if (originalType) { + Reflect.defineMetadata('design:type', originalType, targetClass.prototype, value.propertyName); + } + metadataStorage.addValidationMetadata({ + ...value, + target: targetClass, + }); + return value.propertyName; + }); + } + catch (err) { + logger.error(`Validation ("class-validator") metadata cannot be inherited for "${parentClass.name}" class.`); + logger.error(err); + } +} +function inheritTransformationMetadata(parentClass, targetClass, isPropertyInherited, stackDecorators = true) { + if (!isClassTransformerAvailable()) { + return; + } + try { + const transformMetadataKeys = [ + '_excludeMetadatas', + '_exposeMetadatas', + '_transformMetadatas', + '_typeMetadatas', + ]; + transformMetadataKeys.forEach((key) => inheritTransformerMetadata(key, parentClass, targetClass, isPropertyInherited, stackDecorators)); + } + catch (err) { + logger.error(`Transformer ("class-transformer") metadata cannot be inherited for "${parentClass.name}" class.`); + logger.error(err); + } +} +function inheritTransformerMetadata(key, parentClass, targetClass, isPropertyInherited, stackDecorators = true) { + let classTransformer; + try { + classTransformer = require('class-transformer/cjs/storage'); + } + catch { + classTransformer = require('class-transformer/storage'); + } + const metadataStorage = classTransformer.defaultMetadataStorage; + while (parentClass && parentClass !== Object) { + if (metadataStorage[key].has(parentClass)) { + const metadataMap = metadataStorage[key]; + const parentMetadata = metadataMap.get(parentClass); + const targetMetadataEntries = Array.from(parentMetadata.entries()) + .filter(([key]) => !isPropertyInherited || isPropertyInherited(key)) + .map(([key, metadata]) => { + if (Array.isArray(metadata)) { + const targetMetadata = metadata.map((item) => ({ + ...item, + target: targetClass, + })); + return [key, targetMetadata]; + } + return [key, { ...metadata, target: targetClass }]; + }); + if (metadataMap.has(targetClass)) { + const existingRules = metadataMap.get(targetClass).entries(); + const mergeMap = new Map(); + [existingRules, targetMetadataEntries].forEach((entries) => { + for (const [valueKey, value] of entries) { + if (mergeMap.has(valueKey) && stackDecorators) { + const parentValue = mergeMap.get(valueKey); + if (Array.isArray(parentValue)) { + parentValue.push(...(Array.isArray(value) ? value : [value])); + } + } + else { + mergeMap.set(valueKey, value); + } + } + }); + metadataMap.set(targetClass, mergeMap); + } + else { + metadataMap.set(targetClass, new Map(targetMetadataEntries)); + } + } + parentClass = Object.getPrototypeOf(parentClass); + } +} +function isClassValidatorAvailable() { + try { + require('class-validator'); + return true; + } + catch { + return false; + } +} +function isClassTransformerAvailable() { + try { + require('class-transformer'); + return true; + } + catch { + return false; + } +} +function inheritPropertyInitializers(target, sourceClass, isPropertyInherited = (key) => true) { + try { + const tempInstance = new sourceClass(); + const propertyNames = Object.getOwnPropertyNames(tempInstance); + propertyNames + .filter((propertyName) => typeof tempInstance[propertyName] !== 'undefined' && + typeof target[propertyName] === 'undefined') + .filter((propertyName) => isPropertyInherited(propertyName)) + .forEach((propertyName) => { + target[propertyName] = tempInstance[propertyName]; + }); + } + catch { + } +} diff --git a/node_modules/@nestjs/mapped-types/dist/types/remove-fields-with-type.type.d.ts b/node_modules/@nestjs/mapped-types/dist/types/remove-fields-with-type.type.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6c4aa47b011ee7dfd098ff8df708a373216aa750 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/types/remove-fields-with-type.type.d.ts @@ -0,0 +1,5 @@ +type KeysWithType = { + [K in keyof T]: T[K] extends Type ? K : never; +}[keyof T]; +export type RemoveFieldsWithType = Exclude>; +export {}; diff --git a/node_modules/@nestjs/mapped-types/dist/types/remove-fields-with-type.type.js b/node_modules/@nestjs/mapped-types/dist/types/remove-fields-with-type.type.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/mapped-types/dist/types/remove-fields-with-type.type.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/mapped-types/eslint.config.mjs b/node_modules/@nestjs/mapped-types/eslint.config.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1b519d62e6e7e3c6c624ddb5a156b327c273d835 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/eslint.config.mjs @@ -0,0 +1,41 @@ +// @ts-check +import eslint from '@eslint/js'; +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + { + ignores: ['tests/**'], + }, + eslint.configs.recommended, + ...tseslint.configs.recommendedTypeChecked, + eslintPluginPrettierRecommended, + { + languageOptions: { + globals: { + ...globals.node, + ...globals.jest, + }, + ecmaVersion: 5, + sourceType: 'module', + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + }, + { + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-function-type': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-require-imports': 'off', + '@typescript-eslint/no-unused-expressions': 'warn' + }, + }, +); \ No newline at end of file diff --git a/node_modules/@nestjs/mapped-types/index.d.ts b/node_modules/@nestjs/mapped-types/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5703fb5fd91d469d02795eb9390041c8845eebc7 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/index.d.ts @@ -0,0 +1 @@ +export * from './dist'; diff --git a/node_modules/@nestjs/mapped-types/index.js b/node_modules/@nestjs/mapped-types/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9368dd3979a0d265657029b7376ac7db8358ab0f --- /dev/null +++ b/node_modules/@nestjs/mapped-types/index.js @@ -0,0 +1,6 @@ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +exports.__esModule = true; +__export(require("./dist")); diff --git a/node_modules/@nestjs/mapped-types/package.json b/node_modules/@nestjs/mapped-types/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a4a93038396405a7b112299270402fe6b6a14604 --- /dev/null +++ b/node_modules/@nestjs/mapped-types/package.json @@ -0,0 +1,68 @@ +{ + "name": "@nestjs/mapped-types", + "version": "2.1.1", + "description": "Nest - modern, fast, powerful node.js web framework (@mapped-types)", + "author": "Kamil Mysliwiec", + "license": "MIT", + "url": "https://github.com/nestjs/mapped-types#readme", + "scripts": { + "build": "rimraf -rf dist && tsc -p tsconfig.json", + "lint": "eslint 'lib/**/*.ts' --fix", + "format": "prettier \"{lib,tests}/**/*.ts\" --write", + "prepublish:npm": "npm run build", + "publish:npm": "npm publish --access public", + "prepublish:next": "npm run build", + "publish:next": "npm publish --access public --tag next", + "test:e2e": "jest --config ./tests/jest-e2e.json --runInBand", + "test:e2e:dev": "jest --config ./tests/jest-e2e.json --runInBand --watch", + "prerelease": "npm run build", + "release": "release-it", + "prepare": "husky" + }, + "devDependencies": { + "@commitlint/cli": "20.5.0", + "@commitlint/config-angular": "20.5.0", + "@eslint/eslintrc": "3.3.5", + "@eslint/js": "10.0.1", + "@nestjs/common": "11.1.17", + "@types/jest": "30.0.0", + "@types/node": "24.12.0", + "class-transformer": "0.5.1", + "class-validator": "0.15.1", + "eslint": "10.1.0", + "eslint-config-prettier": "10.1.8", + "eslint-plugin-prettier": "5.5.5", + "globals": "17.4.0", + "husky": "9.1.7", + "jest": "30.3.0", + "lint-staged": "16.4.0", + "prettier": "3.8.1", + "reflect-metadata": "0.2.2", + "release-it": "19.2.4", + "rimraf": "6.1.3", + "ts-jest": "29.4.6", + "typescript": "5.9.3", + "typescript-eslint": "8.57.2" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0 || ^11.0.0", + "class-transformer": "^0.4.0 || ^0.5.0", + "class-validator": "^0.13.0 || ^0.14.0 || ^0.15.0", + "reflect-metadata": "^0.1.12 || ^0.2.0" + }, + "peerDependenciesMeta": { + "class-validator": { + "optional": true + }, + "class-transformer": { + "optional": true + } + }, + "lint-staged": { + "**/*.{ts,json}": [] + }, + "repository": { + "type": "git", + "url": "https://github.com/nestjs/mapped-types" + } +} diff --git a/node_modules/@nestjs/platform-express/LICENSE b/node_modules/@nestjs/platform-express/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d209764d20a03be35896a1ad8ebf6aba30bc7172 --- /dev/null +++ b/node_modules/@nestjs/platform-express/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2017-present Kamil Mysliwiec + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/Readme.md b/node_modules/@nestjs/platform-express/Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..d1631aae1b84b50b74ce4464d1c55dc12837e497 --- /dev/null +++ b/node_modules/@nestjs/platform-express/Readme.md @@ -0,0 +1,150 @@ +

+ Nest Logo +

+ +[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 +[circleci-url]: https://circleci.com/gh/nestjs/nest + +

A progressive Node.js framework for building efficient and scalable server-side applications.

+

+NPM Version +Package License +NPM Downloads +CircleCI +Discord +Backers on Open Collective +Sponsors on Open Collective + + Support us + +

+ + +## Description + +Nest is a framework for building efficient, scalable Node.js server-side applications. It uses modern JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming). + +

Under the hood, Nest makes use of Express, but also provides compatibility with a wide range of other libraries, like Fastify, allowing for easy use of the myriad of third-party plugins which are available.

+ +## Philosophy + +

In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front-end and back-end applications, giving rise to awesome projects like Angular, React, and Vue, which improve developer productivity and enable the construction of fast, testable, and extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers, and tools for Node, none of them effectively solve the main problem - the architecture.

+

Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, and loosely coupled and easily maintainable applications. The architecture is heavily inspired by Angular.

+ +## Getting started + +- To check out the [guide](https://docs.nestjs.com), visit [docs.nestjs.com](https://docs.nestjs.com). :books: +- 要查看中文 [指南](readme_zh.md), 请访问 [docs.nestjs.cn](https://docs.nestjs.cn). :books: +- [가이드](readme_kr.md) 문서는 [docs.nestjs.com](https://docs.nestjs.com)에서 확인하실 수 있습니다. :books: +- [ガイド](readme_jp.md)は [docs.nestjs.com](https://docs.nestjs.com)でご確認ください。 :books: + +## Questions + +For questions and support please use the official [Discord channel](https://discord.gg/G7Qnnhy). The issue list of this repo is **exclusively** for bug reports and feature requests. + +## Issues + +Please make sure to read the [Issue Reporting Checklist](https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md#-submitting-an-issue) before opening an issue. Issues not conforming to the guidelines may be closed immediately. + +## Consulting + +With official support, you can get expert help straight from the Nest core team. We provide dedicated technical support, migration strategies, advice on best practices (and design decisions), PR reviews, and team augmentation. Read more about [support here](https://enterprise.nestjs.com). + +## Support + +Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support from the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). + +#### Principal Sponsors + + + + + + + + + +
+ +#### Gold Sponsors + + + + + + + + + + + + + +
+ +#### Silver Sponsors + + + + + + + + + + + + + + + +
+ +#### Sponsors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +## Backers + + + +## Stay in touch + +- Author - [Kamil Myśliwiec](https://x.com/kammysliwiec) +- Website - [https://nestjs.com](https://nestjs.com/) +- X - [@nestframework](https://x.com/nestframework) + +## License + +Nest is [MIT licensed](LICENSE). diff --git a/node_modules/@nestjs/platform-express/adapters/express-adapter.d.ts b/node_modules/@nestjs/platform-express/adapters/express-adapter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6805d974c71f8b04f25382153bbcb6c05100d2b8 --- /dev/null +++ b/node_modules/@nestjs/platform-express/adapters/express-adapter.d.ts @@ -0,0 +1,65 @@ +import { RequestMethod, VersioningOptions } from '@nestjs/common'; +import { VersionValue } from '@nestjs/common/interfaces'; +import { CorsOptions, CorsOptionsDelegate } from '@nestjs/common/interfaces/external/cors-options.interface'; +import { NestApplicationOptions } from '@nestjs/common/interfaces/nest-application-options.interface'; +import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter'; +import * as express from 'express'; +import type { Server } from 'http'; +import * as http from 'http'; +import * as https from 'https'; +import { NestExpressBodyParserOptions } from '../interfaces/nest-express-body-parser-options.interface'; +import { NestExpressBodyParserType } from '../interfaces/nest-express-body-parser.interface'; +import { ServeStaticOptions } from '../interfaces/serve-static-options.interface'; +type VersionedRoute = = any, TResponse = any>(req: TRequest, res: TResponse, next: () => void) => any; +/** + * @publicApi + */ +export declare class ExpressAdapter extends AbstractHttpAdapter { + private readonly routerMethodFactory; + private readonly logger; + private readonly openConnections; + private onRequestHook?; + private onResponseHook?; + constructor(instance?: any); + setOnRequestHook(onRequestHook: (req: express.Request, res: express.Response, done: () => void) => Promise | void): void; + setOnResponseHook(onResponseHook: (req: express.Request, res: express.Response) => Promise | void): void; + reply(response: any, body: any, statusCode?: number): any; + status(response: any, statusCode: number): any; + end(response: any, message?: string): any; + render(response: any, view: string, options: any): any; + redirect(response: any, statusCode: number, url: string): any; + setErrorHandler(handler: Function, prefix?: string): any; + setNotFoundHandler(handler: Function, prefix?: string): any; + isHeadersSent(response: any): boolean; + getHeader(response: any, name: string): any; + setHeader(response: any, name: string, value: string): any; + appendHeader(response: any, name: string, value: string): any; + normalizePath(path: string): string; + listen(port: string | number, callback?: () => void): Server; + listen(port: string | number, hostname: string, callback?: () => void): Server; + close(): Promise | undefined; + set(...args: any[]): any; + enable(...args: any[]): any; + disable(...args: any[]): any; + engine(...args: any[]): any; + useStaticAssets(path: string, options: ServeStaticOptions): any; + setBaseViewsDir(path: string | string[]): any; + setViewEngine(engine: string): any; + getRequestHostname(request: any): string; + getRequestMethod(request: any): string; + getRequestUrl(request: any): string; + enableCors(options: CorsOptions | CorsOptionsDelegate): any; + createMiddlewareFactory(requestMethod: RequestMethod): (path: string, callback: Function) => any; + initHttpServer(options: NestApplicationOptions): void; + registerParserMiddleware(prefix?: string, rawBody?: boolean): void; + useBodyParser(type: NestExpressBodyParserType, rawBody: boolean, options?: Omit): this; + setLocal(key: string, value: any): this; + getType(): string; + applyVersionFilter(handler: Function, version: VersionValue, versioningOptions: VersioningOptions): VersionedRoute; + private trackOpenConnections; + private closeOpenConnections; + private isMiddlewareApplied; + private setHeaderIfNotExists; + private applyStreamHeaders; +} +export {}; diff --git a/node_modules/@nestjs/platform-express/adapters/express-adapter.js b/node_modules/@nestjs/platform-express/adapters/express-adapter.js new file mode 100644 index 0000000000000000000000000000000000000000..28337210328a189d764fd9c92fc4def149c7530d --- /dev/null +++ b/node_modules/@nestjs/platform-express/adapters/express-adapter.js @@ -0,0 +1,355 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExpressAdapter = void 0; +const common_1 = require("@nestjs/common"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const http_adapter_1 = require("@nestjs/core/adapters/http-adapter"); +const router_method_factory_1 = require("@nestjs/core/helpers/router-method-factory"); +const legacy_route_converter_1 = require("@nestjs/core/router/legacy-route-converter"); +const cors = require("cors"); +const express = require("express"); +const http = require("http"); +const https = require("https"); +const path_to_regexp_1 = require("path-to-regexp"); +const get_body_parser_options_util_1 = require("./utils/get-body-parser-options.util"); +/** + * @publicApi + */ +class ExpressAdapter extends http_adapter_1.AbstractHttpAdapter { + constructor(instance) { + super(instance || express()); + this.routerMethodFactory = new router_method_factory_1.RouterMethodFactory(); + this.logger = new common_1.Logger(ExpressAdapter.name); + this.openConnections = new Set(); + this.instance.use((req, res, next) => { + if (this.onResponseHook) { + res.on('finish', () => { + void this.onResponseHook.apply(this, [req, res]); + }); + } + if (this.onRequestHook) { + void this.onRequestHook.apply(this, [req, res, next]); + } + else { + next(); + } + }); + } + setOnRequestHook(onRequestHook) { + this.onRequestHook = onRequestHook; + } + setOnResponseHook(onResponseHook) { + this.onResponseHook = onResponseHook; + } + reply(response, body, statusCode) { + if (statusCode) { + response.status(statusCode); + } + if ((0, shared_utils_1.isNil)(body)) { + return response.send(); + } + if (body instanceof common_1.StreamableFile) { + this.applyStreamHeaders(response, body); + const stream = body.getStream(); + stream.once('error', err => { + body.errorHandler(err, response); + }); + return stream + .pipe(response) + .on('error', (err) => body.errorLogger(err)); + } + const responseContentType = response.getHeader('Content-Type'); + if (typeof responseContentType === 'string' && + !responseContentType.startsWith('application/json') && + body?.statusCode >= common_1.HttpStatus.BAD_REQUEST) { + this.logger.warn("Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses"); + response.setHeader('Content-Type', 'application/json'); + } + return (0, shared_utils_1.isObject)(body) ? response.json(body) : response.send(String(body)); + } + status(response, statusCode) { + return response.status(statusCode); + } + end(response, message) { + return response.end(message); + } + render(response, view, options) { + return response.render(view, options); + } + redirect(response, statusCode, url) { + return response.redirect(statusCode, url); + } + setErrorHandler(handler, prefix) { + return this.use(handler); + } + setNotFoundHandler(handler, prefix) { + return this.use(handler); + } + isHeadersSent(response) { + return response.headersSent; + } + getHeader(response, name) { + return response.get(name); + } + setHeader(response, name, value) { + return response.set(name, value); + } + appendHeader(response, name, value) { + return response.append(name, value); + } + normalizePath(path) { + try { + const convertedPath = legacy_route_converter_1.LegacyRouteConverter.tryConvert(path); + // Call "pathToRegexp" to trigger a TypeError if the path is invalid + (0, path_to_regexp_1.pathToRegexp)(convertedPath); + return convertedPath; + } + catch (e) { + if (e instanceof TypeError) { + legacy_route_converter_1.LegacyRouteConverter.printError(path); + } + throw e; + } + } + listen(port, ...args) { + return this.httpServer.listen(port, ...args); + } + close() { + this.closeOpenConnections(); + if (!this.httpServer) { + return undefined; + } + return new Promise(resolve => this.httpServer.close(resolve)); + } + set(...args) { + return this.instance.set(...args); + } + enable(...args) { + return this.instance.enable(...args); + } + disable(...args) { + return this.instance.disable(...args); + } + engine(...args) { + return this.instance.engine(...args); + } + useStaticAssets(path, options) { + if (options && options.prefix) { + return this.use(options.prefix, express.static(path, options)); + } + return this.use(express.static(path, options)); + } + setBaseViewsDir(path) { + return this.set('views', path); + } + setViewEngine(engine) { + return this.set('view engine', engine); + } + getRequestHostname(request) { + return request.hostname; + } + getRequestMethod(request) { + return request.method; + } + getRequestUrl(request) { + return request.originalUrl; + } + enableCors(options) { + return this.use(cors(options)); + } + createMiddlewareFactory(requestMethod) { + return (path, callback) => { + try { + const convertedPath = legacy_route_converter_1.LegacyRouteConverter.tryConvert(path); + return this.routerMethodFactory + .get(this.instance, requestMethod) + .call(this.instance, convertedPath, callback); + } + catch (e) { + if (e instanceof TypeError) { + legacy_route_converter_1.LegacyRouteConverter.printError(path); + } + throw e; + } + }; + } + initHttpServer(options) { + const isHttpsEnabled = options && options.httpsOptions; + if (isHttpsEnabled) { + this.httpServer = https.createServer(options.httpsOptions, this.getInstance()); + } + else { + this.httpServer = http.createServer(this.getInstance()); + } + if (options?.forceCloseConnections) { + this.trackOpenConnections(); + } + } + registerParserMiddleware(prefix, rawBody) { + const bodyParserJsonOptions = (0, get_body_parser_options_util_1.getBodyParserOptions)(rawBody); + const bodyParserUrlencodedOptions = (0, get_body_parser_options_util_1.getBodyParserOptions)(rawBody, { + extended: true, + }); + const parserMiddleware = { + jsonParser: express.json(bodyParserJsonOptions), + urlencodedParser: express.urlencoded(bodyParserUrlencodedOptions), + }; + Object.keys(parserMiddleware) + .filter(parser => !this.isMiddlewareApplied(parser)) + .forEach(parserKey => this.use(parserMiddleware[parserKey])); + } + useBodyParser(type, rawBody, options) { + const parserOptions = (0, get_body_parser_options_util_1.getBodyParserOptions)(rawBody, options); + const parser = express[type](parserOptions); + this.use(parser); + return this; + } + setLocal(key, value) { + this.instance.locals[key] = value; + return this; + } + getType() { + return 'express'; + } + applyVersionFilter(handler, version, versioningOptions) { + const callNextHandler = (req, res, next) => { + if (!next) { + throw new common_1.InternalServerErrorException('HTTP adapter does not support filtering on version'); + } + return next(); + }; + if (version === common_1.VERSION_NEUTRAL || + // URL Versioning is done via the path, so the filter continues forward + versioningOptions.type === common_1.VersioningType.URI) { + const handlerForNoVersioning = (req, res, next) => handler(req, res, next); + return handlerForNoVersioning; + } + // Custom Extractor Versioning Handler + if (versioningOptions.type === common_1.VersioningType.CUSTOM) { + const handlerForCustomVersioning = (req, res, next) => { + const extractedVersion = versioningOptions.extractor(req); + if (Array.isArray(version)) { + if (Array.isArray(extractedVersion) && + version.filter(v => extractedVersion.includes(v)).length) { + return handler(req, res, next); + } + if ((0, shared_utils_1.isString)(extractedVersion) && + version.includes(extractedVersion)) { + return handler(req, res, next); + } + } + else if ((0, shared_utils_1.isString)(version)) { + // Known bug here - if there are multiple versions supported across separate + // handlers/controllers, we can't select the highest matching handler. + // Since this code is evaluated per-handler, then we can't see if the highest + // specified version exists in a different handler. + if (Array.isArray(extractedVersion) && + extractedVersion.includes(version)) { + return handler(req, res, next); + } + if ((0, shared_utils_1.isString)(extractedVersion) && version === extractedVersion) { + return handler(req, res, next); + } + } + return callNextHandler(req, res, next); + }; + return handlerForCustomVersioning; + } + // Media Type (Accept Header) Versioning Handler + if (versioningOptions.type === common_1.VersioningType.MEDIA_TYPE) { + const handlerForMediaTypeVersioning = (req, res, next) => { + const MEDIA_TYPE_HEADER = 'Accept'; + const acceptHeaderValue = req.headers?.[MEDIA_TYPE_HEADER] || + req.headers?.[MEDIA_TYPE_HEADER.toLowerCase()]; + const acceptHeaderVersionParameter = acceptHeaderValue + ? acceptHeaderValue.split(';')[1] + : undefined; + // No version was supplied + if ((0, shared_utils_1.isUndefined)(acceptHeaderVersionParameter)) { + if (Array.isArray(version)) { + if (version.includes(common_1.VERSION_NEUTRAL)) { + return handler(req, res, next); + } + } + } + else { + const headerVersion = acceptHeaderVersionParameter.split(versioningOptions.key)[1]; + if (Array.isArray(version)) { + if (version.includes(headerVersion)) { + return handler(req, res, next); + } + } + else if ((0, shared_utils_1.isString)(version)) { + if (version === headerVersion) { + return handler(req, res, next); + } + } + } + return callNextHandler(req, res, next); + }; + return handlerForMediaTypeVersioning; + } + // Header Versioning Handler + if (versioningOptions.type === common_1.VersioningType.HEADER) { + const handlerForHeaderVersioning = (req, res, next) => { + const customHeaderVersionParameter = req.headers?.[versioningOptions.header] || + req.headers?.[versioningOptions.header.toLowerCase()]; + // No version was supplied + if ((0, shared_utils_1.isUndefined)(customHeaderVersionParameter)) { + if (Array.isArray(version)) { + if (version.includes(common_1.VERSION_NEUTRAL)) { + return handler(req, res, next); + } + } + } + else { + if (Array.isArray(version)) { + if (version.includes(customHeaderVersionParameter)) { + return handler(req, res, next); + } + } + else if ((0, shared_utils_1.isString)(version)) { + if (version === customHeaderVersionParameter) { + return handler(req, res, next); + } + } + } + return callNextHandler(req, res, next); + }; + return handlerForHeaderVersioning; + } + throw new Error('Unsupported versioning options'); + } + trackOpenConnections() { + this.httpServer.on('connection', (socket) => { + this.openConnections.add(socket); + socket.on('close', () => this.openConnections.delete(socket)); + }); + } + closeOpenConnections() { + for (const socket of this.openConnections) { + socket.destroy(); + this.openConnections.delete(socket); + } + } + isMiddlewareApplied(name) { + const app = this.getInstance(); + return (!!app.router && + !!app.router.stack && + (0, shared_utils_1.isFunction)(app.router.stack.filter) && + app.router.stack.some((layer) => layer && layer.handle && layer.handle.name === name)); + } + setHeaderIfNotExists(response, name, value) { + if (value !== undefined && response.getHeader(name) === undefined) { + const headerValue = Array.isArray(value) ? value.join(',') : value; + response.setHeader(name, headerValue); + } + } + applyStreamHeaders(response, streamable) { + const headers = streamable.getHeaders(); + this.setHeaderIfNotExists(response, 'Content-Type', headers.type); + this.setHeaderIfNotExists(response, 'Content-Disposition', headers.disposition); + this.setHeaderIfNotExists(response, 'Content-Length', headers.length); + } +} +exports.ExpressAdapter = ExpressAdapter; diff --git a/node_modules/@nestjs/platform-express/adapters/index.d.ts b/node_modules/@nestjs/platform-express/adapters/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3644487c623ce9d8c23377984f9236f5e886986b --- /dev/null +++ b/node_modules/@nestjs/platform-express/adapters/index.d.ts @@ -0,0 +1 @@ +export * from './express-adapter'; diff --git a/node_modules/@nestjs/platform-express/adapters/index.js b/node_modules/@nestjs/platform-express/adapters/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a3797955fd2b40129106442da08cea13551a377c --- /dev/null +++ b/node_modules/@nestjs/platform-express/adapters/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./express-adapter"), exports); diff --git a/node_modules/@nestjs/platform-express/adapters/utils/get-body-parser-options.util.d.ts b/node_modules/@nestjs/platform-express/adapters/utils/get-body-parser-options.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6f4d9cf85078b7cf3da71c1f6d3b431c3e21f138 --- /dev/null +++ b/node_modules/@nestjs/platform-express/adapters/utils/get-body-parser-options.util.d.ts @@ -0,0 +1,2 @@ +import type { NestExpressBodyParserOptions } from '../../interfaces'; +export declare function getBodyParserOptions(rawBody: boolean, options?: Omit): Options; diff --git a/node_modules/@nestjs/platform-express/adapters/utils/get-body-parser-options.util.js b/node_modules/@nestjs/platform-express/adapters/utils/get-body-parser-options.util.js new file mode 100644 index 0000000000000000000000000000000000000000..6d060f50bbf0ed8dc27e9b6836e09b2268dacbf7 --- /dev/null +++ b/node_modules/@nestjs/platform-express/adapters/utils/get-body-parser-options.util.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getBodyParserOptions = getBodyParserOptions; +const rawBodyParser = (req, _res, buffer) => { + if (Buffer.isBuffer(buffer)) { + req.rawBody = buffer; + } + return true; +}; +function getBodyParserOptions(rawBody, options) { + let parserOptions = (options || {}); + if (rawBody === true) { + parserOptions = { + ...parserOptions, + verify: rawBodyParser, + }; + } + return parserOptions; +} diff --git a/node_modules/@nestjs/platform-express/index.d.ts b/node_modules/@nestjs/platform-express/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..604e6cb1d1123c3e5419173180ebf12d7b98d1de --- /dev/null +++ b/node_modules/@nestjs/platform-express/index.d.ts @@ -0,0 +1,3 @@ +export * from './adapters'; +export * from './interfaces'; +export * from './multer'; diff --git a/node_modules/@nestjs/platform-express/index.js b/node_modules/@nestjs/platform-express/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d6ae1b78c2f89b33d4c70b0a114370eea309de94 --- /dev/null +++ b/node_modules/@nestjs/platform-express/index.js @@ -0,0 +1,12 @@ +"use strict"; +/* + * Nest @platform-express + * Copyright(c) 2017 - 2025 Kamil Mysliwiec + * https://nestjs.com + * MIT Licensed + */ +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./adapters"), exports); +tslib_1.__exportStar(require("./interfaces"), exports); +tslib_1.__exportStar(require("./multer"), exports); diff --git a/node_modules/@nestjs/platform-express/interfaces/index.d.ts b/node_modules/@nestjs/platform-express/interfaces/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ac057435a0920c02a9c84dc5c689047ded3c5bbc --- /dev/null +++ b/node_modules/@nestjs/platform-express/interfaces/index.d.ts @@ -0,0 +1,3 @@ +export * from './nest-express-application.interface'; +export { NestExpressBodyParserOptions } from './nest-express-body-parser-options.interface'; +export * from './nest-express-body-parser.interface'; diff --git a/node_modules/@nestjs/platform-express/interfaces/index.js b/node_modules/@nestjs/platform-express/interfaces/index.js new file mode 100644 index 0000000000000000000000000000000000000000..91c867f798e60ae3f159212faa3f7e0a4d2b11bb --- /dev/null +++ b/node_modules/@nestjs/platform-express/interfaces/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./nest-express-application.interface"), exports); +tslib_1.__exportStar(require("./nest-express-body-parser.interface"), exports); diff --git a/node_modules/@nestjs/platform-express/interfaces/nest-express-application.interface.d.ts b/node_modules/@nestjs/platform-express/interfaces/nest-express-application.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..25ffa639b25b84535d55a093b9cf463be6d71654 --- /dev/null +++ b/node_modules/@nestjs/platform-express/interfaces/nest-express-application.interface.d.ts @@ -0,0 +1,119 @@ +import { HttpServer, INestApplication } from '@nestjs/common'; +import type { CorsOptions, CorsOptionsDelegate } from '@nestjs/common/interfaces/external/cors-options.interface'; +import type { Express } from 'express'; +import type { Server as CoreHttpServer } from 'http'; +import type { Server as CoreHttpsServer } from 'https'; +import { NestExpressBodyParserOptions } from './nest-express-body-parser-options.interface'; +import { NestExpressBodyParserType } from './nest-express-body-parser.interface'; +import { ServeStaticOptions } from './serve-static-options.interface'; +/** + * Interface describing methods on NestExpressApplication. + * + * @see [Platform](https://docs.nestjs.com/first-steps#platform) + * + * @publicApi + */ +export interface NestExpressApplication extends INestApplication { + /** + * Returns the underlying HTTP adapter bounded to the Express.js app. + * + * @returns {HttpServer} + */ + getHttpAdapter(): HttpServer; + /** + * Starts the application. + * + * @param {number|string} port + * @param {string} [hostname] + * @param {Function} [callback] Optional callback + * @returns {Promise} A Promise that, when resolved, is a reference to the underlying HttpServer. + */ + listen(port: number | string, callback?: () => void): Promise; + listen(port: number | string, hostname: string, callback?: () => void): Promise; + /** + * A wrapper function around native `express.set()` method. + * + * @example + * app.set('trust proxy', 'loopback') + * + * @returns {this} + */ + set(...args: any[]): this; + /** + * A wrapper function around native `express.engine()` method. + * @example + * app.engine('mustache', mustacheExpress()) + * + * @returns {this} + */ + engine(...args: any[]): this; + /** + * A wrapper function around native `express.enable()` method. + * @example + * app.enable('x-powered-by') + * + * @returns {this} + */ + enable(...args: any[]): this; + /** + * A wrapper function around native `express.disable()` method. + * + * @example + * app.disable('x-powered-by') + * + * @returns {this} + */ + disable(...args: any[]): this; + useStaticAssets(options: ServeStaticOptions): this; + /** + * Sets a base directory for public assets. + * @example + * app.useStaticAssets('public') + * + * @returns {this} + */ + useStaticAssets(path: string, options?: ServeStaticOptions): this; + enableCors(options?: CorsOptions | CorsOptionsDelegate): void; + /** + * Register Express body parsers on the fly. Will respect + * the application's `rawBody` option. + * + * @example + * const app = await NestFactory.create( + * AppModule, + * { rawBody: true } + * ); + * app.useBodyParser('json', { limit: '50mb' }); + * + * @returns {this} + */ + useBodyParser(parser: NestExpressBodyParserType, options?: Omit): this; + /** + * Sets one or multiple base directories for templates (views). + * + * @example + * app.setBaseViewsDir('views') + * + * @returns {this} + */ + setBaseViewsDir(path: string | string[]): this; + /** + * Sets a view engine for templates (views). + * @example + * app.setViewEngine('pug') + * + * @returns {this} + */ + setViewEngine(engine: string): this; + /** + * Sets app-level globals for view templates. + * + * @example + * app.setLocal('title', 'My Site') + * + * @see https://expressjs.com/en/4x/api.html#app.locals + * + * @returns {this} + */ + setLocal(key: string, value: any): this; +} diff --git a/node_modules/@nestjs/platform-express/interfaces/nest-express-application.interface.js b/node_modules/@nestjs/platform-express/interfaces/nest-express-application.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/platform-express/interfaces/nest-express-application.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser-options.interface.d.ts b/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8120be398ee916e84ba2db094c0bde6c1cdaad1e --- /dev/null +++ b/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser-options.interface.d.ts @@ -0,0 +1,21 @@ +import type { IncomingMessage } from 'http'; +/** + * Type alias to keep compatibility with @types/body-parser + * @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/dcd1673c4fa18a15ea8cd8ff8af7d563bb6dc8e6/types/body-parser/index.d.ts#L48-L66#L48-L66 + * @publicApi + */ +export interface NestExpressBodyParserOptions { + /** When set to true, then deflated (compressed) bodies will be inflated; when false, deflated bodies are rejected. Defaults to true. */ + inflate?: boolean | undefined; + /** + * Controls the maximum request body size. If this is a number, + * then the value specifies the number of bytes; if it is a string, + * the value is passed to the bytes library for parsing. Defaults to '100kb'. + */ + limit?: number | string | undefined; + /** + * The type option is used to determine what media type the middleware will parse + */ + type?: string | string[] | ((req: IncomingMessage) => any) | undefined; + [key: string]: unknown; +} diff --git a/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser-options.interface.js b/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser.interface.d.ts b/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9cb0030540f64e2135cd7bcf54a003676af6530c --- /dev/null +++ b/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser.interface.d.ts @@ -0,0 +1,4 @@ +/** + * Interface defining possible body parser types, to be used with `NestExpressApplication.useBodyParser()`. + */ +export type NestExpressBodyParserType = 'json' | 'urlencoded' | 'text' | 'raw'; diff --git a/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser.interface.js b/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/platform-express/interfaces/nest-express-body-parser.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/platform-express/interfaces/serve-static-options.interface.d.ts b/node_modules/@nestjs/platform-express/interfaces/serve-static-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26b98f4ad1d0c3d7d45e951e048fd722934be039 --- /dev/null +++ b/node_modules/@nestjs/platform-express/interfaces/serve-static-options.interface.d.ts @@ -0,0 +1,69 @@ +/** + * Interface describing options for serving static assets. + * + * @see [Serving static files in Express](https://expressjs.com/en/starter/static-files.html) + * @see [Model-View-Controller](https://docs.nestjs.com/techniques/mvc) + * + * @publicApi + */ +export interface ServeStaticOptions { + /** + * Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot ("."). + * Note this check is done on the path itself without checking if the path actually exists on the disk. + * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny"). + * The default value is 'ignore'. + * 'allow' No special treatment for dotfiles + * 'deny' Send a 403 for any request for a dotfile + * 'ignore' Pretend like the dotfile does not exist and call next() + */ + dotfiles?: string; + /** + * Enable or disable etag generation, defaults to true. + */ + etag?: boolean; + /** + * Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for. + * The first that exists will be served. Example: ['html', 'htm']. + * The default value is false. + */ + extensions?: string[]; + /** + * Let client errors fall-through as unhandled requests, otherwise forward a client error. + * The default value is false. + */ + fallthrough?: boolean; + /** + * Enable or disable the immutable directive in the Cache-Control response header. + * If enabled, the maxAge option should also be specified to enable caching. The immutable directive will prevent supported clients from making conditional requests during the life of the maxAge option to check if the file has changed. + */ + immutable?: boolean; + /** + * By default this module will send "index.html" files in response to a request on a directory. + * To disable this set false or to supply a new index pass a string or an array in preferred order. + */ + index?: boolean | string | string[]; + /** + * Enable or disable Last-Modified header, defaults to true. Uses the file system's last modified value. + */ + lastModified?: boolean; + /** + * Provide a max-age in milliseconds for http caching, defaults to 0. This can also be a string accepted by the ms module. + */ + maxAge?: number | string; + /** + * Redirect to trailing "/" when the pathname is a dir. Defaults to true. + */ + redirect?: boolean; + /** + * Function to set custom headers on response. Alterations to the headers need to occur synchronously. + * The function is called as `fn(res, path, stat)`, where the arguments are: + * `res` - the response object + * `path` - the file path that is being sent + * `stat` - the stat object of the file that is being sent + */ + setHeaders?: (res: any, path: string, stat: any) => any; + /** + * Creates a virtual path prefix + */ + prefix?: string; +} diff --git a/node_modules/@nestjs/platform-express/interfaces/serve-static-options.interface.js b/node_modules/@nestjs/platform-express/interfaces/serve-static-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/platform-express/interfaces/serve-static-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/platform-express/multer/files.constants.d.ts b/node_modules/@nestjs/platform-express/multer/files.constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7346eaba2687c5be0cae90d7f87981c797bfb66 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/files.constants.d.ts @@ -0,0 +1 @@ +export declare const MULTER_MODULE_OPTIONS = "MULTER_MODULE_OPTIONS"; diff --git a/node_modules/@nestjs/platform-express/multer/files.constants.js b/node_modules/@nestjs/platform-express/multer/files.constants.js new file mode 100644 index 0000000000000000000000000000000000000000..0ddf1e6801c9dde6cddc7d359dcae95470073212 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/files.constants.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MULTER_MODULE_OPTIONS = void 0; +exports.MULTER_MODULE_OPTIONS = 'MULTER_MODULE_OPTIONS'; diff --git a/node_modules/@nestjs/platform-express/multer/index.d.ts b/node_modules/@nestjs/platform-express/multer/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7afd4aab8993316d68e49a55905be7f3f07c56e3 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/index.d.ts @@ -0,0 +1,3 @@ +export * from './interceptors'; +export * from './interfaces'; +export * from './multer.module'; diff --git a/node_modules/@nestjs/platform-express/multer/index.js b/node_modules/@nestjs/platform-express/multer/index.js new file mode 100644 index 0000000000000000000000000000000000000000..00a6451f9664c751a7dc84bbc988734bd48e597b --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./interceptors"), exports); +tslib_1.__exportStar(require("./interfaces"), exports); +tslib_1.__exportStar(require("./multer.module"), exports); diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/any-files.interceptor.d.ts b/node_modules/@nestjs/platform-express/multer/interceptors/any-files.interceptor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..18f946a50e929d8fce83d8340d8dea784fa47478 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/any-files.interceptor.d.ts @@ -0,0 +1,8 @@ +import { NestInterceptor, Type } from '@nestjs/common'; +import { MulterOptions } from '../interfaces/multer-options.interface'; +/** + * @param localOptions + * + * @publicApi + */ +export declare function AnyFilesInterceptor(localOptions?: MulterOptions): Type; diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/any-files.interceptor.js b/node_modules/@nestjs/platform-express/multer/interceptors/any-files.interceptor.js new file mode 100644 index 0000000000000000000000000000000000000000..751ae2cb1a8e42ef326a5e1416411d9c41a44c3d --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/any-files.interceptor.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnyFilesInterceptor = AnyFilesInterceptor; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const multer = require("multer"); +const files_constants_1 = require("../files.constants"); +const multer_utils_1 = require("../multer/multer.utils"); +/** + * @param localOptions + * + * @publicApi + */ +function AnyFilesInterceptor(localOptions) { + let MixinInterceptor = class MixinInterceptor { + constructor(options = {}) { + this.multer = multer({ + ...options, + ...localOptions, + }); + } + async intercept(context, next) { + const ctx = context.switchToHttp(); + await new Promise((resolve, reject) => this.multer.any()(ctx.getRequest(), ctx.getResponse(), (err) => { + if (err) { + const error = (0, multer_utils_1.transformException)(err); + return reject(error); + } + resolve(); + })); + return next.handle(); + } + }; + MixinInterceptor = tslib_1.__decorate([ + tslib_1.__param(0, (0, common_1.Optional)()), + tslib_1.__param(0, (0, common_1.Inject)(files_constants_1.MULTER_MODULE_OPTIONS)), + tslib_1.__metadata("design:paramtypes", [Object]) + ], MixinInterceptor); + const Interceptor = (0, common_1.mixin)(MixinInterceptor); + return Interceptor; +} diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/file-fields.interceptor.d.ts b/node_modules/@nestjs/platform-express/multer/interceptors/file-fields.interceptor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15e571b67494e8999833349e0c264e819d16e110 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/file-fields.interceptor.d.ts @@ -0,0 +1,8 @@ +import { NestInterceptor, Type } from '@nestjs/common'; +import { MulterField, MulterOptions } from '../interfaces/multer-options.interface'; +/** + * @param uploadFields + * @param localOptions + * @publicApi + */ +export declare function FileFieldsInterceptor(uploadFields: MulterField[], localOptions?: MulterOptions): Type; diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/file-fields.interceptor.js b/node_modules/@nestjs/platform-express/multer/interceptors/file-fields.interceptor.js new file mode 100644 index 0000000000000000000000000000000000000000..31a772ece9104dcfb89cebfe40d92d4b48d12480 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/file-fields.interceptor.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FileFieldsInterceptor = FileFieldsInterceptor; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const multer = require("multer"); +const files_constants_1 = require("../files.constants"); +const multer_utils_1 = require("../multer/multer.utils"); +/** + * @param uploadFields + * @param localOptions + * @publicApi + */ +function FileFieldsInterceptor(uploadFields, localOptions) { + let MixinInterceptor = class MixinInterceptor { + constructor(options = {}) { + this.multer = multer({ + ...options, + ...localOptions, + }); + } + async intercept(context, next) { + const ctx = context.switchToHttp(); + await new Promise((resolve, reject) => this.multer.fields(uploadFields)(ctx.getRequest(), ctx.getResponse(), (err) => { + if (err) { + const error = (0, multer_utils_1.transformException)(err); + return reject(error); + } + resolve(); + })); + return next.handle(); + } + }; + MixinInterceptor = tslib_1.__decorate([ + tslib_1.__param(0, (0, common_1.Optional)()), + tslib_1.__param(0, (0, common_1.Inject)(files_constants_1.MULTER_MODULE_OPTIONS)), + tslib_1.__metadata("design:paramtypes", [Object]) + ], MixinInterceptor); + const Interceptor = (0, common_1.mixin)(MixinInterceptor); + return Interceptor; +} diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/file.interceptor.d.ts b/node_modules/@nestjs/platform-express/multer/interceptors/file.interceptor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0a8341611f1b96461d780a5e4e50bc81fcde2787 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/file.interceptor.d.ts @@ -0,0 +1,9 @@ +import { NestInterceptor, Type } from '@nestjs/common'; +import { MulterOptions } from '../interfaces/multer-options.interface'; +/** + * @param fieldName + * @param localOptions + * + * @publicApi + */ +export declare function FileInterceptor(fieldName: string, localOptions?: MulterOptions): Type; diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/file.interceptor.js b/node_modules/@nestjs/platform-express/multer/interceptors/file.interceptor.js new file mode 100644 index 0000000000000000000000000000000000000000..fbafa85c5ab4386420f798d53006ccd6a5b4b5de --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/file.interceptor.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FileInterceptor = FileInterceptor; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const multer = require("multer"); +const files_constants_1 = require("../files.constants"); +const multer_utils_1 = require("../multer/multer.utils"); +/** + * @param fieldName + * @param localOptions + * + * @publicApi + */ +function FileInterceptor(fieldName, localOptions) { + let MixinInterceptor = class MixinInterceptor { + constructor(options = {}) { + this.multer = multer({ + ...options, + ...localOptions, + }); + } + async intercept(context, next) { + const ctx = context.switchToHttp(); + await new Promise((resolve, reject) => this.multer.single(fieldName)(ctx.getRequest(), ctx.getResponse(), (err) => { + if (err) { + const error = (0, multer_utils_1.transformException)(err); + return reject(error); + } + resolve(); + })); + return next.handle(); + } + }; + MixinInterceptor = tslib_1.__decorate([ + tslib_1.__param(0, (0, common_1.Optional)()), + tslib_1.__param(0, (0, common_1.Inject)(files_constants_1.MULTER_MODULE_OPTIONS)), + tslib_1.__metadata("design:paramtypes", [Object]) + ], MixinInterceptor); + const Interceptor = (0, common_1.mixin)(MixinInterceptor); + return Interceptor; +} diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/files.interceptor.d.ts b/node_modules/@nestjs/platform-express/multer/interceptors/files.interceptor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3519efa8e617a32a9d5265c299024f130ebe31b --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/files.interceptor.d.ts @@ -0,0 +1,11 @@ +import { NestInterceptor, Type } from '@nestjs/common'; +import { MulterOptions } from '../interfaces/multer-options.interface'; +/** + * + * @param fieldName + * @param maxCount + * @param localOptions + * + * @publicApi + */ +export declare function FilesInterceptor(fieldName: string, maxCount?: number, localOptions?: MulterOptions): Type; diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/files.interceptor.js b/node_modules/@nestjs/platform-express/multer/interceptors/files.interceptor.js new file mode 100644 index 0000000000000000000000000000000000000000..974e34f87ac1bb9feba52d34669cf251a60d58e3 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/files.interceptor.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FilesInterceptor = FilesInterceptor; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const multer = require("multer"); +const files_constants_1 = require("../files.constants"); +const multer_utils_1 = require("../multer/multer.utils"); +/** + * + * @param fieldName + * @param maxCount + * @param localOptions + * + * @publicApi + */ +function FilesInterceptor(fieldName, maxCount, localOptions) { + let MixinInterceptor = class MixinInterceptor { + constructor(options = {}) { + this.multer = multer({ + ...options, + ...localOptions, + }); + } + async intercept(context, next) { + const ctx = context.switchToHttp(); + await new Promise((resolve, reject) => this.multer.array(fieldName, maxCount)(ctx.getRequest(), ctx.getResponse(), (err) => { + if (err) { + const error = (0, multer_utils_1.transformException)(err); + return reject(error); + } + resolve(); + })); + return next.handle(); + } + }; + MixinInterceptor = tslib_1.__decorate([ + tslib_1.__param(0, (0, common_1.Optional)()), + tslib_1.__param(0, (0, common_1.Inject)(files_constants_1.MULTER_MODULE_OPTIONS)), + tslib_1.__metadata("design:paramtypes", [Object]) + ], MixinInterceptor); + const Interceptor = (0, common_1.mixin)(MixinInterceptor); + return Interceptor; +} diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/index.d.ts b/node_modules/@nestjs/platform-express/multer/interceptors/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..855620d9762ba23bf4f22e9941bb247b301998f7 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/index.d.ts @@ -0,0 +1,5 @@ +export * from './any-files.interceptor'; +export * from './file-fields.interceptor'; +export * from './file.interceptor'; +export * from './files.interceptor'; +export * from './no-files.interceptor'; diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/index.js b/node_modules/@nestjs/platform-express/multer/interceptors/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e79efdafb455600bdb8f08bc444f2fca7c53883d --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./any-files.interceptor"), exports); +tslib_1.__exportStar(require("./file-fields.interceptor"), exports); +tslib_1.__exportStar(require("./file.interceptor"), exports); +tslib_1.__exportStar(require("./files.interceptor"), exports); +tslib_1.__exportStar(require("./no-files.interceptor"), exports); diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/no-files.interceptor.d.ts b/node_modules/@nestjs/platform-express/multer/interceptors/no-files.interceptor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..036604f18a16bbf454ddfbfb2f48a08e543c639c --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/no-files.interceptor.d.ts @@ -0,0 +1,8 @@ +import { NestInterceptor, Type } from '@nestjs/common'; +import { MulterOptions } from '../interfaces/multer-options.interface'; +/** + * + * @param localOptions + * @publicApi + */ +export declare function NoFilesInterceptor(localOptions?: MulterOptions): Type; diff --git a/node_modules/@nestjs/platform-express/multer/interceptors/no-files.interceptor.js b/node_modules/@nestjs/platform-express/multer/interceptors/no-files.interceptor.js new file mode 100644 index 0000000000000000000000000000000000000000..c1ef58142fbfe3e66a2035c17c866dc48433d014 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interceptors/no-files.interceptor.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NoFilesInterceptor = NoFilesInterceptor; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const multer = require("multer"); +const files_constants_1 = require("../files.constants"); +const multer_utils_1 = require("../multer/multer.utils"); +/** + * + * @param localOptions + * @publicApi + */ +function NoFilesInterceptor(localOptions) { + let MixinInterceptor = class MixinInterceptor { + constructor(options = {}) { + this.multer = multer({ + ...options, + ...localOptions, + }); + } + async intercept(context, next) { + const ctx = context.switchToHttp(); + await new Promise((resolve, reject) => this.multer.none()(ctx.getRequest(), ctx.getResponse(), (err) => { + if (err) { + const error = (0, multer_utils_1.transformException)(err); + return reject(error); + } + resolve(); + })); + return next.handle(); + } + }; + MixinInterceptor = tslib_1.__decorate([ + tslib_1.__param(0, (0, common_1.Optional)()), + tslib_1.__param(0, (0, common_1.Inject)(files_constants_1.MULTER_MODULE_OPTIONS)), + tslib_1.__metadata("design:paramtypes", [Object]) + ], MixinInterceptor); + const Interceptor = (0, common_1.mixin)(MixinInterceptor); + return Interceptor; +} diff --git a/node_modules/@nestjs/platform-express/multer/interfaces/files-upload-module.interface.d.ts b/node_modules/@nestjs/platform-express/multer/interfaces/files-upload-module.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b52bdb3f6ccf7a0555f5182c69d69fe614b8c8b6 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interfaces/files-upload-module.interface.d.ts @@ -0,0 +1,18 @@ +import { ModuleMetadata, Type } from '@nestjs/common/interfaces'; +import { MulterOptions } from './multer-options.interface'; +export type MulterModuleOptions = MulterOptions; +/** + * @publicApi + */ +export interface MulterOptionsFactory { + createMulterOptions(): Promise | MulterModuleOptions; +} +/** + * @publicApi + */ +export interface MulterModuleAsyncOptions extends Pick { + useExisting?: Type; + useClass?: Type; + useFactory?: (...args: any[]) => Promise | MulterModuleOptions; + inject?: any[]; +} diff --git a/node_modules/@nestjs/platform-express/multer/interfaces/files-upload-module.interface.js b/node_modules/@nestjs/platform-express/multer/interfaces/files-upload-module.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interfaces/files-upload-module.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/platform-express/multer/interfaces/index.d.ts b/node_modules/@nestjs/platform-express/multer/interfaces/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..be94ec24afdd1fa6dec8500736502ed3194f3aa8 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interfaces/index.d.ts @@ -0,0 +1 @@ +export * from './files-upload-module.interface'; diff --git a/node_modules/@nestjs/platform-express/multer/interfaces/index.js b/node_modules/@nestjs/platform-express/multer/interfaces/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0e48ce8ba2e30dfaa10e0997b35dd84d1c44d0bb --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interfaces/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./files-upload-module.interface"), exports); diff --git a/node_modules/@nestjs/platform-express/multer/interfaces/multer-options.interface.d.ts b/node_modules/@nestjs/platform-express/multer/interfaces/multer-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b34d7a4a6c28cef3802cda719b78a1d95209ad3b --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interfaces/multer-options.interface.d.ts @@ -0,0 +1,63 @@ +/** + * @see https://github.com/expressjs/multer + * + * @publicApi + */ +export interface MulterOptions { + dest?: string | Function; + /** The storage engine to use for uploaded files. */ + storage?: any; + /** + * An object specifying the size limits of the following optional properties. This object is passed to busboy + * directly, and the details of properties can be found on https://github.com/mscdex/busboy#busboy-methods + */ + limits?: { + /** Max field name size (Default: 100 bytes) */ + fieldNameSize?: number; + /** Max field value size (Default: 1MB) */ + fieldSize?: number; + /** Max number of non- file fields (Default: Infinity) */ + fields?: number; + /** For multipart forms, the max file size (in bytes)(Default: Infinity) */ + fileSize?: number; + /** For multipart forms, the max number of file fields (Default: Infinity) */ + files?: number; + /** For multipart forms, the max number of parts (fields + files)(Default: Infinity) */ + parts?: number; + /** For multipart forms, the max number of header key=> value pairs to parse Default: 2000(same as node's http). */ + headerPairs?: number; + }; + /** Keep the full path of files instead of just the base name (Default: false) */ + preservePath?: boolean; + /** Default character set for part header values (e.g. filename) (Default: 'latin1') */ + defParamCharset?: string; + fileFilter?(req: any, file: { + /** Field name specified in the form */ + fieldname: string; + /** Name of the file on the user's computer */ + originalname: string; + /** Encoding type of the file */ + encoding: string; + /** Mime type of the file */ + mimetype: string; + /** Size of the file in bytes */ + size: number; + /** The folder to which the file has been saved (DiskStorage) */ + destination: string; + /** The name of the file within the destination (DiskStorage) */ + filename: string; + /** Location of the uploaded file (DiskStorage) */ + path: string; + /** A Buffer of the entire file (MemoryStorage) */ + buffer: Buffer; + }, callback: (error: Error | null, acceptFile: boolean) => void): void; +} +/** + * @publicApi + */ +export interface MulterField { + /** The field name. */ + name: string; + /** Optional maximum number of files per field to accept. */ + maxCount?: number; +} diff --git a/node_modules/@nestjs/platform-express/multer/interfaces/multer-options.interface.js b/node_modules/@nestjs/platform-express/multer/interfaces/multer-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/interfaces/multer-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/platform-express/multer/multer.constants.d.ts b/node_modules/@nestjs/platform-express/multer/multer.constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b333b27f27e9fa9135cd8d0b5dc4e4bdc404279a --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/multer.constants.d.ts @@ -0,0 +1 @@ +export declare const MULTER_MODULE_ID = "MULTER_MODULE_ID"; diff --git a/node_modules/@nestjs/platform-express/multer/multer.constants.js b/node_modules/@nestjs/platform-express/multer/multer.constants.js new file mode 100644 index 0000000000000000000000000000000000000000..6a9613276222b7cfe1e32fd62ebf2663bf678558 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/multer.constants.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MULTER_MODULE_ID = void 0; +exports.MULTER_MODULE_ID = 'MULTER_MODULE_ID'; diff --git a/node_modules/@nestjs/platform-express/multer/multer.module.d.ts b/node_modules/@nestjs/platform-express/multer/multer.module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..50888028269d71c6915ae5bc28ff7c2efe3d42ee --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/multer.module.d.ts @@ -0,0 +1,11 @@ +import { DynamicModule } from '@nestjs/common'; +import { MulterModuleAsyncOptions, MulterModuleOptions } from './interfaces/files-upload-module.interface'; +/** + * @publicApi + */ +export declare class MulterModule { + static register(options?: MulterModuleOptions): DynamicModule; + static registerAsync(options: MulterModuleAsyncOptions): DynamicModule; + private static createAsyncProviders; + private static createAsyncOptionsProvider; +} diff --git a/node_modules/@nestjs/platform-express/multer/multer.module.js b/node_modules/@nestjs/platform-express/multer/multer.module.js new file mode 100644 index 0000000000000000000000000000000000000000..808568f16825793f19e41ed2891cdc72db2f102d --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/multer.module.js @@ -0,0 +1,71 @@ +"use strict"; +var MulterModule_1; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MulterModule = void 0; +const tslib_1 = require("tslib"); +const common_1 = require("@nestjs/common"); +const random_string_generator_util_1 = require("@nestjs/common/utils/random-string-generator.util"); +const files_constants_1 = require("./files.constants"); +const multer_constants_1 = require("./multer.constants"); +/** + * @publicApi + */ +let MulterModule = MulterModule_1 = class MulterModule { + static register(options = {}) { + return { + module: MulterModule_1, + providers: [ + { provide: files_constants_1.MULTER_MODULE_OPTIONS, useFactory: () => options }, + { + provide: multer_constants_1.MULTER_MODULE_ID, + useValue: (0, random_string_generator_util_1.randomStringGenerator)(), + }, + ], + exports: [files_constants_1.MULTER_MODULE_OPTIONS], + }; + } + static registerAsync(options) { + return { + module: MulterModule_1, + imports: options.imports, + providers: [ + ...this.createAsyncProviders(options), + { + provide: multer_constants_1.MULTER_MODULE_ID, + useValue: (0, random_string_generator_util_1.randomStringGenerator)(), + }, + ], + exports: [files_constants_1.MULTER_MODULE_OPTIONS], + }; + } + static createAsyncProviders(options) { + if (options.useExisting || options.useFactory) { + return [this.createAsyncOptionsProvider(options)]; + } + return [ + this.createAsyncOptionsProvider(options), + { + provide: options.useClass, + useClass: options.useClass, + }, + ]; + } + static createAsyncOptionsProvider(options) { + if (options.useFactory) { + return { + provide: files_constants_1.MULTER_MODULE_OPTIONS, + useFactory: options.useFactory, + inject: options.inject || [], + }; + } + return { + provide: files_constants_1.MULTER_MODULE_OPTIONS, + useFactory: async (optionsFactory) => optionsFactory.createMulterOptions(), + inject: [options.useExisting || options.useClass], + }; + } +}; +exports.MulterModule = MulterModule; +exports.MulterModule = MulterModule = MulterModule_1 = tslib_1.__decorate([ + (0, common_1.Module)({}) +], MulterModule); diff --git a/node_modules/@nestjs/platform-express/multer/multer/multer.constants.d.ts b/node_modules/@nestjs/platform-express/multer/multer/multer.constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c007c3a74ca2d239d4afbf94e44ba337157e90dd --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/multer/multer.constants.d.ts @@ -0,0 +1,16 @@ +export declare const multerExceptions: { + LIMIT_PART_COUNT: string; + LIMIT_FILE_SIZE: string; + LIMIT_FILE_COUNT: string; + LIMIT_FIELD_KEY: string; + LIMIT_FIELD_VALUE: string; + LIMIT_FIELD_COUNT: string; + LIMIT_UNEXPECTED_FILE: string; + MISSING_FIELD_NAME: string; +}; +export declare const busboyExceptions: { + MULTIPART_BOUNDARY_NOT_FOUND: string; + MULTIPART_MALFORMED_PART_HEADER: string; + MULTIPART_UNEXPECTED_END_OF_FORM: string; + MULTIPART_UNEXPECTED_END_OF_FILE: string; +}; diff --git a/node_modules/@nestjs/platform-express/multer/multer/multer.constants.js b/node_modules/@nestjs/platform-express/multer/multer/multer.constants.js new file mode 100644 index 0000000000000000000000000000000000000000..70a0a7c71dee286b576d9510f5fe0b6b7ecfe0ed --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/multer/multer.constants.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.busboyExceptions = exports.multerExceptions = void 0; +exports.multerExceptions = { + // from https://github.com/expressjs/multer/blob/master/lib/multer-error.js + LIMIT_PART_COUNT: 'Too many parts', + LIMIT_FILE_SIZE: 'File too large', + LIMIT_FILE_COUNT: 'Too many files', + LIMIT_FIELD_KEY: 'Field name too long', + LIMIT_FIELD_VALUE: 'Field value too long', + LIMIT_FIELD_COUNT: 'Too many fields', + LIMIT_UNEXPECTED_FILE: 'Unexpected field', + MISSING_FIELD_NAME: 'Field name missing', +}; +exports.busboyExceptions = { + // from https://github.com/mscdex/busboy/blob/master/lib/types/multipart.js + MULTIPART_BOUNDARY_NOT_FOUND: 'Multipart: Boundary not found', + MULTIPART_MALFORMED_PART_HEADER: 'Malformed part header', + MULTIPART_UNEXPECTED_END_OF_FORM: 'Unexpected end of form', + MULTIPART_UNEXPECTED_END_OF_FILE: 'Unexpected end of file', +}; diff --git a/node_modules/@nestjs/platform-express/multer/multer/multer.utils.d.ts b/node_modules/@nestjs/platform-express/multer/multer/multer.utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..91ebc653a78b5cdd363157709023075c71e747f6 --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/multer/multer.utils.d.ts @@ -0,0 +1,6 @@ +import { HttpException } from '@nestjs/common'; +export declare function transformException(error: (Error & { + field?: string; +}) | undefined): HttpException | (Error & { + field?: string; +}) | undefined; diff --git a/node_modules/@nestjs/platform-express/multer/multer/multer.utils.js b/node_modules/@nestjs/platform-express/multer/multer/multer.utils.js new file mode 100644 index 0000000000000000000000000000000000000000..e83a636b700a6c211c7f818d75989dd671640a9f --- /dev/null +++ b/node_modules/@nestjs/platform-express/multer/multer/multer.utils.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.transformException = transformException; +const common_1 = require("@nestjs/common"); +const multer_constants_1 = require("./multer.constants"); +// Multer may add in a 'field' property to the error +// https://github.com/expressjs/multer/blob/aa42bea6ac7d0cb8fcb279b15a7278cda805dc63/lib/multer-error.js#L19 +function transformException(error) { + if (!error || error instanceof common_1.HttpException) { + return error; + } + switch (error.message) { + case multer_constants_1.multerExceptions.LIMIT_FILE_SIZE: + return new common_1.PayloadTooLargeException(error.message); + case multer_constants_1.multerExceptions.LIMIT_FILE_COUNT: + case multer_constants_1.multerExceptions.LIMIT_FIELD_KEY: + case multer_constants_1.multerExceptions.LIMIT_FIELD_VALUE: + case multer_constants_1.multerExceptions.LIMIT_FIELD_COUNT: + case multer_constants_1.multerExceptions.LIMIT_UNEXPECTED_FILE: + case multer_constants_1.multerExceptions.LIMIT_PART_COUNT: + case multer_constants_1.multerExceptions.MISSING_FIELD_NAME: + if (error.field) { + return new common_1.BadRequestException(`${error.message} - ${error.field}`); + } + return new common_1.BadRequestException(error.message); + case multer_constants_1.busboyExceptions.MULTIPART_BOUNDARY_NOT_FOUND: + return new common_1.BadRequestException(error.message); + case multer_constants_1.busboyExceptions.MULTIPART_MALFORMED_PART_HEADER: + case multer_constants_1.busboyExceptions.MULTIPART_UNEXPECTED_END_OF_FORM: + case multer_constants_1.busboyExceptions.MULTIPART_UNEXPECTED_END_OF_FILE: + return new common_1.BadRequestException(`Multipart: ${error.message}`); + } + return error; +} diff --git a/node_modules/@nestjs/platform-express/node_modules/accepts/HISTORY.md b/node_modules/@nestjs/platform-express/node_modules/accepts/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..627a81d0c760328910c25e561ae121db3b473127 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/accepts/HISTORY.md @@ -0,0 +1,250 @@ +2.0.0 / 2024-08-31 +================== + + * Drop node <18 support + * deps: mime-types@^3.0.0 + * deps: negotiator@^1.0.0 + +1.3.8 / 2022-02-02 +================== + + * deps: mime-types@~2.1.34 + - deps: mime-db@~1.51.0 + * deps: negotiator@0.6.3 + +1.3.7 / 2019-04-29 +================== + + * deps: negotiator@0.6.2 + - Fix sorting charset, encoding, and language with extra parameters + +1.3.6 / 2019-04-28 +================== + + * deps: mime-types@~2.1.24 + - deps: mime-db@~1.40.0 + +1.3.5 / 2018-02-28 +================== + + * deps: mime-types@~2.1.18 + - deps: mime-db@~1.33.0 + +1.3.4 / 2017-08-22 +================== + + * deps: mime-types@~2.1.16 + - deps: mime-db@~1.29.0 + +1.3.3 / 2016-05-02 +================== + + * deps: mime-types@~2.1.11 + - deps: mime-db@~1.23.0 + * deps: negotiator@0.6.1 + - perf: improve `Accept` parsing speed + - perf: improve `Accept-Charset` parsing speed + - perf: improve `Accept-Encoding` parsing speed + - perf: improve `Accept-Language` parsing speed + +1.3.2 / 2016-03-08 +================== + + * deps: mime-types@~2.1.10 + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + - deps: mime-db@~1.22.0 + +1.3.1 / 2016-01-19 +================== + + * deps: mime-types@~2.1.9 + - deps: mime-db@~1.21.0 + +1.3.0 / 2015-09-29 +================== + + * deps: mime-types@~2.1.7 + - deps: mime-db@~1.19.0 + * deps: negotiator@0.6.0 + - Fix including type extensions in parameters in `Accept` parsing + - Fix parsing `Accept` parameters with quoted equals + - Fix parsing `Accept` parameters with quoted semicolons + - Lazy-load modules from main entry point + - perf: delay type concatenation until needed + - perf: enable strict mode + - perf: hoist regular expressions + - perf: remove closures getting spec properties + - perf: remove a closure from media type parsing + - perf: remove property delete from media type parsing + +1.2.13 / 2015-09-06 +=================== + + * deps: mime-types@~2.1.6 + - deps: mime-db@~1.18.0 + +1.2.12 / 2015-07-30 +=================== + + * deps: mime-types@~2.1.4 + - deps: mime-db@~1.16.0 + +1.2.11 / 2015-07-16 +=================== + + * deps: mime-types@~2.1.3 + - deps: mime-db@~1.15.0 + +1.2.10 / 2015-07-01 +=================== + + * deps: mime-types@~2.1.2 + - deps: mime-db@~1.14.0 + +1.2.9 / 2015-06-08 +================== + + * deps: mime-types@~2.1.1 + - perf: fix deopt during mapping + +1.2.8 / 2015-06-07 +================== + + * deps: mime-types@~2.1.0 + - deps: mime-db@~1.13.0 + * perf: avoid argument reassignment & argument slice + * perf: avoid negotiator recursive construction + * perf: enable strict mode + * perf: remove unnecessary bitwise operator + +1.2.7 / 2015-05-10 +================== + + * deps: negotiator@0.5.3 + - Fix media type parameter matching to be case-insensitive + +1.2.6 / 2015-05-07 +================== + + * deps: mime-types@~2.0.11 + - deps: mime-db@~1.9.1 + * deps: negotiator@0.5.2 + - Fix comparing media types with quoted values + - Fix splitting media types with quoted commas + +1.2.5 / 2015-03-13 +================== + + * deps: mime-types@~2.0.10 + - deps: mime-db@~1.8.0 + +1.2.4 / 2015-02-14 +================== + + * Support Node.js 0.6 + * deps: mime-types@~2.0.9 + - deps: mime-db@~1.7.0 + * deps: negotiator@0.5.1 + - Fix preference sorting to be stable for long acceptable lists + +1.2.3 / 2015-01-31 +================== + + * deps: mime-types@~2.0.8 + - deps: mime-db@~1.6.0 + +1.2.2 / 2014-12-30 +================== + + * deps: mime-types@~2.0.7 + - deps: mime-db@~1.5.0 + +1.2.1 / 2014-12-30 +================== + + * deps: mime-types@~2.0.5 + - deps: mime-db@~1.3.1 + +1.2.0 / 2014-12-19 +================== + + * deps: negotiator@0.5.0 + - Fix list return order when large accepted list + - Fix missing identity encoding when q=0 exists + - Remove dynamic building of Negotiator class + +1.1.4 / 2014-12-10 +================== + + * deps: mime-types@~2.0.4 + - deps: mime-db@~1.3.0 + +1.1.3 / 2014-11-09 +================== + + * deps: mime-types@~2.0.3 + - deps: mime-db@~1.2.0 + +1.1.2 / 2014-10-14 +================== + + * deps: negotiator@0.4.9 + - Fix error when media type has invalid parameter + +1.1.1 / 2014-09-28 +================== + + * deps: mime-types@~2.0.2 + - deps: mime-db@~1.1.0 + * deps: negotiator@0.4.8 + - Fix all negotiations to be case-insensitive + - Stable sort preferences of same quality according to client order + +1.1.0 / 2014-09-02 +================== + + * update `mime-types` + +1.0.7 / 2014-07-04 +================== + + * Fix wrong type returned from `type` when match after unknown extension + +1.0.6 / 2014-06-24 +================== + + * deps: negotiator@0.4.7 + +1.0.5 / 2014-06-20 +================== + + * fix crash when unknown extension given + +1.0.4 / 2014-06-19 +================== + + * use `mime-types` + +1.0.3 / 2014-06-11 +================== + + * deps: negotiator@0.4.6 + - Order by specificity when quality is the same + +1.0.2 / 2014-05-29 +================== + + * Fix interpretation when header not in request + * deps: pin negotiator@0.4.5 + +1.0.1 / 2014-01-18 +================== + + * Identity encoding isn't always acceptable + * deps: negotiator@~0.4.0 + +1.0.0 / 2013-12-27 +================== + + * Genesis diff --git a/node_modules/@nestjs/platform-express/node_modules/accepts/LICENSE b/node_modules/@nestjs/platform-express/node_modules/accepts/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..06166077be4d1f620d89b9eb33c76d89e75857da --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/accepts/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/accepts/README.md b/node_modules/@nestjs/platform-express/node_modules/accepts/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f3f10c4a4c36bb690ab2f2f8565a95f400ab153c --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/accepts/README.md @@ -0,0 +1,140 @@ +# accepts + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). +Extracted from [koa](https://www.npmjs.com/package/koa) for general use. + +In addition to negotiator, it allows: + +- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` + as well as `('text/html', 'application/json')`. +- Allows type shorthands such as `json`. +- Returns `false` when no types match +- Treats non-existent headers as `*` + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install accepts +``` + +## API + +```js +var accepts = require('accepts') +``` + +### accepts(req) + +Create a new `Accepts` object for the given `req`. + +#### .charset(charsets) + +Return the first accepted charset. If nothing in `charsets` is accepted, +then `false` is returned. + +#### .charsets() + +Return the charsets that the request accepts, in the order of the client's +preference (most preferred first). + +#### .encoding(encodings) + +Return the first accepted encoding. If nothing in `encodings` is accepted, +then `false` is returned. + +#### .encodings() + +Return the encodings that the request accepts, in the order of the client's +preference (most preferred first). + +#### .language(languages) + +Return the first accepted language. If nothing in `languages` is accepted, +then `false` is returned. + +#### .languages() + +Return the languages that the request accepts, in the order of the client's +preference (most preferred first). + +#### .type(types) + +Return the first accepted type (and it is returned as the same text as what +appears in the `types` array). If nothing in `types` is accepted, then `false` +is returned. + +The `types` array can contain full MIME types or file extensions. Any value +that is not a full MIME type is passed to `require('mime-types').lookup`. + +#### .types() + +Return the types that the request accepts, in the order of the client's +preference (most preferred first). + +## Examples + +### Simple type negotiation + +This simple example shows how to use `accepts` to return a different typed +respond body based on what the client wants to accept. The server lists it's +preferences in order and will get back the best match between the client and +server. + +```js +var accepts = require('accepts') +var http = require('http') + +function app (req, res) { + var accept = accepts(req) + + // the order of this list is significant; should be server preferred order + switch (accept.type(['json', 'html'])) { + case 'json': + res.setHeader('Content-Type', 'application/json') + res.write('{"hello":"world!"}') + break + case 'html': + res.setHeader('Content-Type', 'text/html') + res.write('hello, world!') + break + default: + // the fallback is text/plain, so no need to specify it above + res.setHeader('Content-Type', 'text/plain') + res.write('hello, world!') + break + } + + res.end() +} + +http.createServer(app).listen(3000) +``` + +You can test this out with the cURL program: +```sh +curl -I -H'Accept: text/html' http://localhost:3000/ +``` + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master +[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/jshttp/accepts/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/accepts/actions/workflows/ci.yml +[node-version-image]: https://badgen.net/npm/node/accepts +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/accepts +[npm-url]: https://npmjs.org/package/accepts +[npm-version-image]: https://badgen.net/npm/v/accepts diff --git a/node_modules/@nestjs/platform-express/node_modules/accepts/index.js b/node_modules/@nestjs/platform-express/node_modules/accepts/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4f2840c0b72488218ac325a35022de790176be4d --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/accepts/index.js @@ -0,0 +1,238 @@ +/*! + * accepts + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var Negotiator = require('negotiator') +var mime = require('mime-types') + +/** + * Module exports. + * @public + */ + +module.exports = Accepts + +/** + * Create a new Accepts object for the given req. + * + * @param {object} req + * @public + */ + +function Accepts (req) { + if (!(this instanceof Accepts)) { + return new Accepts(req) + } + + this.headers = req.headers + this.negotiator = new Negotiator(req) +} + +/** + * Check if the given `type(s)` is acceptable, returning + * the best match when true, otherwise `undefined`, in which + * case you should respond with 406 "Not Acceptable". + * + * The `type` value may be a single mime type string + * such as "application/json", the extension name + * such as "json" or an array `["json", "html", "text/plain"]`. When a list + * or array is given the _best_ match, if any is returned. + * + * Examples: + * + * // Accept: text/html + * this.types('html'); + * // => "html" + * + * // Accept: text/*, application/json + * this.types('html'); + * // => "html" + * this.types('text/html'); + * // => "text/html" + * this.types('json', 'text'); + * // => "json" + * this.types('application/json'); + * // => "application/json" + * + * // Accept: text/*, application/json + * this.types('image/png'); + * this.types('png'); + * // => undefined + * + * // Accept: text/*;q=.5, application/json + * this.types(['html', 'json']); + * this.types('html', 'json'); + * // => "json" + * + * @param {String|Array} types... + * @return {String|Array|Boolean} + * @public + */ + +Accepts.prototype.type = +Accepts.prototype.types = function (types_) { + var types = types_ + + // support flattened arguments + if (types && !Array.isArray(types)) { + types = new Array(arguments.length) + for (var i = 0; i < types.length; i++) { + types[i] = arguments[i] + } + } + + // no types, return all requested types + if (!types || types.length === 0) { + return this.negotiator.mediaTypes() + } + + // no accept header, return first given type + if (!this.headers.accept) { + return types[0] + } + + var mimes = types.map(extToMime) + var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)) + var first = accepts[0] + + return first + ? types[mimes.indexOf(first)] + : false +} + +/** + * Return accepted encodings or best fit based on `encodings`. + * + * Given `Accept-Encoding: gzip, deflate` + * an array sorted by quality is returned: + * + * ['gzip', 'deflate'] + * + * @param {String|Array} encodings... + * @return {String|Array} + * @public + */ + +Accepts.prototype.encoding = +Accepts.prototype.encodings = function (encodings_) { + var encodings = encodings_ + + // support flattened arguments + if (encodings && !Array.isArray(encodings)) { + encodings = new Array(arguments.length) + for (var i = 0; i < encodings.length; i++) { + encodings[i] = arguments[i] + } + } + + // no encodings, return all requested encodings + if (!encodings || encodings.length === 0) { + return this.negotiator.encodings() + } + + return this.negotiator.encodings(encodings)[0] || false +} + +/** + * Return accepted charsets or best fit based on `charsets`. + * + * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` + * an array sorted by quality is returned: + * + * ['utf-8', 'utf-7', 'iso-8859-1'] + * + * @param {String|Array} charsets... + * @return {String|Array} + * @public + */ + +Accepts.prototype.charset = +Accepts.prototype.charsets = function (charsets_) { + var charsets = charsets_ + + // support flattened arguments + if (charsets && !Array.isArray(charsets)) { + charsets = new Array(arguments.length) + for (var i = 0; i < charsets.length; i++) { + charsets[i] = arguments[i] + } + } + + // no charsets, return all requested charsets + if (!charsets || charsets.length === 0) { + return this.negotiator.charsets() + } + + return this.negotiator.charsets(charsets)[0] || false +} + +/** + * Return accepted languages or best fit based on `langs`. + * + * Given `Accept-Language: en;q=0.8, es, pt` + * an array sorted by quality is returned: + * + * ['es', 'pt', 'en'] + * + * @param {String|Array} langs... + * @return {Array|String} + * @public + */ + +Accepts.prototype.lang = +Accepts.prototype.langs = +Accepts.prototype.language = +Accepts.prototype.languages = function (languages_) { + var languages = languages_ + + // support flattened arguments + if (languages && !Array.isArray(languages)) { + languages = new Array(arguments.length) + for (var i = 0; i < languages.length; i++) { + languages[i] = arguments[i] + } + } + + // no languages, return all requested languages + if (!languages || languages.length === 0) { + return this.negotiator.languages() + } + + return this.negotiator.languages(languages)[0] || false +} + +/** + * Convert extnames to mime. + * + * @param {String} type + * @return {String} + * @private + */ + +function extToMime (type) { + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type +} + +/** + * Check if mime is valid. + * + * @param {String} type + * @return {Boolean} + * @private + */ + +function validMime (type) { + return typeof type === 'string' +} diff --git a/node_modules/@nestjs/platform-express/node_modules/accepts/package.json b/node_modules/@nestjs/platform-express/node_modules/accepts/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b35b262db04543f863690301c6d48924da90afbb --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/accepts/package.json @@ -0,0 +1,47 @@ +{ + "name": "accepts", + "description": "Higher-level content negotiation", + "version": "2.0.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/accepts", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "devDependencies": { + "deep-equal": "1.0.1", + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.0", + "nyc": "15.1.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + }, + "keywords": [ + "content", + "negotiation", + "accept", + "accepts" + ] +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/LICENSE b/node_modules/@nestjs/platform-express/node_modules/body-parser/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..386b7b6946e47bc46f8138791049b4e6a7cef889 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/README.md b/node_modules/@nestjs/platform-express/node_modules/body-parser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..335743d2a10053bc24e98dcd6512d80dc14c3186 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/README.md @@ -0,0 +1,509 @@ +# body-parser + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + +Node.js body parsing middleware. + +Parse incoming request bodies in a middleware before your handlers, available +under the `req.body` property. + +**Note** As `req.body`'s shape is based on user-controlled input, all +properties and values in this object are untrusted and should be validated +before trusting. For example, `req.body.foo.toString()` may fail in multiple +ways, for example the `foo` property may not be there or may not be a string, +and `toString` may not be a function and instead a string or other user input. + +[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/learn/http/anatomy-of-an-http-transaction). + +_This does not handle multipart bodies_, due to their complex and typically +large nature. For multipart bodies, you may be interested in the following +modules: + + * [busboy](https://www.npmjs.com/package/busboy#readme) and + [connect-busboy](https://www.npmjs.com/package/connect-busboy#readme) + * [multiparty](https://www.npmjs.com/package/multiparty#readme) and + [connect-multiparty](https://www.npmjs.com/package/connect-multiparty#readme) + * [formidable](https://www.npmjs.com/package/formidable#readme) + * [multer](https://www.npmjs.com/package/multer#readme) + +This module provides the following parsers: + + * [JSON body parser](#bodyparserjsonoptions) + * [Raw body parser](#bodyparserrawoptions) + * [Text body parser](#bodyparsertextoptions) + * [URL-encoded form body parser](#bodyparserurlencodedoptions) + +Other body parsers you might be interested in: + +- [body](https://www.npmjs.com/package/body#readme) +- [co-body](https://www.npmjs.com/package/co-body#readme) + +## Installation + +```sh +$ npm install body-parser +``` + +## API + +```js +// Import all parsers +const bodyParser = require('body-parser') + +// Or import individual parsers directly +const json = require('body-parser/json') +const urlencoded = require('body-parser/urlencoded') +const raw = require('body-parser/raw') +const text = require('body-parser/text') +``` + +The `bodyParser` object exposes various factories to create middlewares. All +middlewares will populate the `req.body` property with the parsed body when +the `Content-Type` request header matches the `type` option. + +The various errors returned by this module are described in the +[errors section](#errors). + +### bodyParser.json([options]) + +Returns middleware that only parses `json` and only looks at requests where +the `Content-Type` header matches the `type` option. This parser accepts any +Unicode encoding of the body and supports automatic inflation of `gzip`, +`br` (brotli) and `deflate` encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). + +#### Options + +The `json` function takes an optional `options` object that may contain any of +the following keys: + +##### defaultCharset + +Specify the default character set for the json content if the charset is not +specified in the `Content-Type` header of the request. Defaults to `utf-8`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur. + +##### reviver + +The `reviver` option is passed directly to `JSON.parse` as the second +argument. You can find more information on this argument +[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#the_reviver_parameter). + +##### strict + +When set to `true`, will only accept arrays and objects; when `false` will +accept anything `JSON.parse` accepts. Defaults to `true`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not a +function, `type` option is passed directly to the +[type-is](https://www.npmjs.com/package/type-is#readme) library and this can +be an extension name (like `json`), a mime type (like `application/json`), or +a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` +option is called as `fn(req)` and the request is parsed if it returns a truthy +value. Defaults to `application/json`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.raw([options]) + +Returns middleware that parses all bodies as a `Buffer` and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate` +encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This will be a `Buffer` object +of the body. + +#### Options + +The `raw` function takes an optional `options` object that may contain any of +the following keys: + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. +If not a function, `type` option is passed directly to the +[type-is](https://www.npmjs.com/package/type-is#readme) library and this +can be an extension name (like `bin`), a mime type (like +`application/octet-stream`), or a mime type with a wildcard (like `*/*` or +`application/*`). If a function, the `type` option is called as `fn(req)` +and the request is parsed if it returns a truthy value. Defaults to +`application/octet-stream`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.text([options]) + +Returns middleware that parses all bodies as a string and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate` +encodings. + +A new `body` string containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This will be a string of the +body. + +#### Options + +The `text` function takes an optional `options` object that may contain any of +the following keys: + +##### defaultCharset + +Specify the default character set for the text content if the charset is not +specified in the `Content-Type` header of the request. Defaults to `utf-8`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not +a function, `type` option is passed directly to the +[type-is](https://www.npmjs.com/package/type-is#readme) library and this can +be an extension name (like `txt`), a mime type (like `text/plain`), or a mime +type with a wildcard (like `*/*` or `text/*`). If a function, the `type` +option is called as `fn(req)` and the request is parsed if it returns a +truthy value. Defaults to `text/plain`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.urlencoded([options]) + +Returns middleware that only parses `urlencoded` bodies and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser accepts only UTF-8 and ISO-8859-1 encodings of the body and supports +automatic inflation of `gzip`, `br` (brotli) and `deflate` encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This object will contain +key-value pairs, where the value can be a string or array (when `extended` is +`false`), or any type (when `extended` is `true`). + +#### Options + +The `urlencoded` function takes an optional `options` object that may contain +any of the following keys: + +##### extended + +The "extended" syntax allows for rich objects and arrays to be encoded into the +URL-encoded format, allowing for a JSON-like experience with URL-encoded. For +more information, please [see the qs +library](https://www.npmjs.com/package/qs#readme). + +Defaults to `false`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur. + +##### parameterLimit + +The `parameterLimit` option controls the maximum number of parameters that +are allowed in the URL-encoded data. If a request contains more parameters +than this value, a 413 will be returned to the client. Defaults to `1000`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not +a function, `type` option is passed directly to the +[type-is](https://www.npmjs.com/package/type-is#readme) library and this can +be an extension name (like `urlencoded`), a mime type (like +`application/x-www-form-urlencoded`), or a mime type with a wildcard (like +`*/x-www-form-urlencoded`). If a function, the `type` option is called as +`fn(req)` and the request is parsed if it returns a truthy value. Defaults +to `application/x-www-form-urlencoded`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +##### defaultCharset + +The default charset to parse as, if not specified in content-type. Must be +either `utf-8` or `iso-8859-1`. Defaults to `utf-8`. + +##### charsetSentinel + +Whether to let the value of the `utf8` parameter take precedence as the charset +selector. It requires the form to contain a parameter named `utf8` with a value +of `✓`. Defaults to `false`. + +##### interpretNumericEntities + +Whether to decode numeric entities such as `☺` when parsing an iso-8859-1 +form. Defaults to `false`. + + +##### depth + +The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible. + +## Errors + +The middlewares provided by this module create errors using the +[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors +will typically have a `status`/`statusCode` property that contains the suggested +HTTP response code, an `expose` property to determine if the `message` property +should be displayed to the client, a `type` property to determine the type of +error without matching against the `message`, and a `body` property containing +the read body, if available. + +The following are the common errors created, though any error can come through +for various reasons. + +### content encoding unsupported + +This error will occur when the request had a `Content-Encoding` header that +contained an encoding but the "inflation" option was set to `false`. The +`status` property is set to `415`, the `type` property is set to +`'encoding.unsupported'`, and the `charset` property will be set to the +encoding that is unsupported. + +### entity parse failed + +This error will occur when the request contained an entity that could not be +parsed by the middleware. The `status` property is set to `400`, the `type` +property is set to `'entity.parse.failed'`, and the `body` property is set to +the entity value that failed parsing. + +### entity verify failed + +This error will occur when the request contained an entity that could not be +failed verification by the defined `verify` option. The `status` property is +set to `403`, the `type` property is set to `'entity.verify.failed'`, and the +`body` property is set to the entity value that failed verification. + +### request aborted + +This error will occur when the request is aborted by the client before reading +the body has finished. The `received` property will be set to the number of +bytes received before the request was aborted and the `expected` property is +set to the number of expected bytes. The `status` property is set to `400` +and `type` property is set to `'request.aborted'`. + +### request entity too large + +This error will occur when the request body's size is larger than the "limit" +option. The `limit` property will be set to the byte limit and the `length` +property will be set to the request body's length. The `status` property is +set to `413` and the `type` property is set to `'entity.too.large'`. + +### request size did not match content length + +This error will occur when the request's length did not match the length from +the `Content-Length` header. This typically occurs when the request is malformed, +typically when the `Content-Length` header was calculated based on characters +instead of bytes. The `status` property is set to `400` and the `type` property +is set to `'request.size.invalid'`. + +### stream encoding should not be set + +This error will occur when something called the `req.setEncoding` method prior +to this middleware. This module operates directly on bytes only and you cannot +call `req.setEncoding` when using this module. The `status` property is set to +`500` and the `type` property is set to `'stream.encoding.set'`. + +### stream is not readable + +This error will occur when the request is no longer readable when this middleware +attempts to read it. This typically means something other than a middleware from +this module read the request body already and the middleware was also configured to +read the same request. The `status` property is set to `500` and the `type` +property is set to `'stream.not.readable'`. + +### too many parameters + +This error will occur when the content of the request exceeds the configured +`parameterLimit` for the `urlencoded` parser. The `status` property is set to +`413` and the `type` property is set to `'parameters.too.many'`. + +### unsupported charset "BOGUS" + +This error will occur when the request had a charset parameter in the +`Content-Type` header, but the `iconv-lite` module does not support it OR the +parser does not support it. The charset is contained in the message as well +as in the `charset` property. The `status` property is set to `415`, the +`type` property is set to `'charset.unsupported'`, and the `charset` property +is set to the charset that is unsupported. + +### unsupported content encoding "bogus" + +This error will occur when the request had a `Content-Encoding` header that +contained an unsupported encoding. The encoding is contained in the message +as well as in the `encoding` property. The `status` property is set to `415`, +the `type` property is set to `'encoding.unsupported'`, and the `encoding` +property is set to the encoding that is unsupported. + +### The input exceeded the depth + +This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown. + +## Examples + +### Express/Connect top-level generic + +This example demonstrates adding a generic JSON and URL-encoded parser as a +top-level middleware, which will parse the bodies of all incoming requests. +This is the simplest setup. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// parse application/x-www-form-urlencoded +app.use(bodyParser.urlencoded()) + +// parse application/json +app.use(bodyParser.json()) + +app.use(function (req, res) { + res.setHeader('Content-Type', 'text/plain') + res.write('you posted:\n') + res.end(String(JSON.stringify(req.body, null, 2))) +}) +``` + +### Express route-specific + +This example demonstrates adding body parsers specifically to the routes that +need them. In general, this is the most recommended way to use body-parser with +Express. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// create application/json parser +const jsonParser = bodyParser.json() + +// create application/x-www-form-urlencoded parser +const urlencodedParser = bodyParser.urlencoded() + +// POST /login gets urlencoded bodies +app.post('/login', urlencodedParser, function (req, res) { + if (!req.body || !req.body.username) res.sendStatus(400) + res.send('welcome, ' + req.body.username) +}) + +// POST /api/users gets JSON bodies +app.post('/api/users', jsonParser, function (req, res) { + if (!req.body) res.sendStatus(400) + // create user in req.body +}) +``` + +### Change accepted type for parsers + +All the parsers accept a `type` option which allows you to change the +`Content-Type` that the middleware will parse. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// parse various different custom JSON types as JSON +app.use(bodyParser.json({ type: 'application/*+json' })) + +// parse some custom thing into a Buffer +app.use(bodyParser.raw({ type: 'application/vnd.custom-type' })) + +// parse an HTML body into a string +app.use(bodyParser.text({ type: 'text/html' })) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/body-parser/ci.yml?branch=master&label=ci +[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml +[coveralls-image]: https://img.shields.io/coverallsCoverage/github/expressjs/body-parser?branch=master +[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master +[npm-downloads-image]: https://img.shields.io/npm/dm/body-parser +[npm-url]: https://npmjs.com/package/body-parser +[npm-version-image]: https://img.shields.io/npm/v/body-parser +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/index.js b/node_modules/@nestjs/platform-express/node_modules/body-parser/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c0526e16bde72beed6810e2d195826a6359dafa7 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/index.js @@ -0,0 +1,55 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * @typedef {Object} Parsers + * @property {Function} json JSON parser + * @property {Function} raw Raw parser + * @property {Function} text Text parser + * @property {Function} urlencoded URL-encoded parser + */ + +/** + * Module exports. + * @type {Function & Parsers} + */ +exports = module.exports = bodyParser + +/** + * JSON parser. + * @public + */ +exports.json = require('./lib/types/json') + +/** + * Raw parser. + * @public + */ +exports.raw = require('./lib/types/raw') + +/** + * Text parser. + * @public + */ +exports.text = require('./lib/types/text') + +/** + * URL-encoded parser. + * @public + */ +exports.urlencoded = require('./lib/types/urlencoded') + +/** + * Create a middleware to parse json and urlencoded bodies. + * + * @deprecated + * @public + */ +function bodyParser () { + throw new Error('The bodyParser() generic has been split into individual middleware to use instead.') +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/read.js b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/read.js new file mode 100644 index 0000000000000000000000000000000000000000..bf1a1df420ed3d072cad6002ae235e64e8d26281 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/read.js @@ -0,0 +1,247 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const createError = require('http-errors') +const getBody = require('raw-body') +const iconv = require('iconv-lite') +const onFinished = require('on-finished') +const zlib = require('node:zlib') +const hasBody = require('type-is').hasBody +const { getCharset } = require('./utils') + +/** + * Module exports. + */ + +module.exports = read + +/** + * Read a request into a buffer and parse. + * + * @param {Object} req + * @param {Object} res + * @param {Function} next + * @param {Function} parse + * @param {Function} debug + * @param {Object} options + * @private + */ +function read (req, res, next, parse, debug, options) { + if (onFinished.isFinished(req)) { + debug('body already parsed') + next() + return + } + + if (!('body' in req)) { + req.body = undefined + } + + // skip requests without bodies + if (!hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!options.shouldParse(req)) { + debug('skip parsing') + next() + return + } + + let encoding = null + if (options?.skipCharset !== true) { + encoding = getCharset(req) || options.defaultCharset + + // validate charset + if (!!options?.isValidCharset && !options.isValidCharset(encoding)) { + debug('invalid charset') + next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding, + type: 'charset.unsupported' + })) + return + } + } + + let length + const opts = options + let stream + + // read options + const verify = opts.verify + + try { + // get the content stream + stream = contentstream(req, debug, opts.inflate) + length = stream.length + stream.length = undefined + } catch (err) { + return next(err) + } + + // set raw-body options + opts.length = length + opts.encoding = verify + ? null + : encoding + + // assert charset is supported + if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { + return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: 'charset.unsupported' + })) + } + + // read body + debug('read body') + getBody(stream, opts, function (error, body) { + if (error) { + let _error + + if (error.type === 'encoding.unsupported') { + // echo back charset + _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: 'charset.unsupported' + }) + } else { + // set status code on error + _error = createError(400, error) + } + + // unpipe from stream and destroy + if (stream !== req) { + req.unpipe() + stream.destroy() + } + + // read off entire request + dump(req, function onfinished () { + next(createError(400, _error)) + }) + return + } + + // verify + if (verify) { + try { + debug('verify body') + verify(req, res, body, encoding) + } catch (err) { + next(createError(403, err, { + body: body, + type: err.type || 'entity.verify.failed' + })) + return + } + } + + // parse + let str = body + try { + debug('parse body') + str = typeof body !== 'string' && encoding !== null + ? iconv.decode(body, encoding) + : body + req.body = parse(str, encoding) + } catch (err) { + next(createError(400, err, { + body: str, + type: err.type || 'entity.parse.failed' + })) + return + } + + next() + }) +} + +/** + * Get the content stream of the request. + * + * @param {Object} req + * @param {Function} debug + * @param {boolean} inflate + * @returns {Object} + * @private + */ +function contentstream (req, debug, inflate) { + const encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() + const length = req.headers['content-length'] + + debug('content-encoding "%s"', encoding) + + if (inflate === false && encoding !== 'identity') { + throw createError(415, 'content encoding unsupported', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } + + if (encoding === 'identity') { + req.length = length + return req + } + + const stream = createDecompressionStream(encoding, debug) + req.pipe(stream) + return stream +} + +/** + * Create a decompression stream for the given encoding. + * @param {string} encoding + * @param {Function} debug + * @returns {Object} + * @private + */ +function createDecompressionStream (encoding, debug) { + switch (encoding) { + case 'deflate': + debug('inflate body') + return zlib.createInflate() + case 'gzip': + debug('gunzip body') + return zlib.createGunzip() + case 'br': + debug('brotli decompress body') + return zlib.createBrotliDecompress() + default: + throw createError(415, 'unsupported content encoding "' + encoding + '"', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } +} + +/** + * Dump the contents of a request. + * + * @param {Object} req + * @param {Function} callback + * @private + */ +function dump (req, callback) { + if (onFinished.isFinished(req)) { + callback(null) + } else { + onFinished(req, callback) + req.resume() + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/json.js b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/json.js new file mode 100644 index 0000000000000000000000000000000000000000..14ca3e49b8ee04a9f1603eaa110388a93435b165 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/json.js @@ -0,0 +1,186 @@ +/*! + * body-parser + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const debug = require('debug')('body-parser:json') +const read = require('../read') +const { normalizeOptions } = require('../utils') + +/** + * Module exports. + */ + +module.exports = json + +/** + * RegExp to match the first non-space in a string. + * + * Allowed whitespace is defined in RFC 7159: + * + * ws = *( + * %x20 / ; Space + * %x09 / ; Horizontal tab + * %x0A / ; Line feed or New line + * %x0D ) ; Carriage return + */ +const FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex + +const JSON_SYNTAX_CHAR = '#' +const JSON_SYNTAX_REGEXP = /#+/g + +/** + * Create a middleware to parse JSON bodies. + * + * @param {Object} [options] + * @returns {Function} + * @public + */ +function json (options) { + const normalizedOptions = normalizeOptions(options, 'application/json') + + const parse = createJsonParser(options) + + const readOptions = { + ...normalizedOptions, + // assert charset per RFC 7159 sec 8.1 + isValidCharset: (charset) => charset.slice(0, 4) === 'utf-' + } + + return function jsonParser (req, res, next) { + read(req, res, next, parse, debug, readOptions) + } +} + +/** + * Create a JSON parse function + * + * @param {object} [options] + * @return {function} + * @private + */ +function createJsonParser (options) { + const reviver = options?.reviver + const strict = options?.strict !== false + + if (strict) { + return function parse (body) { + if (body.length === 0) { + // special-case empty json body, as it's a common client-side mistake + // TODO: maybe make this configurable or part of "strict" option + return {} + } + + const first = firstchar(body) + if (first !== '{' && first !== '[') { + debug('strict violation') + throw createStrictSyntaxError(body, first) + } + + try { + debug('parse json') + return JSON.parse(body, reviver) + } catch (e) { + throw normalizeJsonSyntaxError(e, { + message: e.message, + stack: e.stack + }) + } + } + } + + return function parse (body) { + if (body.length === 0) { + // special-case empty json body, as it's a common client-side mistake + // TODO: maybe make this configurable or part of "strict" option + return {} + } + + try { + debug('parse json') + return JSON.parse(body, reviver) + } catch (e) { + throw normalizeJsonSyntaxError(e, { + message: e.message, + stack: e.stack + }) + } + } +} + +/** + * Create strict violation syntax error matching native error. + * + * @param {string} str + * @param {string} char + * @returns {Error} + * @private + */ +function createStrictSyntaxError (str, char) { + const index = str.indexOf(char) + let partial = '' + + if (index !== -1) { + partial = str.substring(0, index) + JSON_SYNTAX_CHAR.repeat(str.length - index) + } + + try { + JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') + } catch (e) { + return normalizeJsonSyntaxError(e, { + message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) { + return str.substring(index, index + placeholder.length) + }), + stack: e.stack + }) + } +} + +/** + * Get the first non-whitespace character in a string. + * + * @param {string} str + * @returns {string|undefined} + * @private + */ +function firstchar (str) { + const match = FIRST_CHAR_REGEXP.exec(str) + + return match + ? match[1] + : undefined +} + +/** + * Normalize a SyntaxError for JSON.parse. + * + * @param {SyntaxError} error + * @param {Object} obj + * @returns {SyntaxError} + * @private + */ +function normalizeJsonSyntaxError (error, obj) { + const keys = Object.getOwnPropertyNames(error) + + for (let i = 0; i < keys.length; i++) { + const key = keys[i] + if (key !== 'stack' && key !== 'message') { + delete error[key] + } + } + + // replace stack before message for Node.js 0.10 and below + error.stack = obj.stack.replace(error.message, obj.message) + error.message = obj.message + + return error +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/raw.js b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/raw.js new file mode 100644 index 0000000000000000000000000000000000000000..c84083b0e01e2068a88b5498917436d9c8632296 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/raw.js @@ -0,0 +1,42 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + */ + +const debug = require('debug')('body-parser:raw') +const read = require('../read') +const { normalizeOptions, passthrough } = require('../utils') + +/** + * Module exports. + */ + +module.exports = raw + +/** + * Create a middleware to parse raw bodies. + * + * @param {Object} [options] + * @returns {Function} + * @public + */ +function raw (options) { + const normalizedOptions = normalizeOptions(options, 'application/octet-stream') + + const readOptions = { + ...normalizedOptions, + // Skip charset validation and parse the body as is + skipCharset: true + } + + return function rawParser (req, res, next) { + read(req, res, next, passthrough, debug, readOptions) + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/text.js b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/text.js new file mode 100644 index 0000000000000000000000000000000000000000..893c80127c007813bb91c1b4dc20b3065f3d168b --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/text.js @@ -0,0 +1,36 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + */ + +const debug = require('debug')('body-parser:text') +const read = require('../read') +const { normalizeOptions, passthrough } = require('../utils') + +/** + * Module exports. + */ + +module.exports = text + +/** + * Create a middleware to parse text bodies. + * + * @param {Object} [options] + * @returns {Function} + * @public + */ +function text (options) { + const normalizedOptions = normalizeOptions(options, 'text/plain') + + return function textParser (req, res, next) { + read(req, res, next, passthrough, debug, normalizedOptions) + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/urlencoded.js b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/urlencoded.js new file mode 100644 index 0000000000000000000000000000000000000000..1db964cba7371faf0e467733cb39c9792bb00938 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/types/urlencoded.js @@ -0,0 +1,138 @@ +/*! + * body-parser + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const createError = require('http-errors') +const debug = require('debug')('body-parser:urlencoded') +const read = require('../read') +const qs = require('qs') +const { normalizeOptions } = require('../utils') + +/** + * Module exports. + */ + +module.exports = urlencoded + +/** + * Create a middleware to parse urlencoded bodies. + * + * @param {Object} [options] + * @returns {Function} + * @public + */ +function urlencoded (options) { + const normalizedOptions = normalizeOptions(options, 'application/x-www-form-urlencoded') + + if (normalizedOptions.defaultCharset !== 'utf-8' && normalizedOptions.defaultCharset !== 'iso-8859-1') { + throw new TypeError('option defaultCharset must be either utf-8 or iso-8859-1') + } + + // create the appropriate query parser + const parse = createQueryParser(options) + + const readOptions = { + ...normalizedOptions, + // assert charset + isValidCharset: (charset) => charset === 'utf-8' || charset === 'iso-8859-1' + } + + return function urlencodedParser (req, res, next) { + read(req, res, next, parse, debug, readOptions) + } +} + +/** + * Get the extended query parser. + * + * @param {Object} options + * @returns {Function} + * @private + */ +function createQueryParser (options) { + const extended = Boolean(options?.extended) + let parameterLimit = options?.parameterLimit !== undefined + ? options?.parameterLimit + : 1000 + const charsetSentinel = options?.charsetSentinel + const interpretNumericEntities = options?.interpretNumericEntities + const depth = extended ? (options?.depth !== undefined ? options?.depth : 32) : 0 + + if (isNaN(parameterLimit) || parameterLimit < 1) { + throw new TypeError('option parameterLimit must be a positive number') + } + + if (isNaN(depth) || depth < 0) { + throw new TypeError('option depth must be a zero or a positive number') + } + + if (isFinite(parameterLimit)) { + parameterLimit = parameterLimit | 0 + } + + return function parse (body, encoding) { + if (!body.length) return {} + + const paramCount = parameterCount(body, parameterLimit) + + if (paramCount === undefined) { + debug('too many parameters') + throw createError(413, 'too many parameters', { + type: 'parameters.too.many' + }) + } + + const arrayLimit = extended ? Math.max(100, paramCount) : paramCount + + debug('parse ' + (extended ? 'extended ' : '') + 'urlencoding') + try { + return qs.parse(body, { + allowPrototypes: true, + arrayLimit: arrayLimit, + depth: depth, + charsetSentinel: charsetSentinel, + interpretNumericEntities: interpretNumericEntities, + charset: encoding, + parameterLimit: parameterLimit, + strictDepth: true + }) + } catch (err) { + if (err instanceof RangeError) { + throw createError(400, 'The input exceeded the depth', { + type: 'querystring.parse.rangeError' + }) + } else { + throw err + } + } + } +} + +/** + * Count the number of parameters, stopping once limit reached + * + * @param {string} body + * @param {number} limit + * @returns {number|undefined} Returns undefined if limit exceeded + * @private + */ +function parameterCount (body, limit) { + let count = 0 + let index = -1 + do { + count++ + if (count > limit) return undefined // Early exit if limit exceeded + index = body.indexOf('&', index + 1) + } while (index !== -1) + return count +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/utils.js b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..7a0dda43c36d9998b2bd6c13cbeecf67af9e1e3e --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/lib/utils.js @@ -0,0 +1,100 @@ +'use strict' + +/** + * Module dependencies. + */ + +const bytes = require('bytes') +const contentType = require('content-type') +const typeis = require('type-is') + +/** + * Module exports. + */ +module.exports = { + getCharset, + normalizeOptions, + passthrough +} + +/** + * Get the charset of a request. + * + * @param {Object} req + * @returns {string | undefined} + * @private + */ +function getCharset (req) { + const header = req.headers['content-type'] + if (!header) return undefined + return contentType.parse(header).parameters.charset?.toLowerCase() +} + +/** + * Get the simple type checker. + * + * @param {string | string[]} type + * @returns {Function} + * @private + */ +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) + } +} + +/** + * Normalizes the common options for all parsers. + * + * @param {Object} options options to normalize + * @param {string | string[] | Function} defaultType default content type(s) or a function to determine it + * @returns {Object} + * @private + */ +function normalizeOptions (options, defaultType) { + if (!defaultType) { + // Parsers must define a default content type + throw new TypeError('defaultType must be provided') + } + + const inflate = options?.inflate !== false + const limit = typeof options?.limit === 'undefined' || options?.limit === null + ? 102400 // 100kb default + : bytes.parse(options.limit) + const type = options?.type || defaultType + const verify = options?.verify || false + const defaultCharset = options?.defaultCharset || 'utf-8' + + if (limit === null) { + throw new TypeError(`option limit "${String(options.limit)}" is invalid`) + } + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') + } + + // create the appropriate type checking function + const shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + + return { + inflate, + limit, + verify, + defaultCharset, + shouldParse + } +} + +/** + * Passthrough function that returns input unchanged. + * Used by parsers that don't need to transform the data. + * + * @param {*} value + * @returns {*} + * @private + */ +function passthrough (value) { + return value +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/LICENSE b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..34b1a2de37216b60b749c23b6f894e51d701ecf0 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/README.md b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7f6847d54901b26a15beec1c5c075cab1e0ddd2b --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/README.md @@ -0,0 +1,69 @@ +# content-type + +[![NPM version][npm-image]][npm-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Build status][build-image]][build-url] +[![Build coverage][coverage-image]][coverage-url] +[![License][license-image]][license-url] + +Create and parse HTTP `Content-Type` header. + +## Installation + +```sh +npm install content-type +``` + +## API + +```js +const contentType = require("content-type"); +``` + +### contentType.parse(string, options?) + +```js +const obj = contentType.parse("image/svg+xml; charset=utf-8"); +``` + +Parse a `Content-Type` header. This will return an object with the following properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): + +- `type`: The media type. Example: `'image/svg+xml'`. +- `parameters`: An object of the parameters in the media type (parameter name is always lower case). Example: `{charset: 'utf-8'}`. + +The parser is lenient and does not error. You should validate `type` and `parameters` before trusting them. + +#### Options + +- `parameters` (default: `true`): Set to `false` to skip parameters. + +### contentType.format(obj) + +```js +const str = contentType.format({ + type: "image/svg+xml", + parameters: { charset: "utf-8" }, +}); +``` + +Format an object into a `Content-Type` header. This will return a string of the content type for the given object with the following properties (examples are shown that produce the string `'image/svg+xml; charset=utf-8'`): + +- `type`: The media type. Example: `'image/svg+xml'`. +- `parameters`: An optional object of the parameters in the media type. Example: `{charset: 'utf-8'}`. + +Throws a `TypeError` if the object contains an invalid type or parameter names. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/content-type +[npm-url]: https://npmjs.org/package/content-type +[downloads-image]: https://img.shields.io/npm/dm/content-type +[downloads-url]: https://npmjs.org/package/content-type +[build-image]: https://img.shields.io/github/actions/workflow/status/jshttp/content-type/ci.yml?branch=master +[build-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml?query=branch%3Amaster +[coverage-image]: https://img.shields.io/codecov/c/gh/jshttp/content-type +[coverage-url]: https://codecov.io/gh/jshttp/content-type +[license-image]: http://img.shields.io/npm/l/content-type.svg?style=flat +[license-url]: LICENSE diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/dist/index.d.ts b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e7289826ff456e1b3bedee2cdad38122e898194 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/dist/index.d.ts @@ -0,0 +1,26 @@ +/*! + * content-type + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ +/** + * The content type object contains a type string and optional parameters. + */ +export interface ContentType { + type: string; + parameters: Record; +} +/** + * Format an object into a `Content-Type` header. + */ +export declare function format(obj: Partial): string; +/** + * Options for parsing a `Content-Type` header. + */ +export interface ParseOptions { + parameters?: boolean; +} +/** + * Parse a `Content-Type` header. + */ +export declare function parse(header: string, options?: ParseOptions): ContentType; diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/dist/index.js b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4026f973dafb1cbfde16dfe0ee72c48492fb299c --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/dist/index.js @@ -0,0 +1,170 @@ +"use strict"; +/*! + * content-type + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.format = format; +exports.parse = parse; +const TEXT_REGEXP = /^[\u0009\u0020-\u007e\u0080-\u00ff]*$/; +const TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; +/** + * RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4 + */ +const QUOTE_REGEXP = /[\\"]/g; +/** + * RegExp to match type in RFC 9110 sec 8.3.1 + * + * media-type = type "/" subtype + * type = token + * subtype = token + */ +const TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; +/** + * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`. + */ +const NullObject = /* @__PURE__ */ (() => { + const C = function () { }; + C.prototype = Object.create(null); + return C; +})(); +/** + * Format an object into a `Content-Type` header. + */ +function format(obj) { + const { type, parameters } = obj; + if (!type || !TYPE_REGEXP.test(type)) { + throw new TypeError(`Invalid type: ${type}`); + } + let result = type; + if (parameters) { + for (const param of Object.keys(parameters)) { + if (!TOKEN_REGEXP.test(param)) { + throw new TypeError(`Invalid parameter name: ${param}`); + } + result += `; ${param}=${qstring(parameters[param])}`; + } + } + return result; +} +/** + * Parse a `Content-Type` header. + */ +function parse(header, options) { + const len = header.length; + let index = skipOWS(header, 0, len); + const valueStart = index; + index = skipValue(header, index, len); + const valueEnd = trailingOWS(header, valueStart, index); + const type = header.slice(valueStart, valueEnd).toLowerCase(); + const parameters = options?.parameters === false + ? new NullObject() + : parseParameters(header, index, len); + return { type, parameters }; +} +const SP = 32; // " " +const HTAB = 9; // "\t" +const SEMI = 59; // ";" +const EQ = 61; // "=" +const DQUOTE = 34; // '"' +const BSLASH = 92; // "\\" +/** + * Parses the parameters of a `Content-Type` header starting at the given index. + */ +function parseParameters(header, index, len) { + const parameters = new NullObject(); + parameter: while (index < len) { + index = skipOWS(header, index + 1 /* Skip over ; */, len); + const keyStart = index; + while (index < len) { + const code = header.charCodeAt(index); + if (code === SEMI) + continue parameter; + if (code === EQ) { + const keyEnd = trailingOWS(header, keyStart, index); + const key = header.slice(keyStart, keyEnd).toLowerCase(); + index = skipOWS(header, index + 1, len); + if (index < len && header.charCodeAt(index) === DQUOTE) { + index++; + let value = ""; + while (index < len) { + const code = header.charCodeAt(index++); + if (code === DQUOTE) { + index = skipValue(header, index, len); + if (parameters[key] === undefined) + parameters[key] = value; + break; + } + if (code === BSLASH && index < len) { + value += header[index++]; + continue; + } + value += String.fromCharCode(code); + } + continue parameter; + } + const valueStart = index; + index = skipValue(header, index, len); + if (parameters[key] === undefined) { + const valueEnd = trailingOWS(header, valueStart, index); + parameters[key] = header.slice(valueStart, valueEnd); + } + continue parameter; + } + index++; + } + } + return parameters; +} +/** + * Skip over characters until a semicolon. + */ +function skipValue(str, index, len) { + while (index < len) { + const char = str.charCodeAt(index); + if (char === SEMI) + break; + index++; + } + return index; +} +/** + * Skip optional whitespace (OWS) in an HTTP header value. + * + * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t"). + */ +function skipOWS(header, index, len) { + while (index < len) { + const char = header.charCodeAt(index); + if (char !== SP && char !== HTAB) + break; + index++; + } + return index; +} +/** + * Trim optional whitespace (OWS) from the end of a substring. + * + * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t"). + */ +function trailingOWS(header, start, end) { + while (end > start) { + const char = header.charCodeAt(end - 1); + if (char !== SP && char !== HTAB) + break; + end--; + } + return end; +} +/** + * Serialize a parameter value. + */ +function qstring(str) { + if (TOKEN_REGEXP.test(str)) + return str; + if (TEXT_REGEXP.test(str)) + return `"${str.replace(QUOTE_REGEXP, "\\$&")}"`; + throw new TypeError(`Invalid parameter value: ${str}`); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/dist/index.js.map b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..db5da25d1a2a305facb5efdc7ff9b9ef6681c8e2 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAwCH,wBAoBC;AAYD,sBAcC;AApFD,MAAM,WAAW,GAAG,uCAAuC,CAAC;AAC5D,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAErD;;GAEG;AACH,MAAM,YAAY,GAAG,QAAQ,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,WAAW,GACf,4DAA4D,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE;IACvC,MAAM,CAAC,GAAG,cAAa,CAAC,CAAC;IACzB,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,CAAC,CAAC;AACX,CAAC,CAAC,EAAgC,CAAC;AAUnC;;GAEG;AACH,SAAgB,MAAM,CAAC,GAAyB;IAC9C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;IAEjC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,SAAS,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,MAAM,GAAG,IAAI,CAAC;IAElB,IAAI,UAAU,EAAE,CAAC;QACf,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC9B,MAAM,IAAI,SAAS,CAAC,2BAA2B,KAAK,EAAE,CAAC,CAAC;YAC1D,CAAC;YAED,MAAM,IAAI,KAAK,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AASD;;GAEG;AACH,SAAgB,KAAK,CAAC,MAAc,EAAE,OAAsB;IAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1B,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IAEpC,MAAM,UAAU,GAAG,KAAK,CAAC;IACzB,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9D,MAAM,UAAU,GACd,OAAO,EAAE,UAAU,KAAK,KAAK;QAC3B,CAAC,CAAC,IAAI,UAAU,EAAE;QAClB,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAE1C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM;AACrB,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO;AACvB,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,MAAM;AACvB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM;AACrB,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,MAAM;AACzB,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,OAAO;AAE1B;;GAEG;AACH,SAAS,eAAe,CACtB,MAAc,EACd,KAAa,EACb,GAAW;IAEX,MAAM,UAAU,GAA2B,IAAI,UAAU,EAAE,CAAC;IAE5D,SAAS,EAAE,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;QAC9B,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;QAE1D,MAAM,QAAQ,GAAG,KAAK,CAAC;QAEvB,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;YACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACtC,IAAI,IAAI,KAAK,IAAI;gBAAE,SAAS,SAAS,CAAC;YAEtC,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;gBAChB,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;gBACpD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;gBAEzD,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;gBAExC,IAAI,KAAK,GAAG,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,MAAM,EAAE,CAAC;oBACvD,KAAK,EAAE,CAAC;oBAER,IAAI,KAAK,GAAG,EAAE,CAAC;oBACf,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;wBACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;wBACxC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;4BACpB,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;4BACtC,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,SAAS;gCAAE,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;4BAC3D,MAAM;wBACR,CAAC;wBAED,IAAI,IAAI,KAAK,MAAM,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;4BACnC,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;4BACzB,SAAS;wBACX,CAAC;wBAED,KAAK,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;oBACrC,CAAC;oBAED,SAAS,SAAS,CAAC;gBACrB,CAAC;gBAED,MAAM,UAAU,GAAG,KAAK,CAAC;gBACzB,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;gBAEtC,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;oBAClC,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;oBACxD,UAAU,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;gBACvD,CAAC;gBAED,SAAS,SAAS,CAAC;YACrB,CAAC;YAED,KAAK,EAAE,CAAC;QACV,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,SAAS,SAAS,CAAC,GAAW,EAAE,KAAa,EAAE,GAAW;IACxD,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM;QACzB,KAAK,EAAE,CAAC;IACV,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,OAAO,CAAC,MAAc,EAAE,KAAa,EAAE,GAAW;IACzD,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM;QACxC,KAAK,EAAE,CAAC;IACV,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,MAAc,EAAE,KAAa,EAAE,GAAW;IAC7D,OAAO,GAAG,GAAG,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACxC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM;QACxC,GAAG,EAAE,CAAC;IACR,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;GAEG;AACH,SAAS,OAAO,CAAC,GAAW;IAC1B,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACvC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC;IAE3E,MAAM,IAAI,SAAS,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * content-type\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\nconst TEXT_REGEXP = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]*$/;\nconst TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4\n */\nconst QUOTE_REGEXP = /[\\\\\"]/g;\n\n/**\n * RegExp to match type in RFC 9110 sec 8.3.1\n *\n * media-type = type \"/\" subtype\n * type = token\n * subtype = token\n */\nconst TYPE_REGEXP =\n /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;\n\n/**\n * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`.\n */\nconst NullObject = /* @__PURE__ */ (() => {\n const C = function () {};\n C.prototype = Object.create(null);\n return C;\n})() as unknown as { new (): any };\n\n/**\n * The content type object contains a type string and optional parameters.\n */\nexport interface ContentType {\n type: string;\n parameters: Record;\n}\n\n/**\n * Format an object into a `Content-Type` header.\n */\nexport function format(obj: Partial): string {\n const { type, parameters } = obj;\n\n if (!type || !TYPE_REGEXP.test(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n\n let result = type;\n\n if (parameters) {\n for (const param of Object.keys(parameters)) {\n if (!TOKEN_REGEXP.test(param)) {\n throw new TypeError(`Invalid parameter name: ${param}`);\n }\n\n result += `; ${param}=${qstring(parameters[param])}`;\n }\n }\n\n return result;\n}\n\n/**\n * Options for parsing a `Content-Type` header.\n */\nexport interface ParseOptions {\n parameters?: boolean;\n}\n\n/**\n * Parse a `Content-Type` header.\n */\nexport function parse(header: string, options?: ParseOptions): ContentType {\n const len = header.length;\n let index = skipOWS(header, 0, len);\n\n const valueStart = index;\n index = skipValue(header, index, len);\n const valueEnd = trailingOWS(header, valueStart, index);\n const type = header.slice(valueStart, valueEnd).toLowerCase();\n const parameters =\n options?.parameters === false\n ? new NullObject()\n : parseParameters(header, index, len);\n\n return { type, parameters };\n}\n\nconst SP = 32; // \" \"\nconst HTAB = 9; // \"\\t\"\nconst SEMI = 59; // \";\"\nconst EQ = 61; // \"=\"\nconst DQUOTE = 34; // '\"'\nconst BSLASH = 92; // \"\\\\\"\n\n/**\n * Parses the parameters of a `Content-Type` header starting at the given index.\n */\nfunction parseParameters(\n header: string,\n index: number,\n len: number,\n): Record {\n const parameters: Record = new NullObject();\n\n parameter: while (index < len) {\n index = skipOWS(header, index + 1 /* Skip over ; */, len);\n\n const keyStart = index;\n\n while (index < len) {\n const code = header.charCodeAt(index);\n if (code === SEMI) continue parameter;\n\n if (code === EQ) {\n const keyEnd = trailingOWS(header, keyStart, index);\n const key = header.slice(keyStart, keyEnd).toLowerCase();\n\n index = skipOWS(header, index + 1, len);\n\n if (index < len && header.charCodeAt(index) === DQUOTE) {\n index++;\n\n let value = \"\";\n while (index < len) {\n const code = header.charCodeAt(index++);\n if (code === DQUOTE) {\n index = skipValue(header, index, len);\n if (parameters[key] === undefined) parameters[key] = value;\n break;\n }\n\n if (code === BSLASH && index < len) {\n value += header[index++];\n continue;\n }\n\n value += String.fromCharCode(code);\n }\n\n continue parameter;\n }\n\n const valueStart = index;\n index = skipValue(header, index, len);\n\n if (parameters[key] === undefined) {\n const valueEnd = trailingOWS(header, valueStart, index);\n parameters[key] = header.slice(valueStart, valueEnd);\n }\n\n continue parameter;\n }\n\n index++;\n }\n }\n\n return parameters;\n}\n\n/**\n * Skip over characters until a semicolon.\n */\nfunction skipValue(str: string, index: number, len: number): number {\n while (index < len) {\n const char = str.charCodeAt(index);\n if (char === SEMI) break;\n index++;\n }\n return index;\n}\n\n/**\n * Skip optional whitespace (OWS) in an HTTP header value.\n *\n * OWS is defined in RFC 9110 sec 5.6.3 as SP (\" \") or HTAB (\"\\t\").\n */\nfunction skipOWS(header: string, index: number, len: number): number {\n while (index < len) {\n const char = header.charCodeAt(index);\n if (char !== SP && char !== HTAB) break;\n index++;\n }\n return index;\n}\n\n/**\n * Trim optional whitespace (OWS) from the end of a substring.\n *\n * OWS is defined in RFC 9110 sec 5.6.3 as SP (\" \") or HTAB (\"\\t\").\n */\nfunction trailingOWS(header: string, start: number, end: number): number {\n while (end > start) {\n const char = header.charCodeAt(end - 1);\n if (char !== SP && char !== HTAB) break;\n end--;\n }\n return end;\n}\n\n/**\n * Serialize a parameter value.\n */\nfunction qstring(str: string): string {\n if (TOKEN_REGEXP.test(str)) return str;\n if (TEXT_REGEXP.test(str)) return `\"${str.replace(QUOTE_REGEXP, \"\\\\$&\")}\"`;\n\n throw new TypeError(`Invalid parameter value: ${str}`);\n}\n"]} \ No newline at end of file diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/package.json b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/package.json new file mode 100644 index 0000000000000000000000000000000000000000..482cbc80aba81d30557427cd85ac005e3f8217c9 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/content-type/package.json @@ -0,0 +1,52 @@ +{ + "name": "content-type", + "version": "2.0.0", + "description": "Create and parse HTTP Content-Type header", + "keywords": [ + "content-type", + "http", + "req", + "res", + "rfc7231", + "rfc9110" + ], + "repository": "jshttp/content-type", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "license": "MIT", + "author": "Douglas Christopher Wilson ", + "type": "commonjs", + "exports": "./dist/index.js", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "bench": "vitest bench", + "build": "ts-scripts build", + "format": "ts-scripts format", + "prepare": "ts-scripts install && npm run build", + "specs": "ts-scripts specs", + "test": "ts-scripts test" + }, + "devDependencies": { + "@borderless/ts-scripts": "^0.15.0", + "@vitest/coverage-v8": "^3.0.5", + "typescript": "^5.7.3", + "vitest": "^3.2.4" + }, + "engines": { + "node": ">=18" + }, + "ts-scripts": { + "dist": [ + "dist" + ], + "project": [ + "tsconfig.build.json" + ] + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/HISTORY.md b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..6812655c8879f5dc3ff3182ed0741fd8c93b347c --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/HISTORY.md @@ -0,0 +1,292 @@ +2.0.1 / 2025-03-27 +========== + +2.0.0 / 2024-08-31 +========== + + * Drop node <18 + * Use `content-type@^1.0.5` and `media-typer@^1.0.0` for type validation + - No behavior changes, upgrades `media-typer` + * deps: mime-types@^3.0.0 + - Add `application/toml` with extension `.toml` + - Add `application/ubjson` with extension `.ubj` + - Add `application/x-keepass2` with extension `.kdbx` + - Add deprecated iWorks mime types and extensions + - Add extension `.amr` to `audio/amr` + - Add extension `.cjs` to `application/node` + - Add extension `.dbf` to `application/vnd.dbf` + - Add extension `.m4s` to `video/iso.segment` + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extension `.opus` to `audio/ogg` + - Add extension `.rar` to `application/vnd.rar` + - Add extension `.td` to `application/urc-targetdesc+xml` + - Add extension `.trig` to `application/trig` + - Add extensions from IANA for `application/*+xml` types + - Add `image/avif` with extension `.avif` + - Add `image/ktx2` with extension `.ktx2` + - Add `image/vnd.ms-dds` with extension `.dds` + - Add new upstream MIME types + - Fix extension of `application/vnd.apple.keynote` to be `.key` + - Remove ambigious extensions from IANA for `application/*+xml` types + - Update primary extension to `.es` for `application/ecmascript` + +1.6.18 / 2019-04-26 +=================== + + * Fix regression passing request object to `typeis.is` + +1.6.17 / 2019-04-25 +=================== + + * deps: mime-types@~2.1.24 + - Add Apple file extensions from IANA + - Add extension `.csl` to `application/vnd.citationstyles.style+xml` + - Add extension `.es` to `application/ecmascript` + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add extension `.owl` to `application/rdf+xml` + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add extensions from IANA for `image/*` types + - Add extensions from IANA for `model/*` types + - Add extensions to HEIC image types + - Add new mime types + - Add `text/mdx` with extension `.mdx` + * perf: prevent internal `throw` on invalid type + +1.6.16 / 2018-02-16 +=================== + + * deps: mime-types@~2.1.18 + - Add `application/raml+yaml` with extension `.raml` + - Add `application/wasm` with extension `.wasm` + - Add `text/shex` with extension `.shex` + - Add extensions for JPEG-2000 images + - Add extensions from IANA for `message/*` types + - Add extension `.mjs` to `application/javascript` + - Add extension `.wadl` to `application/vnd.sun.wadl+xml` + - Add extension `.gz` to `application/gzip` + - Add glTF types and extensions + - Add new mime types + - Update extensions `.md` and `.markdown` to be `text/markdown` + - Update font MIME types + - Update `text/hjson` to registered `application/hjson` + +1.6.15 / 2017-03-31 +=================== + + * deps: mime-types@~2.1.15 + - Add new mime types + +1.6.14 / 2016-11-18 +=================== + + * deps: mime-types@~2.1.13 + - Add new mime types + +1.6.13 / 2016-05-18 +=================== + + * deps: mime-types@~2.1.11 + - Add new mime types + +1.6.12 / 2016-02-28 +=================== + + * deps: mime-types@~2.1.10 + - Add new mime types + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + +1.6.11 / 2016-01-29 +=================== + + * deps: mime-types@~2.1.9 + - Add new mime types + +1.6.10 / 2015-12-01 +=================== + + * deps: mime-types@~2.1.8 + - Add new mime types + +1.6.9 / 2015-09-27 +================== + + * deps: mime-types@~2.1.7 + - Add new mime types + +1.6.8 / 2015-09-04 +================== + + * deps: mime-types@~2.1.6 + - Add new mime types + +1.6.7 / 2015-08-20 +================== + + * Fix type error when given invalid type to match against + * deps: mime-types@~2.1.5 + - Add new mime types + +1.6.6 / 2015-07-31 +================== + + * deps: mime-types@~2.1.4 + - Add new mime types + +1.6.5 / 2015-07-16 +================== + + * deps: mime-types@~2.1.3 + - Add new mime types + +1.6.4 / 2015-07-01 +================== + + * deps: mime-types@~2.1.2 + - Add new mime types + * perf: enable strict mode + * perf: remove argument reassignment + +1.6.3 / 2015-06-08 +================== + + * deps: mime-types@~2.1.1 + - Add new mime types + * perf: reduce try block size + * perf: remove bitwise operations + +1.6.2 / 2015-05-10 +================== + + * deps: mime-types@~2.0.11 + - Add new mime types + +1.6.1 / 2015-03-13 +================== + + * deps: mime-types@~2.0.10 + - Add new mime types + +1.6.0 / 2015-02-12 +================== + + * fix false-positives in `hasBody` `Transfer-Encoding` check + * support wildcard for both type and subtype (`*/*`) + +1.5.7 / 2015-02-09 +================== + + * fix argument reassignment + * deps: mime-types@~2.0.9 + - Add new mime types + +1.5.6 / 2015-01-29 +================== + + * deps: mime-types@~2.0.8 + - Add new mime types + +1.5.5 / 2014-12-30 +================== + + * deps: mime-types@~2.0.7 + - Add new mime types + - Fix missing extensions + - Fix various invalid MIME type entries + - Remove example template MIME types + - deps: mime-db@~1.5.0 + +1.5.4 / 2014-12-10 +================== + + * deps: mime-types@~2.0.4 + - Add new mime types + - deps: mime-db@~1.3.0 + +1.5.3 / 2014-11-09 +================== + + * deps: mime-types@~2.0.3 + - Add new mime types + - deps: mime-db@~1.2.0 + +1.5.2 / 2014-09-28 +================== + + * deps: mime-types@~2.0.2 + - Add new mime types + - deps: mime-db@~1.1.0 + +1.5.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + * deps: media-typer@0.3.0 + * deps: mime-types@~2.0.1 + - Support Node.js 0.6 + +1.5.0 / 2014-09-05 +================== + + * fix `hasbody` to be true for `content-length: 0` + +1.4.0 / 2014-09-02 +================== + + * update mime-types + +1.3.2 / 2014-06-24 +================== + + * use `~` range on mime-types + +1.3.1 / 2014-06-19 +================== + + * fix global variable leak + +1.3.0 / 2014-06-19 +================== + + * improve type parsing + + - invalid media type never matches + - media type not case-sensitive + - extra LWS does not affect results + +1.2.2 / 2014-06-19 +================== + + * fix behavior on unknown type argument + +1.2.1 / 2014-06-03 +================== + + * switch dependency from `mime` to `mime-types@1.0.0` + +1.2.0 / 2014-05-11 +================== + + * support suffix matching: + + - `+json` matches `application/vnd+json` + - `*/vnd+json` matches `application/vnd+json` + - `application/*+json` matches `application/vnd+json` + +1.1.0 / 2014-04-12 +================== + + * add non-array values support + * expose internal utilities: + + - `.is()` + - `.hasBody()` + - `.normalize()` + - `.match()` + +1.0.1 / 2014-03-30 +================== + + * add `multipart` as a shorthand diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/LICENSE b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..386b7b6946e47bc46f8138791049b4e6a7cef889 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/README.md b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d23946e607b8d0ea667b7ffefe7e63a68e052df7 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/README.md @@ -0,0 +1,198 @@ +# type-is + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Infer the content-type of a request. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install type-is +``` + +## API + +```js +var http = require('http') +var typeis = require('type-is') + +http.createServer(function (req, res) { + var istext = typeis(req, ['text/*']) + res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text') +}) +``` + +### typeis(request, types) + +Checks if the `request` is one of the `types`. If the request has no body, +even if there is a `Content-Type` header, then `null` is returned. If the +`Content-Type` header is invalid or does not matches any of the `types`, then +`false` is returned. Otherwise, a string of the type that matched is returned. + +The `request` argument is expected to be a Node.js HTTP request. The `types` +argument is an array of type strings. + +Each type in the `types` array can be one of the following: + +- A file extension name such as `json`. This name will be returned if matched. +- A mime type such as `application/json`. +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. + The full mime type will be returned if matched. +- A suffix such as `+json`. This can be combined with a wildcard such as + `*/vnd+json` or `application/*+json`. The full mime type will be returned + if matched. + +Some examples to illustrate the inputs and returned value: + +```js +// req.headers.content-type = 'application/json' + +typeis(req, ['json']) // => 'json' +typeis(req, ['html', 'json']) // => 'json' +typeis(req, ['application/*']) // => 'application/json' +typeis(req, ['application/json']) // => 'application/json' + +typeis(req, ['html']) // => false +``` + +### typeis.hasBody(request) + +Returns a Boolean if the given `request` has a body, regardless of the +`Content-Type` header. + +Having a body has no relation to how large the body is (it may be 0 bytes). +This is similar to how file existence works. If a body does exist, then this +indicates that there is data to read from the Node.js request stream. + +```js +if (typeis.hasBody(req)) { + // read the body, since there is one + + req.on('data', function (chunk) { + // ... + }) +} +``` + +### typeis.is(mediaType, types) + +Checks if the `mediaType` is one of the `types`. If the `mediaType` is invalid +or does not matches any of the `types`, then `false` is returned. Otherwise, a +string of the type that matched is returned. + +The `mediaType` argument is expected to be a +[media type](https://tools.ietf.org/html/rfc6838) string. The `types` argument +is an array of type strings. + +Each type in the `types` array can be one of the following: + +- A file extension name such as `json`. This name will be returned if matched. +- A mime type such as `application/json`. +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. + The full mime type will be returned if matched. +- A suffix such as `+json`. This can be combined with a wildcard such as + `*/vnd+json` or `application/*+json`. The full mime type will be returned + if matched. + +Some examples to illustrate the inputs and returned value: + +```js +var mediaType = 'application/json' + +typeis.is(mediaType, ['json']) // => 'json' +typeis.is(mediaType, ['html', 'json']) // => 'json' +typeis.is(mediaType, ['application/*']) // => 'application/json' +typeis.is(mediaType, ['application/json']) // => 'application/json' + +typeis.is(mediaType, ['html']) // => false +``` + +### typeis.match(expected, actual) + +Match the type string `expected` with `actual`, taking in to account wildcards. +A wildcard can only be in the type of the subtype part of a media type and only +in the `expected` value (as `actual` should be the real media type to match). A +suffix can still be included even with a wildcard subtype. If an input is +malformed, `false` will be returned. + +```js +typeis.match('text/html', 'text/html') // => true +typeis.match('*/html', 'text/html') // => true +typeis.match('text/*', 'text/html') // => true +typeis.match('*/*', 'text/html') // => true +typeis.match('*/*+json', 'application/x-custom+json') // => true +``` + +### typeis.normalize(type) + +Normalize a `type` string. This works by performing the following: + +- If the `type` is not a string, `false` is returned. +- If the string starts with `+` (so it is a `+suffix` shorthand like `+json`), + then it is expanded to contain the complete wildcard notation of `*/*+suffix`. +- If the string contains a `/`, then it is returned as the type. +- Else the string is assumed to be a file extension and the mapped media type is + returned, or `false` is there is no mapping. + +This includes two special mappings: + +- `'multipart'` -> `'multipart/*'` +- `'urlencoded'` -> `'application/x-www-form-urlencoded'` + +## Examples + +### Example body parser + +```js +var express = require('express') +var typeis = require('type-is') + +var app = express() + +app.use(function bodyParser (req, res, next) { + if (!typeis.hasBody(req)) { + return next() + } + + switch (typeis(req, ['urlencoded', 'json', 'multipart'])) { + case 'urlencoded': + // parse urlencoded body + throw new Error('implement urlencoded body parsing') + case 'json': + // parse json body + throw new Error('implement json body parsing') + case 'multipart': + // parse multipart body + throw new Error('implement multipart body parsing') + default: + // 415 error code + res.statusCode = 415 + res.end() + break + } +}) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/type-is/master?label=ci +[ci-url]: https://github.com/jshttp/type-is/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/type-is/master +[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master +[node-version-image]: https://badgen.net/npm/node/type-is +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/type-is +[npm-url]: https://npmjs.org/package/type-is +[npm-version-image]: https://badgen.net/npm/v/type-is +[travis-image]: https://badgen.net/travis/jshttp/type-is/master +[travis-url]: https://travis-ci.org/jshttp/type-is diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/index.js b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/index.js new file mode 100644 index 0000000000000000000000000000000000000000..37d6da3c81e8bdb5bb018b15630a2f7e9c68d76d --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/index.js @@ -0,0 +1,240 @@ +/*! + * type-is + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var contentType = require('content-type') +var mime = require('mime-types') +var typer = require('media-typer') + +/** + * Module exports. + * @public + */ + +module.exports = typeofrequest +module.exports.is = typeis +module.exports.hasBody = hasbody +module.exports.normalize = normalize +module.exports.match = mimeMatch + +/** + * Compare a `value` content-type with `types`. + * Each `type` can be an extension like `html`, + * a special shortcut like `multipart` or `urlencoded`, + * or a mime type. + * + * If no types match, `false` is returned. + * Otherwise, the first `type` that matches is returned. + * + * @param {String} value + * @param {Array} types + * @public + */ + +function typeis (value, types_) { + // Backward compatibility. TODO: Remove. + if (value && typeof value === 'object') { + value = value.headers['content-type'] + } + + var i + var types = types_ + + // remove parameters and normalize + var val = normalizeType(value) + + // no type or invalid + if (!val) { + return false + } + + // support flattened arguments + if (types && !Array.isArray(types)) { + types = new Array(arguments.length - 1) + for (i = 0; i < types.length; i++) { + types[i] = arguments[i + 1] + } + } + + // no types, return the content type + if (!types || !types.length) { + return val + } + + var type + for (i = 0; i < types.length; i++) { + if (mimeMatch(normalize(type = types[i]), val)) { + return type[0] === '+' || type.indexOf('*') !== -1 + ? val + : type + } + } + + // no matches + return false +} + +/** + * Check if a request has a request body. + * A request with a body __must__ either have `transfer-encoding` + * or `content-length` headers set. + * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3 + * + * @param {Object} request + * @return {Boolean} + * @public + */ + +function hasbody (req) { + return req.headers['transfer-encoding'] !== undefined || + !isNaN(req.headers['content-length']) +} + +/** + * Check if the incoming request contains the "Content-Type" + * header field, and it contains any of the give mime `type`s. + * If there is no request body, `null` is returned. + * If there is no content type, `false` is returned. + * Otherwise, it returns the first `type` that matches. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * this.is('html'); // => 'html' + * this.is('text/html'); // => 'text/html' + * this.is('text/*', 'application/json'); // => 'text/html' + * + * // When Content-Type is application/json + * this.is('json', 'urlencoded'); // => 'json' + * this.is('application/json'); // => 'application/json' + * this.is('html', 'application/*'); // => 'application/json' + * + * this.is('html'); // => false + * + * @param {Object} req + * @param {(String|Array)} types... + * @return {(String|false|null)} + * @public + */ + +function typeofrequest (req, types_) { + // no body + if (!hasbody(req)) return null + // support flattened arguments + var types = arguments.length > 2 + ? Array.prototype.slice.call(arguments, 1) + : types_ + // request content type + var value = req.headers['content-type'] + + return typeis(value, types) +} + +/** + * Normalize a mime type. + * If it's a shorthand, expand it to a valid mime type. + * + * In general, you probably want: + * + * var type = is(req, ['urlencoded', 'json', 'multipart']); + * + * Then use the appropriate body parsers. + * These three are the most common request body types + * and are thus ensured to work. + * + * @param {String} type + * @return {String|false|null} + * @public + */ + +function normalize (type) { + if (typeof type !== 'string') { + // invalid type + return false + } + + switch (type) { + case 'urlencoded': + return 'application/x-www-form-urlencoded' + case 'multipart': + return 'multipart/*' + } + + if (type[0] === '+') { + // "+json" -> "*/*+json" expando + return '*/*' + type + } + + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type +} + +/** + * Check if `expected` mime type + * matches `actual` mime type with + * wildcard and +suffix support. + * + * @param {String} expected + * @param {String} actual + * @return {Boolean} + * @public + */ + +function mimeMatch (expected, actual) { + // invalid type + if (expected === false) { + return false + } + + // split types + var actualParts = actual.split('/') + var expectedParts = expected.split('/') + + // invalid format + if (actualParts.length !== 2 || expectedParts.length !== 2) { + return false + } + + // validate type + if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) { + return false + } + + // validate suffix wildcard + if (expectedParts[1].slice(0, 2) === '*+') { + return expectedParts[1].length <= actualParts[1].length + 1 && + expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length) + } + + // validate subtype + if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) { + return false + } + + return true +} + +/** + * Normalize a type and remove parameters. + * + * @param {string} value + * @return {(string|null)} + * @private + */ +function normalizeType (value) { + if (!value) return null + var type = contentType.parse(value, { parameters: false }).type + + return typer.test(type) ? type : null +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/package.json b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/package.json new file mode 100644 index 0000000000000000000000000000000000000000..07c623fc73b08ac347fb979ebd0c33e51ad401ad --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/node_modules/type-is/package.json @@ -0,0 +1,51 @@ +{ + "name": "type-is", + "description": "Infer the content-type of a request.", + "version": "2.1.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/type-is", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "content-type": "^2.0.0", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.31.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 18" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + }, + "keywords": [ + "content", + "type", + "checking" + ] +} diff --git a/node_modules/@nestjs/platform-express/node_modules/body-parser/package.json b/node_modules/@nestjs/platform-express/node_modules/body-parser/package.json new file mode 100644 index 0000000000000000000000000000000000000000..842cfbdbde4cb5afd7c89c760141d35e1e58f4d2 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/body-parser/package.json @@ -0,0 +1,65 @@ +{ + "name": "body-parser", + "description": "Node.js body parsing middleware", + "version": "2.3.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "expressjs/body-parser", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "type": "commonjs", + "exports": { + ".": "./index.js", + "./package.json": "./package.json", + "./json": "./lib/types/json.js", + "./raw": "./lib/types/raw.js", + "./text": "./lib/types/text.js", + "./urlencoded": "./lib/types/urlencoded.js", + "./lib/*": "./lib/*.js", + "./lib/*.js": "./lib/*.js", + "./lib/types/*": "./lib/types/*.js", + "./lib/types/*.js": "./lib/types/*.js" + }, + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^2.0.0", + "debug": "^4.4.3", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.2", + "on-finished": "^2.4.1", + "qs": "^6.15.2", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" + }, + "devDependencies": { + "eslint": "^8.57.1", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.32.0", + "eslint-plugin-markdown": "^3.0.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^6.6.0", + "eslint-plugin-standard": "^4.1.0", + "mocha": "^11.7.6", + "nyc": "^17.1.0", + "supertest": "^7.2.2" + }, + "files": [ + "lib/", + "LICENSE", + "index.js" + ], + "engines": { + "node": ">=18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/content-disposition/LICENSE b/node_modules/@nestjs/platform-express/node_modules/content-disposition/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..84441fbb5709262c2bfc9b5ff0166ad4f024a1b8 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/content-disposition/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/content-disposition/README.md b/node_modules/@nestjs/platform-express/node_modules/content-disposition/README.md new file mode 100644 index 0000000000000000000000000000000000000000..75c91a96e799150a04bec6fb0393eee2cc3ccf11 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/content-disposition/README.md @@ -0,0 +1,141 @@ +# content-disposition + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create and parse HTTP `Content-Disposition` header + +## Installation + +```sh +$ npm install content-disposition +``` + +## API + +```js +const contentDisposition = require('content-disposition') +``` + +### contentDisposition(filename, options) + +Create an attachment `Content-Disposition` header value using the given file name, +if supplied. The `filename` is optional and if no file name is desired, but you +want to specify `options`, set `filename` to `undefined`. + +```js +res.setHeader('Content-Disposition', contentDisposition('∫ maths.pdf')) +``` + +**note** HTTP headers are of the ISO-8859-1 character set. If you are writing this +header through a means different from `setHeader` in Node.js, you'll want to specify +the `'binary'` encoding in Node.js. + +#### Options + +`contentDisposition` accepts these properties in the options object. + +##### fallback + +If the `filename` option is outside ISO-8859-1, then the file name is actually +stored in a supplemental field for clients that support Unicode file names and +a ISO-8859-1 version of the file name is automatically generated. + +This specifies the ISO-8859-1 file name to override the automatic generation or +disables the generation all together, defaults to `true`. + + - A string will specify the ISO-8859-1 file name to use in place of automatic + generation. + - `false` will disable including a ISO-8859-1 file name and only include the + Unicode version (unless the file name is already ISO-8859-1). + - `true` will enable automatic generation if the file name is outside ISO-8859-1. + +If the `filename` option is ISO-8859-1 and this option is specified and has a +different value, then the `filename` option is encoded in the extended field +and this set as the fallback field, even though they are both ISO-8859-1. + +##### type + +Specifies the disposition type, defaults to `"attachment"`. This can also be +`"inline"`, or any other value (all values except inline are treated like +`attachment`, but can convey additional information if both parties agree to +it). The type is normalized to lower-case. + +### contentDisposition.parse(string) + +```js +const disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt') +``` + +Parse a `Content-Disposition` header string. This automatically handles extended +("Unicode") parameters by decoding them and providing them under the standard +parameter name. This will return an object with the following properties (examples +are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'`): + + - `type`: The disposition type (always lower case). Example: `'attachment'` + + - `parameters`: An object of the parameters in the disposition (name of parameter + always lower case and extended versions replace non-extended versions). Example: + `{filename: "€ rates.txt"}` + +## Examples + +### Send a file for download + +```js +const contentDisposition = require('content-disposition') +const fs = require('fs') +const http = require('http') +const onFinished = require('on-finished') + +const filePath = '/path/to/public/plans.pdf' + +http.createServer(function onRequest (req, res) { + // set headers + res.setHeader('Content-Type', 'application/pdf') + res.setHeader('Content-Disposition', contentDisposition(filePath)) + + // send file + const stream = fs.createReadStream(filePath) + stream.pipe(res) + onFinished(res, function () { + stream.destroy() + }) +}) +``` + +## Testing + +```sh +$ npm test +``` + +## References + +- [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1][rfc-2616] +- [RFC 5987: Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters][rfc-5987] +- [RFC 6266: Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)][rfc-6266] +- [Test Cases for HTTP Content-Disposition header field (RFC 6266) and the Encodings defined in RFCs 2047, 2231 and 5987][tc-2231] + +[rfc-2616]: https://datatracker.ietf.org/doc/html/rfc2616 +[rfc-5987]: https://datatracker.ietf.org/doc/html/rfc5987 +[rfc-6266]: https://datatracker.ietf.org/doc/html/rfc6266 +[tc-2231]: http://greenbytes.de/tech/tc2231/ + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/content-disposition +[npm-url]: https://www.npmjs.com/package/content-disposition +[node-version-image]: https://img.shields.io/node/v/content-disposition +[node-version-url]: https://nodejs.org/en/download +[coveralls-image]: https://img.shields.io/coverallsCoverage/github/jshttp/content-disposition +[coveralls-url]: https://coveralls.io/github/jshttp/content-disposition?branch=master +[downloads-image]: https://img.shields.io/npm/dm/content-disposition +[downloads-url]: https://www.npmjs.com/package/content-disposition +[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/jshttp/content-disposition/ci.yml +[github-actions-ci-url]: https://github.com/jshttp/content-disposition/actions/workflows/ci.yml diff --git a/node_modules/@nestjs/platform-express/node_modules/content-disposition/index.js b/node_modules/@nestjs/platform-express/node_modules/content-disposition/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d1e313ac993b187c7bdcc5ea3cafc141209ac126 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/content-disposition/index.js @@ -0,0 +1,536 @@ +/*! + * content-disposition + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = contentDisposition +module.exports.parse = parse + +/** + * TextDecoder instance for UTF-8 decoding when decodeURIComponent fails due to invalid byte sequences. + * @type {TextDecoder} + * @private + */ +const utf8Decoder = new TextDecoder('utf-8') + +/** + * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%") + * @private + */ + +var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex + +/** + * RegExp to match non-latin1 characters. + * @private + */ + +var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g + +/** + * RegExp to match quoted-pair in RFC 2616 + * + * quoted-pair = "\" CHAR + * CHAR = + * @private + */ + +var QESC_REGEXP = /\\([\u0000-\u007f])/g // eslint-disable-line no-control-regex + +/** + * RegExp to match chars that must be quoted-pair in RFC 2616 + * @private + */ + +var QUOTE_REGEXP = /([\\"])/g + +/** + * RegExp for various RFC 2616 grammar + * + * parameter = token "=" ( token | quoted-string ) + * token = 1* + * separators = "(" | ")" | "<" | ">" | "@" + * | "," | ";" | ":" | "\" | <"> + * | "/" | "[" | "]" | "?" | "=" + * | "{" | "}" | SP | HT + * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) + * qdtext = > + * quoted-pair = "\" CHAR + * CHAR = + * TEXT = + * LWS = [CRLF] 1*( SP | HT ) + * CRLF = CR LF + * CR = + * LF = + * SP = + * HT = + * CTL = + * OCTET = + * @private + */ + +var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g // eslint-disable-line no-control-regex +var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/ +var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/ + +/** + * RegExp for various RFC 5987 grammar + * + * ext-value = charset "'" [ language ] "'" value-chars + * charset = "UTF-8" / "ISO-8859-1" / mime-charset + * mime-charset = 1*mime-charsetc + * mime-charsetc = ALPHA / DIGIT + * / "!" / "#" / "$" / "%" / "&" + * / "+" / "-" / "^" / "_" / "`" + * / "{" / "}" / "~" + * language = ( 2*3ALPHA [ extlang ] ) + * / 4ALPHA + * / 5*8ALPHA + * extlang = *3( "-" 3ALPHA ) + * value-chars = *( pct-encoded / attr-char ) + * pct-encoded = "%" HEXDIG HEXDIG + * attr-char = ALPHA / DIGIT + * / "!" / "#" / "$" / "&" / "+" / "-" / "." + * / "^" / "_" / "`" / "|" / "~" + * @private + */ + +var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/ + +/** + * RegExp for various RFC 6266 grammar + * + * disposition-type = "inline" | "attachment" | disp-ext-type + * disp-ext-type = token + * disposition-parm = filename-parm | disp-ext-parm + * filename-parm = "filename" "=" value + * | "filename*" "=" ext-value + * disp-ext-parm = token "=" value + * | ext-token "=" ext-value + * ext-token = + * @private + */ + +var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex + +/** + * Create an attachment Content-Disposition header. + * + * @param {string} [filename] + * @param {object} [options] + * @param {string} [options.type=attachment] + * @param {string|boolean} [options.fallback=true] + * @return {string} + * @public + */ + +function contentDisposition (filename, options) { + var opts = options || {} + + // get type + var type = opts.type || 'attachment' + + // get parameters + var params = createparams(filename, opts.fallback) + + // format into string + return format(new ContentDisposition(type, params)) +} + +/** + * Create parameters object from filename and fallback. + * + * @param {string} [filename] + * @param {string|boolean} [fallback=true] + * @return {object} + * @private + */ + +function createparams (filename, fallback) { + if (filename === undefined) { + return + } + + var params = {} + + if (typeof filename !== 'string') { + throw new TypeError('filename must be a string') + } + + // fallback defaults to true + if (fallback === undefined) { + fallback = true + } + + if (typeof fallback !== 'string' && typeof fallback !== 'boolean') { + throw new TypeError('fallback must be a string or boolean') + } + + if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) { + throw new TypeError('fallback must be ISO-8859-1 string') + } + + // restrict to file base name + var name = basename(filename) + + // determine if name is suitable for quoted string + var isQuotedString = TEXT_REGEXP.test(name) + + // generate fallback name + var fallbackName = typeof fallback !== 'string' + ? fallback && getlatin1(name) + : basename(fallback) + var hasFallback = typeof fallbackName === 'string' && fallbackName !== name + + // set extended filename parameter + if (hasFallback || !isQuotedString || hasHexEscape(name)) { + params['filename*'] = name + } + + // set filename parameter + if (isQuotedString || hasFallback) { + params.filename = hasFallback + ? fallbackName + : name + } + + return params +} + +/** + * Format object to Content-Disposition header. + * + * @param {object} obj + * @param {string} obj.type + * @param {object} [obj.parameters] + * @return {string} + * @private + */ + +function format (obj) { + var parameters = obj.parameters + var type = obj.type + + if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) { + throw new TypeError('invalid type') + } + + // start with normalized type + var string = String(type).toLowerCase() + + // append parameters + if (parameters && typeof parameters === 'object') { + var param + var params = Object.keys(parameters).sort() + + for (var i = 0; i < params.length; i++) { + param = params[i] + + var val = param.slice(-1) === '*' + ? ustring(parameters[param]) + : qstring(parameters[param]) + + string += '; ' + param + '=' + val + } + } + + return string +} + +/** + * Decode a RFC 5987 field value (gracefully). + * + * @param {string} str + * @return {string} + * @private + */ + +function decodefield (str) { + const match = EXT_VALUE_REGEXP.exec(str) + + if (!match) { + throw new TypeError('invalid extended field value') + } + + const charset = match[1].toLowerCase() + const encoded = match[2] + + switch (charset) { + case 'iso-8859-1': + { + const binary = decodeHexEscapes(encoded) + return getlatin1(binary) + } + case 'utf-8': + case 'utf8': + { + try { + return decodeURIComponent(encoded) + } catch { + // Failed to decode with decodeURIComponent, fallback to lenient decoding which replaces invalid UTF-8 byte sequences with the Unicode replacement character + // TODO: Consider removing in the next major version to be more strict about invalid percent-encodings + const binary = decodeHexEscapes(encoded) + + const bytes = new Uint8Array(binary.length) + for (let idx = 0; idx < binary.length; idx++) { + bytes[idx] = binary.charCodeAt(idx) + } + + return utf8Decoder.decode(bytes) + } + } + } + throw new TypeError('unsupported charset in extended field') +} + +/** + * Get ISO-8859-1 version of string. + * + * @param {string} val + * @return {string} + * @private + */ + +function getlatin1 (val) { + // simple Unicode -> ISO-8859-1 transformation + return String(val).replace(NON_LATIN1_REGEXP, '?') +} + +/** + * Parse Content-Disposition header string. + * + * @param {string} string + * @return {object} + * @public + */ + +function parse (string) { + if (!string || typeof string !== 'string') { + throw new TypeError('argument string is required') + } + + var match = DISPOSITION_TYPE_REGEXP.exec(string) + + if (!match) { + throw new TypeError('invalid type format') + } + + // normalize type + var index = match[0].length + var type = match[1].toLowerCase() + + var key + var names = [] + var params = {} + var value + + // calculate index to start at + index = PARAM_REGEXP.lastIndex = match[0].slice(-1) === ';' + ? index - 1 + : index + + // match parameters + while ((match = PARAM_REGEXP.exec(string))) { + if (match.index !== index) { + throw new TypeError('invalid parameter format') + } + + index += match[0].length + key = match[1].toLowerCase() + value = match[2] + + if (names.indexOf(key) !== -1) { + throw new TypeError('invalid duplicate parameter') + } + + names.push(key) + + if (key.indexOf('*') + 1 === key.length) { + // decode extended value + key = key.slice(0, -1) + value = decodefield(value) + + // overwrite existing value + params[key] = value + continue + } + + if (typeof params[key] === 'string') { + continue + } + + if (value[0] === '"') { + // remove quotes and escapes + value = value + .slice(1, -1) + .replace(QESC_REGEXP, '$1') + } + + params[key] = value + } + + if (index !== -1 && index !== string.length) { + throw new TypeError('invalid parameter format') + } + + return new ContentDisposition(type, params) +} + +/** + * Percent encode a single character. + * + * @param {string} char + * @return {string} + * @private + */ + +function pencode (char) { + return '%' + String(char) + .charCodeAt(0) + .toString(16) + .toUpperCase() +} + +/** + * Quote a string for HTTP. + * + * @param {string} val + * @return {string} + * @private + */ + +function qstring (val) { + var str = String(val) + + return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"' +} + +/** + * Encode a Unicode string for HTTP (RFC 5987). + * + * @param {string} val + * @return {string} + * @private + */ + +function ustring (val) { + var str = String(val) + + // percent encode as UTF-8 + var encoded = encodeURIComponent(str) + .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode) + + return 'UTF-8\'\'' + encoded +} + +/** + * Class for parsed Content-Disposition header for v8 optimization + * + * @public + * @param {string} type + * @param {object} parameters + * @constructor + */ + +function ContentDisposition (type, parameters) { + this.type = type + this.parameters = parameters +} + +/** + * Return the last portion of a path + * + * @param {string} path + * @returns {string} + */ +function basename (path) { + const normalized = path.replaceAll('\\', '/') + + let end = normalized.length + while (end > 0 && normalized[end - 1] === '/') { + end-- + } + + if (end === 0) { + return '' + } + + let start = end - 1 + while (start >= 0 && normalized[start] !== '/') { + start-- + } + + return normalized.slice(start + 1, end) +} + +/** + * Check if a character is a hex digit [0-9A-Fa-f] + * + * @param {string} char + * @return {boolean} + * @private + */ +function isHexDigit (char) { + const code = char.charCodeAt(0) + return ( + (code >= 48 && code <= 57) || // 0-9 + (code >= 65 && code <= 70) || // A-F + (code >= 97 && code <= 102) // a-f + ) +} + +/** + * Check if a string contains percent encoding escapes. + * + * @param {string} str + * @return {boolean} + * @private + */ +function hasHexEscape (str) { + const maxIndex = str.length - 3 + let lastIndex = -1 + + while ((lastIndex = str.indexOf('%', lastIndex + 1)) !== -1 && lastIndex <= maxIndex) { + if (isHexDigit(str[lastIndex + 1]) && isHexDigit(str[lastIndex + 2])) { + return true + } + } + + return false +} + +/** + * Decode hex escapes in a string (e.g., %20 -> space) + * + * @param {string} str + * @return {string} + * @private + */ +function decodeHexEscapes (str) { + const firstEscape = str.indexOf('%') + if (firstEscape === -1) return str + + let result = str.slice(0, firstEscape) + for (let idx = firstEscape; idx < str.length; idx++) { + if ( + str[idx] === '%' && + idx + 2 < str.length && + isHexDigit(str[idx + 1]) && + isHexDigit(str[idx + 2]) + ) { + result += String.fromCharCode(Number.parseInt(str[idx + 1] + str[idx + 2], 16)) + idx += 2 + } else { + result += str[idx] + } + } + return result +} diff --git a/node_modules/@nestjs/platform-express/node_modules/content-disposition/package.json b/node_modules/@nestjs/platform-express/node_modules/content-disposition/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ed3f6192b114f140a084321767457f1eded06eca --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/content-disposition/package.json @@ -0,0 +1,40 @@ +{ + "name": "content-disposition", + "description": "Create and parse Content-Disposition header", + "version": "1.1.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "keywords": [ + "content-disposition", + "http", + "rfc6266", + "res" + ], + "repository": "jshttp/content-disposition", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "devDependencies": { + "c8": "^10.1.2", + "eslint": "^8.57.1", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.32.0", + "eslint-plugin-markdown": "^3.0.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^6.6.0", + "eslint-plugin-standard": "^4.1.0" + }, + "files": [ + "index.js" + ], + "engines": { + "node": ">=18" + }, + "scripts": { + "lint": "eslint .", + "test": "node --test --test-reporter spec", + "test-ci": "c8 --reporter=lcovonly --reporter=text npm test", + "test-cov": "c8 --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/cookie-signature/History.md b/node_modules/@nestjs/platform-express/node_modules/cookie-signature/History.md new file mode 100644 index 0000000000000000000000000000000000000000..479211a7b32761ad05e3f735e511424cfbf6c7d3 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/cookie-signature/History.md @@ -0,0 +1,70 @@ +1.2.2 / 2024-10-29 +================== + +* various metadata/documentation tweaks (incl. #51) + + +1.2.1 / 2023-02-27 +================== + +* update annotations for allowed secret key types (#44, thanks @jyasskin!) + + +1.2.0 / 2022-02-17 +================== + +* allow buffer and other node-supported types as key (#33) +* be pickier about extra content after signed portion (#40) +* some internal code clarity/cleanup improvements (#26) + + +1.1.0 / 2018-01-18 +================== + +* switch to built-in `crypto.timingSafeEqual` for validation instead of previous double-hash method (thank you @jodevsa!) + + +1.0.7 / 2023-04-12 +================== + +Later release for older node.js versions. See the [v1.0.x branch notes](https://github.com/tj/node-cookie-signature/blob/v1.0.x/History.md#107--2023-04-12). + + +1.0.6 / 2015-02-03 +================== + +* use `npm test` instead of `make test` to run tests +* clearer assertion messages when checking input + + +1.0.5 / 2014-09-05 +================== + +* add license to package.json + +1.0.4 / 2014-06-25 +================== + + * corrected avoidance of timing attacks (thanks @tenbits!) + +1.0.3 / 2014-01-28 +================== + + * [incorrect] fix for timing attacks + +1.0.2 / 2014-01-28 +================== + + * fix missing repository warning + * fix typo in test + +1.0.1 / 2013-04-15 +================== + + * Revert "Changed underlying HMAC algo. to sha512." + * Revert "Fix for timing attacks on MAC verification." + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/@nestjs/platform-express/node_modules/cookie-signature/LICENSE b/node_modules/@nestjs/platform-express/node_modules/cookie-signature/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a2671bf753dfdc9caafbbfd3fe4a1ef6dabf15a5 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/cookie-signature/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012–2024 LearnBoost and other contributors; + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/cookie-signature/Readme.md b/node_modules/@nestjs/platform-express/node_modules/cookie-signature/Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..369af15f8511f0d6037937f1610bbc71b39f4e60 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/cookie-signature/Readme.md @@ -0,0 +1,23 @@ + +# cookie-signature + + Sign and unsign cookies. + +## Example + +```js +var cookie = require('cookie-signature'); + +var val = cookie.sign('hello', 'tobiiscool'); +val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI'); + +var val = cookie.sign('hello', 'tobiiscool'); +cookie.unsign(val, 'tobiiscool').should.equal('hello'); +cookie.unsign(val, 'luna').should.be.false; +``` + +## License + +MIT. + +See LICENSE file for details. diff --git a/node_modules/@nestjs/platform-express/node_modules/cookie-signature/index.js b/node_modules/@nestjs/platform-express/node_modules/cookie-signature/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3fbbddb6c11e38c4faf143ddb2ad4c8db7b869f9 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/cookie-signature/index.js @@ -0,0 +1,47 @@ +/** + * Module dependencies. + */ + +var crypto = require('crypto'); + +/** + * Sign the given `val` with `secret`. + * + * @param {String} val + * @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret + * @return {String} + * @api private + */ + +exports.sign = function(val, secret){ + if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string."); + if (null == secret) throw new TypeError("Secret key must be provided."); + return val + '.' + crypto + .createHmac('sha256', secret) + .update(val) + .digest('base64') + .replace(/\=+$/, ''); +}; + +/** + * Unsign and decode the given `input` with `secret`, + * returning `false` if the signature is invalid. + * + * @param {String} input + * @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret + * @return {String|Boolean} + * @api private + */ + +exports.unsign = function(input, secret){ + if ('string' != typeof input) throw new TypeError("Signed cookie string must be provided."); + if (null == secret) throw new TypeError("Secret key must be provided."); + var tentativeValue = input.slice(0, input.lastIndexOf('.')), + expectedInput = exports.sign(tentativeValue, secret), + expectedBuffer = Buffer.from(expectedInput), + inputBuffer = Buffer.from(input); + return ( + expectedBuffer.length === inputBuffer.length && + crypto.timingSafeEqual(expectedBuffer, inputBuffer) + ) ? tentativeValue : false; +}; diff --git a/node_modules/@nestjs/platform-express/node_modules/cookie-signature/package.json b/node_modules/@nestjs/platform-express/node_modules/cookie-signature/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a16004005bf42fa3d7635be323a518f126e4a760 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/cookie-signature/package.json @@ -0,0 +1,24 @@ +{ + "name": "cookie-signature", + "version": "1.2.2", + "main": "index.js", + "description": "Sign and unsign cookies", + "keywords": ["cookie", "sign", "unsign"], + "author": "TJ Holowaychuk ", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/visionmedia/node-cookie-signature.git" + }, + "dependencies": {}, + "engines": { + "node": ">=6.6.0" + }, + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "scripts": { + "test": "mocha --require should --reporter spec" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/express/LICENSE b/node_modules/@nestjs/platform-express/node_modules/express/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..aa927e44e31d486f807634887662efa39256bf84 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2009-2014 TJ Holowaychuk +Copyright (c) 2013-2014 Roman Shtylman +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/express/Readme.md b/node_modules/@nestjs/platform-express/node_modules/express/Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..4c5b6f757f46af739bceddb1092b5afede92b3e4 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/Readme.md @@ -0,0 +1,276 @@ +[![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](https://expressjs.com/) + +**Fast, unopinionated, minimalist web framework for [Node.js](https://nodejs.org).** + +**This project has a [Code of Conduct].** + +## Table of contents + +- [Table of contents](#table-of-contents) +- [Installation](#installation) +- [Features](#features) +- [Docs \& Community](#docs--community) +- [Quick Start](#quick-start) +- [Philosophy](#philosophy) +- [Examples](#examples) +- [Contributing](#contributing) + - [Security Issues](#security-issues) + - [Running Tests](#running-tests) +- [Current project team members](#current-project-team-members) + - [TC (Technical Committee)](#tc-technical-committee) + - [TC emeriti members](#tc-emeriti-members) + - [Triagers](#triagers) + - [Emeritus Triagers](#emeritus-triagers) +- [License](#license) + + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-downloads-url] +[![Linux Build][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + + +```js +import express from 'express' + +const app = express() + +app.get('/', (req, res) => { + res.send('Hello World') +}) + +app.listen(3000, () => { + console.log('Server is running on http://localhost:3000') +}) +``` + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). + +Before installing, [download and install Node.js](https://nodejs.org/en/download/). +Node.js 18 or higher is required. + +If this is a brand new project, make sure to create a `package.json` first with +the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file). + +Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +npm install express +``` + +Follow [our installing guide](https://expressjs.com/en/starter/installing.html) +for more information. + +## Features + + * Robust routing + * Focus on high performance + * Super-high test coverage + * HTTP helpers (redirection, caching, etc) + * View system supporting 14+ template engines + * Content negotiation + * Executable for generating applications quickly + +## Docs & Community + + * [Website and Documentation](https://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)] + * [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules + * [Github Discussions](https://github.com/expressjs/discussions) for discussion on the development and usage of Express + +**PROTIP** Be sure to read the [migration guide to v5](https://expressjs.com/en/guide/migrating-5) + +## Quick Start + + The quickest way to get started with express is to utilize the executable [`express(1)`](https://github.com/expressjs/generator) to generate an application as shown below: + + Install the executable. The executable's major version will match Express's: + +```bash +npm install -g express-generator@4 +``` + + Create the app: + +```bash +express /tmp/foo && cd /tmp/foo +``` + + Install dependencies: + +```bash +npm install +``` + + Start the server: + +```bash +npm start +``` + + View the website at: http://localhost:3000 + +## Philosophy + + The Express philosophy is to provide small, robust tooling for HTTP servers, making + it a great solution for single page applications, websites, hybrids, or public + HTTP APIs. + + Express does not force you to use any specific ORM or template engine. With support for over + 14 template engines via [@ladjs/consolidate](https://github.com/ladjs/consolidate), + you can quickly craft your perfect framework. + +## Examples + + To view the examples, clone the Express repository: + +```bash +git clone https://github.com/expressjs/express.git --depth 1 && cd express +``` + + Then install the dependencies: + +```bash +npm install +``` + + Then run whichever example you want: + +```bash +node examples/content-negotiation +``` + +## Contributing + +The Express.js project welcomes all constructive contributions. Contributions take many forms, +from code for bug fixes and enhancements, to additions and fixes to documentation, additional +tests, triaging incoming pull requests and issues, and more! + +See the [Contributing Guide] for more technical details on contributing. + +### Security Issues + +If you discover a security vulnerability in Express, please see [Security Policies and Procedures](SECURITY.md). + +### Running Tests + +To run the test suite, first install the dependencies: + +```bash +npm install +``` + +Then run `npm test`: + +```bash +npm test +``` + +## Current project team members + +For information about the governance of the express.js project, see [GOVERNANCE.md](https://github.com/expressjs/discussions/blob/HEAD/docs/GOVERNANCE.md). + +The original author of Express is [TJ Holowaychuk](https://github.com/tj) + +[List of all contributors](https://github.com/expressjs/express/graphs/contributors) + +### TC (Technical Committee) + +* [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him) +* [jonchurch](https://github.com/jonchurch) - **Jon Church** +* [wesleytodd](https://github.com/wesleytodd) - **Wes Todd** +* [LinusU](https://github.com/LinusU) - **Linus Unnebäck** +* [blakeembrey](https://github.com/blakeembrey) - **Blake Embrey** +* [sheplu](https://github.com/sheplu) - **Jean Burellier** +* [crandmck](https://github.com/crandmck) - **Rand McKinney** +* [ctcpip](https://github.com/ctcpip) - **Chris de Almeida** + +
+TC emeriti members + +#### TC emeriti members + + * [dougwilson](https://github.com/dougwilson) - **Douglas Wilson** + * [hacksparrow](https://github.com/hacksparrow) - **Hage Yaapa** + * [jonathanong](https://github.com/jonathanong) - **jongleberry** + * [niftylettuce](https://github.com/niftylettuce) - **niftylettuce** + * [troygoode](https://github.com/troygoode) - **Troy Goode** +
+ + +### Triagers + +* [aravindvnair99](https://github.com/aravindvnair99) - **Aravind Nair** +* [bjohansebas](https://github.com/bjohansebas) - **Sebastian Beltran** +* [carpasse](https://github.com/carpasse) - **Carlos Serrano** +* [CBID2](https://github.com/CBID2) - **Christine Belzie** +* [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him) +* [IamLizu](https://github.com/IamLizu) - **S M Mahmudul Hasan** (he/him) +* [Phillip9587](https://github.com/Phillip9587) - **Phillip Barta** +* [efekrskl](https://github.com/efekrskl) - **Efe Karasakal** + + +
+Triagers emeriti members + +#### Emeritus Triagers + + * [AuggieH](https://github.com/AuggieH) - **Auggie Hudak** + * [G-Rath](https://github.com/G-Rath) - **Gareth Jones** + * [MohammadXroid](https://github.com/MohammadXroid) - **Mohammad Ayashi** + * [NawafSwe](https://github.com/NawafSwe) - **Nawaf Alsharqi** + * [NotMoni](https://github.com/NotMoni) - **Moni** + * [VigneshMurugan](https://github.com/VigneshMurugan) - **Vignesh Murugan** + * [davidmashe](https://github.com/davidmashe) - **David Ashe** + * [digitaIfabric](https://github.com/digitaIfabric) - **David** + * [e-l-i-s-e](https://github.com/e-l-i-s-e) - **Elise Bonner** + * [fed135](https://github.com/fed135) - **Frederic Charette** + * [firmanJS](https://github.com/firmanJS) - **Firman Abdul Hakim** + * [getspooky](https://github.com/getspooky) - **Yasser Ameur** + * [ghinks](https://github.com/ghinks) - **Glenn** + * [ghousemohamed](https://github.com/ghousemohamed) - **Ghouse Mohamed** + * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil** + * [jake32321](https://github.com/jake32321) - **Jake Reed** + * [jonchurch](https://github.com/jonchurch) - **Jon Church** + * [lekanikotun](https://github.com/lekanikotun) - **Troy Goode** + * [marsonya](https://github.com/marsonya) - **Lekan Ikotun** + * [mastermatt](https://github.com/mastermatt) - **Matt R. Wilson** + * [maxakuru](https://github.com/maxakuru) - **Max Edell** + * [mlrawlings](https://github.com/mlrawlings) - **Michael Rawlings** + * [rodion-arr](https://github.com/rodion-arr) - **Rodion Abdurakhimov** + * [sheplu](https://github.com/sheplu) - **Jean Burellier** + * [tarunyadav1](https://github.com/tarunyadav1) - **Tarun yadav** + * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe** + * [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim** + * [0ss](https://github.com/0ss) - **Salah** + * [import-brain](https://github.com/import-brain) - **Eric Cheng** (he/him) + * [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him) + * [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego** + * [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin** + * [dpopp07](https://github.com/dpopp07) - **Dustin Popp** + * [Sushmeet](https://github.com/Sushmeet) - **Sushmeet Sunger** + * [3imed-jaberi](https://github.com/3imed-jaberi) - **Imed Jaberi** + +
+ + +## License + + [MIT](LICENSE) + +[coveralls-image]: https://img.shields.io/coverallsCoverage/github/expressjs/express?branch=master +[coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master +[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/express/ci.yml?branch=master&label=ci +[github-actions-ci-url]: https://github.com/expressjs/express/actions/workflows/ci.yml +[npm-downloads-image]: https://img.shields.io/npm/dm/express +[npm-downloads-url]: https://npmcharts.com/compare/express?minimal=true +[npm-url]: https://npmjs.org/package/express +[npm-version-image]: https://img.shields.io/npm/v/express +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/express/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/express +[Code of Conduct]: https://github.com/expressjs/.github/blob/HEAD/CODE_OF_CONDUCT.md +[Contributing Guide]: https://github.com/expressjs/.github/blob/HEAD/CONTRIBUTING.md diff --git a/node_modules/@nestjs/platform-express/node_modules/express/index.js b/node_modules/@nestjs/platform-express/node_modules/express/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d219b0c878dc6136eb2096cffa140bf6bf2b8e9c --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/index.js @@ -0,0 +1,11 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +module.exports = require('./lib/express'); diff --git a/node_modules/@nestjs/platform-express/node_modules/express/lib/application.js b/node_modules/@nestjs/platform-express/node_modules/express/lib/application.js new file mode 100644 index 0000000000000000000000000000000000000000..838b882aaaedc6200a38e3bb06f4bffaf85cad7a --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/lib/application.js @@ -0,0 +1,631 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var finalhandler = require('finalhandler'); +var debug = require('debug')('express:application'); +var View = require('./view'); +var http = require('node:http'); +var methods = require('./utils').methods; +var compileETag = require('./utils').compileETag; +var compileQueryParser = require('./utils').compileQueryParser; +var compileTrust = require('./utils').compileTrust; +var resolve = require('node:path').resolve; +var once = require('once') +var Router = require('router'); + +/** + * Module variables. + * @private + */ + +var slice = Array.prototype.slice; +var flatten = Array.prototype.flat; + +/** + * Application prototype. + */ + +var app = exports = module.exports = {}; + +/** + * Variable for trust proxy inheritance back-compat + * @private + */ + +var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default'; + +/** + * Initialize the server. + * + * - setup default configuration + * - setup default middleware + * - setup route reflection methods + * + * @private + */ + +app.init = function init() { + var router = null; + + this.cache = Object.create(null); + this.engines = Object.create(null); + this.settings = Object.create(null); + + this.defaultConfiguration(); + + // Setup getting to lazily add base router + Object.defineProperty(this, 'router', { + configurable: true, + enumerable: true, + get: function getrouter() { + if (router === null) { + router = new Router({ + caseSensitive: this.enabled('case sensitive routing'), + strict: this.enabled('strict routing') + }); + } + + return router; + } + }); +}; + +/** + * Initialize application configuration. + * @private + */ + +app.defaultConfiguration = function defaultConfiguration() { + var env = process.env.NODE_ENV || 'development'; + + // default settings + this.enable('x-powered-by'); + this.set('etag', 'weak'); + this.set('env', env); + this.set('query parser', 'simple') + this.set('subdomain offset', 2); + this.set('trust proxy', false); + + // trust proxy inherit back-compat + Object.defineProperty(this.settings, trustProxyDefaultSymbol, { + configurable: true, + value: true + }); + + debug('booting in %s mode', env); + + this.on('mount', function onmount(parent) { + // inherit trust proxy + if (this.settings[trustProxyDefaultSymbol] === true + && typeof parent.settings['trust proxy fn'] === 'function') { + delete this.settings['trust proxy']; + delete this.settings['trust proxy fn']; + } + + // inherit protos + Object.setPrototypeOf(this.request, parent.request) + Object.setPrototypeOf(this.response, parent.response) + Object.setPrototypeOf(this.engines, parent.engines) + Object.setPrototypeOf(this.settings, parent.settings) + }); + + // setup locals + this.locals = Object.create(null); + + // top-most app is mounted at / + this.mountpath = '/'; + + // default locals + this.locals.settings = this.settings; + + // default configuration + this.set('view', View); + this.set('views', resolve('views')); + this.set('jsonp callback name', 'callback'); + + if (env === 'production') { + this.enable('view cache'); + } +}; + +/** + * Dispatch a req, res pair into the application. Starts pipeline processing. + * + * If no callback is provided, then default error handlers will respond + * in the event of an error bubbling through the stack. + * + * @private + */ + +app.handle = function handle(req, res, callback) { + // final handler + var done = callback || finalhandler(req, res, { + env: this.get('env'), + onerror: logerror.bind(this) + }); + + // set powered by header + if (this.enabled('x-powered-by')) { + res.setHeader('X-Powered-By', 'Express'); + } + + // set circular references + req.res = res; + res.req = req; + + // alter the prototypes + Object.setPrototypeOf(req, this.request) + Object.setPrototypeOf(res, this.response) + + // setup locals + if (!res.locals) { + res.locals = Object.create(null); + } + + this.router.handle(req, res, done); +}; + +/** + * Proxy `Router#use()` to add middleware to the app router. + * See Router#use() documentation for details. + * + * If the _fn_ parameter is an express app, then it will be + * mounted at the _route_ specified. + * + * @public + */ + +app.use = function use(fn) { + var offset = 0; + var path = '/'; + + // default path to '/' + // disambiguate app.use([fn]) + if (typeof fn !== 'function') { + var arg = fn; + + while (Array.isArray(arg) && arg.length !== 0) { + arg = arg[0]; + } + + // first arg is the path + if (typeof arg !== 'function') { + offset = 1; + path = fn; + } + } + + var fns = flatten.call(slice.call(arguments, offset), Infinity); + + if (fns.length === 0) { + throw new TypeError('app.use() requires a middleware function') + } + + // get router + var router = this.router; + + fns.forEach(function (fn) { + // non-express app + if (!fn || !fn.handle || !fn.set) { + return router.use(path, fn); + } + + debug('.use app under %s', path); + fn.mountpath = path; + fn.parent = this; + + // restore .app property on req and res + router.use(path, function mounted_app(req, res, next) { + var orig = req.app; + fn.handle(req, res, function (err) { + Object.setPrototypeOf(req, orig.request) + Object.setPrototypeOf(res, orig.response) + next(err); + }); + }); + + // mounted an app + fn.emit('mount', this); + }, this); + + return this; +}; + +/** + * Proxy to the app `Router#route()` + * Returns a new `Route` instance for the _path_. + * + * Routes are isolated middleware stacks for specific paths. + * See the Route api docs for details. + * + * @public + */ + +app.route = function route(path) { + return this.router.route(path); +}; + +/** + * Register the given template engine callback `fn` + * as `ext`. + * + * By default will `require()` the engine based on the + * file extension. For example if you try to render + * a "foo.ejs" file Express will invoke the following internally: + * + * app.engine('ejs', require('ejs').__express); + * + * For engines that do not provide `.__express` out of the box, + * or if you wish to "map" a different extension to the template engine + * you may use this method. For example mapping the EJS template engine to + * ".html" files: + * + * app.engine('html', require('ejs').renderFile); + * + * In this case EJS provides a `.renderFile()` method with + * the same signature that Express expects: `(path, options, callback)`, + * though note that it aliases this method as `ejs.__express` internally + * so if you're using ".ejs" extensions you don't need to do anything. + * + * Some template engines do not follow this convention, the + * [Consolidate.js](https://github.com/tj/consolidate.js) + * library was created to map all of node's popular template + * engines to follow this convention, thus allowing them to + * work seamlessly within Express. + * + * @param {String} ext + * @param {Function} fn + * @return {app} for chaining + * @public + */ + +app.engine = function engine(ext, fn) { + if (typeof fn !== 'function') { + throw new Error('callback function required'); + } + + // get file extension + var extension = ext[0] !== '.' + ? '.' + ext + : ext; + + // store engine + this.engines[extension] = fn; + + return this; +}; + +/** + * Proxy to `Router#param()` with one added api feature. The _name_ parameter + * can be an array of names. + * + * See the Router#param() docs for more details. + * + * @param {String|Array} name + * @param {Function} fn + * @return {app} for chaining + * @public + */ + +app.param = function param(name, fn) { + if (Array.isArray(name)) { + for (var i = 0; i < name.length; i++) { + this.param(name[i], fn); + } + + return this; + } + + this.router.param(name, fn); + + return this; +}; + +/** + * Assign `setting` to `val`, or return `setting`'s value. + * + * app.set('foo', 'bar'); + * app.set('foo'); + * // => "bar" + * + * Mounted servers inherit their parent server's settings. + * + * @param {String} setting + * @param {*} [val] + * @return {Server} for chaining + * @public + */ + +app.set = function set(setting, val) { + if (arguments.length === 1) { + // app.get(setting) + return this.settings[setting]; + } + + debug('set "%s" to %o', setting, val); + + // set value + this.settings[setting] = val; + + // trigger matched settings + switch (setting) { + case 'etag': + this.set('etag fn', compileETag(val)); + break; + case 'query parser': + this.set('query parser fn', compileQueryParser(val)); + break; + case 'trust proxy': + this.set('trust proxy fn', compileTrust(val)); + + // trust proxy inherit back-compat + Object.defineProperty(this.settings, trustProxyDefaultSymbol, { + configurable: true, + value: false + }); + + break; + } + + return this; +}; + +/** + * Return the app's absolute pathname + * based on the parent(s) that have + * mounted it. + * + * For example if the application was + * mounted as "/admin", which itself + * was mounted as "/blog" then the + * return value would be "/blog/admin". + * + * @return {String} + * @private + */ + +app.path = function path() { + return this.parent + ? this.parent.path() + this.mountpath + : ''; +}; + +/** + * Check if `setting` is enabled (truthy). + * + * app.enabled('foo') + * // => false + * + * app.enable('foo') + * app.enabled('foo') + * // => true + * + * @param {String} setting + * @return {Boolean} + * @public + */ + +app.enabled = function enabled(setting) { + return Boolean(this.set(setting)); +}; + +/** + * Check if `setting` is disabled. + * + * app.disabled('foo') + * // => true + * + * app.enable('foo') + * app.disabled('foo') + * // => false + * + * @param {String} setting + * @return {Boolean} + * @public + */ + +app.disabled = function disabled(setting) { + return !this.set(setting); +}; + +/** + * Enable `setting`. + * + * @param {String} setting + * @return {app} for chaining + * @public + */ + +app.enable = function enable(setting) { + return this.set(setting, true); +}; + +/** + * Disable `setting`. + * + * @param {String} setting + * @return {app} for chaining + * @public + */ + +app.disable = function disable(setting) { + return this.set(setting, false); +}; + +/** + * Delegate `.VERB(...)` calls to `router.VERB(...)`. + */ + +methods.forEach(function (method) { + app[method] = function (path) { + if (method === 'get' && arguments.length === 1) { + // app.get(setting) + return this.set(path); + } + + var route = this.route(path); + route[method].apply(route, slice.call(arguments, 1)); + return this; + }; +}); + +/** + * Special-cased "all" method, applying the given route `path`, + * middleware, and callback to _every_ HTTP method. + * + * @param {String} path + * @param {Function} ... + * @return {app} for chaining + * @public + */ + +app.all = function all(path) { + var route = this.route(path); + var args = slice.call(arguments, 1); + + for (var i = 0; i < methods.length; i++) { + route[methods[i]].apply(route, args); + } + + return this; +}; + +/** + * Render the given view `name` name with `options` + * and a callback accepting an error and the + * rendered template string. + * + * Example: + * + * app.render('email', { name: 'Tobi' }, function(err, html){ + * // ... + * }) + * + * @param {String} name + * @param {Object|Function} options or fn + * @param {Function} callback + * @public + */ + +app.render = function render(name, options, callback) { + var cache = this.cache; + var done = callback; + var engines = this.engines; + var opts = options; + var view; + + // support callback function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + // merge options + var renderOptions = { ...this.locals, ...opts._locals, ...opts }; + + // set .cache unless explicitly provided + if (renderOptions.cache == null) { + renderOptions.cache = this.enabled('view cache'); + } + + // primed cache + if (renderOptions.cache) { + view = cache[name]; + } + + // view + if (!view) { + var View = this.get('view'); + + view = new View(name, { + defaultEngine: this.get('view engine'), + root: this.get('views'), + engines: engines + }); + + if (!view.path) { + var dirs = Array.isArray(view.root) && view.root.length > 1 + ? 'directories "' + view.root.slice(0, -1).join('", "') + '" or "' + view.root[view.root.length - 1] + '"' + : 'directory "' + view.root + '"' + var err = new Error('Failed to lookup view "' + name + '" in views ' + dirs); + err.view = view; + return done(err); + } + + // prime the cache + if (renderOptions.cache) { + cache[name] = view; + } + } + + // render + tryRender(view, renderOptions, done); +}; + +/** + * Listen for connections. + * + * A node `http.Server` is returned, with this + * application (which is a `Function`) as its + * callback. If you wish to create both an HTTP + * and HTTPS server you may do so with the "http" + * and "https" modules as shown here: + * + * var http = require('node:http') + * , https = require('node:https') + * , express = require('express') + * , app = express(); + * + * http.createServer(app).listen(80); + * https.createServer({ ... }, app).listen(443); + * + * @return {http.Server} + * @public + */ + +app.listen = function listen() { + var server = http.createServer(this) + var args = slice.call(arguments) + if (typeof args[args.length - 1] === 'function') { + var done = args[args.length - 1] = once(args[args.length - 1]) + server.once('error', done) + } + return server.listen.apply(server, args) +} + +/** + * Log error using console.error. + * + * @param {Error} err + * @private + */ + +function logerror(err) { + /* istanbul ignore next */ + if (this.get('env') !== 'test') console.error(err.stack || err.toString()); +} + +/** + * Try rendering a view. + * @private + */ + +function tryRender(view, options, callback) { + try { + view.render(options, callback); + } catch (err) { + callback(err); + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/express/lib/express.js b/node_modules/@nestjs/platform-express/node_modules/express/lib/express.js new file mode 100644 index 0000000000000000000000000000000000000000..2d502eb54e4d7e2f2374494e32071d9416d56418 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/lib/express.js @@ -0,0 +1,81 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + */ + +var bodyParser = require('body-parser') +var EventEmitter = require('node:events').EventEmitter; +var mixin = require('merge-descriptors'); +var proto = require('./application'); +var Router = require('router'); +var req = require('./request'); +var res = require('./response'); + +/** + * Expose `createApplication()`. + */ + +exports = module.exports = createApplication; + +/** + * Create an express application. + * + * @return {Function} + * @api public + */ + +function createApplication() { + var app = function(req, res, next) { + app.handle(req, res, next); + }; + + mixin(app, EventEmitter.prototype, false); + mixin(app, proto, false); + + // expose the prototype that will get set on requests + app.request = Object.create(req, { + app: { configurable: true, enumerable: true, writable: true, value: app } + }) + + // expose the prototype that will get set on responses + app.response = Object.create(res, { + app: { configurable: true, enumerable: true, writable: true, value: app } + }) + + app.init(); + return app; +} + +/** + * Expose the prototypes. + */ + +exports.application = proto; +exports.request = req; +exports.response = res; + +/** + * Expose constructors. + */ + +exports.Route = Router.Route; +exports.Router = Router; + +/** + * Expose middleware + */ + +exports.json = bodyParser.json +exports.raw = bodyParser.raw +exports.static = require('serve-static'); +exports.text = bodyParser.text +exports.urlencoded = bodyParser.urlencoded diff --git a/node_modules/@nestjs/platform-express/node_modules/express/lib/request.js b/node_modules/@nestjs/platform-express/node_modules/express/lib/request.js new file mode 100644 index 0000000000000000000000000000000000000000..69990da39b6da3103d72d74bd729e3372468f82b --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/lib/request.js @@ -0,0 +1,514 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var accepts = require('accepts'); +var isIP = require('node:net').isIP; +var typeis = require('type-is'); +var http = require('node:http'); +var fresh = require('fresh'); +var parseRange = require('range-parser'); +var parse = require('parseurl'); +var proxyaddr = require('proxy-addr'); + +/** + * Request prototype. + * @public + */ + +var req = Object.create(http.IncomingMessage.prototype) + +/** + * Module exports. + * @public + */ + +module.exports = req + +/** + * Return request header. + * + * The `Referrer` header field is special-cased, + * both `Referrer` and `Referer` are interchangeable. + * + * Examples: + * + * req.get('Content-Type'); + * // => "text/plain" + * + * req.get('content-type'); + * // => "text/plain" + * + * req.get('Something'); + * // => undefined + * + * Aliased as `req.header()`. + * + * @param {String} name + * @return {String} + * @public + */ + +req.get = +req.header = function header(name) { + if (!name) { + throw new TypeError('name argument is required to req.get'); + } + + if (typeof name !== 'string') { + throw new TypeError('name must be a string to req.get'); + } + + var lc = name.toLowerCase(); + + switch (lc) { + case 'referer': + case 'referrer': + return this.headers.referrer + || this.headers.referer; + default: + return this.headers[lc]; + } +}; + +/** + * To do: update docs. + * + * Check if the given `type(s)` is acceptable, returning + * the best match when true, otherwise `undefined`, in which + * case you should respond with 406 "Not Acceptable". + * + * The `type` value may be a single MIME type string + * such as "application/json", an extension name + * such as "json", a comma-delimited list such as "json, html, text/plain", + * an argument list such as `"json", "html", "text/plain"`, + * or an array `["json", "html", "text/plain"]`. When a list + * or array is given, the _best_ match, if any is returned. + * + * Examples: + * + * // Accept: text/html + * req.accepts('html'); + * // => "html" + * + * // Accept: text/*, application/json + * req.accepts('html'); + * // => "html" + * req.accepts('text/html'); + * // => "text/html" + * req.accepts('json, text'); + * // => "json" + * req.accepts('application/json'); + * // => "application/json" + * + * // Accept: text/*, application/json + * req.accepts('image/png'); + * req.accepts('png'); + * // => undefined + * + * // Accept: text/*;q=.5, application/json + * req.accepts(['html', 'json']); + * req.accepts('html', 'json'); + * req.accepts('html, json'); + * // => "json" + * + * @param {String|Array} type(s) + * @return {String|Array|Boolean} + * @public + */ + +req.accepts = function(){ + var accept = accepts(this); + return accept.types.apply(accept, arguments); +}; + +/** + * Check if the given `encoding`s are accepted. + * + * @param {String} ...encoding + * @return {String|Array} + * @public + */ + +req.acceptsEncodings = function(){ + var accept = accepts(this); + return accept.encodings.apply(accept, arguments); +}; + +/** + * Check if the given `charset`s are acceptable, + * otherwise you should respond with 406 "Not Acceptable". + * + * @param {String} ...charset + * @return {String|Array} + * @public + */ + +req.acceptsCharsets = function(){ + var accept = accepts(this); + return accept.charsets.apply(accept, arguments); +}; + +/** + * Check if the given `lang`s are acceptable, + * otherwise you should respond with 406 "Not Acceptable". + * + * @param {String} ...lang + * @return {String|Array} + * @public + */ + +req.acceptsLanguages = function(...languages) { + return accepts(this).languages(...languages); +}; + +/** + * Parse Range header field, capping to the given `size`. + * + * Unspecified ranges such as "0-" require knowledge of your resource length. In + * the case of a byte range this is of course the total number of bytes. If the + * Range header field is not given `undefined` is returned, `-1` when unsatisfiable, + * and `-2` when syntactically invalid. + * + * When ranges are returned, the array has a "type" property which is the type of + * range that is required (most commonly, "bytes"). Each array element is an object + * with a "start" and "end" property for the portion of the range. + * + * The "combine" option can be set to `true` and overlapping & adjacent ranges + * will be combined into a single range. + * + * NOTE: remember that ranges are inclusive, so for example "Range: users=0-3" + * should respond with 4 users when available, not 3. + * + * @param {number} size + * @param {object} [options] + * @param {boolean} [options.combine=false] + * @return {number|array} + * @public + */ + +req.range = function range(size, options) { + var range = this.get('Range'); + if (!range) return; + return parseRange(size, range, options); +}; + +/** + * Parse the query string of `req.url`. + * + * This uses the "query parser" setting to parse the raw + * string into an object. + * + * @return {String} + * @api public + */ + +defineGetter(req, 'query', function query(){ + var queryparse = this.app.get('query parser fn'); + + if (!queryparse) { + // parsing is disabled + return Object.create(null); + } + + var querystring = parse(this).query; + + return queryparse(querystring); +}); + +/** + * Check if the incoming request contains the "Content-Type" + * header field, and it contains the given mime `type`. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * req.is('html'); + * req.is('text/html'); + * req.is('text/*'); + * // => true + * + * // When Content-Type is application/json + * req.is('json'); + * req.is('application/json'); + * req.is('application/*'); + * // => true + * + * req.is('html'); + * // => false + * + * @param {String|Array} types... + * @return {String|false|null} + * @public + */ + +req.is = function is(types) { + var arr = types; + + // support flattened arguments + if (!Array.isArray(types)) { + arr = new Array(arguments.length); + for (var i = 0; i < arr.length; i++) { + arr[i] = arguments[i]; + } + } + + return typeis(this, arr); +}; + +/** + * Return the protocol string "http" or "https" + * when requested with TLS. When the "trust proxy" + * setting trusts the socket address, the + * "X-Forwarded-Proto" header field will be trusted + * and used if present. + * + * If you're running behind a reverse proxy that + * supplies https for you this may be enabled. + * + * @return {String} + * @public + */ + +defineGetter(req, 'protocol', function protocol(){ + var proto = this.socket.encrypted + ? 'https' + : 'http'; + var trust = this.app.get('trust proxy fn'); + + if (!trust(this.socket.remoteAddress, 0)) { + return proto; + } + + // Note: X-Forwarded-Proto is normally only ever a + // single value, but this is to be safe. + var header = this.get('X-Forwarded-Proto') || proto + var index = header.indexOf(',') + + return index !== -1 + ? header.substring(0, index).trim() + : header.trim() +}); + +/** + * Short-hand for: + * + * req.protocol === 'https' + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'secure', function secure(){ + return this.protocol === 'https'; +}); + +/** + * Return the remote address from the trusted proxy. + * + * The is the remote address on the socket unless + * "trust proxy" is set. + * + * @return {String} + * @public + */ + +defineGetter(req, 'ip', function ip(){ + var trust = this.app.get('trust proxy fn'); + return proxyaddr(this, trust); +}); + +/** + * When "trust proxy" is set, trusted proxy addresses + client. + * + * For example if the value were "client, proxy1, proxy2" + * you would receive the array `["client", "proxy1", "proxy2"]` + * where "proxy2" is the furthest down-stream and "proxy1" and + * "proxy2" were trusted. + * + * @return {Array} + * @public + */ + +defineGetter(req, 'ips', function ips() { + var trust = this.app.get('trust proxy fn'); + var addrs = proxyaddr.all(this, trust); + + // reverse the order (to farthest -> closest) + // and remove socket address + addrs.reverse().pop() + + return addrs +}); + +/** + * Return subdomains as an array. + * + * Subdomains are the dot-separated parts of the host before the main domain of + * the app. By default, the domain of the app is assumed to be the last two + * parts of the host. This can be changed by setting "subdomain offset". + * + * For example, if the domain is "tobi.ferrets.example.com": + * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`. + * If "subdomain offset" is 3, req.subdomains is `["tobi"]`. + * + * @return {Array} + * @public + */ + +defineGetter(req, 'subdomains', function subdomains() { + var hostname = this.hostname; + + if (!hostname) return []; + + var offset = this.app.get('subdomain offset'); + var subdomains = !isIP(hostname) + ? hostname.split('.').reverse() + : [hostname]; + + return subdomains.slice(offset); +}); + +/** + * Short-hand for `url.parse(req.url).pathname`. + * + * @return {String} + * @public + */ + +defineGetter(req, 'path', function path() { + return parse(this).pathname; +}); + +/** + * Parse the "Host" header field to a host. + * + * When the "trust proxy" setting trusts the socket + * address, the "X-Forwarded-Host" header field will + * be trusted. + * + * @return {String} + * @public + */ + +defineGetter(req, 'host', function host(){ + var trust = this.app.get('trust proxy fn'); + var val = this.get('X-Forwarded-Host'); + + if (!val || !trust(this.socket.remoteAddress, 0)) { + val = this.get('Host'); + } else if (val.indexOf(',') !== -1) { + // Note: X-Forwarded-Host is normally only ever a + // single value, but this is to be safe. + val = val.substring(0, val.indexOf(',')).trimRight() + } + + return val || undefined; +}); + +/** + * Parse the "Host" header field to a hostname. + * + * When the "trust proxy" setting trusts the socket + * address, the "X-Forwarded-Host" header field will + * be trusted. + * + * @return {String} + * @api public + */ + +defineGetter(req, 'hostname', function hostname(){ + var host = this.host; + + if (!host) return; + + // IPv6 literal support + var offset = host[0] === '[' + ? host.indexOf(']') + 1 + : 0; + var index = host.indexOf(':', offset); + + return index !== -1 + ? host.substring(0, index) + : host; +}); + +/** + * Check if the request is fresh, aka + * Last-Modified or the ETag + * still match. + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'fresh', function(){ + var method = this.method; + var res = this.res + var status = res.statusCode + + // GET or HEAD for weak freshness validation only + if ('GET' !== method && 'HEAD' !== method) return false; + + // 2xx or 304 as per rfc2616 14.26 + if ((status >= 200 && status < 300) || 304 === status) { + return fresh(this.headers, { + 'etag': res.get('ETag'), + 'last-modified': res.get('Last-Modified') + }) + } + + return false; +}); + +/** + * Check if the request is stale, aka + * "Last-Modified" and / or the "ETag" for the + * resource has changed. + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'stale', function stale(){ + return !this.fresh; +}); + +/** + * Check if the request was an _XMLHttpRequest_. + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'xhr', function xhr(){ + var val = this.get('X-Requested-With') || ''; + return val.toLowerCase() === 'xmlhttprequest'; +}); + +/** + * Helper function for creating a getter on an object. + * + * @param {Object} obj + * @param {String} name + * @param {Function} getter + * @private + */ +function defineGetter(obj, name, getter) { + Object.defineProperty(obj, name, { + configurable: true, + enumerable: true, + get: getter + }); +} diff --git a/node_modules/@nestjs/platform-express/node_modules/express/lib/response.js b/node_modules/@nestjs/platform-express/node_modules/express/lib/response.js new file mode 100644 index 0000000000000000000000000000000000000000..7a2f0ecce5658191e8670ab943d4f16655c279fc --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/lib/response.js @@ -0,0 +1,1053 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var contentDisposition = require('content-disposition'); +var createError = require('http-errors') +var deprecate = require('depd')('express'); +var encodeUrl = require('encodeurl'); +var escapeHtml = require('escape-html'); +var http = require('node:http'); +var onFinished = require('on-finished'); +var mime = require('mime-types') +var path = require('node:path'); +var pathIsAbsolute = require('node:path').isAbsolute; +var statuses = require('statuses') +var sign = require('cookie-signature').sign; +var normalizeType = require('./utils').normalizeType; +var normalizeTypes = require('./utils').normalizeTypes; +var setCharset = require('./utils').setCharset; +var cookie = require('cookie'); +var send = require('send'); +var extname = path.extname; +var resolve = path.resolve; +var vary = require('vary'); +const { Buffer } = require('node:buffer'); + +/** + * Response prototype. + * @public + */ + +var res = Object.create(http.ServerResponse.prototype) + +/** + * Module exports. + * @public + */ + +module.exports = res + +/** + * Set the HTTP status code for the response. + * + * Expects an integer value between 100 and 999 inclusive. + * Throws an error if the provided status code is not an integer or if it's outside the allowable range. + * + * @param {number} code - The HTTP status code to set. + * @return {ServerResponse} - Returns itself for chaining methods. + * @throws {TypeError} If `code` is not an integer. + * @throws {RangeError} If `code` is outside the range 100 to 999. + * @public + */ + +res.status = function status(code) { + // Check if the status code is not an integer + if (!Number.isInteger(code)) { + throw new TypeError(`Invalid status code: ${JSON.stringify(code)}. Status code must be an integer.`); + } + // Check if the status code is outside of Node's valid range + if (code < 100 || code > 999) { + throw new RangeError(`Invalid status code: ${JSON.stringify(code)}. Status code must be greater than 99 and less than 1000.`); + } + + this.statusCode = code; + return this; +}; + +/** + * Set Link header field with the given `links`. + * + * Examples: + * + * res.links({ + * next: 'http://api.example.com/users?page=2', + * last: 'http://api.example.com/users?page=5', + * pages: [ + * 'http://api.example.com/users?page=1', + * 'http://api.example.com/users?page=2' + * ] + * }); + * + * @param {Object} links + * @return {ServerResponse} + * @public + */ + +res.links = function(links) { + var link = this.get('Link') || ''; + if (link) link += ', '; + return this.set('Link', link + Object.keys(links).map(function(rel) { + // Allow multiple links if links[rel] is an array + if (Array.isArray(links[rel])) { + return links[rel].map(function (singleLink) { + return `<${singleLink}>; rel="${rel}"`; + }).join(', '); + } else { + return `<${links[rel]}>; rel="${rel}"`; + } + }).join(', ')); +}; + +/** + * Send a response. + * + * Examples: + * + * res.send(Buffer.from('wahoo')); + * res.send({ some: 'json' }); + * res.send('

some html

'); + * + * @param {string|number|boolean|object|Buffer} body + * @public + */ + +res.send = function send(body) { + var chunk = body; + var encoding; + var req = this.req; + var type; + + // settings + var app = this.app; + + switch (typeof chunk) { + // string defaulting to html + case 'string': + if (!this.get('Content-Type')) { + this.type('html'); + } + break; + case 'boolean': + case 'number': + case 'object': + if (chunk === null) { + chunk = ''; + } else if (ArrayBuffer.isView(chunk)) { + if (!this.get('Content-Type')) { + this.type('bin'); + } + } else { + return this.json(chunk); + } + break; + } + + // write strings in utf-8 + if (typeof chunk === 'string') { + encoding = 'utf8'; + type = this.get('Content-Type'); + + // reflect this in content-type + if (typeof type === 'string') { + this.set('Content-Type', setCharset(type, 'utf-8')); + } + } + + // determine if ETag should be generated + var etagFn = app.get('etag fn') + var generateETag = !this.get('ETag') && typeof etagFn === 'function' + + // populate Content-Length + var len + if (chunk !== undefined) { + if (Buffer.isBuffer(chunk)) { + // get length of Buffer + len = chunk.length + } else if (!generateETag && chunk.length < 1000) { + // just calculate length when no ETag + small chunk + len = Buffer.byteLength(chunk, encoding) + } else { + // convert chunk to Buffer and calculate + chunk = Buffer.from(chunk, encoding) + encoding = undefined; + len = chunk.length + } + + this.set('Content-Length', len); + } + + // populate ETag + var etag; + if (generateETag && len !== undefined) { + if ((etag = etagFn(chunk, encoding))) { + this.set('ETag', etag); + } + } + + // freshness + if (req.fresh) this.status(304); + + // strip irrelevant headers + if (204 === this.statusCode || 304 === this.statusCode) { + this.removeHeader('Content-Type'); + this.removeHeader('Content-Length'); + this.removeHeader('Transfer-Encoding'); + chunk = ''; + } + + // alter headers for 205 + if (this.statusCode === 205) { + this.set('Content-Length', '0') + this.removeHeader('Transfer-Encoding') + chunk = '' + } + + if (req.method === 'HEAD') { + // skip body for HEAD + this.end(); + } else { + // respond + this.end(chunk, encoding); + } + + return this; +}; + +/** + * Send JSON response. + * + * Examples: + * + * res.json(null); + * res.json({ user: 'tj' }); + * + * @param {string|number|boolean|object} obj + * @public + */ + +res.json = function json(obj) { + // settings + var app = this.app; + var escape = app.get('json escape') + var replacer = app.get('json replacer'); + var spaces = app.get('json spaces'); + var body = stringify(obj, replacer, spaces, escape) + + // content-type + if (!this.get('Content-Type')) { + this.set('Content-Type', 'application/json'); + } + + return this.send(body); +}; + +/** + * Send JSON response with JSONP callback support. + * + * Examples: + * + * res.jsonp(null); + * res.jsonp({ user: 'tj' }); + * + * @param {string|number|boolean|object} obj + * @public + */ + +res.jsonp = function jsonp(obj) { + // settings + var app = this.app; + var escape = app.get('json escape') + var replacer = app.get('json replacer'); + var spaces = app.get('json spaces'); + var body = stringify(obj, replacer, spaces, escape) + var callback = this.req.query[app.get('jsonp callback name')]; + + // content-type + if (!this.get('Content-Type')) { + this.set('X-Content-Type-Options', 'nosniff'); + this.set('Content-Type', 'application/json'); + } + + // fixup callback + if (Array.isArray(callback)) { + callback = callback[0]; + } + + // jsonp + if (typeof callback === 'string' && callback.length !== 0) { + this.set('X-Content-Type-Options', 'nosniff'); + this.set('Content-Type', 'text/javascript'); + + // restrict callback charset + callback = callback.replace(/[^\[\]\w$.]/g, ''); + + if (body === undefined) { + // empty argument + body = '' + } else if (typeof body === 'string') { + // replace chars not allowed in JavaScript that are in JSON + body = body + .replace(/\u2028/g, '\\u2028') + .replace(/\u2029/g, '\\u2029') + } + + // the /**/ is a specific security mitigation for "Rosetta Flash JSONP abuse" + // the typeof check is just to reduce client error noise + body = '/**/ typeof ' + callback + ' === \'function\' && ' + callback + '(' + body + ');'; + } + + return this.send(body); +}; + +/** + * Send given HTTP status code. + * + * Sets the response status to `statusCode` and the body of the + * response to the standard description from node's http.STATUS_CODES + * or the statusCode number if no description. + * + * Examples: + * + * res.sendStatus(200); + * + * @param {number} statusCode + * @public + */ + +res.sendStatus = function sendStatus(statusCode) { + var body = statuses.message[statusCode] || String(statusCode) + + this.status(statusCode); + this.type('txt'); + + return this.send(body); +}; + +/** + * Transfer the file at the given `path`. + * + * Automatically sets the _Content-Type_ response header field. + * The callback `callback(err)` is invoked when the transfer is complete + * or when an error occurs. Be sure to check `res.headersSent` + * if you wish to attempt responding, as the header and some data + * may have already been transferred. + * + * Options: + * + * - `maxAge` defaulting to 0 (can be string converted by `ms`) + * - `root` root directory for relative filenames + * - `headers` object of headers to serve with file + * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them + * + * Other options are passed along to `send`. + * + * Examples: + * + * The following example illustrates how `res.sendFile()` may + * be used as an alternative for the `static()` middleware for + * dynamic situations. The code backing `res.sendFile()` is actually + * the same code, so HTTP cache support etc is identical. + * + * app.get('/user/:uid/photos/:file', function(req, res){ + * var uid = req.params.uid + * , file = req.params.file; + * + * req.user.mayViewFilesFrom(uid, function(yes){ + * if (yes) { + * res.sendFile('/uploads/' + uid + '/' + file); + * } else { + * res.send(403, 'Sorry! you cant see that.'); + * } + * }); + * }); + * + * @public + */ + +res.sendFile = function sendFile(path, options, callback) { + var done = callback; + var req = this.req; + var res = this; + var next = req.next; + var opts = options || {}; + + if (!path) { + throw new TypeError('path argument is required to res.sendFile'); + } + + if (typeof path !== 'string') { + throw new TypeError('path must be a string to res.sendFile') + } + + // support function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + if (!opts.root && !pathIsAbsolute(path)) { + throw new TypeError('path must be absolute or specify root to res.sendFile'); + } + + // create file stream + var pathname = encodeURI(path); + + // wire application etag option to send + opts.etag = this.app.enabled('etag'); + var file = send(req, pathname, opts); + + // transfer + sendfile(res, file, opts, function (err) { + if (done) return done(err); + if (err && err.code === 'EISDIR') return next(); + + // next() all but write errors + if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') { + next(err); + } + }); +}; + +/** + * Transfer the file at the given `path` as an attachment. + * + * Optionally providing an alternate attachment `filename`, + * and optional callback `callback(err)`. The callback is invoked + * when the data transfer is complete, or when an error has + * occurred. Be sure to check `res.headersSent` if you plan to respond. + * + * Optionally providing an `options` object to use with `res.sendFile()`. + * This function will set the `Content-Disposition` header, overriding + * any `Content-Disposition` header passed as header options in order + * to set the attachment and filename. + * + * This method uses `res.sendFile()`. + * + * @public + */ + +res.download = function download (path, filename, options, callback) { + var done = callback; + var name = filename; + var opts = options || null + + // support function as second or third arg + if (typeof filename === 'function') { + done = filename; + name = null; + opts = null + } else if (typeof options === 'function') { + done = options + opts = null + } + + // support optional filename, where options may be in it's place + if (typeof filename === 'object' && + (typeof options === 'function' || options === undefined)) { + name = null + opts = filename + } + + // set Content-Disposition when file is sent + var headers = { + 'Content-Disposition': contentDisposition(name || path) + }; + + // merge user-provided headers + if (opts && opts.headers) { + var keys = Object.keys(opts.headers) + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + if (key.toLowerCase() !== 'content-disposition') { + headers[key] = opts.headers[key] + } + } + } + + // merge user-provided options + opts = Object.create(opts) + opts.headers = headers + + // Resolve the full path for sendFile + var fullPath = !opts.root + ? resolve(path) + : path + + // send file + return this.sendFile(fullPath, opts, done) +}; + +/** + * Set _Content-Type_ response header with `type` through `mime.contentType()` + * when it does not contain "/", or set the Content-Type to `type` otherwise. + * When no mapping is found though `mime.contentType()`, the type is set to + * "application/octet-stream". + * + * Examples: + * + * res.type('.html'); + * res.type('html'); + * res.type('json'); + * res.type('application/json'); + * res.type('png'); + * + * @param {String} type + * @return {ServerResponse} for chaining + * @public + */ + +res.contentType = +res.type = function contentType(type) { + var ct = type.indexOf('/') === -1 + ? (mime.contentType(type) || 'application/octet-stream') + : type; + + return this.set('Content-Type', ct); +}; + +/** + * Respond to the Acceptable formats using an `obj` + * of mime-type callbacks. + * + * This method uses `req.accepted`, an array of + * acceptable types ordered by their quality values. + * When "Accept" is not present the _first_ callback + * is invoked, otherwise the first match is used. When + * no match is performed the server responds with + * 406 "Not Acceptable". + * + * Content-Type is set for you, however if you choose + * you may alter this within the callback using `res.type()` + * or `res.set('Content-Type', ...)`. + * + * res.format({ + * 'text/plain': function(){ + * res.send('hey'); + * }, + * + * 'text/html': function(){ + * res.send('

hey

'); + * }, + * + * 'application/json': function () { + * res.send({ message: 'hey' }); + * } + * }); + * + * In addition to canonicalized MIME types you may + * also use extnames mapped to these types: + * + * res.format({ + * text: function(){ + * res.send('hey'); + * }, + * + * html: function(){ + * res.send('

hey

'); + * }, + * + * json: function(){ + * res.send({ message: 'hey' }); + * } + * }); + * + * By default Express passes an `Error` + * with a `.status` of 406 to `next(err)` + * if a match is not made. If you provide + * a `.default` callback it will be invoked + * instead. + * + * @param {Object} obj + * @return {ServerResponse} for chaining + * @public + */ + +res.format = function(obj){ + var req = this.req; + var next = req.next; + + var keys = Object.keys(obj) + .filter(function (v) { return v !== 'default' }) + + var key = keys.length > 0 + ? req.accepts(keys) + : false; + + this.vary("Accept"); + + if (key) { + this.set('Content-Type', normalizeType(key).value); + obj[key](req, this, next); + } else if (obj.default) { + obj.default(req, this, next) + } else { + next(createError(406, { + types: normalizeTypes(keys).map(function (o) { return o.value }) + })) + } + + return this; +}; + +/** + * Set _Content-Disposition_ header to _attachment_ with optional `filename`. + * + * @param {String} filename + * @return {ServerResponse} + * @public + */ + +res.attachment = function attachment(filename) { + if (filename) { + this.type(extname(filename)); + } + + this.set('Content-Disposition', contentDisposition(filename)); + + return this; +}; + +/** + * Append additional header `field` with value `val`. + * + * Example: + * + * res.append('Link', ['', '']); + * res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly'); + * res.append('Warning', '199 Miscellaneous warning'); + * + * @param {String} field + * @param {String|Array} val + * @return {ServerResponse} for chaining + * @public + */ + +res.append = function append(field, val) { + var prev = this.get(field); + var value = val; + + if (prev) { + // concat the new and prev vals + value = Array.isArray(prev) ? prev.concat(val) + : Array.isArray(val) ? [prev].concat(val) + : [prev, val] + } + + return this.set(field, value); +}; + +/** + * Set header `field` to `val`, or pass + * an object of header fields. + * + * Examples: + * + * res.set('Foo', ['bar', 'baz']); + * res.set('Accept', 'application/json'); + * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' }); + * + * Aliased as `res.header()`. + * + * When the set header is "Content-Type", the type is expanded to include + * the charset if not present using `mime.contentType()`. + * + * @param {String|Object} field + * @param {String|Array} val + * @return {ServerResponse} for chaining + * @public + */ + +res.set = +res.header = function header(field, val) { + if (arguments.length === 2) { + var value = Array.isArray(val) + ? val.map(String) + : String(val); + + // add charset to content-type + if (field.toLowerCase() === 'content-type') { + if (Array.isArray(value)) { + throw new TypeError('Content-Type cannot be set to an Array'); + } + value = mime.contentType(value) + } + + this.setHeader(field, value); + } else { + for (var key in field) { + this.set(key, field[key]); + } + } + return this; +}; + +/** + * Get value for header `field`. + * + * @param {String} field + * @return {String} + * @public + */ + +res.get = function(field){ + return this.getHeader(field); +}; + +/** + * Clear cookie `name`. + * + * @param {String} name + * @param {Object} [options] + * @return {ServerResponse} for chaining + * @public + */ + +res.clearCookie = function clearCookie(name, options) { + // Force cookie expiration by setting expires to the past + const opts = { path: '/', ...options, expires: new Date(1)}; + // ensure maxAge is not passed + delete opts.maxAge + + return this.cookie(name, '', opts); +}; + +/** + * Set cookie `name` to `value`, with the given `options`. + * + * Options: + * + * - `maxAge` max-age in milliseconds, converted to `expires` + * - `signed` sign the cookie + * - `path` defaults to "/" + * + * Examples: + * + * // "Remember Me" for 15 minutes + * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); + * + * // same as above + * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) + * + * @param {String} name + * @param {String|Object} value + * @param {Object} [options] + * @return {ServerResponse} for chaining + * @public + */ + +res.cookie = function (name, value, options) { + var opts = { ...options }; + var secret = this.req.secret; + var signed = opts.signed; + + if (signed && !secret) { + throw new Error('cookieParser("secret") required for signed cookies'); + } + + var val = typeof value === 'object' + ? 'j:' + JSON.stringify(value) + : String(value); + + if (signed) { + val = 's:' + sign(val, secret); + } + + if (opts.maxAge != null) { + var maxAge = opts.maxAge - 0 + + if (!isNaN(maxAge)) { + opts.expires = new Date(Date.now() + maxAge) + opts.maxAge = Math.floor(maxAge / 1000) + } + } + + if (opts.path == null) { + opts.path = '/'; + } + + this.append('Set-Cookie', cookie.serialize(name, String(val), opts)); + + return this; +}; + +/** + * Set the location header to `url`. + * + * The given `url` can also be "back", which redirects + * to the _Referrer_ or _Referer_ headers or "/". + * + * Examples: + * + * res.location('/foo/bar').; + * res.location('http://example.com'); + * res.location('../login'); + * + * @param {String} url + * @return {ServerResponse} for chaining + * @public + */ + +res.location = function location(url) { + return this.set('Location', encodeUrl(url)); +}; + +/** + * Redirect to the given `url` with optional response `status` + * defaulting to 302. + * + * Examples: + * + * res.redirect('/foo/bar'); + * res.redirect('http://example.com'); + * res.redirect(301, 'http://example.com'); + * res.redirect('../login'); // /blog/post/1 -> /blog/login + * + * @public + */ + +res.redirect = function redirect(url) { + var address = url; + var body; + var status = 302; + + // allow status / url + if (arguments.length === 2) { + status = arguments[0] + address = arguments[1] + } + + if (!address) { + deprecate('Provide a url argument'); + } + + if (typeof address !== 'string') { + deprecate('Url must be a string'); + } + + if (typeof status !== 'number') { + deprecate('Status must be a number'); + } + + // Set location header + address = this.location(address).get('Location'); + + // Support text/{plain,html} by default + this.format({ + text: function(){ + body = statuses.message[status] + '. Redirecting to ' + address + }, + + html: function(){ + var u = escapeHtml(address); + body = '

' + statuses.message[status] + '. Redirecting to ' + u + '

' + }, + + default: function(){ + body = ''; + } + }); + + // Respond + this.status(status); + this.set('Content-Length', Buffer.byteLength(body)); + + if (this.req.method === 'HEAD') { + this.end(); + } else { + this.end(body); + } +}; + +/** + * Add `field` to Vary. If already present in the Vary set, then + * this call is simply ignored. + * + * @param {Array|String} field + * @return {ServerResponse} for chaining + * @public + */ + +res.vary = function(field){ + vary(this, field); + + return this; +}; + +/** + * Render `view` with the given `options` and optional callback `fn`. + * When a callback function is given a response will _not_ be made + * automatically, otherwise a response of _200_ and _text/html_ is given. + * + * Options: + * + * - `cache` boolean hinting to the engine it should cache + * - `filename` filename of the view being rendered + * + * @public + */ + +res.render = function render(view, options, callback) { + var app = this.req.app; + var done = callback; + var opts = options || {}; + var req = this.req; + var self = this; + + // support callback function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + // merge res.locals + opts._locals = self.locals; + + // default callback to respond + done = done || function (err, str) { + if (err) return req.next(err); + self.send(str); + }; + + // render + app.render(view, opts, done); +}; + +// pipe the send file stream +function sendfile(res, file, options, callback) { + var done = false; + var streaming; + + // request aborted + function onaborted() { + if (done) return; + done = true; + + var err = new Error('Request aborted'); + err.code = 'ECONNABORTED'; + callback(err); + } + + // directory + function ondirectory() { + if (done) return; + done = true; + + var err = new Error('EISDIR, read'); + err.code = 'EISDIR'; + callback(err); + } + + // errors + function onerror(err) { + if (done) return; + done = true; + callback(err); + } + + // ended + function onend() { + if (done) return; + done = true; + callback(); + } + + // file + function onfile() { + streaming = false; + } + + // finished + function onfinish(err) { + if (err && err.code === 'ECONNRESET') return onaborted(); + if (err) return onerror(err); + if (done) return; + + setImmediate(function () { + if (streaming !== false && !done) { + onaborted(); + return; + } + + if (done) return; + done = true; + callback(); + }); + } + + // streaming + function onstream() { + streaming = true; + } + + file.on('directory', ondirectory); + file.on('end', onend); + file.on('error', onerror); + file.on('file', onfile); + file.on('stream', onstream); + onFinished(res, onfinish); + + if (options.headers) { + // set headers on successful transfer + file.on('headers', function headers(res) { + var obj = options.headers; + var keys = Object.keys(obj); + + for (var i = 0; i < keys.length; i++) { + var k = keys[i]; + res.setHeader(k, obj[k]); + } + }); + } + + // pipe + file.pipe(res); +} + +/** + * Stringify JSON, like JSON.stringify, but v8 optimized, with the + * ability to escape characters that can trigger HTML sniffing. + * + * @param {*} value + * @param {function} replacer + * @param {number} spaces + * @param {boolean} escape + * @returns {string} + * @private + */ + +function stringify (value, replacer, spaces, escape) { + // v8 checks arguments.length for optimizing simple call + // https://bugs.chromium.org/p/v8/issues/detail?id=4730 + var json = replacer || spaces + ? JSON.stringify(value, replacer, spaces) + : JSON.stringify(value); + + if (escape && typeof json === 'string') { + json = json.replace(/[<>&]/g, function (c) { + switch (c.charCodeAt(0)) { + case 0x3c: + return '\\u003c' + case 0x3e: + return '\\u003e' + case 0x26: + return '\\u0026' + /* istanbul ignore next: unreachable default */ + default: + return c + } + }) + } + + return json +} diff --git a/node_modules/@nestjs/platform-express/node_modules/express/lib/utils.js b/node_modules/@nestjs/platform-express/node_modules/express/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..4f21e7ef1e3d2ed8da18a9671f983b012e45198b --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/lib/utils.js @@ -0,0 +1,271 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @api private + */ + +var { METHODS } = require('node:http'); +var contentType = require('content-type'); +var etag = require('etag'); +var mime = require('mime-types') +var proxyaddr = require('proxy-addr'); +var qs = require('qs'); +var querystring = require('node:querystring'); +const { Buffer } = require('node:buffer'); + + +/** + * A list of lowercased HTTP methods that are supported by Node.js. + * @api private + */ +exports.methods = METHODS.map((method) => method.toLowerCase()); + +/** + * Return strong ETag for `body`. + * + * @param {String|Buffer} body + * @param {String} [encoding] + * @return {String} + * @api private + */ + +exports.etag = createETagGenerator({ weak: false }) + +/** + * Return weak ETag for `body`. + * + * @param {String|Buffer} body + * @param {String} [encoding] + * @return {String} + * @api private + */ + +exports.wetag = createETagGenerator({ weak: true }) + +/** + * Normalize the given `type`, for example "html" becomes "text/html". + * + * @param {String} type + * @return {Object} + * @api private + */ + +exports.normalizeType = function(type){ + return ~type.indexOf('/') + ? acceptParams(type) + : { value: (mime.lookup(type) || 'application/octet-stream'), params: {} } +}; + +/** + * Normalize `types`, for example "html" becomes "text/html". + * + * @param {Array} types + * @return {Array} + * @api private + */ + +exports.normalizeTypes = function(types) { + return types.map(exports.normalizeType); +}; + + +/** + * Parse accept params `str` returning an + * object with `.value`, `.quality` and `.params`. + * + * @param {String} str + * @return {Object} + * @api private + */ + +function acceptParams (str) { + var length = str.length; + var colonIndex = str.indexOf(';'); + var index = colonIndex === -1 ? length : colonIndex; + var ret = { value: str.slice(0, index).trim(), quality: 1, params: {} }; + + while (index < length) { + var splitIndex = str.indexOf('=', index); + if (splitIndex === -1) break; + + var colonIndex = str.indexOf(';', index); + var endIndex = colonIndex === -1 ? length : colonIndex; + + if (splitIndex > endIndex) { + index = str.lastIndexOf(';', splitIndex - 1) + 1; + continue; + } + + var key = str.slice(index, splitIndex).trim(); + var value = str.slice(splitIndex + 1, endIndex).trim(); + + if (key === 'q') { + ret.quality = parseFloat(value); + } else { + ret.params[key] = value; + } + + index = endIndex + 1; + } + + return ret; +} + +/** + * Compile "etag" value to function. + * + * @param {Boolean|String|Function} val + * @return {Function} + * @api private + */ + +exports.compileETag = function(val) { + var fn; + + if (typeof val === 'function') { + return val; + } + + switch (val) { + case true: + case 'weak': + fn = exports.wetag; + break; + case false: + break; + case 'strong': + fn = exports.etag; + break; + default: + throw new TypeError('unknown value for etag function: ' + val); + } + + return fn; +} + +/** + * Compile "query parser" value to function. + * + * @param {String|Function} val + * @return {Function} + * @api private + */ + +exports.compileQueryParser = function compileQueryParser(val) { + var fn; + + if (typeof val === 'function') { + return val; + } + + switch (val) { + case true: + case 'simple': + fn = querystring.parse; + break; + case false: + break; + case 'extended': + fn = parseExtendedQueryString; + break; + default: + throw new TypeError('unknown value for query parser function: ' + val); + } + + return fn; +} + +/** + * Compile "proxy trust" value to function. + * + * @param {Boolean|String|Number|Array|Function} val + * @return {Function} + * @api private + */ + +exports.compileTrust = function(val) { + if (typeof val === 'function') return val; + + if (val === true) { + // Support plain true/false + return function(){ return true }; + } + + if (typeof val === 'number') { + // Support trusting hop count + return function(a, i){ return i < val }; + } + + if (typeof val === 'string') { + // Support comma-separated values + val = val.split(',') + .map(function (v) { return v.trim() }) + } + + return proxyaddr.compile(val || []); +} + +/** + * Set the charset in a given Content-Type string. + * + * @param {String} type + * @param {String} charset + * @return {String} + * @api private + */ + +exports.setCharset = function setCharset(type, charset) { + if (!type || !charset) { + return type; + } + + // parse type + var parsed = contentType.parse(type); + + // set charset + parsed.parameters.charset = charset; + + // format type + return contentType.format(parsed); +}; + +/** + * Create an ETag generator function, generating ETags with + * the given options. + * + * @param {object} options + * @return {function} + * @private + */ + +function createETagGenerator (options) { + return function generateETag (body, encoding) { + var buf = !Buffer.isBuffer(body) + ? Buffer.from(body, encoding) + : body + + return etag(buf, options) + } +} + +/** + * Parse an extended query string with qs. + * + * @param {String} str + * @return {Object} + * @private + */ + +function parseExtendedQueryString(str) { + return qs.parse(str, { + allowPrototypes: true + }); +} diff --git a/node_modules/@nestjs/platform-express/node_modules/express/lib/view.js b/node_modules/@nestjs/platform-express/node_modules/express/lib/view.js new file mode 100644 index 0000000000000000000000000000000000000000..d66b4a2d89cda638ca1dcbba3da090e631175fc1 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/lib/view.js @@ -0,0 +1,205 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('express:view'); +var path = require('node:path'); +var fs = require('node:fs'); + +/** + * Module variables. + * @private + */ + +var dirname = path.dirname; +var basename = path.basename; +var extname = path.extname; +var join = path.join; +var resolve = path.resolve; + +/** + * Module exports. + * @public + */ + +module.exports = View; + +/** + * Initialize a new `View` with the given `name`. + * + * Options: + * + * - `defaultEngine` the default template engine name + * - `engines` template engine require() cache + * - `root` root path for view lookup + * + * @param {string} name + * @param {object} options + * @public + */ + +function View(name, options) { + var opts = options || {}; + + this.defaultEngine = opts.defaultEngine; + this.ext = extname(name); + this.name = name; + this.root = opts.root; + + if (!this.ext && !this.defaultEngine) { + throw new Error('No default engine was specified and no extension was provided.'); + } + + var fileName = name; + + if (!this.ext) { + // get extension from default engine name + this.ext = this.defaultEngine[0] !== '.' + ? '.' + this.defaultEngine + : this.defaultEngine; + + fileName += this.ext; + } + + if (!opts.engines[this.ext]) { + // load engine + var mod = this.ext.slice(1) + debug('require "%s"', mod) + + // default engine export + var fn = require(mod).__express + + if (typeof fn !== 'function') { + throw new Error('Module "' + mod + '" does not provide a view engine.') + } + + opts.engines[this.ext] = fn + } + + // store loaded engine + this.engine = opts.engines[this.ext]; + + // lookup path + this.path = this.lookup(fileName); +} + +/** + * Lookup view by the given `name` + * + * @param {string} name + * @private + */ + +View.prototype.lookup = function lookup(name) { + var path; + var roots = [].concat(this.root); + + debug('lookup "%s"', name); + + for (var i = 0; i < roots.length && !path; i++) { + var root = roots[i]; + + // resolve the path + var loc = resolve(root, name); + var dir = dirname(loc); + var file = basename(loc); + + // resolve the file + path = this.resolve(dir, file); + } + + return path; +}; + +/** + * Render with the given options. + * + * @param {object} options + * @param {function} callback + * @private + */ + +View.prototype.render = function render(options, callback) { + var sync = true; + + debug('render "%s"', this.path); + + // render, normalizing sync callbacks + this.engine(this.path, options, function onRender() { + if (!sync) { + return callback.apply(this, arguments); + } + + // copy arguments + var args = new Array(arguments.length); + var cntx = this; + + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + // force callback to be async + return process.nextTick(function renderTick() { + return callback.apply(cntx, args); + }); + }); + + sync = false; +}; + +/** + * Resolve the file within the given directory. + * + * @param {string} dir + * @param {string} file + * @private + */ + +View.prototype.resolve = function resolve(dir, file) { + var ext = this.ext; + + // . + var path = join(dir, file); + var stat = tryStat(path); + + if (stat && stat.isFile()) { + return path; + } + + // /index. + path = join(dir, basename(file, ext), 'index' + ext); + stat = tryStat(path); + + if (stat && stat.isFile()) { + return path; + } +}; + +/** + * Return a stat, maybe. + * + * @param {string} path + * @return {fs.Stats} + * @private + */ + +function tryStat(path) { + debug('stat "%s"', path); + + try { + return fs.statSync(path); + } catch (e) { + return undefined; + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/HISTORY.md b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..6812655c8879f5dc3ff3182ed0741fd8c93b347c --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/HISTORY.md @@ -0,0 +1,292 @@ +2.0.1 / 2025-03-27 +========== + +2.0.0 / 2024-08-31 +========== + + * Drop node <18 + * Use `content-type@^1.0.5` and `media-typer@^1.0.0` for type validation + - No behavior changes, upgrades `media-typer` + * deps: mime-types@^3.0.0 + - Add `application/toml` with extension `.toml` + - Add `application/ubjson` with extension `.ubj` + - Add `application/x-keepass2` with extension `.kdbx` + - Add deprecated iWorks mime types and extensions + - Add extension `.amr` to `audio/amr` + - Add extension `.cjs` to `application/node` + - Add extension `.dbf` to `application/vnd.dbf` + - Add extension `.m4s` to `video/iso.segment` + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extension `.opus` to `audio/ogg` + - Add extension `.rar` to `application/vnd.rar` + - Add extension `.td` to `application/urc-targetdesc+xml` + - Add extension `.trig` to `application/trig` + - Add extensions from IANA for `application/*+xml` types + - Add `image/avif` with extension `.avif` + - Add `image/ktx2` with extension `.ktx2` + - Add `image/vnd.ms-dds` with extension `.dds` + - Add new upstream MIME types + - Fix extension of `application/vnd.apple.keynote` to be `.key` + - Remove ambigious extensions from IANA for `application/*+xml` types + - Update primary extension to `.es` for `application/ecmascript` + +1.6.18 / 2019-04-26 +=================== + + * Fix regression passing request object to `typeis.is` + +1.6.17 / 2019-04-25 +=================== + + * deps: mime-types@~2.1.24 + - Add Apple file extensions from IANA + - Add extension `.csl` to `application/vnd.citationstyles.style+xml` + - Add extension `.es` to `application/ecmascript` + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add extension `.owl` to `application/rdf+xml` + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add extensions from IANA for `image/*` types + - Add extensions from IANA for `model/*` types + - Add extensions to HEIC image types + - Add new mime types + - Add `text/mdx` with extension `.mdx` + * perf: prevent internal `throw` on invalid type + +1.6.16 / 2018-02-16 +=================== + + * deps: mime-types@~2.1.18 + - Add `application/raml+yaml` with extension `.raml` + - Add `application/wasm` with extension `.wasm` + - Add `text/shex` with extension `.shex` + - Add extensions for JPEG-2000 images + - Add extensions from IANA for `message/*` types + - Add extension `.mjs` to `application/javascript` + - Add extension `.wadl` to `application/vnd.sun.wadl+xml` + - Add extension `.gz` to `application/gzip` + - Add glTF types and extensions + - Add new mime types + - Update extensions `.md` and `.markdown` to be `text/markdown` + - Update font MIME types + - Update `text/hjson` to registered `application/hjson` + +1.6.15 / 2017-03-31 +=================== + + * deps: mime-types@~2.1.15 + - Add new mime types + +1.6.14 / 2016-11-18 +=================== + + * deps: mime-types@~2.1.13 + - Add new mime types + +1.6.13 / 2016-05-18 +=================== + + * deps: mime-types@~2.1.11 + - Add new mime types + +1.6.12 / 2016-02-28 +=================== + + * deps: mime-types@~2.1.10 + - Add new mime types + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + +1.6.11 / 2016-01-29 +=================== + + * deps: mime-types@~2.1.9 + - Add new mime types + +1.6.10 / 2015-12-01 +=================== + + * deps: mime-types@~2.1.8 + - Add new mime types + +1.6.9 / 2015-09-27 +================== + + * deps: mime-types@~2.1.7 + - Add new mime types + +1.6.8 / 2015-09-04 +================== + + * deps: mime-types@~2.1.6 + - Add new mime types + +1.6.7 / 2015-08-20 +================== + + * Fix type error when given invalid type to match against + * deps: mime-types@~2.1.5 + - Add new mime types + +1.6.6 / 2015-07-31 +================== + + * deps: mime-types@~2.1.4 + - Add new mime types + +1.6.5 / 2015-07-16 +================== + + * deps: mime-types@~2.1.3 + - Add new mime types + +1.6.4 / 2015-07-01 +================== + + * deps: mime-types@~2.1.2 + - Add new mime types + * perf: enable strict mode + * perf: remove argument reassignment + +1.6.3 / 2015-06-08 +================== + + * deps: mime-types@~2.1.1 + - Add new mime types + * perf: reduce try block size + * perf: remove bitwise operations + +1.6.2 / 2015-05-10 +================== + + * deps: mime-types@~2.0.11 + - Add new mime types + +1.6.1 / 2015-03-13 +================== + + * deps: mime-types@~2.0.10 + - Add new mime types + +1.6.0 / 2015-02-12 +================== + + * fix false-positives in `hasBody` `Transfer-Encoding` check + * support wildcard for both type and subtype (`*/*`) + +1.5.7 / 2015-02-09 +================== + + * fix argument reassignment + * deps: mime-types@~2.0.9 + - Add new mime types + +1.5.6 / 2015-01-29 +================== + + * deps: mime-types@~2.0.8 + - Add new mime types + +1.5.5 / 2014-12-30 +================== + + * deps: mime-types@~2.0.7 + - Add new mime types + - Fix missing extensions + - Fix various invalid MIME type entries + - Remove example template MIME types + - deps: mime-db@~1.5.0 + +1.5.4 / 2014-12-10 +================== + + * deps: mime-types@~2.0.4 + - Add new mime types + - deps: mime-db@~1.3.0 + +1.5.3 / 2014-11-09 +================== + + * deps: mime-types@~2.0.3 + - Add new mime types + - deps: mime-db@~1.2.0 + +1.5.2 / 2014-09-28 +================== + + * deps: mime-types@~2.0.2 + - Add new mime types + - deps: mime-db@~1.1.0 + +1.5.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + * deps: media-typer@0.3.0 + * deps: mime-types@~2.0.1 + - Support Node.js 0.6 + +1.5.0 / 2014-09-05 +================== + + * fix `hasbody` to be true for `content-length: 0` + +1.4.0 / 2014-09-02 +================== + + * update mime-types + +1.3.2 / 2014-06-24 +================== + + * use `~` range on mime-types + +1.3.1 / 2014-06-19 +================== + + * fix global variable leak + +1.3.0 / 2014-06-19 +================== + + * improve type parsing + + - invalid media type never matches + - media type not case-sensitive + - extra LWS does not affect results + +1.2.2 / 2014-06-19 +================== + + * fix behavior on unknown type argument + +1.2.1 / 2014-06-03 +================== + + * switch dependency from `mime` to `mime-types@1.0.0` + +1.2.0 / 2014-05-11 +================== + + * support suffix matching: + + - `+json` matches `application/vnd+json` + - `*/vnd+json` matches `application/vnd+json` + - `application/*+json` matches `application/vnd+json` + +1.1.0 / 2014-04-12 +================== + + * add non-array values support + * expose internal utilities: + + - `.is()` + - `.hasBody()` + - `.normalize()` + - `.match()` + +1.0.1 / 2014-03-30 +================== + + * add `multipart` as a shorthand diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/LICENSE b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..386b7b6946e47bc46f8138791049b4e6a7cef889 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/README.md b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d23946e607b8d0ea667b7ffefe7e63a68e052df7 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/README.md @@ -0,0 +1,198 @@ +# type-is + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Infer the content-type of a request. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install type-is +``` + +## API + +```js +var http = require('http') +var typeis = require('type-is') + +http.createServer(function (req, res) { + var istext = typeis(req, ['text/*']) + res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text') +}) +``` + +### typeis(request, types) + +Checks if the `request` is one of the `types`. If the request has no body, +even if there is a `Content-Type` header, then `null` is returned. If the +`Content-Type` header is invalid or does not matches any of the `types`, then +`false` is returned. Otherwise, a string of the type that matched is returned. + +The `request` argument is expected to be a Node.js HTTP request. The `types` +argument is an array of type strings. + +Each type in the `types` array can be one of the following: + +- A file extension name such as `json`. This name will be returned if matched. +- A mime type such as `application/json`. +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. + The full mime type will be returned if matched. +- A suffix such as `+json`. This can be combined with a wildcard such as + `*/vnd+json` or `application/*+json`. The full mime type will be returned + if matched. + +Some examples to illustrate the inputs and returned value: + +```js +// req.headers.content-type = 'application/json' + +typeis(req, ['json']) // => 'json' +typeis(req, ['html', 'json']) // => 'json' +typeis(req, ['application/*']) // => 'application/json' +typeis(req, ['application/json']) // => 'application/json' + +typeis(req, ['html']) // => false +``` + +### typeis.hasBody(request) + +Returns a Boolean if the given `request` has a body, regardless of the +`Content-Type` header. + +Having a body has no relation to how large the body is (it may be 0 bytes). +This is similar to how file existence works. If a body does exist, then this +indicates that there is data to read from the Node.js request stream. + +```js +if (typeis.hasBody(req)) { + // read the body, since there is one + + req.on('data', function (chunk) { + // ... + }) +} +``` + +### typeis.is(mediaType, types) + +Checks if the `mediaType` is one of the `types`. If the `mediaType` is invalid +or does not matches any of the `types`, then `false` is returned. Otherwise, a +string of the type that matched is returned. + +The `mediaType` argument is expected to be a +[media type](https://tools.ietf.org/html/rfc6838) string. The `types` argument +is an array of type strings. + +Each type in the `types` array can be one of the following: + +- A file extension name such as `json`. This name will be returned if matched. +- A mime type such as `application/json`. +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. + The full mime type will be returned if matched. +- A suffix such as `+json`. This can be combined with a wildcard such as + `*/vnd+json` or `application/*+json`. The full mime type will be returned + if matched. + +Some examples to illustrate the inputs and returned value: + +```js +var mediaType = 'application/json' + +typeis.is(mediaType, ['json']) // => 'json' +typeis.is(mediaType, ['html', 'json']) // => 'json' +typeis.is(mediaType, ['application/*']) // => 'application/json' +typeis.is(mediaType, ['application/json']) // => 'application/json' + +typeis.is(mediaType, ['html']) // => false +``` + +### typeis.match(expected, actual) + +Match the type string `expected` with `actual`, taking in to account wildcards. +A wildcard can only be in the type of the subtype part of a media type and only +in the `expected` value (as `actual` should be the real media type to match). A +suffix can still be included even with a wildcard subtype. If an input is +malformed, `false` will be returned. + +```js +typeis.match('text/html', 'text/html') // => true +typeis.match('*/html', 'text/html') // => true +typeis.match('text/*', 'text/html') // => true +typeis.match('*/*', 'text/html') // => true +typeis.match('*/*+json', 'application/x-custom+json') // => true +``` + +### typeis.normalize(type) + +Normalize a `type` string. This works by performing the following: + +- If the `type` is not a string, `false` is returned. +- If the string starts with `+` (so it is a `+suffix` shorthand like `+json`), + then it is expanded to contain the complete wildcard notation of `*/*+suffix`. +- If the string contains a `/`, then it is returned as the type. +- Else the string is assumed to be a file extension and the mapped media type is + returned, or `false` is there is no mapping. + +This includes two special mappings: + +- `'multipart'` -> `'multipart/*'` +- `'urlencoded'` -> `'application/x-www-form-urlencoded'` + +## Examples + +### Example body parser + +```js +var express = require('express') +var typeis = require('type-is') + +var app = express() + +app.use(function bodyParser (req, res, next) { + if (!typeis.hasBody(req)) { + return next() + } + + switch (typeis(req, ['urlencoded', 'json', 'multipart'])) { + case 'urlencoded': + // parse urlencoded body + throw new Error('implement urlencoded body parsing') + case 'json': + // parse json body + throw new Error('implement json body parsing') + case 'multipart': + // parse multipart body + throw new Error('implement multipart body parsing') + default: + // 415 error code + res.statusCode = 415 + res.end() + break + } +}) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/type-is/master?label=ci +[ci-url]: https://github.com/jshttp/type-is/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/type-is/master +[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master +[node-version-image]: https://badgen.net/npm/node/type-is +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/type-is +[npm-url]: https://npmjs.org/package/type-is +[npm-version-image]: https://badgen.net/npm/v/type-is +[travis-image]: https://badgen.net/travis/jshttp/type-is/master +[travis-url]: https://travis-ci.org/jshttp/type-is diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/index.js b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/index.js new file mode 100644 index 0000000000000000000000000000000000000000..37d6da3c81e8bdb5bb018b15630a2f7e9c68d76d --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/index.js @@ -0,0 +1,240 @@ +/*! + * type-is + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var contentType = require('content-type') +var mime = require('mime-types') +var typer = require('media-typer') + +/** + * Module exports. + * @public + */ + +module.exports = typeofrequest +module.exports.is = typeis +module.exports.hasBody = hasbody +module.exports.normalize = normalize +module.exports.match = mimeMatch + +/** + * Compare a `value` content-type with `types`. + * Each `type` can be an extension like `html`, + * a special shortcut like `multipart` or `urlencoded`, + * or a mime type. + * + * If no types match, `false` is returned. + * Otherwise, the first `type` that matches is returned. + * + * @param {String} value + * @param {Array} types + * @public + */ + +function typeis (value, types_) { + // Backward compatibility. TODO: Remove. + if (value && typeof value === 'object') { + value = value.headers['content-type'] + } + + var i + var types = types_ + + // remove parameters and normalize + var val = normalizeType(value) + + // no type or invalid + if (!val) { + return false + } + + // support flattened arguments + if (types && !Array.isArray(types)) { + types = new Array(arguments.length - 1) + for (i = 0; i < types.length; i++) { + types[i] = arguments[i + 1] + } + } + + // no types, return the content type + if (!types || !types.length) { + return val + } + + var type + for (i = 0; i < types.length; i++) { + if (mimeMatch(normalize(type = types[i]), val)) { + return type[0] === '+' || type.indexOf('*') !== -1 + ? val + : type + } + } + + // no matches + return false +} + +/** + * Check if a request has a request body. + * A request with a body __must__ either have `transfer-encoding` + * or `content-length` headers set. + * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3 + * + * @param {Object} request + * @return {Boolean} + * @public + */ + +function hasbody (req) { + return req.headers['transfer-encoding'] !== undefined || + !isNaN(req.headers['content-length']) +} + +/** + * Check if the incoming request contains the "Content-Type" + * header field, and it contains any of the give mime `type`s. + * If there is no request body, `null` is returned. + * If there is no content type, `false` is returned. + * Otherwise, it returns the first `type` that matches. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * this.is('html'); // => 'html' + * this.is('text/html'); // => 'text/html' + * this.is('text/*', 'application/json'); // => 'text/html' + * + * // When Content-Type is application/json + * this.is('json', 'urlencoded'); // => 'json' + * this.is('application/json'); // => 'application/json' + * this.is('html', 'application/*'); // => 'application/json' + * + * this.is('html'); // => false + * + * @param {Object} req + * @param {(String|Array)} types... + * @return {(String|false|null)} + * @public + */ + +function typeofrequest (req, types_) { + // no body + if (!hasbody(req)) return null + // support flattened arguments + var types = arguments.length > 2 + ? Array.prototype.slice.call(arguments, 1) + : types_ + // request content type + var value = req.headers['content-type'] + + return typeis(value, types) +} + +/** + * Normalize a mime type. + * If it's a shorthand, expand it to a valid mime type. + * + * In general, you probably want: + * + * var type = is(req, ['urlencoded', 'json', 'multipart']); + * + * Then use the appropriate body parsers. + * These three are the most common request body types + * and are thus ensured to work. + * + * @param {String} type + * @return {String|false|null} + * @public + */ + +function normalize (type) { + if (typeof type !== 'string') { + // invalid type + return false + } + + switch (type) { + case 'urlencoded': + return 'application/x-www-form-urlencoded' + case 'multipart': + return 'multipart/*' + } + + if (type[0] === '+') { + // "+json" -> "*/*+json" expando + return '*/*' + type + } + + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type +} + +/** + * Check if `expected` mime type + * matches `actual` mime type with + * wildcard and +suffix support. + * + * @param {String} expected + * @param {String} actual + * @return {Boolean} + * @public + */ + +function mimeMatch (expected, actual) { + // invalid type + if (expected === false) { + return false + } + + // split types + var actualParts = actual.split('/') + var expectedParts = expected.split('/') + + // invalid format + if (actualParts.length !== 2 || expectedParts.length !== 2) { + return false + } + + // validate type + if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) { + return false + } + + // validate suffix wildcard + if (expectedParts[1].slice(0, 2) === '*+') { + return expectedParts[1].length <= actualParts[1].length + 1 && + expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length) + } + + // validate subtype + if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) { + return false + } + + return true +} + +/** + * Normalize a type and remove parameters. + * + * @param {string} value + * @return {(string|null)} + * @private + */ +function normalizeType (value) { + if (!value) return null + var type = contentType.parse(value, { parameters: false }).type + + return typer.test(type) ? type : null +} diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/LICENSE b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..34b1a2de37216b60b749c23b6f894e51d701ecf0 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/README.md b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7f6847d54901b26a15beec1c5c075cab1e0ddd2b --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/README.md @@ -0,0 +1,69 @@ +# content-type + +[![NPM version][npm-image]][npm-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Build status][build-image]][build-url] +[![Build coverage][coverage-image]][coverage-url] +[![License][license-image]][license-url] + +Create and parse HTTP `Content-Type` header. + +## Installation + +```sh +npm install content-type +``` + +## API + +```js +const contentType = require("content-type"); +``` + +### contentType.parse(string, options?) + +```js +const obj = contentType.parse("image/svg+xml; charset=utf-8"); +``` + +Parse a `Content-Type` header. This will return an object with the following properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): + +- `type`: The media type. Example: `'image/svg+xml'`. +- `parameters`: An object of the parameters in the media type (parameter name is always lower case). Example: `{charset: 'utf-8'}`. + +The parser is lenient and does not error. You should validate `type` and `parameters` before trusting them. + +#### Options + +- `parameters` (default: `true`): Set to `false` to skip parameters. + +### contentType.format(obj) + +```js +const str = contentType.format({ + type: "image/svg+xml", + parameters: { charset: "utf-8" }, +}); +``` + +Format an object into a `Content-Type` header. This will return a string of the content type for the given object with the following properties (examples are shown that produce the string `'image/svg+xml; charset=utf-8'`): + +- `type`: The media type. Example: `'image/svg+xml'`. +- `parameters`: An optional object of the parameters in the media type. Example: `{charset: 'utf-8'}`. + +Throws a `TypeError` if the object contains an invalid type or parameter names. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/content-type +[npm-url]: https://npmjs.org/package/content-type +[downloads-image]: https://img.shields.io/npm/dm/content-type +[downloads-url]: https://npmjs.org/package/content-type +[build-image]: https://img.shields.io/github/actions/workflow/status/jshttp/content-type/ci.yml?branch=master +[build-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml?query=branch%3Amaster +[coverage-image]: https://img.shields.io/codecov/c/gh/jshttp/content-type +[coverage-url]: https://codecov.io/gh/jshttp/content-type +[license-image]: http://img.shields.io/npm/l/content-type.svg?style=flat +[license-url]: LICENSE diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/dist/index.d.ts b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e7289826ff456e1b3bedee2cdad38122e898194 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/dist/index.d.ts @@ -0,0 +1,26 @@ +/*! + * content-type + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ +/** + * The content type object contains a type string and optional parameters. + */ +export interface ContentType { + type: string; + parameters: Record; +} +/** + * Format an object into a `Content-Type` header. + */ +export declare function format(obj: Partial): string; +/** + * Options for parsing a `Content-Type` header. + */ +export interface ParseOptions { + parameters?: boolean; +} +/** + * Parse a `Content-Type` header. + */ +export declare function parse(header: string, options?: ParseOptions): ContentType; diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/dist/index.js b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4026f973dafb1cbfde16dfe0ee72c48492fb299c --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/dist/index.js @@ -0,0 +1,170 @@ +"use strict"; +/*! + * content-type + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.format = format; +exports.parse = parse; +const TEXT_REGEXP = /^[\u0009\u0020-\u007e\u0080-\u00ff]*$/; +const TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; +/** + * RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4 + */ +const QUOTE_REGEXP = /[\\"]/g; +/** + * RegExp to match type in RFC 9110 sec 8.3.1 + * + * media-type = type "/" subtype + * type = token + * subtype = token + */ +const TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; +/** + * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`. + */ +const NullObject = /* @__PURE__ */ (() => { + const C = function () { }; + C.prototype = Object.create(null); + return C; +})(); +/** + * Format an object into a `Content-Type` header. + */ +function format(obj) { + const { type, parameters } = obj; + if (!type || !TYPE_REGEXP.test(type)) { + throw new TypeError(`Invalid type: ${type}`); + } + let result = type; + if (parameters) { + for (const param of Object.keys(parameters)) { + if (!TOKEN_REGEXP.test(param)) { + throw new TypeError(`Invalid parameter name: ${param}`); + } + result += `; ${param}=${qstring(parameters[param])}`; + } + } + return result; +} +/** + * Parse a `Content-Type` header. + */ +function parse(header, options) { + const len = header.length; + let index = skipOWS(header, 0, len); + const valueStart = index; + index = skipValue(header, index, len); + const valueEnd = trailingOWS(header, valueStart, index); + const type = header.slice(valueStart, valueEnd).toLowerCase(); + const parameters = options?.parameters === false + ? new NullObject() + : parseParameters(header, index, len); + return { type, parameters }; +} +const SP = 32; // " " +const HTAB = 9; // "\t" +const SEMI = 59; // ";" +const EQ = 61; // "=" +const DQUOTE = 34; // '"' +const BSLASH = 92; // "\\" +/** + * Parses the parameters of a `Content-Type` header starting at the given index. + */ +function parseParameters(header, index, len) { + const parameters = new NullObject(); + parameter: while (index < len) { + index = skipOWS(header, index + 1 /* Skip over ; */, len); + const keyStart = index; + while (index < len) { + const code = header.charCodeAt(index); + if (code === SEMI) + continue parameter; + if (code === EQ) { + const keyEnd = trailingOWS(header, keyStart, index); + const key = header.slice(keyStart, keyEnd).toLowerCase(); + index = skipOWS(header, index + 1, len); + if (index < len && header.charCodeAt(index) === DQUOTE) { + index++; + let value = ""; + while (index < len) { + const code = header.charCodeAt(index++); + if (code === DQUOTE) { + index = skipValue(header, index, len); + if (parameters[key] === undefined) + parameters[key] = value; + break; + } + if (code === BSLASH && index < len) { + value += header[index++]; + continue; + } + value += String.fromCharCode(code); + } + continue parameter; + } + const valueStart = index; + index = skipValue(header, index, len); + if (parameters[key] === undefined) { + const valueEnd = trailingOWS(header, valueStart, index); + parameters[key] = header.slice(valueStart, valueEnd); + } + continue parameter; + } + index++; + } + } + return parameters; +} +/** + * Skip over characters until a semicolon. + */ +function skipValue(str, index, len) { + while (index < len) { + const char = str.charCodeAt(index); + if (char === SEMI) + break; + index++; + } + return index; +} +/** + * Skip optional whitespace (OWS) in an HTTP header value. + * + * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t"). + */ +function skipOWS(header, index, len) { + while (index < len) { + const char = header.charCodeAt(index); + if (char !== SP && char !== HTAB) + break; + index++; + } + return index; +} +/** + * Trim optional whitespace (OWS) from the end of a substring. + * + * OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t"). + */ +function trailingOWS(header, start, end) { + while (end > start) { + const char = header.charCodeAt(end - 1); + if (char !== SP && char !== HTAB) + break; + end--; + } + return end; +} +/** + * Serialize a parameter value. + */ +function qstring(str) { + if (TOKEN_REGEXP.test(str)) + return str; + if (TEXT_REGEXP.test(str)) + return `"${str.replace(QUOTE_REGEXP, "\\$&")}"`; + throw new TypeError(`Invalid parameter value: ${str}`); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/dist/index.js.map b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/dist/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..db5da25d1a2a305facb5efdc7ff9b9ef6681c8e2 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAwCH,wBAoBC;AAYD,sBAcC;AApFD,MAAM,WAAW,GAAG,uCAAuC,CAAC;AAC5D,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAErD;;GAEG;AACH,MAAM,YAAY,GAAG,QAAQ,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,WAAW,GACf,4DAA4D,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,GAAG,EAAE;IACvC,MAAM,CAAC,GAAG,cAAa,CAAC,CAAC;IACzB,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,CAAC,CAAC;AACX,CAAC,CAAC,EAAgC,CAAC;AAUnC;;GAEG;AACH,SAAgB,MAAM,CAAC,GAAyB;IAC9C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;IAEjC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,SAAS,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,MAAM,GAAG,IAAI,CAAC;IAElB,IAAI,UAAU,EAAE,CAAC;QACf,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC9B,MAAM,IAAI,SAAS,CAAC,2BAA2B,KAAK,EAAE,CAAC,CAAC;YAC1D,CAAC;YAED,MAAM,IAAI,KAAK,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AASD;;GAEG;AACH,SAAgB,KAAK,CAAC,MAAc,EAAE,OAAsB;IAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1B,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IAEpC,MAAM,UAAU,GAAG,KAAK,CAAC;IACzB,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9D,MAAM,UAAU,GACd,OAAO,EAAE,UAAU,KAAK,KAAK;QAC3B,CAAC,CAAC,IAAI,UAAU,EAAE;QAClB,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAE1C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM;AACrB,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO;AACvB,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,MAAM;AACvB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM;AACrB,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,MAAM;AACzB,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,OAAO;AAE1B;;GAEG;AACH,SAAS,eAAe,CACtB,MAAc,EACd,KAAa,EACb,GAAW;IAEX,MAAM,UAAU,GAA2B,IAAI,UAAU,EAAE,CAAC;IAE5D,SAAS,EAAE,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;QAC9B,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;QAE1D,MAAM,QAAQ,GAAG,KAAK,CAAC;QAEvB,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;YACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACtC,IAAI,IAAI,KAAK,IAAI;gBAAE,SAAS,SAAS,CAAC;YAEtC,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;gBAChB,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;gBACpD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;gBAEzD,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;gBAExC,IAAI,KAAK,GAAG,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,MAAM,EAAE,CAAC;oBACvD,KAAK,EAAE,CAAC;oBAER,IAAI,KAAK,GAAG,EAAE,CAAC;oBACf,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;wBACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;wBACxC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;4BACpB,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;4BACtC,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,SAAS;gCAAE,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;4BAC3D,MAAM;wBACR,CAAC;wBAED,IAAI,IAAI,KAAK,MAAM,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;4BACnC,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;4BACzB,SAAS;wBACX,CAAC;wBAED,KAAK,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;oBACrC,CAAC;oBAED,SAAS,SAAS,CAAC;gBACrB,CAAC;gBAED,MAAM,UAAU,GAAG,KAAK,CAAC;gBACzB,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;gBAEtC,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;oBAClC,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;oBACxD,UAAU,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;gBACvD,CAAC;gBAED,SAAS,SAAS,CAAC;YACrB,CAAC;YAED,KAAK,EAAE,CAAC;QACV,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,SAAS,SAAS,CAAC,GAAW,EAAE,KAAa,EAAE,GAAW;IACxD,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM;QACzB,KAAK,EAAE,CAAC;IACV,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,OAAO,CAAC,MAAc,EAAE,KAAa,EAAE,GAAW;IACzD,OAAO,KAAK,GAAG,GAAG,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM;QACxC,KAAK,EAAE,CAAC;IACV,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,MAAc,EAAE,KAAa,EAAE,GAAW;IAC7D,OAAO,GAAG,GAAG,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACxC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM;QACxC,GAAG,EAAE,CAAC;IACR,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;GAEG;AACH,SAAS,OAAO,CAAC,GAAW;IAC1B,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACvC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC;IAE3E,MAAM,IAAI,SAAS,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * content-type\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\nconst TEXT_REGEXP = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]*$/;\nconst TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4\n */\nconst QUOTE_REGEXP = /[\\\\\"]/g;\n\n/**\n * RegExp to match type in RFC 9110 sec 8.3.1\n *\n * media-type = type \"/\" subtype\n * type = token\n * subtype = token\n */\nconst TYPE_REGEXP =\n /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;\n\n/**\n * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`.\n */\nconst NullObject = /* @__PURE__ */ (() => {\n const C = function () {};\n C.prototype = Object.create(null);\n return C;\n})() as unknown as { new (): any };\n\n/**\n * The content type object contains a type string and optional parameters.\n */\nexport interface ContentType {\n type: string;\n parameters: Record;\n}\n\n/**\n * Format an object into a `Content-Type` header.\n */\nexport function format(obj: Partial): string {\n const { type, parameters } = obj;\n\n if (!type || !TYPE_REGEXP.test(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n\n let result = type;\n\n if (parameters) {\n for (const param of Object.keys(parameters)) {\n if (!TOKEN_REGEXP.test(param)) {\n throw new TypeError(`Invalid parameter name: ${param}`);\n }\n\n result += `; ${param}=${qstring(parameters[param])}`;\n }\n }\n\n return result;\n}\n\n/**\n * Options for parsing a `Content-Type` header.\n */\nexport interface ParseOptions {\n parameters?: boolean;\n}\n\n/**\n * Parse a `Content-Type` header.\n */\nexport function parse(header: string, options?: ParseOptions): ContentType {\n const len = header.length;\n let index = skipOWS(header, 0, len);\n\n const valueStart = index;\n index = skipValue(header, index, len);\n const valueEnd = trailingOWS(header, valueStart, index);\n const type = header.slice(valueStart, valueEnd).toLowerCase();\n const parameters =\n options?.parameters === false\n ? new NullObject()\n : parseParameters(header, index, len);\n\n return { type, parameters };\n}\n\nconst SP = 32; // \" \"\nconst HTAB = 9; // \"\\t\"\nconst SEMI = 59; // \";\"\nconst EQ = 61; // \"=\"\nconst DQUOTE = 34; // '\"'\nconst BSLASH = 92; // \"\\\\\"\n\n/**\n * Parses the parameters of a `Content-Type` header starting at the given index.\n */\nfunction parseParameters(\n header: string,\n index: number,\n len: number,\n): Record {\n const parameters: Record = new NullObject();\n\n parameter: while (index < len) {\n index = skipOWS(header, index + 1 /* Skip over ; */, len);\n\n const keyStart = index;\n\n while (index < len) {\n const code = header.charCodeAt(index);\n if (code === SEMI) continue parameter;\n\n if (code === EQ) {\n const keyEnd = trailingOWS(header, keyStart, index);\n const key = header.slice(keyStart, keyEnd).toLowerCase();\n\n index = skipOWS(header, index + 1, len);\n\n if (index < len && header.charCodeAt(index) === DQUOTE) {\n index++;\n\n let value = \"\";\n while (index < len) {\n const code = header.charCodeAt(index++);\n if (code === DQUOTE) {\n index = skipValue(header, index, len);\n if (parameters[key] === undefined) parameters[key] = value;\n break;\n }\n\n if (code === BSLASH && index < len) {\n value += header[index++];\n continue;\n }\n\n value += String.fromCharCode(code);\n }\n\n continue parameter;\n }\n\n const valueStart = index;\n index = skipValue(header, index, len);\n\n if (parameters[key] === undefined) {\n const valueEnd = trailingOWS(header, valueStart, index);\n parameters[key] = header.slice(valueStart, valueEnd);\n }\n\n continue parameter;\n }\n\n index++;\n }\n }\n\n return parameters;\n}\n\n/**\n * Skip over characters until a semicolon.\n */\nfunction skipValue(str: string, index: number, len: number): number {\n while (index < len) {\n const char = str.charCodeAt(index);\n if (char === SEMI) break;\n index++;\n }\n return index;\n}\n\n/**\n * Skip optional whitespace (OWS) in an HTTP header value.\n *\n * OWS is defined in RFC 9110 sec 5.6.3 as SP (\" \") or HTAB (\"\\t\").\n */\nfunction skipOWS(header: string, index: number, len: number): number {\n while (index < len) {\n const char = header.charCodeAt(index);\n if (char !== SP && char !== HTAB) break;\n index++;\n }\n return index;\n}\n\n/**\n * Trim optional whitespace (OWS) from the end of a substring.\n *\n * OWS is defined in RFC 9110 sec 5.6.3 as SP (\" \") or HTAB (\"\\t\").\n */\nfunction trailingOWS(header: string, start: number, end: number): number {\n while (end > start) {\n const char = header.charCodeAt(end - 1);\n if (char !== SP && char !== HTAB) break;\n end--;\n }\n return end;\n}\n\n/**\n * Serialize a parameter value.\n */\nfunction qstring(str: string): string {\n if (TOKEN_REGEXP.test(str)) return str;\n if (TEXT_REGEXP.test(str)) return `\"${str.replace(QUOTE_REGEXP, \"\\\\$&\")}\"`;\n\n throw new TypeError(`Invalid parameter value: ${str}`);\n}\n"]} \ No newline at end of file diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/package.json b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/package.json new file mode 100644 index 0000000000000000000000000000000000000000..482cbc80aba81d30557427cd85ac005e3f8217c9 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/node_modules/content-type/package.json @@ -0,0 +1,52 @@ +{ + "name": "content-type", + "version": "2.0.0", + "description": "Create and parse HTTP Content-Type header", + "keywords": [ + "content-type", + "http", + "req", + "res", + "rfc7231", + "rfc9110" + ], + "repository": "jshttp/content-type", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "license": "MIT", + "author": "Douglas Christopher Wilson ", + "type": "commonjs", + "exports": "./dist/index.js", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "bench": "vitest bench", + "build": "ts-scripts build", + "format": "ts-scripts format", + "prepare": "ts-scripts install && npm run build", + "specs": "ts-scripts specs", + "test": "ts-scripts test" + }, + "devDependencies": { + "@borderless/ts-scripts": "^0.15.0", + "@vitest/coverage-v8": "^3.0.5", + "typescript": "^5.7.3", + "vitest": "^3.2.4" + }, + "engines": { + "node": ">=18" + }, + "ts-scripts": { + "dist": [ + "dist" + ], + "project": [ + "tsconfig.build.json" + ] + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/package.json b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/package.json new file mode 100644 index 0000000000000000000000000000000000000000..07c623fc73b08ac347fb979ebd0c33e51ad401ad --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/node_modules/type-is/package.json @@ -0,0 +1,51 @@ +{ + "name": "type-is", + "description": "Infer the content-type of a request.", + "version": "2.1.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/type-is", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "content-type": "^2.0.0", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.31.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 18" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + }, + "keywords": [ + "content", + "type", + "checking" + ] +} diff --git a/node_modules/@nestjs/platform-express/node_modules/express/package.json b/node_modules/@nestjs/platform-express/node_modules/express/package.json new file mode 100644 index 0000000000000000000000000000000000000000..8f358830d97f07e22bd7a38982080e9fbc4fc6a7 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/express/package.json @@ -0,0 +1,99 @@ +{ + "name": "express", + "description": "Fast, unopinionated, minimalist web framework", + "version": "5.2.1", + "author": "TJ Holowaychuk ", + "contributors": [ + "Aaron Heckmann ", + "Ciaran Jessup ", + "Douglas Christopher Wilson ", + "Guillermo Rauch ", + "Jonathan Ong ", + "Roman Shtylman ", + "Young Jae Sim " + ], + "license": "MIT", + "repository": "expressjs/express", + "homepage": "https://expressjs.com/", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "keywords": [ + "express", + "framework", + "sinatra", + "web", + "http", + "rest", + "restful", + "router", + "app", + "api" + ], + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "devDependencies": { + "after": "0.8.2", + "connect-redis": "^8.0.1", + "cookie-parser": "1.4.7", + "cookie-session": "2.1.1", + "ejs": "^3.1.10", + "eslint": "8.47.0", + "express-session": "^1.18.1", + "hbs": "4.2.0", + "marked": "^15.0.3", + "method-override": "3.0.0", + "mocha": "^10.7.3", + "morgan": "1.10.1", + "nyc": "^17.1.0", + "pbkdf2-password": "1.2.1", + "supertest": "^6.3.0", + "vhost": "~3.0.2" + }, + "engines": { + "node": ">= 18" + }, + "files": [ + "LICENSE", + "Readme.md", + "index.js", + "lib/" + ], + "scripts": { + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "test": "mocha --require test/support/env --reporter spec --check-leaks test/ test/acceptance/", + "test-ci": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=html --reporter=text npm test", + "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/finalhandler/HISTORY.md b/node_modules/@nestjs/platform-express/node_modules/finalhandler/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..8b011be00a99399ac5c79dac3251efa5964907cf --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/finalhandler/HISTORY.md @@ -0,0 +1,239 @@ +v2.1.1. / 2025-12-01 +================== + +* update engines field in the package.json to reflect the current compatibility (Node <18). See: 2.0.0 +* Minor changes (package metadata) + +v2.1.0 / 2025-03-05 +================== + + * deps: + * use caret notation for dependency versions + * encodeurl@^2.0.0 + * debug@^4.4.0 + * remove `ServerResponse.headersSent` support check + * remove setImmediate support check + * update test dependencies + * remove unnecessary devDependency `safe-buffer` + * remove `unpipe` package and use native `unpipe()` method + * remove unnecessary devDependency `readable-stream` + * refactor: use object spread to copy error headers + * refactor: use replaceAll instead of replace with a regex + * refactor: replace setHeaders function with optimized inline header setting + +v2.0.0 / 2024-09-02 +================== + + * drop support for node <18 + * ignore status message for HTTP/2 (#53) + +v1.3.1 / 2024-09-11 +================== + + * deps: encodeurl@~2.0.0 + +v1.3.0 / 2024-09-03 +================== + + * ignore status message for HTTP/2 (#53) + +v1.2.1 / 2024-09-02 +================== + + * Gracefully handle when handling an error and socket is null + +1.2.0 / 2022-03-22 +================== + + * Remove set content headers that break response + * deps: on-finished@2.4.1 + * deps: statuses@2.0.1 + - Rename `425 Unordered Collection` to standard `425 Too Early` + +1.1.2 / 2019-05-09 +================== + + * Set stricter `Content-Security-Policy` header + * deps: parseurl@~1.3.3 + * deps: statuses@~1.5.0 + +1.1.1 / 2018-03-06 +================== + + * Fix 404 output for bad / missing pathnames + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: statuses@~1.4.0 + +1.1.0 / 2017-09-24 +================== + + * Use `res.headersSent` when available + +1.0.6 / 2017-09-22 +================== + + * deps: debug@2.6.9 + +1.0.5 / 2017-09-15 +================== + + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + +1.0.4 / 2017-08-03 +================== + + * deps: debug@2.6.8 + +1.0.3 / 2017-05-16 +================== + + * deps: debug@2.6.7 + - deps: ms@2.0.0 + +1.0.2 / 2017-04-22 +================== + + * deps: debug@2.6.4 + - deps: ms@0.7.3 + +1.0.1 / 2017-03-21 +================== + + * Fix missing `` in HTML document + * deps: debug@2.6.3 + - Fix: `DEBUG_MAX_ARRAY_LENGTH` + +1.0.0 / 2017-02-15 +================== + + * Fix exception when `err` cannot be converted to a string + * Fully URL-encode the pathname in the 404 message + * Only include the pathname in the 404 message + * Send complete HTML document + * Set `Content-Security-Policy: default-src 'self'` header + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + +0.5.1 / 2016-11-12 +================== + + * Fix exception when `err.headers` is not an object + * deps: statuses@~1.3.1 + * perf: hoist regular expressions + * perf: remove duplicate validation path + +0.5.0 / 2016-06-15 +================== + + * Change invalid or non-numeric status code to 500 + * Overwrite status message to match set status code + * Prefer `err.statusCode` if `err.status` is invalid + * Set response headers from `err.headers` object + * Use `statuses` instead of `http` module for status messages + - Includes all defined status messages + +0.4.1 / 2015-12-02 +================== + + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + +0.4.0 / 2015-06-14 +================== + + * Fix a false-positive when unpiping in Node.js 0.8 + * Support `statusCode` property on `Error` objects + * Use `unpipe` module for unpiping requests + * deps: escape-html@1.0.2 + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * perf: enable strict mode + * perf: remove argument reassignment + +0.3.6 / 2015-05-11 +================== + + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + +0.3.5 / 2015-04-22 +================== + + * deps: on-finished@~2.2.1 + - Fix `isFinished(req)` when data buffered + +0.3.4 / 2015-03-15 +================== + + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + +0.3.3 / 2015-01-01 +================== + + * deps: debug@~2.1.1 + * deps: on-finished@~2.2.0 + +0.3.2 / 2014-10-22 +================== + + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + +0.3.1 / 2014-10-16 +================== + + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + +0.3.0 / 2014-09-17 +================== + + * Terminate in progress response only on error + * Use `on-finished` to determine request status + +0.2.0 / 2014-09-03 +================== + + * Set `X-Content-Type-Options: nosniff` header + * deps: debug@~2.0.0 + +0.1.0 / 2014-07-16 +================== + + * Respond after request fully read + - prevents hung responses and socket hang ups + * deps: debug@1.0.4 + +0.0.3 / 2014-07-11 +================== + + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + +0.0.2 / 2014-06-19 +================== + + * Handle invalid status codes + +0.0.1 / 2014-06-05 +================== + + * deps: debug@1.0.2 + +0.0.0 / 2014-06-05 +================== + + * Extracted from connect/express diff --git a/node_modules/@nestjs/platform-express/node_modules/finalhandler/LICENSE b/node_modules/@nestjs/platform-express/node_modules/finalhandler/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..60221067c4d591554407b4700033aab9669a9b0e --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/finalhandler/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/finalhandler/README.md b/node_modules/@nestjs/platform-express/node_modules/finalhandler/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e40f729a10085463adc71b4772c2d988bae6f25f --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/finalhandler/README.md @@ -0,0 +1,150 @@ +# finalhandler + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + +Node.js function to invoke as the final step to respond to HTTP request. + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install finalhandler +``` + +## API + +```js +const finalhandler = require('finalhandler') +``` + +### finalhandler(req, res, [options]) + +Returns function to be invoked as the final step for the given `req` and `res`. +This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will +write out a 404 response to the `res`. If it is truthy, an error response will +be written out to the `res` or `res` will be terminated if a response has already +started. + +When an error is written, the following information is added to the response: + + * The `res.statusCode` is set from `err.status` (or `err.statusCode`). If + this value is outside the 4xx or 5xx range, it will be set to 500. + * The `res.statusMessage` is set according to the status code. + * The body will be the HTML of the status code message if `env` is + `'production'`, otherwise will be `err.stack`. + * Any headers specified in an `err.headers` object. + +The final handler will also unpipe anything from `req` when it is invoked. + +#### options.env + +By default, the environment is determined by `NODE_ENV` variable, but it can be +overridden by this option. + +#### options.onerror + +Provide a function to be called with the `err` when it exists. Can be used for +writing errors to a central location without excessive function generation. Called +as `onerror(err, req, res)`. + +## Examples + +### always 404 + +```js +const finalhandler = require('finalhandler') +const http = require('http') + +const server = http.createServer((req, res) => { + const done = finalhandler(req, res) + done() +}) + +server.listen(3000) +``` + +### perform simple action + +```js +const finalhandler = require('finalhandler') +const fs = require('fs') +const http = require('http') + +const server = http.createServer((req, res) => { + const done = finalhandler(req, res) + + fs.readFile('index.html', (err, buf) => { + if (err) return done(err) + res.setHeader('Content-Type', 'text/html') + res.end(buf) + }) +}) + +server.listen(3000) +``` + +### use with middleware-style functions + +```js +const finalhandler = require('finalhandler') +const http = require('http') +const serveStatic = require('serve-static') + +const serve = serveStatic('public') + +const server = http.createServer((req, res) => { + const done = finalhandler(req, res) + serve(req, res, done) +}) + +server.listen(3000) +``` + +### keep log of all errors + +```js +const finalhandler = require('finalhandler') +const fs = require('fs') +const http = require('http') + +const server = http.createServer((req, res) => { + const done = finalhandler(req, res, { onerror: logerror }) + + fs.readFile('index.html', (err, buf) => { + if (err) return done(err) + res.setHeader('Content-Type', 'text/html') + res.end(buf) + }) +}) + +server.listen(3000) + +function logerror (err) { + console.error(err.stack || err.toString()) +} +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/finalhandler.svg +[npm-url]: https://npmjs.org/package/finalhandler +[node-image]: https://img.shields.io/node/v/finalhandler.svg +[node-url]: https://nodejs.org/en/download +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master +[downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg +[downloads-url]: https://npmjs.org/package/finalhandler +[github-actions-ci-image]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml/badge.svg +[github-actions-ci-url]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/pillarjs/finalhandler/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/pillarjs/finalhandler \ No newline at end of file diff --git a/node_modules/@nestjs/platform-express/node_modules/finalhandler/index.js b/node_modules/@nestjs/platform-express/node_modules/finalhandler/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bf15e484c8f40a242f5fbf24676bda8da0e9e013 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/finalhandler/index.js @@ -0,0 +1,293 @@ +/*! + * finalhandler + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('finalhandler') +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var onFinished = require('on-finished') +var parseUrl = require('parseurl') +var statuses = require('statuses') + +/** + * Module variables. + * @private + */ + +var isFinished = onFinished.isFinished + +/** + * Create a minimal HTML document. + * + * @param {string} message + * @private + */ + +function createHtmlDocument (message) { + var body = escapeHtml(message) + .replaceAll('\n', '
') + .replaceAll(' ', '  ') + + return '\n' + + '\n' + + '\n' + + '\n' + + 'Error\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Module exports. + * @public + */ + +module.exports = finalhandler + +/** + * Create a function to handle the final response. + * + * @param {Request} req + * @param {Response} res + * @param {Object} [options] + * @return {Function} + * @public + */ + +function finalhandler (req, res, options) { + var opts = options || {} + + // get environment + var env = opts.env || process.env.NODE_ENV || 'development' + + // get error callback + var onerror = opts.onerror + + return function (err) { + var headers + var msg + var status + + // ignore 404 on in-flight response + if (!err && res.headersSent) { + debug('cannot 404 after headers sent') + return + } + + // unhandled error + if (err) { + // respect status code from error + status = getErrorStatusCode(err) + + if (status === undefined) { + // fallback to status code on response + status = getResponseStatusCode(res) + } else { + // respect headers from error + headers = getErrorHeaders(err) + } + + // get error message + msg = getErrorMessage(err, status, env) + } else { + // not found + status = 404 + msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req)) + } + + debug('default %s', status) + + // schedule onerror callback + if (err && onerror) { + setImmediate(onerror, err, req, res) + } + + // cannot actually respond + if (res.headersSent) { + debug('cannot %d after headers sent', status) + if (req.socket) { + req.socket.destroy() + } + return + } + + // send response + send(req, res, status, headers, msg) + } +} + +/** + * Get headers from Error object. + * + * @param {Error} err + * @return {object} + * @private + */ + +function getErrorHeaders (err) { + if (!err.headers || typeof err.headers !== 'object') { + return undefined + } + + return { ...err.headers } +} + +/** + * Get message from Error object, fallback to status message. + * + * @param {Error} err + * @param {number} status + * @param {string} env + * @return {string} + * @private + */ + +function getErrorMessage (err, status, env) { + var msg + + if (env !== 'production') { + // use err.stack, which typically includes err.message + msg = err.stack + + // fallback to err.toString() when possible + if (!msg && typeof err.toString === 'function') { + msg = err.toString() + } + } + + return msg || statuses.message[status] +} + +/** + * Get status code from Error object. + * + * @param {Error} err + * @return {number} + * @private + */ + +function getErrorStatusCode (err) { + // check err.status + if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) { + return err.status + } + + // check err.statusCode + if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) { + return err.statusCode + } + + return undefined +} + +/** + * Get resource name for the request. + * + * This is typically just the original pathname of the request + * but will fallback to "resource" is that cannot be determined. + * + * @param {IncomingMessage} req + * @return {string} + * @private + */ + +function getResourceName (req) { + try { + return parseUrl.original(req).pathname + } catch (e) { + return 'resource' + } +} + +/** + * Get status code from response. + * + * @param {OutgoingMessage} res + * @return {number} + * @private + */ + +function getResponseStatusCode (res) { + var status = res.statusCode + + // default status code to 500 if outside valid range + if (typeof status !== 'number' || status < 400 || status > 599) { + status = 500 + } + + return status +} + +/** + * Send response. + * + * @param {IncomingMessage} req + * @param {OutgoingMessage} res + * @param {number} status + * @param {object} headers + * @param {string} message + * @private + */ + +function send (req, res, status, headers, message) { + function write () { + // response body + var body = createHtmlDocument(message) + + // response status + res.statusCode = status + + if (req.httpVersionMajor < 2) { + res.statusMessage = statuses.message[status] + } + + // remove any content headers + res.removeHeader('Content-Encoding') + res.removeHeader('Content-Language') + res.removeHeader('Content-Range') + + // response headers + for (const [key, value] of Object.entries(headers ?? {})) { + res.setHeader(key, value) + } + + // security headers + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + + // standard headers + res.setHeader('Content-Type', 'text/html; charset=utf-8') + res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8')) + + if (req.method === 'HEAD') { + res.end() + return + } + + res.end(body, 'utf8') + } + + if (isFinished(req)) { + write() + return + } + + // unpipe everything from the request + req.unpipe() + + // flush the request + onFinished(req, write) + req.resume() +} diff --git a/node_modules/@nestjs/platform-express/node_modules/finalhandler/package.json b/node_modules/@nestjs/platform-express/node_modules/finalhandler/package.json new file mode 100644 index 0000000000000000000000000000000000000000..869ddc2b39e2a68f60559e77f7204403c39e7d90 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/finalhandler/package.json @@ -0,0 +1,47 @@ +{ + "name": "finalhandler", + "description": "Node.js final http responder", + "version": "2.1.1", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "pillarjs/finalhandler", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "devDependencies": { + "eslint": "^7.32.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-markdown": "^2.2.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.2.0", + "eslint-plugin-standard": "^4.1.0", + "mocha": "^11.0.1", + "nyc": "^17.1.0", + "supertest": "^7.0.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 18.0.0" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-inspect": "mocha --reporter spec --inspect --inspect-brk test/" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/fresh/HISTORY.md b/node_modules/@nestjs/platform-express/node_modules/fresh/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..fd3888acb4dd7a0cdb0dae0761c593c95802d6be --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/fresh/HISTORY.md @@ -0,0 +1,80 @@ +2.0.0 - 2024-09-04 +========== + * Drop support for Node.js <18 + +1.0.0 - 2024-09-04 +========== + + * Drop support for Node.js below 0.8 + * Fix: Ignore `If-Modified-Since` in the presence of `If-None-Match`, according to [spec](https://www.rfc-editor.org/rfc/rfc9110.html#section-13.1.3-5). Fixes [#35](https://github.com/jshttp/fresh/issues/35) + +0.5.2 / 2017-09-13 +================== + + * Fix regression matching multiple ETags in `If-None-Match` + * perf: improve `If-None-Match` token parsing + +0.5.1 / 2017-09-11 +================== + + * Fix handling of modified headers with invalid dates + * perf: improve ETag match loop + +0.5.0 / 2017-02-21 +================== + + * Fix incorrect result when `If-None-Match` has both `*` and ETags + * Fix weak `ETag` matching to match spec + * perf: delay reading header values until needed + * perf: skip checking modified time if ETag check failed + * perf: skip parsing `If-None-Match` when no `ETag` header + * perf: use `Date.parse` instead of `new Date` + +0.4.0 / 2017-02-05 +================== + + * Fix false detection of `no-cache` request directive + * perf: enable strict mode + * perf: hoist regular expressions + * perf: remove duplicate conditional + * perf: remove unnecessary boolean coercions + +0.3.0 / 2015-05-12 +================== + + * Add weak `ETag` matching support + +0.2.4 / 2014-09-07 +================== + + * Support Node.js 0.6 + +0.2.3 / 2014-09-07 +================== + + * Move repository to jshttp + +0.2.2 / 2014-02-19 +================== + + * Revert "Fix for blank page on Safari reload" + +0.2.1 / 2014-01-29 +================== + + * Fix for blank page on Safari reload + +0.2.0 / 2013-08-11 +================== + + * Return stale for `Cache-Control: no-cache` + +0.1.0 / 2012-06-15 +================== + + * Add `If-None-Match: *` support + +0.0.1 / 2012-06-10 +================== + + * Initial release diff --git a/node_modules/@nestjs/platform-express/node_modules/fresh/LICENSE b/node_modules/@nestjs/platform-express/node_modules/fresh/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1434ade75d1fc4faf25a6ac5daed813e12eaed28 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/fresh/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2016-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/fresh/README.md b/node_modules/@nestjs/platform-express/node_modules/fresh/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fd79c5b525a9d373331b39a48eaced9003877f1a --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/fresh/README.md @@ -0,0 +1,117 @@ +# fresh + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +HTTP response freshness testing + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +``` +$ npm install fresh +``` + +## API + +```js +var fresh = require('fresh') +``` + +### fresh(reqHeaders, resHeaders) + +Check freshness of the response using request and response headers. + +When the response is still "fresh" in the client's cache `true` is +returned, otherwise `false` is returned to indicate that the client +cache is now stale and the full response should be sent. + +When a client sends the `Cache-Control: no-cache` request header to +indicate an end-to-end reload request, this module will return `false` +to make handling these requests transparent. + +## Known Issues + +This module is designed to only follow the HTTP specifications, not +to work-around all kinda of client bugs (especially since this module +typically does not receive enough information to understand what the +client actually is). + +There is a known issue that in certain versions of Safari, Safari +will incorrectly make a request that allows this module to validate +freshness of the resource even when Safari does not have a +representation of the resource in the cache. The module +[jumanji](https://www.npmjs.com/package/jumanji) can be used in +an Express application to work-around this issue and also provides +links to further reading on this Safari bug. + +## Example + +### API usage + + + +```js +var reqHeaders = { 'if-none-match': '"foo"' } +var resHeaders = { etag: '"bar"' } +fresh(reqHeaders, resHeaders) +// => false + +var reqHeaders = { 'if-none-match': '"foo"' } +var resHeaders = { etag: '"foo"' } +fresh(reqHeaders, resHeaders) +// => true +``` + +### Using with Node.js http server + +```js +var fresh = require('fresh') +var http = require('http') + +var server = http.createServer(function (req, res) { + // perform server logic + // ... including adding ETag / Last-Modified response headers + + if (isFresh(req, res)) { + // client has a fresh copy of resource + res.statusCode = 304 + res.end() + return + } + + // send the resource + res.statusCode = 200 + res.end('hello, world!') +}) + +function isFresh (req, res) { + return fresh(req.headers, { + etag: res.getHeader('ETag'), + 'last-modified': res.getHeader('Last-Modified') + }) +} + +server.listen(3000) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://img.shields.io/github/workflow/status/jshttp/fresh/ci/master?label=ci +[ci-url]: https://github.com/jshttp/fresh/actions/workflows/ci.yml +[npm-image]: https://img.shields.io/npm/v/fresh.svg +[npm-url]: https://npmjs.org/package/fresh +[node-version-image]: https://img.shields.io/node/v/fresh.svg +[node-version-url]: https://nodejs.org/en/ +[coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master +[downloads-image]: https://img.shields.io/npm/dm/fresh.svg +[downloads-url]: https://npmjs.org/package/fresh diff --git a/node_modules/@nestjs/platform-express/node_modules/fresh/index.js b/node_modules/@nestjs/platform-express/node_modules/fresh/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fc3dea7b4ae085168714ffb7b7fbe01646e858a5 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/fresh/index.js @@ -0,0 +1,136 @@ +/*! + * fresh + * Copyright(c) 2012 TJ Holowaychuk + * Copyright(c) 2016-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * RegExp to check for no-cache token in Cache-Control. + * @private + */ + +var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/ + +/** + * Module exports. + * @public + */ + +module.exports = fresh + +/** + * Check freshness of the response using request and response headers. + * + * @param {Object} reqHeaders + * @param {Object} resHeaders + * @return {Boolean} + * @public + */ + +function fresh (reqHeaders, resHeaders) { + // fields + var modifiedSince = reqHeaders['if-modified-since'] + var noneMatch = reqHeaders['if-none-match'] + + // unconditional request + if (!modifiedSince && !noneMatch) { + return false + } + + // Always return stale when Cache-Control: no-cache + // to support end-to-end reload requests + // https://tools.ietf.org/html/rfc2616#section-14.9.4 + var cacheControl = reqHeaders['cache-control'] + if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) { + return false + } + + // if-none-match takes precedent over if-modified-since + if (noneMatch) { + if (noneMatch === '*') { + return true + } + var etag = resHeaders.etag + + if (!etag) { + return false + } + + var matches = parseTokenList(noneMatch) + for (var i = 0; i < matches.length; i++) { + var match = matches[i] + if (match === etag || match === 'W/' + etag || 'W/' + match === etag) { + return true + } + } + + return false + } + + // if-modified-since + if (modifiedSince) { + var lastModified = resHeaders['last-modified'] + var modifiedStale = !lastModified || !(parseHttpDate(lastModified) <= parseHttpDate(modifiedSince)) + + if (modifiedStale) { + return false + } + } + + return true +} + +/** + * Parse an HTTP Date into a number. + * + * @param {string} date + * @private + */ + +function parseHttpDate (date) { + var timestamp = date && Date.parse(date) + + // istanbul ignore next: guard against date.js Date.parse patching + return typeof timestamp === 'number' + ? timestamp + : NaN +} + +/** + * Parse a HTTP token list. + * + * @param {string} str + * @private + */ + +function parseTokenList (str) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = str.length; i < len; i++) { + switch (str.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + list.push(str.substring(start, end)) + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + list.push(str.substring(start, end)) + + return list +} diff --git a/node_modules/@nestjs/platform-express/node_modules/fresh/package.json b/node_modules/@nestjs/platform-express/node_modules/fresh/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5d7e2157f31d97514c00437582b77d3686b12ebd --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/fresh/package.json @@ -0,0 +1,46 @@ +{ + "name": "fresh", + "description": "HTTP response freshness testing", + "version": "2.0.0", + "author": "TJ Holowaychuk (http://tjholowaychuk.com)", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "keywords": [ + "fresh", + "http", + "conditional", + "cache" + ], + "repository": "jshttp/fresh", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "8.12.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.0.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.0", + "nyc": "15.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/LICENSE b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d518d8376af9faa47af875d83c8cdd51a11f9099 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011 Alexander Shtuchkin + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/README.md b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/README.md new file mode 100644 index 0000000000000000000000000000000000000000..78a7a5f1cf2a03ebad4c4bacdfe9d2368470ca81 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/README.md @@ -0,0 +1,138 @@ +## iconv-lite: Pure JS character encoding conversion + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-downloads-url] +[![License][license-image]][license-url] +[![NPM Install Size][npm-install-size-image]][npm-install-size-url] + +* No need for native code compilation. Quick to install, works on Windows, Web, and in sandboxed environments. +* Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), + [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. +* Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). +* Intuitive encode/decode API, including Streaming support. +* In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included). +* Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. +* React Native is supported (need to install `stream` module to enable Streaming API). + +## Usage + +### Basic API + +```javascript +var iconv = require('iconv-lite'); + +// Convert from an encoded buffer to a js string. +str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); + +// Convert from a js string to an encoded buffer. +buf = iconv.encode("Sample input string", 'win1251'); + +// Check if encoding is supported +iconv.encodingExists("us-ascii") +``` + +### Streaming API + +```javascript +// Decode stream (from binary data stream to js strings) +http.createServer(function(req, res) { + var converterStream = iconv.decodeStream('win1251'); + req.pipe(converterStream); + + converterStream.on('data', function(str) { + console.log(str); // Do something with decoded strings, chunk-by-chunk. + }); +}); + +// Convert encoding streaming example +fs.createReadStream('file-in-win1251.txt') + .pipe(iconv.decodeStream('win1251')) + .pipe(iconv.encodeStream('ucs2')) + .pipe(fs.createWriteStream('file-in-ucs2.txt')); + +// Sugar: all encode/decode streams have .collect(cb) method to accumulate data. +http.createServer(function(req, res) { + req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) { + assert(typeof body == 'string'); + console.log(body); // full request body string + }); +}); +``` + +## Supported encodings + + * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. + * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be. + * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, + IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. + Aliases like 'latin1', 'us-ascii' also supported. + * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP. + +See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings). + +Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors! + +Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors! + +## Encoding/decoding speed + +Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). +Note: your results may vary, so please always check on your hardware. + + operation iconv@2.1.4 iconv-lite@0.4.7 + ---------------------------------------------------------- + encode('win1251') ~96 Mb/s ~320 Mb/s + decode('win1251') ~95 Mb/s ~246 Mb/s + +## BOM handling + + * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options + (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`). + A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found. + * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module. + * Encoding: No BOM added, unless overridden by `addBOM: true` option. + +## UTF-16 Encodings + +This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be +smart about endianness in the following ways: + * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be + overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. + +## UTF-32 Encodings + +This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. + * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.) + +## Other notes + +When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). +Untranslatable characters are set to � or ?. No transliteration is currently supported. +Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see [#65](https://github.com/ashtuchkin/iconv-lite/issues/65), [#77](https://github.com/ashtuchkin/iconv-lite/issues/77)). + +## Testing + +```sh +git clone git@github.com:ashtuchkin/iconv-lite.git +cd iconv-lite +npm install +npm test + +# To view performance: +npm run test:performance + +# To view test coverage: +npm run test:cov +open coverage/index.html +``` + +[npm-downloads-image]: https://badgen.net/npm/dm/iconv-lite +[npm-downloads-url]: https://npmcharts.com/compare/iconv-lite?minimal=true +[npm-url]: https://npmjs.org/package/iconv-lite +[npm-version-image]: https://badgen.net/npm/v/iconv-lite +[npm-install-size-image]: https://badgen.net/packagephobia/install/iconv-lite +[npm-install-size-url]: https://packagephobia.com/result?p=iconv-lite +[license-image]: https://img.shields.io/npm/l/iconv-lite.svg +[license-url]: https://github.com/ashtuchkin/iconv-lite/blob/HEAD/LICENSE \ No newline at end of file diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/dbcs-codec.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/dbcs-codec.js new file mode 100644 index 0000000000000000000000000000000000000000..bfec7f2ef9071ed98b30ebf8dfd4ac4b103e5271 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -0,0 +1,532 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. +// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. +// To save memory and loading time, we read table files only when requested. + +exports._dbcs = DBCSCodec + +var UNASSIGNED = -1 +var GB18030_CODE = -2 +var SEQ_START = -10 +var NODE_START = -1000 +var UNASSIGNED_NODE = new Array(0x100) +var DEF_CHAR = -1 + +for (var i = 0; i < 0x100; i++) { UNASSIGNED_NODE[i] = UNASSIGNED } + +// Class DBCSCodec reads and initializes mapping tables. +function DBCSCodec (codecOptions, iconv) { + this.encodingName = codecOptions.encodingName + if (!codecOptions) { throw new Error("DBCS codec is called without the data.") } + if (!codecOptions.table) { throw new Error("Encoding '" + this.encodingName + "' has no data.") } + + // Load tables. + var mappingTable = codecOptions.table() + + // Decode tables: MBCS -> Unicode. + + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = [] + this.decodeTables[0] = UNASSIGNED_NODE.slice(0) // Create root node. + + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = [] + + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) { this._addDecodeChunk(mappingTable[i]) } + + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === "function") { + this.gb18030 = codecOptions.gb18030() // Load GB18030 ranges. + + // Add GB18030 common decode nodes. + var commonThirdByteNodeIdx = this.decodeTables.length + this.decodeTables.push(UNASSIGNED_NODE.slice(0)) + + var commonFourthByteNodeIdx = this.decodeTables.length + this.decodeTables.push(UNASSIGNED_NODE.slice(0)) + + // Fill out the tree + var firstByteNode = this.decodeTables[0] + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]] + for (var j = 0x30; j <= 0x39; j++) { + if (secondByteNode[j] === UNASSIGNED) { + secondByteNode[j] = NODE_START - commonThirdByteNodeIdx + } else if (secondByteNode[j] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 2") + } + + var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]] + for (var k = 0x81; k <= 0xFE; k++) { + if (thirdByteNode[k] === UNASSIGNED) { + thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx + } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { + continue + } else if (thirdByteNode[k] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 3") + } + + var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]] + for (var l = 0x30; l <= 0x39; l++) { + if (fourthByteNode[l] === UNASSIGNED) { fourthByteNode[l] = GB18030_CODE } + } + } + } + } + } + + this.defaultCharUnicode = iconv.defaultCharUnicode + + // Encode tables: Unicode -> DBCS. + + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = [] + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = [] + + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {} + if (codecOptions.encodeSkipVals) { + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i] + if (typeof val === "number") { skipEncodeChars[val] = true } else { + for (var j = val.from; j <= val.to; j++) { skipEncodeChars[j] = true } + } + } + } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars) + + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) { + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) { this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]) } + } + } + + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)] + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]["?"] + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0) +} + +DBCSCodec.prototype.encoder = DBCSEncoder +DBCSCodec.prototype.decoder = DBCSDecoder + +// Decoder helpers +DBCSCodec.prototype._getDecodeTrieNode = function (addr) { + var bytes = [] + for (; addr > 0; addr >>>= 8) { bytes.push(addr & 0xFF) } + if (bytes.length == 0) { bytes.push(0) } + + var node = this.decodeTables[0] + for (var i = bytes.length - 1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]] + + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)) + } else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val] + } else { throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)) } + } + return node +} + +DBCSCodec.prototype._addDecodeChunk = function (chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16) + + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr) + curAddr = curAddr & 0xFF + + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k] + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++) + if (code >= 0xD800 && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++) + if (codeTrail >= 0xDC00 && codeTrail < 0xE000) { writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00) } else { throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]) } + } else if (code > 0x0FF0 && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2 + var seq = [] + for (var m = 0; m < len; m++) { seq.push(part.charCodeAt(l++)) } // Simple variation: don't support surrogates or subsequences in seq. + + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length + this.decodeTableSeq.push(seq) + } else { writeTable[curAddr++] = code } // Basic char + } + } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1 + for (var l = 0; l < part; l++) { writeTable[curAddr++] = charCode++ } + } else { throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]) } + } + if (curAddr > 0xFF) { throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr) } +} + +// Encoder helpers +DBCSCodec.prototype._getEncodeBucket = function (uCode) { + var high = uCode >> 8 // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) { + this.encodeTable[high] = UNASSIGNED_NODE.slice(0) + } // Create bucket on demand. + return this.encodeTable[high] +} + +DBCSCodec.prototype._setEncodeChar = function (uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode) + var low = uCode & 0xFF + if (bucket[low] <= SEQ_START) { this.encodeTableSeq[SEQ_START - bucket[low]][DEF_CHAR] = dbcsCode } // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) { bucket[low] = dbcsCode } +} + +DBCSCodec.prototype._setEncodeSequence = function (seq, dbcsCode) { + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0] + var bucket = this._getEncodeBucket(uCode) + var low = uCode & 0xFF + + var node + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START - bucket[low]] + } else { + // There was no sequence object - allocate a new one. + node = {} + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low] // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length + this.encodeTableSeq.push(node) + } + + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length - 1; j++) { + var oldVal = node[uCode] + if (typeof oldVal === "object") { node = oldVal } else { + node = node[uCode] = {} + if (oldVal !== undefined) { node[DEF_CHAR] = oldVal } + } + } + + // Set the leaf to given dbcsCode. + uCode = seq[seq.length - 1] + node[uCode] = dbcsCode +} + +DBCSCodec.prototype._fillEncodeTable = function (nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx] + var hasValues = false + var subNodeEmpty = {} + for (var i = 0; i < 0x100; i++) { + var uCode = node[i] + var mbCode = prefix + i + if (skipEncodeChars[mbCode]) { continue } + + if (uCode >= 0) { + this._setEncodeChar(uCode, mbCode) + hasValues = true + } else if (uCode <= NODE_START) { + var subNodeIdx = NODE_START - uCode + if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). + var newPrefix = (mbCode << 8) >>> 0 // NOTE: '>>> 0' keeps 32-bit num positive. + if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) { hasValues = true } else { subNodeEmpty[subNodeIdx] = true } + } + } else if (uCode <= SEQ_START) { + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode) + hasValues = true + } + } + return hasValues +} + +// == Encoder ================================================================== + +function DBCSEncoder (options, codec) { + // Encoder state + this.leadSurrogate = -1 + this.seqObj = undefined + + // Static data + this.encodeTable = codec.encodeTable + this.encodeTableSeq = codec.encodeTableSeq + this.defaultCharSingleByte = codec.defCharSB + this.gb18030 = codec.gb18030 +} + +DBCSEncoder.prototype.write = function (str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)) + var leadSurrogate = this.leadSurrogate + var seqObj = this.seqObj + var nextChar = -1 + var i = 0; var j = 0 + + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break + var uCode = str.charCodeAt(i++) + } else { + var uCode = nextChar + nextChar = -1 + } + + // 1. Handle surrogates. + if (uCode >= 0xD800 && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode + continue + } else { + leadSurrogate = uCode + // Double lead surrogate found. + uCode = UNASSIGNED + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00) + leadSurrogate = -1 + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED + } + } + } else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED // Write an error, then current char. + leadSurrogate = -1 + } + + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode] + if (typeof resCode === "object") { // Sequence continues. + seqObj = resCode + continue + } else if (typeof resCode === "number") { // Sequence finished. Write it. + dbcsCode = resCode + } else if (resCode == undefined) { // Current character is not part of the sequence. + // Try default character for this sequence + resCode = seqObj[DEF_CHAR] + if (resCode !== undefined) { + dbcsCode = resCode // Found. Write it. + nextChar = uCode // Current character will be written too in the next iteration. + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined + } else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8] + if (subtable !== undefined) { dbcsCode = subtable[uCode & 0xFF] } + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START - dbcsCode] + continue + } + + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode) + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]) + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600 + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260 + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10 + newBuf[j++] = 0x30 + dbcsCode + continue + } + } + } + + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) { dbcsCode = this.defaultCharSingleByte } + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode + } else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8 // high byte + newBuf[j++] = dbcsCode & 0xFF // low byte + } else if (dbcsCode < 0x1000000) { + newBuf[j++] = dbcsCode >> 16 + newBuf[j++] = (dbcsCode >> 8) & 0xFF + newBuf[j++] = dbcsCode & 0xFF + } else { + newBuf[j++] = dbcsCode >>> 24 + newBuf[j++] = (dbcsCode >>> 16) & 0xFF + newBuf[j++] = (dbcsCode >>> 8) & 0xFF + newBuf[j++] = dbcsCode & 0xFF + } + } + + this.seqObj = seqObj + this.leadSurrogate = leadSurrogate + return newBuf.slice(0, j) +} + +DBCSEncoder.prototype.end = function () { + if (this.leadSurrogate === -1 && this.seqObj === undefined) { return } // All clean. Most often case. + + var newBuf = Buffer.alloc(10); var j = 0 + + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR] + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode + } else { + newBuf[j++] = dbcsCode >> 8 // high byte + newBuf[j++] = dbcsCode & 0xFF // low byte + } + } else { + // See todo above. + } + this.seqObj = undefined + } + + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte + this.leadSurrogate = -1 + } + + return newBuf.slice(0, j) +} + +// Export for testing +DBCSEncoder.prototype.findIdx = findIdx + +// == Decoder ================================================================== + +function DBCSDecoder (options, codec) { + // Decoder state + this.nodeIdx = 0 + this.prevBytes = [] + + // Static data + this.decodeTables = codec.decodeTables + this.decodeTableSeq = codec.decodeTableSeq + this.defaultCharUnicode = codec.defaultCharUnicode + this.gb18030 = codec.gb18030 +} + +DBCSDecoder.prototype.write = function (buf) { + var newBuf = Buffer.alloc(buf.length * 2) + var nodeIdx = this.nodeIdx + var prevBytes = this.prevBytes; var prevOffset = this.prevBytes.length + var seqStart = -this.prevBytes.length // idx of the start of current parsed sequence. + var uCode + + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset] + + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte] + + if (uCode >= 0) { + // Normal character, just use it. + } else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + uCode = this.defaultCharUnicode.charCodeAt(0) + i = seqStart // Skip one byte ('i' will be incremented by the for loop) and try to parse again. + } else if (uCode === GB18030_CODE) { + if (i >= 3) { + var ptr = (buf[i - 3] - 0x81) * 12600 + (buf[i - 2] - 0x30) * 1260 + (buf[i - 1] - 0x81) * 10 + (curByte - 0x30) + } else { + var ptr = (prevBytes[i - 3 + prevOffset] - 0x81) * 12600 + + (((i - 2 >= 0) ? buf[i - 2] : prevBytes[i - 2 + prevOffset]) - 0x30) * 1260 + + (((i - 1 >= 0) ? buf[i - 1] : prevBytes[i - 1 + prevOffset]) - 0x81) * 10 + + (curByte - 0x30) + } + var idx = findIdx(this.gb18030.gbChars, ptr) + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx] + } else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode + continue + } else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode] + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k] + newBuf[j++] = uCode & 0xFF + newBuf[j++] = uCode >> 8 + } + uCode = seq[seq.length - 1] + } else { throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte) } + + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode >= 0x10000) { + uCode -= 0x10000 + var uCodeLead = 0xD800 | (uCode >> 10) + newBuf[j++] = uCodeLead & 0xFF + newBuf[j++] = uCodeLead >> 8 + + uCode = 0xDC00 | (uCode & 0x3FF) + } + newBuf[j++] = uCode & 0xFF + newBuf[j++] = uCode >> 8 + + // Reset trie node. + nodeIdx = 0; seqStart = i + 1 + } + + this.nodeIdx = nodeIdx + this.prevBytes = (seqStart >= 0) + ? Array.prototype.slice.call(buf, seqStart) + : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)) + + return newBuf.slice(0, j).toString("ucs2") +} + +DBCSDecoder.prototype.end = function () { + var ret = "" + + // Try to parse all remaining chars. + while (this.prevBytes.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode + var bytesArr = this.prevBytes.slice(1) + + // Parse remaining as usual. + this.prevBytes = [] + this.nodeIdx = 0 + if (bytesArr.length > 0) { ret += this.write(bytesArr) } + } + + this.prevBytes = [] + this.nodeIdx = 0 + return ret +} + +// Binary search for GB18030. Returns largest i such that table[i] <= val. +function findIdx (table, val) { + if (table[0] > val) { return -1 } + + var l = 0; var r = table.length + while (l < r - 1) { // always table[l] <= val < table[r] + var mid = l + ((r - l + 1) >> 1) + if (table[mid] <= val) { l = mid } else { r = mid } + } + return l +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/dbcs-data.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/dbcs-data.js new file mode 100644 index 0000000000000000000000000000000000000000..a3858d4cf36253ebfd612bfa062260f8f4a20fcc --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/dbcs-data.js @@ -0,0 +1,185 @@ +"use strict" + +// Description of supported double byte encodings and aliases. +// Tables are not require()-d until they are needed to speed up library load. +// require()-s are direct to support Browserify. + +module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html + + shiftjis: { + type: "_dbcs", + table: function () { return require("./tables/shiftjis.json") }, + encodeAdd: { "\u00a5": 0x5C, "\u203E": 0x7E }, + encodeSkipVals: [{ from: 0xED40, to: 0xF940 }] + }, + csshiftjis: "shiftjis", + mskanji: "shiftjis", + sjis: "shiftjis", + windows31j: "shiftjis", + ms31j: "shiftjis", + xsjis: "shiftjis", + windows932: "shiftjis", + ms932: "shiftjis", + 932: "shiftjis", + cp932: "shiftjis", + + eucjp: { + type: "_dbcs", + table: function () { return require("./tables/eucjp.json") }, + encodeAdd: { "\u00a5": 0x5C, "\u203E": 0x7E } + }, + + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. + + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder + + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + gb2312: "cp936", + gb231280: "cp936", + gb23121980: "cp936", + csgb2312: "cp936", + csiso58gb231280: "cp936", + euccn: "cp936", + + // Microsoft's CP936 is a subset and approximation of GBK. + windows936: "cp936", + ms936: "cp936", + 936: "cp936", + cp936: { + type: "_dbcs", + table: function () { return require("./tables/cp936.json") } + }, + + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + gbk: { + type: "_dbcs", + table: function () { return require("./tables/cp936.json").concat(require("./tables/gbk-added.json")) } + }, + xgbk: "gbk", + isoir58: "gbk", + + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + gb18030: { + type: "_dbcs", + table: function () { return require("./tables/cp936.json").concat(require("./tables/gbk-added.json")) }, + gb18030: function () { return require("./tables/gb18030-ranges.json") }, + encodeSkipVals: [0x80], + encodeAdd: { "€": 0xA2E3 } + }, + + chinese: "gb18030", + + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + windows949: "cp949", + ms949: "cp949", + 949: "cp949", + cp949: { + type: "_dbcs", + table: function () { return require("./tables/cp949.json") } + }, + + cseuckr: "cp949", + csksc56011987: "cp949", + euckr: "cp949", + isoir149: "cp949", + korean: "cp949", + ksc56011987: "cp949", + ksc56011989: "cp949", + ksc5601: "cp949", + + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + + windows950: "cp950", + ms950: "cp950", + 950: "cp950", + cp950: { + type: "_dbcs", + table: function () { return require("./tables/cp950.json") } + }, + + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + big5: "big5hkscs", + big5hkscs: { + type: "_dbcs", + table: function () { return require("./tables/cp950.json").concat(require("./tables/big5-added.json")) }, + encodeSkipVals: [ + // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of + // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. + // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. + 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, + 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, + 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, + 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, + 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, + + // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 + 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce + ] + }, + + cnbig5: "big5hkscs", + csbig5: "big5hkscs", + xxbig5: "big5hkscs" +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/index.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9d90e3cac6b09d9bee4d67eb1a9d8d01254eb05d --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/index.js @@ -0,0 +1,23 @@ +"use strict" + +var mergeModules = require("../lib/helpers/merge-exports") + +// Update this array if you add/rename/remove files in this directory. +// We support Browserify by skipping automatic module discovery and requiring modules directly. +var modules = [ + require("./internal"), + require("./utf32"), + require("./utf16"), + require("./utf7"), + require("./sbcs-codec"), + require("./sbcs-data"), + require("./sbcs-data-generated"), + require("./dbcs-codec"), + require("./dbcs-data") +] + +// Put all encoding/alias/codec definitions to single object and export it. +for (var i = 0; i < modules.length; i++) { + var module = modules[i] + mergeModules(exports, module) +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/internal.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/internal.js new file mode 100644 index 0000000000000000000000000000000000000000..4e5c3ff25ac158bba365548767e9fdd815a1788c --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/internal.js @@ -0,0 +1,218 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Export Node.js internal encodings. + +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true }, + cesu8: { type: "_internal", bomAware: true }, + unicode11utf8: "utf8", + + ucs2: { type: "_internal", bomAware: true }, + utf16le: "ucs2", + + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, + + // Codec. + _internal: InternalCodec +} + +// ------------------------------------------------------------------------------ + +function InternalCodec (codecOptions, iconv) { + this.enc = codecOptions.encodingName + this.bomAware = codecOptions.bomAware + + if (this.enc === "base64") { this.encoder = InternalEncoderBase64 } else if (this.enc === "utf8") { this.encoder = InternalEncoderUtf8 } else if (this.enc === "cesu8") { + this.enc = "utf8" // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8 + + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from("eda0bdedb2a9", "hex").toString() !== "💩") { + this.decoder = InternalDecoderCesu8 + this.defaultCharUnicode = iconv.defaultCharUnicode + } + } +} + +InternalCodec.prototype.encoder = InternalEncoder +InternalCodec.prototype.decoder = InternalDecoder + +// ------------------------------------------------------------------------------ + +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = require("string_decoder").StringDecoder + +function InternalDecoder (options, codec) { + this.decoder = new StringDecoder(codec.enc) +} + +InternalDecoder.prototype.write = function (buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf) + } + + return this.decoder.write(buf) +} + +InternalDecoder.prototype.end = function () { + return this.decoder.end() +} + +// ------------------------------------------------------------------------------ +// Encoder is mostly trivial + +function InternalEncoder (options, codec) { + this.enc = codec.enc +} + +InternalEncoder.prototype.write = function (str) { + return Buffer.from(str, this.enc) +} + +InternalEncoder.prototype.end = function () { +} + +// ------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. + +function InternalEncoderBase64 (options, codec) { + this.prevStr = "" +} + +InternalEncoderBase64.prototype.write = function (str) { + str = this.prevStr + str + var completeQuads = str.length - (str.length % 4) + this.prevStr = str.slice(completeQuads) + str = str.slice(0, completeQuads) + + return Buffer.from(str, "base64") +} + +InternalEncoderBase64.prototype.end = function () { + return Buffer.from(this.prevStr, "base64") +} + +// ------------------------------------------------------------------------------ +// CESU-8 encoder is also special. + +function InternalEncoderCesu8 (options, codec) { +} + +InternalEncoderCesu8.prototype.write = function (str) { + var buf = Buffer.alloc(str.length * 3); var bufIdx = 0 + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i) + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) { buf[bufIdx++] = charCode } else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6) + buf[bufIdx++] = 0x80 + (charCode & 0x3f) + } else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12) + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f) + buf[bufIdx++] = 0x80 + (charCode & 0x3f) + } + } + return buf.slice(0, bufIdx) +} + +InternalEncoderCesu8.prototype.end = function () { +} + +// ------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ + +function InternalDecoderCesu8 (options, codec) { + this.acc = 0 + this.contBytes = 0 + this.accBytes = 0 + this.defaultCharUnicode = codec.defaultCharUnicode +} + +InternalDecoderCesu8.prototype.write = function (buf) { + var acc = this.acc; var contBytes = this.contBytes; var accBytes = this.accBytes + var res = "" + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i] + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode + contBytes = 0 + } + + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte) + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F + contBytes = 1; accBytes = 1 + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F + contBytes = 2; accBytes = 1 + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f) + contBytes--; accBytes++ + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) { + res += this.defaultCharUnicode + } else if (accBytes === 3 && acc < 0x800) { + res += this.defaultCharUnicode + } else { + // Actually add character. + res += String.fromCharCode(acc) + } + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes + return res +} + +InternalDecoderCesu8.prototype.end = function () { + var res = 0 + if (this.contBytes > 0) { res += this.defaultCharUnicode } + return res +} + +// ------------------------------------------------------------------------------ +// check the chunk boundaries for surrogate pair + +function InternalEncoderUtf8 (options, codec) { + this.highSurrogate = "" +} + +InternalEncoderUtf8.prototype.write = function (str) { + if (this.highSurrogate) { + str = this.highSurrogate + str + this.highSurrogate = "" + } + + if (str.length > 0) { + var charCode = str.charCodeAt(str.length - 1) + if (charCode >= 0xd800 && charCode < 0xdc00) { + this.highSurrogate = str[str.length - 1] + str = str.slice(0, str.length - 1) + } + } + + return Buffer.from(str, this.enc) +} + +InternalEncoderUtf8.prototype.end = function () { + if (this.highSurrogate) { + var str = this.highSurrogate + this.highSurrogate = "" + return Buffer.from(str, this.enc) + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/sbcs-codec.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/sbcs-codec.js new file mode 100644 index 0000000000000000000000000000000000000000..0e2fc924e1d40c723583b170825298e01ee09158 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/sbcs-codec.js @@ -0,0 +1,75 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that +// correspond to encoded bytes (if 128 - then lower half is ASCII). + +exports._sbcs = SBCSCodec +function SBCSCodec (codecOptions, iconv) { + if (!codecOptions) { + throw new Error("SBCS codec is called without the data.") + } + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) { + throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)") + } + + if (codecOptions.chars.length === 128) { + var asciiString = "" + for (var i = 0; i < 128; i++) { + asciiString += String.fromCharCode(i) + } + codecOptions.chars = asciiString + codecOptions.chars + } + + this.decodeBuf = Buffer.from(codecOptions.chars, "ucs2") + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)) + + for (var i = 0; i < codecOptions.chars.length; i++) { + encodeBuf[codecOptions.chars.charCodeAt(i)] = i + } + + this.encodeBuf = encodeBuf +} + +SBCSCodec.prototype.encoder = SBCSEncoder +SBCSCodec.prototype.decoder = SBCSDecoder + +function SBCSEncoder (options, codec) { + this.encodeBuf = codec.encodeBuf +} + +SBCSEncoder.prototype.write = function (str) { + var buf = Buffer.alloc(str.length) + for (var i = 0; i < str.length; i++) { + buf[i] = this.encodeBuf[str.charCodeAt(i)] + } + + return buf +} + +SBCSEncoder.prototype.end = function () { +} + +function SBCSDecoder (options, codec) { + this.decodeBuf = codec.decodeBuf +} + +SBCSDecoder.prototype.write = function (buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf + var newBuf = Buffer.alloc(buf.length * 2) + var idx1 = 0; var idx2 = 0 + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i] * 2; idx2 = i * 2 + newBuf[idx2] = decodeBuf[idx1] + newBuf[idx2 + 1] = decodeBuf[idx1 + 1] + } + return newBuf.toString("ucs2") +} + +SBCSDecoder.prototype.end = function () { +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/sbcs-data-generated.js new file mode 100644 index 0000000000000000000000000000000000000000..9b4823607b6071c67dd7b553767bfee98a49de1c --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/sbcs-data-generated.js @@ -0,0 +1,451 @@ +"use strict"; + +// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "_sbcs", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "_sbcs", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8t": { + "type": "_sbcs", + "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "armscii8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" + }, + "rk1048": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "georgianps": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "pt154": { + "type": "_sbcs", + "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "viscii": { + "type": "_sbcs", + "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "hproman8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" + }, + "macintosh": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "ascii": { + "type": "_sbcs", + "chars": "��������������������������������������������������������������������������������������������������������������������������������" + }, + "tis620": { + "type": "_sbcs", + "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + } +} \ No newline at end of file diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/sbcs-data.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/sbcs-data.js new file mode 100644 index 0000000000000000000000000000000000000000..d8f8e1729e6af5193d05056c906fb24bc2da35cf --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/sbcs-data.js @@ -0,0 +1,178 @@ +"use strict" + +// Manually added data to be used by sbcs codec in addition to generated one. + +module.exports = { + // Not supported by iconv, not sure why. + 10029: "maccenteuro", + maccenteuro: { + type: "_sbcs", + chars: "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, + + 808: "cp808", + ibm808: "cp808", + cp808: { + type: "_sbcs", + chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " + }, + + mik: { + type: "_sbcs", + chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + + cp720: { + type: "_sbcs", + chars: "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" + }, + + // Aliases of generated encodings. + ascii8bit: "ascii", + usascii: "ascii", + ansix34: "ascii", + ansix341968: "ascii", + ansix341986: "ascii", + csascii: "ascii", + cp367: "ascii", + ibm367: "ascii", + isoir6: "ascii", + iso646us: "ascii", + iso646irv: "ascii", + us: "ascii", + + latin1: "iso88591", + latin2: "iso88592", + latin3: "iso88593", + latin4: "iso88594", + latin5: "iso88599", + latin6: "iso885910", + latin7: "iso885913", + latin8: "iso885914", + latin9: "iso885915", + latin10: "iso885916", + + csisolatin1: "iso88591", + csisolatin2: "iso88592", + csisolatin3: "iso88593", + csisolatin4: "iso88594", + csisolatincyrillic: "iso88595", + csisolatinarabic: "iso88596", + csisolatingreek: "iso88597", + csisolatinhebrew: "iso88598", + csisolatin5: "iso88599", + csisolatin6: "iso885910", + + l1: "iso88591", + l2: "iso88592", + l3: "iso88593", + l4: "iso88594", + l5: "iso88599", + l6: "iso885910", + l7: "iso885913", + l8: "iso885914", + l9: "iso885915", + l10: "iso885916", + + isoir14: "iso646jp", + isoir57: "iso646cn", + isoir100: "iso88591", + isoir101: "iso88592", + isoir109: "iso88593", + isoir110: "iso88594", + isoir144: "iso88595", + isoir127: "iso88596", + isoir126: "iso88597", + isoir138: "iso88598", + isoir148: "iso88599", + isoir157: "iso885910", + isoir166: "tis620", + isoir179: "iso885913", + isoir199: "iso885914", + isoir203: "iso885915", + isoir226: "iso885916", + + cp819: "iso88591", + ibm819: "iso88591", + + cyrillic: "iso88595", + + arabic: "iso88596", + arabic8: "iso88596", + ecma114: "iso88596", + asmo708: "iso88596", + + greek: "iso88597", + greek8: "iso88597", + ecma118: "iso88597", + elot928: "iso88597", + + hebrew: "iso88598", + hebrew8: "iso88598", + + turkish: "iso88599", + turkish8: "iso88599", + + thai: "iso885911", + thai8: "iso885911", + + celtic: "iso885914", + celtic8: "iso885914", + isoceltic: "iso885914", + + tis6200: "tis620", + tis62025291: "tis620", + tis62025330: "tis620", + + 10000: "macroman", + 10006: "macgreek", + 10007: "maccyrillic", + 10079: "maciceland", + 10081: "macturkish", + + cspc8codepage437: "cp437", + cspc775baltic: "cp775", + cspc850multilingual: "cp850", + cspcp852: "cp852", + cspc862latinhebrew: "cp862", + cpgr: "cp869", + + msee: "cp1250", + mscyrl: "cp1251", + msansi: "cp1252", + msgreek: "cp1253", + msturk: "cp1254", + mshebr: "cp1255", + msarab: "cp1256", + winbaltrim: "cp1257", + + cp20866: "koi8r", + 20866: "koi8r", + ibm878: "koi8r", + cskoi8r: "koi8r", + + cp21866: "koi8u", + 21866: "koi8u", + ibm1168: "koi8u", + + strk10482002: "rk1048", + + tcvn5712: "tcvn", + tcvn57121: "tcvn", + + gb198880: "iso646cn", + cn: "iso646cn", + + csiso14jisc6220ro: "iso646jp", + jisc62201969ro: "iso646jp", + jp: "iso646jp", + + cshproman8: "hproman8", + r8: "hproman8", + roman8: "hproman8", + xroman8: "hproman8", + ibm1051: "hproman8", + + mac: "macintosh", + csmacintosh: "macintosh" +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/big5-added.json b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/big5-added.json new file mode 100644 index 0000000000000000000000000000000000000000..3c3d3c2f7b14c6a570e58184f68ef0894a5f812d --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/big5-added.json @@ -0,0 +1,122 @@ +[ +["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"], +["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"], +["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"], +["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"], +["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"], +["8940","𪎩𡅅"], +["8943","攊"], +["8946","丽滝鵎釟"], +["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"], +["89a1","琑糼緍楆竉刧"], +["89ab","醌碸酞肼"], +["89b0","贋胶𠧧"], +["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"], +["89c1","溚舾甙"], +["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"], +["8a40","𧶄唥"], +["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"], +["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"], +["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"], +["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"], +["8aac","䠋𠆩㿺塳𢶍"], +["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"], +["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"], +["8ac9","𪘁𠸉𢫏𢳉"], +["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"], +["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"], +["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"], +["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"], +["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"], +["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"], +["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"], +["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"], +["8ca1","𣏹椙橃𣱣泿"], +["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"], +["8cc9","顨杫䉶圽"], +["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"], +["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"], +["8d40","𠮟"], +["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"], +["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"], +["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"], +["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"], +["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"], +["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"], +["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"], +["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"], +["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"], +["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"], +["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"], +["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"], +["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"], +["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"], +["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"], +["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"], +["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"], +["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"], +["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"], +["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"], +["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"], +["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"], +["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"], +["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"], +["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"], +["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"], +["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"], +["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"], +["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"], +["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"], +["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"], +["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"], +["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"], +["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"], +["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"], +["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"], +["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"], +["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"], +["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"], +["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"], +["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"], +["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"], +["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"], +["9fae","酙隁酜"], +["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"], +["9fc1","𤤙盖鮝个𠳔莾衂"], +["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"], +["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"], +["9fe7","毺蠘罸"], +["9feb","嘠𪙊蹷齓"], +["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"], +["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"], +["a055","𡠻𦸅"], +["a058","詾𢔛"], +["a05b","惽癧髗鵄鍮鮏蟵"], +["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"], +["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"], +["a0a1","嵗𨯂迚𨸹"], +["a0a6","僙𡵆礆匲阸𠼻䁥"], +["a0ae","矾"], +["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"], +["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"], +["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"], +["a3c0","␀",31,"␡"], +["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23], +["c740","す",58,"ァアィイ"], +["c7a1","ゥ",81,"А",5,"ЁЖ",4], +["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"], +["c8a1","龰冈龱𧘇"], +["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"], +["c8f5","ʃɐɛɔɵœøŋʊɪ"], +["f9fe","■"], +["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"], +["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"], +["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"], +["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"], +["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"], +["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"], +["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"], +["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"], +["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"], +["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"] +] diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/cp936.json b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/cp936.json new file mode 100644 index 0000000000000000000000000000000000000000..49ddb9a1d68fd76a82904ef694de6b2770c04575 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/cp936.json @@ -0,0 +1,264 @@ +[ +["0","\u0000",127,"€"], +["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"], +["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"], +["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11], +["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"], +["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"], +["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5], +["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"], +["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"], +["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"], +["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"], +["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"], +["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"], +["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4], +["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6], +["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"], +["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7], +["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"], +["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"], +["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"], +["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5], +["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"], +["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6], +["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"], +["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4], +["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4], +["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"], +["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"], +["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6], +["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"], +["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"], +["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"], +["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6], +["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"], +["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"], +["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"], +["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"], +["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"], +["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"], +["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8], +["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"], +["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"], +["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"], +["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"], +["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5], +["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"], +["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"], +["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"], +["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"], +["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5], +["9980","檧檨檪檭",114,"欥欦欨",6], +["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"], +["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"], +["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"], +["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"], +["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"], +["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5], +["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"], +["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"], +["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6], +["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"], +["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"], +["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4], +["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19], +["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"], +["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"], +["a2a1","ⅰ",9], +["a2b1","⒈",19,"⑴",19,"①",9], +["a2e5","㈠",9], +["a2f1","Ⅰ",11], +["a3a1","!"#¥%",88," ̄"], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"], +["a6ee","︻︼︷︸︱"], +["a6f4","︳︴"], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6], +["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"], +["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"], +["a8bd","ńň"], +["a8c0","ɡ"], +["a8c5","ㄅ",36], +["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"], +["a959","℡㈱"], +["a95c","‐"], +["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8], +["a980","﹢",4,"﹨﹩﹪﹫"], +["a996","〇"], +["a9a4","─",75], +["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8], +["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"], +["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4], +["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4], +["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11], +["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"], +["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12], +["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"], +["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"], +["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"], +["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"], +["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"], +["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"], +["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"], +["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"], +["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"], +["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4], +["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"], +["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"], +["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"], +["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9], +["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"], +["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"], +["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"], +["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"], +["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"], +["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16], +["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"], +["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"], +["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"], +["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"], +["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"], +["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"], +["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"], +["bb40","籃",9,"籎",36,"籵",5,"籾",9], +["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"], +["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5], +["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"], +["bd40","紷",54,"絯",7], +["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"], +["be40","継",12,"綧",6,"綯",42], +["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"], +["bf40","緻",62], +["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"], +["c040","繞",35,"纃",23,"纜纝纞"], +["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"], +["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"], +["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"], +["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"], +["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"], +["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"], +["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"], +["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"], +["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"], +["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"], +["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"], +["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"], +["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"], +["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"], +["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"], +["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"], +["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"], +["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"], +["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"], +["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10], +["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"], +["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"], +["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"], +["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"], +["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"], +["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"], +["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"], +["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"], +["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"], +["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9], +["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"], +["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"], +["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"], +["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5], +["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"], +["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"], +["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"], +["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6], +["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"], +["d440","訞",31,"訿",8,"詉",21], +["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"], +["d540","誁",7,"誋",7,"誔",46], +["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"], +["d640","諤",34,"謈",27], +["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"], +["d740","譆",31,"譧",4,"譭",25], +["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"], +["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"], +["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"], +["d940","貮",62], +["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"], +["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"], +["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"], +["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"], +["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"], +["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7], +["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"], +["dd40","軥",62], +["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"], +["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"], +["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"], +["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"], +["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"], +["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"], +["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"], +["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"], +["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"], +["e240","釦",62], +["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"], +["e340","鉆",45,"鉵",16], +["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"], +["e440","銨",5,"銯",24,"鋉",31], +["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"], +["e540","錊",51,"錿",10], +["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"], +["e640","鍬",34,"鎐",27], +["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"], +["e740","鏎",7,"鏗",54], +["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"], +["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"], +["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"], +["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42], +["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"], +["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"], +["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"], +["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"], +["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"], +["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7], +["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"], +["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46], +["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"], +["ee40","頏",62], +["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"], +["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4], +["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"], +["f040","餈",4,"餎餏餑",28,"餯",26], +["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"], +["f140","馌馎馚",10,"馦馧馩",47], +["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"], +["f240","駺",62], +["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"], +["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"], +["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"], +["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5], +["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"], +["f540","魼",62], +["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"], +["f640","鯜",62], +["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"], +["f740","鰼",62], +["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"], +["f840","鳣",62], +["f880","鴢",32], +["f940","鵃",62], +["f980","鶂",32], +["fa40","鶣",62], +["fa80","鷢",32], +["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"], +["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"], +["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6], +["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"], +["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38], +["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"], +["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"] +] diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/cp949.json b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/cp949.json new file mode 100644 index 0000000000000000000000000000000000000000..2022a007ff7ac97ce51167903d116eec42bffd9a --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/cp949.json @@ -0,0 +1,273 @@ +[ +["0","\u0000",127], +["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"], +["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"], +["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"], +["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5], +["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"], +["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18], +["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7], +["8361","긝",18,"긲긳긵긶긹긻긼"], +["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8], +["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8], +["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18], +["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"], +["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4], +["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"], +["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"], +["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"], +["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10], +["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"], +["8741","놞",9,"놩",15], +["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"], +["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4], +["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4], +["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"], +["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"], +["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"], +["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"], +["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15], +["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"], +["8a61","둧",4,"둭",18,"뒁뒂"], +["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"], +["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"], +["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8], +["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18], +["8c41","똀",15,"똒똓똕똖똗똙",4], +["8c61","똞",6,"똦",5,"똭",6,"똵",5], +["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16], +["8d41","뛃",16,"뛕",8], +["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"], +["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"], +["8e41","랟랡",6,"랪랮",5,"랶랷랹",8], +["8e61","럂",4,"럈럊",19], +["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7], +["8f41","뢅",7,"뢎",17], +["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4], +["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5], +["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"], +["9061","륾",5,"릆릈릋릌릏",15], +["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"], +["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5], +["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5], +["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6], +["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"], +["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4], +["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"], +["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"], +["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8], +["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"], +["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8], +["9461","봞",5,"봥",6,"봭",12], +["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24], +["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"], +["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"], +["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14], +["9641","뺸",23,"뻒뻓"], +["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8], +["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44], +["9741","뾃",16,"뾕",8], +["9761","뾞",17,"뾱",7], +["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"], +["9841","쁀",16,"쁒",5,"쁙쁚쁛"], +["9861","쁝쁞쁟쁡",6,"쁪",15], +["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"], +["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"], +["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"], +["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"], +["9a41","숤숥숦숧숪숬숮숰숳숵",16], +["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"], +["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"], +["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8], +["9b61","쌳",17,"썆",7], +["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"], +["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5], +["9c61","쏿",8,"쐉",6,"쐑",9], +["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12], +["9d41","쒪",13,"쒹쒺쒻쒽",8], +["9d61","쓆",25], +["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"], +["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"], +["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"], +["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"], +["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"], +["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"], +["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"], +["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"], +["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13], +["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"], +["a141","좥좦좧좩",18,"좾좿죀죁"], +["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"], +["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"], +["a241","줐줒",5,"줙",18], +["a261","줭",6,"줵",18], +["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"], +["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"], +["a361","즑",6,"즚즜즞",16], +["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"], +["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"], +["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12], +["a481","쨦쨧쨨쨪",28,"ㄱ",93], +["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"], +["a561","쩫",17,"쩾",5,"쪅쪆"], +["a581","쪇",16,"쪙",14,"ⅰ",9], +["a5b0","Ⅰ",9], +["a5c1","Α",16,"Σ",6], +["a5e1","α",16,"σ",6], +["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"], +["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6], +["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7], +["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7], +["a761","쬪",22,"쭂쭃쭄"], +["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"], +["a841","쭭",10,"쭺",14], +["a861","쮉",18,"쮝",6], +["a881","쮤",19,"쮹",11,"ÆÐªĦ"], +["a8a6","IJ"], +["a8a8","ĿŁØŒºÞŦŊ"], +["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"], +["a941","쯅",14,"쯕",10], +["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18], +["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"], +["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"], +["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"], +["aa81","챳챴챶",29,"ぁ",82], +["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"], +["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5], +["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85], +["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"], +["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4], +["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25], +["acd1","а",5,"ёж",25], +["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7], +["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"], +["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"], +["ae41","췆",5,"췍췎췏췑",16], +["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4], +["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"], +["af41","츬츭츮츯츲츴츶",19], +["af61","칊",13,"칚칛칝칞칢",5,"칪칬"], +["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"], +["b041","캚",5,"캢캦",5,"캮",12], +["b061","캻",5,"컂",19], +["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"], +["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"], +["b161","켥",6,"켮켲",5,"켹",11], +["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"], +["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"], +["b261","쾎",18,"쾢",5,"쾩"], +["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"], +["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"], +["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5], +["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"], +["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5], +["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"], +["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"], +["b541","킕",14,"킦킧킩킪킫킭",5], +["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4], +["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"], +["b641","턅",7,"턎",17], +["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"], +["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"], +["b741","텮",13,"텽",6,"톅톆톇톉톊"], +["b761","톋",20,"톢톣톥톦톧"], +["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"], +["b841","퇐",7,"퇙",17], +["b861","퇫",8,"퇵퇶퇷퇹",13], +["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"], +["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"], +["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"], +["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"], +["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"], +["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5], +["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"], +["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"], +["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"], +["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"], +["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"], +["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"], +["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"], +["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"], +["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13], +["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"], +["be41","퐸",7,"푁푂푃푅",14], +["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"], +["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"], +["bf41","풞",10,"풪",14], +["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"], +["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"], +["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5], +["c061","픞",25], +["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"], +["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"], +["c161","햌햍햎햏햑",19,"햦햧"], +["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"], +["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"], +["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"], +["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"], +["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4], +["c361","홢",4,"홨홪",5,"홲홳홵",11], +["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"], +["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"], +["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4], +["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"], +["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"], +["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4], +["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"], +["c641","힍힎힏힑",6,"힚힜힞",5], +["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"], +["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"], +["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"], +["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"], +["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"], +["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"], +["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"], +["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"], +["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"], +["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"], +["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"], +["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"], +["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"], +["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"], +["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"], +["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"], +["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"], +["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"], +["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"], +["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"], +["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"], +["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"], +["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"], +["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"], +["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"], +["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"], +["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"], +["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"], +["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"], +["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"], +["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"], +["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"], +["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"], +["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"], +["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"], +["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"], +["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"], +["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"], +["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"], +["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"], +["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"], +["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"], +["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"], +["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"], +["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"], +["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"], +["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"], +["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"], +["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"], +["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"], +["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"], +["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"], +["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"], +["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"], +["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"] +] diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/cp950.json b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/cp950.json new file mode 100644 index 0000000000000000000000000000000000000000..d8bc87178dd38fca1829b9e2109c6f71e9721bdf --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/cp950.json @@ -0,0 +1,177 @@ +[ +["0","\u0000",127], +["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"], +["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"], +["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"], +["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21], +["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10], +["a3a1","ㄐ",25,"˙ˉˊˇˋ"], +["a3e1","€"], +["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"], +["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"], +["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"], +["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"], +["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"], +["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"], +["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"], +["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"], +["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"], +["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"], +["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"], +["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"], +["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"], +["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"], +["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"], +["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"], +["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"], +["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"], +["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"], +["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"], +["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"], +["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"], +["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"], +["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"], +["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"], +["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"], +["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"], +["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"], +["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"], +["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"], +["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"], +["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"], +["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"], +["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"], +["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"], +["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"], +["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"], +["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"], +["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"], +["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"], +["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"], +["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"], +["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"], +["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"], +["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"], +["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"], +["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"], +["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"], +["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"], +["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"], +["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"], +["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"], +["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"], +["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"], +["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"], +["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"], +["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"], +["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"], +["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"], +["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"], +["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"], +["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"], +["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"], +["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"], +["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"], +["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"], +["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"], +["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"], +["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"], +["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"], +["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"], +["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"], +["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"], +["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"], +["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"], +["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"], +["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"], +["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"], +["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"], +["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"], +["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"], +["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"], +["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"], +["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"], +["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"], +["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"], +["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"], +["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"], +["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"], +["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"], +["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"], +["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"], +["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"], +["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"], +["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"], +["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"], +["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"], +["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"], +["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"], +["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"], +["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"], +["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"], +["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"], +["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"], +["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"], +["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"], +["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"], +["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"], +["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"], +["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"], +["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"], +["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"], +["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"], +["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"], +["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"], +["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"], +["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"], +["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"], +["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"], +["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"], +["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"], +["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"], +["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"], +["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"], +["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"], +["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"], +["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"], +["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"], +["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"], +["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"], +["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"], +["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"], +["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"], +["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"], +["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"], +["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"], +["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"], +["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"], +["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"], +["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"], +["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"], +["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"], +["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"], +["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"], +["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"], +["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"], +["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"], +["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"], +["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"], +["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"], +["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"], +["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"], +["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"], +["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"], +["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"], +["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"], +["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"], +["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"], +["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"], +["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"], +["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"], +["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"], +["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"], +["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"], +["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"], +["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"], +["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"] +] diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/eucjp.json b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/eucjp.json new file mode 100644 index 0000000000000000000000000000000000000000..4fa61ca116009efc18ecbd1531538f31234ad103 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/eucjp.json @@ -0,0 +1,182 @@ +[ +["0","\u0000",127], +["8ea1","。",62], +["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], +["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], +["a2ba","∈∋⊆⊇⊂⊃∪∩"], +["a2ca","∧∨¬⇒⇔∀∃"], +["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["a2f2","ʼn♯♭♪†‡¶"], +["a2fe","◯"], +["a3b0","0",9], +["a3c1","A",25], +["a3e1","a",25], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["ada1","①",19,"Ⅰ",9], +["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], +["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], +["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], +["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], +["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], +["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], +["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], +["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], +["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], +["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], +["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], +["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], +["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], +["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], +["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], +["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], +["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], +["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], +["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], +["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], +["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], +["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], +["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], +["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], +["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], +["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], +["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], +["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], +["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], +["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], +["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], +["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], +["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], +["f4a1","堯槇遙瑤凜熙"], +["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], +["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], +["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["fcf1","ⅰ",9,"¬¦'""], +["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], +["8fa2c2","¡¦¿"], +["8fa2eb","ºª©®™¤№"], +["8fa6e1","ΆΈΉΊΪ"], +["8fa6e7","Ό"], +["8fa6e9","ΎΫ"], +["8fa6ec","Ώ"], +["8fa6f1","άέήίϊΐόςύϋΰώ"], +["8fa7c2","Ђ",10,"ЎЏ"], +["8fa7f2","ђ",10,"ўџ"], +["8fa9a1","ÆĐ"], +["8fa9a4","Ħ"], +["8fa9a6","IJ"], +["8fa9a8","ŁĿ"], +["8fa9ab","ŊØŒ"], +["8fa9af","ŦÞ"], +["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], +["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], +["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], +["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], +["8fabbd","ġĥíìïîǐ"], +["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], +["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], +["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], +["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], +["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], +["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], +["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], +["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], +["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], +["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], +["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], +["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], +["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], +["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], +["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], +["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], +["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], +["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], +["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], +["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], +["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], +["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], +["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], +["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], +["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], +["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], +["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], +["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], +["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], +["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], +["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], +["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], +["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], +["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], +["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], +["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], +["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], +["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], +["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], +["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], +["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], +["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], +["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], +["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], +["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], +["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], +["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], +["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], +["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], +["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], +["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], +["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], +["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], +["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], +["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], +["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], +["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], +["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], +["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], +["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], +["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], +["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], +["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] +] diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..85c6934757761e98580abf0c26c351b6fdfd6ad5 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json @@ -0,0 +1 @@ +{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]} \ No newline at end of file diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/gbk-added.json b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/gbk-added.json new file mode 100644 index 0000000000000000000000000000000000000000..b742e368f560003b9c95c3ae9b96633034d6f9e9 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/gbk-added.json @@ -0,0 +1,56 @@ +[ +["a140","",62], +["a180","",32], +["a240","",62], +["a280","",32], +["a2ab","",5], +["a2e3","€"], +["a2ef",""], +["a2fd",""], +["a340","",62], +["a380","",31," "], +["a440","",62], +["a480","",32], +["a4f4","",10], +["a540","",62], +["a580","",32], +["a5f7","",7], +["a640","",62], +["a680","",32], +["a6b9","",7], +["a6d9","",6], +["a6ec",""], +["a6f3",""], +["a6f6","",8], +["a740","",62], +["a780","",32], +["a7c2","",14], +["a7f2","",12], +["a896","",10], +["a8bc","ḿ"], +["a8bf","ǹ"], +["a8c1",""], +["a8ea","",20], +["a958",""], +["a95b",""], +["a95d",""], +["a989","〾⿰",11], +["a997","",12], +["a9f0","",14], +["aaa1","",93], +["aba1","",93], +["aca1","",93], +["ada1","",93], +["aea1","",93], +["afa1","",93], +["d7fa","",4], +["f8a1","",93], +["f9a1","",93], +["faa1","",93], +["fba1","",93], +["fca1","",93], +["fda1","",93], +["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], +["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], +["8135f437",""] +] diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/shiftjis.json b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/shiftjis.json new file mode 100644 index 0000000000000000000000000000000000000000..5a3a43cf8cf6d20324a49b75aff87d1bf902d108 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/tables/shiftjis.json @@ -0,0 +1,125 @@ +[ +["0","\u0000",128], +["a1","。",62], +["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"], +["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], +["81b8","∈∋⊆⊇⊂⊃∪∩"], +["81c8","∧∨¬⇒⇔∀∃"], +["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["81f0","ʼn♯♭♪†‡¶"], +["81fc","◯"], +["824f","0",9], +["8260","A",25], +["8281","a",25], +["829f","ぁ",82], +["8340","ァ",62], +["8380","ム",22], +["839f","Α",16,"Σ",6], +["83bf","α",16,"σ",6], +["8440","А",5,"ЁЖ",25], +["8470","а",5,"ёж",7], +["8480","о",17], +["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["8740","①",19,"Ⅰ",9], +["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["877e","㍻"], +["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"], +["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"], +["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"], +["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"], +["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"], +["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"], +["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"], +["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"], +["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"], +["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"], +["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"], +["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"], +["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"], +["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"], +["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"], +["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"], +["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"], +["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"], +["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"], +["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"], +["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"], +["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"], +["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"], +["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"], +["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"], +["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"], +["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"], +["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"], +["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"], +["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"], +["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"], +["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"], +["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"], +["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"], +["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"], +["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"], +["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["eeef","ⅰ",9,"¬¦'""], +["f040","",62], +["f080","",124], +["f140","",62], +["f180","",124], +["f240","",62], +["f280","",124], +["f340","",62], +["f380","",124], +["f440","",62], +["f480","",124], +["f540","",62], +["f580","",124], +["f640","",62], +["f680","",124], +["f740","",62], +["f780","",124], +["f840","",62], +["f880","",124], +["f940",""], +["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"], +["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"], +["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"], +["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"], +["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"] +] diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/utf16.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/utf16.js new file mode 100644 index 0000000000000000000000000000000000000000..ae60d98e305145b06da0ddede84f7d20484c3e59 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/utf16.js @@ -0,0 +1,187 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js + +// == UTF16-BE codec. ========================================================== + +exports.utf16be = Utf16BECodec +function Utf16BECodec () { +} + +Utf16BECodec.prototype.encoder = Utf16BEEncoder +Utf16BECodec.prototype.decoder = Utf16BEDecoder +Utf16BECodec.prototype.bomAware = true + +// -- Encoding + +function Utf16BEEncoder () { +} + +Utf16BEEncoder.prototype.write = function (str) { + var buf = Buffer.from(str, "ucs2") + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i + 1]; buf[i + 1] = tmp + } + return buf +} + +Utf16BEEncoder.prototype.end = function () { +} + +// -- Decoding + +function Utf16BEDecoder () { + this.overflowByte = -1 +} + +Utf16BEDecoder.prototype.write = function (buf) { + if (buf.length == 0) { return "" } + + var buf2 = Buffer.alloc(buf.length + 1) + var i = 0; var j = 0 + + if (this.overflowByte !== -1) { + buf2[0] = buf[0] + buf2[1] = this.overflowByte + i = 1; j = 2 + } + + for (; i < buf.length - 1; i += 2, j += 2) { + buf2[j] = buf[i + 1] + buf2[j + 1] = buf[i] + } + + this.overflowByte = (i == buf.length - 1) ? buf[buf.length - 1] : -1 + + return buf2.slice(0, j).toString("ucs2") +} + +Utf16BEDecoder.prototype.end = function () { + this.overflowByte = -1 +} + +// == UTF-16 codec ============================================================= +// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. +// Defaults to UTF-16LE, as it's prevalent and default in Node. +// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le +// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); + +// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). + +exports.utf16 = Utf16Codec +function Utf16Codec (codecOptions, iconv) { + this.iconv = iconv +} + +Utf16Codec.prototype.encoder = Utf16Encoder +Utf16Codec.prototype.decoder = Utf16Decoder + +// -- Encoding (pass-through) + +function Utf16Encoder (options, codec) { + options = options || {} + if (options.addBOM === undefined) { options.addBOM = true } + this.encoder = codec.iconv.getEncoder("utf-16le", options) +} + +Utf16Encoder.prototype.write = function (str) { + return this.encoder.write(str) +} + +Utf16Encoder.prototype.end = function () { + return this.encoder.end() +} + +// -- Decoding + +function Utf16Decoder (options, codec) { + this.decoder = null + this.initialBufs = [] + this.initialBufsLen = 0 + + this.options = options || {} + this.iconv = codec.iconv +} + +Utf16Decoder.prototype.write = function (buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf) + this.initialBufsLen += buf.length + + if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) + { return "" } + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + + return this.decoder.write(buf) +} + +Utf16Decoder.prototype.end = function () { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + var trail = this.decoder.end() + if (trail) { resStr += trail } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + return this.decoder.end() +} + +function detectEncoding (bufs, defaultEncoding) { + var b = [] + var charsProcessed = 0 + // Number of ASCII chars when decoded as LE or BE. + var asciiCharsLE = 0 + var asciiCharsBE = 0 + + outerLoop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i] + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]) + if (b.length === 2) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE) return "utf-16le" + if (b[0] === 0xFE && b[1] === 0xFF) return "utf-16be" + } + + if (b[0] === 0 && b[1] !== 0) asciiCharsBE++ + if (b[0] !== 0 && b[1] === 0) asciiCharsLE++ + + b.length = 0 + charsProcessed++ + + if (charsProcessed >= 100) { + break outerLoop + } + } + } + } + + // Make decisions. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + if (asciiCharsBE > asciiCharsLE) return "utf-16be" + if (asciiCharsBE < asciiCharsLE) return "utf-16le" + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || "utf-16le" +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/utf32.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/utf32.js new file mode 100644 index 0000000000000000000000000000000000000000..723178937a3a729a4b701992983292246f55f92f --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/utf32.js @@ -0,0 +1,307 @@ +"use strict" + +var Buffer = require("safer-buffer").Buffer + +// == UTF32-LE/BE codec. ========================================================== + +exports._utf32 = Utf32Codec + +function Utf32Codec (codecOptions, iconv) { + this.iconv = iconv + this.bomAware = true + this.isLE = codecOptions.isLE +} + +exports.utf32le = { type: "_utf32", isLE: true } +exports.utf32be = { type: "_utf32", isLE: false } + +// Aliases +exports.ucs4le = "utf32le" +exports.ucs4be = "utf32be" + +Utf32Codec.prototype.encoder = Utf32Encoder +Utf32Codec.prototype.decoder = Utf32Decoder + +// -- Encoding + +function Utf32Encoder (options, codec) { + this.isLE = codec.isLE + this.highSurrogate = 0 +} + +Utf32Encoder.prototype.write = function (str) { + var src = Buffer.from(str, "ucs2") + var dst = Buffer.alloc(src.length * 2) + var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE + var offset = 0 + + for (var i = 0; i < src.length; i += 2) { + var code = src.readUInt16LE(i) + var isHighSurrogate = (code >= 0xD800 && code < 0xDC00) + var isLowSurrogate = (code >= 0xDC00 && code < 0xE000) + + if (this.highSurrogate) { + if (isHighSurrogate || !isLowSurrogate) { + // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low + // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character + // (technically wrong, but expected by some applications, like Windows file names). + write32.call(dst, this.highSurrogate, offset) + offset += 4 + } else { + // Create 32-bit value from high and low surrogates; + var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000 + + write32.call(dst, codepoint, offset) + offset += 4 + this.highSurrogate = 0 + + continue + } + } + + if (isHighSurrogate) { this.highSurrogate = code } else { + // Even if the current character is a low surrogate, with no previous high surrogate, we'll + // encode it as a semi-invalid stand-alone character for the same reasons expressed above for + // unpaired high surrogates. + write32.call(dst, code, offset) + offset += 4 + this.highSurrogate = 0 + } + } + + if (offset < dst.length) { dst = dst.slice(0, offset) } + + return dst +} + +Utf32Encoder.prototype.end = function () { + // Treat any leftover high surrogate as a semi-valid independent character. + if (!this.highSurrogate) { return } + + var buf = Buffer.alloc(4) + + if (this.isLE) { buf.writeUInt32LE(this.highSurrogate, 0) } else { buf.writeUInt32BE(this.highSurrogate, 0) } + + this.highSurrogate = 0 + + return buf +} + +// -- Decoding + +function Utf32Decoder (options, codec) { + this.isLE = codec.isLE + this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0) + this.overflow = [] +} + +Utf32Decoder.prototype.write = function (src) { + if (src.length === 0) { return "" } + + var i = 0 + var codepoint = 0 + var dst = Buffer.alloc(src.length + 4) + var offset = 0 + var isLE = this.isLE + var overflow = this.overflow + var badChar = this.badChar + + if (overflow.length > 0) { + for (; i < src.length && overflow.length < 4; i++) { overflow.push(src[i]) } + + if (overflow.length === 4) { + // NOTE: codepoint is a signed int32 and can be negative. + // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). + if (isLE) { + codepoint = overflow[i] | (overflow[i + 1] << 8) | (overflow[i + 2] << 16) | (overflow[i + 3] << 24) + } else { + codepoint = overflow[i + 3] | (overflow[i + 2] << 8) | (overflow[i + 1] << 16) | (overflow[i] << 24) + } + overflow.length = 0 + + offset = _writeCodepoint(dst, offset, codepoint, badChar) + } + } + + // Main loop. Should be as optimized as possible. + for (; i < src.length - 3; i += 4) { + // NOTE: codepoint is a signed int32 and can be negative. + if (isLE) { + codepoint = src[i] | (src[i + 1] << 8) | (src[i + 2] << 16) | (src[i + 3] << 24) + } else { + codepoint = src[i + 3] | (src[i + 2] << 8) | (src[i + 1] << 16) | (src[i] << 24) + } + offset = _writeCodepoint(dst, offset, codepoint, badChar) + } + + // Keep overflowing bytes. + for (; i < src.length; i++) { + overflow.push(src[i]) + } + + return dst.slice(0, offset).toString("ucs2") +} + +function _writeCodepoint (dst, offset, codepoint, badChar) { + // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. + if (codepoint < 0 || codepoint > 0x10FFFF) { + // Not a valid Unicode codepoint + codepoint = badChar + } + + // Ephemeral Planes: Write high surrogate. + if (codepoint >= 0x10000) { + codepoint -= 0x10000 + + var high = 0xD800 | (codepoint >> 10) + dst[offset++] = high & 0xff + dst[offset++] = high >> 8 + + // Low surrogate is written below. + var codepoint = 0xDC00 | (codepoint & 0x3FF) + } + + // Write BMP char or low surrogate. + dst[offset++] = codepoint & 0xff + dst[offset++] = codepoint >> 8 + + return offset +}; + +Utf32Decoder.prototype.end = function () { + this.overflow.length = 0 +} + +// == UTF-32 Auto codec ============================================================= +// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. +// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 +// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); + +// Encoder prepends BOM (which can be overridden with (addBOM: false}). + +exports.utf32 = Utf32AutoCodec +exports.ucs4 = "utf32" + +function Utf32AutoCodec (options, iconv) { + this.iconv = iconv +} + +Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder +Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder + +// -- Encoding + +function Utf32AutoEncoder (options, codec) { + options = options || {} + + if (options.addBOM === undefined) { + options.addBOM = true + } + + this.encoder = codec.iconv.getEncoder(options.defaultEncoding || "utf-32le", options) +} + +Utf32AutoEncoder.prototype.write = function (str) { + return this.encoder.write(str) +} + +Utf32AutoEncoder.prototype.end = function () { + return this.encoder.end() +} + +// -- Decoding + +function Utf32AutoDecoder (options, codec) { + this.decoder = null + this.initialBufs = [] + this.initialBufsLen = 0 + this.options = options || {} + this.iconv = codec.iconv +} + +Utf32AutoDecoder.prototype.write = function (buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf) + this.initialBufsLen += buf.length + + if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) + { return "" } + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + + return this.decoder.write(buf) +} + +Utf32AutoDecoder.prototype.end = function () { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) + this.decoder = this.iconv.getDecoder(encoding, this.options) + + var resStr = "" + for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } + + var trail = this.decoder.end() + if (trail) { resStr += trail } + + this.initialBufs.length = this.initialBufsLen = 0 + return resStr + } + + return this.decoder.end() +} + +function detectEncoding (bufs, defaultEncoding) { + var b = [] + var charsProcessed = 0 + var invalidLE = 0; var invalidBE = 0 // Number of invalid chars when decoded as LE or BE. + var bmpCharsLE = 0; var bmpCharsBE = 0 // Number of BMP chars when decoded as LE or BE. + + outerLoop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i] + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]) + if (b.length === 4) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { + return "utf-32le" + } + if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { + return "utf-32be" + } + } + + if (b[0] !== 0 || b[1] > 0x10) invalidBE++ + if (b[3] !== 0 || b[2] > 0x10) invalidLE++ + + if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++ + if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++ + + b.length = 0 + charsProcessed++ + + if (charsProcessed >= 100) { + break outerLoop + } + } + } + } + + // Make decisions. + if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return "utf-32be" + if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return "utf-32le" + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || "utf-32le" +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/utf7.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/utf7.js new file mode 100644 index 0000000000000000000000000000000000000000..fe72a9d9b52b1b616ce05a534ff53e7975928e23 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/encodings/utf7.js @@ -0,0 +1,283 @@ +"use strict" +var Buffer = require("safer-buffer").Buffer + +// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 +// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 + +exports.utf7 = Utf7Codec +exports.unicode11utf7 = "utf7" // Alias UNICODE-1-1-UTF-7 +function Utf7Codec (codecOptions, iconv) { + this.iconv = iconv +}; + +Utf7Codec.prototype.encoder = Utf7Encoder +Utf7Codec.prototype.decoder = Utf7Decoder +Utf7Codec.prototype.bomAware = true + +// -- Encoding + +// Why scape ()?./? +// eslint-disable-next-line no-useless-escape +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g + +function Utf7Encoder (options, codec) { + this.iconv = codec.iconv +} + +Utf7Encoder.prototype.write = function (str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function (chunk) { + return "+" + (chunk === "+" + ? "" + : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + + "-" + }.bind(this))) +} + +Utf7Encoder.prototype.end = function () { +} + +// -- Decoding + +function Utf7Decoder (options, codec) { + this.iconv = codec.iconv + this.inBase64 = false + this.base64Accum = "" +} + +// Why scape /? +// eslint-disable-next-line no-useless-escape +var base64Regex = /[A-Za-z0-9\/+]/ +var base64Chars = [] +for (var i = 0; i < 256; i++) { base64Chars[i] = base64Regex.test(String.fromCharCode(i)) } + +var plusChar = "+".charCodeAt(0) +var minusChar = "-".charCodeAt(0) +var andChar = "&".charCodeAt(0) + +Utf7Decoder.prototype.write = function (buf) { + var res = ""; var lastI = 0 + var inBase64 = this.inBase64 + var base64Accum = this.base64Accum + + // The decoder is more involved as we must handle chunks in stream. + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars. + lastI = i + 1 + inBase64 = true + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "+-" -> "+" + res += "+" + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii") + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + if (buf[i] != minusChar) // Minus is absorbed after base64. + { i-- } + + lastI = i + 1 + inBase64 = false + base64Accum = "" + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii") + + var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded) + + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + this.inBase64 = inBase64 + this.base64Accum = base64Accum + + return res +} + +Utf7Decoder.prototype.end = function () { + var res = "" + if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") } + + this.inBase64 = false + this.base64Accum = "" + return res +} + +// UTF-7-IMAP codec. +// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) +// Differences: +// * Base64 part is started by "&" instead of "+" +// * Direct characters are 0x20-0x7E, except "&" (0x26) +// * In Base64, "," is used instead of "/" +// * Base64 must not be used to represent direct characters. +// * No implicit shift back from Base64 (should always end with '-') +// * String must end in non-shifted position. +// * "-&" while in base64 is not allowed. + +exports.utf7imap = Utf7IMAPCodec +function Utf7IMAPCodec (codecOptions, iconv) { + this.iconv = iconv +}; + +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder +Utf7IMAPCodec.prototype.bomAware = true + +// -- Encoding + +function Utf7IMAPEncoder (options, codec) { + this.iconv = codec.iconv + this.inBase64 = false + this.base64Accum = Buffer.alloc(6) + this.base64AccumIdx = 0 +} + +Utf7IMAPEncoder.prototype.write = function (str) { + var inBase64 = this.inBase64 + var base64Accum = this.base64Accum + var base64AccumIdx = this.base64AccumIdx + var buf = Buffer.alloc(str.length * 5 + 10); var bufIdx = 0 + + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i) + if (uChar >= 0x20 && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx) + base64AccumIdx = 0 + } + + buf[bufIdx++] = minusChar // Write '-', then go to direct mode. + inBase64 = false + } + + if (!inBase64) { + buf[bufIdx++] = uChar // Write direct character + + if (uChar === andChar) // Ampersand -> '&-' + { buf[bufIdx++] = minusChar } + } + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar // Write '&', then go to base64 mode. + inBase64 = true + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8 + base64Accum[base64AccumIdx++] = uChar & 0xFF + + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString("base64").replace(/\//g, ","), bufIdx) + base64AccumIdx = 0 + } + } + } + } + + this.inBase64 = inBase64 + this.base64AccumIdx = base64AccumIdx + + return buf.slice(0, bufIdx) +} + +Utf7IMAPEncoder.prototype.end = function () { + var buf = Buffer.alloc(10); var bufIdx = 0 + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx) + this.base64AccumIdx = 0 + } + + buf[bufIdx++] = minusChar // Write '-', then go to direct mode. + this.inBase64 = false + } + + return buf.slice(0, bufIdx) +} + +// -- Decoding + +function Utf7IMAPDecoder (options, codec) { + this.iconv = codec.iconv + this.inBase64 = false + this.base64Accum = "" +} + +var base64IMAPChars = base64Chars.slice() +base64IMAPChars[",".charCodeAt(0)] = true + +Utf7IMAPDecoder.prototype.write = function (buf) { + var res = ""; var lastI = 0 + var inBase64 = this.inBase64 + var base64Accum = this.base64Accum + + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars. + lastI = i + 1 + inBase64 = true + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&" + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, "/") + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + if (buf[i] != minusChar) // Minus may be absorbed after base64. + { i-- } + + lastI = i + 1 + inBase64 = false + base64Accum = "" + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, "/") + + var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded) + + res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + } + + this.inBase64 = inBase64 + this.base64Accum = base64Accum + + return res +} + +Utf7IMAPDecoder.prototype.end = function () { + var res = "" + if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") } + + this.inBase64 = false + this.base64Accum = "" + return res +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/bom-handling.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/bom-handling.js new file mode 100644 index 0000000000000000000000000000000000000000..a86a6b55ce1982670735bc873e18da940f796747 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/bom-handling.js @@ -0,0 +1,48 @@ +"use strict" + +var BOMChar = "\uFEFF" + +exports.PrependBOM = PrependBOMWrapper +function PrependBOMWrapper (encoder, options) { + this.encoder = encoder + this.addBOM = true +} + +PrependBOMWrapper.prototype.write = function (str) { + if (this.addBOM) { + str = BOMChar + str + this.addBOM = false + } + + return this.encoder.write(str) +} + +PrependBOMWrapper.prototype.end = function () { + return this.encoder.end() +} + +// ------------------------------------------------------------------------------ + +exports.StripBOM = StripBOMWrapper +function StripBOMWrapper (decoder, options) { + this.decoder = decoder + this.pass = false + this.options = options || {} +} + +StripBOMWrapper.prototype.write = function (buf) { + var res = this.decoder.write(buf) + if (this.pass || !res) { return res } + + if (res[0] === BOMChar) { + res = res.slice(1) + if (typeof this.options.stripBOM === "function") { this.options.stripBOM() } + } + + this.pass = true + return res +} + +StripBOMWrapper.prototype.end = function () { + return this.decoder.end() +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/helpers/merge-exports.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/helpers/merge-exports.js new file mode 100644 index 0000000000000000000000000000000000000000..e79e041d9529bfa24dc638a72bbc28039c83d54f --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/helpers/merge-exports.js @@ -0,0 +1,13 @@ +"use strict" + +var hasOwn = typeof Object.hasOwn === "undefined" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn + +function mergeModules (target, module) { + for (var key in module) { + if (hasOwn(module, key)) { + target[key] = module[key] + } + } +} + +module.exports = mergeModules diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/index.d.ts b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b11d99e91e6d8ed211f8d8b1d3b457c6adf0044b --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/index.d.ts @@ -0,0 +1,129 @@ +/* --------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + * REQUIREMENT: This definition is dependent on the @types/node definition. + * Install with `npm install @types/node --save-dev` + *-------------------------------------------------------------------------------------------- */ + +/* --------------------------------------------------------------------------------------------- + * This file provides detailed typings for the public API of iconv-lite + *-------------------------------------------------------------------------------------------- */ + +import type Stream = require("stream") +import type { Encoding } from "../types/encodings" + +declare namespace iconv { + export interface DecodeOptions { + /** + * Strip the Byte Order Mark (BOM) from the input, + * when decoding, if the codec is BOM-aware. @default true + */ + stripBOM?: boolean; + /** Override the default endianness for `UTF-16` and `UTF-32` decodings. */ + defaultEncoding?: "utf16be" | "utf32be"; + } + + export interface EncodeOptions { + /** + * Add a Byte Order Mark (BOM) to the output, when encoding, + * if the codec is BOM-aware. @default false + */ + addBOM?: boolean; + /** Override the default endianness for `UTF-32` encoding. */ + defaultEncoding?: "utf32be"; + } + + export interface EncoderStream { + write(str: string): Buffer; + end(): Buffer | undefined; + } + + export interface DecoderStream { + write(buf: Buffer): string; + end(): string | undefined; + } + + export interface Codec { + encoder: new (options?: EncodeOptions, codec?: Codec) => EncoderStream; + decoder: new (options?: DecodeOptions, codec?: Codec) => DecoderStream; + bomAware?: boolean; + [key: string]: any; + } + + /** Encodes a `string` into a `Buffer`, using the provided `encoding`. */ + export function encode (content: string, encoding: Encoding, options?: EncodeOptions): Buffer + + /** Decodes a `Buffer` into a `string`, using the provided `encoding`. */ + export function decode (buffer: Buffer | Uint8Array, encoding: Encoding, options?: DecodeOptions): string + + /** Checks if a given encoding is supported by `iconv-lite`. */ + export function encodingExists (encoding: string): encoding is Encoding + + /** Legacy alias for {@link iconv.encode}. */ + export const toEncoding: typeof iconv.encode + + /** Legacy alias for {@link iconv.decode}. */ + export const fromEncoding: typeof iconv.decode + + /** Creates a stream that decodes binary data from a given `encoding` into strings. */ + export function decodeStream (encoding: Encoding, options?: DecodeOptions): NodeJS.ReadWriteStream + + /** Creates a stream that encodes strings into binary data in a given `encoding`. */ + export function encodeStream (encoding: Encoding, options?: EncodeOptions): NodeJS.ReadWriteStream + + /** + * Explicitly enable Streaming API in browser environments by passing in: + * ```js + * require('stream') + * ``` + * @example iconv.enableStreamingAPI(require('stream')); + */ + export function enableStreamingAPI (stream_module: { Transform: typeof Stream.Transform }): void + + /** Creates and returns a low-level encoder stream. */ + export function getEncoder (encoding: Encoding, options?: EncodeOptions): EncoderStream + + /** Creates and returns a low-level decoder stream. */ + export function getDecoder (encoding: Encoding, options?: DecodeOptions): DecoderStream + + /** + * Returns a codec object for the given `encoding`. + * @throws If the `encoding` is not recognized. + */ + export function getCodec (encoding: Encoding): Codec + + /** Strips all non-alphanumeric characters and appended year from `encoding`. */ + export function _canonicalizeEncoding (encoding: Encoding): string + + /** A cache of all loaded encoding definitions. */ + export let encodings: Record< + Encoding, + | string + | { + type: string; + [key: string]: any; + } + > | null + + /** A cache of initialized codec objects. */ + export let _codecDataCache: Record + + /** The character used for untranslatable `Unicode` characters. @default "�" */ + export let defaultCharUnicode: string + + /** The character used for untranslatable `single-byte` characters. @default "?" */ + export let defaultCharSingleByte: string + + /** + * Skip deprecation warning when strings are used instead of Buffers during decoding. + * Note: {@link iconv.decode} converts the string to Buffer regardless. + */ + export let skipDecodeWarning: boolean + + /** @readonly Whether or not, Streaming API is enabled. */ + export const supportsStreams: boolean + + export type { iconv as Iconv, Encoding } +} + +export = iconv diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/index.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bd5d6bc0d90ac1a924e825a0f2c2c5c5a8021924 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/index.js @@ -0,0 +1,182 @@ +"use strict" + +var Buffer = require("safer-buffer").Buffer + +var bomHandling = require("./bom-handling") +var mergeModules = require("./helpers/merge-exports") + +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +// Cannot initialize with { __proto__: null } because Boolean({ __proto__: null }) === true +module.exports.encodings = null + +// Characters emitted in case of error. +module.exports.defaultCharUnicode = "�" +module.exports.defaultCharSingleByte = "?" + +// Public API. +module.exports.encode = function encode (str, encoding, options) { + str = "" + (str || "") // Ensure string. + + var encoder = module.exports.getEncoder(encoding, options) + + var res = encoder.write(str) + var trail = encoder.end() + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res +} + +module.exports.decode = function decode (buf, encoding, options) { + if (typeof buf === "string") { + if (!module.exports.skipDecodeWarning) { + console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding") + module.exports.skipDecodeWarning = true + } + + buf = Buffer.from("" + (buf || ""), "binary") // Ensure buffer. + } + + var decoder = module.exports.getDecoder(encoding, options) + + var res = decoder.write(buf) + var trail = decoder.end() + + return trail ? (res + trail) : res +} + +module.exports.encodingExists = function encodingExists (enc) { + try { + module.exports.getCodec(enc) + return true + } catch (e) { + return false + } +} + +// Legacy aliases to convert functions +module.exports.toEncoding = module.exports.encode +module.exports.fromEncoding = module.exports.decode + +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +module.exports._codecDataCache = { __proto__: null } + +module.exports.getCodec = function getCodec (encoding) { + if (!module.exports.encodings) { + var raw = require("../encodings") + // TODO: In future versions when old nodejs support is removed can use object.assign + module.exports.encodings = { __proto__: null } // Initialize as empty object. + mergeModules(module.exports.encodings, raw) + } + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = module.exports._canonicalizeEncoding(encoding) + + // Traverse iconv.encodings to find actual codec. + var codecOptions = {} + while (true) { + var codec = module.exports._codecDataCache[enc] + + if (codec) { return codec } + + var codecDef = module.exports.encodings[enc] + + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef + break + + case "object": // Alias with options. Can be layered. + for (var key in codecDef) { codecOptions[key] = codecDef[key] } + + if (!codecOptions.encodingName) { codecOptions.encodingName = enc } + + enc = codecDef.type + break + + case "function": // Codec itself. + if (!codecOptions.encodingName) { codecOptions.encodingName = enc } + + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + // + codec = new codecDef(codecOptions, module.exports) + + module.exports._codecDataCache[codecOptions.encodingName] = codec // Save it to be reused later. + return codec + + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')") + } + } +} + +module.exports._canonicalizeEncoding = function (encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "") +} + +module.exports.getEncoder = function getEncoder (encoding, options) { + var codec = module.exports.getCodec(encoding) + var encoder = new codec.encoder(options, codec) + + if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options) } + + return encoder +} + +module.exports.getDecoder = function getDecoder (encoding, options) { + var codec = module.exports.getCodec(encoding) + var decoder = new codec.decoder(options, codec) + + if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options) } + + return decoder +} + +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +module.exports.enableStreamingAPI = function enableStreamingAPI (streamModule) { + if (module.exports.supportsStreams) { return } + + // Dependency-inject stream module to create IconvLite stream classes. + var streams = require("./streams")(streamModule) + + // Not public API yet, but expose the stream classes. + module.exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream + module.exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream + + // Streaming API. + module.exports.encodeStream = function encodeStream (encoding, options) { + return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding, options), options) + } + + module.exports.decodeStream = function decodeStream (encoding, options) { + return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding, options), options) + } + + module.exports.supportsStreams = true +} + +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var streamModule +try { + streamModule = require("stream") +} catch (e) {} + +if (streamModule && streamModule.Transform) { + module.exports.enableStreamingAPI(streamModule) +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + module.exports.encodeStream = module.exports.decodeStream = function () { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.") + } +} + +// Some environments, such as browsers, may not load JavaScript files as UTF-8 +// eslint-disable-next-line no-constant-condition +if ("Ā" !== "\u0100") { + console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.") +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/streams.js b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/streams.js new file mode 100644 index 0000000000000000000000000000000000000000..ebfed8e0dc39caaa6830d86ef0a0b3ae1fde4f6f --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/lib/streams.js @@ -0,0 +1,105 @@ +"use strict" + +var Buffer = require("safer-buffer").Buffer + +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function (streamModule) { + var Transform = streamModule.Transform + + // == Encoder stream ======================================================= + + function IconvLiteEncoderStream (conv, options) { + this.conv = conv + options = options || {} + options.decodeStrings = false // We accept only strings, so we don't need to decode them. + Transform.call(this, options) + } + + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }) + + IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) { + if (typeof chunk !== "string") { + return done(new Error("Iconv encoding stream needs strings as its input.")) + } + + try { + var res = this.conv.write(chunk) + if (res && res.length) this.push(res) + done() + } catch (e) { + done(e) + } + } + + IconvLiteEncoderStream.prototype._flush = function (done) { + try { + var res = this.conv.end() + if (res && res.length) this.push(res) + done() + } catch (e) { + done(e) + } + } + + IconvLiteEncoderStream.prototype.collect = function (cb) { + var chunks = [] + this.on("error", cb) + this.on("data", function (chunk) { chunks.push(chunk) }) + this.on("end", function () { + cb(null, Buffer.concat(chunks)) + }) + return this + } + + // == Decoder stream ======================================================= + + function IconvLiteDecoderStream (conv, options) { + this.conv = conv + options = options || {} + options.encoding = this.encoding = "utf8" // We output strings. + Transform.call(this, options) + } + + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }) + + IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) { return done(new Error("Iconv decoding stream needs buffers as its input.")) } + try { + var res = this.conv.write(chunk) + if (res && res.length) this.push(res, this.encoding) + done() + } catch (e) { + done(e) + } + } + + IconvLiteDecoderStream.prototype._flush = function (done) { + try { + var res = this.conv.end() + if (res && res.length) this.push(res, this.encoding) + done() + } catch (e) { + done(e) + } + } + + IconvLiteDecoderStream.prototype.collect = function (cb) { + var res = "" + this.on("error", cb) + this.on("data", function (chunk) { res += chunk }) + this.on("end", function () { + cb(null, res) + }) + return this + } + + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/package.json b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2a573574293a93259fa06edef5810076d4f9ac7d --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/package.json @@ -0,0 +1,70 @@ +{ + "name": "iconv-lite", + "description": "Convert character encodings in pure javascript.", + "version": "0.7.2", + "license": "MIT", + "keywords": [ + "iconv", + "convert", + "charset", + "icu" + ], + "author": "Alexander Shtuchkin ", + "main": "./lib/index.js", + "typings": "./lib/index.d.ts", + "homepage": "https://github.com/pillarjs/iconv-lite", + "bugs": "https://github.com/pillarjs/iconv-lite/issues", + "files": [ + "lib/", + "encodings/", + "types/" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "repository": { + "type": "git", + "url": "https://github.com/pillarjs/iconv-lite.git" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "lint": "eslint", + "lint:fix": "eslint --fix", + "test": "mocha --reporter spec --check-leaks --grep .", + "test:ci": "nyc --exclude test --reporter=lcovonly --reporter=text npm test", + "test:cov": "nyc --exclude test --reporter=html --reporter=text npm test", + "test:performance": "node --allow-natives-syntax performance/index.js", + "test:tap": "mocha --reporter tap --check-leaks --grep .", + "test:typescript": "tsc && attw --pack", + "test:webpack": "npm pack && mv iconv-lite-*.tgz test/webpack/iconv-lite.tgz && cd test/webpack && npm install && npm run test && rm iconv-lite.tgz", + "typegen": "node generation/gen-typings.js" + }, + "browser": { + "stream": false + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", + "@stylistic/eslint-plugin": "^5.1.0", + "@stylistic/eslint-plugin-js": "^4.1.0", + "@types/node": "^24.0.12", + "async": "^3.2.0", + "bench-node": "^0.10.0", + "eslint": "^9.0.0", + "errto": "^0.2.1", + "expect-type": "^1.2.0", + "iconv": "^2.3.5", + "mocha": "^6.2.2", + "neostandard": "^0.12.0", + "nyc": "^14.1.1", + "request": "^2.88.2", + "semver": "^6.3.0", + "typescript": "~5.9.2", + "unorm": "^1.6.0" + }, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/iconv-lite/types/encodings.d.ts b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/types/encodings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bedbe33f87099e919425a1b40256e2556255252f --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/iconv-lite/types/encodings.d.ts @@ -0,0 +1,423 @@ +/* + * --------------------------------------------------------------------------------------------- + * DO NOT EDIT THIS FILE MANUALLY. + * THIS FILE IS AUTOMATICALLY GENERATED. + * TO UPDATE, RUN `npm run typegen` AND COMMIT THE CHANGES. + * --------------------------------------------------------------------------------------------- + */ + +/** A union of all supported encoding strings in `iconv-lite`. */ +export type Encoding = + | "10000" + | "10006" + | "10007" + | "10029" + | "10079" + | "10081" + | "1046" + | "1124" + | "1125" + | "1129" + | "1133" + | "1161" + | "1162" + | "1163" + | "1250" + | "1251" + | "1252" + | "1253" + | "1254" + | "1255" + | "1256" + | "1257" + | "1258" + | "20866" + | "21866" + | "28591" + | "28592" + | "28593" + | "28594" + | "28595" + | "28596" + | "28597" + | "28598" + | "28599" + | "28600" + | "28601" + | "28603" + | "28604" + | "28605" + | "28606" + | "437" + | "737" + | "775" + | "808" + | "850" + | "852" + | "855" + | "856" + | "857" + | "858" + | "860" + | "861" + | "862" + | "863" + | "864" + | "865" + | "866" + | "869" + | "874" + | "922" + | "932" + | "936" + | "949" + | "950" + | "ansix34" + | "ansix341968" + | "ansix341986" + | "arabic" + | "arabic8" + | "armscii8" + | "ascii" + | "ascii8bit" + | "asmo708" + | "base64" + | "big5" + | "big5hkscs" + | "binary" + | "celtic" + | "celtic8" + | "cesu8" + | "chinese" + | "cn" + | "cnbig5" + | "cp1046" + | "cp1124" + | "cp1125" + | "cp1129" + | "cp1133" + | "cp1161" + | "cp1162" + | "cp1163" + | "cp1250" + | "cp1251" + | "cp1252" + | "cp1253" + | "cp1254" + | "cp1255" + | "cp1256" + | "cp1257" + | "cp1258" + | "cp20866" + | "cp21866" + | "cp28591" + | "cp28592" + | "cp28593" + | "cp28594" + | "cp28595" + | "cp28596" + | "cp28597" + | "cp28598" + | "cp28599" + | "cp28600" + | "cp28601" + | "cp28603" + | "cp28604" + | "cp28605" + | "cp28606" + | "cp367" + | "cp437" + | "cp720" + | "cp737" + | "cp775" + | "cp808" + | "cp819" + | "cp850" + | "cp852" + | "cp855" + | "cp856" + | "cp857" + | "cp858" + | "cp860" + | "cp861" + | "cp862" + | "cp863" + | "cp864" + | "cp865" + | "cp866" + | "cp869" + | "cp874" + | "cp922" + | "cp932" + | "cp936" + | "cp949" + | "cp950" + | "cpgr" + | "csascii" + | "csbig5" + | "cseuckr" + | "csgb2312" + | "cshproman8" + | "csibm1046" + | "csibm1124" + | "csibm1125" + | "csibm1129" + | "csibm1133" + | "csibm1161" + | "csibm1162" + | "csibm1163" + | "csibm437" + | "csibm737" + | "csibm775" + | "csibm850" + | "csibm852" + | "csibm855" + | "csibm856" + | "csibm857" + | "csibm858" + | "csibm860" + | "csibm861" + | "csibm862" + | "csibm863" + | "csibm864" + | "csibm865" + | "csibm866" + | "csibm869" + | "csibm922" + | "csiso14jisc6220ro" + | "csiso58gb231280" + | "csisolatin1" + | "csisolatin2" + | "csisolatin3" + | "csisolatin4" + | "csisolatin5" + | "csisolatin6" + | "csisolatinarabic" + | "csisolatincyrillic" + | "csisolatingreek" + | "csisolatinhebrew" + | "cskoi8r" + | "csksc56011987" + | "csmacintosh" + | "cspc775baltic" + | "cspc850multilingual" + | "cspc862latinhebrew" + | "cspc8codepage437" + | "cspcp852" + | "csshiftjis" + | "cyrillic" + | "ecma114" + | "ecma118" + | "elot928" + | "euccn" + | "eucjp" + | "euckr" + | "gb18030" + | "gb198880" + | "gb2312" + | "gb23121980" + | "gb231280" + | "gbk" + | "georgianacademy" + | "georgianps" + | "greek" + | "greek8" + | "hebrew" + | "hebrew8" + | "hex" + | "hproman8" + | "ibm1046" + | "ibm1051" + | "ibm1124" + | "ibm1125" + | "ibm1129" + | "ibm1133" + | "ibm1161" + | "ibm1162" + | "ibm1163" + | "ibm1168" + | "ibm367" + | "ibm437" + | "ibm737" + | "ibm775" + | "ibm808" + | "ibm819" + | "ibm850" + | "ibm852" + | "ibm855" + | "ibm856" + | "ibm857" + | "ibm858" + | "ibm860" + | "ibm861" + | "ibm862" + | "ibm863" + | "ibm864" + | "ibm865" + | "ibm866" + | "ibm869" + | "ibm878" + | "ibm922" + | "iso646cn" + | "iso646irv" + | "iso646jp" + | "iso646us" + | "iso88591" + | "iso885910" + | "iso885911" + | "iso885913" + | "iso885914" + | "iso885915" + | "iso885916" + | "iso88592" + | "iso88593" + | "iso88594" + | "iso88595" + | "iso88596" + | "iso88597" + | "iso88598" + | "iso88599" + | "isoceltic" + | "isoir100" + | "isoir101" + | "isoir109" + | "isoir110" + | "isoir126" + | "isoir127" + | "isoir138" + | "isoir14" + | "isoir144" + | "isoir148" + | "isoir149" + | "isoir157" + | "isoir166" + | "isoir179" + | "isoir199" + | "isoir203" + | "isoir226" + | "isoir57" + | "isoir58" + | "isoir6" + | "jisc62201969ro" + | "jp" + | "koi8r" + | "koi8ru" + | "koi8t" + | "koi8u" + | "korean" + | "ksc5601" + | "ksc56011987" + | "ksc56011989" + | "l1" + | "l10" + | "l2" + | "l3" + | "l4" + | "l5" + | "l6" + | "l7" + | "l8" + | "l9" + | "latin1" + | "latin10" + | "latin2" + | "latin3" + | "latin4" + | "latin5" + | "latin6" + | "latin7" + | "latin8" + | "latin9" + | "mac" + | "maccenteuro" + | "maccroatian" + | "maccyrillic" + | "macgreek" + | "maciceland" + | "macintosh" + | "macroman" + | "macromania" + | "macthai" + | "macturkish" + | "macukraine" + | "mik" + | "ms31j" + | "ms932" + | "ms936" + | "ms949" + | "ms950" + | "msansi" + | "msarab" + | "mscyrl" + | "msee" + | "msgreek" + | "mshebr" + | "mskanji" + | "msturk" + | "pt154" + | "r8" + | "rk1048" + | "roman8" + | "shiftjis" + | "sjis" + | "strk10482002" + | "tcvn" + | "tcvn5712" + | "tcvn57121" + | "thai" + | "thai8" + | "tis620" + | "tis6200" + | "tis62025291" + | "tis62025330" + | "turkish" + | "turkish8" + | "ucs2" + | "ucs4" + | "ucs4be" + | "ucs4le" + | "unicode11utf7" + | "unicode11utf8" + | "us" + | "usascii" + | "utf16" + | "utf16be" + | "utf16le" + | "utf32" + | "utf32be" + | "utf32le" + | "utf7" + | "utf7imap" + | "utf8" + | "viscii" + | "win1250" + | "win1251" + | "win1252" + | "win1253" + | "win1254" + | "win1255" + | "win1256" + | "win1257" + | "win1258" + | "win874" + | "winbaltrim" + | "windows1250" + | "windows1251" + | "windows1252" + | "windows1253" + | "windows1254" + | "windows1255" + | "windows1256" + | "windows1257" + | "windows1258" + | "windows31j" + | "windows874" + | "windows932" + | "windows936" + | "windows949" + | "windows950" + | "xgbk" + | "xroman8" + | "xsjis" + | "xxbig5" + | (string & {}) diff --git a/node_modules/@nestjs/platform-express/node_modules/media-typer/HISTORY.md b/node_modules/@nestjs/platform-express/node_modules/media-typer/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..538ade14fa848dcce1b5b839ced17f5817fcd5ff --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/media-typer/HISTORY.md @@ -0,0 +1,50 @@ +1.1.0 / 2019-04-24 +================== + + * Add `test(string)` function + +1.0.2 / 2019-04-19 +================== + + * Fix JSDoc comment for `parse` function + +1.0.1 / 2018-10-20 +================== + + * Remove left over `parameters` property from class + +1.0.0 / 2018-10-20 +================== + +This major release brings the module back to it's RFC 6838 roots. If you want +a module to parse the `Content-Type` or similar HTTP headers, use the +`content-type` module instead. + + * Drop support for Node.js below 0.8 + * Remove parameter handling, which is outside RFC 6838 scope + * Remove `parse(req)` and `parse(res)` signatures + * perf: enable strict mode + * perf: use a class for object creation + +0.3.0 / 2014-09-07 +================== + + * Support Node.js 0.6 + * Throw error when parameter format invalid on parse + +0.2.0 / 2014-06-18 +================== + + * Add `typer.format()` to format media types + +0.1.0 / 2014-06-17 +================== + + * Accept `req` as argument to `parse` + * Accept `res` as argument to `parse` + * Parse media type with extra LWS between type and first parameter + +0.0.0 / 2014-06-13 +================== + + * Initial implementation diff --git a/node_modules/@nestjs/platform-express/node_modules/media-typer/LICENSE b/node_modules/@nestjs/platform-express/node_modules/media-typer/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..84441fbb5709262c2bfc9b5ff0166ad4f024a1b8 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/media-typer/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/media-typer/README.md b/node_modules/@nestjs/platform-express/node_modules/media-typer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..37edad16f5aca0263d8350f3654cf1f04a5c32cf --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/media-typer/README.md @@ -0,0 +1,93 @@ +# media-typer + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Simple RFC 6838 media type parser. + +This module will parse a given media type into it's component parts, like type, +subtype, and suffix. A formatter is also provided to put them back together and +the two can be combined to normalize media types into a canonical form. + +If you are looking to parse the string that represents a media type and it's +parameters in HTTP (for example, the `Content-Type` header), use the +[content-type module](https://www.npmjs.com/package/content-type). + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install media-typer +``` + +## API + + + +```js +var typer = require('media-typer') +``` + +### typer.parse(string) + + + +```js +var obj = typer.parse('image/svg+xml') +``` + +Parse a media type string. This will return an object with the following +properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): + + - `type`: The type of the media type (always lower case). Example: `'image'` + + - `subtype`: The subtype of the media type (always lower case). Example: `'svg'` + + - `suffix`: The suffix of the media type (always lower case). Example: `'xml'` + +If the given type string is invalid, then a `TypeError` is thrown. + +### typer.format(obj) + + + +```js +var obj = typer.format({ type: 'image', subtype: 'svg', suffix: 'xml' }) +``` + +Format an object into a media type string. This will return a string of the +mime type for the given object. For the properties of the object, see the +documentation for `typer.parse(string)`. + +If any of the given object values are invalid, then a `TypeError` is thrown. + +### typer.test(string) + + + +```js +var valid = typer.test('image/svg+xml') +``` + +Validate a media type string. This will return `true` is the string is a well- +formatted media type, or `false` otherwise. + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/media-typer/master +[coveralls-url]: https://coveralls.io/r/jshttp/media-typer?branch=master +[node-version-image]: https://badgen.net/npm/node/media-typer +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/media-typer +[npm-url]: https://npmjs.org/package/media-typer +[npm-version-image]: https://badgen.net/npm/v/media-typer +[travis-image]: https://badgen.net/travis/jshttp/media-typer/master +[travis-url]: https://travis-ci.org/jshttp/media-typer diff --git a/node_modules/@nestjs/platform-express/node_modules/media-typer/index.js b/node_modules/@nestjs/platform-express/node_modules/media-typer/index.js new file mode 100644 index 0000000000000000000000000000000000000000..897cae1570efe9b622229f15e07fe45fe8284350 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/media-typer/index.js @@ -0,0 +1,143 @@ +/*! + * media-typer + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * RegExp to match type in RFC 6838 + * + * type-name = restricted-name + * subtype-name = restricted-name + * restricted-name = restricted-name-first *126restricted-name-chars + * restricted-name-first = ALPHA / DIGIT + * restricted-name-chars = ALPHA / DIGIT / "!" / "#" / + * "$" / "&" / "-" / "^" / "_" + * restricted-name-chars =/ "." ; Characters before first dot always + * ; specify a facet name + * restricted-name-chars =/ "+" ; Characters after last plus always + * ; specify a structured syntax suffix + * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z + * DIGIT = %x30-39 ; 0-9 + */ +var SUBTYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/ +var TYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/ +var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/ + +/** + * Module exports. + */ + +exports.format = format +exports.parse = parse +exports.test = test + +/** + * Format object to media type. + * + * @param {object} obj + * @return {string} + * @public + */ + +function format (obj) { + if (!obj || typeof obj !== 'object') { + throw new TypeError('argument obj is required') + } + + var subtype = obj.subtype + var suffix = obj.suffix + var type = obj.type + + if (!type || !TYPE_NAME_REGEXP.test(type)) { + throw new TypeError('invalid type') + } + + if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) { + throw new TypeError('invalid subtype') + } + + // format as type/subtype + var string = type + '/' + subtype + + // append +suffix + if (suffix) { + if (!TYPE_NAME_REGEXP.test(suffix)) { + throw new TypeError('invalid suffix') + } + + string += '+' + suffix + } + + return string +} + +/** + * Test media type. + * + * @param {string} string + * @return {object} + * @public + */ + +function test (string) { + if (!string) { + throw new TypeError('argument string is required') + } + + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + return TYPE_REGEXP.test(string.toLowerCase()) +} + +/** + * Parse media type to object. + * + * @param {string} string + * @return {object} + * @public + */ + +function parse (string) { + if (!string) { + throw new TypeError('argument string is required') + } + + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + var match = TYPE_REGEXP.exec(string.toLowerCase()) + + if (!match) { + throw new TypeError('invalid media type') + } + + var type = match[1] + var subtype = match[2] + var suffix + + // suffix after last + + var index = subtype.lastIndexOf('+') + if (index !== -1) { + suffix = subtype.substr(index + 1) + subtype = subtype.substr(0, index) + } + + return new MediaType(type, subtype, suffix) +} + +/** + * Class for MediaType object. + * @public + */ + +function MediaType (type, subtype, suffix) { + this.type = type + this.subtype = subtype + this.suffix = suffix +} diff --git a/node_modules/@nestjs/platform-express/node_modules/media-typer/package.json b/node_modules/@nestjs/platform-express/node_modules/media-typer/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1dca712ee162c2ae9cb7ee3011948018c845ca39 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/media-typer/package.json @@ -0,0 +1,33 @@ +{ + "name": "media-typer", + "description": "Simple RFC 6838 media type parser and formatter", + "version": "1.1.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "jshttp/media-typer", + "devDependencies": { + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.17.2", + "eslint-plugin-markdown": "1.0.0", + "eslint-plugin-node": "8.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "mocha": "6.1.4", + "nyc": "14.0.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-travis": "nyc --reporter=text npm test" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/index.d.ts b/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..df8f91f445b1ef0be11552801e36bf5eedea8910 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/index.d.ts @@ -0,0 +1,11 @@ +/** +Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties. + +@param destination - The object to receive properties. +@param source - The object providing properties. +@param overwrite - Optional boolean to control overwriting of existing properties. Defaults to true. +@returns The modified destination object. +*/ +declare function mergeDescriptors(destination: T, source: U, overwrite?: boolean): T & U; + +export = mergeDescriptors; diff --git a/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/index.js b/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/index.js new file mode 100644 index 0000000000000000000000000000000000000000..51228e5cecc2929c27b40f855a6f4eb4fb9baf7b --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/index.js @@ -0,0 +1,26 @@ +'use strict'; + +function mergeDescriptors(destination, source, overwrite = true) { + if (!destination) { + throw new TypeError('The `destination` argument is required.'); + } + + if (!source) { + throw new TypeError('The `source` argument is required.'); + } + + for (const name of Object.getOwnPropertyNames(source)) { + if (!overwrite && Object.hasOwn(destination, name)) { + // Skip descriptor + continue; + } + + // Copy descriptor + const descriptor = Object.getOwnPropertyDescriptor(source, name); + Object.defineProperty(destination, name, descriptor); + } + + return destination; +} + +module.exports = mergeDescriptors; diff --git a/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/license b/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/license new file mode 100644 index 0000000000000000000000000000000000000000..c509d4557c0d11a3f7ea08d5e4ff0c77ff91f4cf --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/license @@ -0,0 +1,11 @@ +MIT License + +Copyright (c) Jonathan Ong +Copyright (c) Douglas Christopher Wilson +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/package.json b/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9bedb250ba6f5976c708674d9d6b539e7ff3050e --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/package.json @@ -0,0 +1,50 @@ +{ + "name": "merge-descriptors", + "version": "2.0.0", + "description": "Merge objects using their property descriptors", + "license": "MIT", + "repository": "sindresorhus/merge-descriptors", + "funding": "https://github.com/sponsors/sindresorhus", + "contributors": [ + "Jonathan Ong ", + "Douglas Christopher Wilson ", + "Mike Grabowski ", + "Sindre Sorhus " + ], + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "main": "./index.js", + "types": "./index.d.ts", + "sideEffects": false, + "engines": { + "node": ">=18" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "merge", + "descriptors", + "object", + "property", + "properties", + "merging", + "getter", + "setter" + ], + "devDependencies": { + "ava": "^5.3.1", + "xo": "^0.56.0" + }, + "xo": { + "rules": { + "unicorn/prefer-module": "off" + } + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/readme.md b/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..1dee67d843668d895d55ed100debc2a1b36254e6 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/merge-descriptors/readme.md @@ -0,0 +1,55 @@ +# merge-descriptors + +> Merge objects using their property descriptors + +## Install + +```sh +npm install merge-descriptors +``` + +## Usage + +```js +import mergeDescriptors from 'merge-descriptors'; + +const thing = { + get name() { + return 'John' + } +} + +const animal = {}; + +mergeDescriptors(animal, thing); + +console.log(animal.name); +//=> 'John' +``` + +## API + +### merge(destination, source, overwrite?) + +Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties. + +Returns the modified destination object. + +#### destination + +Type: `object` + +The object to receive properties. + +#### source + +Type: `object` + +The object providing properties. + +#### overwrite + +Type: `boolean`\ +Default: `true` + +A boolean to control overwriting of existing properties. diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-db/HISTORY.md b/node_modules/@nestjs/platform-express/node_modules/mime-db/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..fb35beccad7e990844c8b39305e328db6b904f70 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-db/HISTORY.md @@ -0,0 +1,541 @@ +1.54.0 / 2025-03-17 +=================== + + * Update mime type for DCM format (#362) + * mark application/octet-stream as compressible (#163) + * Fix typo in application/x-zip-compressed mimetype (#359) + * Add mime-type for Jupyter notebooks (#282) + * Add Google Drive MIME types (#311) + * Add .blend file type (#338) + * Add support for the FBX file extension (#342) + * Add Adobe DNG file (#340) + * Add Procreate Brush and Brush Set file Types (#339) + * Add support for Procreate Dreams (#341) + * replace got with undici (#352) + * Added extensions list for model/step (#293) + * Add m4b as a type of audio/mp4 (#357) + * windows 11 application/x-zip-compressed (#346) + * add dotLottie mime type (#351) + * Add some MS-related extensions and types (#336) + +1.53.0 / 2024-07-12 +=================== + + * Add extension `.sql` to `application/sql` + * Add extensions `.aac` and `.adts` to `audio/aac` + * Add extensions `.js` and `.mjs` to `text/javascript` + * Add extensions for `application/mp4` from IANA + * Add extensions from IANA for more MIME types + * Add Microsoft app installer types and extensions + * Add new upstream MIME types + * Fix extensions for `text/markdown` to match IANA + * Remove extension `.mjs` from `application/javascript` + * Remove obsolete MIME types from IANA data + +1.52.0 / 2022-02-21 +=================== + + * Add extensions from IANA for more `image/*` types + * Add extension `.asc` to `application/pgp-keys` + * Add extensions to various XML types + * Add new upstream MIME types + +1.51.0 / 2021-11-08 +=================== + + * Add new upstream MIME types + * Mark `image/vnd.microsoft.icon` as compressible + * Mark `image/vnd.ms-dds` as compressible + +1.50.0 / 2021-09-15 +=================== + + * Add deprecated iWorks mime types and extensions + * Add new upstream MIME types + +1.49.0 / 2021-07-26 +=================== + + * Add extension `.trig` to `application/trig` + * Add new upstream MIME types + +1.48.0 / 2021-05-30 +=================== + + * Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + * Add new upstream MIME types + * Mark `text/yaml` as compressible + +1.47.0 / 2021-04-01 +=================== + + * Add new upstream MIME types + * Remove ambiguous extensions from IANA for `application/*+xml` types + * Update primary extension to `.es` for `application/ecmascript` + +1.46.0 / 2021-02-13 +=================== + + * Add extension `.amr` to `audio/amr` + * Add extension `.m4s` to `video/iso.segment` + * Add extension `.opus` to `audio/ogg` + * Add new upstream MIME types + +1.45.0 / 2020-09-22 +=================== + + * Add `application/ubjson` with extension `.ubj` + * Add `image/avif` with extension `.avif` + * Add `image/ktx2` with extension `.ktx2` + * Add extension `.dbf` to `application/vnd.dbf` + * Add extension `.rar` to `application/vnd.rar` + * Add extension `.td` to `application/urc-targetdesc+xml` + * Add new upstream MIME types + * Fix extension of `application/vnd.apple.keynote` to be `.key` + +1.44.0 / 2020-04-22 +=================== + + * Add charsets from IANA + * Add extension `.cjs` to `application/node` + * Add new upstream MIME types + +1.43.0 / 2020-01-05 +=================== + + * Add `application/x-keepass2` with extension `.kdbx` + * Add extension `.mxmf` to `audio/mobile-xmf` + * Add extensions from IANA for `application/*+xml` types + * Add new upstream MIME types + +1.42.0 / 2019-09-25 +=================== + + * Add `image/vnd.ms-dds` with extension `.dds` + * Add new upstream MIME types + * Remove compressible from `multipart/mixed` + +1.41.0 / 2019-08-30 +=================== + + * Add new upstream MIME types + * Add `application/toml` with extension `.toml` + * Mark `font/ttf` as compressible + +1.40.0 / 2019-04-20 +=================== + + * Add extensions from IANA for `model/*` types + * Add `text/mdx` with extension `.mdx` + +1.39.0 / 2019-04-04 +=================== + + * Add extensions `.siv` and `.sieve` to `application/sieve` + * Add new upstream MIME types + +1.38.0 / 2019-02-04 +=================== + + * Add extension `.nq` to `application/n-quads` + * Add extension `.nt` to `application/n-triples` + * Add new upstream MIME types + * Mark `text/less` as compressible + +1.37.0 / 2018-10-19 +=================== + + * Add extensions to HEIC image types + * Add new upstream MIME types + +1.36.0 / 2018-08-20 +=================== + + * Add Apple file extensions from IANA + * Add extensions from IANA for `image/*` types + * Add new upstream MIME types + +1.35.0 / 2018-07-15 +=================== + + * Add extension `.owl` to `application/rdf+xml` + * Add new upstream MIME types + - Removes extension `.woff` from `application/font-woff` + +1.34.0 / 2018-06-03 +=================== + + * Add extension `.csl` to `application/vnd.citationstyles.style+xml` + * Add extension `.es` to `application/ecmascript` + * Add new upstream MIME types + * Add `UTF-8` as default charset for `text/turtle` + * Mark all XML-derived types as compressible + +1.33.0 / 2018-02-15 +=================== + + * Add extensions from IANA for `message/*` types + * Add new upstream MIME types + * Fix some incorrect OOXML types + * Remove `application/font-woff2` + +1.32.0 / 2017-11-29 +=================== + + * Add new upstream MIME types + * Update `text/hjson` to registered `application/hjson` + * Add `text/shex` with extension `.shex` + +1.31.0 / 2017-10-25 +=================== + + * Add `application/raml+yaml` with extension `.raml` + * Add `application/wasm` with extension `.wasm` + * Add new `font` type from IANA + * Add new upstream font extensions + * Add new upstream MIME types + * Add extensions for JPEG-2000 images + +1.30.0 / 2017-08-27 +=================== + + * Add `application/vnd.ms-outlook` + * Add `application/x-arj` + * Add extension `.mjs` to `application/javascript` + * Add glTF types and extensions + * Add new upstream MIME types + * Add `text/x-org` + * Add VirtualBox MIME types + * Fix `source` records for `video/*` types that are IANA + * Update `font/opentype` to registered `font/otf` + +1.29.0 / 2017-07-10 +=================== + + * Add `application/fido.trusted-apps+json` + * Add extension `.wadl` to `application/vnd.sun.wadl+xml` + * Add new upstream MIME types + * Add `UTF-8` as default charset for `text/css` + +1.28.0 / 2017-05-14 +=================== + + * Add new upstream MIME types + * Add extension `.gz` to `application/gzip` + * Update extensions `.md` and `.markdown` to be `text/markdown` + +1.27.0 / 2017-03-16 +=================== + + * Add new upstream MIME types + * Add `image/apng` with extension `.apng` + +1.26.0 / 2017-01-14 +=================== + + * Add new upstream MIME types + * Add extension `.geojson` to `application/geo+json` + +1.25.0 / 2016-11-11 +=================== + + * Add new upstream MIME types + +1.24.0 / 2016-09-18 +=================== + + * Add `audio/mp3` + * Add new upstream MIME types + +1.23.0 / 2016-05-01 +=================== + + * Add new upstream MIME types + * Add extension `.3gpp` to `audio/3gpp` + +1.22.0 / 2016-02-15 +=================== + + * Add `text/slim` + * Add extension `.rng` to `application/xml` + * Add new upstream MIME types + * Fix extension of `application/dash+xml` to be `.mpd` + * Update primary extension to `.m4a` for `audio/mp4` + +1.21.0 / 2016-01-06 +=================== + + * Add Google document types + * Add new upstream MIME types + +1.20.0 / 2015-11-10 +=================== + + * Add `text/x-suse-ymp` + * Add new upstream MIME types + +1.19.0 / 2015-09-17 +=================== + + * Add `application/vnd.apple.pkpass` + * Add new upstream MIME types + +1.18.0 / 2015-09-03 +=================== + + * Add new upstream MIME types + +1.17.0 / 2015-08-13 +=================== + + * Add `application/x-msdos-program` + * Add `audio/g711-0` + * Add `image/vnd.mozilla.apng` + * Add extension `.exe` to `application/x-msdos-program` + +1.16.0 / 2015-07-29 +=================== + + * Add `application/vnd.uri-map` + +1.15.0 / 2015-07-13 +=================== + + * Add `application/x-httpd-php` + +1.14.0 / 2015-06-25 +=================== + + * Add `application/scim+json` + * Add `application/vnd.3gpp.ussd+xml` + * Add `application/vnd.biopax.rdf+xml` + * Add `text/x-processing` + +1.13.0 / 2015-06-07 +=================== + + * Add nginx as a source + * Add `application/x-cocoa` + * Add `application/x-java-archive-diff` + * Add `application/x-makeself` + * Add `application/x-perl` + * Add `application/x-pilot` + * Add `application/x-redhat-package-manager` + * Add `application/x-sea` + * Add `audio/x-m4a` + * Add `audio/x-realaudio` + * Add `image/x-jng` + * Add `text/mathml` + +1.12.0 / 2015-06-05 +=================== + + * Add `application/bdoc` + * Add `application/vnd.hyperdrive+json` + * Add `application/x-bdoc` + * Add extension `.rtf` to `text/rtf` + +1.11.0 / 2015-05-31 +=================== + + * Add `audio/wav` + * Add `audio/wave` + * Add extension `.litcoffee` to `text/coffeescript` + * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` + * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` + +1.10.0 / 2015-05-19 +=================== + + * Add `application/vnd.balsamiq.bmpr` + * Add `application/vnd.microsoft.portable-executable` + * Add `application/x-ns-proxy-autoconfig` + +1.9.1 / 2015-04-19 +================== + + * Remove `.json` extension from `application/manifest+json` + - This is causing bugs downstream + +1.9.0 / 2015-04-19 +================== + + * Add `application/manifest+json` + * Add `application/vnd.micro+json` + * Add `image/vnd.zbrush.pcx` + * Add `image/x-ms-bmp` + +1.8.0 / 2015-03-13 +================== + + * Add `application/vnd.citationstyles.style+xml` + * Add `application/vnd.fastcopy-disk-image` + * Add `application/vnd.gov.sk.xmldatacontainer+xml` + * Add extension `.jsonld` to `application/ld+json` + +1.7.0 / 2015-02-08 +================== + + * Add `application/vnd.gerber` + * Add `application/vnd.msa-disk-image` + +1.6.1 / 2015-02-05 +================== + + * Community extensions ownership transferred from `node-mime` + +1.6.0 / 2015-01-29 +================== + + * Add `application/jose` + * Add `application/jose+json` + * Add `application/json-seq` + * Add `application/jwk+json` + * Add `application/jwk-set+json` + * Add `application/jwt` + * Add `application/rdap+json` + * Add `application/vnd.gov.sk.e-form+xml` + * Add `application/vnd.ims.imsccv1p3` + +1.5.0 / 2014-12-30 +================== + + * Add `application/vnd.oracle.resource+json` + * Fix various invalid MIME type entries + - `application/mbox+xml` + - `application/oscp-response` + - `application/vwg-multiplexed` + - `audio/g721` + +1.4.0 / 2014-12-21 +================== + + * Add `application/vnd.ims.imsccv1p2` + * Fix various invalid MIME type entries + - `application/vnd-acucobol` + - `application/vnd-curl` + - `application/vnd-dart` + - `application/vnd-dxr` + - `application/vnd-fdf` + - `application/vnd-mif` + - `application/vnd-sema` + - `application/vnd-wap-wmlc` + - `application/vnd.adobe.flash-movie` + - `application/vnd.dece-zip` + - `application/vnd.dvb_service` + - `application/vnd.micrografx-igx` + - `application/vnd.sealed-doc` + - `application/vnd.sealed-eml` + - `application/vnd.sealed-mht` + - `application/vnd.sealed-ppt` + - `application/vnd.sealed-tiff` + - `application/vnd.sealed-xls` + - `application/vnd.sealedmedia.softseal-html` + - `application/vnd.sealedmedia.softseal-pdf` + - `application/vnd.wap-slc` + - `application/vnd.wap-wbxml` + - `audio/vnd.sealedmedia.softseal-mpeg` + - `image/vnd-djvu` + - `image/vnd-svf` + - `image/vnd-wap-wbmp` + - `image/vnd.sealed-png` + - `image/vnd.sealedmedia.softseal-gif` + - `image/vnd.sealedmedia.softseal-jpg` + - `model/vnd-dwf` + - `model/vnd.parasolid.transmit-binary` + - `model/vnd.parasolid.transmit-text` + - `text/vnd-a` + - `text/vnd-curl` + - `text/vnd.wap-wml` + * Remove example template MIME types + - `application/example` + - `audio/example` + - `image/example` + - `message/example` + - `model/example` + - `multipart/example` + - `text/example` + - `video/example` + +1.3.1 / 2014-12-16 +================== + + * Fix missing extensions + - `application/json5` + - `text/hjson` + +1.3.0 / 2014-12-07 +================== + + * Add `application/a2l` + * Add `application/aml` + * Add `application/atfx` + * Add `application/atxml` + * Add `application/cdfx+xml` + * Add `application/dii` + * Add `application/json5` + * Add `application/lxf` + * Add `application/mf4` + * Add `application/vnd.apache.thrift.compact` + * Add `application/vnd.apache.thrift.json` + * Add `application/vnd.coffeescript` + * Add `application/vnd.enphase.envoy` + * Add `application/vnd.ims.imsccv1p1` + * Add `text/csv-schema` + * Add `text/hjson` + * Add `text/markdown` + * Add `text/yaml` + +1.2.0 / 2014-11-09 +================== + + * Add `application/cea` + * Add `application/dit` + * Add `application/vnd.gov.sk.e-form+zip` + * Add `application/vnd.tmd.mediaflex.api+xml` + * Type `application/epub+zip` is now IANA-registered + +1.1.2 / 2014-10-23 +================== + + * Rebuild database for `application/x-www-form-urlencoded` change + +1.1.1 / 2014-10-20 +================== + + * Mark `application/x-www-form-urlencoded` as compressible. + +1.1.0 / 2014-09-28 +================== + + * Add `application/font-woff2` + +1.0.3 / 2014-09-25 +================== + + * Fix engine requirement in package + +1.0.2 / 2014-09-25 +================== + + * Add `application/coap-group+json` + * Add `application/dcd` + * Add `application/vnd.apache.thrift.binary` + * Add `image/vnd.tencent.tap` + * Mark all JSON-derived types as compressible + * Update `text/vtt` data + +1.0.1 / 2014-08-30 +================== + + * Fix extension ordering + +1.0.0 / 2014-08-30 +================== + + * Add `application/atf` + * Add `application/merge-patch+json` + * Add `multipart/x-mixed-replace` + * Add `source: 'apache'` metadata + * Add `source: 'iana'` metadata + * Remove badly-assumed charset data diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-db/LICENSE b/node_modules/@nestjs/platform-express/node_modules/mime-db/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0751cb10e94972be9a07b44cc261447bac726a7f --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-db/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-db/README.md b/node_modules/@nestjs/platform-express/node_modules/mime-db/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ee93fa00ab2fbe05ba2ee0fcdc606d9aad12bd52 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-db/README.md @@ -0,0 +1,109 @@ +# mime-db + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +This is a large database of mime types and information about them. +It consists of a single, public JSON file and does not include any logic, +allowing it to remain as un-opinionated as possible with an API. +It aggregates data from the following sources: + +- https://www.iana.org/assignments/media-types/media-types.xhtml +- https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types +- https://hg.nginx.org/nginx/raw-file/default/conf/mime.types + +## Installation + +```bash +npm install mime-db +``` + +### Database Download + +If you intend to use this in a web browser, you can conveniently access the JSON file via [jsDelivr](https://www.jsdelivr.com/), a popular CDN (Content Delivery Network). To ensure stability and compatibility, it is advisable to specify [a release tag](https://github.com/jshttp/mime-db/tags) instead of using the 'master' branch. This is because the JSON file's format might change in future updates, and relying on a specific release tag will prevent potential issues arising from these changes. + +``` +https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json +``` + +## Usage + +```js +var db = require('mime-db') + +// grab data on .js files +var data = db['application/javascript'] +``` + +## Data Structure + +The JSON file is a map lookup for lowercased mime types. +Each mime type has the following properties: + +- `.source` - where the mime type is defined. + If not set, it's probably a custom media type. + - `apache` - [Apache common media types](https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) + - `iana` - [IANA-defined media types](https://www.iana.org/assignments/media-types/media-types.xhtml) + - `nginx` - [nginx media types](https://hg.nginx.org/nginx/raw-file/default/conf/mime.types) +- `.extensions[]` - known extensions associated with this mime type. +- `.compressible` - whether a file of this type can be gzipped. +- `.charset` - the default charset associated with this type, if any. + +If unknown, every property could be `undefined`. + +## Note on MIME Type Data and Semver + +This package considers the programmatic api as the semver compatibility. This means the MIME type resolution is *not* considered +in the semver bumps. This means that if you want to pin your `mime-db` data you will need to do it in your application. While +this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is a breaking change. + +## Contributing + +The primary way to contribute to this database is by updating the data in +one of the upstream sources. The database is updated from the upstreams +periodically and will pull in any changes. + +### Registering Media Types + +The best way to get new media types included in this library is to register +them with the IANA. The community registration procedure is outlined in +[RFC 6838 section 5](https://tools.ietf.org/html/rfc6838#section-5). Types +registered with the IANA are automatically pulled into this library. + +### Direct Inclusion + +If that is not possible / feasible, they can be added directly here as a +"custom" type. To do this, it is required to have a primary source that +definitively lists the media type. If an extension is going to be listed as +associated with this media type, the source must definitively link the +media type and extension as well. + +To edit the database, only make PRs against `src/custom-types.json` or +`src/custom-suffix.json`. + +The `src/custom-types.json` file is a JSON object with the MIME type as the +keys and the values being an object with the following keys: + +- `compressible` - leave out if you don't know, otherwise `true`/`false` to + indicate whether the data represented by the type is typically compressible. +- `extensions` - include an array of file extensions that are associated with + the type. +- `notes` - human-readable notes about the type, typically what the type is. +- `sources` - include an array of URLs of where the MIME type and the associated + extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source); + links to type aggregating sites and Wikipedia are _not acceptable_. + +To update the build, run `npm run build`. + +[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci +[ci-url]: https://github.com/jshttp/mime-db/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master +[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master +[node-image]: https://badgen.net/npm/node/mime-db +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mime-db +[npm-url]: https://npmjs.org/package/mime-db +[npm-version-image]: https://badgen.net/npm/v/mime-db diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-db/db.json b/node_modules/@nestjs/platform-express/node_modules/mime-db/db.json new file mode 100644 index 0000000000000000000000000000000000000000..7e74733026db22005684393bf7a54c895e9f4abe --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-db/db.json @@ -0,0 +1,9342 @@ +{ + "application/1d-interleaved-parityfec": { + "source": "iana" + }, + "application/3gpdash-qoe-report+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/3gpp-ims+xml": { + "source": "iana", + "compressible": true + }, + "application/3gpphal+json": { + "source": "iana", + "compressible": true + }, + "application/3gpphalforms+json": { + "source": "iana", + "compressible": true + }, + "application/a2l": { + "source": "iana" + }, + "application/ace+cbor": { + "source": "iana" + }, + "application/ace+json": { + "source": "iana", + "compressible": true + }, + "application/ace-groupcomm+cbor": { + "source": "iana" + }, + "application/ace-trl+cbor": { + "source": "iana" + }, + "application/activemessage": { + "source": "iana" + }, + "application/activity+json": { + "source": "iana", + "compressible": true + }, + "application/aif+cbor": { + "source": "iana" + }, + "application/aif+json": { + "source": "iana", + "compressible": true + }, + "application/alto-cdni+json": { + "source": "iana", + "compressible": true + }, + "application/alto-cdnifilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-directory+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcost+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcostparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointprop+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointpropparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-error+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-propmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-propmapparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-tips+json": { + "source": "iana", + "compressible": true + }, + "application/alto-tipsparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamcontrol+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamparams+json": { + "source": "iana", + "compressible": true + }, + "application/aml": { + "source": "iana" + }, + "application/andrew-inset": { + "source": "iana", + "extensions": ["ez"] + }, + "application/appinstaller": { + "compressible": false, + "extensions": ["appinstaller"] + }, + "application/applefile": { + "source": "iana" + }, + "application/applixware": { + "source": "apache", + "extensions": ["aw"] + }, + "application/appx": { + "compressible": false, + "extensions": ["appx"] + }, + "application/appxbundle": { + "compressible": false, + "extensions": ["appxbundle"] + }, + "application/at+jwt": { + "source": "iana" + }, + "application/atf": { + "source": "iana" + }, + "application/atfx": { + "source": "iana" + }, + "application/atom+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atom"] + }, + "application/atomcat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomcat"] + }, + "application/atomdeleted+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomdeleted"] + }, + "application/atomicmail": { + "source": "iana" + }, + "application/atomsvc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomsvc"] + }, + "application/atsc-dwd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dwd"] + }, + "application/atsc-dynamic-event-message": { + "source": "iana" + }, + "application/atsc-held+xml": { + "source": "iana", + "compressible": true, + "extensions": ["held"] + }, + "application/atsc-rdt+json": { + "source": "iana", + "compressible": true + }, + "application/atsc-rsat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsat"] + }, + "application/atxml": { + "source": "iana" + }, + "application/auth-policy+xml": { + "source": "iana", + "compressible": true + }, + "application/automationml-aml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["aml"] + }, + "application/automationml-amlx+zip": { + "source": "iana", + "compressible": false, + "extensions": ["amlx"] + }, + "application/bacnet-xdd+zip": { + "source": "iana", + "compressible": false + }, + "application/batch-smtp": { + "source": "iana" + }, + "application/bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/beep+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/bufr": { + "source": "iana" + }, + "application/c2pa": { + "source": "iana" + }, + "application/calendar+json": { + "source": "iana", + "compressible": true + }, + "application/calendar+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xcs"] + }, + "application/call-completion": { + "source": "iana" + }, + "application/cals-1840": { + "source": "iana" + }, + "application/captive+json": { + "source": "iana", + "compressible": true + }, + "application/cbor": { + "source": "iana" + }, + "application/cbor-seq": { + "source": "iana" + }, + "application/cccex": { + "source": "iana" + }, + "application/ccmp+xml": { + "source": "iana", + "compressible": true + }, + "application/ccxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ccxml"] + }, + "application/cda+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/cdfx+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cdfx"] + }, + "application/cdmi-capability": { + "source": "iana", + "extensions": ["cdmia"] + }, + "application/cdmi-container": { + "source": "iana", + "extensions": ["cdmic"] + }, + "application/cdmi-domain": { + "source": "iana", + "extensions": ["cdmid"] + }, + "application/cdmi-object": { + "source": "iana", + "extensions": ["cdmio"] + }, + "application/cdmi-queue": { + "source": "iana", + "extensions": ["cdmiq"] + }, + "application/cdni": { + "source": "iana" + }, + "application/ce+cbor": { + "source": "iana" + }, + "application/cea": { + "source": "iana" + }, + "application/cea-2018+xml": { + "source": "iana", + "compressible": true + }, + "application/cellml+xml": { + "source": "iana", + "compressible": true + }, + "application/cfw": { + "source": "iana" + }, + "application/cid-edhoc+cbor-seq": { + "source": "iana" + }, + "application/city+json": { + "source": "iana", + "compressible": true + }, + "application/city+json-seq": { + "source": "iana" + }, + "application/clr": { + "source": "iana" + }, + "application/clue+xml": { + "source": "iana", + "compressible": true + }, + "application/clue_info+xml": { + "source": "iana", + "compressible": true + }, + "application/cms": { + "source": "iana" + }, + "application/cnrp+xml": { + "source": "iana", + "compressible": true + }, + "application/coap-eap": { + "source": "iana" + }, + "application/coap-group+json": { + "source": "iana", + "compressible": true + }, + "application/coap-payload": { + "source": "iana" + }, + "application/commonground": { + "source": "iana" + }, + "application/concise-problem-details+cbor": { + "source": "iana" + }, + "application/conference-info+xml": { + "source": "iana", + "compressible": true + }, + "application/cose": { + "source": "iana" + }, + "application/cose-key": { + "source": "iana" + }, + "application/cose-key-set": { + "source": "iana" + }, + "application/cose-x509": { + "source": "iana" + }, + "application/cpl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cpl"] + }, + "application/csrattrs": { + "source": "iana" + }, + "application/csta+xml": { + "source": "iana", + "compressible": true + }, + "application/cstadata+xml": { + "source": "iana", + "compressible": true + }, + "application/csvm+json": { + "source": "iana", + "compressible": true + }, + "application/cu-seeme": { + "source": "apache", + "extensions": ["cu"] + }, + "application/cwl": { + "source": "iana", + "extensions": ["cwl"] + }, + "application/cwl+json": { + "source": "iana", + "compressible": true + }, + "application/cwl+yaml": { + "source": "iana" + }, + "application/cwt": { + "source": "iana" + }, + "application/cybercash": { + "source": "iana" + }, + "application/dart": { + "compressible": true + }, + "application/dash+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpd"] + }, + "application/dash-patch+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpp"] + }, + "application/dashdelta": { + "source": "iana" + }, + "application/davmount+xml": { + "source": "iana", + "compressible": true, + "extensions": ["davmount"] + }, + "application/dca-rft": { + "source": "iana" + }, + "application/dcd": { + "source": "iana" + }, + "application/dec-dx": { + "source": "iana" + }, + "application/dialog-info+xml": { + "source": "iana", + "compressible": true + }, + "application/dicom": { + "source": "iana", + "extensions": ["dcm"] + }, + "application/dicom+json": { + "source": "iana", + "compressible": true + }, + "application/dicom+xml": { + "source": "iana", + "compressible": true + }, + "application/dii": { + "source": "iana" + }, + "application/dit": { + "source": "iana" + }, + "application/dns": { + "source": "iana" + }, + "application/dns+json": { + "source": "iana", + "compressible": true + }, + "application/dns-message": { + "source": "iana" + }, + "application/docbook+xml": { + "source": "apache", + "compressible": true, + "extensions": ["dbk"] + }, + "application/dots+cbor": { + "source": "iana" + }, + "application/dpop+jwt": { + "source": "iana" + }, + "application/dskpp+xml": { + "source": "iana", + "compressible": true + }, + "application/dssc+der": { + "source": "iana", + "extensions": ["dssc"] + }, + "application/dssc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdssc"] + }, + "application/dvcs": { + "source": "iana" + }, + "application/eat+cwt": { + "source": "iana" + }, + "application/eat+jwt": { + "source": "iana" + }, + "application/eat-bun+cbor": { + "source": "iana" + }, + "application/eat-bun+json": { + "source": "iana", + "compressible": true + }, + "application/eat-ucs+cbor": { + "source": "iana" + }, + "application/eat-ucs+json": { + "source": "iana", + "compressible": true + }, + "application/ecmascript": { + "source": "apache", + "compressible": true, + "extensions": ["ecma"] + }, + "application/edhoc+cbor-seq": { + "source": "iana" + }, + "application/edi-consent": { + "source": "iana" + }, + "application/edi-x12": { + "source": "iana", + "compressible": false + }, + "application/edifact": { + "source": "iana", + "compressible": false + }, + "application/efi": { + "source": "iana" + }, + "application/elm+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/elm+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.cap+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/emergencycalldata.comment+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.control+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.deviceinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.ecall.msd": { + "source": "iana" + }, + "application/emergencycalldata.legacyesn+json": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.providerinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.serviceinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.subscriberinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.veds+xml": { + "source": "iana", + "compressible": true + }, + "application/emma+xml": { + "source": "iana", + "compressible": true, + "extensions": ["emma"] + }, + "application/emotionml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["emotionml"] + }, + "application/encaprtp": { + "source": "iana" + }, + "application/entity-statement+jwt": { + "source": "iana" + }, + "application/epp+xml": { + "source": "iana", + "compressible": true + }, + "application/epub+zip": { + "source": "iana", + "compressible": false, + "extensions": ["epub"] + }, + "application/eshop": { + "source": "iana" + }, + "application/exi": { + "source": "iana", + "extensions": ["exi"] + }, + "application/expect-ct-report+json": { + "source": "iana", + "compressible": true + }, + "application/express": { + "source": "iana", + "extensions": ["exp"] + }, + "application/fastinfoset": { + "source": "iana" + }, + "application/fastsoap": { + "source": "iana" + }, + "application/fdf": { + "source": "iana", + "extensions": ["fdf"] + }, + "application/fdt+xml": { + "source": "iana", + "compressible": true, + "extensions": ["fdt"] + }, + "application/fhir+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/fhir+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/fido.trusted-apps+json": { + "compressible": true + }, + "application/fits": { + "source": "iana" + }, + "application/flexfec": { + "source": "iana" + }, + "application/font-sfnt": { + "source": "iana" + }, + "application/font-tdpfr": { + "source": "iana", + "extensions": ["pfr"] + }, + "application/font-woff": { + "source": "iana", + "compressible": false + }, + "application/framework-attributes+xml": { + "source": "iana", + "compressible": true + }, + "application/geo+json": { + "source": "iana", + "compressible": true, + "extensions": ["geojson"] + }, + "application/geo+json-seq": { + "source": "iana" + }, + "application/geopackage+sqlite3": { + "source": "iana" + }, + "application/geopose+json": { + "source": "iana", + "compressible": true + }, + "application/geoxacml+json": { + "source": "iana", + "compressible": true + }, + "application/geoxacml+xml": { + "source": "iana", + "compressible": true + }, + "application/gltf-buffer": { + "source": "iana" + }, + "application/gml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["gml"] + }, + "application/gnap-binding-jws": { + "source": "iana" + }, + "application/gnap-binding-jwsd": { + "source": "iana" + }, + "application/gnap-binding-rotation-jws": { + "source": "iana" + }, + "application/gnap-binding-rotation-jwsd": { + "source": "iana" + }, + "application/gpx+xml": { + "source": "apache", + "compressible": true, + "extensions": ["gpx"] + }, + "application/grib": { + "source": "iana" + }, + "application/gxf": { + "source": "apache", + "extensions": ["gxf"] + }, + "application/gzip": { + "source": "iana", + "compressible": false, + "extensions": ["gz"] + }, + "application/h224": { + "source": "iana" + }, + "application/held+xml": { + "source": "iana", + "compressible": true + }, + "application/hjson": { + "extensions": ["hjson"] + }, + "application/hl7v2+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/http": { + "source": "iana" + }, + "application/hyperstudio": { + "source": "iana", + "extensions": ["stk"] + }, + "application/ibe-key-request+xml": { + "source": "iana", + "compressible": true + }, + "application/ibe-pkg-reply+xml": { + "source": "iana", + "compressible": true + }, + "application/ibe-pp-data": { + "source": "iana" + }, + "application/iges": { + "source": "iana" + }, + "application/im-iscomposing+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/index": { + "source": "iana" + }, + "application/index.cmd": { + "source": "iana" + }, + "application/index.obj": { + "source": "iana" + }, + "application/index.response": { + "source": "iana" + }, + "application/index.vnd": { + "source": "iana" + }, + "application/inkml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ink","inkml"] + }, + "application/iotp": { + "source": "iana" + }, + "application/ipfix": { + "source": "iana", + "extensions": ["ipfix"] + }, + "application/ipp": { + "source": "iana" + }, + "application/isup": { + "source": "iana" + }, + "application/its+xml": { + "source": "iana", + "compressible": true, + "extensions": ["its"] + }, + "application/java-archive": { + "source": "iana", + "compressible": false, + "extensions": ["jar","war","ear"] + }, + "application/java-serialized-object": { + "source": "apache", + "compressible": false, + "extensions": ["ser"] + }, + "application/java-vm": { + "source": "apache", + "compressible": false, + "extensions": ["class"] + }, + "application/javascript": { + "source": "apache", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js"] + }, + "application/jf2feed+json": { + "source": "iana", + "compressible": true + }, + "application/jose": { + "source": "iana" + }, + "application/jose+json": { + "source": "iana", + "compressible": true + }, + "application/jrd+json": { + "source": "iana", + "compressible": true + }, + "application/jscalendar+json": { + "source": "iana", + "compressible": true + }, + "application/jscontact+json": { + "source": "iana", + "compressible": true + }, + "application/json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["json","map"] + }, + "application/json-patch+json": { + "source": "iana", + "compressible": true + }, + "application/json-seq": { + "source": "iana" + }, + "application/json5": { + "extensions": ["json5"] + }, + "application/jsonml+json": { + "source": "apache", + "compressible": true, + "extensions": ["jsonml"] + }, + "application/jsonpath": { + "source": "iana" + }, + "application/jwk+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+jwt": { + "source": "iana" + }, + "application/jwt": { + "source": "iana" + }, + "application/kpml-request+xml": { + "source": "iana", + "compressible": true + }, + "application/kpml-response+xml": { + "source": "iana", + "compressible": true + }, + "application/ld+json": { + "source": "iana", + "compressible": true, + "extensions": ["jsonld"] + }, + "application/lgr+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lgr"] + }, + "application/link-format": { + "source": "iana" + }, + "application/linkset": { + "source": "iana" + }, + "application/linkset+json": { + "source": "iana", + "compressible": true + }, + "application/load-control+xml": { + "source": "iana", + "compressible": true + }, + "application/logout+jwt": { + "source": "iana" + }, + "application/lost+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lostxml"] + }, + "application/lostsync+xml": { + "source": "iana", + "compressible": true + }, + "application/lpf+zip": { + "source": "iana", + "compressible": false + }, + "application/lxf": { + "source": "iana" + }, + "application/mac-binhex40": { + "source": "iana", + "extensions": ["hqx"] + }, + "application/mac-compactpro": { + "source": "apache", + "extensions": ["cpt"] + }, + "application/macwriteii": { + "source": "iana" + }, + "application/mads+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mads"] + }, + "application/manifest+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["webmanifest"] + }, + "application/marc": { + "source": "iana", + "extensions": ["mrc"] + }, + "application/marcxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mrcx"] + }, + "application/mathematica": { + "source": "iana", + "extensions": ["ma","nb","mb"] + }, + "application/mathml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mathml"] + }, + "application/mathml-content+xml": { + "source": "iana", + "compressible": true + }, + "application/mathml-presentation+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-associated-procedure-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-deregister+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-envelope+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-msk+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-msk-response+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-protection-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-reception-report+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-register+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-register-response+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-schedule+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-user-service-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbox": { + "source": "iana", + "extensions": ["mbox"] + }, + "application/media-policy-dataset+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpf"] + }, + "application/media_control+xml": { + "source": "iana", + "compressible": true + }, + "application/mediaservercontrol+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mscml"] + }, + "application/merge-patch+json": { + "source": "iana", + "compressible": true + }, + "application/metalink+xml": { + "source": "apache", + "compressible": true, + "extensions": ["metalink"] + }, + "application/metalink4+xml": { + "source": "iana", + "compressible": true, + "extensions": ["meta4"] + }, + "application/mets+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mets"] + }, + "application/mf4": { + "source": "iana" + }, + "application/mikey": { + "source": "iana" + }, + "application/mipc": { + "source": "iana" + }, + "application/missing-blocks+cbor-seq": { + "source": "iana" + }, + "application/mmt-aei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["maei"] + }, + "application/mmt-usd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["musd"] + }, + "application/mods+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mods"] + }, + "application/moss-keys": { + "source": "iana" + }, + "application/moss-signature": { + "source": "iana" + }, + "application/mosskey-data": { + "source": "iana" + }, + "application/mosskey-request": { + "source": "iana" + }, + "application/mp21": { + "source": "iana", + "extensions": ["m21","mp21"] + }, + "application/mp4": { + "source": "iana", + "extensions": ["mp4","mpg4","mp4s","m4p"] + }, + "application/mpeg4-generic": { + "source": "iana" + }, + "application/mpeg4-iod": { + "source": "iana" + }, + "application/mpeg4-iod-xmt": { + "source": "iana" + }, + "application/mrb-consumer+xml": { + "source": "iana", + "compressible": true + }, + "application/mrb-publish+xml": { + "source": "iana", + "compressible": true + }, + "application/msc-ivr+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/msc-mixer+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/msix": { + "compressible": false, + "extensions": ["msix"] + }, + "application/msixbundle": { + "compressible": false, + "extensions": ["msixbundle"] + }, + "application/msword": { + "source": "iana", + "compressible": false, + "extensions": ["doc","dot"] + }, + "application/mud+json": { + "source": "iana", + "compressible": true + }, + "application/multipart-core": { + "source": "iana" + }, + "application/mxf": { + "source": "iana", + "extensions": ["mxf"] + }, + "application/n-quads": { + "source": "iana", + "extensions": ["nq"] + }, + "application/n-triples": { + "source": "iana", + "extensions": ["nt"] + }, + "application/nasdata": { + "source": "iana" + }, + "application/news-checkgroups": { + "source": "iana", + "charset": "US-ASCII" + }, + "application/news-groupinfo": { + "source": "iana", + "charset": "US-ASCII" + }, + "application/news-transmission": { + "source": "iana" + }, + "application/nlsml+xml": { + "source": "iana", + "compressible": true + }, + "application/node": { + "source": "iana", + "extensions": ["cjs"] + }, + "application/nss": { + "source": "iana" + }, + "application/oauth-authz-req+jwt": { + "source": "iana" + }, + "application/oblivious-dns-message": { + "source": "iana" + }, + "application/ocsp-request": { + "source": "iana" + }, + "application/ocsp-response": { + "source": "iana" + }, + "application/octet-stream": { + "source": "iana", + "compressible": true, + "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] + }, + "application/oda": { + "source": "iana", + "extensions": ["oda"] + }, + "application/odm+xml": { + "source": "iana", + "compressible": true + }, + "application/odx": { + "source": "iana" + }, + "application/oebps-package+xml": { + "source": "iana", + "compressible": true, + "extensions": ["opf"] + }, + "application/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogx"] + }, + "application/ohttp-keys": { + "source": "iana" + }, + "application/omdoc+xml": { + "source": "apache", + "compressible": true, + "extensions": ["omdoc"] + }, + "application/onenote": { + "source": "apache", + "extensions": ["onetoc","onetoc2","onetmp","onepkg","one","onea"] + }, + "application/opc-nodeset+xml": { + "source": "iana", + "compressible": true + }, + "application/oscore": { + "source": "iana" + }, + "application/oxps": { + "source": "iana", + "extensions": ["oxps"] + }, + "application/p21": { + "source": "iana" + }, + "application/p21+zip": { + "source": "iana", + "compressible": false + }, + "application/p2p-overlay+xml": { + "source": "iana", + "compressible": true, + "extensions": ["relo"] + }, + "application/parityfec": { + "source": "iana" + }, + "application/passport": { + "source": "iana" + }, + "application/patch-ops-error+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xer"] + }, + "application/pdf": { + "source": "iana", + "compressible": false, + "extensions": ["pdf"] + }, + "application/pdx": { + "source": "iana" + }, + "application/pem-certificate-chain": { + "source": "iana" + }, + "application/pgp-encrypted": { + "source": "iana", + "compressible": false, + "extensions": ["pgp"] + }, + "application/pgp-keys": { + "source": "iana", + "extensions": ["asc"] + }, + "application/pgp-signature": { + "source": "iana", + "extensions": ["sig","asc"] + }, + "application/pics-rules": { + "source": "apache", + "extensions": ["prf"] + }, + "application/pidf+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/pidf-diff+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/pkcs10": { + "source": "iana", + "extensions": ["p10"] + }, + "application/pkcs12": { + "source": "iana" + }, + "application/pkcs7-mime": { + "source": "iana", + "extensions": ["p7m","p7c"] + }, + "application/pkcs7-signature": { + "source": "iana", + "extensions": ["p7s"] + }, + "application/pkcs8": { + "source": "iana", + "extensions": ["p8"] + }, + "application/pkcs8-encrypted": { + "source": "iana" + }, + "application/pkix-attr-cert": { + "source": "iana", + "extensions": ["ac"] + }, + "application/pkix-cert": { + "source": "iana", + "extensions": ["cer"] + }, + "application/pkix-crl": { + "source": "iana", + "extensions": ["crl"] + }, + "application/pkix-pkipath": { + "source": "iana", + "extensions": ["pkipath"] + }, + "application/pkixcmp": { + "source": "iana", + "extensions": ["pki"] + }, + "application/pls+xml": { + "source": "iana", + "compressible": true, + "extensions": ["pls"] + }, + "application/poc-settings+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/postscript": { + "source": "iana", + "compressible": true, + "extensions": ["ai","eps","ps"] + }, + "application/ppsp-tracker+json": { + "source": "iana", + "compressible": true + }, + "application/private-token-issuer-directory": { + "source": "iana" + }, + "application/private-token-request": { + "source": "iana" + }, + "application/private-token-response": { + "source": "iana" + }, + "application/problem+json": { + "source": "iana", + "compressible": true + }, + "application/problem+xml": { + "source": "iana", + "compressible": true + }, + "application/provenance+xml": { + "source": "iana", + "compressible": true, + "extensions": ["provx"] + }, + "application/provided-claims+jwt": { + "source": "iana" + }, + "application/prs.alvestrand.titrax-sheet": { + "source": "iana" + }, + "application/prs.cww": { + "source": "iana", + "extensions": ["cww"] + }, + "application/prs.cyn": { + "source": "iana", + "charset": "7-BIT" + }, + "application/prs.hpub+zip": { + "source": "iana", + "compressible": false + }, + "application/prs.implied-document+xml": { + "source": "iana", + "compressible": true + }, + "application/prs.implied-executable": { + "source": "iana" + }, + "application/prs.implied-object+json": { + "source": "iana", + "compressible": true + }, + "application/prs.implied-object+json-seq": { + "source": "iana" + }, + "application/prs.implied-object+yaml": { + "source": "iana" + }, + "application/prs.implied-structure": { + "source": "iana" + }, + "application/prs.mayfile": { + "source": "iana" + }, + "application/prs.nprend": { + "source": "iana" + }, + "application/prs.plucker": { + "source": "iana" + }, + "application/prs.rdf-xml-crypt": { + "source": "iana" + }, + "application/prs.vcfbzip2": { + "source": "iana" + }, + "application/prs.xsf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xsf"] + }, + "application/pskc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["pskcxml"] + }, + "application/pvd+json": { + "source": "iana", + "compressible": true + }, + "application/qsig": { + "source": "iana" + }, + "application/raml+yaml": { + "compressible": true, + "extensions": ["raml"] + }, + "application/raptorfec": { + "source": "iana" + }, + "application/rdap+json": { + "source": "iana", + "compressible": true + }, + "application/rdf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rdf","owl"] + }, + "application/reginfo+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rif"] + }, + "application/relax-ng-compact-syntax": { + "source": "iana", + "extensions": ["rnc"] + }, + "application/remote-printing": { + "source": "apache" + }, + "application/reputon+json": { + "source": "iana", + "compressible": true + }, + "application/resolve-response+jwt": { + "source": "iana" + }, + "application/resource-lists+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rl"] + }, + "application/resource-lists-diff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rld"] + }, + "application/rfc+xml": { + "source": "iana", + "compressible": true + }, + "application/riscos": { + "source": "iana" + }, + "application/rlmi+xml": { + "source": "iana", + "compressible": true + }, + "application/rls-services+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rs"] + }, + "application/route-apd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rapd"] + }, + "application/route-s-tsid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sls"] + }, + "application/route-usd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rusd"] + }, + "application/rpki-checklist": { + "source": "iana" + }, + "application/rpki-ghostbusters": { + "source": "iana", + "extensions": ["gbr"] + }, + "application/rpki-manifest": { + "source": "iana", + "extensions": ["mft"] + }, + "application/rpki-publication": { + "source": "iana" + }, + "application/rpki-roa": { + "source": "iana", + "extensions": ["roa"] + }, + "application/rpki-signed-tal": { + "source": "iana" + }, + "application/rpki-updown": { + "source": "iana" + }, + "application/rsd+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rsd"] + }, + "application/rss+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rss"] + }, + "application/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "application/rtploopback": { + "source": "iana" + }, + "application/rtx": { + "source": "iana" + }, + "application/samlassertion+xml": { + "source": "iana", + "compressible": true + }, + "application/samlmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/sarif+json": { + "source": "iana", + "compressible": true + }, + "application/sarif-external-properties+json": { + "source": "iana", + "compressible": true + }, + "application/sbe": { + "source": "iana" + }, + "application/sbml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sbml"] + }, + "application/scaip+xml": { + "source": "iana", + "compressible": true + }, + "application/scim+json": { + "source": "iana", + "compressible": true + }, + "application/scvp-cv-request": { + "source": "iana", + "extensions": ["scq"] + }, + "application/scvp-cv-response": { + "source": "iana", + "extensions": ["scs"] + }, + "application/scvp-vp-request": { + "source": "iana", + "extensions": ["spq"] + }, + "application/scvp-vp-response": { + "source": "iana", + "extensions": ["spp"] + }, + "application/sdp": { + "source": "iana", + "extensions": ["sdp"] + }, + "application/secevent+jwt": { + "source": "iana" + }, + "application/senml+cbor": { + "source": "iana" + }, + "application/senml+json": { + "source": "iana", + "compressible": true + }, + "application/senml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["senmlx"] + }, + "application/senml-etch+cbor": { + "source": "iana" + }, + "application/senml-etch+json": { + "source": "iana", + "compressible": true + }, + "application/senml-exi": { + "source": "iana" + }, + "application/sensml+cbor": { + "source": "iana" + }, + "application/sensml+json": { + "source": "iana", + "compressible": true + }, + "application/sensml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sensmlx"] + }, + "application/sensml-exi": { + "source": "iana" + }, + "application/sep+xml": { + "source": "iana", + "compressible": true + }, + "application/sep-exi": { + "source": "iana" + }, + "application/session-info": { + "source": "iana" + }, + "application/set-payment": { + "source": "iana" + }, + "application/set-payment-initiation": { + "source": "iana", + "extensions": ["setpay"] + }, + "application/set-registration": { + "source": "iana" + }, + "application/set-registration-initiation": { + "source": "iana", + "extensions": ["setreg"] + }, + "application/sgml": { + "source": "iana" + }, + "application/sgml-open-catalog": { + "source": "iana" + }, + "application/shf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["shf"] + }, + "application/sieve": { + "source": "iana", + "extensions": ["siv","sieve"] + }, + "application/simple-filter+xml": { + "source": "iana", + "compressible": true + }, + "application/simple-message-summary": { + "source": "iana" + }, + "application/simplesymbolcontainer": { + "source": "iana" + }, + "application/sipc": { + "source": "iana" + }, + "application/slate": { + "source": "iana" + }, + "application/smil": { + "source": "apache" + }, + "application/smil+xml": { + "source": "iana", + "compressible": true, + "extensions": ["smi","smil"] + }, + "application/smpte336m": { + "source": "iana" + }, + "application/soap+fastinfoset": { + "source": "iana" + }, + "application/soap+xml": { + "source": "iana", + "compressible": true + }, + "application/sparql-query": { + "source": "iana", + "extensions": ["rq"] + }, + "application/sparql-results+xml": { + "source": "iana", + "compressible": true, + "extensions": ["srx"] + }, + "application/spdx+json": { + "source": "iana", + "compressible": true + }, + "application/spirits-event+xml": { + "source": "iana", + "compressible": true + }, + "application/sql": { + "source": "iana", + "extensions": ["sql"] + }, + "application/srgs": { + "source": "iana", + "extensions": ["gram"] + }, + "application/srgs+xml": { + "source": "iana", + "compressible": true, + "extensions": ["grxml"] + }, + "application/sru+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sru"] + }, + "application/ssdl+xml": { + "source": "apache", + "compressible": true, + "extensions": ["ssdl"] + }, + "application/sslkeylogfile": { + "source": "iana" + }, + "application/ssml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ssml"] + }, + "application/st2110-41": { + "source": "iana" + }, + "application/stix+json": { + "source": "iana", + "compressible": true + }, + "application/stratum": { + "source": "iana" + }, + "application/swid+cbor": { + "source": "iana" + }, + "application/swid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["swidtag"] + }, + "application/tamp-apex-update": { + "source": "iana" + }, + "application/tamp-apex-update-confirm": { + "source": "iana" + }, + "application/tamp-community-update": { + "source": "iana" + }, + "application/tamp-community-update-confirm": { + "source": "iana" + }, + "application/tamp-error": { + "source": "iana" + }, + "application/tamp-sequence-adjust": { + "source": "iana" + }, + "application/tamp-sequence-adjust-confirm": { + "source": "iana" + }, + "application/tamp-status-query": { + "source": "iana" + }, + "application/tamp-status-response": { + "source": "iana" + }, + "application/tamp-update": { + "source": "iana" + }, + "application/tamp-update-confirm": { + "source": "iana" + }, + "application/tar": { + "compressible": true + }, + "application/taxii+json": { + "source": "iana", + "compressible": true + }, + "application/td+json": { + "source": "iana", + "compressible": true + }, + "application/tei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["tei","teicorpus"] + }, + "application/tetra_isi": { + "source": "iana" + }, + "application/thraud+xml": { + "source": "iana", + "compressible": true, + "extensions": ["tfi"] + }, + "application/timestamp-query": { + "source": "iana" + }, + "application/timestamp-reply": { + "source": "iana" + }, + "application/timestamped-data": { + "source": "iana", + "extensions": ["tsd"] + }, + "application/tlsrpt+gzip": { + "source": "iana" + }, + "application/tlsrpt+json": { + "source": "iana", + "compressible": true + }, + "application/tm+json": { + "source": "iana", + "compressible": true + }, + "application/tnauthlist": { + "source": "iana" + }, + "application/toc+cbor": { + "source": "iana" + }, + "application/token-introspection+jwt": { + "source": "iana" + }, + "application/toml": { + "source": "iana", + "compressible": true, + "extensions": ["toml"] + }, + "application/trickle-ice-sdpfrag": { + "source": "iana" + }, + "application/trig": { + "source": "iana", + "extensions": ["trig"] + }, + "application/trust-chain+json": { + "source": "iana", + "compressible": true + }, + "application/trust-mark+jwt": { + "source": "iana" + }, + "application/trust-mark-delegation+jwt": { + "source": "iana" + }, + "application/ttml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ttml"] + }, + "application/tve-trigger": { + "source": "iana" + }, + "application/tzif": { + "source": "iana" + }, + "application/tzif-leap": { + "source": "iana" + }, + "application/ubjson": { + "compressible": false, + "extensions": ["ubj"] + }, + "application/uccs+cbor": { + "source": "iana" + }, + "application/ujcs+json": { + "source": "iana", + "compressible": true + }, + "application/ulpfec": { + "source": "iana" + }, + "application/urc-grpsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/urc-ressheet+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsheet"] + }, + "application/urc-targetdesc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["td"] + }, + "application/urc-uisocketdesc+xml": { + "source": "iana", + "compressible": true + }, + "application/vc": { + "source": "iana" + }, + "application/vc+cose": { + "source": "iana" + }, + "application/vc+jwt": { + "source": "iana" + }, + "application/vcard+json": { + "source": "iana", + "compressible": true + }, + "application/vcard+xml": { + "source": "iana", + "compressible": true + }, + "application/vemmi": { + "source": "iana" + }, + "application/vividence.scriptfile": { + "source": "apache" + }, + "application/vnd.1000minds.decision-model+xml": { + "source": "iana", + "compressible": true, + "extensions": ["1km"] + }, + "application/vnd.1ob": { + "source": "iana" + }, + "application/vnd.3gpp-prose+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3a+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3ach+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3ch+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc8+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-v2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.5gnas": { + "source": "iana" + }, + "application/vnd.3gpp.5gsa2x": { + "source": "iana" + }, + "application/vnd.3gpp.5gsa2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.5gsv2x": { + "source": "iana" + }, + "application/vnd.3gpp.5gsv2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.access-transfer-events+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.bsf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.crs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.current-location-discovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.gmop+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.gtpc": { + "source": "iana" + }, + "application/vnd.3gpp.interworking-data": { + "source": "iana" + }, + "application/vnd.3gpp.lpp": { + "source": "iana" + }, + "application/vnd.3gpp.mc-signalling-ear": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-payload": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-signalling": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-floor-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-signed+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-init-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-regroup+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-transmission-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mid-call+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.ngap": { + "source": "iana" + }, + "application/vnd.3gpp.pfcp": { + "source": "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + "source": "iana", + "extensions": ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + "source": "iana", + "extensions": ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + "source": "iana", + "extensions": ["pvb"] + }, + "application/vnd.3gpp.pinapp-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.s1ap": { + "source": "iana" + }, + "application/vnd.3gpp.seal-group-doc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-network-qos-management-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-ue-config-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-unicast-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.seal-user-profile-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.sms": { + "source": "iana" + }, + "application/vnd.3gpp.sms+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.srvcc-ext+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.srvcc-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.state-and-event-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.ussd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.v2x": { + "source": "iana" + }, + "application/vnd.3gpp.vae-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp2.sms": { + "source": "iana" + }, + "application/vnd.3gpp2.tcap": { + "source": "iana", + "extensions": ["tcap"] + }, + "application/vnd.3lightssoftware.imagescal": { + "source": "iana" + }, + "application/vnd.3m.post-it-notes": { + "source": "iana", + "extensions": ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + "source": "iana", + "extensions": ["aso"] + }, + "application/vnd.accpac.simply.imp": { + "source": "iana", + "extensions": ["imp"] + }, + "application/vnd.acm.addressxfer+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.acm.chatbot+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.acucobol": { + "source": "iana", + "extensions": ["acu"] + }, + "application/vnd.acucorp": { + "source": "iana", + "extensions": ["atc","acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + "source": "apache", + "compressible": false, + "extensions": ["air"] + }, + "application/vnd.adobe.flash.movie": { + "source": "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + "source": "iana", + "extensions": ["fcdt"] + }, + "application/vnd.adobe.fxp": { + "source": "iana", + "extensions": ["fxp","fxpl"] + }, + "application/vnd.adobe.partial-upload": { + "source": "iana" + }, + "application/vnd.adobe.xdp+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdp"] + }, + "application/vnd.adobe.xfdf": { + "source": "apache", + "extensions": ["xfdf"] + }, + "application/vnd.aether.imp": { + "source": "iana" + }, + "application/vnd.afpc.afplinedata": { + "source": "iana" + }, + "application/vnd.afpc.afplinedata-pagedef": { + "source": "iana" + }, + "application/vnd.afpc.cmoca-cmresource": { + "source": "iana" + }, + "application/vnd.afpc.foca-charset": { + "source": "iana" + }, + "application/vnd.afpc.foca-codedfont": { + "source": "iana" + }, + "application/vnd.afpc.foca-codepage": { + "source": "iana" + }, + "application/vnd.afpc.modca": { + "source": "iana" + }, + "application/vnd.afpc.modca-cmtable": { + "source": "iana" + }, + "application/vnd.afpc.modca-formdef": { + "source": "iana" + }, + "application/vnd.afpc.modca-mediummap": { + "source": "iana" + }, + "application/vnd.afpc.modca-objectcontainer": { + "source": "iana" + }, + "application/vnd.afpc.modca-overlay": { + "source": "iana" + }, + "application/vnd.afpc.modca-pagesegment": { + "source": "iana" + }, + "application/vnd.age": { + "source": "iana", + "extensions": ["age"] + }, + "application/vnd.ah-barcode": { + "source": "apache" + }, + "application/vnd.ahead.space": { + "source": "iana", + "extensions": ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + "source": "iana", + "extensions": ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + "source": "iana", + "extensions": ["azs"] + }, + "application/vnd.amadeus+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.amazon.ebook": { + "source": "apache", + "extensions": ["azw"] + }, + "application/vnd.amazon.mobi8-ebook": { + "source": "iana" + }, + "application/vnd.americandynamics.acc": { + "source": "iana", + "extensions": ["acc"] + }, + "application/vnd.amiga.ami": { + "source": "iana", + "extensions": ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.android.ota": { + "source": "iana" + }, + "application/vnd.android.package-archive": { + "source": "apache", + "compressible": false, + "extensions": ["apk"] + }, + "application/vnd.anki": { + "source": "iana" + }, + "application/vnd.anser-web-certificate-issue-initiation": { + "source": "iana", + "extensions": ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + "source": "apache", + "extensions": ["fti"] + }, + "application/vnd.antix.game-component": { + "source": "iana", + "extensions": ["atx"] + }, + "application/vnd.apache.arrow.file": { + "source": "iana" + }, + "application/vnd.apache.arrow.stream": { + "source": "iana" + }, + "application/vnd.apache.parquet": { + "source": "iana" + }, + "application/vnd.apache.thrift.binary": { + "source": "iana" + }, + "application/vnd.apache.thrift.compact": { + "source": "iana" + }, + "application/vnd.apache.thrift.json": { + "source": "iana" + }, + "application/vnd.apexlang": { + "source": "iana" + }, + "application/vnd.api+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.aplextor.warrp+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apothekende.reservation+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apple.installer+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpkg"] + }, + "application/vnd.apple.keynote": { + "source": "iana", + "extensions": ["key"] + }, + "application/vnd.apple.mpegurl": { + "source": "iana", + "extensions": ["m3u8"] + }, + "application/vnd.apple.numbers": { + "source": "iana", + "extensions": ["numbers"] + }, + "application/vnd.apple.pages": { + "source": "iana", + "extensions": ["pages"] + }, + "application/vnd.apple.pkpass": { + "compressible": false, + "extensions": ["pkpass"] + }, + "application/vnd.arastra.swi": { + "source": "apache" + }, + "application/vnd.aristanetworks.swi": { + "source": "iana", + "extensions": ["swi"] + }, + "application/vnd.artisan+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.artsquare": { + "source": "iana" + }, + "application/vnd.astraea-software.iota": { + "source": "iana", + "extensions": ["iota"] + }, + "application/vnd.audiograph": { + "source": "iana", + "extensions": ["aep"] + }, + "application/vnd.autodesk.fbx": { + "extensions": ["fbx"] + }, + "application/vnd.autopackage": { + "source": "iana" + }, + "application/vnd.avalon+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.avistar+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.balsamiq.bmml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["bmml"] + }, + "application/vnd.balsamiq.bmpr": { + "source": "iana" + }, + "application/vnd.banana-accounting": { + "source": "iana" + }, + "application/vnd.bbf.usp.error": { + "source": "iana" + }, + "application/vnd.bbf.usp.msg": { + "source": "iana" + }, + "application/vnd.bbf.usp.msg+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.bekitzur-stech+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.belightsoft.lhzd+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.belightsoft.lhzl+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.bint.med-content": { + "source": "iana" + }, + "application/vnd.biopax.rdf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.blink-idb-value-wrapper": { + "source": "iana" + }, + "application/vnd.blueice.multipass": { + "source": "iana", + "extensions": ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + "source": "iana" + }, + "application/vnd.bluetooth.le.oob": { + "source": "iana" + }, + "application/vnd.bmi": { + "source": "iana", + "extensions": ["bmi"] + }, + "application/vnd.bpf": { + "source": "iana" + }, + "application/vnd.bpf3": { + "source": "iana" + }, + "application/vnd.businessobjects": { + "source": "iana", + "extensions": ["rep"] + }, + "application/vnd.byu.uapi+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.bzip3": { + "source": "iana" + }, + "application/vnd.c3voc.schedule+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cab-jscript": { + "source": "iana" + }, + "application/vnd.canon-cpdl": { + "source": "iana" + }, + "application/vnd.canon-lips": { + "source": "iana" + }, + "application/vnd.capasystems-pg+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cendio.thinlinc.clientconf": { + "source": "iana" + }, + "application/vnd.century-systems.tcp_stream": { + "source": "iana" + }, + "application/vnd.chemdraw+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cdxml"] + }, + "application/vnd.chess-pgn": { + "source": "iana" + }, + "application/vnd.chipnuts.karaoke-mmd": { + "source": "iana", + "extensions": ["mmd"] + }, + "application/vnd.ciedi": { + "source": "iana" + }, + "application/vnd.cinderella": { + "source": "iana", + "extensions": ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + "source": "iana" + }, + "application/vnd.citationstyles.style+xml": { + "source": "iana", + "compressible": true, + "extensions": ["csl"] + }, + "application/vnd.claymore": { + "source": "iana", + "extensions": ["cla"] + }, + "application/vnd.cloanto.rp9": { + "source": "iana", + "extensions": ["rp9"] + }, + "application/vnd.clonk.c4group": { + "source": "iana", + "extensions": ["c4g","c4d","c4f","c4p","c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + "source": "iana", + "extensions": ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + "source": "iana", + "extensions": ["c11amz"] + }, + "application/vnd.cncf.helm.chart.content.v1.tar+gzip": { + "source": "iana" + }, + "application/vnd.cncf.helm.chart.provenance.v1.prov": { + "source": "iana" + }, + "application/vnd.cncf.helm.config.v1+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.coffeescript": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.document": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.document-template": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.presentation": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.presentation-template": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet-template": { + "source": "iana" + }, + "application/vnd.collection+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.doc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.next+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.comicbook+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.comicbook-rar": { + "source": "iana" + }, + "application/vnd.commerce-battelle": { + "source": "iana" + }, + "application/vnd.commonspace": { + "source": "iana", + "extensions": ["csp"] + }, + "application/vnd.contact.cmsg": { + "source": "iana", + "extensions": ["cdbcmsg"] + }, + "application/vnd.coreos.ignition+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cosmocaller": { + "source": "iana", + "extensions": ["cmc"] + }, + "application/vnd.crick.clicker": { + "source": "iana", + "extensions": ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + "source": "iana", + "extensions": ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + "source": "iana", + "extensions": ["clkp"] + }, + "application/vnd.crick.clicker.template": { + "source": "iana", + "extensions": ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + "source": "iana", + "extensions": ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wbs"] + }, + "application/vnd.cryptii.pipe+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.crypto-shade-file": { + "source": "iana" + }, + "application/vnd.cryptomator.encrypted": { + "source": "iana" + }, + "application/vnd.cryptomator.vault": { + "source": "iana" + }, + "application/vnd.ctc-posml": { + "source": "iana", + "extensions": ["pml"] + }, + "application/vnd.ctct.ws+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cups-pdf": { + "source": "iana" + }, + "application/vnd.cups-postscript": { + "source": "iana" + }, + "application/vnd.cups-ppd": { + "source": "iana", + "extensions": ["ppd"] + }, + "application/vnd.cups-raster": { + "source": "iana" + }, + "application/vnd.cups-raw": { + "source": "iana" + }, + "application/vnd.curl": { + "source": "iana" + }, + "application/vnd.curl.car": { + "source": "apache", + "extensions": ["car"] + }, + "application/vnd.curl.pcurl": { + "source": "apache", + "extensions": ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cybank": { + "source": "iana" + }, + "application/vnd.cyclonedx+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cyclonedx+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.d2l.coursepackage1p0+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.d3m-dataset": { + "source": "iana" + }, + "application/vnd.d3m-problem": { + "source": "iana" + }, + "application/vnd.dart": { + "source": "iana", + "compressible": true, + "extensions": ["dart"] + }, + "application/vnd.data-vision.rdz": { + "source": "iana", + "extensions": ["rdz"] + }, + "application/vnd.datalog": { + "source": "iana" + }, + "application/vnd.datapackage+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dataresource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dbf": { + "source": "iana", + "extensions": ["dbf"] + }, + "application/vnd.dcmp+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dcmp"] + }, + "application/vnd.debian.binary-package": { + "source": "iana" + }, + "application/vnd.dece.data": { + "source": "iana", + "extensions": ["uvf","uvvf","uvd","uvvd"] + }, + "application/vnd.dece.ttml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["uvt","uvvt"] + }, + "application/vnd.dece.unspecified": { + "source": "iana", + "extensions": ["uvx","uvvx"] + }, + "application/vnd.dece.zip": { + "source": "iana", + "extensions": ["uvz","uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + "source": "iana", + "extensions": ["fe_launch"] + }, + "application/vnd.desmume.movie": { + "source": "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + "source": "iana" + }, + "application/vnd.dm.delegation+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dna": { + "source": "iana", + "extensions": ["dna"] + }, + "application/vnd.document+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dolby.mlp": { + "source": "apache", + "extensions": ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + "source": "iana" + }, + "application/vnd.dolby.mobile.2": { + "source": "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + "source": "iana" + }, + "application/vnd.dpgraph": { + "source": "iana", + "extensions": ["dpg"] + }, + "application/vnd.dreamfactory": { + "source": "iana", + "extensions": ["dfac"] + }, + "application/vnd.drive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ds-keypoint": { + "source": "apache", + "extensions": ["kpxx"] + }, + "application/vnd.dtg.local": { + "source": "iana" + }, + "application/vnd.dtg.local.flash": { + "source": "iana" + }, + "application/vnd.dtg.local.html": { + "source": "iana" + }, + "application/vnd.dvb.ait": { + "source": "iana", + "extensions": ["ait"] + }, + "application/vnd.dvb.dvbisl+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.dvbj": { + "source": "iana" + }, + "application/vnd.dvb.esgcontainer": { + "source": "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + "source": "iana" + }, + "application/vnd.dvb.ipdcroaming": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + "source": "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-container+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-generic+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-init+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.pfr": { + "source": "iana" + }, + "application/vnd.dvb.service": { + "source": "iana", + "extensions": ["svc"] + }, + "application/vnd.dxr": { + "source": "iana" + }, + "application/vnd.dynageo": { + "source": "iana", + "extensions": ["geo"] + }, + "application/vnd.dzr": { + "source": "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + "source": "iana" + }, + "application/vnd.ecdis-update": { + "source": "iana" + }, + "application/vnd.ecip.rlp": { + "source": "iana" + }, + "application/vnd.eclipse.ditto+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ecowin.chart": { + "source": "iana", + "extensions": ["mag"] + }, + "application/vnd.ecowin.filerequest": { + "source": "iana" + }, + "application/vnd.ecowin.fileupdate": { + "source": "iana" + }, + "application/vnd.ecowin.series": { + "source": "iana" + }, + "application/vnd.ecowin.seriesrequest": { + "source": "iana" + }, + "application/vnd.ecowin.seriesupdate": { + "source": "iana" + }, + "application/vnd.efi.img": { + "source": "iana" + }, + "application/vnd.efi.iso": { + "source": "iana" + }, + "application/vnd.eln+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.emclient.accessrequest+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.enliven": { + "source": "iana", + "extensions": ["nml"] + }, + "application/vnd.enphase.envoy": { + "source": "iana" + }, + "application/vnd.eprints.data+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.epson.esf": { + "source": "iana", + "extensions": ["esf"] + }, + "application/vnd.epson.msf": { + "source": "iana", + "extensions": ["msf"] + }, + "application/vnd.epson.quickanime": { + "source": "iana", + "extensions": ["qam"] + }, + "application/vnd.epson.salt": { + "source": "iana", + "extensions": ["slt"] + }, + "application/vnd.epson.ssf": { + "source": "iana", + "extensions": ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + "source": "iana" + }, + "application/vnd.erofs": { + "source": "iana" + }, + "application/vnd.espass-espass+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.eszigno3+xml": { + "source": "iana", + "compressible": true, + "extensions": ["es3","et3"] + }, + "application/vnd.etsi.aoc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.asic-e+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.etsi.asic-s+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.etsi.cug+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvcommand+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvdiscovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-bc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-cod+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvservice+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsync+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvueprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.mcid+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.mheg5": { + "source": "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.pstn+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.sci+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.simservs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.timestamp-token": { + "source": "iana" + }, + "application/vnd.etsi.tsl+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.tsl.der": { + "source": "iana" + }, + "application/vnd.eu.kasparian.car+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.eudora.data": { + "source": "iana" + }, + "application/vnd.evolv.ecig.profile": { + "source": "iana" + }, + "application/vnd.evolv.ecig.settings": { + "source": "iana" + }, + "application/vnd.evolv.ecig.theme": { + "source": "iana" + }, + "application/vnd.exstream-empower+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.exstream-package": { + "source": "iana" + }, + "application/vnd.ezpix-album": { + "source": "iana", + "extensions": ["ez2"] + }, + "application/vnd.ezpix-package": { + "source": "iana", + "extensions": ["ez3"] + }, + "application/vnd.f-secure.mobile": { + "source": "iana" + }, + "application/vnd.familysearch.gedcom+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.fastcopy-disk-image": { + "source": "iana" + }, + "application/vnd.fdf": { + "source": "apache", + "extensions": ["fdf"] + }, + "application/vnd.fdsn.mseed": { + "source": "iana", + "extensions": ["mseed"] + }, + "application/vnd.fdsn.seed": { + "source": "iana", + "extensions": ["seed","dataless"] + }, + "application/vnd.fdsn.stationxml+xml": { + "source": "iana", + "charset": "XML-BASED", + "compressible": true + }, + "application/vnd.ffsns": { + "source": "iana" + }, + "application/vnd.ficlab.flb+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.filmit.zfc": { + "source": "iana" + }, + "application/vnd.fints": { + "source": "iana" + }, + "application/vnd.firemonkeys.cloudcell": { + "source": "iana" + }, + "application/vnd.flographit": { + "source": "iana", + "extensions": ["gph"] + }, + "application/vnd.fluxtime.clip": { + "source": "iana", + "extensions": ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + "source": "iana" + }, + "application/vnd.framemaker": { + "source": "iana", + "extensions": ["fm","frame","maker","book"] + }, + "application/vnd.freelog.comic": { + "source": "iana" + }, + "application/vnd.frogans.fnc": { + "source": "apache", + "extensions": ["fnc"] + }, + "application/vnd.frogans.ltf": { + "source": "apache", + "extensions": ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + "source": "iana", + "extensions": ["fsc"] + }, + "application/vnd.fujifilm.fb.docuworks": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.binder": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.jfi+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.fujitsu.oasys": { + "source": "iana", + "extensions": ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + "source": "iana", + "extensions": ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + "source": "iana", + "extensions": ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + "source": "iana", + "extensions": ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + "source": "iana", + "extensions": ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + "source": "iana" + }, + "application/vnd.fujixerox.art4": { + "source": "iana" + }, + "application/vnd.fujixerox.ddd": { + "source": "iana", + "extensions": ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + "source": "iana", + "extensions": ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + "source": "iana", + "extensions": ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujixerox.hbpl": { + "source": "iana" + }, + "application/vnd.fut-misnet": { + "source": "iana" + }, + "application/vnd.futoin+cbor": { + "source": "iana" + }, + "application/vnd.futoin+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.fuzzysheet": { + "source": "iana", + "extensions": ["fzs"] + }, + "application/vnd.ga4gh.passport+jwt": { + "source": "iana" + }, + "application/vnd.genomatix.tuxedo": { + "source": "iana", + "extensions": ["txd"] + }, + "application/vnd.genozip": { + "source": "iana" + }, + "application/vnd.gentics.grd+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.catmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.ebuild": { + "source": "iana" + }, + "application/vnd.gentoo.eclass": { + "source": "iana" + }, + "application/vnd.gentoo.gpkg": { + "source": "iana" + }, + "application/vnd.gentoo.manifest": { + "source": "iana" + }, + "application/vnd.gentoo.pkgmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.gentoo.xpak": { + "source": "iana" + }, + "application/vnd.geo+json": { + "source": "apache", + "compressible": true + }, + "application/vnd.geocube+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.geogebra.file": { + "source": "iana", + "extensions": ["ggb"] + }, + "application/vnd.geogebra.pinboard": { + "source": "iana" + }, + "application/vnd.geogebra.slides": { + "source": "iana", + "extensions": ["ggs"] + }, + "application/vnd.geogebra.tool": { + "source": "iana", + "extensions": ["ggt"] + }, + "application/vnd.geometry-explorer": { + "source": "iana", + "extensions": ["gex","gre"] + }, + "application/vnd.geonext": { + "source": "iana", + "extensions": ["gxt"] + }, + "application/vnd.geoplan": { + "source": "iana", + "extensions": ["g2w"] + }, + "application/vnd.geospace": { + "source": "iana", + "extensions": ["g3w"] + }, + "application/vnd.gerber": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + "source": "iana" + }, + "application/vnd.gmx": { + "source": "iana", + "extensions": ["gmx"] + }, + "application/vnd.gnu.taler.exchange+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.gnu.taler.merchant+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.google-apps.audio": {}, + "application/vnd.google-apps.document": { + "compressible": false, + "extensions": ["gdoc"] + }, + "application/vnd.google-apps.drawing": { + "compressible": false, + "extensions": ["gdraw"] + }, + "application/vnd.google-apps.drive-sdk": { + "compressible": false + }, + "application/vnd.google-apps.file": {}, + "application/vnd.google-apps.folder": { + "compressible": false + }, + "application/vnd.google-apps.form": { + "compressible": false, + "extensions": ["gform"] + }, + "application/vnd.google-apps.fusiontable": {}, + "application/vnd.google-apps.jam": { + "compressible": false, + "extensions": ["gjam"] + }, + "application/vnd.google-apps.mail-layout": {}, + "application/vnd.google-apps.map": { + "compressible": false, + "extensions": ["gmap"] + }, + "application/vnd.google-apps.photo": {}, + "application/vnd.google-apps.presentation": { + "compressible": false, + "extensions": ["gslides"] + }, + "application/vnd.google-apps.script": { + "compressible": false, + "extensions": ["gscript"] + }, + "application/vnd.google-apps.shortcut": {}, + "application/vnd.google-apps.site": { + "compressible": false, + "extensions": ["gsite"] + }, + "application/vnd.google-apps.spreadsheet": { + "compressible": false, + "extensions": ["gsheet"] + }, + "application/vnd.google-apps.unknown": {}, + "application/vnd.google-apps.video": {}, + "application/vnd.google-earth.kml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["kml"] + }, + "application/vnd.google-earth.kmz": { + "source": "iana", + "compressible": false, + "extensions": ["kmz"] + }, + "application/vnd.gov.sk.e-form+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.gov.sk.e-form+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.gov.sk.xmldatacontainer+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdcf"] + }, + "application/vnd.gpxsee.map+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.grafeq": { + "source": "iana", + "extensions": ["gqf","gqs"] + }, + "application/vnd.gridmp": { + "source": "iana" + }, + "application/vnd.groove-account": { + "source": "iana", + "extensions": ["gac"] + }, + "application/vnd.groove-help": { + "source": "iana", + "extensions": ["ghf"] + }, + "application/vnd.groove-identity-message": { + "source": "iana", + "extensions": ["gim"] + }, + "application/vnd.groove-injector": { + "source": "iana", + "extensions": ["grv"] + }, + "application/vnd.groove-tool-message": { + "source": "iana", + "extensions": ["gtm"] + }, + "application/vnd.groove-tool-template": { + "source": "iana", + "extensions": ["tpl"] + }, + "application/vnd.groove-vcard": { + "source": "iana", + "extensions": ["vcg"] + }, + "application/vnd.hal+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hal+xml": { + "source": "iana", + "compressible": true, + "extensions": ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + "source": "iana", + "compressible": true, + "extensions": ["zmm"] + }, + "application/vnd.hbci": { + "source": "iana", + "extensions": ["hbci"] + }, + "application/vnd.hc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hcl-bireports": { + "source": "iana" + }, + "application/vnd.hdt": { + "source": "iana" + }, + "application/vnd.heroku+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hhe.lesson-player": { + "source": "iana", + "extensions": ["les"] + }, + "application/vnd.hp-hpgl": { + "source": "iana", + "extensions": ["hpgl"] + }, + "application/vnd.hp-hpid": { + "source": "iana", + "extensions": ["hpid"] + }, + "application/vnd.hp-hps": { + "source": "iana", + "extensions": ["hps"] + }, + "application/vnd.hp-jlyt": { + "source": "iana", + "extensions": ["jlt"] + }, + "application/vnd.hp-pcl": { + "source": "iana", + "extensions": ["pcl"] + }, + "application/vnd.hp-pclxl": { + "source": "iana", + "extensions": ["pclxl"] + }, + "application/vnd.hsl": { + "source": "iana" + }, + "application/vnd.httphone": { + "source": "iana" + }, + "application/vnd.hydrostatix.sof-data": { + "source": "iana", + "extensions": ["sfd-hdstx"] + }, + "application/vnd.hyper+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hyper-item+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hyperdrive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hzn-3d-crossword": { + "source": "iana" + }, + "application/vnd.ibm.afplinedata": { + "source": "apache" + }, + "application/vnd.ibm.electronic-media": { + "source": "iana" + }, + "application/vnd.ibm.minipay": { + "source": "iana", + "extensions": ["mpy"] + }, + "application/vnd.ibm.modcap": { + "source": "apache", + "extensions": ["afp","listafp","list3820"] + }, + "application/vnd.ibm.rights-management": { + "source": "iana", + "extensions": ["irm"] + }, + "application/vnd.ibm.secure-container": { + "source": "iana", + "extensions": ["sc"] + }, + "application/vnd.iccprofile": { + "source": "iana", + "extensions": ["icc","icm"] + }, + "application/vnd.ieee.1905": { + "source": "iana" + }, + "application/vnd.igloader": { + "source": "iana", + "extensions": ["igl"] + }, + "application/vnd.imagemeter.folder+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.imagemeter.image+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.immervision-ivp": { + "source": "iana", + "extensions": ["ivp"] + }, + "application/vnd.immervision-ivu": { + "source": "iana", + "extensions": ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p2": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p3": { + "source": "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.informedcontrol.rms+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.informix-visionary": { + "source": "apache" + }, + "application/vnd.infotech.project": { + "source": "iana" + }, + "application/vnd.infotech.project+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.innopath.wamp.notification": { + "source": "iana" + }, + "application/vnd.insors.igm": { + "source": "iana", + "extensions": ["igm"] + }, + "application/vnd.intercon.formnet": { + "source": "iana", + "extensions": ["xpw","xpx"] + }, + "application/vnd.intergeo": { + "source": "iana", + "extensions": ["i2g"] + }, + "application/vnd.intertrust.digibox": { + "source": "iana" + }, + "application/vnd.intertrust.nncp": { + "source": "iana" + }, + "application/vnd.intu.qbo": { + "source": "iana", + "extensions": ["qbo"] + }, + "application/vnd.intu.qfx": { + "source": "iana", + "extensions": ["qfx"] + }, + "application/vnd.ipfs.ipns-record": { + "source": "iana" + }, + "application/vnd.ipld.car": { + "source": "iana" + }, + "application/vnd.ipld.dag-cbor": { + "source": "iana" + }, + "application/vnd.ipld.dag-json": { + "source": "iana" + }, + "application/vnd.ipld.raw": { + "source": "iana" + }, + "application/vnd.iptc.g2.catalogitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.conceptitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.newsitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.newsmessage+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.packageitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.planningitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ipunplugged.rcprofile": { + "source": "iana", + "extensions": ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + "source": "iana", + "compressible": true, + "extensions": ["irp"] + }, + "application/vnd.is-xpr": { + "source": "iana", + "extensions": ["xpr"] + }, + "application/vnd.isac.fcs": { + "source": "iana", + "extensions": ["fcs"] + }, + "application/vnd.iso11783-10+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.jam": { + "source": "iana", + "extensions": ["jam"] + }, + "application/vnd.japannet-directory-service": { + "source": "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-payment-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-registration": { + "source": "iana" + }, + "application/vnd.japannet-registration-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-verification": { + "source": "iana" + }, + "application/vnd.japannet-verification-wakeup": { + "source": "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + "source": "iana", + "extensions": ["rms"] + }, + "application/vnd.jisp": { + "source": "iana", + "extensions": ["jisp"] + }, + "application/vnd.joost.joda-archive": { + "source": "iana", + "extensions": ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + "source": "iana" + }, + "application/vnd.kahootz": { + "source": "iana", + "extensions": ["ktz","ktr"] + }, + "application/vnd.kde.karbon": { + "source": "iana", + "extensions": ["karbon"] + }, + "application/vnd.kde.kchart": { + "source": "iana", + "extensions": ["chrt"] + }, + "application/vnd.kde.kformula": { + "source": "iana", + "extensions": ["kfo"] + }, + "application/vnd.kde.kivio": { + "source": "iana", + "extensions": ["flw"] + }, + "application/vnd.kde.kontour": { + "source": "iana", + "extensions": ["kon"] + }, + "application/vnd.kde.kpresenter": { + "source": "iana", + "extensions": ["kpr","kpt"] + }, + "application/vnd.kde.kspread": { + "source": "iana", + "extensions": ["ksp"] + }, + "application/vnd.kde.kword": { + "source": "iana", + "extensions": ["kwd","kwt"] + }, + "application/vnd.kdl": { + "source": "iana" + }, + "application/vnd.kenameaapp": { + "source": "iana", + "extensions": ["htke"] + }, + "application/vnd.keyman.kmp+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.keyman.kmx": { + "source": "iana" + }, + "application/vnd.kidspiration": { + "source": "iana", + "extensions": ["kia"] + }, + "application/vnd.kinar": { + "source": "iana", + "extensions": ["kne","knp"] + }, + "application/vnd.koan": { + "source": "iana", + "extensions": ["skp","skd","skt","skm"] + }, + "application/vnd.kodak-descriptor": { + "source": "iana", + "extensions": ["sse"] + }, + "application/vnd.las": { + "source": "iana" + }, + "application/vnd.las.las+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.las.las+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lasxml"] + }, + "application/vnd.laszip": { + "source": "iana" + }, + "application/vnd.ldev.productlicensing": { + "source": "iana" + }, + "application/vnd.leap+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.liberty-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.llamagraphics.life-balance.desktop": { + "source": "iana", + "extensions": ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lbe"] + }, + "application/vnd.logipipe.circuit+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.loom": { + "source": "iana" + }, + "application/vnd.lotus-1-2-3": { + "source": "iana", + "extensions": ["123"] + }, + "application/vnd.lotus-approach": { + "source": "iana", + "extensions": ["apr"] + }, + "application/vnd.lotus-freelance": { + "source": "iana", + "extensions": ["pre"] + }, + "application/vnd.lotus-notes": { + "source": "iana", + "extensions": ["nsf"] + }, + "application/vnd.lotus-organizer": { + "source": "iana", + "extensions": ["org"] + }, + "application/vnd.lotus-screencam": { + "source": "iana", + "extensions": ["scm"] + }, + "application/vnd.lotus-wordpro": { + "source": "iana", + "extensions": ["lwp"] + }, + "application/vnd.macports.portpkg": { + "source": "iana", + "extensions": ["portpkg"] + }, + "application/vnd.mapbox-vector-tile": { + "source": "iana", + "extensions": ["mvt"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.conftoken+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.license+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.mdcf": { + "source": "iana" + }, + "application/vnd.mason+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.maxar.archive.3tz+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.maxmind.maxmind-db": { + "source": "iana" + }, + "application/vnd.mcd": { + "source": "iana", + "extensions": ["mcd"] + }, + "application/vnd.mdl": { + "source": "iana" + }, + "application/vnd.mdl-mbsdf": { + "source": "iana" + }, + "application/vnd.medcalcdata": { + "source": "iana", + "extensions": ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + "source": "iana", + "extensions": ["cdkey"] + }, + "application/vnd.medicalholodeck.recordxr": { + "source": "iana" + }, + "application/vnd.meridian-slingshot": { + "source": "iana" + }, + "application/vnd.mermaid": { + "source": "iana" + }, + "application/vnd.mfer": { + "source": "iana", + "extensions": ["mwf"] + }, + "application/vnd.mfmp": { + "source": "iana", + "extensions": ["mfm"] + }, + "application/vnd.micro+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.micrografx.flo": { + "source": "iana", + "extensions": ["flo"] + }, + "application/vnd.micrografx.igx": { + "source": "iana", + "extensions": ["igx"] + }, + "application/vnd.microsoft.portable-executable": { + "source": "iana" + }, + "application/vnd.microsoft.windows.thumbnail-cache": { + "source": "iana" + }, + "application/vnd.miele+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.mif": { + "source": "iana", + "extensions": ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + "source": "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + "source": "iana" + }, + "application/vnd.mobius.daf": { + "source": "iana", + "extensions": ["daf"] + }, + "application/vnd.mobius.dis": { + "source": "iana", + "extensions": ["dis"] + }, + "application/vnd.mobius.mbk": { + "source": "iana", + "extensions": ["mbk"] + }, + "application/vnd.mobius.mqy": { + "source": "iana", + "extensions": ["mqy"] + }, + "application/vnd.mobius.msl": { + "source": "iana", + "extensions": ["msl"] + }, + "application/vnd.mobius.plc": { + "source": "iana", + "extensions": ["plc"] + }, + "application/vnd.mobius.txf": { + "source": "iana", + "extensions": ["txf"] + }, + "application/vnd.modl": { + "source": "iana" + }, + "application/vnd.mophun.application": { + "source": "iana", + "extensions": ["mpn"] + }, + "application/vnd.mophun.certificate": { + "source": "iana", + "extensions": ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + "source": "iana" + }, + "application/vnd.motorola.iprm": { + "source": "iana" + }, + "application/vnd.mozilla.xul+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xul"] + }, + "application/vnd.ms-3mfdocument": { + "source": "iana" + }, + "application/vnd.ms-artgalry": { + "source": "iana", + "extensions": ["cil"] + }, + "application/vnd.ms-asf": { + "source": "iana" + }, + "application/vnd.ms-cab-compressed": { + "source": "iana", + "extensions": ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + "source": "apache" + }, + "application/vnd.ms-excel": { + "source": "iana", + "compressible": false, + "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + "source": "iana", + "extensions": ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + "source": "iana", + "extensions": ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + "source": "iana", + "extensions": ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + "source": "iana", + "extensions": ["xltm"] + }, + "application/vnd.ms-fontobject": { + "source": "iana", + "compressible": true, + "extensions": ["eot"] + }, + "application/vnd.ms-htmlhelp": { + "source": "iana", + "extensions": ["chm"] + }, + "application/vnd.ms-ims": { + "source": "iana", + "extensions": ["ims"] + }, + "application/vnd.ms-lrm": { + "source": "iana", + "extensions": ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-officetheme": { + "source": "iana", + "extensions": ["thmx"] + }, + "application/vnd.ms-opentype": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-outlook": { + "compressible": false, + "extensions": ["msg"] + }, + "application/vnd.ms-package.obfuscated-opentype": { + "source": "apache" + }, + "application/vnd.ms-pki.seccat": { + "source": "apache", + "extensions": ["cat"] + }, + "application/vnd.ms-pki.stl": { + "source": "apache", + "extensions": ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-powerpoint": { + "source": "iana", + "compressible": false, + "extensions": ["ppt","pps","pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + "source": "iana", + "extensions": ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + "source": "iana", + "extensions": ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + "source": "iana", + "extensions": ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + "source": "iana", + "extensions": ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + "source": "iana", + "extensions": ["potm"] + }, + "application/vnd.ms-printdevicecapabilities+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-printing.printticket+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-printschematicket+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-project": { + "source": "iana", + "extensions": ["mpp","mpt"] + }, + "application/vnd.ms-tnef": { + "source": "iana" + }, + "application/vnd.ms-visio.viewer": { + "extensions": ["vdx"] + }, + "application/vnd.ms-windows.devicepairing": { + "source": "iana" + }, + "application/vnd.ms-windows.nwprinting.oob": { + "source": "iana" + }, + "application/vnd.ms-windows.printerpairing": { + "source": "iana" + }, + "application/vnd.ms-windows.wsd.oob": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + "source": "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + "source": "iana", + "extensions": ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + "source": "iana", + "extensions": ["dotm"] + }, + "application/vnd.ms-works": { + "source": "iana", + "extensions": ["wps","wks","wcm","wdb"] + }, + "application/vnd.ms-wpl": { + "source": "iana", + "extensions": ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + "source": "iana", + "compressible": false, + "extensions": ["xps"] + }, + "application/vnd.msa-disk-image": { + "source": "iana" + }, + "application/vnd.mseq": { + "source": "iana", + "extensions": ["mseq"] + }, + "application/vnd.msgpack": { + "source": "iana" + }, + "application/vnd.msign": { + "source": "iana" + }, + "application/vnd.multiad.creator": { + "source": "iana" + }, + "application/vnd.multiad.creator.cif": { + "source": "iana" + }, + "application/vnd.music-niff": { + "source": "iana" + }, + "application/vnd.musician": { + "source": "iana", + "extensions": ["mus"] + }, + "application/vnd.muvee.style": { + "source": "iana", + "extensions": ["msty"] + }, + "application/vnd.mynfc": { + "source": "iana", + "extensions": ["taglet"] + }, + "application/vnd.nacamar.ybrid+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nato.bindingdataobject+cbor": { + "source": "iana" + }, + "application/vnd.nato.bindingdataobject+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nato.bindingdataobject+xml": { + "source": "iana", + "compressible": true, + "extensions": ["bdo"] + }, + "application/vnd.nato.openxmlformats-package.iepd+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.ncd.control": { + "source": "iana" + }, + "application/vnd.ncd.reference": { + "source": "iana" + }, + "application/vnd.nearst.inv+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nebumind.line": { + "source": "iana" + }, + "application/vnd.nervana": { + "source": "iana" + }, + "application/vnd.netfpx": { + "source": "iana" + }, + "application/vnd.neurolanguage.nlu": { + "source": "iana", + "extensions": ["nlu"] + }, + "application/vnd.nimn": { + "source": "iana" + }, + "application/vnd.nintendo.nitro.rom": { + "source": "iana" + }, + "application/vnd.nintendo.snes.rom": { + "source": "iana" + }, + "application/vnd.nitf": { + "source": "iana", + "extensions": ["ntf","nitf"] + }, + "application/vnd.noblenet-directory": { + "source": "iana", + "extensions": ["nnd"] + }, + "application/vnd.noblenet-sealer": { + "source": "iana", + "extensions": ["nns"] + }, + "application/vnd.noblenet-web": { + "source": "iana", + "extensions": ["nnw"] + }, + "application/vnd.nokia.catalogs": { + "source": "iana" + }, + "application/vnd.nokia.conml+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.conml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.iptv.config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.isds-radio-presets": { + "source": "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.landmark+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.landmarkcollection+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.n-gage.ac+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ac"] + }, + "application/vnd.nokia.n-gage.data": { + "source": "iana", + "extensions": ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + "source": "apache", + "extensions": ["n-gage"] + }, + "application/vnd.nokia.ncd": { + "source": "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.pcd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.radio-preset": { + "source": "iana", + "extensions": ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + "source": "iana", + "extensions": ["rpss"] + }, + "application/vnd.novadigm.edm": { + "source": "iana", + "extensions": ["edm"] + }, + "application/vnd.novadigm.edx": { + "source": "iana", + "extensions": ["edx"] + }, + "application/vnd.novadigm.ext": { + "source": "iana", + "extensions": ["ext"] + }, + "application/vnd.ntt-local.content-share": { + "source": "iana" + }, + "application/vnd.ntt-local.file-transfer": { + "source": "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + "source": "iana" + }, + "application/vnd.oai.workflows": { + "source": "iana" + }, + "application/vnd.oai.workflows+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oai.workflows+yaml": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.base": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.chart": { + "source": "iana", + "extensions": ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + "source": "iana", + "extensions": ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + "source": "apache", + "extensions": ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + "source": "iana", + "extensions": ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + "source": "iana", + "extensions": ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + "source": "iana", + "compressible": false, + "extensions": ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + "source": "iana", + "extensions": ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + "source": "iana", + "extensions": ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + "source": "iana", + "extensions": ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + "source": "iana", + "extensions": ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + "source": "iana", + "compressible": false, + "extensions": ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + "source": "iana", + "extensions": ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + "source": "iana", + "compressible": false, + "extensions": ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + "source": "iana", + "extensions": ["odm"] + }, + "application/vnd.oasis.opendocument.text-master-template": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.text-template": { + "source": "iana", + "extensions": ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + "source": "iana", + "extensions": ["oth"] + }, + "application/vnd.obn": { + "source": "iana" + }, + "application/vnd.ocf+cbor": { + "source": "iana" + }, + "application/vnd.oci.image.manifest.v1+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oftn.l10n+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.cspg-hexbinary": { + "source": "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.dae.xhtml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.pae.gem": { + "source": "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.spdlist+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.ueprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.userprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.olpc-sugar": { + "source": "iana", + "extensions": ["xo"] + }, + "application/vnd.oma-scws-config": { + "source": "iana" + }, + "application/vnd.oma-scws-http-request": { + "source": "iana" + }, + "application/vnd.oma-scws-http-response": { + "source": "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.oma.bcast.imd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.ltkm": { + "source": "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.provisioningtrigger": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgboot": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.sgdu": { + "source": "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + "source": "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.oma.bcast.sprov+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.stkm": { + "source": "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-feature-handler+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-pcc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-subs-invite+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-user-prefs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.dcd": { + "source": "iana" + }, + "application/vnd.oma.dcdc": { + "source": "iana" + }, + "application/vnd.oma.dd2+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.group-usage-list+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.lwm2m+cbor": { + "source": "iana" + }, + "application/vnd.oma.lwm2m+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.lwm2m+tlv": { + "source": "iana" + }, + "application/vnd.oma.pal+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.final-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.groups+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.push": { + "source": "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.xcap-directory+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.omads-email+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omads-file+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omads-folder+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omaloc-supl-init": { + "source": "iana" + }, + "application/vnd.onepager": { + "source": "iana" + }, + "application/vnd.onepagertamp": { + "source": "iana" + }, + "application/vnd.onepagertamx": { + "source": "iana" + }, + "application/vnd.onepagertat": { + "source": "iana" + }, + "application/vnd.onepagertatp": { + "source": "iana" + }, + "application/vnd.onepagertatx": { + "source": "iana" + }, + "application/vnd.onvif.metadata": { + "source": "iana" + }, + "application/vnd.openblox.game+xml": { + "source": "iana", + "compressible": true, + "extensions": ["obgx"] + }, + "application/vnd.openblox.game-binary": { + "source": "iana" + }, + "application/vnd.openeye.oeb": { + "source": "iana" + }, + "application/vnd.openofficeorg.extension": { + "source": "apache", + "extensions": ["oxt"] + }, + "application/vnd.openstreetmap.data+xml": { + "source": "iana", + "compressible": true, + "extensions": ["osm"] + }, + "application/vnd.opentimestamps.ots": { + "source": "iana" + }, + "application/vnd.openvpi.dspx+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + "source": "iana", + "extensions": ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + "source": "iana", + "extensions": ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + "source": "iana", + "extensions": ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + "source": "iana", + "compressible": false, + "extensions": ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + "source": "iana", + "extensions": ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + "source": "iana", + "compressible": false, + "extensions": ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + "source": "iana", + "extensions": ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.relationships+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oracle.resource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.orange.indata": { + "source": "iana" + }, + "application/vnd.osa.netdeploy": { + "source": "iana" + }, + "application/vnd.osgeo.mapguide.package": { + "source": "iana", + "extensions": ["mgp"] + }, + "application/vnd.osgi.bundle": { + "source": "iana" + }, + "application/vnd.osgi.dp": { + "source": "iana", + "extensions": ["dp"] + }, + "application/vnd.osgi.subsystem": { + "source": "iana", + "extensions": ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oxli.countgraph": { + "source": "iana" + }, + "application/vnd.pagerduty+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.palm": { + "source": "iana", + "extensions": ["pdb","pqa","oprc"] + }, + "application/vnd.panoply": { + "source": "iana" + }, + "application/vnd.paos.xml": { + "source": "iana" + }, + "application/vnd.patentdive": { + "source": "iana" + }, + "application/vnd.patientecommsdoc": { + "source": "iana" + }, + "application/vnd.pawaafile": { + "source": "iana", + "extensions": ["paw"] + }, + "application/vnd.pcos": { + "source": "iana" + }, + "application/vnd.pg.format": { + "source": "iana", + "extensions": ["str"] + }, + "application/vnd.pg.osasli": { + "source": "iana", + "extensions": ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + "source": "iana" + }, + "application/vnd.picsel": { + "source": "iana", + "extensions": ["efif"] + }, + "application/vnd.pmi.widget": { + "source": "iana", + "extensions": ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.pocketlearn": { + "source": "iana", + "extensions": ["plf"] + }, + "application/vnd.powerbuilder6": { + "source": "iana", + "extensions": ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + "source": "iana" + }, + "application/vnd.powerbuilder7": { + "source": "iana" + }, + "application/vnd.powerbuilder7-s": { + "source": "iana" + }, + "application/vnd.powerbuilder75": { + "source": "iana" + }, + "application/vnd.powerbuilder75-s": { + "source": "iana" + }, + "application/vnd.preminet": { + "source": "iana" + }, + "application/vnd.previewsystems.box": { + "source": "iana", + "extensions": ["box"] + }, + "application/vnd.procrate.brushset": { + "extensions": ["brushset"] + }, + "application/vnd.procreate.brush": { + "extensions": ["brush"] + }, + "application/vnd.procreate.dream": { + "extensions": ["drm"] + }, + "application/vnd.proteus.magazine": { + "source": "iana", + "extensions": ["mgz"] + }, + "application/vnd.psfs": { + "source": "iana" + }, + "application/vnd.pt.mundusmundi": { + "source": "iana" + }, + "application/vnd.publishare-delta-tree": { + "source": "iana", + "extensions": ["qps"] + }, + "application/vnd.pvi.ptid1": { + "source": "iana", + "extensions": ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + "source": "iana" + }, + "application/vnd.pwg-xhtml-print+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtm"] + }, + "application/vnd.qualcomm.brew-app-res": { + "source": "iana" + }, + "application/vnd.quarantainenet": { + "source": "iana" + }, + "application/vnd.quark.quarkxpress": { + "source": "iana", + "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] + }, + "application/vnd.quobject-quoxdocument": { + "source": "iana" + }, + "application/vnd.radisys.moml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-conf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-conn+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-stream+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-conf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-base+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-group+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.rainstor.data": { + "source": "iana" + }, + "application/vnd.rapid": { + "source": "iana" + }, + "application/vnd.rar": { + "source": "iana", + "extensions": ["rar"] + }, + "application/vnd.realvnc.bed": { + "source": "iana", + "extensions": ["bed"] + }, + "application/vnd.recordare.musicxml": { + "source": "iana", + "extensions": ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["musicxml"] + }, + "application/vnd.relpipe": { + "source": "iana" + }, + "application/vnd.renlearn.rlprint": { + "source": "iana" + }, + "application/vnd.resilient.logic": { + "source": "iana" + }, + "application/vnd.restful+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.rig.cryptonote": { + "source": "iana", + "extensions": ["cryptonote"] + }, + "application/vnd.rim.cod": { + "source": "apache", + "extensions": ["cod"] + }, + "application/vnd.rn-realmedia": { + "source": "apache", + "extensions": ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + "source": "apache", + "extensions": ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + "source": "iana", + "compressible": true, + "extensions": ["link66"] + }, + "application/vnd.rs-274x": { + "source": "iana" + }, + "application/vnd.ruckus.download": { + "source": "iana" + }, + "application/vnd.s3sms": { + "source": "iana" + }, + "application/vnd.sailingtracker.track": { + "source": "iana", + "extensions": ["st"] + }, + "application/vnd.sar": { + "source": "iana" + }, + "application/vnd.sbm.cid": { + "source": "iana" + }, + "application/vnd.sbm.mid2": { + "source": "iana" + }, + "application/vnd.scribus": { + "source": "iana" + }, + "application/vnd.sealed.3df": { + "source": "iana" + }, + "application/vnd.sealed.csf": { + "source": "iana" + }, + "application/vnd.sealed.doc": { + "source": "iana" + }, + "application/vnd.sealed.eml": { + "source": "iana" + }, + "application/vnd.sealed.mht": { + "source": "iana" + }, + "application/vnd.sealed.net": { + "source": "iana" + }, + "application/vnd.sealed.ppt": { + "source": "iana" + }, + "application/vnd.sealed.tiff": { + "source": "iana" + }, + "application/vnd.sealed.xls": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.pdf": { + "source": "iana" + }, + "application/vnd.seemail": { + "source": "iana", + "extensions": ["see"] + }, + "application/vnd.seis+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.sema": { + "source": "iana", + "extensions": ["sema"] + }, + "application/vnd.semd": { + "source": "iana", + "extensions": ["semd"] + }, + "application/vnd.semf": { + "source": "iana", + "extensions": ["semf"] + }, + "application/vnd.shade-save-file": { + "source": "iana" + }, + "application/vnd.shana.informed.formdata": { + "source": "iana", + "extensions": ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + "source": "iana", + "extensions": ["itp"] + }, + "application/vnd.shana.informed.interchange": { + "source": "iana", + "extensions": ["iif"] + }, + "application/vnd.shana.informed.package": { + "source": "iana", + "extensions": ["ipk"] + }, + "application/vnd.shootproof+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shopkick+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shp": { + "source": "iana" + }, + "application/vnd.shx": { + "source": "iana" + }, + "application/vnd.sigrok.session": { + "source": "iana" + }, + "application/vnd.simtech-mindmapper": { + "source": "iana", + "extensions": ["twd","twds"] + }, + "application/vnd.siren+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.sketchometry": { + "source": "iana" + }, + "application/vnd.smaf": { + "source": "iana", + "extensions": ["mmf"] + }, + "application/vnd.smart.notebook": { + "source": "iana" + }, + "application/vnd.smart.teacher": { + "source": "iana", + "extensions": ["teacher"] + }, + "application/vnd.smintio.portals.archive": { + "source": "iana" + }, + "application/vnd.snesdev-page-table": { + "source": "iana" + }, + "application/vnd.software602.filler.form+xml": { + "source": "iana", + "compressible": true, + "extensions": ["fo"] + }, + "application/vnd.software602.filler.form-xml-zip": { + "source": "iana" + }, + "application/vnd.solent.sdkm+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sdkm","sdkd"] + }, + "application/vnd.spotfire.dxp": { + "source": "iana", + "extensions": ["dxp"] + }, + "application/vnd.spotfire.sfs": { + "source": "iana", + "extensions": ["sfs"] + }, + "application/vnd.sqlite3": { + "source": "iana" + }, + "application/vnd.sss-cod": { + "source": "iana" + }, + "application/vnd.sss-dtf": { + "source": "iana" + }, + "application/vnd.sss-ntf": { + "source": "iana" + }, + "application/vnd.stardivision.calc": { + "source": "apache", + "extensions": ["sdc"] + }, + "application/vnd.stardivision.draw": { + "source": "apache", + "extensions": ["sda"] + }, + "application/vnd.stardivision.impress": { + "source": "apache", + "extensions": ["sdd"] + }, + "application/vnd.stardivision.math": { + "source": "apache", + "extensions": ["smf"] + }, + "application/vnd.stardivision.writer": { + "source": "apache", + "extensions": ["sdw","vor"] + }, + "application/vnd.stardivision.writer-global": { + "source": "apache", + "extensions": ["sgl"] + }, + "application/vnd.stepmania.package": { + "source": "iana", + "extensions": ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + "source": "iana", + "extensions": ["sm"] + }, + "application/vnd.street-stream": { + "source": "iana" + }, + "application/vnd.sun.wadl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wadl"] + }, + "application/vnd.sun.xml.calc": { + "source": "apache", + "extensions": ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + "source": "apache", + "extensions": ["stc"] + }, + "application/vnd.sun.xml.draw": { + "source": "apache", + "extensions": ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + "source": "apache", + "extensions": ["std"] + }, + "application/vnd.sun.xml.impress": { + "source": "apache", + "extensions": ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + "source": "apache", + "extensions": ["sti"] + }, + "application/vnd.sun.xml.math": { + "source": "apache", + "extensions": ["sxm"] + }, + "application/vnd.sun.xml.writer": { + "source": "apache", + "extensions": ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + "source": "apache", + "extensions": ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + "source": "apache", + "extensions": ["stw"] + }, + "application/vnd.sus-calendar": { + "source": "iana", + "extensions": ["sus","susp"] + }, + "application/vnd.svd": { + "source": "iana", + "extensions": ["svd"] + }, + "application/vnd.swiftview-ics": { + "source": "iana" + }, + "application/vnd.sybyl.mol2": { + "source": "iana" + }, + "application/vnd.sycle+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.syft+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.symbian.install": { + "source": "apache", + "extensions": ["sis","sisx"] + }, + "application/vnd.syncml+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["ddf"] + }, + "application/vnd.syncml.dmtnds+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.syncml.ds.notification": { + "source": "iana" + }, + "application/vnd.tableschema+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.tao.intent-module-archive": { + "source": "iana", + "extensions": ["tao"] + }, + "application/vnd.tcpdump.pcap": { + "source": "iana", + "extensions": ["pcap","cap","dmp"] + }, + "application/vnd.think-cell.ppttc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.tmd.mediaflex.api+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.tml": { + "source": "iana" + }, + "application/vnd.tmobile-livetv": { + "source": "iana", + "extensions": ["tmo"] + }, + "application/vnd.tri.onesource": { + "source": "iana" + }, + "application/vnd.trid.tpt": { + "source": "iana", + "extensions": ["tpt"] + }, + "application/vnd.triscape.mxs": { + "source": "iana", + "extensions": ["mxs"] + }, + "application/vnd.trueapp": { + "source": "iana", + "extensions": ["tra"] + }, + "application/vnd.truedoc": { + "source": "iana" + }, + "application/vnd.ubisoft.webplayer": { + "source": "iana" + }, + "application/vnd.ufdl": { + "source": "iana", + "extensions": ["ufd","ufdl"] + }, + "application/vnd.uic.osdm+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.uiq.theme": { + "source": "iana", + "extensions": ["utz"] + }, + "application/vnd.umajin": { + "source": "iana", + "extensions": ["umj"] + }, + "application/vnd.unity": { + "source": "iana", + "extensions": ["unityweb"] + }, + "application/vnd.uoml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["uoml","uo"] + }, + "application/vnd.uplanet.alert": { + "source": "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.channel": { + "source": "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.list": { + "source": "iana" + }, + "application/vnd.uplanet.list-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.signal": { + "source": "iana" + }, + "application/vnd.uri-map": { + "source": "iana" + }, + "application/vnd.valve.source.material": { + "source": "iana" + }, + "application/vnd.vcx": { + "source": "iana", + "extensions": ["vcx"] + }, + "application/vnd.vd-study": { + "source": "iana" + }, + "application/vnd.vectorworks": { + "source": "iana" + }, + "application/vnd.vel+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.veraison.tsm-report+cbor": { + "source": "iana" + }, + "application/vnd.veraison.tsm-report+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.verimatrix.vcas": { + "source": "iana" + }, + "application/vnd.veritone.aion+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.veryant.thin": { + "source": "iana" + }, + "application/vnd.ves.encrypted": { + "source": "iana" + }, + "application/vnd.vidsoft.vidconference": { + "source": "iana" + }, + "application/vnd.visio": { + "source": "iana", + "extensions": ["vsd","vst","vss","vsw","vsdx","vtx"] + }, + "application/vnd.visionary": { + "source": "iana", + "extensions": ["vis"] + }, + "application/vnd.vividence.scriptfile": { + "source": "iana" + }, + "application/vnd.vocalshaper.vsp4": { + "source": "iana" + }, + "application/vnd.vsf": { + "source": "iana", + "extensions": ["vsf"] + }, + "application/vnd.wap.sic": { + "source": "iana" + }, + "application/vnd.wap.slc": { + "source": "iana" + }, + "application/vnd.wap.wbxml": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["wbxml"] + }, + "application/vnd.wap.wmlc": { + "source": "iana", + "extensions": ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + "source": "iana", + "extensions": ["wmlsc"] + }, + "application/vnd.wasmflow.wafl": { + "source": "iana" + }, + "application/vnd.webturbo": { + "source": "iana", + "extensions": ["wtb"] + }, + "application/vnd.wfa.dpp": { + "source": "iana" + }, + "application/vnd.wfa.p2p": { + "source": "iana" + }, + "application/vnd.wfa.wsc": { + "source": "iana" + }, + "application/vnd.windows.devicepairing": { + "source": "iana" + }, + "application/vnd.wmc": { + "source": "iana" + }, + "application/vnd.wmf.bootstrap": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica.package": { + "source": "iana" + }, + "application/vnd.wolfram.player": { + "source": "iana", + "extensions": ["nbp"] + }, + "application/vnd.wordlift": { + "source": "iana" + }, + "application/vnd.wordperfect": { + "source": "iana", + "extensions": ["wpd"] + }, + "application/vnd.wqd": { + "source": "iana", + "extensions": ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + "source": "iana" + }, + "application/vnd.wt.stf": { + "source": "iana", + "extensions": ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + "source": "iana" + }, + "application/vnd.wv.csp+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.wv.ssp+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.xacml+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.xara": { + "source": "iana", + "extensions": ["xar"] + }, + "application/vnd.xarin.cpj": { + "source": "iana" + }, + "application/vnd.xecrets-encrypted": { + "source": "iana" + }, + "application/vnd.xfdl": { + "source": "iana", + "extensions": ["xfdl"] + }, + "application/vnd.xfdl.webform": { + "source": "iana" + }, + "application/vnd.xmi+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.xmpie.cpkg": { + "source": "iana" + }, + "application/vnd.xmpie.dpkg": { + "source": "iana" + }, + "application/vnd.xmpie.plan": { + "source": "iana" + }, + "application/vnd.xmpie.ppkg": { + "source": "iana" + }, + "application/vnd.xmpie.xlim": { + "source": "iana" + }, + "application/vnd.yamaha.hv-dic": { + "source": "iana", + "extensions": ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + "source": "iana", + "extensions": ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + "source": "iana", + "extensions": ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + "source": "iana", + "extensions": ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + "source": "iana" + }, + "application/vnd.yamaha.smaf-audio": { + "source": "iana", + "extensions": ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + "source": "iana", + "extensions": ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + "source": "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + "source": "iana" + }, + "application/vnd.yaoweme": { + "source": "iana" + }, + "application/vnd.yellowriver-custom-menu": { + "source": "iana", + "extensions": ["cmp"] + }, + "application/vnd.zul": { + "source": "iana", + "extensions": ["zir","zirz"] + }, + "application/vnd.zzazz.deck+xml": { + "source": "iana", + "compressible": true, + "extensions": ["zaz"] + }, + "application/voicexml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["vxml"] + }, + "application/voucher-cms+json": { + "source": "iana", + "compressible": true + }, + "application/voucher-jws+json": { + "source": "iana", + "compressible": true + }, + "application/vp": { + "source": "iana" + }, + "application/vp+cose": { + "source": "iana" + }, + "application/vp+jwt": { + "source": "iana" + }, + "application/vq-rtcpxr": { + "source": "iana" + }, + "application/wasm": { + "source": "iana", + "compressible": true, + "extensions": ["wasm"] + }, + "application/watcherinfo+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wif"] + }, + "application/webpush-options+json": { + "source": "iana", + "compressible": true + }, + "application/whoispp-query": { + "source": "iana" + }, + "application/whoispp-response": { + "source": "iana" + }, + "application/widget": { + "source": "iana", + "extensions": ["wgt"] + }, + "application/winhlp": { + "source": "apache", + "extensions": ["hlp"] + }, + "application/wita": { + "source": "iana" + }, + "application/wordperfect5.1": { + "source": "iana" + }, + "application/wsdl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wsdl"] + }, + "application/wspolicy+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wspolicy"] + }, + "application/x-7z-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["7z"] + }, + "application/x-abiword": { + "source": "apache", + "extensions": ["abw"] + }, + "application/x-ace-compressed": { + "source": "apache", + "extensions": ["ace"] + }, + "application/x-amf": { + "source": "apache" + }, + "application/x-apple-diskimage": { + "source": "apache", + "extensions": ["dmg"] + }, + "application/x-arj": { + "compressible": false, + "extensions": ["arj"] + }, + "application/x-authorware-bin": { + "source": "apache", + "extensions": ["aab","x32","u32","vox"] + }, + "application/x-authorware-map": { + "source": "apache", + "extensions": ["aam"] + }, + "application/x-authorware-seg": { + "source": "apache", + "extensions": ["aas"] + }, + "application/x-bcpio": { + "source": "apache", + "extensions": ["bcpio"] + }, + "application/x-bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/x-bittorrent": { + "source": "apache", + "extensions": ["torrent"] + }, + "application/x-blender": { + "extensions": ["blend"] + }, + "application/x-blorb": { + "source": "apache", + "extensions": ["blb","blorb"] + }, + "application/x-bzip": { + "source": "apache", + "compressible": false, + "extensions": ["bz"] + }, + "application/x-bzip2": { + "source": "apache", + "compressible": false, + "extensions": ["bz2","boz"] + }, + "application/x-cbr": { + "source": "apache", + "extensions": ["cbr","cba","cbt","cbz","cb7"] + }, + "application/x-cdlink": { + "source": "apache", + "extensions": ["vcd"] + }, + "application/x-cfs-compressed": { + "source": "apache", + "extensions": ["cfs"] + }, + "application/x-chat": { + "source": "apache", + "extensions": ["chat"] + }, + "application/x-chess-pgn": { + "source": "apache", + "extensions": ["pgn"] + }, + "application/x-chrome-extension": { + "extensions": ["crx"] + }, + "application/x-cocoa": { + "source": "nginx", + "extensions": ["cco"] + }, + "application/x-compress": { + "source": "apache" + }, + "application/x-compressed": { + "extensions": ["rar"] + }, + "application/x-conference": { + "source": "apache", + "extensions": ["nsc"] + }, + "application/x-cpio": { + "source": "apache", + "extensions": ["cpio"] + }, + "application/x-csh": { + "source": "apache", + "extensions": ["csh"] + }, + "application/x-deb": { + "compressible": false + }, + "application/x-debian-package": { + "source": "apache", + "extensions": ["deb","udeb"] + }, + "application/x-dgc-compressed": { + "source": "apache", + "extensions": ["dgc"] + }, + "application/x-director": { + "source": "apache", + "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] + }, + "application/x-doom": { + "source": "apache", + "extensions": ["wad"] + }, + "application/x-dtbncx+xml": { + "source": "apache", + "compressible": true, + "extensions": ["ncx"] + }, + "application/x-dtbook+xml": { + "source": "apache", + "compressible": true, + "extensions": ["dtb"] + }, + "application/x-dtbresource+xml": { + "source": "apache", + "compressible": true, + "extensions": ["res"] + }, + "application/x-dvi": { + "source": "apache", + "compressible": false, + "extensions": ["dvi"] + }, + "application/x-envoy": { + "source": "apache", + "extensions": ["evy"] + }, + "application/x-eva": { + "source": "apache", + "extensions": ["eva"] + }, + "application/x-font-bdf": { + "source": "apache", + "extensions": ["bdf"] + }, + "application/x-font-dos": { + "source": "apache" + }, + "application/x-font-framemaker": { + "source": "apache" + }, + "application/x-font-ghostscript": { + "source": "apache", + "extensions": ["gsf"] + }, + "application/x-font-libgrx": { + "source": "apache" + }, + "application/x-font-linux-psf": { + "source": "apache", + "extensions": ["psf"] + }, + "application/x-font-pcf": { + "source": "apache", + "extensions": ["pcf"] + }, + "application/x-font-snf": { + "source": "apache", + "extensions": ["snf"] + }, + "application/x-font-speedo": { + "source": "apache" + }, + "application/x-font-sunos-news": { + "source": "apache" + }, + "application/x-font-type1": { + "source": "apache", + "extensions": ["pfa","pfb","pfm","afm"] + }, + "application/x-font-vfont": { + "source": "apache" + }, + "application/x-freearc": { + "source": "apache", + "extensions": ["arc"] + }, + "application/x-futuresplash": { + "source": "apache", + "extensions": ["spl"] + }, + "application/x-gca-compressed": { + "source": "apache", + "extensions": ["gca"] + }, + "application/x-glulx": { + "source": "apache", + "extensions": ["ulx"] + }, + "application/x-gnumeric": { + "source": "apache", + "extensions": ["gnumeric"] + }, + "application/x-gramps-xml": { + "source": "apache", + "extensions": ["gramps"] + }, + "application/x-gtar": { + "source": "apache", + "extensions": ["gtar"] + }, + "application/x-gzip": { + "source": "apache" + }, + "application/x-hdf": { + "source": "apache", + "extensions": ["hdf"] + }, + "application/x-httpd-php": { + "compressible": true, + "extensions": ["php"] + }, + "application/x-install-instructions": { + "source": "apache", + "extensions": ["install"] + }, + "application/x-ipynb+json": { + "compressible": true, + "extensions": ["ipynb"] + }, + "application/x-iso9660-image": { + "source": "apache", + "extensions": ["iso"] + }, + "application/x-iwork-keynote-sffkey": { + "extensions": ["key"] + }, + "application/x-iwork-numbers-sffnumbers": { + "extensions": ["numbers"] + }, + "application/x-iwork-pages-sffpages": { + "extensions": ["pages"] + }, + "application/x-java-archive-diff": { + "source": "nginx", + "extensions": ["jardiff"] + }, + "application/x-java-jnlp-file": { + "source": "apache", + "compressible": false, + "extensions": ["jnlp"] + }, + "application/x-javascript": { + "compressible": true + }, + "application/x-keepass2": { + "extensions": ["kdbx"] + }, + "application/x-latex": { + "source": "apache", + "compressible": false, + "extensions": ["latex"] + }, + "application/x-lua-bytecode": { + "extensions": ["luac"] + }, + "application/x-lzh-compressed": { + "source": "apache", + "extensions": ["lzh","lha"] + }, + "application/x-makeself": { + "source": "nginx", + "extensions": ["run"] + }, + "application/x-mie": { + "source": "apache", + "extensions": ["mie"] + }, + "application/x-mobipocket-ebook": { + "source": "apache", + "extensions": ["prc","mobi"] + }, + "application/x-mpegurl": { + "compressible": false + }, + "application/x-ms-application": { + "source": "apache", + "extensions": ["application"] + }, + "application/x-ms-shortcut": { + "source": "apache", + "extensions": ["lnk"] + }, + "application/x-ms-wmd": { + "source": "apache", + "extensions": ["wmd"] + }, + "application/x-ms-wmz": { + "source": "apache", + "extensions": ["wmz"] + }, + "application/x-ms-xbap": { + "source": "apache", + "extensions": ["xbap"] + }, + "application/x-msaccess": { + "source": "apache", + "extensions": ["mdb"] + }, + "application/x-msbinder": { + "source": "apache", + "extensions": ["obd"] + }, + "application/x-mscardfile": { + "source": "apache", + "extensions": ["crd"] + }, + "application/x-msclip": { + "source": "apache", + "extensions": ["clp"] + }, + "application/x-msdos-program": { + "extensions": ["exe"] + }, + "application/x-msdownload": { + "source": "apache", + "extensions": ["exe","dll","com","bat","msi"] + }, + "application/x-msmediaview": { + "source": "apache", + "extensions": ["mvb","m13","m14"] + }, + "application/x-msmetafile": { + "source": "apache", + "extensions": ["wmf","wmz","emf","emz"] + }, + "application/x-msmoney": { + "source": "apache", + "extensions": ["mny"] + }, + "application/x-mspublisher": { + "source": "apache", + "extensions": ["pub"] + }, + "application/x-msschedule": { + "source": "apache", + "extensions": ["scd"] + }, + "application/x-msterminal": { + "source": "apache", + "extensions": ["trm"] + }, + "application/x-mswrite": { + "source": "apache", + "extensions": ["wri"] + }, + "application/x-netcdf": { + "source": "apache", + "extensions": ["nc","cdf"] + }, + "application/x-ns-proxy-autoconfig": { + "compressible": true, + "extensions": ["pac"] + }, + "application/x-nzb": { + "source": "apache", + "extensions": ["nzb"] + }, + "application/x-perl": { + "source": "nginx", + "extensions": ["pl","pm"] + }, + "application/x-pilot": { + "source": "nginx", + "extensions": ["prc","pdb"] + }, + "application/x-pkcs12": { + "source": "apache", + "compressible": false, + "extensions": ["p12","pfx"] + }, + "application/x-pkcs7-certificates": { + "source": "apache", + "extensions": ["p7b","spc"] + }, + "application/x-pkcs7-certreqresp": { + "source": "apache", + "extensions": ["p7r"] + }, + "application/x-pki-message": { + "source": "iana" + }, + "application/x-rar-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["rar"] + }, + "application/x-redhat-package-manager": { + "source": "nginx", + "extensions": ["rpm"] + }, + "application/x-research-info-systems": { + "source": "apache", + "extensions": ["ris"] + }, + "application/x-sea": { + "source": "nginx", + "extensions": ["sea"] + }, + "application/x-sh": { + "source": "apache", + "compressible": true, + "extensions": ["sh"] + }, + "application/x-shar": { + "source": "apache", + "extensions": ["shar"] + }, + "application/x-shockwave-flash": { + "source": "apache", + "compressible": false, + "extensions": ["swf"] + }, + "application/x-silverlight-app": { + "source": "apache", + "extensions": ["xap"] + }, + "application/x-sql": { + "source": "apache", + "extensions": ["sql"] + }, + "application/x-stuffit": { + "source": "apache", + "compressible": false, + "extensions": ["sit"] + }, + "application/x-stuffitx": { + "source": "apache", + "extensions": ["sitx"] + }, + "application/x-subrip": { + "source": "apache", + "extensions": ["srt"] + }, + "application/x-sv4cpio": { + "source": "apache", + "extensions": ["sv4cpio"] + }, + "application/x-sv4crc": { + "source": "apache", + "extensions": ["sv4crc"] + }, + "application/x-t3vm-image": { + "source": "apache", + "extensions": ["t3"] + }, + "application/x-tads": { + "source": "apache", + "extensions": ["gam"] + }, + "application/x-tar": { + "source": "apache", + "compressible": true, + "extensions": ["tar"] + }, + "application/x-tcl": { + "source": "apache", + "extensions": ["tcl","tk"] + }, + "application/x-tex": { + "source": "apache", + "extensions": ["tex"] + }, + "application/x-tex-tfm": { + "source": "apache", + "extensions": ["tfm"] + }, + "application/x-texinfo": { + "source": "apache", + "extensions": ["texinfo","texi"] + }, + "application/x-tgif": { + "source": "apache", + "extensions": ["obj"] + }, + "application/x-ustar": { + "source": "apache", + "extensions": ["ustar"] + }, + "application/x-virtualbox-hdd": { + "compressible": true, + "extensions": ["hdd"] + }, + "application/x-virtualbox-ova": { + "compressible": true, + "extensions": ["ova"] + }, + "application/x-virtualbox-ovf": { + "compressible": true, + "extensions": ["ovf"] + }, + "application/x-virtualbox-vbox": { + "compressible": true, + "extensions": ["vbox"] + }, + "application/x-virtualbox-vbox-extpack": { + "compressible": false, + "extensions": ["vbox-extpack"] + }, + "application/x-virtualbox-vdi": { + "compressible": true, + "extensions": ["vdi"] + }, + "application/x-virtualbox-vhd": { + "compressible": true, + "extensions": ["vhd"] + }, + "application/x-virtualbox-vmdk": { + "compressible": true, + "extensions": ["vmdk"] + }, + "application/x-wais-source": { + "source": "apache", + "extensions": ["src"] + }, + "application/x-web-app-manifest+json": { + "compressible": true, + "extensions": ["webapp"] + }, + "application/x-www-form-urlencoded": { + "source": "iana", + "compressible": true + }, + "application/x-x509-ca-cert": { + "source": "iana", + "extensions": ["der","crt","pem"] + }, + "application/x-x509-ca-ra-cert": { + "source": "iana" + }, + "application/x-x509-next-ca-cert": { + "source": "iana" + }, + "application/x-xfig": { + "source": "apache", + "extensions": ["fig"] + }, + "application/x-xliff+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xlf"] + }, + "application/x-xpinstall": { + "source": "apache", + "compressible": false, + "extensions": ["xpi"] + }, + "application/x-xz": { + "source": "apache", + "extensions": ["xz"] + }, + "application/x-zip-compressed": { + "extensions": ["zip"] + }, + "application/x-zmachine": { + "source": "apache", + "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] + }, + "application/x400-bp": { + "source": "iana" + }, + "application/xacml+xml": { + "source": "iana", + "compressible": true + }, + "application/xaml+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xaml"] + }, + "application/xcap-att+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xav"] + }, + "application/xcap-caps+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xca"] + }, + "application/xcap-diff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdf"] + }, + "application/xcap-el+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xel"] + }, + "application/xcap-error+xml": { + "source": "iana", + "compressible": true + }, + "application/xcap-ns+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xns"] + }, + "application/xcon-conference-info+xml": { + "source": "iana", + "compressible": true + }, + "application/xcon-conference-info-diff+xml": { + "source": "iana", + "compressible": true + }, + "application/xenc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xenc"] + }, + "application/xfdf": { + "source": "iana", + "extensions": ["xfdf"] + }, + "application/xhtml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtml","xht"] + }, + "application/xhtml-voice+xml": { + "source": "apache", + "compressible": true + }, + "application/xliff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xlf"] + }, + "application/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml","xsl","xsd","rng"] + }, + "application/xml-dtd": { + "source": "iana", + "compressible": true, + "extensions": ["dtd"] + }, + "application/xml-external-parsed-entity": { + "source": "iana" + }, + "application/xml-patch+xml": { + "source": "iana", + "compressible": true + }, + "application/xmpp+xml": { + "source": "iana", + "compressible": true + }, + "application/xop+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xop"] + }, + "application/xproc+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xpl"] + }, + "application/xslt+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xsl","xslt"] + }, + "application/xspf+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xspf"] + }, + "application/xv+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mxml","xhvml","xvml","xvm"] + }, + "application/yaml": { + "source": "iana" + }, + "application/yang": { + "source": "iana", + "extensions": ["yang"] + }, + "application/yang-data+cbor": { + "source": "iana" + }, + "application/yang-data+json": { + "source": "iana", + "compressible": true + }, + "application/yang-data+xml": { + "source": "iana", + "compressible": true + }, + "application/yang-patch+json": { + "source": "iana", + "compressible": true + }, + "application/yang-patch+xml": { + "source": "iana", + "compressible": true + }, + "application/yang-sid+json": { + "source": "iana", + "compressible": true + }, + "application/yin+xml": { + "source": "iana", + "compressible": true, + "extensions": ["yin"] + }, + "application/zip": { + "source": "iana", + "compressible": false, + "extensions": ["zip"] + }, + "application/zip+dotlottie": { + "extensions": ["lottie"] + }, + "application/zlib": { + "source": "iana" + }, + "application/zstd": { + "source": "iana" + }, + "audio/1d-interleaved-parityfec": { + "source": "iana" + }, + "audio/32kadpcm": { + "source": "iana" + }, + "audio/3gpp": { + "source": "iana", + "compressible": false, + "extensions": ["3gpp"] + }, + "audio/3gpp2": { + "source": "iana" + }, + "audio/aac": { + "source": "iana", + "extensions": ["adts","aac"] + }, + "audio/ac3": { + "source": "iana" + }, + "audio/adpcm": { + "source": "apache", + "extensions": ["adp"] + }, + "audio/amr": { + "source": "iana", + "extensions": ["amr"] + }, + "audio/amr-wb": { + "source": "iana" + }, + "audio/amr-wb+": { + "source": "iana" + }, + "audio/aptx": { + "source": "iana" + }, + "audio/asc": { + "source": "iana" + }, + "audio/atrac-advanced-lossless": { + "source": "iana" + }, + "audio/atrac-x": { + "source": "iana" + }, + "audio/atrac3": { + "source": "iana" + }, + "audio/basic": { + "source": "iana", + "compressible": false, + "extensions": ["au","snd"] + }, + "audio/bv16": { + "source": "iana" + }, + "audio/bv32": { + "source": "iana" + }, + "audio/clearmode": { + "source": "iana" + }, + "audio/cn": { + "source": "iana" + }, + "audio/dat12": { + "source": "iana" + }, + "audio/dls": { + "source": "iana" + }, + "audio/dsr-es201108": { + "source": "iana" + }, + "audio/dsr-es202050": { + "source": "iana" + }, + "audio/dsr-es202211": { + "source": "iana" + }, + "audio/dsr-es202212": { + "source": "iana" + }, + "audio/dv": { + "source": "iana" + }, + "audio/dvi4": { + "source": "iana" + }, + "audio/eac3": { + "source": "iana" + }, + "audio/encaprtp": { + "source": "iana" + }, + "audio/evrc": { + "source": "iana" + }, + "audio/evrc-qcp": { + "source": "iana" + }, + "audio/evrc0": { + "source": "iana" + }, + "audio/evrc1": { + "source": "iana" + }, + "audio/evrcb": { + "source": "iana" + }, + "audio/evrcb0": { + "source": "iana" + }, + "audio/evrcb1": { + "source": "iana" + }, + "audio/evrcnw": { + "source": "iana" + }, + "audio/evrcnw0": { + "source": "iana" + }, + "audio/evrcnw1": { + "source": "iana" + }, + "audio/evrcwb": { + "source": "iana" + }, + "audio/evrcwb0": { + "source": "iana" + }, + "audio/evrcwb1": { + "source": "iana" + }, + "audio/evs": { + "source": "iana" + }, + "audio/flac": { + "source": "iana" + }, + "audio/flexfec": { + "source": "iana" + }, + "audio/fwdred": { + "source": "iana" + }, + "audio/g711-0": { + "source": "iana" + }, + "audio/g719": { + "source": "iana" + }, + "audio/g722": { + "source": "iana" + }, + "audio/g7221": { + "source": "iana" + }, + "audio/g723": { + "source": "iana" + }, + "audio/g726-16": { + "source": "iana" + }, + "audio/g726-24": { + "source": "iana" + }, + "audio/g726-32": { + "source": "iana" + }, + "audio/g726-40": { + "source": "iana" + }, + "audio/g728": { + "source": "iana" + }, + "audio/g729": { + "source": "iana" + }, + "audio/g7291": { + "source": "iana" + }, + "audio/g729d": { + "source": "iana" + }, + "audio/g729e": { + "source": "iana" + }, + "audio/gsm": { + "source": "iana" + }, + "audio/gsm-efr": { + "source": "iana" + }, + "audio/gsm-hr-08": { + "source": "iana" + }, + "audio/ilbc": { + "source": "iana" + }, + "audio/ip-mr_v2.5": { + "source": "iana" + }, + "audio/isac": { + "source": "apache" + }, + "audio/l16": { + "source": "iana" + }, + "audio/l20": { + "source": "iana" + }, + "audio/l24": { + "source": "iana", + "compressible": false + }, + "audio/l8": { + "source": "iana" + }, + "audio/lpc": { + "source": "iana" + }, + "audio/matroska": { + "source": "iana" + }, + "audio/melp": { + "source": "iana" + }, + "audio/melp1200": { + "source": "iana" + }, + "audio/melp2400": { + "source": "iana" + }, + "audio/melp600": { + "source": "iana" + }, + "audio/mhas": { + "source": "iana" + }, + "audio/midi": { + "source": "apache", + "extensions": ["mid","midi","kar","rmi"] + }, + "audio/midi-clip": { + "source": "iana" + }, + "audio/mobile-xmf": { + "source": "iana", + "extensions": ["mxmf"] + }, + "audio/mp3": { + "compressible": false, + "extensions": ["mp3"] + }, + "audio/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["m4a","mp4a","m4b"] + }, + "audio/mp4a-latm": { + "source": "iana" + }, + "audio/mpa": { + "source": "iana" + }, + "audio/mpa-robust": { + "source": "iana" + }, + "audio/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] + }, + "audio/mpeg4-generic": { + "source": "iana" + }, + "audio/musepack": { + "source": "apache" + }, + "audio/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["oga","ogg","spx","opus"] + }, + "audio/opus": { + "source": "iana" + }, + "audio/parityfec": { + "source": "iana" + }, + "audio/pcma": { + "source": "iana" + }, + "audio/pcma-wb": { + "source": "iana" + }, + "audio/pcmu": { + "source": "iana" + }, + "audio/pcmu-wb": { + "source": "iana" + }, + "audio/prs.sid": { + "source": "iana" + }, + "audio/qcelp": { + "source": "iana" + }, + "audio/raptorfec": { + "source": "iana" + }, + "audio/red": { + "source": "iana" + }, + "audio/rtp-enc-aescm128": { + "source": "iana" + }, + "audio/rtp-midi": { + "source": "iana" + }, + "audio/rtploopback": { + "source": "iana" + }, + "audio/rtx": { + "source": "iana" + }, + "audio/s3m": { + "source": "apache", + "extensions": ["s3m"] + }, + "audio/scip": { + "source": "iana" + }, + "audio/silk": { + "source": "apache", + "extensions": ["sil"] + }, + "audio/smv": { + "source": "iana" + }, + "audio/smv-qcp": { + "source": "iana" + }, + "audio/smv0": { + "source": "iana" + }, + "audio/sofa": { + "source": "iana" + }, + "audio/sp-midi": { + "source": "iana" + }, + "audio/speex": { + "source": "iana" + }, + "audio/t140c": { + "source": "iana" + }, + "audio/t38": { + "source": "iana" + }, + "audio/telephone-event": { + "source": "iana" + }, + "audio/tetra_acelp": { + "source": "iana" + }, + "audio/tetra_acelp_bb": { + "source": "iana" + }, + "audio/tone": { + "source": "iana" + }, + "audio/tsvcis": { + "source": "iana" + }, + "audio/uemclip": { + "source": "iana" + }, + "audio/ulpfec": { + "source": "iana" + }, + "audio/usac": { + "source": "iana" + }, + "audio/vdvi": { + "source": "iana" + }, + "audio/vmr-wb": { + "source": "iana" + }, + "audio/vnd.3gpp.iufp": { + "source": "iana" + }, + "audio/vnd.4sb": { + "source": "iana" + }, + "audio/vnd.audiokoz": { + "source": "iana" + }, + "audio/vnd.celp": { + "source": "iana" + }, + "audio/vnd.cisco.nse": { + "source": "iana" + }, + "audio/vnd.cmles.radio-events": { + "source": "iana" + }, + "audio/vnd.cns.anp1": { + "source": "iana" + }, + "audio/vnd.cns.inf1": { + "source": "iana" + }, + "audio/vnd.dece.audio": { + "source": "iana", + "extensions": ["uva","uvva"] + }, + "audio/vnd.digital-winds": { + "source": "iana", + "extensions": ["eol"] + }, + "audio/vnd.dlna.adts": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.1": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.2": { + "source": "iana" + }, + "audio/vnd.dolby.mlp": { + "source": "iana" + }, + "audio/vnd.dolby.mps": { + "source": "iana" + }, + "audio/vnd.dolby.pl2": { + "source": "iana" + }, + "audio/vnd.dolby.pl2x": { + "source": "iana" + }, + "audio/vnd.dolby.pl2z": { + "source": "iana" + }, + "audio/vnd.dolby.pulse.1": { + "source": "iana" + }, + "audio/vnd.dra": { + "source": "iana", + "extensions": ["dra"] + }, + "audio/vnd.dts": { + "source": "iana", + "extensions": ["dts"] + }, + "audio/vnd.dts.hd": { + "source": "iana", + "extensions": ["dtshd"] + }, + "audio/vnd.dts.uhd": { + "source": "iana" + }, + "audio/vnd.dvb.file": { + "source": "iana" + }, + "audio/vnd.everad.plj": { + "source": "iana" + }, + "audio/vnd.hns.audio": { + "source": "iana" + }, + "audio/vnd.lucent.voice": { + "source": "iana", + "extensions": ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + "source": "iana", + "extensions": ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + "source": "iana" + }, + "audio/vnd.nortel.vbk": { + "source": "iana" + }, + "audio/vnd.nuera.ecelp4800": { + "source": "iana", + "extensions": ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + "source": "iana", + "extensions": ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + "source": "iana", + "extensions": ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + "source": "iana" + }, + "audio/vnd.presonus.multitrack": { + "source": "iana" + }, + "audio/vnd.qcelp": { + "source": "apache" + }, + "audio/vnd.rhetorex.32kadpcm": { + "source": "iana" + }, + "audio/vnd.rip": { + "source": "iana", + "extensions": ["rip"] + }, + "audio/vnd.rn-realaudio": { + "compressible": false + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + "source": "iana" + }, + "audio/vnd.vmx.cvsd": { + "source": "iana" + }, + "audio/vnd.wave": { + "compressible": false + }, + "audio/vorbis": { + "source": "iana", + "compressible": false + }, + "audio/vorbis-config": { + "source": "iana" + }, + "audio/wav": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/wave": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/webm": { + "source": "apache", + "compressible": false, + "extensions": ["weba"] + }, + "audio/x-aac": { + "source": "apache", + "compressible": false, + "extensions": ["aac"] + }, + "audio/x-aiff": { + "source": "apache", + "extensions": ["aif","aiff","aifc"] + }, + "audio/x-caf": { + "source": "apache", + "compressible": false, + "extensions": ["caf"] + }, + "audio/x-flac": { + "source": "apache", + "extensions": ["flac"] + }, + "audio/x-m4a": { + "source": "nginx", + "extensions": ["m4a"] + }, + "audio/x-matroska": { + "source": "apache", + "extensions": ["mka"] + }, + "audio/x-mpegurl": { + "source": "apache", + "extensions": ["m3u"] + }, + "audio/x-ms-wax": { + "source": "apache", + "extensions": ["wax"] + }, + "audio/x-ms-wma": { + "source": "apache", + "extensions": ["wma"] + }, + "audio/x-pn-realaudio": { + "source": "apache", + "extensions": ["ram","ra"] + }, + "audio/x-pn-realaudio-plugin": { + "source": "apache", + "extensions": ["rmp"] + }, + "audio/x-realaudio": { + "source": "nginx", + "extensions": ["ra"] + }, + "audio/x-tta": { + "source": "apache" + }, + "audio/x-wav": { + "source": "apache", + "extensions": ["wav"] + }, + "audio/xm": { + "source": "apache", + "extensions": ["xm"] + }, + "chemical/x-cdx": { + "source": "apache", + "extensions": ["cdx"] + }, + "chemical/x-cif": { + "source": "apache", + "extensions": ["cif"] + }, + "chemical/x-cmdf": { + "source": "apache", + "extensions": ["cmdf"] + }, + "chemical/x-cml": { + "source": "apache", + "extensions": ["cml"] + }, + "chemical/x-csml": { + "source": "apache", + "extensions": ["csml"] + }, + "chemical/x-pdb": { + "source": "apache" + }, + "chemical/x-xyz": { + "source": "apache", + "extensions": ["xyz"] + }, + "font/collection": { + "source": "iana", + "extensions": ["ttc"] + }, + "font/otf": { + "source": "iana", + "compressible": true, + "extensions": ["otf"] + }, + "font/sfnt": { + "source": "iana" + }, + "font/ttf": { + "source": "iana", + "compressible": true, + "extensions": ["ttf"] + }, + "font/woff": { + "source": "iana", + "extensions": ["woff"] + }, + "font/woff2": { + "source": "iana", + "extensions": ["woff2"] + }, + "image/aces": { + "source": "iana", + "extensions": ["exr"] + }, + "image/apng": { + "source": "iana", + "compressible": false, + "extensions": ["apng"] + }, + "image/avci": { + "source": "iana", + "extensions": ["avci"] + }, + "image/avcs": { + "source": "iana", + "extensions": ["avcs"] + }, + "image/avif": { + "source": "iana", + "compressible": false, + "extensions": ["avif"] + }, + "image/bmp": { + "source": "iana", + "compressible": true, + "extensions": ["bmp","dib"] + }, + "image/cgm": { + "source": "iana", + "extensions": ["cgm"] + }, + "image/dicom-rle": { + "source": "iana", + "extensions": ["drle"] + }, + "image/dpx": { + "source": "iana", + "extensions": ["dpx"] + }, + "image/emf": { + "source": "iana", + "extensions": ["emf"] + }, + "image/fits": { + "source": "iana", + "extensions": ["fits"] + }, + "image/g3fax": { + "source": "iana", + "extensions": ["g3"] + }, + "image/gif": { + "source": "iana", + "compressible": false, + "extensions": ["gif"] + }, + "image/heic": { + "source": "iana", + "extensions": ["heic"] + }, + "image/heic-sequence": { + "source": "iana", + "extensions": ["heics"] + }, + "image/heif": { + "source": "iana", + "extensions": ["heif"] + }, + "image/heif-sequence": { + "source": "iana", + "extensions": ["heifs"] + }, + "image/hej2k": { + "source": "iana", + "extensions": ["hej2"] + }, + "image/ief": { + "source": "iana", + "extensions": ["ief"] + }, + "image/j2c": { + "source": "iana" + }, + "image/jaii": { + "source": "iana", + "extensions": ["jaii"] + }, + "image/jais": { + "source": "iana", + "extensions": ["jais"] + }, + "image/jls": { + "source": "iana", + "extensions": ["jls"] + }, + "image/jp2": { + "source": "iana", + "compressible": false, + "extensions": ["jp2","jpg2"] + }, + "image/jpeg": { + "source": "iana", + "compressible": false, + "extensions": ["jpg","jpeg","jpe"] + }, + "image/jph": { + "source": "iana", + "extensions": ["jph"] + }, + "image/jphc": { + "source": "iana", + "extensions": ["jhc"] + }, + "image/jpm": { + "source": "iana", + "compressible": false, + "extensions": ["jpm","jpgm"] + }, + "image/jpx": { + "source": "iana", + "compressible": false, + "extensions": ["jpx","jpf"] + }, + "image/jxl": { + "source": "iana", + "extensions": ["jxl"] + }, + "image/jxr": { + "source": "iana", + "extensions": ["jxr"] + }, + "image/jxra": { + "source": "iana", + "extensions": ["jxra"] + }, + "image/jxrs": { + "source": "iana", + "extensions": ["jxrs"] + }, + "image/jxs": { + "source": "iana", + "extensions": ["jxs"] + }, + "image/jxsc": { + "source": "iana", + "extensions": ["jxsc"] + }, + "image/jxsi": { + "source": "iana", + "extensions": ["jxsi"] + }, + "image/jxss": { + "source": "iana", + "extensions": ["jxss"] + }, + "image/ktx": { + "source": "iana", + "extensions": ["ktx"] + }, + "image/ktx2": { + "source": "iana", + "extensions": ["ktx2"] + }, + "image/naplps": { + "source": "iana" + }, + "image/pjpeg": { + "compressible": false, + "extensions": ["jfif"] + }, + "image/png": { + "source": "iana", + "compressible": false, + "extensions": ["png"] + }, + "image/prs.btif": { + "source": "iana", + "extensions": ["btif","btf"] + }, + "image/prs.pti": { + "source": "iana", + "extensions": ["pti"] + }, + "image/pwg-raster": { + "source": "iana" + }, + "image/sgi": { + "source": "apache", + "extensions": ["sgi"] + }, + "image/svg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["svg","svgz"] + }, + "image/t38": { + "source": "iana", + "extensions": ["t38"] + }, + "image/tiff": { + "source": "iana", + "compressible": false, + "extensions": ["tif","tiff"] + }, + "image/tiff-fx": { + "source": "iana", + "extensions": ["tfx"] + }, + "image/vnd.adobe.photoshop": { + "source": "iana", + "compressible": true, + "extensions": ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + "source": "iana", + "extensions": ["azv"] + }, + "image/vnd.clip": { + "source": "iana" + }, + "image/vnd.cns.inf2": { + "source": "iana" + }, + "image/vnd.dece.graphic": { + "source": "iana", + "extensions": ["uvi","uvvi","uvg","uvvg"] + }, + "image/vnd.djvu": { + "source": "iana", + "extensions": ["djvu","djv"] + }, + "image/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "image/vnd.dwg": { + "source": "iana", + "extensions": ["dwg"] + }, + "image/vnd.dxf": { + "source": "iana", + "extensions": ["dxf"] + }, + "image/vnd.fastbidsheet": { + "source": "iana", + "extensions": ["fbs"] + }, + "image/vnd.fpx": { + "source": "iana", + "extensions": ["fpx"] + }, + "image/vnd.fst": { + "source": "iana", + "extensions": ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + "source": "iana", + "extensions": ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + "source": "iana", + "extensions": ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + "source": "iana" + }, + "image/vnd.microsoft.icon": { + "source": "iana", + "compressible": true, + "extensions": ["ico"] + }, + "image/vnd.mix": { + "source": "iana" + }, + "image/vnd.mozilla.apng": { + "source": "iana" + }, + "image/vnd.ms-dds": { + "compressible": true, + "extensions": ["dds"] + }, + "image/vnd.ms-modi": { + "source": "iana", + "extensions": ["mdi"] + }, + "image/vnd.ms-photo": { + "source": "apache", + "extensions": ["wdp"] + }, + "image/vnd.net-fpx": { + "source": "iana", + "extensions": ["npx"] + }, + "image/vnd.pco.b16": { + "source": "iana", + "extensions": ["b16"] + }, + "image/vnd.radiance": { + "source": "iana" + }, + "image/vnd.sealed.png": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.jpg": { + "source": "iana" + }, + "image/vnd.svf": { + "source": "iana" + }, + "image/vnd.tencent.tap": { + "source": "iana", + "extensions": ["tap"] + }, + "image/vnd.valve.source.texture": { + "source": "iana", + "extensions": ["vtf"] + }, + "image/vnd.wap.wbmp": { + "source": "iana", + "extensions": ["wbmp"] + }, + "image/vnd.xiff": { + "source": "iana", + "extensions": ["xif"] + }, + "image/vnd.zbrush.pcx": { + "source": "iana", + "extensions": ["pcx"] + }, + "image/webp": { + "source": "iana", + "extensions": ["webp"] + }, + "image/wmf": { + "source": "iana", + "extensions": ["wmf"] + }, + "image/x-3ds": { + "source": "apache", + "extensions": ["3ds"] + }, + "image/x-adobe-dng": { + "extensions": ["dng"] + }, + "image/x-cmu-raster": { + "source": "apache", + "extensions": ["ras"] + }, + "image/x-cmx": { + "source": "apache", + "extensions": ["cmx"] + }, + "image/x-emf": { + "source": "iana" + }, + "image/x-freehand": { + "source": "apache", + "extensions": ["fh","fhc","fh4","fh5","fh7"] + }, + "image/x-icon": { + "source": "apache", + "compressible": true, + "extensions": ["ico"] + }, + "image/x-jng": { + "source": "nginx", + "extensions": ["jng"] + }, + "image/x-mrsid-image": { + "source": "apache", + "extensions": ["sid"] + }, + "image/x-ms-bmp": { + "source": "nginx", + "compressible": true, + "extensions": ["bmp"] + }, + "image/x-pcx": { + "source": "apache", + "extensions": ["pcx"] + }, + "image/x-pict": { + "source": "apache", + "extensions": ["pic","pct"] + }, + "image/x-portable-anymap": { + "source": "apache", + "extensions": ["pnm"] + }, + "image/x-portable-bitmap": { + "source": "apache", + "extensions": ["pbm"] + }, + "image/x-portable-graymap": { + "source": "apache", + "extensions": ["pgm"] + }, + "image/x-portable-pixmap": { + "source": "apache", + "extensions": ["ppm"] + }, + "image/x-rgb": { + "source": "apache", + "extensions": ["rgb"] + }, + "image/x-tga": { + "source": "apache", + "extensions": ["tga"] + }, + "image/x-wmf": { + "source": "iana" + }, + "image/x-xbitmap": { + "source": "apache", + "extensions": ["xbm"] + }, + "image/x-xcf": { + "compressible": false + }, + "image/x-xpixmap": { + "source": "apache", + "extensions": ["xpm"] + }, + "image/x-xwindowdump": { + "source": "apache", + "extensions": ["xwd"] + }, + "message/bhttp": { + "source": "iana" + }, + "message/cpim": { + "source": "iana" + }, + "message/delivery-status": { + "source": "iana" + }, + "message/disposition-notification": { + "source": "iana", + "extensions": [ + "disposition-notification" + ] + }, + "message/external-body": { + "source": "iana" + }, + "message/feedback-report": { + "source": "iana" + }, + "message/global": { + "source": "iana", + "extensions": ["u8msg"] + }, + "message/global-delivery-status": { + "source": "iana", + "extensions": ["u8dsn"] + }, + "message/global-disposition-notification": { + "source": "iana", + "extensions": ["u8mdn"] + }, + "message/global-headers": { + "source": "iana", + "extensions": ["u8hdr"] + }, + "message/http": { + "source": "iana", + "compressible": false + }, + "message/imdn+xml": { + "source": "iana", + "compressible": true + }, + "message/mls": { + "source": "iana" + }, + "message/news": { + "source": "apache" + }, + "message/ohttp-req": { + "source": "iana" + }, + "message/ohttp-res": { + "source": "iana" + }, + "message/partial": { + "source": "iana", + "compressible": false + }, + "message/rfc822": { + "source": "iana", + "compressible": true, + "extensions": ["eml","mime","mht","mhtml"] + }, + "message/s-http": { + "source": "apache" + }, + "message/sip": { + "source": "iana" + }, + "message/sipfrag": { + "source": "iana" + }, + "message/tracking-status": { + "source": "iana" + }, + "message/vnd.si.simp": { + "source": "apache" + }, + "message/vnd.wfa.wsc": { + "source": "iana", + "extensions": ["wsc"] + }, + "model/3mf": { + "source": "iana", + "extensions": ["3mf"] + }, + "model/e57": { + "source": "iana" + }, + "model/gltf+json": { + "source": "iana", + "compressible": true, + "extensions": ["gltf"] + }, + "model/gltf-binary": { + "source": "iana", + "compressible": true, + "extensions": ["glb"] + }, + "model/iges": { + "source": "iana", + "compressible": false, + "extensions": ["igs","iges"] + }, + "model/jt": { + "source": "iana", + "extensions": ["jt"] + }, + "model/mesh": { + "source": "iana", + "compressible": false, + "extensions": ["msh","mesh","silo"] + }, + "model/mtl": { + "source": "iana", + "extensions": ["mtl"] + }, + "model/obj": { + "source": "iana", + "extensions": ["obj"] + }, + "model/prc": { + "source": "iana", + "extensions": ["prc"] + }, + "model/step": { + "source": "iana", + "extensions": ["step","stp","stpnc","p21","210"] + }, + "model/step+xml": { + "source": "iana", + "compressible": true, + "extensions": ["stpx"] + }, + "model/step+zip": { + "source": "iana", + "compressible": false, + "extensions": ["stpz"] + }, + "model/step-xml+zip": { + "source": "iana", + "compressible": false, + "extensions": ["stpxz"] + }, + "model/stl": { + "source": "iana", + "extensions": ["stl"] + }, + "model/u3d": { + "source": "iana", + "extensions": ["u3d"] + }, + "model/vnd.bary": { + "source": "iana", + "extensions": ["bary"] + }, + "model/vnd.cld": { + "source": "iana", + "extensions": ["cld"] + }, + "model/vnd.collada+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dae"] + }, + "model/vnd.dwf": { + "source": "iana", + "extensions": ["dwf"] + }, + "model/vnd.flatland.3dml": { + "source": "iana" + }, + "model/vnd.gdl": { + "source": "iana", + "extensions": ["gdl"] + }, + "model/vnd.gs-gdl": { + "source": "apache" + }, + "model/vnd.gs.gdl": { + "source": "iana" + }, + "model/vnd.gtw": { + "source": "iana", + "extensions": ["gtw"] + }, + "model/vnd.moml+xml": { + "source": "iana", + "compressible": true + }, + "model/vnd.mts": { + "source": "iana", + "extensions": ["mts"] + }, + "model/vnd.opengex": { + "source": "iana", + "extensions": ["ogex"] + }, + "model/vnd.parasolid.transmit.binary": { + "source": "iana", + "extensions": ["x_b"] + }, + "model/vnd.parasolid.transmit.text": { + "source": "iana", + "extensions": ["x_t"] + }, + "model/vnd.pytha.pyox": { + "source": "iana", + "extensions": ["pyo","pyox"] + }, + "model/vnd.rosette.annotated-data-model": { + "source": "iana" + }, + "model/vnd.sap.vds": { + "source": "iana", + "extensions": ["vds"] + }, + "model/vnd.usda": { + "source": "iana", + "extensions": ["usda"] + }, + "model/vnd.usdz+zip": { + "source": "iana", + "compressible": false, + "extensions": ["usdz"] + }, + "model/vnd.valve.source.compiled-map": { + "source": "iana", + "extensions": ["bsp"] + }, + "model/vnd.vtu": { + "source": "iana", + "extensions": ["vtu"] + }, + "model/vrml": { + "source": "iana", + "compressible": false, + "extensions": ["wrl","vrml"] + }, + "model/x3d+binary": { + "source": "apache", + "compressible": false, + "extensions": ["x3db","x3dbz"] + }, + "model/x3d+fastinfoset": { + "source": "iana", + "extensions": ["x3db"] + }, + "model/x3d+vrml": { + "source": "apache", + "compressible": false, + "extensions": ["x3dv","x3dvz"] + }, + "model/x3d+xml": { + "source": "iana", + "compressible": true, + "extensions": ["x3d","x3dz"] + }, + "model/x3d-vrml": { + "source": "iana", + "extensions": ["x3dv"] + }, + "multipart/alternative": { + "source": "iana", + "compressible": false + }, + "multipart/appledouble": { + "source": "iana" + }, + "multipart/byteranges": { + "source": "iana" + }, + "multipart/digest": { + "source": "iana" + }, + "multipart/encrypted": { + "source": "iana", + "compressible": false + }, + "multipart/form-data": { + "source": "iana", + "compressible": false + }, + "multipart/header-set": { + "source": "iana" + }, + "multipart/mixed": { + "source": "iana" + }, + "multipart/multilingual": { + "source": "iana" + }, + "multipart/parallel": { + "source": "iana" + }, + "multipart/related": { + "source": "iana", + "compressible": false + }, + "multipart/report": { + "source": "iana" + }, + "multipart/signed": { + "source": "iana", + "compressible": false + }, + "multipart/vnd.bint.med-plus": { + "source": "iana" + }, + "multipart/voice-message": { + "source": "iana" + }, + "multipart/x-mixed-replace": { + "source": "iana" + }, + "text/1d-interleaved-parityfec": { + "source": "iana" + }, + "text/cache-manifest": { + "source": "iana", + "compressible": true, + "extensions": ["appcache","manifest"] + }, + "text/calendar": { + "source": "iana", + "extensions": ["ics","ifb"] + }, + "text/calender": { + "compressible": true + }, + "text/cmd": { + "compressible": true + }, + "text/coffeescript": { + "extensions": ["coffee","litcoffee"] + }, + "text/cql": { + "source": "iana" + }, + "text/cql-expression": { + "source": "iana" + }, + "text/cql-identifier": { + "source": "iana" + }, + "text/css": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["css"] + }, + "text/csv": { + "source": "iana", + "compressible": true, + "extensions": ["csv"] + }, + "text/csv-schema": { + "source": "iana" + }, + "text/directory": { + "source": "iana" + }, + "text/dns": { + "source": "iana" + }, + "text/ecmascript": { + "source": "apache" + }, + "text/encaprtp": { + "source": "iana" + }, + "text/enriched": { + "source": "iana" + }, + "text/fhirpath": { + "source": "iana" + }, + "text/flexfec": { + "source": "iana" + }, + "text/fwdred": { + "source": "iana" + }, + "text/gff3": { + "source": "iana" + }, + "text/grammar-ref-list": { + "source": "iana" + }, + "text/hl7v2": { + "source": "iana" + }, + "text/html": { + "source": "iana", + "compressible": true, + "extensions": ["html","htm","shtml"] + }, + "text/jade": { + "extensions": ["jade"] + }, + "text/javascript": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js","mjs"] + }, + "text/jcr-cnd": { + "source": "iana" + }, + "text/jsx": { + "compressible": true, + "extensions": ["jsx"] + }, + "text/less": { + "compressible": true, + "extensions": ["less"] + }, + "text/markdown": { + "source": "iana", + "compressible": true, + "extensions": ["md","markdown"] + }, + "text/mathml": { + "source": "nginx", + "extensions": ["mml"] + }, + "text/mdx": { + "compressible": true, + "extensions": ["mdx"] + }, + "text/mizar": { + "source": "iana" + }, + "text/n3": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["n3"] + }, + "text/parameters": { + "source": "iana", + "charset": "UTF-8" + }, + "text/parityfec": { + "source": "iana" + }, + "text/plain": { + "source": "iana", + "compressible": true, + "extensions": ["txt","text","conf","def","list","log","in","ini"] + }, + "text/provenance-notation": { + "source": "iana", + "charset": "UTF-8" + }, + "text/prs.fallenstein.rst": { + "source": "iana" + }, + "text/prs.lines.tag": { + "source": "iana", + "extensions": ["dsc"] + }, + "text/prs.prop.logic": { + "source": "iana" + }, + "text/prs.texi": { + "source": "iana" + }, + "text/raptorfec": { + "source": "iana" + }, + "text/red": { + "source": "iana" + }, + "text/rfc822-headers": { + "source": "iana" + }, + "text/richtext": { + "source": "iana", + "compressible": true, + "extensions": ["rtx"] + }, + "text/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "text/rtp-enc-aescm128": { + "source": "iana" + }, + "text/rtploopback": { + "source": "iana" + }, + "text/rtx": { + "source": "iana" + }, + "text/sgml": { + "source": "iana", + "extensions": ["sgml","sgm"] + }, + "text/shaclc": { + "source": "iana" + }, + "text/shex": { + "source": "iana", + "extensions": ["shex"] + }, + "text/slim": { + "extensions": ["slim","slm"] + }, + "text/spdx": { + "source": "iana", + "extensions": ["spdx"] + }, + "text/strings": { + "source": "iana" + }, + "text/stylus": { + "extensions": ["stylus","styl"] + }, + "text/t140": { + "source": "iana" + }, + "text/tab-separated-values": { + "source": "iana", + "compressible": true, + "extensions": ["tsv"] + }, + "text/troff": { + "source": "iana", + "extensions": ["t","tr","roff","man","me","ms"] + }, + "text/turtle": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["ttl"] + }, + "text/ulpfec": { + "source": "iana" + }, + "text/uri-list": { + "source": "iana", + "compressible": true, + "extensions": ["uri","uris","urls"] + }, + "text/vcard": { + "source": "iana", + "compressible": true, + "extensions": ["vcard"] + }, + "text/vnd.a": { + "source": "iana" + }, + "text/vnd.abc": { + "source": "iana" + }, + "text/vnd.ascii-art": { + "source": "iana" + }, + "text/vnd.curl": { + "source": "iana", + "extensions": ["curl"] + }, + "text/vnd.curl.dcurl": { + "source": "apache", + "extensions": ["dcurl"] + }, + "text/vnd.curl.mcurl": { + "source": "apache", + "extensions": ["mcurl"] + }, + "text/vnd.curl.scurl": { + "source": "apache", + "extensions": ["scurl"] + }, + "text/vnd.debian.copyright": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.dmclientscript": { + "source": "iana" + }, + "text/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.exchangeable": { + "source": "iana" + }, + "text/vnd.familysearch.gedcom": { + "source": "iana", + "extensions": ["ged"] + }, + "text/vnd.ficlab.flt": { + "source": "iana" + }, + "text/vnd.fly": { + "source": "iana", + "extensions": ["fly"] + }, + "text/vnd.fmi.flexstor": { + "source": "iana", + "extensions": ["flx"] + }, + "text/vnd.gml": { + "source": "iana" + }, + "text/vnd.graphviz": { + "source": "iana", + "extensions": ["gv"] + }, + "text/vnd.hans": { + "source": "iana" + }, + "text/vnd.hgl": { + "source": "iana" + }, + "text/vnd.in3d.3dml": { + "source": "iana", + "extensions": ["3dml"] + }, + "text/vnd.in3d.spot": { + "source": "iana", + "extensions": ["spot"] + }, + "text/vnd.iptc.newsml": { + "source": "iana" + }, + "text/vnd.iptc.nitf": { + "source": "iana" + }, + "text/vnd.latex-z": { + "source": "iana" + }, + "text/vnd.motorola.reflex": { + "source": "iana" + }, + "text/vnd.ms-mediapackage": { + "source": "iana" + }, + "text/vnd.net2phone.commcenter.command": { + "source": "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + "source": "iana" + }, + "text/vnd.senx.warpscript": { + "source": "iana" + }, + "text/vnd.si.uricatalogue": { + "source": "apache" + }, + "text/vnd.sosi": { + "source": "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["jad"] + }, + "text/vnd.trolltech.linguist": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.vcf": { + "source": "iana" + }, + "text/vnd.wap.si": { + "source": "iana" + }, + "text/vnd.wap.sl": { + "source": "iana" + }, + "text/vnd.wap.wml": { + "source": "iana", + "extensions": ["wml"] + }, + "text/vnd.wap.wmlscript": { + "source": "iana", + "extensions": ["wmls"] + }, + "text/vnd.zoo.kcl": { + "source": "iana" + }, + "text/vtt": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["vtt"] + }, + "text/wgsl": { + "source": "iana", + "extensions": ["wgsl"] + }, + "text/x-asm": { + "source": "apache", + "extensions": ["s","asm"] + }, + "text/x-c": { + "source": "apache", + "extensions": ["c","cc","cxx","cpp","h","hh","dic"] + }, + "text/x-component": { + "source": "nginx", + "extensions": ["htc"] + }, + "text/x-fortran": { + "source": "apache", + "extensions": ["f","for","f77","f90"] + }, + "text/x-gwt-rpc": { + "compressible": true + }, + "text/x-handlebars-template": { + "extensions": ["hbs"] + }, + "text/x-java-source": { + "source": "apache", + "extensions": ["java"] + }, + "text/x-jquery-tmpl": { + "compressible": true + }, + "text/x-lua": { + "extensions": ["lua"] + }, + "text/x-markdown": { + "compressible": true, + "extensions": ["mkd"] + }, + "text/x-nfo": { + "source": "apache", + "extensions": ["nfo"] + }, + "text/x-opml": { + "source": "apache", + "extensions": ["opml"] + }, + "text/x-org": { + "compressible": true, + "extensions": ["org"] + }, + "text/x-pascal": { + "source": "apache", + "extensions": ["p","pas"] + }, + "text/x-processing": { + "compressible": true, + "extensions": ["pde"] + }, + "text/x-sass": { + "extensions": ["sass"] + }, + "text/x-scss": { + "extensions": ["scss"] + }, + "text/x-setext": { + "source": "apache", + "extensions": ["etx"] + }, + "text/x-sfv": { + "source": "apache", + "extensions": ["sfv"] + }, + "text/x-suse-ymp": { + "compressible": true, + "extensions": ["ymp"] + }, + "text/x-uuencode": { + "source": "apache", + "extensions": ["uu"] + }, + "text/x-vcalendar": { + "source": "apache", + "extensions": ["vcs"] + }, + "text/x-vcard": { + "source": "apache", + "extensions": ["vcf"] + }, + "text/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml"] + }, + "text/xml-external-parsed-entity": { + "source": "iana" + }, + "text/yaml": { + "compressible": true, + "extensions": ["yaml","yml"] + }, + "video/1d-interleaved-parityfec": { + "source": "iana" + }, + "video/3gpp": { + "source": "iana", + "extensions": ["3gp","3gpp"] + }, + "video/3gpp-tt": { + "source": "iana" + }, + "video/3gpp2": { + "source": "iana", + "extensions": ["3g2"] + }, + "video/av1": { + "source": "iana" + }, + "video/bmpeg": { + "source": "iana" + }, + "video/bt656": { + "source": "iana" + }, + "video/celb": { + "source": "iana" + }, + "video/dv": { + "source": "iana" + }, + "video/encaprtp": { + "source": "iana" + }, + "video/evc": { + "source": "iana" + }, + "video/ffv1": { + "source": "iana" + }, + "video/flexfec": { + "source": "iana" + }, + "video/h261": { + "source": "iana", + "extensions": ["h261"] + }, + "video/h263": { + "source": "iana", + "extensions": ["h263"] + }, + "video/h263-1998": { + "source": "iana" + }, + "video/h263-2000": { + "source": "iana" + }, + "video/h264": { + "source": "iana", + "extensions": ["h264"] + }, + "video/h264-rcdo": { + "source": "iana" + }, + "video/h264-svc": { + "source": "iana" + }, + "video/h265": { + "source": "iana" + }, + "video/h266": { + "source": "iana" + }, + "video/iso.segment": { + "source": "iana", + "extensions": ["m4s"] + }, + "video/jpeg": { + "source": "iana", + "extensions": ["jpgv"] + }, + "video/jpeg2000": { + "source": "iana" + }, + "video/jpm": { + "source": "apache", + "extensions": ["jpm","jpgm"] + }, + "video/jxsv": { + "source": "iana" + }, + "video/lottie+json": { + "source": "iana", + "compressible": true + }, + "video/matroska": { + "source": "iana" + }, + "video/matroska-3d": { + "source": "iana" + }, + "video/mj2": { + "source": "iana", + "extensions": ["mj2","mjp2"] + }, + "video/mp1s": { + "source": "iana" + }, + "video/mp2p": { + "source": "iana" + }, + "video/mp2t": { + "source": "iana", + "extensions": ["ts","m2t","m2ts","mts"] + }, + "video/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["mp4","mp4v","mpg4"] + }, + "video/mp4v-es": { + "source": "iana" + }, + "video/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpeg","mpg","mpe","m1v","m2v"] + }, + "video/mpeg4-generic": { + "source": "iana" + }, + "video/mpv": { + "source": "iana" + }, + "video/nv": { + "source": "iana" + }, + "video/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogv"] + }, + "video/parityfec": { + "source": "iana" + }, + "video/pointer": { + "source": "iana" + }, + "video/quicktime": { + "source": "iana", + "compressible": false, + "extensions": ["qt","mov"] + }, + "video/raptorfec": { + "source": "iana" + }, + "video/raw": { + "source": "iana" + }, + "video/rtp-enc-aescm128": { + "source": "iana" + }, + "video/rtploopback": { + "source": "iana" + }, + "video/rtx": { + "source": "iana" + }, + "video/scip": { + "source": "iana" + }, + "video/smpte291": { + "source": "iana" + }, + "video/smpte292m": { + "source": "iana" + }, + "video/ulpfec": { + "source": "iana" + }, + "video/vc1": { + "source": "iana" + }, + "video/vc2": { + "source": "iana" + }, + "video/vnd.cctv": { + "source": "iana" + }, + "video/vnd.dece.hd": { + "source": "iana", + "extensions": ["uvh","uvvh"] + }, + "video/vnd.dece.mobile": { + "source": "iana", + "extensions": ["uvm","uvvm"] + }, + "video/vnd.dece.mp4": { + "source": "iana" + }, + "video/vnd.dece.pd": { + "source": "iana", + "extensions": ["uvp","uvvp"] + }, + "video/vnd.dece.sd": { + "source": "iana", + "extensions": ["uvs","uvvs"] + }, + "video/vnd.dece.video": { + "source": "iana", + "extensions": ["uvv","uvvv"] + }, + "video/vnd.directv.mpeg": { + "source": "iana" + }, + "video/vnd.directv.mpeg-tts": { + "source": "iana" + }, + "video/vnd.dlna.mpeg-tts": { + "source": "iana" + }, + "video/vnd.dvb.file": { + "source": "iana", + "extensions": ["dvb"] + }, + "video/vnd.fvt": { + "source": "iana", + "extensions": ["fvt"] + }, + "video/vnd.hns.video": { + "source": "iana" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + "source": "iana" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + "source": "iana" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + "source": "iana" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + "source": "iana" + }, + "video/vnd.iptvforum.ttsavc": { + "source": "iana" + }, + "video/vnd.iptvforum.ttsmpeg2": { + "source": "iana" + }, + "video/vnd.motorola.video": { + "source": "iana" + }, + "video/vnd.motorola.videop": { + "source": "iana" + }, + "video/vnd.mpegurl": { + "source": "iana", + "extensions": ["mxu","m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + "source": "iana", + "extensions": ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + "source": "iana" + }, + "video/vnd.nokia.mp4vr": { + "source": "iana" + }, + "video/vnd.nokia.videovoip": { + "source": "iana" + }, + "video/vnd.objectvideo": { + "source": "iana" + }, + "video/vnd.planar": { + "source": "iana" + }, + "video/vnd.radgamettools.bink": { + "source": "iana" + }, + "video/vnd.radgamettools.smacker": { + "source": "apache" + }, + "video/vnd.sealed.mpeg1": { + "source": "iana" + }, + "video/vnd.sealed.mpeg4": { + "source": "iana" + }, + "video/vnd.sealed.swf": { + "source": "iana" + }, + "video/vnd.sealedmedia.softseal.mov": { + "source": "iana" + }, + "video/vnd.uvvu.mp4": { + "source": "iana", + "extensions": ["uvu","uvvu"] + }, + "video/vnd.vivo": { + "source": "iana", + "extensions": ["viv"] + }, + "video/vnd.youtube.yt": { + "source": "iana" + }, + "video/vp8": { + "source": "iana" + }, + "video/vp9": { + "source": "iana" + }, + "video/webm": { + "source": "apache", + "compressible": false, + "extensions": ["webm"] + }, + "video/x-f4v": { + "source": "apache", + "extensions": ["f4v"] + }, + "video/x-fli": { + "source": "apache", + "extensions": ["fli"] + }, + "video/x-flv": { + "source": "apache", + "compressible": false, + "extensions": ["flv"] + }, + "video/x-m4v": { + "source": "apache", + "extensions": ["m4v"] + }, + "video/x-matroska": { + "source": "apache", + "compressible": false, + "extensions": ["mkv","mk3d","mks"] + }, + "video/x-mng": { + "source": "apache", + "extensions": ["mng"] + }, + "video/x-ms-asf": { + "source": "apache", + "extensions": ["asf","asx"] + }, + "video/x-ms-vob": { + "source": "apache", + "extensions": ["vob"] + }, + "video/x-ms-wm": { + "source": "apache", + "extensions": ["wm"] + }, + "video/x-ms-wmv": { + "source": "apache", + "compressible": false, + "extensions": ["wmv"] + }, + "video/x-ms-wmx": { + "source": "apache", + "extensions": ["wmx"] + }, + "video/x-ms-wvx": { + "source": "apache", + "extensions": ["wvx"] + }, + "video/x-msvideo": { + "source": "apache", + "extensions": ["avi"] + }, + "video/x-sgi-movie": { + "source": "apache", + "extensions": ["movie"] + }, + "video/x-smv": { + "source": "apache", + "extensions": ["smv"] + }, + "x-conference/x-cooltalk": { + "source": "apache", + "extensions": ["ice"] + }, + "x-shader/x-fragment": { + "compressible": true + }, + "x-shader/x-vertex": { + "compressible": true + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-db/index.js b/node_modules/@nestjs/platform-express/node_modules/mime-db/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ec2be30de1663c20ea2166f33a583c9c0b84d029 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-db/index.js @@ -0,0 +1,12 @@ +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = require('./db.json') diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-db/package.json b/node_modules/@nestjs/platform-express/node_modules/mime-db/package.json new file mode 100644 index 0000000000000000000000000000000000000000..289a370c8f644df453d0fb395ba4a5f3fd0d3e27 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-db/package.json @@ -0,0 +1,56 @@ +{ + "name": "mime-db", + "description": "Media Type Database", + "version": "1.54.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)", + "Robert Kieffer (http://github.com/broofa)" + ], + "license": "MIT", + "keywords": [ + "mime", + "db", + "type", + "types", + "database", + "charset", + "charsets" + ], + "repository": "jshttp/mime-db", + "devDependencies": { + "csv-parse": "4.16.3", + "eslint": "8.32.0", + "eslint-config-standard": "15.0.1", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-markdown": "3.0.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.1.1", + "eslint-plugin-standard": "4.1.0", + "media-typer": "1.1.0", + "mocha": "10.2.0", + "nyc": "15.1.0", + "stream-to-array": "2.3.0", + "undici": "7.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "db.json", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "build": "node scripts/build", + "fetch": "node scripts/fetch-apache && node scripts/fetch-iana && node scripts/fetch-nginx", + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "update": "npm run fetch && npm run build", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-types/HISTORY.md b/node_modules/@nestjs/platform-express/node_modules/mime-types/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..9ba2dc077dd9f5ed292fcf3d7eaa2c396765a9d1 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-types/HISTORY.md @@ -0,0 +1,428 @@ +3.0.2 / 2025-11-20 +=================== + +* Fix: update JSDoc to reflect that functions return only `false` or `string`, not `boolean|string`. +* Fix: refined mime-score logic so `.mp4` resolves correctly +* Fix:reflect the current Node.js version supported to ≥ 18 (See 3.0.0 for more details). + +3.0.1 / 2025-03-26 +=================== + +* deps: mime-db@1.54.0 + +3.0.0 / 2024-08-31 +=================== + +* Drop support for node <18 +* deps: mime-db@1.53.0 +* resolve extension conflicts with mime-score (#119) + * asc -> application/pgp-signature is now application/pgp-keys + * mpp -> application/vnd.ms-project is now application/dash-patch+xml + * ac -> application/vnd.nokia.n-gage.ac+xml is now application/pkix-attr-cert + * bdoc -> application/x-bdoc is now application/bdoc + * wmz -> application/x-msmetafile is now application/x-ms-wmz + * xsl -> application/xslt+xml is now application/xml + * wav -> audio/wave is now audio/wav + * rtf -> text/rtf is now application/rtf + * xml -> text/xml is now application/xml + * mp4 -> video/mp4 is now application/mp4 + * mpg4 -> video/mp4 is now application/mp4 + + +2.1.35 / 2022-03-12 +=================== + + * deps: mime-db@1.52.0 + - Add extensions from IANA for more `image/*` types + - Add extension `.asc` to `application/pgp-keys` + - Add extensions to various XML types + - Add new upstream MIME types + +2.1.34 / 2021-11-08 +=================== + + * deps: mime-db@1.51.0 + - Add new upstream MIME types + +2.1.33 / 2021-10-01 +=================== + + * deps: mime-db@1.50.0 + - Add deprecated iWorks mime types and extensions + - Add new upstream MIME types + +2.1.32 / 2021-07-27 +=================== + + * deps: mime-db@1.49.0 + - Add extension `.trig` to `application/trig` + - Add new upstream MIME types + +2.1.31 / 2021-06-01 +=================== + + * deps: mime-db@1.48.0 + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add new upstream MIME types + +2.1.30 / 2021-04-02 +=================== + + * deps: mime-db@1.47.0 + - Add extension `.amr` to `audio/amr` + - Remove ambigious extensions from IANA for `application/*+xml` types + - Update primary extension to `.es` for `application/ecmascript` + +2.1.29 / 2021-02-17 +=================== + + * deps: mime-db@1.46.0 + - Add extension `.amr` to `audio/amr` + - Add extension `.m4s` to `video/iso.segment` + - Add extension `.opus` to `audio/ogg` + - Add new upstream MIME types + +2.1.28 / 2021-01-01 +=================== + + * deps: mime-db@1.45.0 + - Add `application/ubjson` with extension `.ubj` + - Add `image/avif` with extension `.avif` + - Add `image/ktx2` with extension `.ktx2` + - Add extension `.dbf` to `application/vnd.dbf` + - Add extension `.rar` to `application/vnd.rar` + - Add extension `.td` to `application/urc-targetdesc+xml` + - Add new upstream MIME types + - Fix extension of `application/vnd.apple.keynote` to be `.key` + +2.1.27 / 2020-04-23 +=================== + + * deps: mime-db@1.44.0 + - Add charsets from IANA + - Add extension `.cjs` to `application/node` + - Add new upstream MIME types + +2.1.26 / 2020-01-05 +=================== + + * deps: mime-db@1.43.0 + - Add `application/x-keepass2` with extension `.kdbx` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extensions from IANA for `application/*+xml` types + - Add new upstream MIME types + +2.1.25 / 2019-11-12 +=================== + + * deps: mime-db@1.42.0 + - Add new upstream MIME types + - Add `application/toml` with extension `.toml` + - Add `image/vnd.ms-dds` with extension `.dds` + +2.1.24 / 2019-04-20 +=================== + + * deps: mime-db@1.40.0 + - Add extensions from IANA for `model/*` types + - Add `text/mdx` with extension `.mdx` + +2.1.23 / 2019-04-17 +=================== + + * deps: mime-db@~1.39.0 + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add new upstream MIME types + +2.1.22 / 2019-02-14 +=================== + + * deps: mime-db@~1.38.0 + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add new upstream MIME types + +2.1.21 / 2018-10-19 +=================== + + * deps: mime-db@~1.37.0 + - Add extensions to HEIC image types + - Add new upstream MIME types + +2.1.20 / 2018-08-26 +=================== + + * deps: mime-db@~1.36.0 + - Add Apple file extensions from IANA + - Add extensions from IANA for `image/*` types + - Add new upstream MIME types + +2.1.19 / 2018-07-17 +=================== + + * deps: mime-db@~1.35.0 + - Add extension `.csl` to `application/vnd.citationstyles.style+xml` + - Add extension `.es` to `application/ecmascript` + - Add extension `.owl` to `application/rdf+xml` + - Add new upstream MIME types + - Add UTF-8 as default charset for `text/turtle` + +2.1.18 / 2018-02-16 +=================== + + * deps: mime-db@~1.33.0 + - Add `application/raml+yaml` with extension `.raml` + - Add `application/wasm` with extension `.wasm` + - Add `text/shex` with extension `.shex` + - Add extensions for JPEG-2000 images + - Add extensions from IANA for `message/*` types + - Add new upstream MIME types + - Update font MIME types + - Update `text/hjson` to registered `application/hjson` + +2.1.17 / 2017-09-01 +=================== + + * deps: mime-db@~1.30.0 + - Add `application/vnd.ms-outlook` + - Add `application/x-arj` + - Add extension `.mjs` to `application/javascript` + - Add glTF types and extensions + - Add new upstream MIME types + - Add `text/x-org` + - Add VirtualBox MIME types + - Fix `source` records for `video/*` types that are IANA + - Update `font/opentype` to registered `font/otf` + +2.1.16 / 2017-07-24 +=================== + + * deps: mime-db@~1.29.0 + - Add `application/fido.trusted-apps+json` + - Add extension `.wadl` to `application/vnd.sun.wadl+xml` + - Add extension `.gz` to `application/gzip` + - Add new upstream MIME types + - Update extensions `.md` and `.markdown` to be `text/markdown` + +2.1.15 / 2017-03-23 +=================== + + * deps: mime-db@~1.27.0 + - Add new mime types + - Add `image/apng` + +2.1.14 / 2017-01-14 +=================== + + * deps: mime-db@~1.26.0 + - Add new mime types + +2.1.13 / 2016-11-18 +=================== + + * deps: mime-db@~1.25.0 + - Add new mime types + +2.1.12 / 2016-09-18 +=================== + + * deps: mime-db@~1.24.0 + - Add new mime types + - Add `audio/mp3` + +2.1.11 / 2016-05-01 +=================== + + * deps: mime-db@~1.23.0 + - Add new mime types + +2.1.10 / 2016-02-15 +=================== + + * deps: mime-db@~1.22.0 + - Add new mime types + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + +2.1.9 / 2016-01-06 +================== + + * deps: mime-db@~1.21.0 + - Add new mime types + +2.1.8 / 2015-11-30 +================== + + * deps: mime-db@~1.20.0 + - Add new mime types + +2.1.7 / 2015-09-20 +================== + + * deps: mime-db@~1.19.0 + - Add new mime types + +2.1.6 / 2015-09-03 +================== + + * deps: mime-db@~1.18.0 + - Add new mime types + +2.1.5 / 2015-08-20 +================== + + * deps: mime-db@~1.17.0 + - Add new mime types + +2.1.4 / 2015-07-30 +================== + + * deps: mime-db@~1.16.0 + - Add new mime types + +2.1.3 / 2015-07-13 +================== + + * deps: mime-db@~1.15.0 + - Add new mime types + +2.1.2 / 2015-06-25 +================== + + * deps: mime-db@~1.14.0 + - Add new mime types + +2.1.1 / 2015-06-08 +================== + + * perf: fix deopt during mapping + +2.1.0 / 2015-06-07 +================== + + * Fix incorrectly treating extension-less file name as extension + - i.e. `'path/to/json'` will no longer return `application/json` + * Fix `.charset(type)` to accept parameters + * Fix `.charset(type)` to match case-insensitive + * Improve generation of extension to MIME mapping + * Refactor internals for readability and no argument reassignment + * Prefer `application/*` MIME types from the same source + * Prefer any type over `application/octet-stream` + * deps: mime-db@~1.13.0 + - Add nginx as a source + - Add new mime types + +2.0.14 / 2015-06-06 +=================== + + * deps: mime-db@~1.12.0 + - Add new mime types + +2.0.13 / 2015-05-31 +=================== + + * deps: mime-db@~1.11.0 + - Add new mime types + +2.0.12 / 2015-05-19 +=================== + + * deps: mime-db@~1.10.0 + - Add new mime types + +2.0.11 / 2015-05-05 +=================== + + * deps: mime-db@~1.9.1 + - Add new mime types + +2.0.10 / 2015-03-13 +=================== + + * deps: mime-db@~1.8.0 + - Add new mime types + +2.0.9 / 2015-02-09 +================== + + * deps: mime-db@~1.7.0 + - Add new mime types + - Community extensions ownership transferred from `node-mime` + +2.0.8 / 2015-01-29 +================== + + * deps: mime-db@~1.6.0 + - Add new mime types + +2.0.7 / 2014-12-30 +================== + + * deps: mime-db@~1.5.0 + - Add new mime types + - Fix various invalid MIME type entries + +2.0.6 / 2014-12-30 +================== + + * deps: mime-db@~1.4.0 + - Add new mime types + - Fix various invalid MIME type entries + - Remove example template MIME types + +2.0.5 / 2014-12-29 +================== + + * deps: mime-db@~1.3.1 + - Fix missing extensions + +2.0.4 / 2014-12-10 +================== + + * deps: mime-db@~1.3.0 + - Add new mime types + +2.0.3 / 2014-11-09 +================== + + * deps: mime-db@~1.2.0 + - Add new mime types + +2.0.2 / 2014-09-28 +================== + + * deps: mime-db@~1.1.0 + - Add new mime types + - Update charsets + +2.0.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + +2.0.0 / 2014-09-02 +================== + + * Use `mime-db` + * Remove `.define()` + +1.0.2 / 2014-08-04 +================== + + * Set charset=utf-8 for `text/javascript` + +1.0.1 / 2014-06-24 +================== + + * Add `text/jsx` type + +1.0.0 / 2014-05-12 +================== + + * Return `false` for unknown types + * Set charset=utf-8 for `application/json` + +0.1.0 / 2014-05-02 +================== + + * Initial release diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-types/LICENSE b/node_modules/@nestjs/platform-express/node_modules/mime-types/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..06166077be4d1f620d89b9eb33c76d89e75857da --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-types/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-types/README.md b/node_modules/@nestjs/platform-express/node_modules/mime-types/README.md new file mode 100644 index 0000000000000000000000000000000000000000..222d2b58a343a582ba534945387b9106bbd514a4 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-types/README.md @@ -0,0 +1,126 @@ +# mime-types + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +The ultimate javascript content-type utility. + +Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except: + +- __No fallbacks.__ Instead of naively returning the first available type, + `mime-types` simply returns `false`, so do + `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. +- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. +- No `.define()` functionality +- Bug fixes for `.lookup(path)` + +Otherwise, the API is compatible with `mime` 1.x. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install mime-types +``` + +## Note on MIME Type Data and Semver + +This package considers the programmatic api as the semver compatibility. Additionally, the package which provides the MIME data +for this package (`mime-db`) *also* considers it's programmatic api as the semver contract. This means the MIME type resolution is *not* considered +in the semver bumps. + +In the past the version of `mime-db` was pinned to give two decision points when adopting MIME data changes. This is no longer true. We still update the +`mime-db` package here as a `minor` release when necessary, but will use a `^` range going forward. This means that if you want to pin your `mime-db` data +you will need to do it in your application. While this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is +a breaking change. + +If you wish to pin your `mime-db` version you can do that with overrides via your package manager of choice. See their documentation for how to correctly configure that. + +## Adding Types + +All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db), +so open a PR there if you'd like to add mime types. + +## API + +```js +var mime = require('mime-types') +``` + +All functions return `false` if input is invalid or not found. + +### mime.lookup(path) + +Lookup the content-type associated with a file. + +```js +mime.lookup('json') // 'application/json' +mime.lookup('.md') // 'text/markdown' +mime.lookup('file.html') // 'text/html' +mime.lookup('folder/file.js') // 'application/javascript' +mime.lookup('folder/.htaccess') // false + +mime.lookup('cats') // false +``` + +### mime.contentType(type) + +Create a full content-type header given a content-type or extension. +When given an extension, `mime.lookup` is used to get the matching +content-type, otherwise the given content-type is used. Then if the +content-type does not already have a `charset` parameter, `mime.charset` +is used to get the default charset and add to the returned content-type. + +```js +mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' +mime.contentType('file.json') // 'application/json; charset=utf-8' +mime.contentType('text/html') // 'text/html; charset=utf-8' +mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1' + +// from a full path +mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' +``` + +### mime.extension(type) + +Get the default extension for a content-type. + +```js +mime.extension('application/octet-stream') // 'bin' +``` + +### mime.charset(type) + +Lookup the implied default charset of a content-type. + +```js +mime.charset('text/markdown') // 'UTF-8' +``` + +### var type = mime.types[extension] + +A map of content-types by extension. + +### [extensions...] = mime.extensions[type] + +A map of extensions by content-type. + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci +[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master +[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master +[node-version-image]: https://badgen.net/npm/node/mime-types +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mime-types +[npm-url]: https://npmjs.org/package/mime-types +[npm-version-image]: https://badgen.net/npm/v/mime-types diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-types/index.js b/node_modules/@nestjs/platform-express/node_modules/mime-types/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9725ddf3d42d9a0fccd6c3f7b69a794bf4fb6962 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-types/index.js @@ -0,0 +1,211 @@ +/*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var db = require('mime-db') +var extname = require('path').extname +var mimeScore = require('./mimeScore') + +/** + * Module variables. + * @private + */ + +var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ +var TEXT_TYPE_REGEXP = /^text\//i + +/** + * Module exports. + * @public + */ + +exports.charset = charset +exports.charsets = { lookup: charset } +exports.contentType = contentType +exports.extension = extension +exports.extensions = Object.create(null) +exports.lookup = lookup +exports.types = Object.create(null) +exports._extensionConflicts = [] + +// Populate the extensions/types maps +populateMaps(exports.extensions, exports.types) + +/** + * Get the default charset for a MIME type. + * + * @param {string} type + * @return {false|string} + */ + +function charset (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + var mime = match && db[match[1].toLowerCase()] + + if (mime && mime.charset) { + return mime.charset + } + + // default text/* to utf-8 + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return 'UTF-8' + } + + return false +} + +/** + * Create a full Content-Type header given a MIME type or extension. + * + * @param {string} str + * @return {false|string} + */ + +function contentType (str) { + // TODO: should this even be in this module? + if (!str || typeof str !== 'string') { + return false + } + + var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str + + if (!mime) { + return false + } + + // TODO: use content-type or other module + if (mime.indexOf('charset') === -1) { + var charset = exports.charset(mime) + if (charset) mime += '; charset=' + charset.toLowerCase() + } + + return mime +} + +/** + * Get the default extension for a MIME type. + * + * @param {string} type + * @return {false|string} + */ + +function extension (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + + // get extensions + var exts = match && exports.extensions[match[1].toLowerCase()] + + if (!exts || !exts.length) { + return false + } + + return exts[0] +} + +/** + * Lookup the MIME type for a file path/extension. + * + * @param {string} path + * @return {false|string} + */ + +function lookup (path) { + if (!path || typeof path !== 'string') { + return false + } + + // get the extension ("ext" or ".ext" or full path) + var extension = extname('x.' + path) + .toLowerCase() + .slice(1) + + if (!extension) { + return false + } + + return exports.types[extension] || false +} + +/** + * Populate the extensions and types maps. + * @private + */ + +function populateMaps (extensions, types) { + Object.keys(db).forEach(function forEachMimeType (type) { + var mime = db[type] + var exts = mime.extensions + + if (!exts || !exts.length) { + return + } + + // mime -> extensions + extensions[type] = exts + + // extension -> mime + for (var i = 0; i < exts.length; i++) { + var extension = exts[i] + types[extension] = _preferredType(extension, types[extension], type) + + // DELETE (eventually): Capture extension->type maps that change as a + // result of switching to mime-score. This is just to help make reviewing + // PR #119 easier, and can be removed once that PR is approved. + const legacyType = _preferredTypeLegacy( + extension, + types[extension], + type + ) + if (legacyType !== types[extension]) { + exports._extensionConflicts.push([extension, legacyType, types[extension]]) + } + } + }) +} + +// Resolve type conflict using mime-score +function _preferredType (ext, type0, type1) { + var score0 = type0 ? mimeScore(type0, db[type0].source) : 0 + var score1 = type1 ? mimeScore(type1, db[type1].source) : 0 + + return score0 > score1 ? type0 : type1 +} + +// Resolve type conflict using pre-mime-score logic +function _preferredTypeLegacy (ext, type0, type1) { + var SOURCE_RANK = ['nginx', 'apache', undefined, 'iana'] + + var score0 = type0 ? SOURCE_RANK.indexOf(db[type0].source) : 0 + var score1 = type1 ? SOURCE_RANK.indexOf(db[type1].source) : 0 + + if ( + exports.types[extension] !== 'application/octet-stream' && + (score0 > score1 || + (score0 === score1 && + exports.types[extension]?.slice(0, 12) === 'application/')) + ) { + return type0 + } + + return score0 > score1 ? type0 : type1 +} diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-types/mimeScore.js b/node_modules/@nestjs/platform-express/node_modules/mime-types/mimeScore.js new file mode 100644 index 0000000000000000000000000000000000000000..fc2e6657aafcc80d2ca56fb9ba362cf949460478 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-types/mimeScore.js @@ -0,0 +1,57 @@ +// 'mime-score' back-ported to CommonJS + +// Score RFC facets (see https://tools.ietf.org/html/rfc6838#section-3) +var FACET_SCORES = { + 'prs.': 100, + 'x-': 200, + 'x.': 300, + 'vnd.': 400, + default: 900 +} + +// Score mime source (Logic originally from `jshttp/mime-types` module) +var SOURCE_SCORES = { + nginx: 10, + apache: 20, + iana: 40, + default: 30 // definitions added by `jshttp/mime-db` project? +} + +var TYPE_SCORES = { + // prefer application/xml over text/xml + // prefer application/rtf over text/rtf + application: 1, + + // prefer font/woff over application/font-woff + font: 2, + + // prefer video/mp4 over audio/mp4 over application/mp4 + // See https://www.rfc-editor.org/rfc/rfc4337.html#section-2 + audio: 2, + video: 3, + + default: 0 +} + +/** + * Get each component of the score for a mime type. The sum of these is the + * total score. The higher the score, the more "official" the type. + */ +module.exports = function mimeScore (mimeType, source = 'default') { + if (mimeType === 'application/octet-stream') { + return 0 + } + + const [type, subtype] = mimeType.split('/') + + const facet = subtype.replace(/(\.|x-).*/, '$1') + + const facetScore = FACET_SCORES[facet] || FACET_SCORES.default + const sourceScore = SOURCE_SCORES[source] || SOURCE_SCORES.default + const typeScore = TYPE_SCORES[type] || TYPE_SCORES.default + + // All else being equal prefer shorter types + const lengthScore = 1 - mimeType.length / 100 + + return facetScore + sourceScore + typeScore + lengthScore +} diff --git a/node_modules/@nestjs/platform-express/node_modules/mime-types/package.json b/node_modules/@nestjs/platform-express/node_modules/mime-types/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6c58c27afd32c5df6fd5d96dfe833b27f155770b --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/mime-types/package.json @@ -0,0 +1,49 @@ +{ + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "3.0.2", + "contributors": [ + "Douglas Christopher Wilson ", + "Jeremiah Senkpiel (https://searchbeam.jit.su)", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "keywords": [ + "mime", + "types" + ], + "repository": "jshttp/mime-types", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "mime-db": "^1.54.0" + }, + "devDependencies": { + "eslint": "8.33.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.32.0", + "eslint-plugin-markdown": "3.0.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.6.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "10.8.2", + "nyc": "15.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js", + "mimeScore.js" + ], + "engines": { + "node": ">=18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec test/test.js", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/LICENSE b/node_modules/@nestjs/platform-express/node_modules/multer/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6c011b18fa16e456f63b662d75047e376306874b --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/LICENSE @@ -0,0 +1,17 @@ +Copyright (c) 2014 Hage Yaapa <[http://www.hacksparrow.com](http://www.hacksparrow.com)> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/README.md b/node_modules/@nestjs/platform-express/node_modules/multer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..630a495a1b368450225aeb2c58737149e905a3d8 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/README.md @@ -0,0 +1,351 @@ +# Multer [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Test Coverage][test-image]][test-url] [![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + +Multer is a node.js middleware for handling `multipart/form-data`, which is primarily used for uploading files. It is written +on top of [busboy](https://github.com/mscdex/busboy) for maximum efficiency. + +**NOTE**: Multer will not process any form which is not multipart (`multipart/form-data`). + +## Translations + +This README is also available in other languages: + +| | | +| ------------------------------------------------------------------------------ | --------------- | +| [العربية](https://github.com/expressjs/multer/blob/main/doc/README-ar.md) | Arabic | +| [简体中文](https://github.com/expressjs/multer/blob/main/doc/README-zh-cn.md) | Chinese | +| [Français](https://github.com/expressjs/multer/blob/main/doc/README-fr.md) | French | +| [한국어](https://github.com/expressjs/multer/blob/main/doc/README-ko.md) | Korean | +| [Português](https://github.com/expressjs/multer/blob/main/doc/README-pt-br.md) | Portuguese (BR) | +| [Русский язык](https://github.com/expressjs/multer/blob/main/doc/README-ru.md) | Russian | +| [Español](https://github.com/expressjs/multer/blob/main/doc/README-es.md) | Spanish | +| [O'zbek tili](https://github.com/expressjs/multer/blob/main/doc/README-uz.md) | Uzbek | +| [Việt Nam](https://github.com/expressjs/multer/blob/main/doc/README-vi.md) | Vietnamese | +| [Türkçe](https://github.com/expressjs/multer/blob/main/doc/README-tr.md) | Turkish | + + +## Installation + +```sh +$ npm install multer +``` + +## Usage + +Multer adds a `body` object and a `file` or `files` object to the `request` object. The `body` object contains the values of the text fields of the form, the `file` or `files` object contains the files uploaded via the form. + +Basic usage example: + +Don't forget the `enctype="multipart/form-data"` in your form. + +```html +
+ +
+``` + +```javascript +const express = require('express') +const multer = require('multer') +const upload = multer({ dest: 'uploads/' }) + +const app = express() + +app.post('/profile', upload.single('avatar'), function (req, res, next) { + // req.file is the `avatar` file + // req.body will hold the text fields, if there were any +}) + +app.post('/photos/upload', upload.array('photos', 12), function (req, res, next) { + // req.files is array of `photos` files + // req.body will contain the text fields, if there were any +}) + +const uploadMiddleware = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }]) +app.post('/cool-profile', uploadMiddleware, function (req, res, next) { + // req.files is an object (String -> Array) where fieldname is the key, and the value is array of files + // + // e.g. + // req.files['avatar'][0] -> File + // req.files['gallery'] -> Array + // + // req.body will contain the text fields, if there were any +}) +``` + +In case you need to handle a text-only multipart form, you should use the `.none()` method: + +```javascript +const express = require('express') +const app = express() +const multer = require('multer') +const upload = multer() + +app.post('/profile', upload.none(), function (req, res, next) { + // req.body contains the text fields +}) +``` + +Here's an example on how multer is used in a HTML form. Take special note of the `enctype="multipart/form-data"` and `name="uploaded_file"` fields: + +```html +
+
+ + + +
+
+``` + +Then in your javascript file you would add these lines to access both the file and the body. It is important that you use the `name` field value from the form in your upload function. This tells multer which field on the request it should look for the files in. If these fields aren't the same in the HTML form and on your server, your upload will fail: + +```javascript +const multer = require('multer') +const upload = multer({ dest: './public/data/uploads/' }) +app.post('/stats', upload.single('uploaded_file'), function (req, res) { + // req.file is the name of your file in the form above, here 'uploaded_file' + // req.body will hold the text fields, if there were any + console.log(req.file, req.body) +}); +``` + + + +## API + +### File information + +Each file contains the following information: + +Key | Description | Note +--- | --- | --- +`fieldname` | Field name specified in the form | +`originalname` | Name of the file on the user's computer | +`encoding` | Encoding type of the file | +`mimetype` | Mime type of the file | +`size` | Size of the file in bytes | +`destination` | The folder to which the file has been saved | `DiskStorage` +`filename` | The name of the file within the `destination` | `DiskStorage` +`path` | The full path to the uploaded file | `DiskStorage` +`buffer` | A `Buffer` of the entire file | `MemoryStorage` + +### `multer(opts)` + +Multer accepts an options object, the most basic of which is the `dest` +property, which tells Multer where to upload the files. In case you omit the +options object, the files will be kept in memory and never written to disk. + +By default, Multer will rename the files so as to avoid naming conflicts. The +renaming function can be customized according to your needs. + +The following are the options that can be passed to Multer. + +Key | Description +--- | --- +`dest` or `storage` | Where to store the files +`fileFilter` | Function to control which files are accepted +`limits` | Limits of the uploaded data +`preservePath` | Keep the full path of files instead of just the base name +`defParamCharset` | Default character set to use for values of part header parameters (e.g. filename) that are not extended parameters (that contain an explicit charset). Default: `'latin1'` + +In an average web app, only `dest` might be required, and configured as shown in +the following example. + +```javascript +const upload = multer({ dest: 'uploads/' }) +``` + +If you want more control over your uploads, you'll want to use the `storage` +option instead of `dest`. Multer ships with storage engines `DiskStorage` +and `MemoryStorage`; More engines are available from third parties. + +#### `.single(fieldname)` + +Accept a single file with the name `fieldname`. The single file will be stored +in `req.file`. + +#### `.array(fieldname[, maxCount])` + +Accept an array of files, all with the name `fieldname`. Optionally error out if +more than `maxCount` files are uploaded. The array of files will be stored in +`req.files`. + +#### `.fields(fields)` + +Accept a mix of files, specified by `fields`. An object with arrays of files +will be stored in `req.files`. + +`fields` should be an array of objects with `name` and optionally a `maxCount`. +Example: + +```javascript +[ + { name: 'avatar', maxCount: 1 }, + { name: 'gallery', maxCount: 8 } +] +``` + +#### `.none()` + +Accept only text fields. If any file upload is made, error with code +"LIMIT\_UNEXPECTED\_FILE" will be issued. + +#### `.any()` + +Accepts all files that comes over the wire. An array of files will be stored in +`req.files`. + +**WARNING:** Make sure that you always handle the files that a user uploads. +Never add multer as a global middleware since a malicious user could upload +files to a route that you didn't anticipate. Only use this function on routes +where you are handling the uploaded files. + +### `storage` + +#### `DiskStorage` + +The disk storage engine gives you full control on storing files to disk. + +```javascript +const storage = multer.diskStorage({ + destination: function (req, file, cb) { + cb(null, '/tmp/my-uploads') + }, + filename: function (req, file, cb) { + const uniqueSuffix = Date.now() + '-' + Math.round(Math.random() * 1E9) + cb(null, file.fieldname + '-' + uniqueSuffix) + } +}) + +const upload = multer({ storage: storage }) +``` + +There are two options available, `destination` and `filename`. They are both +functions that determine where the file should be stored. + +`destination` is used to determine within which folder the uploaded files should +be stored. This can also be given as a `string` (e.g. `'/tmp/uploads'`). If no +`destination` is given, the operating system's default directory for temporary +files is used. + +**Note:** You are responsible for creating the directory when providing +`destination` as a function. When passing a string, multer will make sure that +the directory is created for you. + +`filename` is used to determine what the file should be named inside the folder. +If no `filename` is given, each file will be given a random name that doesn't +include any file extension. + +**Note:** Multer will not append any file extension for you, your function +should return a filename complete with a file extension. + +Each function gets passed both the request (`req`) and some information about +the file (`file`) to aid with the decision. + +Note that `req.body` might not have been fully populated yet. It depends on the +order that the client transmits fields and files to the server. + +For understanding the calling convention used in the callback (needing to pass +null as the first param), refer to +[Node.js error handling](https://web.archive.org/web/20220417042018/https://www.joyent.com/node-js/production/design/errors) + +#### `MemoryStorage` + +The memory storage engine stores the files in memory as `Buffer` objects. It +doesn't have any options. + +```javascript +const storage = multer.memoryStorage() +const upload = multer({ storage: storage }) +``` + +When using memory storage, the file info will contain a field called +`buffer` that contains the entire file. + +**WARNING**: Uploading very large files, or relatively small files in large +numbers very quickly, can cause your application to run out of memory when +memory storage is used. + +### `limits` + +An object specifying the size limits of the following optional properties. Multer passes this object into busboy directly, and the details of the properties can be found on [busboy's page](https://github.com/mscdex/busboy#busboy-methods). + +The following integer values are available: + +Key | Description | Default +--- | --- | --- +`fieldNameSize` | Max field name size | 100 bytes +`fieldSize` | Max field value size (in bytes) | 1MB +`fields` | Max number of non-file fields | Infinity +`fileSize` | For multipart forms, the max file size (in bytes) | Infinity +`files` | For multipart forms, the max number of file fields | Infinity +`parts` | For multipart forms, the max number of parts (fields + files) | Infinity +`headerPairs` | For multipart forms, the max number of header key=>value pairs to parse | 2000 + +Specifying the limits can help protect your site against denial of service (DoS) attacks. + +### `fileFilter` + +Set this to a function to control which files should be uploaded and which +should be skipped. The function should look like this: + +```javascript +function fileFilter (req, file, cb) { + + // The function should call `cb` with a boolean + // to indicate if the file should be accepted + + // To reject this file pass `false`, like so: + cb(null, false) + + // To accept the file pass `true`, like so: + cb(null, true) + + // You can always pass an error if something goes wrong: + cb(new Error('I don\'t have a clue!')) + +} +``` + +## Error handling + +When encountering an error, Multer will delegate the error to Express. You can +display a nice error page using [the standard express way](http://expressjs.com/guide/error-handling.html). + +If you want to catch errors specifically from Multer, you can call the +middleware function by yourself. Also, if you want to catch only [the Multer errors](https://github.com/expressjs/multer/blob/main/lib/multer-error.js), you can use the `MulterError` class that is attached to the `multer` object itself (e.g. `err instanceof multer.MulterError`). + +```javascript +const multer = require('multer') +const upload = multer().single('avatar') + +app.post('/profile', function (req, res) { + upload(req, res, function (err) { + if (err instanceof multer.MulterError) { + // A Multer error occurred when uploading. + } else if (err) { + // An unknown error occurred when uploading. + } + + // Everything went fine. + }) +}) +``` + +## Custom storage engine + +For information on how to build your own storage engine, see [Multer Storage Engine](https://github.com/expressjs/multer/blob/main/StorageEngine.md). + +## License + +[MIT](LICENSE) + +[ci-image]: https://github.com/expressjs/multer/actions/workflows/ci.yml/badge.svg +[ci-url]: https://github.com/expressjs/multer/actions/workflows/ci.yml +[test-url]: https://coveralls.io/r/expressjs/multer?branch=main +[test-image]: https://badgen.net/coveralls/c/github/expressjs/multer/main +[npm-downloads-image]: https://badgen.net/npm/dm/multer +[npm-url]: https://npmjs.org/package/multer +[npm-version-image]: https://badgen.net/npm/v/multer +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/multer/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/multer diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/index.js b/node_modules/@nestjs/platform-express/node_modules/multer/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1dbfaacb1c64dd1c929f1cfcf09716c7e6fa7b35 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/index.js @@ -0,0 +1,107 @@ +var makeMiddleware = require('./lib/make-middleware') + +var diskStorage = require('./storage/disk') +var memoryStorage = require('./storage/memory') +var MulterError = require('./lib/multer-error') + +function allowAll (req, file, cb) { + cb(null, true) +} + +function Multer (options) { + if (options.storage) { + this.storage = options.storage + } else if (options.dest) { + this.storage = diskStorage({ destination: options.dest }) + } else { + this.storage = memoryStorage() + } + + this.limits = options.limits + this.preservePath = options.preservePath + this.defParamCharset = options.defParamCharset || 'latin1' + this.fileFilter = options.fileFilter || allowAll +} + +Multer.prototype._makeMiddleware = function (fields, fileStrategy) { + function setup () { + var fileFilter = this.fileFilter + var filesLeft = Object.create(null) + + fields.forEach(function (field) { + if (typeof field.maxCount === 'number') { + filesLeft[field.name] = field.maxCount + } else { + filesLeft[field.name] = Infinity + } + }) + + function wrappedFileFilter (req, file, cb) { + if ((filesLeft[file.fieldname] || 0) <= 0) { + return cb(new MulterError('LIMIT_UNEXPECTED_FILE', file.fieldname)) + } + + filesLeft[file.fieldname] -= 1 + fileFilter(req, file, cb) + } + + return { + limits: this.limits, + preservePath: this.preservePath, + defParamCharset: this.defParamCharset, + storage: this.storage, + fileFilter: wrappedFileFilter, + fileStrategy: fileStrategy + } + } + + return makeMiddleware(setup.bind(this)) +} + +Multer.prototype.single = function (name) { + return this._makeMiddleware([{ name: name, maxCount: 1 }], 'VALUE') +} + +Multer.prototype.array = function (name, maxCount) { + return this._makeMiddleware([{ name: name, maxCount: maxCount }], 'ARRAY') +} + +Multer.prototype.fields = function (fields) { + return this._makeMiddleware(fields, 'OBJECT') +} + +Multer.prototype.none = function () { + return this._makeMiddleware([], 'NONE') +} + +Multer.prototype.any = function () { + function setup () { + return { + limits: this.limits, + preservePath: this.preservePath, + defParamCharset: this.defParamCharset, + storage: this.storage, + fileFilter: this.fileFilter, + fileStrategy: 'ARRAY' + } + } + + return makeMiddleware(setup.bind(this)) +} + +function multer (options) { + if (options === undefined) { + return new Multer({}) + } + + if (typeof options === 'object' && options !== null) { + return new Multer(options) + } + + throw new TypeError('Expected object for argument options') +} + +module.exports = multer +module.exports.diskStorage = diskStorage +module.exports.memoryStorage = memoryStorage +module.exports.MulterError = MulterError diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/lib/counter.js b/node_modules/@nestjs/platform-express/node_modules/multer/lib/counter.js new file mode 100644 index 0000000000000000000000000000000000000000..29c410c7b4850d2640fef61629508a534fc98a74 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/lib/counter.js @@ -0,0 +1,28 @@ +var EventEmitter = require('events').EventEmitter + +function Counter () { + EventEmitter.call(this) + this.value = 0 +} + +Counter.prototype = Object.create(EventEmitter.prototype) + +Counter.prototype.increment = function increment () { + this.value++ +} + +Counter.prototype.decrement = function decrement () { + if (--this.value === 0) this.emit('zero') +} + +Counter.prototype.isZero = function isZero () { + return (this.value === 0) +} + +Counter.prototype.onceZero = function onceZero (fn) { + if (this.isZero()) return fn() + + this.once('zero', fn) +} + +module.exports = Counter diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/lib/file-appender.js b/node_modules/@nestjs/platform-express/node_modules/multer/lib/file-appender.js new file mode 100644 index 0000000000000000000000000000000000000000..a760d8bb5f2879e4ee9fb5ee3951d9953c97cbb0 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/lib/file-appender.js @@ -0,0 +1,65 @@ +function arrayRemove (arr, item) { + var idx = arr.indexOf(item) + if (~idx) arr.splice(idx, 1) +} + +function FileAppender (strategy, req) { + this.strategy = strategy + this.req = req + + switch (strategy) { + case 'NONE': break + case 'VALUE': break + case 'ARRAY': req.files = []; break + case 'OBJECT': req.files = Object.create(null); break + default: throw new Error('Unknown file strategy: ' + strategy) + } +} + +FileAppender.prototype.insertPlaceholder = function (file) { + var placeholder = { + fieldname: file.fieldname + } + + switch (this.strategy) { + case 'NONE': break + case 'VALUE': break + case 'ARRAY': this.req.files.push(placeholder); break + case 'OBJECT': + if (this.req.files[file.fieldname]) { + this.req.files[file.fieldname].push(placeholder) + } else { + this.req.files[file.fieldname] = [placeholder] + } + break + } + + return placeholder +} + +FileAppender.prototype.removePlaceholder = function (placeholder) { + switch (this.strategy) { + case 'NONE': break + case 'VALUE': break + case 'ARRAY': arrayRemove(this.req.files, placeholder); break + case 'OBJECT': + if (this.req.files[placeholder.fieldname].length === 1) { + delete this.req.files[placeholder.fieldname] + } else { + arrayRemove(this.req.files[placeholder.fieldname], placeholder) + } + break + } +} + +FileAppender.prototype.replacePlaceholder = function (placeholder, file) { + if (this.strategy === 'VALUE') { + this.req.file = file + return + } + + delete placeholder.fieldname + Object.assign(placeholder, file) +} + +module.exports = FileAppender diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/lib/make-middleware.js b/node_modules/@nestjs/platform-express/node_modules/multer/lib/make-middleware.js new file mode 100644 index 0000000000000000000000000000000000000000..ee509886b719acb764c8f2befa945382e8fcdce6 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/lib/make-middleware.js @@ -0,0 +1,250 @@ +var is = require('type-is') +var Busboy = require('busboy') +var appendField = require('append-field') + +var Counter = require('./counter') +var MulterError = require('./multer-error') +var FileAppender = require('./file-appender') +var removeUploadedFiles = require('./remove-uploaded-files') + +function drainStream (stream) { + stream.on('readable', () => { + while (stream.read() !== null) {} + }) +} + +function makeMiddleware (setup) { + return function multerMiddleware (req, res, next) { + if (!is(req, ['multipart'])) return next() + + var options = setup() + + var limits = options.limits + var storage = options.storage + var fileFilter = options.fileFilter + var fileStrategy = options.fileStrategy + var preservePath = options.preservePath + var defParamCharset = options.defParamCharset + + req.body = Object.create(null) + + var busboy + var appender = null + var isDone = false + var readFinished = false + var errorOccured = false + var pendingWrites = new Counter() + var uploadedFiles = [] + + function done (err) { + var called = false + function onFinished () { + if (called) return + called = true + next(err) + } + + if (isDone) return + isDone = true + if (busboy) { + req.unpipe(busboy) + setImmediate(() => { + busboy.removeAllListeners() + }) + } + drainStream(req) + req.resume() + + // - if responding with an error, drain request body before calling + // next(err) -- avoids EPIPE on the client (server closing connection + // while the client is still sending the request body) + // - also listen for 'close' so we don't hang when the client aborts (stream may never 'end') + // - skip waiting if the stream is already destroyed (e.g. client aborted) + if (err && req.readable && !req.destroyed) { + req.once('end', onFinished) + req.once('error', onFinished) + req.once('close', onFinished) + return + } + next(err) + } + + function indicateDone () { + if (readFinished && pendingWrites.isZero() && !errorOccured) done() + } + + function abortWithError (uploadError, skipPendingWait) { + if (errorOccured) return + errorOccured = true + + function finishAbort () { + function remove (file, cb) { + storage._removeFile(req, file, cb) + } + + removeUploadedFiles(uploadedFiles, remove, function (err, storageErrors) { + if (err) return done(err) + + uploadError.storageErrors = storageErrors + done(uploadError) + }) + } + + if (skipPendingWait) { + finishAbort() + } else { + pendingWrites.onceZero(finishAbort) + } + } + + function abortWithCode (code, optionalField) { + abortWithError(new MulterError(code, optionalField)) + } + + function handleRequestFailure (err) { + if (isDone) return + if (busboy) { + req.unpipe(busboy) + busboy.destroy(err) + } + abortWithError(err, true) + } + + req.on('error', function (err) { + handleRequestFailure(err || new Error('Request error')) + }) + + req.on('aborted', function () { + handleRequestFailure(new Error('Request aborted')) + }) + + req.on('close', function () { + if (req.readableEnded) return + handleRequestFailure(new Error('Request closed')) + }) + + try { + busboy = Busboy({ + headers: req.headers, + limits: limits, + preservePath: preservePath, + defParamCharset: defParamCharset + }) + } catch (err) { + return next(err) + } + + appender = new FileAppender(fileStrategy, req) + + // handle text field data + busboy.on('field', function (fieldname, value, { nameTruncated, valueTruncated }) { + if (fieldname == null) return abortWithCode('MISSING_FIELD_NAME') + if (nameTruncated) return abortWithCode('LIMIT_FIELD_KEY') + if (valueTruncated) return abortWithCode('LIMIT_FIELD_VALUE', fieldname) + + // Work around bug in Busboy (https://github.com/mscdex/busboy/issues/6) + if (limits && Object.prototype.hasOwnProperty.call(limits, 'fieldNameSize')) { + if (fieldname.length > limits.fieldNameSize) return abortWithCode('LIMIT_FIELD_KEY') + } + + appendField(req.body, fieldname, value) + }) + + // handle files + busboy.on('file', function (fieldname, fileStream, { filename, encoding, mimeType }) { + var pendingWritesIncremented = false + + fileStream.on('error', function (err) { + if (pendingWritesIncremented) { + pendingWrites.decrement() + } + abortWithError(err) + }) + + if (fieldname == null) return abortWithCode('MISSING_FIELD_NAME') + + // don't attach to the files object, if there is no file + if (!filename) return fileStream.resume() + + // Work around bug in Busboy (https://github.com/mscdex/busboy/issues/6) + if (limits && Object.prototype.hasOwnProperty.call(limits, 'fieldNameSize')) { + if (fieldname.length > limits.fieldNameSize) return abortWithCode('LIMIT_FIELD_KEY') + } + + var file = { + fieldname: fieldname, + originalname: filename, + encoding: encoding, + mimetype: mimeType + } + + var placeholder = appender.insertPlaceholder(file) + + fileFilter(req, file, function (err, includeFile) { + if (errorOccured) { + appender.removePlaceholder(placeholder) + return fileStream.resume() + } + + if (err) { + appender.removePlaceholder(placeholder) + return abortWithError(err) + } + + if (!includeFile) { + appender.removePlaceholder(placeholder) + return fileStream.resume() + } + + var aborting = false + pendingWritesIncremented = true + pendingWrites.increment() + + Object.defineProperty(file, 'stream', { + configurable: true, + enumerable: false, + value: fileStream + }) + + fileStream.on('limit', function () { + aborting = true + abortWithCode('LIMIT_FILE_SIZE', fieldname) + }) + + storage._handleFile(req, file, function (err, info) { + if (aborting) { + appender.removePlaceholder(placeholder) + uploadedFiles.push({ ...file, ...info }) + return pendingWrites.decrement() + } + + if (err) { + appender.removePlaceholder(placeholder) + pendingWrites.decrement() + return abortWithError(err) + } + + var fileInfo = { ...file, ...info } + + appender.replacePlaceholder(placeholder, fileInfo) + uploadedFiles.push(fileInfo) + pendingWrites.decrement() + indicateDone() + }) + }) + }) + + busboy.on('error', function (err) { abortWithError(err) }) + busboy.on('partsLimit', function () { abortWithCode('LIMIT_PART_COUNT') }) + busboy.on('filesLimit', function () { abortWithCode('LIMIT_FILE_COUNT') }) + busboy.on('fieldsLimit', function () { abortWithCode('LIMIT_FIELD_COUNT') }) + busboy.on('close', function () { + readFinished = true + indicateDone() + }) + + req.pipe(busboy) + } +} + +module.exports = makeMiddleware diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/lib/multer-error.js b/node_modules/@nestjs/platform-express/node_modules/multer/lib/multer-error.js new file mode 100644 index 0000000000000000000000000000000000000000..d56b00e88cc59deb83a5cfec9d7bea3de29400ed --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/lib/multer-error.js @@ -0,0 +1,24 @@ +var util = require('util') + +var errorMessages = { + LIMIT_PART_COUNT: 'Too many parts', + LIMIT_FILE_SIZE: 'File too large', + LIMIT_FILE_COUNT: 'Too many files', + LIMIT_FIELD_KEY: 'Field name too long', + LIMIT_FIELD_VALUE: 'Field value too long', + LIMIT_FIELD_COUNT: 'Too many fields', + LIMIT_UNEXPECTED_FILE: 'Unexpected field', + MISSING_FIELD_NAME: 'Field name missing' +} + +function MulterError (code, field) { + Error.captureStackTrace(this, this.constructor) + this.name = this.constructor.name + this.message = errorMessages[code] + this.code = code + if (field) this.field = field +} + +util.inherits(MulterError, Error) + +module.exports = MulterError diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/lib/remove-uploaded-files.js b/node_modules/@nestjs/platform-express/node_modules/multer/lib/remove-uploaded-files.js new file mode 100644 index 0000000000000000000000000000000000000000..d225c4842fa4bcb53c579fc40c32ec7696a8c1b9 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/lib/remove-uploaded-files.js @@ -0,0 +1,28 @@ +function removeUploadedFiles (uploadedFiles, remove, cb) { + var length = uploadedFiles.length + var errors = [] + + if (length === 0) return cb(null, errors) + + function handleFile (idx) { + var file = uploadedFiles[idx] + + remove(file, function (err) { + if (err) { + err.file = file + err.field = file.fieldname + errors.push(err) + } + + if (idx < length - 1) { + setImmediate(function () { handleFile(idx + 1) }) + } else { + cb(null, errors) + } + }) + } + + handleFile(0) +} + +module.exports = removeUploadedFiles diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/package.json b/node_modules/@nestjs/platform-express/node_modules/multer/package.json new file mode 100644 index 0000000000000000000000000000000000000000..db895112b40296e4b8a83494586d87b5baecdf30 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/package.json @@ -0,0 +1,58 @@ +{ + "name": "multer", + "description": "Middleware for handling `multipart/form-data`.", + "version": "2.1.1", + "contributors": [ + "Hage Yaapa (http://www.hacksparrow.com)", + "Jaret Pfluger ", + "Linus Unnebäck " + ], + "license": "MIT", + "repository": "expressjs/multer", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "keywords": [ + "form", + "post", + "multipart", + "form-data", + "formdata", + "express", + "middleware" + ], + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.6.0", + "concat-stream": "^2.0.0", + "type-is": "^1.6.18" + }, + "devDependencies": { + "deep-equal": "^2.0.3", + "express": "^4.21.2", + "form-data": "^4.0.2", + "fs-temp": "^1.2.1", + "mocha": "^11.5.0", + "nyc": "^15.1.0", + "rimraf": "^2.4.1", + "standard": "^14.3.3", + "testdata-w3c-json-form": "^1.0.0" + }, + "engines": { + "node": ">= 10.16.0" + }, + "files": [ + "LICENSE", + "index.js", + "storage/", + "lib/" + ], + "scripts": { + "lint": "standard", + "lint:fix": "standard --fix", + "test": "mocha --reporter spec --exit --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/storage/disk.js b/node_modules/@nestjs/platform-express/node_modules/multer/storage/disk.js new file mode 100644 index 0000000000000000000000000000000000000000..ae1f7bb9dbdf2e37054fc4092911cd7ef1bd1aa0 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/storage/disk.js @@ -0,0 +1,65 @@ +var fs = require('fs') +var os = require('os') +var path = require('path') +var crypto = require('crypto') + +function getFilename (req, file, cb) { + crypto.randomBytes(16, function (err, raw) { + cb(err, err ? undefined : raw.toString('hex')) + }) +} + +function getDestination (req, file, cb) { + cb(null, os.tmpdir()) +} + +function DiskStorage (opts) { + this.getFilename = (opts.filename || getFilename) + + if (typeof opts.destination === 'string') { + fs.mkdirSync(opts.destination, { recursive: true }) + this.getDestination = function ($0, $1, cb) { cb(null, opts.destination) } + } else { + this.getDestination = (opts.destination || getDestination) + } +} + +DiskStorage.prototype._handleFile = function _handleFile (req, file, cb) { + var that = this + + that.getDestination(req, file, function (err, destination) { + if (err) return cb(err) + + that.getFilename(req, file, function (err, filename) { + if (err) return cb(err) + + var finalPath = path.join(destination, filename) + var outStream = fs.createWriteStream(finalPath) + + file.stream.pipe(outStream) + outStream.on('error', cb) + outStream.on('finish', function () { + cb(null, { + destination: destination, + filename: filename, + path: finalPath, + size: outStream.bytesWritten + }) + }) + }) + }) +} + +DiskStorage.prototype._removeFile = function _removeFile (req, file, cb) { + var path = file.path + + delete file.destination + delete file.filename + delete file.path + + fs.unlink(path, cb) +} + +module.exports = function (opts) { + return new DiskStorage(opts) +} diff --git a/node_modules/@nestjs/platform-express/node_modules/multer/storage/memory.js b/node_modules/@nestjs/platform-express/node_modules/multer/storage/memory.js new file mode 100644 index 0000000000000000000000000000000000000000..f953ded15a2baf5cf59d3c2a716a8d5576db086c --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/multer/storage/memory.js @@ -0,0 +1,21 @@ +var concat = require('concat-stream') + +function MemoryStorage (opts) {} + +MemoryStorage.prototype._handleFile = function _handleFile (req, file, cb) { + file.stream.pipe(concat({ encoding: 'buffer' }, function (data) { + cb(null, { + buffer: data, + size: data.length + }) + })) +} + +MemoryStorage.prototype._removeFile = function _removeFile (req, file, cb) { + delete file.buffer + cb(null) +} + +module.exports = function (opts) { + return new MemoryStorage(opts) +} diff --git a/node_modules/@nestjs/platform-express/node_modules/negotiator/HISTORY.md b/node_modules/@nestjs/platform-express/node_modules/negotiator/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..63d537d3f681143b17f9250b199a865297b020be --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/negotiator/HISTORY.md @@ -0,0 +1,114 @@ +1.0.0 / 2024-08-31 +================== + + * Drop support for node <18 + * Added an option preferred encodings array #59 + +0.6.3 / 2022-01-22 +================== + + * Revert "Lazy-load modules from main entry point" + +0.6.2 / 2019-04-29 +================== + + * Fix sorting charset, encoding, and language with extra parameters + +0.6.1 / 2016-05-02 +================== + + * perf: improve `Accept` parsing speed + * perf: improve `Accept-Charset` parsing speed + * perf: improve `Accept-Encoding` parsing speed + * perf: improve `Accept-Language` parsing speed + +0.6.0 / 2015-09-29 +================== + + * Fix including type extensions in parameters in `Accept` parsing + * Fix parsing `Accept` parameters with quoted equals + * Fix parsing `Accept` parameters with quoted semicolons + * Lazy-load modules from main entry point + * perf: delay type concatenation until needed + * perf: enable strict mode + * perf: hoist regular expressions + * perf: remove closures getting spec properties + * perf: remove a closure from media type parsing + * perf: remove property delete from media type parsing + +0.5.3 / 2015-05-10 +================== + + * Fix media type parameter matching to be case-insensitive + +0.5.2 / 2015-05-06 +================== + + * Fix comparing media types with quoted values + * Fix splitting media types with quoted commas + +0.5.1 / 2015-02-14 +================== + + * Fix preference sorting to be stable for long acceptable lists + +0.5.0 / 2014-12-18 +================== + + * Fix list return order when large accepted list + * Fix missing identity encoding when q=0 exists + * Remove dynamic building of Negotiator class + +0.4.9 / 2014-10-14 +================== + + * Fix error when media type has invalid parameter + +0.4.8 / 2014-09-28 +================== + + * Fix all negotiations to be case-insensitive + * Stable sort preferences of same quality according to client order + * Support Node.js 0.6 + +0.4.7 / 2014-06-24 +================== + + * Handle invalid provided languages + * Handle invalid provided media types + +0.4.6 / 2014-06-11 +================== + + * Order by specificity when quality is the same + +0.4.5 / 2014-05-29 +================== + + * Fix regression in empty header handling + +0.4.4 / 2014-05-29 +================== + + * Fix behaviors when headers are not present + +0.4.3 / 2014-04-16 +================== + + * Handle slashes on media params correctly + +0.4.2 / 2014-02-28 +================== + + * Fix media type sorting + * Handle media types params strictly + +0.4.1 / 2014-01-16 +================== + + * Use most specific matches + +0.4.0 / 2014-01-09 +================== + + * Remove preferred prefix from methods diff --git a/node_modules/@nestjs/platform-express/node_modules/negotiator/LICENSE b/node_modules/@nestjs/platform-express/node_modules/negotiator/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..ea6b9e2e9ac251526c95df2dd995cf5f1e861854 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/negotiator/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2014 Federico Romero +Copyright (c) 2012-2014 Isaac Z. Schlueter +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/negotiator/README.md b/node_modules/@nestjs/platform-express/node_modules/negotiator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6fb7f2db31e670a487e3aa21a99fdc9c3978e6be --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/negotiator/README.md @@ -0,0 +1,212 @@ +# negotiator + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +An HTTP content negotiator for Node.js + +## Installation + +```sh +$ npm install negotiator +``` + +## API + +```js +var Negotiator = require('negotiator') +``` + +### Accept Negotiation + +```js +availableMediaTypes = ['text/html', 'text/plain', 'application/json'] + +// The negotiator constructor receives a request object +negotiator = new Negotiator(request) + +// Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8' + +negotiator.mediaTypes() +// -> ['text/html', 'image/jpeg', 'application/*'] + +negotiator.mediaTypes(availableMediaTypes) +// -> ['text/html', 'application/json'] + +negotiator.mediaType(availableMediaTypes) +// -> 'text/html' +``` + +You can check a working example at `examples/accept.js`. + +#### Methods + +##### mediaType() + +Returns the most preferred media type from the client. + +##### mediaType(availableMediaType) + +Returns the most preferred media type from a list of available media types. + +##### mediaTypes() + +Returns an array of preferred media types ordered by the client preference. + +##### mediaTypes(availableMediaTypes) + +Returns an array of preferred media types ordered by priority from a list of +available media types. + +### Accept-Language Negotiation + +```js +negotiator = new Negotiator(request) + +availableLanguages = ['en', 'es', 'fr'] + +// Let's say Accept-Language header is 'en;q=0.8, es, pt' + +negotiator.languages() +// -> ['es', 'pt', 'en'] + +negotiator.languages(availableLanguages) +// -> ['es', 'en'] + +language = negotiator.language(availableLanguages) +// -> 'es' +``` + +You can check a working example at `examples/language.js`. + +#### Methods + +##### language() + +Returns the most preferred language from the client. + +##### language(availableLanguages) + +Returns the most preferred language from a list of available languages. + +##### languages() + +Returns an array of preferred languages ordered by the client preference. + +##### languages(availableLanguages) + +Returns an array of preferred languages ordered by priority from a list of +available languages. + +### Accept-Charset Negotiation + +```js +availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5'] + +negotiator = new Negotiator(request) + +// Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2' + +negotiator.charsets() +// -> ['utf-8', 'iso-8859-1', 'utf-7'] + +negotiator.charsets(availableCharsets) +// -> ['utf-8', 'iso-8859-1'] + +negotiator.charset(availableCharsets) +// -> 'utf-8' +``` + +You can check a working example at `examples/charset.js`. + +#### Methods + +##### charset() + +Returns the most preferred charset from the client. + +##### charset(availableCharsets) + +Returns the most preferred charset from a list of available charsets. + +##### charsets() + +Returns an array of preferred charsets ordered by the client preference. + +##### charsets(availableCharsets) + +Returns an array of preferred charsets ordered by priority from a list of +available charsets. + +### Accept-Encoding Negotiation + +```js +availableEncodings = ['identity', 'gzip'] + +negotiator = new Negotiator(request) + +// Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5' + +negotiator.encodings() +// -> ['gzip', 'identity', 'compress'] + +negotiator.encodings(availableEncodings) +// -> ['gzip', 'identity'] + +negotiator.encoding(availableEncodings) +// -> 'gzip' +``` + +You can check a working example at `examples/encoding.js`. + +#### Methods + +##### encoding() + +Returns the most preferred encoding from the client. + +##### encoding(availableEncodings) + +Returns the most preferred encoding from a list of available encodings. + +##### encoding(availableEncodings, { preferred }) + +Returns the most preferred encoding from a list of available encodings, while prioritizing based on `preferred` array between same-quality encodings. + +##### encodings() + +Returns an array of preferred encodings ordered by the client preference. + +##### encodings(availableEncodings) + +Returns an array of preferred encodings ordered by priority from a list of +available encodings. + +##### encodings(availableEncodings, { preferred }) + +Returns an array of preferred encodings ordered by priority from a list of +available encodings, while prioritizing based on `preferred` array between same-quality encodings. + +## See Also + +The [accepts](https://npmjs.org/package/accepts#readme) module builds on +this module and provides an alternative interface, mime type validation, +and more. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/negotiator.svg +[npm-url]: https://npmjs.org/package/negotiator +[node-version-image]: https://img.shields.io/node/v/negotiator.svg +[node-version-url]: https://nodejs.org/en/download/ +[coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master +[downloads-image]: https://img.shields.io/npm/dm/negotiator.svg +[downloads-url]: https://npmjs.org/package/negotiator +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/negotiator/ci/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/negotiator/actions/workflows/ci.yml diff --git a/node_modules/@nestjs/platform-express/node_modules/negotiator/index.js b/node_modules/@nestjs/platform-express/node_modules/negotiator/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4f51315d6af4bda48533904adf1c530d1ac95a4a --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/negotiator/index.js @@ -0,0 +1,83 @@ +/*! + * negotiator + * Copyright(c) 2012 Federico Romero + * Copyright(c) 2012-2014 Isaac Z. Schlueter + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +var preferredCharsets = require('./lib/charset') +var preferredEncodings = require('./lib/encoding') +var preferredLanguages = require('./lib/language') +var preferredMediaTypes = require('./lib/mediaType') + +/** + * Module exports. + * @public + */ + +module.exports = Negotiator; +module.exports.Negotiator = Negotiator; + +/** + * Create a Negotiator instance from a request. + * @param {object} request + * @public + */ + +function Negotiator(request) { + if (!(this instanceof Negotiator)) { + return new Negotiator(request); + } + + this.request = request; +} + +Negotiator.prototype.charset = function charset(available) { + var set = this.charsets(available); + return set && set[0]; +}; + +Negotiator.prototype.charsets = function charsets(available) { + return preferredCharsets(this.request.headers['accept-charset'], available); +}; + +Negotiator.prototype.encoding = function encoding(available, opts) { + var set = this.encodings(available, opts); + return set && set[0]; +}; + +Negotiator.prototype.encodings = function encodings(available, options) { + var opts = options || {}; + return preferredEncodings(this.request.headers['accept-encoding'], available, opts.preferred); +}; + +Negotiator.prototype.language = function language(available) { + var set = this.languages(available); + return set && set[0]; +}; + +Negotiator.prototype.languages = function languages(available) { + return preferredLanguages(this.request.headers['accept-language'], available); +}; + +Negotiator.prototype.mediaType = function mediaType(available) { + var set = this.mediaTypes(available); + return set && set[0]; +}; + +Negotiator.prototype.mediaTypes = function mediaTypes(available) { + return preferredMediaTypes(this.request.headers.accept, available); +}; + +// Backwards compatibility +Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; +Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; +Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; +Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; +Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; +Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; +Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; +Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; diff --git a/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/charset.js b/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/charset.js new file mode 100644 index 0000000000000000000000000000000000000000..cdd014803474a4b76b981c475a32ebcaa81a36e5 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/charset.js @@ -0,0 +1,169 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredCharsets; +module.exports.preferredCharsets = preferredCharsets; + +/** + * Module variables. + * @private + */ + +var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Charset header. + * @private + */ + +function parseAcceptCharset(accept) { + var accepts = accept.split(','); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var charset = parseCharset(accepts[i].trim(), i); + + if (charset) { + accepts[j++] = charset; + } + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse a charset from the Accept-Charset header. + * @private + */ + +function parseCharset(str, i) { + var match = simpleCharsetRegExp.exec(str); + if (!match) return null; + + var charset = match[1]; + var q = 1; + if (match[2]) { + var params = match[2].split(';') + for (var j = 0; j < params.length; j++) { + var p = params[j].trim().split('='); + if (p[0] === 'q') { + q = parseFloat(p[1]); + break; + } + } + } + + return { + charset: charset, + q: q, + i: i + }; +} + +/** + * Get the priority of a charset. + * @private + */ + +function getCharsetPriority(charset, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(charset, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the charset. + * @private + */ + +function specify(charset, spec, index) { + var s = 0; + if(spec.charset.toLowerCase() === charset.toLowerCase()){ + s |= 1; + } else if (spec.charset !== '*' ) { + return null + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s + } +} + +/** + * Get the preferred charsets from an Accept-Charset header. + * @public + */ + +function preferredCharsets(accept, provided) { + // RFC 2616 sec 14.2: no header = * + var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); + + if (!provided) { + // sorted list of all charsets + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullCharset); + } + + var priorities = provided.map(function getPriority(type, index) { + return getCharsetPriority(type, accepts, index); + }); + + // sorted list of accepted charsets + return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full charset string. + * @private + */ + +function getFullCharset(spec) { + return spec.charset; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/encoding.js b/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/encoding.js new file mode 100644 index 0000000000000000000000000000000000000000..9ebb633d67743316863baf3504bfe1d47d53b033 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/encoding.js @@ -0,0 +1,205 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredEncodings; +module.exports.preferredEncodings = preferredEncodings; + +/** + * Module variables. + * @private + */ + +var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Encoding header. + * @private + */ + +function parseAcceptEncoding(accept) { + var accepts = accept.split(','); + var hasIdentity = false; + var minQuality = 1; + + for (var i = 0, j = 0; i < accepts.length; i++) { + var encoding = parseEncoding(accepts[i].trim(), i); + + if (encoding) { + accepts[j++] = encoding; + hasIdentity = hasIdentity || specify('identity', encoding); + minQuality = Math.min(minQuality, encoding.q || 1); + } + } + + if (!hasIdentity) { + /* + * If identity doesn't explicitly appear in the accept-encoding header, + * it's added to the list of acceptable encoding with the lowest q + */ + accepts[j++] = { + encoding: 'identity', + q: minQuality, + i: i + }; + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse an encoding from the Accept-Encoding header. + * @private + */ + +function parseEncoding(str, i) { + var match = simpleEncodingRegExp.exec(str); + if (!match) return null; + + var encoding = match[1]; + var q = 1; + if (match[2]) { + var params = match[2].split(';'); + for (var j = 0; j < params.length; j++) { + var p = params[j].trim().split('='); + if (p[0] === 'q') { + q = parseFloat(p[1]); + break; + } + } + } + + return { + encoding: encoding, + q: q, + i: i + }; +} + +/** + * Get the priority of an encoding. + * @private + */ + +function getEncodingPriority(encoding, accepted, index) { + var priority = {encoding: encoding, o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(encoding, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the encoding. + * @private + */ + +function specify(encoding, spec, index) { + var s = 0; + if(spec.encoding.toLowerCase() === encoding.toLowerCase()){ + s |= 1; + } else if (spec.encoding !== '*' ) { + return null + } + + return { + encoding: encoding, + i: index, + o: spec.i, + q: spec.q, + s: s + } +}; + +/** + * Get the preferred encodings from an Accept-Encoding header. + * @public + */ + +function preferredEncodings(accept, provided, preferred) { + var accepts = parseAcceptEncoding(accept || ''); + + var comparator = preferred ? function comparator (a, b) { + if (a.q !== b.q) { + return b.q - a.q // higher quality first + } + + var aPreferred = preferred.indexOf(a.encoding) + var bPreferred = preferred.indexOf(b.encoding) + + if (aPreferred === -1 && bPreferred === -1) { + // consider the original specifity/order + return (b.s - a.s) || (a.o - b.o) || (a.i - b.i) + } + + if (aPreferred !== -1 && bPreferred !== -1) { + return aPreferred - bPreferred // consider the preferred order + } + + return aPreferred === -1 ? 1 : -1 // preferred first + } : compareSpecs; + + if (!provided) { + // sorted list of all encodings + return accepts + .filter(isQuality) + .sort(comparator) + .map(getFullEncoding); + } + + var priorities = provided.map(function getPriority(type, index) { + return getEncodingPriority(type, accepts, index); + }); + + // sorted list of accepted encodings + return priorities.filter(isQuality).sort(comparator).map(function getEncoding(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i); +} + +/** + * Get full encoding string. + * @private + */ + +function getFullEncoding(spec) { + return spec.encoding; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/language.js b/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/language.js new file mode 100644 index 0000000000000000000000000000000000000000..a23167252719be841ad570eb655a703a4ae8fe9e --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/language.js @@ -0,0 +1,179 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredLanguages; +module.exports.preferredLanguages = preferredLanguages; + +/** + * Module variables. + * @private + */ + +var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Language header. + * @private + */ + +function parseAcceptLanguage(accept) { + var accepts = accept.split(','); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var language = parseLanguage(accepts[i].trim(), i); + + if (language) { + accepts[j++] = language; + } + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse a language from the Accept-Language header. + * @private + */ + +function parseLanguage(str, i) { + var match = simpleLanguageRegExp.exec(str); + if (!match) return null; + + var prefix = match[1] + var suffix = match[2] + var full = prefix + + if (suffix) full += "-" + suffix; + + var q = 1; + if (match[3]) { + var params = match[3].split(';') + for (var j = 0; j < params.length; j++) { + var p = params[j].split('='); + if (p[0] === 'q') q = parseFloat(p[1]); + } + } + + return { + prefix: prefix, + suffix: suffix, + q: q, + i: i, + full: full + }; +} + +/** + * Get the priority of a language. + * @private + */ + +function getLanguagePriority(language, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(language, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the language. + * @private + */ + +function specify(language, spec, index) { + var p = parseLanguage(language) + if (!p) return null; + var s = 0; + if(spec.full.toLowerCase() === p.full.toLowerCase()){ + s |= 4; + } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) { + s |= 2; + } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) { + s |= 1; + } else if (spec.full !== '*' ) { + return null + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s + } +}; + +/** + * Get the preferred languages from an Accept-Language header. + * @public + */ + +function preferredLanguages(accept, provided) { + // RFC 2616 sec 14.4: no header = * + var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); + + if (!provided) { + // sorted list of all languages + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullLanguage); + } + + var priorities = provided.map(function getPriority(type, index) { + return getLanguagePriority(type, accepts, index); + }); + + // sorted list of accepted languages + return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full language string. + * @private + */ + +function getFullLanguage(spec) { + return spec.full; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/mediaType.js b/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/mediaType.js new file mode 100644 index 0000000000000000000000000000000000000000..8e402ea88394c040bf5964f65b8eba33b50bd4a1 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/negotiator/lib/mediaType.js @@ -0,0 +1,294 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredMediaTypes; +module.exports.preferredMediaTypes = preferredMediaTypes; + +/** + * Module variables. + * @private + */ + +var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept header. + * @private + */ + +function parseAccept(accept) { + var accepts = splitMediaTypes(accept); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var mediaType = parseMediaType(accepts[i].trim(), i); + + if (mediaType) { + accepts[j++] = mediaType; + } + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse a media type from the Accept header. + * @private + */ + +function parseMediaType(str, i) { + var match = simpleMediaTypeRegExp.exec(str); + if (!match) return null; + + var params = Object.create(null); + var q = 1; + var subtype = match[2]; + var type = match[1]; + + if (match[3]) { + var kvps = splitParameters(match[3]).map(splitKeyValuePair); + + for (var j = 0; j < kvps.length; j++) { + var pair = kvps[j]; + var key = pair[0].toLowerCase(); + var val = pair[1]; + + // get the value, unwrapping quotes + var value = val && val[0] === '"' && val[val.length - 1] === '"' + ? val.slice(1, -1) + : val; + + if (key === 'q') { + q = parseFloat(value); + break; + } + + // store parameter + params[key] = value; + } + } + + return { + type: type, + subtype: subtype, + params: params, + q: q, + i: i + }; +} + +/** + * Get the priority of a media type. + * @private + */ + +function getMediaTypePriority(type, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(type, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the media type. + * @private + */ + +function specify(type, spec, index) { + var p = parseMediaType(type); + var s = 0; + + if (!p) { + return null; + } + + if(spec.type.toLowerCase() == p.type.toLowerCase()) { + s |= 4 + } else if(spec.type != '*') { + return null; + } + + if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { + s |= 2 + } else if(spec.subtype != '*') { + return null; + } + + var keys = Object.keys(spec.params); + if (keys.length > 0) { + if (keys.every(function (k) { + return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase(); + })) { + s |= 1 + } else { + return null + } + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s, + } +} + +/** + * Get the preferred media types from an Accept header. + * @public + */ + +function preferredMediaTypes(accept, provided) { + // RFC 2616 sec 14.2: no header = */* + var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); + + if (!provided) { + // sorted list of all types + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullType); + } + + var priorities = provided.map(function getPriority(type, index) { + return getMediaTypePriority(type, accepts, index); + }); + + // sorted list of accepted types + return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full type string. + * @private + */ + +function getFullType(spec) { + return spec.type + '/' + spec.subtype; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} + +/** + * Count the number of quotes in a string. + * @private + */ + +function quoteCount(string) { + var count = 0; + var index = 0; + + while ((index = string.indexOf('"', index)) !== -1) { + count++; + index++; + } + + return count; +} + +/** + * Split a key value pair. + * @private + */ + +function splitKeyValuePair(str) { + var index = str.indexOf('='); + var key; + var val; + + if (index === -1) { + key = str; + } else { + key = str.slice(0, index); + val = str.slice(index + 1); + } + + return [key, val]; +} + +/** + * Split an Accept header into media types. + * @private + */ + +function splitMediaTypes(accept) { + var accepts = accept.split(','); + + for (var i = 1, j = 0; i < accepts.length; i++) { + if (quoteCount(accepts[j]) % 2 == 0) { + accepts[++j] = accepts[i]; + } else { + accepts[j] += ',' + accepts[i]; + } + } + + // trim accepts + accepts.length = j + 1; + + return accepts; +} + +/** + * Split a string of parameters. + * @private + */ + +function splitParameters(str) { + var parameters = str.split(';'); + + for (var i = 1, j = 0; i < parameters.length; i++) { + if (quoteCount(parameters[j]) % 2 == 0) { + parameters[++j] = parameters[i]; + } else { + parameters[j] += ';' + parameters[i]; + } + } + + // trim parameters + parameters.length = j + 1; + + for (var i = 0; i < parameters.length; i++) { + parameters[i] = parameters[i].trim(); + } + + return parameters; +} diff --git a/node_modules/@nestjs/platform-express/node_modules/negotiator/package.json b/node_modules/@nestjs/platform-express/node_modules/negotiator/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e4bdc1ef4f74812bfc15dbd980eab1f57282b753 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/negotiator/package.json @@ -0,0 +1,43 @@ +{ + "name": "negotiator", + "description": "HTTP content negotiation", + "version": "1.0.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Federico Romero ", + "Isaac Z. Schlueter (http://blog.izs.me/)" + ], + "license": "MIT", + "keywords": [ + "http", + "content negotiation", + "accept", + "accept-language", + "accept-encoding", + "accept-charset" + ], + "repository": "jshttp/negotiator", + "devDependencies": { + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "mocha": "9.1.3", + "nyc": "15.1.0" + }, + "files": [ + "lib/", + "HISTORY.md", + "LICENSE", + "index.js", + "README.md" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/send/LICENSE b/node_modules/@nestjs/platform-express/node_modules/send/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b6ea1c1fd44ff6f4af6a8e4e5d4793004b9e8524 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/send/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/send/README.md b/node_modules/@nestjs/platform-express/node_modules/send/README.md new file mode 100644 index 0000000000000000000000000000000000000000..350fccd5aa88fb0a855d182db3073b17991b6cc2 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/send/README.md @@ -0,0 +1,317 @@ +# send + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![CI][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Send is a library for streaming files from the file system as a http response +supporting partial responses (Ranges), conditional-GET negotiation (If-Match, +If-Unmodified-Since, If-None-Match, If-Modified-Since), high test coverage, +and granular events which may be leveraged to take appropriate actions in your +application or framework. + +Looking to serve up entire folders mapped to URLs? Try [serve-static](https://www.npmjs.org/package/serve-static). + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install send +``` + +## API + +```js +var send = require('send') +``` + +### send(req, path, [options]) + +Create a new `SendStream` for the given path to send to a `res`. The `req` is +the Node.js HTTP request and the `path` is a urlencoded path to send (urlencoded, +not the actual file-system path). + +#### Options + +##### acceptRanges + +Enable or disable accepting ranged requests, defaults to true. +Disabling this will not send `Accept-Ranges` and ignore the contents +of the `Range` request header. + +##### cacheControl + +Enable or disable setting `Cache-Control` response header, defaults to +true. Disabling this will ignore the `immutable` and `maxAge` options. + +##### dotfiles + +Set how "dotfiles" are treated when encountered. A dotfile is a file +or directory that begins with a dot ("."). Note this check is done on +the path itself without checking if the path actually exists on the +disk. If `root` is specified, only the dotfiles above the root are +checked (i.e. the root itself can be within a dotfile when set +to "deny"). + + - `'allow'` No special treatment for dotfiles. + - `'deny'` Send a 403 for any request for a dotfile. + - `'ignore'` Pretend like the dotfile does not exist and 404. + +The default value is _similar_ to `'ignore'`, with the exception that +this default will not ignore the files within a directory that begins +with a dot, for backward-compatibility. + +##### end + +Byte offset at which the stream ends, defaults to the length of the file +minus 1. The end is inclusive in the stream, meaning `end: 3` will include +the 4th byte in the stream. + +##### etag + +Enable or disable etag generation, defaults to true. + +##### extensions + +If a given file doesn't exist, try appending one of the given extensions, +in the given order. By default, this is disabled (set to `false`). An +example value that will serve extension-less HTML files: `['html', 'htm']`. +This is skipped if the requested file already has an extension. + +##### immutable + +Enable or disable the `immutable` directive in the `Cache-Control` response +header, defaults to `false`. If set to `true`, the `maxAge` option should +also be specified to enable caching. The `immutable` directive will prevent +supported clients from making conditional requests during the life of the +`maxAge` option to check if the file has changed. + +##### index + +By default send supports "index.html" files, to disable this +set `false` or to supply a new index pass a string or an array +in preferred order. + +##### lastModified + +Enable or disable `Last-Modified` header, defaults to true. Uses the file +system's last modified value. + +##### maxAge + +Provide a max-age in milliseconds for http caching, defaults to 0. +This can also be a string accepted by the +[ms](https://www.npmjs.org/package/ms#readme) module. + +##### root + +Serve files relative to `path`. + +##### start + +Byte offset at which the stream starts, defaults to 0. The start is inclusive, +meaning `start: 2` will include the 3rd byte in the stream. + +#### Events + +The `SendStream` is an event emitter and will emit the following events: + + - `error` an error occurred `(err)` + - `directory` a directory was requested `(res, path)` + - `file` a file was requested `(path, stat)` + - `headers` the headers are about to be set on a file `(res, path, stat)` + - `stream` file streaming has started `(stream)` + - `end` streaming has completed + +#### .pipe + +The `pipe` method is used to pipe the response into the Node.js HTTP response +object, typically `send(req, path, options).pipe(res)`. + +## Error-handling + +By default when no `error` listeners are present an automatic response will be +made, otherwise you have full control over the response, aka you may show a 5xx +page etc. + +## Caching + +It does _not_ perform internal caching, you should use a reverse proxy cache +such as Varnish for this, or those fancy things called CDNs. If your +application is small enough that it would benefit from single-node memory +caching, it's small enough that it does not need caching at all ;). + +## Debugging + +To enable `debug()` instrumentation output export __DEBUG__: + +``` +$ DEBUG=send node app +``` + +## Running tests + +``` +$ npm install +$ npm test +``` + +## Examples + +### Serve a specific file + +This simple example will send a specific file to all requests. + +```js +var http = require('http') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + send(req, '/path/to/index.html') + .pipe(res) +}) + +server.listen(3000) +``` + +### Serve all files from a directory + +This simple example will just serve up all the files in a +given directory as the top-level. For example, a request +`GET /foo.txt` will send back `/www/public/foo.txt`. + +```js +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .pipe(res) +}) + +server.listen(3000) +``` + +### Custom file types + +```js +var extname = require('path').extname +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .on('headers', function (res, path) { + switch (extname(path)) { + case '.x-mt': + case '.x-mtt': + // custom type for these extensions + res.setHeader('Content-Type', 'application/x-my-type') + break + } + }) + .pipe(res) +}) + +server.listen(3000) +``` + +### Custom directory index view + +This is an example of serving up a structure of directories with a +custom function to render a listing of a directory. + +```js +var http = require('http') +var fs = require('fs') +var parseUrl = require('parseurl') +var send = require('send') + +// Transfer arbitrary files from within /www/example.com/public/* +// with a custom handler for directory listing +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { index: false, root: '/www/public' }) + .once('directory', directory) + .pipe(res) +}) + +server.listen(3000) + +// Custom directory handler +function directory (res, path) { + var stream = this + + // redirect to trailing slash for consistent url + if (!stream.hasTrailingSlash()) { + return stream.redirect(path) + } + + // get directory list + fs.readdir(path, function onReaddir (err, list) { + if (err) return stream.error(err) + + // render an index for the directory + res.setHeader('Content-Type', 'text/plain; charset=UTF-8') + res.end(list.join('\n') + '\n') + }) +} +``` + +### Serving from a root directory with custom error-handling + +```js +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + // your custom error-handling logic: + function error (err) { + res.statusCode = err.status || 500 + res.end(err.message) + } + + // your custom headers + function headers (res, path, stat) { + // serve all files for download + res.setHeader('Content-Disposition', 'attachment') + } + + // your custom directory handling logic: + function redirect () { + res.statusCode = 301 + res.setHeader('Location', req.url + '/') + res.end('Redirecting to ' + req.url + '/') + } + + // transfer arbitrary files from within + // /www/example.com/public/* + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .on('error', error) + .on('directory', redirect) + .on('headers', headers) + .pipe(res) +}) + +server.listen(3000) +``` + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master +[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux +[github-actions-ci-url]: https://github.com/pillarjs/send/actions/workflows/ci.yml +[node-image]: https://badgen.net/npm/node/send +[node-url]: https://nodejs.org/en/download/ +[npm-downloads-image]: https://badgen.net/npm/dm/send +[npm-url]: https://npmjs.org/package/send +[npm-version-image]: https://badgen.net/npm/v/send diff --git a/node_modules/@nestjs/platform-express/node_modules/send/index.js b/node_modules/@nestjs/platform-express/node_modules/send/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1655053d15ca7d95cc1d3442d16f83c12ab68b66 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/send/index.js @@ -0,0 +1,997 @@ +/*! + * send + * Copyright(c) 2012 TJ Holowaychuk + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var createError = require('http-errors') +var debug = require('debug')('send') +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var etag = require('etag') +var fresh = require('fresh') +var fs = require('fs') +var mime = require('mime-types') +var ms = require('ms') +var onFinished = require('on-finished') +var parseRange = require('range-parser') +var path = require('path') +var statuses = require('statuses') +var Stream = require('stream') +var util = require('util') + +/** + * Path function references. + * @private + */ + +var extname = path.extname +var join = path.join +var normalize = path.normalize +var resolve = path.resolve +var sep = path.sep + +/** + * Regular expression for identifying a bytes Range header. + * @private + */ + +var BYTES_RANGE_REGEXP = /^ *bytes=/ + +/** + * Maximum value allowed for the max age. + * @private + */ + +var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year + +/** + * Regular expression to match a path with a directory up component. + * @private + */ + +var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/ + +/** + * Module exports. + * @public + */ + +module.exports = send + +/** + * Return a `SendStream` for `req` and `path`. + * + * @param {object} req + * @param {string} path + * @param {object} [options] + * @return {SendStream} + * @public + */ + +function send (req, path, options) { + return new SendStream(req, path, options) +} + +/** + * Initialize a `SendStream` with the given `path`. + * + * @param {Request} req + * @param {String} path + * @param {object} [options] + * @private + */ + +function SendStream (req, path, options) { + Stream.call(this) + + var opts = options || {} + + this.options = opts + this.path = path + this.req = req + + this._acceptRanges = opts.acceptRanges !== undefined + ? Boolean(opts.acceptRanges) + : true + + this._cacheControl = opts.cacheControl !== undefined + ? Boolean(opts.cacheControl) + : true + + this._etag = opts.etag !== undefined + ? Boolean(opts.etag) + : true + + this._dotfiles = opts.dotfiles !== undefined + ? opts.dotfiles + : 'ignore' + + if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') { + throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"') + } + + this._extensions = opts.extensions !== undefined + ? normalizeList(opts.extensions, 'extensions option') + : [] + + this._immutable = opts.immutable !== undefined + ? Boolean(opts.immutable) + : false + + this._index = opts.index !== undefined + ? normalizeList(opts.index, 'index option') + : ['index.html'] + + this._lastModified = opts.lastModified !== undefined + ? Boolean(opts.lastModified) + : true + + this._maxage = opts.maxAge || opts.maxage + this._maxage = typeof this._maxage === 'string' + ? ms(this._maxage) + : Number(this._maxage) + this._maxage = !isNaN(this._maxage) + ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) + : 0 + + this._root = opts.root + ? resolve(opts.root) + : null +} + +/** + * Inherits from `Stream`. + */ + +util.inherits(SendStream, Stream) + +/** + * Emit error with `status`. + * + * @param {number} status + * @param {Error} [err] + * @private + */ + +SendStream.prototype.error = function error (status, err) { + // emit if listeners instead of responding + if (hasListeners(this, 'error')) { + return this.emit('error', createHttpError(status, err)) + } + + var res = this.res + var msg = statuses.message[status] || String(status) + var doc = createHtmlDocument('Error', escapeHtml(msg)) + + // clear existing headers + clearHeaders(res) + + // add error headers + if (err && err.headers) { + setHeaders(res, err.headers) + } + + // send basic response + res.statusCode = status + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + res.end(doc) +} + +/** + * Check if the pathname ends with "/". + * + * @return {boolean} + * @private + */ + +SendStream.prototype.hasTrailingSlash = function hasTrailingSlash () { + return this.path[this.path.length - 1] === '/' +} + +/** + * Check if this is a conditional GET request. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isConditionalGET = function isConditionalGET () { + return this.req.headers['if-match'] || + this.req.headers['if-unmodified-since'] || + this.req.headers['if-none-match'] || + this.req.headers['if-modified-since'] +} + +/** + * Check if the request preconditions failed. + * + * @return {boolean} + * @private + */ + +SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () { + var req = this.req + var res = this.res + + // if-match + var match = req.headers['if-match'] + if (match) { + var etag = res.getHeader('ETag') + return !etag || (match !== '*' && parseTokenList(match).every(function (match) { + return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag + })) + } + + // if-unmodified-since + var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since']) + if (!isNaN(unmodifiedSince)) { + var lastModified = parseHttpDate(res.getHeader('Last-Modified')) + return isNaN(lastModified) || lastModified > unmodifiedSince + } + + return false +} + +/** + * Strip various content header fields for a change in entity. + * + * @private + */ + +SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () { + var res = this.res + + res.removeHeader('Content-Encoding') + res.removeHeader('Content-Language') + res.removeHeader('Content-Length') + res.removeHeader('Content-Range') + res.removeHeader('Content-Type') +} + +/** + * Respond with 304 not modified. + * + * @api private + */ + +SendStream.prototype.notModified = function notModified () { + var res = this.res + debug('not modified') + this.removeContentHeaderFields() + res.statusCode = 304 + res.end() +} + +/** + * Raise error that headers already sent. + * + * @api private + */ + +SendStream.prototype.headersAlreadySent = function headersAlreadySent () { + var err = new Error('Can\'t set headers after they are sent.') + debug('headers already sent') + this.error(500, err) +} + +/** + * Check if the request is cacheable, aka + * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isCachable = function isCachable () { + var statusCode = this.res.statusCode + return (statusCode >= 200 && statusCode < 300) || + statusCode === 304 +} + +/** + * Handle stat() error. + * + * @param {Error} error + * @private + */ + +SendStream.prototype.onStatError = function onStatError (error) { + switch (error.code) { + case 'ENAMETOOLONG': + case 'ENOENT': + case 'ENOTDIR': + this.error(404, error) + break + default: + this.error(500, error) + break + } +} + +/** + * Check if the cache is fresh. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isFresh = function isFresh () { + return fresh(this.req.headers, { + etag: this.res.getHeader('ETag'), + 'last-modified': this.res.getHeader('Last-Modified') + }) +} + +/** + * Check if the range is fresh. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isRangeFresh = function isRangeFresh () { + var ifRange = this.req.headers['if-range'] + + if (!ifRange) { + return true + } + + // if-range as etag + if (ifRange.indexOf('"') !== -1) { + var etag = this.res.getHeader('ETag') + return Boolean(etag && ifRange.indexOf(etag) !== -1) + } + + // if-range as modified date + var lastModified = this.res.getHeader('Last-Modified') + return parseHttpDate(lastModified) <= parseHttpDate(ifRange) +} + +/** + * Redirect to path. + * + * @param {string} path + * @private + */ + +SendStream.prototype.redirect = function redirect (path) { + var res = this.res + + if (hasListeners(this, 'directory')) { + this.emit('directory', res, path) + return + } + + if (this.hasTrailingSlash()) { + this.error(403) + return + } + + var loc = encodeUrl(collapseLeadingSlashes(this.path + '/')) + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc)) + + // redirect + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + res.setHeader('Location', loc) + res.end(doc) +} + +/** + * Pipe to `res. + * + * @param {Stream} res + * @return {Stream} res + * @api public + */ + +SendStream.prototype.pipe = function pipe (res) { + // root path + var root = this._root + + // references + this.res = res + + // decode the path + var path = decode(this.path) + if (path === -1) { + this.error(400) + return res + } + + // null byte(s) + if (~path.indexOf('\0')) { + this.error(400) + return res + } + + var parts + if (root !== null) { + // normalize + if (path) { + path = normalize('.' + sep + path) + } + + // malicious path + if (UP_PATH_REGEXP.test(path)) { + debug('malicious path "%s"', path) + this.error(403) + return res + } + + // explode path parts + parts = path.split(sep) + + // join / normalize from optional root dir + path = normalize(join(root, path)) + } else { + // ".." is malicious without "root" + if (UP_PATH_REGEXP.test(path)) { + debug('malicious path "%s"', path) + this.error(403) + return res + } + + // explode path parts + parts = normalize(path).split(sep) + + // resolve the path + path = resolve(path) + } + + // dotfile handling + if (containsDotFile(parts)) { + debug('%s dotfile "%s"', this._dotfiles, path) + switch (this._dotfiles) { + case 'allow': + break + case 'deny': + this.error(403) + return res + case 'ignore': + default: + this.error(404) + return res + } + } + + // index file support + if (this._index.length && this.hasTrailingSlash()) { + this.sendIndex(path) + return res + } + + this.sendFile(path) + return res +} + +/** + * Transfer `path`. + * + * @param {String} path + * @api public + */ + +SendStream.prototype.send = function send (path, stat) { + var len = stat.size + var options = this.options + var opts = {} + var res = this.res + var req = this.req + var ranges = req.headers.range + var offset = options.start || 0 + + if (res.headersSent) { + // impossible to send now + this.headersAlreadySent() + return + } + + debug('pipe "%s"', path) + + // set header fields + this.setHeader(path, stat) + + // set content-type + this.type(path) + + // conditional GET support + if (this.isConditionalGET()) { + if (this.isPreconditionFailure()) { + this.error(412) + return + } + + if (this.isCachable() && this.isFresh()) { + this.notModified() + return + } + } + + // adjust len to start/end options + len = Math.max(0, len - offset) + if (options.end !== undefined) { + var bytes = options.end - offset + 1 + if (len > bytes) len = bytes + } + + // Range support + if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) { + // parse + ranges = parseRange(len, ranges, { + combine: true + }) + + // If-Range support + if (!this.isRangeFresh()) { + debug('range stale') + ranges = -2 + } + + // unsatisfiable + if (ranges === -1) { + debug('range unsatisfiable') + + // Content-Range + res.setHeader('Content-Range', contentRange('bytes', len)) + + // 416 Requested Range Not Satisfiable + return this.error(416, { + headers: { 'Content-Range': res.getHeader('Content-Range') } + }) + } + + // valid (syntactically invalid/multiple ranges are treated as a regular response) + if (ranges !== -2 && ranges.length === 1) { + debug('range %j', ranges) + + // Content-Range + res.statusCode = 206 + res.setHeader('Content-Range', contentRange('bytes', len, ranges[0])) + + // adjust for requested range + offset += ranges[0].start + len = ranges[0].end - ranges[0].start + 1 + } + } + + // clone options + for (var prop in options) { + opts[prop] = options[prop] + } + + // set read options + opts.start = offset + opts.end = Math.max(offset, offset + len - 1) + + // content-length + res.setHeader('Content-Length', len) + + // HEAD support + if (req.method === 'HEAD') { + res.end() + return + } + + this.stream(path, opts) +} + +/** + * Transfer file for `path`. + * + * @param {String} path + * @api private + */ +SendStream.prototype.sendFile = function sendFile (path) { + var i = 0 + var self = this + + debug('stat "%s"', path) + fs.stat(path, function onstat (err, stat) { + var pathEndsWithSep = path[path.length - 1] === sep + if (err && err.code === 'ENOENT' && !extname(path) && !pathEndsWithSep) { + // not found, check extensions + return next(err) + } + if (err) return self.onStatError(err) + if (stat.isDirectory()) return self.redirect(path) + if (pathEndsWithSep) return self.error(404) + self.emit('file', path, stat) + self.send(path, stat) + }) + + function next (err) { + if (self._extensions.length <= i) { + return err + ? self.onStatError(err) + : self.error(404) + } + + var p = path + '.' + self._extensions[i++] + + debug('stat "%s"', p) + fs.stat(p, function (err, stat) { + if (err) return next(err) + if (stat.isDirectory()) return next() + self.emit('file', p, stat) + self.send(p, stat) + }) + } +} + +/** + * Transfer index for `path`. + * + * @param {String} path + * @api private + */ +SendStream.prototype.sendIndex = function sendIndex (path) { + var i = -1 + var self = this + + function next (err) { + if (++i >= self._index.length) { + if (err) return self.onStatError(err) + return self.error(404) + } + + var p = join(path, self._index[i]) + + debug('stat "%s"', p) + fs.stat(p, function (err, stat) { + if (err) return next(err) + if (stat.isDirectory()) return next() + self.emit('file', p, stat) + self.send(p, stat) + }) + } + + next() +} + +/** + * Stream `path` to the response. + * + * @param {String} path + * @param {Object} options + * @api private + */ + +SendStream.prototype.stream = function stream (path, options) { + var self = this + var res = this.res + + // pipe + var stream = fs.createReadStream(path, options) + this.emit('stream', stream) + stream.pipe(res) + + // cleanup + function cleanup () { + stream.destroy() + } + + // response finished, cleanup + onFinished(res, cleanup) + + // error handling + stream.on('error', function onerror (err) { + // clean up stream early + cleanup() + + // error + self.onStatError(err) + }) + + // end + stream.on('end', function onend () { + self.emit('end') + }) +} + +/** + * Set content-type based on `path` + * if it hasn't been explicitly set. + * + * @param {String} path + * @api private + */ + +SendStream.prototype.type = function type (path) { + var res = this.res + + if (res.getHeader('Content-Type')) return + + var ext = extname(path) + var type = mime.contentType(ext) || 'application/octet-stream' + + debug('content-type %s', type) + res.setHeader('Content-Type', type) +} + +/** + * Set response header fields, most + * fields may be pre-defined. + * + * @param {String} path + * @param {Object} stat + * @api private + */ + +SendStream.prototype.setHeader = function setHeader (path, stat) { + var res = this.res + + this.emit('headers', res, path, stat) + + if (this._acceptRanges && !res.getHeader('Accept-Ranges')) { + debug('accept ranges') + res.setHeader('Accept-Ranges', 'bytes') + } + + if (this._cacheControl && !res.getHeader('Cache-Control')) { + var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000) + + if (this._immutable) { + cacheControl += ', immutable' + } + + debug('cache-control %s', cacheControl) + res.setHeader('Cache-Control', cacheControl) + } + + if (this._lastModified && !res.getHeader('Last-Modified')) { + var modified = stat.mtime.toUTCString() + debug('modified %s', modified) + res.setHeader('Last-Modified', modified) + } + + if (this._etag && !res.getHeader('ETag')) { + var val = etag(stat) + debug('etag %s', val) + res.setHeader('ETag', val) + } +} + +/** + * Clear all headers from a response. + * + * @param {object} res + * @private + */ + +function clearHeaders (res) { + for (const header of res.getHeaderNames()) { + res.removeHeader(header) + } +} + +/** + * Collapse all leading slashes into a single slash + * + * @param {string} str + * @private + */ +function collapseLeadingSlashes (str) { + for (var i = 0; i < str.length; i++) { + if (str[i] !== '/') { + break + } + } + + return i > 1 + ? '/' + str.substr(i) + : str +} + +/** + * Determine if path parts contain a dotfile. + * + * @api private + */ + +function containsDotFile (parts) { + for (var i = 0; i < parts.length; i++) { + var part = parts[i] + if (part.length > 1 && part[0] === '.') { + return true + } + } + + return false +} + +/** + * Create a Content-Range header. + * + * @param {string} type + * @param {number} size + * @param {array} [range] + */ + +function contentRange (type, size, range) { + return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size +} + +/** + * Create a minimal HTML document. + * + * @param {string} title + * @param {string} body + * @private + */ + +function createHtmlDocument (title, body) { + return '\n' + + '\n' + + '\n' + + '\n' + + '' + title + '\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Create a HttpError object from simple arguments. + * + * @param {number} status + * @param {Error|object} err + * @private + */ + +function createHttpError (status, err) { + if (!err) { + return createError(status) + } + + return err instanceof Error + ? createError(status, err, { expose: false }) + : createError(status, err) +} + +/** + * decodeURIComponent. + * + * Allows V8 to only deoptimize this fn instead of all + * of send(). + * + * @param {String} path + * @api private + */ + +function decode (path) { + try { + return decodeURIComponent(path) + } catch (err) { + return -1 + } +} + +/** + * Determine if emitter has listeners of a given type. + * + * The way to do this check is done three different ways in Node.js >= 0.10 + * so this consolidates them into a minimal set using instance methods. + * + * @param {EventEmitter} emitter + * @param {string} type + * @returns {boolean} + * @private + */ + +function hasListeners (emitter, type) { + var count = typeof emitter.listenerCount !== 'function' + ? emitter.listeners(type).length + : emitter.listenerCount(type) + + return count > 0 +} + +/** + * Normalize the index option into an array. + * + * @param {boolean|string|array} val + * @param {string} name + * @private + */ + +function normalizeList (val, name) { + var list = [].concat(val || []) + + for (var i = 0; i < list.length; i++) { + if (typeof list[i] !== 'string') { + throw new TypeError(name + ' must be array of strings or false') + } + } + + return list +} + +/** + * Parse an HTTP Date into a number. + * + * @param {string} date + * @private + */ + +function parseHttpDate (date) { + var timestamp = date && Date.parse(date) + + return typeof timestamp === 'number' + ? timestamp + : NaN +} + +/** + * Parse a HTTP token list. + * + * @param {string} str + * @private + */ + +function parseTokenList (str) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = str.length; i < len; i++) { + switch (str.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + if (start !== end) { + list.push(str.substring(start, end)) + } + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + if (start !== end) { + list.push(str.substring(start, end)) + } + + return list +} + +/** + * Set an object of headers on a response. + * + * @param {object} res + * @param {object} headers + * @private + */ + +function setHeaders (res, headers) { + var keys = Object.keys(headers) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + res.setHeader(key, headers[key]) + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/send/package.json b/node_modules/@nestjs/platform-express/node_modules/send/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e9d3cc293cd2d2364a4da6d3c98be86768755619 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/send/package.json @@ -0,0 +1,63 @@ +{ + "name": "send", + "description": "Better streaming static file server with Range and conditional-GET support", + "version": "1.2.1", + "author": "TJ Holowaychuk ", + "contributors": [ + "Douglas Christopher Wilson ", + "James Wyatt Cready ", + "Jesús Leganés Combarro " + ], + "license": "MIT", + "repository": "pillarjs/send", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "keywords": [ + "static", + "file", + "server" + ], + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "devDependencies": { + "after": "^0.8.2", + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.32.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "^10.7.0", + "nyc": "^17.0.0", + "supertest": "6.3.4" + }, + "files": [ + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --check-leaks --reporter spec", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/serve-static/LICENSE b/node_modules/@nestjs/platform-express/node_modules/serve-static/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cbe62e8e7f20b6aa70e4d138b1503837ae4e5f95 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/serve-static/LICENSE @@ -0,0 +1,25 @@ +(The MIT License) + +Copyright (c) 2010 Sencha Inc. +Copyright (c) 2011 LearnBoost +Copyright (c) 2011 TJ Holowaychuk +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@nestjs/platform-express/node_modules/serve-static/README.md b/node_modules/@nestjs/platform-express/node_modules/serve-static/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3ff1f1fa397718be73e1bb4a44149f8df224a18a --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/serve-static/README.md @@ -0,0 +1,253 @@ +# serve-static + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![CI][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install serve-static +``` + +## API + +```js +const serveStatic = require('serve-static') +``` + +### serveStatic(root, options) + +Create a new middleware function to serve files from within a given root +directory. The file to serve will be determined by combining `req.url` +with the provided root directory. When a file is not found, instead of +sending a 404 response, this module will instead call `next()` to move on +to the next middleware, allowing for stacking and fall-backs. + +#### Options + +##### acceptRanges + +Enable or disable accepting ranged requests, defaults to true. +Disabling this will not send `Accept-Ranges` and ignore the contents +of the `Range` request header. + +##### cacheControl + +Enable or disable setting `Cache-Control` response header, defaults to +true. Disabling this will ignore the `immutable` and `maxAge` options. + +##### dotfiles + +Set how "dotfiles" are treated when encountered. A dotfile is a file +or directory that begins with a dot ("."). Note this check is done on +the path itself without checking if the path actually exists on the +disk. If `root` is specified, only the dotfiles above the root are +checked (i.e. the root itself can be within a dotfile when set +to "deny"). + + - `'allow'` No special treatment for dotfiles. + - `'deny'` Deny a request for a dotfile and 403/`next()`. + - `'ignore'` Pretend like the dotfile does not exist and 404/`next()`. + +The default value is `'ignore'`. + +##### etag + +Enable or disable etag generation, defaults to true. + +##### extensions + +Set file extension fallbacks. When set, if a file is not found, the given +extensions will be added to the file name and search for. The first that +exists will be served. Example: `['html', 'htm']`. + +The default value is `false`. + +##### fallthrough + +Set the middleware to have client errors fall-through as just unhandled +requests, otherwise forward a client error. The difference is that client +errors like a bad request or a request to a non-existent file will cause +this middleware to simply `next()` to your next middleware when this value +is `true`. When this value is `false`, these errors (even 404s), will invoke +`next(err)`. + +Typically `true` is desired such that multiple physical directories can be +mapped to the same web address or for routes to fill in non-existent files. + +The value `false` can be used if this middleware is mounted at a path that +is designed to be strictly a single file system directory, which allows for +short-circuiting 404s for less overhead. This middleware will also reply to +all methods. + +The default value is `true`. + +##### immutable + +Enable or disable the `immutable` directive in the `Cache-Control` response +header, defaults to `false`. If set to `true`, the `maxAge` option should +also be specified to enable caching. The `immutable` directive will prevent +supported clients from making conditional requests during the life of the +`maxAge` option to check if the file has changed. + +##### index + +By default this module will send "index.html" files in response to a request +on a directory. To disable this set `false` or to supply a new index pass a +string or an array in preferred order. + +##### lastModified + +Enable or disable `Last-Modified` header, defaults to true. Uses the file +system's last modified value. + +##### maxAge + +Provide a max-age in milliseconds for http caching, defaults to 0. This +can also be a string accepted by the [ms](https://www.npmjs.org/package/ms#readme) +module. + +##### redirect + +Redirect to trailing "/" when the pathname is a dir. Defaults to `true`. + +##### setHeaders + +Function to set custom headers on response. Alterations to the headers need to +occur synchronously. The function is called as `fn(res, path, stat)`, where +the arguments are: + + - `res` the response object + - `path` the file path that is being sent + - `stat` the stat object of the file that is being sent + +## Examples + +### Serve files with vanilla node.js http server + +```js +const finalhandler = require('finalhandler') +const http = require('http') +const serveStatic = require('serve-static') + +// Serve up public/ftp folder +const serve = serveStatic('public/ftp', { index: ['index.html', 'index.htm'] }) + +// Create server +const server = http.createServer((req, res) => { + serve(req, res, finalhandler(req, res)) +}) + +// Listen +server.listen(3000) +``` + +### Serve all files as downloads + +```js +const contentDisposition = require('content-disposition') +const finalhandler = require('finalhandler') +const http = require('http') +const serveStatic = require('serve-static') + +// Serve up public/ftp folder +const serve = serveStatic('public/ftp', { + index: false, + setHeaders: setHeaders +}) + +// Set header to force download +function setHeaders (res, path) { + res.setHeader('Content-Disposition', contentDisposition(path)) +} + +// Create server +const server = http.createServer((req, res) => { + serve(req, res, finalhandler(req, res)) +}) + +// Listen +server.listen(3000) +``` + +### Serving using express + +#### Simple + +This is a simple example of using Express. + +```js +const express = require('express') +const serveStatic = require('serve-static') + +const app = express() + +app.use(serveStatic('public/ftp', { index: ['default.html', 'default.htm'] })) +app.listen(3000) +``` + +#### Multiple roots + +This example shows a simple way to search through multiple directories. +Files are searched for in `public-optimized/` first, then `public/` second +as a fallback. + +```js +const express = require('express') +const path = require('path') +const serveStatic = require('serve-static') + +const app = express() + +app.use(serveStatic(path.join(__dirname, 'public-optimized'))) +app.use(serveStatic(path.join(__dirname, 'public'))) +app.listen(3000) +``` + +#### Different settings for paths + +This example shows how to set a different max age depending on the served +file. In this example, HTML files are not cached, while everything else +is for 1 day. + +```js +const express = require('express') +const path = require('path') +const serveStatic = require('serve-static') + +const app = express() + +app.use(serveStatic(path.join(__dirname, 'public'), { + maxAge: '1d', + setHeaders: setCustomCacheControl +})) + +app.listen(3000) + +function setCustomCacheControl (res, file) { + if (path.extname(file) === '.html') { + // Custom Cache-Control for HTML files + res.setHeader('Cache-Control', 'public, max-age=0') + } +} +``` + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master +[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux +[github-actions-ci-url]: https://github.com/expressjs/serve-static/actions/workflows/ci.yml +[node-image]: https://badgen.net/npm/node/serve-static +[node-url]: https://nodejs.org/en/download/ +[npm-downloads-image]: https://badgen.net/npm/dm/serve-static +[npm-url]: https://npmjs.org/package/serve-static +[npm-version-image]: https://badgen.net/npm/v/serve-static diff --git a/node_modules/@nestjs/platform-express/node_modules/serve-static/index.js b/node_modules/@nestjs/platform-express/node_modules/serve-static/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1bee46378e2739aa85ba83948671aa0e2a2fb569 --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/serve-static/index.js @@ -0,0 +1,208 @@ +/*! + * serve-static + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var parseUrl = require('parseurl') +var resolve = require('path').resolve +var send = require('send') +var url = require('url') + +/** + * Module exports. + * @public + */ + +module.exports = serveStatic + +/** + * @param {string} root + * @param {object} [options] + * @return {function} + * @public + */ + +function serveStatic (root, options) { + if (!root) { + throw new TypeError('root path required') + } + + if (typeof root !== 'string') { + throw new TypeError('root path must be a string') + } + + // copy options object + var opts = Object.create(options || null) + + // fall-though + var fallthrough = opts.fallthrough !== false + + // default redirect + var redirect = opts.redirect !== false + + // headers listener + var setHeaders = opts.setHeaders + + if (setHeaders && typeof setHeaders !== 'function') { + throw new TypeError('option setHeaders must be function') + } + + // setup options for send + opts.maxage = opts.maxage || opts.maxAge || 0 + opts.root = resolve(root) + + // construct directory listener + var onDirectory = redirect + ? createRedirectDirectoryListener() + : createNotFoundDirectoryListener() + + return function serveStatic (req, res, next) { + if (req.method !== 'GET' && req.method !== 'HEAD') { + if (fallthrough) { + return next() + } + + // method not allowed + res.statusCode = 405 + res.setHeader('Allow', 'GET, HEAD') + res.setHeader('Content-Length', '0') + res.end() + return + } + + var forwardError = !fallthrough + var originalUrl = parseUrl.original(req) + var path = parseUrl(req).pathname + + // make sure redirect occurs at mount + if (path === '/' && originalUrl.pathname.substr(-1) !== '/') { + path = '' + } + + // create send stream + var stream = send(req, path, opts) + + // add directory handler + stream.on('directory', onDirectory) + + // add headers listener + if (setHeaders) { + stream.on('headers', setHeaders) + } + + // add file listener for fallthrough + if (fallthrough) { + stream.on('file', function onFile () { + // once file is determined, always forward error + forwardError = true + }) + } + + // forward errors + stream.on('error', function error (err) { + if (forwardError || !(err.statusCode < 500)) { + next(err) + return + } + + next() + }) + + // pipe + stream.pipe(res) + } +} + +/** + * Collapse all leading slashes into a single slash + * @private + */ +function collapseLeadingSlashes (str) { + for (var i = 0; i < str.length; i++) { + if (str.charCodeAt(i) !== 0x2f /* / */) { + break + } + } + + return i > 1 + ? '/' + str.substr(i) + : str +} + +/** + * Create a minimal HTML document. + * + * @param {string} title + * @param {string} body + * @private + */ + +function createHtmlDocument (title, body) { + return '\n' + + '\n' + + '\n' + + '\n' + + '' + title + '\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Create a directory listener that just 404s. + * @private + */ + +function createNotFoundDirectoryListener () { + return function notFound () { + this.error(404) + } +} + +/** + * Create a directory listener that performs a redirect. + * @private + */ + +function createRedirectDirectoryListener () { + return function redirect (res) { + if (this.hasTrailingSlash()) { + this.error(404) + return + } + + // get original URL + var originalUrl = parseUrl.original(this.req) + + // append trailing slash + originalUrl.path = null + originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/') + + // reformat the URL + var loc = encodeUrl(url.format(originalUrl)) + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc)) + + // send redirect response + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + res.setHeader('Location', loc) + res.end(doc) + } +} diff --git a/node_modules/@nestjs/platform-express/node_modules/serve-static/package.json b/node_modules/@nestjs/platform-express/node_modules/serve-static/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5fb5b0234cc6529968e3a127fda98cf8f328519a --- /dev/null +++ b/node_modules/@nestjs/platform-express/node_modules/serve-static/package.json @@ -0,0 +1,44 @@ +{ + "name": "serve-static", + "description": "Serve static files", + "version": "2.2.1", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "expressjs/serve-static", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.32.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "^10.7.0", + "nyc": "^17.0.0", + "supertest": "^6.3.4" + }, + "files": [ + "LICENSE", + "index.js" + ], + "engines": { + "node": ">= 18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/@nestjs/platform-express/package.json b/node_modules/@nestjs/platform-express/package.json new file mode 100644 index 0000000000000000000000000000000000000000..80ec89648184bb939751e211245387165476acda --- /dev/null +++ b/node_modules/@nestjs/platform-express/package.json @@ -0,0 +1,36 @@ +{ + "name": "@nestjs/platform-express", + "version": "11.1.27", + "description": "Nest - modern, fast, powerful node.js web framework (@platform-express)", + "author": "Kamil Mysliwiec", + "license": "MIT", + "homepage": "https://nestjs.com", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "repository": { + "type": "git", + "url": "https://github.com/nestjs/nest.git", + "directory": "packages/platform-express" + }, + "publishConfig": { + "access": "public" + }, + "dependencies": { + "cors": "2.8.6", + "express": "5.2.1", + "multer": "2.1.1", + "path-to-regexp": "8.4.2", + "tslib": "2.8.1" + }, + "devDependencies": { + "@nestjs/common": "11.1.27", + "@nestjs/core": "11.1.27" + }, + "peerDependencies": { + "@nestjs/common": "^11.0.0", + "@nestjs/core": "^11.0.0" + }, + "gitHead": "660a1249e32e7701cdd7e5ccb20b7f695e721bce" +} diff --git a/node_modules/@nestjs/platform-express/tsconfig.build.json b/node_modules/@nestjs/platform-express/tsconfig.build.json new file mode 100644 index 0000000000000000000000000000000000000000..732ca00cb71c2333992f422868eb650d7b44414d --- /dev/null +++ b/node_modules/@nestjs/platform-express/tsconfig.build.json @@ -0,0 +1,22 @@ +{ + "extends": "../tsconfig.build.json", + "compilerOptions": { + "outDir": ".", + "rootDir": ".", + "paths": { + "@nestjs/common": ["../common"], + "@nestjs/common/*": ["../common/*"], + "@nestjs/core": ["../core"], + "@nestjs/core/*": ["../core/*"] + } + }, + "exclude": ["node_modules", "dist", "test/**/*", "*.spec.ts"], + "references": [ + { + "path": "../common/tsconfig.build.json" + }, + { + "path": "../core/tsconfig.build.json" + } + ] +} diff --git a/node_modules/@nestjs/swagger/LICENSE b/node_modules/@nestjs/swagger/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d26aa195e6c450d08d9f1c2444b15e6710d2a2c7 --- /dev/null +++ b/node_modules/@nestjs/swagger/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2022 Kamil Mysliwiec + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nestjs/swagger/README.md b/node_modules/@nestjs/swagger/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5df0fd0107b57e36136c4d3316d49a93eeeb4b6f --- /dev/null +++ b/node_modules/@nestjs/swagger/README.md @@ -0,0 +1,46 @@ +

+ Nest Logo +

+ +

A progressive Node.js framework for building efficient and scalable server-side applications.

+

+ NPM Version + Package License + NPM Downloads + CircleCI + Discord + Backers on Open Collective + Sponsors on Open Collective + + +

+ + +## Description + +[OpenAPI (Swagger)](https://www.openapis.org/) module for [Nest](https://github.com/nestjs/nest). + +## Installation + +```bash +$ npm i --save @nestjs/swagger +``` + +## Quick Start + +[Overview & Tutorial](https://docs.nestjs.com/openapi/introduction) + +## Support + +Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). + +## Stay in touch + +- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec) +- Website - [https://nestjs.com](https://nestjs.com/) +- Twitter - [@nestframework](https://twitter.com/nestframework) + +## License + +Nest is [MIT licensed](LICENSE). diff --git a/node_modules/@nestjs/swagger/dist/constants.d.ts b/node_modules/@nestjs/swagger/dist/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..208dafeee40c519fe2b21362521eb133fe7b4b93 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/constants.d.ts @@ -0,0 +1,23 @@ +export declare const DECORATORS_PREFIX = "swagger"; +export declare const DECORATORS: { + API_OPERATION: string; + API_RESPONSE: string; + API_PRODUCES: string; + API_CONSUMES: string; + API_TAGS: string; + API_WEBHOOK: string; + API_CALLBACKS: string; + API_PARAMETERS: string; + API_HEADERS: string; + API_MODEL_PROPERTIES: string; + API_MODEL_PROPERTIES_ARRAY: string; + API_SECURITY: string; + API_EXCLUDE_ENDPOINT: string; + API_INCLUDE_ENDPOINT: string; + API_EXCLUDE_CONTROLLER: string; + API_EXTRA_MODELS: string; + API_EXTENSION: string; + API_SCHEMA: string; + API_DEFAULT_GETTER: string; + API_LINK: string; +}; diff --git a/node_modules/@nestjs/swagger/dist/constants.js b/node_modules/@nestjs/swagger/dist/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..cd46be696d32ac535dc2946ccb94240f3a802d58 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/constants.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DECORATORS = exports.DECORATORS_PREFIX = void 0; +exports.DECORATORS_PREFIX = 'swagger'; +exports.DECORATORS = { + API_OPERATION: `${exports.DECORATORS_PREFIX}/apiOperation`, + API_RESPONSE: `${exports.DECORATORS_PREFIX}/apiResponse`, + API_PRODUCES: `${exports.DECORATORS_PREFIX}/apiProduces`, + API_CONSUMES: `${exports.DECORATORS_PREFIX}/apiConsumes`, + API_TAGS: `${exports.DECORATORS_PREFIX}/apiUseTags`, + API_WEBHOOK: `${exports.DECORATORS_PREFIX}/apiWebhook`, + API_CALLBACKS: `${exports.DECORATORS_PREFIX}/apiCallbacks`, + API_PARAMETERS: `${exports.DECORATORS_PREFIX}/apiParameters`, + API_HEADERS: `${exports.DECORATORS_PREFIX}/apiHeaders`, + API_MODEL_PROPERTIES: `${exports.DECORATORS_PREFIX}/apiModelProperties`, + API_MODEL_PROPERTIES_ARRAY: `${exports.DECORATORS_PREFIX}/apiModelPropertiesArray`, + API_SECURITY: `${exports.DECORATORS_PREFIX}/apiSecurity`, + API_EXCLUDE_ENDPOINT: `${exports.DECORATORS_PREFIX}/apiExcludeEndpoint`, + API_INCLUDE_ENDPOINT: `${exports.DECORATORS_PREFIX}/apiIncludeEndpoint`, + API_EXCLUDE_CONTROLLER: `${exports.DECORATORS_PREFIX}/apiExcludeController`, + API_EXTRA_MODELS: `${exports.DECORATORS_PREFIX}/apiExtraModels`, + API_EXTENSION: `${exports.DECORATORS_PREFIX}/apiExtension`, + API_SCHEMA: `${exports.DECORATORS_PREFIX}/apiSchema`, + API_DEFAULT_GETTER: `${exports.DECORATORS_PREFIX}/apiDefaultGetter`, + API_LINK: `${exports.DECORATORS_PREFIX}/apiLink` +}; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-basic.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-basic.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6c8af2c2f28a0ee0897f7f4d8ef8ebb118258fdf --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-basic.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiBasicAuth(name?: string): ClassDecorator & MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-basic.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-basic.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..1b00cea4f4f3d6763fae44fdaf8d2dc237449187 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-basic.decorator.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiBasicAuth = ApiBasicAuth; +const api_security_decorator_1 = require("./api-security.decorator"); +function ApiBasicAuth(name = 'basic') { + return (0, api_security_decorator_1.ApiSecurity)(name); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-bearer.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-bearer.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..92f2edc4a19a9d72ddee4dcfa46f7855a15ac886 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-bearer.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiBearerAuth(name?: string): ClassDecorator & MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-bearer.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-bearer.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..3391a44c72ae3a5dec530f42c2b3cfe066a3d61e --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-bearer.decorator.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiBearerAuth = ApiBearerAuth; +const api_security_decorator_1 = require("./api-security.decorator"); +function ApiBearerAuth(name = 'bearer') { + return (0, api_security_decorator_1.ApiSecurity)(name); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-body.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-body.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d884522fe6e3d60acf629b59f5cd284c11a3d701 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-body.decorator.d.ts @@ -0,0 +1,18 @@ +import { Type } from '@nestjs/common'; +import { EncodingObject, ExamplesObject, ReferenceObject, RequestBodyObject, SchemaObject } from '../interfaces/open-api-spec.interface'; +import { SwaggerEnumType } from '../types/swagger-enum.type'; +type RequestBodyOptions = Omit; +interface ApiBodyMetadata extends RequestBodyOptions { + type?: Type | Function | [Function] | string; + isArray?: boolean; + enum?: SwaggerEnumType; + encoding?: EncodingObject; +} +interface ApiBodySchemaHost extends RequestBodyOptions { + schema: SchemaObject | ReferenceObject; + examples?: ExamplesObject; + encoding?: EncodingObject; +} +export type ApiBodyOptions = ApiBodyMetadata | ApiBodySchemaHost; +export declare function ApiBody(options: ApiBodyOptions): MethodDecorator; +export {}; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-body.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-body.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..a92a423123c86b8dc14c42c5f3d561b5b981f0f4 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-body.decorator.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiBody = ApiBody; +const lodash_1 = require("lodash"); +const enum_utils_1 = require("../utils/enum.utils"); +const helpers_1 = require("./helpers"); +const defaultBodyMetadata = { + type: String, + required: true +}; +function ApiBody(options) { + const [type, isArray] = (0, helpers_1.getTypeIsArrayTuple)(options.type, options.isArray); + const param = Object.assign(Object.assign({ in: 'body' }, (0, lodash_1.omit)(options, 'enum')), { type, + isArray }); + if ((0, enum_utils_1.isEnumArray)(options)) { + (0, enum_utils_1.addEnumArraySchema)(param, options); + } + else if ((0, enum_utils_1.isEnumDefined)(options)) { + (0, enum_utils_1.addEnumSchema)(param, options); + } + return (0, helpers_1.createParamDecorator)(param, defaultBodyMetadata); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-callbacks.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-callbacks.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9be9763741556d4a29a32a15994ef46c35211e99 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-callbacks.decorator.d.ts @@ -0,0 +1,2 @@ +import { CallBackObject } from '../interfaces/callback-object.interface'; +export declare function ApiCallbacks(...callbackObject: Array>): MethodDecorator & ClassDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-callbacks.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-callbacks.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..5cffa8d156d152f68b2c29003014ae37c242bedc --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-callbacks.decorator.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiCallbacks = ApiCallbacks; +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +function ApiCallbacks(...callbackObject) { + return (0, helpers_1.createMixedDecorator)(constants_1.DECORATORS.API_CALLBACKS, callbackObject); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-consumes.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-consumes.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..91a5f0ee986476ef1a9db36c6b0398126a8390d5 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-consumes.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiConsumes(...mimeTypes: string[]): MethodDecorator & ClassDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-consumes.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-consumes.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..4d1ce020a2afaf8d90cade8ca57c3548a9e71e06 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-consumes.decorator.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiConsumes = ApiConsumes; +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +function ApiConsumes(...mimeTypes) { + return (0, helpers_1.createMixedDecorator)(constants_1.DECORATORS.API_CONSUMES, mimeTypes); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-cookie.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-cookie.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65d37a7caf8f4845f9a507aaccce1526495e49c3 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-cookie.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiCookieAuth(name?: string): ClassDecorator & MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-cookie.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-cookie.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..0489444d5a76677e5e1b4ee4e80374ffec59f545 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-cookie.decorator.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiCookieAuth = ApiCookieAuth; +const api_security_decorator_1 = require("./api-security.decorator"); +function ApiCookieAuth(name = 'cookie') { + return (0, api_security_decorator_1.ApiSecurity)(name); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-default-getter.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-default-getter.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a1844503bf97b3f7bc0c138769ec2290757688d3 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-default-getter.decorator.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare function ApiDefaultGetter(type: Type | Function, parameter: string): MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-default-getter.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-default-getter.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..a27c42e874b08732c28c758a89a6953906ea79ef --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-default-getter.decorator.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiDefaultGetter = ApiDefaultGetter; +const constants_1 = require("../constants"); +function ApiDefaultGetter(type, parameter) { + return (prototype, key, descriptor) => { + if (type.prototype) { + Reflect.defineMetadata(constants_1.DECORATORS.API_DEFAULT_GETTER, { getter: descriptor.value, parameter, prototype }, type.prototype); + } + return descriptor; + }; +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-exclude-controller.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-exclude-controller.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6de204ea3c47a04c7b22176f697a31d2821819b7 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-exclude-controller.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiExcludeController(disable?: boolean): ClassDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-exclude-controller.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-exclude-controller.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..4ab55fc848fc081617ddf89c9cf545b770f0b510 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-exclude-controller.decorator.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiExcludeController = ApiExcludeController; +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +function ApiExcludeController(disable = true) { + return (0, helpers_1.createClassDecorator)(constants_1.DECORATORS.API_EXCLUDE_CONTROLLER, [disable]); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-exclude-endpoint.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-exclude-endpoint.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0f9ca3f82e30a57c632889a552821b052abc4999 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-exclude-endpoint.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiExcludeEndpoint(disable?: boolean): MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-exclude-endpoint.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-exclude-endpoint.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..7afa44ac0fb91059b9fd939f6ad9adb77a07971f --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-exclude-endpoint.decorator.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiExcludeEndpoint = ApiExcludeEndpoint; +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +function ApiExcludeEndpoint(disable = true) { + return (0, helpers_1.createMethodDecorator)(constants_1.DECORATORS.API_EXCLUDE_ENDPOINT, { + disable + }); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-extension.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-extension.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bfe9dac36f8b7f13b3d5ac0e723172e65acdb948 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-extension.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiExtension(extensionKey: string, extensionProperties: any): (target: object | Function, key?: string | symbol, descriptor?: TypedPropertyDescriptor) => any; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-extension.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-extension.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..bc85313206a0b4e846e22db8dc933d08caf9f77b --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-extension.decorator.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiExtension = ApiExtension; +const constants_1 = require("@nestjs/common/constants"); +const constants_2 = require("../constants"); +const lodash_1 = require("lodash"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +function applyExtension(target, key, value) { + const extensions = Reflect.getMetadata(constants_2.DECORATORS.API_EXTENSION, target) || {}; + Reflect.defineMetadata(constants_2.DECORATORS.API_EXTENSION, Object.assign({ [key]: value }, extensions), target); +} +function ApiExtension(extensionKey, extensionProperties) { + if (!extensionKey.startsWith('x-')) { + throw new Error('Extension key is not prefixed. Please ensure you prefix it with `x-`.'); + } + return (target, key, descriptor) => { + const extensionValue = (0, lodash_1.clone)(extensionProperties); + if (descriptor) { + applyExtension(descriptor.value, extensionKey, extensionValue); + return descriptor; + } + if (typeof target === 'object') { + return target; + } + const apiMethods = Object.getOwnPropertyNames(target.prototype) + .filter((propertyKey) => !(0, shared_utils_1.isConstructor)(propertyKey)) + .map((propertyKey) => { var _a; return (_a = Object.getOwnPropertyDescriptor(target.prototype, propertyKey)) === null || _a === void 0 ? void 0 : _a.value; }) + .filter((methodDescriptor) => methodDescriptor !== undefined && + Reflect.hasMetadata(constants_1.METHOD_METADATA, methodDescriptor)); + if (apiMethods.length > 0) { + apiMethods.forEach((method) => applyExtension(method, extensionKey, extensionValue)); + } + else { + applyExtension(target, extensionKey, extensionValue); + } + return target; + }; +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-extra-models.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-extra-models.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..31af477af5a1e2a67ee7fe4de985d5aba5751715 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-extra-models.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiExtraModels(...models: Function[]): (target: object, key?: string | symbol, descriptor?: TypedPropertyDescriptor) => any; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-extra-models.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-extra-models.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..19e996c384855750ccd436100e13e2087eb68df2 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-extra-models.decorator.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiExtraModels = ApiExtraModels; +const constants_1 = require("../constants"); +function ApiExtraModels(...models) { + return (target, key, descriptor) => { + if (descriptor) { + const extraModels = Reflect.getMetadata(constants_1.DECORATORS.API_EXTRA_MODELS, descriptor.value) || + []; + Reflect.defineMetadata(constants_1.DECORATORS.API_EXTRA_MODELS, [...extraModels, ...models], descriptor.value); + return descriptor; + } + const extraModels = Reflect.getMetadata(constants_1.DECORATORS.API_EXTRA_MODELS, target) || []; + Reflect.defineMetadata(constants_1.DECORATORS.API_EXTRA_MODELS, [...extraModels, ...models], target); + return target; + }; +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-header.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-header.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..522c425da6fc3a386aef67ac5aff63d9bf6cefa4 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-header.decorator.d.ts @@ -0,0 +1,7 @@ +import { ParameterObject } from '../interfaces/open-api-spec.interface'; +import { SwaggerEnumType } from '../types/swagger-enum.type'; +export interface ApiHeaderOptions extends Omit { + enum?: SwaggerEnumType; +} +export declare function ApiHeader(options: ApiHeaderOptions): MethodDecorator & ClassDecorator; +export declare const ApiHeaders: (headers: ApiHeaderOptions[]) => MethodDecorator & ClassDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-header.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-header.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..10cedba5c5b7b7440331db1e6eeb72d83605298b --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-header.decorator.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiHeaders = void 0; +exports.ApiHeader = ApiHeader; +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const enum_utils_1 = require("../utils/enum.utils"); +const helpers_1 = require("./helpers"); +const defaultHeaderOptions = { + name: '' +}; +function ApiHeader(options) { + const paramSchema = options.content + ? undefined + : Object.assign(Object.assign({ type: 'string' }, (options.example ? { example: options.example } : {})), (options.schema || {})); + const param = (0, lodash_1.pickBy)({ + name: (0, lodash_1.isNil)(options.name) ? defaultHeaderOptions.name : options.name, + in: 'header', + description: options.description, + required: options.required, + deprecated: options.deprecated, + allowEmptyValue: options.allowEmptyValue, + style: options.style, + explode: options.explode, + allowReserved: options.allowReserved, + content: options.content, + examples: options.examples, + schema: paramSchema + }, (0, lodash_1.negate)(lodash_1.isUndefined)); + if (options.enum) { + const enumValues = (0, enum_utils_1.getEnumValues)(options.enum); + param.schema = Object.assign(Object.assign({}, param.schema), { enum: enumValues, type: (0, enum_utils_1.getEnumType)(enumValues) }); + } + return (target, key, descriptor) => { + if (descriptor) { + return (0, helpers_1.createParamDecorator)(param, defaultHeaderOptions)(target, key, descriptor); + } + return (0, helpers_1.createClassDecorator)(constants_1.DECORATORS.API_HEADERS, [param])(target); + }; +} +const ApiHeaders = (headers) => { + return (target, key, descriptor) => { + headers.forEach((options) => ApiHeader(options)(target, key, descriptor)); + }; +}; +exports.ApiHeaders = ApiHeaders; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dbeb840e7d2d7a2e6a7e39ca35c52672bce2636d --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiHideProperty(): PropertyDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..689823f0abf2cfcc23c948641edf7f57d9a1d30c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiHideProperty = ApiHideProperty; +function ApiHideProperty() { + return (target, propertyKey) => { }; +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-include-endpoint.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-include-endpoint.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2fe671015631c49a65951dd86925ad910632eff0 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-include-endpoint.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiIncludeEndpoint(disable?: boolean): MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-include-endpoint.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-include-endpoint.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..ae70e1e483575bd5dc11781fe98869489a1a8d66 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-include-endpoint.decorator.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiIncludeEndpoint = ApiIncludeEndpoint; +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +function ApiIncludeEndpoint(disable = true) { + return (0, helpers_1.createMethodDecorator)(constants_1.DECORATORS.API_INCLUDE_ENDPOINT, { + disable + }); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-link.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-link.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..376d5a635f267d1912221e3489a5e776b3372b9a --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-link.decorator.d.ts @@ -0,0 +1,7 @@ +import { Type } from '@nestjs/common'; +export interface ApiLinkOptions { + from: Type | Function; + fromField?: string; + routeParam: string; +} +export declare function ApiLink({ from, fromField, routeParam }: ApiLinkOptions): MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-link.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-link.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..443f70678d7cadd39ba3b7a2f227995364d3ff68 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-link.decorator.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiLink = ApiLink; +const constants_1 = require("../constants"); +function ApiLink({ from, fromField = 'id', routeParam }) { + return (controllerPrototype, key, descriptor) => { + var _a; + const { prototype } = from; + if (prototype) { + const links = (_a = Reflect.getMetadata(constants_1.DECORATORS.API_LINK, prototype)) !== null && _a !== void 0 ? _a : []; + links.push({ + method: descriptor.value, + prototype: controllerPrototype, + field: fromField, + parameter: routeParam + }); + Reflect.defineMetadata(constants_1.DECORATORS.API_LINK, links, prototype); + } + return descriptor; + }; +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-oauth2.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-oauth2.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..507bff199fb059d85c347d51761f598b7454f636 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-oauth2.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiOAuth2(scopes: string[], name?: string): ClassDecorator & MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-oauth2.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-oauth2.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..a24be45fbaf0585c9ec8e1fe3aac3d069039cd57 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-oauth2.decorator.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiOAuth2 = ApiOAuth2; +const api_security_decorator_1 = require("./api-security.decorator"); +function ApiOAuth2(scopes, name = 'oauth2') { + return (0, api_security_decorator_1.ApiSecurity)(name, scopes); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-operation.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-operation.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c44be54dd58443a3b65f879eabcb97bdca0e03b5 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-operation.decorator.d.ts @@ -0,0 +1,5 @@ +import { OperationObject } from '../interfaces/open-api-spec.interface'; +export type ApiOperationOptions = Partial; +export declare function ApiOperation(options: ApiOperationOptions, { overrideExisting }?: { + overrideExisting: boolean; +}): MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-operation.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-operation.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..09f28ed69f50c52e96d19bbbfb6bf5882db63905 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-operation.decorator.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiOperation = ApiOperation; +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +const defaultOperationOptions = { + summary: '' +}; +function ApiOperation(options, { overrideExisting } = { overrideExisting: true }) { + return (0, helpers_1.createMethodDecorator)(constants_1.DECORATORS.API_OPERATION, (0, lodash_1.pickBy)(Object.assign(Object.assign({}, defaultOperationOptions), options), (0, lodash_1.negate)(lodash_1.isUndefined)), { overrideExisting }); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-param.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-param.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a88c94fece4c43af602806c620eb2591ee2d18f1 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-param.decorator.d.ts @@ -0,0 +1,23 @@ +import { Type } from '@nestjs/common'; +import { EnumSchemaAttributes } from '../interfaces/enum-schema-attributes.interface'; +import { ParameterObject, SchemaObject } from '../interfaces/open-api-spec.interface'; +import { SwaggerEnumType } from '../types/swagger-enum.type'; +type ParameterOptions = Omit; +interface ApiParamCommonMetadata extends ParameterOptions { + type?: Type | Function | [Function] | string; + format?: string; + enum?: SwaggerEnumType; + enumName?: string; + enumSchema?: EnumSchemaAttributes; + extensions?: Record; +} +type ApiParamMetadata = ApiParamCommonMetadata | (ApiParamCommonMetadata & { + enumName: string; + enumSchema?: EnumSchemaAttributes; +}); +interface ApiParamSchemaHost extends ParameterOptions { + schema: SchemaObject; +} +export type ApiParamOptions = ApiParamMetadata | ApiParamSchemaHost; +export declare function ApiParam(options: ApiParamOptions): MethodDecorator & ClassDecorator; +export {}; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-param.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-param.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..c391fab738f86d53dbea97f1ea0d9ed047c2ef2f --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-param.decorator.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiParam = ApiParam; +const lodash_1 = require("lodash"); +const enum_utils_1 = require("../utils/enum.utils"); +const helpers_1 = require("./helpers"); +const defaultParamOptions = { + name: '', + required: true +}; +function ApiParam(options) { + const param = Object.assign({ name: (0, lodash_1.isNil)(options.name) ? defaultParamOptions.name : options.name, in: 'path' }, (0, lodash_1.omit)(options, ['enum', 'extensions'])); + if ((0, enum_utils_1.isEnumDefined)(options)) { + (0, enum_utils_1.addEnumSchema)(param, options); + } + const extensions = options.extensions; + if (extensions && typeof extensions === 'object') { + const cloned = (0, lodash_1.clone)(extensions); + for (const [key, value] of Object.entries(cloned)) { + const extKey = key.startsWith('x-') ? key : `x-${key}`; + param[extKey] = value; + } + } + return (0, helpers_1.createParamDecorator)(param, defaultParamOptions); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-produces.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-produces.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3bddc01e1a010ca1f8a6b2971eb4694cee504efd --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-produces.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiProduces(...mimeTypes: string[]): MethodDecorator & ClassDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-produces.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-produces.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..3ef2d8290214c427dc863beeb4fbedf20013dfed --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-produces.decorator.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiProduces = ApiProduces; +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +function ApiProduces(...mimeTypes) { + return (0, helpers_1.createMixedDecorator)(constants_1.DECORATORS.API_PRODUCES, mimeTypes); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-property.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-property.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1a45b3d03cfcf6a876f8535fb43bdafb6cf23498 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-property.decorator.d.ts @@ -0,0 +1,16 @@ +import { Type } from '@nestjs/common'; +import { EnumSchemaAttributes } from '../interfaces/enum-schema-attributes.interface'; +import { SchemaObjectMetadata } from '../interfaces/schema-object-metadata.interface'; +export type ApiPropertyCommonOptions = SchemaObjectMetadata & { + 'x-enumNames'?: string[]; + link?: () => Type | Function; + exampleMaxDepth?: number; +}; +export type ApiPropertyOptions = ApiPropertyCommonOptions | (ApiPropertyCommonOptions & { + enumName: string; + enumSchema?: EnumSchemaAttributes; +}); +export declare function ApiProperty(options?: ApiPropertyOptions): PropertyDecorator; +export declare function createApiPropertyDecorator(options?: ApiPropertyOptions, overrideExisting?: boolean): PropertyDecorator; +export declare function ApiPropertyOptional(options?: ApiPropertyOptions): PropertyDecorator; +export declare function ApiResponseProperty(options?: Pick): PropertyDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-property.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-property.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..68d4c778f25e225b7bf0d623f58f9047c60d19c4 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-property.decorator.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiProperty = ApiProperty; +exports.createApiPropertyDecorator = createApiPropertyDecorator; +exports.ApiPropertyOptional = ApiPropertyOptional; +exports.ApiResponseProperty = ApiResponseProperty; +const constants_1 = require("../constants"); +const enum_utils_1 = require("../utils/enum.utils"); +const helpers_1 = require("./helpers"); +const isEnumArray = (opts) => opts.isArray && 'enum' in opts && opts.enum !== undefined; +function ApiProperty(options = {}) { + return createApiPropertyDecorator(options); +} +function createApiPropertyDecorator(options = {}, overrideExisting = true) { + const [type, isArray] = (0, helpers_1.getTypeIsArrayTuple)(options.type, options.isArray); + options = Object.assign(Object.assign({}, options), { type, + isArray }); + if (isEnumArray(options)) { + options.type = 'array'; + const enumValues = (0, enum_utils_1.getEnumValues)(options.enum); + options.items = { + type: (0, enum_utils_1.getEnumType)(enumValues), + enum: enumValues + }; + delete options.enum; + } + else if ('enum' in options && options.enum !== undefined) { + const enumValues = (0, enum_utils_1.getEnumValues)(options.enum); + options.enum = enumValues; + if (!options.type) { + options.type = (0, enum_utils_1.getEnumType)(enumValues); + } + } + if (Array.isArray(options.type)) { + const innerType = options.type[0]; + options.type = 'array'; + options.items = { + type: 'array', + items: { + type: typeof innerType === 'function' + ? innerType.name.charAt(0).toLowerCase() + innerType.name.slice(1) + : innerType + } + }; + } + if (options.pattern instanceof RegExp) { + options.pattern = options.pattern.source; + } + return (0, helpers_1.createPropertyDecorator)(constants_1.DECORATORS.API_MODEL_PROPERTIES, options, overrideExisting); +} +function ApiPropertyOptional(options = {}) { + return ApiProperty(Object.assign(Object.assign({}, options), { required: false })); +} +function ApiResponseProperty(options = {}) { + return ApiProperty(Object.assign({ readOnly: true }, options)); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-query.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-query.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87708dc13c4b7b79ce77bce72f57da803ff9ed2d --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-query.decorator.d.ts @@ -0,0 +1,24 @@ +import { Type } from '@nestjs/common'; +import { EnumSchemaAttributes } from '../interfaces/enum-schema-attributes.interface'; +import { ParameterObject, ReferenceObject, SchemaObject } from '../interfaces/open-api-spec.interface'; +import { SwaggerEnumType } from '../types/swagger-enum.type'; +type ParameterOptions = Omit; +interface ApiQueryCommonMetadata extends ParameterOptions { + type?: Type | Function | [Function] | 'string' | 'number' | 'integer' | 'boolean' | (string & {}); + isArray?: boolean; + enum?: SwaggerEnumType; +} +export type ApiQueryMetadata = ApiQueryCommonMetadata | ({ + name: string; +} & ApiQueryCommonMetadata & Omit) | ({ + name?: string; + enumName: string; + enumSchema?: EnumSchemaAttributes; +} & ApiQueryCommonMetadata); +interface ApiQuerySchemaHost extends ParameterOptions { + name?: string; + schema: SchemaObject | ReferenceObject; +} +export type ApiQueryOptions = ApiQueryMetadata | ApiQuerySchemaHost; +export declare function ApiQuery(options: ApiQueryOptions): MethodDecorator & ClassDecorator; +export {}; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-query.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-query.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..6080bdaf6238335fff3adc866b13d665deac2f71 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-query.decorator.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiQuery = ApiQuery; +const lodash_1 = require("lodash"); +const enum_utils_1 = require("../utils/enum.utils"); +const helpers_1 = require("./helpers"); +const defaultQueryOptions = { + name: '', + required: true +}; +function ApiQuery(options) { + const apiQueryMetadata = options; + const [type, isArray] = (0, helpers_1.getTypeIsArrayTuple)(apiQueryMetadata.type, apiQueryMetadata.isArray); + const param = Object.assign(Object.assign({ name: 'name' in options ? options.name : defaultQueryOptions.name, in: 'query' }, (0, lodash_1.omit)(options, 'enum')), { type }); + if ((0, enum_utils_1.isEnumArray)(options)) { + (0, enum_utils_1.addEnumArraySchema)(param, options); + } + else if ((0, enum_utils_1.isEnumDefined)(options)) { + (0, enum_utils_1.addEnumSchema)(param, options); + } + if (isArray) { + param.isArray = isArray; + } + return (0, helpers_1.createParamDecorator)(param, defaultQueryOptions); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-response.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-response.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dbc45a448cba3c4324e9d64f0c9d32d79691755a --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-response.decorator.d.ts @@ -0,0 +1,40 @@ +import { Type } from '@nestjs/common'; +import { ReferenceObject, ResponseObject, SchemaObject } from '../interfaces/open-api-spec.interface'; +type ApiResponseExampleValue = any; +export interface ApiResponseExamples { + summary: string; + value: ApiResponseExampleValue; +} +export interface ApiResponseCommonMetadata extends Omit { + status?: number | 'default' | '1XX' | '2XX' | '3XX' | '4XX' | '5XX'; + type?: Type | Function | [Function] | string; + isArray?: boolean; + description?: string; + nullable?: boolean; +} +export type ApiResponseMetadata = (ApiResponseCommonMetadata & { + example?: ApiResponseExampleValue; +}) | (ApiResponseCommonMetadata & { + examples?: { + [key: string]: ApiResponseExamples; + }; +}); +export interface ApiResponseSchemaHost extends Omit { + schema: SchemaObject & Partial; + status?: number | 'default' | '1XX' | '2XX' | '3XX' | '4XX' | '5XX'; + description?: string; +} +export type ApiResponseOptions = ApiResponseMetadata | ApiResponseSchemaHost; +export type ApiResponseNoStatusOptions = (Omit & { + example?: ApiResponseExampleValue; +}) | (Omit & { + examples?: { + [key: string]: ApiResponseExamples; + }; +}) | Omit; +export declare function ApiResponse(options: ApiResponseOptions, { overrideExisting }?: { + overrideExisting: boolean; +}): MethodDecorator & ClassDecorator; +export declare const ApiContinueResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiSwitchingProtocolsResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiProcessingResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiEarlyhintsResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiOkResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiCreatedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiAcceptedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNonAuthoritativeInformationResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNoContentResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiResetContentResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPartialContentResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiAmbiguousResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiMovedPermanentlyResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiFoundResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiSeeOtherResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNotModifiedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiTemporaryRedirectResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPermanentRedirectResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiBadRequestResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiUnauthorizedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPaymentRequiredResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiForbiddenResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNotFoundResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiMethodNotAllowedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNotAcceptableResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiProxyAuthenticationRequiredResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiRequestTimeoutResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiConflictResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiGoneResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiLengthRequiredResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPreconditionFailedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPayloadTooLargeResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiUriTooLongResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiUnsupportedMediaTypeResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiRequestedRangeNotSatisfiableResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiExpectationFailedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiIAmATeapotResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiMisdirectedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiUnprocessableEntityResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiFailedDependencyResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiPreconditionRequiredResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiTooManyRequestsResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiInternalServerErrorResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiNotImplementedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiBadGatewayResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiServiceUnavailableResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiGatewayTimeoutResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator, ApiHttpVersionNotSupportedResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator; +export declare const ApiDefaultResponse: (options?: ApiResponseNoStatusOptions) => MethodDecorator & ClassDecorator; +export {}; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-response.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-response.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..6b4ea8663ff6997d95b6cb1714323e4ec0722236 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-response.decorator.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiDefaultResponse = exports.ApiHttpVersionNotSupportedResponse = exports.ApiGatewayTimeoutResponse = exports.ApiServiceUnavailableResponse = exports.ApiBadGatewayResponse = exports.ApiNotImplementedResponse = exports.ApiInternalServerErrorResponse = exports.ApiTooManyRequestsResponse = exports.ApiPreconditionRequiredResponse = exports.ApiFailedDependencyResponse = exports.ApiUnprocessableEntityResponse = exports.ApiMisdirectedResponse = exports.ApiIAmATeapotResponse = exports.ApiExpectationFailedResponse = exports.ApiRequestedRangeNotSatisfiableResponse = exports.ApiUnsupportedMediaTypeResponse = exports.ApiUriTooLongResponse = exports.ApiPayloadTooLargeResponse = exports.ApiPreconditionFailedResponse = exports.ApiLengthRequiredResponse = exports.ApiGoneResponse = exports.ApiConflictResponse = exports.ApiRequestTimeoutResponse = exports.ApiProxyAuthenticationRequiredResponse = exports.ApiNotAcceptableResponse = exports.ApiMethodNotAllowedResponse = exports.ApiNotFoundResponse = exports.ApiForbiddenResponse = exports.ApiPaymentRequiredResponse = exports.ApiUnauthorizedResponse = exports.ApiBadRequestResponse = exports.ApiPermanentRedirectResponse = exports.ApiTemporaryRedirectResponse = exports.ApiNotModifiedResponse = exports.ApiSeeOtherResponse = exports.ApiFoundResponse = exports.ApiMovedPermanentlyResponse = exports.ApiAmbiguousResponse = exports.ApiPartialContentResponse = exports.ApiResetContentResponse = exports.ApiNoContentResponse = exports.ApiNonAuthoritativeInformationResponse = exports.ApiAcceptedResponse = exports.ApiCreatedResponse = exports.ApiOkResponse = exports.ApiEarlyhintsResponse = exports.ApiProcessingResponse = exports.ApiSwitchingProtocolsResponse = exports.ApiContinueResponse = void 0; +exports.ApiResponse = ApiResponse; +const common_1 = require("@nestjs/common"); +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +function ApiResponse(options, { overrideExisting } = { overrideExisting: true }) { + const apiResponseMetadata = options; + const [type, isArray] = (0, helpers_1.getTypeIsArrayTuple)(apiResponseMetadata.type, apiResponseMetadata.isArray); + apiResponseMetadata.type = type; + apiResponseMetadata.isArray = isArray; + options.description = options.description ? options.description : ''; + const statusKey = options.status || 'default'; + const incomingEntry = (0, lodash_1.omit)(options, 'status'); + return (target, key, descriptor) => { + if (descriptor) { + const responses = Reflect.getMetadata(constants_1.DECORATORS.API_RESPONSE, descriptor.value); + if (responses && !overrideExisting) { + return descriptor; + } + Reflect.defineMetadata(constants_1.DECORATORS.API_RESPONSE, Object.assign(Object.assign({}, responses), { [statusKey]: mergeResponseEntry(responses === null || responses === void 0 ? void 0 : responses[statusKey], incomingEntry) }), descriptor.value); + return descriptor; + } + const responses = Reflect.getMetadata(constants_1.DECORATORS.API_RESPONSE, target); + if (responses && !overrideExisting) { + return descriptor; + } + Reflect.defineMetadata(constants_1.DECORATORS.API_RESPONSE, Object.assign(Object.assign({}, responses), { [statusKey]: mergeResponseEntry(responses === null || responses === void 0 ? void 0 : responses[statusKey], incomingEntry) }), target); + return target; + }; +} +function mergeResponseEntry(existing, incoming) { + var _a; + if (!existing) { + return incoming; + } + const existingDesc = existing.description || ''; + const incomingDesc = incoming.description || ''; + const mergedDescription = existingDesc && incomingDesc + ? `${existingDesc}\n\n${incomingDesc}` + : existingDesc || incomingDesc; + const mergedExamples = existing.examples && incoming.examples + ? Object.assign(Object.assign({}, existing.examples), incoming.examples) : (_a = incoming.examples) !== null && _a !== void 0 ? _a : existing.examples; + return Object.assign(Object.assign(Object.assign(Object.assign({}, existing), incoming), { description: mergedDescription }), (mergedExamples !== undefined ? { examples: mergedExamples } : {})); +} +const decorators = {}; +const statusList = Object.keys(common_1.HttpStatus) + .filter((key) => !isNaN(Number(common_1.HttpStatus[key]))) + .map((key) => { + const functionName = key + .split('_') + .map((strToken) => `${strToken[0].toUpperCase()}${strToken.slice(1).toLowerCase()}`) + .join(''); + return { + code: Number(common_1.HttpStatus[key]), + functionName: `Api${functionName}Response` + }; +}); +statusList.forEach(({ code, functionName }) => { + decorators[functionName] = function (options = {}) { + return ApiResponse(Object.assign(Object.assign({}, options), { status: code })); + }; +}); +exports.ApiContinueResponse = decorators.ApiContinueResponse, exports.ApiSwitchingProtocolsResponse = decorators.ApiSwitchingProtocolsResponse, exports.ApiProcessingResponse = decorators.ApiProcessingResponse, exports.ApiEarlyhintsResponse = decorators.ApiEarlyhintsResponse, exports.ApiOkResponse = decorators.ApiOkResponse, exports.ApiCreatedResponse = decorators.ApiCreatedResponse, exports.ApiAcceptedResponse = decorators.ApiAcceptedResponse, exports.ApiNonAuthoritativeInformationResponse = decorators.ApiNonAuthoritativeInformationResponse, exports.ApiNoContentResponse = decorators.ApiNoContentResponse, exports.ApiResetContentResponse = decorators.ApiResetContentResponse, exports.ApiPartialContentResponse = decorators.ApiPartialContentResponse, exports.ApiAmbiguousResponse = decorators.ApiAmbiguousResponse, exports.ApiMovedPermanentlyResponse = decorators.ApiMovedPermanentlyResponse, exports.ApiFoundResponse = decorators.ApiFoundResponse, exports.ApiSeeOtherResponse = decorators.ApiSeeOtherResponse, exports.ApiNotModifiedResponse = decorators.ApiNotModifiedResponse, exports.ApiTemporaryRedirectResponse = decorators.ApiTemporaryRedirectResponse, exports.ApiPermanentRedirectResponse = decorators.ApiPermanentRedirectResponse, exports.ApiBadRequestResponse = decorators.ApiBadRequestResponse, exports.ApiUnauthorizedResponse = decorators.ApiUnauthorizedResponse, exports.ApiPaymentRequiredResponse = decorators.ApiPaymentRequiredResponse, exports.ApiForbiddenResponse = decorators.ApiForbiddenResponse, exports.ApiNotFoundResponse = decorators.ApiNotFoundResponse, exports.ApiMethodNotAllowedResponse = decorators.ApiMethodNotAllowedResponse, exports.ApiNotAcceptableResponse = decorators.ApiNotAcceptableResponse, exports.ApiProxyAuthenticationRequiredResponse = decorators.ApiProxyAuthenticationRequiredResponse, exports.ApiRequestTimeoutResponse = decorators.ApiRequestTimeoutResponse, exports.ApiConflictResponse = decorators.ApiConflictResponse, exports.ApiGoneResponse = decorators.ApiGoneResponse, exports.ApiLengthRequiredResponse = decorators.ApiLengthRequiredResponse, exports.ApiPreconditionFailedResponse = decorators.ApiPreconditionFailedResponse, exports.ApiPayloadTooLargeResponse = decorators.ApiPayloadTooLargeResponse, exports.ApiUriTooLongResponse = decorators.ApiUriTooLongResponse, exports.ApiUnsupportedMediaTypeResponse = decorators.ApiUnsupportedMediaTypeResponse, exports.ApiRequestedRangeNotSatisfiableResponse = decorators.ApiRequestedRangeNotSatisfiableResponse, exports.ApiExpectationFailedResponse = decorators.ApiExpectationFailedResponse, exports.ApiIAmATeapotResponse = decorators.ApiIAmATeapotResponse, exports.ApiMisdirectedResponse = decorators.ApiMisdirectedResponse, exports.ApiUnprocessableEntityResponse = decorators.ApiUnprocessableEntityResponse, exports.ApiFailedDependencyResponse = decorators.ApiFailedDependencyResponse, exports.ApiPreconditionRequiredResponse = decorators.ApiPreconditionRequiredResponse, exports.ApiTooManyRequestsResponse = decorators.ApiTooManyRequestsResponse, exports.ApiInternalServerErrorResponse = decorators.ApiInternalServerErrorResponse, exports.ApiNotImplementedResponse = decorators.ApiNotImplementedResponse, exports.ApiBadGatewayResponse = decorators.ApiBadGatewayResponse, exports.ApiServiceUnavailableResponse = decorators.ApiServiceUnavailableResponse, exports.ApiGatewayTimeoutResponse = decorators.ApiGatewayTimeoutResponse, exports.ApiHttpVersionNotSupportedResponse = decorators.ApiHttpVersionNotSupportedResponse; +const ApiDefaultResponse = (options = {}) => ApiResponse(Object.assign(Object.assign({}, options), { status: 'default' })); +exports.ApiDefaultResponse = ApiDefaultResponse; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-schema.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-schema.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c3f6f7453dd704d555b18ce8b2cadc3cd868e556 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-schema.decorator.d.ts @@ -0,0 +1,6 @@ +import { SchemaObjectMetadata } from '../interfaces/schema-object-metadata.interface'; +export interface ApiSchemaOptions extends Pick { + name?: string; + description?: string; +} +export declare function ApiSchema(options?: ApiSchemaOptions): ClassDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-schema.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-schema.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..ddcd4498c245451265ee48a7ca20daeadd338cac --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-schema.decorator.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiSchema = ApiSchema; +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +function ApiSchema(options) { + return (0, helpers_1.createClassDecorator)(constants_1.DECORATORS.API_SCHEMA, [options]); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-security.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-security.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ddba129c9a46b55143d1513212a73b3e5f015b02 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-security.decorator.d.ts @@ -0,0 +1,2 @@ +import { SecurityRequirementObject } from '../interfaces/open-api-spec.interface'; +export declare function ApiSecurity(name: string | SecurityRequirementObject, requirements?: string[]): ClassDecorator & MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-security.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-security.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..8110f2d36372565f52e76bae696347804b2289d6 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-security.decorator.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiSecurity = ApiSecurity; +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const extend_metadata_util_1 = require("../utils/extend-metadata.util"); +function ApiSecurity(name, requirements = []) { + let metadata; + if ((0, lodash_1.isString)(name)) { + metadata = [{ [name]: requirements }]; + } + else { + metadata = [name]; + } + return (target, key, descriptor) => { + if (descriptor) { + metadata = (0, extend_metadata_util_1.extendMetadata)(metadata, constants_1.DECORATORS.API_SECURITY, descriptor.value); + Reflect.defineMetadata(constants_1.DECORATORS.API_SECURITY, metadata, descriptor.value); + return descriptor; + } + metadata = (0, extend_metadata_util_1.extendMetadata)(metadata, constants_1.DECORATORS.API_SECURITY, target); + Reflect.defineMetadata(constants_1.DECORATORS.API_SECURITY, metadata, target); + return target; + }; +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-use-tags.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-use-tags.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d74e4b42bbb3442c5bddfe403dfbc6f815051674 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-use-tags.decorator.d.ts @@ -0,0 +1,2 @@ +import { ApiTagOptions } from '../interfaces/open-api-spec.interface'; +export declare function ApiTags(...tags: (string | ApiTagOptions)[]): MethodDecorator & ClassDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-use-tags.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-use-tags.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..7efdf67d1d98a78d8dd0bfb8c3d35253d91d93c7 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-use-tags.decorator.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiTags = ApiTags; +const common_1 = require("@nestjs/common"); +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +const logger = new common_1.Logger('ApiTags'); +function ApiTags(...tags) { + const normalizedTags = tags.map((tag) => { + if (typeof tag === 'string') { + return tag; + } + if (tag.parent !== undefined || tag.kind !== undefined) { + logger.warn(`Tag "${tag.name}" includes hierarchy fields (parent/kind) defined via @ApiTags, but those values are ignored there. Define them with DocumentBuilder.addTag("${tag.name}", description, { parent, kind }) to include them in the document's root-level tags.`); + } + return tag.name; + }); + return (0, helpers_1.createMixedDecorator)(constants_1.DECORATORS.API_TAGS, normalizedTags); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-webhook.decorator.d.ts b/node_modules/@nestjs/swagger/dist/decorators/api-webhook.decorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8d87754bdc41d5abba7911dde1e9b4c73fa6219 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-webhook.decorator.d.ts @@ -0,0 +1 @@ +export declare function ApiWebhook(name?: string): MethodDecorator; diff --git a/node_modules/@nestjs/swagger/dist/decorators/api-webhook.decorator.js b/node_modules/@nestjs/swagger/dist/decorators/api-webhook.decorator.js new file mode 100644 index 0000000000000000000000000000000000000000..10f2bc034509b304f3f49f0b52459ea7c9929b89 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/api-webhook.decorator.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiWebhook = ApiWebhook; +const constants_1 = require("../constants"); +const helpers_1 = require("./helpers"); +function ApiWebhook(name) { + return (0, helpers_1.createMethodDecorator)(constants_1.DECORATORS.API_WEBHOOK, name !== null && name !== void 0 ? name : true); +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/helpers.d.ts b/node_modules/@nestjs/swagger/dist/decorators/helpers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5dda2c47c81c5512594c1fd860c2b2322b3f2320 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/helpers.d.ts @@ -0,0 +1,8 @@ +export declare function createMethodDecorator(metakey: string, metadata: T, { overrideExisting }?: { + overrideExisting: boolean; +}): MethodDecorator; +export declare function createClassDecorator = any>(metakey: string, metadata?: T): ClassDecorator; +export declare function createPropertyDecorator = any>(metakey: string, metadata: T, overrideExisting?: boolean): PropertyDecorator; +export declare function createMixedDecorator(metakey: string, metadata: T): MethodDecorator & ClassDecorator; +export declare function createParamDecorator = any>(metadata: T, initial: Partial): MethodDecorator & ClassDecorator; +export declare function getTypeIsArrayTuple(input: Function | [Function] | undefined | string | Record, isArrayFlag: boolean): [Function | undefined, boolean]; diff --git a/node_modules/@nestjs/swagger/dist/decorators/helpers.js b/node_modules/@nestjs/swagger/dist/decorators/helpers.js new file mode 100644 index 0000000000000000000000000000000000000000..764a76d71d6cd149981e7e543561471a9095b1c3 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/helpers.js @@ -0,0 +1,133 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createMethodDecorator = createMethodDecorator; +exports.createClassDecorator = createClassDecorator; +exports.createPropertyDecorator = createPropertyDecorator; +exports.createMixedDecorator = createMixedDecorator; +exports.createParamDecorator = createParamDecorator; +exports.getTypeIsArrayTuple = getTypeIsArrayTuple; +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const lodash_1 = require("lodash"); +const constants_2 = require("../constants"); +const plugin_constants_1 = require("../plugin/plugin-constants"); +function createMethodDecorator(metakey, metadata, { overrideExisting } = { overrideExisting: true }) { + return (target, key, descriptor) => { + if (typeof metadata === 'object') { + const prevValue = Reflect.getMetadata(metakey, descriptor.value); + if (prevValue && !overrideExisting) { + return descriptor; + } + Reflect.defineMetadata(metakey, Object.assign(Object.assign({}, prevValue), metadata), descriptor.value); + return descriptor; + } + Reflect.defineMetadata(metakey, metadata, descriptor.value); + return descriptor; + }; +} +function createClassDecorator(metakey, metadata = []) { + return (target) => { + const prevValue = Reflect.getMetadata(metakey, target) || []; + Reflect.defineMetadata(metakey, [...prevValue, ...metadata], target); + return target; + }; +} +function createPropertyDecorator(metakey, metadata, overrideExisting = true) { + return (target, propertyKey) => { + var _a, _b, _c, _d, _e, _f, _g, _h; + const properties = Reflect.getMetadata(constants_2.DECORATORS.API_MODEL_PROPERTIES_ARRAY, target) || []; + const key = `:${String(propertyKey)}`; + if (!properties.includes(key)) { + Reflect.defineMetadata(constants_2.DECORATORS.API_MODEL_PROPERTIES_ARRAY, [...properties, `:${String(propertyKey)}`], target); + } + const existingMetadata = Reflect.getMetadata(metakey, target, propertyKey); + if (existingMetadata) { + const newMetadata = (0, lodash_1.pickBy)(metadata, (0, lodash_1.negate)(lodash_1.isUndefined)); + const ownExistingMetadata = Reflect.getOwnMetadata(metakey, target, propertyKey); + if (!ownExistingMetadata && newMetadata.type === undefined) { + const designType = (_d = (_c = (_b = (_a = target === null || target === void 0 ? void 0 : target.constructor) === null || _a === void 0 ? void 0 : _a[plugin_constants_1.METADATA_FACTORY_NAME]) === null || _b === void 0 ? void 0 : _b.call(_a)[propertyKey]) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : Reflect.getMetadata('design:type', target, propertyKey); + if (designType) { + newMetadata.type = designType; + } + } + const metadataToSave = overrideExisting + ? Object.assign(Object.assign({}, existingMetadata), newMetadata) : Object.assign(Object.assign({}, newMetadata), existingMetadata); + Reflect.defineMetadata(metakey, metadataToSave, target, propertyKey); + } + else { + const type = (_h = (_g = (_f = (_e = target === null || target === void 0 ? void 0 : target.constructor) === null || _e === void 0 ? void 0 : _e[plugin_constants_1.METADATA_FACTORY_NAME]) === null || _f === void 0 ? void 0 : _f.call(_e)[propertyKey]) === null || _g === void 0 ? void 0 : _g.type) !== null && _h !== void 0 ? _h : Reflect.getMetadata('design:type', target, propertyKey); + Reflect.defineMetadata(metakey, Object.assign({ type }, (0, lodash_1.pickBy)(metadata, (0, lodash_1.negate)(lodash_1.isUndefined))), target, propertyKey); + } + }; +} +function createMixedDecorator(metakey, metadata) { + return (target, key, descriptor) => { + if (descriptor) { + let metadatas; + if (Array.isArray(metadata)) { + const previousMetadata = Reflect.getMetadata(metakey, descriptor.value) || []; + metadatas = [...previousMetadata, ...metadata]; + } + else { + const previousMetadata = Reflect.getMetadata(metakey, descriptor.value) || {}; + metadatas = Object.assign(Object.assign({}, previousMetadata), metadata); + } + Reflect.defineMetadata(metakey, metadatas, descriptor.value); + return descriptor; + } + let metadatas; + if (Array.isArray(metadata)) { + const previousMetadata = Reflect.getMetadata(metakey, target) || []; + metadatas = [...previousMetadata, ...metadata]; + } + else { + const previousMetadata = Reflect.getMetadata(metakey, target) || {}; + metadatas = Object.assign(Object.assign({}, previousMetadata), metadata); + } + Reflect.defineMetadata(metakey, metadatas, target); + return target; + }; +} +function createParamDecorator(metadata, initial) { + return (target, key, descriptor) => { + const paramOptions = Object.assign(Object.assign({}, initial), (0, lodash_1.pickBy)(metadata, (0, lodash_1.negate)(lodash_1.isUndefined))); + if (descriptor) { + const parameters = Reflect.getMetadata(constants_2.DECORATORS.API_PARAMETERS, descriptor.value) || []; + Reflect.defineMetadata(constants_2.DECORATORS.API_PARAMETERS, [...parameters, paramOptions], descriptor.value); + return descriptor; + } + if (typeof target === 'object') { + return target; + } + const propertyKeys = Object.getOwnPropertyNames(target.prototype); + for (const propertyKey of propertyKeys) { + if ((0, shared_utils_1.isConstructor)(propertyKey)) { + continue; + } + const methodDescriptor = Object.getOwnPropertyDescriptor(target.prototype, propertyKey); + if (!methodDescriptor) { + continue; + } + if (!methodDescriptor.value) { + continue; + } + const isApiMethod = Reflect.hasMetadata(constants_1.METHOD_METADATA, methodDescriptor.value); + if (!isApiMethod) { + continue; + } + const parameters = Reflect.getMetadata(constants_2.DECORATORS.API_PARAMETERS, methodDescriptor.value) || []; + Reflect.defineMetadata(constants_2.DECORATORS.API_PARAMETERS, [...parameters, paramOptions], methodDescriptor.value); + } + }; +} +function getTypeIsArrayTuple(input, isArrayFlag) { + if (!input) { + return [input, isArrayFlag]; + } + if (isArrayFlag) { + return [input, isArrayFlag]; + } + const isInputArray = (0, lodash_1.isArray)(input); + const type = isInputArray ? input[0] : input; + return [type, isInputArray]; +} diff --git a/node_modules/@nestjs/swagger/dist/decorators/index.d.ts b/node_modules/@nestjs/swagger/dist/decorators/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3700a287f34aaa6c53baeac39bc6de8310bc2c9b --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/index.d.ts @@ -0,0 +1,26 @@ +export * from './api-basic.decorator'; +export * from './api-bearer.decorator'; +export * from './api-body.decorator'; +export * from './api-consumes.decorator'; +export * from './api-cookie.decorator'; +export * from './api-default-getter.decorator'; +export * from './api-exclude-endpoint.decorator'; +export * from './api-include-endpoint.decorator'; +export * from './api-exclude-controller.decorator'; +export * from './api-extra-models.decorator'; +export * from './api-header.decorator'; +export * from './api-hide-property.decorator'; +export * from './api-link.decorator'; +export * from './api-oauth2.decorator'; +export * from './api-operation.decorator'; +export * from './api-param.decorator'; +export * from './api-produces.decorator'; +export { ApiProperty, ApiPropertyOptional, ApiPropertyOptions, ApiResponseProperty } from './api-property.decorator'; +export * from './api-query.decorator'; +export * from './api-webhook.decorator'; +export * from './api-response.decorator'; +export * from './api-security.decorator'; +export * from './api-use-tags.decorator'; +export * from './api-callbacks.decorator'; +export * from './api-extension.decorator'; +export * from './api-schema.decorator'; diff --git a/node_modules/@nestjs/swagger/dist/decorators/index.js b/node_modules/@nestjs/swagger/dist/decorators/index.js new file mode 100644 index 0000000000000000000000000000000000000000..aba195cbe2e8eb5608f5a87f0708ee4db453597c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/decorators/index.js @@ -0,0 +1,46 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiResponseProperty = exports.ApiPropertyOptional = exports.ApiProperty = void 0; +__exportStar(require("./api-basic.decorator"), exports); +__exportStar(require("./api-bearer.decorator"), exports); +__exportStar(require("./api-body.decorator"), exports); +__exportStar(require("./api-consumes.decorator"), exports); +__exportStar(require("./api-cookie.decorator"), exports); +__exportStar(require("./api-default-getter.decorator"), exports); +__exportStar(require("./api-exclude-endpoint.decorator"), exports); +__exportStar(require("./api-include-endpoint.decorator"), exports); +__exportStar(require("./api-exclude-controller.decorator"), exports); +__exportStar(require("./api-extra-models.decorator"), exports); +__exportStar(require("./api-header.decorator"), exports); +__exportStar(require("./api-hide-property.decorator"), exports); +__exportStar(require("./api-link.decorator"), exports); +__exportStar(require("./api-oauth2.decorator"), exports); +__exportStar(require("./api-operation.decorator"), exports); +__exportStar(require("./api-param.decorator"), exports); +__exportStar(require("./api-produces.decorator"), exports); +var api_property_decorator_1 = require("./api-property.decorator"); +Object.defineProperty(exports, "ApiProperty", { enumerable: true, get: function () { return api_property_decorator_1.ApiProperty; } }); +Object.defineProperty(exports, "ApiPropertyOptional", { enumerable: true, get: function () { return api_property_decorator_1.ApiPropertyOptional; } }); +Object.defineProperty(exports, "ApiResponseProperty", { enumerable: true, get: function () { return api_property_decorator_1.ApiResponseProperty; } }); +__exportStar(require("./api-query.decorator"), exports); +__exportStar(require("./api-webhook.decorator"), exports); +__exportStar(require("./api-response.decorator"), exports); +__exportStar(require("./api-security.decorator"), exports); +__exportStar(require("./api-use-tags.decorator"), exports); +__exportStar(require("./api-callbacks.decorator"), exports); +__exportStar(require("./api-extension.decorator"), exports); +__exportStar(require("./api-schema.decorator"), exports); diff --git a/node_modules/@nestjs/swagger/dist/document-builder.d.ts b/node_modules/@nestjs/swagger/dist/document-builder.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8e253b255b650f4887d2f67166c1d8964731669 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/document-builder.d.ts @@ -0,0 +1,33 @@ +import { ApiResponseOptions } from './decorators/api-response.decorator'; +import { OpenAPIObject } from './interfaces'; +import { ExtensionLocation, ExternalDocumentationObject, ParameterObject, SecurityRequirementObject, SecuritySchemeObject, ServerVariableObject } from './interfaces/open-api-spec.interface'; +export declare class DocumentBuilder { + private readonly logger; + private readonly document; + setTitle(title: string): this; + setDescription(description: string): this; + setVersion(version: string): this; + setTermsOfService(termsOfService: string): this; + setContact(name: string, url: string, email: string): this; + setLicense(name: string, url: string): this; + setOpenAPIVersion(version: string): this; + addServer(url: string, description?: string, variables?: Record, serverExtraProperties?: Record): this; + setExternalDoc(description: string, url: string): this; + setBasePath(path: string): this; + addTag(name: string, description?: string, externalDocs?: ExternalDocumentationObject, options?: { + summary?: string; + parent?: string; + kind?: string; + }): this; + addExtension(extensionKey: string, extensionProperties: any, location?: ExtensionLocation): this; + addSecurity(name: string, options: SecuritySchemeObject): this; + addGlobalResponse(...respones: ApiResponseOptions[]): this; + addGlobalParameters(...parameters: Omit[]): this; + addSecurityRequirements(name: string | SecurityRequirementObject, requirements?: string[]): this; + addBearerAuth(options?: SecuritySchemeObject, name?: string): this; + addOAuth2(options?: SecuritySchemeObject, name?: string): this; + addApiKey(options?: SecuritySchemeObject, name?: string): this; + addBasicAuth(options?: SecuritySchemeObject, name?: string): this; + addCookieAuth(cookieName?: string, options?: SecuritySchemeObject, securityName?: string): this; + build(): Omit; +} diff --git a/node_modules/@nestjs/swagger/dist/document-builder.js b/node_modules/@nestjs/swagger/dist/document-builder.js new file mode 100644 index 0000000000000000000000000000000000000000..b6056b402080b60ce109993f2845759e50a25d3f --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/document-builder.js @@ -0,0 +1,158 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DocumentBuilder = void 0; +const common_1 = require("@nestjs/common"); +const lodash_1 = require("lodash"); +const document_base_1 = require("./fixtures/document.base"); +const global_parameters_storage_1 = require("./storages/global-parameters.storage"); +const global_responses_storage_1 = require("./storages/global-responses.storage"); +class DocumentBuilder { + constructor() { + this.logger = new common_1.Logger(DocumentBuilder.name); + this.document = (0, document_base_1.buildDocumentBase)(); + } + setTitle(title) { + this.document.info.title = title; + return this; + } + setDescription(description) { + this.document.info.description = description; + return this; + } + setVersion(version) { + this.document.info.version = version; + return this; + } + setTermsOfService(termsOfService) { + this.document.info.termsOfService = termsOfService; + return this; + } + setContact(name, url, email) { + this.document.info.contact = { name, url, email }; + return this; + } + setLicense(name, url) { + this.document.info.license = { name, url }; + return this; + } + setOpenAPIVersion(version) { + if (/^\d+\.\d+\.\d+$/.test(version)) { + this.document.openapi = version; + } + else { + this.logger.warn('The OpenApi version is invalid. Expecting format "x.x.x"'); + } + return this; + } + addServer(url, description, variables, serverExtraProperties) { + const serverObjDef = { + url, + description, + variables + }; + if (serverExtraProperties) { + const alreadyDefinedKeysForServerEntry = Object.keys(serverObjDef); + for (const key in serverExtraProperties) { + if (alreadyDefinedKeysForServerEntry.includes(key)) + continue; + const extraFieldValue = serverExtraProperties[key]; + serverObjDef[key] = extraFieldValue; + } + } + this.document.servers.push(serverObjDef); + return this; + } + setExternalDoc(description, url) { + this.document.externalDocs = { description, url }; + return this; + } + setBasePath(path) { + this.logger.warn('The "setBasePath" method has been deprecated. Now, a global prefix is populated automatically. If you want to ignore it, take a look here: https://docs.nestjs.com/recipes/swagger#global-prefix. Alternatively, you can use "addServer" method to set up multiple different paths.'); + return this; + } + addTag(name, description = '', externalDocs, options) { + this.document.tags = this.document.tags.concat((0, lodash_1.pickBy)({ + name, + summary: options === null || options === void 0 ? void 0 : options.summary, + description, + externalDocs, + parent: options === null || options === void 0 ? void 0 : options.parent, + kind: options === null || options === void 0 ? void 0 : options.kind + }, (0, lodash_1.negate)(lodash_1.isUndefined))); + return this; + } + addExtension(extensionKey, extensionProperties, location = 'root') { + if (!extensionKey.startsWith('x-')) { + throw new Error('Extension key is not prefixed. Please ensure you prefix it with `x-`.'); + } + if (location === 'root') { + this.document[extensionKey] = (0, lodash_1.clone)(extensionProperties); + } + else { + this.document[location][extensionKey] = (0, lodash_1.clone)(extensionProperties); + } + return this; + } + addSecurity(name, options) { + this.document.components.securitySchemes = Object.assign(Object.assign({}, (this.document.components.securitySchemes || {})), { [name]: options }); + return this; + } + addGlobalResponse(...respones) { + const groupedByStatus = respones.reduce((acc, response) => { + const { status = 'default' } = response; + acc[status] = (0, lodash_1.omit)(response, 'status'); + return acc; + }, {}); + global_responses_storage_1.GlobalResponsesStorage.add(groupedByStatus); + return this; + } + addGlobalParameters(...parameters) { + global_parameters_storage_1.GlobalParametersStorage.add(...parameters); + return this; + } + addSecurityRequirements(name, requirements = []) { + let securityRequirement; + if ((0, lodash_1.isString)(name)) { + securityRequirement = { [name]: requirements }; + } + else { + securityRequirement = name; + } + this.document.security = (this.document.security || []).concat(Object.assign({}, securityRequirement)); + return this; + } + addBearerAuth(options = { + type: 'http' + }, name = 'bearer') { + this.addSecurity(name, Object.assign({ scheme: 'bearer', bearerFormat: 'JWT' }, options)); + return this; + } + addOAuth2(options = { + type: 'oauth2' + }, name = 'oauth2') { + this.addSecurity(name, Object.assign({ type: 'oauth2', flows: {} }, options)); + return this; + } + addApiKey(options = { + type: 'apiKey' + }, name = 'api_key') { + this.addSecurity(name, Object.assign({ type: 'apiKey', in: 'header', name }, options)); + return this; + } + addBasicAuth(options = { + type: 'http' + }, name = 'basic') { + this.addSecurity(name, Object.assign({ type: 'http', scheme: 'basic' }, options)); + return this; + } + addCookieAuth(cookieName = 'connect.sid', options = { + type: 'apiKey' + }, securityName = 'cookie') { + this.addSecurity(securityName, Object.assign({ type: 'apiKey', in: 'cookie', name: cookieName }, options)); + return this; + } + build() { + return this.document; + } +} +exports.DocumentBuilder = DocumentBuilder; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-callbacks.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-callbacks.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a29febb0b6c0ab8331f903c9f4dc21a8c78dabc8 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-callbacks.explorer.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare const exploreApiCallbacksMetadata: (instance: object, prototype: Type, method: object) => any; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-callbacks.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-callbacks.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..72958c19aae5119db47b2b585d8009249e7ef3f2 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-callbacks.explorer.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiCallbacksMetadata = void 0; +const constants_1 = require("../constants"); +const utils_1 = require("../utils"); +const exploreApiCallbacksMetadata = (instance, prototype, method) => { + const callbacksData = Reflect.getMetadata(constants_1.DECORATORS.API_CALLBACKS, method); + if (!callbacksData) + return callbacksData; + return callbacksData.reduce((acc, callbackData) => { + const { name: eventName, callbackUrl, method: callbackMethod, requestBody, expectedResponse } = callbackData; + return Object.assign(Object.assign({}, acc), { [eventName]: { + [callbackUrl]: { + [callbackMethod]: { + requestBody: { + required: true, + content: { + 'application/json': { + schema: { + $ref: (0, utils_1.getSchemaPath)(requestBody.type) + } + } + } + }, + responses: { + [expectedResponse.status]: { + description: expectedResponse.description || + 'Your server returns this code if it accepts the callback' + } + } + } + } + } }); + }, {}); +}; +exports.exploreApiCallbacksMetadata = exploreApiCallbacksMetadata; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-consumes.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-consumes.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f1bf2c98760172026d81fd817ca3f69a867cded --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-consumes.explorer.d.ts @@ -0,0 +1,5 @@ +import { Type } from '@nestjs/common'; +export declare const exploreGlobalApiConsumesMetadata: (metatype: Type) => { + consumes: any; +}; +export declare const exploreApiConsumesMetadata: (instance: object, prototype: Type, method: object) => string[] | undefined; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-consumes.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-consumes.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..cfb037f3ec80f046aac5f6bc713d000906502e56 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-consumes.explorer.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiConsumesMetadata = exports.exploreGlobalApiConsumesMetadata = void 0; +const constants_1 = require("../constants"); +const exploreGlobalApiConsumesMetadata = (metatype) => { + const consumes = Reflect.getMetadata(constants_1.DECORATORS.API_CONSUMES, metatype); + return consumes ? { consumes } : undefined; +}; +exports.exploreGlobalApiConsumesMetadata = exploreGlobalApiConsumesMetadata; +const exploreApiConsumesMetadata = (instance, prototype, method) => Reflect.getMetadata(constants_1.DECORATORS.API_CONSUMES, method); +exports.exploreApiConsumesMetadata = exploreApiConsumesMetadata; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-exclude-controller.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-exclude-controller.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..546eaff79f82aa814a5e46b077b3a36473ef7569 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-exclude-controller.explorer.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare const exploreApiExcludeControllerMetadata: (metatype: Type) => boolean; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-exclude-controller.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-exclude-controller.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..7ca847e4e41f96025e31b3357d39da6feae5386c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-exclude-controller.explorer.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiExcludeControllerMetadata = void 0; +const constants_1 = require("../constants"); +const exploreApiExcludeControllerMetadata = (metatype) => { + var _a; + return ((_a = Reflect.getMetadata(constants_1.DECORATORS.API_EXCLUDE_CONTROLLER, metatype)) === null || _a === void 0 ? void 0 : _a[0]) === + true; +}; +exports.exploreApiExcludeControllerMetadata = exploreApiExcludeControllerMetadata; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-exclude-endpoint.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-exclude-endpoint.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..44dac2597a31f84d73f30618352f7aea3f3d63f9 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-exclude-endpoint.explorer.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare const exploreApiExcludeEndpointMetadata: (instance: object, prototype: Type, method: object) => any; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-exclude-endpoint.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-exclude-endpoint.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..fb42f74daecc6e7566be88407137d18211e374b5 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-exclude-endpoint.explorer.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiExcludeEndpointMetadata = void 0; +const constants_1 = require("../constants"); +const exploreApiExcludeEndpointMetadata = (instance, prototype, method) => Reflect.getMetadata(constants_1.DECORATORS.API_EXCLUDE_ENDPOINT, method); +exports.exploreApiExcludeEndpointMetadata = exploreApiExcludeEndpointMetadata; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-extra-models.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-extra-models.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e67b7605d815fc42f85f51a70176494a17ad98ff --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-extra-models.explorer.d.ts @@ -0,0 +1,3 @@ +import { Type } from '@nestjs/common'; +export declare const exploreGlobalApiExtraModelsMetadata: (metatype: Type) => Function[]; +export declare const exploreApiExtraModelsMetadata: (instance: object, prototype: Type, method: object) => Function[]; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-extra-models.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-extra-models.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..dfa5c9214302a489cca25b232b96ca86a4c31bc1 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-extra-models.explorer.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiExtraModelsMetadata = exports.exploreGlobalApiExtraModelsMetadata = void 0; +const constants_1 = require("../constants"); +const exploreGlobalApiExtraModelsMetadata = (metatype) => { + const extraModels = Reflect.getMetadata(constants_1.DECORATORS.API_EXTRA_MODELS, metatype); + return extraModels || []; +}; +exports.exploreGlobalApiExtraModelsMetadata = exploreGlobalApiExtraModelsMetadata; +const exploreApiExtraModelsMetadata = (instance, prototype, method) => Reflect.getMetadata(constants_1.DECORATORS.API_EXTRA_MODELS, method) || []; +exports.exploreApiExtraModelsMetadata = exploreApiExtraModelsMetadata; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-headers.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-headers.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..171bf2f9a9999b829f12b44ab291abd86442daee --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-headers.explorer.d.ts @@ -0,0 +1,7 @@ +import { Type } from '@nestjs/common'; +export declare const exploreGlobalApiHeaderMetadata: (metatype: Type) => { + root: { + parameters: any; + }; + depth: number; +}; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-headers.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-headers.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..79430ed83e96dacad4515027fe9d3bfc310ec6ef --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-headers.explorer.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreGlobalApiHeaderMetadata = void 0; +const constants_1 = require("../constants"); +const exploreGlobalApiHeaderMetadata = (metatype) => { + const headers = Reflect.getMetadata(constants_1.DECORATORS.API_HEADERS, metatype); + return headers ? { root: { parameters: headers }, depth: 1 } : undefined; +}; +exports.exploreGlobalApiHeaderMetadata = exploreGlobalApiHeaderMetadata; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-include-endpoint.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-include-endpoint.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2f68cac3384718d246b1ed5f490a7d10118df0ea --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-include-endpoint.explorer.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare const exploreApiIncludeEndpointMetadata: (instance: object, prototype: Type, method: object) => any; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-include-endpoint.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-include-endpoint.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..853bb1eaa515e37195b9a7591889589598d86e1e --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-include-endpoint.explorer.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiIncludeEndpointMetadata = void 0; +const constants_1 = require("../constants"); +const exploreApiIncludeEndpointMetadata = (instance, prototype, method) => Reflect.getMetadata(constants_1.DECORATORS.API_INCLUDE_ENDPOINT, method); +exports.exploreApiIncludeEndpointMetadata = exploreApiIncludeEndpointMetadata; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-operation.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-operation.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2ae0ce2ef47feb433cb7b5c921963f8105afcc0a --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-operation.explorer.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare const exploreApiOperationMetadata: (instance: object, prototype: Type, method: object) => any; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-operation.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-operation.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..67cd4ddef76f5afe9227e70d46a31551194c6bd8 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-operation.explorer.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiOperationMetadata = void 0; +const constants_1 = require("../constants"); +const api_operation_decorator_1 = require("../decorators/api-operation.decorator"); +const plugin_constants_1 = require("../plugin/plugin-constants"); +const exploreApiOperationMetadata = (instance, prototype, method) => { + applyMetadataFactory(prototype, instance); + return Reflect.getMetadata(constants_1.DECORATORS.API_OPERATION, method); +}; +exports.exploreApiOperationMetadata = exploreApiOperationMetadata; +function applyMetadataFactory(prototype, instance) { + const classPrototype = prototype; + do { + if (!prototype.constructor) { + return; + } + if (!prototype.constructor[plugin_constants_1.METADATA_FACTORY_NAME]) { + continue; + } + const metadata = prototype.constructor[plugin_constants_1.METADATA_FACTORY_NAME](); + const methodKeys = Object.keys(metadata).filter((key) => typeof instance[key] === 'function'); + methodKeys.forEach((key) => { + const operationMeta = {}; + const { summary, deprecated, tags, description } = metadata[key]; + applyIfNotNil(operationMeta, 'summary', summary); + applyIfNotNil(operationMeta, 'deprecated', deprecated); + applyIfNotNil(operationMeta, 'tags', tags); + applyIfNotNil(operationMeta, 'description', description); + if (Object.keys(operationMeta).length === 0) { + return; + } + (0, api_operation_decorator_1.ApiOperation)(operationMeta, { overrideExisting: false })(classPrototype, key, Object.getOwnPropertyDescriptor(classPrototype, key)); + }); + } while ((prototype = Reflect.getPrototypeOf(prototype)) && + prototype !== Object.prototype && + prototype); +} +function applyIfNotNil(target, key, value) { + if (value !== undefined && value !== null) { + target[key] = value; + } +} diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a35ba95c1c80986688c33639cadccb15ff362e3 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.d.ts @@ -0,0 +1,71 @@ +import { Type } from '@nestjs/common'; +import { SchemaObject } from '../interfaces/open-api-spec.interface'; +import { ParamWithTypeMetadata } from '../services/parameter-metadata-accessor'; +export declare const exploreApiParametersMetadata: (schemas: Record, instance: object, prototype: Type, method: Function) => { + parameters: (Partial | Partial | { + schema: { + type: string; + items: any; + nullable?: boolean; + discriminator?: import("../interfaces/open-api-spec.interface").DiscriminatorObject; + readOnly?: boolean; + writeOnly?: boolean; + xml?: import("../interfaces/open-api-spec.interface").XmlObject; + externalDocs?: import("../interfaces/open-api-spec.interface").ExternalDocumentationObject; + example?: any; + examples?: any[] | Record; + deprecated?: boolean; + allOf?: (SchemaObject | import("../interfaces/open-api-spec.interface").ReferenceObject)[]; + oneOf?: (SchemaObject | import("../interfaces/open-api-spec.interface").ReferenceObject)[]; + anyOf?: (SchemaObject | import("../interfaces/open-api-spec.interface").ReferenceObject)[]; + not?: SchemaObject | import("../interfaces/open-api-spec.interface").ReferenceObject; + properties?: Record; + additionalProperties?: SchemaObject | import("../interfaces/open-api-spec.interface").ReferenceObject | boolean; + patternProperties?: SchemaObject | import("../interfaces/open-api-spec.interface").ReferenceObject | any; + description?: string; + format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat; + default?: any; + title?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: string[]; + enum?: any[]; + 'x-enumNames'?: string[]; + }; + } | { + schema: import("lodash").Dictionary; + description?: string; + required?: boolean; + deprecated?: boolean; + allowEmptyValue?: boolean; + style?: import("../interfaces/open-api-spec.interface").ParameterStyle; + explode?: boolean; + allowReserved?: boolean; + examples?: Record; + example?: any; + content?: import("../interfaces/open-api-spec.interface").ContentObject; + } | { + schema: import("lodash").Dictionary; + name?: string | number | object; + type?: Type; + in?: import("../interfaces/open-api-spec.interface").ParameterLocation | "body" | "placeholder"; + isArray?: boolean; + items?: SchemaObject; + required?: boolean; + enum?: unknown[]; + enumName?: string; + enumSchema?: import("../interfaces/enum-schema-attributes.interface").EnumSchemaAttributes; + selfRequired?: boolean; + })[]; +}; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..e7c91de6de604267e29fc4ac0e5ceecae4de031c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-parameters.explorer.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiParametersMetadata = void 0; +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const model_properties_accessor_1 = require("../services/model-properties-accessor"); +const parameter_metadata_accessor_1 = require("../services/parameter-metadata-accessor"); +const parameters_metadata_mapper_1 = require("../services/parameters-metadata-mapper"); +const schema_object_factory_1 = require("../services/schema-object-factory"); +const swagger_types_mapper_1 = require("../services/swagger-types-mapper"); +const global_parameters_storage_1 = require("../storages/global-parameters.storage"); +const parameterMetadataAccessor = new parameter_metadata_accessor_1.ParameterMetadataAccessor(); +const modelPropertiesAccessor = new model_properties_accessor_1.ModelPropertiesAccessor(); +const parametersMetadataMapper = new parameters_metadata_mapper_1.ParametersMetadataMapper(modelPropertiesAccessor); +const swaggerTypesMapper = new swagger_types_mapper_1.SwaggerTypesMapper(); +const schemaObjectFactory = new schema_object_factory_1.SchemaObjectFactory(modelPropertiesAccessor, swaggerTypesMapper); +const exploreApiParametersMetadata = (schemas, instance, prototype, method) => { + const explicitParameters = Reflect.getMetadata(constants_1.DECORATORS.API_PARAMETERS, method); + const globalParameters = global_parameters_storage_1.GlobalParametersStorage.getAll(); + const parametersMetadata = parameterMetadataAccessor.explore(instance, prototype, method); + const noExplicitAndGlobalMetadata = (0, lodash_1.isNil)(explicitParameters) && (0, lodash_1.isNil)(globalParameters); + if (noExplicitAndGlobalMetadata && (0, lodash_1.isNil)(parametersMetadata)) { + return undefined; + } + const reflectedParametersAsProperties = parametersMetadataMapper.transformModelToProperties(parametersMetadata || {}); + let properties = reflectedParametersAsProperties; + if (!noExplicitAndGlobalMetadata) { + const mergeImplicitAndExplicit = (item) => (0, lodash_1.assign)(item, (0, lodash_1.find)(explicitParameters, ['name', item.name])); + properties = removeBodyMetadataIfExplicitExists(properties, explicitParameters); + properties = (0, lodash_1.map)(properties, mergeImplicitAndExplicit); + properties = (0, lodash_1.unionWith)(properties, explicitParameters, globalParameters, (arrVal, othVal) => { + return arrVal.name === othVal.name && arrVal.in === othVal.in; + }); + } + const paramsWithDefinitions = schemaObjectFactory.createFromModel(properties, schemas); + const parameters = swaggerTypesMapper.mapParamTypes(paramsWithDefinitions); + return parameters ? { parameters } : undefined; +}; +exports.exploreApiParametersMetadata = exploreApiParametersMetadata; +function removeBodyMetadataIfExplicitExists(properties, explicitParams) { + const isBodyReflected = (0, lodash_1.some)(properties, (p) => p.in === 'body'); + const isBodyDefinedExplicitly = (0, lodash_1.some)(explicitParams, (p) => p.in === 'body'); + if (isBodyReflected && isBodyDefinedExplicitly) { + return (0, lodash_1.omitBy)(properties, (p) => p.in === 'body'); + } + return properties; +} diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-produces.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-produces.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ec0ef6418449afda2fc8faec86c9f454abb8fc27 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-produces.explorer.d.ts @@ -0,0 +1,5 @@ +import { Type } from '@nestjs/common'; +export declare const exploreGlobalApiProducesMetadata: (metatype: Type) => { + produces: any; +}; +export declare const exploreApiProducesMetadata: (instance: object, prototype: Type, method: object) => any; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-produces.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-produces.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..ac4980c90dd2a8bcd5d87f6f821baa5c3c225a4c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-produces.explorer.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiProducesMetadata = exports.exploreGlobalApiProducesMetadata = void 0; +const constants_1 = require("../constants"); +const exploreGlobalApiProducesMetadata = (metatype) => { + const produces = Reflect.getMetadata(constants_1.DECORATORS.API_PRODUCES, metatype); + return produces ? { produces } : undefined; +}; +exports.exploreGlobalApiProducesMetadata = exploreGlobalApiProducesMetadata; +const exploreApiProducesMetadata = (instance, prototype, method) => Reflect.getMetadata(constants_1.DECORATORS.API_PRODUCES, method); +exports.exploreApiProducesMetadata = exploreApiProducesMetadata; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-response.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-response.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..52b94e4f9662c0dc486e0669a17f0a82272b1f86 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-response.explorer.d.ts @@ -0,0 +1,13 @@ +import { Type } from '@nestjs/common'; +import { SchemaObject } from '../interfaces/open-api-spec.interface'; +import { FactoriesNeededByResponseFactory } from '../services/response-object-factory'; +export declare const exploreGlobalApiResponseMetadata: (schemas: Record, metatype: Type, factories: FactoriesNeededByResponseFactory) => { + responses: { + [x: string]: boolean; + }; +}; +export declare const exploreApiResponseMetadata: (schemas: Record, factories: FactoriesNeededByResponseFactory, instance: object, prototype: Type, method: Function, metatype?: Type) => import("lodash").Dictionary | { + [status]: { + description: string; + }; +}; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-response.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-response.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..c4fc8bfc80506087755a194b024845396bec2ea5 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-response.explorer.js @@ -0,0 +1,103 @@ +"use strict"; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiResponseMetadata = exports.exploreGlobalApiResponseMetadata = void 0; +const common_1 = require("@nestjs/common"); +const constants_1 = require("@nestjs/common/constants"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const lodash_1 = require("lodash"); +const constants_2 = require("../constants"); +const decorators_1 = require("../decorators"); +const plugin_constants_1 = require("../plugin/plugin-constants"); +const response_object_factory_1 = require("../services/response-object-factory"); +const global_responses_storage_1 = require("../storages/global-responses.storage"); +const merge_and_uniq_util_1 = require("../utils/merge-and-uniq.util"); +const responseObjectFactory = new response_object_factory_1.ResponseObjectFactory(); +const exploreGlobalApiResponseMetadata = (schemas, metatype, factories) => { + const responses = Reflect.getMetadata(constants_2.DECORATORS.API_RESPONSE, metatype); + const globalResponses = global_responses_storage_1.GlobalResponsesStorage.getAll(); + const mappedGlobalResponsesOrUndefined = globalResponses + ? mapResponsesToSwaggerResponses(globalResponses, schemas, undefined, factories) + : undefined; + const produces = Reflect.getMetadata(constants_2.DECORATORS.API_PRODUCES, metatype); + return responses + ? { + responses: Object.assign(Object.assign({}, mappedGlobalResponsesOrUndefined), mapResponsesToSwaggerResponses(responses, schemas, produces, factories)) + } + : mappedGlobalResponsesOrUndefined + ? { + responses: mappedGlobalResponsesOrUndefined + } + : undefined; +}; +exports.exploreGlobalApiResponseMetadata = exploreGlobalApiResponseMetadata; +const exploreApiResponseMetadata = (schemas, factories, instance, prototype, method, metatype) => { + applyMetadataFactory(prototype, instance); + const responses = Reflect.getMetadata(constants_2.DECORATORS.API_RESPONSE, method); + if (responses) { + const classProduces = Reflect.getMetadata(constants_2.DECORATORS.API_PRODUCES, metatype !== null && metatype !== void 0 ? metatype : prototype === null || prototype === void 0 ? void 0 : prototype.constructor); + const methodProduces = Reflect.getMetadata(constants_2.DECORATORS.API_PRODUCES, method); + const produces = (0, merge_and_uniq_util_1.mergeAndUniq)(classProduces, methodProduces); + return mapResponsesToSwaggerResponses(responses, schemas, produces, factories); + } + const status = getStatusCode(method); + if (status) { + return { [status]: { description: '' } }; + } + return undefined; +}; +exports.exploreApiResponseMetadata = exploreApiResponseMetadata; +const getStatusCode = (method) => { + const status = Reflect.getMetadata(constants_1.HTTP_CODE_METADATA, method); + if (status) { + return status; + } + const requestMethod = Reflect.getMetadata(constants_1.METHOD_METADATA, method); + switch (requestMethod) { + case common_1.RequestMethod.POST: + return common_1.HttpStatus.CREATED; + default: + return common_1.HttpStatus.OK; + } +}; +const omitParamType = (param) => (0, lodash_1.omit)(param, 'type'); +const mapResponsesToSwaggerResponses = (responses, schemas, produces = ['application/json'], factories) => { + produces = (0, shared_utils_1.isEmpty)(produces) ? ['application/json'] : produces; + const openApiResponses = (0, lodash_1.mapValues)(responses, (response) => responseObjectFactory.create(response, produces, schemas, factories)); + return (0, lodash_1.mapValues)(openApiResponses, omitParamType); +}; +function applyMetadataFactory(prototype, instance) { + const classPrototype = prototype; + do { + if (!prototype.constructor) { + return; + } + if (!prototype.constructor[plugin_constants_1.METADATA_FACTORY_NAME]) { + continue; + } + const metadata = prototype.constructor[plugin_constants_1.METADATA_FACTORY_NAME](); + const methodKeys = Object.keys(metadata).filter((key) => typeof instance[key] === 'function'); + methodKeys.forEach((key) => { + const _a = metadata[key], { summary, deprecated, tags } = _a, meta = __rest(_a, ["summary", "deprecated", "tags"]); + if (Object.keys(meta).length === 0) { + return; + } + if (meta.status === undefined) { + meta.status = getStatusCode(instance[key]); + } + (0, decorators_1.ApiResponse)(meta, { overrideExisting: false })(classPrototype, key, Object.getOwnPropertyDescriptor(classPrototype, key)); + }); + } while ((prototype = Reflect.getPrototypeOf(prototype)) && + prototype !== Object.prototype && + prototype); +} diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-security.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-security.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b99f2b624fc53cb5d573e8fd25766c4274964616 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-security.explorer.d.ts @@ -0,0 +1,5 @@ +import { Type } from '@nestjs/common'; +export declare const exploreGlobalApiSecurityMetadata: (metatype: Type) => { + security: any; +}; +export declare const exploreApiSecurityMetadata: (instance: object, prototype: Type, method: object) => any; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-security.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-security.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..26b30ae8a044c2e32e26e87a63aef74d50fa9c06 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-security.explorer.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiSecurityMetadata = exports.exploreGlobalApiSecurityMetadata = void 0; +const constants_1 = require("../constants"); +const exploreGlobalApiSecurityMetadata = (metatype) => { + const security = Reflect.getMetadata(constants_1.DECORATORS.API_SECURITY, metatype); + return security ? { security } : undefined; +}; +exports.exploreGlobalApiSecurityMetadata = exploreGlobalApiSecurityMetadata; +const exploreApiSecurityMetadata = (instance, prototype, method) => { + return Reflect.getMetadata(constants_1.DECORATORS.API_SECURITY, method); +}; +exports.exploreApiSecurityMetadata = exploreApiSecurityMetadata; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-use-tags.explorer.d.ts b/node_modules/@nestjs/swagger/dist/explorers/api-use-tags.explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8916f1e857b223ff35b94ed270485cee3890323b --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-use-tags.explorer.d.ts @@ -0,0 +1,5 @@ +import { Type } from '@nestjs/common'; +export declare const exploreGlobalApiTagsMetadata: (autoTagControllers?: boolean) => (metatype: Type) => { + tags: any; +}; +export declare const exploreApiTagsMetadata: (instance: object, prototype: Type, method: object) => any; diff --git a/node_modules/@nestjs/swagger/dist/explorers/api-use-tags.explorer.js b/node_modules/@nestjs/swagger/dist/explorers/api-use-tags.explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..cfa44d838163de7dd09aff0d2726c3d61f44a212 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/explorers/api-use-tags.explorer.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.exploreApiTagsMetadata = exports.exploreGlobalApiTagsMetadata = void 0; +const constants_1 = require("../constants"); +const exploreGlobalApiTagsMetadata = (autoTagControllers) => (metatype) => { + const decoratorTags = Reflect.getMetadata(constants_1.DECORATORS.API_TAGS, metatype); + const isEmpty = !decoratorTags || decoratorTags.length === 0; + if (isEmpty && autoTagControllers) { + const defaultTag = metatype.name.replace(/Controller$/, ''); + return { + tags: [defaultTag] + }; + } + return isEmpty ? undefined : { tags: decoratorTags }; +}; +exports.exploreGlobalApiTagsMetadata = exploreGlobalApiTagsMetadata; +const exploreApiTagsMetadata = (instance, prototype, method) => Reflect.getMetadata(constants_1.DECORATORS.API_TAGS, method); +exports.exploreApiTagsMetadata = exploreApiTagsMetadata; diff --git a/node_modules/@nestjs/swagger/dist/extra/swagger-shim.d.ts b/node_modules/@nestjs/swagger/dist/extra/swagger-shim.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7033f979591a4461704ba81cc2d782868fd1ac74 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/extra/swagger-shim.d.ts @@ -0,0 +1,110 @@ +export declare function ApiProperty(): () => void; +export declare function ApiPropertyOptional(): () => void; +export declare function ApiResponseProperty(): () => void; +export declare function ApiBasicAuth(): () => void; +export declare function ApiBearerAuth(): () => void; +export declare function ApiBody(): () => void; +export declare function ApiConsumes(): () => void; +export declare function ApiCookieAuth(): () => void; +export declare function ApiExcludeEndpoint(): () => void; +export declare function ApiIncludeEndpoint(): () => void; +export declare function ApiExcludeController(): () => void; +export declare function ApiExtraModels(): () => void; +export declare function ApiHeader(): () => void; +export declare function ApiHeaders(): () => void; +export declare function ApiHideProperty(): () => void; +export declare function ApiOAuth2(): () => void; +export declare function ApiOperation(): () => void; +export declare function ApiParam(): () => void; +export declare function ApiProduces(): () => void; +export declare function ApiQuery(): () => void; +export declare function ApiResponse(): () => void; +export declare function ApiContinueResponse(): () => void; +export declare function ApiSwitchingProtocolsResponse(): () => void; +export declare function ApiProcessingResponse(): () => void; +export declare function ApiEarlyhintsResponse(): () => void; +export declare function ApiOkResponse(): () => void; +export declare function ApiCreatedResponse(): () => void; +export declare function ApiAcceptedResponse(): () => void; +export declare function ApiNonAuthoritativeInformationResponse(): () => void; +export declare function ApiNoContentResponse(): () => void; +export declare function ApiResetContentResponse(): () => void; +export declare function ApiPartialContentResponse(): () => void; +export declare function ApiAmbiguousResponse(): () => void; +export declare function ApiMovedPermanentlyResponse(): () => void; +export declare function ApiFoundResponse(): () => void; +export declare function ApiSeeOtherResponse(): () => void; +export declare function ApiNotModifiedResponse(): () => void; +export declare function ApiTemporaryRedirectResponse(): () => void; +export declare function ApiPermanentRedirectResponse(): () => void; +export declare function ApiBadRequestResponse(): () => void; +export declare function ApiUnauthorizedResponse(): () => void; +export declare function ApiPaymentRequiredResponse(): () => void; +export declare function ApiForbiddenResponse(): () => void; +export declare function ApiNotFoundResponse(): () => void; +export declare function ApiMethodNotAllowedResponse(): () => void; +export declare function ApiNotAcceptableResponse(): () => void; +export declare function ApiProxyAuthenticationRequiredResponse(): () => void; +export declare function ApiRequestTimeoutResponse(): () => void; +export declare function ApiConflictResponse(): () => void; +export declare function ApiGoneResponse(): () => void; +export declare function ApiLengthRequiredResponse(): () => void; +export declare function ApiPreconditionFailedResponse(): () => void; +export declare function ApiPayloadTooLargeResponse(): () => void; +export declare function ApiUriTooLongResponse(): () => void; +export declare function ApiUnsupportedMediaTypeResponse(): () => void; +export declare function ApiRequestedRangeNotSatisfiableResponse(): () => void; +export declare function ApiExpectationFailedResponse(): () => void; +export declare function ApiIAmATeapotResponse(): () => void; +export declare function ApiMisdirectedResponse(): () => void; +export declare function ApiUnprocessableEntityResponse(): () => void; +export declare function ApiFailedDependencyResponse(): () => void; +export declare function ApiPreconditionRequiredResponse(): () => void; +export declare function ApiTooManyRequestsResponse(): () => void; +export declare function ApiInternalServerErrorResponse(): () => void; +export declare function ApiNotImplementedResponse(): () => void; +export declare function ApiBadGatewayResponse(): () => void; +export declare function ApiServiceUnavailableResponse(): () => void; +export declare function ApiGatewayTimeoutResponse(): () => void; +export declare function ApiHttpVersionNotSupportedResponse(): () => void; +export declare function ApiDefaultResponse(): () => void; +export declare function ApiSchema(): () => void; +export declare function ApiSecurity(): () => void; +export declare function ApiTags(): () => void; +export declare function ApiTagOptions(): () => void; +export declare function ApiCallbacks(): () => void; +export declare function ApiWebhook(): () => void; +export declare function ApiLink(): () => void; +export declare function ApiDefaultGetter(): () => void; +export declare function ApiExtension(): () => void; +export declare function DocumentBuilder(): () => void; +export declare function SwaggerModule(): () => void; +export declare function DeepPartialType(): { + new (): {}; +}; +export declare function IntersectionType(): { + new (): {}; +}; +export declare function OmitType(): { + new (): {}; +}; +export declare function PartialType(): { + new (): {}; +}; +export declare function PickType(): { + new (): {}; +}; +export declare function getSchemaPath(): () => string; +export declare function refs(): any[]; +export declare function before(): () => string; +export declare function ReadonlyVisitor(): { + new (): {}; +}; +export declare function generateSchema(): { + schema: {}; + schemas: {}; +}; +export declare const ApiPropertyOptions: {}; +export declare const OpenAPIObject: {}; +export declare const DECORATORS_PREFIX = ""; +export declare const DECORATORS: {}; diff --git a/node_modules/@nestjs/swagger/dist/extra/swagger-shim.js b/node_modules/@nestjs/swagger/dist/extra/swagger-shim.js new file mode 100644 index 0000000000000000000000000000000000000000..6867c88c2f3e0feb298183d94abb55915905d78c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/extra/swagger-shim.js @@ -0,0 +1,377 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DECORATORS = exports.DECORATORS_PREFIX = exports.OpenAPIObject = exports.ApiPropertyOptions = void 0; +exports.ApiProperty = ApiProperty; +exports.ApiPropertyOptional = ApiPropertyOptional; +exports.ApiResponseProperty = ApiResponseProperty; +exports.ApiBasicAuth = ApiBasicAuth; +exports.ApiBearerAuth = ApiBearerAuth; +exports.ApiBody = ApiBody; +exports.ApiConsumes = ApiConsumes; +exports.ApiCookieAuth = ApiCookieAuth; +exports.ApiExcludeEndpoint = ApiExcludeEndpoint; +exports.ApiIncludeEndpoint = ApiIncludeEndpoint; +exports.ApiExcludeController = ApiExcludeController; +exports.ApiExtraModels = ApiExtraModels; +exports.ApiHeader = ApiHeader; +exports.ApiHeaders = ApiHeaders; +exports.ApiHideProperty = ApiHideProperty; +exports.ApiOAuth2 = ApiOAuth2; +exports.ApiOperation = ApiOperation; +exports.ApiParam = ApiParam; +exports.ApiProduces = ApiProduces; +exports.ApiQuery = ApiQuery; +exports.ApiResponse = ApiResponse; +exports.ApiContinueResponse = ApiContinueResponse; +exports.ApiSwitchingProtocolsResponse = ApiSwitchingProtocolsResponse; +exports.ApiProcessingResponse = ApiProcessingResponse; +exports.ApiEarlyhintsResponse = ApiEarlyhintsResponse; +exports.ApiOkResponse = ApiOkResponse; +exports.ApiCreatedResponse = ApiCreatedResponse; +exports.ApiAcceptedResponse = ApiAcceptedResponse; +exports.ApiNonAuthoritativeInformationResponse = ApiNonAuthoritativeInformationResponse; +exports.ApiNoContentResponse = ApiNoContentResponse; +exports.ApiResetContentResponse = ApiResetContentResponse; +exports.ApiPartialContentResponse = ApiPartialContentResponse; +exports.ApiAmbiguousResponse = ApiAmbiguousResponse; +exports.ApiMovedPermanentlyResponse = ApiMovedPermanentlyResponse; +exports.ApiFoundResponse = ApiFoundResponse; +exports.ApiSeeOtherResponse = ApiSeeOtherResponse; +exports.ApiNotModifiedResponse = ApiNotModifiedResponse; +exports.ApiTemporaryRedirectResponse = ApiTemporaryRedirectResponse; +exports.ApiPermanentRedirectResponse = ApiPermanentRedirectResponse; +exports.ApiBadRequestResponse = ApiBadRequestResponse; +exports.ApiUnauthorizedResponse = ApiUnauthorizedResponse; +exports.ApiPaymentRequiredResponse = ApiPaymentRequiredResponse; +exports.ApiForbiddenResponse = ApiForbiddenResponse; +exports.ApiNotFoundResponse = ApiNotFoundResponse; +exports.ApiMethodNotAllowedResponse = ApiMethodNotAllowedResponse; +exports.ApiNotAcceptableResponse = ApiNotAcceptableResponse; +exports.ApiProxyAuthenticationRequiredResponse = ApiProxyAuthenticationRequiredResponse; +exports.ApiRequestTimeoutResponse = ApiRequestTimeoutResponse; +exports.ApiConflictResponse = ApiConflictResponse; +exports.ApiGoneResponse = ApiGoneResponse; +exports.ApiLengthRequiredResponse = ApiLengthRequiredResponse; +exports.ApiPreconditionFailedResponse = ApiPreconditionFailedResponse; +exports.ApiPayloadTooLargeResponse = ApiPayloadTooLargeResponse; +exports.ApiUriTooLongResponse = ApiUriTooLongResponse; +exports.ApiUnsupportedMediaTypeResponse = ApiUnsupportedMediaTypeResponse; +exports.ApiRequestedRangeNotSatisfiableResponse = ApiRequestedRangeNotSatisfiableResponse; +exports.ApiExpectationFailedResponse = ApiExpectationFailedResponse; +exports.ApiIAmATeapotResponse = ApiIAmATeapotResponse; +exports.ApiMisdirectedResponse = ApiMisdirectedResponse; +exports.ApiUnprocessableEntityResponse = ApiUnprocessableEntityResponse; +exports.ApiFailedDependencyResponse = ApiFailedDependencyResponse; +exports.ApiPreconditionRequiredResponse = ApiPreconditionRequiredResponse; +exports.ApiTooManyRequestsResponse = ApiTooManyRequestsResponse; +exports.ApiInternalServerErrorResponse = ApiInternalServerErrorResponse; +exports.ApiNotImplementedResponse = ApiNotImplementedResponse; +exports.ApiBadGatewayResponse = ApiBadGatewayResponse; +exports.ApiServiceUnavailableResponse = ApiServiceUnavailableResponse; +exports.ApiGatewayTimeoutResponse = ApiGatewayTimeoutResponse; +exports.ApiHttpVersionNotSupportedResponse = ApiHttpVersionNotSupportedResponse; +exports.ApiDefaultResponse = ApiDefaultResponse; +exports.ApiSchema = ApiSchema; +exports.ApiSecurity = ApiSecurity; +exports.ApiTags = ApiTags; +exports.ApiTagOptions = ApiTagOptions; +exports.ApiCallbacks = ApiCallbacks; +exports.ApiWebhook = ApiWebhook; +exports.ApiLink = ApiLink; +exports.ApiDefaultGetter = ApiDefaultGetter; +exports.ApiExtension = ApiExtension; +exports.DocumentBuilder = DocumentBuilder; +exports.SwaggerModule = SwaggerModule; +exports.DeepPartialType = DeepPartialType; +exports.IntersectionType = IntersectionType; +exports.OmitType = OmitType; +exports.PartialType = PartialType; +exports.PickType = PickType; +exports.getSchemaPath = getSchemaPath; +exports.refs = refs; +exports.before = before; +exports.ReadonlyVisitor = ReadonlyVisitor; +exports.generateSchema = generateSchema; +function ApiProperty() { + return () => { }; +} +function ApiPropertyOptional() { + return () => { }; +} +function ApiResponseProperty() { + return () => { }; +} +function ApiBasicAuth() { + return () => { }; +} +function ApiBearerAuth() { + return () => { }; +} +function ApiBody() { + return () => { }; +} +function ApiConsumes() { + return () => { }; +} +function ApiCookieAuth() { + return () => { }; +} +function ApiExcludeEndpoint() { + return () => { }; +} +function ApiIncludeEndpoint() { + return () => { }; +} +function ApiExcludeController() { + return () => { }; +} +function ApiExtraModels() { + return () => { }; +} +function ApiHeader() { + return () => { }; +} +function ApiHeaders() { + return () => { }; +} +function ApiHideProperty() { + return () => { }; +} +function ApiOAuth2() { + return () => { }; +} +function ApiOperation() { + return () => { }; +} +function ApiParam() { + return () => { }; +} +function ApiProduces() { + return () => { }; +} +function ApiQuery() { + return () => { }; +} +function ApiResponse() { + return () => { }; +} +function ApiContinueResponse() { + return () => { }; +} +function ApiSwitchingProtocolsResponse() { + return () => { }; +} +function ApiProcessingResponse() { + return () => { }; +} +function ApiEarlyhintsResponse() { + return () => { }; +} +function ApiOkResponse() { + return () => { }; +} +function ApiCreatedResponse() { + return () => { }; +} +function ApiAcceptedResponse() { + return () => { }; +} +function ApiNonAuthoritativeInformationResponse() { + return () => { }; +} +function ApiNoContentResponse() { + return () => { }; +} +function ApiResetContentResponse() { + return () => { }; +} +function ApiPartialContentResponse() { + return () => { }; +} +function ApiAmbiguousResponse() { + return () => { }; +} +function ApiMovedPermanentlyResponse() { + return () => { }; +} +function ApiFoundResponse() { + return () => { }; +} +function ApiSeeOtherResponse() { + return () => { }; +} +function ApiNotModifiedResponse() { + return () => { }; +} +function ApiTemporaryRedirectResponse() { + return () => { }; +} +function ApiPermanentRedirectResponse() { + return () => { }; +} +function ApiBadRequestResponse() { + return () => { }; +} +function ApiUnauthorizedResponse() { + return () => { }; +} +function ApiPaymentRequiredResponse() { + return () => { }; +} +function ApiForbiddenResponse() { + return () => { }; +} +function ApiNotFoundResponse() { + return () => { }; +} +function ApiMethodNotAllowedResponse() { + return () => { }; +} +function ApiNotAcceptableResponse() { + return () => { }; +} +function ApiProxyAuthenticationRequiredResponse() { + return () => { }; +} +function ApiRequestTimeoutResponse() { + return () => { }; +} +function ApiConflictResponse() { + return () => { }; +} +function ApiGoneResponse() { + return () => { }; +} +function ApiLengthRequiredResponse() { + return () => { }; +} +function ApiPreconditionFailedResponse() { + return () => { }; +} +function ApiPayloadTooLargeResponse() { + return () => { }; +} +function ApiUriTooLongResponse() { + return () => { }; +} +function ApiUnsupportedMediaTypeResponse() { + return () => { }; +} +function ApiRequestedRangeNotSatisfiableResponse() { + return () => { }; +} +function ApiExpectationFailedResponse() { + return () => { }; +} +function ApiIAmATeapotResponse() { + return () => { }; +} +function ApiMisdirectedResponse() { + return () => { }; +} +function ApiUnprocessableEntityResponse() { + return () => { }; +} +function ApiFailedDependencyResponse() { + return () => { }; +} +function ApiPreconditionRequiredResponse() { + return () => { }; +} +function ApiTooManyRequestsResponse() { + return () => { }; +} +function ApiInternalServerErrorResponse() { + return () => { }; +} +function ApiNotImplementedResponse() { + return () => { }; +} +function ApiBadGatewayResponse() { + return () => { }; +} +function ApiServiceUnavailableResponse() { + return () => { }; +} +function ApiGatewayTimeoutResponse() { + return () => { }; +} +function ApiHttpVersionNotSupportedResponse() { + return () => { }; +} +function ApiDefaultResponse() { + return () => { }; +} +function ApiSchema() { + return () => { }; +} +function ApiSecurity() { + return () => { }; +} +function ApiTags() { + return () => { }; +} +function ApiTagOptions() { + return () => { }; +} +function ApiCallbacks() { + return () => { }; +} +function ApiWebhook() { + return () => { }; +} +function ApiLink() { + return () => { }; +} +function ApiDefaultGetter() { + return () => { }; +} +function ApiExtension() { + return () => { }; +} +function DocumentBuilder() { + return () => { }; +} +function SwaggerModule() { + return () => { }; +} +function DeepPartialType() { + return class { + }; +} +function IntersectionType() { + return class { + }; +} +function OmitType() { + return class { + }; +} +function PartialType() { + return class { + }; +} +function PickType() { + return class { + }; +} +function getSchemaPath() { + return () => ''; +} +function refs() { + return []; +} +function before() { + return () => ''; +} +function ReadonlyVisitor() { + return class { + }; +} +function generateSchema() { + return { schema: {}, schemas: {} }; +} +exports.ApiPropertyOptions = {}; +exports.OpenAPIObject = {}; +exports.DECORATORS_PREFIX = ''; +exports.DECORATORS = {}; diff --git a/node_modules/@nestjs/swagger/dist/fixtures/document.base.d.ts b/node_modules/@nestjs/swagger/dist/fixtures/document.base.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..163223666d8835be21611c4b05dc3f3d34ff7551 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/fixtures/document.base.d.ts @@ -0,0 +1,2 @@ +import { OpenAPIObject } from '../interfaces'; +export declare const buildDocumentBase: () => Omit; diff --git a/node_modules/@nestjs/swagger/dist/fixtures/document.base.js b/node_modules/@nestjs/swagger/dist/fixtures/document.base.js new file mode 100644 index 0000000000000000000000000000000000000000..1bd15a2e1b38480ccf14cb65b0d6977b41261a18 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/fixtures/document.base.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildDocumentBase = void 0; +const buildDocumentBase = () => ({ + openapi: '3.0.0', + info: { + title: '', + description: '', + version: '1.0.0', + contact: {} + }, + tags: [], + servers: [], + components: {} +}); +exports.buildDocumentBase = buildDocumentBase; diff --git a/node_modules/@nestjs/swagger/dist/index.d.ts b/node_modules/@nestjs/swagger/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5076da02e92af7af7a8c62ff4e547a340db37736 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/index.d.ts @@ -0,0 +1,8 @@ +import 'reflect-metadata'; +export * from './decorators'; +export * from './document-builder'; +export * from './interfaces'; +export * from './swagger-module'; +export * from './type-helpers'; +export * from './utils'; +export * from './constants'; diff --git a/node_modules/@nestjs/swagger/dist/index.js b/node_modules/@nestjs/swagger/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c262fe727ee418c8644df0bc5d2b1877e88efd57 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/index.js @@ -0,0 +1,24 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +require("reflect-metadata"); +__exportStar(require("./decorators"), exports); +__exportStar(require("./document-builder"), exports); +__exportStar(require("./interfaces"), exports); +__exportStar(require("./swagger-module"), exports); +__exportStar(require("./type-helpers"), exports); +__exportStar(require("./utils"), exports); +__exportStar(require("./constants"), exports); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/callback-object.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/callback-object.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..58985d9b4a037682ad23a8899ea745c2610ce5ca --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/callback-object.interface.d.ts @@ -0,0 +1,12 @@ +export interface CallBackObject { + name: string; + callbackUrl: string; + method: string; + requestBody: { + type: T; + }; + expectedResponse: { + status: number; + description?: string; + }; +} diff --git a/node_modules/@nestjs/swagger/dist/interfaces/callback-object.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/callback-object.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/callback-object.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc-resolvers.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc-resolvers.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..09dac0ee501224bda3f6fc59114d95adb3156592 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc-resolvers.interface.d.ts @@ -0,0 +1,7 @@ +export interface DenormalizedDocResolvers { + root: Function[]; + security: Function[]; + tags: Function[]; + callbacks: Function[]; + responses: Function[]; +} diff --git a/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc-resolvers.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc-resolvers.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc-resolvers.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..912c0759fce5f987e6026fe2f863cdc75e46b260 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc.interface.d.ts @@ -0,0 +1,10 @@ +import { OpenAPIObject, OperationObject, ResponsesObject } from './open-api-spec.interface'; +export interface DenormalizedDoc extends Partial { + root?: { + method: string; + path: string; + isWebhook?: boolean; + webhookName?: string; + } & OperationObject; + responses?: ResponsesObject; +} diff --git a/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/denormalized-doc.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/enum-schema-attributes.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/enum-schema-attributes.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2241a361107e1b29eaeacf61971c041b4aac93fc --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/enum-schema-attributes.interface.d.ts @@ -0,0 +1,2 @@ +import { SchemaObject } from './open-api-spec.interface'; +export type EnumSchemaAttributes = Pick; diff --git a/node_modules/@nestjs/swagger/dist/interfaces/enum-schema-attributes.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/enum-schema-attributes.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/enum-schema-attributes.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/index.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5371e9c9cc077b6e298c6e3b68884cc9cc73f7d9 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/index.d.ts @@ -0,0 +1,3 @@ +export { ApiTagOptions, OpenAPIObject } from './open-api-spec.interface'; +export * from './swagger-custom-options.interface'; +export * from './swagger-document-options.interface'; diff --git a/node_modules/@nestjs/swagger/dist/interfaces/index.js b/node_modules/@nestjs/swagger/dist/interfaces/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b64b78292f26565a95e61b7a283eaeb53c9759d7 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./swagger-custom-options.interface"), exports); +__exportStar(require("./swagger-document-options.interface"), exports); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/module-route.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/module-route.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e44c1c79fc801b77422ac43b99c55aed5ca7ee63 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/module-route.interface.d.ts @@ -0,0 +1,2 @@ +import { OpenAPIObject } from '.'; +export type ModuleRoute = Omit & Record<'root', any>; diff --git a/node_modules/@nestjs/swagger/dist/interfaces/module-route.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/module-route.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/module-route.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/open-api-spec.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/open-api-spec.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8d3058c8dbba003060d2b336eb7ba0ac7942c6e7 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/open-api-spec.interface.d.ts @@ -0,0 +1,250 @@ +export interface OpenAPIObject { + openapi: string; + info: InfoObject; + servers?: ServerObject[]; + paths: PathsObject; + webhooks?: WebhooksObject; + components?: ComponentsObject; + security?: SecurityRequirementObject[]; + tags?: TagObject[]; + externalDocs?: ExternalDocumentationObject; +} +export interface InfoObject { + title: string; + description?: string; + termsOfService?: string; + contact?: ContactObject; + license?: LicenseObject; + version: string; +} +export interface ContactObject { + name?: string; + url?: string; + email?: string; +} +export interface LicenseObject { + name: string; + url?: string; +} +export interface ServerObject { + url: string; + description?: string; + variables?: Record; +} +export interface ServerVariableObject { + enum?: string[] | boolean[] | number[]; + default: string | boolean | number; + description?: string; +} +export interface ComponentsObject { + schemas?: Record; + responses?: Record; + parameters?: Record; + examples?: Record; + requestBodies?: Record; + headers?: Record; + securitySchemes?: Record; + links?: Record; + callbacks?: Record; +} +export type PathsObject = Record; +export type WebhooksObject = Record; +export interface PathItemObject { + $ref?: string; + summary?: string; + description?: string; + get?: OperationObject; + put?: OperationObject; + post?: OperationObject; + delete?: OperationObject; + options?: OperationObject; + head?: OperationObject; + patch?: OperationObject; + trace?: OperationObject; + servers?: ServerObject[]; + parameters?: (ParameterObject | ReferenceObject)[]; +} +export interface OperationObject { + tags?: string[]; + summary?: string; + description?: string; + externalDocs?: ExternalDocumentationObject; + operationId?: string; + parameters?: (ParameterObject | ReferenceObject)[]; + requestBody?: RequestBodyObject | ReferenceObject; + responses: ResponsesObject; + callbacks?: CallbacksObject; + deprecated?: boolean; + security?: SecurityRequirementObject[]; + servers?: ServerObject[]; +} +export interface ExternalDocumentationObject { + description?: string; + url: string; +} +export type ParameterLocation = 'query' | 'header' | 'path' | 'cookie'; +export type ParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject'; +export interface BaseParameterObject { + description?: string; + required?: boolean; + deprecated?: boolean; + allowEmptyValue?: boolean; + style?: ParameterStyle; + explode?: boolean; + allowReserved?: boolean; + schema?: SchemaObject | ReferenceObject; + examples?: Record; + example?: any; + content?: ContentObject; +} +export interface ParameterObject extends BaseParameterObject { + name: string; + in: ParameterLocation; +} +export interface RequestBodyObject { + description?: string; + content: ContentObject; + required?: boolean; +} +export type ContentObject = Record; +export interface MediaTypeObject { + schema?: SchemaObject | ReferenceObject; + examples?: ExamplesObject; + example?: any; + encoding?: EncodingObject; +} +export type EncodingObject = Record; +export interface EncodingPropertyObject { + contentType?: string; + headers?: Record; + style?: string; + explode?: boolean; + allowReserved?: boolean; +} +export interface ResponsesObject extends Record { + default?: ResponseObject | ReferenceObject; +} +export interface ResponseObject { + description: string; + headers?: HeadersObject; + content?: ContentObject; + links?: LinksObject; +} +export type CallbacksObject = Record; +export type CallbackObject = Record; +export type HeadersObject = Record; +export interface ExampleObject { + summary?: string; + description?: string; + value?: any; + externalValue?: string; +} +export type LinksObject = Record; +export interface LinkObject { + operationRef?: string; + operationId?: string; + parameters?: LinkParametersObject; + requestBody?: any | string; + description?: string; + server?: ServerObject; +} +export type LinkParametersObject = Record; +export type HeaderObject = BaseParameterObject; +export interface TagObject { + name: string; + summary?: string; + description?: string; + externalDocs?: ExternalDocumentationObject; + parent?: string; + kind?: string; +} +export interface ApiTagOptions { + name: string; + parent?: string; + kind?: string; +} +export type ExamplesObject = Record; +export interface ReferenceObject { + $ref: string; +} +export interface SchemaObject { + nullable?: boolean; + discriminator?: DiscriminatorObject; + readOnly?: boolean; + writeOnly?: boolean; + xml?: XmlObject; + externalDocs?: ExternalDocumentationObject; + example?: any; + examples?: any[] | Record; + deprecated?: boolean; + type?: string; + allOf?: (SchemaObject | ReferenceObject)[]; + oneOf?: (SchemaObject | ReferenceObject)[]; + anyOf?: (SchemaObject | ReferenceObject)[]; + not?: SchemaObject | ReferenceObject; + items?: SchemaObject | ReferenceObject; + properties?: Record; + additionalProperties?: SchemaObject | ReferenceObject | boolean; + patternProperties?: SchemaObject | ReferenceObject | any; + description?: string; + format?: OpenAPIFormat; + default?: any; + title?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: string[]; + enum?: any[]; + 'x-enumNames'?: string[]; +} +export type SchemasObject = Record; +export interface DiscriminatorObject { + propertyName: string; + mapping?: Record; +} +export interface XmlObject { + name?: string; + namespace?: string; + prefix?: string; + attribute?: boolean; + wrapped?: boolean; +} +export type SecuritySchemeType = 'apiKey' | 'http' | 'oauth2' | 'openIdConnect'; +export interface SecuritySchemeObject { + type: SecuritySchemeType; + description?: string; + name?: string; + in?: string; + scheme?: string; + bearerFormat?: string; + flows?: OAuthFlowsObject; + openIdConnectUrl?: string; + 'x-tokenName'?: string; + [extension: `x-${string}`]: any; +} +export interface OAuthFlowsObject { + implicit?: OAuthFlowObject; + password?: OAuthFlowObject; + clientCredentials?: OAuthFlowObject; + authorizationCode?: OAuthFlowObject; +} +export interface OAuthFlowObject { + authorizationUrl?: string; + tokenUrl?: string; + refreshUrl?: string; + scopes: ScopesObject; +} +export type ScopesObject = Record; +export type SecurityRequirementObject = Record; +export type ExtensionLocation = 'root' | 'info'; +export type OpenAPIFormat = 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'time' | 'duration' | 'password' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'uri-template' | 'iri' | 'iri-reference' | 'uuid' | 'json-pointer' | 'relative-json-pointer' | 'regex' | (string & {}); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/open-api-spec.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/open-api-spec.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/open-api-spec.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/schema-object-metadata.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/schema-object-metadata.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1aa4c10f18e629f3717c457303f5bcd83b8ffa66 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/schema-object-metadata.interface.d.ts @@ -0,0 +1,31 @@ +import { Type } from '@nestjs/common'; +import { EnumSchemaAttributes } from './enum-schema-attributes.interface'; +import { ReferenceObject, SchemaObject } from './open-api-spec.interface'; +export type EnumAllowedTypes = any[] | Record | (() => any[] | Record); +interface SchemaObjectCommonMetadata extends Omit { + isArray?: boolean; + name?: string; + pattern?: string | RegExp; + enum?: EnumAllowedTypes; +} +export type SchemaObjectMetadata = (SchemaObjectCommonMetadata & { + type?: Type | Function | [Function] | 'array' | 'string' | 'number' | 'boolean' | 'integer' | 'file' | 'null'; + required?: boolean; +}) | ({ + type?: Type | Function | [Function] | Record; + required?: boolean; + enumName: string; + enumSchema?: EnumSchemaAttributes; +} & SchemaObjectCommonMetadata) | ({ + type: 'object'; + properties: Record; + required?: string[]; + selfRequired?: boolean; +} & SchemaObjectCommonMetadata) | ({ + type: 'object'; + properties?: Record; + additionalProperties: SchemaObject | ReferenceObject | boolean; + required?: string[]; + selfRequired?: boolean; +} & SchemaObjectCommonMetadata); +export {}; diff --git a/node_modules/@nestjs/swagger/dist/interfaces/schema-object-metadata.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/schema-object-metadata.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/schema-object-metadata.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/swagger-custom-options.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/swagger-custom-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..351ce09f0a0fc6818f53b6222eb9b5d3caf235cd --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/swagger-custom-options.interface.d.ts @@ -0,0 +1,24 @@ +import { OpenAPIObject } from './open-api-spec.interface'; +import { SwaggerUiOptions } from './swagger-ui-options.interface'; +export interface SwaggerCustomOptions { + useGlobalPrefix?: boolean; + swaggerUiEnabled?: boolean; + ui?: boolean; + raw?: boolean | Array<'json' | 'yaml'>; + swaggerUrl?: string; + jsonDocumentUrl?: string; + yamlDocumentUrl?: string; + patchDocumentOnRequest?: (req: TRequest, res: TResponse, document: OpenAPIObject) => OpenAPIObject | Promise; + explorer?: boolean; + swaggerOptions?: SwaggerUiOptions; + customCss?: string; + customCssUrl?: string | string[]; + customJs?: string | string[]; + customJsStr?: string | string[]; + customfavIcon?: string; + customSiteTitle?: string; + customSwaggerUiPath?: string; + validatorUrl?: string; + url?: string; + urls?: Record<'url' | 'name', string>[]; +} diff --git a/node_modules/@nestjs/swagger/dist/interfaces/swagger-custom-options.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/swagger-custom-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/swagger-custom-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/swagger-document-options.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/swagger-document-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a02a844088eb84c43e7c6f406239063165ff682 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/swagger-document-options.interface.d.ts @@ -0,0 +1,13 @@ +export type OperationIdFactory = (controllerKey: string, methodKey: string, version?: string) => string; +export interface SwaggerDocumentOptions { + include?: Function[]; + extraModels?: Function[]; + ignoreGlobalPrefix?: boolean; + deepScanRoutes?: boolean; + operationIdFactory?: OperationIdFactory; + linkNameFactory?: (controllerKey: string, methodKey: string, fieldKey: string) => string; + autoTagControllers?: boolean; + onlyIncludeDecoratedEndpoints?: boolean; + excludeDynamicDefaults?: boolean; + exampleMaxDepth?: number; +} diff --git a/node_modules/@nestjs/swagger/dist/interfaces/swagger-document-options.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/swagger-document-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/swagger-document-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-init-options.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-init-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9ece09ccd46775795e55ee332eabe4ab52ae0150 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-init-options.interface.d.ts @@ -0,0 +1,7 @@ +import { OpenAPIObject } from './open-api-spec.interface'; +import { SwaggerUiOptions } from './swagger-ui-options.interface'; +export interface SwaggerUIInitOptions { + swaggerDoc: OpenAPIObject; + customOptions: SwaggerUiOptions; + swaggerUrl: string; +} diff --git a/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-init-options.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-init-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-init-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-options.interface.d.ts b/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-options.interface.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d5624925f5fc0820ea6d588f0b978cd97c65b3a --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-options.interface.d.ts @@ -0,0 +1,15 @@ +export interface SwaggerUiOptions { + initOAuth?: { + clientId?: string; + clientSecret?: string; + realm?: string; + appName?: string; + scopeSeparator?: string; + scopes?: string[]; + additionalQueryStringParams?: Record; + useBasicAuthenticationWithAccessCodeGrant?: boolean; + usePkceWithAuthorizationCodeGrant?: boolean; + }; + persistAuthorization?: boolean; + [key: string]: any; +} diff --git a/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-options.interface.js b/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-options.interface.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/interfaces/swagger-ui-options.interface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/plugin/compiler-plugin.d.ts b/node_modules/@nestjs/swagger/dist/plugin/compiler-plugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..be0604abe3588f705c4db02790fe6952b71e3c23 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/compiler-plugin.d.ts @@ -0,0 +1,2 @@ +import * as ts from 'typescript'; +export declare const before: (options?: Record, program?: ts.Program) => (ctx: ts.TransformationContext) => ts.Transformer; diff --git a/node_modules/@nestjs/swagger/dist/plugin/compiler-plugin.js b/node_modules/@nestjs/swagger/dist/plugin/compiler-plugin.js new file mode 100644 index 0000000000000000000000000000000000000000..fe2b0c1deca34f26199c04715ff4009886a0f248 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/compiler-plugin.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.before = void 0; +const merge_options_1 = require("./merge-options"); +const plugin_debug_logger_1 = require("./plugin-debug-logger"); +const is_filename_matched_util_1 = require("./utils/is-filename-matched.util"); +const controller_class_visitor_1 = require("./visitors/controller-class.visitor"); +const model_class_visitor_1 = require("./visitors/model-class.visitor"); +const modelClassVisitor = new model_class_visitor_1.ModelClassVisitor(); +const controllerClassVisitor = new controller_class_visitor_1.ControllerClassVisitor(); +const before = (options, program) => { + options = (0, merge_options_1.mergePluginOptions)(options); + if (!program) { + const error = `The "program" reference must be provided when using the CLI Plugin. This error is likely caused by the "isolatedModules" compiler option being set to "true".`; + plugin_debug_logger_1.pluginDebugLogger.debug(error); + throw new Error(error); + } + const compilerOptions = program.getCompilerOptions(); + if (compilerOptions.outDir) { + options.outDir = compilerOptions.outDir; + } + if (compilerOptions.rootDir) { + options.rootDir = compilerOptions.rootDir; + } + return (ctx) => { + return (sf) => { + if ((0, is_filename_matched_util_1.isFilenameMatched)(options.dtoFileNameSuffix, sf.fileName)) { + return modelClassVisitor.visit(sf, ctx, program, options); + } + if ((0, is_filename_matched_util_1.isFilenameMatched)(options.controllerFileNameSuffix, sf.fileName)) { + return controllerClassVisitor.visit(sf, ctx, program, options); + } + return sf; + }; + }; +}; +exports.before = before; diff --git a/node_modules/@nestjs/swagger/dist/plugin/index.d.ts b/node_modules/@nestjs/swagger/dist/plugin/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f980bda5bb88eea6bdd35e0cf30e0cd6a21b6be8 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/index.d.ts @@ -0,0 +1,2 @@ +export * from './compiler-plugin'; +export * from './visitors/readonly.visitor'; diff --git a/node_modules/@nestjs/swagger/dist/plugin/index.js b/node_modules/@nestjs/swagger/dist/plugin/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f5a43755b53c94b261a91cc86f0631df099361e1 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./compiler-plugin"), exports); +__exportStar(require("./visitors/readonly.visitor"), exports); diff --git a/node_modules/@nestjs/swagger/dist/plugin/merge-options.d.ts b/node_modules/@nestjs/swagger/dist/plugin/merge-options.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..030c4ff52b9c9016c72b48cd146a385dbe2e22b1 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/merge-options.d.ts @@ -0,0 +1,20 @@ +export interface PluginOptions { + dtoFileNameSuffix?: string | string[]; + controllerFileNameSuffix?: string | string[]; + classValidatorShim?: boolean; + classTransformerShim?: boolean | 'exclusive'; + dtoKeyOfComment?: string; + controllerKeyOfComment?: string; + introspectComments?: boolean; + esmCompatible?: boolean; + readonly?: boolean; + pathToSource?: string; + debug?: boolean; + parameterProperties?: boolean; + skipAutoHttpCode?: boolean; + skipDefaultValues?: boolean; + outDir?: string; + rootDir?: string; + autoFillEnumName?: boolean; +} +export declare const mergePluginOptions: (options?: Record) => PluginOptions; diff --git a/node_modules/@nestjs/swagger/dist/plugin/merge-options.js b/node_modules/@nestjs/swagger/dist/plugin/merge-options.js new file mode 100644 index 0000000000000000000000000000000000000000..a4269d0d95deac880255ae82a2042d47be0a9d4e --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/merge-options.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergePluginOptions = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const plugin_debug_logger_1 = require("./plugin-debug-logger"); +const defaultOptions = { + dtoFileNameSuffix: ['.dto.ts', '.entity.ts'], + controllerFileNameSuffix: ['.controller.ts'], + classValidatorShim: true, + classTransformerShim: false, + dtoKeyOfComment: 'description', + controllerKeyOfComment: 'summary', + introspectComments: false, + esmCompatible: false, + readonly: false, + debug: false, + skipDefaultValues: false +}; +const mergePluginOptions = (options = {}) => { + if ((0, shared_utils_1.isString)(options.dtoFileNameSuffix)) { + options.dtoFileNameSuffix = [options.dtoFileNameSuffix]; + } + if ((0, shared_utils_1.isString)(options.controllerFileNameSuffix)) { + options.controllerFileNameSuffix = [options.controllerFileNameSuffix]; + } + for (const key of ['dtoFileNameSuffix', 'controllerFileNameSuffix']) { + if (options[key] && options[key].includes('.ts')) { + plugin_debug_logger_1.pluginDebugLogger.warn(`Skipping ${key} option ".ts" because it can cause unwanted behaviour.`); + options[key] = options[key].filter((pattern) => pattern !== '.ts'); + if (options[key].length == 0) { + delete options[key]; + } + } + } + return Object.assign(Object.assign({}, defaultOptions), options); +}; +exports.mergePluginOptions = mergePluginOptions; diff --git a/node_modules/@nestjs/swagger/dist/plugin/metadata-loader.d.ts b/node_modules/@nestjs/swagger/dist/plugin/metadata-loader.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2b3eaa7d7cf64b9a84388e7824d381ab0e63f69 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/metadata-loader.d.ts @@ -0,0 +1,7 @@ +export declare class MetadataLoader { + private static readonly refreshHooks; + static addRefreshHook(hook: () => void): number; + load(metadata: Record): Promise; + private applyMetadata; + private runHooks; +} diff --git a/node_modules/@nestjs/swagger/dist/plugin/metadata-loader.js b/node_modules/@nestjs/swagger/dist/plugin/metadata-loader.js new file mode 100644 index 0000000000000000000000000000000000000000..e8a73d859274616c11468c53235ee4c58dc7eca0 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/metadata-loader.js @@ -0,0 +1,51 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MetadataLoader = void 0; +const plugin_constants_1 = require("./plugin-constants"); +class MetadataLoader { + static addRefreshHook(hook) { + return MetadataLoader.refreshHooks.push(hook); + } + load(metadata) { + return __awaiter(this, void 0, void 0, function* () { + const pkgMetadata = metadata['@nestjs/swagger']; + if (!pkgMetadata) { + return; + } + const { models, controllers } = pkgMetadata; + if (models) { + yield this.applyMetadata(models); + } + if (controllers) { + yield this.applyMetadata(controllers); + } + this.runHooks(); + }); + } + applyMetadata(meta) { + return __awaiter(this, void 0, void 0, function* () { + const loadPromises = meta.map((_a) => __awaiter(this, [_a], void 0, function* ([fileImport, fileMeta]) { + const fileRef = yield fileImport; + Object.keys(fileMeta).map((key) => { + const clsRef = fileRef[key]; + clsRef[plugin_constants_1.METADATA_FACTORY_NAME] = () => fileMeta[key]; + }); + })); + yield Promise.all(loadPromises); + }); + } + runHooks() { + MetadataLoader.refreshHooks.forEach((hook) => hook()); + } +} +exports.MetadataLoader = MetadataLoader; +MetadataLoader.refreshHooks = new Array(); diff --git a/node_modules/@nestjs/swagger/dist/plugin/plugin-constants.d.ts b/node_modules/@nestjs/swagger/dist/plugin/plugin-constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fef0dd13867d57ac8e62b3a37a3b09af0c866cf8 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/plugin-constants.d.ts @@ -0,0 +1,3 @@ +export declare const OPENAPI_NAMESPACE = "openapi"; +export declare const OPENAPI_PACKAGE_NAME = "@nestjs/swagger"; +export declare const METADATA_FACTORY_NAME = "_OPENAPI_METADATA_FACTORY"; diff --git a/node_modules/@nestjs/swagger/dist/plugin/plugin-constants.js b/node_modules/@nestjs/swagger/dist/plugin/plugin-constants.js new file mode 100644 index 0000000000000000000000000000000000000000..e31c07b2e65e538929019f302c0f5589e4b91425 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/plugin-constants.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.METADATA_FACTORY_NAME = exports.OPENAPI_PACKAGE_NAME = exports.OPENAPI_NAMESPACE = void 0; +exports.OPENAPI_NAMESPACE = 'openapi'; +exports.OPENAPI_PACKAGE_NAME = '@nestjs/swagger'; +exports.METADATA_FACTORY_NAME = '_OPENAPI_METADATA_FACTORY'; diff --git a/node_modules/@nestjs/swagger/dist/plugin/plugin-debug-logger.d.ts b/node_modules/@nestjs/swagger/dist/plugin/plugin-debug-logger.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dd9544ee99d2567c6c9702fe39e383a526d43580 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/plugin-debug-logger.d.ts @@ -0,0 +1,5 @@ +import { ConsoleLogger } from '@nestjs/common'; +declare class PluginDebugLogger extends ConsoleLogger { +} +export declare const pluginDebugLogger: PluginDebugLogger; +export {}; diff --git a/node_modules/@nestjs/swagger/dist/plugin/plugin-debug-logger.js b/node_modules/@nestjs/swagger/dist/plugin/plugin-debug-logger.js new file mode 100644 index 0000000000000000000000000000000000000000..0f9365e0cdb2a8eb6d15cb4511abc9edd3d0c606 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/plugin-debug-logger.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.pluginDebugLogger = void 0; +const common_1 = require("@nestjs/common"); +class PluginDebugLogger extends common_1.ConsoleLogger { +} +exports.pluginDebugLogger = new PluginDebugLogger('CLI Plugin'); diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/ast-utils.d.ts b/node_modules/@nestjs/swagger/dist/plugin/utils/ast-utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..80db7239b453e06f5328c00e8947f15ae3650a9d --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/ast-utils.d.ts @@ -0,0 +1,31 @@ +import { DocComment, DocNode } from '@microsoft/tsdoc'; +import * as ts from 'typescript'; +import { Decorator, Node, ObjectFlags, Type, TypeChecker, TypeFlags, TypeFormatFlags, UnionTypeNode } from 'typescript'; +export declare function renderDocNode(docNode: DocNode): string; +export declare function isArray(type: Type): boolean; +export declare function getTypeArguments(type: Type): any; +export declare function isBoolean(type: Type): boolean; +export declare function isBooleanLiteral(type: Type): boolean; +export declare function isString(type: Type): boolean; +export declare function isStringLiteral(type: Type): boolean; +export declare function isStringMapping(type: Type): boolean; +export declare function isNumber(type: Type): boolean; +export declare function isBigInt(type: Type): boolean; +export declare function isInterface(type: Type): boolean; +export declare function isEnum(type: Type): boolean; +export declare function isEnumLiteral(type: Type): boolean; +export declare function hasFlag(type: Type, flag: TypeFlags): boolean; +export declare function hasObjectFlag(type: Type, flag: ObjectFlags): boolean; +export declare function getText(type: Type, typeChecker: TypeChecker, enclosingNode?: Node, typeFormatFlags?: TypeFormatFlags): string; +export declare function getDefaultTypeFormatFlags(enclosingNode: Node): number; +export declare function getDocComment(node: Node): DocComment; +export declare function getMainCommentOfNode(node: Node): string; +export declare function parseCommentDocValue(docValue: string, type: ts.Type): string; +export declare function getTsDocTagsOfNode(node: Node, typeChecker: TypeChecker): any; +export declare function getTsDocErrorsOfNode(node: Node): any[]; +export declare function getDecoratorArguments(decorator: Decorator): any[] | ts.NodeArray; +export declare function getDecoratorName(decorator: Decorator): string; +export declare function findNullableTypeFromUnion(typeNode: UnionTypeNode, typeChecker: TypeChecker): ts.TypeNode; +export declare function createBooleanLiteral(factory: ts.NodeFactory, flag: boolean): ts.BooleanLiteral; +export declare function createPrimitiveLiteral(factory: ts.NodeFactory, item: unknown, typeOfItem?: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"): ts.StringLiteral | ts.NumericLiteral | ts.PrefixUnaryExpression | ts.BooleanLiteral; +export declare function createLiteralFromAnyValue(factory: ts.NodeFactory, item: unknown): any; diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/ast-utils.js b/node_modules/@nestjs/swagger/dist/plugin/utils/ast-utils.js new file mode 100644 index 0000000000000000000000000000000000000000..bd0de44613178922b618ab606f912e598d5188bd --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/ast-utils.js @@ -0,0 +1,278 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.renderDocNode = renderDocNode; +exports.isArray = isArray; +exports.getTypeArguments = getTypeArguments; +exports.isBoolean = isBoolean; +exports.isBooleanLiteral = isBooleanLiteral; +exports.isString = isString; +exports.isStringLiteral = isStringLiteral; +exports.isStringMapping = isStringMapping; +exports.isNumber = isNumber; +exports.isBigInt = isBigInt; +exports.isInterface = isInterface; +exports.isEnum = isEnum; +exports.isEnumLiteral = isEnumLiteral; +exports.hasFlag = hasFlag; +exports.hasObjectFlag = hasObjectFlag; +exports.getText = getText; +exports.getDefaultTypeFormatFlags = getDefaultTypeFormatFlags; +exports.getDocComment = getDocComment; +exports.getMainCommentOfNode = getMainCommentOfNode; +exports.parseCommentDocValue = parseCommentDocValue; +exports.getTsDocTagsOfNode = getTsDocTagsOfNode; +exports.getTsDocErrorsOfNode = getTsDocErrorsOfNode; +exports.getDecoratorArguments = getDecoratorArguments; +exports.getDecoratorName = getDecoratorName; +exports.findNullableTypeFromUnion = findNullableTypeFromUnion; +exports.createBooleanLiteral = createBooleanLiteral; +exports.createPrimitiveLiteral = createPrimitiveLiteral; +exports.createLiteralFromAnyValue = createLiteralFromAnyValue; +const tsdoc_1 = require("@microsoft/tsdoc"); +const typescript_1 = require("typescript"); +const plugin_utils_1 = require("./plugin-utils"); +function renderDocNode(docNode) { + let result = ''; + if (docNode) { + if (docNode instanceof tsdoc_1.DocExcerpt) { + result += docNode.content.toString(); + } + for (const childNode of docNode.getChildNodes()) { + result += renderDocNode(childNode); + } + } + return result; +} +function isArray(type) { + const symbol = type.getSymbol(); + if (!symbol) { + return false; + } + return symbol.getName() === 'Array' && getTypeArguments(type).length === 1; +} +function getTypeArguments(type) { + return type.typeArguments || []; +} +function isBoolean(type) { + return (hasFlag(type, typescript_1.TypeFlags.Boolean) || + hasFlag(type, typescript_1.TypeFlags.BooleanLiteral)); +} +function isBooleanLiteral(type) { + return hasFlag(type, typescript_1.TypeFlags.BooleanLiteral) && !type.isUnion(); +} +function isString(type) { + return hasFlag(type, typescript_1.TypeFlags.String); +} +function isStringLiteral(type) { + return hasFlag(type, typescript_1.TypeFlags.StringLiteral) && !type.isUnion(); +} +function isStringMapping(type) { + return hasFlag(type, typescript_1.TypeFlags.StringMapping); +} +function isNumber(type) { + return hasFlag(type, typescript_1.TypeFlags.Number); +} +function isBigInt(type) { + return hasFlag(type, typescript_1.TypeFlags.BigInt); +} +function isInterface(type) { + return hasObjectFlag(type, typescript_1.ObjectFlags.Interface); +} +function isEnum(type) { + const hasEnumFlag = hasFlag(type, typescript_1.TypeFlags.Enum); + if (hasEnumFlag) { + return true; + } + if (isEnumLiteral(type)) { + return false; + } + const symbol = type.getSymbol(); + if (!symbol) { + return false; + } + const valueDeclaration = symbol.valueDeclaration; + if (!valueDeclaration) { + return false; + } + return valueDeclaration.kind === typescript_1.SyntaxKind.EnumDeclaration; +} +function isEnumLiteral(type) { + return hasFlag(type, typescript_1.TypeFlags.EnumLiteral) && !type.isUnion(); +} +function hasFlag(type, flag) { + return (type.flags & flag) === flag; +} +function hasObjectFlag(type, flag) { + return (type.objectFlags & flag) === flag; +} +function getText(type, typeChecker, enclosingNode, typeFormatFlags) { + if (!typeFormatFlags) { + typeFormatFlags = getDefaultTypeFormatFlags(enclosingNode); + } + const compilerNode = !enclosingNode ? undefined : enclosingNode; + return typeChecker.typeToString(type, compilerNode, typeFormatFlags); +} +function getDefaultTypeFormatFlags(enclosingNode) { + let formatFlags = typescript_1.TypeFormatFlags.UseTypeOfFunction | + typescript_1.TypeFormatFlags.NoTruncation | + typescript_1.TypeFormatFlags.UseFullyQualifiedType | + typescript_1.TypeFormatFlags.WriteTypeArgumentsOfSignature; + if (enclosingNode && enclosingNode.kind === typescript_1.SyntaxKind.TypeAliasDeclaration) + formatFlags |= typescript_1.TypeFormatFlags.InTypeAlias; + return formatFlags; +} +function getDocComment(node) { + const tsdocParser = new tsdoc_1.TSDocParser(); + const parserContext = tsdocParser.parseString(node.getFullText()); + return parserContext.docComment; +} +function getMainCommentOfNode(node) { + const docComment = getDocComment(node); + return renderDocNode(docComment.summarySection).trim(); +} +function parseCommentDocValue(docValue, type) { + let value = docValue.replace(/'/g, '"').trim(); + if (!type || !isString(type)) { + try { + value = JSON.parse(value); + } + catch (_a) { + } + } + else if (isString(type)) { + if (value.split(' ').length !== 1 && !value.startsWith('"')) { + value = null; + } + else { + value = value.replace(/"/g, ''); + } + } + return value; +} +function getTsDocTagsOfNode(node, typeChecker) { + const docComment = getDocComment(node); + const tagDefinitions = { + example: { + hasProperties: true, + repeatable: true + } + }; + const tagResults = {}; + const introspectTsDocTags = (docComment) => { + for (const tag in tagDefinitions) { + const { hasProperties, repeatable } = tagDefinitions[tag]; + const blocks = docComment.customBlocks.filter((block) => block.blockTag.tagName === `@${tag}`); + if (blocks.length === 0) { + continue; + } + if (repeatable && !tagResults[tag]) { + tagResults[tag] = []; + } + const type = typeChecker.getTypeAtLocation(node); + if (hasProperties) { + blocks.forEach((block) => { + const docValue = renderDocNode(block.content).split('\n')[0]; + const value = parseCommentDocValue(docValue, type); + if (value !== null) { + if (repeatable) { + tagResults[tag].push(value); + } + else { + tagResults[tag] = value; + } + } + }); + } + else { + tagResults[tag] = true; + } + } + if (docComment.remarksBlock) { + tagResults['remarks'] = renderDocNode(docComment.remarksBlock.content).trim(); + } + if (docComment.deprecatedBlock) { + tagResults['deprecated'] = true; + } + }; + introspectTsDocTags(docComment); + return tagResults; +} +function getTsDocErrorsOfNode(node) { + const tsdocParser = new tsdoc_1.TSDocParser(); + const parserContext = tsdocParser.parseString(node.getFullText()); + const docComment = parserContext.docComment; + const tagResults = []; + const errorParsingRegex = /{(\d+)} (.*)/; + const introspectTsDocTags = (docComment) => { + const blocks = docComment.customBlocks.filter((block) => block.blockTag.tagName === '@throws'); + blocks.forEach((block) => { + try { + const docValue = renderDocNode(block.content).split('\n')[0].trim(); + const match = docValue.match(errorParsingRegex); + tagResults.push({ + status: Number(match[1]), + description: match[2] + }); + } + catch (_a) { + } + }); + }; + introspectTsDocTags(docComment); + return tagResults; +} +function getDecoratorArguments(decorator) { + const callExpression = decorator.expression; + return (callExpression && callExpression.arguments) || []; +} +function getDecoratorName(decorator) { + const isDecoratorFactory = decorator.expression.kind === typescript_1.SyntaxKind.CallExpression; + if (isDecoratorFactory) { + const callExpression = decorator.expression; + const identifier = callExpression + .expression; + if ((0, plugin_utils_1.isDynamicallyAdded)(identifier)) { + return undefined; + } + return getIdentifierFromName(callExpression.expression).getText(); + } + return getIdentifierFromName(decorator.expression).getText(); +} +function getIdentifierFromName(expression) { + const identifier = getNameFromExpression(expression); + if (expression && expression.kind !== typescript_1.SyntaxKind.Identifier) { + throw new Error(); + } + return identifier; +} +function getNameFromExpression(expression) { + if (expression && expression.kind === typescript_1.SyntaxKind.PropertyAccessExpression) { + return expression.name; + } + return expression; +} +function findNullableTypeFromUnion(typeNode, typeChecker) { + return typeNode.types.find((tNode) => hasFlag(typeChecker.getTypeAtLocation(tNode), typescript_1.TypeFlags.Null)); +} +function createBooleanLiteral(factory, flag) { + return flag ? factory.createTrue() : factory.createFalse(); +} +function createPrimitiveLiteral(factory, item, typeOfItem = typeof item) { + switch (typeOfItem) { + case 'boolean': + return createBooleanLiteral(factory, item); + case 'number': { + if (item < 0) { + return factory.createPrefixUnaryExpression(typescript_1.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(item))); + } + return factory.createNumericLiteral(item); + } + case 'string': + return factory.createStringLiteral(item); + } +} +function createLiteralFromAnyValue(factory, item) { + return Array.isArray(item) + ? factory.createArrayLiteralExpression(item.map((item) => createLiteralFromAnyValue(factory, item))) + : createPrimitiveLiteral(factory, item); +} diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/external-imports.util.d.ts b/node_modules/@nestjs/swagger/dist/plugin/utils/external-imports.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..164412932b6bdc31d25399cd87fa002a802b50af --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/external-imports.util.d.ts @@ -0,0 +1,3 @@ +import * as ts from 'typescript'; +export declare function getExternalImports(sourceFile: ts.SourceFile): Record; +export declare function replaceExternalImportsInTypeReference(typeReference: string, externalImports: Record): string; diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/external-imports.util.js b/node_modules/@nestjs/swagger/dist/plugin/utils/external-imports.util.js new file mode 100644 index 0000000000000000000000000000000000000000..04f3f0424c9315ae7e4d72352fb2c9197b3bbb28 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/external-imports.util.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getExternalImports = getExternalImports; +exports.replaceExternalImportsInTypeReference = replaceExternalImportsInTypeReference; +const ts = require("typescript"); +function getExternalImports(sourceFile) { + const externalImports = {}; + const importDeclarations = sourceFile.statements.filter(ts.isImportDeclaration); + for (const declaration of importDeclarations) { + const { moduleSpecifier, importClause } = declaration; + if (!ts.isStringLiteral(moduleSpecifier) || + moduleSpecifier.text[0] === '.') { + continue; + } + if ((importClause === null || importClause === void 0 ? void 0 : importClause.namedBindings) && + ts.isNamedImports(importClause.namedBindings)) { + const namedImports = importClause === null || importClause === void 0 ? void 0 : importClause.namedBindings; + for (const namedImport of namedImports.elements) { + externalImports[namedImport.name.text] = moduleSpecifier.text; + } + } + } + return externalImports; +} +function replaceExternalImportsInTypeReference(typeReference, externalImports) { + const regexp = /import\((.+)\).([^\]]+)(\])?/; + const match = regexp.exec(typeReference); + if ((match === null || match === void 0 ? void 0 : match.length) >= 3) { + const [, importPath, importName] = match; + if (externalImports[importName]) { + return typeReference.replace(importPath, `"${externalImports[importName]}"`); + } + } + return typeReference; +} diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/is-filename-matched.util.d.ts b/node_modules/@nestjs/swagger/dist/plugin/utils/is-filename-matched.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bddf2006fe2e2287860033c8cd4d69b4fc7e7bea --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/is-filename-matched.util.d.ts @@ -0,0 +1 @@ +export declare const isFilenameMatched: (patterns: string[], filename: string) => boolean; diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/is-filename-matched.util.js b/node_modules/@nestjs/swagger/dist/plugin/utils/is-filename-matched.util.js new file mode 100644 index 0000000000000000000000000000000000000000..e28ede211a18d1e4da7795de601c08dd164d42e9 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/is-filename-matched.util.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isFilenameMatched = void 0; +const isFilenameMatched = (patterns, filename) => patterns.some((path) => filename.includes(path)); +exports.isFilenameMatched = isFilenameMatched; diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/module-format.util.d.ts b/node_modules/@nestjs/swagger/dist/plugin/utils/module-format.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a57970a8e8a2d132886c5af32612769b8930bf59 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/module-format.util.d.ts @@ -0,0 +1,4 @@ +import * as ts from 'typescript'; +import { PluginOptions } from '../merge-options.js'; +export declare function resolvePluginOptionsForFile(options: PluginOptions, sourceFile: ts.SourceFile, compilerOptions: ts.CompilerOptions): PluginOptions; +export declare function isEsmOutputFile(sourceFile: ts.SourceFile, compilerOptions: ts.CompilerOptions, options?: PluginOptions): boolean; diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/module-format.util.js b/node_modules/@nestjs/swagger/dist/plugin/utils/module-format.util.js new file mode 100644 index 0000000000000000000000000000000000000000..5e9a561866777a589b8ca55265fc776272d4dc5f --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/module-format.util.js @@ -0,0 +1,40 @@ +import * as ts from 'typescript'; +export function resolvePluginOptionsForFile(options, sourceFile, compilerOptions) { + return { + ...options, + esmCompatible: isEsmOutputFile(sourceFile, compilerOptions, options) + }; +} +export function isEsmOutputFile(sourceFile, compilerOptions, options) { + if (options?.esmCompatibleWasConfigured) { + return options.esmCompatible; + } + if (sourceFile.impliedNodeFormat !== undefined) { + return sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext; + } + const impliedNodeFormat = getImpliedNodeFormat(sourceFile, compilerOptions); + if (impliedNodeFormat !== undefined) { + return impliedNodeFormat === ts.ModuleKind.ESNext; + } + return isEsmModuleKind(compilerOptions.module); +} +function getImpliedNodeFormat(sourceFile, compilerOptions) { + if (!isNodeModuleKind(compilerOptions.module)) { + return undefined; + } + return ts.getImpliedNodeFormatForFile(sourceFile.fileName, undefined, ts.sys, compilerOptions); +} +function isEsmModuleKind(moduleKind) { + if (moduleKind === undefined) { + return false; + } + return ((moduleKind >= ts.ModuleKind.ES2015 && + moduleKind <= ts.ModuleKind.ESNext) || + moduleKind === ts.ModuleKind.Preserve); +} +function isNodeModuleKind(moduleKind) { + return (moduleKind === ts.ModuleKind.Node16 || + moduleKind === ts.ModuleKind.Node18 || + moduleKind === ts.ModuleKind.Node20 || + moduleKind === ts.ModuleKind.NodeNext); +} diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/plugin-utils.d.ts b/node_modules/@nestjs/swagger/dist/plugin/utils/plugin-utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..88ff51f62ce724998c12b9c2d533f0c9c34e81a8 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/plugin-utils.d.ts @@ -0,0 +1,38 @@ +import * as ts from 'typescript'; +import { PluginOptions } from '../merge-options'; +export declare function getDecoratorOrUndefinedByNames(names: string[], decorators: readonly ts.Decorator[], factory: ts.NodeFactory): ts.Decorator | undefined; +export declare function getTypeReferenceAsString(type: ts.Type, typeChecker: ts.TypeChecker, arrayDepth?: number): { + typeName: string; + isArray?: boolean; + arrayDepth?: number; +}; +export declare function getRecordValueType(type: ts.Type, typeChecker: ts.TypeChecker): ts.Type | undefined; +export declare function createAdditionalPropertiesValueSchema(valueType: ts.Type, typeChecker: ts.TypeChecker, factory: ts.NodeFactory): ts.Expression; +export declare function isPromiseOrObservable(type: string): boolean; +export declare function hasPropertyKey(key: string, properties: ts.NodeArray): boolean; +export declare function getOutputExtension(fileName: string): string; +export declare function replaceImportPath(typeReference: string, fileName: string, options: PluginOptions): { + typeReference: string; + typeName: string; + importPath: string; +} | { + typeReference: string; + importPath: string; + typeName?: undefined; +}; +export declare function insertAt(string: string, index: number, substring: string): string; +export declare function isDynamicallyAdded(identifier: ts.Node): boolean; +export declare function isAutoGeneratedEnumUnion(type: ts.Type, typeChecker: ts.TypeChecker): ts.Type; +export declare function isAutoGeneratedTypeUnion(type: ts.Type): boolean; +export declare function getStringLiteralUnionValues(type: ts.Type): { + values: (string | number)[]; + isNullable: boolean; +} | undefined; +export declare function extractTypeArgumentIfArray(type: ts.Type): { + type: ts.Type; + isArray: boolean; +}; +export declare function convertPath(windowsPath: string): string; +export declare function safeDecodeURIComponent(path: string): string; +export declare function normalizePackagePath(importPath: string): string; +export declare function canReferenceNode(node: ts.Node, options: PluginOptions): boolean; diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/plugin-utils.js b/node_modules/@nestjs/swagger/dist/plugin/utils/plugin-utils.js new file mode 100644 index 0000000000000000000000000000000000000000..2ffb8953b0b3ed38d6e8243d64fb7c505eef5f70 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/plugin-utils.js @@ -0,0 +1,450 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDecoratorOrUndefinedByNames = getDecoratorOrUndefinedByNames; +exports.getTypeReferenceAsString = getTypeReferenceAsString; +exports.getRecordValueType = getRecordValueType; +exports.createAdditionalPropertiesValueSchema = createAdditionalPropertiesValueSchema; +exports.isPromiseOrObservable = isPromiseOrObservable; +exports.hasPropertyKey = hasPropertyKey; +exports.getOutputExtension = getOutputExtension; +exports.replaceImportPath = replaceImportPath; +exports.insertAt = insertAt; +exports.isDynamicallyAdded = isDynamicallyAdded; +exports.isAutoGeneratedEnumUnion = isAutoGeneratedEnumUnion; +exports.isAutoGeneratedTypeUnion = isAutoGeneratedTypeUnion; +exports.getStringLiteralUnionValues = getStringLiteralUnionValues; +exports.extractTypeArgumentIfArray = extractTypeArgumentIfArray; +exports.convertPath = convertPath; +exports.safeDecodeURIComponent = safeDecodeURIComponent; +exports.normalizePackagePath = normalizePackagePath; +exports.canReferenceNode = canReferenceNode; +const lodash_1 = require("lodash"); +const path_1 = require("path"); +const ts = __importStar(require("typescript")); +const ast_utils_1 = require("./ast-utils"); +function getDecoratorOrUndefinedByNames(names, decorators, factory) { + return (decorators || factory.createNodeArray()).find((item) => { + try { + const decoratorName = (0, ast_utils_1.getDecoratorName)(item); + return names.includes(decoratorName); + } + catch (_a) { + return false; + } + }); +} +function getTypeReferenceAsString(type, typeChecker, arrayDepth = 0) { + if ((0, ast_utils_1.isArray)(type)) { + const arrayType = (0, ast_utils_1.getTypeArguments)(type)[0]; + const { typeName, arrayDepth: depth } = getTypeReferenceAsString(arrayType, typeChecker, arrayDepth + 1); + if (!typeName) { + return { typeName: undefined }; + } + return { + typeName: `${typeName}`, + isArray: true, + arrayDepth: depth + }; + } + if ((0, ast_utils_1.isBoolean)(type)) { + return { typeName: Boolean.name, arrayDepth }; + } + if ((0, ast_utils_1.isNumber)(type)) { + return { typeName: Number.name, arrayDepth }; + } + if ((0, ast_utils_1.isBigInt)(type)) { + return { typeName: BigInt.name, arrayDepth }; + } + if ((0, ast_utils_1.isString)(type) || (0, ast_utils_1.isStringLiteral)(type) || (0, ast_utils_1.isStringMapping)(type)) { + return { typeName: String.name, arrayDepth }; + } + if (isPromiseOrObservable((0, ast_utils_1.getText)(type, typeChecker))) { + const typeArguments = (0, ast_utils_1.getTypeArguments)(type); + const elementType = getTypeReferenceAsString((0, lodash_1.head)(typeArguments), typeChecker, arrayDepth); + return elementType; + } + if (type.isClass()) { + return { typeName: (0, ast_utils_1.getText)(type, typeChecker), arrayDepth }; + } + try { + const text = (0, ast_utils_1.getText)(type, typeChecker); + if (text === Date.name) { + return { typeName: text, arrayDepth }; + } + if (isOptionalBoolean(text)) { + return { typeName: Boolean.name, arrayDepth }; + } + if (isAutoGeneratedTypeUnion(type) || + isAutoGeneratedEnumUnion(type, typeChecker)) { + const types = type.types; + return getTypeReferenceAsString(types[types.length - 1], typeChecker, arrayDepth); + } + if (text === 'any' || + text === 'unknown' || + text === 'object' || + (0, ast_utils_1.isInterface)(type) || + (type.isUnionOrIntersection() && !(0, ast_utils_1.isEnum)(type))) { + return { typeName: 'Object', arrayDepth }; + } + if ((0, ast_utils_1.isEnum)(type)) { + return { typeName: undefined, arrayDepth }; + } + if (type.aliasSymbol) { + return { typeName: 'Object', arrayDepth }; + } + if (typeChecker.getApparentType(type).getSymbol().getEscapedName() === + 'String') { + return { typeName: String.name, arrayDepth }; + } + return { typeName: undefined }; + } + catch (_a) { + return { typeName: undefined }; + } +} +function getRecordValueType(type, typeChecker) { + var _a, _b; + const indexInfo = (_a = typeChecker.getIndexInfoOfType(type, ts.IndexKind.String)) !== null && _a !== void 0 ? _a : typeChecker.getIndexInfoOfType(type, ts.IndexKind.Number); + if ((indexInfo === null || indexInfo === void 0 ? void 0 : indexInfo.type) && type.getProperties().length === 0) { + return indexInfo.type; + } + if (((_b = type.aliasSymbol) === null || _b === void 0 ? void 0 : _b.getName()) === 'Record') { + const aliasArgs = type.aliasTypeArguments; + if ((aliasArgs === null || aliasArgs === void 0 ? void 0 : aliasArgs.length) === 2) { + return aliasArgs[1]; + } + } + return undefined; +} +function createAdditionalPropertiesValueSchema(valueType, typeChecker, factory) { + const text = (0, ast_utils_1.getText)(valueType, typeChecker); + const objType = (t) => factory.createObjectLiteralExpression([ + factory.createPropertyAssignment('type', factory.createStringLiteral(t)) + ], false); + if ((0, ast_utils_1.isString)(valueType) || + (0, ast_utils_1.isStringLiteral)(valueType) || + (0, ast_utils_1.isStringMapping)(valueType)) { + return objType('string'); + } + if ((0, ast_utils_1.isNumber)(valueType) || (0, ast_utils_1.isBigInt)(valueType)) { + return objType('number'); + } + if ((0, ast_utils_1.isBoolean)(valueType)) { + return objType('boolean'); + } + if (text === 'any' || text === 'unknown' || text === 'object') { + return factory.createTrue(); + } + const nested = getRecordValueType(valueType, typeChecker); + if (nested) { + return factory.createObjectLiteralExpression([ + factory.createPropertyAssignment('type', factory.createStringLiteral('object')), + factory.createPropertyAssignment('additionalProperties', createAdditionalPropertiesValueSchema(nested, typeChecker, factory)) + ], false); + } + if ((0, ast_utils_1.isArray)(valueType)) { + const elementType = (0, ast_utils_1.getTypeArguments)(valueType)[0]; + return factory.createObjectLiteralExpression([ + factory.createPropertyAssignment('type', factory.createStringLiteral('array')), + factory.createPropertyAssignment('items', createAdditionalPropertiesValueSchema(elementType, typeChecker, factory)) + ], false); + } + return factory.createTrue(); +} +function isPromiseOrObservable(type) { + return /(^|\.)(Promise|Observable) !isDynamicallyAdded(item)) + .some((item) => item.name.getText() === key); +} +function getOutputExtension(fileName) { + if (fileName.endsWith('.mts')) { + return '.mjs'; + } + else if (fileName.endsWith('.cts')) { + return '.cjs'; + } + else { + return '.js'; + } +} +function replaceImportPath(typeReference, fileName, options) { + if (!typeReference.includes('import')) { + return { typeReference, importPath: null }; + } + if (options.esmCompatible) { + typeReference = typeReference.replace(', { with: { "resolution-mode": "import" } }', ''); + } + let importPath = /\(\"([^)]).+(\")/.exec(typeReference)[0]; + if (!importPath) { + return { typeReference: undefined, importPath: null }; + } + importPath = convertPath(importPath); + importPath = importPath.slice(2, importPath.length - 1); + const decodedImportPath = safeDecodeURIComponent(importPath); + try { + if ((0, path_1.isAbsolute)(decodedImportPath)) { + throw {}; + } + require.resolve(decodedImportPath); + if (!options.esmCompatible) { + typeReference = typeReference.replace('import', 'require'); + } + return { + typeReference, + importPath: null + }; + } + catch (_a) { + const from = (options === null || options === void 0 ? void 0 : options.readonly) + ? safeDecodeURIComponent(convertPath(options.pathToSource)) + : getOutputDir(fileName, options); + const targetPath = options.outDir && + options.rootDir && + decodedImportPath.startsWith(convertPath(options.rootDir)) + ? path_1.posix.join(convertPath(options.outDir), path_1.posix.relative(convertPath(options.rootDir), decodedImportPath)) + : decodedImportPath; + let relativePath = path_1.posix.relative(from, targetPath); + relativePath = relativePath[0] !== '.' ? './' + relativePath : relativePath; + const normalizedPath = normalizePackagePath(relativePath); + if (normalizedPath !== relativePath) { + relativePath = normalizedPath; + } + else if (options.esmCompatible) { + const extension = getOutputExtension(fileName); + relativePath += extension; + } + typeReference = typeReference.replace(importPath, relativePath); + if (options.readonly) { + const { typeName, typeImportStatement } = convertToAsyncImport(typeReference); + return { + typeReference: typeImportStatement, + typeName, + importPath: relativePath + }; + } + if (options.esmCompatible) { + const { typeName, typeImportStatement } = convertToAsyncImport(typeReference); + return { + typeReference: `(${typeImportStatement}).${typeName}`, + importPath: relativePath + }; + } + return { + typeReference: typeReference.replace('import', 'require'), + importPath: relativePath + }; + } +} +function getOutputDir(fileName, options) { + const sourceDir = path_1.posix.dirname(safeDecodeURIComponent(convertPath(fileName))); + if (options.outDir && options.rootDir) { + const outDir = convertPath(options.outDir); + const rootDir = convertPath(options.rootDir); + return path_1.posix.join(outDir, path_1.posix.relative(rootDir, sourceDir)); + } + return sourceDir; +} +function convertToAsyncImport(typeReference) { + const regexp = /import\(.+\).([^\]]+)(\])?/; + const match = regexp.exec(typeReference); + if ((match === null || match === void 0 ? void 0 : match.length) >= 2) { + const importPos = typeReference.indexOf(match[0]); + typeReference = typeReference.replace(`.${match[1]}`, ''); + return { + typeImportStatement: insertAt(typeReference, importPos, 'await '), + typeName: match[1] + }; + } + return { typeImportStatement: typeReference }; +} +function insertAt(string, index, substring) { + return string.slice(0, index) + substring + string.slice(index); +} +function isDynamicallyAdded(identifier) { + return identifier && !identifier.parent && identifier.pos === -1; +} +function isAutoGeneratedEnumUnion(type, typeChecker) { + if (type.isUnionOrIntersection() && !(0, ast_utils_1.isEnum)(type)) { + if (!type.types) { + return undefined; + } + const undefinedTypeIndex = type.types.findIndex((type) => type.intrinsicName === 'undefined' || type.intrinsicName === 'null'); + if (undefinedTypeIndex < 0) { + return undefined; + } + let parentType = undefined; + const isParentSymbolEqual = type.types.every((item, index) => { + if (index === undefinedTypeIndex) { + return true; + } + if (!item.symbol) { + return false; + } + if (!item.symbol.parent || + item.symbol.flags !== ts.SymbolFlags.EnumMember) { + return false; + } + const symbolType = typeChecker.getDeclaredTypeOfSymbol(item.symbol.parent); + if (symbolType === parentType || !parentType) { + parentType = symbolType; + return true; + } + return false; + }); + if (isParentSymbolEqual) { + return parentType; + } + } + return undefined; +} +function isAutoGeneratedTypeUnion(type) { + if (type.isUnionOrIntersection() && !(0, ast_utils_1.isEnum)(type)) { + if (!type.types) { + return false; + } + const undefinedTypeIndex = type.types.findIndex((type) => type.intrinsicName === 'undefined'); + if (type.types.length === 2 && undefinedTypeIndex >= 0) { + return true; + } + } + return false; +} +function isPlainStringLiteralType(type) { + return ((0, ast_utils_1.isStringLiteral)(type) && + !(type.symbol && (type.symbol.flags & ts.SymbolFlags.EnumMember) !== 0)); +} +function isPlainNumberLiteralType(type) { + return ((0, ast_utils_1.hasFlag)(type, ts.TypeFlags.NumberLiteral) && + !(type.symbol && (type.symbol.flags & ts.SymbolFlags.EnumMember) !== 0)); +} +function getStringLiteralUnionValues(type) { + if (!type.isUnion()) { + return undefined; + } + const isNullable = type.types.some((t) => (0, ast_utils_1.hasFlag)(t, ts.TypeFlags.Null)); + const members = type.types.filter((t) => !(0, ast_utils_1.hasFlag)(t, ts.TypeFlags.Null) && !(0, ast_utils_1.hasFlag)(t, ts.TypeFlags.Undefined)); + if (members.length === 0) { + return undefined; + } + if (members.every(isPlainStringLiteralType)) { + return { values: members.map((t) => t.value), isNullable }; + } + if (members.every(isPlainNumberLiteralType)) { + return { values: members.map((t) => t.value), isNullable }; + } + return undefined; +} +function extractTypeArgumentIfArray(type) { + if ((0, ast_utils_1.isArray)(type)) { + type = (0, ast_utils_1.getTypeArguments)(type)[0]; + if (!type) { + return undefined; + } + return { + type, + isArray: true + }; + } + return { + type, + isArray: false + }; +} +function isOptionalBoolean(text) { + return typeof text === 'string' && text === 'boolean | undefined'; +} +function convertPath(windowsPath) { + return windowsPath + .replace(/^\\\\\?\\/, '') + .replace(/\\/g, '/') + .replace(/\/\/+/g, '/'); +} +function safeDecodeURIComponent(path) { + try { + return decodeURIComponent(path); + } + catch (_a) { + return path; + } +} +function normalizePackagePath(importPath) { + const nodeModulesText = 'node_modules'; + const nodeModulePos = importPath.indexOf(nodeModulesText); + if (nodeModulePos < 0) { + return importPath; + } + let packagePath = importPath.slice(nodeModulePos + nodeModulesText.length + 1); + const typesText = '@types'; + const typesPos = packagePath.indexOf(typesText); + if (typesPos >= 0) { + packagePath = packagePath.slice(typesPos + typesText.length + 1); + } + const indexText = '/index'; + const indexPos = packagePath.indexOf(indexText); + if (indexPos >= 0) { + packagePath = packagePath.slice(0, indexPos); + } + return packagePath; +} +function canReferenceNode(node, options) { + var _a; + if (!options.readonly) { + return true; + } + if (ts.isCallExpression(node) || ts.isIdentifier(node)) { + return false; + } + if (ts.isNewExpression(node)) { + if (((_a = node.expression) === null || _a === void 0 ? void 0 : _a.escapedText) === 'Date') { + return true; + } + return false; + } + if (node.kind === ts.SyntaxKind.FalseKeyword || + node.kind === ts.SyntaxKind.TrueKeyword || + node.kind === ts.SyntaxKind.NullKeyword) { + return true; + } + if (ts.isNumericLiteral(node) || + ts.isPrefixUnaryExpression(node) || + ts.isStringLiteral(node)) { + return true; + } + return false; +} diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/type-reference-to-identifier.util.d.ts b/node_modules/@nestjs/swagger/dist/plugin/utils/type-reference-to-identifier.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ae9be329f0a5a4238de4f14f3bccb2be712597c9 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/type-reference-to-identifier.util.d.ts @@ -0,0 +1,7 @@ +import * as ts from 'typescript'; +import { PluginOptions } from '../merge-options'; +export declare function typeReferenceToIdentifier(typeReferenceDescriptor: { + typeName: string; + isArray?: boolean; + arrayDepth?: number; +}, hostFilename: string, options: PluginOptions, factory: ts.NodeFactory, type: ts.Type, typeImports: Record): ts.Identifier; diff --git a/node_modules/@nestjs/swagger/dist/plugin/utils/type-reference-to-identifier.util.js b/node_modules/@nestjs/swagger/dist/plugin/utils/type-reference-to-identifier.util.js new file mode 100644 index 0000000000000000000000000000000000000000..c4aeee78ba8e455db3c699189c1e004156ab870a --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/utils/type-reference-to-identifier.util.js @@ -0,0 +1,137 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeReferenceToIdentifier = typeReferenceToIdentifier; +const path_1 = require("path"); +const ts = __importStar(require("typescript")); +const plugin_debug_logger_1 = require("../plugin-debug-logger"); +const plugin_utils_1 = require("./plugin-utils"); +function typeReferenceToIdentifier(typeReferenceDescriptor, hostFilename, options, factory, type, typeImports) { + if (options.readonly) { + assertReferenceableType(type, typeReferenceDescriptor.typeName, hostFilename, options); + } + const { typeReference, importPath, typeName } = (0, plugin_utils_1.replaceImportPath)(typeReferenceDescriptor.typeName, hostFilename, options); + let identifier; + if (options.readonly && (typeReference === null || typeReference === void 0 ? void 0 : typeReference.includes('import'))) { + if (!typeImports[importPath]) { + typeImports[importPath] = typeReference; + } + let ref = `t["${importPath}"].${typeName}`; + if (typeReferenceDescriptor.isArray) { + ref = wrapTypeInArray(ref, typeReferenceDescriptor.arrayDepth); + } + identifier = factory.createIdentifier(ref); + } + else if (options.readonly && + !(typeReference === null || typeReference === void 0 ? void 0 : typeReference.includes('import')) && + isSameFileUserType(type, hostFilename)) { + const sameFileImportPath = buildSameFileImportPath(hostFilename, options); + const syntheticImportRef = `await import("${sameFileImportPath}")`; + if (!typeImports[sameFileImportPath]) { + typeImports[sameFileImportPath] = syntheticImportRef; + } + let ref = `t["${sameFileImportPath}"].${typeReferenceDescriptor.typeName}`; + if (typeReferenceDescriptor.isArray) { + ref = wrapTypeInArray(ref, typeReferenceDescriptor.arrayDepth); + } + identifier = factory.createIdentifier(ref); + } + else { + let ref = typeReference; + if (typeReferenceDescriptor.isArray) { + ref = wrapTypeInArray(ref, typeReferenceDescriptor.arrayDepth); + } + identifier = factory.createIdentifier(ref); + } + return identifier; +} +function isSameFileUserType(type, hostFilename) { + if (!type.symbol || !type.symbol.declarations) { + return false; + } + const normalizedHost = (0, plugin_utils_1.convertPath)(hostFilename); + return type.symbol.declarations.some((decl) => { + const declFile = (0, plugin_utils_1.convertPath)(decl.getSourceFile().fileName); + return (declFile === normalizedHost && !decl.getSourceFile().isDeclarationFile); + }); +} +function buildSameFileImportPath(hostFilename, options) { + const from = (0, plugin_utils_1.convertPath)(options.pathToSource); + const to = (0, plugin_utils_1.convertPath)(hostFilename).replace(/\.[jt]s$/, ''); + let relativePath = path_1.posix.relative(from, to); + if (relativePath[0] !== '.') { + relativePath = './' + relativePath; + } + if (options.esmCompatible) { + relativePath += (0, plugin_utils_1.getOutputExtension)(hostFilename); + } + return relativePath; +} +function wrapTypeInArray(typeRef, arrayDepth) { + for (let i = 0; i < arrayDepth; i++) { + typeRef = `[${typeRef}]`; + } + return typeRef; +} +function assertReferenceableType(type, parsedTypeName, hostFilename, options) { + var _a; + if (!type.symbol) { + return true; + } + if (parsedTypeName.includes('import')) { + return true; + } + if (!isSameFileUserType(type, hostFilename)) { + return true; + } + const declarations = (_a = type.symbol.declarations) !== null && _a !== void 0 ? _a : (type.symbol.valueDeclaration + ? [type.symbol.valueDeclaration] + : []); + const isExported = declarations.some((decl) => { + var _a; + if (!decl) + return false; + return (ts.canHaveModifiers(decl) && + ((_a = ts.getModifiers(decl)) === null || _a === void 0 ? void 0 : _a.some((mod) => mod.kind === ts.SyntaxKind.ExportKeyword))); + }); + if (isExported) { + return true; + } + const errorMessage = `Type "${parsedTypeName}" is not referenceable ("${hostFilename}"). To fix this, make sure to export this type.`; + if (options.debug) { + plugin_debug_logger_1.pluginDebugLogger.debug(errorMessage); + } + throw new Error(errorMessage); +} diff --git a/node_modules/@nestjs/swagger/dist/plugin/visitors/abstract.visitor.d.ts b/node_modules/@nestjs/swagger/dist/plugin/visitors/abstract.visitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a985324fc14d10d7b901b6c55cf80b4d87321de0 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/visitors/abstract.visitor.d.ts @@ -0,0 +1,4 @@ +import * as ts from 'typescript'; +export declare class AbstractFileVisitor { + updateImports(sourceFile: ts.SourceFile, factory: ts.NodeFactory | undefined, program: ts.Program): ts.SourceFile; +} diff --git a/node_modules/@nestjs/swagger/dist/plugin/visitors/abstract.visitor.js b/node_modules/@nestjs/swagger/dist/plugin/visitors/abstract.visitor.js new file mode 100644 index 0000000000000000000000000000000000000000..d1ace213a38b305039552cd6b804ea7051252238 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/visitors/abstract.visitor.js @@ -0,0 +1,63 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AbstractFileVisitor = void 0; +const ts = __importStar(require("typescript")); +const plugin_constants_1 = require("../plugin-constants"); +const [major, minor] = ts.versionMajorMinor.split('.').map((x) => +x); +class AbstractFileVisitor { + updateImports(sourceFile, factory, program) { + if (major <= 4 && minor < 8) { + throw new Error('Nest CLI plugin does not support TypeScript < v4.8'); + } + const importEqualsDeclaration = factory.createImportEqualsDeclaration(undefined, false, factory.createIdentifier(plugin_constants_1.OPENAPI_NAMESPACE), factory.createExternalModuleReference(factory.createStringLiteral(plugin_constants_1.OPENAPI_PACKAGE_NAME))); + const compilerOptions = program.getCompilerOptions(); + if (compilerOptions.module >= ts.ModuleKind.ES2015 && + compilerOptions.module <= ts.ModuleKind.ESNext) { + const importAsDeclaration = factory.createImportDeclaration(undefined, factory.createImportClause(false, undefined, factory.createNamespaceImport(factory.createIdentifier(plugin_constants_1.OPENAPI_NAMESPACE))), factory.createStringLiteral(plugin_constants_1.OPENAPI_PACKAGE_NAME), undefined); + return factory.updateSourceFile(sourceFile, [ + importAsDeclaration, + ...sourceFile.statements + ]); + } + else { + return factory.updateSourceFile(sourceFile, [ + importEqualsDeclaration, + ...sourceFile.statements + ]); + } + } +} +exports.AbstractFileVisitor = AbstractFileVisitor; diff --git a/node_modules/@nestjs/swagger/dist/plugin/visitors/controller-class.visitor.d.ts b/node_modules/@nestjs/swagger/dist/plugin/visitors/controller-class.visitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bd30399f0572746296b1a7f33d9fcd4e68d3d7b1 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/visitors/controller-class.visitor.d.ts @@ -0,0 +1,23 @@ +import * as ts from 'typescript'; +import { PluginOptions } from '../merge-options'; +import { AbstractFileVisitor } from './abstract.visitor'; +type ClassMetadata = Record; +export declare class ControllerClassVisitor extends AbstractFileVisitor { + private readonly _collectedMetadata; + private readonly _typeImports; + get typeImports(): Record; + collectedMetadata(options: PluginOptions): Array<[ts.CallExpression, Record]>; + visit(sourceFile: ts.SourceFile, ctx: ts.TransformationContext, program: ts.Program, options: PluginOptions): ts.Node; + addDecoratorToNode(factory: ts.NodeFactory, compilerNode: ts.MethodDeclaration, typeChecker: ts.TypeChecker, options: PluginOptions, sourceFile: ts.SourceFile, metadata: ClassMetadata): ts.MethodDeclaration; + createApiOperationDecorator(factory: ts.NodeFactory, node: ts.MethodDeclaration, decorators: readonly ts.Decorator[], options: PluginOptions, sourceFile: ts.SourceFile, typeChecker: ts.TypeChecker, metadata: ClassMetadata): ts.Decorator[]; + createApiResponseDecorator(factory: ts.NodeFactory, node: ts.MethodDeclaration, options: PluginOptions, metadata: ClassMetadata): ts.Decorator[]; + createApiQueryDecorators(factory: ts.NodeFactory, node: ts.MethodDeclaration, methodDecorators: readonly ts.Decorator[]): ts.Decorator[]; + private isParameterOptional; + createDecoratorObjectLiteralExpr(factory: ts.NodeFactory, node: ts.MethodDeclaration, typeChecker: ts.TypeChecker, existingProperties: ts.NodeArray, hostFilename: string, metadata: ClassMetadata, options: PluginOptions): ts.ObjectLiteralExpression; + createTypePropertyAssignment(factory: ts.NodeFactory, node: ts.MethodDeclaration, typeChecker: ts.TypeChecker, existingProperties: ts.NodeArray, hostFilename: string, options: PluginOptions): ts.PropertyAssignment; + createStatusPropertyAssignment(factory: ts.NodeFactory, node: ts.MethodDeclaration, existingProperties: ts.NodeArray): ts.PropertyAssignment; + getStatusCodeIdentifier(factory: ts.NodeFactory, node: ts.MethodDeclaration): any; + private normalizeImportPath; + private isSuccessOrRedirectApiResponseArg; +} +export {}; diff --git a/node_modules/@nestjs/swagger/dist/plugin/visitors/controller-class.visitor.js b/node_modules/@nestjs/swagger/dist/plugin/visitors/controller-class.visitor.js new file mode 100644 index 0000000000000000000000000000000000000000..5a172308f6895e19e468f3584fa983ecfa756e3c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/visitors/controller-class.visitor.js @@ -0,0 +1,431 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ControllerClassVisitor = void 0; +const common_1 = require("@nestjs/common"); +const lodash_1 = require("lodash"); +const path_1 = require("path"); +const ts = __importStar(require("typescript")); +const decorators_1 = require("../../decorators"); +const plugin_constants_1 = require("../plugin-constants"); +const ast_utils_1 = require("../utils/ast-utils"); +const plugin_utils_1 = require("../utils/plugin-utils"); +const type_reference_to_identifier_util_1 = require("../utils/type-reference-to-identifier.util"); +const abstract_visitor_1 = require("./abstract.visitor"); +class ControllerClassVisitor extends abstract_visitor_1.AbstractFileVisitor { + constructor() { + super(...arguments); + this._collectedMetadata = {}; + this._typeImports = {}; + } + get typeImports() { + return this._typeImports; + } + collectedMetadata(options) { + const metadataWithImports = []; + Object.keys(this._collectedMetadata).forEach((filePath) => { + const metadata = this._collectedMetadata[filePath]; + const fileExt = options.esmCompatible ? (0, plugin_utils_1.getOutputExtension)(filePath) : ''; + let path = filePath.replace(/\.[jt]s$/, fileExt); + path = (0, plugin_utils_1.normalizePackagePath)(path); + const importExpr = ts.factory.createCallExpression(ts.factory.createToken(ts.SyntaxKind.ImportKeyword), undefined, [ts.factory.createStringLiteral(path)]); + metadataWithImports.push([importExpr, metadata]); + }); + return metadataWithImports; + } + visit(sourceFile, ctx, program, options) { + const typeChecker = program.getTypeChecker(); + if (!options.readonly) { + sourceFile = this.updateImports(sourceFile, ctx.factory, program); + } + const visitNode = (node) => { + var _a; + if (ts.isMethodDeclaration(node)) { + try { + const metadata = {}; + const updatedNode = this.addDecoratorToNode(ctx.factory, node, typeChecker, options, sourceFile, metadata); + if (!options.readonly) { + return updatedNode; + } + else { + const filePath = this.normalizeImportPath(options.pathToSource, sourceFile.fileName); + if (!this._collectedMetadata[filePath]) { + this._collectedMetadata[filePath] = {}; + } + const parent = node.parent; + const clsName = (_a = parent.name) === null || _a === void 0 ? void 0 : _a.getText(); + if (clsName) { + if (!this._collectedMetadata[filePath][clsName]) { + this._collectedMetadata[filePath][clsName] = {}; + } + Object.assign(this._collectedMetadata[filePath][clsName], metadata); + } + } + } + catch (_b) { + if (!options.readonly) { + return node; + } + } + } + if (options.readonly) { + ts.forEachChild(node, visitNode); + } + else { + return ts.visitEachChild(node, visitNode, ctx); + } + }; + return ts.visitNode(sourceFile, visitNode); + } + addDecoratorToNode(factory, compilerNode, typeChecker, options, sourceFile, metadata) { + var _a; + const hostFilename = sourceFile.fileName; + const decorators = ts.canHaveDecorators(compilerNode) && ts.getDecorators(compilerNode); + if (!decorators) { + return compilerNode; + } + const apiOperationDecoratorsArray = this.createApiOperationDecorator(factory, compilerNode, decorators, options, sourceFile, typeChecker, metadata); + const apiResponseDecoratorsArray = this.createApiResponseDecorator(factory, compilerNode, options, metadata); + const apiQueryDecoratorsArray = this.createApiQueryDecorators(factory, compilerNode, decorators); + const removeExistingApiOperationDecorator = apiOperationDecoratorsArray.length > 0; + const existingDecorators = removeExistingApiOperationDecorator + ? decorators.filter((item) => (0, ast_utils_1.getDecoratorName)(item) !== decorators_1.ApiOperation.name) + : decorators; + const hasExplicitApiResponseDecorator = decorators.some((item) => { + try { + const decoratorName = (0, ast_utils_1.getDecoratorName)(item); + if (decoratorName === decorators_1.ApiResponse.name) { + return this.isSuccessOrRedirectApiResponseArg(item); + } + const statusNameMatch = decoratorName.match(/^Api(.+)Response$/); + if (!statusNameMatch) + return false; + const statusKey = statusNameMatch[1] + .replace(/([a-z0-9])([A-Z])/g, '$1_$2') + .toUpperCase(); + const status = Number(common_1.HttpStatus[statusKey]); + return isNaN(status) || status < 400; + } + catch (_a) { + return false; + } + }); + const modifiers = (_a = ts.getModifiers(compilerNode)) !== null && _a !== void 0 ? _a : []; + const objectLiteralExpr = this.createDecoratorObjectLiteralExpr(factory, compilerNode, typeChecker, factory.createNodeArray(), hostFilename, metadata, options); + const autoGeneratedApiResponseDecorators = hasExplicitApiResponseDecorator + ? [] + : [ + factory.createDecorator(factory.createCallExpression(factory.createIdentifier(`${plugin_constants_1.OPENAPI_NAMESPACE}.${decorators_1.ApiResponse.name}`), undefined, [ + factory.createObjectLiteralExpression(objectLiteralExpr.properties) + ])) + ]; + const updatedDecorators = [ + ...apiOperationDecoratorsArray, + ...apiResponseDecoratorsArray, + ...apiQueryDecoratorsArray, + ...existingDecorators, + ...autoGeneratedApiResponseDecorators + ]; + if (!options.readonly) { + return factory.updateMethodDeclaration(compilerNode, [...updatedDecorators, ...modifiers], compilerNode.asteriskToken, compilerNode.name, compilerNode.questionToken, compilerNode.typeParameters, compilerNode.parameters, compilerNode.type, compilerNode.body); + } + else { + return compilerNode; + } + } + createApiOperationDecorator(factory, node, decorators, options, sourceFile, typeChecker, metadata) { + if (!options.introspectComments) { + return []; + } + const apiOperationDecorator = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)([decorators_1.ApiOperation.name], decorators, factory); + let apiOperationExistingProps = undefined; + if (apiOperationDecorator && !options.readonly) { + const apiOperationExpr = (0, lodash_1.head)((0, ast_utils_1.getDecoratorArguments)(apiOperationDecorator)); + if (apiOperationExpr) { + apiOperationExistingProps = + apiOperationExpr.properties; + } + } + const extractedComments = (0, ast_utils_1.getMainCommentOfNode)(node); + if (!extractedComments) { + return []; + } + const properties = [ + ...(apiOperationExistingProps !== null && apiOperationExistingProps !== void 0 ? apiOperationExistingProps : factory.createNodeArray()) + ]; + const tags = (0, ast_utils_1.getTsDocTagsOfNode)(node, typeChecker); + const existingPropsArray = factory.createNodeArray(apiOperationExistingProps); + const hasRemarksKey = (0, plugin_utils_1.hasPropertyKey)('description', existingPropsArray); + const unshiftIfNotExisting = (key, value) => { + if ((0, plugin_utils_1.hasPropertyKey)(key, existingPropsArray)) { + return; + } + properties.unshift(factory.createPropertyAssignment(key, factory.createStringLiteral(value))); + }; + if (!hasRemarksKey && tags.remarks) { + const remarksPropertyAssignment = factory.createPropertyAssignment('description', (0, ast_utils_1.createLiteralFromAnyValue)(factory, tags.remarks)); + properties.push(remarksPropertyAssignment); + if (options.controllerKeyOfComment === 'description') { + unshiftIfNotExisting('summary', extractedComments); + } + else { + unshiftIfNotExisting(options.controllerKeyOfComment, extractedComments); + } + } + else { + unshiftIfNotExisting(options.controllerKeyOfComment, extractedComments); + } + const hasDeprecatedKey = (0, plugin_utils_1.hasPropertyKey)('deprecated', factory.createNodeArray(apiOperationExistingProps)); + if (!hasDeprecatedKey && tags.deprecated) { + const deprecatedPropertyAssignment = factory.createPropertyAssignment('deprecated', (0, ast_utils_1.createLiteralFromAnyValue)(factory, tags.deprecated)); + properties.push(deprecatedPropertyAssignment); + } + const objectLiteralExpr = factory.createObjectLiteralExpression((0, lodash_1.compact)(properties)); + const apiOperationDecoratorArguments = factory.createNodeArray([objectLiteralExpr]); + const methodKey = node.name.getText(); + if (metadata[methodKey]) { + const existingObjectLiteralExpr = metadata[methodKey]; + const existingProperties = existingObjectLiteralExpr.properties; + const updatedProperties = factory.createNodeArray([ + ...existingProperties, + ...(0, lodash_1.compact)(properties) + ]); + const updatedObjectLiteralExpr = factory.createObjectLiteralExpression(updatedProperties); + metadata[methodKey] = updatedObjectLiteralExpr; + } + else { + metadata[methodKey] = objectLiteralExpr; + } + if (apiOperationDecorator) { + const expr = apiOperationDecorator.expression; + const updatedCallExpr = factory.updateCallExpression(expr, expr.expression, undefined, apiOperationDecoratorArguments); + return [factory.updateDecorator(apiOperationDecorator, updatedCallExpr)]; + } + else { + return [ + factory.createDecorator(factory.createCallExpression(factory.createIdentifier(`${plugin_constants_1.OPENAPI_NAMESPACE}.${decorators_1.ApiOperation.name}`), undefined, apiOperationDecoratorArguments)) + ]; + } + } + createApiResponseDecorator(factory, node, options, metadata) { + if (!options.introspectComments) { + return []; + } + const tags = (0, ast_utils_1.getTsDocErrorsOfNode)(node); + if (!tags.length) { + return []; + } + return tags.map((tag) => { + const properties = []; + properties.push(factory.createPropertyAssignment('status', factory.createNumericLiteral(tag.status))); + properties.push(factory.createPropertyAssignment('description', factory.createStringLiteral(tag.description))); + const objectLiteralExpr = factory.createObjectLiteralExpression((0, lodash_1.compact)(properties)); + const methodKey = node.name.getText(); + metadata[methodKey] = objectLiteralExpr; + const apiResponseDecoratorArguments = factory.createNodeArray([objectLiteralExpr]); + return factory.createDecorator(factory.createCallExpression(factory.createIdentifier(`${plugin_constants_1.OPENAPI_NAMESPACE}.${decorators_1.ApiResponse.name}`), undefined, apiResponseDecoratorArguments)); + }); + } + createApiQueryDecorators(factory, node, methodDecorators) { + const parameters = node.parameters; + if (!parameters || parameters.length === 0) { + return []; + } + const existingApiQueryNames = new Set(); + for (const decorator of methodDecorators) { + let decoratorName; + try { + decoratorName = (0, ast_utils_1.getDecoratorName)(decorator); + } + catch (_a) { + continue; + } + if (decoratorName !== decorators_1.ApiQuery.name) { + continue; + } + const optionsExpr = (0, lodash_1.head)((0, ast_utils_1.getDecoratorArguments)(decorator)); + if (!optionsExpr || !ts.isObjectLiteralExpression(optionsExpr)) { + return []; + } + const nameProp = optionsExpr.properties.find((p) => ts.isPropertyAssignment(p) && + p.name !== undefined && + ((ts.isIdentifier(p.name) && p.name.text === 'name') || + (ts.isStringLiteral(p.name) && p.name.text === 'name'))); + if (nameProp && ts.isStringLiteral(nameProp.initializer)) { + existingApiQueryNames.add(nameProp.initializer.text); + } + else { + return []; + } + } + const generated = []; + for (const parameter of parameters) { + const paramDecorators = (ts.canHaveDecorators(parameter) && ts.getDecorators(parameter)) || []; + const queryDecorator = paramDecorators.find((d) => { + try { + return (0, ast_utils_1.getDecoratorName)(d) === 'Query'; + } + catch (_a) { + return false; + } + }); + if (!queryDecorator) { + continue; + } + const firstArg = (0, lodash_1.head)((0, ast_utils_1.getDecoratorArguments)(queryDecorator)); + if (!firstArg || !ts.isStringLiteral(firstArg)) { + continue; + } + const queryName = firstArg.text; + if (existingApiQueryNames.has(queryName)) { + continue; + } + if (!this.isParameterOptional(parameter)) { + continue; + } + const objectLiteral = factory.createObjectLiteralExpression([ + factory.createPropertyAssignment('name', factory.createStringLiteral(queryName)), + factory.createPropertyAssignment('required', factory.createFalse()) + ], false); + generated.push(factory.createDecorator(factory.createCallExpression(factory.createIdentifier(`${plugin_constants_1.OPENAPI_NAMESPACE}.${decorators_1.ApiQuery.name}`), undefined, [objectLiteral]))); + existingApiQueryNames.add(queryName); + } + return generated; + } + isParameterOptional(parameter) { + if (parameter.questionToken) { + return true; + } + if (parameter.initializer) { + return true; + } + if (parameter.type && ts.isUnionTypeNode(parameter.type)) { + return parameter.type.types.some((t) => t.kind === ts.SyntaxKind.UndefinedKeyword); + } + return false; + } + createDecoratorObjectLiteralExpr(factory, node, typeChecker, existingProperties = factory.createNodeArray(), hostFilename, metadata, options) { + let properties = []; + if (!options.readonly && !options.skipAutoHttpCode) { + properties = properties.concat(existingProperties, this.createStatusPropertyAssignment(factory, node, existingProperties)); + } + properties = properties.concat([ + this.createTypePropertyAssignment(factory, node, typeChecker, existingProperties, hostFilename, options) + ]); + const objectLiteralExpr = factory.createObjectLiteralExpression((0, lodash_1.compact)(properties)); + const methodKey = node.name.getText(); + const existingExprOrUndefined = metadata[methodKey]; + if (existingExprOrUndefined) { + const existingProperties = existingExprOrUndefined.properties; + const updatedProperties = factory.createNodeArray([ + ...existingProperties, + ...(0, lodash_1.compact)(properties) + ]); + const updatedObjectLiteralExpr = factory.createObjectLiteralExpression(updatedProperties); + metadata[methodKey] = updatedObjectLiteralExpr; + } + else { + metadata[methodKey] = objectLiteralExpr; + } + return objectLiteralExpr; + } + createTypePropertyAssignment(factory, node, typeChecker, existingProperties, hostFilename, options) { + if ((0, plugin_utils_1.hasPropertyKey)('type', existingProperties)) { + return undefined; + } + const signature = typeChecker.getSignatureFromDeclaration(node); + const type = typeChecker.getReturnTypeOfSignature(signature); + if (!type) { + return undefined; + } + const typeReferenceDescriptor = (0, plugin_utils_1.getTypeReferenceAsString)(type, typeChecker); + if (!typeReferenceDescriptor.typeName) { + return undefined; + } + if (typeReferenceDescriptor.typeName.includes('node_modules')) { + return undefined; + } + const identifier = (0, type_reference_to_identifier_util_1.typeReferenceToIdentifier)(typeReferenceDescriptor, hostFilename, options, factory, type, this._typeImports); + return factory.createPropertyAssignment('type', identifier); + } + createStatusPropertyAssignment(factory, node, existingProperties) { + if ((0, plugin_utils_1.hasPropertyKey)('status', existingProperties)) { + return undefined; + } + const statusNode = this.getStatusCodeIdentifier(factory, node); + return factory.createPropertyAssignment('status', statusNode); + } + getStatusCodeIdentifier(factory, node) { + const decorators = ts.canHaveDecorators(node) && ts.getDecorators(node); + const httpCodeDecorator = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)(['HttpCode'], decorators, factory); + if (httpCodeDecorator) { + const argument = (0, lodash_1.head)((0, ast_utils_1.getDecoratorArguments)(httpCodeDecorator)); + if (argument) { + return argument; + } + } + const postDecorator = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)(['Post'], decorators, factory); + if (postDecorator) { + return factory.createIdentifier('201'); + } + return factory.createIdentifier('200'); + } + normalizeImportPath(pathToSource, path) { + let relativePath = path_1.posix.relative((0, plugin_utils_1.convertPath)(pathToSource), (0, plugin_utils_1.convertPath)(path)); + relativePath = relativePath[0] !== '.' ? './' + relativePath : relativePath; + return relativePath; + } + isSuccessOrRedirectApiResponseArg(decorator) { + const [firstArg] = (0, ast_utils_1.getDecoratorArguments)(decorator); + if (!firstArg || !ts.isObjectLiteralExpression(firstArg)) + return true; + const statusProp = firstArg.properties.find((p) => ts.isPropertyAssignment(p) && + ts.isIdentifier(p.name) && + p.name.text === 'status'); + if (!statusProp) + return true; + const init = statusProp.initializer; + if (ts.isNumericLiteral(init)) + return Number(init.text) < 400; + if (ts.isStringLiteral(init)) { + return (init.text === '1XX' || + init.text === '2XX' || + init.text === '3XX' || + init.text === 'default'); + } + return true; + } +} +exports.ControllerClassVisitor = ControllerClassVisitor; diff --git a/node_modules/@nestjs/swagger/dist/plugin/visitors/model-class.visitor.d.ts b/node_modules/@nestjs/swagger/dist/plugin/visitors/model-class.visitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f9f77c00d045ed27a5f72805522ceb5b909977e --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/visitors/model-class.visitor.d.ts @@ -0,0 +1,37 @@ +import * as ts from 'typescript'; +import { PropertyAssignment } from 'typescript'; +import { PluginOptions } from '../merge-options'; +import { AbstractFileVisitor } from './abstract.visitor'; +type ClassMetadata = Record; +export declare class ModelClassVisitor extends AbstractFileVisitor { + private readonly _typeImports; + private readonly _collectedMetadata; + get typeImports(): Record; + collectedMetadata(options: PluginOptions): Array<[ts.CallExpression, Record]>; + visit(sourceFile: ts.SourceFile, ctx: ts.TransformationContext, program: ts.Program, options: PluginOptions): ts.Node; + visitPropertyNodeDeclaration(node: ts.PropertyDeclaration, ctx: ts.TransformationContext, typeChecker: ts.TypeChecker, options: PluginOptions, sourceFile: ts.SourceFile, metadata: ClassMetadata): ts.PropertyDeclaration; + visitConstructorDeclarationNode(constructorNode: ts.ConstructorDeclaration, typeChecker: ts.TypeChecker, options: PluginOptions, sourceFile: ts.SourceFile, metadata: ClassMetadata): void; + addMetadataFactory(factory: ts.NodeFactory, node: ts.ClassDeclaration, classMetadata: ClassMetadata, sourceFile: ts.SourceFile, options: PluginOptions): ts.ClassDeclaration; + inspectPropertyDeclaration(factory: ts.NodeFactory, compilerNode: ts.PropertyDeclaration, typeChecker: ts.TypeChecker, options: PluginOptions, hostFilename: string, sourceFile: ts.SourceFile, metadata: ClassMetadata): void; + createDecoratorObjectLiteralExpr(factory: ts.NodeFactory, node: ts.PropertyDeclaration | ts.PropertySignature | ts.ParameterDeclaration, typeChecker: ts.TypeChecker, existingProperties?: ts.NodeArray, options?: PluginOptions, hostFilename?: string, sourceFile?: ts.SourceFile): ts.ObjectLiteralExpression; + private createRecordTypePropertyAssignment; + private createTypePropertyAssignments; + createInitializerForArrayLiteralTypeNode(node: ts.ArrayTypeNode, factory: ts.NodeFactory, typeChecker: ts.TypeChecker, existingProperties: ts.NodeArray, hostFilename: string, options: PluginOptions): ts.ArrowFunction; + createInitializerForTypeLiteralNode(node: ts.TypeLiteralNode, factory: ts.NodeFactory, typeChecker: ts.TypeChecker, existingProperties: ts.NodeArray, hostFilename: string, options: PluginOptions): ts.ArrowFunction; + isNullableUnion(node: ts.UnionTypeNode): { + nullableType: ts.TypeNode; + isNullable: boolean; + }; + createEnumPropertyAssignment(factory: ts.NodeFactory, node: ts.PropertyDeclaration | ts.PropertySignature | ts.ParameterDeclaration, typeChecker: ts.TypeChecker, existingProperties: ts.NodeArray, hostFilename: string, options: PluginOptions): ts.PropertyAssignment | ts.PropertyAssignment[]; + createDefaultPropertyAssignment(factory: ts.NodeFactory, node: ts.PropertyDeclaration | ts.PropertySignature | ts.ParameterDeclaration, existingProperties: ts.NodeArray, options: PluginOptions): ts.PropertyAssignment; + createValidationPropertyAssignments(factory: ts.NodeFactory, node: ts.PropertyDeclaration | ts.PropertySignature, options: PluginOptions): ts.PropertyAssignment[]; + addPropertyByValidationDecorator(factory: ts.NodeFactory, decoratorName: string, propertyKey: string, decorators: readonly ts.Decorator[], assignments: ts.PropertyAssignment[], options: PluginOptions): void; + addPropertiesByValidationDecorator(factory: ts.NodeFactory, decoratorName: string, decorators: readonly ts.Decorator[], assignments: ts.PropertyAssignment[], addPropertyAssignments: (decoratorRef: ts.Decorator) => PropertyAssignment[]): void; + private isEachOptionEnabled; + addClassMetadata(node: ts.PropertyDeclaration, objectLiteral: ts.ObjectLiteralExpression, sourceFile: ts.SourceFile, metadata: ClassMetadata): void; + createDescriptionAndTsDocTagPropertyAssignments(factory: ts.NodeFactory, node: ts.PropertyDeclaration | ts.PropertySignature | ts.ParameterDeclaration, typeChecker: ts.TypeChecker, existingProperties?: ts.NodeArray, options?: PluginOptions, sourceFile?: ts.SourceFile): ts.PropertyAssignment[]; + private normalizeImportPath; + private clonePrimitiveLiteral; + private getInitializerPrimitiveTypeName; +} +export {}; diff --git a/node_modules/@nestjs/swagger/dist/plugin/visitors/model-class.visitor.js b/node_modules/@nestjs/swagger/dist/plugin/visitors/model-class.visitor.js new file mode 100644 index 0000000000000000000000000000000000000000..8b45c9ef54614e757dae0ac89c5004ce5c5d1e20 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/visitors/model-class.visitor.js @@ -0,0 +1,649 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ModelClassVisitor = void 0; +const lodash_1 = require("lodash"); +const path_1 = require("path"); +const ts = __importStar(require("typescript")); +const typescript_1 = require("typescript"); +const decorators_1 = require("../../decorators"); +const decorators_properties_1 = require("../../services/decorators-properties"); +const plugin_constants_1 = require("../plugin-constants"); +const plugin_debug_logger_1 = require("../plugin-debug-logger"); +const ast_utils_1 = require("../utils/ast-utils"); +const plugin_utils_1 = require("../utils/plugin-utils"); +const type_reference_to_identifier_util_1 = require("../utils/type-reference-to-identifier.util"); +const abstract_visitor_1 = require("./abstract.visitor"); +class ModelClassVisitor extends abstract_visitor_1.AbstractFileVisitor { + constructor() { + super(...arguments); + this._typeImports = {}; + this._collectedMetadata = {}; + } + get typeImports() { + return this._typeImports; + } + collectedMetadata(options) { + const metadataWithImports = []; + Object.keys(this._collectedMetadata).forEach((filePath) => { + const metadata = this._collectedMetadata[filePath]; + const fileExt = options.esmCompatible ? (0, plugin_utils_1.getOutputExtension)(filePath) : ''; + let path = filePath.replace(/\.[jt]s$/, fileExt); + path = (0, plugin_utils_1.normalizePackagePath)(path); + const importExpr = ts.factory.createCallExpression(ts.factory.createToken(ts.SyntaxKind.ImportKeyword), undefined, [ts.factory.createStringLiteral(path)]); + metadataWithImports.push([importExpr, metadata]); + }); + return metadataWithImports; + } + visit(sourceFile, ctx, program, options) { + const typeChecker = program.getTypeChecker(); + sourceFile = this.updateImports(sourceFile, ctx.factory, program); + const propertyNodeVisitorFactory = (metadata) => (node) => { + const visit = () => { + if (ts.isPropertyDeclaration(node)) { + this.visitPropertyNodeDeclaration(node, ctx, typeChecker, options, sourceFile, metadata); + } + else if (options.parameterProperties && + ts.isConstructorDeclaration(node)) { + this.visitConstructorDeclarationNode(node, typeChecker, options, sourceFile, metadata); + } + return node; + }; + const visitedNode = visit(); + if (!options.readonly) { + return visitedNode; + } + }; + const visitClassNode = (node) => { + var _a; + if (ts.isClassDeclaration(node)) { + const metadata = {}; + const isExported = (_a = node.modifiers) === null || _a === void 0 ? void 0 : _a.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword); + if (options.readonly) { + if (isExported) { + ts.forEachChild(node, propertyNodeVisitorFactory(metadata)); + } + else { + if (options.debug) { + plugin_debug_logger_1.pluginDebugLogger.debug(`Skipping class "${node.name.getText()}" because it's not exported.`); + } + } + } + else { + node = ts.visitEachChild(node, propertyNodeVisitorFactory(metadata), ctx); + } + if ((isExported && options.readonly) || !options.readonly) { + const declaration = this.addMetadataFactory(ctx.factory, node, metadata, sourceFile, options); + if (!options.readonly) { + return declaration; + } + } + } + if (options.readonly) { + ts.forEachChild(node, visitClassNode); + } + else { + return ts.visitEachChild(node, visitClassNode, ctx); + } + }; + return ts.visitNode(sourceFile, visitClassNode); + } + visitPropertyNodeDeclaration(node, ctx, typeChecker, options, sourceFile, metadata) { + const isPropertyStatic = (node.modifiers || []).some((modifier) => modifier.kind === ts.SyntaxKind.StaticKeyword); + if (isPropertyStatic) { + return node; + } + const isPrivateProperty = ts.isPrivateIdentifier(node.name); + if (isPrivateProperty) { + return node; + } + const decorators = ts.canHaveDecorators(node) && ts.getDecorators(node); + const classTransformerShim = options.classTransformerShim; + const hidePropertyDecoratorExists = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)(classTransformerShim + ? [decorators_1.ApiHideProperty.name, 'Exclude'] + : [decorators_1.ApiHideProperty.name], decorators, typescript_1.factory); + const annotatePropertyDecoratorExists = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)(classTransformerShim ? [decorators_1.ApiProperty.name, 'Expose'] : [decorators_1.ApiProperty.name], decorators, typescript_1.factory); + if (!annotatePropertyDecoratorExists && + (hidePropertyDecoratorExists || classTransformerShim === 'exclusive')) { + return node; + } + else if (annotatePropertyDecoratorExists && hidePropertyDecoratorExists) { + if (options.debug) { + plugin_debug_logger_1.pluginDebugLogger.debug(`"${node.parent.name.getText()}->${node.name.getText()}" has conflicting decorators, excluding as @ApiHideProperty() takes priority.`); + } + return node; + } + try { + this.inspectPropertyDeclaration(ctx.factory, node, typeChecker, options, sourceFile.fileName, sourceFile, metadata); + } + catch (err) { + return node; + } + } + visitConstructorDeclarationNode(constructorNode, typeChecker, options, sourceFile, metadata) { + constructorNode.forEachChild((node) => { + if (ts.isParameter(node) && + node.modifiers != null && + node.modifiers.some((modifier) => modifier.kind === ts.SyntaxKind.ReadonlyKeyword || + modifier.kind === ts.SyntaxKind.PrivateKeyword || + modifier.kind === ts.SyntaxKind.PublicKeyword || + modifier.kind === ts.SyntaxKind.ProtectedKeyword)) { + const objectLiteralExpr = this.createDecoratorObjectLiteralExpr(typescript_1.factory, node, typeChecker, typescript_1.factory.createNodeArray(), options, sourceFile.fileName, sourceFile); + const propertyName = node.name.getText(); + metadata[propertyName] = objectLiteralExpr; + } + }); + } + addMetadataFactory(factory, node, classMetadata, sourceFile, options) { + const returnValue = factory.createObjectLiteralExpression(Object.keys(classMetadata).map((key) => factory.createPropertyAssignment(factory.createIdentifier(key), classMetadata[key]))); + if (options.readonly) { + const filePath = this.normalizeImportPath(options.pathToSource, sourceFile.fileName); + if (!this._collectedMetadata[filePath]) { + this._collectedMetadata[filePath] = {}; + } + const attributeKey = node.name.getText(); + this._collectedMetadata[filePath][attributeKey] = returnValue; + return; + } + const method = factory.createMethodDeclaration([factory.createModifier(ts.SyntaxKind.StaticKeyword)], undefined, factory.createIdentifier(plugin_constants_1.METADATA_FACTORY_NAME), undefined, undefined, [], undefined, factory.createBlock([factory.createReturnStatement(returnValue)], true)); + return factory.updateClassDeclaration(node, node.modifiers, node.name, node.typeParameters, node.heritageClauses, [...node.members, method]); + } + inspectPropertyDeclaration(factory, compilerNode, typeChecker, options, hostFilename, sourceFile, metadata) { + const objectLiteralExpr = this.createDecoratorObjectLiteralExpr(factory, compilerNode, typeChecker, factory.createNodeArray(), options, hostFilename, sourceFile); + this.addClassMetadata(compilerNode, objectLiteralExpr, sourceFile, metadata); + } + createDecoratorObjectLiteralExpr(factory, node, typeChecker, existingProperties = factory.createNodeArray(), options = {}, hostFilename = '', sourceFile) { + const isRequired = !node.questionToken; + const properties = [ + ...existingProperties, + !(0, plugin_utils_1.hasPropertyKey)('required', existingProperties) && + factory.createPropertyAssignment('required', (0, ast_utils_1.createBooleanLiteral)(factory, isRequired)), + ...this.createTypePropertyAssignments(factory, node.type, typeChecker, existingProperties, hostFilename, options), + ...this.createDescriptionAndTsDocTagPropertyAssignments(factory, node, typeChecker, existingProperties, options, sourceFile), + this.createDefaultPropertyAssignment(factory, node, existingProperties, options), + this.createEnumPropertyAssignment(factory, node, typeChecker, existingProperties, hostFilename, options) + ]; + if ((ts.isPropertyDeclaration(node) || ts.isPropertySignature(node)) && + options.classValidatorShim) { + properties.push(this.createValidationPropertyAssignments(factory, node, options)); + } + return factory.createObjectLiteralExpression((0, lodash_1.compact)((0, lodash_1.flatten)(properties))); + } + createRecordTypePropertyAssignment(factory, recordValueType, typeChecker) { + const additionalPropertiesExpr = (0, plugin_utils_1.createAdditionalPropertiesValueSchema)(recordValueType, typeChecker, factory); + return [ + factory.createPropertyAssignment('type', factory.createStringLiteral('object')), + factory.createPropertyAssignment('additionalProperties', additionalPropertiesExpr) + ]; + } + createTypePropertyAssignments(factory, node, typeChecker, existingProperties, hostFilename, options) { + const key = 'type'; + if ((0, plugin_utils_1.hasPropertyKey)(key, existingProperties)) { + return []; + } + if (node) { + if (ts.isArrayTypeNode(node) && ts.isTypeLiteralNode(node.elementType)) { + const initializer = this.createInitializerForArrayLiteralTypeNode(node, factory, typeChecker, existingProperties, hostFilename, options); + return [factory.createPropertyAssignment(key, initializer)]; + } + if (ts.isTypeLiteralNode(node) && + node.members.length > 0 && + node.members.every(ts.isIndexSignatureDeclaration)) { + const literalType = typeChecker.getTypeAtLocation(node); + const recordValueType = (0, plugin_utils_1.getRecordValueType)(literalType, typeChecker); + if (recordValueType) { + return this.createRecordTypePropertyAssignment(factory, recordValueType, typeChecker); + } + } + if (ts.isTypeLiteralNode(node)) { + const initializer = this.createInitializerForTypeLiteralNode(node, factory, typeChecker, existingProperties, hostFilename, options); + return [factory.createPropertyAssignment(key, initializer)]; + } + if (ts.isUnionTypeNode(node)) { + const { nullableType, isNullable } = this.isNullableUnion(node); + const remainingTypes = node.types.filter((t) => t !== nullableType); + if (remainingTypes.length === 1) { + const nonNullishNode = remainingTypes[0]; + const resolved = typeChecker.getTypeAtLocation(nonNullishNode); + let candidateType = resolved; + const arrayTuple = (0, plugin_utils_1.extractTypeArgumentIfArray)(candidateType); + if (arrayTuple) { + candidateType = arrayTuple.type; + } + let isEnumType = false; + if (candidateType) { + if ((0, ast_utils_1.isEnum)(candidateType)) { + isEnumType = true; + } + else { + const maybeEnum = (0, plugin_utils_1.isAutoGeneratedEnumUnion)(candidateType, typeChecker); + if (maybeEnum || (0, plugin_utils_1.getStringLiteralUnionValues)(candidateType)) { + isEnumType = true; + } + } + } + if (isEnumType) { + return isNullable + ? [ + factory.createPropertyAssignment('nullable', (0, ast_utils_1.createBooleanLiteral)(factory, true)) + ] + : []; + } + const propertyAssignments = this.createTypePropertyAssignments(factory, nonNullishNode, typeChecker, existingProperties, hostFilename, options); + if (!isNullable) { + return propertyAssignments; + } + return [ + ...propertyAssignments, + factory.createPropertyAssignment('nullable', (0, ast_utils_1.createBooleanLiteral)(factory, true)) + ]; + } + } + } + const type = typeChecker.getTypeAtLocation(node); + if (!type) { + return []; + } + const stringLiteralUnion = (0, plugin_utils_1.getStringLiteralUnionValues)(type); + if (stringLiteralUnion) { + if (stringLiteralUnion.isNullable && + !(0, plugin_utils_1.hasPropertyKey)('nullable', existingProperties)) { + return [ + factory.createPropertyAssignment('nullable', (0, ast_utils_1.createBooleanLiteral)(factory, true)) + ]; + } + return []; + } + const recordValueType = (0, plugin_utils_1.getRecordValueType)(type, typeChecker); + if (recordValueType) { + return this.createRecordTypePropertyAssignment(factory, recordValueType, typeChecker); + } + const typeReferenceDescriptor = (0, plugin_utils_1.getTypeReferenceAsString)(type, typeChecker); + if (!typeReferenceDescriptor.typeName) { + return []; + } + const identifier = (0, type_reference_to_identifier_util_1.typeReferenceToIdentifier)(typeReferenceDescriptor, hostFilename, options, factory, type, this._typeImports); + const initializer = factory.createArrowFunction(undefined, undefined, [], undefined, undefined, identifier); + return [factory.createPropertyAssignment(key, initializer)]; + } + createInitializerForArrayLiteralTypeNode(node, factory, typeChecker, existingProperties, hostFilename, options) { + const elementType = node.elementType; + const propertyAssignments = Array.from(elementType.members || []).map((member) => { + const literalExpr = this.createDecoratorObjectLiteralExpr(factory, member, typeChecker, existingProperties, options, hostFilename); + return factory.createPropertyAssignment(factory.createIdentifier(member.name.getText()), literalExpr); + }); + const initializer = factory.createArrowFunction(undefined, undefined, [], undefined, undefined, factory.createArrayLiteralExpression([ + factory.createParenthesizedExpression(factory.createObjectLiteralExpression(propertyAssignments)) + ])); + return initializer; + } + createInitializerForTypeLiteralNode(node, factory, typeChecker, existingProperties, hostFilename, options) { + const propertyAssignments = Array.from(node.members || []).map((member) => { + const literalExpr = this.createDecoratorObjectLiteralExpr(factory, member, typeChecker, existingProperties, options, hostFilename); + return factory.createPropertyAssignment(factory.createIdentifier(member.name.getText()), literalExpr); + }); + const initializer = factory.createArrowFunction(undefined, undefined, [], undefined, undefined, factory.createParenthesizedExpression(factory.createObjectLiteralExpression(propertyAssignments))); + return initializer; + } + isNullableUnion(node) { + const nullableType = node.types.find((type) => type.kind === ts.SyntaxKind.NullKeyword || + (ts.SyntaxKind.LiteralType && type.getText() === 'null')); + const isNullable = !!nullableType; + return { nullableType, isNullable }; + } + createEnumPropertyAssignment(factory, node, typeChecker, existingProperties, hostFilename, options) { + const key = 'enum'; + if ((0, plugin_utils_1.hasPropertyKey)(key, existingProperties)) { + return undefined; + } + let type; + try { + if (node.type) { + type = typeChecker.getTypeFromTypeNode(node.type); + } + } + catch (e) { + } + if (!type) { + type = typeChecker.getTypeAtLocation(node); + } + if (!type) { + return undefined; + } + if ((type.flags & ts.TypeFlags.Union) !== 0) { + const union = type; + const nonNullish = union.types.filter((t) => (t.flags & (ts.TypeFlags.Null | ts.TypeFlags.Undefined)) === 0); + if (nonNullish.length === 1) { + type = nonNullish[0]; + } + } + if ((0, plugin_utils_1.isAutoGeneratedTypeUnion)(type)) { + const types = type.types; + const nonUndefined = types.find((t) => t.intrinsicName !== 'undefined'); + if (nonUndefined) { + type = nonUndefined; + } + } + if ((0, plugin_utils_1.isAutoGeneratedTypeUnion)(type)) { + const types = type.types; + type = types[types.length - 1]; + } + const typeIsArrayTuple = (0, plugin_utils_1.extractTypeArgumentIfArray)(type); + if (!typeIsArrayTuple) { + return undefined; + } + const isArrayType = typeIsArrayTuple.isArray; + type = typeIsArrayTuple.type; + const stringLiteralUnion = (0, plugin_utils_1.getStringLiteralUnionValues)(type); + if (stringLiteralUnion) { + const enumProperty = factory.createPropertyAssignment(key, factory.createArrayLiteralExpression(stringLiteralUnion.values.map((v) => typeof v === 'number' + ? factory.createNumericLiteral(v) + : factory.createStringLiteral(v)))); + const result = (0, lodash_1.compact)([ + enumProperty, + isArrayType && + factory.createPropertyAssignment('isArray', factory.createIdentifier('true')) + ]); + return result.length === 1 ? result[0] : result; + } + const isEnumMember = type.symbol && type.symbol.flags === ts.SymbolFlags.EnumMember; + if (!(0, ast_utils_1.isEnum)(type) || isEnumMember) { + if (!isEnumMember) { + type = (0, plugin_utils_1.isAutoGeneratedEnumUnion)(type, typeChecker); + } + if (!type) { + return undefined; + } + const typeIsArrayTuple = (0, plugin_utils_1.extractTypeArgumentIfArray)(type); + if (!typeIsArrayTuple) { + return undefined; + } + type = typeIsArrayTuple.type; + } + const typeReferenceDescriptor = { typeName: (0, ast_utils_1.getText)(type, typeChecker) }; + const enumIdentifier = (0, type_reference_to_identifier_util_1.typeReferenceToIdentifier)(typeReferenceDescriptor, hostFilename, options, factory, type, this._typeImports); + const enumProperty = factory.createPropertyAssignment(key, enumIdentifier); + const extraProperties = []; + if (options.autoFillEnumName && + !(0, plugin_utils_1.hasPropertyKey)('enumName', existingProperties)) { + const fullTypeName = typeReferenceDescriptor.typeName; + const enumTypeName = fullTypeName.includes('.') + ? fullTypeName.slice(fullTypeName.lastIndexOf('.') + 1) + : fullTypeName; + extraProperties.push(factory.createPropertyAssignment('enumName', factory.createStringLiteral(enumTypeName))); + } + if (isArrayType) { + const isArrayKey = 'isArray'; + const isArrayProperty = factory.createPropertyAssignment(isArrayKey, factory.createIdentifier('true')); + return [enumProperty, isArrayProperty, ...extraProperties]; + } + return extraProperties.length > 0 + ? [enumProperty, ...extraProperties] + : enumProperty; + } + createDefaultPropertyAssignment(factory, node, existingProperties, options) { + var _a; + const key = 'default'; + if (options.skipDefaultValues) { + return undefined; + } + if ((0, plugin_utils_1.hasPropertyKey)(key, existingProperties)) { + return undefined; + } + if (ts.isPropertySignature(node)) { + return undefined; + } + if (node.initializer == null) { + return undefined; + } + let initializer = node.initializer; + if (ts.isAsExpression(initializer)) { + initializer = initializer.expression; + } + initializer = + (_a = this.clonePrimitiveLiteral(factory, initializer)) !== null && _a !== void 0 ? _a : initializer; + if (!(0, plugin_utils_1.canReferenceNode)(initializer, options)) { + if (options.debug) { + const parentFilePath = node.getSourceFile().fileName; + const propertyName = node.name.getText(); + plugin_debug_logger_1.pluginDebugLogger.debug(`Skipping registering default value for "${propertyName}" property in "${parentFilePath}" file because it is not a referenceable value ("${initializer.getText()}").`); + } + return undefined; + } + return factory.createPropertyAssignment(key, initializer); + } + createValidationPropertyAssignments(factory, node, options) { + const assignments = []; + const decorators = ts.canHaveDecorators(node) && ts.getDecorators(node); + if (!options.readonly) { + this.addPropertiesByValidationDecorator(factory, 'IsIn', decorators, assignments, (decoratorRef) => { + var _a; + const decoratorArguments = (0, ast_utils_1.getDecoratorArguments)(decoratorRef); + const result = []; + const argumentValue = (0, lodash_1.head)(decoratorArguments); + if (!(0, plugin_utils_1.canReferenceNode)(argumentValue, options)) { + return result; + } + const assignment = (_a = this.clonePrimitiveLiteral(factory, argumentValue)) !== null && _a !== void 0 ? _a : argumentValue; + result.push(factory.createPropertyAssignment('enum', assignment)); + if (this.isEachOptionEnabled(decoratorArguments[1])) { + result.push(factory.createPropertyAssignment('isArray', factory.createIdentifier('true'))); + } + return result; + }); + } + decorators_properties_1.decoratorsProperties.forEach((decoratorProperty) => { + if (decoratorProperty.mappingType === decorators_properties_1.decoratorsPropertiesMappingType.DIRECT) { + this.addPropertyByValidationDecorator(factory, decoratorProperty.decorator, decoratorProperty.property, decorators, assignments, options); + } + else if (decoratorProperty.mappingType === + decorators_properties_1.decoratorsPropertiesMappingType.INDIRECT_VALUE) { + this.addPropertiesByValidationDecorator(factory, decoratorProperty.decorator, decorators, assignments, () => { + return [ + factory.createPropertyAssignment(decoratorProperty.property, (0, ast_utils_1.createPrimitiveLiteral)(factory, decoratorProperty.value)) + ]; + }); + } + else if (decoratorProperty.mappingType === + decorators_properties_1.decoratorsPropertiesMappingType.INDIRECT_ARGUMENT) { + this.addPropertiesByValidationDecorator(factory, decoratorProperty.decorator, decorators, assignments, (decoratorRef) => { + const decoratorArguments = (0, ast_utils_1.getDecoratorArguments)(decoratorRef); + const result = []; + const argumentValue = (0, lodash_1.head)(decoratorArguments); + if (!(0, plugin_utils_1.canReferenceNode)(argumentValue, options)) { + return result; + } + const clonedArgumentValue = this.clonePrimitiveLiteral(factory, argumentValue); + if (clonedArgumentValue) { + result.push(factory.createPropertyAssignment(decoratorProperty.property, clonedArgumentValue)); + } + return result; + }); + } + }); + this.addPropertiesByValidationDecorator(factory, 'Length', decorators, assignments, (decoratorRef) => { + var _a, _b; + const decoratorArguments = (0, ast_utils_1.getDecoratorArguments)(decoratorRef); + const result = []; + const minLength = (0, lodash_1.head)(decoratorArguments); + if (!(0, plugin_utils_1.canReferenceNode)(minLength, options)) { + return result; + } + const clonedMinLength = (_a = this.clonePrimitiveLiteral(factory, minLength)) !== null && _a !== void 0 ? _a : minLength; + if (clonedMinLength) { + result.push(factory.createPropertyAssignment('minLength', clonedMinLength)); + } + if (decoratorArguments.length > 1) { + const maxLength = decoratorArguments[1]; + if (!(0, plugin_utils_1.canReferenceNode)(maxLength, options)) { + return result; + } + const clonedMaxLength = (_b = this.clonePrimitiveLiteral(factory, maxLength)) !== null && _b !== void 0 ? _b : maxLength; + if (clonedMaxLength) { + result.push(factory.createPropertyAssignment('maxLength', clonedMaxLength)); + } + } + return result; + }); + this.addPropertiesByValidationDecorator(factory, 'Matches', decorators, assignments, (decoratorRef) => { + const decoratorArguments = (0, ast_utils_1.getDecoratorArguments)(decoratorRef); + const firstArg = (0, lodash_1.head)(decoratorArguments); + if (!firstArg) { + return []; + } + let patternText; + if (ts.isRegularExpressionLiteral(firstArg)) { + const match = firstArg.text.match(/^\/(.*)\/([gimsuy]*)$/); + if (match) { + patternText = match[1]; + } + } + else if (ts.isStringLiteral(firstArg)) { + patternText = firstArg.text; + } + if (patternText === undefined) { + return []; + } + return [ + factory.createPropertyAssignment('pattern', (0, ast_utils_1.createPrimitiveLiteral)(factory, patternText)) + ]; + }); + return assignments; + } + addPropertyByValidationDecorator(factory, decoratorName, propertyKey, decorators, assignments, options) { + this.addPropertiesByValidationDecorator(factory, decoratorName, decorators, assignments, (decoratorRef) => { + var _a; + const argument = (0, lodash_1.head)((0, ast_utils_1.getDecoratorArguments)(decoratorRef)); + const assignment = (_a = this.clonePrimitiveLiteral(factory, argument)) !== null && _a !== void 0 ? _a : argument; + if (!(0, plugin_utils_1.canReferenceNode)(assignment, options)) { + return []; + } + return [factory.createPropertyAssignment(propertyKey, assignment)]; + }); + } + addPropertiesByValidationDecorator(factory, decoratorName, decorators, assignments, addPropertyAssignments) { + const decoratorRef = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)([decoratorName], decorators, factory); + if (!decoratorRef) { + return; + } + assignments.push(...addPropertyAssignments(decoratorRef)); + } + isEachOptionEnabled(optionsArgument) { + if (!optionsArgument || !ts.isObjectLiteralExpression(optionsArgument)) { + return false; + } + return optionsArgument.properties.some((property) => { + if (!ts.isPropertyAssignment(property) || + !ts.isIdentifier(property.name) || + property.name.text !== 'each') { + return false; + } + return property.initializer.kind === ts.SyntaxKind.TrueKeyword; + }); + } + addClassMetadata(node, objectLiteral, sourceFile, metadata) { + const hostClass = node.parent; + const className = hostClass.name && hostClass.name.getText(); + if (!className) { + return; + } + const propertyName = node.name && node.name.getText(sourceFile); + if (!propertyName || + (node.name && node.name.kind === ts.SyntaxKind.ComputedPropertyName)) { + return; + } + metadata[propertyName] = objectLiteral; + } + createDescriptionAndTsDocTagPropertyAssignments(factory, node, typeChecker, existingProperties = factory.createNodeArray(), options = {}, sourceFile) { + var _a; + if (!options.introspectComments || !sourceFile) { + return []; + } + const propertyAssignments = []; + const comments = (0, ast_utils_1.getMainCommentOfNode)(node); + const tags = (0, ast_utils_1.getTsDocTagsOfNode)(node, typeChecker); + const keyOfComment = options.dtoKeyOfComment; + if (!(0, plugin_utils_1.hasPropertyKey)(keyOfComment, existingProperties) && comments) { + const descriptionPropertyAssignment = factory.createPropertyAssignment(keyOfComment, factory.createStringLiteral(comments)); + propertyAssignments.push(descriptionPropertyAssignment); + } + const hasExampleOrExamplesKey = (0, plugin_utils_1.hasPropertyKey)('example', existingProperties) || + (0, plugin_utils_1.hasPropertyKey)('examples', existingProperties); + if (!hasExampleOrExamplesKey && ((_a = tags.example) === null || _a === void 0 ? void 0 : _a.length)) { + if (tags.example.length === 1) { + const examplePropertyAssignment = factory.createPropertyAssignment('example', (0, ast_utils_1.createLiteralFromAnyValue)(factory, tags.example[0])); + propertyAssignments.push(examplePropertyAssignment); + } + else { + const examplesPropertyAssignment = factory.createPropertyAssignment('examples', (0, ast_utils_1.createLiteralFromAnyValue)(factory, tags.example)); + propertyAssignments.push(examplesPropertyAssignment); + } + } + const hasDeprecatedKey = (0, plugin_utils_1.hasPropertyKey)('deprecated', existingProperties); + if (!hasDeprecatedKey && tags.deprecated) { + const deprecatedPropertyAssignment = factory.createPropertyAssignment('deprecated', (0, ast_utils_1.createLiteralFromAnyValue)(factory, tags.deprecated)); + propertyAssignments.push(deprecatedPropertyAssignment); + } + return propertyAssignments; + } + normalizeImportPath(pathToSource, path) { + let relativePath = path_1.posix.relative((0, plugin_utils_1.convertPath)(pathToSource), (0, plugin_utils_1.convertPath)(path)); + relativePath = relativePath[0] !== '.' ? './' + relativePath : relativePath; + return relativePath; + } + clonePrimitiveLiteral(factory, node) { + var _a; + const primitiveTypeName = this.getInitializerPrimitiveTypeName(node); + if (!primitiveTypeName) { + return undefined; + } + const text = (_a = node.text) !== null && _a !== void 0 ? _a : node.getText(); + return (0, ast_utils_1.createPrimitiveLiteral)(factory, text, primitiveTypeName); + } + getInitializerPrimitiveTypeName(node) { + if (ts.isIdentifier(node) && + (node.text === 'true' || node.text === 'false')) { + return 'boolean'; + } + if (ts.isNumericLiteral(node) || ts.isPrefixUnaryExpression(node)) { + return 'number'; + } + if (ts.isStringLiteral(node)) { + return 'string'; + } + return undefined; + } +} +exports.ModelClassVisitor = ModelClassVisitor; diff --git a/node_modules/@nestjs/swagger/dist/plugin/visitors/readonly.visitor.d.ts b/node_modules/@nestjs/swagger/dist/plugin/visitors/readonly.visitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cf3fc45f231f8016083134444d632f480854037c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/visitors/readonly.visitor.d.ts @@ -0,0 +1,22 @@ +import * as ts from 'typescript'; +import { PluginOptions } from '../merge-options'; +export declare class ReadonlyVisitor { + private readonly options; + readonly key = "@nestjs/swagger"; + private readonly modelClassVisitor; + private readonly controllerClassVisitor; + static createTsProgram(tsconfigPath: string): ts.Program; + get typeImports(): { + [x: string]: string; + }; + constructor(options: PluginOptions); + visit(program: ts.Program, sf: ts.SourceFile): ts.Node; + collect(): { + models: [ts.CallExpression, Record][]; + controllers: [ts.CallExpression, Record][]; + }; +} diff --git a/node_modules/@nestjs/swagger/dist/plugin/visitors/readonly.visitor.js b/node_modules/@nestjs/swagger/dist/plugin/visitors/readonly.visitor.js new file mode 100644 index 0000000000000000000000000000000000000000..d3f68ac8ba654ce6ad3271e42045d4ac00f6fef5 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/plugin/visitors/readonly.visitor.js @@ -0,0 +1,109 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReadonlyVisitor = void 0; +const ts = __importStar(require("typescript")); +const merge_options_1 = require("../merge-options"); +const is_filename_matched_util_1 = require("../utils/is-filename-matched.util"); +const controller_class_visitor_1 = require("./controller-class.visitor"); +const model_class_visitor_1 = require("./model-class.visitor"); +function collectProjectReferenceSourceFiles(projectReferences, visitedProjects = new Set()) { + if (!projectReferences) { + return []; + } + const sourceFiles = []; + for (const ref of projectReferences) { + const refConfigPath = ts.resolveProjectReferencePath(ref); + if (visitedProjects.has(refConfigPath)) { + continue; + } + visitedProjects.add(refConfigPath); + const parsedRef = ts.getParsedCommandLineOfConfigFile(refConfigPath, undefined, ts.sys); + if (parsedRef) { + sourceFiles.push(...parsedRef.fileNames); + sourceFiles.push(...collectProjectReferenceSourceFiles(parsedRef.projectReferences, visitedProjects)); + } + } + return sourceFiles; +} +class ReadonlyVisitor { + static createTsProgram(tsconfigPath) { + let parseError; + const host = Object.assign(Object.assign({}, ts.sys), { onUnRecoverableConfigFileDiagnostic(diagnostic) { + parseError = diagnostic; + } }); + const parsedCmd = ts.getParsedCommandLineOfConfigFile(tsconfigPath, undefined, host); + if (!parsedCmd || parseError) { + const message = parseError + ? ts.flattenDiagnosticMessageText(parseError.messageText, '\n') + : tsconfigPath; + throw new Error(`Failed to parse tsconfig at path: ${message}`); + } + const { options, fileNames, projectReferences } = parsedCmd; + const referencedSourceFiles = collectProjectReferenceSourceFiles(projectReferences); + const rootNames = [...new Set([...fileNames, ...referencedSourceFiles])]; + return ts.createProgram({ options, rootNames }); + } + get typeImports() { + return Object.assign(Object.assign({}, this.modelClassVisitor.typeImports), this.controllerClassVisitor.typeImports); + } + constructor(options) { + this.options = options; + this.key = '@nestjs/swagger'; + this.modelClassVisitor = new model_class_visitor_1.ModelClassVisitor(); + this.controllerClassVisitor = new controller_class_visitor_1.ControllerClassVisitor(); + options.readonly = true; + if (!options.pathToSource) { + throw new Error(`"pathToSource" must be defined in plugin options`); + } + } + visit(program, sf) { + const factoryHost = { factory: ts.factory }; + const parsedOptions = (0, merge_options_1.mergePluginOptions)(this.options); + if ((0, is_filename_matched_util_1.isFilenameMatched)(parsedOptions.dtoFileNameSuffix, sf.fileName)) { + return this.modelClassVisitor.visit(sf, factoryHost, program, parsedOptions); + } + if ((0, is_filename_matched_util_1.isFilenameMatched)(parsedOptions.controllerFileNameSuffix, sf.fileName)) { + return this.controllerClassVisitor.visit(sf, factoryHost, program, parsedOptions); + } + } + collect() { + return { + models: this.modelClassVisitor.collectedMetadata(this.options), + controllers: this.controllerClassVisitor.collectedMetadata(this.options) + }; + } +} +exports.ReadonlyVisitor = ReadonlyVisitor; diff --git a/node_modules/@nestjs/swagger/dist/services/constants.d.ts b/node_modules/@nestjs/swagger/dist/services/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b4afcb78d4a3c430d9a0a682609fa04e8c8fdc5a --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/constants.d.ts @@ -0,0 +1 @@ +export declare const BUILT_IN_TYPES: (StringConstructor | ArrayConstructor | ObjectConstructor | NumberConstructor | BooleanConstructor)[]; diff --git a/node_modules/@nestjs/swagger/dist/services/constants.js b/node_modules/@nestjs/swagger/dist/services/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..d04046b7cd6bb724e951df9c48c2b1f92cdc0f66 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/constants.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BUILT_IN_TYPES = void 0; +exports.BUILT_IN_TYPES = [String, Boolean, Number, Object, Array]; diff --git a/node_modules/@nestjs/swagger/dist/services/decorators-properties.d.ts b/node_modules/@nestjs/swagger/dist/services/decorators-properties.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dccde65a37f959175573da0dc67f45a37e310c5c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/decorators-properties.d.ts @@ -0,0 +1,21 @@ +export declare enum decoratorsPropertiesMappingType { + DIRECT = 0, + INDIRECT_VALUE = 1, + INDIRECT_ARGUMENT = 2 +} +export declare const decoratorsProperties: ({ + mappingType: decoratorsPropertiesMappingType; + decorator: string; + property: string; + value: number; +} | { + mappingType: decoratorsPropertiesMappingType; + decorator: string; + property: string; + value: boolean; +} | { + mappingType: decoratorsPropertiesMappingType; + decorator: string; + property: string; + value: string; +})[]; diff --git a/node_modules/@nestjs/swagger/dist/services/decorators-properties.js b/node_modules/@nestjs/swagger/dist/services/decorators-properties.js new file mode 100644 index 0000000000000000000000000000000000000000..6c8f4455d3044a23b95576eaa6ec1284d227303d --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/decorators-properties.js @@ -0,0 +1,149 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decoratorsProperties = exports.decoratorsPropertiesMappingType = void 0; +var decoratorsPropertiesMappingType; +(function (decoratorsPropertiesMappingType) { + decoratorsPropertiesMappingType[decoratorsPropertiesMappingType["DIRECT"] = 0] = "DIRECT"; + decoratorsPropertiesMappingType[decoratorsPropertiesMappingType["INDIRECT_VALUE"] = 1] = "INDIRECT_VALUE"; + decoratorsPropertiesMappingType[decoratorsPropertiesMappingType["INDIRECT_ARGUMENT"] = 2] = "INDIRECT_ARGUMENT"; +})(decoratorsPropertiesMappingType || (exports.decoratorsPropertiesMappingType = decoratorsPropertiesMappingType = {})); +exports.decoratorsProperties = [ + { + mappingType: decoratorsPropertiesMappingType.DIRECT, + decorator: 'Min', + property: 'minimum', + value: undefined + }, + { + mappingType: decoratorsPropertiesMappingType.DIRECT, + decorator: 'Max', + property: 'maximum', + value: undefined + }, + { + mappingType: decoratorsPropertiesMappingType.DIRECT, + decorator: 'MinLength', + property: 'minLength', + value: undefined + }, + { + mappingType: decoratorsPropertiesMappingType.DIRECT, + decorator: 'MaxLength', + property: 'maxLength', + value: undefined + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'ArrayNotEmpty', + property: 'minItems', + value: 1 + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsPositive', + property: 'minimum', + value: 1 + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsNegative', + property: 'maximum', + value: -1 + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'ArrayUnique', + property: 'uniqueItems', + value: true + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsBase64', + property: 'format', + value: 'base64' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsCreditCard', + property: 'format', + value: 'credit-card' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsCurrency', + property: 'format', + value: 'currency' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsEmail', + property: 'format', + value: 'email' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsJSON', + property: 'format', + value: 'json' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsUrl', + property: 'format', + value: 'uri' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsUUID', + property: 'format', + value: 'uuid' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsMobilePhone', + property: 'format', + value: 'mobile-phone' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsAscii', + property: 'pattern', + value: '^[\\x00-\\x7F]+$' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsHexColor', + property: 'pattern', + value: '^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_VALUE, + decorator: 'IsHexadecimal', + property: 'pattern', + value: '^(0x|0h)?[0-9A-F]+$' + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_ARGUMENT, + decorator: 'ArrayMinSize', + property: 'minItems', + value: undefined + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_ARGUMENT, + decorator: 'ArrayMaxSize', + property: 'maxItems', + value: undefined + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_ARGUMENT, + decorator: 'IsDivisibleBy', + property: 'multipleOf', + value: undefined + }, + { + mappingType: decoratorsPropertiesMappingType.INDIRECT_ARGUMENT, + decorator: 'Contains', + property: 'pattern', + value: undefined + } +]; diff --git a/node_modules/@nestjs/swagger/dist/services/mimetype-content-wrapper.d.ts b/node_modules/@nestjs/swagger/dist/services/mimetype-content-wrapper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b622fe8d71cf9e4559c4aade9ca504dee3e93956 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/mimetype-content-wrapper.d.ts @@ -0,0 +1,4 @@ +import { ContentObject } from '../interfaces/open-api-spec.interface'; +export declare class MimetypeContentWrapper { + wrap(mimetype: string[], obj: Record): Record<'content', ContentObject>; +} diff --git a/node_modules/@nestjs/swagger/dist/services/mimetype-content-wrapper.js b/node_modules/@nestjs/swagger/dist/services/mimetype-content-wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..371ce202f34032dee7b88ef2a70f909b31df919c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/mimetype-content-wrapper.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MimetypeContentWrapper = void 0; +const remove_undefined_keys_1 = require("../utils/remove-undefined-keys"); +class MimetypeContentWrapper { + wrap(mimetype, obj) { + const content = mimetype.reduce((acc, item) => (Object.assign(Object.assign({}, acc), { [item]: (0, remove_undefined_keys_1.removeUndefinedKeys)(obj) })), {}); + return { content }; + } +} +exports.MimetypeContentWrapper = MimetypeContentWrapper; diff --git a/node_modules/@nestjs/swagger/dist/services/model-properties-accessor.d.ts b/node_modules/@nestjs/swagger/dist/services/model-properties-accessor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2df5cb1fe87b7d809164302d35d00cad05d72964 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/model-properties-accessor.d.ts @@ -0,0 +1,6 @@ +import { Type } from '@nestjs/common'; +import 'reflect-metadata'; +export declare class ModelPropertiesAccessor { + getModelProperties(prototype: Type): string[]; + applyMetadataFactory(prototype: Type): void; +} diff --git a/node_modules/@nestjs/swagger/dist/services/model-properties-accessor.js b/node_modules/@nestjs/swagger/dist/services/model-properties-accessor.js new file mode 100644 index 0000000000000000000000000000000000000000..2b2465e0808bf5aec59e13d33be1fab27b129ce6 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/model-properties-accessor.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ModelPropertiesAccessor = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +require("reflect-metadata"); +const constants_1 = require("../constants"); +const api_property_decorator_1 = require("../decorators/api-property.decorator"); +const plugin_constants_1 = require("../plugin/plugin-constants"); +class ModelPropertiesAccessor { + getModelProperties(prototype) { + const properties = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES_ARRAY, prototype) || + []; + return properties + .filter(shared_utils_1.isString) + .filter((key) => key.charAt(0) === ':' && !(0, shared_utils_1.isFunction)(prototype[key])) + .map((key) => key.slice(1)); + } + applyMetadataFactory(prototype) { + const classPrototype = prototype; + do { + if (!prototype.constructor) { + return; + } + if (!prototype.constructor[plugin_constants_1.METADATA_FACTORY_NAME]) { + continue; + } + const metadata = prototype.constructor[plugin_constants_1.METADATA_FACTORY_NAME](); + const properties = Object.keys(metadata); + properties.forEach((key) => { + (0, api_property_decorator_1.createApiPropertyDecorator)(metadata[key], false)(classPrototype, key); + }); + } while ((prototype = Reflect.getPrototypeOf(prototype)) && + prototype !== Object.prototype && + prototype); + } +} +exports.ModelPropertiesAccessor = ModelPropertiesAccessor; diff --git a/node_modules/@nestjs/swagger/dist/services/parameter-metadata-accessor.d.ts b/node_modules/@nestjs/swagger/dist/services/parameter-metadata-accessor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f97095a6911ca7edf45e7de324c4b40db944b6e9 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/parameter-metadata-accessor.d.ts @@ -0,0 +1,22 @@ +import { Type } from '@nestjs/common'; +import { EnumSchemaAttributes } from '../interfaces/enum-schema-attributes.interface'; +import { ParameterLocation, SchemaObject } from '../interfaces/open-api-spec.interface'; +export interface ParamWithTypeMetadata { + name?: string | number | object; + type?: Type; + in?: ParameterLocation | 'body' | typeof PARAM_TOKEN_PLACEHOLDER; + isArray?: boolean; + items?: SchemaObject; + required?: boolean; + enum?: unknown[]; + enumName?: string; + enumSchema?: EnumSchemaAttributes; + selfRequired?: boolean; +} +export type ParamsWithType = Record; +declare const PARAM_TOKEN_PLACEHOLDER = "placeholder"; +export declare class ParameterMetadataAccessor { + explore(instance: object, prototype: Type, method: Function): ParamsWithType; + private mapParamType; +} +export {}; diff --git a/node_modules/@nestjs/swagger/dist/services/parameter-metadata-accessor.js b/node_modules/@nestjs/swagger/dist/services/parameter-metadata-accessor.js new file mode 100644 index 0000000000000000000000000000000000000000..f0f5c77bfe004dc2a156e4acde0b92b5832b966f --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/parameter-metadata-accessor.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParameterMetadataAccessor = void 0; +const constants_1 = require("@nestjs/common/constants"); +const route_paramtypes_enum_1 = require("@nestjs/common/enums/route-paramtypes.enum"); +const lodash_1 = require("lodash"); +const reverse_object_keys_util_1 = require("../utils/reverse-object-keys.util"); +const PARAM_TOKEN_PLACEHOLDER = 'placeholder'; +class ParameterMetadataAccessor { + explore(instance, prototype, method) { + const types = Reflect.getMetadata(constants_1.PARAMTYPES_METADATA, instance, method.name); + if (!(types === null || types === void 0 ? void 0 : types.length)) { + return undefined; + } + const routeArgsMetadata = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, instance.constructor, method.name) || {}; + const parametersWithType = (0, lodash_1.mapValues)((0, reverse_object_keys_util_1.reverseObjectKeys)(routeArgsMetadata), (param) => ({ + type: types[param.index], + name: param.data, + required: true + })); + const excludePredicate = (val) => val.in === PARAM_TOKEN_PLACEHOLDER || (val.name && val.in === 'body'); + const parameters = (0, lodash_1.omitBy)((0, lodash_1.mapValues)(parametersWithType, (val, key) => (Object.assign(Object.assign({}, val), { in: this.mapParamType(key) }))), excludePredicate); + return !(0, lodash_1.isEmpty)(parameters) ? parameters : undefined; + } + mapParamType(key) { + const keyPair = key.split(':'); + switch (Number(keyPair[0])) { + case route_paramtypes_enum_1.RouteParamtypes.BODY: + return 'body'; + case route_paramtypes_enum_1.RouteParamtypes.PARAM: + return 'path'; + case route_paramtypes_enum_1.RouteParamtypes.QUERY: + return 'query'; + case route_paramtypes_enum_1.RouteParamtypes.HEADERS: + return 'header'; + default: + return PARAM_TOKEN_PLACEHOLDER; + } + } +} +exports.ParameterMetadataAccessor = ParameterMetadataAccessor; diff --git a/node_modules/@nestjs/swagger/dist/services/parameters-metadata-mapper.d.ts b/node_modules/@nestjs/swagger/dist/services/parameters-metadata-mapper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..53aa77311d8a6c0adde2a73178469f681a4fb61b --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/parameters-metadata-mapper.d.ts @@ -0,0 +1,9 @@ +import { Type } from '@nestjs/common'; +import { ModelPropertiesAccessor } from './model-properties-accessor'; +import { ParamWithTypeMetadata, ParamsWithType } from './parameter-metadata-accessor'; +export declare class ParametersMetadataMapper { + private readonly modelPropertiesAccessor; + constructor(modelPropertiesAccessor: ModelPropertiesAccessor); + transformModelToProperties(parameters: ParamsWithType): ParamWithTypeMetadata[]; + mergeImplicitWithExplicit(key: string, prototype: Type, param: ParamWithTypeMetadata): ParamWithTypeMetadata; +} diff --git a/node_modules/@nestjs/swagger/dist/services/parameters-metadata-mapper.js b/node_modules/@nestjs/swagger/dist/services/parameters-metadata-mapper.js new file mode 100644 index 0000000000000000000000000000000000000000..bf661f224eeee20348cf6112875ac661f3e54e59 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/parameters-metadata-mapper.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParametersMetadataMapper = void 0; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const is_body_parameter_util_1 = require("../utils/is-body-parameter.util"); +class ParametersMetadataMapper { + constructor(modelPropertiesAccessor) { + this.modelPropertiesAccessor = modelPropertiesAccessor; + } + transformModelToProperties(parameters) { + const properties = (0, lodash_1.flatMap)(parameters, (param) => { + if (!param || param.type === Object || !param.type) { + return undefined; + } + if (param.name) { + return param; + } + if ((0, is_body_parameter_util_1.isBodyParameter)(param)) { + const isCtor = param.type && (0, shared_utils_1.isFunction)(param.type); + const name = isCtor ? param.type.name : param.type; + return Object.assign(Object.assign({}, param), { name }); + } + const { prototype } = param.type; + this.modelPropertiesAccessor.applyMetadataFactory(prototype); + const modelProperties = this.modelPropertiesAccessor.getModelProperties(prototype); + return modelProperties.map((key) => this.mergeImplicitWithExplicit(key, prototype, param)); + }); + return properties.filter(lodash_1.identity); + } + mergeImplicitWithExplicit(key, prototype, param) { + const reflectedParam = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, prototype, key) || + {}; + return Object.assign(Object.assign(Object.assign({}, param), reflectedParam), { name: reflectedParam.name || key }); + } +} +exports.ParametersMetadataMapper = ParametersMetadataMapper; diff --git a/node_modules/@nestjs/swagger/dist/services/response-object-factory.d.ts b/node_modules/@nestjs/swagger/dist/services/response-object-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c39a149866e8c372d9f6556ed03976470ae91976 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/response-object-factory.d.ts @@ -0,0 +1,22 @@ +import { ApiResponseMetadata, ApiResponseSchemaHost } from '../decorators'; +import { SchemaObject } from '../interfaces/open-api-spec.interface'; +export type FactoriesNeededByResponseFactory = { + linkName: (controllerKey: string, methodKey: string, fieldKey: string) => string; + operationId: (controllerKey: string, methodKey: string) => string; +}; +export declare class ResponseObjectFactory { + private readonly mimetypeContentWrapper; + private readonly modelPropertiesAccessor; + private readonly swaggerTypesMapper; + private readonly schemaObjectFactory; + private readonly responseObjectMapper; + create(response: ApiResponseMetadata, produces: string[], schemas: Record, factories: FactoriesNeededByResponseFactory): (ApiResponseSchemaHost & import("..").ApiResponseCommonMetadata & { + example?: any; + }) | (ApiResponseSchemaHost & import("..").ApiResponseCommonMetadata & { + examples?: { + [key: string]: import("..").ApiResponseExamples; + }; + }) | { + content: import("../interfaces/open-api-spec.interface").ContentObject; + }; +} diff --git a/node_modules/@nestjs/swagger/dist/services/response-object-factory.js b/node_modules/@nestjs/swagger/dist/services/response-object-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..836688a623fb9d7e1de76247d5f87ae2c190367a --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/response-object-factory.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ResponseObjectFactory = void 0; +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const is_built_in_type_util_1 = require("../utils/is-built-in-type.util"); +const mimetype_content_wrapper_1 = require("./mimetype-content-wrapper"); +const model_properties_accessor_1 = require("./model-properties-accessor"); +const response_object_mapper_1 = require("./response-object-mapper"); +const schema_object_factory_1 = require("./schema-object-factory"); +const swagger_types_mapper_1 = require("./swagger-types-mapper"); +class ResponseObjectFactory { + constructor() { + this.mimetypeContentWrapper = new mimetype_content_wrapper_1.MimetypeContentWrapper(); + this.modelPropertiesAccessor = new model_properties_accessor_1.ModelPropertiesAccessor(); + this.swaggerTypesMapper = new swagger_types_mapper_1.SwaggerTypesMapper(); + this.schemaObjectFactory = new schema_object_factory_1.SchemaObjectFactory(this.modelPropertiesAccessor, this.swaggerTypesMapper); + this.responseObjectMapper = new response_object_mapper_1.ResponseObjectMapper(); + } + create(response, produces, schemas, factories) { + var _a; + const { type, isArray } = response; + response = (0, lodash_1.omit)(response, ['isArray']); + if (!type) { + return this.responseObjectMapper.wrapSchemaWithContent(response, produces); + } + if ((0, is_built_in_type_util_1.isBuiltInType)(type)) { + const typeName = type && (0, lodash_1.isFunction)(type) ? type.name : type; + const swaggerType = this.swaggerTypesMapper.mapTypeToOpenAPIType(typeName); + const exampleKeys = ['example', 'examples']; + const baseSchema = isArray + ? { type: 'array', items: { type: swaggerType } } + : { type: swaggerType }; + const schema = response.nullable + ? { oneOf: [baseSchema, { type: 'null' }] } + : baseSchema; + const content = this.mimetypeContentWrapper.wrap(produces, Object.assign({ schema }, (0, lodash_1.pick)(response, exampleKeys))); + return Object.assign(Object.assign({}, (0, lodash_1.omit)(response, [...exampleKeys, 'nullable'])), content); + } + const name = this.schemaObjectFactory.exploreModelSchema(type, schemas); + if ((0, lodash_1.isFunction)(type) && type.prototype) { + const { prototype } = type; + const links = {}; + const properties = this.modelPropertiesAccessor.getModelProperties(prototype); + const generateLink = (controllerPrototype, method, parameter, field) => { + if (!factories) { + return; + } + const linkName = factories.linkName(controllerPrototype.constructor.name, method.name, field); + links[linkName] = { + operationId: factories.operationId(controllerPrototype.constructor.name, method.name), + parameters: { + [parameter]: `$response.body#/${field}` + } + }; + }; + for (const key of properties) { + const metadata = (_a = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, prototype, key)) !== null && _a !== void 0 ? _a : {}; + if (!metadata.link) { + continue; + } + const linkedType = metadata.link(); + const linkedGetterInfo = Reflect.getMetadata(constants_1.DECORATORS.API_DEFAULT_GETTER, linkedType.prototype); + if (!linkedGetterInfo) { + continue; + } + const { getter, parameter, prototype: controllerPrototype } = linkedGetterInfo; + generateLink(controllerPrototype, getter, parameter, key); + } + const customLinks = Reflect.getMetadata(constants_1.DECORATORS.API_LINK, prototype); + for (const customLink of customLinks !== null && customLinks !== void 0 ? customLinks : []) { + const { method, parameter, field, prototype: controllerPrototype } = customLink; + generateLink(controllerPrototype, method, parameter, field); + } + if (!(0, lodash_1.isEmpty)(links)) { + response.links = Object.assign(links, response.links); + } + } + if (isArray) { + return this.responseObjectMapper.toArrayRefObject(response, name, produces); + } + return this.responseObjectMapper.toRefObject(response, name, produces); + } +} +exports.ResponseObjectFactory = ResponseObjectFactory; diff --git a/node_modules/@nestjs/swagger/dist/services/response-object-mapper.d.ts b/node_modules/@nestjs/swagger/dist/services/response-object-mapper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7d1bc76ad9a74580a630a749d1c6fc31c50b8086 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/response-object-mapper.d.ts @@ -0,0 +1,41 @@ +import { ApiResponseMetadata, ApiResponseSchemaHost } from '../decorators'; +export declare class ResponseObjectMapper { + private readonly mimetypeContentWrapper; + toArrayRefObject(response: Record, name: string, produces: string[]): { + content: import("../interfaces/open-api-spec.interface").ContentObject; + }; + toRefObject(response: Record, name: string, produces: string[]): { + content: import("../interfaces/open-api-spec.interface").ContentObject; + }; + wrapSchemaWithContent(response: ApiResponseSchemaHost & ApiResponseMetadata, produces: string[]): (ApiResponseSchemaHost & import("..").ApiResponseCommonMetadata & { + example?: any; + }) | (ApiResponseSchemaHost & import("..").ApiResponseCommonMetadata & { + examples?: { + [key: string]: import("..").ApiResponseExamples; + }; + }) | { + content: import("../interfaces/open-api-spec.interface").ContentObject; + schema?: import("../interfaces/open-api-spec.interface").SchemaObject & Partial; + status?: number | "default" | "1XX" | "2XX" | "3XX" | "4XX" | "5XX"; + description?: string; + headers?: import("../interfaces/open-api-spec.interface").HeadersObject; + links?: import("../interfaces/open-api-spec.interface").LinksObject; + type?: import("@nestjs/common").Type | Function | [Function] | string; + isArray?: boolean; + nullable?: boolean; + example?: any; + } | { + content: import("../interfaces/open-api-spec.interface").ContentObject; + schema?: import("../interfaces/open-api-spec.interface").SchemaObject & Partial; + status?: number | "default" | "1XX" | "2XX" | "3XX" | "4XX" | "5XX"; + description?: string; + headers?: import("../interfaces/open-api-spec.interface").HeadersObject; + links?: import("../interfaces/open-api-spec.interface").LinksObject; + type?: import("@nestjs/common").Type | Function | [Function] | string; + isArray?: boolean; + nullable?: boolean; + examples?: { + [key: string]: import("..").ApiResponseExamples; + }; + }; +} diff --git a/node_modules/@nestjs/swagger/dist/services/response-object-mapper.js b/node_modules/@nestjs/swagger/dist/services/response-object-mapper.js new file mode 100644 index 0000000000000000000000000000000000000000..6f004f63a89d965501f5ea35eead6085e6a2cc92 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/response-object-mapper.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ResponseObjectMapper = void 0; +const lodash_1 = require("lodash"); +const utils_1 = require("../utils"); +const mimetype_content_wrapper_1 = require("./mimetype-content-wrapper"); +class ResponseObjectMapper { + constructor() { + this.mimetypeContentWrapper = new mimetype_content_wrapper_1.MimetypeContentWrapper(); + } + toArrayRefObject(response, name, produces) { + const exampleKeys = ['example', 'examples']; + const arraySchema = { + type: 'array', + items: { $ref: (0, utils_1.getSchemaPath)(name) } + }; + const schema = response.nullable + ? { oneOf: [arraySchema, { type: 'null' }] } + : arraySchema; + return Object.assign(Object.assign({}, (0, lodash_1.omit)(response, [...exampleKeys, 'nullable'])), this.mimetypeContentWrapper.wrap(produces, Object.assign({ schema }, (0, lodash_1.pick)(response, exampleKeys)))); + } + toRefObject(response, name, produces) { + const exampleKeys = ['example', 'examples']; + const schema = response.nullable + ? { oneOf: [{ $ref: (0, utils_1.getSchemaPath)(name) }, { type: 'null' }] } + : { $ref: (0, utils_1.getSchemaPath)(name) }; + return Object.assign(Object.assign({}, (0, lodash_1.omit)(response, [...exampleKeys, 'nullable'])), this.mimetypeContentWrapper.wrap(produces, Object.assign({ schema }, (0, lodash_1.pick)(response, exampleKeys)))); + } + wrapSchemaWithContent(response, produces) { + if (!response.schema && + !('example' in response) && + !('examples' in response)) { + return response; + } + const exampleKeys = ['example', 'examples']; + const content = this.mimetypeContentWrapper.wrap(produces, Object.assign({ schema: response.schema }, (0, lodash_1.pick)(response, exampleKeys))); + const keysToOmit = [...exampleKeys, 'schema']; + return Object.assign(Object.assign({}, (0, lodash_1.omit)(response, keysToOmit)), content); + } +} +exports.ResponseObjectMapper = ResponseObjectMapper; diff --git a/node_modules/@nestjs/swagger/dist/services/schema-object-factory.d.ts b/node_modules/@nestjs/swagger/dist/services/schema-object-factory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b58b30f56231e45aa73104d8c0b76e4c5d7b0c4 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/schema-object-factory.d.ts @@ -0,0 +1,188 @@ +import { Type } from '@nestjs/common'; +import { BaseParameterObject, ParameterObject, ReferenceObject, SchemaObject } from '../interfaces/open-api-spec.interface'; +import { SchemaObjectMetadata } from '../interfaces/schema-object-metadata.interface'; +import { ModelPropertiesAccessor } from './model-properties-accessor'; +import { ParamWithTypeMetadata } from './parameter-metadata-accessor'; +import { SwaggerTypesMapper } from './swagger-types-mapper'; +export declare class SchemaObjectFactory { + private readonly modelPropertiesAccessor; + private readonly swaggerTypesMapper; + constructor(modelPropertiesAccessor: ModelPropertiesAccessor, swaggerTypesMapper: SwaggerTypesMapper); + createFromModel(parameters: ParamWithTypeMetadata[], schemas: Record): Array; + getCustomType(param: ParamWithTypeMetadata, schemas: Record): { + name: string | number | object; + schema: { + type: string; + items: { + $ref: string; + nullable?: boolean; + discriminator?: import("../interfaces/open-api-spec.interface").DiscriminatorObject; + readOnly?: boolean; + writeOnly?: boolean; + xml?: import("../interfaces/open-api-spec.interface").XmlObject; + externalDocs?: import("../interfaces/open-api-spec.interface").ExternalDocumentationObject; + example?: any; + examples?: any[] | Record; + deprecated?: boolean; + type?: string; + allOf?: (SchemaObject | ReferenceObject)[]; + oneOf?: (SchemaObject | ReferenceObject)[]; + anyOf?: (SchemaObject | ReferenceObject)[]; + not?: SchemaObject | ReferenceObject; + items?: SchemaObject | ReferenceObject; + properties?: Record; + additionalProperties?: SchemaObject | ReferenceObject | boolean; + patternProperties?: SchemaObject | ReferenceObject | any; + description?: string; + format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat; + default?: any; + title?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: string[]; + enum?: any[]; + 'x-enumNames'?: string[]; + } | { + $ref: string; + }; + }; + type?: Type; + in?: import("../interfaces/open-api-spec.interface").ParameterLocation | "body" | "placeholder"; + isArray?: boolean; + items?: SchemaObject; + required?: boolean; + enum?: unknown[]; + enumName?: string; + enumSchema?: import("../interfaces/enum-schema-attributes.interface").EnumSchemaAttributes; + selfRequired?: boolean; + } | { + name: string | number | object; + schema: { + $ref: string; + nullable?: boolean; + discriminator?: import("../interfaces/open-api-spec.interface").DiscriminatorObject; + readOnly?: boolean; + writeOnly?: boolean; + xml?: import("../interfaces/open-api-spec.interface").XmlObject; + externalDocs?: import("../interfaces/open-api-spec.interface").ExternalDocumentationObject; + example?: any; + examples?: any[] | Record; + deprecated?: boolean; + type?: string; + allOf?: (SchemaObject | ReferenceObject)[]; + oneOf?: (SchemaObject | ReferenceObject)[]; + anyOf?: (SchemaObject | ReferenceObject)[]; + not?: SchemaObject | ReferenceObject; + items?: SchemaObject | ReferenceObject; + properties?: Record; + additionalProperties?: SchemaObject | ReferenceObject | boolean; + patternProperties?: SchemaObject | ReferenceObject | any; + description?: string; + format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat; + default?: any; + title?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: string[]; + enum?: any[]; + 'x-enumNames'?: string[]; + } | { + $ref: string; + }; + type?: Type; + in?: import("../interfaces/open-api-spec.interface").ParameterLocation | "body" | "placeholder"; + isArray?: boolean; + items?: SchemaObject; + required?: boolean; + enum?: unknown[]; + enumName?: string; + enumSchema?: import("../interfaces/enum-schema-attributes.interface").EnumSchemaAttributes; + selfRequired?: boolean; + }; + private createQueryOrParamSchema; + extractPropertiesFromType(type: Type, schemas: Record, pendingSchemasRefs?: string[]): ParameterObject[]; + exploreModelSchema(type: Type | Function, schemas: Record, pendingSchemasRefs?: string[]): string; + getSchemaMetadata(type: Function | Type): { + schemaName: string; + schemaProperties: { + description?: string; + }; + }; + mergePropertyWithMetadata(key: string, prototype: Type, schemas: Record, pendingSchemaRefs: string[], metadata?: SchemaObjectMetadata): SchemaObjectMetadata | ReferenceObject | ParameterObject | (SchemaObject & { + selfRequired?: boolean; + }); + createEnumParam(param: ParamWithTypeMetadata & BaseParameterObject, schemas: Record): Partial<{ + schema: { + type: string; + items: { + $ref: string; + }; + $ref?: undefined; + } | { + $ref: string; + type?: undefined; + items?: undefined; + }; + name?: string | number | object; + type?: Type; + in?: import("../interfaces/open-api-spec.interface").ParameterLocation | "body" | "placeholder"; + isArray?: boolean; + items?: SchemaObject; + required?: boolean; + enum?: unknown[]; + enumName?: string; + enumSchema?: import("../interfaces/enum-schema-attributes.interface").EnumSchemaAttributes; + selfRequired?: boolean; + description?: string; + deprecated?: boolean; + allowEmptyValue?: boolean; + style?: import("../interfaces/open-api-spec.interface").ParameterStyle; + explode?: boolean; + allowReserved?: boolean; + examples?: Record; + example?: any; + content?: import("../interfaces/open-api-spec.interface").ContentObject; + }>; + createEnumSchemaType(key: string, metadata: SchemaObjectMetadata, schemas: Record): SchemaObjectMetadata; + createNotBuiltInTypeReference(key: string, metadata: SchemaObjectMetadata, trueMetadataType: unknown, schemas: Record, pendingSchemaRefs: string[]): SchemaObjectMetadata; + transformToArraySchemaProperty(metadata: SchemaObjectMetadata, key: string, type: string | Record): SchemaObjectMetadata; + mapArrayCtorParam(param: ParamWithTypeMetadata): any; + createFromObjectLiteral(key: string, literalObj: Record, schemas: Record): { + name: string; + type: string; + properties: {}; + required: any[]; + }; + createFromNestedArray(key: string, metadata: SchemaObjectMetadata, schemas: Record, pendingSchemaRefs: string[]): any; + private createSchemaMetadata; + private isArrayCtor; + private isPrimitiveType; + private isLazyTypeFunc; + private getTypeName; + private isObjectLiteral; + private isBigInt; + private isConstEnumObject; + private extractPropertyModifiers; +} diff --git a/node_modules/@nestjs/swagger/dist/services/schema-object-factory.js b/node_modules/@nestjs/swagger/dist/services/schema-object-factory.js new file mode 100644 index 0000000000000000000000000000000000000000..8ef0e8e133d65b47342bb63a91674bcc95429348 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/schema-object-factory.js @@ -0,0 +1,560 @@ +"use strict"; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SchemaObjectFactory = void 0; +const common_1 = require("@nestjs/common"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const helpers_1 = require("../decorators/helpers"); +const api_extra_models_explorer_1 = require("../explorers/api-extra-models.explorer"); +const utils_1 = require("../utils"); +const enum_utils_1 = require("../utils/enum.utils"); +const is_body_parameter_util_1 = require("../utils/is-body-parameter.util"); +const is_built_in_type_util_1 = require("../utils/is-built-in-type.util"); +const is_date_ctor_util_1 = require("../utils/is-date-ctor.util"); +class SchemaObjectFactory { + constructor(modelPropertiesAccessor, swaggerTypesMapper) { + this.modelPropertiesAccessor = modelPropertiesAccessor; + this.swaggerTypesMapper = swaggerTypesMapper; + } + createFromModel(parameters, schemas) { + const parameterObjects = parameters.map((param) => { + if (this.isLazyTypeFunc(param.type)) { + [param.type, param.isArray] = (0, helpers_1.getTypeIsArrayTuple)(param.type(), undefined); + } + if (!(0, is_body_parameter_util_1.isBodyParameter)(param) && param.enumName) { + return this.createEnumParam(param, schemas); + } + if (this.isPrimitiveType(param.type)) { + return param; + } + if (this.isArrayCtor(param.type)) { + return this.mapArrayCtorParam(param); + } + if (!(0, is_body_parameter_util_1.isBodyParameter)(param)) { + return this.createQueryOrParamSchema(param, schemas); + } + return this.getCustomType(param, schemas); + }); + return (0, lodash_1.flatten)(parameterObjects); + } + getCustomType(param, schemas) { + const modelName = this.exploreModelSchema(param.type, schemas); + const name = param.name || modelName; + const schema = Object.assign(Object.assign({}, (param.schema || {})), { $ref: (0, utils_1.getSchemaPath)(modelName) }); + const isArray = param.isArray; + param = (0, lodash_1.omit)(param, 'isArray'); + if (isArray) { + return Object.assign(Object.assign({}, param), { name, schema: { + type: 'array', + items: schema + } }); + } + return Object.assign(Object.assign({}, param), { name, + schema }); + } + createQueryOrParamSchema(param, schemas) { + if ((0, is_date_ctor_util_1.isDateCtor)(param.type)) { + return Object.assign(Object.assign({ format: 'date-time' }, param), { type: 'string' }); + } + if (this.isBigInt(param.type)) { + return Object.assign(Object.assign({ format: 'int64' }, param), { type: 'integer' }); + } + if ((0, lodash_1.isFunction)(param.type)) { + if (param.name) { + const customType = this.getCustomType(param, schemas); + const schemaOptionsKeys = [ + ...this.swaggerTypesMapper.getSchemaOptionsKeys(), + 'allOf' + ]; + const schemaOptionsFromParam = {}; + for (const key of schemaOptionsKeys) { + if (key === 'type' || key === 'items') { + continue; + } + if (key in customType && !(key in (customType.schema || {}))) { + schemaOptionsFromParam[key] = customType[key]; + delete customType[key]; + } + } + if (Object.keys(schemaOptionsFromParam).length > 0) { + const existingSchema = (customType.schema || {}); + if ('$ref' in existingSchema) { + const { $ref, allOf: existingAllOf } = existingSchema, restSchema = __rest(existingSchema, ["$ref", "allOf"]); + const { allOf: paramAllOf } = schemaOptionsFromParam, restParamOptions = __rest(schemaOptionsFromParam, ["allOf"]); + const mergedAllOf = [ + ...(Array.isArray(existingAllOf) ? existingAllOf : []), + ...(Array.isArray(paramAllOf) ? paramAllOf : []), + { $ref: $ref } + ]; + customType.schema = Object.assign(Object.assign(Object.assign({}, restSchema), restParamOptions), { allOf: mergedAllOf }); + } + else { + const mergedSchema = Object.assign(Object.assign({}, existingSchema), schemaOptionsFromParam); + const existingAllOf = existingSchema.allOf; + const paramAllOf = schemaOptionsFromParam.allOf; + if (Array.isArray(existingAllOf) && Array.isArray(paramAllOf)) { + mergedSchema.allOf = [...existingAllOf, ...paramAllOf]; + } + customType.schema = mergedSchema; + } + } + return customType; + } + const propertiesWithType = this.extractPropertiesFromType(param.type, schemas); + if (!propertiesWithType) { + return param; + } + return propertiesWithType.map((property) => { + const keysToOmit = [ + 'isArray', + 'enumName', + 'enumSchema', + 'selfRequired' + ]; + const parameterObject = Object.assign(Object.assign({}, (0, lodash_1.omit)(property, keysToOmit)), { in: 'query', required: 'selfRequired' in property + ? property.selfRequired + : typeof property.required === 'boolean' + ? property.required + : true }); + const keysToMoveToSchema = [ + ...this.swaggerTypesMapper.getSchemaOptionsKeys(), + 'allOf' + ]; + return keysToMoveToSchema.reduce((acc, key) => { + if (key in property) { + acc.schema = Object.assign(Object.assign({}, acc.schema), { [key]: property[key] }); + delete acc[key]; + } + return acc; + }, parameterObject); + }); + } + if (this.isConstEnumObject(param.type)) { + const enumValues = (0, enum_utils_1.getEnumValues)(param.type); + const enumType = (0, enum_utils_1.getEnumType)(enumValues); + return Object.assign(Object.assign({}, param), { schema: { + type: enumType, + enum: enumValues + }, selfRequired: param.required }); + } + if (this.isObjectLiteral(param.type)) { + const schemaFromObjectLiteral = this.createFromObjectLiteral(param.name, param.type, schemas); + if (param.isArray) { + return Object.assign(Object.assign({}, param), { schema: { + type: 'array', + items: (0, lodash_1.omit)(schemaFromObjectLiteral, 'name') + }, selfRequired: param.required }); + } + return Object.assign(Object.assign({}, param), { schema: { + type: schemaFromObjectLiteral.type, + properties: schemaFromObjectLiteral.properties, + required: schemaFromObjectLiteral.required + }, selfRequired: param.required }); + } + return param; + } + extractPropertiesFromType(type, schemas, pendingSchemasRefs = []) { + const { prototype } = type; + if (!prototype) { + return; + } + const extraModels = (0, api_extra_models_explorer_1.exploreGlobalApiExtraModelsMetadata)(type); + extraModels.forEach((item) => this.exploreModelSchema(item, schemas, pendingSchemasRefs)); + this.modelPropertiesAccessor.applyMetadataFactory(prototype); + const modelProperties = this.modelPropertiesAccessor.getModelProperties(prototype); + const propertiesWithType = modelProperties.map((key) => { + let property; + try { + property = this.mergePropertyWithMetadata(key, prototype, schemas, pendingSchemasRefs); + } + catch (err) { + if (err instanceof Error) { + const className = (type === null || type === void 0 ? void 0 : type.name) || 'UnknownType'; + const prefix = `[${className}] `; + if (!err.message.startsWith(prefix)) { + err.message = `${prefix}${err.message}`; + } + } + throw err; + } + const schemaCombinators = ['oneOf', 'anyOf', 'allOf']; + const declaredSchemaCombinator = schemaCombinators.find((combinator) => combinator in property); + if (declaredSchemaCombinator) { + const reflectedPropertyMetadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, prototype, key); + const hasDeclaredSchemaCombinator = schemaCombinators.some((combinator) => combinator in (reflectedPropertyMetadata || {})); + const schemaObjectMetadata = property; + if ((schemaObjectMetadata === null || schemaObjectMetadata === void 0 ? void 0 : schemaObjectMetadata.type) === 'array' || + schemaObjectMetadata.isArray) { + schemaObjectMetadata.items = {}; + schemaObjectMetadata.items[declaredSchemaCombinator] = + property[declaredSchemaCombinator]; + delete property[declaredSchemaCombinator]; + } + else if (hasDeclaredSchemaCombinator) { + delete schemaObjectMetadata.type; + } + } + return property; + }); + return propertiesWithType; + } + exploreModelSchema(type, schemas, pendingSchemasRefs = []) { + if (this.isLazyTypeFunc(type)) { + type = type(); + } + const propertiesWithType = this.extractPropertiesFromType(type, schemas, pendingSchemasRefs); + if (!propertiesWithType) { + return ''; + } + const extensionProperties = Reflect.getMetadata(constants_1.DECORATORS.API_EXTENSION, type) || {}; + const { schemaName, schemaProperties } = this.getSchemaMetadata(type); + const typeDefinition = Object.assign(Object.assign({ type: 'object', properties: (0, lodash_1.mapValues)((0, lodash_1.keyBy)(propertiesWithType, 'name'), (property) => { + const keysToOmit = [ + 'name', + 'isArray', + 'enumName', + 'enumSchema', + 'selfRequired' + ]; + if ('required' in property && Array.isArray(property.required)) { + return (0, lodash_1.omit)(property, keysToOmit); + } + return (0, lodash_1.omit)(property, [...keysToOmit, 'required']); + }) }, extensionProperties), schemaProperties); + const typeDefinitionRequiredFields = propertiesWithType + .filter((property) => 'selfRequired' in property + ? property.selfRequired != false + : property.required != false && !Array.isArray(property.required)) + .map((property) => property.name); + if (typeDefinitionRequiredFields.length > 0) { + typeDefinition['required'] = typeDefinitionRequiredFields; + } + if (schemas[schemaName] && !(0, lodash_1.isEqual)(schemas[schemaName], typeDefinition)) { + common_1.Logger.warn(`Duplicate DTO detected: "${schemaName}" is defined multiple times with different schemas.\n` + + `Consider using unique class names or applying @ApiExtraModels() decorator with custom schema names.\n` + + `Note: This will throw an error in the next major version.`); + } + schemas[schemaName] = typeDefinition; + return schemaName; + } + getSchemaMetadata(type) { + var _a, _b; + const schemas = (_a = Reflect.getOwnMetadata(constants_1.DECORATORS.API_SCHEMA, type)) !== null && _a !== void 0 ? _a : []; + const _c = (_b = schemas[schemas.length - 1]) !== null && _b !== void 0 ? _b : {}, { name } = _c, schemaProperties = __rest(_c, ["name"]); + return { schemaName: name !== null && name !== void 0 ? name : type.name, schemaProperties }; + } + mergePropertyWithMetadata(key, prototype, schemas, pendingSchemaRefs, metadata) { + if (!metadata) { + metadata = + (0, lodash_1.omit)(Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, prototype, key), 'link') || {}; + } + if (this.isLazyTypeFunc(metadata.type)) { + metadata.type = metadata.type(); + [metadata.type, metadata.isArray] = (0, helpers_1.getTypeIsArrayTuple)(metadata.type, metadata.isArray); + } + if (Array.isArray(metadata.type)) { + return this.createFromNestedArray(key, metadata, schemas, pendingSchemaRefs); + } + return this.createSchemaMetadata(key, metadata, schemas, pendingSchemaRefs); + } + createEnumParam(param, schemas) { + var _a, _b, _c, _d, _e; + const enumName = param.enumName; + const $ref = (0, utils_1.getSchemaPath)(enumName); + if (!(enumName in schemas)) { + const _enum = param.enum + ? param.enum + : param.schema + ? param.schema['items'] + ? param.schema['items']['enum'] + : param.schema['enum'] + : param.isArray && param.items + ? param.items.enum + : undefined; + schemas[enumName] = Object.assign(Object.assign({ type: (_d = (param.isArray + ? (_b = (_a = param.schema) === null || _a === void 0 ? void 0 : _a['items']) === null || _b === void 0 ? void 0 : _b['type'] + : (_c = param.schema) === null || _c === void 0 ? void 0 : _c['type'])) !== null && _d !== void 0 ? _d : 'string', enum: _enum }, param.enumSchema), (param['x-enumNames'] ? { 'x-enumNames': param['x-enumNames'] } : {})); + } + else { + if (param.enumSchema) { + schemas[enumName] = Object.assign(Object.assign({}, schemas[enumName]), param.enumSchema); + } + } + const newSchema = param.isArray || ((_e = param.schema) === null || _e === void 0 ? void 0 : _e['items']) + ? { type: 'array', items: { $ref } } + : { $ref }; + return (0, lodash_1.omit)(Object.assign(Object.assign({}, param), { schema: newSchema }), ['isArray', 'items', 'enumName', 'enum', 'x-enumNames', 'enumSchema']); + } + createEnumSchemaType(key, metadata, schemas) { + var _a, _b, _c; + if (!('enumName' in metadata) || !metadata.enumName) { + return Object.assign(Object.assign({}, metadata), { name: metadata.name || key }); + } + const enumName = metadata.enumName; + const $ref = (0, utils_1.getSchemaPath)(enumName); + const enumType = (_a = (metadata.isArray ? metadata.items['type'] : metadata.type)) !== null && _a !== void 0 ? _a : 'string'; + if (!schemas[enumName]) { + schemas[enumName] = Object.assign(Object.assign({ type: enumType }, metadata.enumSchema), { enum: metadata.isArray && metadata.items + ? metadata.items['enum'] + : metadata.enum, description: (_b = metadata.description) !== null && _b !== void 0 ? _b : undefined, 'x-enumNames': (_c = metadata['x-enumNames']) !== null && _c !== void 0 ? _c : undefined }); + } + else { + if (metadata.enumSchema) { + schemas[enumName] = Object.assign(Object.assign({}, schemas[enumName]), metadata.enumSchema); + } + if (metadata['x-enumNames']) { + schemas[enumName]['x-enumNames'] = metadata['x-enumNames']; + } + } + const _schemaObject = Object.assign(Object.assign({}, metadata), { name: metadata.name || key, type: metadata.isArray ? 'array' : 'string' }); + const existingCombinator = ['oneOf', 'anyOf'].find((key) => key in metadata && Array.isArray(metadata[key])); + const refHost = metadata.isArray + ? { items: { $ref } } + : existingCombinator + ? { [existingCombinator]: [...metadata[existingCombinator], { $ref }] } + : { allOf: [{ $ref }] }; + const paramObject = Object.assign(Object.assign({}, _schemaObject), refHost); + const pathsToOmit = ['enum', 'enumName', 'enumSchema', 'x-enumNames']; + if (!metadata.isArray) { + pathsToOmit.push('type'); + } + return (0, lodash_1.omit)(paramObject, pathsToOmit); + } + createNotBuiltInTypeReference(key, metadata, trueMetadataType, schemas, pendingSchemaRefs) { + if ((0, shared_utils_1.isUndefined)(trueMetadataType)) { + const errorIn = (pendingSchemaRefs === null || pendingSchemaRefs === void 0 ? void 0 : pendingSchemaRefs.length) > 0 + ? `in "${pendingSchemaRefs[pendingSchemaRefs.length - 1]}" ` + : ''; + throw new Error(`A circular dependency has been detected ${errorIn}(property key: "${key}"). To resolve this, use a lazy resolver for the property type ("type: () => ClassType") on each side of the relationship, or break the cycle by introducing a reference via @ApiExtraModels.`); + } + let { schemaName: schemaObjectName } = this.getSchemaMetadata(trueMetadataType); + if (!(schemaObjectName in schemas) && + !pendingSchemaRefs.includes(schemaObjectName)) { + schemaObjectName = this.exploreModelSchema(trueMetadataType, schemas, [...pendingSchemaRefs, schemaObjectName]); + } + const $ref = (0, utils_1.getSchemaPath)(schemaObjectName); + if (metadata.isArray) { + return this.transformToArraySchemaProperty(metadata, key, { $ref }); + } + const keysToRemove = ['type', 'isArray', 'required', 'name']; + const validMetadataObject = (0, lodash_1.omit)(metadata, keysToRemove); + const extraMetadataKeys = Object.keys(validMetadataObject); + if (extraMetadataKeys.length > 0) { + return Object.assign(Object.assign(Object.assign({ name: metadata.name || key, required: metadata.required }, validMetadataObject), (validMetadataObject['nullable'] ? { type: 'object' } : {})), { allOf: [{ $ref }] }); + } + return { + name: metadata.name || key, + required: metadata.required, + $ref + }; + } + transformToArraySchemaProperty(metadata, key, type) { + const keysToRemove = ['type', 'enum']; + const [movedProperties, keysToMove] = this.extractPropertyModifiers(metadata); + const schemaHost = Object.assign(Object.assign({}, (0, lodash_1.omit)(metadata, [...keysToRemove, ...keysToMove])), { name: metadata.name || key, type: 'array', items: metadata.items + ? Object.assign(Object.assign({}, metadata.items), movedProperties) : (0, lodash_1.isString)(type) + ? Object.assign({ type }, movedProperties) : Object.assign(Object.assign({}, type), movedProperties) }); + schemaHost.items = (0, lodash_1.omitBy)(schemaHost.items, shared_utils_1.isUndefined); + return schemaHost; + } + mapArrayCtorParam(param) { + return Object.assign(Object.assign({}, (0, lodash_1.omit)(param, 'type')), { schema: { + type: 'array', + items: { + type: 'string' + } + } }); + } + createFromObjectLiteral(key, literalObj, schemas) { + const objLiteralKeys = Object.keys(literalObj); + const properties = {}; + const required = []; + objLiteralKeys.forEach((key) => { + var _a, _b; + const propertyCompilerMetadata = literalObj[key]; + if ((0, enum_utils_1.isEnumArray)(propertyCompilerMetadata)) { + propertyCompilerMetadata.type = 'array'; + const enumValues = (0, enum_utils_1.getEnumValues)(propertyCompilerMetadata.enum); + propertyCompilerMetadata.items = { + type: (_b = (_a = propertyCompilerMetadata.items) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : (0, enum_utils_1.getEnumType)(enumValues), + enum: enumValues + }; + delete propertyCompilerMetadata.enum; + } + else if (propertyCompilerMetadata.enum) { + const enumValues = (0, enum_utils_1.getEnumValues)(propertyCompilerMetadata.enum); + propertyCompilerMetadata.enum = enumValues; + if (!propertyCompilerMetadata.type) { + propertyCompilerMetadata.type = (0, enum_utils_1.getEnumType)(enumValues); + } + } + const propertyMetadata = this.mergePropertyWithMetadata(key, Object, schemas, [], propertyCompilerMetadata); + if ('required' in propertyMetadata && propertyMetadata.required) { + required.push(key); + } + const keysToRemove = ['isArray', 'name', 'required']; + const validMetadataObject = (0, lodash_1.omit)(propertyMetadata, keysToRemove); + properties[key] = validMetadataObject; + }); + const schema = { + name: key, + type: 'object', + properties, + required + }; + return schema; + } + createFromNestedArray(key, metadata, schemas, pendingSchemaRefs) { + const recurse = (type) => { + if (!Array.isArray(type)) { + const schemaMetadata = this.createSchemaMetadata(key, metadata, schemas, pendingSchemaRefs, type); + return (0, lodash_1.omit)(schemaMetadata, ['isArray', 'name']); + } + return { + name: key, + type: 'array', + items: recurse(type[0]) + }; + }; + return recurse(metadata.type); + } + createSchemaMetadata(key, metadata, schemas, pendingSchemaRefs, nestedArrayType) { + const typeRef = nestedArrayType || metadata.type; + if (metadata.enum && typeRef === Object) { + const enumValues = (0, enum_utils_1.getEnumValues)(metadata.enum); + const enumType = (0, enum_utils_1.getEnumType)(enumValues); + if (metadata.isArray) { + return this.transformToArraySchemaProperty(Object.assign(Object.assign({}, metadata), { items: { + type: enumType, + enum: enumValues + } }), key, { type: enumType, enum: enumValues }); + } + return this.createSchemaMetadata(key, Object.assign(Object.assign({}, metadata), { type: enumType, enum: enumValues }), schemas, pendingSchemaRefs, enumType); + } + if (this.isConstEnumObject(typeRef)) { + const enumValues = (0, enum_utils_1.getEnumValues)(typeRef); + const enumType = (0, enum_utils_1.getEnumType)(enumValues); + const syntheticMetadata = Object.assign(Object.assign({}, metadata), { type: enumType, enum: enumValues }); + return this.createSchemaMetadata(key, syntheticMetadata, schemas, pendingSchemaRefs, enumType); + } + if (this.isObjectLiteral(typeRef)) { + const schemaFromObjectLiteral = this.createFromObjectLiteral(key, typeRef, schemas); + if (metadata.isArray) { + return { + name: schemaFromObjectLiteral.name, + type: 'array', + items: (0, lodash_1.omit)(schemaFromObjectLiteral, 'name'), + selfRequired: metadata.required + }; + } + return Object.assign(Object.assign({}, schemaFromObjectLiteral), { selfRequired: metadata.required }); + } + if ((0, lodash_1.isString)(typeRef)) { + if ((0, enum_utils_1.isEnumMetadata)(metadata)) { + return this.createEnumSchemaType(key, metadata, schemas); + } + if (metadata.isArray) { + return this.transformToArraySchemaProperty(metadata, key, typeRef); + } + return Object.assign(Object.assign({}, metadata), { name: metadata.name || key }); + } + if ((0, is_date_ctor_util_1.isDateCtor)(typeRef)) { + if (metadata.isArray) { + return this.transformToArraySchemaProperty(metadata, key, { + format: metadata.format || 'date-time', + type: 'string' + }); + } + return Object.assign(Object.assign({ format: 'date-time' }, metadata), { type: 'string', name: metadata.name || key }); + } + if (this.isBigInt(typeRef)) { + return Object.assign(Object.assign({ format: 'int64' }, metadata), { type: 'integer', name: metadata.name || key }); + } + if (!(0, is_built_in_type_util_1.isBuiltInType)(typeRef)) { + return this.createNotBuiltInTypeReference(key, metadata, typeRef, schemas, pendingSchemaRefs); + } + const typeName = this.getTypeName(typeRef); + const itemType = this.swaggerTypesMapper.mapTypeToOpenAPIType(typeName); + if (metadata.isArray) { + return this.transformToArraySchemaProperty(metadata, key, { + type: itemType + }); + } + else if (itemType === 'array') { + const defaultOnArray = 'string'; + const hasSchemaCombinator = ['oneOf', 'anyOf', 'allOf'].some((combinator) => combinator in metadata); + if (hasSchemaCombinator) { + return Object.assign(Object.assign({}, metadata), { type: undefined, name: metadata.name || key }); + } + return this.transformToArraySchemaProperty(metadata, key, { + type: defaultOnArray + }); + } + return Object.assign(Object.assign({}, metadata), { name: metadata.name || key, type: itemType }); + } + isArrayCtor(type) { + return type === Array; + } + isPrimitiveType(type) { + return ((0, lodash_1.isFunction)(type) && + [String, Boolean, Number].some((item) => item === type)); + } + isLazyTypeFunc(type) { + return (0, lodash_1.isFunction)(type) && type.name == 'type'; + } + getTypeName(type) { + return type && (0, lodash_1.isFunction)(type) ? type.name : type; + } + isObjectLiteral(obj) { + if (typeof obj !== 'object' || !obj) { + return false; + } + const hasOwnProp = Object.prototype.hasOwnProperty; + let objPrototype = obj; + while (Object.getPrototypeOf((objPrototype = Object.getPrototypeOf(objPrototype))) !== null) + ; + for (const prop in obj) { + if (!hasOwnProp.call(obj, prop) && !hasOwnProp.call(objPrototype, prop)) { + return false; + } + } + return Object.getPrototypeOf(obj) === objPrototype; + } + isBigInt(type) { + return type === BigInt; + } + isConstEnumObject(obj) { + if (typeof obj !== 'object' || !obj || Array.isArray(obj)) { + return false; + } + const values = Object.values(obj); + if (values.length === 0) { + return false; + } + return values.every((value) => typeof value === 'string' || typeof value === 'number'); + } + extractPropertyModifiers(metadata) { + const modifierKeys = [ + 'format', + 'maximum', + 'maxLength', + 'minimum', + 'minLength', + 'pattern' + ]; + return [(0, lodash_1.pick)(metadata, modifierKeys), modifierKeys]; + } +} +exports.SchemaObjectFactory = SchemaObjectFactory; diff --git a/node_modules/@nestjs/swagger/dist/services/standard-schema-openapi.converter.d.ts b/node_modules/@nestjs/swagger/dist/services/standard-schema-openapi.converter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a336bae5468f2ce730f5bdebd3aaeabbed8a672 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/standard-schema-openapi.converter.d.ts @@ -0,0 +1,21 @@ +import type { StandardSchemaConverter } from '../interfaces/swagger-document-options.interface.js'; +import { ReferenceObject, SchemaObject } from '../interfaces/open-api-spec.interface.js'; +export interface ConvertedStandardSchema { + schema: SchemaObject | ReferenceObject; + components: Record; +} +export declare class StandardSchemaOpenApiConverter { + private readonly schemaConverter?; + constructor(schemaConverter?: StandardSchemaConverter); + convert(schema: unknown, schemaType?: 'input' | 'output'): ConvertedStandardSchema | undefined; + private isStandardSchema; + private hasStandardJsonSchema; + private normalizeCustomConvertedSchema; + private normalizeConvertedSchema; + private rewriteComponents; + private getDefinitionEntries; + private rewriteDefinitionRefs; + private rewriteValue; + private normalizeSchemaExamples; + private normalizeSchemaConst; +} diff --git a/node_modules/@nestjs/swagger/dist/services/standard-schema-openapi.converter.js b/node_modules/@nestjs/swagger/dist/services/standard-schema-openapi.converter.js new file mode 100644 index 0000000000000000000000000000000000000000..d5e1e9eae4bc07e5e4c4c202be90e3b3ed1aa7a8 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/standard-schema-openapi.converter.js @@ -0,0 +1,121 @@ +import { omit, omitBy, transform } from 'es-toolkit/compat'; +export class StandardSchemaOpenApiConverter { + constructor(schemaConverter) { + this.schemaConverter = schemaConverter; + } + convert(schema, schemaType = 'input') { + if (!this.isStandardSchema(schema)) { + return undefined; + } + const customSchema = this.schemaConverter?.(schema, { schemaType }); + if (customSchema) { + return this.normalizeCustomConvertedSchema(customSchema); + } + if (!this.hasStandardJsonSchema(schema)) { + return undefined; + } + const convert = schema['~standard'].jsonSchema?.[schemaType]; + if (!convert) { + return undefined; + } + const convertedSchema = convert({ target: 'openapi-3.0' }); + if (!convertedSchema || typeof convertedSchema !== 'object') { + return undefined; + } + return this.normalizeConvertedSchema(convertedSchema); + } + isStandardSchema(schema) { + return !!(schema && typeof schema === 'object' && '~standard' in schema); + } + hasStandardJsonSchema(schema) { + const standard = schema['~standard']; + return !!standard && 'jsonSchema' in standard; + } + normalizeCustomConvertedSchema(convertedSchema) { + return { + schema: this.rewriteDefinitionRefs(convertedSchema.schema), + components: this.rewriteComponents(convertedSchema.components || {}) + }; + } + normalizeConvertedSchema(schema, components = {}) { + const normalizedComponents = this.getDefinitionEntries(schema).reduce((acc, [name, definition]) => ({ + ...acc, + [name]: this.rewriteDefinitionRefs(definition) + }), {}); + return { + schema: this.rewriteDefinitionRefs(omit(schema, ['$defs', 'definitions', '$schema'])), + components: { + ...this.rewriteComponents(components), + ...normalizedComponents + } + }; + } + rewriteComponents(components) { + return Object.entries(components).reduce((acc, [name, definition]) => ({ + ...acc, + [name]: this.rewriteDefinitionRefs(definition) + }), {}); + } + getDefinitionEntries(schema) { + const definitions = schema.$defs || schema.definitions; + if (!definitions || typeof definitions !== 'object') { + return []; + } + return Object.entries(definitions); + } + rewriteDefinitionRefs(value) { + if (Array.isArray(value)) { + return value.map((item) => this.rewriteValue(item)); + } + const rewrittenValue = omitBy(transform(value, (result, currentValue, key) => { + result[key] = this.rewriteValue(currentValue); + }, {}), (currentValue) => currentValue === undefined); + return this.normalizeSchemaExamples(rewrittenValue); + } + rewriteValue(value) { + if (Array.isArray(value)) { + return value.map((item) => this.rewriteValue(item)); + } + if (!value || typeof value !== 'object') { + return value; + } + const currentValue = value; + if (typeof currentValue.$ref === 'string') { + return { + ...this.rewriteDefinitionRefs(omit(currentValue, ['$ref'])), + $ref: currentValue.$ref + .replace('#/$defs/', '#/components/schemas/') + .replace('#/definitions/', '#/components/schemas/') + }; + } + return this.rewriteDefinitionRefs(currentValue); + } + normalizeSchemaExamples(value) { + const normalizedConstValue = this.normalizeSchemaConst(value); + if (!Array.isArray(normalizedConstValue.examples) || + normalizedConstValue.example !== undefined) { + return normalizedConstValue; + } + const [firstExample] = normalizedConstValue.examples; + return { + ...omit(normalizedConstValue, ['examples']), + example: firstExample + }; + } + normalizeSchemaConst(value) { + if (!('const' in value)) { + return value; + } + const constValue = value.const; + if (!Array.isArray(value.examples) || value.example !== undefined) { + return { + ...omit(value, ['const']), + enum: value.enum ?? [constValue] + }; + } + return { + ...omit(value, ['const']), + enum: value.enum ?? [constValue] + }; + } +} diff --git a/node_modules/@nestjs/swagger/dist/services/swagger-types-mapper.d.ts b/node_modules/@nestjs/swagger/dist/services/swagger-types-mapper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3f807f8d132cce31a2a736e6764efdeaf14effa5 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/swagger-types-mapper.d.ts @@ -0,0 +1,260 @@ +import { ApiPropertyOptions } from '../decorators'; +import { BaseParameterObject, ReferenceObject, SchemaObject } from '../interfaces/open-api-spec.interface'; +import { ParamWithTypeMetadata } from './parameter-metadata-accessor'; +type KeysToRemove = keyof ApiPropertyOptions | '$ref' | 'properties' | 'enumName' | 'enumSchema' | 'selfRequired'; +export declare class SwaggerTypesMapper { + private readonly keysToRemove; + mapParamTypes(parameters: Array): (Partial | Partial | { + schema: { + type: string; + items: any; + nullable?: boolean; + discriminator?: import("../interfaces/open-api-spec.interface").DiscriminatorObject; + readOnly?: boolean; + writeOnly?: boolean; + xml?: import("../interfaces/open-api-spec.interface").XmlObject; + externalDocs?: import("../interfaces/open-api-spec.interface").ExternalDocumentationObject; + example?: any; + examples?: any[] | Record; + deprecated?: boolean; + allOf?: (SchemaObject | ReferenceObject)[]; + oneOf?: (SchemaObject | ReferenceObject)[]; + anyOf?: (SchemaObject | ReferenceObject)[]; + not?: SchemaObject | ReferenceObject; + properties?: Record; + additionalProperties?: SchemaObject | ReferenceObject | boolean; + patternProperties?: SchemaObject | ReferenceObject | any; + description?: string; + format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat; + default?: any; + title?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: string[]; + enum?: any[]; + 'x-enumNames'?: string[]; + }; + } | { + schema: import("lodash").Dictionary; + description?: string; + required?: boolean; + deprecated?: boolean; + allowEmptyValue?: boolean; + style?: import("../interfaces/open-api-spec.interface").ParameterStyle; + explode?: boolean; + allowReserved?: boolean; + examples?: Record; + example?: any; + content?: import("../interfaces/open-api-spec.interface").ContentObject; + } | { + schema: import("lodash").Dictionary; + name?: string | number | object; + type?: import("@nestjs/common").Type; + in?: import("../interfaces/open-api-spec.interface").ParameterLocation | "body" | "placeholder"; + isArray?: boolean; + items?: SchemaObject; + required?: boolean; + enum?: unknown[]; + enumName?: string; + enumSchema?: import("../interfaces/enum-schema-attributes.interface").EnumSchemaAttributes; + selfRequired?: boolean; + })[]; + mapTypeToOpenAPIType(type: string | Function): string; + mapEnumArrayType(param: Record, keysToRemove: KeysToRemove[]): { + schema: { + type: string; + items: any; + nullable?: boolean; + discriminator?: import("../interfaces/open-api-spec.interface").DiscriminatorObject; + readOnly?: boolean; + writeOnly?: boolean; + xml?: import("../interfaces/open-api-spec.interface").XmlObject; + externalDocs?: import("../interfaces/open-api-spec.interface").ExternalDocumentationObject; + example?: any; + examples?: any[] | Record; + deprecated?: boolean; + allOf?: (SchemaObject | ReferenceObject)[]; + oneOf?: (SchemaObject | ReferenceObject)[]; + anyOf?: (SchemaObject | ReferenceObject)[]; + not?: SchemaObject | ReferenceObject; + properties?: Record; + additionalProperties?: SchemaObject | ReferenceObject | boolean; + patternProperties?: SchemaObject | ReferenceObject | any; + description?: string; + format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat; + default?: any; + title?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: string[]; + enum?: any[]; + 'x-enumNames'?: string[]; + }; + }; + mapArrayType(param: (ParamWithTypeMetadata & SchemaObject) | BaseParameterObject, keysToRemove: KeysToRemove[]): { + schema: { + type: string; + items: any; + nullable?: boolean; + discriminator?: import("../interfaces/open-api-spec.interface").DiscriminatorObject; + readOnly?: boolean; + writeOnly?: boolean; + xml?: import("../interfaces/open-api-spec.interface").XmlObject; + externalDocs?: import("../interfaces/open-api-spec.interface").ExternalDocumentationObject; + example?: any; + examples?: any[] | Record; + deprecated?: boolean; + allOf?: (SchemaObject | ReferenceObject)[]; + oneOf?: (SchemaObject | ReferenceObject)[]; + anyOf?: (SchemaObject | ReferenceObject)[]; + not?: SchemaObject | ReferenceObject; + properties?: Record; + additionalProperties?: SchemaObject | ReferenceObject | boolean; + patternProperties?: SchemaObject | ReferenceObject | any; + description?: string; + format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat; + default?: any; + title?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: string[]; + enum?: any[]; + 'x-enumNames'?: string[]; + }; + description?: string; + required?: boolean; + deprecated?: boolean; + allowEmptyValue?: boolean; + style?: import("../interfaces/open-api-spec.interface").ParameterStyle; + explode?: boolean; + allowReserved?: boolean; + examples?: Record; + example?: any; + content?: import("../interfaces/open-api-spec.interface").ContentObject; + } | { + schema: { + type: string; + items: any; + nullable?: boolean; + discriminator?: import("../interfaces/open-api-spec.interface").DiscriminatorObject; + readOnly?: boolean; + writeOnly?: boolean; + xml?: import("../interfaces/open-api-spec.interface").XmlObject; + externalDocs?: import("../interfaces/open-api-spec.interface").ExternalDocumentationObject; + example?: any; + examples?: any[] | Record; + deprecated?: boolean; + allOf?: (SchemaObject | ReferenceObject)[]; + oneOf?: (SchemaObject | ReferenceObject)[]; + anyOf?: (SchemaObject | ReferenceObject)[]; + not?: SchemaObject | ReferenceObject; + properties?: Record; + additionalProperties?: SchemaObject | ReferenceObject | boolean; + patternProperties?: SchemaObject | ReferenceObject | any; + description?: string; + format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat; + default?: any; + title?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: string[]; + enum?: any[]; + 'x-enumNames'?: string[]; + }; + name?: string | number | object; + type?: import("@nestjs/common").Type & string; + in?: import("../interfaces/open-api-spec.interface").ParameterLocation | "body" | "placeholder"; + isArray?: boolean; + items?: SchemaObject | (SchemaObject & ReferenceObject); + required?: boolean & string[]; + enum?: unknown[] & any[]; + enumName?: string; + enumSchema?: import("../interfaces/enum-schema-attributes.interface").EnumSchemaAttributes; + selfRequired?: boolean; + nullable?: boolean; + discriminator?: import("../interfaces/open-api-spec.interface").DiscriminatorObject; + readOnly?: boolean; + writeOnly?: boolean; + xml?: import("../interfaces/open-api-spec.interface").XmlObject; + externalDocs?: import("../interfaces/open-api-spec.interface").ExternalDocumentationObject; + example?: any; + examples?: any[] | Record; + deprecated?: boolean; + allOf?: (SchemaObject | ReferenceObject)[]; + oneOf?: (SchemaObject | ReferenceObject)[]; + anyOf?: (SchemaObject | ReferenceObject)[]; + not?: SchemaObject | ReferenceObject; + properties?: Record; + additionalProperties?: SchemaObject | ReferenceObject | boolean; + patternProperties?: SchemaObject | ReferenceObject | any; + description?: string; + format?: import("../interfaces/open-api-spec.interface").OpenAPIFormat; + default?: any; + title?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: boolean; + minimum?: number; + exclusiveMinimum?: boolean; + maxLength?: number; + minLength?: number; + pattern?: string; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + 'x-enumNames'?: string[]; + }; + getSchemaOptionsKeys(): Array; + private getSchemaOptions; + private isEnumArrayType; + private hasSchemaDefinition; + private hasRawContentDefinition; + private omitParamKeys; +} +export {}; diff --git a/node_modules/@nestjs/swagger/dist/services/swagger-types-mapper.js b/node_modules/@nestjs/swagger/dist/services/swagger-types-mapper.js new file mode 100644 index 0000000000000000000000000000000000000000..daa6b7b3cce56a71df0edd80580353bf2b9a166b --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/services/swagger-types-mapper.js @@ -0,0 +1,108 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SwaggerTypesMapper = void 0; +const lodash_1 = require("lodash"); +class SwaggerTypesMapper { + constructor() { + this.keysToRemove = [ + 'isArray', + 'enum', + 'enumName', + 'enumSchema', + '$ref', + 'selfRequired', + ...this.getSchemaOptionsKeys() + ]; + } + mapParamTypes(parameters) { + return parameters.map((param) => { + if (this.hasSchemaDefinition(param) || + this.hasRawContentDefinition(param)) { + if (Array.isArray(param.required) && 'schema' in param) { + param.schema.required = param.required; + delete param.required; + } + if ('selfRequired' in param) { + param.required = param.selfRequired; + } + return this.omitParamKeys(param); + } + const { type } = param; + const typeName = type && (0, lodash_1.isFunction)(type) + ? this.mapTypeToOpenAPIType(type.name) + : this.mapTypeToOpenAPIType(type); + const paramWithTypeMetadata = (0, lodash_1.omitBy)(Object.assign(Object.assign({}, param), { type: typeName }), lodash_1.isUndefined); + if (this.isEnumArrayType(paramWithTypeMetadata)) { + return this.mapEnumArrayType(paramWithTypeMetadata, this.keysToRemove); + } + else if (paramWithTypeMetadata.isArray) { + return this.mapArrayType(paramWithTypeMetadata, this.keysToRemove); + } + return Object.assign(Object.assign({}, (0, lodash_1.omit)(param, this.keysToRemove)), { schema: (0, lodash_1.omitBy)(Object.assign(Object.assign(Object.assign({}, this.getSchemaOptions(param)), (param.schema || {})), { enum: paramWithTypeMetadata.enum, type: paramWithTypeMetadata.type, $ref: paramWithTypeMetadata.$ref }), lodash_1.isUndefined) }); + }); + } + mapTypeToOpenAPIType(type) { + if (!(type && type.charAt)) { + return; + } + return type.charAt(0).toLowerCase() + type.slice(1); + } + mapEnumArrayType(param, keysToRemove) { + return Object.assign(Object.assign({}, (0, lodash_1.omit)(param, keysToRemove)), { schema: Object.assign(Object.assign({}, this.getSchemaOptions(param)), { type: 'array', items: param.items }) }); + } + mapArrayType(param, keysToRemove) { + const itemsModifierKeys = ['format', 'maximum', 'minimum', 'pattern']; + const items = param.items || + (0, lodash_1.omitBy)(Object.assign(Object.assign({}, (param.schema || {})), { enum: param.enum, type: this.mapTypeToOpenAPIType(param.type) }), lodash_1.isUndefined); + const modifierProperties = (0, lodash_1.pick)(param, itemsModifierKeys); + return Object.assign(Object.assign({}, (0, lodash_1.omit)(param, keysToRemove)), { schema: Object.assign(Object.assign({}, (0, lodash_1.omit)(this.getSchemaOptions(param), [...itemsModifierKeys])), { type: 'array', items: (0, lodash_1.isString)(items.type) + ? Object.assign({ type: items.type }, modifierProperties) : Object.assign(Object.assign({}, items.type), modifierProperties) }) }); + } + getSchemaOptionsKeys() { + return [ + 'properties', + 'patternProperties', + 'additionalProperties', + 'minimum', + 'maximum', + 'maxProperties', + 'minItems', + 'minProperties', + 'maxItems', + 'minLength', + 'maxLength', + 'exclusiveMaximum', + 'exclusiveMinimum', + 'uniqueItems', + 'multipleOf', + 'title', + 'format', + 'pattern', + 'nullable', + 'default', + 'example', + 'oneOf', + 'anyOf', + 'type', + 'items' + ]; + } + getSchemaOptions(param) { + const schemaKeys = this.getSchemaOptionsKeys(); + const optionsObject = schemaKeys.reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: param[key] })), {}); + return (0, lodash_1.omitBy)(optionsObject, lodash_1.isUndefined); + } + isEnumArrayType(param) { + return param.isArray && param.items && param.items.enum; + } + hasSchemaDefinition(param) { + return !!param.schema; + } + hasRawContentDefinition(param) { + return 'content' in param; + } + omitParamKeys(param) { + return (0, lodash_1.omit)(param, this.keysToRemove); + } +} +exports.SwaggerTypesMapper = SwaggerTypesMapper; diff --git a/node_modules/@nestjs/swagger/dist/storages/global-parameters.storage.d.ts b/node_modules/@nestjs/swagger/dist/storages/global-parameters.storage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5de3fbb248c43e3886847793cbdeecbefae50894 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/storages/global-parameters.storage.d.ts @@ -0,0 +1,8 @@ +import { ParameterObject } from '../interfaces/open-api-spec.interface'; +export declare class GlobalParametersStorageHost { + private parameters; + add(...parameters: ParameterObject[]): void; + getAll(): ParameterObject[]; + clear(): void; +} +export declare const GlobalParametersStorage: GlobalParametersStorageHost; diff --git a/node_modules/@nestjs/swagger/dist/storages/global-parameters.storage.js b/node_modules/@nestjs/swagger/dist/storages/global-parameters.storage.js new file mode 100644 index 0000000000000000000000000000000000000000..a8d7b0e6d3dfa527cab37c1a7cfad467fa3eaa9a --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/storages/global-parameters.storage.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GlobalParametersStorage = exports.GlobalParametersStorageHost = void 0; +class GlobalParametersStorageHost { + constructor() { + this.parameters = new Array(); + } + add(...parameters) { + this.parameters.push(...parameters); + } + getAll() { + return this.parameters; + } + clear() { + this.parameters = []; + } +} +exports.GlobalParametersStorageHost = GlobalParametersStorageHost; +const globalRef = global; +exports.GlobalParametersStorage = globalRef.SwaggerGlobalParametersStorage || + (globalRef.SwaggerGlobalParametersStorage = + new GlobalParametersStorageHost()); diff --git a/node_modules/@nestjs/swagger/dist/storages/global-responses.storage.d.ts b/node_modules/@nestjs/swagger/dist/storages/global-responses.storage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..64ac45ddea2e416eaf64987c568a110d26c77217 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/storages/global-responses.storage.d.ts @@ -0,0 +1,10 @@ +import { ApiResponseOptions } from '../decorators'; +type GlobalResponesMap = Record>; +export declare class GlobalResponsesStorageHost { + private responses; + add(responses: GlobalResponesMap): void; + getAll(): GlobalResponesMap; + clear(): void; +} +export declare const GlobalResponsesStorage: GlobalResponsesStorageHost; +export {}; diff --git a/node_modules/@nestjs/swagger/dist/storages/global-responses.storage.js b/node_modules/@nestjs/swagger/dist/storages/global-responses.storage.js new file mode 100644 index 0000000000000000000000000000000000000000..0468d933ae01cce2e95ef15ba9c9f4c0e5198007 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/storages/global-responses.storage.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GlobalResponsesStorage = exports.GlobalResponsesStorageHost = void 0; +class GlobalResponsesStorageHost { + constructor() { + this.responses = {}; + } + add(responses) { + this.responses = Object.assign(Object.assign({}, this.responses), responses); + } + getAll() { + return this.responses; + } + clear() { + this.responses = {}; + } +} +exports.GlobalResponsesStorageHost = GlobalResponsesStorageHost; +const globalRef = global; +exports.GlobalResponsesStorage = globalRef.SwaggerGlobalResponsesStorage || + (globalRef.SwaggerGlobalResponsesStorage = new GlobalResponsesStorageHost()); diff --git a/node_modules/@nestjs/swagger/dist/swagger-explorer.d.ts b/node_modules/@nestjs/swagger/dist/swagger-explorer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a08255d55a013b961c897962d9decf49f453f84b --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-explorer.d.ts @@ -0,0 +1,43 @@ +import { Controller } from '@nestjs/common/interfaces'; +import { ApplicationConfig } from '@nestjs/core'; +import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper'; +import { OperationIdFactory } from './interfaces'; +import { DenormalizedDoc } from './interfaces/denormalized-doc.interface'; +import { SchemaObject } from './interfaces/open-api-spec.interface'; +import { SchemaObjectFactory } from './services/schema-object-factory'; +export declare class SwaggerExplorer { + private readonly schemaObjectFactory; + private readonly options; + private readonly mimetypeContentWrapper; + private readonly metadataScanner; + private readonly schemas; + private operationIdFactory; + private routePathFactory?; + private linkNameFactory; + constructor(schemaObjectFactory: SchemaObjectFactory, options?: { + httpAdapterType?: string; + }); + exploreController(wrapper: InstanceWrapper, applicationConfig: ApplicationConfig, options: { + modulePath?: string; + globalPrefix?: string; + operationIdFactory?: OperationIdFactory; + linkNameFactory?: (controllerKey: string, methodKey: string, fieldKey: string) => string; + autoTagControllers?: boolean; + onlyIncludeDecoratedEndpoints?: boolean; + }): DenormalizedDoc[]; + getSchemas(): Record; + private generateDenormalizedDocument; + private exploreGlobalMetadata; + private exploreRoutePathAndMethod; + private getOperationId; + private getRoutePathVersions; + private reflectControllerPath; + private validateRoutePath; + private mergeMetadata; + private deepMergeMetadata; + private mergeValues; + private migrateOperationSchema; + private registerExtraModels; + private getVersionMetadata; + private getNonPathVersion; +} diff --git a/node_modules/@nestjs/swagger/dist/swagger-explorer.js b/node_modules/@nestjs/swagger/dist/swagger-explorer.js new file mode 100644 index 0000000000000000000000000000000000000000..677b4aaca7eebc75adeb8958aaa74fb912b6c73f --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-explorer.js @@ -0,0 +1,352 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SwaggerExplorer = void 0; +const common_1 = require("@nestjs/common"); +const constants_1 = require("@nestjs/common/constants"); +const interfaces_1 = require("@nestjs/common/interfaces"); +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const core_1 = require("@nestjs/core"); +const legacy_route_converter_1 = require("@nestjs/core/router/legacy-route-converter"); +const route_path_factory_1 = require("@nestjs/core/router/route-path-factory"); +const lodash_1 = require("lodash"); +const path_to_regexp_1 = require("path-to-regexp"); +const constants_2 = require("./constants"); +const api_callbacks_explorer_1 = require("./explorers/api-callbacks.explorer"); +const api_exclude_controller_explorer_1 = require("./explorers/api-exclude-controller.explorer"); +const api_exclude_endpoint_explorer_1 = require("./explorers/api-exclude-endpoint.explorer"); +const api_extra_models_explorer_1 = require("./explorers/api-extra-models.explorer"); +const api_headers_explorer_1 = require("./explorers/api-headers.explorer"); +const api_include_endpoint_explorer_1 = require("./explorers/api-include-endpoint.explorer"); +const api_operation_explorer_1 = require("./explorers/api-operation.explorer"); +const api_parameters_explorer_1 = require("./explorers/api-parameters.explorer"); +const api_response_explorer_1 = require("./explorers/api-response.explorer"); +const api_security_explorer_1 = require("./explorers/api-security.explorer"); +const api_use_tags_explorer_1 = require("./explorers/api-use-tags.explorer"); +const mimetype_content_wrapper_1 = require("./services/mimetype-content-wrapper"); +const is_body_parameter_util_1 = require("./utils/is-body-parameter.util"); +const merge_and_uniq_util_1 = require("./utils/merge-and-uniq.util"); +class SwaggerExplorer { + constructor(schemaObjectFactory, options = {}) { + this.schemaObjectFactory = schemaObjectFactory; + this.options = options; + this.mimetypeContentWrapper = new mimetype_content_wrapper_1.MimetypeContentWrapper(); + this.metadataScanner = new core_1.MetadataScanner(); + this.schemas = {}; + this.operationIdFactory = (controllerKey, methodKey, version) => version + ? controllerKey + ? `${controllerKey}_${methodKey}_${version}` + : `${methodKey}_${version}` + : controllerKey + ? `${controllerKey}_${methodKey}` + : methodKey; + this.linkNameFactory = (controllerKey, methodKey, fieldKey) => controllerKey + ? `${controllerKey}_${methodKey}_from_${fieldKey}` + : `${methodKey}_from_${fieldKey}`; + } + exploreController(wrapper, applicationConfig, options) { + const { operationIdFactory, linkNameFactory } = options; + this.routePathFactory = new route_path_factory_1.RoutePathFactory(applicationConfig); + if (operationIdFactory) { + this.operationIdFactory = operationIdFactory; + } + if (linkNameFactory) { + this.linkNameFactory = linkNameFactory; + } + const { instance, metatype } = wrapper; + const prototype = Object.getPrototypeOf(instance); + const documentResolvers = { + root: [ + this.exploreRoutePathAndMethod, + api_operation_explorer_1.exploreApiOperationMetadata, + api_parameters_explorer_1.exploreApiParametersMetadata.bind(null, this.schemas) + ], + security: [api_security_explorer_1.exploreApiSecurityMetadata], + tags: [api_use_tags_explorer_1.exploreApiTagsMetadata], + callbacks: [api_callbacks_explorer_1.exploreApiCallbacksMetadata], + responses: [ + api_response_explorer_1.exploreApiResponseMetadata.bind(null, this.schemas, { + operationId: this.operationIdFactory, + linkName: this.linkNameFactory + }) + ] + }; + return this.generateDenormalizedDocument(metatype, prototype, instance, documentResolvers, applicationConfig, options); + } + getSchemas() { + return this.schemas; + } + generateDenormalizedDocument(metatype, prototype, instance, documentResolvers, applicationConfig, options) { + const self = this; + const excludeController = (0, api_exclude_controller_explorer_1.exploreApiExcludeControllerMetadata)(metatype); + if (excludeController) { + return []; + } + const globalMetadata = this.exploreGlobalMetadata(metatype, { + autoTagControllers: options.autoTagControllers + }); + const ctrlExtraModels = (0, api_extra_models_explorer_1.exploreGlobalApiExtraModelsMetadata)(metatype); + this.registerExtraModels(ctrlExtraModels); + const denormalizedPaths = this.metadataScanner.scanFromPrototype(instance, prototype, (name) => { + const targetCallback = prototype[name]; + const includeEndpoint = (0, api_include_endpoint_explorer_1.exploreApiIncludeEndpointMetadata)(instance, prototype, targetCallback); + if (options.onlyIncludeDecoratedEndpoints && !includeEndpoint) { + return; + } + const excludeEndpoint = (0, api_exclude_endpoint_explorer_1.exploreApiExcludeEndpointMetadata)(instance, prototype, targetCallback); + if (excludeEndpoint && excludeEndpoint.disable) { + return; + } + const ctrlExtraModels = (0, api_extra_models_explorer_1.exploreApiExtraModelsMetadata)(instance, prototype, targetCallback); + this.registerExtraModels(ctrlExtraModels); + const methodMetadata = (0, lodash_1.mapValues)(documentResolvers, (explorers) => explorers.reduce((metadata, fn) => { + const exploredMetadata = fn.call(self, instance, prototype, targetCallback, metatype, options.globalPrefix, options.modulePath, applicationConfig, options.autoTagControllers); + if (!exploredMetadata) { + return metadata; + } + if (!(0, lodash_1.isArray)(exploredMetadata)) { + if (Array.isArray(metadata)) { + return metadata.map((item) => (Object.assign(Object.assign({}, item), exploredMetadata))); + } + return Object.assign(Object.assign({}, metadata), exploredMetadata); + } + return (0, lodash_1.isArray)(metadata) + ? [...metadata, ...exploredMetadata] + : exploredMetadata; + }, {})); + if (Array.isArray(methodMetadata.root)) { + return methodMetadata.root.map((endpointMetadata) => { + endpointMetadata = (0, lodash_1.cloneDeep)(Object.assign(Object.assign({}, methodMetadata), { root: endpointMetadata })); + const mergedMethodMetadata = this.mergeMetadata(globalMetadata, (0, lodash_1.omitBy)(endpointMetadata, lodash_1.isEmpty)); + return this.migrateOperationSchema(Object.assign(Object.assign({ responses: {} }, (0, lodash_1.omit)(globalMetadata, 'chunks')), mergedMethodMetadata), prototype, targetCallback, metatype); + }); + } + const mergedMethodMetadata = this.mergeMetadata(globalMetadata, (0, lodash_1.omitBy)(methodMetadata, lodash_1.isEmpty)); + return [ + this.migrateOperationSchema(Object.assign(Object.assign({ responses: {} }, (0, lodash_1.omit)(globalMetadata, 'chunks')), mergedMethodMetadata), prototype, targetCallback, metatype) + ]; + }); + return (0, lodash_1.flatten)(denormalizedPaths).filter((path) => { var _a; return (_a = path.root) === null || _a === void 0 ? void 0 : _a.path; }); + } + exploreGlobalMetadata(metatype, options) { + const globalExplorers = [ + (0, api_use_tags_explorer_1.exploreGlobalApiTagsMetadata)(options.autoTagControllers), + api_security_explorer_1.exploreGlobalApiSecurityMetadata, + api_response_explorer_1.exploreGlobalApiResponseMetadata.bind(null, this.schemas), + api_headers_explorer_1.exploreGlobalApiHeaderMetadata + ]; + const globalMetadata = globalExplorers + .map((explorer) => explorer.call(explorer, metatype)) + .filter((val) => !(0, shared_utils_1.isUndefined)(val)) + .reduce((curr, next) => { + if (next.depth) { + return Object.assign(Object.assign({}, curr), { chunks: (curr.chunks || []).concat(next) }); + } + return Object.assign(Object.assign({}, curr), next); + }, {}); + return globalMetadata; + } + exploreRoutePathAndMethod(instance, prototype, method, metatype, globalPrefix, modulePath, applicationConfig) { + const methodPath = Reflect.getMetadata(constants_1.PATH_METADATA, method); + if ((0, shared_utils_1.isUndefined)(methodPath)) { + return undefined; + } + const requestMethod = Reflect.getMetadata(constants_1.METHOD_METADATA, method); + const webhookMetadata = Reflect.getMetadata(constants_2.DECORATORS.API_WEBHOOK, method); + const isWebhook = Boolean(webhookMetadata); + const methodVersion = Reflect.getMetadata(constants_1.VERSION_METADATA, method); + const versioningOptions = applicationConfig.getVersioning(); + const controllerVersion = this.getVersionMetadata(metatype, versioningOptions); + const versionOrVersions = methodVersion !== null && methodVersion !== void 0 ? methodVersion : controllerVersion; + const versions = this.getRoutePathVersions(versionOrVersions, versioningOptions); + const allRoutePaths = this.routePathFactory.create({ + methodPath, + methodVersion, + modulePath, + globalPrefix, + controllerVersion, + ctrlPath: this.reflectControllerPath(metatype), + versioningOptions: applicationConfig.getVersioning() + }, requestMethod); + return (0, lodash_1.flatten)(allRoutePaths.map((routePath, index) => { + const fullPath = this.validateRoutePath(routePath); + const apiExtension = Reflect.getMetadata(constants_2.DECORATORS.API_EXTENSION, method); + if (requestMethod === common_1.RequestMethod.ALL) { + const validMethods = [ + 'get', + 'post', + 'put', + 'delete', + 'patch', + 'options', + 'head', + 'search' + ]; + return validMethods.map((requestMethod) => (Object.assign(Object.assign(Object.assign({ method: requestMethod, path: fullPath === '' ? '/' : fullPath }, (isWebhook + ? { + isWebhook: true, + webhookName: typeof webhookMetadata === 'string' + ? webhookMetadata + : method.name + } + : {})), { operationId: `${this.getOperationId(instance, method.name)}_${requestMethod.toLowerCase()}` }), apiExtension))); + } + const pathVersion = versions.find((v) => fullPath.includes(`/${v}/`) || fullPath.endsWith(`/${v}`)); + const isAlias = allRoutePaths.length > 1 && allRoutePaths.length !== versions.length; + const methodKey = isAlias ? `${method.name}[${index}]` : method.name; + const nonPathVersion = this.getNonPathVersion(methodVersion, metatype, versioningOptions); + const operationVersion = pathVersion !== null && pathVersion !== void 0 ? pathVersion : nonPathVersion; + return Object.assign(Object.assign(Object.assign({ method: common_1.RequestMethod[requestMethod].toLowerCase(), path: fullPath === '' ? '/' : fullPath }, (isWebhook + ? { + isWebhook: true, + webhookName: typeof webhookMetadata === 'string' + ? webhookMetadata + : method.name + } + : {})), { operationId: this.getOperationId(instance, methodKey, operationVersion) }), apiExtension); + })); + } + getOperationId(instance, methodKey, version) { + var _a; + return this.operationIdFactory(((_a = instance.constructor) === null || _a === void 0 ? void 0 : _a.name) || '', methodKey, version); + } + getRoutePathVersions(versionValue, versioningOptions) { + let versions = []; + if (!versionValue || (versioningOptions === null || versioningOptions === void 0 ? void 0 : versioningOptions.type) !== common_1.VersioningType.URI) { + return versions; + } + if (Array.isArray(versionValue)) { + versions = versionValue.filter((v) => v !== interfaces_1.VERSION_NEUTRAL); + } + else if (versionValue !== interfaces_1.VERSION_NEUTRAL) { + versions = [versionValue]; + } + const prefix = this.routePathFactory.getVersionPrefix(versioningOptions); + versions = versions.map((v) => `${prefix}${v}`); + return versions; + } + reflectControllerPath(metatype) { + return Reflect.getMetadata(constants_1.PATH_METADATA, metatype); + } + validateRoutePath(path) { + if ((0, shared_utils_1.isUndefined)(path)) { + return ''; + } + if (Array.isArray(path)) { + path = (0, lodash_1.head)(path); + } + let pathWithParams = ''; + try { + let normalizedPath = legacy_route_converter_1.LegacyRouteConverter.tryConvert(path, { + logs: this.options.httpAdapterType !== 'fastify' + }); + normalizedPath = normalizedPath.replace(/::/g, '\\:'); + normalizedPath = normalizedPath.replace(/\[:\]/g, '\\:'); + normalizedPath = normalizedPath.replace(/\(\^([^)]+)\)/g, ''); + const { tokens } = (0, path_to_regexp_1.parse)(normalizedPath); + for (const item of tokens) { + if (item.type === 'text') { + pathWithParams += item.value; + } + else if (item.type === 'param') { + pathWithParams += `{${item.name}}`; + } + else if (item.type === 'wildcard') { + pathWithParams += `{${item.name}}`; + } + else if (item.type === 'group') { + pathWithParams += item.tokens.reduce((acc, item) => acc + + (item.type === 'text' + ? item.value + : `{${item.name}}`), ''); + } + } + } + catch (err) { + if (err instanceof TypeError) { + legacy_route_converter_1.LegacyRouteConverter.printError(path); + } + throw err; + } + return pathWithParams === '/' ? '' : (0, shared_utils_1.addLeadingSlash)(pathWithParams); + } + mergeMetadata(globalMetadata, methodMetadata) { + if (methodMetadata.root && !methodMetadata.root.parameters) { + methodMetadata.root.parameters = []; + } + const deepMerge = (metadata) => (value, key) => { + if (!metadata[key]) { + return value; + } + const globalValue = metadata[key]; + if (metadata.depth) { + return this.deepMergeMetadata(globalValue, value, metadata.depth); + } + return this.mergeValues(globalValue, value); + }; + if (globalMetadata.chunks) { + const { chunks } = globalMetadata; + chunks.forEach((chunk) => { + methodMetadata = (0, lodash_1.mapValues)(methodMetadata, deepMerge(chunk)); + }); + } + return (0, lodash_1.mapValues)(methodMetadata, deepMerge(globalMetadata)); + } + deepMergeMetadata(globalValue, methodValue, maxDepth, currentDepthLevel = 0) { + if (currentDepthLevel === maxDepth) { + return this.mergeValues(globalValue, methodValue); + } + return (0, lodash_1.mapValues)(methodValue, (value, key) => { + if (key in globalValue) { + return this.deepMergeMetadata(globalValue[key], methodValue[key], maxDepth, currentDepthLevel + 1); + } + return value; + }); + } + mergeValues(globalValue, methodValue) { + if (!(0, lodash_1.isArray)(globalValue)) { + return Object.assign(Object.assign({}, globalValue), methodValue); + } + return [...globalValue, ...methodValue]; + } + migrateOperationSchema(document, prototype, method, metatype) { + const parametersObject = (0, lodash_1.get)(document, 'root.parameters'); + const requestBodyIndex = (parametersObject || []).findIndex(is_body_parameter_util_1.isBodyParameter); + if (requestBodyIndex < 0) { + return document; + } + const requestBody = parametersObject[requestBodyIndex]; + parametersObject.splice(requestBodyIndex, 1); + const classConsumes = Reflect.getMetadata(constants_2.DECORATORS.API_CONSUMES, metatype !== null && metatype !== void 0 ? metatype : prototype === null || prototype === void 0 ? void 0 : prototype.constructor); + const methodConsumes = Reflect.getMetadata(constants_2.DECORATORS.API_CONSUMES, method); + let consumes = (0, merge_and_uniq_util_1.mergeAndUniq)(classConsumes, methodConsumes); + consumes = (0, lodash_1.isEmpty)(consumes) ? ['application/json'] : consumes; + const keysToRemove = ['schema', 'in', 'name', 'examples', 'encoding']; + document.root.requestBody = Object.assign(Object.assign({}, (0, lodash_1.omit)(requestBody, keysToRemove)), this.mimetypeContentWrapper.wrap(consumes, (0, lodash_1.pick)(requestBody, ['schema', 'examples', 'encoding']))); + return document; + } + registerExtraModels(extraModels) { + extraModels.forEach((item) => this.schemaObjectFactory.exploreModelSchema(item, this.schemas)); + } + getVersionMetadata(metatype, versioningOptions) { + var _a; + if ((versioningOptions === null || versioningOptions === void 0 ? void 0 : versioningOptions.type) === common_1.VersioningType.URI) { + return ((_a = Reflect.getMetadata(constants_1.VERSION_METADATA, metatype)) !== null && _a !== void 0 ? _a : versioningOptions.defaultVersion); + } + } + getNonPathVersion(methodVersion, metatype, versioningOptions) { + var _a; + if (!versioningOptions || versioningOptions.type === common_1.VersioningType.URI) { + return undefined; + } + const version = (_a = methodVersion !== null && methodVersion !== void 0 ? methodVersion : Reflect.getMetadata(constants_1.VERSION_METADATA, metatype)) !== null && _a !== void 0 ? _a : versioningOptions.defaultVersion; + if (!version || version === interfaces_1.VERSION_NEUTRAL) { + return undefined; + } + if (Array.isArray(version)) { + const filtered = version.filter((v) => v !== interfaces_1.VERSION_NEUTRAL); + return filtered.length > 0 ? filtered[0] : undefined; + } + return version; + } +} +exports.SwaggerExplorer = SwaggerExplorer; diff --git a/node_modules/@nestjs/swagger/dist/swagger-module.d.ts b/node_modules/@nestjs/swagger/dist/swagger-module.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4740e20a60f3427d68eab2799cdaa7474640b0e0 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-module.d.ts @@ -0,0 +1,27 @@ +import { INestApplication } from '@nestjs/common'; +import { HttpServer } from '@nestjs/common/interfaces/http/http-server.interface'; +import { OpenAPIObject, SwaggerCustomOptions, SwaggerDocumentOptions } from './interfaces'; +export declare class SwaggerModule { + private static readonly metadataLoader; + private static mergeWebhooks; + static createDocument(app: INestApplication, config: Omit, options?: SwaggerDocumentOptions): OpenAPIObject; + static loadPluginMetadata(metadataFn: () => Promise>): Promise; + protected static serveStatic(finalPath: string, app: INestApplication, customStaticPath?: string): void; + protected static serveDocuments(finalPath: string, urlLastSubdirectory: string, httpAdapter: HttpServer, documentOrFactory: OpenAPIObject | (() => OpenAPIObject), options: { + ui: boolean; + raw: boolean | Array<'json' | 'yaml'>; + jsonDocumentUrl: string; + yamlDocumentUrl: string; + swaggerOptions: SwaggerCustomOptions; + }): void; + protected static serveSwaggerUi(finalPath: string, urlLastSubdirectory: string, httpAdapter: HttpServer, getBuiltDocument: () => OpenAPIObject, swaggerOptions: SwaggerCustomOptions): void; + protected static serveDefinitions(httpAdapter: HttpServer, getBuiltDocument: () => OpenAPIObject, options: { + jsonDocumentUrl: string; + yamlDocumentUrl: string; + swaggerOptions: SwaggerCustomOptions; + }, serveOptions: { + serveJson: boolean; + serveYaml: boolean; + }): void; + static setup(path: string, app: INestApplication, documentOrFactory: OpenAPIObject | (() => OpenAPIObject), options?: SwaggerCustomOptions): void; +} diff --git a/node_modules/@nestjs/swagger/dist/swagger-module.js b/node_modules/@nestjs/swagger/dist/swagger-module.js new file mode 100644 index 0000000000000000000000000000000000000000..9a4a4c024a8d3b29ccbc595648e762707a29a048 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-module.js @@ -0,0 +1,273 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SwaggerModule = void 0; +const common_1 = require("@nestjs/common"); +const jsyaml = __importStar(require("js-yaml")); +const metadata_loader_1 = require("./plugin/metadata-loader"); +const swagger_scanner_1 = require("./swagger-scanner"); +const swagger_ui_1 = require("./swagger-ui"); +const assign_two_levels_deep_1 = require("./utils/assign-two-levels-deep"); +const get_global_prefix_1 = require("./utils/get-global-prefix"); +const is_oas31_or_later_util_1 = require("./utils/is-oas31-or-later.util"); +const normalize_rel_path_1 = require("./utils/normalize-rel-path"); +const resolve_path_util_1 = require("./utils/resolve-path.util"); +const validate_global_prefix_util_1 = require("./utils/validate-global-prefix.util"); +const validate_path_util_1 = require("./utils/validate-path.util"); +class SwaggerModule { + static mergeWebhooks(configWebhooks, scannedWebhooks) { + if (!configWebhooks && !scannedWebhooks) { + return undefined; + } + return (0, assign_two_levels_deep_1.assignTwoLevelsDeep)({}, configWebhooks || {}, scannedWebhooks || {}); + } + static createDocument(app, config, options = {}) { + var _a; + const swaggerScanner = new swagger_scanner_1.SwaggerScanner(); + const document = swaggerScanner.scanApplication(app, options); + const _b = config, { webhooks: configWebhooks } = _b, configWithoutWebhooks = __rest(_b, ["webhooks"]); + document.components = (0, assign_two_levels_deep_1.assignTwoLevelsDeep)({}, config.components, document.components); + const _c = document, { webhooks: scannedWebhooks, webhookPaths } = _c, documentWithoutWebhooks = __rest(_c, ["webhooks", "webhookPaths"]); + const mergedWebhooks = SwaggerModule.mergeWebhooks(configWebhooks, scannedWebhooks); + const shouldIncludeWebhooks = (0, is_oas31_or_later_util_1.isOas31OrLater)((_a = config.openapi) !== null && _a !== void 0 ? _a : '3.0.0'); + const baseDocument = Object.assign(Object.assign({ openapi: '3.0.0', paths: {} }, configWithoutWebhooks), documentWithoutWebhooks); + if (shouldIncludeWebhooks) { + return Object.assign(Object.assign({}, baseDocument), (mergedWebhooks ? { webhooks: mergedWebhooks } : {})); + } + return Object.assign(Object.assign({}, baseDocument), { paths: webhookPaths + ? (0, assign_two_levels_deep_1.assignTwoLevelsDeep)({}, baseDocument.paths || {}, webhookPaths) + : baseDocument.paths }); + } + static loadPluginMetadata(metadataFn) { + return __awaiter(this, void 0, void 0, function* () { + const metadata = yield metadataFn(); + return this.metadataLoader.load(metadata); + }); + } + static serveStatic(finalPath, app, customStaticPath) { + const httpAdapter = app.getHttpAdapter(); + const swaggerAssetsPath = customStaticPath + ? (0, resolve_path_util_1.resolvePath)(customStaticPath) + : (0, swagger_ui_1.getSwaggerAssetsAbsoluteFSPath)(); + if (httpAdapter && httpAdapter.getType() === 'fastify') { + app.useStaticAssets({ + root: swaggerAssetsPath, + prefix: finalPath, + decorateReply: false + }); + } + else { + app.useStaticAssets(swaggerAssetsPath, { + prefix: finalPath + }); + } + } + static serveDocuments(finalPath, urlLastSubdirectory, httpAdapter, documentOrFactory, options) { + let document; + const getBuiltDocument = () => { + if (!document) { + document = + typeof documentOrFactory === 'function' + ? documentOrFactory() + : documentOrFactory; + } + return document; + }; + if (options.ui) { + this.serveSwaggerUi(finalPath, urlLastSubdirectory, httpAdapter, getBuiltDocument, options.swaggerOptions); + } + if (options.raw === true || + (Array.isArray(options.raw) && options.raw.length > 0)) { + const serveJson = options.raw === true || options.raw.includes('json'); + const serveYaml = options.raw === true || options.raw.includes('yaml'); + this.serveDefinitions(httpAdapter, getBuiltDocument, options, { + serveJson, + serveYaml + }); + } + } + static serveSwaggerUi(finalPath, urlLastSubdirectory, httpAdapter, getBuiltDocument, swaggerOptions) { + const baseUrlForSwaggerUI = (0, normalize_rel_path_1.normalizeRelPath)(`./${urlLastSubdirectory}/`); + let swaggerUiHtml; + let swaggerUiHtmlForTrailingSlash; + let swaggerUiInitJS; + httpAdapter.get((0, normalize_rel_path_1.normalizeRelPath)(`${finalPath}/swagger-ui-init.js`), (req, res) => __awaiter(this, void 0, void 0, function* () { + res.type('application/javascript'); + const document = getBuiltDocument(); + if (swaggerOptions.patchDocumentOnRequest) { + const documentToSerialize = yield Promise.resolve(swaggerOptions.patchDocumentOnRequest(req, res, document)); + const swaggerInitJsPerRequest = (0, swagger_ui_1.buildSwaggerInitJS)(documentToSerialize, swaggerOptions); + return res.send(swaggerInitJsPerRequest); + } + if (!swaggerUiInitJS) { + swaggerUiInitJS = (0, swagger_ui_1.buildSwaggerInitJS)(document, swaggerOptions); + } + return res.send(swaggerUiInitJS); + })); + try { + httpAdapter.get((0, normalize_rel_path_1.normalizeRelPath)(`${finalPath}/${urlLastSubdirectory}/swagger-ui-init.js`), (req, res) => __awaiter(this, void 0, void 0, function* () { + res.type('application/javascript'); + const document = getBuiltDocument(); + if (swaggerOptions.patchDocumentOnRequest) { + const documentToSerialize = yield Promise.resolve(swaggerOptions.patchDocumentOnRequest(req, res, document)); + const swaggerInitJsPerRequest = (0, swagger_ui_1.buildSwaggerInitJS)(documentToSerialize, swaggerOptions); + return res.send(swaggerInitJsPerRequest); + } + if (!swaggerUiInitJS) { + swaggerUiInitJS = (0, swagger_ui_1.buildSwaggerInitJS)(document, swaggerOptions); + } + return res.send(swaggerUiInitJS); + })); + } + catch (_a) { + } + const getSwaggerHtml = () => { + if (!swaggerUiHtml) { + swaggerUiHtml = (0, swagger_ui_1.buildSwaggerHTML)(baseUrlForSwaggerUI, swaggerOptions); + } + return swaggerUiHtml; + }; + const getTrailingSlashSwaggerHtml = () => { + if (!swaggerUiHtmlForTrailingSlash) { + swaggerUiHtmlForTrailingSlash = (0, swagger_ui_1.buildSwaggerHTML)('./', swaggerOptions); + } + return swaggerUiHtmlForTrailingSlash; + }; + function serveSwaggerHtml(req, res) { + res.type('text/html'); + const url = httpAdapter.getRequestUrl(req); + const hasTrailingSlash = url.endsWith('/'); + const swaggerUiHtml = hasTrailingSlash + ? getTrailingSlashSwaggerHtml() + : getSwaggerHtml(); + res.send(swaggerUiHtml); + } + httpAdapter.get(finalPath, serveSwaggerHtml); + httpAdapter.get(`${finalPath}/index.html`, serveSwaggerHtml); + httpAdapter.get(`${finalPath}/LICENSE`, () => { + throw new common_1.NotFoundException(); + }); + try { + httpAdapter.get((0, normalize_rel_path_1.normalizeRelPath)(`${finalPath}/`), serveSwaggerHtml); + } + catch (_b) { + } + } + static serveDefinitions(httpAdapter, getBuiltDocument, options, serveOptions) { + if (serveOptions.serveJson) { + httpAdapter.get((0, normalize_rel_path_1.normalizeRelPath)(options.jsonDocumentUrl), (req, res) => __awaiter(this, void 0, void 0, function* () { + res.type('application/json'); + const document = getBuiltDocument(); + const documentToSerialize = options.swaggerOptions + .patchDocumentOnRequest + ? yield Promise.resolve(options.swaggerOptions.patchDocumentOnRequest(req, res, document)) + : document; + return res.send(JSON.stringify(documentToSerialize)); + })); + } + if (serveOptions.serveYaml) { + httpAdapter.get((0, normalize_rel_path_1.normalizeRelPath)(options.yamlDocumentUrl), (req, res) => __awaiter(this, void 0, void 0, function* () { + res.type('text/yaml'); + const document = getBuiltDocument(); + const documentToSerialize = options.swaggerOptions + .patchDocumentOnRequest + ? yield Promise.resolve(options.swaggerOptions.patchDocumentOnRequest(req, res, document)) + : document; + const yamlDocument = jsyaml.dump(documentToSerialize, { + skipInvalid: true, + noRefs: true + }); + return res.send(yamlDocument); + })); + } + } + static setup(path, app, documentOrFactory, options) { + var _a, _b, _c; + const globalPrefix = (0, get_global_prefix_1.getGlobalPrefix)(app); + const finalPath = (0, validate_path_util_1.validatePath)((options === null || options === void 0 ? void 0 : options.useGlobalPrefix) && (0, validate_global_prefix_util_1.validateGlobalPrefix)(globalPrefix) + ? `${globalPrefix}${(0, validate_path_util_1.validatePath)(path)}` + : path); + const urlLastSubdirectory = finalPath.split('/').slice(-1).pop() || ''; + const validatedGlobalPrefix = (options === null || options === void 0 ? void 0 : options.useGlobalPrefix) && (0, validate_global_prefix_util_1.validateGlobalPrefix)(globalPrefix) + ? (0, validate_path_util_1.validatePath)(globalPrefix) + : ''; + const finalJSONDocumentPath = (options === null || options === void 0 ? void 0 : options.jsonDocumentUrl) + ? `${validatedGlobalPrefix}${(0, validate_path_util_1.validatePath)(options.jsonDocumentUrl)}` + : `${finalPath}-json`; + const finalYAMLDocumentPath = (options === null || options === void 0 ? void 0 : options.yamlDocumentUrl) + ? `${validatedGlobalPrefix}${(0, validate_path_util_1.validatePath)(options.yamlDocumentUrl)}` + : `${finalPath}-yaml`; + const ui = (_b = (_a = options === null || options === void 0 ? void 0 : options.ui) !== null && _a !== void 0 ? _a : options === null || options === void 0 ? void 0 : options.swaggerUiEnabled) !== null && _b !== void 0 ? _b : true; + const raw = (_c = options === null || options === void 0 ? void 0 : options.raw) !== null && _c !== void 0 ? _c : true; + const httpAdapter = app.getHttpAdapter(); + SwaggerModule.serveDocuments(finalPath, urlLastSubdirectory, httpAdapter, documentOrFactory, { + ui, + raw, + jsonDocumentUrl: finalJSONDocumentPath, + yamlDocumentUrl: finalYAMLDocumentPath, + swaggerOptions: options || {} + }); + if (ui) { + SwaggerModule.serveStatic(finalPath, app, options === null || options === void 0 ? void 0 : options.customSwaggerUiPath); + if (finalPath === `/${urlLastSubdirectory}`) { + return; + } + const serveStaticSlashEndingPath = `${finalPath}/${urlLastSubdirectory}`; + SwaggerModule.serveStatic(serveStaticSlashEndingPath, app); + } + } +} +exports.SwaggerModule = SwaggerModule; +SwaggerModule.metadataLoader = new metadata_loader_1.MetadataLoader(); diff --git a/node_modules/@nestjs/swagger/dist/swagger-scanner.d.ts b/node_modules/@nestjs/swagger/dist/swagger-scanner.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87fa336c5379c4f17086bb9b0e0a07387c07ca4e --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-scanner.d.ts @@ -0,0 +1,25 @@ +import { INestApplication, InjectionToken } from '@nestjs/common'; +import { ApplicationConfig } from '@nestjs/core'; +import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper'; +import { Module } from '@nestjs/core/injector/module'; +import { OpenAPIObject, OperationIdFactory, SwaggerDocumentOptions } from './interfaces'; +import { ModuleRoute } from './interfaces/module-route.interface'; +import { SchemaObject } from './interfaces/open-api-spec.interface'; +export declare class SwaggerScanner { + private readonly transformer; + private readonly schemaObjectFactory; + private explorer; + scanApplication(app: INestApplication, options: SwaggerDocumentOptions): Omit; + scanModuleControllers(controller: Map, applicationConfig: ApplicationConfig, options: { + modulePath: string | undefined; + globalPrefix: string | undefined; + operationIdFactory?: OperationIdFactory; + linkNameFactory?: (controllerKey: string, methodKey: string, fieldKey: string) => string; + autoTagControllers?: boolean; + onlyIncludeDecoratedEndpoints?: boolean; + }): ModuleRoute[]; + getModules(modulesContainer: Map, include: Function[]): Module[]; + addExtraModels(schemas: Record, extraModels: Function[]): void; + private getModulePathMetadata; + private initializeSwaggerExplorer; +} diff --git a/node_modules/@nestjs/swagger/dist/swagger-scanner.js b/node_modules/@nestjs/swagger/dist/swagger-scanner.js new file mode 100644 index 0000000000000000000000000000000000000000..ac817f518ed4c35e9722ec245f0176d4ffbc6ce8 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-scanner.js @@ -0,0 +1,98 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SwaggerScanner = void 0; +const constants_1 = require("@nestjs/common/constants"); +const lodash_1 = require("lodash"); +const model_properties_accessor_1 = require("./services/model-properties-accessor"); +const schema_object_factory_1 = require("./services/schema-object-factory"); +const swagger_types_mapper_1 = require("./services/swagger-types-mapper"); +const swagger_explorer_1 = require("./swagger-explorer"); +const swagger_transformer_1 = require("./swagger-transformer"); +const apply_example_max_depth_util_1 = require("./utils/apply-example-max-depth.util"); +const get_global_prefix_1 = require("./utils/get-global-prefix"); +const strip_dynamic_defaults_util_1 = require("./utils/strip-dynamic-defaults.util"); +const strip_last_slash_util_1 = require("./utils/strip-last-slash.util"); +class SwaggerScanner { + constructor() { + this.transformer = new swagger_transformer_1.SwaggerTransformer(); + this.schemaObjectFactory = new schema_object_factory_1.SchemaObjectFactory(new model_properties_accessor_1.ModelPropertiesAccessor(), new swagger_types_mapper_1.SwaggerTypesMapper()); + } + scanApplication(app, options) { + const { deepScanRoutes, include: includedModules = [], extraModels = [], ignoreGlobalPrefix = false, operationIdFactory, linkNameFactory, autoTagControllers = true, onlyIncludeDecoratedEndpoints = false, excludeDynamicDefaults = false, exampleMaxDepth } = options; + const untypedApp = app; + const container = untypedApp.container; + const internalConfigRef = untypedApp.config; + const httpAdapterType = app.getHttpAdapter().getType(); + this.initializeSwaggerExplorer(httpAdapterType); + const modules = this.getModules(container.getModules(), includedModules); + const globalPrefix = !ignoreGlobalPrefix + ? (0, strip_last_slash_util_1.stripLastSlash)((0, get_global_prefix_1.getGlobalPrefix)(app)) + : ''; + const denormalizedPaths = modules.map(({ controllers, metatype, imports }) => { + let result = []; + if (deepScanRoutes) { + const isGlobal = (module) => !container.isGlobalModule(module); + Array.from(imports.values()) + .filter(isGlobal) + .forEach(({ metatype, controllers }) => { + const modulePath = this.getModulePathMetadata(container, metatype); + result = result.concat(this.scanModuleControllers(controllers, internalConfigRef, { + modulePath, + globalPrefix, + operationIdFactory, + linkNameFactory, + autoTagControllers, + onlyIncludeDecoratedEndpoints + })); + }); + } + const modulePath = this.getModulePathMetadata(container, metatype); + return result.concat(this.scanModuleControllers(controllers, internalConfigRef, { + modulePath, + globalPrefix, + operationIdFactory, + linkNameFactory, + autoTagControllers, + onlyIncludeDecoratedEndpoints + })); + }); + const schemas = this.explorer.getSchemas(); + this.addExtraModels(schemas, extraModels); + if (excludeDynamicDefaults) { + (0, strip_dynamic_defaults_util_1.stripDynamicDefaults)(schemas); + } + (0, apply_example_max_depth_util_1.applyExampleMaxDepth)(schemas, exampleMaxDepth); + return Object.assign(Object.assign({}, this.transformer.normalizePaths((0, lodash_1.flatten)(denormalizedPaths))), { components: { + schemas: schemas + } }); + } + scanModuleControllers(controller, applicationConfig, options) { + const denormalizedArray = [...controller.values()].map((ctrl) => this.explorer.exploreController(ctrl, applicationConfig, options)); + return (0, lodash_1.flatten)(denormalizedArray); + } + getModules(modulesContainer, include) { + if (!include || (0, lodash_1.isEmpty)(include)) { + return [...modulesContainer.values()]; + } + return [...modulesContainer.values()].filter(({ metatype }) => include.some((item) => item === metatype)); + } + addExtraModels(schemas, extraModels) { + extraModels.forEach((item) => { + this.schemaObjectFactory.exploreModelSchema(item, schemas); + }); + } + getModulePathMetadata(container, metatype) { + const modulesContainer = container.getModules(); + const modulePath = Reflect.getMetadata(constants_1.MODULE_PATH + modulesContainer.applicationId, metatype); + return modulePath !== null && modulePath !== void 0 ? modulePath : Reflect.getMetadata(constants_1.MODULE_PATH, metatype); + } + initializeSwaggerExplorer(httpAdapterType) { + if (this.explorer) { + return; + } + this.explorer = new swagger_explorer_1.SwaggerExplorer(this.schemaObjectFactory, { + httpAdapterType + }); + } +} +exports.SwaggerScanner = SwaggerScanner; diff --git a/node_modules/@nestjs/swagger/dist/swagger-transformer.d.ts b/node_modules/@nestjs/swagger/dist/swagger-transformer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e78de44bfea9280c9a02e686490daf4f2fcf3521 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-transformer.d.ts @@ -0,0 +1,7 @@ +import { OpenAPIObject } from './interfaces'; +import { DenormalizedDoc } from './interfaces/denormalized-doc.interface'; +export declare class SwaggerTransformer { + normalizePaths(denormalizedDoc: DenormalizedDoc[]): Pick & { + webhookPaths?: OpenAPIObject['paths']; + }; +} diff --git a/node_modules/@nestjs/swagger/dist/swagger-transformer.js b/node_modules/@nestjs/swagger/dist/swagger-transformer.js new file mode 100644 index 0000000000000000000000000000000000000000..172e81416ae3f0711262a89750ae146323a34cb6 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-transformer.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SwaggerTransformer = void 0; +const lodash_1 = require("lodash"); +const sort_object_lexicographically_1 = require("./utils/sort-object-lexicographically"); +class SwaggerTransformer { + normalizePaths(denormalizedDoc) { + const roots = denormalizedDoc.filter((doc) => Boolean(doc.root)); + const webhookRoots = roots.filter(({ root }) => Boolean(root.isWebhook)); + const pathRoots = roots.filter(({ root }) => !root.isWebhook); + const groupedByPath = (0, lodash_1.groupBy)(pathRoots, ({ root }) => root.path); + const paths = (0, lodash_1.mapValues)(groupedByPath, (routes) => { + const keyByMethod = (0, lodash_1.keyBy)(routes, ({ root }) => root.method); + return (0, lodash_1.mapValues)(keyByMethod, (route) => { + const mergedDefinition = Object.assign(Object.assign({}, (0, lodash_1.omit)(route, 'root')), (0, lodash_1.omit)(route.root, ['method', 'path', 'isWebhook', 'webhookName'])); + return (0, sort_object_lexicographically_1.sortObjectLexicographically)(mergedDefinition); + }); + }); + const groupedByWebhookName = (0, lodash_1.groupBy)(webhookRoots, ({ root }) => root.webhookName || root.path); + const webhooks = (0, lodash_1.mapValues)(groupedByWebhookName, (routes) => { + const keyByMethod = (0, lodash_1.keyBy)(routes, ({ root }) => root.method); + return (0, lodash_1.mapValues)(keyByMethod, (route) => { + const mergedDefinition = Object.assign(Object.assign({}, (0, lodash_1.omit)(route, 'root')), (0, lodash_1.omit)(route.root, ['method', 'path', 'isWebhook', 'webhookName'])); + return (0, sort_object_lexicographically_1.sortObjectLexicographically)(mergedDefinition); + }); + }); + const groupedByWebhookPath = (0, lodash_1.groupBy)(webhookRoots, ({ root }) => root.path); + const webhookPaths = (0, lodash_1.mapValues)(groupedByWebhookPath, (routes) => { + const keyByMethod = (0, lodash_1.keyBy)(routes, ({ root }) => root.method); + return (0, lodash_1.mapValues)(keyByMethod, (route) => { + const mergedDefinition = Object.assign(Object.assign({}, (0, lodash_1.omit)(route, 'root')), (0, lodash_1.omit)(route.root, ['method', 'path', 'isWebhook', 'webhookName'])); + return (0, sort_object_lexicographically_1.sortObjectLexicographically)(mergedDefinition); + }); + }); + return Object.assign(Object.assign({ paths }, (Object.keys(webhooks).length > 0 ? { webhooks } : {})), (Object.keys(webhookPaths).length > 0 ? { webhookPaths } : {})); + } +} +exports.SwaggerTransformer = SwaggerTransformer; diff --git a/node_modules/@nestjs/swagger/dist/swagger-ui/constants.d.ts b/node_modules/@nestjs/swagger/dist/swagger-ui/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5ef1a350bff6d7593cd476a6d22d889fdfca825e --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-ui/constants.d.ts @@ -0,0 +1,3 @@ +export declare const favIconHtml: string; +export declare const htmlTemplateString = "\n\n\n\n\n \n <% title %>\n swagger-ui.css\" >\n <% favIconString %>\n \n\n\n\n\n\n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n\n \n \n \n\n \n \n \n\n \n\n\n
\n\n\n\n\n<% customJs %>\n<% customJsStr %>\n<% customCssUrl %>\n\n\n\n\n"; +export declare const jsTemplateString = "\nwindow.onload = function() {\n // Build a system\n let url = window.location.search.match(/url=([^&]+)/);\n if (url && url.length > 1) {\n url = decodeURIComponent(url[1]);\n } else {\n url = window.location.origin;\n }\n <% swaggerOptions %>\n url = options.swaggerUrl || url\n let urls = options.swaggerUrls\n let customOptions = options.customOptions\n let spec1 = options.swaggerDoc\n let swaggerOptions = {\n spec: spec1,\n url: url,\n urls: urls,\n dom_id: '#swagger-ui',\n deepLinking: true,\n presets: [\n SwaggerUIBundle.presets.apis,\n SwaggerUIStandalonePreset\n ],\n plugins: [\n SwaggerUIBundle.plugins.DownloadUrl\n ],\n layout: \"StandaloneLayout\"\n }\n for (let attrname in customOptions) {\n swaggerOptions[attrname] = customOptions[attrname];\n }\n let ui = SwaggerUIBundle(swaggerOptions)\n\n if (customOptions.initOAuth) {\n ui.initOAuth(customOptions.initOAuth)\n }\n\n if (customOptions.authAction) {\n ui.authActions.authorize(customOptions.authAction)\n }\n \n window.ui = ui\n}\n"; diff --git a/node_modules/@nestjs/swagger/dist/swagger-ui/constants.js b/node_modules/@nestjs/swagger/dist/swagger-ui/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..6f47648e2bbb603f4edc32e481dfa0ca5aef0824 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-ui/constants.js @@ -0,0 +1,132 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.jsTemplateString = exports.htmlTemplateString = exports.favIconHtml = void 0; +exports.favIconHtml = '' + + ''; +exports.htmlTemplateString = ` + + + + + + <% title %> + + <% favIconString %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +<% customJs %> +<% customJsStr %> +<% customCssUrl %> + + + + +`; +exports.jsTemplateString = ` +window.onload = function() { + // Build a system + let url = window.location.search.match(/url=([^&]+)/); + if (url && url.length > 1) { + url = decodeURIComponent(url[1]); + } else { + url = window.location.origin; + } + <% swaggerOptions %> + url = options.swaggerUrl || url + let urls = options.swaggerUrls + let customOptions = options.customOptions + let spec1 = options.swaggerDoc + let swaggerOptions = { + spec: spec1, + url: url, + urls: urls, + dom_id: '#swagger-ui', + deepLinking: true, + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ], + plugins: [ + SwaggerUIBundle.plugins.DownloadUrl + ], + layout: "StandaloneLayout" + } + for (let attrname in customOptions) { + swaggerOptions[attrname] = customOptions[attrname]; + } + let ui = SwaggerUIBundle(swaggerOptions) + + if (customOptions.initOAuth) { + ui.initOAuth(customOptions.initOAuth) + } + + if (customOptions.authAction) { + ui.authActions.authorize(customOptions.authAction) + } + + window.ui = ui +} +`; diff --git a/node_modules/@nestjs/swagger/dist/swagger-ui/helpers.d.ts b/node_modules/@nestjs/swagger/dist/swagger-ui/helpers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e0d2bc09e3a7c3f1648f305b0c333232091d401f --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-ui/helpers.d.ts @@ -0,0 +1,2 @@ +import { SwaggerUIInitOptions } from '../interfaces/swagger-ui-init-options.interface'; +export declare function buildJSInitOptions(initOptions: SwaggerUIInitOptions): string; diff --git a/node_modules/@nestjs/swagger/dist/swagger-ui/helpers.js b/node_modules/@nestjs/swagger/dist/swagger-ui/helpers.js new file mode 100644 index 0000000000000000000000000000000000000000..416fd6faab01e76803012bdc74621a9f2f934e92 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-ui/helpers.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildJSInitOptions = buildJSInitOptions; +const crypto_1 = require("crypto"); +function buildJSInitOptions(initOptions) { + const fns = []; + const placeholders = []; + let json = JSON.stringify(initOptions, (key, value) => { + if (typeof value === 'function') { + const placeholder = (0, crypto_1.randomUUID)(); + fns.push(value); + placeholders.push(placeholder); + return placeholder; + } + return value; + }, 2); + placeholders.forEach((placeholder, i) => { + json = json.replace(`"${placeholder}"`, () => fns[i].toString()); + }); + return `let options = ${json};`; +} diff --git a/node_modules/@nestjs/swagger/dist/swagger-ui/index.d.ts b/node_modules/@nestjs/swagger/dist/swagger-ui/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..863a2abec1b07e33d068f5167a4e9968b3efbf72 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-ui/index.d.ts @@ -0,0 +1 @@ +export * from './swagger-ui'; diff --git a/node_modules/@nestjs/swagger/dist/swagger-ui/index.js b/node_modules/@nestjs/swagger/dist/swagger-ui/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f8d1886b94c87c57644698950448d9fde1c18e1d --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-ui/index.js @@ -0,0 +1,17 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./swagger-ui"), exports); diff --git a/node_modules/@nestjs/swagger/dist/swagger-ui/swagger-ui.d.ts b/node_modules/@nestjs/swagger/dist/swagger-ui/swagger-ui.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..361b69b08a160f21f003b30911967f16ecf74cf4 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-ui/swagger-ui.d.ts @@ -0,0 +1,4 @@ +import { OpenAPIObject, SwaggerCustomOptions } from '../interfaces'; +export declare function buildSwaggerInitJS(swaggerDoc: OpenAPIObject, customOptions?: SwaggerCustomOptions): string; +export declare function getSwaggerAssetsAbsoluteFSPath(): string; +export declare function buildSwaggerHTML(baseUrl: string, customOptions?: SwaggerCustomOptions): string; diff --git a/node_modules/@nestjs/swagger/dist/swagger-ui/swagger-ui.js b/node_modules/@nestjs/swagger/dist/swagger-ui/swagger-ui.js new file mode 100644 index 0000000000000000000000000000000000000000..2b48f9b8085d4e28fc1939f8647fbc5c678619bb --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/swagger-ui/swagger-ui.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildSwaggerInitJS = buildSwaggerInitJS; +exports.getSwaggerAssetsAbsoluteFSPath = getSwaggerAssetsAbsoluteFSPath; +exports.buildSwaggerHTML = buildSwaggerHTML; +const constants_1 = require("./constants"); +const helpers_1 = require("./helpers"); +function buildSwaggerInitJS(swaggerDoc, customOptions = {}) { + const { swaggerOptions = {}, swaggerUrl } = customOptions; + const swaggerInitOptions = { + swaggerDoc, + swaggerUrl, + customOptions: swaggerOptions + }; + const jsInitOptions = (0, helpers_1.buildJSInitOptions)(swaggerInitOptions); + return constants_1.jsTemplateString.replace('<% swaggerOptions %>', jsInitOptions); +} +let swaggerAssetsAbsoluteFSPath; +function getSwaggerAssetsAbsoluteFSPath() { + if (!swaggerAssetsAbsoluteFSPath) { + swaggerAssetsAbsoluteFSPath = require('swagger-ui-dist/absolute-path.js')(); + } + return swaggerAssetsAbsoluteFSPath; +} +function toExternalScriptTag(url) { + return ``; +} +function toInlineScriptTag(jsCode) { + return ``; +} +function toExternalStylesheetTag(url) { + return ``; +} +function toTags(customCode, toScript) { + if (!customCode) { + return ''; + } + if (typeof customCode === 'string') { + return toScript(customCode); + } + else { + return customCode.map(toScript).join('\n'); + } +} +function buildSwaggerHTML(baseUrl, customOptions = {}) { + const { customCss = '', customJs = '', customJsStr = '', customfavIcon = false, customSiteTitle = 'Swagger UI', customCssUrl = '', explorer = false } = customOptions; + const favIconString = customfavIcon + ? `` + : constants_1.favIconHtml; + const explorerCss = explorer + ? '' + : '.swagger-ui .topbar .download-url-wrapper { display: none }'; + return constants_1.htmlTemplateString + .replace('<% customCss %>', customCss) + .replace('<% explorerCss %>', explorerCss) + .replace('<% favIconString %>', favIconString) + .replace(/<% baseUrl %>/g, baseUrl) + .replace('<% customJs %>', toTags(customJs, toExternalScriptTag)) + .replace('<% customJsStr %>', toTags(customJsStr, toInlineScriptTag)) + .replace('<% customCssUrl %>', toTags(customCssUrl, toExternalStylesheetTag)) + .replace('<% title %>', customSiteTitle); +} diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/deep-partial-type.helper.d.ts b/node_modules/@nestjs/swagger/dist/type-helpers/deep-partial-type.helper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d2c584fb9e2eea1bbe36c7efd13e02ac060eb95a --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/deep-partial-type.helper.d.ts @@ -0,0 +1,7 @@ +import { Type } from '@nestjs/common'; +export declare function DeepPartialType(classRef: Type, options?: { + skipNullProperties?: boolean; +}): Type>; +export type DeepPartial = T extends object ? { + [P in keyof T]?: DeepPartial; +} : T; diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/deep-partial-type.helper.js b/node_modules/@nestjs/swagger/dist/type-helpers/deep-partial-type.helper.js new file mode 100644 index 0000000000000000000000000000000000000000..7edd2022d97a11d9e8ab3fe6dd5d01ed558bb3d9 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/deep-partial-type.helper.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeepPartialType = DeepPartialType; +const mapped_types_1 = require("@nestjs/mapped-types"); +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const decorators_1 = require("../decorators"); +const metadata_loader_1 = require("../plugin/metadata-loader"); +const plugin_constants_1 = require("../plugin/plugin-constants"); +const model_properties_accessor_1 = require("../services/model-properties-accessor"); +const mapped_types_utils_1 = require("./mapped-types.utils"); +const modelPropertiesAccessor = new model_properties_accessor_1.ModelPropertiesAccessor(); +const deepPartialCache = new Map(); +function isDtoClass(typeRef) { + if (!typeRef || + typeof typeRef !== 'function' || + typeRef === String || + typeRef === Number || + typeRef === Boolean || + typeRef === Object || + typeRef === Array || + typeRef === Date) { + return false; + } + const fields = modelPropertiesAccessor.getModelProperties(typeRef.prototype); + return fields.length > 0; +} +function DeepPartialType(classRef, options = {}) { + if (deepPartialCache.has(classRef)) { + return deepPartialCache.get(classRef); + } + const applyPartialDecoratorFn = options.skipNullProperties === false + ? mapped_types_1.applyValidateIfDefinedDecorator + : mapped_types_1.applyIsOptionalDecorator; + const fields = modelPropertiesAccessor.getModelProperties(classRef.prototype); + class DeepPartialTypeClass { + constructor() { + (0, mapped_types_1.inheritPropertyInitializers)(this, classRef); + } + } + deepPartialCache.set(classRef, DeepPartialTypeClass); + const keysWithValidationConstraints = (0, mapped_types_1.inheritValidationMetadata)(classRef, DeepPartialTypeClass); + if (keysWithValidationConstraints) { + keysWithValidationConstraints + .filter((key) => !fields.includes(key)) + .forEach((key) => applyPartialDecoratorFn(DeepPartialTypeClass, key)); + } + (0, mapped_types_1.inheritTransformationMetadata)(classRef, DeepPartialTypeClass); + function applyFields(fields) { + (0, mapped_types_utils_1.clonePluginMetadataFactory)(DeepPartialTypeClass, classRef.prototype, (metadata) => (0, lodash_1.mapValues)(metadata, (item) => (Object.assign(Object.assign({}, item), { required: false })))); + if (DeepPartialTypeClass[plugin_constants_1.METADATA_FACTORY_NAME]) { + const pluginFields = Object.keys(DeepPartialTypeClass[plugin_constants_1.METADATA_FACTORY_NAME]()); + pluginFields.forEach((key) => applyPartialDecoratorFn(DeepPartialTypeClass, key)); + } + fields.forEach((key) => { + const metadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, classRef.prototype, key) || {}; + let resolvedType = metadata.type; + if (typeof resolvedType === 'function' && resolvedType.length === 0) { + try { + resolvedType = resolvedType(); + } + catch (_a) { + resolvedType = metadata.type; + } + } + if (Array.isArray(resolvedType) && resolvedType.length === 1) { + resolvedType = resolvedType[0]; + } + const nestedType = isDtoClass(resolvedType) + ? DeepPartialType(resolvedType, options) + : metadata.type; + const decoratorFactory = (0, decorators_1.ApiProperty)(Object.assign(Object.assign({}, metadata), { type: nestedType, required: false })); + decoratorFactory(DeepPartialTypeClass.prototype, key); + applyPartialDecoratorFn(DeepPartialTypeClass, key); + }); + } + applyFields(fields); + metadata_loader_1.MetadataLoader.addRefreshHook(() => { + const fields = modelPropertiesAccessor.getModelProperties(classRef.prototype); + applyFields(fields); + }); + return DeepPartialTypeClass; +} diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/index.d.ts b/node_modules/@nestjs/swagger/dist/type-helpers/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65a653e52c293c01d6ad7a0f6662bfdcc6334857 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/index.d.ts @@ -0,0 +1,5 @@ +export * from './deep-partial-type.helper'; +export * from './intersection-type.helper'; +export * from './omit-type.helper'; +export * from './partial-type.helper'; +export * from './pick-type.helper'; diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/index.js b/node_modules/@nestjs/swagger/dist/type-helpers/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a8cabb975c97a1de2fc715b6b63281d8d5140387 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/index.js @@ -0,0 +1,21 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./deep-partial-type.helper"), exports); +__exportStar(require("./intersection-type.helper"), exports); +__exportStar(require("./omit-type.helper"), exports); +__exportStar(require("./partial-type.helper"), exports); +__exportStar(require("./pick-type.helper"), exports); diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/intersection-type.helper.d.ts b/node_modules/@nestjs/swagger/dist/type-helpers/intersection-type.helper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6331b9e0bf36b4bc9b342ecdd2e74be9508abdf --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/intersection-type.helper.d.ts @@ -0,0 +1,8 @@ +import { Type } from '@nestjs/common'; +type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; +type ClassRefsToConstructors = { + [U in keyof T]: T[U] extends Type ? V : never; +}; +type Intersection = Type[number]>>; +export declare function IntersectionType(...classRefs: T): Intersection; +export {}; diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/intersection-type.helper.js b/node_modules/@nestjs/swagger/dist/type-helpers/intersection-type.helper.js new file mode 100644 index 0000000000000000000000000000000000000000..ff7da273a8a1fbfd1ac36a8e07d55675db597877 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/intersection-type.helper.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IntersectionType = IntersectionType; +const mapped_types_1 = require("@nestjs/mapped-types"); +const constants_1 = require("../constants"); +const decorators_1 = require("../decorators"); +const metadata_loader_1 = require("../plugin/metadata-loader"); +const model_properties_accessor_1 = require("../services/model-properties-accessor"); +const mapped_types_utils_1 = require("./mapped-types.utils"); +const modelPropertiesAccessor = new model_properties_accessor_1.ModelPropertiesAccessor(); +function IntersectionType(...classRefs) { + class IntersectionClassType { + constructor() { + classRefs.forEach((classRef) => { + (0, mapped_types_1.inheritPropertyInitializers)(this, classRef); + }); + } + } + classRefs.forEach((classRef) => { + const fields = modelPropertiesAccessor.getModelProperties(classRef.prototype); + (0, mapped_types_1.inheritValidationMetadata)(classRef, IntersectionClassType); + (0, mapped_types_1.inheritTransformationMetadata)(classRef, IntersectionClassType); + function applyFields(fields) { + (0, mapped_types_utils_1.clonePluginMetadataFactory)(IntersectionClassType, classRef.prototype); + fields.forEach((propertyKey) => { + const metadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, classRef.prototype, propertyKey); + const decoratorFactory = (0, decorators_1.ApiProperty)(metadata); + decoratorFactory(IntersectionClassType.prototype, propertyKey); + }); + } + applyFields(fields); + metadata_loader_1.MetadataLoader.addRefreshHook(() => { + const fields = modelPropertiesAccessor.getModelProperties(classRef.prototype); + applyFields(fields); + }); + }); + const intersectedNames = classRefs.reduce((prev, ref) => prev + ref.name, ''); + Object.defineProperty(IntersectionClassType, 'name', { + value: `Intersection${intersectedNames}` + }); + return IntersectionClassType; +} diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/mapped-types.utils.d.ts b/node_modules/@nestjs/swagger/dist/type-helpers/mapped-types.utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cf5713cfa364adf5ed3f5c912be8986f8b13f7ef --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/mapped-types.utils.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare function clonePluginMetadataFactory(target: Type, parent: Type, transformFn?: (metadata: Record) => Record): void; diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/mapped-types.utils.js b/node_modules/@nestjs/swagger/dist/type-helpers/mapped-types.utils.js new file mode 100644 index 0000000000000000000000000000000000000000..c28844606b34a83b086e65b7169fb0e70dd85dce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/mapped-types.utils.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clonePluginMetadataFactory = clonePluginMetadataFactory; +const lodash_1 = require("lodash"); +const plugin_constants_1 = require("../plugin/plugin-constants"); +function clonePluginMetadataFactory(target, parent, transformFn = lodash_1.identity) { + let targetMetadata = {}; + do { + if (!parent.constructor) { + return; + } + if (!parent.constructor[plugin_constants_1.METADATA_FACTORY_NAME]) { + continue; + } + const parentMetadata = parent.constructor[plugin_constants_1.METADATA_FACTORY_NAME](); + targetMetadata = Object.assign(Object.assign({}, parentMetadata), targetMetadata); + } while ((parent = Reflect.getPrototypeOf(parent)) && + parent !== Object.prototype && + parent); + targetMetadata = transformFn(targetMetadata); + if (target[plugin_constants_1.METADATA_FACTORY_NAME]) { + const originalFactory = target[plugin_constants_1.METADATA_FACTORY_NAME]; + target[plugin_constants_1.METADATA_FACTORY_NAME] = () => { + const originalMetadata = originalFactory(); + return Object.assign(Object.assign({}, originalMetadata), targetMetadata); + }; + } + else { + target[plugin_constants_1.METADATA_FACTORY_NAME] = () => targetMetadata; + } +} diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/omit-type.helper.d.ts b/node_modules/@nestjs/swagger/dist/type-helpers/omit-type.helper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dec22489779dfb7d22eaf5eaed445341b9793780 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/omit-type.helper.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare function OmitType(classRef: Type, keys: readonly K[]): Type>; diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/omit-type.helper.js b/node_modules/@nestjs/swagger/dist/type-helpers/omit-type.helper.js new file mode 100644 index 0000000000000000000000000000000000000000..1105a128816f788dab7ae595b3b8e9c1bf226dfb --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/omit-type.helper.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OmitType = OmitType; +const mapped_types_1 = require("@nestjs/mapped-types"); +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const decorators_1 = require("../decorators"); +const metadata_loader_1 = require("../plugin/metadata-loader"); +const plugin_constants_1 = require("../plugin/plugin-constants"); +const model_properties_accessor_1 = require("../services/model-properties-accessor"); +const mapped_types_utils_1 = require("./mapped-types.utils"); +const modelPropertiesAccessor = new model_properties_accessor_1.ModelPropertiesAccessor(); +function OmitType(classRef, keys) { + const fields = modelPropertiesAccessor + .getModelProperties(classRef.prototype) + .filter((item) => !keys.includes(item)); + const isInheritedPredicate = (propertyKey) => !keys.includes(propertyKey); + class OmitTypeClass { + constructor() { + (0, mapped_types_1.inheritPropertyInitializers)(this, classRef, isInheritedPredicate); + } + } + (0, mapped_types_1.inheritValidationMetadata)(classRef, OmitTypeClass, isInheritedPredicate); + (0, mapped_types_1.inheritTransformationMetadata)(classRef, OmitTypeClass, isInheritedPredicate); + function applyFields(fields) { + (0, mapped_types_utils_1.clonePluginMetadataFactory)(OmitTypeClass, classRef.prototype, (metadata) => (0, lodash_1.omit)(metadata, keys)); + fields.forEach((propertyKey) => { + const metadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, classRef.prototype, propertyKey); + const decoratorFactory = (0, decorators_1.ApiProperty)(metadata); + decoratorFactory(OmitTypeClass.prototype, propertyKey); + }); + if (OmitTypeClass[plugin_constants_1.METADATA_FACTORY_NAME]) { + const pluginMetadata = OmitTypeClass[plugin_constants_1.METADATA_FACTORY_NAME](); + Object.keys(pluginMetadata).forEach((key) => { + if (!fields.includes(key)) { + const decoratorFactory = (0, decorators_1.ApiProperty)(pluginMetadata[key]); + decoratorFactory(OmitTypeClass.prototype, key); + } + }); + } + } + applyFields(fields); + metadata_loader_1.MetadataLoader.addRefreshHook(() => { + const fields = modelPropertiesAccessor + .getModelProperties(classRef.prototype) + .filter((item) => !keys.includes(item)); + applyFields(fields); + }); + return OmitTypeClass; +} diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/partial-type.helper.d.ts b/node_modules/@nestjs/swagger/dist/type-helpers/partial-type.helper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2cdd8a4626acb1bda633c6c4de94f8e365b7a5ae --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/partial-type.helper.d.ts @@ -0,0 +1,4 @@ +import { Type } from '@nestjs/common'; +export declare function PartialType(classRef: Type, options?: { + skipNullProperties?: boolean; +}): Type>; diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/partial-type.helper.js b/node_modules/@nestjs/swagger/dist/type-helpers/partial-type.helper.js new file mode 100644 index 0000000000000000000000000000000000000000..590682ccc95bb46bccb3f0aa51cebd64b6463e24 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/partial-type.helper.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PartialType = PartialType; +const mapped_types_1 = require("@nestjs/mapped-types"); +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const decorators_1 = require("../decorators"); +const metadata_loader_1 = require("../plugin/metadata-loader"); +const plugin_constants_1 = require("../plugin/plugin-constants"); +const model_properties_accessor_1 = require("../services/model-properties-accessor"); +const mapped_types_utils_1 = require("./mapped-types.utils"); +const modelPropertiesAccessor = new model_properties_accessor_1.ModelPropertiesAccessor(); +function PartialType(classRef, options = {}) { + const applyPartialDecoratorFn = options.skipNullProperties === false + ? mapped_types_1.applyValidateIfDefinedDecorator + : mapped_types_1.applyIsOptionalDecorator; + const fields = modelPropertiesAccessor.getModelProperties(classRef.prototype); + class PartialTypeClass { + constructor() { + (0, mapped_types_1.inheritPropertyInitializers)(this, classRef); + } + } + const keysWithValidationConstraints = (0, mapped_types_1.inheritValidationMetadata)(classRef, PartialTypeClass); + if (keysWithValidationConstraints) { + keysWithValidationConstraints + .filter((key) => !fields.includes(key)) + .forEach((key) => applyPartialDecoratorFn(PartialTypeClass, key)); + } + (0, mapped_types_1.inheritTransformationMetadata)(classRef, PartialTypeClass); + function applyFields(fields) { + (0, mapped_types_utils_1.clonePluginMetadataFactory)(PartialTypeClass, classRef.prototype, (metadata) => (0, lodash_1.mapValues)(metadata, (item) => (Object.assign(Object.assign({}, item), { required: false })))); + fields.forEach((key) => { + const metadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, classRef.prototype, key) || {}; + const decoratorFactory = (0, decorators_1.ApiProperty)(Object.assign(Object.assign({}, metadata), { required: false })); + decoratorFactory(PartialTypeClass.prototype, key); + applyPartialDecoratorFn(PartialTypeClass, key); + }); + if (PartialTypeClass[plugin_constants_1.METADATA_FACTORY_NAME]) { + const pluginMetadata = PartialTypeClass[plugin_constants_1.METADATA_FACTORY_NAME](); + const pluginFields = Object.keys(pluginMetadata); + pluginFields.forEach((key) => { + if (!fields.includes(key)) { + const decoratorFactory = (0, decorators_1.ApiProperty)(Object.assign(Object.assign({}, pluginMetadata[key]), { required: false })); + decoratorFactory(PartialTypeClass.prototype, key); + } + applyPartialDecoratorFn(PartialTypeClass, key); + }); + } + } + applyFields(fields); + metadata_loader_1.MetadataLoader.addRefreshHook(() => { + const fields = modelPropertiesAccessor.getModelProperties(classRef.prototype); + applyFields(fields); + }); + return PartialTypeClass; +} diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/pick-type.helper.d.ts b/node_modules/@nestjs/swagger/dist/type-helpers/pick-type.helper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dbba78e8b65dcecd8cd35de317e85445e0a5e83d --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/pick-type.helper.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare function PickType(classRef: Type, keys: readonly K[]): Type>; diff --git a/node_modules/@nestjs/swagger/dist/type-helpers/pick-type.helper.js b/node_modules/@nestjs/swagger/dist/type-helpers/pick-type.helper.js new file mode 100644 index 0000000000000000000000000000000000000000..c9fc8e34cd1d0488cc41310e5d8b2b5e01b76bd0 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/type-helpers/pick-type.helper.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PickType = PickType; +const mapped_types_1 = require("@nestjs/mapped-types"); +const lodash_1 = require("lodash"); +const constants_1 = require("../constants"); +const decorators_1 = require("../decorators"); +const metadata_loader_1 = require("../plugin/metadata-loader"); +const plugin_constants_1 = require("../plugin/plugin-constants"); +const model_properties_accessor_1 = require("../services/model-properties-accessor"); +const mapped_types_utils_1 = require("./mapped-types.utils"); +const modelPropertiesAccessor = new model_properties_accessor_1.ModelPropertiesAccessor(); +function PickType(classRef, keys) { + const fields = modelPropertiesAccessor + .getModelProperties(classRef.prototype) + .filter((item) => keys.includes(item)); + const isInheritedPredicate = (propertyKey) => keys.includes(propertyKey); + class PickTypeClass { + constructor() { + (0, mapped_types_1.inheritPropertyInitializers)(this, classRef, isInheritedPredicate); + } + } + (0, mapped_types_1.inheritValidationMetadata)(classRef, PickTypeClass, isInheritedPredicate); + (0, mapped_types_1.inheritTransformationMetadata)(classRef, PickTypeClass, isInheritedPredicate); + function applyFields(fields) { + (0, mapped_types_utils_1.clonePluginMetadataFactory)(PickTypeClass, classRef.prototype, (metadata) => (0, lodash_1.pick)(metadata, keys)); + fields.forEach((propertyKey) => { + const metadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, classRef.prototype, propertyKey); + const decoratorFactory = (0, decorators_1.ApiProperty)(metadata); + decoratorFactory(PickTypeClass.prototype, propertyKey); + }); + if (PickTypeClass[plugin_constants_1.METADATA_FACTORY_NAME]) { + const pluginMetadata = PickTypeClass[plugin_constants_1.METADATA_FACTORY_NAME](); + Object.keys(pluginMetadata).forEach((key) => { + if (!fields.includes(key)) { + const decoratorFactory = (0, decorators_1.ApiProperty)(pluginMetadata[key]); + decoratorFactory(PickTypeClass.prototype, key); + } + }); + } + } + applyFields(fields); + metadata_loader_1.MetadataLoader.addRefreshHook(() => { + const fields = modelPropertiesAccessor + .getModelProperties(classRef.prototype) + .filter((item) => keys.includes(item)); + applyFields(fields); + }); + return PickTypeClass; +} diff --git a/node_modules/@nestjs/swagger/dist/types/swagger-enum.type.d.ts b/node_modules/@nestjs/swagger/dist/types/swagger-enum.type.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57c3d4e1ea66c0e33b655db4d754d46b708de40e --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/types/swagger-enum.type.d.ts @@ -0,0 +1 @@ +export type SwaggerEnumType = string[] | number[] | boolean[] | (string | number | boolean)[] | Record; diff --git a/node_modules/@nestjs/swagger/dist/types/swagger-enum.type.js b/node_modules/@nestjs/swagger/dist/types/swagger-enum.type.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/types/swagger-enum.type.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nestjs/swagger/dist/utils/apply-example-max-depth.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/apply-example-max-depth.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..59538a40dabf51f3a9d0f8aa730ba00e13143d71 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/apply-example-max-depth.util.d.ts @@ -0,0 +1,2 @@ +import { SchemaObject } from '../interfaces/open-api-spec.interface'; +export declare function applyExampleMaxDepth(schemas: Record, globalMaxDepth: number | undefined): void; diff --git a/node_modules/@nestjs/swagger/dist/utils/apply-example-max-depth.util.js b/node_modules/@nestjs/swagger/dist/utils/apply-example-max-depth.util.js new file mode 100644 index 0000000000000000000000000000000000000000..c6180b5093f704e0d349eae361ca188c4bd1bac4 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/apply-example-max-depth.util.js @@ -0,0 +1,77 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.applyExampleMaxDepth = applyExampleMaxDepth; +function applyExampleMaxDepth(schemas, globalMaxDepth) { + for (const schema of Object.values(schemas)) { + walkSchema(schema, globalMaxDepth); + } +} +function walkSchema(schema, globalMaxDepth) { + if (!schema || typeof schema !== 'object') { + return; + } + const perPropOverride = typeof schema.exampleMaxDepth === 'number' + ? schema.exampleMaxDepth + : undefined; + const effectiveMax = perPropOverride !== undefined ? perPropOverride : globalMaxDepth; + if (effectiveMax !== undefined) { + if ('example' in schema) { + schema.example = trimExampleValue(schema.example, effectiveMax); + } + if ('examples' in schema && Array.isArray(schema.examples)) { + schema.examples = schema.examples.map((entry) => trimExampleValue(entry, effectiveMax)); + } + } + if ('exampleMaxDepth' in schema) { + delete schema.exampleMaxDepth; + } + if (schema.properties && typeof schema.properties === 'object') { + for (const prop of Object.values(schema.properties)) { + walkSchema(prop, globalMaxDepth); + } + } + if (schema.items) { + walkSchema(schema.items, globalMaxDepth); + } + for (const key of ['allOf', 'oneOf', 'anyOf']) { + const combinator = schema[key]; + if (Array.isArray(combinator)) { + for (const sub of combinator) { + walkSchema(sub, globalMaxDepth); + } + } + } + if (schema.additionalProperties && + typeof schema.additionalProperties === 'object') { + walkSchema(schema.additionalProperties, globalMaxDepth); + } +} +function trimExampleValue(value, remainingDepth, path = new WeakSet()) { + if (value === null || typeof value !== 'object') { + return value; + } + const isArray = Array.isArray(value); + if (!isArray && value.constructor !== Object) { + return value; + } + if (remainingDepth <= 0) { + return isArray ? [] : {}; + } + if (path.has(value)) { + return isArray ? [] : {}; + } + path.add(value); + try { + if (isArray) { + return value.map((entry) => trimExampleValue(entry, remainingDepth - 1, path)); + } + const trimmed = {}; + for (const [key, child] of Object.entries(value)) { + trimmed[key] = trimExampleValue(child, remainingDepth - 1, path); + } + return trimmed; + } + finally { + path.delete(value); + } +} diff --git a/node_modules/@nestjs/swagger/dist/utils/assign-two-levels-deep.d.ts b/node_modules/@nestjs/swagger/dist/utils/assign-two-levels-deep.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..22756a01ca2acf11fb994bc2c8d937a4f23f5f2c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/assign-two-levels-deep.d.ts @@ -0,0 +1 @@ +export declare function assignTwoLevelsDeep(_dest: TObject, ...args: T[]): TObject & T; diff --git a/node_modules/@nestjs/swagger/dist/utils/assign-two-levels-deep.js b/node_modules/@nestjs/swagger/dist/utils/assign-two-levels-deep.js new file mode 100644 index 0000000000000000000000000000000000000000..ffa1b91f320c24554a0039d7bb298c42454e3e77 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/assign-two-levels-deep.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assignTwoLevelsDeep = assignTwoLevelsDeep; +function assignTwoLevelsDeep(_dest, ...args) { + const dest = _dest; + for (const arg of args) { + for (const [key, value] of Object.entries(arg !== null && arg !== void 0 ? arg : {})) { + dest[key] = Object.assign(Object.assign({}, dest[key]), value); + } + } + return dest; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/enum.utils.d.ts b/node_modules/@nestjs/swagger/dist/utils/enum.utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..daf3e315698911a42abddfefec40ae64ef765e7d --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/enum.utils.d.ts @@ -0,0 +1,9 @@ +import { SchemaObjectMetadata } from '../interfaces/schema-object-metadata.interface'; +import { SwaggerEnumType } from '../types/swagger-enum.type'; +export declare function getEnumValues(enumType: SwaggerEnumType | (() => SwaggerEnumType)): string[] | number[] | boolean[]; +export declare function getEnumType(values: (string | number | boolean)[]): 'string' | 'number' | 'boolean'; +export declare function addEnumArraySchema(paramDefinition: Partial>, decoratorOptions: Partial>): void; +export declare function addEnumSchema(paramDefinition: Partial>, decoratorOptions: Partial>): void; +export declare const isEnumArray: >>(obj: Record) => obj is T; +export declare const isEnumDefined: >>(obj: Record) => obj is T; +export declare const isEnumMetadata: (metadata: SchemaObjectMetadata) => any; diff --git a/node_modules/@nestjs/swagger/dist/utils/enum.utils.js b/node_modules/@nestjs/swagger/dist/utils/enum.utils.js new file mode 100644 index 0000000000000000000000000000000000000000..c3399c59b0187c4eaff6a88b53a163599b277e4c --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/enum.utils.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isEnumMetadata = exports.isEnumDefined = exports.isEnumArray = void 0; +exports.getEnumValues = getEnumValues; +exports.getEnumType = getEnumType; +exports.addEnumArraySchema = addEnumArraySchema; +exports.addEnumSchema = addEnumSchema; +const lodash_1 = require("lodash"); +function getEnumValues(enumType) { + if (typeof enumType === 'function') { + return getEnumValues(enumType()); + } + if (Array.isArray(enumType)) { + return enumType; + } + if (typeof enumType !== 'object') { + return []; + } + const numericValues = Object.values(enumType) + .filter((value) => typeof value === 'number') + .map((value) => value.toString()); + return Object.keys(enumType) + .filter((key) => !numericValues.includes(key)) + .map((key) => enumType[key]); +} +function getEnumType(values) { + const hasString = values.filter(lodash_1.isString).length > 0; + if (hasString) { + return 'string'; + } + const hasBoolean = values.filter((v) => typeof v === 'boolean').length > 0; + return hasBoolean ? 'boolean' : 'number'; +} +function addEnumArraySchema(paramDefinition, decoratorOptions) { + const paramSchema = paramDefinition.schema || {}; + paramDefinition.schema = paramSchema; + paramSchema.type = 'array'; + delete paramDefinition.isArray; + const enumValues = getEnumValues(decoratorOptions.enum); + paramSchema.items = { + type: getEnumType(enumValues), + enum: enumValues + }; + if (decoratorOptions.enumName) { + paramDefinition.enumName = decoratorOptions.enumName; + } + if (decoratorOptions.enumSchema) { + paramDefinition.enumSchema = decoratorOptions.enumSchema; + } +} +function addEnumSchema(paramDefinition, decoratorOptions) { + const paramSchema = paramDefinition.schema || {}; + const enumValues = getEnumValues(decoratorOptions.enum); + paramDefinition.schema = paramSchema; + paramSchema.enum = enumValues; + paramSchema.type = getEnumType(enumValues); + if (decoratorOptions.enumName) { + paramDefinition.enumName = decoratorOptions.enumName; + } + if (decoratorOptions.enumSchema) { + paramDefinition.enumSchema = decoratorOptions.enumSchema; + } +} +const isEnumArray = (obj) => obj.isArray && obj.enum; +exports.isEnumArray = isEnumArray; +const isEnumDefined = (obj) => obj.enum; +exports.isEnumDefined = isEnumDefined; +const isEnumMetadata = (metadata) => { var _a; return metadata.enum || (metadata.isArray && ((_a = metadata.items) === null || _a === void 0 ? void 0 : _a['enum'])); }; +exports.isEnumMetadata = isEnumMetadata; diff --git a/node_modules/@nestjs/swagger/dist/utils/extend-metadata.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/extend-metadata.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e88c198e5a8292e59d3cc43763f886f3123e2ae3 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/extend-metadata.util.d.ts @@ -0,0 +1,2 @@ +import 'reflect-metadata'; +export declare function extendMetadata[] = any[]>(metadata: T, metakey: string, target: object): any; diff --git a/node_modules/@nestjs/swagger/dist/utils/extend-metadata.util.js b/node_modules/@nestjs/swagger/dist/utils/extend-metadata.util.js new file mode 100644 index 0000000000000000000000000000000000000000..24386ffc2352494c0ea451f4c88c688cd2086ebb --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/extend-metadata.util.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extendMetadata = extendMetadata; +require("reflect-metadata"); +function extendMetadata(metadata, metakey, target) { + const existingMetadata = Reflect.getMetadata(metakey, target); + if (!existingMetadata) { + return metadata; + } + return existingMetadata.concat(metadata); +} diff --git a/node_modules/@nestjs/swagger/dist/utils/generate-schema.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/generate-schema.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a7bfda9170c28eb8817ebdd1399d5dafc61d0995 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/generate-schema.util.d.ts @@ -0,0 +1,6 @@ +import { Type } from '@nestjs/common'; +import { SchemaObject } from '../interfaces/open-api-spec.interface'; +export declare function generateSchema(target: Type, extraSchemas?: Record): { + schema: SchemaObject; + schemas: Record; +}; diff --git a/node_modules/@nestjs/swagger/dist/utils/generate-schema.util.js b/node_modules/@nestjs/swagger/dist/utils/generate-schema.util.js new file mode 100644 index 0000000000000000000000000000000000000000..e7ecb77f5def178454b5bb363dec0654e2b310f4 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/generate-schema.util.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.generateSchema = generateSchema; +const model_properties_accessor_1 = require("../services/model-properties-accessor"); +const schema_object_factory_1 = require("../services/schema-object-factory"); +const swagger_types_mapper_1 = require("../services/swagger-types-mapper"); +function generateSchema(target, extraSchemas = {}) { + const factory = new schema_object_factory_1.SchemaObjectFactory(new model_properties_accessor_1.ModelPropertiesAccessor(), new swagger_types_mapper_1.SwaggerTypesMapper()); + const schemas = Object.assign({}, extraSchemas); + factory.exploreModelSchema(target, schemas); + return { schema: schemas[target.name], schemas }; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/get-global-prefix.d.ts b/node_modules/@nestjs/swagger/dist/utils/get-global-prefix.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..77cdd5367fc563b0f92f01cf7ab5819932a5cce3 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/get-global-prefix.d.ts @@ -0,0 +1,2 @@ +import { INestApplication } from '@nestjs/common'; +export declare function getGlobalPrefix(app: INestApplication): string; diff --git a/node_modules/@nestjs/swagger/dist/utils/get-global-prefix.js b/node_modules/@nestjs/swagger/dist/utils/get-global-prefix.js new file mode 100644 index 0000000000000000000000000000000000000000..b06b2e2114d5bd719bf4bd2cfffe9891840a300d --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/get-global-prefix.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getGlobalPrefix = getGlobalPrefix; +function getGlobalPrefix(app) { + const internalConfigRef = app.config; + return (internalConfigRef && internalConfigRef.getGlobalPrefix()) || ''; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/get-schema-path.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/get-schema-path.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a755c75a417209c417b25b10977f307a64dabf4d --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/get-schema-path.util.d.ts @@ -0,0 +1,4 @@ +export declare function getSchemaPath(model: string | Function): string; +export declare function refs(...models: Function[]): { + $ref: string; +}[]; diff --git a/node_modules/@nestjs/swagger/dist/utils/get-schema-path.util.js b/node_modules/@nestjs/swagger/dist/utils/get-schema-path.util.js new file mode 100644 index 0000000000000000000000000000000000000000..af99666f78b295cc27894cf421d73df378dfb453 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/get-schema-path.util.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSchemaPath = getSchemaPath; +exports.refs = refs; +const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); +const constants_1 = require("../constants"); +function getSchemaPath(model) { + const modelName = (0, shared_utils_1.isString)(model) ? model : getSchemaNameByClass(model); + return `#/components/schemas/${modelName}`; +} +function getSchemaNameByClass(target) { + var _a; + if (!target || typeof target !== 'function') { + return ''; + } + const customSchema = Reflect.getOwnMetadata(constants_1.DECORATORS.API_SCHEMA, target); + if (!customSchema || customSchema.length === 0) { + return target.name; + } + return (_a = customSchema[customSchema.length - 1].name) !== null && _a !== void 0 ? _a : target.name; +} +function refs(...models) { + return models.map((item) => ({ + $ref: getSchemaPath(item.name) + })); +} diff --git a/node_modules/@nestjs/swagger/dist/utils/index.d.ts b/node_modules/@nestjs/swagger/dist/utils/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1cd35aa00ef58a1c4311f35d22d0e24add678fb6 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/index.d.ts @@ -0,0 +1,2 @@ +export * from './get-schema-path.util'; +export * from './generate-schema.util'; diff --git a/node_modules/@nestjs/swagger/dist/utils/index.js b/node_modules/@nestjs/swagger/dist/utils/index.js new file mode 100644 index 0000000000000000000000000000000000000000..79b42ae8a45075472677ad5ac01ebbe68b5d02d3 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./get-schema-path.util"), exports); +__exportStar(require("./generate-schema.util"), exports); diff --git a/node_modules/@nestjs/swagger/dist/utils/is-body-parameter.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/is-body-parameter.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..095a799eeae8d8846973b19b7646e7e25be4bc23 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/is-body-parameter.util.d.ts @@ -0,0 +1,2 @@ +import { ParamWithTypeMetadata } from '../services/parameter-metadata-accessor'; +export declare function isBodyParameter(param: ParamWithTypeMetadata): boolean; diff --git a/node_modules/@nestjs/swagger/dist/utils/is-body-parameter.util.js b/node_modules/@nestjs/swagger/dist/utils/is-body-parameter.util.js new file mode 100644 index 0000000000000000000000000000000000000000..d28e4b8d890fbde514626eeb0d79fcf2dc48ec27 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/is-body-parameter.util.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isBodyParameter = isBodyParameter; +function isBodyParameter(param) { + return param.in === 'body'; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/is-built-in-type.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/is-built-in-type.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf565f61144a68038c4fa6a5bcf98db5800fdee6 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/is-built-in-type.util.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare function isBuiltInType(type: Type | Function | string): boolean; diff --git a/node_modules/@nestjs/swagger/dist/utils/is-built-in-type.util.js b/node_modules/@nestjs/swagger/dist/utils/is-built-in-type.util.js new file mode 100644 index 0000000000000000000000000000000000000000..6df4b0233659ab8ccc2e21c91390d7b1260a5af7 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/is-built-in-type.util.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isBuiltInType = isBuiltInType; +const lodash_1 = require("lodash"); +const constants_1 = require("../services/constants"); +function isBuiltInType(type) { + return (0, lodash_1.isFunction)(type) && constants_1.BUILT_IN_TYPES.some((item) => item === type); +} diff --git a/node_modules/@nestjs/swagger/dist/utils/is-date-ctor.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/is-date-ctor.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3c37683d34f5d7d0707c59a8113923858de43e60 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/is-date-ctor.util.d.ts @@ -0,0 +1,2 @@ +import { Type } from '@nestjs/common'; +export declare function isDateCtor(type: Type | Function | string): boolean; diff --git a/node_modules/@nestjs/swagger/dist/utils/is-date-ctor.util.js b/node_modules/@nestjs/swagger/dist/utils/is-date-ctor.util.js new file mode 100644 index 0000000000000000000000000000000000000000..b01b52df092b36602498b21f455c63ef840978bb --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/is-date-ctor.util.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isDateCtor = isDateCtor; +function isDateCtor(type) { + return type === Date; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/is-oas31-or-later.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/is-oas31-or-later.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a4065045abdb757efead0cfc2be47c2afa8fef49 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/is-oas31-or-later.util.d.ts @@ -0,0 +1 @@ +export declare function isOas31OrLater(openApiVersion: string): boolean; diff --git a/node_modules/@nestjs/swagger/dist/utils/is-oas31-or-later.util.js b/node_modules/@nestjs/swagger/dist/utils/is-oas31-or-later.util.js new file mode 100644 index 0000000000000000000000000000000000000000..310e2cbc20117c9d8b1d32b1f169324719189695 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/is-oas31-or-later.util.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isOas31OrLater = isOas31OrLater; +function isOas31OrLater(openApiVersion) { + const [major, minor] = openApiVersion.split('.').map((part) => Number(part)); + const safeMajor = Number.isNaN(major) ? 0 : major; + const safeMinor = Number.isNaN(minor) ? 0 : minor; + return safeMajor > 3 || (safeMajor === 3 && safeMinor >= 1); +} diff --git a/node_modules/@nestjs/swagger/dist/utils/merge-and-uniq.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/merge-and-uniq.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..401377124b241e9069c18bf85a39c666d241d4ef --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/merge-and-uniq.util.d.ts @@ -0,0 +1 @@ +export declare function mergeAndUniq(a?: unknown, b?: unknown): T; diff --git a/node_modules/@nestjs/swagger/dist/utils/merge-and-uniq.util.js b/node_modules/@nestjs/swagger/dist/utils/merge-and-uniq.util.js new file mode 100644 index 0000000000000000000000000000000000000000..2af6d0665116fa728b5648807463b6bddfc940e2 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/merge-and-uniq.util.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeAndUniq = mergeAndUniq; +const lodash_1 = require("lodash"); +function mergeAndUniq(a = [], b = []) { + return (0, lodash_1.uniq)((0, lodash_1.merge)(a, b)); +} diff --git a/node_modules/@nestjs/swagger/dist/utils/normalize-rel-path.d.ts b/node_modules/@nestjs/swagger/dist/utils/normalize-rel-path.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..227895859cb150386e143a88e4a25baa0a1f65d9 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/normalize-rel-path.d.ts @@ -0,0 +1 @@ +export declare function normalizeRelPath(input: string): string; diff --git a/node_modules/@nestjs/swagger/dist/utils/normalize-rel-path.js b/node_modules/@nestjs/swagger/dist/utils/normalize-rel-path.js new file mode 100644 index 0000000000000000000000000000000000000000..c7f5f608371e76ae12fc902a51c0a576a1cec772 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/normalize-rel-path.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.normalizeRelPath = normalizeRelPath; +function normalizeRelPath(input) { + const output = input.replace(/\/\/+/g, '/'); + return output; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/remove-undefined-keys.d.ts b/node_modules/@nestjs/swagger/dist/utils/remove-undefined-keys.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..140ad84f47d78b45ec508d0c67fc2f4bb3e232c3 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/remove-undefined-keys.d.ts @@ -0,0 +1,5 @@ +export declare function removeUndefinedKeys(obj: { + [x: string]: any; +}): { + [x: string]: any; +}; diff --git a/node_modules/@nestjs/swagger/dist/utils/remove-undefined-keys.js b/node_modules/@nestjs/swagger/dist/utils/remove-undefined-keys.js new file mode 100644 index 0000000000000000000000000000000000000000..c642ab634ba5c61dbb3f7fbfd0ebcd4eb6ed3667 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/remove-undefined-keys.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.removeUndefinedKeys = removeUndefinedKeys; +function removeUndefinedKeys(obj) { + Object.entries(obj).forEach(([key, value]) => { + if (value === undefined) { + delete obj[key]; + } + }); + return obj; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/resolve-path.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/resolve-path.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c771101b7d70283ce816c48fb3880b3da39ade2b --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/resolve-path.util.d.ts @@ -0,0 +1 @@ +export declare function resolvePath(path: string): string; diff --git a/node_modules/@nestjs/swagger/dist/utils/resolve-path.util.js b/node_modules/@nestjs/swagger/dist/utils/resolve-path.util.js new file mode 100644 index 0000000000000000000000000000000000000000..21fd0852bcb2bddc7d25522202db4b52ab14e74e --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/resolve-path.util.js @@ -0,0 +1,40 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolvePath = resolvePath; +const pathLib = __importStar(require("path")); +function resolvePath(path) { + return path ? pathLib.resolve(path) : path; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/reverse-object-keys.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/reverse-object-keys.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..90336d5ea735ffc444cbb622c9a0a48f90b39e4d --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/reverse-object-keys.util.d.ts @@ -0,0 +1 @@ +export declare function reverseObjectKeys(originalObject: Record): Record; diff --git a/node_modules/@nestjs/swagger/dist/utils/reverse-object-keys.util.js b/node_modules/@nestjs/swagger/dist/utils/reverse-object-keys.util.js new file mode 100644 index 0000000000000000000000000000000000000000..80c02c14608016a250217a0c5125a8cbb7486f6e --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/reverse-object-keys.util.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.reverseObjectKeys = reverseObjectKeys; +function reverseObjectKeys(originalObject) { + const reversedObject = {}; + const keys = Object.keys(originalObject).reverse(); + for (const key of keys) { + reversedObject[key] = originalObject[key]; + } + return reversedObject; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/sort-object-lexicographically.d.ts b/node_modules/@nestjs/swagger/dist/utils/sort-object-lexicographically.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7c67a471b6a74cf469b9896a2a8d0ca660e227c8 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/sort-object-lexicographically.d.ts @@ -0,0 +1,5 @@ +export declare function sortObjectLexicographically(obj: { + [key: string]: any; +}): { + [key: string]: any; +}; diff --git a/node_modules/@nestjs/swagger/dist/utils/sort-object-lexicographically.js b/node_modules/@nestjs/swagger/dist/utils/sort-object-lexicographically.js new file mode 100644 index 0000000000000000000000000000000000000000..08c2ce46158e0dc2e071a96b1ca20a1d4856c6d0 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/sort-object-lexicographically.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sortObjectLexicographically = sortObjectLexicographically; +function sortObjectLexicographically(obj) { + const sortedKeys = Object.keys(obj).sort(); + const sortedObj = {}; + for (const key of sortedKeys) { + sortedObj[key] = obj[key]; + } + return sortedObj; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/standard-schema-to-openapi.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/standard-schema-to-openapi.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7f8ffc87aded90091787d424891e3a7bd54aee72 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/standard-schema-to-openapi.util.d.ts @@ -0,0 +1,7 @@ +import type { StandardSchemaConverter } from '../interfaces/swagger-document-options.interface.js'; +import { ReferenceObject, SchemaObject } from '../interfaces/open-api-spec.interface.js'; +export interface ConvertedStandardSchema { + schema: SchemaObject | ReferenceObject; + components: Record; +} +export declare function convertStandardSchemaToOpenAPI(schema: unknown, schemaType?: 'input' | 'output', schemaConverter?: StandardSchemaConverter): ConvertedStandardSchema | undefined; diff --git a/node_modules/@nestjs/swagger/dist/utils/standard-schema-to-openapi.util.js b/node_modules/@nestjs/swagger/dist/utils/standard-schema-to-openapi.util.js new file mode 100644 index 0000000000000000000000000000000000000000..99b5bfd0f4db40102f6ebabb7311800f9caf09d5 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/standard-schema-to-openapi.util.js @@ -0,0 +1,116 @@ +import { omit, omitBy, transform } from 'es-toolkit/compat'; +export function convertStandardSchemaToOpenAPI(schema, schemaType = 'input', schemaConverter) { + if (!isStandardSchema(schema)) { + return undefined; + } + const customSchema = schemaConverter?.(schema, { schemaType }); + if (customSchema) { + return normalizeCustomConvertedSchema(customSchema); + } + if (!hasStandardJsonSchema(schema)) { + return undefined; + } + const convert = schema['~standard'].jsonSchema?.[schemaType]; + if (!convert) { + return undefined; + } + const convertedSchema = convert({ target: 'openapi-3.0' }); + if (!convertedSchema || typeof convertedSchema !== 'object') { + return undefined; + } + return normalizeConvertedSchema(convertedSchema); +} +function isStandardSchema(schema) { + return !!(schema && typeof schema === 'object' && '~standard' in schema); +} +function hasStandardJsonSchema(schema) { + const standard = schema['~standard']; + return !!standard && 'jsonSchema' in standard; +} +function normalizeCustomConvertedSchema(convertedSchema) { + return { + schema: rewriteDefinitionRefs(convertedSchema.schema), + components: rewriteComponents(convertedSchema.components || {}) + }; +} +function normalizeConvertedSchema(schema, components = {}) { + const normalizedComponents = getDefinitionEntries(schema).reduce((acc, [name, definition]) => ({ + ...acc, + [name]: rewriteDefinitionRefs(definition) + }), {}); + return { + schema: rewriteDefinitionRefs(omit(schema, ['$defs', 'definitions', '$schema'])), + components: { + ...rewriteComponents(components), + ...normalizedComponents + } + }; +} +function rewriteComponents(components) { + return Object.entries(components).reduce((acc, [name, definition]) => ({ + ...acc, + [name]: rewriteDefinitionRefs(definition) + }), {}); +} +function getDefinitionEntries(schema) { + const definitions = schema.$defs || schema.definitions; + if (!definitions || typeof definitions !== 'object') { + return []; + } + return Object.entries(definitions); +} +function rewriteDefinitionRefs(value) { + if (Array.isArray(value)) { + return value.map((item) => rewriteValue(item)); + } + const rewrittenValue = omitBy(transform(value, (result, currentValue, key) => { + result[key] = rewriteValue(currentValue); + }, {}), (currentValue) => currentValue === undefined); + return normalizeSchemaExamples(rewrittenValue); +} +function rewriteValue(value) { + if (Array.isArray(value)) { + return value.map((item) => rewriteValue(item)); + } + if (!value || typeof value !== 'object') { + return value; + } + const currentValue = value; + if (typeof currentValue.$ref === 'string') { + return { + ...rewriteDefinitionRefs(omit(currentValue, ['$ref'])), + $ref: currentValue.$ref + .replace('#/$defs/', '#/components/schemas/') + .replace('#/definitions/', '#/components/schemas/') + }; + } + return rewriteDefinitionRefs(currentValue); +} +function normalizeSchemaExamples(value) { + const normalizedConstValue = normalizeSchemaConst(value); + if (!Array.isArray(normalizedConstValue.examples) || + normalizedConstValue.example !== undefined) { + return normalizedConstValue; + } + const [firstExample] = normalizedConstValue.examples; + return { + ...omit(normalizedConstValue, ['examples']), + example: firstExample + }; +} +function normalizeSchemaConst(value) { + if (!('const' in value)) { + return value; + } + const constValue = value.const; + if (!Array.isArray(value.examples) || value.example !== undefined) { + return { + ...omit(value, ['const']), + enum: value.enum ?? [constValue] + }; + } + return { + ...omit(value, ['const']), + enum: value.enum ?? [constValue] + }; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/strip-dynamic-defaults.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/strip-dynamic-defaults.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..601a2ff864e4a48e86f71c4f5bd72992efa6c892 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/strip-dynamic-defaults.util.d.ts @@ -0,0 +1,2 @@ +import { SchemaObject } from '../interfaces/open-api-spec.interface'; +export declare function stripDynamicDefaults(schemas: Record): void; diff --git a/node_modules/@nestjs/swagger/dist/utils/strip-dynamic-defaults.util.js b/node_modules/@nestjs/swagger/dist/utils/strip-dynamic-defaults.util.js new file mode 100644 index 0000000000000000000000000000000000000000..241c68aa053a02422ff5a95857e4b2a14d0eb95f --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/strip-dynamic-defaults.util.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stripDynamicDefaults = stripDynamicDefaults; +function isDynamicDefault(value) { + if (value === null || + value === undefined || + typeof value === 'string' || + typeof value === 'number' || + typeof value === 'boolean') { + return false; + } + if (typeof value === 'function') { + return true; + } + if (Array.isArray(value)) { + return false; + } + if (typeof value === 'object' && value.constructor === Object) { + return false; + } + return true; +} +function stripDynamicDefaults(schemas) { + for (const schema of Object.values(schemas)) { + stripFromSchema(schema); + } +} +function stripFromSchema(schema) { + if (!schema || typeof schema !== 'object') { + return; + } + if ('default' in schema && isDynamicDefault(schema.default)) { + delete schema.default; + } + if (schema.properties) { + for (const prop of Object.values(schema.properties)) { + stripFromSchema(prop); + } + } + if (schema.items) { + stripFromSchema(schema.items); + } + for (const key of ['allOf', 'oneOf', 'anyOf']) { + if (schema[key]) { + for (const sub of schema[key]) { + stripFromSchema(sub); + } + } + } +} diff --git a/node_modules/@nestjs/swagger/dist/utils/strip-last-slash.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/strip-last-slash.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d40d325d6021c8da5372f7ad43e2bc4e0a528ed0 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/strip-last-slash.util.d.ts @@ -0,0 +1 @@ +export declare function stripLastSlash(path: string): string; diff --git a/node_modules/@nestjs/swagger/dist/utils/strip-last-slash.util.js b/node_modules/@nestjs/swagger/dist/utils/strip-last-slash.util.js new file mode 100644 index 0000000000000000000000000000000000000000..9082452e36683558fd4c564ca4d916c1451f2e9f --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/strip-last-slash.util.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stripLastSlash = stripLastSlash; +function stripLastSlash(path) { + return path && path[path.length - 1] === '/' + ? path.slice(0, path.length - 1) + : path; +} diff --git a/node_modules/@nestjs/swagger/dist/utils/validate-global-prefix.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/validate-global-prefix.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8ad70d680b87b7f6fb9e6b3f517703c3f37034e --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/validate-global-prefix.util.d.ts @@ -0,0 +1 @@ +export declare const validateGlobalPrefix: (globalPrefix: string) => boolean; diff --git a/node_modules/@nestjs/swagger/dist/utils/validate-global-prefix.util.js b/node_modules/@nestjs/swagger/dist/utils/validate-global-prefix.util.js new file mode 100644 index 0000000000000000000000000000000000000000..3b4987632ce442e94755509e7ea5c365f1968d4f --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/validate-global-prefix.util.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateGlobalPrefix = void 0; +const validateGlobalPrefix = (globalPrefix) => globalPrefix && !globalPrefix.match(/^(\/?)$/); +exports.validateGlobalPrefix = validateGlobalPrefix; diff --git a/node_modules/@nestjs/swagger/dist/utils/validate-path.util.d.ts b/node_modules/@nestjs/swagger/dist/utils/validate-path.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..475ba5bfc72ca97b1e164ee22da0d980c8c06ce2 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/validate-path.util.d.ts @@ -0,0 +1 @@ +export declare const validatePath: (inputPath: string) => string; diff --git a/node_modules/@nestjs/swagger/dist/utils/validate-path.util.js b/node_modules/@nestjs/swagger/dist/utils/validate-path.util.js new file mode 100644 index 0000000000000000000000000000000000000000..5198b0f5ab13742ecce17a8ac1f8ef0a30defc23 --- /dev/null +++ b/node_modules/@nestjs/swagger/dist/utils/validate-path.util.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validatePath = void 0; +const validatePath = (inputPath) => inputPath.charAt(0) !== '/' ? '/' + inputPath : inputPath; +exports.validatePath = validatePath; diff --git a/node_modules/@nestjs/swagger/nest-cli.json b/node_modules/@nestjs/swagger/nest-cli.json new file mode 100644 index 0000000000000000000000000000000000000000..8c7255b4eab5c50d6ab5130646d03a4a0b5a658a --- /dev/null +++ b/node_modules/@nestjs/swagger/nest-cli.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://json.schemastore.org/nest-cli", + "collection": "@nestjs/schematics", + "sourceRoot": "e2e", + "entryFile": "e2e/manual-e2e" +} diff --git a/node_modules/@nestjs/swagger/oxlintrc.json b/node_modules/@nestjs/swagger/oxlintrc.json new file mode 100644 index 0000000000000000000000000000000000000000..1ba8dbb46056ca05933eb155ff91044469630a92 --- /dev/null +++ b/node_modules/@nestjs/swagger/oxlintrc.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://raw.githubusercontent.com/nicolo-ribaudo/oxc-project/refs/heads/nicolo/json-schema/npm/oxlint/configuration_schema.json", + "rules": { + "no-useless-escape": "off" + }, + "ignorePatterns": ["dist", "node_modules"] +}