@depup/nestjs__common 11.1.16-depup.1
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/LICENSE +22 -0
- package/PACKAGE.md +1 -0
- package/Readme.md +31 -0
- package/changes.json +10 -0
- package/constants.d.ts +42 -0
- package/constants.js +44 -0
- package/decorators/core/apply-decorators.d.ts +10 -0
- package/decorators/core/apply-decorators.js +23 -0
- package/decorators/core/bind.decorator.d.ts +11 -0
- package/decorators/core/bind.decorator.js +19 -0
- package/decorators/core/catch.decorator.d.ts +19 -0
- package/decorators/core/catch.decorator.js +27 -0
- package/decorators/core/controller.decorator.d.ts +102 -0
- package/decorators/core/controller.decorator.js +61 -0
- package/decorators/core/dependencies.decorator.d.ts +7 -0
- package/decorators/core/dependencies.decorator.js +23 -0
- package/decorators/core/exception-filters.decorator.d.ts +23 -0
- package/decorators/core/exception-filters.decorator.js +43 -0
- package/decorators/core/index.d.ts +14 -0
- package/decorators/core/index.js +17 -0
- package/decorators/core/inject.decorator.d.ts +31 -0
- package/decorators/core/inject.decorator.js +53 -0
- package/decorators/core/injectable.decorator.d.ts +43 -0
- package/decorators/core/injectable.decorator.js +50 -0
- package/decorators/core/optional.decorator.d.ts +14 -0
- package/decorators/core/optional.decorator.js +29 -0
- package/decorators/core/set-metadata.decorator.d.ts +20 -0
- package/decorators/core/set-metadata.decorator.js +32 -0
- package/decorators/core/use-guards.decorator.d.ts +23 -0
- package/decorators/core/use-guards.decorator.js +41 -0
- package/decorators/core/use-interceptors.decorator.d.ts +23 -0
- package/decorators/core/use-interceptors.decorator.js +42 -0
- package/decorators/core/use-pipes.decorator.d.ts +23 -0
- package/decorators/core/use-pipes.decorator.js +40 -0
- package/decorators/core/version.decorator.d.ts +7 -0
- package/decorators/core/version.decorator.js +19 -0
- package/decorators/http/create-route-param-metadata.decorator.d.ts +13 -0
- package/decorators/http/create-route-param-metadata.decorator.js +32 -0
- package/decorators/http/header.decorator.d.ts +15 -0
- package/decorators/http/header.decorator.js +25 -0
- package/decorators/http/http-code.decorator.d.ts +11 -0
- package/decorators/http/http-code.decorator.js +20 -0
- package/decorators/http/index.d.ts +8 -0
- package/decorators/http/index.js +11 -0
- package/decorators/http/redirect.decorator.d.ts +6 -0
- package/decorators/http/redirect.decorator.js +15 -0
- package/decorators/http/render.decorator.d.ts +12 -0
- package/decorators/http/render.decorator.js +21 -0
- package/decorators/http/request-mapping.decorator.d.ts +134 -0
- package/decorators/http/request-mapping.decorator.js +154 -0
- package/decorators/http/route-params.decorator.d.ts +445 -0
- package/decorators/http/route-params.decorator.js +265 -0
- package/decorators/http/sse.decorator.d.ts +10 -0
- package/decorators/http/sse.decorator.js +21 -0
- package/decorators/index.d.ts +3 -0
- package/decorators/index.js +6 -0
- package/decorators/modules/global.decorator.d.ts +12 -0
- package/decorators/modules/global.decorator.js +20 -0
- package/decorators/modules/index.d.ts +2 -0
- package/decorators/modules/index.js +5 -0
- package/decorators/modules/module.decorator.d.ts +16 -0
- package/decorators/modules/module.decorator.js +29 -0
- package/enums/http-status.enum.d.ts +60 -0
- package/enums/http-status.enum.js +64 -0
- package/enums/index.d.ts +4 -0
- package/enums/index.js +7 -0
- package/enums/request-method.enum.d.ts +18 -0
- package/enums/request-method.enum.js +22 -0
- package/enums/route-paramtypes.enum.d.ts +16 -0
- package/enums/route-paramtypes.enum.js +20 -0
- package/enums/shutdown-signal.enum.d.ts +16 -0
- package/enums/shutdown-signal.enum.js +20 -0
- package/enums/version-type.enum.d.ts +9 -0
- package/enums/version-type.enum.js +13 -0
- package/exceptions/bad-gateway.exception.d.ts +35 -0
- package/exceptions/bad-gateway.exception.js +43 -0
- package/exceptions/bad-request.exception.d.ts +35 -0
- package/exceptions/bad-request.exception.js +43 -0
- package/exceptions/conflict.exception.d.ts +35 -0
- package/exceptions/conflict.exception.js +43 -0
- package/exceptions/forbidden.exception.d.ts +35 -0
- package/exceptions/forbidden.exception.js +43 -0
- package/exceptions/gateway-timeout.exception.d.ts +35 -0
- package/exceptions/gateway-timeout.exception.js +43 -0
- package/exceptions/gone.exception.d.ts +35 -0
- package/exceptions/gone.exception.js +43 -0
- package/exceptions/http-version-not-supported.exception.d.ts +35 -0
- package/exceptions/http-version-not-supported.exception.js +43 -0
- package/exceptions/http.exception.d.ts +85 -0
- package/exceptions/http.exception.js +133 -0
- package/exceptions/im-a-teapot.exception.d.ts +38 -0
- package/exceptions/im-a-teapot.exception.js +46 -0
- package/exceptions/index.d.ts +23 -0
- package/exceptions/index.js +26 -0
- package/exceptions/internal-server-error.exception.d.ts +35 -0
- package/exceptions/internal-server-error.exception.js +43 -0
- package/exceptions/intrinsic.exception.d.ts +8 -0
- package/exceptions/intrinsic.exception.js +12 -0
- package/exceptions/method-not-allowed.exception.d.ts +35 -0
- package/exceptions/method-not-allowed.exception.js +43 -0
- package/exceptions/misdirected.exception.d.ts +35 -0
- package/exceptions/misdirected.exception.js +43 -0
- package/exceptions/not-acceptable.exception.d.ts +35 -0
- package/exceptions/not-acceptable.exception.js +43 -0
- package/exceptions/not-found.exception.d.ts +35 -0
- package/exceptions/not-found.exception.js +43 -0
- package/exceptions/not-implemented.exception.d.ts +35 -0
- package/exceptions/not-implemented.exception.js +43 -0
- package/exceptions/payload-too-large.exception.d.ts +35 -0
- package/exceptions/payload-too-large.exception.js +43 -0
- package/exceptions/precondition-failed.exception.d.ts +35 -0
- package/exceptions/precondition-failed.exception.js +43 -0
- package/exceptions/request-timeout.exception.d.ts +35 -0
- package/exceptions/request-timeout.exception.js +43 -0
- package/exceptions/service-unavailable.exception.d.ts +35 -0
- package/exceptions/service-unavailable.exception.js +43 -0
- package/exceptions/unauthorized.exception.d.ts +35 -0
- package/exceptions/unauthorized.exception.js +43 -0
- package/exceptions/unprocessable-entity.exception.d.ts +35 -0
- package/exceptions/unprocessable-entity.exception.js +43 -0
- package/exceptions/unsupported-media-type.exception.d.ts +35 -0
- package/exceptions/unsupported-media-type.exception.js +43 -0
- package/file-stream/index.d.ts +1 -0
- package/file-stream/index.js +4 -0
- package/file-stream/interfaces/index.d.ts +2 -0
- package/file-stream/interfaces/index.js +5 -0
- package/file-stream/interfaces/streamable-handler-response.interface.d.ts +12 -0
- package/file-stream/interfaces/streamable-handler-response.interface.js +2 -0
- package/file-stream/interfaces/streamable-options.interface.d.ts +22 -0
- package/file-stream/interfaces/streamable-options.interface.js +2 -0
- package/file-stream/streamable-file.d.ts +27 -0
- package/file-stream/streamable-file.js +68 -0
- package/index.d.ts +11 -0
- package/index.js +23 -0
- package/interfaces/abstract.interface.d.ts +3 -0
- package/interfaces/abstract.interface.js +2 -0
- package/interfaces/controllers/controller-metadata.interface.d.ts +3 -0
- package/interfaces/controllers/controller-metadata.interface.js +2 -0
- package/interfaces/controllers/controller.interface.d.ts +1 -0
- package/interfaces/controllers/controller.interface.js +2 -0
- package/interfaces/controllers/index.d.ts +2 -0
- package/interfaces/controllers/index.js +5 -0
- package/interfaces/exceptions/exception-filter-metadata.interface.d.ts +6 -0
- package/interfaces/exceptions/exception-filter-metadata.interface.js +2 -0
- package/interfaces/exceptions/exception-filter.interface.d.ts +18 -0
- package/interfaces/exceptions/exception-filter.interface.js +2 -0
- package/interfaces/exceptions/index.d.ts +5 -0
- package/interfaces/exceptions/index.js +8 -0
- package/interfaces/exceptions/rpc-exception-filter-metadata.interface.d.ts +6 -0
- package/interfaces/exceptions/rpc-exception-filter-metadata.interface.js +2 -0
- package/interfaces/exceptions/rpc-exception-filter.interface.d.ts +19 -0
- package/interfaces/exceptions/rpc-exception-filter.interface.js +2 -0
- package/interfaces/exceptions/ws-exception-filter.interface.d.ts +18 -0
- package/interfaces/exceptions/ws-exception-filter.interface.js +2 -0
- package/interfaces/external/class-transform-options.interface.d.ts +65 -0
- package/interfaces/external/class-transform-options.interface.js +2 -0
- package/interfaces/external/cors-options.interface.d.ts +58 -0
- package/interfaces/external/cors-options.interface.js +2 -0
- package/interfaces/external/https-options.interface.d.ts +105 -0
- package/interfaces/external/https-options.interface.js +2 -0
- package/interfaces/external/transformer-package.interface.d.ts +6 -0
- package/interfaces/external/transformer-package.interface.js +2 -0
- package/interfaces/external/validation-error.interface.d.ts +42 -0
- package/interfaces/external/validation-error.interface.js +2 -0
- package/interfaces/external/validator-options.interface.d.ts +76 -0
- package/interfaces/external/validator-options.interface.js +2 -0
- package/interfaces/external/validator-package.interface.d.ts +5 -0
- package/interfaces/external/validator-package.interface.js +2 -0
- package/interfaces/features/arguments-host.interface.d.ts +88 -0
- package/interfaces/features/arguments-host.interface.js +2 -0
- package/interfaces/features/can-activate.interface.d.ts +22 -0
- package/interfaces/features/can-activate.interface.js +2 -0
- package/interfaces/features/custom-route-param-factory.interface.d.ts +5 -0
- package/interfaces/features/custom-route-param-factory.interface.js +2 -0
- package/interfaces/features/execution-context.interface.d.ts +20 -0
- package/interfaces/features/execution-context.interface.js +2 -0
- package/interfaces/features/nest-interceptor.interface.d.ts +34 -0
- package/interfaces/features/nest-interceptor.interface.js +2 -0
- package/interfaces/features/paramtype.interface.d.ts +4 -0
- package/interfaces/features/paramtype.interface.js +2 -0
- package/interfaces/features/pipe-transform.interface.d.ts +42 -0
- package/interfaces/features/pipe-transform.interface.js +2 -0
- package/interfaces/global-prefix-options.interface.d.ts +7 -0
- package/interfaces/global-prefix-options.interface.js +2 -0
- package/interfaces/hooks/before-application-shutdown.interface.d.ts +3 -0
- package/interfaces/hooks/before-application-shutdown.interface.js +2 -0
- package/interfaces/hooks/index.d.ts +5 -0
- package/interfaces/hooks/index.js +8 -0
- package/interfaces/hooks/on-application-bootstrap.interface.d.ts +11 -0
- package/interfaces/hooks/on-application-bootstrap.interface.js +2 -0
- package/interfaces/hooks/on-application-shutdown.interface.d.ts +11 -0
- package/interfaces/hooks/on-application-shutdown.interface.js +2 -0
- package/interfaces/hooks/on-destroy.interface.d.ts +12 -0
- package/interfaces/hooks/on-destroy.interface.js +2 -0
- package/interfaces/hooks/on-init.interface.d.ts +10 -0
- package/interfaces/hooks/on-init.interface.js +2 -0
- package/interfaces/http/http-exception-body.interface.d.ts +6 -0
- package/interfaces/http/http-exception-body.interface.js +2 -0
- package/interfaces/http/http-redirect-response.interface.d.ts +5 -0
- package/interfaces/http/http-redirect-response.interface.js +2 -0
- package/interfaces/http/http-server.interface.d.ts +70 -0
- package/interfaces/http/http-server.interface.js +2 -0
- package/interfaces/http/index.d.ts +5 -0
- package/interfaces/http/index.js +8 -0
- package/interfaces/http/message-event.interface.d.ts +6 -0
- package/interfaces/http/message-event.interface.js +2 -0
- package/interfaces/http/raw-body-request.interface.d.ts +6 -0
- package/interfaces/http/raw-body-request.interface.js +2 -0
- package/interfaces/index.d.ts +30 -0
- package/interfaces/index.js +33 -0
- package/interfaces/injectable.interface.d.ts +1 -0
- package/interfaces/injectable.interface.js +2 -0
- package/interfaces/microservices/nest-hybrid-application-options.interface.d.ts +7 -0
- package/interfaces/microservices/nest-hybrid-application-options.interface.js +2 -0
- package/interfaces/microservices/nest-microservice-options.interface.d.ts +5 -0
- package/interfaces/microservices/nest-microservice-options.interface.js +2 -0
- package/interfaces/middleware/index.d.ts +4 -0
- package/interfaces/middleware/index.js +7 -0
- package/interfaces/middleware/middleware-config-proxy.interface.d.ts +24 -0
- package/interfaces/middleware/middleware-config-proxy.interface.js +2 -0
- package/interfaces/middleware/middleware-configuration.interface.d.ts +12 -0
- package/interfaces/middleware/middleware-configuration.interface.js +2 -0
- package/interfaces/middleware/middleware-consumer.interface.d.ts +18 -0
- package/interfaces/middleware/middleware-consumer.interface.js +2 -0
- package/interfaces/middleware/nest-middleware.interface.d.ts +8 -0
- package/interfaces/middleware/nest-middleware.interface.js +2 -0
- package/interfaces/modules/dynamic-module.interface.d.ts +25 -0
- package/interfaces/modules/dynamic-module.interface.js +2 -0
- package/interfaces/modules/forward-reference.interface.d.ts +3 -0
- package/interfaces/modules/forward-reference.interface.js +2 -0
- package/interfaces/modules/index.d.ts +8 -0
- package/interfaces/modules/index.js +11 -0
- package/interfaces/modules/injection-token.interface.d.ts +6 -0
- package/interfaces/modules/injection-token.interface.js +2 -0
- package/interfaces/modules/introspection-result.interface.d.ts +10 -0
- package/interfaces/modules/introspection-result.interface.js +2 -0
- package/interfaces/modules/module-metadata.interface.d.ts +34 -0
- package/interfaces/modules/module-metadata.interface.js +2 -0
- package/interfaces/modules/nest-module.interface.d.ts +7 -0
- package/interfaces/modules/nest-module.interface.js +2 -0
- package/interfaces/modules/optional-factory-dependency.interface.d.ts +8 -0
- package/interfaces/modules/optional-factory-dependency.interface.js +2 -0
- package/interfaces/modules/provider.interface.d.ts +156 -0
- package/interfaces/modules/provider.interface.js +2 -0
- package/interfaces/nest-application-context-options.interface.d.ts +68 -0
- package/interfaces/nest-application-context-options.interface.js +9 -0
- package/interfaces/nest-application-context.interface.d.ts +139 -0
- package/interfaces/nest-application-context.interface.js +2 -0
- package/interfaces/nest-application-options.interface.d.ts +29 -0
- package/interfaces/nest-application-options.interface.js +2 -0
- package/interfaces/nest-application.interface.d.ts +135 -0
- package/interfaces/nest-application.interface.js +2 -0
- package/interfaces/nest-microservice.interface.d.ts +75 -0
- package/interfaces/nest-microservice.interface.js +2 -0
- package/interfaces/scope-options.interface.d.ts +37 -0
- package/interfaces/scope-options.interface.js +23 -0
- package/interfaces/shutdown-hooks-options.interface.d.ts +21 -0
- package/interfaces/shutdown-hooks-options.interface.js +2 -0
- package/interfaces/type.interface.d.ts +3 -0
- package/interfaces/type.interface.js +2 -0
- package/interfaces/version-options.interface.d.ts +92 -0
- package/interfaces/version-options.interface.js +9 -0
- package/interfaces/websockets/web-socket-adapter.interface.d.ts +19 -0
- package/interfaces/websockets/web-socket-adapter.interface.js +2 -0
- package/module-utils/configurable-module.builder.d.ts +93 -0
- package/module-utils/configurable-module.builder.js +219 -0
- package/module-utils/constants.d.ts +9 -0
- package/module-utils/constants.js +19 -0
- package/module-utils/index.d.ts +2 -0
- package/module-utils/index.js +5 -0
- package/module-utils/interfaces/configurable-module-async-options.interface.d.ts +42 -0
- package/module-utils/interfaces/configurable-module-async-options.interface.js +2 -0
- package/module-utils/interfaces/configurable-module-cls.interface.d.ts +13 -0
- package/module-utils/interfaces/configurable-module-cls.interface.js +2 -0
- package/module-utils/interfaces/configurable-module-host.interface.d.ts +62 -0
- package/module-utils/interfaces/configurable-module-host.interface.js +2 -0
- package/module-utils/interfaces/index.d.ts +3 -0
- package/module-utils/interfaces/index.js +6 -0
- package/module-utils/utils/generate-options-injection-token.util.d.ts +1 -0
- package/module-utils/utils/generate-options-injection-token.util.js +8 -0
- package/module-utils/utils/get-injection-providers.util.d.ts +8 -0
- package/module-utils/utils/get-injection-providers.util.js +35 -0
- package/module-utils/utils/index.d.ts +2 -0
- package/module-utils/utils/index.js +5 -0
- package/package.json +61 -0
- package/pipes/default-value.pipe.d.ts +13 -0
- package/pipes/default-value.pipe.js +30 -0
- package/pipes/file/file-type.validator.d.ts +62 -0
- package/pipes/file/file-type.validator.js +102 -0
- package/pipes/file/file-validator-context.interface.d.ts +5 -0
- package/pipes/file/file-validator-context.interface.js +2 -0
- package/pipes/file/file-validator.interface.d.ts +21 -0
- package/pipes/file/file-validator.interface.js +15 -0
- package/pipes/file/index.d.ts +6 -0
- package/pipes/file/index.js +9 -0
- package/pipes/file/interfaces/file.interface.d.ts +5 -0
- package/pipes/file/interfaces/file.interface.js +2 -0
- package/pipes/file/interfaces/index.d.ts +1 -0
- package/pipes/file/interfaces/index.js +4 -0
- package/pipes/file/max-file-size.validator.d.ts +44 -0
- package/pipes/file/max-file-size.validator.js +37 -0
- package/pipes/file/parse-file-options.interface.d.ts +15 -0
- package/pipes/file/parse-file-options.interface.js +2 -0
- package/pipes/file/parse-file-pipe.builder.d.ts +15 -0
- package/pipes/file/parse-file-pipe.builder.js +33 -0
- package/pipes/file/parse-file.pipe.d.ts +28 -0
- package/pipes/file/parse-file.pipe.js +76 -0
- package/pipes/index.d.ts +10 -0
- package/pipes/index.js +13 -0
- package/pipes/parse-array.pipe.d.ts +52 -0
- package/pipes/parse-array.pipe.js +148 -0
- package/pipes/parse-bool.pipe.d.ts +55 -0
- package/pipes/parse-bool.pipe.js +67 -0
- package/pipes/parse-date.pipe.d.ts +37 -0
- package/pipes/parse-date.pipe.js +42 -0
- package/pipes/parse-enum.pipe.d.ts +46 -0
- package/pipes/parse-enum.pipe.js +55 -0
- package/pipes/parse-float.pipe.d.ts +49 -0
- package/pipes/parse-float.pipe.js +56 -0
- package/pipes/parse-int.pipe.d.ts +48 -0
- package/pipes/parse-int.pipe.js +57 -0
- package/pipes/parse-uuid.pipe.d.ts +49 -0
- package/pipes/parse-uuid.pipe.js +57 -0
- package/pipes/validation.pipe.d.ts +51 -0
- package/pipes/validation.pipe.js +245 -0
- package/serializer/class-serializer.constants.d.ts +1 -0
- package/serializer/class-serializer.constants.js +4 -0
- package/serializer/class-serializer.interceptor.d.ts +29 -0
- package/serializer/class-serializer.interceptor.js +77 -0
- package/serializer/class-serializer.interfaces.d.ts +8 -0
- package/serializer/class-serializer.interfaces.js +2 -0
- package/serializer/decorators/index.d.ts +1 -0
- package/serializer/decorators/index.js +4 -0
- package/serializer/decorators/serialize-options.decorator.d.ts +5 -0
- package/serializer/decorators/serialize-options.decorator.js +10 -0
- package/serializer/index.d.ts +3 -0
- package/serializer/index.js +6 -0
- package/services/console-logger.service.d.ts +202 -0
- package/services/console-logger.service.js +379 -0
- package/services/index.d.ts +3 -0
- package/services/index.js +6 -0
- package/services/logger.service.d.ts +152 -0
- package/services/logger.service.js +251 -0
- package/services/utils/filter-log-levels.util.d.ts +5 -0
- package/services/utils/filter-log-levels.util.js +23 -0
- package/services/utils/index.d.ts +3 -0
- package/services/utils/index.js +6 -0
- package/services/utils/is-log-level-enabled.util.d.ts +7 -0
- package/services/utils/is-log-level-enabled.util.js +32 -0
- package/services/utils/is-log-level.util.d.ts +5 -0
- package/services/utils/is-log-level.util.js +10 -0
- package/tsconfig.build.json +10 -0
- package/utils/assign-custom-metadata.util.d.ts +4 -0
- package/utils/assign-custom-metadata.util.js +15 -0
- package/utils/cli-colors.util.d.ts +10 -0
- package/utils/cli-colors.util.js +15 -0
- package/utils/extend-metadata.util.d.ts +1 -0
- package/utils/extend-metadata.util.js +8 -0
- package/utils/forward-ref.util.d.ts +5 -0
- package/utils/forward-ref.util.js +10 -0
- package/utils/http-error-by-code.util.d.ts +4 -0
- package/utils/http-error-by-code.util.js +26 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +4 -0
- package/utils/load-package.util.d.ts +1 -0
- package/utils/load-package.util.js +16 -0
- package/utils/merge-with-values.util.d.ts +4 -0
- package/utils/merge-with-values.util.js +18 -0
- package/utils/random-string-generator.util.d.ts +1 -0
- package/utils/random-string-generator.util.js +6 -0
- package/utils/select-exception-filter-metadata.util.d.ts +2 -0
- package/utils/select-exception-filter-metadata.util.js +6 -0
- package/utils/shared.utils.d.ts +13 -0
- package/utils/shared.utils.js +51 -0
- package/utils/validate-each.util.d.ts +8 -0
- package/utils/validate-each.util.js +25 -0
- package/utils/validate-module-keys.util.d.ts +2 -0
- package/utils/validate-module-keys.util.js +22 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route handler method Decorator. Defines a template to be rendered by the controller.
|
|
3
|
+
*
|
|
4
|
+
* For example: `@Render('index')`
|
|
5
|
+
*
|
|
6
|
+
* @param template name of the render engine template file
|
|
7
|
+
*
|
|
8
|
+
* @see [Model-View-Controller](https://docs.nestjs.com/techniques/mvc)
|
|
9
|
+
*
|
|
10
|
+
* @publicApi
|
|
11
|
+
*/
|
|
12
|
+
export declare function Render(template: string): MethodDecorator;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Render = Render;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
/**
|
|
6
|
+
* Route handler method Decorator. Defines a template to be rendered by the controller.
|
|
7
|
+
*
|
|
8
|
+
* For example: `@Render('index')`
|
|
9
|
+
*
|
|
10
|
+
* @param template name of the render engine template file
|
|
11
|
+
*
|
|
12
|
+
* @see [Model-View-Controller](https://docs.nestjs.com/techniques/mvc)
|
|
13
|
+
*
|
|
14
|
+
* @publicApi
|
|
15
|
+
*/
|
|
16
|
+
function Render(template) {
|
|
17
|
+
return (target, key, descriptor) => {
|
|
18
|
+
Reflect.defineMetadata(constants_1.RENDER_METADATA, template, descriptor.value);
|
|
19
|
+
return descriptor;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { RequestMethod } from '../../enums/request-method.enum';
|
|
2
|
+
export interface RequestMappingMetadata {
|
|
3
|
+
path?: string | string[];
|
|
4
|
+
method?: RequestMethod;
|
|
5
|
+
}
|
|
6
|
+
export declare const RequestMapping: (metadata?: RequestMappingMetadata) => MethodDecorator;
|
|
7
|
+
/**
|
|
8
|
+
* Route handler (method) Decorator. Routes HTTP POST requests to the specified path.
|
|
9
|
+
*
|
|
10
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
11
|
+
*
|
|
12
|
+
* @publicApi
|
|
13
|
+
*/
|
|
14
|
+
export declare const Post: (path?: string | string[]) => MethodDecorator;
|
|
15
|
+
/**
|
|
16
|
+
* Route handler (method) Decorator. Routes HTTP GET requests to the specified path.
|
|
17
|
+
*
|
|
18
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
19
|
+
*
|
|
20
|
+
* @publicApi
|
|
21
|
+
*/
|
|
22
|
+
export declare const Get: (path?: string | string[]) => MethodDecorator;
|
|
23
|
+
/**
|
|
24
|
+
* Route handler (method) Decorator. Routes HTTP DELETE requests to the specified path.
|
|
25
|
+
*
|
|
26
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
27
|
+
*
|
|
28
|
+
* @publicApi
|
|
29
|
+
*/
|
|
30
|
+
export declare const Delete: (path?: string | string[]) => MethodDecorator;
|
|
31
|
+
/**
|
|
32
|
+
* Route handler (method) Decorator. Routes HTTP PUT requests to the specified path.
|
|
33
|
+
*
|
|
34
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
35
|
+
*
|
|
36
|
+
* @publicApi
|
|
37
|
+
*/
|
|
38
|
+
export declare const Put: (path?: string | string[]) => MethodDecorator;
|
|
39
|
+
/**
|
|
40
|
+
* Route handler (method) Decorator. Routes HTTP PATCH requests to the specified path.
|
|
41
|
+
*
|
|
42
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
43
|
+
*
|
|
44
|
+
* @publicApi
|
|
45
|
+
*/
|
|
46
|
+
export declare const Patch: (path?: string | string[]) => MethodDecorator;
|
|
47
|
+
/**
|
|
48
|
+
* Route handler (method) Decorator. Routes HTTP OPTIONS requests to the specified path.
|
|
49
|
+
*
|
|
50
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
51
|
+
*
|
|
52
|
+
* @publicApi
|
|
53
|
+
*/
|
|
54
|
+
export declare const Options: (path?: string | string[]) => MethodDecorator;
|
|
55
|
+
/**
|
|
56
|
+
* Route handler (method) Decorator. Routes HTTP HEAD requests to the specified path.
|
|
57
|
+
*
|
|
58
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
59
|
+
*
|
|
60
|
+
* @publicApi
|
|
61
|
+
*/
|
|
62
|
+
export declare const Head: (path?: string | string[]) => MethodDecorator;
|
|
63
|
+
/**
|
|
64
|
+
* Route handler (method) Decorator. Routes all HTTP requests to the specified path.
|
|
65
|
+
*
|
|
66
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
67
|
+
*
|
|
68
|
+
* @publicApi
|
|
69
|
+
*/
|
|
70
|
+
export declare const All: (path?: string | string[]) => MethodDecorator;
|
|
71
|
+
/**
|
|
72
|
+
* Route handler (method) Decorator. Routes HTTP SEARCH requests to the specified path.
|
|
73
|
+
*
|
|
74
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
75
|
+
*
|
|
76
|
+
* @publicApi
|
|
77
|
+
*/
|
|
78
|
+
export declare const Search: (path?: string | string[]) => MethodDecorator;
|
|
79
|
+
/**
|
|
80
|
+
* Route handler (method) Decorator. Routes Webdav PROPFIND requests to the specified path.
|
|
81
|
+
*
|
|
82
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
83
|
+
*
|
|
84
|
+
* @publicApi
|
|
85
|
+
*/
|
|
86
|
+
export declare const Propfind: (path?: string | string[]) => MethodDecorator;
|
|
87
|
+
/**
|
|
88
|
+
* Route handler (method) Decorator. Routes Webdav PROPPATCH requests to the specified path.
|
|
89
|
+
*
|
|
90
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
91
|
+
*
|
|
92
|
+
* @publicApi
|
|
93
|
+
*/
|
|
94
|
+
export declare const Proppatch: (path?: string | string[]) => MethodDecorator;
|
|
95
|
+
/**
|
|
96
|
+
* Route handler (method) Decorator. Routes Webdav MKCOL requests to the specified path.
|
|
97
|
+
*
|
|
98
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
99
|
+
*
|
|
100
|
+
* @publicApi
|
|
101
|
+
*/
|
|
102
|
+
export declare const Mkcol: (path?: string | string[]) => MethodDecorator;
|
|
103
|
+
/**
|
|
104
|
+
* Route handler (method) Decorator. Routes Webdav COPY requests to the specified path.
|
|
105
|
+
*
|
|
106
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
107
|
+
*
|
|
108
|
+
* @publicApi
|
|
109
|
+
*/
|
|
110
|
+
export declare const Copy: (path?: string | string[]) => MethodDecorator;
|
|
111
|
+
/**
|
|
112
|
+
* Route handler (method) Decorator. Routes Webdav MOVE requests to the specified path.
|
|
113
|
+
*
|
|
114
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
115
|
+
*
|
|
116
|
+
* @publicApi
|
|
117
|
+
*/
|
|
118
|
+
export declare const Move: (path?: string | string[]) => MethodDecorator;
|
|
119
|
+
/**
|
|
120
|
+
* Route handler (method) Decorator. Routes Webdav LOCK requests to the specified path.
|
|
121
|
+
*
|
|
122
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
123
|
+
*
|
|
124
|
+
* @publicApi
|
|
125
|
+
*/
|
|
126
|
+
export declare const Lock: (path?: string | string[]) => MethodDecorator;
|
|
127
|
+
/**
|
|
128
|
+
* Route handler (method) Decorator. Routes Webdav UNLOCK requests to the specified path.
|
|
129
|
+
*
|
|
130
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
131
|
+
*
|
|
132
|
+
* @publicApi
|
|
133
|
+
*/
|
|
134
|
+
export declare const Unlock: (path?: string | string[]) => MethodDecorator;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Unlock = exports.Lock = exports.Move = exports.Copy = exports.Mkcol = exports.Proppatch = exports.Propfind = exports.Search = exports.All = exports.Head = exports.Options = exports.Patch = exports.Put = exports.Delete = exports.Get = exports.Post = exports.RequestMapping = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
const request_method_enum_1 = require("../../enums/request-method.enum");
|
|
6
|
+
const defaultMetadata = {
|
|
7
|
+
[constants_1.PATH_METADATA]: '/',
|
|
8
|
+
[constants_1.METHOD_METADATA]: request_method_enum_1.RequestMethod.GET,
|
|
9
|
+
};
|
|
10
|
+
const RequestMapping = (metadata = defaultMetadata) => {
|
|
11
|
+
const pathMetadata = metadata[constants_1.PATH_METADATA];
|
|
12
|
+
const path = pathMetadata && pathMetadata.length ? pathMetadata : '/';
|
|
13
|
+
const requestMethod = metadata[constants_1.METHOD_METADATA] || request_method_enum_1.RequestMethod.GET;
|
|
14
|
+
return (target, key, descriptor) => {
|
|
15
|
+
Reflect.defineMetadata(constants_1.PATH_METADATA, path, descriptor.value);
|
|
16
|
+
Reflect.defineMetadata(constants_1.METHOD_METADATA, requestMethod, descriptor.value);
|
|
17
|
+
return descriptor;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
exports.RequestMapping = RequestMapping;
|
|
21
|
+
const createMappingDecorator = (method) => (path) => {
|
|
22
|
+
return (0, exports.RequestMapping)({
|
|
23
|
+
[constants_1.PATH_METADATA]: path,
|
|
24
|
+
[constants_1.METHOD_METADATA]: method,
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Route handler (method) Decorator. Routes HTTP POST requests to the specified path.
|
|
29
|
+
*
|
|
30
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
31
|
+
*
|
|
32
|
+
* @publicApi
|
|
33
|
+
*/
|
|
34
|
+
exports.Post = createMappingDecorator(request_method_enum_1.RequestMethod.POST);
|
|
35
|
+
/**
|
|
36
|
+
* Route handler (method) Decorator. Routes HTTP GET requests to the specified path.
|
|
37
|
+
*
|
|
38
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
39
|
+
*
|
|
40
|
+
* @publicApi
|
|
41
|
+
*/
|
|
42
|
+
exports.Get = createMappingDecorator(request_method_enum_1.RequestMethod.GET);
|
|
43
|
+
/**
|
|
44
|
+
* Route handler (method) Decorator. Routes HTTP DELETE requests to the specified path.
|
|
45
|
+
*
|
|
46
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
47
|
+
*
|
|
48
|
+
* @publicApi
|
|
49
|
+
*/
|
|
50
|
+
exports.Delete = createMappingDecorator(request_method_enum_1.RequestMethod.DELETE);
|
|
51
|
+
/**
|
|
52
|
+
* Route handler (method) Decorator. Routes HTTP PUT requests to the specified path.
|
|
53
|
+
*
|
|
54
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
55
|
+
*
|
|
56
|
+
* @publicApi
|
|
57
|
+
*/
|
|
58
|
+
exports.Put = createMappingDecorator(request_method_enum_1.RequestMethod.PUT);
|
|
59
|
+
/**
|
|
60
|
+
* Route handler (method) Decorator. Routes HTTP PATCH requests to the specified path.
|
|
61
|
+
*
|
|
62
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
63
|
+
*
|
|
64
|
+
* @publicApi
|
|
65
|
+
*/
|
|
66
|
+
exports.Patch = createMappingDecorator(request_method_enum_1.RequestMethod.PATCH);
|
|
67
|
+
/**
|
|
68
|
+
* Route handler (method) Decorator. Routes HTTP OPTIONS requests to the specified path.
|
|
69
|
+
*
|
|
70
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
71
|
+
*
|
|
72
|
+
* @publicApi
|
|
73
|
+
*/
|
|
74
|
+
exports.Options = createMappingDecorator(request_method_enum_1.RequestMethod.OPTIONS);
|
|
75
|
+
/**
|
|
76
|
+
* Route handler (method) Decorator. Routes HTTP HEAD requests to the specified path.
|
|
77
|
+
*
|
|
78
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
79
|
+
*
|
|
80
|
+
* @publicApi
|
|
81
|
+
*/
|
|
82
|
+
exports.Head = createMappingDecorator(request_method_enum_1.RequestMethod.HEAD);
|
|
83
|
+
/**
|
|
84
|
+
* Route handler (method) Decorator. Routes all HTTP requests to the specified path.
|
|
85
|
+
*
|
|
86
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
87
|
+
*
|
|
88
|
+
* @publicApi
|
|
89
|
+
*/
|
|
90
|
+
exports.All = createMappingDecorator(request_method_enum_1.RequestMethod.ALL);
|
|
91
|
+
/**
|
|
92
|
+
* Route handler (method) Decorator. Routes HTTP SEARCH requests to the specified path.
|
|
93
|
+
*
|
|
94
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
95
|
+
*
|
|
96
|
+
* @publicApi
|
|
97
|
+
*/
|
|
98
|
+
exports.Search = createMappingDecorator(request_method_enum_1.RequestMethod.SEARCH);
|
|
99
|
+
/**
|
|
100
|
+
* Route handler (method) Decorator. Routes Webdav PROPFIND requests to the specified path.
|
|
101
|
+
*
|
|
102
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
103
|
+
*
|
|
104
|
+
* @publicApi
|
|
105
|
+
*/
|
|
106
|
+
exports.Propfind = createMappingDecorator(request_method_enum_1.RequestMethod.PROPFIND);
|
|
107
|
+
/**
|
|
108
|
+
* Route handler (method) Decorator. Routes Webdav PROPPATCH requests to the specified path.
|
|
109
|
+
*
|
|
110
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
111
|
+
*
|
|
112
|
+
* @publicApi
|
|
113
|
+
*/
|
|
114
|
+
exports.Proppatch = createMappingDecorator(request_method_enum_1.RequestMethod.PROPPATCH);
|
|
115
|
+
/**
|
|
116
|
+
* Route handler (method) Decorator. Routes Webdav MKCOL requests to the specified path.
|
|
117
|
+
*
|
|
118
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
119
|
+
*
|
|
120
|
+
* @publicApi
|
|
121
|
+
*/
|
|
122
|
+
exports.Mkcol = createMappingDecorator(request_method_enum_1.RequestMethod.MKCOL);
|
|
123
|
+
/**
|
|
124
|
+
* Route handler (method) Decorator. Routes Webdav COPY requests to the specified path.
|
|
125
|
+
*
|
|
126
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
127
|
+
*
|
|
128
|
+
* @publicApi
|
|
129
|
+
*/
|
|
130
|
+
exports.Copy = createMappingDecorator(request_method_enum_1.RequestMethod.COPY);
|
|
131
|
+
/**
|
|
132
|
+
* Route handler (method) Decorator. Routes Webdav MOVE requests to the specified path.
|
|
133
|
+
*
|
|
134
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
135
|
+
*
|
|
136
|
+
* @publicApi
|
|
137
|
+
*/
|
|
138
|
+
exports.Move = createMappingDecorator(request_method_enum_1.RequestMethod.MOVE);
|
|
139
|
+
/**
|
|
140
|
+
* Route handler (method) Decorator. Routes Webdav LOCK requests to the specified path.
|
|
141
|
+
*
|
|
142
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
143
|
+
*
|
|
144
|
+
* @publicApi
|
|
145
|
+
*/
|
|
146
|
+
exports.Lock = createMappingDecorator(request_method_enum_1.RequestMethod.LOCK);
|
|
147
|
+
/**
|
|
148
|
+
* Route handler (method) Decorator. Routes Webdav UNLOCK requests to the specified path.
|
|
149
|
+
*
|
|
150
|
+
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
|
151
|
+
*
|
|
152
|
+
* @publicApi
|
|
153
|
+
*/
|
|
154
|
+
exports.Unlock = createMappingDecorator(request_method_enum_1.RequestMethod.UNLOCK);
|