@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,40 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.UploadedFile = UploadedFile;
|
|
6
|
-
exports.UploadedFiles = UploadedFiles;
|
|
7
|
-
exports.Query = Query;
|
|
8
|
-
exports.Body = Body;
|
|
9
|
-
exports.RawBody = RawBody;
|
|
10
|
-
exports.Param = Param;
|
|
11
|
-
exports.HostParam = HostParam;
|
|
12
|
-
const constants_1 = require("../../constants");
|
|
13
|
-
const route_paramtypes_enum_1 = require("../../enums/route-paramtypes.enum");
|
|
14
|
-
const shared_utils_1 = require("../../utils/shared.utils");
|
|
15
|
-
function assignMetadata(args, paramtype, index, data, ...pipes) {
|
|
1
|
+
import { RESPONSE_PASSTHROUGH_METADATA, ROUTE_ARGS_METADATA, } from '../../constants.js';
|
|
2
|
+
import { RouteParamtypes } from '../../enums/route-paramtypes.enum.js';
|
|
3
|
+
import { isNil, isString } from '../../utils/shared.utils.js';
|
|
4
|
+
export function assignMetadata(args, paramtype, index, options) {
|
|
16
5
|
return {
|
|
17
6
|
...args,
|
|
18
7
|
[`${paramtype}:${index}`]: {
|
|
19
8
|
index,
|
|
20
|
-
data,
|
|
21
|
-
pipes,
|
|
9
|
+
data: options.data,
|
|
10
|
+
pipes: options.pipes ?? [],
|
|
11
|
+
...(options.schema !== undefined && { schema: options.schema }),
|
|
22
12
|
},
|
|
23
13
|
};
|
|
24
14
|
}
|
|
25
15
|
function createRouteParamDecorator(paramtype) {
|
|
26
16
|
return (data) => (target, key, index) => {
|
|
27
|
-
const args = Reflect.getMetadata(
|
|
17
|
+
const args = Reflect.getMetadata(ROUTE_ARGS_METADATA, target.constructor, key) ||
|
|
28
18
|
{};
|
|
29
|
-
Reflect.defineMetadata(
|
|
19
|
+
Reflect.defineMetadata(ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, {
|
|
20
|
+
data,
|
|
21
|
+
}), target.constructor, key);
|
|
30
22
|
};
|
|
31
23
|
}
|
|
32
|
-
const createPipesRouteParamDecorator = (paramtype) => (data,
|
|
33
|
-
const args = Reflect.getMetadata(
|
|
34
|
-
const hasParamData =
|
|
24
|
+
const createPipesRouteParamDecorator = (paramtype) => ({ data, pipes, schema, }) => (target, key, index) => {
|
|
25
|
+
const args = Reflect.getMetadata(ROUTE_ARGS_METADATA, target.constructor, key) || {};
|
|
26
|
+
const hasParamData = isNil(data) || isString(data);
|
|
35
27
|
const paramData = hasParamData ? data : undefined;
|
|
36
|
-
const paramPipes = hasParamData
|
|
37
|
-
|
|
28
|
+
const paramPipes = hasParamData
|
|
29
|
+
? (pipes ?? [])
|
|
30
|
+
: [data, ...(pipes ?? [])];
|
|
31
|
+
Reflect.defineMetadata(ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, {
|
|
32
|
+
data: paramData,
|
|
33
|
+
pipes: paramPipes,
|
|
34
|
+
schema,
|
|
35
|
+
}), target.constructor, key);
|
|
38
36
|
};
|
|
39
37
|
/**
|
|
40
38
|
* Route handler parameter decorator. Extracts the `Request`
|
|
@@ -47,7 +45,7 @@ const createPipesRouteParamDecorator = (paramtype) => (data, ...pipes) => (targe
|
|
|
47
45
|
*
|
|
48
46
|
* @publicApi
|
|
49
47
|
*/
|
|
50
|
-
|
|
48
|
+
export const Request = createRouteParamDecorator(RouteParamtypes.REQUEST);
|
|
51
49
|
/**
|
|
52
50
|
* Route handler parameter decorator. Extracts the `Response`
|
|
53
51
|
* object from the underlying platform and populates the decorated
|
|
@@ -57,13 +55,12 @@ exports.Request = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamty
|
|
|
57
55
|
*
|
|
58
56
|
* @publicApi
|
|
59
57
|
*/
|
|
60
|
-
const Response = (options) => (target, key, index) => {
|
|
58
|
+
export const Response = (options) => (target, key, index) => {
|
|
61
59
|
if (options?.passthrough) {
|
|
62
|
-
Reflect.defineMetadata(
|
|
60
|
+
Reflect.defineMetadata(RESPONSE_PASSTHROUGH_METADATA, options?.passthrough, target.constructor, key);
|
|
63
61
|
}
|
|
64
|
-
return createRouteParamDecorator(
|
|
62
|
+
return createRouteParamDecorator(RouteParamtypes.RESPONSE)()(target, key, index);
|
|
65
63
|
};
|
|
66
|
-
exports.Response = Response;
|
|
67
64
|
/**
|
|
68
65
|
* Route handler parameter decorator. Extracts reference to the `Next` function
|
|
69
66
|
* from the underlying platform and populates the decorated
|
|
@@ -71,7 +68,7 @@ exports.Response = Response;
|
|
|
71
68
|
*
|
|
72
69
|
* @publicApi
|
|
73
70
|
*/
|
|
74
|
-
|
|
71
|
+
export const Next = createRouteParamDecorator(RouteParamtypes.NEXT);
|
|
75
72
|
/**
|
|
76
73
|
* Route handler parameter decorator. Extracts the `Ip` property
|
|
77
74
|
* from the `req` object and populates the decorated
|
|
@@ -81,7 +78,7 @@ exports.Next = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes
|
|
|
81
78
|
*
|
|
82
79
|
* @publicApi
|
|
83
80
|
*/
|
|
84
|
-
|
|
81
|
+
export const Ip = createRouteParamDecorator(RouteParamtypes.IP);
|
|
85
82
|
/**
|
|
86
83
|
* Route handler parameter decorator. Extracts the `Session` object
|
|
87
84
|
* from the underlying platform and populates the decorated
|
|
@@ -91,7 +88,7 @@ exports.Ip = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.I
|
|
|
91
88
|
*
|
|
92
89
|
* @publicApi
|
|
93
90
|
*/
|
|
94
|
-
|
|
91
|
+
export const Session = createRouteParamDecorator(RouteParamtypes.SESSION);
|
|
95
92
|
/**
|
|
96
93
|
* Route handler parameter decorator. Extracts the `file` object
|
|
97
94
|
* and populates the decorated parameter with the value of `file`.
|
|
@@ -108,8 +105,11 @@ exports.Session = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamty
|
|
|
108
105
|
*
|
|
109
106
|
* @publicApi
|
|
110
107
|
*/
|
|
111
|
-
function UploadedFile(fileKey, ...pipes) {
|
|
112
|
-
return createPipesRouteParamDecorator(
|
|
108
|
+
export function UploadedFile(fileKey, ...pipes) {
|
|
109
|
+
return createPipesRouteParamDecorator(RouteParamtypes.FILE)({
|
|
110
|
+
data: fileKey,
|
|
111
|
+
pipes,
|
|
112
|
+
});
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* Route handler parameter decorator. Extracts the `files` object
|
|
@@ -127,8 +127,10 @@ function UploadedFile(fileKey, ...pipes) {
|
|
|
127
127
|
*
|
|
128
128
|
* @publicApi
|
|
129
129
|
*/
|
|
130
|
-
function UploadedFiles(...pipes) {
|
|
131
|
-
return createPipesRouteParamDecorator(
|
|
130
|
+
export function UploadedFiles(...pipes) {
|
|
131
|
+
return createPipesRouteParamDecorator(RouteParamtypes.FILES)({
|
|
132
|
+
pipes,
|
|
133
|
+
});
|
|
132
134
|
}
|
|
133
135
|
/**
|
|
134
136
|
* Route handler parameter decorator. Extracts the `headers`
|
|
@@ -143,7 +145,7 @@ function UploadedFiles(...pipes) {
|
|
|
143
145
|
*
|
|
144
146
|
* @publicApi
|
|
145
147
|
*/
|
|
146
|
-
|
|
148
|
+
export const Headers = createRouteParamDecorator(RouteParamtypes.HEADERS);
|
|
147
149
|
/**
|
|
148
150
|
* Route handler parameter decorator. Extracts the `query`
|
|
149
151
|
* property from the `req` object and populates the decorated
|
|
@@ -156,14 +158,35 @@ exports.Headers = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamty
|
|
|
156
158
|
* ```
|
|
157
159
|
*
|
|
158
160
|
* @param property name of single property to extract from the `query` object
|
|
161
|
+
* @param optionsOrPipe one or more pipes to apply to the bound query parameter or options object
|
|
159
162
|
* @param pipes one or more pipes to apply to the bound query parameter
|
|
160
163
|
*
|
|
161
164
|
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
|
162
165
|
*
|
|
163
166
|
* @publicApi
|
|
164
167
|
*/
|
|
165
|
-
function Query(property, ...pipes) {
|
|
166
|
-
|
|
168
|
+
export function Query(property, optionsOrPipe, ...pipes) {
|
|
169
|
+
const isPropertyOptions = property &&
|
|
170
|
+
typeof property === 'object' &&
|
|
171
|
+
!('transform' in property) &&
|
|
172
|
+
('schema' in property || 'pipes' in property);
|
|
173
|
+
if (isPropertyOptions) {
|
|
174
|
+
return createPipesRouteParamDecorator(RouteParamtypes.QUERY)({
|
|
175
|
+
pipes: property.pipes,
|
|
176
|
+
schema: property.schema,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
const isOptions = optionsOrPipe &&
|
|
180
|
+
typeof optionsOrPipe === 'object' &&
|
|
181
|
+
('schema' in optionsOrPipe || 'pipes' in optionsOrPipe);
|
|
182
|
+
const actualPipes = isOptions
|
|
183
|
+
? optionsOrPipe.pipes
|
|
184
|
+
: [optionsOrPipe, ...pipes].filter(Boolean);
|
|
185
|
+
return createPipesRouteParamDecorator(RouteParamtypes.QUERY)({
|
|
186
|
+
data: property,
|
|
187
|
+
pipes: actualPipes,
|
|
188
|
+
schema: isOptions ? optionsOrPipe.schema : undefined,
|
|
189
|
+
});
|
|
167
190
|
}
|
|
168
191
|
/**
|
|
169
192
|
* Route handler parameter decorator. Extracts the entire `body` object
|
|
@@ -177,6 +200,7 @@ function Query(property, ...pipes) {
|
|
|
177
200
|
* ```
|
|
178
201
|
*
|
|
179
202
|
* @param property name of single property to extract from the `body` object
|
|
203
|
+
* @param optionsOrPipe options to apply to the bound body parameter.
|
|
180
204
|
* @param pipes one or more pipes - either instances or classes - to apply to
|
|
181
205
|
* the bound body parameter.
|
|
182
206
|
*
|
|
@@ -185,8 +209,28 @@ function Query(property, ...pipes) {
|
|
|
185
209
|
*
|
|
186
210
|
* @publicApi
|
|
187
211
|
*/
|
|
188
|
-
function Body(property, ...pipes) {
|
|
189
|
-
|
|
212
|
+
export function Body(property, optionsOrPipe, ...pipes) {
|
|
213
|
+
const isPropertyOptions = property &&
|
|
214
|
+
typeof property === 'object' &&
|
|
215
|
+
!('transform' in property) &&
|
|
216
|
+
('schema' in property || 'pipes' in property);
|
|
217
|
+
if (isPropertyOptions) {
|
|
218
|
+
return createPipesRouteParamDecorator(RouteParamtypes.BODY)({
|
|
219
|
+
pipes: property.pipes,
|
|
220
|
+
schema: property.schema,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
const isOptions = optionsOrPipe &&
|
|
224
|
+
typeof optionsOrPipe === 'object' &&
|
|
225
|
+
('schema' in optionsOrPipe || 'pipes' in optionsOrPipe);
|
|
226
|
+
const actualPipes = isOptions
|
|
227
|
+
? optionsOrPipe.pipes
|
|
228
|
+
: [optionsOrPipe, ...pipes].filter(Boolean);
|
|
229
|
+
return createPipesRouteParamDecorator(RouteParamtypes.BODY)({
|
|
230
|
+
data: property,
|
|
231
|
+
pipes: actualPipes,
|
|
232
|
+
schema: isOptions ? optionsOrPipe.schema : undefined,
|
|
233
|
+
});
|
|
190
234
|
}
|
|
191
235
|
/**
|
|
192
236
|
* Route handler parameter decorator. Extracts the `rawBody` Buffer
|
|
@@ -198,6 +242,7 @@ function Body(property, ...pipes) {
|
|
|
198
242
|
* async create(@RawBody(new ValidationPipe()) rawBody: Buffer)
|
|
199
243
|
* ```
|
|
200
244
|
*
|
|
245
|
+
* @param optionsOrPipe one or more pipes to apply or options object
|
|
201
246
|
* @param pipes one or more pipes - either instances or classes - to apply to
|
|
202
247
|
* the bound body parameter.
|
|
203
248
|
*
|
|
@@ -207,8 +252,17 @@ function Body(property, ...pipes) {
|
|
|
207
252
|
*
|
|
208
253
|
* @publicApi
|
|
209
254
|
*/
|
|
210
|
-
function RawBody(...pipes) {
|
|
211
|
-
|
|
255
|
+
export function RawBody(optionsOrPipe, ...pipes) {
|
|
256
|
+
const isOptions = optionsOrPipe &&
|
|
257
|
+
typeof optionsOrPipe === 'object' &&
|
|
258
|
+
('schema' in optionsOrPipe || 'pipes' in optionsOrPipe);
|
|
259
|
+
const actualPipes = isOptions
|
|
260
|
+
? optionsOrPipe.pipes
|
|
261
|
+
: [optionsOrPipe, ...pipes].filter(Boolean);
|
|
262
|
+
return createPipesRouteParamDecorator(RouteParamtypes.RAW_BODY)({
|
|
263
|
+
pipes: actualPipes,
|
|
264
|
+
schema: isOptions ? optionsOrPipe.schema : undefined,
|
|
265
|
+
});
|
|
212
266
|
}
|
|
213
267
|
/**
|
|
214
268
|
* Route handler parameter decorator. Extracts the `params`
|
|
@@ -226,6 +280,7 @@ function RawBody(...pipes) {
|
|
|
226
280
|
* findOne(@Param('id') id: string)
|
|
227
281
|
* ```
|
|
228
282
|
* @param property name of single property to extract from the `req` object
|
|
283
|
+
* @param optionsOrPipe one or more pipes to apply to the bound parameter or options object
|
|
229
284
|
* @param pipes one or more pipes - either instances or classes - to apply to
|
|
230
285
|
* the bound parameter.
|
|
231
286
|
*
|
|
@@ -234,8 +289,28 @@ function RawBody(...pipes) {
|
|
|
234
289
|
*
|
|
235
290
|
* @publicApi
|
|
236
291
|
*/
|
|
237
|
-
function Param(property, ...pipes) {
|
|
238
|
-
|
|
292
|
+
export function Param(property, optionsOrPipe, ...pipes) {
|
|
293
|
+
const isPropertyOptions = property &&
|
|
294
|
+
typeof property === 'object' &&
|
|
295
|
+
!('transform' in property) &&
|
|
296
|
+
('schema' in property || 'pipes' in property);
|
|
297
|
+
if (isPropertyOptions) {
|
|
298
|
+
return createPipesRouteParamDecorator(RouteParamtypes.PARAM)({
|
|
299
|
+
pipes: property.pipes,
|
|
300
|
+
schema: property.schema,
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
const isOptions = optionsOrPipe &&
|
|
304
|
+
typeof optionsOrPipe === 'object' &&
|
|
305
|
+
('schema' in optionsOrPipe || 'pipes' in optionsOrPipe);
|
|
306
|
+
const actualPipes = isOptions
|
|
307
|
+
? optionsOrPipe.pipes
|
|
308
|
+
: [optionsOrPipe, ...pipes].filter(Boolean);
|
|
309
|
+
return createPipesRouteParamDecorator(RouteParamtypes.PARAM)({
|
|
310
|
+
data: property,
|
|
311
|
+
pipes: actualPipes,
|
|
312
|
+
schema: isOptions ? optionsOrPipe.schema : undefined,
|
|
313
|
+
});
|
|
239
314
|
}
|
|
240
315
|
/**
|
|
241
316
|
* Route handler parameter decorator. Extracts the `hosts`
|
|
@@ -258,8 +333,8 @@ function Param(property, ...pipes) {
|
|
|
258
333
|
*
|
|
259
334
|
* @publicApi
|
|
260
335
|
*/
|
|
261
|
-
function HostParam(property) {
|
|
262
|
-
return createRouteParamDecorator(
|
|
336
|
+
export function HostParam(property) {
|
|
337
|
+
return createRouteParamDecorator(RouteParamtypes.HOST)(property);
|
|
263
338
|
}
|
|
264
|
-
|
|
265
|
-
|
|
339
|
+
export const Req = Request;
|
|
340
|
+
export const Res = Response;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { METHOD_METADATA } from '../../constants';
|
|
2
|
-
import { RequestMethod } from '../../enums/request-method.enum';
|
|
1
|
+
import { METHOD_METADATA } from '../../constants.js';
|
|
2
|
+
import { RequestMethod } from '../../enums/request-method.enum.js';
|
|
3
3
|
/**
|
|
4
4
|
* Declares this route as a Server-Sent-Events endpoint
|
|
5
5
|
*
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Sse = Sse;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
const request_method_enum_1 = require("../../enums/request-method.enum");
|
|
1
|
+
import { METHOD_METADATA, PATH_METADATA, SSE_METADATA, } from '../../constants.js';
|
|
2
|
+
import { RequestMethod } from '../../enums/request-method.enum.js';
|
|
6
3
|
/**
|
|
7
4
|
* Declares this route as a Server-Sent-Events endpoint
|
|
8
5
|
*
|
|
9
6
|
* @publicApi
|
|
10
7
|
*/
|
|
11
|
-
function Sse(path, options = {
|
|
12
|
-
[
|
|
8
|
+
export function Sse(path, options = {
|
|
9
|
+
[METHOD_METADATA]: RequestMethod.GET,
|
|
13
10
|
}) {
|
|
14
11
|
return (target, key, descriptor) => {
|
|
15
12
|
path = path && path.length ? path : '/';
|
|
16
|
-
Reflect.defineMetadata(
|
|
17
|
-
Reflect.defineMetadata(
|
|
18
|
-
Reflect.defineMetadata(
|
|
13
|
+
Reflect.defineMetadata(PATH_METADATA, path, descriptor.value);
|
|
14
|
+
Reflect.defineMetadata(METHOD_METADATA, options[METHOD_METADATA], descriptor.value);
|
|
15
|
+
Reflect.defineMetadata(SSE_METADATA, true, descriptor.value);
|
|
19
16
|
return descriptor;
|
|
20
17
|
};
|
|
21
18
|
}
|
package/decorators/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './core';
|
|
2
|
-
export * from './modules';
|
|
3
|
-
export * from './http';
|
|
1
|
+
export * from './core/index.js';
|
|
2
|
+
export * from './modules/index.js';
|
|
3
|
+
export * from './http/index.js';
|
package/decorators/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./core"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./modules"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./http"), exports);
|
|
1
|
+
export * from './core/index.js';
|
|
2
|
+
export * from './modules/index.js';
|
|
3
|
+
export * from './http/index.js';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Global = Global;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
1
|
+
import { GLOBAL_MODULE_METADATA } from '../../constants.js';
|
|
5
2
|
/**
|
|
6
3
|
* Decorator that makes a module global-scoped.
|
|
7
4
|
*
|
|
@@ -13,8 +10,8 @@ const constants_1 = require("../../constants");
|
|
|
13
10
|
*
|
|
14
11
|
* @publicApi
|
|
15
12
|
*/
|
|
16
|
-
function Global() {
|
|
13
|
+
export function Global() {
|
|
17
14
|
return (target) => {
|
|
18
|
-
Reflect.defineMetadata(
|
|
15
|
+
Reflect.defineMetadata(GLOBAL_MODULE_METADATA, true, target);
|
|
19
16
|
};
|
|
20
17
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './global.decorator';
|
|
2
|
-
export * from './module.decorator';
|
|
1
|
+
export * from './global.decorator.js';
|
|
2
|
+
export * from './module.decorator.js';
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./global.decorator"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./module.decorator"), exports);
|
|
1
|
+
export * from './global.decorator.js';
|
|
2
|
+
export * from './module.decorator.js';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Module = Module;
|
|
4
|
-
const validate_module_keys_util_1 = require("../../utils/validate-module-keys.util");
|
|
1
|
+
import { validateModuleKeys } from '../../utils/validate-module-keys.util.js';
|
|
5
2
|
/**
|
|
6
3
|
* Decorator that marks a class as a [module](https://docs.nestjs.com/modules).
|
|
7
4
|
*
|
|
@@ -16,9 +13,9 @@ const validate_module_keys_util_1 = require("../../utils/validate-module-keys.ut
|
|
|
16
13
|
*
|
|
17
14
|
* @publicApi
|
|
18
15
|
*/
|
|
19
|
-
function Module(metadata) {
|
|
16
|
+
export function Module(metadata) {
|
|
20
17
|
const propsKeys = Object.keys(metadata);
|
|
21
|
-
|
|
18
|
+
validateModuleKeys(propsKeys);
|
|
22
19
|
return (target) => {
|
|
23
20
|
for (const property in metadata) {
|
|
24
21
|
if (Object.hasOwnProperty.call(metadata, property)) {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpStatus = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @publicApi
|
|
6
3
|
*/
|
|
7
|
-
var HttpStatus;
|
|
4
|
+
export var HttpStatus;
|
|
8
5
|
(function (HttpStatus) {
|
|
9
6
|
HttpStatus[HttpStatus["CONTINUE"] = 100] = "CONTINUE";
|
|
10
7
|
HttpStatus[HttpStatus["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|
|
@@ -61,4 +58,4 @@ var HttpStatus;
|
|
|
61
58
|
HttpStatus[HttpStatus["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
62
59
|
HttpStatus[HttpStatus["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
|
|
63
60
|
HttpStatus[HttpStatus["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
|
|
64
|
-
})(HttpStatus || (
|
|
61
|
+
})(HttpStatus || (HttpStatus = {}));
|
package/enums/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './request-method.enum';
|
|
2
|
-
export * from './http-status.enum';
|
|
3
|
-
export * from './shutdown-signal.enum';
|
|
4
|
-
export * from './version-type.enum';
|
|
1
|
+
export * from './request-method.enum.js';
|
|
2
|
+
export * from './http-status.enum.js';
|
|
3
|
+
export * from './shutdown-signal.enum.js';
|
|
4
|
+
export * from './version-type.enum.js';
|
package/enums/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tslib_1.__exportStar(require("./http-status.enum"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./shutdown-signal.enum"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./version-type.enum"), exports);
|
|
1
|
+
export * from './request-method.enum.js';
|
|
2
|
+
export * from './http-status.enum.js';
|
|
3
|
+
export * from './shutdown-signal.enum.js';
|
|
4
|
+
export * from './version-type.enum.js';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RequestMethod = void 0;
|
|
4
|
-
var RequestMethod;
|
|
1
|
+
export var RequestMethod;
|
|
5
2
|
(function (RequestMethod) {
|
|
6
3
|
RequestMethod[RequestMethod["GET"] = 0] = "GET";
|
|
7
4
|
RequestMethod[RequestMethod["POST"] = 1] = "POST";
|
|
@@ -19,4 +16,4 @@ var RequestMethod;
|
|
|
19
16
|
RequestMethod[RequestMethod["MOVE"] = 13] = "MOVE";
|
|
20
17
|
RequestMethod[RequestMethod["LOCK"] = 14] = "LOCK";
|
|
21
18
|
RequestMethod[RequestMethod["UNLOCK"] = 15] = "UNLOCK";
|
|
22
|
-
})(RequestMethod || (
|
|
19
|
+
})(RequestMethod || (RequestMethod = {}));
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RouteParamtypes = void 0;
|
|
4
|
-
var RouteParamtypes;
|
|
1
|
+
export var RouteParamtypes;
|
|
5
2
|
(function (RouteParamtypes) {
|
|
6
3
|
RouteParamtypes[RouteParamtypes["REQUEST"] = 0] = "REQUEST";
|
|
7
4
|
RouteParamtypes[RouteParamtypes["RESPONSE"] = 1] = "RESPONSE";
|
|
@@ -17,4 +14,4 @@ var RouteParamtypes;
|
|
|
17
14
|
RouteParamtypes[RouteParamtypes["IP"] = 11] = "IP";
|
|
18
15
|
RouteParamtypes[RouteParamtypes["RAW_BODY"] = 12] = "RAW_BODY";
|
|
19
16
|
RouteParamtypes[RouteParamtypes["ACK"] = 13] = "ACK";
|
|
20
|
-
})(RouteParamtypes || (
|
|
17
|
+
})(RouteParamtypes || (RouteParamtypes = {}));
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ShutdownSignal = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* System signals which shut down a process
|
|
6
3
|
*/
|
|
7
|
-
var ShutdownSignal;
|
|
4
|
+
export var ShutdownSignal;
|
|
8
5
|
(function (ShutdownSignal) {
|
|
9
6
|
ShutdownSignal["SIGHUP"] = "SIGHUP";
|
|
10
7
|
ShutdownSignal["SIGINT"] = "SIGINT";
|
|
@@ -17,4 +14,4 @@ var ShutdownSignal;
|
|
|
17
14
|
ShutdownSignal["SIGSEGV"] = "SIGSEGV";
|
|
18
15
|
ShutdownSignal["SIGUSR2"] = "SIGUSR2";
|
|
19
16
|
ShutdownSignal["SIGTERM"] = "SIGTERM";
|
|
20
|
-
})(ShutdownSignal || (
|
|
17
|
+
})(ShutdownSignal || (ShutdownSignal = {}));
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VersioningType = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @publicApi
|
|
6
3
|
*/
|
|
7
|
-
var VersioningType;
|
|
4
|
+
export var VersioningType;
|
|
8
5
|
(function (VersioningType) {
|
|
9
6
|
VersioningType[VersioningType["URI"] = 0] = "URI";
|
|
10
7
|
VersioningType[VersioningType["HEADER"] = 1] = "HEADER";
|
|
11
8
|
VersioningType[VersioningType["MEDIA_TYPE"] = 2] = "MEDIA_TYPE";
|
|
12
9
|
VersioningType[VersioningType["CUSTOM"] = 3] = "CUSTOM";
|
|
13
|
-
})(VersioningType || (
|
|
10
|
+
})(VersioningType || (VersioningType = {}));
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.BadGatewayException = void 0;
|
|
4
|
-
const http_status_enum_1 = require("../enums/http-status.enum");
|
|
5
|
-
const http_exception_1 = require("./http.exception");
|
|
1
|
+
import { HttpStatus } from '../enums/http-status.enum.js';
|
|
2
|
+
import { HttpException } from './http.exception.js';
|
|
6
3
|
/**
|
|
7
4
|
* Defines an HTTP exception for *Bad Gateway* type errors.
|
|
8
5
|
*
|
|
@@ -10,7 +7,7 @@ const http_exception_1 = require("./http.exception");
|
|
|
10
7
|
*
|
|
11
8
|
* @publicApi
|
|
12
9
|
*/
|
|
13
|
-
class BadGatewayException extends
|
|
10
|
+
export class BadGatewayException extends HttpException {
|
|
14
11
|
/**
|
|
15
12
|
* Instantiate a `BadGatewayException` Exception.
|
|
16
13
|
*
|
|
@@ -36,8 +33,7 @@ class BadGatewayException extends http_exception_1.HttpException {
|
|
|
36
33
|
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
34
|
*/
|
|
38
35
|
constructor(objectOrError, descriptionOrOptions = 'Bad Gateway') {
|
|
39
|
-
const { description, httpExceptionOptions } =
|
|
40
|
-
super(
|
|
36
|
+
const { description = 'Bad Gateway', httpExceptionOptions } = HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
37
|
+
super(HttpException.createBody(objectOrError, description, HttpStatus.BAD_GATEWAY), HttpStatus.BAD_GATEWAY, httpExceptionOptions);
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
exports.BadGatewayException = BadGatewayException;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.BadRequestException = void 0;
|
|
4
|
-
const http_status_enum_1 = require("../enums/http-status.enum");
|
|
5
|
-
const http_exception_1 = require("./http.exception");
|
|
1
|
+
import { HttpStatus } from '../enums/http-status.enum.js';
|
|
2
|
+
import { HttpException } from './http.exception.js';
|
|
6
3
|
/**
|
|
7
4
|
* Defines an HTTP exception for *Bad Request* type errors.
|
|
8
5
|
*
|
|
@@ -10,7 +7,7 @@ const http_exception_1 = require("./http.exception");
|
|
|
10
7
|
*
|
|
11
8
|
* @publicApi
|
|
12
9
|
*/
|
|
13
|
-
class BadRequestException extends
|
|
10
|
+
export class BadRequestException extends HttpException {
|
|
14
11
|
/**
|
|
15
12
|
* Instantiate a `BadRequestException` Exception.
|
|
16
13
|
*
|
|
@@ -36,8 +33,7 @@ class BadRequestException extends http_exception_1.HttpException {
|
|
|
36
33
|
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
34
|
*/
|
|
38
35
|
constructor(objectOrError, descriptionOrOptions = 'Bad Request') {
|
|
39
|
-
const { description, httpExceptionOptions } =
|
|
40
|
-
super(
|
|
36
|
+
const { description = 'Bad Request', httpExceptionOptions } = HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
37
|
+
super(HttpException.createBody(objectOrError, description, HttpStatus.BAD_REQUEST), HttpStatus.BAD_REQUEST, httpExceptionOptions);
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
exports.BadRequestException = BadRequestException;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ConflictException = void 0;
|
|
4
|
-
const http_status_enum_1 = require("../enums/http-status.enum");
|
|
5
|
-
const http_exception_1 = require("./http.exception");
|
|
1
|
+
import { HttpStatus } from '../enums/http-status.enum.js';
|
|
2
|
+
import { HttpException } from './http.exception.js';
|
|
6
3
|
/**
|
|
7
4
|
* Defines an HTTP exception for *Conflict* type errors.
|
|
8
5
|
*
|
|
@@ -10,7 +7,7 @@ const http_exception_1 = require("./http.exception");
|
|
|
10
7
|
*
|
|
11
8
|
* @publicApi
|
|
12
9
|
*/
|
|
13
|
-
class ConflictException extends
|
|
10
|
+
export class ConflictException extends HttpException {
|
|
14
11
|
/**
|
|
15
12
|
* Instantiate a `ConflictException` Exception.
|
|
16
13
|
*
|
|
@@ -36,8 +33,7 @@ class ConflictException extends http_exception_1.HttpException {
|
|
|
36
33
|
* @param descriptionOrOptions either a short description of the HTTP error or an options object used to provide an underlying error cause
|
|
37
34
|
*/
|
|
38
35
|
constructor(objectOrError, descriptionOrOptions = 'Conflict') {
|
|
39
|
-
const { description, httpExceptionOptions } =
|
|
40
|
-
super(
|
|
36
|
+
const { description = 'Conflict', httpExceptionOptions } = HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
|
|
37
|
+
super(HttpException.createBody(objectOrError, description, HttpStatus.CONFLICT), HttpStatus.CONFLICT, httpExceptionOptions);
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
exports.ConflictException = ConflictException;
|