1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | 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;
|
4 | const request_method_enum_1 = require("@nestjs/common/enums/request-method.enum");
|
5 | const version_options_interface_1 = require("@nestjs/common/interfaces/version-options.interface");
|
6 | const MODULE_INIT_MESSAGE = (text, module) => `${module} dependencies initialized`;
|
7 | exports.MODULE_INIT_MESSAGE = MODULE_INIT_MESSAGE;
|
8 | const ROUTE_MAPPED_MESSAGE = (path, method) => `Mapped {${path}, ${request_method_enum_1.RequestMethod[method]}} route`;
|
9 | exports.ROUTE_MAPPED_MESSAGE = ROUTE_MAPPED_MESSAGE;
|
10 | const VERSIONED_ROUTE_MAPPED_MESSAGE = (path, method, version) => {
|
11 | const controllerVersions = Array.isArray(version) ? version : [version];
|
12 | const versions = controllerVersions
|
13 | .map(version => (version === version_options_interface_1.VERSION_NEUTRAL ? 'Neutral' : version))
|
14 | .join(',');
|
15 | return `Mapped {${path}, ${request_method_enum_1.RequestMethod[method]}} (version: ${versions}) route`;
|
16 | };
|
17 | exports.VERSIONED_ROUTE_MAPPED_MESSAGE = VERSIONED_ROUTE_MAPPED_MESSAGE;
|
18 | const CONTROLLER_MAPPING_MESSAGE = (name, path) => `${name} {${path}}:`;
|
19 | exports.CONTROLLER_MAPPING_MESSAGE = CONTROLLER_MAPPING_MESSAGE;
|
20 | const VERSIONED_CONTROLLER_MAPPING_MESSAGE = (name, path, version) => {
|
21 | const controllerVersions = Array.isArray(version) ? version : [version];
|
22 | const versions = controllerVersions
|
23 | .map(version => (version === version_options_interface_1.VERSION_NEUTRAL ? 'Neutral' : version))
|
24 | .join(',');
|
25 | return `${name} {${path}} (version: ${versions}):`;
|
26 | };
|
27 | exports.VERSIONED_CONTROLLER_MAPPING_MESSAGE = VERSIONED_CONTROLLER_MAPPING_MESSAGE;
|
28 | const INVALID_EXECUTION_CONTEXT = (methodName, currentContext) => `Calling ${methodName} is not allowed in this context. Your current execution context is "${currentContext}".`;
|
29 | exports.INVALID_EXECUTION_CONTEXT = INVALID_EXECUTION_CONTEXT;
|