@velajs/vela 1.19.0 → 1.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (449) hide show
  1. package/CHANGELOG.md +22 -14
  2. package/dist/configurable-module.builder-5FGMaXG6.js +91 -0
  3. package/dist/configurable-module.builder-5FGMaXG6.js.map +1 -0
  4. package/dist/container-BqUHID4l.js +645 -0
  5. package/dist/container-BqUHID4l.js.map +1 -0
  6. package/dist/cron-matcher-C9qv5OUA.js +113 -0
  7. package/dist/cron-matcher-C9qv5OUA.js.map +1 -0
  8. package/dist/decorate-GcSMAbKn.js +528 -0
  9. package/dist/decorate-GcSMAbKn.js.map +1 -0
  10. package/dist/decorators-C8YBFCIk.js +53 -0
  11. package/dist/decorators-C8YBFCIk.js.map +1 -0
  12. package/dist/define-module-NOyOZNXD.js +235 -0
  13. package/dist/define-module-NOyOZNXD.js.map +1 -0
  14. package/dist/discovery.service-BYm95SSD.js +368 -0
  15. package/dist/discovery.service-BYm95SSD.js.map +1 -0
  16. package/dist/discovery.service-Cpf1QcZ5.d.ts +648 -0
  17. package/dist/i18n/index.d.ts +138 -10
  18. package/dist/i18n/index.js +270 -8
  19. package/dist/i18n/index.js.map +1 -0
  20. package/dist/index-D72EQfcC.d.ts +430 -0
  21. package/dist/index-DhShDLCM.d.ts +2310 -0
  22. package/dist/index.d.ts +6 -70
  23. package/dist/index.js +14 -76
  24. package/dist/internal.d.ts +13 -17
  25. package/dist/internal.js +6 -19
  26. package/dist/live/index.d.ts +2 -12
  27. package/dist/live/index.js +826 -16
  28. package/dist/live/index.js.map +1 -0
  29. package/dist/metadata.registry-D1od8ZBt.d.ts +842 -0
  30. package/dist/plugin-ByBlVOve.js +1387 -0
  31. package/dist/plugin-ByBlVOve.js.map +1 -0
  32. package/dist/queue/index.d.ts +247 -10
  33. package/dist/queue/index.js +384 -12
  34. package/dist/queue/index.js.map +1 -0
  35. package/dist/request-context-C3nCGJNd.js +26 -0
  36. package/dist/request-context-C3nCGJNd.js.map +1 -0
  37. package/dist/route.manager-DRAZ5X04.js +991 -0
  38. package/dist/route.manager-DRAZ5X04.js.map +1 -0
  39. package/dist/schedule-node/index.d.ts +32 -3
  40. package/dist/schedule-node/index.js +97 -3
  41. package/dist/schedule-node/index.js.map +1 -0
  42. package/dist/schedule.registry-DVm7Jp5w.d.ts +55 -0
  43. package/dist/seeder/index.d.ts +75 -5
  44. package/dist/seeder/index.js +105 -4
  45. package/dist/seeder/index.js.map +1 -0
  46. package/dist/signed-url-CMmi0SIb.js +56 -0
  47. package/dist/signed-url-CMmi0SIb.js.map +1 -0
  48. package/dist/signed-url-DKhgja4U.d.ts +16 -0
  49. package/dist/src-eb5CI6Xn.js +2151 -0
  50. package/dist/src-eb5CI6Xn.js.map +1 -0
  51. package/dist/storage/index.d.ts +57 -4
  52. package/dist/storage/index.js +22 -5
  53. package/dist/storage/index.js.map +1 -0
  54. package/dist/streaming/index.d.ts +2 -2
  55. package/dist/streaming/index.js +2 -1
  56. package/dist/websocket/index.d.ts +3 -12
  57. package/dist/websocket/index.js +2 -16
  58. package/dist/websocket-DXmB-MWJ.js +697 -0
  59. package/dist/websocket-DXmB-MWJ.js.map +1 -0
  60. package/dist/websocket-node/index.d.ts +108 -6
  61. package/dist/websocket-node/index.js +228 -6
  62. package/dist/websocket-node/index.js.map +1 -0
  63. package/package.json +66 -53
  64. package/dist/__tests__/workers/entry.d.ts +0 -9
  65. package/dist/__tests__/workers-als/entry-als.d.ts +0 -9
  66. package/dist/application.d.ts +0 -104
  67. package/dist/application.js +0 -364
  68. package/dist/cache/cache.decorators.d.ts +0 -2
  69. package/dist/cache/cache.decorators.js +0 -4
  70. package/dist/cache/cache.interceptor.d.ts +0 -9
  71. package/dist/cache/cache.interceptor.js +0 -60
  72. package/dist/cache/cache.module.d.ts +0 -7
  73. package/dist/cache/cache.module.js +0 -58
  74. package/dist/cache/cache.service.d.ts +0 -9
  75. package/dist/cache/cache.service.js +0 -42
  76. package/dist/cache/cache.store.d.ts +0 -12
  77. package/dist/cache/cache.store.js +0 -51
  78. package/dist/cache/cache.tokens.d.ts +0 -6
  79. package/dist/cache/cache.tokens.js +0 -5
  80. package/dist/cache/cache.types.d.ts +0 -41
  81. package/dist/cache/cache.types.js +0 -1
  82. package/dist/cache/index.d.ts +0 -8
  83. package/dist/cache/index.js +0 -7
  84. package/dist/cache/tiered-cache.store.d.ts +0 -19
  85. package/dist/cache/tiered-cache.store.js +0 -40
  86. package/dist/config/config.module.d.ts +0 -19
  87. package/dist/config/config.module.js +0 -98
  88. package/dist/config/config.service.d.ts +0 -20
  89. package/dist/config/config.service.js +0 -43
  90. package/dist/config/config.store.d.ts +0 -46
  91. package/dist/config/config.store.js +0 -119
  92. package/dist/config/config.tokens.d.ts +0 -13
  93. package/dist/config/config.tokens.js +0 -14
  94. package/dist/config/config.types.d.ts +0 -41
  95. package/dist/config/config.types.js +0 -4
  96. package/dist/config/index.d.ts +0 -7
  97. package/dist/config/index.js +0 -5
  98. package/dist/config/register-as.d.ts +0 -52
  99. package/dist/config/register-as.js +0 -39
  100. package/dist/constants.d.ts +0 -44
  101. package/dist/constants.js +0 -46
  102. package/dist/container/container.d.ts +0 -154
  103. package/dist/container/container.js +0 -849
  104. package/dist/container/decorators.d.ts +0 -17
  105. package/dist/container/decorators.js +0 -57
  106. package/dist/container/disposable.d.ts +0 -5
  107. package/dist/container/disposable.js +0 -33
  108. package/dist/container/index.d.ts +0 -6
  109. package/dist/container/index.js +0 -5
  110. package/dist/container/mixin.d.ts +0 -24
  111. package/dist/container/mixin.js +0 -26
  112. package/dist/container/module-ref.d.ts +0 -21
  113. package/dist/container/module-ref.js +0 -48
  114. package/dist/container/types.d.ts +0 -154
  115. package/dist/container/types.js +0 -49
  116. package/dist/cors/cors.module.d.ts +0 -7
  117. package/dist/cors/cors.module.js +0 -37
  118. package/dist/cors/cors.tokens.d.ts +0 -3
  119. package/dist/cors/cors.tokens.js +0 -2
  120. package/dist/cors/cors.types.d.ts +0 -8
  121. package/dist/cors/cors.types.js +0 -1
  122. package/dist/cors/index.d.ts +0 -3
  123. package/dist/cors/index.js +0 -2
  124. package/dist/crypto/signed-url.d.ts +0 -12
  125. package/dist/crypto/signed-url.js +0 -60
  126. package/dist/discovery/discoverable.decorator.d.ts +0 -38
  127. package/dist/discovery/discoverable.decorator.js +0 -42
  128. package/dist/discovery/discovery.service.d.ts +0 -102
  129. package/dist/discovery/discovery.service.js +0 -177
  130. package/dist/discovery/index.d.ts +0 -2
  131. package/dist/discovery/index.js +0 -2
  132. package/dist/entrypoint/entrypoint.registry.d.ts +0 -42
  133. package/dist/entrypoint/entrypoint.registry.js +0 -112
  134. package/dist/entrypoint/entrypoint.types.d.ts +0 -41
  135. package/dist/entrypoint/entrypoint.types.js +0 -3
  136. package/dist/entrypoint/execution-context.d.ts +0 -15
  137. package/dist/entrypoint/execution-context.js +0 -21
  138. package/dist/entrypoint/execution-scope.d.ts +0 -21
  139. package/dist/entrypoint/execution-scope.js +0 -28
  140. package/dist/entrypoint/index.d.ts +0 -4
  141. package/dist/entrypoint/index.js +0 -4
  142. package/dist/errors/http-exception.d.ts +0 -63
  143. package/dist/errors/http-exception.js +0 -142
  144. package/dist/errors/index.d.ts +0 -1
  145. package/dist/errors/index.js +0 -1
  146. package/dist/event-emitter/event-emitter.decorators.d.ts +0 -1
  147. package/dist/event-emitter/event-emitter.decorators.js +0 -10
  148. package/dist/event-emitter/event-emitter.module.d.ts +0 -2
  149. package/dist/event-emitter/event-emitter.module.js +0 -23
  150. package/dist/event-emitter/event-emitter.service.d.ts +0 -13
  151. package/dist/event-emitter/event-emitter.service.js +0 -127
  152. package/dist/event-emitter/event-emitter.subscriber.d.ts +0 -9
  153. package/dist/event-emitter/event-emitter.subscriber.js +0 -45
  154. package/dist/event-emitter/event-emitter.tokens.d.ts +0 -1
  155. package/dist/event-emitter/event-emitter.tokens.js +0 -1
  156. package/dist/event-emitter/event-emitter.types.d.ts +0 -5
  157. package/dist/event-emitter/event-emitter.types.js +0 -1
  158. package/dist/event-emitter/index.d.ts +0 -6
  159. package/dist/event-emitter/index.js +0 -5
  160. package/dist/exceptions/errors.module.d.ts +0 -40
  161. package/dist/exceptions/errors.module.js +0 -46
  162. package/dist/exceptions/exception-handler.d.ts +0 -56
  163. package/dist/exceptions/exception-handler.js +0 -17
  164. package/dist/exceptions/index.d.ts +0 -6
  165. package/dist/exceptions/index.js +0 -3
  166. package/dist/exceptions/reporter.d.ts +0 -21
  167. package/dist/exceptions/reporter.js +0 -70
  168. package/dist/factory/adapter.d.ts +0 -36
  169. package/dist/factory/adapter.js +0 -18
  170. package/dist/factory/bootstrap.d.ts +0 -23
  171. package/dist/factory/bootstrap.js +0 -110
  172. package/dist/factory.d.ts +0 -16
  173. package/dist/factory.js +0 -36
  174. package/dist/fetch/fetch.module.d.ts +0 -7
  175. package/dist/fetch/fetch.module.js +0 -31
  176. package/dist/fetch/fetch.service.d.ts +0 -24
  177. package/dist/fetch/fetch.service.js +0 -145
  178. package/dist/fetch/fetch.types.d.ts +0 -24
  179. package/dist/fetch/fetch.types.js +0 -1
  180. package/dist/fetch/index.d.ts +0 -3
  181. package/dist/fetch/index.js +0 -2
  182. package/dist/health/health.http.d.ts +0 -14
  183. package/dist/health/health.http.js +0 -75
  184. package/dist/health/health.indicator.d.ts +0 -9
  185. package/dist/health/health.indicator.js +0 -32
  186. package/dist/health/health.module.d.ts +0 -2
  187. package/dist/health/health.module.js +0 -26
  188. package/dist/health/health.service.d.ts +0 -7
  189. package/dist/health/health.service.js +0 -69
  190. package/dist/health/health.types.d.ts +0 -15
  191. package/dist/health/health.types.js +0 -1
  192. package/dist/health/index.d.ts +0 -6
  193. package/dist/health/index.js +0 -4
  194. package/dist/http/ambient.d.ts +0 -17
  195. package/dist/http/ambient.js +0 -44
  196. package/dist/http/argument-resolver.d.ts +0 -10
  197. package/dist/http/argument-resolver.js +0 -89
  198. package/dist/http/decorators.d.ts +0 -198
  199. package/dist/http/decorators.js +0 -321
  200. package/dist/http/execution-context.d.ts +0 -8
  201. package/dist/http/execution-context.js +0 -35
  202. package/dist/http/handler-executor.d.ts +0 -20
  203. package/dist/http/handler-executor.js +0 -133
  204. package/dist/http/index.d.ts +0 -12
  205. package/dist/http/index.js +0 -7
  206. package/dist/http/instantiate.d.ts +0 -4
  207. package/dist/http/instantiate.js +0 -45
  208. package/dist/http/lazy-param.decorator.d.ts +0 -37
  209. package/dist/http/lazy-param.decorator.js +0 -117
  210. package/dist/http/request-container.d.ts +0 -16
  211. package/dist/http/request-container.js +0 -19
  212. package/dist/http/request-context.d.ts +0 -13
  213. package/dist/http/request-context.js +0 -22
  214. package/dist/http/response-mapper.d.ts +0 -8
  215. package/dist/http/response-mapper.js +0 -42
  216. package/dist/http/route-contributor.d.ts +0 -68
  217. package/dist/http/route-contributor.js +0 -22
  218. package/dist/http/route-map.d.ts +0 -30
  219. package/dist/http/route-map.js +0 -27
  220. package/dist/http/route.manager.d.ts +0 -92
  221. package/dist/http/route.manager.js +0 -481
  222. package/dist/http/types.d.ts +0 -37
  223. package/dist/http/types.js +0 -1
  224. package/dist/http/url/index.d.ts +0 -4
  225. package/dist/http/url/index.js +0 -3
  226. package/dist/http/url/signed-url.guard.d.ts +0 -27
  227. package/dist/http/url/signed-url.guard.js +0 -62
  228. package/dist/http/url/signing-secret.d.ts +0 -20
  229. package/dist/http/url/signing-secret.js +0 -24
  230. package/dist/http/url/url-generator.service.d.ts +0 -52
  231. package/dist/http/url/url-generator.service.js +0 -104
  232. package/dist/i18n/deep-merge.d.ts +0 -2
  233. package/dist/i18n/deep-merge.js +0 -15
  234. package/dist/i18n/i18n.middleware.d.ts +0 -15
  235. package/dist/i18n/i18n.middleware.js +0 -94
  236. package/dist/i18n/i18n.module.d.ts +0 -13
  237. package/dist/i18n/i18n.module.js +0 -69
  238. package/dist/i18n/i18n.options.d.ts +0 -30
  239. package/dist/i18n/i18n.options.js +0 -16
  240. package/dist/i18n/i18n.service.d.ts +0 -20
  241. package/dist/i18n/i18n.service.js +0 -49
  242. package/dist/i18n/i18n.tokens.d.ts +0 -6
  243. package/dist/i18n/i18n.tokens.js +0 -3
  244. package/dist/i18n/i18n.types.d.ts +0 -6
  245. package/dist/i18n/i18n.types.js +0 -1
  246. package/dist/i18n/message-loader.service.d.ts +0 -21
  247. package/dist/i18n/message-loader.service.js +0 -90
  248. package/dist/i18n/message-registry.d.ts +0 -16
  249. package/dist/i18n/message-registry.js +0 -49
  250. package/dist/lifecycle/index.d.ts +0 -20
  251. package/dist/lifecycle/index.js +0 -15
  252. package/dist/live/live.cursor.d.ts +0 -22
  253. package/dist/live/live.cursor.js +0 -56
  254. package/dist/live/live.decorators.d.ts +0 -32
  255. package/dist/live/live.decorators.js +0 -46
  256. package/dist/live/live.delta.d.ts +0 -15
  257. package/dist/live/live.delta.js +0 -51
  258. package/dist/live/live.engine.d.ts +0 -88
  259. package/dist/live/live.engine.js +0 -471
  260. package/dist/live/live.invalidation.d.ts +0 -45
  261. package/dist/live/live.invalidation.js +0 -99
  262. package/dist/live/live.module.d.ts +0 -28
  263. package/dist/live/live.module.js +0 -87
  264. package/dist/live/live.tokens.d.ts +0 -9
  265. package/dist/live/live.tokens.js +0 -8
  266. package/dist/live/live.types.d.ts +0 -138
  267. package/dist/live/live.types.js +0 -1
  268. package/dist/live/presence.d.ts +0 -44
  269. package/dist/live/presence.js +0 -130
  270. package/dist/metadata.d.ts +0 -10
  271. package/dist/metadata.js +0 -20
  272. package/dist/module/configurable-module.builder.d.ts +0 -56
  273. package/dist/module/configurable-module.builder.js +0 -84
  274. package/dist/module/configurable-module.types.d.ts +0 -93
  275. package/dist/module/configurable-module.types.js +0 -5
  276. package/dist/module/decorators.d.ts +0 -10
  277. package/dist/module/decorators.js +0 -47
  278. package/dist/module/define-module.d.ts +0 -112
  279. package/dist/module/define-module.js +0 -232
  280. package/dist/module/graph.d.ts +0 -10
  281. package/dist/module/graph.js +0 -35
  282. package/dist/module/index.d.ts +0 -10
  283. package/dist/module/index.js +0 -7
  284. package/dist/module/lazy-modules.d.ts +0 -82
  285. package/dist/module/lazy-modules.js +0 -231
  286. package/dist/module/lazy-provider.d.ts +0 -65
  287. package/dist/module/lazy-provider.js +0 -111
  288. package/dist/module/middleware.d.ts +0 -30
  289. package/dist/module/middleware.js +0 -67
  290. package/dist/module/module-loader.d.ts +0 -58
  291. package/dist/module/module-loader.js +0 -484
  292. package/dist/module/stable-hash.d.ts +0 -15
  293. package/dist/module/stable-hash.js +0 -52
  294. package/dist/module/types.d.ts +0 -1
  295. package/dist/module/types.js +0 -1
  296. package/dist/openapi/decorators.d.ts +0 -34
  297. package/dist/openapi/decorators.js +0 -66
  298. package/dist/openapi/document.d.ts +0 -3
  299. package/dist/openapi/document.js +0 -316
  300. package/dist/openapi/index.d.ts +0 -7
  301. package/dist/openapi/index.js +0 -6
  302. package/dist/openapi/redoc-ui.d.ts +0 -1
  303. package/dist/openapi/redoc-ui.js +0 -19
  304. package/dist/openapi/scalar-ui.d.ts +0 -1
  305. package/dist/openapi/scalar-ui.js +0 -19
  306. package/dist/openapi/swagger-ui.d.ts +0 -1
  307. package/dist/openapi/swagger-ui.js +0 -23
  308. package/dist/openapi/types.d.ts +0 -182
  309. package/dist/openapi/types.js +0 -4
  310. package/dist/openapi/zod-to-json-schema.d.ts +0 -4
  311. package/dist/openapi/zod-to-json-schema.js +0 -57
  312. package/dist/pipeline/app-providers.d.ts +0 -10
  313. package/dist/pipeline/app-providers.js +0 -43
  314. package/dist/pipeline/component.manager.d.ts +0 -25
  315. package/dist/pipeline/component.manager.js +0 -66
  316. package/dist/pipeline/decorators.d.ts +0 -10
  317. package/dist/pipeline/decorators.js +0 -42
  318. package/dist/pipeline/index.d.ts +0 -12
  319. package/dist/pipeline/index.js +0 -7
  320. package/dist/pipeline/pipeline-runner.d.ts +0 -31
  321. package/dist/pipeline/pipeline-runner.js +0 -40
  322. package/dist/pipeline/pipes.d.ts +0 -48
  323. package/dist/pipeline/pipes.js +0 -104
  324. package/dist/pipeline/reflector.d.ts +0 -86
  325. package/dist/pipeline/reflector.js +0 -121
  326. package/dist/pipeline/scoped-components.d.ts +0 -26
  327. package/dist/pipeline/scoped-components.js +0 -27
  328. package/dist/pipeline/tokens.d.ts +0 -57
  329. package/dist/pipeline/tokens.js +0 -47
  330. package/dist/pipeline/types.d.ts +0 -64
  331. package/dist/pipeline/types.js +0 -1
  332. package/dist/plugin/plugin.d.ts +0 -31
  333. package/dist/plugin/plugin.js +0 -111
  334. package/dist/queue/inline.driver.d.ts +0 -30
  335. package/dist/queue/inline.driver.js +0 -58
  336. package/dist/queue/queue.binding.d.ts +0 -23
  337. package/dist/queue/queue.binding.js +0 -60
  338. package/dist/queue/queue.client.d.ts +0 -20
  339. package/dist/queue/queue.client.js +0 -33
  340. package/dist/queue/queue.decorators.d.ts +0 -23
  341. package/dist/queue/queue.decorators.js +0 -46
  342. package/dist/queue/queue.dispatch.d.ts +0 -36
  343. package/dist/queue/queue.dispatch.js +0 -109
  344. package/dist/queue/queue.module.d.ts +0 -32
  345. package/dist/queue/queue.module.js +0 -80
  346. package/dist/queue/queue.tokens.d.ts +0 -21
  347. package/dist/queue/queue.tokens.js +0 -34
  348. package/dist/queue/queue.types.d.ts +0 -61
  349. package/dist/queue/queue.types.js +0 -4
  350. package/dist/registry/index.d.ts +0 -2
  351. package/dist/registry/index.js +0 -1
  352. package/dist/registry/metadata.registry.d.ts +0 -73
  353. package/dist/registry/metadata.registry.js +0 -357
  354. package/dist/registry/paths.d.ts +0 -3
  355. package/dist/registry/paths.js +0 -15
  356. package/dist/registry/types.d.ts +0 -116
  357. package/dist/registry/types.js +0 -1
  358. package/dist/registry/util.d.ts +0 -3
  359. package/dist/registry/util.js +0 -8
  360. package/dist/schedule/cron-matcher.d.ts +0 -2
  361. package/dist/schedule/cron-matcher.js +0 -62
  362. package/dist/schedule/index.d.ts +0 -8
  363. package/dist/schedule/index.js +0 -5
  364. package/dist/schedule/schedule.decorators.d.ts +0 -2
  365. package/dist/schedule/schedule.decorators.js +0 -18
  366. package/dist/schedule/schedule.module.d.ts +0 -9
  367. package/dist/schedule/schedule.module.js +0 -28
  368. package/dist/schedule/schedule.registry.d.ts +0 -23
  369. package/dist/schedule/schedule.registry.js +0 -63
  370. package/dist/schedule/schedule.tokens.d.ts +0 -2
  371. package/dist/schedule/schedule.tokens.js +0 -2
  372. package/dist/schedule/schedule.types.d.ts +0 -8
  373. package/dist/schedule/schedule.types.js +0 -1
  374. package/dist/schedule-node/schedule-node.module.d.ts +0 -9
  375. package/dist/schedule-node/schedule-node.module.js +0 -28
  376. package/dist/schedule-node/schedule.executor.d.ts +0 -19
  377. package/dist/schedule-node/schedule.executor.js +0 -112
  378. package/dist/seeder/seeder.decorator.d.ts +0 -7
  379. package/dist/seeder/seeder.decorator.js +0 -15
  380. package/dist/seeder/seeder.module.d.ts +0 -16
  381. package/dist/seeder/seeder.module.js +0 -44
  382. package/dist/seeder/seeder.registry.d.ts +0 -23
  383. package/dist/seeder/seeder.registry.js +0 -83
  384. package/dist/seeder/seeder.tokens.d.ts +0 -2
  385. package/dist/seeder/seeder.tokens.js +0 -1
  386. package/dist/seeder/seeder.types.d.ts +0 -20
  387. package/dist/seeder/seeder.types.js +0 -1
  388. package/dist/serialization/index.d.ts +0 -2
  389. package/dist/serialization/index.js +0 -2
  390. package/dist/serialization/serialize.decorator.d.ts +0 -6
  391. package/dist/serialization/serialize.decorator.js +0 -7
  392. package/dist/serialization/serializer.interceptor.d.ts +0 -4
  393. package/dist/serialization/serializer.interceptor.js +0 -16
  394. package/dist/services/index.d.ts +0 -2
  395. package/dist/services/index.js +0 -1
  396. package/dist/services/logger.d.ts +0 -59
  397. package/dist/services/logger.js +0 -159
  398. package/dist/storage/path-template.d.ts +0 -9
  399. package/dist/storage/path-template.js +0 -20
  400. package/dist/storage/storage.types.d.ts +0 -41
  401. package/dist/storage/storage.types.js +0 -5
  402. package/dist/throttler/index.d.ts +0 -6
  403. package/dist/throttler/index.js +0 -5
  404. package/dist/throttler/throttler.decorators.d.ts +0 -3
  405. package/dist/throttler/throttler.decorators.js +0 -4
  406. package/dist/throttler/throttler.guard.d.ts +0 -9
  407. package/dist/throttler/throttler.guard.js +0 -72
  408. package/dist/throttler/throttler.module.d.ts +0 -7
  409. package/dist/throttler/throttler.module.js +0 -41
  410. package/dist/throttler/throttler.storage.d.ts +0 -10
  411. package/dist/throttler/throttler.storage.js +0 -44
  412. package/dist/throttler/throttler.tokens.d.ts +0 -6
  413. package/dist/throttler/throttler.tokens.js +0 -5
  414. package/dist/throttler/throttler.types.d.ts +0 -25
  415. package/dist/throttler/throttler.types.js +0 -1
  416. package/dist/validation/create-zod-dto.d.ts +0 -13
  417. package/dist/validation/create-zod-dto.js +0 -18
  418. package/dist/validation/index.d.ts +0 -3
  419. package/dist/validation/index.js +0 -2
  420. package/dist/validation/validation.pipe.d.ts +0 -4
  421. package/dist/validation/validation.pipe.js +0 -19
  422. package/dist/websocket/websocket.decorators.d.ts +0 -47
  423. package/dist/websocket/websocket.decorators.js +0 -80
  424. package/dist/websocket/websocket.module.d.ts +0 -35
  425. package/dist/websocket/websocket.module.js +0 -63
  426. package/dist/websocket/websocket.tokens.d.ts +0 -30
  427. package/dist/websocket/websocket.tokens.js +0 -27
  428. package/dist/websocket/websocket.types.d.ts +0 -102
  429. package/dist/websocket/websocket.types.js +0 -4
  430. package/dist/websocket/ws-argument-resolver.d.ts +0 -13
  431. package/dist/websocket/ws-argument-resolver.js +0 -40
  432. package/dist/websocket/ws-dispatcher.d.ts +0 -54
  433. package/dist/websocket/ws-dispatcher.js +0 -343
  434. package/dist/websocket/ws-exception.d.ts +0 -25
  435. package/dist/websocket/ws-exception.js +0 -42
  436. package/dist/websocket/ws-execution-context.d.ts +0 -9
  437. package/dist/websocket/ws-execution-context.js +0 -24
  438. package/dist/websocket/ws-server.d.ts +0 -31
  439. package/dist/websocket/ws-server.js +0 -74
  440. package/dist/websocket/ws-sync.d.ts +0 -47
  441. package/dist/websocket/ws-sync.js +0 -74
  442. package/dist/websocket-node/node-ws-client.d.ts +0 -24
  443. package/dist/websocket-node/node-ws-client.js +0 -49
  444. package/dist/websocket-node/redis-live.d.ts +0 -24
  445. package/dist/websocket-node/redis-live.js +0 -57
  446. package/dist/websocket-node/redis-sync.d.ts +0 -33
  447. package/dist/websocket-node/redis-sync.js +0 -56
  448. package/dist/websocket-node/register-gateways.d.ts +0 -20
  449. package/dist/websocket-node/register-gateways.js +0 -61
@@ -1,93 +0,0 @@
1
- import type { InferTokens, InjectionToken, Token, Type } from '../container/types';
2
- import type { DynamicModule, ModuleImport } from '../registry/types';
3
- /**
4
- * Arbitrary extra keys a module accepts alongside its options bag (e.g.
5
- * `isGlobal`). Kept separate from the options type so the extras-transform can
6
- * reshape the generated {@link DynamicModule} without polluting `Opts`.
7
- */
8
- export type ConfigurableModuleExtras = Record<string, unknown>;
9
- /**
10
- * Reshape the generated definition based on the resolved extras. Runs after the
11
- * options provider + `key` are computed; the return value is the final
12
- * `DynamicModule`. Mirrors NestJS's `extras` transform.
13
- */
14
- export type ConfigurableModuleExtrasTransform<E extends ConfigurableModuleExtras> = (definition: DynamicModule, extras: E) => DynamicModule;
15
- /**
16
- * The contract a `useClass`/`useExisting` async-options factory must satisfy:
17
- * a single method (default name `create`) returning the module options.
18
- */
19
- export type ConfigurableModuleOptionsFactory<Opts, MethodName extends string> = {
20
- [K in MethodName]: () => Opts | Promise<Opts>;
21
- };
22
- /**
23
- * Async configuration accepted by the generated `<method>Async` static.
24
- *
25
- * Superset of `AsyncModuleOptions` (`registry/types.ts`): adds NestJS's
26
- * `useClass`/`useExisting` while preserving the headline `const Inject` tuple
27
- * inference for `useFactory` params (no `as const` needed at the call site).
28
- */
29
- export interface ConfigurableModuleAsyncOptions<Opts, MethodName extends string = 'create', Inject extends readonly Token<unknown>[] = readonly Token<unknown>[]> {
30
- imports?: ModuleImport[];
31
- inject?: Inject;
32
- useFactory?: (...args: InferTokens<Inject>) => Opts | Promise<Opts>;
33
- useClass?: Type<ConfigurableModuleOptionsFactory<Opts, MethodName>>;
34
- useExisting?: Token<ConfigurableModuleOptionsFactory<Opts, MethodName>>;
35
- /** Explicit instance discriminator (see {@link DynamicModule.key}). */
36
- key?: string;
37
- }
38
- export interface ConfigurableModuleBuilderOptions {
39
- /** Names the generated base class + the auto-minted options token, and feeds diagnostics. */
40
- moduleName?: string;
41
- /**
42
- * Reuse an existing options token instead of minting one. **Critical for
43
- * migrations** so the module's public token keeps its identity.
44
- */
45
- optionsInjectionToken?: InjectionToken<unknown>;
46
- }
47
- /**
48
- * The generated base class type, carrying dynamically-named `<method>` and
49
- * `<method>Async` statics. A module does `class Foo extends ConfigurableModuleClass {}`
50
- * and gets `Foo.forRoot(...)` / `Foo.forRootAsync(...)` for free.
51
- */
52
- export type ConfigurableModuleClassType<Opts, MethodKey extends string, FactoryMethodKey extends string, Extras extends ConfigurableModuleExtras> = (new () => object) & Record<MethodKey, (options: Opts & Partial<Extras> & {
53
- key?: string;
54
- }) => DynamicModule> & Record<`${MethodKey}Async`, <const Inject extends readonly Token<unknown>[]>(options: ConfigurableModuleAsyncOptions<Opts, FactoryMethodKey, Inject> & Partial<Extras> & {
55
- key?: string;
56
- }) => DynamicModule>;
57
- export interface ConfigurableModuleHost<Opts, MethodKey extends string = 'forRoot', FactoryMethodKey extends string = 'create', Extras extends ConfigurableModuleExtras = {
58
- isGlobal?: boolean;
59
- }> {
60
- /** Base class to `extends`. */
61
- ConfigurableModuleClass: ConfigurableModuleClassType<Opts, MethodKey, FactoryMethodKey, Extras>;
62
- /** The options token — inject it into derived providers (`inject: [MODULE_OPTIONS_TOKEN]`). */
63
- MODULE_OPTIONS_TOKEN: InjectionToken<Opts>;
64
- /** Type-only helper: the shape accepted by the sync `<method>` static. */
65
- OPTIONS_TYPE: Opts & Partial<Extras> & {
66
- key?: string;
67
- };
68
- /** Type-only helper: the shape accepted by the `<method>Async` static. */
69
- ASYNC_OPTIONS_TYPE: ConfigurableModuleAsyncOptions<Opts, FactoryMethodKey> & Partial<Extras> & {
70
- key?: string;
71
- };
72
- }
73
- /**
74
- * Low-level engine spec (see `defineConfigurableModule`). Used for the cases a
75
- * class-mixin can't express — notably runtime-generated module classes whose
76
- * providers depend on a call-time argument (e.g. Cloudflare binding modules).
77
- */
78
- export interface DefineConfigurableModuleSpec<Args> {
79
- /** The module class to reference in `{ module }`. */
80
- module: Type;
81
- /** Static method name to generate (e.g. `forRoot`). */
82
- methodName?: string;
83
- /** Derive the instance `key` from the call args. */
84
- keyFrom: (args: Args) => string;
85
- /** Build the provider list from the call args. */
86
- providers: (args: Args) => DynamicModule['providers'];
87
- /** Optional exports (usually prefer declaring these on `@Module`). */
88
- exports?: DynamicModule['exports'];
89
- /** Optional imports. */
90
- imports?: (args: Args) => DynamicModule['imports'];
91
- /** Mark the produced module global. */
92
- global?: boolean;
93
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Low-level engine spec (see `defineConfigurableModule`). Used for the cases a
3
- * class-mixin can't express — notably runtime-generated module classes whose
4
- * providers depend on a call-time argument (e.g. Cloudflare binding modules).
5
- */ export { };
@@ -1,10 +0,0 @@
1
- import type { Constructor, DynamicModule, ModuleMetadata, ModuleOptions } from '../registry/types';
2
- export declare function Global(): ClassDecorator;
3
- export declare function Module(options?: ModuleOptions): ClassDecorator;
4
- export declare function isModule(target: Constructor): boolean;
5
- /**
6
- * Normalize a DynamicModule, defaulting `key` to `"default"`. Module authors
7
- * call this from `forRoot()` so the loader always sees an explicit key.
8
- */
9
- export declare function defineDynamicModule(input: DynamicModule): DynamicModule;
10
- export declare function getModuleMetadata(target: Constructor): ModuleMetadata | undefined;
@@ -1,47 +0,0 @@
1
- import { MetadataRegistry } from "../registry/metadata.registry.js";
2
- export function Global() {
3
- return (target)=>{
4
- const ctor = target;
5
- const existing = MetadataRegistry.getModuleOptions(ctor);
6
- MetadataRegistry.setModuleOptions(ctor, {
7
- ...existing,
8
- isGlobal: true
9
- });
10
- };
11
- }
12
- export function Module(options = {}) {
13
- return (target)=>{
14
- MetadataRegistry.setModuleOptions(target, {
15
- imports: options.imports,
16
- providers: options.providers,
17
- controllers: options.controllers,
18
- exports: options.exports,
19
- isGlobal: options.isGlobal,
20
- lazy: options.lazy
21
- });
22
- };
23
- }
24
- export function isModule(target) {
25
- return MetadataRegistry.getModuleOptions(target) !== undefined;
26
- }
27
- /**
28
- * Normalize a DynamicModule, defaulting `key` to `"default"`. Module authors
29
- * call this from `forRoot()` so the loader always sees an explicit key.
30
- */ export function defineDynamicModule(input) {
31
- return {
32
- ...input,
33
- key: input.key ?? 'default'
34
- };
35
- }
36
- export function getModuleMetadata(target) {
37
- const options = MetadataRegistry.getModuleOptions(target);
38
- if (!options) return undefined;
39
- return {
40
- providers: options.providers ?? [],
41
- controllers: options.controllers ?? [],
42
- imports: options.imports ?? [],
43
- exports: options.exports ?? [],
44
- isGlobal: options.isGlobal === true,
45
- lazy: options.lazy === true
46
- };
47
- }
@@ -1,112 +0,0 @@
1
- import { InjectionToken, type ProviderOptions, type Token, type Type } from '../container/types';
2
- import type { ComponentInstance, ModuleImport } from '../registry/types';
3
- import type { ConfigurableModuleAsyncOptions, ConfigurableModuleExtras, ConfigurableModuleExtrasTransform, ConfigurableModuleHost } from './configurable-module.types';
4
- /** The `global:` slot's component groups, lowered to `APP_*` registrations. */
5
- export interface GlobalComponentSlot {
6
- guards?: Array<Type | ComponentInstance>;
7
- pipes?: Array<Type | ComponentInstance>;
8
- interceptors?: Array<Type | ComponentInstance>;
9
- filters?: Array<Type | ComponentInstance>;
10
- middleware?: Array<Type | ComponentInstance>;
11
- }
12
- /** What a module instance contributes, computed from its call-time options. */
13
- export interface ModuleContributions {
14
- providers?: Array<Type | ProviderOptions>;
15
- controllers?: Type[];
16
- imports?: ModuleImport[];
17
- exports?: Array<Type | InjectionToken>;
18
- /**
19
- * Standardized global-component registration — the one idiom replacing both
20
- * the `@Module({ providers: [{ provide: APP_GUARD, useExisting: X }] })`
21
- * pattern and the conditional-push-into-forRoot pattern. Class entries are
22
- * registered as providers and wired via `useExisting`; instances via `useValue`.
23
- */
24
- global?: GlobalComponentSlot;
25
- }
26
- export interface ModuleSetupContext<Opts> {
27
- /** The options token — derived providers do `inject: [OPTIONS]`. */
28
- readonly OPTIONS: InjectionToken<Opts>;
29
- /**
30
- * Structural options known at call time. For `forRoot` this is the full
31
- * bag; for `forRootAsync` it is only the structural fields passed alongside
32
- * the factory (the DI-resolved options exist only at resolution time —
33
- * read them through `OPTIONS`, never here).
34
- */
35
- readonly options: Partial<Opts>;
36
- /** The instance key in effect (for deriving per-instance token names). */
37
- readonly key: string;
38
- }
39
- export interface DefineModuleSpec<Opts, Extras extends ConfigurableModuleExtras = {
40
- isGlobal?: boolean;
41
- }, MethodKey extends string = 'forRoot', FactoryMethodKey extends string = 'create'> {
42
- /** Names the generated base class, the minted options token, and diagnostics. */
43
- name: string;
44
- /**
45
- * Reuse an existing options token instead of minting one — critical for
46
- * migrations so the module's public token keeps its identity.
47
- */
48
- optionsToken?: InjectionToken<Opts>;
49
- /**
50
- * Structural contributions as a function of the call-time options. Runs at
51
- * `forRoot`/`forRootAsync` call time, once per module instance.
52
- */
53
- setup?: (ctx: ModuleSetupContext<Opts>) => ModuleContributions;
54
- /**
55
- * Dedup key from the structural options. Defaults to `stableHash(options)`.
56
- * Modules whose options carry stateful instances (drivers, registries)
57
- * should derive from the stable identifying subset — or document that
58
- * callers pass an explicit `key` for multi-instance setups.
59
- */
60
- key?: (options: Partial<Opts>) => string;
61
- /** Call-site extras defaults (default `{ isGlobal: false }`). */
62
- extras?: Extras;
63
- /** Reshape the definition from resolved extras (default: `isGlobal` → `global: true`). */
64
- transform?: ConfigurableModuleExtrasTransform<Extras>;
65
- /** Rename the sync static (default `forRoot`); the async static becomes `<name>Async`. */
66
- methodName?: MethodKey;
67
- /** Method a `useClass`/`useExisting` options factory must implement (default `create`). */
68
- factoryMethodName?: FactoryMethodKey;
69
- /**
70
- * Default every generated module instance to deferred (first-use)
71
- * materialization. Call sites can also opt in per instance by passing
72
- * `lazy: true` alongside the options (recognized like `isGlobal`).
73
- * See MODULE_AUTHORING.md "Lazy modules".
74
- */
75
- lazy?: boolean;
76
- }
77
- /**
78
- * The one blessed module-authoring engine. Generates `forRoot` AND
79
- * `forRootAsync` statics with: `stableHash` key derivation (multi-instance
80
- * dedup that survives HMR), typed `inject` tuple inference on the async
81
- * factory, an `isGlobal` extra, and — the piece `ConfigurableModuleBuilder`
82
- * could not express — providers/controllers/imports/exports/global components
83
- * computed **as functions of the options**.
84
- *
85
- * ```ts
86
- * const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } = defineModule<CorsOptions>({
87
- * name: 'Cors',
88
- * setup: ({ OPTIONS }) => ({
89
- * providers: [{
90
- * provide: APP_MIDDLEWARE,
91
- * useFactory: (o: CorsOptions) => buildCorsMiddleware(o),
92
- * inject: [OPTIONS],
93
- * }],
94
- * exports: [OPTIONS],
95
- * }),
96
- * });
97
- * export class CorsModule extends ConfigurableModuleClass {}
98
- * ```
99
- *
100
- * `ConfigurableModuleBuilder` remains supported (NestJS parity) and is a thin
101
- * adapter over this engine.
102
- */
103
- export declare function defineModule<Opts, Extras extends ConfigurableModuleExtras = {
104
- isGlobal?: boolean;
105
- }, MethodKey extends string = 'forRoot', FactoryMethodKey extends string = 'create'>(spec: DefineModuleSpec<Opts, Extras, MethodKey, FactoryMethodKey>): ConfigurableModuleHost<Opts, MethodKey, FactoryMethodKey, Extras>;
106
- /**
107
- * Lower `useFactory`/`useClass`/`useExisting` async options into provider
108
- * registrations. Structural fields from the call site merge UNDER the resolved
109
- * options (`{ ...structural, ...resolved }`) so sync-declared fields act as
110
- * defaults and the factory stays authoritative.
111
- */
112
- export declare function buildAsyncOptionsProviders<Opts>(optionsToken: Token, factoryMethodName: string, async: Pick<ConfigurableModuleAsyncOptions<Opts>, 'inject' | 'useFactory' | 'useClass' | 'useExisting'>, structural?: Record<string, unknown>): Array<ProviderOptions>;
@@ -1,232 +0,0 @@
1
- import { InjectionToken } from "../container/types.js";
2
- import { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_MIDDLEWARE, APP_PIPE } from "../pipeline/tokens.js";
3
- import { stableHash } from "./stable-hash.js";
4
- const DEFAULT_EXTRAS = {
5
- isGlobal: false
6
- };
7
- const DEFAULT_TRANSFORM = (def, extras)=>extras.isGlobal ? {
8
- ...def,
9
- global: true
10
- } : def;
11
- const GLOBAL_SLOT_TOKENS = {
12
- guards: APP_GUARD,
13
- pipes: APP_PIPE,
14
- interceptors: APP_INTERCEPTOR,
15
- filters: APP_FILTER,
16
- middleware: APP_MIDDLEWARE
17
- };
18
- /** Lower a `global:` slot to `APP_*` provider registrations. */ function lowerGlobalSlot(slot) {
19
- const out = [];
20
- for (const kind of Object.keys(GLOBAL_SLOT_TOKENS)){
21
- for (const component of slot[kind] ?? []){
22
- const token = GLOBAL_SLOT_TOKENS[kind];
23
- if (typeof component === 'function') {
24
- out.push(component, {
25
- provide: token,
26
- useExisting: component
27
- });
28
- } else {
29
- out.push({
30
- provide: token,
31
- useValue: component
32
- });
33
- }
34
- }
35
- }
36
- return out;
37
- }
38
- const ASYNC_OPTION_KEYS = new Set([
39
- 'key',
40
- 'imports',
41
- 'inject',
42
- 'useFactory',
43
- 'useClass',
44
- 'useExisting'
45
- ]);
46
- /**
47
- * The one blessed module-authoring engine. Generates `forRoot` AND
48
- * `forRootAsync` statics with: `stableHash` key derivation (multi-instance
49
- * dedup that survives HMR), typed `inject` tuple inference on the async
50
- * factory, an `isGlobal` extra, and — the piece `ConfigurableModuleBuilder`
51
- * could not express — providers/controllers/imports/exports/global components
52
- * computed **as functions of the options**.
53
- *
54
- * ```ts
55
- * const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } = defineModule<CorsOptions>({
56
- * name: 'Cors',
57
- * setup: ({ OPTIONS }) => ({
58
- * providers: [{
59
- * provide: APP_MIDDLEWARE,
60
- * useFactory: (o: CorsOptions) => buildCorsMiddleware(o),
61
- * inject: [OPTIONS],
62
- * }],
63
- * exports: [OPTIONS],
64
- * }),
65
- * });
66
- * export class CorsModule extends ConfigurableModuleClass {}
67
- * ```
68
- *
69
- * `ConfigurableModuleBuilder` remains supported (NestJS parity) and is a thin
70
- * adapter over this engine.
71
- */ export function defineModule(spec) {
72
- const optionsToken = spec.optionsToken ?? new InjectionToken(`${spec.name}_MODULE_OPTIONS`);
73
- const syncName = spec.methodName ?? 'forRoot';
74
- const asyncName = `${syncName}Async`;
75
- const factoryMethodName = spec.factoryMethodName ?? 'create';
76
- const extrasDefaults = spec.extras ?? DEFAULT_EXTRAS;
77
- const transform = spec.transform ?? DEFAULT_TRANSFORM;
78
- const deriveKey = (explicit, structural)=>explicit ?? spec.key?.(structural) ?? stableHash(structural);
79
- // Laziness is OR-composed: the spec defaults it, a call site can add it.
80
- const applyLazy = (definition, callSiteLazy)=>spec.lazy === true || callSiteLazy === true ? {
81
- ...definition,
82
- lazy: true
83
- } : definition;
84
- const applyContributions = (definition, structural, key)=>{
85
- if (!spec.setup) return definition;
86
- const contributions = spec.setup({
87
- OPTIONS: optionsToken,
88
- options: structural,
89
- key
90
- });
91
- const providers = [
92
- ...definition.providers ?? [],
93
- ...contributions.providers ?? [],
94
- ...contributions.global ? lowerGlobalSlot(contributions.global) : []
95
- ];
96
- return {
97
- ...definition,
98
- providers,
99
- controllers: [
100
- ...definition.controllers ?? [],
101
- ...contributions.controllers ?? []
102
- ],
103
- imports: [
104
- ...definition.imports ?? [],
105
- ...contributions.imports ?? []
106
- ],
107
- exports: [
108
- ...definition.exports ?? [],
109
- ...contributions.exports ?? []
110
- ]
111
- };
112
- };
113
- let GeneratedModuleClass = class GeneratedModuleClass {
114
- };
115
- Object.defineProperty(GeneratedModuleClass, 'name', {
116
- value: `${spec.name}ModuleHost`
117
- });
118
- Object.defineProperty(GeneratedModuleClass, syncName, {
119
- configurable: true,
120
- writable: true,
121
- enumerable: false,
122
- value (options = {}) {
123
- const { key: explicitKey, ...rest } = options;
124
- const key = deriveKey(explicitKey, rest);
125
- const definition = {
126
- module: this,
127
- key,
128
- providers: [
129
- {
130
- provide: optionsToken,
131
- useValue: rest
132
- }
133
- ]
134
- };
135
- return applyLazy(transform(applyContributions(definition, rest, key), {
136
- ...extrasDefaults,
137
- ...rest
138
- }), rest.lazy);
139
- }
140
- });
141
- Object.defineProperty(GeneratedModuleClass, asyncName, {
142
- configurable: true,
143
- writable: true,
144
- enumerable: false,
145
- value (options = {}) {
146
- const bag = options;
147
- const structural = {};
148
- for (const [k, v] of Object.entries(bag)){
149
- if (!ASYNC_OPTION_KEYS.has(k)) structural[k] = v;
150
- }
151
- const key = deriveKey(bag.key, // Async factories aren't structurally hashable in a useful way, so the
152
- // default key hashes the async wiring + structural fields — same
153
- // instance-identity semantics ConfigurableModuleBuilder always had.
154
- spec.key ? structural : {
155
- inject: bag.inject,
156
- useFactory: bag.useFactory,
157
- useClass: bag.useClass,
158
- useExisting: bag.useExisting,
159
- ...structural
160
- });
161
- const definition = {
162
- module: this,
163
- key,
164
- imports: bag.imports ?? [],
165
- providers: buildAsyncOptionsProviders(optionsToken, factoryMethodName, bag, structural)
166
- };
167
- return applyLazy(transform(applyContributions(definition, structural, key), {
168
- ...extrasDefaults,
169
- ...structural
170
- }), structural.lazy);
171
- }
172
- });
173
- return {
174
- ConfigurableModuleClass: GeneratedModuleClass,
175
- MODULE_OPTIONS_TOKEN: optionsToken,
176
- // Type-only sentinels — never read at runtime.
177
- OPTIONS_TYPE: undefined,
178
- ASYNC_OPTIONS_TYPE: undefined
179
- };
180
- }
181
- /**
182
- * Lower `useFactory`/`useClass`/`useExisting` async options into provider
183
- * registrations. Structural fields from the call site merge UNDER the resolved
184
- * options (`{ ...structural, ...resolved }`) so sync-declared fields act as
185
- * defaults and the factory stays authoritative.
186
- */ export function buildAsyncOptionsProviders(optionsToken, factoryMethodName, async, structural = {}) {
187
- const hasStructural = Object.keys(structural).length > 0;
188
- const merge = (resolved)=>resolved instanceof Promise ? resolved.then((o)=>({
189
- ...structural,
190
- ...o
191
- })) : {
192
- ...structural,
193
- ...resolved
194
- };
195
- if (async.useFactory) {
196
- const factory = async.useFactory;
197
- return [
198
- {
199
- provide: optionsToken,
200
- // No structural fields → pass the caller's factory through untouched
201
- // (function identity preserved; nothing to merge).
202
- useFactory: hasStructural ? (...deps)=>merge(factory(...deps)) : factory,
203
- inject: async.inject ?? []
204
- }
205
- ];
206
- }
207
- if (async.useClass) {
208
- const factoryClass = async.useClass;
209
- return [
210
- factoryClass,
211
- {
212
- provide: optionsToken,
213
- useFactory: (instance)=>merge(instance[factoryMethodName]()),
214
- inject: [
215
- factoryClass
216
- ]
217
- }
218
- ];
219
- }
220
- if (async.useExisting) {
221
- return [
222
- {
223
- provide: optionsToken,
224
- useFactory: (instance)=>merge(instance[factoryMethodName]()),
225
- inject: [
226
- async.useExisting
227
- ]
228
- }
229
- ];
230
- }
231
- throw new Error('Async module options require one of `useFactory`, `useClass`, or `useExisting`.');
232
- }
@@ -1,10 +0,0 @@
1
- import type { Type } from '../container/types';
2
- /**
3
- * Walks the module dependency graph from a root, unwrapping ForwardRef and
4
- * dynamic-module imports along the way, and returns every controller
5
- * reachable from it. Pure metadata read — no Container, no side effects.
6
- *
7
- * Used by createOpenApiDocument and any other consumer that needs a
8
- * controller list without bootstrapping the application.
9
- */
10
- export declare function collectControllers(rootModule: Type): Type[];
@@ -1,35 +0,0 @@
1
- import { ForwardRef } from "../container/types.js";
2
- import { getModuleMetadata } from "./decorators.js";
3
- function isDynamicModuleLike(value) {
4
- return !!value && typeof value === 'object' && 'module' in value && typeof value.module === 'function';
5
- }
6
- /**
7
- * Walks the module dependency graph from a root, unwrapping ForwardRef and
8
- * dynamic-module imports along the way, and returns every controller
9
- * reachable from it. Pure metadata read — no Container, no side effects.
10
- *
11
- * Used by createOpenApiDocument and any other consumer that needs a
12
- * controller list without bootstrapping the application.
13
- */ export function collectControllers(rootModule) {
14
- const visited = new Set();
15
- const controllers = new Set();
16
- const visit = (entry)=>{
17
- const unwrapped = entry instanceof ForwardRef ? entry.factory() : entry;
18
- const moduleClass = isDynamicModuleLike(unwrapped) ? unwrapped.module : unwrapped;
19
- const extraControllers = isDynamicModuleLike(unwrapped) ? unwrapped.controllers ?? [] : [];
20
- const extraImports = isDynamicModuleLike(unwrapped) ? unwrapped.imports ?? [] : [];
21
- if (typeof moduleClass !== 'function' || visited.has(moduleClass)) return;
22
- visited.add(moduleClass);
23
- const metadata = getModuleMetadata(moduleClass);
24
- if (metadata) {
25
- for (const controller of metadata.controllers)controllers.add(controller);
26
- for (const imp of metadata.imports)visit(imp);
27
- }
28
- for (const controller of extraControllers)controllers.add(controller);
29
- for (const imp of extraImports)visit(imp);
30
- };
31
- visit(rootModule);
32
- return [
33
- ...controllers
34
- ];
35
- }
@@ -1,10 +0,0 @@
1
- export { Global, Module, isModule, getModuleMetadata, defineDynamicModule, } from './decorators';
2
- export { stableHash } from './stable-hash';
3
- export { ConfigurableModuleBuilder, defineConfigurableModule, moduleKey, } from './configurable-module.builder';
4
- export { defineModule, buildAsyncOptionsProviders, type DefineModuleSpec, type GlobalComponentSlot, type ModuleContributions, type ModuleSetupContext, } from './define-module';
5
- export { lazyProvider, moduleToken, provideGlobal, sideEffectModule, type LazyProviderSpec, } from './lazy-provider';
6
- export type { ConfigurableModuleAsyncOptions, ConfigurableModuleBuilderOptions, ConfigurableModuleClassType, ConfigurableModuleExtras, ConfigurableModuleExtrasTransform, ConfigurableModuleHost, ConfigurableModuleOptionsFactory, DefineConfigurableModuleSpec, } from './configurable-module.types';
7
- export { ModuleLoader } from './module-loader';
8
- export { MiddlewareBuilder } from './middleware';
9
- export type { MiddlewareConsumer, MiddlewareConfigProxy, MiddlewareRouteDefinition, NestModule, RouteInfo, } from './middleware';
10
- export type { ModuleOptions, ModuleMetadata, DynamicModule, AsyncModuleOptions, ModuleImport } from './types';
@@ -1,7 +0,0 @@
1
- export { Global, Module, isModule, getModuleMetadata, defineDynamicModule } from "./decorators.js";
2
- export { stableHash } from "./stable-hash.js";
3
- export { ConfigurableModuleBuilder, defineConfigurableModule, moduleKey } from "./configurable-module.builder.js";
4
- export { defineModule, buildAsyncOptionsProviders } from "./define-module.js";
5
- export { lazyProvider, moduleToken, provideGlobal, sideEffectModule } from "./lazy-provider.js";
6
- export { ModuleLoader } from "./module-loader.js";
7
- export { MiddlewareBuilder } from "./middleware.js";
@@ -1,82 +0,0 @@
1
- import type { Container } from '../container/container';
2
- import type { LazyResolutionHook, Token } from '../container/types';
3
- /** One lazy module instance's deferral unit: its own tokens, in registration order. */
4
- export interface LazyModuleGroup {
5
- moduleId: string;
6
- tokens: Token[];
7
- /**
8
- * A class provider's prototype declares `collectEntrypoints` — the module
9
- * must be materialized before the entrypoint registry snapshot or its
10
- * computed contributions would be silently absent.
11
- */
12
- hasEntrypointContributor: boolean;
13
- }
14
- /**
15
- * Owns deferred-module state for one application: which module instances are
16
- * still pending, which have been claimed by a container trigger, and how
17
- * claimed groups get completed (construction + lifecycle-hook replay).
18
- *
19
- * Phases:
20
- * - `'bootstrap'` (until the end of `callOnApplicationBootstrap`): completed
21
- * groups are *absorbed* — their instances queue up for the application's
22
- * normal hook phases, so a lazy module dragged in by an eager consumer gets
23
- * today-identical semantics.
24
- * - `'live'`: hooks replay at drain time (memoized, exactly once), then the
25
- * instances are handed to the application for shutdown-hook symmetry.
26
- *
27
- * Sync/async duality: sync drains throw a descriptive error when a member
28
- * factory or hook yields a thenable — lazy modules with async providers or
29
- * hooks must be reached through an async seam (`materializeLazyModules()`,
30
- * `resolveAsync`) or stay eager.
31
- */
32
- export declare class LazyModuleManager implements LazyResolutionHook {
33
- private readonly container;
34
- private readonly pending;
35
- private readonly claimed;
36
- private readonly absorbed;
37
- private phase;
38
- private draining;
39
- private drainPromise?;
40
- private onMaterialized?;
41
- constructor(container: Container);
42
- registerGroup(group: LazyModuleGroup): void;
43
- /** Application sink for live-phase materializations (shutdown symmetry). */
44
- setOnMaterialized(sink: (instances: unknown[]) => void): void;
45
- setPhaseLive(): void;
46
- isPending(moduleId: string): boolean;
47
- /** Tokens whose owning modules are ALL still pending are deferred. */
48
- hasPendingModules(): boolean;
49
- claim(moduleId: string): void;
50
- hasClaimed(): boolean;
51
- /**
52
- * A drain loop is running. The container consults this before its
53
- * post-resolution drain: `constructGroupAsync` resolves members through
54
- * `resolveAsync`, whose end-of-cascade check would otherwise re-enter and
55
- * AWAIT the very drain promise it is executing inside — a self-referential
56
- * await that never settles (with ≥2 claimed groups). Claims made while
57
- * draining are picked up by the running loop instead.
58
- */
59
- isDraining(): boolean;
60
- /** Instances constructed during the bootstrap phase, owed their hooks. */
61
- takeAbsorbed(): unknown[];
62
- drainSync(): void;
63
- drainAsync(): Promise<void>;
64
- /**
65
- * Materialize every still-pending group whose providers compute entrypoints
66
- * (`collectEntrypoints` on a class prototype). Called by the application
67
- * right before the entrypoint-registry snapshot so computed contributions
68
- * are never silently absent. The cost — those modules are effectively
69
- * eager — is the documented price of contributing computed entrypoints.
70
- */
71
- materializeContributors(): Promise<void>;
72
- /** Materialize everything still pending (warmup / tests / node runtimes). */
73
- materializeAll(): Promise<void>;
74
- private groupTokensToConstruct;
75
- private constructGroupSync;
76
- private constructGroupAsync;
77
- /** Reversed batch = dependency-before-consumer (see drainSync comment). */
78
- private orderBatch;
79
- private finishBatchSync;
80
- private finishBatchAsync;
81
- private describeSyncFailure;
82
- }