@depup/nestjs__core 11.2.2-depup.0 → 12.0.1-depup.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 (359) hide show
  1. package/README.md +2 -2
  2. package/adapters/http-adapter.d.ts +5 -3
  3. package/adapters/http-adapter.js +8 -5
  4. package/adapters/index.d.ts +1 -1
  5. package/adapters/index.js +1 -4
  6. package/application-config.d.ts +13 -4
  7. package/application-config.js +34 -15
  8. package/changes.json +1 -1
  9. package/constants.d.ts +1 -1
  10. package/constants.js +10 -13
  11. package/discovery/discoverable-meta-host-collection.d.ts +3 -3
  12. package/discovery/discoverable-meta-host-collection.js +15 -19
  13. package/discovery/discovery-module.js +9 -12
  14. package/discovery/discovery-service.d.ts +4 -4
  15. package/discovery/discovery-service.js +17 -19
  16. package/discovery/index.d.ts +2 -2
  17. package/discovery/index.js +2 -5
  18. package/errors/exception-handler.js +3 -7
  19. package/errors/exceptions/circular-dependency.exception.d.ts +1 -1
  20. package/errors/exceptions/circular-dependency.exception.js +2 -6
  21. package/errors/exceptions/index.d.ts +9 -8
  22. package/errors/exceptions/index.js +9 -11
  23. package/errors/exceptions/invalid-class-module.exception.d.ts +1 -1
  24. package/errors/exceptions/invalid-class-module.exception.js +4 -8
  25. package/errors/exceptions/invalid-class-scope.exception.d.ts +2 -2
  26. package/errors/exceptions/invalid-class-scope.exception.js +6 -10
  27. package/errors/exceptions/invalid-class.exception.d.ts +1 -1
  28. package/errors/exceptions/invalid-class.exception.js +4 -8
  29. package/errors/exceptions/invalid-exception-filter.exception.d.ts +1 -1
  30. package/errors/exceptions/invalid-exception-filter.exception.js +4 -8
  31. package/errors/exceptions/invalid-middleware-configuration.exception.d.ts +1 -1
  32. package/errors/exceptions/invalid-middleware-configuration.exception.js +4 -8
  33. package/errors/exceptions/invalid-middleware.exception.d.ts +1 -1
  34. package/errors/exceptions/invalid-middleware.exception.js +4 -8
  35. package/errors/exceptions/invalid-module.exception.d.ts +1 -1
  36. package/errors/exceptions/invalid-module.exception.js +4 -8
  37. package/errors/exceptions/route-conflict.exception.d.ts +4 -0
  38. package/errors/exceptions/route-conflict.exception.js +7 -0
  39. package/errors/exceptions/runtime.exception.js +1 -5
  40. package/errors/exceptions/undefined-dependency.exception.d.ts +3 -3
  41. package/errors/exceptions/undefined-dependency.exception.js +4 -8
  42. package/errors/exceptions/undefined-forwardref.exception.d.ts +2 -2
  43. package/errors/exceptions/undefined-forwardref.exception.js +4 -8
  44. package/errors/exceptions/undefined-module.exception.d.ts +1 -1
  45. package/errors/exceptions/undefined-module.exception.js +4 -8
  46. package/errors/exceptions/unknown-dependencies.exception.d.ts +3 -3
  47. package/errors/exceptions/unknown-dependencies.exception.js +8 -8
  48. package/errors/exceptions/unknown-element.exception.d.ts +1 -1
  49. package/errors/exceptions/unknown-element.exception.js +2 -6
  50. package/errors/exceptions/unknown-export.exception.d.ts +1 -1
  51. package/errors/exceptions/unknown-export.exception.js +4 -8
  52. package/errors/exceptions/unknown-module.exception.d.ts +1 -1
  53. package/errors/exceptions/unknown-module.exception.js +2 -6
  54. package/errors/exceptions/unknown-request-mapping.exception.d.ts +1 -1
  55. package/errors/exceptions/unknown-request-mapping.exception.js +4 -8
  56. package/errors/exceptions-zone.js +6 -10
  57. package/errors/messages.d.ts +5 -2
  58. package/errors/messages.js +26 -32
  59. package/exceptions/base-exception-filter-context.d.ts +6 -7
  60. package/exceptions/base-exception-filter-context.js +13 -16
  61. package/exceptions/base-exception-filter.d.ts +4 -4
  62. package/exceptions/base-exception-filter.js +38 -23
  63. package/exceptions/exceptions-handler.d.ts +4 -4
  64. package/exceptions/exceptions-handler.js +8 -16
  65. package/exceptions/external-exception-filter-context.d.ts +8 -8
  66. package/exceptions/external-exception-filter-context.js +14 -18
  67. package/exceptions/external-exception-filter.d.ts +1 -1
  68. package/exceptions/external-exception-filter.js +4 -8
  69. package/exceptions/external-exceptions-handler.d.ts +3 -3
  70. package/exceptions/external-exceptions-handler.js +8 -16
  71. package/exceptions/index.d.ts +1 -1
  72. package/exceptions/index.js +1 -4
  73. package/guards/constants.js +1 -4
  74. package/guards/guards-consumer.d.ts +4 -3
  75. package/guards/guards-consumer.js +8 -12
  76. package/guards/guards-context-creator.d.ts +11 -10
  77. package/guards/guards-context-creator.js +18 -20
  78. package/guards/index.d.ts +3 -3
  79. package/guards/index.js +3 -6
  80. package/helpers/barrier.js +5 -5
  81. package/helpers/context-creator.d.ts +2 -2
  82. package/helpers/context-creator.js +3 -7
  83. package/helpers/context-id-factory.d.ts +1 -1
  84. package/helpers/context-id-factory.js +10 -14
  85. package/helpers/context-utils.d.ts +6 -3
  86. package/helpers/context-utils.js +7 -12
  87. package/helpers/execution-context-host.d.ts +3 -3
  88. package/helpers/execution-context-host.js +5 -6
  89. package/helpers/external-context-creator.d.ts +15 -18
  90. package/helpers/external-context-creator.js +54 -43
  91. package/helpers/external-proxy.d.ts +2 -2
  92. package/helpers/external-proxy.js +3 -7
  93. package/helpers/get-class-scope.d.ts +2 -2
  94. package/helpers/get-class-scope.js +3 -6
  95. package/helpers/handler-metadata-storage.d.ts +4 -4
  96. package/helpers/handler-metadata-storage.js +7 -15
  97. package/helpers/http-adapter-host.d.ts +1 -1
  98. package/helpers/http-adapter-host.js +6 -11
  99. package/helpers/index.d.ts +3 -3
  100. package/helpers/index.js +3 -6
  101. package/helpers/interfaces/external-handler-metadata.interface.d.ts +2 -2
  102. package/helpers/interfaces/external-handler-metadata.interface.js +1 -2
  103. package/helpers/interfaces/index.d.ts +2 -2
  104. package/helpers/interfaces/index.js +2 -5
  105. package/helpers/interfaces/params-metadata.interface.d.ts +1 -1
  106. package/helpers/interfaces/params-metadata.interface.js +1 -2
  107. package/helpers/is-durable.d.ts +1 -1
  108. package/helpers/is-durable.js +3 -6
  109. package/helpers/load-adapter.d.ts +1 -1
  110. package/helpers/load-adapter.js +5 -8
  111. package/helpers/messages.d.ts +1 -1
  112. package/helpers/messages.js +10 -20
  113. package/helpers/optional-require.d.ts +1 -1
  114. package/helpers/optional-require.js +2 -5
  115. package/helpers/rethrow.js +1 -5
  116. package/helpers/router-method-factory.d.ts +2 -2
  117. package/helpers/router-method-factory.js +21 -25
  118. package/helpers/safe-instance-decorator.js +3 -6
  119. package/hooks/before-app-shutdown.hook.d.ts +3 -3
  120. package/hooks/before-app-shutdown.hook.js +25 -23
  121. package/hooks/index.d.ts +5 -5
  122. package/hooks/index.js +5 -8
  123. package/hooks/on-app-bootstrap.hook.d.ts +3 -3
  124. package/hooks/on-app-bootstrap.hook.js +15 -22
  125. package/hooks/on-app-shutdown.hook.d.ts +3 -3
  126. package/hooks/on-app-shutdown.hook.js +25 -23
  127. package/hooks/on-module-destroy.hook.d.ts +3 -3
  128. package/hooks/on-module-destroy.hook.js +25 -23
  129. package/hooks/on-module-init.hook.d.ts +3 -3
  130. package/hooks/on-module-init.hook.js +15 -22
  131. package/hooks/utils/get-instances-grouped-by-hierarchy-level.d.ts +3 -0
  132. package/hooks/utils/get-instances-grouped-by-hierarchy-level.js +27 -0
  133. package/hooks/utils/get-sorted-hierarchy-levels.d.ts +1 -0
  134. package/hooks/utils/get-sorted-hierarchy-levels.js +7 -0
  135. package/index.d.ts +16 -16
  136. package/index.js +17 -26
  137. package/injector/abstract-instance-resolver.d.ts +6 -6
  138. package/injector/abstract-instance-resolver.js +7 -11
  139. package/injector/compiler.d.ts +2 -2
  140. package/injector/compiler.js +2 -5
  141. package/injector/constants.d.ts +1 -1
  142. package/injector/constants.js +2 -5
  143. package/injector/container.d.ts +13 -14
  144. package/injector/container.js +40 -40
  145. package/injector/helpers/provider-classifier.d.ts +1 -1
  146. package/injector/helpers/provider-classifier.js +5 -10
  147. package/injector/helpers/silent-logger.js +9 -16
  148. package/injector/index.d.ts +6 -6
  149. package/injector/index.js +5 -8
  150. package/injector/injector.d.ts +7 -6
  151. package/injector/injector.js +98 -87
  152. package/injector/inquirer/index.d.ts +1 -1
  153. package/injector/inquirer/index.js +1 -4
  154. package/injector/inquirer/inquirer-constants.js +1 -4
  155. package/injector/inquirer/inquirer-providers.d.ts +1 -1
  156. package/injector/inquirer/inquirer-providers.js +5 -8
  157. package/injector/instance-links-host.d.ts +3 -3
  158. package/injector/instance-links-host.js +8 -11
  159. package/injector/instance-loader.d.ts +5 -5
  160. package/injector/instance-loader.js +11 -11
  161. package/injector/instance-wrapper.d.ts +8 -5
  162. package/injector/instance-wrapper.js +95 -76
  163. package/injector/internal-core-module/index.d.ts +1 -1
  164. package/injector/internal-core-module/index.js +1 -4
  165. package/injector/internal-core-module/internal-core-module-factory.d.ts +6 -6
  166. package/injector/internal-core-module/internal-core-module-factory.js +23 -27
  167. package/injector/internal-core-module/internal-core-module.d.ts +2 -2
  168. package/injector/internal-core-module/internal-core-module.js +17 -20
  169. package/injector/internal-providers-storage.d.ts +2 -2
  170. package/injector/internal-providers-storage.js +4 -9
  171. package/injector/lazy-module-loader/lazy-module-loader-options.interface.js +1 -2
  172. package/injector/lazy-module-loader/lazy-module-loader.d.ts +8 -8
  173. package/injector/lazy-module-loader/lazy-module-loader.js +10 -9
  174. package/injector/module-ref.d.ts +7 -7
  175. package/injector/module-ref.js +30 -35
  176. package/injector/module.d.ts +5 -5
  177. package/injector/module.js +96 -82
  178. package/injector/modules-container.d.ts +1 -1
  179. package/injector/modules-container.js +5 -12
  180. package/injector/opaque-key-factory/by-reference-module-opaque-key-factory.d.ts +2 -4
  181. package/injector/opaque-key-factory/by-reference-module-opaque-key-factory.js +6 -9
  182. package/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.d.ts +2 -3
  183. package/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.js +17 -22
  184. package/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.d.ts +1 -3
  185. package/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.js +1 -2
  186. package/injector/settlement-signal.js +5 -7
  187. package/injector/topology-tree/topology-tree.d.ts +1 -1
  188. package/injector/topology-tree/topology-tree.js +6 -9
  189. package/injector/topology-tree/tree-node.js +4 -6
  190. package/inspector/deterministic-uuid-registry.js +2 -6
  191. package/inspector/graph-inspector.d.ts +7 -7
  192. package/inspector/graph-inspector.js +10 -12
  193. package/inspector/index.d.ts +4 -4
  194. package/inspector/index.js +4 -7
  195. package/inspector/initialize-on-preview.allowlist.d.ts +1 -1
  196. package/inspector/initialize-on-preview.allowlist.js +2 -6
  197. package/inspector/interfaces/edge.interface.d.ts +1 -1
  198. package/inspector/interfaces/edge.interface.js +1 -2
  199. package/inspector/interfaces/enhancer-metadata-cache-entry.interface.d.ts +3 -3
  200. package/inspector/interfaces/enhancer-metadata-cache-entry.interface.js +1 -2
  201. package/inspector/interfaces/entrypoint.interface.d.ts +2 -2
  202. package/inspector/interfaces/entrypoint.interface.js +1 -2
  203. package/inspector/interfaces/extras.interface.d.ts +1 -1
  204. package/inspector/interfaces/extras.interface.js +1 -2
  205. package/inspector/interfaces/node.interface.d.ts +2 -2
  206. package/inspector/interfaces/node.interface.js +1 -2
  207. package/inspector/interfaces/serialized-graph-json.interface.d.ts +6 -6
  208. package/inspector/interfaces/serialized-graph-json.interface.js +1 -2
  209. package/inspector/interfaces/serialized-graph-metadata.interface.d.ts +1 -1
  210. package/inspector/interfaces/serialized-graph-metadata.interface.js +1 -2
  211. package/inspector/noop-graph-inspector.d.ts +1 -1
  212. package/inspector/noop-graph-inspector.js +2 -5
  213. package/inspector/partial-graph.host.d.ts +2 -2
  214. package/inspector/partial-graph.host.js +2 -5
  215. package/inspector/serialized-graph.d.ts +7 -7
  216. package/inspector/serialized-graph.js +35 -40
  217. package/inspector/uuid-factory.js +8 -12
  218. package/interceptors/index.d.ts +2 -2
  219. package/interceptors/index.js +2 -5
  220. package/interceptors/interceptors-consumer.d.ts +4 -3
  221. package/interceptors/interceptors-consumer.js +14 -18
  222. package/interceptors/interceptors-context-creator.d.ts +10 -9
  223. package/interceptors/interceptors-context-creator.js +18 -20
  224. package/interfaces/index.d.ts +2 -0
  225. package/interfaces/index.js +2 -0
  226. package/interfaces/module-definition.interface.d.ts +2 -2
  227. package/interfaces/module-definition.interface.js +1 -2
  228. package/interfaces/module-override.interface.d.ts +1 -1
  229. package/interfaces/module-override.interface.js +1 -2
  230. package/internal.d.ts +42 -0
  231. package/internal.js +50 -0
  232. package/metadata-scanner.d.ts +1 -1
  233. package/metadata-scanner.js +8 -14
  234. package/middleware/builder.d.ts +4 -4
  235. package/middleware/builder.js +82 -80
  236. package/middleware/container.d.ts +4 -4
  237. package/middleware/container.js +10 -13
  238. package/middleware/index.d.ts +1 -1
  239. package/middleware/index.js +1 -4
  240. package/middleware/middleware-module.d.ts +8 -9
  241. package/middleware/middleware-module.js +49 -46
  242. package/middleware/resolver.d.ts +3 -3
  243. package/middleware/resolver.js +3 -5
  244. package/middleware/route-info-path-extractor.d.ts +2 -2
  245. package/middleware/route-info-path-extractor.js +26 -25
  246. package/middleware/routes-mapper.d.ts +4 -3
  247. package/middleware/routes-mapper.js +22 -24
  248. package/middleware/utils.d.ts +3 -2
  249. package/middleware/utils.js +34 -45
  250. package/nest-application-context.d.ts +10 -9
  251. package/nest-application-context.js +50 -40
  252. package/nest-application.d.ts +19 -11
  253. package/nest-application.js +168 -65
  254. package/nest-factory.d.ts +4 -5
  255. package/nest-factory.js +61 -68
  256. package/package.json +17 -9
  257. package/pipes/index.d.ts +3 -3
  258. package/pipes/index.js +3 -6
  259. package/pipes/params-token-factory.d.ts +2 -2
  260. package/pipes/params-token-factory.js +5 -9
  261. package/pipes/pipes-consumer.d.ts +3 -7
  262. package/pipes/pipes-consumer.js +17 -18
  263. package/pipes/pipes-context-creator.d.ts +10 -9
  264. package/pipes/pipes-context-creator.js +18 -20
  265. package/repl/assign-to-object.util.js +1 -4
  266. package/repl/constants.js +1 -4
  267. package/repl/index.d.ts +1 -1
  268. package/repl/index.js +1 -4
  269. package/repl/native-functions/debug-repl-fn.d.ts +2 -2
  270. package/repl/native-functions/debug-repl-fn.js +14 -21
  271. package/repl/native-functions/get-repl-fn.d.ts +2 -2
  272. package/repl/native-functions/get-repl-fn.js +8 -15
  273. package/repl/native-functions/help-repl-fn.d.ts +2 -2
  274. package/repl/native-functions/help-repl-fn.js +13 -20
  275. package/repl/native-functions/index.d.ts +6 -6
  276. package/repl/native-functions/index.js +6 -9
  277. package/repl/native-functions/methods-repl-fn.d.ts +2 -2
  278. package/repl/native-functions/methods-repl-fn.js +12 -19
  279. package/repl/native-functions/resolve-repl-fn.d.ts +2 -2
  280. package/repl/native-functions/resolve-repl-fn.js +7 -14
  281. package/repl/native-functions/select-relp-fn.d.ts +2 -2
  282. package/repl/native-functions/select-relp-fn.js +7 -14
  283. package/repl/repl-context.d.ts +3 -3
  284. package/repl/repl-context.js +21 -23
  285. package/repl/repl-function.d.ts +3 -3
  286. package/repl/repl-function.js +5 -7
  287. package/repl/repl-logger.js +10 -14
  288. package/repl/repl-native-commands.js +1 -4
  289. package/repl/repl.d.ts +1 -1
  290. package/repl/repl.interfaces.d.ts +2 -2
  291. package/repl/repl.interfaces.js +1 -2
  292. package/repl/repl.js +17 -20
  293. package/router/index.d.ts +3 -3
  294. package/router/index.js +3 -8
  295. package/router/interfaces/exceptions-filter.interface.d.ts +3 -3
  296. package/router/interfaces/exceptions-filter.interface.js +1 -2
  297. package/router/interfaces/exclude-route-metadata.interface.d.ts +1 -1
  298. package/router/interfaces/exclude-route-metadata.interface.js +1 -2
  299. package/router/interfaces/index.d.ts +4 -1
  300. package/router/interfaces/index.js +4 -4
  301. package/router/interfaces/resolved-route.interface.d.ts +32 -0
  302. package/router/interfaces/resolved-route.interface.js +1 -0
  303. package/router/interfaces/resolver.interface.d.ts +5 -1
  304. package/router/interfaces/resolver.interface.js +1 -2
  305. package/router/interfaces/route-conflict.interface.d.ts +14 -0
  306. package/router/interfaces/route-conflict.interface.js +1 -0
  307. package/router/interfaces/route-params-factory.interface.d.ts +1 -1
  308. package/router/interfaces/route-params-factory.interface.js +1 -2
  309. package/router/interfaces/route-path-metadata.interface.d.ts +2 -2
  310. package/router/interfaces/route-path-metadata.interface.js +1 -2
  311. package/router/interfaces/route-resolution-options.interface.d.ts +24 -0
  312. package/router/interfaces/route-resolution-options.interface.js +1 -0
  313. package/router/interfaces/routes.interface.d.ts +1 -1
  314. package/router/interfaces/routes.interface.js +1 -2
  315. package/router/legacy-route-converter.js +3 -7
  316. package/router/paths-explorer.d.ts +4 -5
  317. package/router/paths-explorer.js +11 -15
  318. package/router/request/index.d.ts +1 -1
  319. package/router/request/index.js +1 -5
  320. package/router/request/request-constants.js +2 -5
  321. package/router/request/request-providers.d.ts +1 -1
  322. package/router/request/request-providers.js +5 -8
  323. package/router/route-conflict-detector.d.ts +71 -0
  324. package/router/route-conflict-detector.js +276 -0
  325. package/router/route-params-factory.d.ts +2 -2
  326. package/router/route-params-factory.js +15 -19
  327. package/router/route-path-factory.d.ts +4 -4
  328. package/router/route-path-factory.js +19 -22
  329. package/router/route-specificity-sorter.d.ts +23 -0
  330. package/router/route-specificity-sorter.js +59 -0
  331. package/router/router-exception-filters.d.ts +9 -9
  332. package/router/router-exception-filters.js +15 -18
  333. package/router/router-execution-context.d.ts +17 -20
  334. package/router/router-execution-context.js +62 -55
  335. package/router/router-explorer.d.ts +25 -18
  336. package/router/router-explorer.js +116 -73
  337. package/router/router-module.d.ts +4 -4
  338. package/router/router-module.js +21 -23
  339. package/router/router-proxy.d.ts +1 -1
  340. package/router/router-proxy.js +4 -8
  341. package/router/router-response-controller.d.ts +2 -2
  342. package/router/router-response-controller.js +23 -27
  343. package/router/routes-resolver.d.ts +13 -11
  344. package/router/routes-resolver.js +42 -55
  345. package/router/sse-stream.d.ts +1 -1
  346. package/router/sse-stream.js +19 -22
  347. package/router/utils/exclude-route.util.d.ts +1 -1
  348. package/router/utils/exclude-route.util.js +7 -12
  349. package/router/utils/flatten-route-paths.util.d.ts +2 -2
  350. package/router/utils/flatten-route-paths.util.js +4 -7
  351. package/router/utils/index.d.ts +2 -2
  352. package/router/utils/index.js +2 -5
  353. package/scanner.d.ts +11 -11
  354. package/scanner.js +66 -67
  355. package/services/index.d.ts +1 -1
  356. package/services/index.js +1 -4
  357. package/services/reflector.service.d.ts +1 -1
  358. package/services/reflector.service.js +9 -13
  359. package/tsconfig.build.json +1 -9
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InvalidMiddlewareException = void 0;
4
- const messages_1 = require("../messages");
5
- const runtime_exception_1 = require("./runtime.exception");
6
- class InvalidMiddlewareException extends runtime_exception_1.RuntimeException {
1
+ import { INVALID_MIDDLEWARE_MESSAGE } from '../messages.js';
2
+ import { RuntimeException } from './runtime.exception.js';
3
+ export class InvalidMiddlewareException extends RuntimeException {
7
4
  constructor(name) {
8
- super((0, messages_1.INVALID_MIDDLEWARE_MESSAGE) `${name}`);
5
+ super(INVALID_MIDDLEWARE_MESSAGE `${name}`);
9
6
  }
10
7
  }
11
- exports.InvalidMiddlewareException = InvalidMiddlewareException;
@@ -1,4 +1,4 @@
1
- import { RuntimeException } from './runtime.exception';
1
+ import { RuntimeException } from './runtime.exception.js';
2
2
  export declare class InvalidModuleException extends RuntimeException {
3
3
  constructor(parentModule: any, index: number, scope: any[], receivedValue: unknown);
4
4
  }
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InvalidModuleException = void 0;
4
- const messages_1 = require("../messages");
5
- const runtime_exception_1 = require("./runtime.exception");
6
- class InvalidModuleException extends runtime_exception_1.RuntimeException {
1
+ import { INVALID_MODULE_MESSAGE } from '../messages.js';
2
+ import { RuntimeException } from './runtime.exception.js';
3
+ export class InvalidModuleException extends RuntimeException {
7
4
  constructor(parentModule, index, scope, receivedValue) {
8
- super((0, messages_1.INVALID_MODULE_MESSAGE)(parentModule, index, scope, receivedValue));
5
+ super(INVALID_MODULE_MESSAGE(parentModule, index, scope, receivedValue));
9
6
  }
10
7
  }
11
- exports.InvalidModuleException = InvalidModuleException;
@@ -0,0 +1,4 @@
1
+ import { RuntimeException } from './runtime.exception.js';
2
+ export declare class RouteConflictException extends RuntimeException {
3
+ constructor(messages: string[]);
4
+ }
@@ -0,0 +1,7 @@
1
+ import { ROUTE_CONFLICT_MESSAGE } from '../messages.js';
2
+ import { RuntimeException } from './runtime.exception.js';
3
+ export class RouteConflictException extends RuntimeException {
4
+ constructor(messages) {
5
+ super(ROUTE_CONFLICT_MESSAGE(messages));
6
+ }
7
+ }
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RuntimeException = void 0;
4
- class RuntimeException extends Error {
1
+ export class RuntimeException extends Error {
5
2
  constructor(message = ``) {
6
3
  super(message);
7
4
  }
@@ -9,4 +6,3 @@ class RuntimeException extends Error {
9
6
  return this.message;
10
7
  }
11
8
  }
12
- exports.RuntimeException = RuntimeException;
@@ -1,6 +1,6 @@
1
- import { InjectorDependencyContext } from '../../injector/injector';
2
- import { Module } from '../../injector/module';
3
- import { RuntimeException } from './runtime.exception';
1
+ import { InjectorDependencyContext } from '../../injector/injector.js';
2
+ import { Module } from '../../injector/module.js';
3
+ import { RuntimeException } from './runtime.exception.js';
4
4
  export declare class UndefinedDependencyException extends RuntimeException {
5
5
  constructor(type: string, undefinedDependencyContext: InjectorDependencyContext, moduleRef?: Module);
6
6
  }
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UndefinedDependencyException = void 0;
4
- const messages_1 = require("../messages");
5
- const runtime_exception_1 = require("./runtime.exception");
6
- class UndefinedDependencyException extends runtime_exception_1.RuntimeException {
1
+ import { UNKNOWN_DEPENDENCIES_MESSAGE } from '../messages.js';
2
+ import { RuntimeException } from './runtime.exception.js';
3
+ export class UndefinedDependencyException extends RuntimeException {
7
4
  constructor(type, undefinedDependencyContext, moduleRef) {
8
- super((0, messages_1.UNKNOWN_DEPENDENCIES_MESSAGE)(type, undefinedDependencyContext, moduleRef));
5
+ super(UNKNOWN_DEPENDENCIES_MESSAGE(type, undefinedDependencyContext, moduleRef));
9
6
  }
10
7
  }
11
- exports.UndefinedDependencyException = UndefinedDependencyException;
@@ -1,5 +1,5 @@
1
- import { RuntimeException } from './runtime.exception';
2
- import { Type } from '@nestjs/common';
1
+ import { RuntimeException } from './runtime.exception.js';
2
+ import type { Type } from '@nestjs/common';
3
3
  export declare class UndefinedForwardRefException extends RuntimeException {
4
4
  constructor(scope: Type<any>[]);
5
5
  }
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UndefinedForwardRefException = void 0;
4
- const messages_1 = require("../messages");
5
- const runtime_exception_1 = require("./runtime.exception");
6
- class UndefinedForwardRefException extends runtime_exception_1.RuntimeException {
1
+ import { UNDEFINED_FORWARDREF_MESSAGE } from '../messages.js';
2
+ import { RuntimeException } from './runtime.exception.js';
3
+ export class UndefinedForwardRefException extends RuntimeException {
7
4
  constructor(scope) {
8
- super((0, messages_1.UNDEFINED_FORWARDREF_MESSAGE)(scope));
5
+ super(UNDEFINED_FORWARDREF_MESSAGE(scope));
9
6
  }
10
7
  }
11
- exports.UndefinedForwardRefException = UndefinedForwardRefException;
@@ -1,4 +1,4 @@
1
- import { RuntimeException } from './runtime.exception';
1
+ import { RuntimeException } from './runtime.exception.js';
2
2
  export declare class UndefinedModuleException extends RuntimeException {
3
3
  constructor(parentModule: any, index: number, scope: any[]);
4
4
  }
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UndefinedModuleException = void 0;
4
- const runtime_exception_1 = require("./runtime.exception");
5
- const messages_1 = require("../messages");
6
- class UndefinedModuleException extends runtime_exception_1.RuntimeException {
1
+ import { RuntimeException } from './runtime.exception.js';
2
+ import { UNDEFINED_MODULE_MESSAGE } from '../messages.js';
3
+ export class UndefinedModuleException extends RuntimeException {
7
4
  constructor(parentModule, index, scope) {
8
- super((0, messages_1.UNDEFINED_MODULE_MESSAGE)(parentModule, index, scope));
5
+ super(UNDEFINED_MODULE_MESSAGE(parentModule, index, scope));
9
6
  }
10
7
  }
11
- exports.UndefinedModuleException = UndefinedModuleException;
@@ -1,6 +1,6 @@
1
- import { InjectorDependencyContext } from '../../injector/injector';
2
- import { Module } from '../../injector/module';
3
- import { RuntimeException } from './runtime.exception';
1
+ import { InjectorDependencyContext } from '../../injector/injector.js';
2
+ import { Module } from '../../injector/module.js';
3
+ import { RuntimeException } from './runtime.exception.js';
4
4
  export declare class UnknownDependenciesException extends RuntimeException {
5
5
  readonly type: string | symbol;
6
6
  readonly context: InjectorDependencyContext;
@@ -1,15 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnknownDependenciesException = void 0;
4
- const messages_1 = require("../messages");
5
- const runtime_exception_1 = require("./runtime.exception");
6
- class UnknownDependenciesException extends runtime_exception_1.RuntimeException {
1
+ import { UNKNOWN_DEPENDENCIES_MESSAGE } from '../messages.js';
2
+ import { RuntimeException } from './runtime.exception.js';
3
+ export class UnknownDependenciesException extends RuntimeException {
4
+ type;
5
+ context;
6
+ metadata;
7
+ moduleRef;
7
8
  constructor(type, context, moduleRef, metadata) {
8
- super((0, messages_1.UNKNOWN_DEPENDENCIES_MESSAGE)(type, context, moduleRef));
9
+ super(UNKNOWN_DEPENDENCIES_MESSAGE(type, context, moduleRef));
9
10
  this.type = type;
10
11
  this.context = context;
11
12
  this.metadata = metadata;
12
13
  this.moduleRef = moduleRef && { id: moduleRef.id };
13
14
  }
14
15
  }
15
- exports.UnknownDependenciesException = UnknownDependenciesException;
@@ -1,4 +1,4 @@
1
- import { RuntimeException } from './runtime.exception';
1
+ import { RuntimeException } from './runtime.exception.js';
2
2
  export declare class UnknownElementException extends RuntimeException {
3
3
  constructor(name?: string | symbol);
4
4
  }
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnknownElementException = void 0;
4
- const runtime_exception_1 = require("./runtime.exception");
5
- class UnknownElementException extends runtime_exception_1.RuntimeException {
1
+ import { RuntimeException } from './runtime.exception.js';
2
+ export class UnknownElementException extends RuntimeException {
6
3
  constructor(name) {
7
4
  name = name && name.toString();
8
5
  super(`Nest could not find ${name || 'given'} element (this provider does not exist in the current context)`);
9
6
  }
10
7
  }
11
- exports.UnknownElementException = UnknownElementException;
@@ -1,4 +1,4 @@
1
- import { RuntimeException } from './runtime.exception';
1
+ import { RuntimeException } from './runtime.exception.js';
2
2
  export declare class UnknownExportException extends RuntimeException {
3
3
  constructor(token: string | symbol, moduleName: string);
4
4
  }
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnknownExportException = void 0;
4
- const messages_1 = require("../messages");
5
- const runtime_exception_1 = require("./runtime.exception");
6
- class UnknownExportException extends runtime_exception_1.RuntimeException {
1
+ import { UNKNOWN_EXPORT_MESSAGE } from '../messages.js';
2
+ import { RuntimeException } from './runtime.exception.js';
3
+ export class UnknownExportException extends RuntimeException {
7
4
  constructor(token, moduleName) {
8
- super((0, messages_1.UNKNOWN_EXPORT_MESSAGE)(token, moduleName));
5
+ super(UNKNOWN_EXPORT_MESSAGE(token, moduleName));
9
6
  }
10
7
  }
11
- exports.UnknownExportException = UnknownExportException;
@@ -1,4 +1,4 @@
1
- import { RuntimeException } from './runtime.exception';
1
+ import { RuntimeException } from './runtime.exception.js';
2
2
  export declare class UnknownModuleException extends RuntimeException {
3
3
  constructor(moduleName?: string);
4
4
  }
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnknownModuleException = void 0;
4
- const runtime_exception_1 = require("./runtime.exception");
5
- class UnknownModuleException extends runtime_exception_1.RuntimeException {
1
+ import { RuntimeException } from './runtime.exception.js';
2
+ export class UnknownModuleException extends RuntimeException {
6
3
  constructor(moduleName) {
7
4
  super(`Nest could not select the given module (${moduleName ? `"${moduleName}"` : 'it'} does not exist in current context).`);
8
5
  }
9
6
  }
10
- exports.UnknownModuleException = UnknownModuleException;
@@ -1,5 +1,5 @@
1
1
  import type { Type } from '@nestjs/common';
2
- import { RuntimeException } from './runtime.exception';
2
+ import { RuntimeException } from './runtime.exception.js';
3
3
  export declare class UnknownRequestMappingException extends RuntimeException {
4
4
  constructor(metatype: Type);
5
5
  }
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnknownRequestMappingException = void 0;
4
- const runtime_exception_1 = require("./runtime.exception");
5
- const messages_1 = require("../messages");
6
- class UnknownRequestMappingException extends runtime_exception_1.RuntimeException {
1
+ import { RuntimeException } from './runtime.exception.js';
2
+ import { UNKNOWN_REQUEST_MAPPING } from '../messages.js';
3
+ export class UnknownRequestMappingException extends RuntimeException {
7
4
  constructor(metatype) {
8
- super((0, messages_1.UNKNOWN_REQUEST_MAPPING)(metatype));
5
+ super(UNKNOWN_REQUEST_MAPPING(metatype));
9
6
  }
10
7
  }
11
- exports.UnknownRequestMappingException = UnknownRequestMappingException;
@@ -1,10 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExceptionsZone = void 0;
4
- const common_1 = require("@nestjs/common");
5
- const exception_handler_1 = require("./exception-handler");
1
+ import { Logger } from '@nestjs/common';
2
+ import { ExceptionHandler } from './exception-handler.js';
6
3
  const DEFAULT_TEARDOWN = () => process.exit(1);
7
- class ExceptionsZone {
4
+ export class ExceptionsZone {
5
+ static exceptionHandler = new ExceptionHandler();
8
6
  static run(callback, teardown = DEFAULT_TEARDOWN, autoFlushLogs) {
9
7
  try {
10
8
  callback();
@@ -12,7 +10,7 @@ class ExceptionsZone {
12
10
  catch (e) {
13
11
  this.exceptionHandler.handle(e);
14
12
  if (autoFlushLogs) {
15
- common_1.Logger.flush();
13
+ Logger.flush();
16
14
  }
17
15
  teardown(e);
18
16
  }
@@ -24,11 +22,9 @@ class ExceptionsZone {
24
22
  catch (e) {
25
23
  this.exceptionHandler.handle(e);
26
24
  if (autoFlushLogs) {
27
- common_1.Logger.flush();
25
+ Logger.flush();
28
26
  }
29
27
  teardown(e);
30
28
  }
31
29
  }
32
30
  }
33
- exports.ExceptionsZone = ExceptionsZone;
34
- ExceptionsZone.exceptionHandler = new exception_handler_1.ExceptionHandler();
@@ -1,6 +1,6 @@
1
1
  import type { ForwardReference, Type } from '@nestjs/common';
2
- import { InjectorDependencyContext } from '../injector/injector';
3
- import { Module } from '../injector/module';
2
+ import { InjectorDependencyContext } from '../injector/injector.js';
3
+ import { Module } from '../injector/module.js';
4
4
  export declare const UNKNOWN_DEPENDENCIES_MESSAGE: (type: string | symbol, unknownDependencyContext: InjectorDependencyContext, moduleRef: Module | undefined) => string;
5
5
  export declare const INVALID_MIDDLEWARE_MESSAGE: (text: TemplateStringsArray, name: string) => string;
6
6
  export declare const UNDEFINED_FORWARDREF_MESSAGE: (scope: Type<any>[]) => string;
@@ -11,6 +11,9 @@ export declare const UNKNOWN_EXPORT_MESSAGE: (token: string | symbol | undefined
11
11
  export declare const INVALID_CLASS_MESSAGE: (text: TemplateStringsArray, value: any) => string;
12
12
  export declare const INVALID_CLASS_SCOPE_MESSAGE: (text: TemplateStringsArray, name: string | undefined) => string;
13
13
  export declare const UNKNOWN_REQUEST_MAPPING: (metatype: Type) => string;
14
+ export declare const ROUTE_CONFLICT_MESSAGE: (messages: string[]) => string;
15
+ export declare const DUPLICATE_ROUTE_MESSAGE: (method: string, path: string, firstHandlerLabel: string, secondHandlerLabel: string) => string;
16
+ export declare const SHADOWED_ROUTE_MESSAGE: (method: string, shadowedPath: string, shadowedHandlerLabel: string, winnerPath: string, winnerHandlerLabel: string) => string;
14
17
  export declare const INVALID_MIDDLEWARE_CONFIGURATION = "An invalid middleware configuration has been passed inside the module 'configure()' method.";
15
18
  export declare const UNHANDLED_RUNTIME_EXCEPTION = "Unhandled Runtime Exception.";
16
19
  export declare const INVALID_EXCEPTION_FILTER = "Invalid exception filters (@UseFilters()).";
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MICROSERVICES_PACKAGE_NOT_FOUND_EXCEPTION = exports.INVALID_EXCEPTION_FILTER = exports.UNHANDLED_RUNTIME_EXCEPTION = exports.INVALID_MIDDLEWARE_CONFIGURATION = exports.UNKNOWN_REQUEST_MAPPING = exports.INVALID_CLASS_SCOPE_MESSAGE = exports.INVALID_CLASS_MESSAGE = exports.UNKNOWN_EXPORT_MESSAGE = exports.UNDEFINED_MODULE_MESSAGE = exports.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = exports.INVALID_MODULE_MESSAGE = exports.UNDEFINED_FORWARDREF_MESSAGE = exports.INVALID_MIDDLEWARE_MESSAGE = exports.UNKNOWN_DEPENDENCIES_MESSAGE = void 0;
4
- const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
1
+ import { isNil, isSymbol } from '@nestjs/common/internal';
5
2
  /**
6
3
  * Returns the name of an instance or `undefined`
7
4
  * @param instance The instance which should get the name from
@@ -28,7 +25,7 @@ const getDependencyName = (dependency, fallbackValue, disambiguated = true) =>
28
25
  // use class name
29
26
  getInstanceName(dependency) ||
30
27
  // use injection token (symbol)
31
- ((0, shared_utils_1.isSymbol)(dependency) && dependency.toString()) ||
28
+ (isSymbol(dependency) && dependency.toString()) ||
32
29
  // use string directly
33
30
  (dependency
34
31
  ? disambiguated
@@ -44,11 +41,11 @@ getInstanceName(dependency) ||
44
41
  */
45
42
  const getModuleName = (module) => (module && getInstanceName(module.metatype)) || 'current';
46
43
  const stringifyScope = (scope) => (scope || []).map(getInstanceName).join(' -> ');
47
- const UNKNOWN_DEPENDENCIES_MESSAGE = (type, unknownDependencyContext, moduleRef) => {
44
+ export const UNKNOWN_DEPENDENCIES_MESSAGE = (type, unknownDependencyContext, moduleRef) => {
48
45
  const { index, name, dependencies, key } = unknownDependencyContext;
49
46
  const moduleName = getModuleName(moduleRef);
50
47
  const dependencyName = getDependencyName(name, 'dependency');
51
- const isImportTypeIssue = !(0, shared_utils_1.isNil)(index) &&
48
+ const isImportTypeIssue = !isNil(index) &&
52
49
  dependencies &&
53
50
  (dependencies[index] === undefined ||
54
51
  dependencies[index] === Object ||
@@ -93,7 +90,7 @@ Potential solutions:
93
90
  For more common dependency resolution issues, see: https://docs.nestjs.com/faq/common-errors`;
94
91
  }
95
92
  let message = `Nest can't resolve dependencies of the ${type.toString()}`;
96
- if ((0, shared_utils_1.isNil)(index)) {
93
+ if (isNil(index)) {
97
94
  message += `. Please make sure that the "${key.toString()}" property is available in the current context.${potentialSolutions}`;
98
95
  return message;
99
96
  }
@@ -108,16 +105,13 @@ For more common dependency resolution issues, see: https://docs.nestjs.com/faq/c
108
105
  message += potentialSolutions;
109
106
  return message;
110
107
  };
111
- exports.UNKNOWN_DEPENDENCIES_MESSAGE = UNKNOWN_DEPENDENCIES_MESSAGE;
112
- const INVALID_MIDDLEWARE_MESSAGE = (text, name) => `The middleware doesn't provide the 'use' method (${name})`;
113
- exports.INVALID_MIDDLEWARE_MESSAGE = INVALID_MIDDLEWARE_MESSAGE;
114
- const UNDEFINED_FORWARDREF_MESSAGE = (scope) => `Nest cannot create the module instance. Often, this is because of a circular dependency between modules. Use forwardRef() to avoid it.
108
+ export const INVALID_MIDDLEWARE_MESSAGE = (text, name) => `The middleware doesn't provide the 'use' method (${name})`;
109
+ export const UNDEFINED_FORWARDREF_MESSAGE = (scope) => `Nest cannot create the module instance. Often, this is because of a circular dependency between modules. Use forwardRef() to avoid it.
115
110
 
116
111
  (Read more: https://docs.nestjs.com/fundamentals/circular-dependency)
117
112
  Scope [${stringifyScope(scope)}]
118
113
  `;
119
- exports.UNDEFINED_FORWARDREF_MESSAGE = UNDEFINED_FORWARDREF_MESSAGE;
120
- const INVALID_MODULE_MESSAGE = (parentModule, index, scope, receivedValue) => {
114
+ export const INVALID_MODULE_MESSAGE = (parentModule, index, scope, receivedValue) => {
121
115
  const parentModuleName = parentModule?.name || 'module';
122
116
  let formattedValue;
123
117
  let receivedType;
@@ -139,8 +133,7 @@ The received value \`${formattedValue}\` is of type "${receivedType}".
139
133
 
140
134
  Scope [${stringifyScope(scope)}]`;
141
135
  };
142
- exports.INVALID_MODULE_MESSAGE = INVALID_MODULE_MESSAGE;
143
- const USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = (metatypeUsedAsAModule, scope, classKind) => {
136
+ export const USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = (metatypeUsedAsAModule, scope, classKind) => {
144
137
  const metatypeNameQuote = `"${getInstanceName(metatypeUsedAsAModule)}"`;
145
138
  let hint;
146
139
  switch (classKind) {
@@ -159,8 +152,7 @@ const USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = (metatypeUsedAsAModule, scope, c
159
152
  Scope [${stringifyScope(scope)}]
160
153
  `;
161
154
  };
162
- exports.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE = USING_INVALID_CLASS_AS_A_MODULE_MESSAGE;
163
- const UNDEFINED_MODULE_MESSAGE = (parentModule, index, scope) => {
155
+ export const UNDEFINED_MODULE_MESSAGE = (parentModule, index, scope) => {
164
156
  const parentModuleName = parentModule?.name || 'module';
165
157
  return `Nest cannot create the ${parentModuleName} instance.
166
158
  The module at index [${index}] of the ${parentModuleName} "imports" array is undefined.
@@ -171,9 +163,8 @@ Potential causes:
171
163
 
172
164
  Scope [${stringifyScope(scope)}]`;
173
165
  };
174
- exports.UNDEFINED_MODULE_MESSAGE = UNDEFINED_MODULE_MESSAGE;
175
- const UNKNOWN_EXPORT_MESSAGE = (token = 'item', module) => {
176
- token = (0, shared_utils_1.isSymbol)(token) ? token.toString() : token;
166
+ export const UNKNOWN_EXPORT_MESSAGE = (token = 'item', module) => {
167
+ token = isSymbol(token) ? token.toString() : token;
177
168
  return `Nest cannot export a provider/module that is not a part of the currently processed module (${module}). Please verify whether the exported ${token} is available in this particular context.
178
169
 
179
170
  Possible Solutions:
@@ -182,19 +173,22 @@ Possible Solutions:
182
173
  For more common dependency resolution issues, see: https://docs.nestjs.com/faq/common-errors
183
174
  `;
184
175
  };
185
- exports.UNKNOWN_EXPORT_MESSAGE = UNKNOWN_EXPORT_MESSAGE;
186
- const INVALID_CLASS_MESSAGE = (text, value) => `ModuleRef cannot instantiate class (${value} is not constructable).`;
187
- exports.INVALID_CLASS_MESSAGE = INVALID_CLASS_MESSAGE;
188
- const INVALID_CLASS_SCOPE_MESSAGE = (text, name) => `${name || 'This class'} is marked as a scoped provider. Request and transient-scoped providers can't be used in combination with "get()" method. Please, use "resolve()" instead.`;
189
- exports.INVALID_CLASS_SCOPE_MESSAGE = INVALID_CLASS_SCOPE_MESSAGE;
190
- const UNKNOWN_REQUEST_MAPPING = (metatype) => {
176
+ export const INVALID_CLASS_MESSAGE = (text, value) => `ModuleRef cannot instantiate class (${value} is not constructable).`;
177
+ export const INVALID_CLASS_SCOPE_MESSAGE = (text, name) => `${name || 'This class'} is marked as a scoped provider. Request and transient-scoped providers can't be used in combination with "get()" method. Please, use "resolve()" instead.`;
178
+ export const UNKNOWN_REQUEST_MAPPING = (metatype) => {
191
179
  const className = metatype.name;
192
180
  return className
193
181
  ? `An invalid controller has been detected. "${className}" does not have the @Controller() decorator but it is being listed in the "controllers" array of some module.`
194
182
  : `An invalid controller has been detected. Perhaps, one of your controllers is missing the @Controller() decorator.`;
195
183
  };
196
- exports.UNKNOWN_REQUEST_MAPPING = UNKNOWN_REQUEST_MAPPING;
197
- exports.INVALID_MIDDLEWARE_CONFIGURATION = `An invalid middleware configuration has been passed inside the module 'configure()' method.`;
198
- exports.UNHANDLED_RUNTIME_EXCEPTION = `Unhandled Runtime Exception.`;
199
- exports.INVALID_EXCEPTION_FILTER = `Invalid exception filters (@UseFilters()).`;
200
- exports.MICROSERVICES_PACKAGE_NOT_FOUND_EXCEPTION = `Unable to load @nestjs/microservices package. (Please make sure that it's already installed.)`;
184
+ export const ROUTE_CONFLICT_MESSAGE = (messages) => [
185
+ 'Conflicting HTTP routes detected:',
186
+ ...messages.map(message => ` - ${message}`),
187
+ `Adjust route declarations or relax the 'routeConflictPolicy' option passed to NestFactory.create() to allow the application to start.`,
188
+ ].join('\n');
189
+ export const DUPLICATE_ROUTE_MESSAGE = (method, path, firstHandlerLabel, secondHandlerLabel) => `Duplicate route: ${method} ${path} is registered by both ${firstHandlerLabel} and ${secondHandlerLabel}.`;
190
+ export const SHADOWED_ROUTE_MESSAGE = (method, shadowedPath, shadowedHandlerLabel, winnerPath, winnerHandlerLabel) => `Route ${method} ${shadowedPath} (${shadowedHandlerLabel}) is shadowed by ${method} ${winnerPath} (${winnerHandlerLabel}). The first-registered route will match all matching requests on order-sensitive adapters.`;
191
+ export const INVALID_MIDDLEWARE_CONFIGURATION = `An invalid middleware configuration has been passed inside the module 'configure()' method.`;
192
+ export const UNHANDLED_RUNTIME_EXCEPTION = `Unhandled Runtime Exception.`;
193
+ export const INVALID_EXCEPTION_FILTER = `Invalid exception filters (@UseFilters()).`;
194
+ export const MICROSERVICES_PACKAGE_NOT_FOUND_EXCEPTION = `Unable to load @nestjs/microservices package. (Please make sure that it's already installed.)`;
@@ -1,14 +1,13 @@
1
- import { Type } from '@nestjs/common/interfaces';
2
- import { ExceptionFilter } from '@nestjs/common/interfaces/exceptions/exception-filter.interface';
3
- import { ContextCreator } from '../helpers/context-creator';
4
- import { NestContainer } from '../injector/container';
5
- import { InstanceWrapper } from '../injector/instance-wrapper';
1
+ import { ContextCreator } from '../helpers/context-creator.js';
2
+ import { NestContainer } from '../injector/container.js';
3
+ import { InstanceWrapper } from '../injector/instance-wrapper.js';
4
+ import type { Type, ExceptionFilter } from '@nestjs/common';
6
5
  export declare class BaseExceptionFilterContext extends ContextCreator {
7
6
  private readonly container;
8
7
  protected moduleContext: string;
9
8
  constructor(container: NestContainer);
10
- createConcreteContext<T extends any[], R extends any[]>(metadata: T, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): R;
11
- getFilterInstance(filter: Function | ExceptionFilter, contextId?: import("../injector/instance-wrapper").ContextId, inquirerId?: string): ExceptionFilter | null;
9
+ createConcreteContext<T extends any[], R extends any[]>(metadata: T, contextId?: import("../injector/instance-wrapper.js").ContextId, inquirerId?: string): R;
10
+ getFilterInstance(filter: Function | ExceptionFilter, contextId?: import("../injector/instance-wrapper.js").ContextId, inquirerId?: string): ExceptionFilter | null;
12
11
  getInstanceByMetatype(metatype: Type<unknown>): InstanceWrapper | undefined;
13
12
  reflectCatchExceptions(instance: ExceptionFilter): Type<any>[];
14
13
  }
@@ -1,22 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseExceptionFilterContext = void 0;
4
- const constants_1 = require("@nestjs/common/constants");
5
- const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
6
- const iterare_1 = require("iterare");
7
- const context_creator_1 = require("../helpers/context-creator");
8
- const constants_2 = require("../injector/constants");
9
- class BaseExceptionFilterContext extends context_creator_1.ContextCreator {
1
+ import { iterate } from 'iterare';
2
+ import { ContextCreator } from '../helpers/context-creator.js';
3
+ import { STATIC_CONTEXT } from '../injector/constants.js';
4
+ import { FILTER_CATCH_EXCEPTIONS, isEmpty, isFunction, } from '@nestjs/common/internal';
5
+ export class BaseExceptionFilterContext extends ContextCreator {
6
+ container;
7
+ moduleContext;
10
8
  constructor(container) {
11
9
  super();
12
10
  this.container = container;
13
11
  }
14
- createConcreteContext(metadata, contextId = constants_2.STATIC_CONTEXT, inquirerId) {
15
- if ((0, shared_utils_1.isEmpty)(metadata)) {
12
+ createConcreteContext(metadata, contextId = STATIC_CONTEXT, inquirerId) {
13
+ if (isEmpty(metadata)) {
16
14
  return [];
17
15
  }
18
- return (0, iterare_1.iterate)(metadata)
19
- .filter(instance => instance && ((0, shared_utils_1.isFunction)(instance.catch) || instance.name))
16
+ return iterate(metadata)
17
+ .filter(instance => instance && (isFunction(instance.catch) || instance.name))
20
18
  .map(filter => this.getFilterInstance(filter, contextId, inquirerId))
21
19
  .filter(item => !!item)
22
20
  .map(instance => ({
@@ -25,7 +23,7 @@ class BaseExceptionFilterContext extends context_creator_1.ContextCreator {
25
23
  }))
26
24
  .toArray();
27
25
  }
28
- getFilterInstance(filter, contextId = constants_2.STATIC_CONTEXT, inquirerId) {
26
+ getFilterInstance(filter, contextId = STATIC_CONTEXT, inquirerId) {
29
27
  const isObject = !!filter.catch;
30
28
  if (isObject) {
31
29
  return filter;
@@ -50,7 +48,6 @@ class BaseExceptionFilterContext extends context_creator_1.ContextCreator {
50
48
  }
51
49
  reflectCatchExceptions(instance) {
52
50
  const prototype = Object.getPrototypeOf(instance);
53
- return (Reflect.getMetadata(constants_1.FILTER_CATCH_EXCEPTIONS, prototype.constructor) || []);
51
+ return (Reflect.getMetadata(FILTER_CATCH_EXCEPTIONS, prototype.constructor) || []);
54
52
  }
55
53
  }
56
- exports.BaseExceptionFilterContext = BaseExceptionFilterContext;
@@ -1,6 +1,6 @@
1
- import { ArgumentsHost, ExceptionFilter, HttpServer } from '@nestjs/common';
2
- import { AbstractHttpAdapter } from '../adapters';
3
- import { HttpAdapterHost } from '../helpers/http-adapter-host';
1
+ import { type ArgumentsHost, type ExceptionFilter, type HttpServer } from '@nestjs/common';
2
+ import { AbstractHttpAdapter } from '../adapters/index.js';
3
+ import { HttpAdapterHost } from '../helpers/http-adapter-host.js';
4
4
  export declare class BaseExceptionFilter<T = any> implements ExceptionFilter<T> {
5
5
  protected readonly applicationRef?: HttpServer | undefined;
6
6
  private static readonly logger;
@@ -10,7 +10,7 @@ export declare class BaseExceptionFilter<T = any> implements ExceptionFilter<T>
10
10
  handleUnknownError(exception: T, host: ArgumentsHost, applicationRef: AbstractHttpAdapter | HttpServer): void;
11
11
  isExceptionObject(err: any): err is Error;
12
12
  /**
13
- * Checks if the thrown error comes from the "http-errors" library.
13
+ * Checks if the thrown error is a FastifyError or comes from the "http-errors" library.
14
14
  * @param err error object
15
15
  */
16
16
  isHttpError(err: any): err is {