@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
@@ -1,40 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Res = exports.Req = exports.Headers = exports.Session = exports.Ip = exports.Next = exports.Response = exports.Request = void 0;
4
- exports.assignMetadata = assignMetadata;
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(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) ||
17
+ const args = Reflect.getMetadata(ROUTE_ARGS_METADATA, target.constructor, key) ||
28
18
  {};
29
- Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, data), target.constructor, key);
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, ...pipes) => (target, key, index) => {
33
- const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
34
- const hasParamData = (0, shared_utils_1.isNil)(data) || (0, shared_utils_1.isString)(data);
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 ? pipes : [data, ...pipes];
37
- Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, paramData, ...paramPipes), target.constructor, key);
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
- exports.Request = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.REQUEST);
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(constants_1.RESPONSE_PASSTHROUGH_METADATA, options?.passthrough, target.constructor, key);
60
+ Reflect.defineMetadata(RESPONSE_PASSTHROUGH_METADATA, options?.passthrough, target.constructor, key);
63
61
  }
64
- return createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.RESPONSE)()(target, key, index);
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
- exports.Next = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.NEXT);
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
- exports.Ip = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.IP);
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
- exports.Session = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.SESSION);
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(route_paramtypes_enum_1.RouteParamtypes.FILE)(fileKey, ...pipes);
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(route_paramtypes_enum_1.RouteParamtypes.FILES)(undefined, ...pipes);
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
- exports.Headers = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.HEADERS);
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
- return createPipesRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.QUERY)(property, ...pipes);
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
- return createPipesRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.BODY)(property, ...pipes);
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
- return createPipesRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.RAW_BODY)(undefined, ...pipes);
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
- return createPipesRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.PARAM)(property, ...pipes);
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(route_paramtypes_enum_1.RouteParamtypes.HOST)(property);
336
+ export function HostParam(property) {
337
+ return createRouteParamDecorator(RouteParamtypes.HOST)(property);
263
338
  }
264
- exports.Req = exports.Request;
265
- exports.Res = exports.Response;
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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
- [constants_1.METHOD_METADATA]: request_method_enum_1.RequestMethod.GET,
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(constants_1.PATH_METADATA, path, descriptor.value);
17
- Reflect.defineMetadata(constants_1.METHOD_METADATA, options[constants_1.METHOD_METADATA], descriptor.value);
18
- Reflect.defineMetadata(constants_1.SSE_METADATA, true, descriptor.value);
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
  }
@@ -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';
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
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
- "use strict";
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(constants_1.GLOBAL_MODULE_METADATA, true, target);
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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,4 +1,4 @@
1
- import { ModuleMetadata } from '../../interfaces/modules/module-metadata.interface';
1
+ import { ModuleMetadata } from '../../interfaces/modules/module-metadata.interface.js';
2
2
  /**
3
3
  * Decorator that marks a class as a [module](https://docs.nestjs.com/modules).
4
4
  *
@@ -1,7 +1,4 @@
1
- "use strict";
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
- (0, validate_module_keys_util_1.validateModuleKeys)(propsKeys);
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 || (exports.HttpStatus = 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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./request-method.enum"), exports);
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
- "use strict";
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 || (exports.RequestMethod = RequestMethod = {}));
19
+ })(RequestMethod || (RequestMethod = {}));
@@ -1,7 +1,4 @@
1
- "use strict";
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 || (exports.RouteParamtypes = 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 || (exports.ShutdownSignal = 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 || (exports.VersioningType = VersioningType = {}));
10
+ })(VersioningType || (VersioningType = {}));
@@ -1,4 +1,4 @@
1
- import { HttpException, HttpExceptionOptions } from './http.exception';
1
+ import { HttpException, HttpExceptionOptions } from './http.exception.js';
2
2
  /**
3
3
  * Defines an HTTP exception for *Bad Gateway* type errors.
4
4
  *
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 http_exception_1.HttpException {
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 } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
40
- super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.BAD_GATEWAY), http_status_enum_1.HttpStatus.BAD_GATEWAY, httpExceptionOptions);
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,4 +1,4 @@
1
- import { HttpException, HttpExceptionOptions } from './http.exception';
1
+ import { HttpException, HttpExceptionOptions } from './http.exception.js';
2
2
  /**
3
3
  * Defines an HTTP exception for *Bad Request* type errors.
4
4
  *
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 http_exception_1.HttpException {
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 } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
40
- super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.BAD_REQUEST), http_status_enum_1.HttpStatus.BAD_REQUEST, httpExceptionOptions);
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,4 +1,4 @@
1
- import { HttpException, HttpExceptionOptions } from './http.exception';
1
+ import { HttpException, HttpExceptionOptions } from './http.exception.js';
2
2
  /**
3
3
  * Defines an HTTP exception for *Conflict* type errors.
4
4
  *
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 http_exception_1.HttpException {
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 } = http_exception_1.HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
40
- super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.CONFLICT), http_status_enum_1.HttpStatus.CONFLICT, httpExceptionOptions);
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;