@nestjs/common 11.1.16 → 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,6 +1,6 @@
|
|
|
1
|
-
import { DynamicModule } from '../../interfaces';
|
|
2
|
-
import { DEFAULT_FACTORY_CLASS_METHOD_KEY, DEFAULT_METHOD_KEY } from '../constants';
|
|
3
|
-
import { ConfigurableModuleAsyncOptions } from './configurable-module-async-options.interface';
|
|
1
|
+
import { DynamicModule } from '../../interfaces/index.js';
|
|
2
|
+
import { DEFAULT_FACTORY_CLASS_METHOD_KEY, DEFAULT_METHOD_KEY } from '../constants.js';
|
|
3
|
+
import { ConfigurableModuleAsyncOptions } from './configurable-module-async-options.interface.js';
|
|
4
4
|
/**
|
|
5
5
|
* Class that represents a blueprint/prototype for a configurable Nest module.
|
|
6
6
|
* This class provides static methods for constructing dynamic modules. Their names
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigurableModuleAsyncOptions } from './configurable-module-async-options.interface';
|
|
2
|
-
import { ConfigurableModuleCls } from './configurable-module-cls.interface';
|
|
1
|
+
import { ConfigurableModuleAsyncOptions } from './configurable-module-async-options.interface.js';
|
|
2
|
+
import { ConfigurableModuleCls } from './configurable-module-cls.interface.js';
|
|
3
3
|
/**
|
|
4
4
|
* Configurable module host. See properties for more details
|
|
5
5
|
*
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './configurable-module-async-options.interface';
|
|
2
|
-
export * from './configurable-module-cls.interface';
|
|
3
|
-
export * from './configurable-module-host.interface';
|
|
1
|
+
export * from './configurable-module-async-options.interface.js';
|
|
2
|
+
export * from './configurable-module-cls.interface.js';
|
|
3
|
+
export * from './configurable-module-host.interface.js';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./configurable-module-async-options.interface"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./configurable-module-cls.interface"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./configurable-module-host.interface"), exports);
|
|
1
|
+
export * from './configurable-module-async-options.interface.js';
|
|
2
|
+
export * from './configurable-module-cls.interface.js';
|
|
3
|
+
export * from './configurable-module-host.interface.js';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const random_string_generator_util_1 = require("../../utils/random-string-generator.util");
|
|
5
|
-
function generateOptionsInjectionToken() {
|
|
6
|
-
const hash = (0, random_string_generator_util_1.randomStringGenerator)();
|
|
1
|
+
import { randomStringGenerator } from '../../utils/random-string-generator.util.js';
|
|
2
|
+
export function generateOptionsInjectionToken() {
|
|
3
|
+
const hash = randomStringGenerator();
|
|
7
4
|
return `CONFIGURABLE_MODULE_OPTIONS[${hash}]`;
|
|
8
5
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInjectionProviders = getInjectionProviders;
|
|
4
|
-
const shared_utils_1 = require("../../utils/shared.utils");
|
|
1
|
+
import { isUndefined } from '../../utils/shared.utils.js';
|
|
5
2
|
/**
|
|
6
3
|
* @param value
|
|
7
4
|
* @returns `true` if value is `OptionalFactoryDependency`
|
|
8
5
|
*/
|
|
9
6
|
function isOptionalFactoryDependency(value) {
|
|
10
|
-
return (!
|
|
11
|
-
!
|
|
7
|
+
return (!isUndefined(value.token) &&
|
|
8
|
+
!isUndefined(value.optional) &&
|
|
12
9
|
!value.prototype);
|
|
13
10
|
}
|
|
14
11
|
const mapInjectToTokens = (t) => isOptionalFactoryDependency(t) ? t.token : t;
|
|
@@ -18,7 +15,7 @@ const mapInjectToTokens = (t) => isOptionalFactoryDependency(t) ? t.token : t;
|
|
|
18
15
|
* @param tokens Injection tokens needed for a useFactory function (usually the module's options' token)
|
|
19
16
|
* @returns All the providers needed for the tokens' injection (searched recursively)
|
|
20
17
|
*/
|
|
21
|
-
function getInjectionProviders(providers, tokens) {
|
|
18
|
+
export function getInjectionProviders(providers, tokens) {
|
|
22
19
|
const result = [];
|
|
23
20
|
let search = tokens.map(mapInjectToTokens);
|
|
24
21
|
while (search.length > 0) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './generate-options-injection-token.util';
|
|
2
|
-
export * from './get-injection-providers.util';
|
|
1
|
+
export * from './generate-options-injection-token.util.js';
|
|
2
|
+
export * from './get-injection-providers.util.js';
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./generate-options-injection-token.util"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./get-injection-providers.util"), exports);
|
|
1
|
+
export * from './generate-options-injection-token.util.js';
|
|
2
|
+
export * from './get-injection-providers.util.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0-alpha.0",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"homepage": "https://nestjs.com",
|
|
@@ -17,6 +17,39 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./index.js",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": "./index.js",
|
|
24
|
+
"./*.js": "./*.js",
|
|
25
|
+
"./*": "./*.js",
|
|
26
|
+
"./decorators": "./decorators/index.js",
|
|
27
|
+
"./decorators/core": "./decorators/core/index.js",
|
|
28
|
+
"./decorators/http": "./decorators/http/index.js",
|
|
29
|
+
"./decorators/modules": "./decorators/modules/index.js",
|
|
30
|
+
"./enums": "./enums/index.js",
|
|
31
|
+
"./exceptions": "./exceptions/index.js",
|
|
32
|
+
"./file-stream": "./file-stream/index.js",
|
|
33
|
+
"./file-stream/interfaces": "./file-stream/interfaces/index.js",
|
|
34
|
+
"./interfaces": "./interfaces/index.js",
|
|
35
|
+
"./interfaces/controllers": "./interfaces/controllers/index.js",
|
|
36
|
+
"./interfaces/exceptions": "./interfaces/exceptions/index.js",
|
|
37
|
+
"./interfaces/hooks": "./interfaces/hooks/index.js",
|
|
38
|
+
"./interfaces/http": "./interfaces/http/index.js",
|
|
39
|
+
"./interfaces/middleware": "./interfaces/middleware/index.js",
|
|
40
|
+
"./interfaces/modules": "./interfaces/modules/index.js",
|
|
41
|
+
"./module-utils": "./module-utils/index.js",
|
|
42
|
+
"./module-utils/interfaces": "./module-utils/interfaces/index.js",
|
|
43
|
+
"./module-utils/utils": "./module-utils/utils/index.js",
|
|
44
|
+
"./pipes": "./pipes/index.js",
|
|
45
|
+
"./pipes/file": "./pipes/file/index.js",
|
|
46
|
+
"./pipes/file/interfaces": "./pipes/file/interfaces/index.js",
|
|
47
|
+
"./serializer": "./serializer/index.js",
|
|
48
|
+
"./serializer/decorators": "./serializer/decorators/index.js",
|
|
49
|
+
"./services": "./services/index.js",
|
|
50
|
+
"./services/utils": "./services/utils/index.js",
|
|
51
|
+
"./utils": "./utils/index.js"
|
|
52
|
+
},
|
|
20
53
|
"dependencies": {
|
|
21
54
|
"file-type": "21.3.0",
|
|
22
55
|
"iterare": "1.2.1",
|
|
@@ -38,5 +71,5 @@
|
|
|
38
71
|
"optional": true
|
|
39
72
|
}
|
|
40
73
|
},
|
|
41
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "7035ecc828a2a9f752aad188871b1171663a20c2"
|
|
42
75
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const injectable_decorator_1 = require("../decorators/core/injectable.decorator");
|
|
6
|
-
const shared_utils_1 = require("../utils/shared.utils");
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Injectable } from '../decorators/core/injectable.decorator.js';
|
|
3
|
+
import { isNil, isNumber } from '../utils/shared.utils.js';
|
|
7
4
|
/**
|
|
8
5
|
* Defines the built-in DefaultValue Pipe
|
|
9
6
|
*
|
|
@@ -12,19 +9,20 @@ const shared_utils_1 = require("../utils/shared.utils");
|
|
|
12
9
|
* @publicApi
|
|
13
10
|
*/
|
|
14
11
|
let DefaultValuePipe = class DefaultValuePipe {
|
|
12
|
+
defaultValue;
|
|
15
13
|
constructor(defaultValue) {
|
|
16
14
|
this.defaultValue = defaultValue;
|
|
17
15
|
}
|
|
18
16
|
transform(value, _metadata) {
|
|
19
|
-
if (
|
|
20
|
-
(
|
|
17
|
+
if (isNil(value) ||
|
|
18
|
+
(isNumber(value) && isNaN(value))) {
|
|
21
19
|
return this.defaultValue;
|
|
22
20
|
}
|
|
23
21
|
return value;
|
|
24
22
|
}
|
|
25
23
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(
|
|
29
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
24
|
+
DefaultValuePipe = __decorate([
|
|
25
|
+
Injectable(),
|
|
26
|
+
__metadata("design:paramtypes", [Object])
|
|
30
27
|
], DefaultValuePipe);
|
|
28
|
+
export { DefaultValuePipe };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FileValidatorContext } from './file-validator-context.interface';
|
|
2
|
-
import { FileValidator } from './file-validator.interface';
|
|
3
|
-
import { IFile } from './interfaces';
|
|
1
|
+
import { FileValidatorContext } from './file-validator-context.interface.js';
|
|
2
|
+
import { FileValidator } from './file-validator.interface.js';
|
|
3
|
+
import { IFile } from './interfaces/index.js';
|
|
4
4
|
type FileTypeValidatorContext = FileValidatorContext<Omit<FileTypeValidatorOptions, 'errorMessage'>>;
|
|
5
5
|
export type FileTypeValidatorOptions = {
|
|
6
6
|
/**
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const url_1 = require("url");
|
|
5
|
-
const logger_service_1 = require("../../services/logger.service");
|
|
6
|
-
const file_validator_interface_1 = require("./file-validator.interface");
|
|
7
|
-
const load_esm_1 = require("load-esm");
|
|
8
|
-
const logger = new logger_service_1.Logger('FileTypeValidator');
|
|
1
|
+
import { Logger } from '../../services/logger.service.js';
|
|
2
|
+
import { FileValidator } from './file-validator.interface.js';
|
|
3
|
+
const logger = new Logger('FileTypeValidator');
|
|
9
4
|
/**
|
|
10
5
|
* Defines the built-in FileTypeValidator. It validates incoming files by examining
|
|
11
6
|
* their magic numbers using the file-type package, providing more reliable file type validation
|
|
@@ -15,7 +10,7 @@ const logger = new logger_service_1.Logger('FileTypeValidator');
|
|
|
15
10
|
*
|
|
16
11
|
* @publicApi
|
|
17
12
|
*/
|
|
18
|
-
class FileTypeValidator extends
|
|
13
|
+
export class FileTypeValidator extends FileValidator {
|
|
19
14
|
buildErrorMessage(file) {
|
|
20
15
|
const { errorMessage, ...config } = this.validationOptions;
|
|
21
16
|
if (errorMessage) {
|
|
@@ -57,15 +52,7 @@ class FileTypeValidator extends file_validator_interface_1.FileValidator {
|
|
|
57
52
|
return false;
|
|
58
53
|
}
|
|
59
54
|
try {
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
const resolvedPath = require.resolve('file-type');
|
|
63
|
-
fileTypeModule = (0, url_1.pathToFileURL)(resolvedPath).href;
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
fileTypeModule = 'file-type';
|
|
67
|
-
}
|
|
68
|
-
const { fileTypeFromBuffer } = await (0, load_esm_1.loadEsm)(fileTypeModule);
|
|
55
|
+
const { fileTypeFromBuffer } = await import('file-type');
|
|
69
56
|
const fileType = await fileTypeFromBuffer(file.buffer);
|
|
70
57
|
if (fileType) {
|
|
71
58
|
// Match detected mime type against allowed type
|
|
@@ -99,4 +86,3 @@ class FileTypeValidator extends file_validator_interface_1.FileValidator {
|
|
|
99
86
|
}
|
|
100
87
|
}
|
|
101
88
|
}
|
|
102
|
-
exports.FileTypeValidator = FileTypeValidator;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FileValidator = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Interface describing FileValidators, which can be added to a ParseFilePipe
|
|
6
3
|
*
|
|
7
4
|
* @see {ParseFilePipe}
|
|
8
5
|
* @publicApi
|
|
9
6
|
*/
|
|
10
|
-
class FileValidator {
|
|
7
|
+
export class FileValidator {
|
|
8
|
+
validationOptions;
|
|
11
9
|
constructor(validationOptions) {
|
|
12
10
|
this.validationOptions = validationOptions;
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
|
-
exports.FileValidator = FileValidator;
|
package/pipes/file/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './file-type.validator';
|
|
2
|
-
export * from './file-validator.interface';
|
|
3
|
-
export * from './max-file-size.validator';
|
|
4
|
-
export * from './parse-file-options.interface';
|
|
5
|
-
export * from './parse-file.pipe';
|
|
6
|
-
export * from './parse-file-pipe.builder';
|
|
1
|
+
export * from './file-type.validator.js';
|
|
2
|
+
export * from './file-validator.interface.js';
|
|
3
|
+
export * from './max-file-size.validator.js';
|
|
4
|
+
export * from './parse-file-options.interface.js';
|
|
5
|
+
export * from './parse-file.pipe.js';
|
|
6
|
+
export * from './parse-file-pipe.builder.js';
|
package/pipes/file/index.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
tslib_1.__exportStar(require("./parse-file-options.interface"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./parse-file.pipe"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./parse-file-pipe.builder"), exports);
|
|
1
|
+
export * from './file-type.validator.js';
|
|
2
|
+
export * from './file-validator.interface.js';
|
|
3
|
+
export * from './max-file-size.validator.js';
|
|
4
|
+
export * from './parse-file-options.interface.js';
|
|
5
|
+
export * from './parse-file.pipe.js';
|
|
6
|
+
export * from './parse-file-pipe.builder.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './file.interface';
|
|
1
|
+
export * from './file.interface.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FileValidatorContext } from './file-validator-context.interface';
|
|
2
|
-
import { FileValidator } from './file-validator.interface';
|
|
3
|
-
import { IFile } from './interfaces';
|
|
1
|
+
import { FileValidatorContext } from './file-validator-context.interface.js';
|
|
2
|
+
import { FileValidator } from './file-validator.interface.js';
|
|
3
|
+
import { IFile } from './interfaces/index.js';
|
|
4
4
|
type MaxFileSizeValidatorContext = FileValidatorContext<Omit<MaxFileSizeValidatorOptions, 'errorMessage' | 'message'>>;
|
|
5
5
|
export type MaxFileSizeValidatorOptions = {
|
|
6
6
|
/**
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MaxFileSizeValidator = void 0;
|
|
4
|
-
const file_validator_interface_1 = require("./file-validator.interface");
|
|
1
|
+
import { FileValidator } from './file-validator.interface.js';
|
|
5
2
|
/**
|
|
6
3
|
* Defines the built-in MaxSize File Validator
|
|
7
4
|
*
|
|
@@ -9,7 +6,7 @@ const file_validator_interface_1 = require("./file-validator.interface");
|
|
|
9
6
|
*
|
|
10
7
|
* @publicApi
|
|
11
8
|
*/
|
|
12
|
-
class MaxFileSizeValidator extends
|
|
9
|
+
export class MaxFileSizeValidator extends FileValidator {
|
|
13
10
|
buildErrorMessage(file) {
|
|
14
11
|
const { errorMessage, message, ...config } = this.validationOptions;
|
|
15
12
|
if (errorMessage) {
|
|
@@ -34,4 +31,3 @@ class MaxFileSizeValidator extends file_validator_interface_1.FileValidator {
|
|
|
34
31
|
return 'size' in file && file.size < this.validationOptions.maxSize;
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
|
-
exports.MaxFileSizeValidator = MaxFileSizeValidator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ErrorHttpStatusCode } from '../../utils/http-error-by-code.util';
|
|
2
|
-
import { FileValidator } from './file-validator.interface';
|
|
1
|
+
import { ErrorHttpStatusCode } from '../../utils/http-error-by-code.util.js';
|
|
2
|
+
import { FileValidator } from './file-validator.interface.js';
|
|
3
3
|
/**
|
|
4
4
|
* @publicApi
|
|
5
5
|
*/
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FileTypeValidatorOptions } from './file-type.validator';
|
|
2
|
-
import { FileValidator } from './file-validator.interface';
|
|
3
|
-
import { MaxFileSizeValidatorOptions } from './max-file-size.validator';
|
|
4
|
-
import { ParseFileOptions } from './parse-file-options.interface';
|
|
5
|
-
import { ParseFilePipe } from './parse-file.pipe';
|
|
1
|
+
import { FileTypeValidatorOptions } from './file-type.validator.js';
|
|
2
|
+
import { FileValidator } from './file-validator.interface.js';
|
|
3
|
+
import { MaxFileSizeValidatorOptions } from './max-file-size.validator.js';
|
|
4
|
+
import { ParseFileOptions } from './parse-file-options.interface.js';
|
|
5
|
+
import { ParseFilePipe } from './parse-file.pipe.js';
|
|
6
6
|
/**
|
|
7
7
|
* @publicApi
|
|
8
8
|
*/
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const file_type_validator_1 = require("./file-type.validator");
|
|
5
|
-
const max_file_size_validator_1 = require("./max-file-size.validator");
|
|
6
|
-
const parse_file_pipe_1 = require("./parse-file.pipe");
|
|
1
|
+
import { FileTypeValidator, } from './file-type.validator.js';
|
|
2
|
+
import { MaxFileSizeValidator, } from './max-file-size.validator.js';
|
|
3
|
+
import { ParseFilePipe } from './parse-file.pipe.js';
|
|
7
4
|
/**
|
|
8
5
|
* @publicApi
|
|
9
6
|
*/
|
|
10
|
-
class ParseFilePipeBuilder {
|
|
11
|
-
|
|
12
|
-
this.validators = [];
|
|
13
|
-
}
|
|
7
|
+
export class ParseFilePipeBuilder {
|
|
8
|
+
validators = [];
|
|
14
9
|
addMaxSizeValidator(options) {
|
|
15
|
-
return this.addValidator(new
|
|
10
|
+
return this.addValidator(new MaxFileSizeValidator(options));
|
|
16
11
|
}
|
|
17
12
|
addFileTypeValidator(options) {
|
|
18
|
-
return this.addValidator(new
|
|
13
|
+
return this.addValidator(new FileTypeValidator(options));
|
|
19
14
|
}
|
|
20
15
|
addValidator(validator) {
|
|
21
16
|
this.validators.push(validator);
|
|
22
17
|
return this;
|
|
23
18
|
}
|
|
24
19
|
build(additionalOptions) {
|
|
25
|
-
const parseFilePipe = new
|
|
20
|
+
const parseFilePipe = new ParseFilePipe({
|
|
26
21
|
...additionalOptions,
|
|
27
22
|
validators: this.validators,
|
|
28
23
|
});
|
|
@@ -30,4 +25,3 @@ class ParseFilePipeBuilder {
|
|
|
30
25
|
return parseFilePipe;
|
|
31
26
|
}
|
|
32
27
|
}
|
|
33
|
-
exports.ParseFilePipeBuilder = ParseFilePipeBuilder;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PipeTransform } from '../../interfaces/features/pipe-transform.interface';
|
|
2
|
-
import { FileValidator } from './file-validator.interface';
|
|
3
|
-
import { ParseFileOptions } from './parse-file-options.interface';
|
|
1
|
+
import { PipeTransform } from '../../interfaces/features/pipe-transform.interface.js';
|
|
2
|
+
import { FileValidator } from './file-validator.interface.js';
|
|
3
|
+
import { ParseFileOptions } from './parse-file-options.interface.js';
|
|
4
4
|
/**
|
|
5
5
|
* Defines the built-in ParseFile Pipe. This pipe can be used to validate incoming files
|
|
6
6
|
* with `@UploadedFile()` decorator. You can use either other specific built-in validators
|
|
@@ -11,18 +11,18 @@ import { ParseFileOptions } from './parse-file-options.interface';
|
|
|
11
11
|
*
|
|
12
12
|
* @publicApi
|
|
13
13
|
*/
|
|
14
|
-
export declare class ParseFilePipe implements PipeTransform
|
|
14
|
+
export declare class ParseFilePipe implements PipeTransform {
|
|
15
15
|
protected exceptionFactory: (error: string) => any;
|
|
16
16
|
private readonly validators;
|
|
17
17
|
private readonly fileIsRequired;
|
|
18
18
|
constructor(options?: ParseFileOptions);
|
|
19
|
-
transform(value:
|
|
19
|
+
transform(value: unknown): Promise<any>;
|
|
20
20
|
private validateFilesOrFile;
|
|
21
21
|
private thereAreNoFilesIn;
|
|
22
|
-
protected validate(file:
|
|
22
|
+
protected validate(file: unknown): Promise<any>;
|
|
23
23
|
private validateOrThrow;
|
|
24
24
|
/**
|
|
25
25
|
* @returns list of validators used in this pipe.
|
|
26
26
|
*/
|
|
27
|
-
getValidators(): FileValidator<Record<string, any>, import("./interfaces").IFile>[];
|
|
27
|
+
getValidators(): FileValidator<Record<string, any>, import("./interfaces/file.interface.js").IFile>[];
|
|
28
28
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const enums_1 = require("../../enums");
|
|
7
|
-
const http_error_by_code_util_1 = require("../../utils/http-error-by-code.util");
|
|
8
|
-
const shared_utils_1 = require("../../utils/shared.utils");
|
|
1
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
+
import { Injectable, Optional } from '../../decorators/core/index.js';
|
|
3
|
+
import { HttpStatus } from '../../enums/index.js';
|
|
4
|
+
import { HttpErrorByCode } from '../../utils/http-error-by-code.util.js';
|
|
5
|
+
import { isEmptyArray, isObject, isUndefined, } from '../../utils/shared.utils.js';
|
|
9
6
|
/**
|
|
10
7
|
* Defines the built-in ParseFile Pipe. This pipe can be used to validate incoming files
|
|
11
8
|
* with `@UploadedFile()` decorator. You can use either other specific built-in validators
|
|
@@ -17,11 +14,14 @@ const shared_utils_1 = require("../../utils/shared.utils");
|
|
|
17
14
|
* @publicApi
|
|
18
15
|
*/
|
|
19
16
|
let ParseFilePipe = class ParseFilePipe {
|
|
17
|
+
exceptionFactory;
|
|
18
|
+
validators;
|
|
19
|
+
fileIsRequired;
|
|
20
20
|
constructor(options = {}) {
|
|
21
|
-
const { exceptionFactory, errorHttpStatusCode =
|
|
21
|
+
const { exceptionFactory, errorHttpStatusCode = HttpStatus.BAD_REQUEST, validators = [], fileIsRequired, } = options;
|
|
22
22
|
this.exceptionFactory =
|
|
23
23
|
exceptionFactory ||
|
|
24
|
-
(error => new
|
|
24
|
+
(error => new HttpErrorByCode[errorHttpStatusCode](error));
|
|
25
25
|
this.validators = validators;
|
|
26
26
|
this.fileIsRequired = fileIsRequired ?? true;
|
|
27
27
|
}
|
|
@@ -44,9 +44,8 @@ let ParseFilePipe = class ParseFilePipe {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
thereAreNoFilesIn(value) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
return (0, shared_utils_1.isUndefined)(value) || isEmptyArray || isEmptyObject;
|
|
47
|
+
const isEmptyObject = isObject(value) && isEmptyArray(Object.keys(value));
|
|
48
|
+
return isUndefined(value) || isEmptyArray(value) || isEmptyObject;
|
|
50
49
|
}
|
|
51
50
|
async validate(file) {
|
|
52
51
|
for (const validator of this.validators) {
|
|
@@ -68,9 +67,9 @@ let ParseFilePipe = class ParseFilePipe {
|
|
|
68
67
|
return this.validators;
|
|
69
68
|
}
|
|
70
69
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(0,
|
|
74
|
-
|
|
75
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
70
|
+
ParseFilePipe = __decorate([
|
|
71
|
+
Injectable(),
|
|
72
|
+
__param(0, Optional()),
|
|
73
|
+
__metadata("design:paramtypes", [Object])
|
|
76
74
|
], ParseFilePipe);
|
|
75
|
+
export { ParseFilePipe };
|
package/pipes/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export * from './default-value.pipe';
|
|
2
|
-
export * from './file';
|
|
3
|
-
export * from './parse-array.pipe';
|
|
4
|
-
export * from './parse-bool.pipe';
|
|
5
|
-
export * from './parse-date.pipe';
|
|
6
|
-
export * from './parse-enum.pipe';
|
|
7
|
-
export * from './parse-float.pipe';
|
|
8
|
-
export * from './parse-int.pipe';
|
|
9
|
-
export * from './parse-uuid.pipe';
|
|
10
|
-
export * from './validation.pipe';
|
|
1
|
+
export * from './default-value.pipe.js';
|
|
2
|
+
export * from './file/index.js';
|
|
3
|
+
export * from './parse-array.pipe.js';
|
|
4
|
+
export * from './parse-bool.pipe.js';
|
|
5
|
+
export * from './parse-date.pipe.js';
|
|
6
|
+
export * from './parse-enum.pipe.js';
|
|
7
|
+
export * from './parse-float.pipe.js';
|
|
8
|
+
export * from './parse-int.pipe.js';
|
|
9
|
+
export * from './parse-uuid.pipe.js';
|
|
10
|
+
export * from './standard-schema-validation.pipe.js';
|
|
11
|
+
export * from './validation.pipe.js';
|
package/pipes/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
tslib_1.__exportStar(require("./parse-uuid.pipe"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./validation.pipe"), exports);
|
|
1
|
+
export * from './default-value.pipe.js';
|
|
2
|
+
export * from './file/index.js';
|
|
3
|
+
export * from './parse-array.pipe.js';
|
|
4
|
+
export * from './parse-bool.pipe.js';
|
|
5
|
+
export * from './parse-date.pipe.js';
|
|
6
|
+
export * from './parse-enum.pipe.js';
|
|
7
|
+
export * from './parse-float.pipe.js';
|
|
8
|
+
export * from './parse-int.pipe.js';
|
|
9
|
+
export * from './parse-uuid.pipe.js';
|
|
10
|
+
export * from './standard-schema-validation.pipe.js';
|
|
11
|
+
export * from './validation.pipe.js';
|