@nestjs/common 11.1.15 → 12.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constants.js +35 -38
- package/decorators/core/apply-decorators.js +1 -4
- package/decorators/core/bind.decorator.js +1 -4
- package/decorators/core/catch.decorator.d.ts +1 -1
- package/decorators/core/catch.decorator.js +4 -7
- package/decorators/core/controller.decorator.d.ts +1 -1
- package/decorators/core/controller.decorator.js +10 -13
- package/decorators/core/dependencies.decorator.js +4 -9
- package/decorators/core/exception-filters.decorator.d.ts +1 -1
- package/decorators/core/exception-filters.decorator.js +10 -14
- package/decorators/core/index.d.ts +14 -14
- package/decorators/core/index.js +14 -17
- package/decorators/core/inject.decorator.d.ts +1 -1
- package/decorators/core/inject.decorator.js +9 -12
- package/decorators/core/injectable.decorator.d.ts +2 -2
- package/decorators/core/injectable.decorator.js +7 -11
- package/decorators/core/optional.decorator.js +8 -11
- package/decorators/core/set-metadata.decorator.js +1 -5
- package/decorators/core/use-guards.decorator.d.ts +1 -1
- package/decorators/core/use-guards.decorator.js +10 -13
- package/decorators/core/use-interceptors.decorator.d.ts +1 -1
- package/decorators/core/use-interceptors.decorator.js +10 -13
- package/decorators/core/use-pipes.decorator.d.ts +1 -1
- package/decorators/core/use-pipes.decorator.js +9 -12
- package/decorators/core/version.decorator.d.ts +1 -1
- package/decorators/core/version.decorator.js +3 -6
- package/decorators/http/create-route-param-metadata.decorator.d.ts +6 -5
- package/decorators/http/create-route-param-metadata.decorator.js +48 -16
- package/decorators/http/header.decorator.js +4 -7
- package/decorators/http/http-code.decorator.js +3 -6
- package/decorators/http/index.d.ts +8 -8
- package/decorators/http/index.js +8 -11
- package/decorators/http/redirect.decorator.js +3 -6
- package/decorators/http/render.decorator.js +3 -6
- package/decorators/http/request-mapping.decorator.d.ts +1 -1
- package/decorators/http/request-mapping.decorator.js +28 -32
- package/decorators/http/route-params.decorator.d.ts +153 -3
- package/decorators/http/route-params.decorator.js +124 -49
- package/decorators/http/sse.decorator.d.ts +2 -2
- package/decorators/http/sse.decorator.js +7 -10
- package/decorators/index.d.ts +3 -3
- package/decorators/index.js +3 -6
- package/decorators/modules/global.decorator.js +3 -6
- package/decorators/modules/index.d.ts +2 -2
- package/decorators/modules/index.js +2 -5
- package/decorators/modules/module.decorator.d.ts +1 -1
- package/decorators/modules/module.decorator.js +3 -6
- package/enums/http-status.enum.js +2 -5
- package/enums/index.d.ts +4 -4
- package/enums/index.js +4 -7
- package/enums/request-method.enum.js +2 -5
- package/enums/route-paramtypes.enum.js +2 -5
- package/enums/shutdown-signal.enum.js +2 -5
- package/enums/version-type.enum.js +2 -5
- package/exceptions/bad-gateway.exception.d.ts +1 -1
- package/exceptions/bad-gateway.exception.js +5 -9
- package/exceptions/bad-request.exception.d.ts +1 -1
- package/exceptions/bad-request.exception.js +5 -9
- package/exceptions/conflict.exception.d.ts +1 -1
- package/exceptions/conflict.exception.js +5 -9
- package/exceptions/forbidden.exception.d.ts +1 -1
- package/exceptions/forbidden.exception.js +5 -9
- package/exceptions/gateway-timeout.exception.d.ts +1 -1
- package/exceptions/gateway-timeout.exception.js +5 -9
- package/exceptions/gone.exception.d.ts +1 -1
- package/exceptions/gone.exception.js +5 -9
- package/exceptions/http-version-not-supported.exception.d.ts +1 -1
- package/exceptions/http-version-not-supported.exception.js +5 -9
- package/exceptions/http.exception.d.ts +6 -2
- package/exceptions/http.exception.js +36 -17
- package/exceptions/im-a-teapot.exception.d.ts +1 -1
- package/exceptions/im-a-teapot.exception.js +5 -9
- package/exceptions/index.d.ts +23 -23
- package/exceptions/index.js +23 -26
- package/exceptions/internal-server-error.exception.d.ts +1 -1
- package/exceptions/internal-server-error.exception.js +5 -9
- package/exceptions/intrinsic.exception.js +1 -5
- package/exceptions/method-not-allowed.exception.d.ts +1 -1
- package/exceptions/method-not-allowed.exception.js +5 -9
- package/exceptions/misdirected.exception.d.ts +1 -1
- package/exceptions/misdirected.exception.js +5 -9
- package/exceptions/not-acceptable.exception.d.ts +1 -1
- package/exceptions/not-acceptable.exception.js +5 -9
- package/exceptions/not-found.exception.d.ts +1 -1
- package/exceptions/not-found.exception.js +5 -9
- package/exceptions/not-implemented.exception.d.ts +1 -1
- package/exceptions/not-implemented.exception.js +5 -9
- package/exceptions/payload-too-large.exception.d.ts +1 -1
- package/exceptions/payload-too-large.exception.js +5 -9
- package/exceptions/precondition-failed.exception.d.ts +1 -1
- package/exceptions/precondition-failed.exception.js +5 -9
- package/exceptions/request-timeout.exception.d.ts +1 -1
- package/exceptions/request-timeout.exception.js +5 -9
- package/exceptions/service-unavailable.exception.d.ts +1 -1
- package/exceptions/service-unavailable.exception.js +5 -9
- package/exceptions/unauthorized.exception.d.ts +1 -1
- package/exceptions/unauthorized.exception.js +5 -9
- package/exceptions/unprocessable-entity.exception.d.ts +1 -1
- package/exceptions/unprocessable-entity.exception.js +5 -9
- package/exceptions/unsupported-media-type.exception.d.ts +1 -1
- package/exceptions/unsupported-media-type.exception.js +5 -9
- package/file-stream/index.d.ts +1 -1
- package/file-stream/index.js +1 -4
- package/file-stream/interfaces/index.d.ts +2 -2
- package/file-stream/interfaces/index.js +2 -5
- package/file-stream/interfaces/streamable-handler-response.interface.js +1 -2
- package/file-stream/interfaces/streamable-options.interface.js +1 -2
- package/file-stream/streamable-file.d.ts +2 -2
- package/file-stream/streamable-file.js +26 -28
- package/index.d.ts +10 -10
- package/index.js +11 -17
- package/interfaces/abstract.interface.js +1 -2
- package/interfaces/controllers/controller-metadata.interface.js +1 -2
- package/interfaces/controllers/controller.interface.js +1 -2
- package/interfaces/controllers/index.d.ts +2 -2
- package/interfaces/controllers/index.js +2 -5
- package/interfaces/exceptions/exception-filter-metadata.interface.d.ts +2 -2
- package/interfaces/exceptions/exception-filter-metadata.interface.js +1 -2
- package/interfaces/exceptions/exception-filter.interface.d.ts +1 -1
- package/interfaces/exceptions/exception-filter.interface.js +1 -2
- package/interfaces/exceptions/index.d.ts +5 -5
- package/interfaces/exceptions/index.js +5 -8
- package/interfaces/exceptions/rpc-exception-filter-metadata.interface.d.ts +2 -2
- package/interfaces/exceptions/rpc-exception-filter-metadata.interface.js +1 -2
- package/interfaces/exceptions/rpc-exception-filter.interface.d.ts +1 -1
- package/interfaces/exceptions/rpc-exception-filter.interface.js +1 -2
- package/interfaces/exceptions/ws-exception-filter.interface.d.ts +1 -1
- package/interfaces/exceptions/ws-exception-filter.interface.js +1 -2
- package/interfaces/external/class-transform-options.interface.js +1 -2
- package/interfaces/external/cors-options.interface.js +1 -2
- package/interfaces/external/https-options.interface.js +1 -2
- package/interfaces/external/transformer-package.interface.d.ts +2 -2
- package/interfaces/external/transformer-package.interface.js +1 -2
- package/interfaces/external/validation-error.interface.js +1 -2
- package/interfaces/external/validator-options.interface.js +1 -2
- package/interfaces/external/validator-package.interface.d.ts +2 -2
- package/interfaces/external/validator-package.interface.js +1 -2
- package/interfaces/features/arguments-host.interface.js +1 -2
- package/interfaces/features/can-activate.interface.d.ts +1 -1
- package/interfaces/features/can-activate.interface.js +1 -2
- package/interfaces/features/custom-route-param-factory.interface.d.ts +1 -1
- package/interfaces/features/custom-route-param-factory.interface.js +1 -2
- package/interfaces/features/execution-context.interface.d.ts +2 -2
- package/interfaces/features/execution-context.interface.js +1 -2
- package/interfaces/features/nest-interceptor.interface.d.ts +1 -1
- package/interfaces/features/nest-interceptor.interface.js +1 -2
- package/interfaces/features/paramtype.interface.js +1 -2
- package/interfaces/features/pipe-transform.interface.d.ts +10 -4
- package/interfaces/features/pipe-transform.interface.js +1 -2
- package/interfaces/global-prefix-options.interface.d.ts +1 -1
- package/interfaces/global-prefix-options.interface.js +1 -2
- package/interfaces/hooks/before-application-shutdown.interface.js +1 -2
- package/interfaces/hooks/index.d.ts +5 -5
- package/interfaces/hooks/index.js +5 -8
- package/interfaces/hooks/on-application-bootstrap.interface.js +1 -2
- package/interfaces/hooks/on-application-shutdown.interface.js +1 -2
- package/interfaces/hooks/on-destroy.interface.js +1 -2
- package/interfaces/hooks/on-init.interface.js +1 -2
- package/interfaces/http/http-exception-body.interface.d.ts +2 -1
- package/interfaces/http/http-exception-body.interface.js +1 -2
- package/interfaces/http/http-redirect-response.interface.d.ts +1 -1
- package/interfaces/http/http-redirect-response.interface.js +1 -2
- package/interfaces/http/http-server.interface.d.ts +4 -3
- package/interfaces/http/http-server.interface.js +1 -2
- package/interfaces/http/index.d.ts +5 -5
- package/interfaces/http/index.js +5 -8
- package/interfaces/http/message-event.interface.js +1 -2
- package/interfaces/http/raw-body-request.interface.js +1 -2
- package/interfaces/index.d.ts +31 -30
- package/interfaces/index.js +31 -33
- package/interfaces/injectable.interface.js +1 -2
- package/interfaces/microservices/nest-hybrid-application-options.interface.js +1 -2
- package/interfaces/microservices/nest-microservice-options.interface.d.ts +1 -1
- package/interfaces/microservices/nest-microservice-options.interface.js +1 -2
- package/interfaces/microservices/pre-request-hook.interface.d.ts +22 -0
- package/interfaces/microservices/pre-request-hook.interface.js +1 -0
- package/interfaces/middleware/index.d.ts +4 -4
- package/interfaces/middleware/index.js +4 -7
- package/interfaces/middleware/middleware-config-proxy.interface.d.ts +3 -3
- package/interfaces/middleware/middleware-config-proxy.interface.js +1 -2
- package/interfaces/middleware/middleware-configuration.interface.d.ts +3 -3
- package/interfaces/middleware/middleware-configuration.interface.js +1 -2
- package/interfaces/middleware/middleware-consumer.interface.d.ts +2 -2
- package/interfaces/middleware/middleware-consumer.interface.js +1 -2
- package/interfaces/middleware/nest-middleware.interface.js +1 -2
- package/interfaces/modules/dynamic-module.interface.d.ts +2 -2
- package/interfaces/modules/dynamic-module.interface.js +1 -2
- package/interfaces/modules/forward-reference.interface.js +1 -2
- package/interfaces/modules/index.d.ts +8 -8
- package/interfaces/modules/index.js +8 -11
- package/interfaces/modules/injection-token.interface.d.ts +2 -2
- package/interfaces/modules/injection-token.interface.js +1 -2
- package/interfaces/modules/introspection-result.interface.d.ts +1 -1
- package/interfaces/modules/introspection-result.interface.js +1 -2
- package/interfaces/modules/module-metadata.interface.d.ts +5 -5
- package/interfaces/modules/module-metadata.interface.js +1 -2
- package/interfaces/modules/nest-module.interface.d.ts +1 -1
- package/interfaces/modules/nest-module.interface.js +1 -2
- package/interfaces/modules/optional-factory-dependency.interface.d.ts +1 -1
- package/interfaces/modules/optional-factory-dependency.interface.js +1 -2
- package/interfaces/modules/provider.interface.d.ts +4 -4
- package/interfaces/modules/provider.interface.js +1 -2
- package/interfaces/nest-application-context-options.interface.d.ts +1 -1
- package/interfaces/nest-application-context-options.interface.js +55 -5
- package/interfaces/nest-application-context.interface.d.ts +6 -6
- package/interfaces/nest-application-context.interface.js +1 -2
- package/interfaces/nest-application-options.interface.d.ts +9 -3
- package/interfaces/nest-application-options.interface.js +1 -2
- package/interfaces/nest-application.interface.d.ts +8 -8
- package/interfaces/nest-application.interface.js +1 -2
- package/interfaces/nest-microservice.interface.d.ts +15 -6
- package/interfaces/nest-microservice.interface.js +1 -2
- package/interfaces/scope-options.interface.js +2 -5
- package/interfaces/shutdown-hooks-options.interface.js +1 -2
- package/interfaces/type.interface.js +1 -2
- package/interfaces/version-options.interface.d.ts +1 -1
- package/interfaces/version-options.interface.js +1 -4
- package/interfaces/websockets/web-socket-adapter.interface.js +1 -2
- package/internal.d.ts +30 -0
- package/internal.js +19 -0
- package/module-utils/configurable-module.builder.d.ts +4 -4
- package/module-utils/configurable-module.builder.js +21 -20
- package/module-utils/constants.js +5 -8
- package/module-utils/index.d.ts +2 -2
- package/module-utils/index.js +2 -5
- package/module-utils/interfaces/configurable-module-async-options.interface.d.ts +2 -2
- package/module-utils/interfaces/configurable-module-async-options.interface.js +1 -2
- package/module-utils/interfaces/configurable-module-cls.interface.d.ts +3 -3
- package/module-utils/interfaces/configurable-module-cls.interface.js +1 -2
- package/module-utils/interfaces/configurable-module-host.interface.d.ts +2 -2
- package/module-utils/interfaces/configurable-module-host.interface.js +1 -2
- package/module-utils/interfaces/index.d.ts +3 -3
- package/module-utils/interfaces/index.js +3 -6
- package/module-utils/utils/generate-options-injection-token.util.js +3 -6
- package/module-utils/utils/get-injection-providers.util.d.ts +1 -1
- package/module-utils/utils/get-injection-providers.util.js +4 -7
- package/module-utils/utils/index.d.ts +2 -2
- package/module-utils/utils/index.js +2 -5
- package/package.json +35 -2
- package/pipes/default-value.pipe.d.ts +1 -1
- package/pipes/default-value.pipe.js +10 -12
- package/pipes/file/file-type.validator.d.ts +3 -3
- package/pipes/file/file-type.validator.js +5 -19
- package/pipes/file/file-validator-context.interface.d.ts +1 -1
- package/pipes/file/file-validator-context.interface.js +1 -2
- package/pipes/file/file-validator.interface.d.ts +1 -1
- package/pipes/file/file-validator.interface.js +2 -5
- package/pipes/file/index.d.ts +6 -6
- package/pipes/file/index.js +6 -9
- package/pipes/file/interfaces/file.interface.js +1 -2
- package/pipes/file/interfaces/index.d.ts +1 -1
- package/pipes/file/interfaces/index.js +1 -4
- package/pipes/file/max-file-size.validator.d.ts +3 -3
- package/pipes/file/max-file-size.validator.js +2 -6
- package/pipes/file/parse-file-options.interface.d.ts +2 -2
- package/pipes/file/parse-file-options.interface.js +1 -2
- package/pipes/file/parse-file-pipe.builder.d.ts +5 -5
- package/pipes/file/parse-file-pipe.builder.js +8 -14
- package/pipes/file/parse-file.pipe.d.ts +7 -7
- package/pipes/file/parse-file.pipe.js +17 -18
- package/pipes/index.d.ts +11 -10
- package/pipes/index.js +11 -13
- package/pipes/parse-array.pipe.d.ts +4 -4
- package/pipes/parse-array.pipe.js +23 -23
- package/pipes/parse-bool.pipe.d.ts +6 -6
- package/pipes/parse-bool.pipe.js +16 -17
- package/pipes/parse-date.pipe.d.ts +4 -4
- package/pipes/parse-date.pipe.js +17 -16
- package/pipes/parse-enum.pipe.d.ts +5 -5
- package/pipes/parse-enum.pipe.js +16 -16
- package/pipes/parse-float.pipe.d.ts +6 -6
- package/pipes/parse-float.pipe.js +17 -18
- package/pipes/parse-int.pipe.d.ts +5 -5
- package/pipes/parse-int.pipe.js +18 -19
- package/pipes/parse-uuid.pipe.d.ts +4 -4
- package/pipes/parse-uuid.pipe.js +27 -26
- package/pipes/standard-schema-validation.pipe.d.ts +86 -0
- package/pipes/standard-schema-validation.pipe.js +120 -0
- package/pipes/validation.pipe.d.ts +32 -14
- package/pipes/validation.pipe.js +60 -30
- package/serializer/class-serializer.constants.js +1 -4
- package/serializer/class-serializer.interceptor.d.ts +5 -5
- package/serializer/class-serializer.interceptor.js +21 -24
- package/serializer/class-serializer.interfaces.d.ts +2 -2
- package/serializer/class-serializer.interfaces.js +1 -2
- package/serializer/decorators/index.d.ts +1 -1
- package/serializer/decorators/index.js +1 -4
- package/serializer/decorators/serialize-options.decorator.d.ts +3 -2
- package/serializer/decorators/serialize-options.decorator.js +3 -7
- package/serializer/index.d.ts +5 -3
- package/serializer/index.js +5 -6
- package/serializer/standard-schema-serializer.interceptor.d.ts +50 -0
- package/serializer/standard-schema-serializer.interceptor.js +75 -0
- package/serializer/standard-schema-serializer.interfaces.d.ts +18 -0
- package/serializer/standard-schema-serializer.interfaces.js +1 -0
- package/services/console-logger.service.d.ts +22 -3
- package/services/console-logger.service.js +132 -66
- package/services/index.d.ts +3 -3
- package/services/index.js +3 -6
- package/services/logger.service.js +86 -83
- package/services/utils/filter-log-levels.util.d.ts +1 -1
- package/services/utils/filter-log-levels.util.js +7 -10
- package/services/utils/index.d.ts +3 -3
- package/services/utils/index.js +3 -6
- package/services/utils/is-log-level-enabled.util.d.ts +1 -1
- package/services/utils/is-log-level-enabled.util.js +1 -4
- package/services/utils/is-log-level.util.d.ts +1 -1
- package/services/utils/is-log-level.util.js +3 -6
- package/tsconfig.build.json +1 -2
- package/utils/assign-custom-metadata.util.d.ts +5 -4
- package/utils/assign-custom-metadata.util.js +4 -6
- package/utils/cli-colors.util.js +4 -8
- package/utils/extend-metadata.util.js +1 -4
- package/utils/forward-ref.util.d.ts +1 -1
- package/utils/forward-ref.util.js +1 -5
- package/utils/http-error-by-code.util.d.ts +2 -2
- package/utils/http-error-by-code.util.js +22 -25
- package/utils/index.d.ts +1 -1
- package/utils/index.js +1 -4
- package/utils/load-package.util.d.ts +21 -1
- package/utils/load-package.util.js +62 -8
- package/utils/merge-with-values.util.js +1 -5
- package/utils/random-string-generator.util.js +2 -6
- package/utils/select-exception-filter-metadata.util.d.ts +1 -1
- package/utils/select-exception-filter-metadata.util.js +1 -5
- package/utils/shared.utils.d.ts +11 -10
- package/utils/shared.utils.js +28 -30
- package/utils/validate-each.util.js +3 -7
- package/utils/validate-module-keys.util.js +8 -13
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './filter-log-levels.util';
|
|
2
|
-
export * from './is-log-level-enabled.util';
|
|
3
|
-
export * from './is-log-level.util';
|
|
1
|
+
export * from './filter-log-levels.util.js';
|
|
2
|
+
export * from './is-log-level-enabled.util.js';
|
|
3
|
+
export * from './is-log-level.util.js';
|
package/services/utils/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./filter-log-levels.util"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./is-log-level-enabled.util"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./is-log-level.util"), exports);
|
|
1
|
+
export * from './filter-log-levels.util.js';
|
|
2
|
+
export * from './is-log-level-enabled.util.js';
|
|
3
|
+
export * from './is-log-level.util.js';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isLogLevelEnabled = isLogLevelEnabled;
|
|
4
1
|
const LOG_LEVEL_VALUES = {
|
|
5
2
|
verbose: 0,
|
|
6
3
|
debug: 1,
|
|
@@ -14,7 +11,7 @@ const LOG_LEVEL_VALUES = {
|
|
|
14
11
|
* @param targetLevel target level
|
|
15
12
|
* @param logLevels array of enabled log levels
|
|
16
13
|
*/
|
|
17
|
-
function isLogLevelEnabled(targetLevel, logLevels) {
|
|
14
|
+
export function isLogLevelEnabled(targetLevel, logLevels) {
|
|
18
15
|
if (!logLevels || (Array.isArray(logLevels) && logLevels?.length === 0)) {
|
|
19
16
|
return false;
|
|
20
17
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isLogLevel = isLogLevel;
|
|
4
|
-
const logger_service_1 = require("../logger.service");
|
|
1
|
+
import { LOG_LEVELS } from '../logger.service.js';
|
|
5
2
|
/**
|
|
6
3
|
* @publicApi
|
|
7
4
|
*/
|
|
8
|
-
function isLogLevel(maybeLogLevel) {
|
|
9
|
-
return
|
|
5
|
+
export function isLogLevel(maybeLogLevel) {
|
|
6
|
+
return LOG_LEVELS.includes(maybeLogLevel);
|
|
10
7
|
}
|
package/tsconfig.build.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { CustomParamFactory } from '../interfaces/features/custom-route-param-factory.interface';
|
|
4
|
-
|
|
1
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
|
+
import { ParamData, RouteParamMetadata } from '../decorators/http/route-params.decorator.js';
|
|
3
|
+
import { CustomParamFactory } from '../interfaces/features/custom-route-param-factory.interface.js';
|
|
4
|
+
import { PipeTransform, Type } from '../interfaces/index.js';
|
|
5
|
+
export declare function assignCustomParameterMetadata(args: Record<number, RouteParamMetadata>, paramtype: number | string, index: number, factory: CustomParamFactory, data?: ParamData, schema?: StandardSchemaV1, ...pipes: (Type<PipeTransform> | PipeTransform)[]): {};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.assignCustomParameterMetadata = assignCustomParameterMetadata;
|
|
4
|
-
const constants_1 = require("../constants");
|
|
5
|
-
function assignCustomParameterMetadata(args, paramtype, index, factory, data, ...pipes) {
|
|
1
|
+
import { CUSTOM_ROUTE_ARGS_METADATA } from '../constants.js';
|
|
2
|
+
export function assignCustomParameterMetadata(args, paramtype, index, factory, data, schema, ...pipes) {
|
|
6
3
|
return {
|
|
7
4
|
...args,
|
|
8
|
-
[`${paramtype}${
|
|
5
|
+
[`${paramtype}${CUSTOM_ROUTE_ARGS_METADATA}:${index}`]: {
|
|
9
6
|
index,
|
|
10
7
|
factory,
|
|
11
8
|
data,
|
|
12
9
|
pipes,
|
|
10
|
+
...(schema !== undefined && { schema }),
|
|
13
11
|
},
|
|
14
12
|
};
|
|
15
13
|
}
|
package/utils/cli-colors.util.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const isColorAllowed = () => !process.env.NO_COLOR;
|
|
5
|
-
exports.isColorAllowed = isColorAllowed;
|
|
6
|
-
const colorIfAllowed = (colorFn) => (text) => (0, exports.isColorAllowed)() ? colorFn(text) : text;
|
|
7
|
-
exports.clc = {
|
|
1
|
+
export const isColorAllowed = () => !process.env.NO_COLOR;
|
|
2
|
+
const colorIfAllowed = (colorFn) => (text) => isColorAllowed() ? colorFn(text) : text;
|
|
3
|
+
export const clc = {
|
|
8
4
|
bold: colorIfAllowed((text) => `\x1B[1m${text}\x1B[0m`),
|
|
9
5
|
green: colorIfAllowed((text) => `\x1B[32m${text}\x1B[39m`),
|
|
10
6
|
yellow: colorIfAllowed((text) => `\x1B[33m${text}\x1B[39m`),
|
|
@@ -12,4 +8,4 @@ exports.clc = {
|
|
|
12
8
|
magentaBright: colorIfAllowed((text) => `\x1B[95m${text}\x1B[39m`),
|
|
13
9
|
cyanBright: colorIfAllowed((text) => `\x1B[96m${text}\x1B[39m`),
|
|
14
10
|
};
|
|
15
|
-
|
|
11
|
+
export const yellow = colorIfAllowed((text) => `\x1B[38;5;3m${text}\x1B[39m`);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extendArrayMetadata = extendArrayMetadata;
|
|
4
|
-
function extendArrayMetadata(key, metadata, target) {
|
|
1
|
+
export function extendArrayMetadata(key, metadata, target) {
|
|
5
2
|
const previousValue = Reflect.getMetadata(key, target) || [];
|
|
6
3
|
const value = [...previousValue, ...metadata];
|
|
7
4
|
Reflect.defineMetadata(key, value, target);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.forwardRef = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @publicApi
|
|
6
3
|
*/
|
|
7
|
-
const forwardRef = (fn) => ({
|
|
4
|
+
export const forwardRef = (fn) => ({
|
|
8
5
|
forwardRef: fn,
|
|
9
6
|
});
|
|
10
|
-
exports.forwardRef = forwardRef;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpStatus } from '../enums';
|
|
2
|
-
import { Type } from '../interfaces';
|
|
1
|
+
import { HttpStatus } from '../enums/index.js';
|
|
2
|
+
import { Type } from '../interfaces/index.js';
|
|
3
3
|
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;
|
|
4
4
|
export declare const HttpErrorByCode: Record<ErrorHttpStatusCode, Type<unknown>>;
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[enums_1.HttpStatus.UNAUTHORIZED]: exceptions_1.UnauthorizedException,
|
|
24
|
-
[enums_1.HttpStatus.UNPROCESSABLE_ENTITY]: exceptions_1.UnprocessableEntityException,
|
|
25
|
-
[enums_1.HttpStatus.UNSUPPORTED_MEDIA_TYPE]: exceptions_1.UnsupportedMediaTypeException,
|
|
1
|
+
import { HttpStatus } from '../enums/index.js';
|
|
2
|
+
import { BadGatewayException, BadRequestException, ConflictException, ForbiddenException, GatewayTimeoutException, GoneException, ImATeapotException, InternalServerErrorException, MethodNotAllowedException, NotAcceptableException, NotFoundException, NotImplementedException, PayloadTooLargeException, PreconditionFailedException, RequestTimeoutException, ServiceUnavailableException, UnauthorizedException, UnprocessableEntityException, UnsupportedMediaTypeException, } from '../exceptions/index.js';
|
|
3
|
+
export const HttpErrorByCode = {
|
|
4
|
+
[HttpStatus.BAD_GATEWAY]: BadGatewayException,
|
|
5
|
+
[HttpStatus.BAD_REQUEST]: BadRequestException,
|
|
6
|
+
[HttpStatus.CONFLICT]: ConflictException,
|
|
7
|
+
[HttpStatus.FORBIDDEN]: ForbiddenException,
|
|
8
|
+
[HttpStatus.GATEWAY_TIMEOUT]: GatewayTimeoutException,
|
|
9
|
+
[HttpStatus.GONE]: GoneException,
|
|
10
|
+
[HttpStatus.I_AM_A_TEAPOT]: ImATeapotException,
|
|
11
|
+
[HttpStatus.INTERNAL_SERVER_ERROR]: InternalServerErrorException,
|
|
12
|
+
[HttpStatus.METHOD_NOT_ALLOWED]: MethodNotAllowedException,
|
|
13
|
+
[HttpStatus.NOT_ACCEPTABLE]: NotAcceptableException,
|
|
14
|
+
[HttpStatus.NOT_FOUND]: NotFoundException,
|
|
15
|
+
[HttpStatus.NOT_IMPLEMENTED]: NotImplementedException,
|
|
16
|
+
[HttpStatus.PAYLOAD_TOO_LARGE]: PayloadTooLargeException,
|
|
17
|
+
[HttpStatus.PRECONDITION_FAILED]: PreconditionFailedException,
|
|
18
|
+
[HttpStatus.REQUEST_TIMEOUT]: RequestTimeoutException,
|
|
19
|
+
[HttpStatus.SERVICE_UNAVAILABLE]: ServiceUnavailableException,
|
|
20
|
+
[HttpStatus.UNAUTHORIZED]: UnauthorizedException,
|
|
21
|
+
[HttpStatus.UNPROCESSABLE_ENTITY]: UnprocessableEntityException,
|
|
22
|
+
[HttpStatus.UNSUPPORTED_MEDIA_TYPE]: UnsupportedMediaTypeException,
|
|
26
23
|
};
|
package/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './forward-ref.util';
|
|
1
|
+
export * from './forward-ref.util.js';
|
package/utils/index.js
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
export declare function loadPackage(packageName: string, context: string, loaderFn?: Function): any
|
|
1
|
+
export declare function loadPackage(packageName: string, context: string, loaderFn?: Function): Promise<any>;
|
|
2
|
+
/**
|
|
3
|
+
* Synchronously loads a package using `createRequire` and caches it.
|
|
4
|
+
* This is meant for optional dependencies that must be loaded in
|
|
5
|
+
* synchronous contexts (e.g. constructors).
|
|
6
|
+
*
|
|
7
|
+
* @param loaderFn Optional synchronous loader (e.g.
|
|
8
|
+
* `() => createRequire(import.meta.url)('pkg')`).
|
|
9
|
+
* When provided, bundlers can statically analyse the string literal.
|
|
10
|
+
* Falls back to a `createRequire` call resolved from this file.
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadPackageSync(packageName: string, context: string, loaderFn?: () => any): any;
|
|
13
|
+
/**
|
|
14
|
+
* Synchronously returns a package that was previously loaded and cached
|
|
15
|
+
* via {@link loadPackage}. Throws if the package has not been loaded yet.
|
|
16
|
+
*
|
|
17
|
+
* Use this in methods that must remain synchronous (e.g. `connectMicroservice`).
|
|
18
|
+
* Ensure that `loadPackage()` has been `await`ed for the same package name
|
|
19
|
+
* before calling this function (typically during `init()` or `compile()`).
|
|
20
|
+
*/
|
|
21
|
+
export declare function loadPackageCached(packageName: string): any;
|
|
@@ -1,16 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.loadPackage = loadPackage;
|
|
4
|
-
const logger_service_1 = require("../services/logger.service");
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
import { Logger } from '../services/logger.service.js';
|
|
5
3
|
const MISSING_REQUIRED_DEPENDENCY = (name, reason) => `The "${name}" package is missing. Please, make sure to install it to take advantage of ${reason}.`;
|
|
6
|
-
const logger = new
|
|
7
|
-
|
|
4
|
+
const logger = new Logger('PackageLoader');
|
|
5
|
+
/**
|
|
6
|
+
* Cache of already-loaded packages keyed by package name.
|
|
7
|
+
* Allows subsequent calls (including synchronous ones) to
|
|
8
|
+
* return the module without another async import().
|
|
9
|
+
*/
|
|
10
|
+
const packageCache = new Map();
|
|
11
|
+
export async function loadPackage(packageName, context, loaderFn) {
|
|
12
|
+
const cached = packageCache.get(packageName);
|
|
13
|
+
if (cached) {
|
|
14
|
+
return cached;
|
|
15
|
+
}
|
|
8
16
|
try {
|
|
9
|
-
|
|
17
|
+
const pkg = loaderFn ? await loaderFn() : await import(packageName);
|
|
18
|
+
packageCache.set(packageName, pkg);
|
|
19
|
+
return pkg;
|
|
10
20
|
}
|
|
11
21
|
catch (e) {
|
|
12
22
|
logger.error(MISSING_REQUIRED_DEPENDENCY(packageName, context));
|
|
13
|
-
|
|
23
|
+
Logger.flush();
|
|
14
24
|
process.exit(1);
|
|
15
25
|
}
|
|
16
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Synchronously loads a package using `createRequire` and caches it.
|
|
29
|
+
* This is meant for optional dependencies that must be loaded in
|
|
30
|
+
* synchronous contexts (e.g. constructors).
|
|
31
|
+
*
|
|
32
|
+
* @param loaderFn Optional synchronous loader (e.g.
|
|
33
|
+
* `() => createRequire(import.meta.url)('pkg')`).
|
|
34
|
+
* When provided, bundlers can statically analyse the string literal.
|
|
35
|
+
* Falls back to a `createRequire` call resolved from this file.
|
|
36
|
+
*/
|
|
37
|
+
export function loadPackageSync(packageName, context, loaderFn) {
|
|
38
|
+
const cached = packageCache.get(packageName);
|
|
39
|
+
if (cached) {
|
|
40
|
+
return cached;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const pkg = loaderFn
|
|
44
|
+
? loaderFn()
|
|
45
|
+
: createRequire(import.meta.url)(packageName);
|
|
46
|
+
packageCache.set(packageName, pkg);
|
|
47
|
+
return pkg;
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
logger.error(MISSING_REQUIRED_DEPENDENCY(packageName, context));
|
|
51
|
+
Logger.flush();
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Synchronously returns a package that was previously loaded and cached
|
|
57
|
+
* via {@link loadPackage}. Throws if the package has not been loaded yet.
|
|
58
|
+
*
|
|
59
|
+
* Use this in methods that must remain synchronous (e.g. `connectMicroservice`).
|
|
60
|
+
* Ensure that `loadPackage()` has been `await`ed for the same package name
|
|
61
|
+
* before calling this function (typically during `init()` or `compile()`).
|
|
62
|
+
*/
|
|
63
|
+
export function loadPackageCached(packageName) {
|
|
64
|
+
const cached = packageCache.get(packageName);
|
|
65
|
+
if (!cached) {
|
|
66
|
+
throw new Error(`Package "${packageName}" has not been loaded yet. ` +
|
|
67
|
+
`Ensure loadPackage("${packageName}", ...) has been awaited before calling loadPackageCached.`);
|
|
68
|
+
}
|
|
69
|
+
return cached;
|
|
70
|
+
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MergeWithValues = void 0;
|
|
4
1
|
/* eslint-disable @typescript-eslint/no-empty-object-type */
|
|
5
|
-
const MergeWithValues = (data) => {
|
|
2
|
+
export const MergeWithValues = (data) => {
|
|
6
3
|
return (Metatype) => {
|
|
7
4
|
const Type = class extends Metatype {
|
|
8
5
|
constructor(...args) {
|
|
@@ -15,4 +12,3 @@ const MergeWithValues = (data) => {
|
|
|
15
12
|
return Type;
|
|
16
13
|
};
|
|
17
14
|
};
|
|
18
|
-
exports.MergeWithValues = MergeWithValues;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.randomStringGenerator = void 0;
|
|
4
|
-
const uid_1 = require("uid");
|
|
5
|
-
const randomStringGenerator = () => (0, uid_1.uid)(21);
|
|
6
|
-
exports.randomStringGenerator = randomStringGenerator;
|
|
1
|
+
import { uid } from 'uid';
|
|
2
|
+
export const randomStringGenerator = () => uid(21);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ExceptionFilterMetadata } from '../interfaces/exceptions';
|
|
1
|
+
import { ExceptionFilterMetadata } from '../interfaces/exceptions/index.js';
|
|
2
2
|
export declare const selectExceptionFilterMetadata: <T = any>(filters: ExceptionFilterMetadata[], exception: T) => ExceptionFilterMetadata | undefined;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.selectExceptionFilterMetadata = void 0;
|
|
4
|
-
const selectExceptionFilterMetadata = (filters, exception) => filters.find(({ exceptionMetatypes }) => !exceptionMetatypes.length ||
|
|
1
|
+
export const selectExceptionFilterMetadata = (filters, exception) => filters.find(({ exceptionMetatypes }) => !exceptionMetatypes.length ||
|
|
5
2
|
exceptionMetatypes.some(ExceptionMetaType => exception instanceof ExceptionMetaType));
|
|
6
|
-
exports.selectExceptionFilterMetadata = selectExceptionFilterMetadata;
|
package/utils/shared.utils.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export declare const isUndefined: (obj:
|
|
2
|
-
export declare const isObject: (fn:
|
|
3
|
-
export declare const isPlainObject: (fn:
|
|
1
|
+
export declare const isUndefined: (obj: unknown) => obj is undefined;
|
|
2
|
+
export declare const isObject: (fn: unknown) => fn is object;
|
|
3
|
+
export declare const isPlainObject: (fn: unknown) => fn is object;
|
|
4
4
|
export declare const addLeadingSlash: (path?: string) => string;
|
|
5
5
|
export declare const normalizePath: (path?: string) => string;
|
|
6
6
|
export declare const stripEndSlash: (path: string) => string;
|
|
7
|
-
export declare const isFunction: (val:
|
|
8
|
-
export declare const isString: (val:
|
|
9
|
-
export declare const isNumber: (val:
|
|
10
|
-
export declare const isConstructor: (val:
|
|
11
|
-
export declare const isNil: (val:
|
|
12
|
-
export declare const isEmpty: (
|
|
13
|
-
export declare const
|
|
7
|
+
export declare const isFunction: (val: unknown) => val is Function;
|
|
8
|
+
export declare const isString: (val: unknown) => val is string;
|
|
9
|
+
export declare const isNumber: (val: unknown) => val is number;
|
|
10
|
+
export declare const isConstructor: (val: unknown) => boolean;
|
|
11
|
+
export declare const isNil: (val: unknown) => val is null | undefined;
|
|
12
|
+
export declare const isEmpty: (value: unknown) => boolean;
|
|
13
|
+
export declare const isEmptyArray: (array: unknown) => boolean;
|
|
14
|
+
export declare const isSymbol: (val: unknown) => val is symbol;
|
package/utils/shared.utils.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.isUndefined = isUndefined;
|
|
6
|
-
const isObject = (fn) => !(0, exports.isNil)(fn) && typeof fn === 'object';
|
|
7
|
-
exports.isObject = isObject;
|
|
8
|
-
const isPlainObject = (fn) => {
|
|
9
|
-
if (!(0, exports.isObject)(fn)) {
|
|
1
|
+
export const isUndefined = (obj) => typeof obj === 'undefined';
|
|
2
|
+
export const isObject = (fn) => !isNil(fn) && typeof fn === 'object';
|
|
3
|
+
export const isPlainObject = (fn) => {
|
|
4
|
+
if (!isObject(fn)) {
|
|
10
5
|
return false;
|
|
11
6
|
}
|
|
12
7
|
const proto = Object.getPrototypeOf(fn);
|
|
@@ -20,32 +15,35 @@ const isPlainObject = (fn) => {
|
|
|
20
15
|
Function.prototype.toString.call(ctor) ===
|
|
21
16
|
Function.prototype.toString.call(Object));
|
|
22
17
|
};
|
|
23
|
-
|
|
24
|
-
const addLeadingSlash = (path) => path && typeof path === 'string'
|
|
18
|
+
export const addLeadingSlash = (path) => path && typeof path === 'string'
|
|
25
19
|
? path.charAt(0) !== '/' && path.substring(0, 2) !== '{/'
|
|
26
20
|
? '/' + path
|
|
27
21
|
: path
|
|
28
22
|
: '';
|
|
29
|
-
|
|
30
|
-
const normalizePath = (path) => path
|
|
23
|
+
export const normalizePath = (path) => path
|
|
31
24
|
? path.startsWith('/')
|
|
32
25
|
? ('/' + path.replace(/\/+$/, '')).replace(/\/+/g, '/')
|
|
33
26
|
: '/' + path.replace(/\/+$/, '')
|
|
34
27
|
: '/';
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
28
|
+
export const stripEndSlash = (path) => path.endsWith('/') ? path.slice(0, -1) : path;
|
|
29
|
+
export const isFunction = (val) => typeof val === 'function';
|
|
30
|
+
export const isString = (val) => typeof val === 'string';
|
|
31
|
+
export const isNumber = (val) => typeof val === 'number';
|
|
32
|
+
export const isConstructor = (val) => val === 'constructor';
|
|
33
|
+
export const isNil = (val) => isUndefined(val) || val === null;
|
|
34
|
+
export const isEmpty = (value) => {
|
|
35
|
+
if (isNil(value)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
if (Array.isArray(value)) {
|
|
39
|
+
return value.length === 0;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
};
|
|
43
|
+
export const isEmptyArray = (array) => {
|
|
44
|
+
if (!Array.isArray(array)) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return array.length === 0;
|
|
48
|
+
};
|
|
49
|
+
export const isSymbol = (val) => typeof val === 'symbol';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.InvalidDecoratorItemException = void 0;
|
|
4
|
-
exports.validateEach = validateEach;
|
|
5
|
-
class InvalidDecoratorItemException extends Error {
|
|
1
|
+
export class InvalidDecoratorItemException extends Error {
|
|
2
|
+
msg;
|
|
6
3
|
constructor(decorator, item, context) {
|
|
7
4
|
const message = `Invalid ${item} passed to ${decorator}() decorator (${context}).`;
|
|
8
5
|
super(message);
|
|
@@ -12,8 +9,7 @@ class InvalidDecoratorItemException extends Error {
|
|
|
12
9
|
return this.msg;
|
|
13
10
|
}
|
|
14
11
|
}
|
|
15
|
-
|
|
16
|
-
function validateEach(context, arr, predicate, decorator, item) {
|
|
12
|
+
export function validateEach(context, arr, predicate, decorator, item) {
|
|
17
13
|
if (!context || !context.name) {
|
|
18
14
|
return true;
|
|
19
15
|
}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.INVALID_MODULE_CONFIG_MESSAGE = void 0;
|
|
4
|
-
exports.validateModuleKeys = validateModuleKeys;
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
const INVALID_MODULE_CONFIG_MESSAGE = (text, property) => `Invalid property '${property}' passed into the @Module() decorator.`;
|
|
7
|
-
exports.INVALID_MODULE_CONFIG_MESSAGE = INVALID_MODULE_CONFIG_MESSAGE;
|
|
1
|
+
import { MODULE_METADATA as metadataConstants } from '../constants.js';
|
|
2
|
+
export const INVALID_MODULE_CONFIG_MESSAGE = (text, property) => `Invalid property '${property}' passed into the @Module() decorator.`;
|
|
8
3
|
const metadataKeys = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
metadataConstants.IMPORTS,
|
|
5
|
+
metadataConstants.EXPORTS,
|
|
6
|
+
metadataConstants.CONTROLLERS,
|
|
7
|
+
metadataConstants.PROVIDERS,
|
|
13
8
|
];
|
|
14
|
-
function validateModuleKeys(keys) {
|
|
9
|
+
export function validateModuleKeys(keys) {
|
|
15
10
|
const validateKey = (key) => {
|
|
16
11
|
if (metadataKeys.includes(key)) {
|
|
17
12
|
return;
|
|
18
13
|
}
|
|
19
|
-
throw new Error(
|
|
14
|
+
throw new Error(INVALID_MODULE_CONFIG_MESSAGE `${key}`);
|
|
20
15
|
};
|
|
21
16
|
keys.forEach(validateKey);
|
|
22
17
|
}
|