@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators-C8YBFCIk.js","names":[],"sources":["../src/module/decorators.ts"],"sourcesContent":["import { MetadataRegistry } from '../registry/metadata.registry';\nimport type { Constructor, DynamicModule, ModuleMetadata, ModuleOptions } from '../registry/types';\n\nexport function Global(): ClassDecorator {\n return (target) => {\n const ctor = target as unknown as Constructor;\n const existing = MetadataRegistry.getModuleOptions(ctor);\n MetadataRegistry.setModuleOptions(ctor, { ...existing, isGlobal: true });\n };\n}\n\nexport function Module(options: ModuleOptions = {}): ClassDecorator {\n return (target) => {\n MetadataRegistry.setModuleOptions(target as unknown as Constructor, {\n imports: options.imports,\n providers: options.providers,\n controllers: options.controllers,\n exports: options.exports,\n isGlobal: options.isGlobal,\n lazy: options.lazy,\n });\n };\n}\n\nexport function isModule(target: Constructor): boolean {\n return MetadataRegistry.getModuleOptions(target) !== undefined;\n}\n\n/**\n * Normalize a DynamicModule, defaulting `key` to `\"default\"`. Module authors\n * call this from `forRoot()` so the loader always sees an explicit key.\n */\nexport function defineDynamicModule(input: DynamicModule): DynamicModule {\n return { ...input, key: input.key ?? 'default' };\n}\n\nexport function getModuleMetadata(target: Constructor): ModuleMetadata | undefined {\n const options = MetadataRegistry.getModuleOptions(target);\n if (!options) return undefined;\n\n return {\n providers: options.providers ?? [],\n controllers: options.controllers ?? [],\n imports: options.imports ?? [],\n exports: options.exports ?? [],\n isGlobal: options.isGlobal === true,\n lazy: options.lazy === true,\n };\n}\n"],"mappings":";;AAGA,SAAgB,SAAyB;CACvC,QAAQ,WAAW;EACjB,MAAM,OAAO;EACb,MAAM,WAAW,iBAAiB,iBAAiB,IAAI;EACvD,iBAAiB,iBAAiB,MAAM;GAAE,GAAG;GAAU,UAAU;EAAK,CAAC;CACzE;AACF;AAEA,SAAgB,OAAO,UAAyB,CAAC,GAAmB;CAClE,QAAQ,WAAW;EACjB,iBAAiB,iBAAiB,QAAkC;GAClE,SAAS,QAAQ;GACjB,WAAW,QAAQ;GACnB,aAAa,QAAQ;GACrB,SAAS,QAAQ;GACjB,UAAU,QAAQ;GAClB,MAAM,QAAQ;EAChB,CAAC;CACH;AACF;AAEA,SAAgB,SAAS,QAA8B;CACrD,OAAO,iBAAiB,iBAAiB,MAAM,MAAM,KAAA;AACvD;;;;;AAMA,SAAgB,oBAAoB,OAAqC;CACvE,OAAO;EAAE,GAAG;EAAO,KAAK,MAAM,OAAO;CAAU;AACjD;AAEA,SAAgB,kBAAkB,QAAiD;CACjF,MAAM,UAAU,iBAAiB,iBAAiB,MAAM;CACxD,IAAI,CAAC,SAAS,OAAO,KAAA;CAErB,OAAO;EACL,WAAW,QAAQ,aAAa,CAAC;EACjC,aAAa,QAAQ,eAAe,CAAC;EACrC,SAAS,QAAQ,WAAW,CAAC;EAC7B,SAAS,QAAQ,WAAW,CAAC;EAC7B,UAAU,QAAQ,aAAa;EAC/B,MAAM,QAAQ,SAAS;CACzB;AACF"}
@@ -0,0 +1,235 @@
1
+ import { C as InjectionToken, _ as APP_GUARD, b as APP_PIPE, g as APP_FILTER, v as APP_INTERCEPTOR, y as APP_MIDDLEWARE } from "./decorate-GcSMAbKn.js";
2
+ //#region src/module/stable-hash.ts
3
+ /**
4
+ * Deterministic, sync, edge-safe hash for module-instance discrimination.
5
+ *
6
+ * Walks values (objects/arrays/primitives/functions/class instances) into a
7
+ * sorted, source-fingerprinting JSON string, then runs FNV-1a (32-bit) for a
8
+ * compact 8-hex-char output.
9
+ *
10
+ * Functions and class instances are tolerated — they become `__fn:source` or
11
+ * `__cls:ClassName` markers. Two distinct closures with the same source code
12
+ * collide; module authors who care about that should pass an explicit `key`.
13
+ *
14
+ * Not cryptographic. Sufficient for discriminating module instances within
15
+ * an app.
16
+ */
17
+ function stableHash(value) {
18
+ return fnv1a(stableStringify(value));
19
+ }
20
+ function stableStringify(value) {
21
+ if (value === null || value === void 0) return JSON.stringify(value) ?? "undefined";
22
+ if (typeof value === "function") return `__fn:${fnv1a(value.toString())}`;
23
+ if (typeof value === "symbol") return `__sym:${value.description ?? ""}`;
24
+ if (typeof value !== "object") return JSON.stringify(value);
25
+ if (Array.isArray(value)) return "[" + value.map(stableStringify).join(",") + "]";
26
+ const proto = Object.getPrototypeOf(value);
27
+ if (proto !== null && proto !== Object.prototype) return `__cls:${proto?.constructor?.name ?? "AnonymousClass"}` + stringifyOwnProps(value);
28
+ return stringifyOwnProps(value);
29
+ }
30
+ function stringifyOwnProps(obj) {
31
+ return "{" + Object.keys(obj).sort().map((k) => JSON.stringify(k) + ":" + stableStringify(obj[k])).join(",") + "}";
32
+ }
33
+ function fnv1a(s) {
34
+ let h = 2166136261;
35
+ for (let i = 0; i < s.length; i++) {
36
+ h ^= s.charCodeAt(i);
37
+ h = Math.imul(h, 16777619);
38
+ }
39
+ return (h >>> 0).toString(16).padStart(8, "0");
40
+ }
41
+ //#endregion
42
+ //#region src/module/define-module.ts
43
+ const DEFAULT_EXTRAS = { isGlobal: false };
44
+ const DEFAULT_TRANSFORM = (def, extras) => extras.isGlobal ? {
45
+ ...def,
46
+ global: true
47
+ } : def;
48
+ const GLOBAL_SLOT_TOKENS = {
49
+ guards: APP_GUARD,
50
+ pipes: APP_PIPE,
51
+ interceptors: APP_INTERCEPTOR,
52
+ filters: APP_FILTER,
53
+ middleware: APP_MIDDLEWARE
54
+ };
55
+ /** Lower a `global:` slot to `APP_*` provider registrations. */
56
+ function lowerGlobalSlot(slot) {
57
+ const out = [];
58
+ for (const kind of Object.keys(GLOBAL_SLOT_TOKENS)) for (const component of slot[kind] ?? []) {
59
+ const token = GLOBAL_SLOT_TOKENS[kind];
60
+ if (typeof component === "function") out.push(component, {
61
+ provide: token,
62
+ useExisting: component
63
+ });
64
+ else out.push({
65
+ provide: token,
66
+ useValue: component
67
+ });
68
+ }
69
+ return out;
70
+ }
71
+ const ASYNC_OPTION_KEYS = /* @__PURE__ */ new Set([
72
+ "key",
73
+ "imports",
74
+ "inject",
75
+ "useFactory",
76
+ "useClass",
77
+ "useExisting"
78
+ ]);
79
+ /**
80
+ * The one blessed module-authoring engine. Generates `forRoot` AND
81
+ * `forRootAsync` statics with: `stableHash` key derivation (multi-instance
82
+ * dedup that survives HMR), typed `inject` tuple inference on the async
83
+ * factory, an `isGlobal` extra, and — the piece `ConfigurableModuleBuilder`
84
+ * could not express — providers/controllers/imports/exports/global components
85
+ * computed **as functions of the options**.
86
+ *
87
+ * ```ts
88
+ * const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } = defineModule<CorsOptions>({
89
+ * name: 'Cors',
90
+ * setup: ({ OPTIONS }) => ({
91
+ * providers: [{
92
+ * provide: APP_MIDDLEWARE,
93
+ * useFactory: (o: CorsOptions) => buildCorsMiddleware(o),
94
+ * inject: [OPTIONS],
95
+ * }],
96
+ * exports: [OPTIONS],
97
+ * }),
98
+ * });
99
+ * export class CorsModule extends ConfigurableModuleClass {}
100
+ * ```
101
+ *
102
+ * `ConfigurableModuleBuilder` remains supported (NestJS parity) and is a thin
103
+ * adapter over this engine.
104
+ */
105
+ function defineModule(spec) {
106
+ const optionsToken = spec.optionsToken ?? new InjectionToken(`${spec.name}_MODULE_OPTIONS`);
107
+ const syncName = spec.methodName ?? "forRoot";
108
+ const asyncName = `${syncName}Async`;
109
+ const factoryMethodName = spec.factoryMethodName ?? "create";
110
+ const extrasDefaults = spec.extras ?? DEFAULT_EXTRAS;
111
+ const transform = spec.transform ?? DEFAULT_TRANSFORM;
112
+ const deriveKey = (explicit, structural) => explicit ?? spec.key?.(structural) ?? stableHash(structural);
113
+ const applyLazy = (definition, callSiteLazy) => spec.lazy === true || callSiteLazy === true ? {
114
+ ...definition,
115
+ lazy: true
116
+ } : definition;
117
+ const applyContributions = (definition, structural, key) => {
118
+ if (!spec.setup) return definition;
119
+ const contributions = spec.setup({
120
+ OPTIONS: optionsToken,
121
+ options: structural,
122
+ key
123
+ });
124
+ const providers = [
125
+ ...definition.providers ?? [],
126
+ ...contributions.providers ?? [],
127
+ ...contributions.global ? lowerGlobalSlot(contributions.global) : []
128
+ ];
129
+ return {
130
+ ...definition,
131
+ providers,
132
+ controllers: [...definition.controllers ?? [], ...contributions.controllers ?? []],
133
+ imports: [...definition.imports ?? [], ...contributions.imports ?? []],
134
+ exports: [...definition.exports ?? [], ...contributions.exports ?? []]
135
+ };
136
+ };
137
+ class GeneratedModuleClass {}
138
+ Object.defineProperty(GeneratedModuleClass, "name", { value: `${spec.name}ModuleHost` });
139
+ Object.defineProperty(GeneratedModuleClass, syncName, {
140
+ configurable: true,
141
+ writable: true,
142
+ enumerable: false,
143
+ value(options = {}) {
144
+ const { key: explicitKey, ...rest } = options;
145
+ const key = deriveKey(explicitKey, rest);
146
+ const definition = {
147
+ module: this,
148
+ key,
149
+ providers: [{
150
+ provide: optionsToken,
151
+ useValue: rest
152
+ }]
153
+ };
154
+ return applyLazy(transform(applyContributions(definition, rest, key), {
155
+ ...extrasDefaults,
156
+ ...rest
157
+ }), rest.lazy);
158
+ }
159
+ });
160
+ Object.defineProperty(GeneratedModuleClass, asyncName, {
161
+ configurable: true,
162
+ writable: true,
163
+ enumerable: false,
164
+ value(options = {}) {
165
+ const bag = options;
166
+ const structural = {};
167
+ for (const [k, v] of Object.entries(bag)) if (!ASYNC_OPTION_KEYS.has(k)) structural[k] = v;
168
+ const key = deriveKey(bag.key, spec.key ? structural : {
169
+ inject: bag.inject,
170
+ useFactory: bag.useFactory,
171
+ useClass: bag.useClass,
172
+ useExisting: bag.useExisting,
173
+ ...structural
174
+ });
175
+ const definition = {
176
+ module: this,
177
+ key,
178
+ imports: bag.imports ?? [],
179
+ providers: buildAsyncOptionsProviders(optionsToken, factoryMethodName, bag, structural)
180
+ };
181
+ return applyLazy(transform(applyContributions(definition, structural, key), {
182
+ ...extrasDefaults,
183
+ ...structural
184
+ }), structural.lazy);
185
+ }
186
+ });
187
+ return {
188
+ ConfigurableModuleClass: GeneratedModuleClass,
189
+ MODULE_OPTIONS_TOKEN: optionsToken,
190
+ OPTIONS_TYPE: void 0,
191
+ ASYNC_OPTIONS_TYPE: void 0
192
+ };
193
+ }
194
+ /**
195
+ * Lower `useFactory`/`useClass`/`useExisting` async options into provider
196
+ * registrations. Structural fields from the call site merge UNDER the resolved
197
+ * options (`{ ...structural, ...resolved }`) so sync-declared fields act as
198
+ * defaults and the factory stays authoritative.
199
+ */
200
+ function buildAsyncOptionsProviders(optionsToken, factoryMethodName, async, structural = {}) {
201
+ const hasStructural = Object.keys(structural).length > 0;
202
+ const merge = (resolved) => resolved instanceof Promise ? resolved.then((o) => ({
203
+ ...structural,
204
+ ...o
205
+ })) : {
206
+ ...structural,
207
+ ...resolved
208
+ };
209
+ if (async.useFactory) {
210
+ const factory = async.useFactory;
211
+ return [{
212
+ provide: optionsToken,
213
+ useFactory: hasStructural ? (...deps) => merge(factory(...deps)) : factory,
214
+ inject: async.inject ?? []
215
+ }];
216
+ }
217
+ if (async.useClass) {
218
+ const factoryClass = async.useClass;
219
+ return [factoryClass, {
220
+ provide: optionsToken,
221
+ useFactory: (instance) => merge(instance[factoryMethodName]()),
222
+ inject: [factoryClass]
223
+ }];
224
+ }
225
+ if (async.useExisting) return [{
226
+ provide: optionsToken,
227
+ useFactory: (instance) => merge(instance[factoryMethodName]()),
228
+ inject: [async.useExisting]
229
+ }];
230
+ throw new Error("Async module options require one of `useFactory`, `useClass`, or `useExisting`.");
231
+ }
232
+ //#endregion
233
+ export { defineModule as n, stableHash as r, buildAsyncOptionsProviders as t };
234
+
235
+ //# sourceMappingURL=define-module-NOyOZNXD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-module-NOyOZNXD.js","names":[],"sources":["../src/module/stable-hash.ts","../src/module/define-module.ts"],"sourcesContent":["/**\n * Deterministic, sync, edge-safe hash for module-instance discrimination.\n *\n * Walks values (objects/arrays/primitives/functions/class instances) into a\n * sorted, source-fingerprinting JSON string, then runs FNV-1a (32-bit) for a\n * compact 8-hex-char output.\n *\n * Functions and class instances are tolerated — they become `__fn:source` or\n * `__cls:ClassName` markers. Two distinct closures with the same source code\n * collide; module authors who care about that should pass an explicit `key`.\n *\n * Not cryptographic. Sufficient for discriminating module instances within\n * an app.\n */\nexport function stableHash(value: unknown): string {\n return fnv1a(stableStringify(value));\n}\n\nfunction stableStringify(value: unknown): string {\n if (value === null || value === undefined) return JSON.stringify(value) ?? 'undefined';\n\n if (typeof value === 'function') {\n // Source-fingerprint via FNV-1a so we don't bloat the parent hash; this\n // keeps two distinct factory functions distinguishable as long as their\n // source differs (the common case). Names are intentionally excluded —\n // two arrow functions with the same body should dedup.\n return `__fn:${fnv1a(value.toString())}`;\n }\n\n if (typeof value === 'symbol') {\n return `__sym:${value.description ?? ''}`;\n }\n\n if (typeof value !== 'object') return JSON.stringify(value);\n\n if (Array.isArray(value)) {\n return '[' + value.map(stableStringify).join(',') + ']';\n }\n\n const proto = Object.getPrototypeOf(value);\n if (proto !== null && proto !== Object.prototype) {\n const name: string = proto?.constructor?.name ?? 'AnonymousClass';\n return `__cls:${name}` + stringifyOwnProps(value as Record<string, unknown>);\n }\n\n return stringifyOwnProps(value as Record<string, unknown>);\n}\n\nfunction stringifyOwnProps(obj: Record<string, unknown>): string {\n const keys = Object.keys(obj).sort();\n const parts = keys.map((k) => JSON.stringify(k) + ':' + stableStringify(obj[k]));\n return '{' + parts.join(',') + '}';\n}\n\nfunction fnv1a(s: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < s.length; i++) {\n h ^= s.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return (h >>> 0).toString(16).padStart(8, '0');\n}\n","import { InjectionToken, type ProviderOptions, type Token, type Type } from '../container/types';\nimport {\n APP_FILTER,\n APP_GUARD,\n APP_INTERCEPTOR,\n APP_MIDDLEWARE,\n APP_PIPE,\n} from '../pipeline/tokens';\nimport type { ComponentInstance, DynamicModule, ModuleImport } from '../registry/types';\nimport type {\n ConfigurableModuleAsyncOptions,\n ConfigurableModuleClassType,\n ConfigurableModuleExtras,\n ConfigurableModuleExtrasTransform,\n ConfigurableModuleHost,\n} from './configurable-module.types';\nimport { stableHash } from './stable-hash';\n\n/** The `global:` slot's component groups, lowered to `APP_*` registrations. */\nexport interface GlobalComponentSlot {\n guards?: Array<Type | ComponentInstance>;\n pipes?: Array<Type | ComponentInstance>;\n interceptors?: Array<Type | ComponentInstance>;\n filters?: Array<Type | ComponentInstance>;\n middleware?: Array<Type | ComponentInstance>;\n}\n\n/** What a module instance contributes, computed from its call-time options. */\nexport interface ModuleContributions {\n providers?: Array<Type | ProviderOptions>;\n controllers?: Type[];\n imports?: ModuleImport[];\n exports?: Array<Type | InjectionToken>;\n /**\n * Standardized global-component registration — the one idiom replacing both\n * the `@Module({ providers: [{ provide: APP_GUARD, useExisting: X }] })`\n * pattern and the conditional-push-into-forRoot pattern. Class entries are\n * registered as providers and wired via `useExisting`; instances via `useValue`.\n */\n global?: GlobalComponentSlot;\n}\n\nexport interface ModuleSetupContext<Opts> {\n /** The options token — derived providers do `inject: [OPTIONS]`. */\n readonly OPTIONS: InjectionToken<Opts>;\n /**\n * Structural options known at call time. For `forRoot` this is the full\n * bag; for `forRootAsync` it is only the structural fields passed alongside\n * the factory (the DI-resolved options exist only at resolution time —\n * read them through `OPTIONS`, never here).\n */\n readonly options: Partial<Opts>;\n /** The instance key in effect (for deriving per-instance token names). */\n readonly key: string;\n}\n\nexport interface DefineModuleSpec<\n Opts,\n Extras extends ConfigurableModuleExtras = { isGlobal?: boolean },\n MethodKey extends string = 'forRoot',\n FactoryMethodKey extends string = 'create',\n> {\n /** Names the generated base class, the minted options token, and diagnostics. */\n name: string;\n /**\n * Reuse an existing options token instead of minting one — critical for\n * migrations so the module's public token keeps its identity.\n */\n optionsToken?: InjectionToken<Opts>;\n /**\n * Structural contributions as a function of the call-time options. Runs at\n * `forRoot`/`forRootAsync` call time, once per module instance.\n */\n setup?: (ctx: ModuleSetupContext<Opts>) => ModuleContributions;\n /**\n * Dedup key from the structural options. Defaults to `stableHash(options)`.\n * Modules whose options carry stateful instances (drivers, registries)\n * should derive from the stable identifying subset — or document that\n * callers pass an explicit `key` for multi-instance setups.\n */\n key?: (options: Partial<Opts>) => string;\n /** Call-site extras defaults (default `{ isGlobal: false }`). */\n extras?: Extras;\n /** Reshape the definition from resolved extras (default: `isGlobal` → `global: true`). */\n transform?: ConfigurableModuleExtrasTransform<Extras>;\n /** Rename the sync static (default `forRoot`); the async static becomes `<name>Async`. */\n methodName?: MethodKey;\n /** Method a `useClass`/`useExisting` options factory must implement (default `create`). */\n factoryMethodName?: FactoryMethodKey;\n /**\n * Default every generated module instance to deferred (first-use)\n * materialization. Call sites can also opt in per instance by passing\n * `lazy: true` alongside the options (recognized like `isGlobal`).\n * See MODULE_AUTHORING.md \"Lazy modules\".\n */\n lazy?: boolean;\n}\n\nconst DEFAULT_EXTRAS = { isGlobal: false } as const;\nconst DEFAULT_TRANSFORM: ConfigurableModuleExtrasTransform<{ isGlobal?: boolean }> = (\n def,\n extras,\n) => (extras.isGlobal ? { ...def, global: true } : def);\n\nconst GLOBAL_SLOT_TOKENS = {\n guards: APP_GUARD,\n pipes: APP_PIPE,\n interceptors: APP_INTERCEPTOR,\n filters: APP_FILTER,\n middleware: APP_MIDDLEWARE,\n} as const;\n\n/** Lower a `global:` slot to `APP_*` provider registrations. */\nfunction lowerGlobalSlot(slot: GlobalComponentSlot): Array<Type | ProviderOptions> {\n const out: Array<Type | ProviderOptions> = [];\n for (const kind of Object.keys(GLOBAL_SLOT_TOKENS) as Array<keyof GlobalComponentSlot>) {\n for (const component of slot[kind] ?? []) {\n const token = GLOBAL_SLOT_TOKENS[kind];\n if (typeof component === 'function') {\n out.push(component as Type, { provide: token, useExisting: component as Token });\n } else {\n out.push({ provide: token, useValue: component });\n }\n }\n }\n return out;\n}\n\nconst ASYNC_OPTION_KEYS = new Set([\n 'key',\n 'imports',\n 'inject',\n 'useFactory',\n 'useClass',\n 'useExisting',\n]);\n\n/**\n * The one blessed module-authoring engine. Generates `forRoot` AND\n * `forRootAsync` statics with: `stableHash` key derivation (multi-instance\n * dedup that survives HMR), typed `inject` tuple inference on the async\n * factory, an `isGlobal` extra, and — the piece `ConfigurableModuleBuilder`\n * could not express — providers/controllers/imports/exports/global components\n * computed **as functions of the options**.\n *\n * ```ts\n * const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } = defineModule<CorsOptions>({\n * name: 'Cors',\n * setup: ({ OPTIONS }) => ({\n * providers: [{\n * provide: APP_MIDDLEWARE,\n * useFactory: (o: CorsOptions) => buildCorsMiddleware(o),\n * inject: [OPTIONS],\n * }],\n * exports: [OPTIONS],\n * }),\n * });\n * export class CorsModule extends ConfigurableModuleClass {}\n * ```\n *\n * `ConfigurableModuleBuilder` remains supported (NestJS parity) and is a thin\n * adapter over this engine.\n */\nexport function defineModule<\n Opts,\n Extras extends ConfigurableModuleExtras = { isGlobal?: boolean },\n MethodKey extends string = 'forRoot',\n FactoryMethodKey extends string = 'create',\n>(\n spec: DefineModuleSpec<Opts, Extras, MethodKey, FactoryMethodKey>,\n): ConfigurableModuleHost<Opts, MethodKey, FactoryMethodKey, Extras> {\n const optionsToken = spec.optionsToken ?? new InjectionToken<Opts>(`${spec.name}_MODULE_OPTIONS`);\n const syncName = spec.methodName ?? 'forRoot';\n const asyncName = `${syncName}Async`;\n const factoryMethodName = spec.factoryMethodName ?? 'create';\n const extrasDefaults = (spec.extras ?? DEFAULT_EXTRAS) as ConfigurableModuleExtras;\n const transform = (spec.transform ??\n DEFAULT_TRANSFORM) as ConfigurableModuleExtrasTransform<ConfigurableModuleExtras>;\n\n const deriveKey = (explicit: string | undefined, structural: Record<string, unknown>): string =>\n explicit ?? spec.key?.(structural as Partial<Opts>) ?? stableHash(structural);\n\n // Laziness is OR-composed: the spec defaults it, a call site can add it.\n const applyLazy = (definition: DynamicModule, callSiteLazy: unknown): DynamicModule =>\n spec.lazy === true || callSiteLazy === true ? { ...definition, lazy: true } : definition;\n\n const applyContributions = (\n definition: DynamicModule,\n structural: Record<string, unknown>,\n key: string,\n ): DynamicModule => {\n if (!spec.setup) return definition;\n const contributions = spec.setup({\n OPTIONS: optionsToken,\n options: structural as Partial<Opts>,\n key,\n });\n const providers = [\n ...(definition.providers ?? []),\n ...(contributions.providers ?? []),\n ...(contributions.global ? lowerGlobalSlot(contributions.global) : []),\n ];\n return {\n ...definition,\n providers,\n controllers: [...(definition.controllers ?? []), ...(contributions.controllers ?? [])],\n imports: [...(definition.imports ?? []), ...(contributions.imports ?? [])],\n exports: [...(definition.exports ?? []), ...(contributions.exports ?? [])],\n };\n };\n\n class GeneratedModuleClass {}\n Object.defineProperty(GeneratedModuleClass, 'name', { value: `${spec.name}ModuleHost` });\n\n Object.defineProperty(GeneratedModuleClass, syncName, {\n configurable: true,\n writable: true,\n enumerable: false,\n value(this: unknown, options: Record<string, unknown> = {}): DynamicModule {\n const { key: explicitKey, ...rest } = options;\n const key = deriveKey(explicitKey as string | undefined, rest);\n const definition: DynamicModule = {\n module: this as DynamicModule['module'],\n key,\n providers: [{ provide: optionsToken as Token, useValue: rest }],\n };\n return applyLazy(\n transform(applyContributions(definition, rest, key), {\n ...extrasDefaults,\n ...rest,\n }),\n rest.lazy,\n );\n },\n });\n\n Object.defineProperty(GeneratedModuleClass, asyncName, {\n configurable: true,\n writable: true,\n enumerable: false,\n value(this: unknown, options: ConfigurableModuleAsyncOptions<Opts> = {}): DynamicModule {\n const bag = options as ConfigurableModuleAsyncOptions<Opts> & Record<string, unknown>;\n const structural: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(bag)) {\n if (!ASYNC_OPTION_KEYS.has(k)) structural[k] = v;\n }\n const key = deriveKey(\n bag.key,\n // Async factories aren't structurally hashable in a useful way, so the\n // default key hashes the async wiring + structural fields — same\n // instance-identity semantics ConfigurableModuleBuilder always had.\n spec.key\n ? structural\n : {\n inject: bag.inject,\n useFactory: bag.useFactory,\n useClass: bag.useClass,\n useExisting: bag.useExisting,\n ...structural,\n },\n );\n const definition: DynamicModule = {\n module: this as DynamicModule['module'],\n key,\n imports: bag.imports ?? [],\n providers: buildAsyncOptionsProviders<Opts>(\n optionsToken as Token,\n factoryMethodName,\n bag,\n structural,\n ),\n };\n return applyLazy(\n transform(applyContributions(definition, structural, key), {\n ...extrasDefaults,\n ...structural,\n }),\n structural.lazy,\n );\n },\n });\n\n return {\n ConfigurableModuleClass: GeneratedModuleClass as unknown as ConfigurableModuleClassType<\n Opts,\n MethodKey,\n FactoryMethodKey,\n Extras\n >,\n MODULE_OPTIONS_TOKEN: optionsToken,\n // Type-only sentinels — never read at runtime.\n OPTIONS_TYPE: undefined as never,\n ASYNC_OPTIONS_TYPE: undefined as never,\n };\n}\n\n/**\n * Lower `useFactory`/`useClass`/`useExisting` async options into provider\n * registrations. Structural fields from the call site merge UNDER the resolved\n * options (`{ ...structural, ...resolved }`) so sync-declared fields act as\n * defaults and the factory stays authoritative.\n */\nexport function buildAsyncOptionsProviders<Opts>(\n optionsToken: Token,\n factoryMethodName: string,\n async: Pick<\n ConfigurableModuleAsyncOptions<Opts>,\n 'inject' | 'useFactory' | 'useClass' | 'useExisting'\n >,\n structural: Record<string, unknown> = {},\n): Array<ProviderOptions> {\n const hasStructural = Object.keys(structural).length > 0;\n const merge = (resolved: Opts | Promise<Opts>): Opts | Promise<Opts> =>\n resolved instanceof Promise\n ? resolved.then((o) => ({ ...structural, ...o }) as Opts)\n : ({ ...structural, ...resolved } as Opts);\n\n if (async.useFactory) {\n const factory = async.useFactory;\n return [\n {\n provide: optionsToken,\n // No structural fields → pass the caller's factory through untouched\n // (function identity preserved; nothing to merge).\n useFactory: hasStructural\n ? (...deps: unknown[]) =>\n merge((factory as (...a: unknown[]) => Opts | Promise<Opts>)(...deps))\n : (factory as (...deps: unknown[]) => Opts | Promise<Opts>),\n inject: (async.inject ?? []) as Token[],\n },\n ];\n }\n if (async.useClass) {\n const factoryClass = async.useClass;\n return [\n factoryClass as unknown as ProviderOptions,\n {\n provide: optionsToken,\n useFactory: (instance: Record<string, () => Opts | Promise<Opts>>) =>\n merge(instance[factoryMethodName]!()),\n inject: [factoryClass as unknown as Token],\n },\n ];\n }\n if (async.useExisting) {\n return [\n {\n provide: optionsToken,\n useFactory: (instance: Record<string, () => Opts | Promise<Opts>>) =>\n merge(instance[factoryMethodName]!()),\n inject: [async.useExisting as unknown as Token],\n },\n ];\n }\n throw new Error(\n 'Async module options require one of `useFactory`, `useClass`, or `useExisting`.',\n );\n}\n"],"mappings":"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"}
@@ -0,0 +1,368 @@
1
+ import { a as Injectable, h as APP_EXCEPTION_HANDLER, i as Inject, k as MetadataRegistry, m as Scope, n as __decorateParam, r as __decorateMetadata, t as __decorate, x as ERROR_CATALOG } from "./decorate-GcSMAbKn.js";
2
+ import { t as Container } from "./container-BqUHID4l.js";
3
+ import { HTTPException } from "hono/http-exception";
4
+ import { CORE_CATALOG, isVelaError } from "@velajs/errors";
5
+ //#region src/errors/http-exception.ts
6
+ var HttpException = class extends Error {
7
+ statusCode;
8
+ _response;
9
+ constructor(response, statusCode) {
10
+ const message = typeof response === "string" ? response : JSON.stringify(response);
11
+ super(message);
12
+ this.name = "HttpException";
13
+ this.statusCode = statusCode;
14
+ this._response = response;
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ }
17
+ getStatus() {
18
+ return this.statusCode;
19
+ }
20
+ getResponse() {
21
+ if (typeof this._response === "string") return {
22
+ statusCode: this.statusCode,
23
+ message: this._response
24
+ };
25
+ return this._response;
26
+ }
27
+ getRawResponse() {
28
+ return this._response;
29
+ }
30
+ };
31
+ var BadRequestException = class extends HttpException {
32
+ constructor(message = "Bad Request") {
33
+ super(message, 400);
34
+ this.name = "BadRequestException";
35
+ }
36
+ };
37
+ var UnauthorizedException = class extends HttpException {
38
+ constructor(message = "Unauthorized") {
39
+ super(message, 401);
40
+ this.name = "UnauthorizedException";
41
+ }
42
+ };
43
+ var ForbiddenException = class extends HttpException {
44
+ constructor(message = "Forbidden") {
45
+ super(message, 403);
46
+ this.name = "ForbiddenException";
47
+ }
48
+ };
49
+ var NotFoundException = class extends HttpException {
50
+ constructor(message = "Not Found") {
51
+ super(message, 404);
52
+ this.name = "NotFoundException";
53
+ }
54
+ };
55
+ var MethodNotAllowedException = class extends HttpException {
56
+ constructor(message = "Method Not Allowed") {
57
+ super(message, 405);
58
+ this.name = "MethodNotAllowedException";
59
+ }
60
+ };
61
+ var NotAcceptableException = class extends HttpException {
62
+ constructor(message = "Not Acceptable") {
63
+ super(message, 406);
64
+ this.name = "NotAcceptableException";
65
+ }
66
+ };
67
+ var RequestTimeoutException = class extends HttpException {
68
+ constructor(message = "Request Timeout") {
69
+ super(message, 408);
70
+ this.name = "RequestTimeoutException";
71
+ }
72
+ };
73
+ var ConflictException = class extends HttpException {
74
+ constructor(message = "Conflict") {
75
+ super(message, 409);
76
+ this.name = "ConflictException";
77
+ }
78
+ };
79
+ var GoneException = class extends HttpException {
80
+ constructor(message = "Gone") {
81
+ super(message, 410);
82
+ this.name = "GoneException";
83
+ }
84
+ };
85
+ var PayloadTooLargeException = class extends HttpException {
86
+ constructor(message = "Payload Too Large") {
87
+ super(message, 413);
88
+ this.name = "PayloadTooLargeException";
89
+ }
90
+ };
91
+ var UnsupportedMediaTypeException = class extends HttpException {
92
+ constructor(message = "Unsupported Media Type") {
93
+ super(message, 415);
94
+ this.name = "UnsupportedMediaTypeException";
95
+ }
96
+ };
97
+ var UnprocessableEntityException = class extends HttpException {
98
+ constructor(message = "Unprocessable Entity") {
99
+ super(message, 422);
100
+ this.name = "UnprocessableEntityException";
101
+ }
102
+ };
103
+ var TooManyRequestsException = class extends HttpException {
104
+ constructor(message = "Too Many Requests") {
105
+ super(message, 429);
106
+ this.name = "TooManyRequestsException";
107
+ }
108
+ };
109
+ var InternalServerErrorException = class extends HttpException {
110
+ constructor(message = "Internal Server Error") {
111
+ super(message, 500);
112
+ this.name = "InternalServerErrorException";
113
+ }
114
+ };
115
+ var NotImplementedException = class extends HttpException {
116
+ constructor(message = "Not Implemented") {
117
+ super(message, 501);
118
+ this.name = "NotImplementedException";
119
+ }
120
+ };
121
+ var BadGatewayException = class extends HttpException {
122
+ constructor(message = "Bad Gateway") {
123
+ super(message, 502);
124
+ this.name = "BadGatewayException";
125
+ }
126
+ };
127
+ var ServiceUnavailableException = class extends HttpException {
128
+ constructor(message = "Service Unavailable") {
129
+ super(message, 503);
130
+ this.name = "ServiceUnavailableException";
131
+ }
132
+ };
133
+ var GatewayTimeoutException = class extends HttpException {
134
+ constructor(message = "Gateway Timeout") {
135
+ super(message, 504);
136
+ this.name = "GatewayTimeoutException";
137
+ }
138
+ };
139
+ //#endregion
140
+ //#region src/exceptions/exception-handler.ts
141
+ /**
142
+ * True when `error` matches any of `matchers`. A string matches a branded
143
+ * {@link VelaError} by `code`; an arrow-function predicate is called; anything
144
+ * else with a `prototype` is treated as an error class and matched via
145
+ * `instanceof`. Predicates therefore MUST be arrow functions — a regular
146
+ * `function` expression has a `prototype` and would be mistaken for a class.
147
+ * Bound functions (e.g. `SomeClass.bind(null)`) lack `.prototype` too, so they
148
+ * are invoked as predicates — don't pass a bound class as a class matcher.
149
+ */
150
+ const matchesAny = (matchers, error) => {
151
+ if (!matchers?.length) return false;
152
+ return matchers.some((m) => {
153
+ if (typeof m === "string") return isVelaError(error) && error.code === m;
154
+ if (typeof m === "function" && !m.prototype) return m(error);
155
+ return error instanceof m;
156
+ });
157
+ };
158
+ //#endregion
159
+ //#region src/exceptions/reporter.ts
160
+ /**
161
+ * Build an {@link ErrorReporter} from a container. Reads the optional
162
+ * {@link APP_EXCEPTION_HANDLER} and {@link ERROR_CATALOG} providers; with
163
+ * neither registered the reporter logs (unless diagnostics is `'silent'`) and
164
+ * exposes the core catalog.
165
+ */
166
+ const resolveErrorReporter = (container) => {
167
+ const handler = container.has(APP_EXCEPTION_HANDLER) ? container.resolve(APP_EXCEPTION_HANDLER) : void 0;
168
+ return {
169
+ catalog: container.has(ERROR_CATALOG) ? container.resolve(ERROR_CATALOG) : CORE_CATALOG,
170
+ report(error, ctx) {
171
+ let suppressed = false;
172
+ try {
173
+ suppressed = matchesAny(handler?.dontReport, error);
174
+ } catch {}
175
+ if (suppressed) return;
176
+ const merged = handler?.context ? {
177
+ ...ctx,
178
+ ...safeContext(handler, error, ctx)
179
+ } : ctx;
180
+ if (handler?.report) {
181
+ try {
182
+ Promise.resolve(handler.report(error, merged)).catch(() => {});
183
+ } catch {}
184
+ return;
185
+ }
186
+ if (container.getDiagnostics() !== "silent") {
187
+ const status = clientFaultStatus(error);
188
+ if (status !== void 0 && status >= 400 && status < 500) return;
189
+ console.error(`[vela] ${merged.edge} error${merged.source ? ` in ${merged.source}` : ""}${merged.note ? ` (${merged.note})` : ""}:`, error);
190
+ }
191
+ },
192
+ render(error, executionCtx) {
193
+ try {
194
+ return handler?.render?.(error, executionCtx);
195
+ } catch {
196
+ return;
197
+ }
198
+ }
199
+ };
200
+ };
201
+ /**
202
+ * The HTTP status of a client-fault (4xx) error, read across the three shapes a
203
+ * caught error can take: a branded {@link VelaError} (`.status`), vela's own
204
+ * {@link HttpException} (`getStatus()`), or hono's {@link HTTPException}
205
+ * (`.status`). `undefined` for anything else — including raw/unbranded errors,
206
+ * which must always be logged. Only the DEFAULT console reporter uses this to
207
+ * mute client faults; a custom `handler.report` still receives everything.
208
+ */
209
+ const clientFaultStatus = (error) => {
210
+ if (isVelaError(error)) return error.status;
211
+ if (error instanceof HttpException) return error.getStatus();
212
+ if (error instanceof HTTPException) return error.status;
213
+ };
214
+ const safeContext = (handler, error, ctx) => {
215
+ try {
216
+ return handler.context?.(error, ctx) ?? {};
217
+ } catch {
218
+ return {};
219
+ }
220
+ };
221
+ //#endregion
222
+ //#region src/discovery/discovery.service.ts
223
+ function isMethodMetaItem(x) {
224
+ return typeof x === "object" && x !== null && (typeof x.methodName === "string" || typeof x.methodName === "symbol");
225
+ }
226
+ function resolveKey(key) {
227
+ return typeof key === "string" ? key : key.KEY;
228
+ }
229
+ let DiscoveryService = class DiscoveryService {
230
+ container;
231
+ constructor(container) {
232
+ this.container = container;
233
+ }
234
+ /** Every class-token provider registered in the container. */
235
+ getProviders(filter) {
236
+ const out = [];
237
+ for (const token of this.container.getTokens()) {
238
+ if (typeof token !== "function") continue;
239
+ const entry = this.buildEntry(token, filter, "provider discovery");
240
+ if (entry) out.push(entry);
241
+ }
242
+ return out;
243
+ }
244
+ /**
245
+ * Providers whose class carries class-level metadata under `key` — both
246
+ * class decorators (single value) and method decorators that append
247
+ * class-level lists (`@Cron`, `@OnEvent`, `@SubscribeMessage`).
248
+ */
249
+ providersWithMeta(key, filter) {
250
+ const metaKey = resolveKey(key);
251
+ const out = [];
252
+ for (const target of this.candidatesWithClassMeta(metaKey)) {
253
+ const entry = this.buildEntry(target, filter, `discovery of '${metaKey}'`);
254
+ if (!entry) continue;
255
+ const meta = MetadataRegistry.getCustomClassMeta(target, metaKey);
256
+ out.push({
257
+ ...entry,
258
+ meta
259
+ });
260
+ }
261
+ return out;
262
+ }
263
+ /**
264
+ * Handler methods carrying metadata under `key`. Merges the two storage
265
+ * conventions:
266
+ * - class-level appended lists whose items carry `methodName`
267
+ * (`@Cron`/`@OnEvent`-style method decorators), and
268
+ * - true handler-level metadata (`@SetMetadata`/`createDiscoverableDecorator`
269
+ * applied to a method).
270
+ */
271
+ methodsWithMeta(key, filter) {
272
+ const metaKey = resolveKey(key);
273
+ const out = [];
274
+ for (const target of this.candidatesWithClassMeta(metaKey)) {
275
+ const classMeta = MetadataRegistry.getCustomClassMeta(target, metaKey);
276
+ if (!Array.isArray(classMeta) || !classMeta.some(isMethodMetaItem)) continue;
277
+ const entry = this.buildEntry(target, filter, `discovery of '${metaKey}'`);
278
+ if (!entry) continue;
279
+ for (const item of classMeta) {
280
+ if (!isMethodMetaItem(item)) continue;
281
+ out.push({
282
+ class: entry,
283
+ methodName: item.methodName,
284
+ meta: item
285
+ });
286
+ }
287
+ }
288
+ for (const target of MetadataRegistry.getClassesWithHandlerMeta(metaKey)) {
289
+ if (!this.container.has(target)) continue;
290
+ const entry = this.buildEntry(target, filter, `discovery of '${metaKey}'`);
291
+ if (!entry) continue;
292
+ for (const { handler, value } of MetadataRegistry.getHandlersWithMeta(target, metaKey)) out.push({
293
+ class: entry,
294
+ methodName: handler,
295
+ meta: value
296
+ });
297
+ }
298
+ return out;
299
+ }
300
+ /**
301
+ * Index-first candidate walk with a legacy full-scan fallback: when the
302
+ * reverse index knows nothing about a key, an older copy of the registry
303
+ * module may have taken the writes (mixed dist/src or package versions in
304
+ * one process) — fall back to scanning container tokens the way the
305
+ * pre-DiscoveryService loops did.
306
+ */
307
+ candidatesWithClassMeta(metaKey) {
308
+ const indexed = MetadataRegistry.getClassesWithClassMeta(metaKey);
309
+ if (indexed.size > 0) return [...indexed].filter((t) => this.container.has(t));
310
+ const out = [];
311
+ for (const token of this.container.getTokens()) {
312
+ if (typeof token !== "function") continue;
313
+ if (MetadataRegistry.getCustomClassMeta(token, metaKey) !== void 0) out.push(token);
314
+ }
315
+ return out;
316
+ }
317
+ buildEntry(metatype, filter, label) {
318
+ const moduleIds = this.container.getOwnerModuleIds(metatype);
319
+ if (moduleIds.length === 0) return void 0;
320
+ if (filter?.moduleId !== void 0) {
321
+ const wanted = Array.isArray(filter.moduleId) ? filter.moduleId : [filter.moduleId];
322
+ if (!moduleIds.some((id) => wanted.includes(id))) return void 0;
323
+ }
324
+ const scope = this.container.getProviderScope(metatype) ?? Scope.SINGLETON;
325
+ if (filter?.deferLazy && this.container.isLazyPending(metatype)) return {
326
+ token: metatype,
327
+ metatype,
328
+ moduleIds,
329
+ scope,
330
+ instance: void 0
331
+ };
332
+ if (scope === Scope.REQUEST && !filter?.includeRequestScoped) {
333
+ if (this.container.getDiagnostics() === "log") console.warn(`[vela] ${label}: ${metatype.name} is request-scoped and cannot be materialized at bootstrap — skipped. Pass { includeRequestScoped: true } to override.`);
334
+ return {
335
+ token: metatype,
336
+ metatype,
337
+ moduleIds,
338
+ scope,
339
+ instance: void 0
340
+ };
341
+ }
342
+ let instance;
343
+ try {
344
+ instance = this.container.resolve(metatype);
345
+ } catch (err) {
346
+ const mode = this.container.getDiagnostics();
347
+ if (mode === "throw") throw err;
348
+ if (mode === "log") console.warn(`[vela] ${label}: cannot resolve ${metatype.name}:`, err);
349
+ return;
350
+ }
351
+ return {
352
+ token: metatype,
353
+ metatype,
354
+ moduleIds,
355
+ scope,
356
+ instance
357
+ };
358
+ }
359
+ };
360
+ DiscoveryService = __decorate([
361
+ Injectable(),
362
+ __decorateParam(0, Inject(Container)),
363
+ __decorateMetadata("design:paramtypes", [typeof Container === "undefined" ? Object : Container])
364
+ ], DiscoveryService);
365
+ //#endregion
366
+ export { UnsupportedMediaTypeException as S, RequestTimeoutException as _, BadRequestException as a, UnauthorizedException as b, GatewayTimeoutException as c, InternalServerErrorException as d, MethodNotAllowedException as f, PayloadTooLargeException as g, NotImplementedException as h, BadGatewayException as i, GoneException as l, NotFoundException as m, resolveErrorReporter as n, ConflictException as o, NotAcceptableException as p, matchesAny as r, ForbiddenException as s, DiscoveryService as t, HttpException as u, ServiceUnavailableException as v, UnprocessableEntityException as x, TooManyRequestsException as y };
367
+
368
+ //# sourceMappingURL=discovery.service-BYm95SSD.js.map