@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.
Files changed (329) hide show
  1. package/constants.js +35 -38
  2. package/decorators/core/apply-decorators.js +1 -4
  3. package/decorators/core/bind.decorator.js +1 -4
  4. package/decorators/core/catch.decorator.d.ts +1 -1
  5. package/decorators/core/catch.decorator.js +4 -7
  6. package/decorators/core/controller.decorator.d.ts +1 -1
  7. package/decorators/core/controller.decorator.js +10 -13
  8. package/decorators/core/dependencies.decorator.js +4 -9
  9. package/decorators/core/exception-filters.decorator.d.ts +1 -1
  10. package/decorators/core/exception-filters.decorator.js +10 -14
  11. package/decorators/core/index.d.ts +14 -14
  12. package/decorators/core/index.js +14 -17
  13. package/decorators/core/inject.decorator.d.ts +1 -1
  14. package/decorators/core/inject.decorator.js +9 -12
  15. package/decorators/core/injectable.decorator.d.ts +2 -2
  16. package/decorators/core/injectable.decorator.js +7 -11
  17. package/decorators/core/optional.decorator.js +8 -11
  18. package/decorators/core/set-metadata.decorator.js +1 -5
  19. package/decorators/core/use-guards.decorator.d.ts +1 -1
  20. package/decorators/core/use-guards.decorator.js +10 -13
  21. package/decorators/core/use-interceptors.decorator.d.ts +1 -1
  22. package/decorators/core/use-interceptors.decorator.js +10 -13
  23. package/decorators/core/use-pipes.decorator.d.ts +1 -1
  24. package/decorators/core/use-pipes.decorator.js +9 -12
  25. package/decorators/core/version.decorator.d.ts +1 -1
  26. package/decorators/core/version.decorator.js +3 -6
  27. package/decorators/http/create-route-param-metadata.decorator.d.ts +6 -5
  28. package/decorators/http/create-route-param-metadata.decorator.js +48 -16
  29. package/decorators/http/header.decorator.js +4 -7
  30. package/decorators/http/http-code.decorator.js +3 -6
  31. package/decorators/http/index.d.ts +8 -8
  32. package/decorators/http/index.js +8 -11
  33. package/decorators/http/redirect.decorator.js +3 -6
  34. package/decorators/http/render.decorator.js +3 -6
  35. package/decorators/http/request-mapping.decorator.d.ts +1 -1
  36. package/decorators/http/request-mapping.decorator.js +28 -32
  37. package/decorators/http/route-params.decorator.d.ts +153 -3
  38. package/decorators/http/route-params.decorator.js +124 -49
  39. package/decorators/http/sse.decorator.d.ts +2 -2
  40. package/decorators/http/sse.decorator.js +7 -10
  41. package/decorators/index.d.ts +3 -3
  42. package/decorators/index.js +3 -6
  43. package/decorators/modules/global.decorator.js +3 -6
  44. package/decorators/modules/index.d.ts +2 -2
  45. package/decorators/modules/index.js +2 -5
  46. package/decorators/modules/module.decorator.d.ts +1 -1
  47. package/decorators/modules/module.decorator.js +3 -6
  48. package/enums/http-status.enum.js +2 -5
  49. package/enums/index.d.ts +4 -4
  50. package/enums/index.js +4 -7
  51. package/enums/request-method.enum.js +2 -5
  52. package/enums/route-paramtypes.enum.js +2 -5
  53. package/enums/shutdown-signal.enum.js +2 -5
  54. package/enums/version-type.enum.js +2 -5
  55. package/exceptions/bad-gateway.exception.d.ts +1 -1
  56. package/exceptions/bad-gateway.exception.js +5 -9
  57. package/exceptions/bad-request.exception.d.ts +1 -1
  58. package/exceptions/bad-request.exception.js +5 -9
  59. package/exceptions/conflict.exception.d.ts +1 -1
  60. package/exceptions/conflict.exception.js +5 -9
  61. package/exceptions/forbidden.exception.d.ts +1 -1
  62. package/exceptions/forbidden.exception.js +5 -9
  63. package/exceptions/gateway-timeout.exception.d.ts +1 -1
  64. package/exceptions/gateway-timeout.exception.js +5 -9
  65. package/exceptions/gone.exception.d.ts +1 -1
  66. package/exceptions/gone.exception.js +5 -9
  67. package/exceptions/http-version-not-supported.exception.d.ts +1 -1
  68. package/exceptions/http-version-not-supported.exception.js +5 -9
  69. package/exceptions/http.exception.d.ts +6 -2
  70. package/exceptions/http.exception.js +36 -17
  71. package/exceptions/im-a-teapot.exception.d.ts +1 -1
  72. package/exceptions/im-a-teapot.exception.js +5 -9
  73. package/exceptions/index.d.ts +23 -23
  74. package/exceptions/index.js +23 -26
  75. package/exceptions/internal-server-error.exception.d.ts +1 -1
  76. package/exceptions/internal-server-error.exception.js +5 -9
  77. package/exceptions/intrinsic.exception.js +1 -5
  78. package/exceptions/method-not-allowed.exception.d.ts +1 -1
  79. package/exceptions/method-not-allowed.exception.js +5 -9
  80. package/exceptions/misdirected.exception.d.ts +1 -1
  81. package/exceptions/misdirected.exception.js +5 -9
  82. package/exceptions/not-acceptable.exception.d.ts +1 -1
  83. package/exceptions/not-acceptable.exception.js +5 -9
  84. package/exceptions/not-found.exception.d.ts +1 -1
  85. package/exceptions/not-found.exception.js +5 -9
  86. package/exceptions/not-implemented.exception.d.ts +1 -1
  87. package/exceptions/not-implemented.exception.js +5 -9
  88. package/exceptions/payload-too-large.exception.d.ts +1 -1
  89. package/exceptions/payload-too-large.exception.js +5 -9
  90. package/exceptions/precondition-failed.exception.d.ts +1 -1
  91. package/exceptions/precondition-failed.exception.js +5 -9
  92. package/exceptions/request-timeout.exception.d.ts +1 -1
  93. package/exceptions/request-timeout.exception.js +5 -9
  94. package/exceptions/service-unavailable.exception.d.ts +1 -1
  95. package/exceptions/service-unavailable.exception.js +5 -9
  96. package/exceptions/unauthorized.exception.d.ts +1 -1
  97. package/exceptions/unauthorized.exception.js +5 -9
  98. package/exceptions/unprocessable-entity.exception.d.ts +1 -1
  99. package/exceptions/unprocessable-entity.exception.js +5 -9
  100. package/exceptions/unsupported-media-type.exception.d.ts +1 -1
  101. package/exceptions/unsupported-media-type.exception.js +5 -9
  102. package/file-stream/index.d.ts +1 -1
  103. package/file-stream/index.js +1 -4
  104. package/file-stream/interfaces/index.d.ts +2 -2
  105. package/file-stream/interfaces/index.js +2 -5
  106. package/file-stream/interfaces/streamable-handler-response.interface.js +1 -2
  107. package/file-stream/interfaces/streamable-options.interface.js +1 -2
  108. package/file-stream/streamable-file.d.ts +2 -2
  109. package/file-stream/streamable-file.js +26 -28
  110. package/index.d.ts +10 -10
  111. package/index.js +11 -17
  112. package/interfaces/abstract.interface.js +1 -2
  113. package/interfaces/controllers/controller-metadata.interface.js +1 -2
  114. package/interfaces/controllers/controller.interface.js +1 -2
  115. package/interfaces/controllers/index.d.ts +2 -2
  116. package/interfaces/controllers/index.js +2 -5
  117. package/interfaces/exceptions/exception-filter-metadata.interface.d.ts +2 -2
  118. package/interfaces/exceptions/exception-filter-metadata.interface.js +1 -2
  119. package/interfaces/exceptions/exception-filter.interface.d.ts +1 -1
  120. package/interfaces/exceptions/exception-filter.interface.js +1 -2
  121. package/interfaces/exceptions/index.d.ts +5 -5
  122. package/interfaces/exceptions/index.js +5 -8
  123. package/interfaces/exceptions/rpc-exception-filter-metadata.interface.d.ts +2 -2
  124. package/interfaces/exceptions/rpc-exception-filter-metadata.interface.js +1 -2
  125. package/interfaces/exceptions/rpc-exception-filter.interface.d.ts +1 -1
  126. package/interfaces/exceptions/rpc-exception-filter.interface.js +1 -2
  127. package/interfaces/exceptions/ws-exception-filter.interface.d.ts +1 -1
  128. package/interfaces/exceptions/ws-exception-filter.interface.js +1 -2
  129. package/interfaces/external/class-transform-options.interface.js +1 -2
  130. package/interfaces/external/cors-options.interface.js +1 -2
  131. package/interfaces/external/https-options.interface.js +1 -2
  132. package/interfaces/external/transformer-package.interface.d.ts +2 -2
  133. package/interfaces/external/transformer-package.interface.js +1 -2
  134. package/interfaces/external/validation-error.interface.js +1 -2
  135. package/interfaces/external/validator-options.interface.js +1 -2
  136. package/interfaces/external/validator-package.interface.d.ts +2 -2
  137. package/interfaces/external/validator-package.interface.js +1 -2
  138. package/interfaces/features/arguments-host.interface.js +1 -2
  139. package/interfaces/features/can-activate.interface.d.ts +1 -1
  140. package/interfaces/features/can-activate.interface.js +1 -2
  141. package/interfaces/features/custom-route-param-factory.interface.d.ts +1 -1
  142. package/interfaces/features/custom-route-param-factory.interface.js +1 -2
  143. package/interfaces/features/execution-context.interface.d.ts +2 -2
  144. package/interfaces/features/execution-context.interface.js +1 -2
  145. package/interfaces/features/nest-interceptor.interface.d.ts +1 -1
  146. package/interfaces/features/nest-interceptor.interface.js +1 -2
  147. package/interfaces/features/paramtype.interface.js +1 -2
  148. package/interfaces/features/pipe-transform.interface.d.ts +10 -4
  149. package/interfaces/features/pipe-transform.interface.js +1 -2
  150. package/interfaces/global-prefix-options.interface.d.ts +1 -1
  151. package/interfaces/global-prefix-options.interface.js +1 -2
  152. package/interfaces/hooks/before-application-shutdown.interface.js +1 -2
  153. package/interfaces/hooks/index.d.ts +5 -5
  154. package/interfaces/hooks/index.js +5 -8
  155. package/interfaces/hooks/on-application-bootstrap.interface.js +1 -2
  156. package/interfaces/hooks/on-application-shutdown.interface.js +1 -2
  157. package/interfaces/hooks/on-destroy.interface.js +1 -2
  158. package/interfaces/hooks/on-init.interface.js +1 -2
  159. package/interfaces/http/http-exception-body.interface.d.ts +2 -1
  160. package/interfaces/http/http-exception-body.interface.js +1 -2
  161. package/interfaces/http/http-redirect-response.interface.d.ts +1 -1
  162. package/interfaces/http/http-redirect-response.interface.js +1 -2
  163. package/interfaces/http/http-server.interface.d.ts +4 -3
  164. package/interfaces/http/http-server.interface.js +1 -2
  165. package/interfaces/http/index.d.ts +5 -5
  166. package/interfaces/http/index.js +5 -8
  167. package/interfaces/http/message-event.interface.js +1 -2
  168. package/interfaces/http/raw-body-request.interface.js +1 -2
  169. package/interfaces/index.d.ts +31 -30
  170. package/interfaces/index.js +31 -33
  171. package/interfaces/injectable.interface.js +1 -2
  172. package/interfaces/microservices/nest-hybrid-application-options.interface.js +1 -2
  173. package/interfaces/microservices/nest-microservice-options.interface.d.ts +1 -1
  174. package/interfaces/microservices/nest-microservice-options.interface.js +1 -2
  175. package/interfaces/microservices/pre-request-hook.interface.d.ts +22 -0
  176. package/interfaces/microservices/pre-request-hook.interface.js +1 -0
  177. package/interfaces/middleware/index.d.ts +4 -4
  178. package/interfaces/middleware/index.js +4 -7
  179. package/interfaces/middleware/middleware-config-proxy.interface.d.ts +3 -3
  180. package/interfaces/middleware/middleware-config-proxy.interface.js +1 -2
  181. package/interfaces/middleware/middleware-configuration.interface.d.ts +3 -3
  182. package/interfaces/middleware/middleware-configuration.interface.js +1 -2
  183. package/interfaces/middleware/middleware-consumer.interface.d.ts +2 -2
  184. package/interfaces/middleware/middleware-consumer.interface.js +1 -2
  185. package/interfaces/middleware/nest-middleware.interface.js +1 -2
  186. package/interfaces/modules/dynamic-module.interface.d.ts +2 -2
  187. package/interfaces/modules/dynamic-module.interface.js +1 -2
  188. package/interfaces/modules/forward-reference.interface.js +1 -2
  189. package/interfaces/modules/index.d.ts +8 -8
  190. package/interfaces/modules/index.js +8 -11
  191. package/interfaces/modules/injection-token.interface.d.ts +2 -2
  192. package/interfaces/modules/injection-token.interface.js +1 -2
  193. package/interfaces/modules/introspection-result.interface.d.ts +1 -1
  194. package/interfaces/modules/introspection-result.interface.js +1 -2
  195. package/interfaces/modules/module-metadata.interface.d.ts +5 -5
  196. package/interfaces/modules/module-metadata.interface.js +1 -2
  197. package/interfaces/modules/nest-module.interface.d.ts +1 -1
  198. package/interfaces/modules/nest-module.interface.js +1 -2
  199. package/interfaces/modules/optional-factory-dependency.interface.d.ts +1 -1
  200. package/interfaces/modules/optional-factory-dependency.interface.js +1 -2
  201. package/interfaces/modules/provider.interface.d.ts +4 -4
  202. package/interfaces/modules/provider.interface.js +1 -2
  203. package/interfaces/nest-application-context-options.interface.d.ts +1 -1
  204. package/interfaces/nest-application-context-options.interface.js +55 -5
  205. package/interfaces/nest-application-context.interface.d.ts +6 -6
  206. package/interfaces/nest-application-context.interface.js +1 -2
  207. package/interfaces/nest-application-options.interface.d.ts +9 -3
  208. package/interfaces/nest-application-options.interface.js +1 -2
  209. package/interfaces/nest-application.interface.d.ts +8 -8
  210. package/interfaces/nest-application.interface.js +1 -2
  211. package/interfaces/nest-microservice.interface.d.ts +15 -6
  212. package/interfaces/nest-microservice.interface.js +1 -2
  213. package/interfaces/scope-options.interface.js +2 -5
  214. package/interfaces/shutdown-hooks-options.interface.js +1 -2
  215. package/interfaces/type.interface.js +1 -2
  216. package/interfaces/version-options.interface.d.ts +1 -1
  217. package/interfaces/version-options.interface.js +1 -4
  218. package/interfaces/websockets/web-socket-adapter.interface.js +1 -2
  219. package/internal.d.ts +30 -0
  220. package/internal.js +19 -0
  221. package/module-utils/configurable-module.builder.d.ts +4 -4
  222. package/module-utils/configurable-module.builder.js +21 -20
  223. package/module-utils/constants.js +5 -8
  224. package/module-utils/index.d.ts +2 -2
  225. package/module-utils/index.js +2 -5
  226. package/module-utils/interfaces/configurable-module-async-options.interface.d.ts +2 -2
  227. package/module-utils/interfaces/configurable-module-async-options.interface.js +1 -2
  228. package/module-utils/interfaces/configurable-module-cls.interface.d.ts +3 -3
  229. package/module-utils/interfaces/configurable-module-cls.interface.js +1 -2
  230. package/module-utils/interfaces/configurable-module-host.interface.d.ts +2 -2
  231. package/module-utils/interfaces/configurable-module-host.interface.js +1 -2
  232. package/module-utils/interfaces/index.d.ts +3 -3
  233. package/module-utils/interfaces/index.js +3 -6
  234. package/module-utils/utils/generate-options-injection-token.util.js +3 -6
  235. package/module-utils/utils/get-injection-providers.util.d.ts +1 -1
  236. package/module-utils/utils/get-injection-providers.util.js +4 -7
  237. package/module-utils/utils/index.d.ts +2 -2
  238. package/module-utils/utils/index.js +2 -5
  239. package/package.json +35 -2
  240. package/pipes/default-value.pipe.d.ts +1 -1
  241. package/pipes/default-value.pipe.js +10 -12
  242. package/pipes/file/file-type.validator.d.ts +3 -3
  243. package/pipes/file/file-type.validator.js +5 -19
  244. package/pipes/file/file-validator-context.interface.d.ts +1 -1
  245. package/pipes/file/file-validator-context.interface.js +1 -2
  246. package/pipes/file/file-validator.interface.d.ts +1 -1
  247. package/pipes/file/file-validator.interface.js +2 -5
  248. package/pipes/file/index.d.ts +6 -6
  249. package/pipes/file/index.js +6 -9
  250. package/pipes/file/interfaces/file.interface.js +1 -2
  251. package/pipes/file/interfaces/index.d.ts +1 -1
  252. package/pipes/file/interfaces/index.js +1 -4
  253. package/pipes/file/max-file-size.validator.d.ts +3 -3
  254. package/pipes/file/max-file-size.validator.js +2 -6
  255. package/pipes/file/parse-file-options.interface.d.ts +2 -2
  256. package/pipes/file/parse-file-options.interface.js +1 -2
  257. package/pipes/file/parse-file-pipe.builder.d.ts +5 -5
  258. package/pipes/file/parse-file-pipe.builder.js +8 -14
  259. package/pipes/file/parse-file.pipe.d.ts +7 -7
  260. package/pipes/file/parse-file.pipe.js +17 -18
  261. package/pipes/index.d.ts +11 -10
  262. package/pipes/index.js +11 -13
  263. package/pipes/parse-array.pipe.d.ts +4 -4
  264. package/pipes/parse-array.pipe.js +23 -23
  265. package/pipes/parse-bool.pipe.d.ts +6 -6
  266. package/pipes/parse-bool.pipe.js +16 -17
  267. package/pipes/parse-date.pipe.d.ts +4 -4
  268. package/pipes/parse-date.pipe.js +17 -16
  269. package/pipes/parse-enum.pipe.d.ts +5 -5
  270. package/pipes/parse-enum.pipe.js +16 -16
  271. package/pipes/parse-float.pipe.d.ts +6 -6
  272. package/pipes/parse-float.pipe.js +17 -18
  273. package/pipes/parse-int.pipe.d.ts +5 -5
  274. package/pipes/parse-int.pipe.js +18 -19
  275. package/pipes/parse-uuid.pipe.d.ts +4 -4
  276. package/pipes/parse-uuid.pipe.js +27 -26
  277. package/pipes/standard-schema-validation.pipe.d.ts +86 -0
  278. package/pipes/standard-schema-validation.pipe.js +120 -0
  279. package/pipes/validation.pipe.d.ts +32 -14
  280. package/pipes/validation.pipe.js +60 -30
  281. package/serializer/class-serializer.constants.js +1 -4
  282. package/serializer/class-serializer.interceptor.d.ts +5 -5
  283. package/serializer/class-serializer.interceptor.js +21 -24
  284. package/serializer/class-serializer.interfaces.d.ts +2 -2
  285. package/serializer/class-serializer.interfaces.js +1 -2
  286. package/serializer/decorators/index.d.ts +1 -1
  287. package/serializer/decorators/index.js +1 -4
  288. package/serializer/decorators/serialize-options.decorator.d.ts +3 -2
  289. package/serializer/decorators/serialize-options.decorator.js +3 -7
  290. package/serializer/index.d.ts +5 -3
  291. package/serializer/index.js +5 -6
  292. package/serializer/standard-schema-serializer.interceptor.d.ts +50 -0
  293. package/serializer/standard-schema-serializer.interceptor.js +75 -0
  294. package/serializer/standard-schema-serializer.interfaces.d.ts +18 -0
  295. package/serializer/standard-schema-serializer.interfaces.js +1 -0
  296. package/services/console-logger.service.d.ts +22 -3
  297. package/services/console-logger.service.js +132 -66
  298. package/services/index.d.ts +3 -3
  299. package/services/index.js +3 -6
  300. package/services/logger.service.js +86 -83
  301. package/services/utils/filter-log-levels.util.d.ts +1 -1
  302. package/services/utils/filter-log-levels.util.js +7 -10
  303. package/services/utils/index.d.ts +3 -3
  304. package/services/utils/index.js +3 -6
  305. package/services/utils/is-log-level-enabled.util.d.ts +1 -1
  306. package/services/utils/is-log-level-enabled.util.js +1 -4
  307. package/services/utils/is-log-level.util.d.ts +1 -1
  308. package/services/utils/is-log-level.util.js +3 -6
  309. package/tsconfig.build.json +1 -2
  310. package/utils/assign-custom-metadata.util.d.ts +5 -4
  311. package/utils/assign-custom-metadata.util.js +4 -6
  312. package/utils/cli-colors.util.js +4 -8
  313. package/utils/extend-metadata.util.js +1 -4
  314. package/utils/forward-ref.util.d.ts +1 -1
  315. package/utils/forward-ref.util.js +1 -5
  316. package/utils/http-error-by-code.util.d.ts +2 -2
  317. package/utils/http-error-by-code.util.js +22 -25
  318. package/utils/index.d.ts +1 -1
  319. package/utils/index.js +1 -4
  320. package/utils/load-package.util.d.ts +21 -1
  321. package/utils/load-package.util.js +62 -8
  322. package/utils/merge-with-values.util.js +1 -5
  323. package/utils/random-string-generator.util.js +2 -6
  324. package/utils/select-exception-filter-metadata.util.d.ts +1 -1
  325. package/utils/select-exception-filter-metadata.util.js +1 -5
  326. package/utils/shared.utils.d.ts +11 -10
  327. package/utils/shared.utils.js +28 -30
  328. package/utils/validate-each.util.js +3 -7
  329. package/utils/validate-module-keys.util.js +8 -13
package/constants.js CHANGED
@@ -1,44 +1,41 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ENTRY_PROVIDER_WATERMARK = exports.CATCH_WATERMARK = exports.CONTROLLER_WATERMARK = exports.INJECTABLE_WATERMARK = exports.VERSION_METADATA = exports.SSE_METADATA = exports.RESPONSE_PASSTHROUGH_METADATA = exports.REDIRECT_METADATA = exports.HEADERS_METADATA = exports.MODULE_PATH = exports.HTTP_CODE_METADATA = exports.RENDER_METADATA = exports.ENHANCER_KEY_TO_SUBTYPE_MAP = exports.EXCEPTION_FILTERS_METADATA = exports.INTERCEPTORS_METADATA = exports.GUARDS_METADATA = exports.PIPES_METADATA = exports.FILTER_CATCH_EXCEPTIONS = exports.CUSTOM_ROUTE_ARGS_METADATA = exports.ROUTE_ARGS_METADATA = exports.METHOD_METADATA = exports.SCOPE_OPTIONS_METADATA = exports.OPTIONAL_PROPERTY_DEPS_METADATA = exports.PROPERTY_DEPS_METADATA = exports.OPTIONAL_DEPS_METADATA = exports.SELF_DECLARED_DEPS_METADATA = exports.PARAMTYPES_METADATA = exports.PATH_METADATA = exports.HOST_METADATA = exports.GLOBAL_MODULE_METADATA = exports.MODULE_METADATA = void 0;
4
- exports.MODULE_METADATA = {
1
+ export const MODULE_METADATA = {
5
2
  IMPORTS: 'imports',
6
3
  PROVIDERS: 'providers',
7
4
  CONTROLLERS: 'controllers',
8
5
  EXPORTS: 'exports',
9
6
  };
10
- exports.GLOBAL_MODULE_METADATA = '__module:global__';
11
- exports.HOST_METADATA = 'host';
12
- exports.PATH_METADATA = 'path';
13
- exports.PARAMTYPES_METADATA = 'design:paramtypes';
14
- exports.SELF_DECLARED_DEPS_METADATA = 'self:paramtypes';
15
- exports.OPTIONAL_DEPS_METADATA = 'optional:paramtypes';
16
- exports.PROPERTY_DEPS_METADATA = 'self:properties_metadata';
17
- exports.OPTIONAL_PROPERTY_DEPS_METADATA = 'optional:properties_metadata';
18
- exports.SCOPE_OPTIONS_METADATA = 'scope:options';
19
- exports.METHOD_METADATA = 'method';
20
- exports.ROUTE_ARGS_METADATA = '__routeArguments__';
21
- exports.CUSTOM_ROUTE_ARGS_METADATA = '__customRouteArgs__';
22
- exports.FILTER_CATCH_EXCEPTIONS = '__filterCatchExceptions__';
23
- exports.PIPES_METADATA = '__pipes__';
24
- exports.GUARDS_METADATA = '__guards__';
25
- exports.INTERCEPTORS_METADATA = '__interceptors__';
26
- exports.EXCEPTION_FILTERS_METADATA = '__exceptionFilters__';
27
- exports.ENHANCER_KEY_TO_SUBTYPE_MAP = {
28
- [exports.GUARDS_METADATA]: 'guard',
29
- [exports.INTERCEPTORS_METADATA]: 'interceptor',
30
- [exports.PIPES_METADATA]: 'pipe',
31
- [exports.EXCEPTION_FILTERS_METADATA]: 'filter',
7
+ export const GLOBAL_MODULE_METADATA = '__module:global__';
8
+ export const HOST_METADATA = 'host';
9
+ export const PATH_METADATA = 'path';
10
+ export const PARAMTYPES_METADATA = 'design:paramtypes';
11
+ export const SELF_DECLARED_DEPS_METADATA = 'self:paramtypes';
12
+ export const OPTIONAL_DEPS_METADATA = 'optional:paramtypes';
13
+ export const PROPERTY_DEPS_METADATA = 'self:properties_metadata';
14
+ export const OPTIONAL_PROPERTY_DEPS_METADATA = 'optional:properties_metadata';
15
+ export const SCOPE_OPTIONS_METADATA = 'scope:options';
16
+ export const METHOD_METADATA = 'method';
17
+ export const ROUTE_ARGS_METADATA = '__routeArguments__';
18
+ export const CUSTOM_ROUTE_ARGS_METADATA = '__customRouteArgs__';
19
+ export const FILTER_CATCH_EXCEPTIONS = '__filterCatchExceptions__';
20
+ export const PIPES_METADATA = '__pipes__';
21
+ export const GUARDS_METADATA = '__guards__';
22
+ export const INTERCEPTORS_METADATA = '__interceptors__';
23
+ export const EXCEPTION_FILTERS_METADATA = '__exceptionFilters__';
24
+ export const ENHANCER_KEY_TO_SUBTYPE_MAP = {
25
+ [GUARDS_METADATA]: 'guard',
26
+ [INTERCEPTORS_METADATA]: 'interceptor',
27
+ [PIPES_METADATA]: 'pipe',
28
+ [EXCEPTION_FILTERS_METADATA]: 'filter',
32
29
  };
33
- exports.RENDER_METADATA = '__renderTemplate__';
34
- exports.HTTP_CODE_METADATA = '__httpCode__';
35
- exports.MODULE_PATH = '__module_path__';
36
- exports.HEADERS_METADATA = '__headers__';
37
- exports.REDIRECT_METADATA = '__redirect__';
38
- exports.RESPONSE_PASSTHROUGH_METADATA = '__responsePassthrough__';
39
- exports.SSE_METADATA = '__sse__';
40
- exports.VERSION_METADATA = '__version__';
41
- exports.INJECTABLE_WATERMARK = '__injectable__';
42
- exports.CONTROLLER_WATERMARK = '__controller__';
43
- exports.CATCH_WATERMARK = '__catch__';
44
- exports.ENTRY_PROVIDER_WATERMARK = '__entryProvider__';
30
+ export const RENDER_METADATA = '__renderTemplate__';
31
+ export const HTTP_CODE_METADATA = '__httpCode__';
32
+ export const MODULE_PATH = '__module_path__';
33
+ export const HEADERS_METADATA = '__headers__';
34
+ export const REDIRECT_METADATA = '__redirect__';
35
+ export const RESPONSE_PASSTHROUGH_METADATA = '__responsePassthrough__';
36
+ export const SSE_METADATA = '__sse__';
37
+ export const VERSION_METADATA = '__version__';
38
+ export const INJECTABLE_WATERMARK = '__injectable__';
39
+ export const CONTROLLER_WATERMARK = '__controller__';
40
+ export const CATCH_WATERMARK = '__catch__';
41
+ export const ENTRY_PROVIDER_WATERMARK = '__entryProvider__';
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyDecorators = applyDecorators;
4
1
  /**
5
2
  * Function that returns a new decorator that applies all decorators provided by param
6
3
  *
@@ -10,7 +7,7 @@ exports.applyDecorators = applyDecorators;
10
7
  *
11
8
  * @publicApi
12
9
  */
13
- function applyDecorators(...decorators) {
10
+ export function applyDecorators(...decorators) {
14
11
  return (target, propertyKey, descriptor) => {
15
12
  for (const decorator of decorators) {
16
13
  if (target instanceof Function && !descriptor) {
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Bind = Bind;
4
1
  /**
5
2
  * Decorator that binds *parameter decorators* to the method that follows.
6
3
  *
@@ -11,7 +8,7 @@ exports.Bind = Bind;
11
8
  *
12
9
  * @publicApi
13
10
  */
14
- function Bind(...decorators) {
11
+ export function Bind(...decorators) {
15
12
  return (target, key, descriptor) => {
16
13
  decorators.forEach((fn, index) => fn(target, key, index));
17
14
  return descriptor;
@@ -1,4 +1,4 @@
1
- import { Type, Abstract } from '../../interfaces';
1
+ import { Type, Abstract } from '../../interfaces/index.js';
2
2
  /**
3
3
  * Decorator that marks a class as a Nest exception filter. An exception filter
4
4
  * handles exceptions thrown by or not handled by your application code.
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Catch = Catch;
4
- const constants_1 = require("../../constants");
1
+ import { CATCH_WATERMARK, FILTER_CATCH_EXCEPTIONS } from '../../constants.js';
5
2
  /**
6
3
  * Decorator that marks a class as a Nest exception filter. An exception filter
7
4
  * handles exceptions thrown by or not handled by your application code.
@@ -19,9 +16,9 @@ const constants_1 = require("../../constants");
19
16
  *
20
17
  * @publicApi
21
18
  */
22
- function Catch(...exceptions) {
19
+ export function Catch(...exceptions) {
23
20
  return (target) => {
24
- Reflect.defineMetadata(constants_1.CATCH_WATERMARK, true, target);
25
- Reflect.defineMetadata(constants_1.FILTER_CATCH_EXCEPTIONS, exceptions, target);
21
+ Reflect.defineMetadata(CATCH_WATERMARK, true, target);
22
+ Reflect.defineMetadata(FILTER_CATCH_EXCEPTIONS, exceptions, target);
26
23
  };
27
24
  }
@@ -1,4 +1,4 @@
1
- import { ScopeOptions, VersionOptions } from '../../interfaces';
1
+ import { ScopeOptions, VersionOptions } from '../../interfaces/index.js';
2
2
  /**
3
3
  * Interface defining options that can be passed to `@Controller()` decorator
4
4
  *
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Controller = Controller;
4
- const constants_1 = require("../../constants");
5
- const shared_utils_1 = require("../../utils/shared.utils");
1
+ import { CONTROLLER_WATERMARK, HOST_METADATA, PATH_METADATA, SCOPE_OPTIONS_METADATA, VERSION_METADATA, } from '../../constants.js';
2
+ import { isString, isUndefined } from '../../utils/shared.utils.js';
6
3
  /**
7
4
  * Decorator that marks a class as a Nest controller that can receive inbound
8
5
  * requests and produce responses.
@@ -37,11 +34,11 @@ const shared_utils_1 = require("../../utils/shared.utils");
37
34
  *
38
35
  * @publicApi
39
36
  */
40
- function Controller(prefixOrOptions) {
37
+ export function Controller(prefixOrOptions) {
41
38
  const defaultPath = '/';
42
- const [path, host, scopeOptions, versionOptions] = (0, shared_utils_1.isUndefined)(prefixOrOptions)
39
+ const [path, host, scopeOptions, versionOptions] = isUndefined(prefixOrOptions)
43
40
  ? [defaultPath, undefined, undefined, undefined]
44
- : (0, shared_utils_1.isString)(prefixOrOptions) || Array.isArray(prefixOrOptions)
41
+ : isString(prefixOrOptions) || Array.isArray(prefixOrOptions)
45
42
  ? [prefixOrOptions, undefined, undefined, undefined]
46
43
  : [
47
44
  prefixOrOptions.path || defaultPath,
@@ -52,10 +49,10 @@ function Controller(prefixOrOptions) {
52
49
  : prefixOrOptions.version,
53
50
  ];
54
51
  return (target) => {
55
- Reflect.defineMetadata(constants_1.CONTROLLER_WATERMARK, true, target);
56
- Reflect.defineMetadata(constants_1.PATH_METADATA, path, target);
57
- Reflect.defineMetadata(constants_1.HOST_METADATA, host, target);
58
- Reflect.defineMetadata(constants_1.SCOPE_OPTIONS_METADATA, scopeOptions, target);
59
- Reflect.defineMetadata(constants_1.VERSION_METADATA, versionOptions, target);
52
+ Reflect.defineMetadata(CONTROLLER_WATERMARK, true, target);
53
+ Reflect.defineMetadata(PATH_METADATA, path, target);
54
+ Reflect.defineMetadata(HOST_METADATA, host, target);
55
+ Reflect.defineMetadata(SCOPE_OPTIONS_METADATA, scopeOptions, target);
56
+ Reflect.defineMetadata(VERSION_METADATA, versionOptions, target);
60
57
  };
61
58
  }
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Dependencies = void 0;
4
- exports.flatten = flatten;
5
- const constants_1 = require("../../constants");
6
- function flatten(arr) {
1
+ import { PARAMTYPES_METADATA } from '../../constants.js';
2
+ export function flatten(arr) {
7
3
  const flat = [].concat(...arr);
8
4
  return flat.some(Array.isArray)
9
5
  ? flatten(flat)
@@ -14,10 +10,9 @@ function flatten(arr) {
14
10
  *
15
11
  * @publicApi
16
12
  */
17
- const Dependencies = (...dependencies) => {
13
+ export const Dependencies = (...dependencies) => {
18
14
  const flattenDeps = flatten(dependencies);
19
15
  return (target) => {
20
- Reflect.defineMetadata(constants_1.PARAMTYPES_METADATA, flattenDeps, target);
16
+ Reflect.defineMetadata(PARAMTYPES_METADATA, flattenDeps, target);
21
17
  };
22
18
  };
23
- exports.Dependencies = Dependencies;
@@ -1,4 +1,4 @@
1
- import { ExceptionFilter } from '../../index';
1
+ import { ExceptionFilter } from '../../index.js';
2
2
  /**
3
3
  * Decorator that binds exception filters to the scope of the controller or
4
4
  * method, depending on its context.
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UseFilters = void 0;
4
- const constants_1 = require("../../constants");
5
- const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
6
- const shared_utils_1 = require("../../utils/shared.utils");
7
- const validate_each_util_1 = require("../../utils/validate-each.util");
1
+ import { EXCEPTION_FILTERS_METADATA } from '../../constants.js';
2
+ import { extendArrayMetadata } from '../../utils/extend-metadata.util.js';
3
+ import { isFunction } from '../../utils/shared.utils.js';
4
+ import { validateEach } from '../../utils/validate-each.util.js';
8
5
  /**
9
6
  * Decorator that binds exception filters to the scope of the controller or
10
7
  * method, depending on its context.
@@ -26,18 +23,17 @@ const validate_each_util_1 = require("../../utils/validate-each.util");
26
23
  *
27
24
  * @publicApi
28
25
  */
29
- const UseFilters = (...filters) => addExceptionFiltersMetadata(...filters);
30
- exports.UseFilters = UseFilters;
26
+ export const UseFilters = (...filters) => addExceptionFiltersMetadata(...filters);
31
27
  function addExceptionFiltersMetadata(...filters) {
32
28
  return (target, key, descriptor) => {
33
- const isFilterValid = (filter) => filter && ((0, shared_utils_1.isFunction)(filter) || (0, shared_utils_1.isFunction)(filter.catch));
29
+ const isFilterValid = (filter) => filter && (isFunction(filter) || isFunction(filter.catch));
34
30
  if (descriptor) {
35
- (0, validate_each_util_1.validateEach)(target.constructor, filters, isFilterValid, '@UseFilters', 'filter');
36
- (0, extend_metadata_util_1.extendArrayMetadata)(constants_1.EXCEPTION_FILTERS_METADATA, filters, descriptor.value);
31
+ validateEach(target.constructor, filters, isFilterValid, '@UseFilters', 'filter');
32
+ extendArrayMetadata(EXCEPTION_FILTERS_METADATA, filters, descriptor.value);
37
33
  return descriptor;
38
34
  }
39
- (0, validate_each_util_1.validateEach)(target, filters, isFilterValid, '@UseFilters', 'filter');
40
- (0, extend_metadata_util_1.extendArrayMetadata)(constants_1.EXCEPTION_FILTERS_METADATA, filters, target);
35
+ validateEach(target, filters, isFilterValid, '@UseFilters', 'filter');
36
+ extendArrayMetadata(EXCEPTION_FILTERS_METADATA, filters, target);
41
37
  return target;
42
38
  };
43
39
  }
@@ -1,14 +1,14 @@
1
- export * from './bind.decorator';
2
- export * from './catch.decorator';
3
- export * from './controller.decorator';
4
- export * from './dependencies.decorator';
5
- export * from './exception-filters.decorator';
6
- export * from './inject.decorator';
7
- export * from './injectable.decorator';
8
- export * from './optional.decorator';
9
- export * from './set-metadata.decorator';
10
- export * from './use-guards.decorator';
11
- export * from './use-interceptors.decorator';
12
- export * from './use-pipes.decorator';
13
- export * from './apply-decorators';
14
- export * from './version.decorator';
1
+ export * from './bind.decorator.js';
2
+ export * from './catch.decorator.js';
3
+ export * from './controller.decorator.js';
4
+ export * from './dependencies.decorator.js';
5
+ export * from './exception-filters.decorator.js';
6
+ export * from './inject.decorator.js';
7
+ export * from './injectable.decorator.js';
8
+ export * from './optional.decorator.js';
9
+ export * from './set-metadata.decorator.js';
10
+ export * from './use-guards.decorator.js';
11
+ export * from './use-interceptors.decorator.js';
12
+ export * from './use-pipes.decorator.js';
13
+ export * from './apply-decorators.js';
14
+ export * from './version.decorator.js';
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./bind.decorator"), exports);
5
- tslib_1.__exportStar(require("./catch.decorator"), exports);
6
- tslib_1.__exportStar(require("./controller.decorator"), exports);
7
- tslib_1.__exportStar(require("./dependencies.decorator"), exports);
8
- tslib_1.__exportStar(require("./exception-filters.decorator"), exports);
9
- tslib_1.__exportStar(require("./inject.decorator"), exports);
10
- tslib_1.__exportStar(require("./injectable.decorator"), exports);
11
- tslib_1.__exportStar(require("./optional.decorator"), exports);
12
- tslib_1.__exportStar(require("./set-metadata.decorator"), exports);
13
- tslib_1.__exportStar(require("./use-guards.decorator"), exports);
14
- tslib_1.__exportStar(require("./use-interceptors.decorator"), exports);
15
- tslib_1.__exportStar(require("./use-pipes.decorator"), exports);
16
- tslib_1.__exportStar(require("./apply-decorators"), exports);
17
- tslib_1.__exportStar(require("./version.decorator"), exports);
1
+ export * from './bind.decorator.js';
2
+ export * from './catch.decorator.js';
3
+ export * from './controller.decorator.js';
4
+ export * from './dependencies.decorator.js';
5
+ export * from './exception-filters.decorator.js';
6
+ export * from './inject.decorator.js';
7
+ export * from './injectable.decorator.js';
8
+ export * from './optional.decorator.js';
9
+ export * from './set-metadata.decorator.js';
10
+ export * from './use-guards.decorator.js';
11
+ export * from './use-interceptors.decorator.js';
12
+ export * from './use-pipes.decorator.js';
13
+ export * from './apply-decorators.js';
14
+ export * from './version.decorator.js';
@@ -1,4 +1,4 @@
1
- import { ForwardReference, InjectionToken } from '../../interfaces';
1
+ import { ForwardReference, InjectionToken } from '../../interfaces/index.js';
2
2
  /**
3
3
  * Decorator that marks a constructor parameter as a target for
4
4
  * [Dependency Injection (DI)](https://docs.nestjs.com/providers#dependency-injection).
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Inject = Inject;
4
- const constants_1 = require("../../constants");
5
- const shared_utils_1 = require("../../utils/shared.utils");
1
+ import { PARAMTYPES_METADATA, PROPERTY_DEPS_METADATA, SELF_DECLARED_DEPS_METADATA, } from '../../constants.js';
2
+ import { isUndefined } from '../../utils/shared.utils.js';
6
3
  /**
7
4
  * Decorator that marks a constructor parameter as a target for
8
5
  * [Dependency Injection (DI)](https://docs.nestjs.com/providers#dependency-injection).
@@ -32,22 +29,22 @@ const shared_utils_1 = require("../../utils/shared.utils");
32
29
  *
33
30
  * @publicApi
34
31
  */
35
- function Inject(token) {
32
+ export function Inject(token) {
36
33
  const injectCallHasArguments = arguments.length > 0;
37
34
  return (target, key, index) => {
38
35
  let type = token || Reflect.getMetadata('design:type', target, key);
39
36
  // Try to infer the token in a constructor-based injection
40
37
  if (!type && !injectCallHasArguments) {
41
- type = Reflect.getMetadata(constants_1.PARAMTYPES_METADATA, target, key)?.[index];
38
+ type = Reflect.getMetadata(PARAMTYPES_METADATA, target, key)?.[index];
42
39
  }
43
- if (!(0, shared_utils_1.isUndefined)(index)) {
44
- let dependencies = Reflect.getMetadata(constants_1.SELF_DECLARED_DEPS_METADATA, target) || [];
40
+ if (!isUndefined(index)) {
41
+ let dependencies = Reflect.getMetadata(SELF_DECLARED_DEPS_METADATA, target) || [];
45
42
  dependencies = [...dependencies, { index, param: type }];
46
- Reflect.defineMetadata(constants_1.SELF_DECLARED_DEPS_METADATA, dependencies, target);
43
+ Reflect.defineMetadata(SELF_DECLARED_DEPS_METADATA, dependencies, target);
47
44
  return;
48
45
  }
49
- let properties = Reflect.getMetadata(constants_1.PROPERTY_DEPS_METADATA, target.constructor) || [];
46
+ let properties = Reflect.getMetadata(PROPERTY_DEPS_METADATA, target.constructor) || [];
50
47
  properties = [...properties, { key, type }];
51
- Reflect.defineMetadata(constants_1.PROPERTY_DEPS_METADATA, properties, target.constructor);
48
+ Reflect.defineMetadata(PROPERTY_DEPS_METADATA, properties, target.constructor);
52
49
  };
53
50
  }
@@ -1,5 +1,5 @@
1
- import { ScopeOptions } from '../../interfaces/scope-options.interface';
2
- import { Type } from '../../interfaces/type.interface';
1
+ import { ScopeOptions } from '../../interfaces/scope-options.interface.js';
2
+ import { Type } from '../../interfaces/type.interface.js';
3
3
  /**
4
4
  * Defines the injection scope.
5
5
  *
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Injectable = Injectable;
4
- exports.mixin = mixin;
5
- const uid_1 = require("uid");
6
- const constants_1 = require("../../constants");
1
+ import { uid } from 'uid';
2
+ import { INJECTABLE_WATERMARK, SCOPE_OPTIONS_METADATA, } from '../../constants.js';
7
3
  /**
8
4
  * Decorator that marks a class as a [provider](https://docs.nestjs.com/providers).
9
5
  * Providers can be injected into other classes via constructor parameter injection
@@ -32,18 +28,18 @@ const constants_1 = require("../../constants");
32
28
  *
33
29
  * @publicApi
34
30
  */
35
- function Injectable(options) {
31
+ export function Injectable(options) {
36
32
  return (target) => {
37
- Reflect.defineMetadata(constants_1.INJECTABLE_WATERMARK, true, target);
38
- Reflect.defineMetadata(constants_1.SCOPE_OPTIONS_METADATA, options, target);
33
+ Reflect.defineMetadata(INJECTABLE_WATERMARK, true, target);
34
+ Reflect.defineMetadata(SCOPE_OPTIONS_METADATA, options, target);
39
35
  };
40
36
  }
41
37
  /**
42
38
  * @publicApi
43
39
  */
44
- function mixin(mixinClass) {
40
+ export function mixin(mixinClass) {
45
41
  Object.defineProperty(mixinClass, 'name', {
46
- value: (0, uid_1.uid)(21),
42
+ value: uid(21),
47
43
  });
48
44
  Injectable()(mixinClass);
49
45
  return mixinClass;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Optional = Optional;
4
- const constants_1 = require("../../constants");
5
- const shared_utils_1 = require("../../utils/shared.utils");
1
+ import { OPTIONAL_DEPS_METADATA, OPTIONAL_PROPERTY_DEPS_METADATA, } from '../../constants.js';
2
+ import { isUndefined } from '../../utils/shared.utils.js';
6
3
  /**
7
4
  * Parameter decorator for an injected dependency marking the
8
5
  * dependency as optional.
@@ -16,14 +13,14 @@ const shared_utils_1 = require("../../utils/shared.utils");
16
13
  *
17
14
  * @publicApi
18
15
  */
19
- function Optional() {
16
+ export function Optional() {
20
17
  return (target, key, index) => {
21
- if (!(0, shared_utils_1.isUndefined)(index)) {
22
- const args = Reflect.getMetadata(constants_1.OPTIONAL_DEPS_METADATA, target) || [];
23
- Reflect.defineMetadata(constants_1.OPTIONAL_DEPS_METADATA, [...args, index], target);
18
+ if (!isUndefined(index)) {
19
+ const args = Reflect.getMetadata(OPTIONAL_DEPS_METADATA, target) || [];
20
+ Reflect.defineMetadata(OPTIONAL_DEPS_METADATA, [...args, index], target);
24
21
  return;
25
22
  }
26
- const properties = Reflect.getMetadata(constants_1.OPTIONAL_PROPERTY_DEPS_METADATA, target.constructor) || [];
27
- Reflect.defineMetadata(constants_1.OPTIONAL_PROPERTY_DEPS_METADATA, [...properties, key], target.constructor);
23
+ const properties = Reflect.getMetadata(OPTIONAL_PROPERTY_DEPS_METADATA, target.constructor) || [];
24
+ Reflect.defineMetadata(OPTIONAL_PROPERTY_DEPS_METADATA, [...properties, key], target.constructor);
28
25
  };
29
26
  }
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetMetadata = void 0;
4
1
  /**
5
2
  * Decorator that assigns metadata to the class/function using the
6
3
  * specified `key`.
@@ -17,7 +14,7 @@ exports.SetMetadata = void 0;
17
14
  *
18
15
  * @publicApi
19
16
  */
20
- const SetMetadata = (metadataKey, metadataValue) => {
17
+ export const SetMetadata = (metadataKey, metadataValue) => {
21
18
  const decoratorFactory = (target, key, descriptor) => {
22
19
  if (descriptor) {
23
20
  Reflect.defineMetadata(metadataKey, metadataValue, descriptor.value);
@@ -29,4 +26,3 @@ const SetMetadata = (metadataKey, metadataValue) => {
29
26
  decoratorFactory.KEY = metadataKey;
30
27
  return decoratorFactory;
31
28
  };
32
- exports.SetMetadata = SetMetadata;
@@ -1,4 +1,4 @@
1
- import { CanActivate } from '../../interfaces';
1
+ import { CanActivate } from '../../interfaces/index.js';
2
2
  /**
3
3
  * Decorator that binds guards to the scope of the controller or method,
4
4
  * depending on its context.
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UseGuards = UseGuards;
4
- const constants_1 = require("../../constants");
5
- const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
6
- const shared_utils_1 = require("../../utils/shared.utils");
7
- const validate_each_util_1 = require("../../utils/validate-each.util");
1
+ import { GUARDS_METADATA } from '../../constants.js';
2
+ import { extendArrayMetadata } from '../../utils/extend-metadata.util.js';
3
+ import { isFunction } from '../../utils/shared.utils.js';
4
+ import { validateEach } from '../../utils/validate-each.util.js';
8
5
  /**
9
6
  * Decorator that binds guards to the scope of the controller or method,
10
7
  * depending on its context.
@@ -26,16 +23,16 @@ const validate_each_util_1 = require("../../utils/validate-each.util");
26
23
  *
27
24
  * @publicApi
28
25
  */
29
- function UseGuards(...guards) {
26
+ export function UseGuards(...guards) {
30
27
  return (target, key, descriptor) => {
31
- const isGuardValid = (guard) => guard && ((0, shared_utils_1.isFunction)(guard) || (0, shared_utils_1.isFunction)(guard.canActivate));
28
+ const isGuardValid = (guard) => guard && (isFunction(guard) || isFunction(guard.canActivate));
32
29
  if (descriptor) {
33
- (0, validate_each_util_1.validateEach)(target.constructor, guards, isGuardValid, '@UseGuards', 'guard');
34
- (0, extend_metadata_util_1.extendArrayMetadata)(constants_1.GUARDS_METADATA, guards, descriptor.value);
30
+ validateEach(target.constructor, guards, isGuardValid, '@UseGuards', 'guard');
31
+ extendArrayMetadata(GUARDS_METADATA, guards, descriptor.value);
35
32
  return descriptor;
36
33
  }
37
- (0, validate_each_util_1.validateEach)(target, guards, isGuardValid, '@UseGuards', 'guard');
38
- (0, extend_metadata_util_1.extendArrayMetadata)(constants_1.GUARDS_METADATA, guards, target);
34
+ validateEach(target, guards, isGuardValid, '@UseGuards', 'guard');
35
+ extendArrayMetadata(GUARDS_METADATA, guards, target);
39
36
  return target;
40
37
  };
41
38
  }
@@ -1,4 +1,4 @@
1
- import { NestInterceptor } from '../../interfaces';
1
+ import { NestInterceptor } from '../../interfaces/index.js';
2
2
  /**
3
3
  * Decorator that binds interceptors to the scope of the controller or method,
4
4
  * depending on its context.
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UseInterceptors = UseInterceptors;
4
- const constants_1 = require("../../constants");
5
- const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
6
- const shared_utils_1 = require("../../utils/shared.utils");
7
- const validate_each_util_1 = require("../../utils/validate-each.util");
1
+ import { INTERCEPTORS_METADATA } from '../../constants.js';
2
+ import { extendArrayMetadata } from '../../utils/extend-metadata.util.js';
3
+ import { isFunction } from '../../utils/shared.utils.js';
4
+ import { validateEach } from '../../utils/validate-each.util.js';
8
5
  /**
9
6
  * Decorator that binds interceptors to the scope of the controller or method,
10
7
  * depending on its context.
@@ -26,17 +23,17 @@ const validate_each_util_1 = require("../../utils/validate-each.util");
26
23
  *
27
24
  * @publicApi
28
25
  */
29
- function UseInterceptors(...interceptors) {
26
+ export function UseInterceptors(...interceptors) {
30
27
  return (target, key, descriptor) => {
31
28
  const isInterceptorValid = (interceptor) => interceptor &&
32
- ((0, shared_utils_1.isFunction)(interceptor) || (0, shared_utils_1.isFunction)(interceptor.intercept));
29
+ (isFunction(interceptor) || isFunction(interceptor.intercept));
33
30
  if (descriptor) {
34
- (0, validate_each_util_1.validateEach)(target.constructor, interceptors, isInterceptorValid, '@UseInterceptors', 'interceptor');
35
- (0, extend_metadata_util_1.extendArrayMetadata)(constants_1.INTERCEPTORS_METADATA, interceptors, descriptor.value);
31
+ validateEach(target.constructor, interceptors, isInterceptorValid, '@UseInterceptors', 'interceptor');
32
+ extendArrayMetadata(INTERCEPTORS_METADATA, interceptors, descriptor.value);
36
33
  return descriptor;
37
34
  }
38
- (0, validate_each_util_1.validateEach)(target, interceptors, isInterceptorValid, '@UseInterceptors', 'interceptor');
39
- (0, extend_metadata_util_1.extendArrayMetadata)(constants_1.INTERCEPTORS_METADATA, interceptors, target);
35
+ validateEach(target, interceptors, isInterceptorValid, '@UseInterceptors', 'interceptor');
36
+ extendArrayMetadata(INTERCEPTORS_METADATA, interceptors, target);
40
37
  return target;
41
38
  };
42
39
  }
@@ -1,4 +1,4 @@
1
- import { PipeTransform } from '../../interfaces/index';
1
+ import { PipeTransform } from '../../interfaces/index.js';
2
2
  /**
3
3
  * Decorator that binds pipes to the scope of the controller or method,
4
4
  * depending on its context.
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UsePipes = UsePipes;
4
- const constants_1 = require("../../constants");
5
- const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
6
- const shared_utils_1 = require("../../utils/shared.utils");
7
- const validate_each_util_1 = require("../../utils/validate-each.util");
1
+ import { PIPES_METADATA } from '../../constants.js';
2
+ import { extendArrayMetadata } from '../../utils/extend-metadata.util.js';
3
+ import { isFunction } from '../../utils/shared.utils.js';
4
+ import { validateEach } from '../../utils/validate-each.util.js';
8
5
  /**
9
6
  * Decorator that binds pipes to the scope of the controller or method,
10
7
  * depending on its context.
@@ -26,15 +23,15 @@ const validate_each_util_1 = require("../../utils/validate-each.util");
26
23
  *
27
24
  * @publicApi
28
25
  */
29
- function UsePipes(...pipes) {
26
+ export function UsePipes(...pipes) {
30
27
  return (target, key, descriptor) => {
31
- const isPipeValid = (pipe) => pipe && ((0, shared_utils_1.isFunction)(pipe) || (0, shared_utils_1.isFunction)(pipe.transform));
28
+ const isPipeValid = (pipe) => pipe && (isFunction(pipe) || isFunction(pipe.transform));
32
29
  if (descriptor) {
33
- (0, extend_metadata_util_1.extendArrayMetadata)(constants_1.PIPES_METADATA, pipes, descriptor.value);
30
+ extendArrayMetadata(PIPES_METADATA, pipes, descriptor.value);
34
31
  return descriptor;
35
32
  }
36
- (0, validate_each_util_1.validateEach)(target, pipes, isPipeValid, '@UsePipes', 'pipe');
37
- (0, extend_metadata_util_1.extendArrayMetadata)(constants_1.PIPES_METADATA, pipes, target);
33
+ validateEach(target, pipes, isPipeValid, '@UsePipes', 'pipe');
34
+ extendArrayMetadata(PIPES_METADATA, pipes, target);
38
35
  return target;
39
36
  };
40
37
  }
@@ -1,4 +1,4 @@
1
- import { VersionValue } from '../../interfaces/version-options.interface';
1
+ import { VersionValue } from '../../interfaces/version-options.interface.js';
2
2
  /**
3
3
  * Sets the version of the endpoint to the passed version
4
4
  *