@depup/nestjs__core 11.1.17-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 (371) hide show
  1. package/LICENSE +22 -0
  2. package/PACKAGE.md +1 -0
  3. package/README.md +25 -0
  4. package/Readme.md +146 -0
  5. package/adapters/http-adapter.d.ts +80 -0
  6. package/adapters/http-adapter.js +90 -0
  7. package/adapters/index.d.ts +1 -0
  8. package/adapters/index.js +4 -0
  9. package/application-config.d.ts +47 -0
  10. package/application-config.js +107 -0
  11. package/changes.json +5 -0
  12. package/constants.d.ts +14 -0
  13. package/constants.js +21 -0
  14. package/discovery/discoverable-meta-host-collection.d.ts +46 -0
  15. package/discovery/discoverable-meta-host-collection.js +98 -0
  16. package/discovery/discovery-module.d.ts +5 -0
  17. package/discovery/discovery-module.js +19 -0
  18. package/discovery/discovery-service.d.ts +76 -0
  19. package/discovery/discovery-service.js +98 -0
  20. package/discovery/index.d.ts +2 -0
  21. package/discovery/index.js +5 -0
  22. package/errors/exception-handler.d.ts +4 -0
  23. package/errors/exception-handler.js +11 -0
  24. package/errors/exceptions/circular-dependency.exception.d.ts +4 -0
  25. package/errors/exceptions/circular-dependency.exception.js +11 -0
  26. package/errors/exceptions/index.d.ts +8 -0
  27. package/errors/exceptions/index.js +11 -0
  28. package/errors/exceptions/invalid-class-module.exception.d.ts +4 -0
  29. package/errors/exceptions/invalid-class-module.exception.js +11 -0
  30. package/errors/exceptions/invalid-class-scope.exception.d.ts +5 -0
  31. package/errors/exceptions/invalid-class-scope.exception.js +16 -0
  32. package/errors/exceptions/invalid-class.exception.d.ts +4 -0
  33. package/errors/exceptions/invalid-class.exception.js +11 -0
  34. package/errors/exceptions/invalid-exception-filter.exception.d.ts +4 -0
  35. package/errors/exceptions/invalid-exception-filter.exception.js +11 -0
  36. package/errors/exceptions/invalid-middleware-configuration.exception.d.ts +4 -0
  37. package/errors/exceptions/invalid-middleware-configuration.exception.js +11 -0
  38. package/errors/exceptions/invalid-middleware.exception.d.ts +4 -0
  39. package/errors/exceptions/invalid-middleware.exception.js +11 -0
  40. package/errors/exceptions/invalid-module.exception.d.ts +4 -0
  41. package/errors/exceptions/invalid-module.exception.js +11 -0
  42. package/errors/exceptions/runtime.exception.d.ts +4 -0
  43. package/errors/exceptions/runtime.exception.js +12 -0
  44. package/errors/exceptions/undefined-dependency.exception.d.ts +6 -0
  45. package/errors/exceptions/undefined-dependency.exception.js +11 -0
  46. package/errors/exceptions/undefined-forwardref.exception.d.ts +5 -0
  47. package/errors/exceptions/undefined-forwardref.exception.js +11 -0
  48. package/errors/exceptions/undefined-module.exception.d.ts +4 -0
  49. package/errors/exceptions/undefined-module.exception.js +11 -0
  50. package/errors/exceptions/unknown-dependencies.exception.d.ts +16 -0
  51. package/errors/exceptions/unknown-dependencies.exception.js +15 -0
  52. package/errors/exceptions/unknown-element.exception.d.ts +4 -0
  53. package/errors/exceptions/unknown-element.exception.js +11 -0
  54. package/errors/exceptions/unknown-export.exception.d.ts +4 -0
  55. package/errors/exceptions/unknown-export.exception.js +11 -0
  56. package/errors/exceptions/unknown-module.exception.d.ts +4 -0
  57. package/errors/exceptions/unknown-module.exception.js +10 -0
  58. package/errors/exceptions/unknown-request-mapping.exception.d.ts +5 -0
  59. package/errors/exceptions/unknown-request-mapping.exception.js +11 -0
  60. package/errors/exceptions-zone.d.ts +5 -0
  61. package/errors/exceptions-zone.js +34 -0
  62. package/errors/messages.d.ts +17 -0
  63. package/errors/messages.js +174 -0
  64. package/exceptions/base-exception-filter-context.d.ts +14 -0
  65. package/exceptions/base-exception-filter-context.js +56 -0
  66. package/exceptions/base-exception-filter.d.ts +20 -0
  67. package/exceptions/base-exception-filter.js +72 -0
  68. package/exceptions/exceptions-handler.d.ts +10 -0
  69. package/exceptions/exceptions-handler.js +34 -0
  70. package/exceptions/external-exception-filter-context.d.ts +12 -0
  71. package/exceptions/external-exception-filter-context.js +42 -0
  72. package/exceptions/external-exception-filter.d.ts +5 -0
  73. package/exceptions/external-exception-filter.js +15 -0
  74. package/exceptions/external-exceptions-handler.d.ts +9 -0
  75. package/exceptions/external-exceptions-handler.js +34 -0
  76. package/exceptions/index.d.ts +1 -0
  77. package/exceptions/index.js +4 -0
  78. package/guards/constants.d.ts +1 -0
  79. package/guards/constants.js +4 -0
  80. package/guards/guards-consumer.d.ts +9 -0
  81. package/guards/guards-consumer.js +39 -0
  82. package/guards/guards-context-creator.d.ts +17 -0
  83. package/guards/guards-context-creator.js +70 -0
  84. package/guards/index.d.ts +3 -0
  85. package/guards/index.js +6 -0
  86. package/helpers/barrier.d.ts +30 -0
  87. package/helpers/barrier.js +46 -0
  88. package/helpers/context-creator.d.ts +10 -0
  89. package/helpers/context-creator.js +33 -0
  90. package/helpers/context-id-factory.d.ts +41 -0
  91. package/helpers/context-id-factory.js +67 -0
  92. package/helpers/context-utils.d.ts +23 -0
  93. package/helpers/context-utils.js +55 -0
  94. package/helpers/execution-context-host.d.ts +19 -0
  95. package/helpers/execution-context-host.js +50 -0
  96. package/helpers/external-context-creator.d.ts +51 -0
  97. package/helpers/external-context-creator.js +166 -0
  98. package/helpers/external-proxy.d.ts +5 -0
  99. package/helpers/external-proxy.js +19 -0
  100. package/helpers/get-class-scope.d.ts +3 -0
  101. package/helpers/get-class-scope.js +8 -0
  102. package/helpers/handler-metadata-storage.d.ts +27 -0
  103. package/helpers/handler-metadata-storage.js +26 -0
  104. package/helpers/http-adapter-host.d.ts +51 -0
  105. package/helpers/http-adapter-host.js +73 -0
  106. package/helpers/index.d.ts +3 -0
  107. package/helpers/index.js +6 -0
  108. package/helpers/interfaces/external-handler-metadata.interface.d.ts +11 -0
  109. package/helpers/interfaces/external-handler-metadata.interface.js +2 -0
  110. package/helpers/interfaces/index.d.ts +2 -0
  111. package/helpers/interfaces/index.js +5 -0
  112. package/helpers/interfaces/params-metadata.interface.d.ts +6 -0
  113. package/helpers/interfaces/params-metadata.interface.js +2 -0
  114. package/helpers/is-durable.d.ts +2 -0
  115. package/helpers/is-durable.js +8 -0
  116. package/helpers/load-adapter.d.ts +1 -0
  117. package/helpers/load-adapter.js +15 -0
  118. package/helpers/messages.d.ts +7 -0
  119. package/helpers/messages.js +29 -0
  120. package/helpers/optional-require.d.ts +1 -0
  121. package/helpers/optional-require.js +11 -0
  122. package/helpers/rethrow.d.ts +1 -0
  123. package/helpers/rethrow.js +7 -0
  124. package/helpers/router-method-factory.d.ts +23 -0
  125. package/helpers/router-method-factory.js +33 -0
  126. package/hooks/before-app-shutdown.hook.d.ts +9 -0
  127. package/hooks/before-app-shutdown.hook.js +51 -0
  128. package/hooks/index.d.ts +5 -0
  129. package/hooks/index.js +8 -0
  130. package/hooks/on-app-bootstrap.hook.d.ts +8 -0
  131. package/hooks/on-app-bootstrap.hook.js +53 -0
  132. package/hooks/on-app-shutdown.hook.d.ts +9 -0
  133. package/hooks/on-app-shutdown.hook.js +54 -0
  134. package/hooks/on-module-destroy.hook.d.ts +8 -0
  135. package/hooks/on-module-destroy.hook.js +53 -0
  136. package/hooks/on-module-init.hook.d.ts +8 -0
  137. package/hooks/on-module-init.hook.js +53 -0
  138. package/hooks/utils/get-instances-grouped-by-hierarchy-level.d.ts +3 -0
  139. package/hooks/utils/get-instances-grouped-by-hierarchy-level.js +27 -0
  140. package/hooks/utils/get-sorted-hierarchy-levels.d.ts +1 -0
  141. package/hooks/utils/get-sorted-hierarchy-levels.js +7 -0
  142. package/index.d.ts +17 -0
  143. package/index.js +32 -0
  144. package/injector/abstract-instance-resolver.d.ts +16 -0
  145. package/injector/abstract-instance-resolver.js +49 -0
  146. package/injector/compiler.d.ts +18 -0
  147. package/injector/compiler.js +35 -0
  148. package/injector/constants.d.ts +3 -0
  149. package/injector/constants.js +8 -0
  150. package/injector/container.d.ts +67 -0
  151. package/injector/container.js +233 -0
  152. package/injector/helpers/provider-classifier.d.ts +4 -0
  153. package/injector/helpers/provider-classifier.js +16 -0
  154. package/injector/helpers/silent-logger.d.ts +10 -0
  155. package/injector/helpers/silent-logger.js +18 -0
  156. package/injector/helpers/transient-instances.d.ts +12 -0
  157. package/injector/helpers/transient-instances.js +28 -0
  158. package/injector/index.d.ts +6 -0
  159. package/injector/index.js +8 -0
  160. package/injector/injector.d.ts +104 -0
  161. package/injector/injector.js +554 -0
  162. package/injector/inquirer/index.d.ts +1 -0
  163. package/injector/inquirer/index.js +4 -0
  164. package/injector/inquirer/inquirer-constants.d.ts +1 -0
  165. package/injector/inquirer/inquirer-constants.js +4 -0
  166. package/injector/inquirer/inquirer-providers.d.ts +2 -0
  167. package/injector/inquirer/inquirer-providers.js +11 -0
  168. package/injector/instance-links-host.d.ts +22 -0
  169. package/injector/instance-links-host.js +56 -0
  170. package/injector/instance-loader.d.ts +23 -0
  171. package/injector/instance-loader.js +88 -0
  172. package/injector/instance-wrapper.d.ts +99 -0
  173. package/injector/instance-wrapper.js +350 -0
  174. package/injector/internal-core-module/index.d.ts +1 -0
  175. package/injector/internal-core-module/index.js +4 -0
  176. package/injector/internal-core-module/internal-core-module-factory.d.ts +9 -0
  177. package/injector/internal-core-module/internal-core-module-factory.js +52 -0
  178. package/injector/internal-core-module/internal-core-module.d.ts +5 -0
  179. package/injector/internal-core-module/internal-core-module.js +40 -0
  180. package/injector/internal-providers-storage.d.ts +9 -0
  181. package/injector/internal-providers-storage.js +19 -0
  182. package/injector/lazy-module-loader/lazy-module-loader-options.interface.d.ts +6 -0
  183. package/injector/lazy-module-loader/lazy-module-loader-options.interface.js +2 -0
  184. package/injector/lazy-module-loader/lazy-module-loader.d.ts +20 -0
  185. package/injector/lazy-module-loader/lazy-module-loader.js +49 -0
  186. package/injector/module-ref.d.ts +106 -0
  187. package/injector/module-ref.js +66 -0
  188. package/injector/module.d.ts +82 -0
  189. package/injector/module.js +432 -0
  190. package/injector/modules-container.d.ts +27 -0
  191. package/injector/modules-container.js +42 -0
  192. package/injector/opaque-key-factory/by-reference-module-opaque-key-factory.d.ts +15 -0
  193. package/injector/opaque-key-factory/by-reference-module-opaque-key-factory.js +41 -0
  194. package/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.d.ts +15 -0
  195. package/injector/opaque-key-factory/deep-hashed-module-opaque-key-factory.js +83 -0
  196. package/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.d.ts +18 -0
  197. package/injector/opaque-key-factory/interfaces/module-opaque-key-factory.interface.js +2 -0
  198. package/injector/settlement-signal.d.ts +37 -0
  199. package/injector/settlement-signal.js +55 -0
  200. package/injector/topology-tree/topology-tree.d.ts +8 -0
  201. package/injector/topology-tree/topology-tree.js +51 -0
  202. package/injector/topology-tree/tree-node.d.ts +14 -0
  203. package/injector/topology-tree/tree-node.js +54 -0
  204. package/inspector/deterministic-uuid-registry.d.ts +6 -0
  205. package/inspector/deterministic-uuid-registry.js +24 -0
  206. package/inspector/graph-inspector.d.ts +26 -0
  207. package/inspector/graph-inspector.js +166 -0
  208. package/inspector/index.d.ts +4 -0
  209. package/inspector/index.js +7 -0
  210. package/inspector/initialize-on-preview.allowlist.d.ts +6 -0
  211. package/inspector/initialize-on-preview.allowlist.js +13 -0
  212. package/inspector/interfaces/edge.interface.d.ts +28 -0
  213. package/inspector/interfaces/edge.interface.js +2 -0
  214. package/inspector/interfaces/enhancer-metadata-cache-entry.interface.d.ts +12 -0
  215. package/inspector/interfaces/enhancer-metadata-cache-entry.interface.js +2 -0
  216. package/inspector/interfaces/entrypoint.interface.d.ts +23 -0
  217. package/inspector/interfaces/entrypoint.interface.js +2 -0
  218. package/inspector/interfaces/extras.interface.d.ts +18 -0
  219. package/inspector/interfaces/extras.interface.js +2 -0
  220. package/inspector/interfaces/node.interface.d.ts +48 -0
  221. package/inspector/interfaces/node.interface.js +2 -0
  222. package/inspector/interfaces/serialized-graph-json.interface.d.ts +14 -0
  223. package/inspector/interfaces/serialized-graph-json.interface.js +2 -0
  224. package/inspector/interfaces/serialized-graph-metadata.interface.d.ts +10 -0
  225. package/inspector/interfaces/serialized-graph-metadata.interface.js +2 -0
  226. package/inspector/noop-graph-inspector.d.ts +2 -0
  227. package/inspector/noop-graph-inspector.js +8 -0
  228. package/inspector/partial-graph.host.d.ts +7 -0
  229. package/inspector/partial-graph.host.js +15 -0
  230. package/inspector/serialized-graph.d.ts +52 -0
  231. package/inspector/serialized-graph.js +124 -0
  232. package/inspector/uuid-factory.d.ts +9 -0
  233. package/inspector/uuid-factory.js +22 -0
  234. package/interceptors/index.d.ts +2 -0
  235. package/interceptors/index.js +5 -0
  236. package/interceptors/interceptors-consumer.d.ts +9 -0
  237. package/interceptors/interceptors-consumer.js +37 -0
  238. package/interceptors/interceptors-context-creator.d.ts +16 -0
  239. package/interceptors/interceptors-context-creator.js +69 -0
  240. package/interfaces/index.d.ts +2 -0
  241. package/interfaces/index.js +2 -0
  242. package/interfaces/module-definition.interface.d.ts +3 -0
  243. package/interfaces/module-definition.interface.js +2 -0
  244. package/interfaces/module-override.interface.d.ts +5 -0
  245. package/interfaces/module-override.interface.js +2 -0
  246. package/internal.d.ts +38 -0
  247. package/internal.js +46 -0
  248. package/metadata-scanner.d.ts +17 -0
  249. package/metadata-scanner.js +83 -0
  250. package/middleware/builder.d.ts +15 -0
  251. package/middleware/builder.js +91 -0
  252. package/middleware/container.d.ts +14 -0
  253. package/middleware/container.js +49 -0
  254. package/middleware/index.d.ts +1 -0
  255. package/middleware/index.js +4 -0
  256. package/middleware/middleware-module.d.ts +33 -0
  257. package/middleware/middleware-module.js +208 -0
  258. package/middleware/resolver.d.ts +10 -0
  259. package/middleware/resolver.js +18 -0
  260. package/middleware/route-info-path-extractor.d.ts +15 -0
  261. package/middleware/route-info-path-extractor.js +81 -0
  262. package/middleware/routes-mapper.d.ts +19 -0
  263. package/middleware/routes-mapper.js +117 -0
  264. package/middleware/utils.d.ts +8 -0
  265. package/middleware/utils.js +106 -0
  266. package/nest-application-context.d.ts +173 -0
  267. package/nest-application-context.js +327 -0
  268. package/nest-application.d.ts +64 -0
  269. package/nest-application.js +328 -0
  270. package/nest-factory.d.ts +83 -0
  271. package/nest-factory.js +232 -0
  272. package/package.json +73 -0
  273. package/pipes/index.d.ts +3 -0
  274. package/pipes/index.js +6 -0
  275. package/pipes/params-token-factory.d.ts +5 -0
  276. package/pipes/params-token-factory.js +19 -0
  277. package/pipes/pipes-consumer.d.ts +10 -0
  278. package/pipes/pipes-consumer.js +21 -0
  279. package/pipes/pipes-context-creator.d.ts +17 -0
  280. package/pipes/pipes-context-creator.js +72 -0
  281. package/repl/assign-to-object.util.d.ts +5 -0
  282. package/repl/assign-to-object.util.js +14 -0
  283. package/repl/constants.d.ts +1 -0
  284. package/repl/constants.js +4 -0
  285. package/repl/index.d.ts +1 -0
  286. package/repl/index.js +4 -0
  287. package/repl/native-functions/debug-repl-fn.d.ts +9 -0
  288. package/repl/native-functions/debug-repl-fn.js +46 -0
  289. package/repl/native-functions/get-repl-fn.d.ts +7 -0
  290. package/repl/native-functions/get-repl-fn.js +19 -0
  291. package/repl/native-functions/help-repl-fn.d.ts +7 -0
  292. package/repl/native-functions/help-repl-fn.js +29 -0
  293. package/repl/native-functions/index.d.ts +6 -0
  294. package/repl/native-functions/index.js +9 -0
  295. package/repl/native-functions/methods-repl-fn.d.ts +8 -0
  296. package/repl/native-functions/methods-repl-fn.js +28 -0
  297. package/repl/native-functions/resolve-repl-fn.d.ts +7 -0
  298. package/repl/native-functions/resolve-repl-fn.js +18 -0
  299. package/repl/native-functions/select-relp-fn.d.ts +7 -0
  300. package/repl/native-functions/select-relp-fn.js +18 -0
  301. package/repl/repl-context.d.ts +26 -0
  302. package/repl/repl-context.js +126 -0
  303. package/repl/repl-function.d.ts +18 -0
  304. package/repl/repl-function.js +19 -0
  305. package/repl/repl-logger.d.ts +5 -0
  306. package/repl/repl-logger.js +22 -0
  307. package/repl/repl-native-commands.d.ts +2 -0
  308. package/repl/repl-native-commands.js +46 -0
  309. package/repl/repl.d.ts +3 -0
  310. package/repl/repl.interfaces.d.ts +16 -0
  311. package/repl/repl.interfaces.js +2 -0
  312. package/repl/repl.js +32 -0
  313. package/router/index.d.ts +3 -0
  314. package/router/index.js +8 -0
  315. package/router/interfaces/exceptions-filter.interface.d.ts +6 -0
  316. package/router/interfaces/exceptions-filter.interface.js +2 -0
  317. package/router/interfaces/exclude-route-metadata.interface.d.ts +15 -0
  318. package/router/interfaces/exclude-route-metadata.interface.js +2 -0
  319. package/router/interfaces/index.d.ts +1 -0
  320. package/router/interfaces/index.js +4 -0
  321. package/router/interfaces/resolver.interface.d.ts +5 -0
  322. package/router/interfaces/resolver.interface.js +2 -0
  323. package/router/interfaces/route-params-factory.interface.d.ts +8 -0
  324. package/router/interfaces/route-params-factory.interface.js +2 -0
  325. package/router/interfaces/route-path-metadata.interface.d.ts +32 -0
  326. package/router/interfaces/route-path-metadata.interface.js +2 -0
  327. package/router/interfaces/routes.interface.d.ts +7 -0
  328. package/router/interfaces/routes.interface.js +2 -0
  329. package/router/legacy-route-converter.d.ts +16 -0
  330. package/router/legacy-route-converter.js +61 -0
  331. package/router/paths-explorer.d.ts +18 -0
  332. package/router/paths-explorer.js +45 -0
  333. package/router/request/index.d.ts +1 -0
  334. package/router/request/index.js +5 -0
  335. package/router/request/request-constants.d.ts +2 -0
  336. package/router/request/request-constants.js +5 -0
  337. package/router/request/request-providers.d.ts +2 -0
  338. package/router/request/request-providers.js +11 -0
  339. package/router/route-params-factory.d.ts +9 -0
  340. package/router/route-params-factory.js +41 -0
  341. package/router/route-path-factory.d.ts +14 -0
  342. package/router/route-path-factory.js +101 -0
  343. package/router/router-exception-filters.d.ts +14 -0
  344. package/router/router-exception-filters.js +40 -0
  345. package/router/router-execution-context.d.ts +54 -0
  346. package/router/router-execution-context.js +186 -0
  347. package/router/router-explorer.d.ts +47 -0
  348. package/router/router-explorer.js +234 -0
  349. package/router/router-module.d.ts +19 -0
  350. package/router/router-module.js +80 -0
  351. package/router/router-proxy.d.ts +6 -0
  352. package/router/router-proxy.js +31 -0
  353. package/router/router-response-controller.d.ts +28 -0
  354. package/router/router-response-controller.js +98 -0
  355. package/router/routes-resolver.d.ts +27 -0
  356. package/router/routes-resolver.js +129 -0
  357. package/router/sse-stream.d.ts +43 -0
  358. package/router/sse-stream.js +83 -0
  359. package/router/utils/exclude-route.util.d.ts +4 -0
  360. package/router/utils/exclude-route.util.js +19 -0
  361. package/router/utils/flatten-route-paths.util.d.ts +6 -0
  362. package/router/utils/flatten-route-paths.util.js +25 -0
  363. package/router/utils/index.d.ts +2 -0
  364. package/router/utils/index.js +5 -0
  365. package/scanner.d.ts +89 -0
  366. package/scanner.js +416 -0
  367. package/services/index.d.ts +1 -0
  368. package/services/index.js +4 -0
  369. package/services/reflector.service.d.ts +111 -0
  370. package/services/reflector.service.js +100 -0
  371. package/tsconfig.build.json +21 -0
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplContext = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const application_config_1 = require("../application-config");
6
+ const injector_1 = require("../injector");
7
+ const internal_core_module_1 = require("../injector/internal-core-module/internal-core-module");
8
+ const native_functions_1 = require("./native-functions");
9
+ class ReplContext {
10
+ constructor(app, nativeFunctionsClassRefs) {
11
+ this.app = app;
12
+ this.logger = new common_1.Logger(ReplContext.name);
13
+ this.debugRegistry = {};
14
+ this.globalScope = Object.create(null);
15
+ this.nativeFunctions = new Map();
16
+ this.container = app.container; // Using `any` because `app.container` is not public.
17
+ this.initializeContext();
18
+ this.initializeNativeFunctions(nativeFunctionsClassRefs || []);
19
+ }
20
+ writeToStdout(text) {
21
+ process.stdout.write(text);
22
+ }
23
+ initializeContext() {
24
+ const modules = this.container.getModules();
25
+ modules.forEach(moduleRef => {
26
+ let moduleName = moduleRef.metatype.name;
27
+ if (moduleName === internal_core_module_1.InternalCoreModule.name) {
28
+ return;
29
+ }
30
+ if (this.globalScope[moduleName]) {
31
+ moduleName += ` (${moduleRef.token})`;
32
+ }
33
+ this.introspectCollection(moduleRef, moduleName, 'providers');
34
+ this.introspectCollection(moduleRef, moduleName, 'controllers');
35
+ // For in REPL auto-complete functionality
36
+ Object.defineProperty(this.globalScope, moduleName, {
37
+ value: moduleRef.metatype,
38
+ configurable: false,
39
+ enumerable: true,
40
+ });
41
+ });
42
+ }
43
+ introspectCollection(moduleRef, moduleKey, collection) {
44
+ const moduleDebugEntry = {};
45
+ moduleRef[collection].forEach(({ token }) => {
46
+ const stringifiedToken = this.stringifyToken(token);
47
+ if (stringifiedToken === application_config_1.ApplicationConfig.name ||
48
+ stringifiedToken === moduleRef.metatype.name) {
49
+ return;
50
+ }
51
+ if (!this.globalScope[stringifiedToken]) {
52
+ // For in REPL auto-complete functionality
53
+ Object.defineProperty(this.globalScope, stringifiedToken, {
54
+ value: token,
55
+ configurable: false,
56
+ enumerable: true,
57
+ });
58
+ }
59
+ if (stringifiedToken === injector_1.ModuleRef.name) {
60
+ return;
61
+ }
62
+ moduleDebugEntry[stringifiedToken] = token;
63
+ });
64
+ this.debugRegistry[moduleKey] = {
65
+ ...this.debugRegistry?.[moduleKey],
66
+ [collection]: moduleDebugEntry,
67
+ };
68
+ }
69
+ stringifyToken(token) {
70
+ return typeof token !== 'string'
71
+ ? typeof token === 'function'
72
+ ? token.name
73
+ : token?.toString()
74
+ : `"${token}"`;
75
+ }
76
+ addNativeFunction(NativeFunctionRef) {
77
+ const nativeFunction = new NativeFunctionRef(this);
78
+ const nativeFunctions = [nativeFunction];
79
+ this.nativeFunctions.set(nativeFunction.fnDefinition.name, nativeFunction);
80
+ nativeFunction.fnDefinition.aliases?.forEach(aliasName => {
81
+ const aliasNativeFunction = Object.create(nativeFunction);
82
+ aliasNativeFunction.fnDefinition = {
83
+ name: aliasName,
84
+ description: aliasNativeFunction.fnDefinition.description,
85
+ signature: aliasNativeFunction.fnDefinition.signature,
86
+ };
87
+ this.nativeFunctions.set(aliasName, aliasNativeFunction);
88
+ nativeFunctions.push(aliasNativeFunction);
89
+ });
90
+ return nativeFunctions;
91
+ }
92
+ registerFunctionIntoGlobalScope(nativeFunction) {
93
+ // Bind the method to REPL's context:
94
+ this.globalScope[nativeFunction.fnDefinition.name] =
95
+ nativeFunction.action.bind(nativeFunction);
96
+ // Load the help trigger as a `help` getter on each native function:
97
+ const functionBoundRef = this.globalScope[nativeFunction.fnDefinition.name];
98
+ Object.defineProperty(functionBoundRef, 'help', {
99
+ enumerable: false,
100
+ configurable: false,
101
+ get: () =>
102
+ // Dynamically builds the help message as will unlikely to be called
103
+ // several times.
104
+ this.writeToStdout(nativeFunction.makeHelpMessage()),
105
+ });
106
+ }
107
+ initializeNativeFunctions(nativeFunctionsClassRefs) {
108
+ const builtInFunctionsClassRefs = [
109
+ native_functions_1.HelpReplFn,
110
+ native_functions_1.GetReplFn,
111
+ native_functions_1.ResolveReplFn,
112
+ native_functions_1.SelectReplFn,
113
+ native_functions_1.DebugReplFn,
114
+ native_functions_1.MethodsReplFn,
115
+ ];
116
+ builtInFunctionsClassRefs
117
+ .concat(nativeFunctionsClassRefs)
118
+ .forEach(NativeFunction => {
119
+ const nativeFunctions = this.addNativeFunction(NativeFunction);
120
+ nativeFunctions.forEach(nativeFunction => {
121
+ this.registerFunctionIntoGlobalScope(nativeFunction);
122
+ });
123
+ });
124
+ }
125
+ }
126
+ exports.ReplContext = ReplContext;
@@ -0,0 +1,18 @@
1
+ import { Logger } from '@nestjs/common';
2
+ import { ReplContext } from './repl-context';
3
+ import type { ReplFnDefinition } from './repl.interfaces';
4
+ export declare abstract class ReplFunction<ActionParams extends Array<unknown> = Array<unknown>, ActionReturn = any> {
5
+ protected readonly ctx: ReplContext;
6
+ /** Metadata that describes the built-in function itself. */
7
+ abstract fnDefinition: ReplFnDefinition;
8
+ protected readonly logger: Logger;
9
+ constructor(ctx: ReplContext);
10
+ /**
11
+ * Method called when the function is invoked from the REPL by the user.
12
+ */
13
+ abstract action(...args: ActionParams): ActionReturn;
14
+ /**
15
+ * @returns A message displayed by calling `<fnName>.help`
16
+ */
17
+ makeHelpMessage(): string;
18
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplFunction = void 0;
4
+ const cli_colors_util_1 = require("@nestjs/common/utils/cli-colors.util");
5
+ class ReplFunction {
6
+ constructor(ctx) {
7
+ this.ctx = ctx;
8
+ this.logger = ctx.logger;
9
+ }
10
+ /**
11
+ * @returns A message displayed by calling `<fnName>.help`
12
+ */
13
+ makeHelpMessage() {
14
+ const { description, name, signature } = this.fnDefinition;
15
+ const fnSignatureWithName = `${name}${signature}`;
16
+ return `${cli_colors_util_1.clc.yellow(description)}\n${cli_colors_util_1.clc.magentaBright('Interface:')} ${cli_colors_util_1.clc.bold(fnSignatureWithName)}\n`;
17
+ }
18
+ }
19
+ exports.ReplFunction = ReplFunction;
@@ -0,0 +1,5 @@
1
+ import { ConsoleLogger } from '@nestjs/common';
2
+ export declare class ReplLogger extends ConsoleLogger {
3
+ private static readonly ignoredContexts;
4
+ log(_message: any, context?: string): void;
5
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplLogger = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const nest_application_1 = require("../nest-application");
6
+ const router_explorer_1 = require("../router/router-explorer");
7
+ const routes_resolver_1 = require("../router/routes-resolver");
8
+ class ReplLogger extends common_1.ConsoleLogger {
9
+ log(_message, context) {
10
+ if (ReplLogger.ignoredContexts.includes(context)) {
11
+ return;
12
+ }
13
+ // eslint-disable-next-line
14
+ return super.log.apply(this, Array.from(arguments));
15
+ }
16
+ }
17
+ exports.ReplLogger = ReplLogger;
18
+ ReplLogger.ignoredContexts = [
19
+ routes_resolver_1.RoutesResolver.name,
20
+ router_explorer_1.RouterExplorer.name,
21
+ nest_application_1.NestApplication.name,
22
+ ];
@@ -0,0 +1,2 @@
1
+ import type { REPLServer } from 'repl';
2
+ export declare function defineDefaultCommandsOnRepl(replServer: REPLServer): void;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineDefaultCommandsOnRepl = defineDefaultCommandsOnRepl;
4
+ /**
5
+ * Displays a list of available commands in the REPL alongside with their
6
+ * descriptions.
7
+ * (c) This code was inspired by the 'help' command from Node.js core:
8
+ * {@link https://github.com/nodejs/node/blob/58b60c1393dd65cd228a8b0084a19acd2c1d16aa/lib/repl.js#L1741-L1759}
9
+ */
10
+ function listAllCommands(replServer) {
11
+ Object.keys(replServer.commands)
12
+ .sort()
13
+ .forEach(name => {
14
+ const cmd = replServer.commands[name];
15
+ if (cmd) {
16
+ replServer.output.write(`${name}\t${cmd.help || ''}\n`);
17
+ }
18
+ });
19
+ }
20
+ function defineDefaultCommandsOnRepl(replServer) {
21
+ replServer.defineCommand('help', {
22
+ help: 'Show REPL options',
23
+ action(name) {
24
+ this.clearBufferedCommand();
25
+ if (name) {
26
+ // Considering native commands before native nestjs injected functions.
27
+ const nativeCommandOrFunction = this.commands[name] || this.context[name];
28
+ // NOTE: If the command was retrieve from the context, it will have a `help`
29
+ // getter property that outputs the helper message and returns undefined.
30
+ // But if the command was retrieve from the `commands` object, it will
31
+ // have a `help` property that returns the helper message.
32
+ const helpMessage = nativeCommandOrFunction?.help;
33
+ if (helpMessage) {
34
+ this.output.write(`${helpMessage}\n`);
35
+ }
36
+ }
37
+ else {
38
+ listAllCommands(this);
39
+ this.output.write('\n\n');
40
+ this.context.help();
41
+ this.output.write('\nPress Ctrl+C to abort current expression, Ctrl+D to exit the REPL\n');
42
+ }
43
+ this.displayPrompt();
44
+ },
45
+ });
46
+ }
package/repl/repl.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { DynamicModule, Type } from '@nestjs/common';
2
+ import type { ReplOptions } from 'repl';
3
+ export declare function repl(module: Type | DynamicModule, replOptions?: ReplOptions): Promise<import("node:repl").REPLServer>;
@@ -0,0 +1,16 @@
1
+ import type { ReplContext } from './repl-context';
2
+ import type { ReplFunction } from './repl-function';
3
+ export type ReplFnDefinition = {
4
+ /** Function's name. Note that this should be a valid JavaScript function name. */
5
+ name: string;
6
+ /** Alternative names to the function. */
7
+ aliases?: ReplFnDefinition['name'][];
8
+ /** Function's description to display when `<function>.help` is entered. */
9
+ description: string;
10
+ /**
11
+ * Function's signature following TypeScript _function type expression_ syntax.
12
+ * @example '(token: InjectionToken) => any'
13
+ */
14
+ signature: string;
15
+ };
16
+ export type ReplFunctionClass = new (replContext: ReplContext) => ReplFunction;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/repl/repl.js ADDED
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.repl = repl;
4
+ const common_1 = require("@nestjs/common");
5
+ const cli_colors_util_1 = require("@nestjs/common/utils/cli-colors.util");
6
+ const nest_factory_1 = require("../nest-factory");
7
+ const assign_to_object_util_1 = require("./assign-to-object.util");
8
+ const constants_1 = require("./constants");
9
+ const repl_context_1 = require("./repl-context");
10
+ const repl_logger_1 = require("./repl-logger");
11
+ const repl_native_commands_1 = require("./repl-native-commands");
12
+ async function repl(module, replOptions = {}) {
13
+ const app = await nest_factory_1.NestFactory.createApplicationContext(module, {
14
+ abortOnError: false,
15
+ logger: new repl_logger_1.ReplLogger(),
16
+ });
17
+ await app.init();
18
+ const replContext = new repl_context_1.ReplContext(app);
19
+ common_1.Logger.log(constants_1.REPL_INITIALIZED_MESSAGE);
20
+ const _repl = await Promise.resolve().then(() => require('repl'));
21
+ const replServer = _repl.start({
22
+ prompt: cli_colors_util_1.clc.green('> '),
23
+ ignoreUndefined: true,
24
+ ...replOptions,
25
+ });
26
+ (0, assign_to_object_util_1.assignToObject)(replServer.context, replContext.globalScope);
27
+ (0, repl_native_commands_1.defineDefaultCommandsOnRepl)(replServer);
28
+ replServer.on('exit', async () => {
29
+ await app.close();
30
+ });
31
+ return replServer;
32
+ }
@@ -0,0 +1,3 @@
1
+ export * from './interfaces';
2
+ export * from './request';
3
+ export { RouterModule } from './router-module';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RouterModule = void 0;
4
+ const tslib_1 = require("tslib");
5
+ tslib_1.__exportStar(require("./interfaces"), exports);
6
+ tslib_1.__exportStar(require("./request"), exports);
7
+ var router_module_1 = require("./router-module");
8
+ Object.defineProperty(exports, "RouterModule", { enumerable: true, get: function () { return router_module_1.RouterModule; } });
@@ -0,0 +1,6 @@
1
+ import { Controller } from '@nestjs/common/interfaces/controllers/controller.interface';
2
+ import { ExceptionsHandler } from '../../exceptions/exceptions-handler';
3
+ import { ContextId } from '../../injector/instance-wrapper';
4
+ export interface ExceptionsFilter {
5
+ create(instance: Controller, callback: Function, module: string, contextId?: ContextId, inquirerId?: string): ExceptionsHandler;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ import { RequestMethod } from '@nestjs/common';
2
+ export interface ExcludeRouteMetadata {
3
+ /**
4
+ * Route path.
5
+ */
6
+ path: string;
7
+ /**
8
+ * Regular expression representing the route path.
9
+ */
10
+ pathRegex: RegExp;
11
+ /**
12
+ * HTTP request method (e.g., GET, POST).
13
+ */
14
+ requestMethod: RequestMethod;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './routes.interface';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./routes.interface"), exports);
@@ -0,0 +1,5 @@
1
+ export interface Resolver {
2
+ resolve(instance: any, basePath: string): void;
3
+ registerNotFoundHandler(): void;
4
+ registerExceptionHandler(): void;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { RouteParamtypes } from '@nestjs/common/enums/route-paramtypes.enum';
2
+ export interface IRouteParamsFactory {
3
+ exchangeKeyForValue<TRequest extends Record<string, any> = any, TResponse = any, TResult = any>(key: RouteParamtypes | string, data: any, { req, res, next }: {
4
+ req: TRequest;
5
+ res: TResponse;
6
+ next: Function;
7
+ }): TResult | null;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ import { VersioningOptions } from '@nestjs/common';
2
+ import { VersionValue } from '@nestjs/common/interfaces';
3
+ export interface RoutePathMetadata {
4
+ /**
5
+ * Controller-level path (e.g., @Controller('resource') = "resource").
6
+ */
7
+ ctrlPath?: string;
8
+ /**
9
+ * Method-level path (e.g., @Get('resource') = "resource").
10
+ */
11
+ methodPath?: string;
12
+ /**
13
+ * Global route prefix specified with the "NestApplication#setGlobalPrefix" method.
14
+ */
15
+ globalPrefix?: string;
16
+ /**
17
+ * Module-level path registered through the "RouterModule".
18
+ */
19
+ modulePath?: string;
20
+ /**
21
+ * Controller-level version (e.g., @Controller({ version: '1.0' }) = "1.0").
22
+ */
23
+ controllerVersion?: VersionValue;
24
+ /**
25
+ * Method-level version (e.g., @Version('1.0') = "1.0").
26
+ */
27
+ methodVersion?: VersionValue;
28
+ /**
29
+ * API versioning options object.
30
+ */
31
+ versioningOptions?: VersioningOptions;
32
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { Type } from '@nestjs/common';
2
+ export interface RouteTree {
3
+ path: string;
4
+ module?: Type<any>;
5
+ children?: (RouteTree | Type<any>)[];
6
+ }
7
+ export type Routes = RouteTree[];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ export declare class LegacyRouteConverter {
2
+ private static readonly logger;
3
+ /**
4
+ * Convert legacy routes to the new format (syntax).
5
+ * path-to-regexp used by Express>=v5 and @fastify/middie>=v9 no longer support unnamed wildcards.
6
+ * This method attempts to convert the old syntax to the new one, and logs an error if it fails.
7
+ * @param route The route to convert.
8
+ * @param options Options object.
9
+ * @returns The converted route, or the original route if it cannot be converted.
10
+ */
11
+ static tryConvert(route: string, options?: {
12
+ logs?: boolean;
13
+ }): string;
14
+ static printError(route: string): void;
15
+ static printWarning(route: string): void;
16
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LegacyRouteConverter = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const UNSUPPORTED_PATH_MESSAGE = (text, route) => `Unsupported route path: "${route}". In previous versions, the symbols ?, *, and + were used to denote optional or repeating path parameters. The latest version of "path-to-regexp" now requires the use of named parameters. For example, instead of using a route like /users/* to capture all routes starting with "/users", you should use /users/*path. For more details, refer to the migration guide.`;
6
+ class LegacyRouteConverter {
7
+ /**
8
+ * Convert legacy routes to the new format (syntax).
9
+ * path-to-regexp used by Express>=v5 and @fastify/middie>=v9 no longer support unnamed wildcards.
10
+ * This method attempts to convert the old syntax to the new one, and logs an error if it fails.
11
+ * @param route The route to convert.
12
+ * @param options Options object.
13
+ * @returns The converted route, or the original route if it cannot be converted.
14
+ */
15
+ static tryConvert(route, options) {
16
+ // Normalize path to eliminate additional if statements.
17
+ const routeWithLeadingSlash = route.startsWith('/') ? route : `/${route}`;
18
+ const normalizedRoute = route.endsWith('/')
19
+ ? routeWithLeadingSlash
20
+ : `${routeWithLeadingSlash}/`;
21
+ const loggingEnabled = options?.logs ?? true;
22
+ const printWarning = loggingEnabled
23
+ ? this.printWarning.bind(this)
24
+ : () => { };
25
+ if (normalizedRoute.endsWith('/(.*)/')) {
26
+ // Skip printing warning for the "all" wildcard.
27
+ if (normalizedRoute !== '/(.*)/') {
28
+ printWarning(route);
29
+ }
30
+ return route.replace('(.*)', '{*path}');
31
+ }
32
+ if (normalizedRoute.endsWith('/*/')) {
33
+ // Skip printing warning for the "all" wildcard.
34
+ if (normalizedRoute !== '/*/') {
35
+ printWarning(route);
36
+ }
37
+ return route.replace('*', '{*path}');
38
+ }
39
+ if (normalizedRoute.endsWith('/+/')) {
40
+ printWarning(route);
41
+ return route.replace('/+', '/*path');
42
+ }
43
+ // When route includes any wildcard segments in the middle.
44
+ if (normalizedRoute.includes('/*/')) {
45
+ printWarning(route);
46
+ // Replace each /*/ segment with a named parameter using different name for each segment.
47
+ return route.replaceAll('/*/', (match, offset) => {
48
+ return `/*path${offset}/`;
49
+ });
50
+ }
51
+ return route;
52
+ }
53
+ static printError(route) {
54
+ this.logger.error(UNSUPPORTED_PATH_MESSAGE `${route}`);
55
+ }
56
+ static printWarning(route) {
57
+ this.logger.warn(UNSUPPORTED_PATH_MESSAGE `${route}` + ' Attempting to auto-convert...');
58
+ }
59
+ }
60
+ exports.LegacyRouteConverter = LegacyRouteConverter;
61
+ LegacyRouteConverter.logger = new common_1.Logger(LegacyRouteConverter.name);
@@ -0,0 +1,18 @@
1
+ import { RequestMethod } from '@nestjs/common/enums';
2
+ import { Controller } from '@nestjs/common/interfaces/controllers/controller.interface';
3
+ import { VersionValue } from '@nestjs/common/interfaces/version-options.interface';
4
+ import { MetadataScanner } from '../metadata-scanner';
5
+ import { RouterProxyCallback } from './router-proxy';
6
+ export interface RouteDefinition {
7
+ path: string[];
8
+ requestMethod: RequestMethod;
9
+ targetCallback: RouterProxyCallback;
10
+ methodName: string;
11
+ version?: VersionValue;
12
+ }
13
+ export declare class PathsExplorer {
14
+ private readonly metadataScanner;
15
+ constructor(metadataScanner: MetadataScanner);
16
+ scanForPaths(instance: Controller, prototype?: object): RouteDefinition[];
17
+ exploreMethodMetadata(instance: Controller, prototype: object, methodName: string): RouteDefinition | null;
18
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PathsExplorer = void 0;
4
+ const constants_1 = require("@nestjs/common/constants");
5
+ const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
6
+ class PathsExplorer {
7
+ constructor(metadataScanner) {
8
+ this.metadataScanner = metadataScanner;
9
+ }
10
+ scanForPaths(instance, prototype) {
11
+ const instancePrototype = (0, shared_utils_1.isUndefined)(prototype)
12
+ ? Object.getPrototypeOf(instance)
13
+ : prototype;
14
+ return this.metadataScanner
15
+ .getAllMethodNames(instancePrototype)
16
+ .reduce((acc, method) => {
17
+ const route = this.exploreMethodMetadata(instance, instancePrototype, method);
18
+ if (route) {
19
+ acc.push(route);
20
+ }
21
+ return acc;
22
+ }, []);
23
+ }
24
+ exploreMethodMetadata(instance, prototype, methodName) {
25
+ const instanceCallback = instance[methodName];
26
+ const prototypeCallback = prototype[methodName];
27
+ const routePath = Reflect.getMetadata(constants_1.PATH_METADATA, prototypeCallback);
28
+ if ((0, shared_utils_1.isUndefined)(routePath)) {
29
+ return null;
30
+ }
31
+ const requestMethod = Reflect.getMetadata(constants_1.METHOD_METADATA, prototypeCallback);
32
+ const version = Reflect.getMetadata(constants_1.VERSION_METADATA, prototypeCallback);
33
+ const path = (0, shared_utils_1.isString)(routePath)
34
+ ? [(0, shared_utils_1.addLeadingSlash)(routePath)]
35
+ : routePath.map((p) => (0, shared_utils_1.addLeadingSlash)(p));
36
+ return {
37
+ path,
38
+ requestMethod,
39
+ targetCallback: instanceCallback,
40
+ methodName,
41
+ version,
42
+ };
43
+ }
44
+ }
45
+ exports.PathsExplorer = PathsExplorer;
@@ -0,0 +1 @@
1
+ export { REQUEST } from './request-constants';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REQUEST = void 0;
4
+ var request_constants_1 = require("./request-constants");
5
+ Object.defineProperty(exports, "REQUEST", { enumerable: true, get: function () { return request_constants_1.REQUEST; } });
@@ -0,0 +1,2 @@
1
+ export declare const REQUEST = "REQUEST";
2
+ export declare const REQUEST_CONTEXT_ID: unique symbol;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REQUEST_CONTEXT_ID = exports.REQUEST = void 0;
4
+ exports.REQUEST = 'REQUEST';
5
+ exports.REQUEST_CONTEXT_ID = Symbol('REQUEST_CONTEXT_ID');
@@ -0,0 +1,2 @@
1
+ import { Provider } from '@nestjs/common';
2
+ export declare const requestProvider: Provider;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requestProvider = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const request_constants_1 = require("./request-constants");
6
+ const noop = () => { };
7
+ exports.requestProvider = {
8
+ provide: request_constants_1.REQUEST,
9
+ scope: common_1.Scope.REQUEST,
10
+ useFactory: noop,
11
+ };
@@ -0,0 +1,9 @@
1
+ import { RouteParamtypes } from '@nestjs/common/enums/route-paramtypes.enum';
2
+ import { IRouteParamsFactory } from './interfaces/route-params-factory.interface';
3
+ export declare class RouteParamsFactory implements IRouteParamsFactory {
4
+ exchangeKeyForValue<TRequest extends Record<string, any> = any, TResponse = any, TResult = any>(key: RouteParamtypes | string, data: string, { req, res, next }: {
5
+ req: TRequest;
6
+ res: TResponse;
7
+ next: Function;
8
+ }): TResult | null;
9
+ }