@velajs/vela 1.18.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 (441) hide show
  1. package/CHANGELOG.md +78 -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 -66
  23. package/dist/index.js +14 -71
  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 +67 -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 -91
  67. package/dist/application.js +0 -308
  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 -62
  143. package/dist/errors/http-exception.js +0 -134
  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/factory/adapter.d.ts +0 -36
  161. package/dist/factory/adapter.js +0 -18
  162. package/dist/factory/bootstrap.d.ts +0 -23
  163. package/dist/factory/bootstrap.js +0 -108
  164. package/dist/factory.d.ts +0 -16
  165. package/dist/factory.js +0 -36
  166. package/dist/fetch/fetch.module.d.ts +0 -7
  167. package/dist/fetch/fetch.module.js +0 -31
  168. package/dist/fetch/fetch.service.d.ts +0 -24
  169. package/dist/fetch/fetch.service.js +0 -145
  170. package/dist/fetch/fetch.types.d.ts +0 -24
  171. package/dist/fetch/fetch.types.js +0 -1
  172. package/dist/fetch/index.d.ts +0 -3
  173. package/dist/fetch/index.js +0 -2
  174. package/dist/health/health.http.d.ts +0 -14
  175. package/dist/health/health.http.js +0 -75
  176. package/dist/health/health.indicator.d.ts +0 -9
  177. package/dist/health/health.indicator.js +0 -32
  178. package/dist/health/health.module.d.ts +0 -2
  179. package/dist/health/health.module.js +0 -26
  180. package/dist/health/health.service.d.ts +0 -7
  181. package/dist/health/health.service.js +0 -69
  182. package/dist/health/health.types.d.ts +0 -15
  183. package/dist/health/health.types.js +0 -1
  184. package/dist/health/index.d.ts +0 -6
  185. package/dist/health/index.js +0 -4
  186. package/dist/http/ambient.d.ts +0 -17
  187. package/dist/http/ambient.js +0 -44
  188. package/dist/http/argument-resolver.d.ts +0 -10
  189. package/dist/http/argument-resolver.js +0 -89
  190. package/dist/http/decorators.d.ts +0 -198
  191. package/dist/http/decorators.js +0 -321
  192. package/dist/http/execution-context.d.ts +0 -8
  193. package/dist/http/execution-context.js +0 -35
  194. package/dist/http/handler-executor.d.ts +0 -20
  195. package/dist/http/handler-executor.js +0 -111
  196. package/dist/http/index.d.ts +0 -12
  197. package/dist/http/index.js +0 -7
  198. package/dist/http/instantiate.d.ts +0 -4
  199. package/dist/http/instantiate.js +0 -45
  200. package/dist/http/lazy-param.decorator.d.ts +0 -37
  201. package/dist/http/lazy-param.decorator.js +0 -117
  202. package/dist/http/request-container.d.ts +0 -16
  203. package/dist/http/request-container.js +0 -19
  204. package/dist/http/request-context.d.ts +0 -13
  205. package/dist/http/request-context.js +0 -22
  206. package/dist/http/response-mapper.d.ts +0 -8
  207. package/dist/http/response-mapper.js +0 -42
  208. package/dist/http/route-contributor.d.ts +0 -68
  209. package/dist/http/route-contributor.js +0 -22
  210. package/dist/http/route-map.d.ts +0 -30
  211. package/dist/http/route-map.js +0 -27
  212. package/dist/http/route.manager.d.ts +0 -92
  213. package/dist/http/route.manager.js +0 -481
  214. package/dist/http/types.d.ts +0 -37
  215. package/dist/http/types.js +0 -1
  216. package/dist/http/url/index.d.ts +0 -4
  217. package/dist/http/url/index.js +0 -3
  218. package/dist/http/url/signed-url.guard.d.ts +0 -27
  219. package/dist/http/url/signed-url.guard.js +0 -62
  220. package/dist/http/url/signing-secret.d.ts +0 -20
  221. package/dist/http/url/signing-secret.js +0 -24
  222. package/dist/http/url/url-generator.service.d.ts +0 -52
  223. package/dist/http/url/url-generator.service.js +0 -104
  224. package/dist/i18n/deep-merge.d.ts +0 -2
  225. package/dist/i18n/deep-merge.js +0 -15
  226. package/dist/i18n/i18n.middleware.d.ts +0 -15
  227. package/dist/i18n/i18n.middleware.js +0 -94
  228. package/dist/i18n/i18n.module.d.ts +0 -13
  229. package/dist/i18n/i18n.module.js +0 -69
  230. package/dist/i18n/i18n.options.d.ts +0 -30
  231. package/dist/i18n/i18n.options.js +0 -16
  232. package/dist/i18n/i18n.service.d.ts +0 -20
  233. package/dist/i18n/i18n.service.js +0 -49
  234. package/dist/i18n/i18n.tokens.d.ts +0 -6
  235. package/dist/i18n/i18n.tokens.js +0 -3
  236. package/dist/i18n/i18n.types.d.ts +0 -6
  237. package/dist/i18n/i18n.types.js +0 -1
  238. package/dist/i18n/message-loader.service.d.ts +0 -21
  239. package/dist/i18n/message-loader.service.js +0 -90
  240. package/dist/i18n/message-registry.d.ts +0 -16
  241. package/dist/i18n/message-registry.js +0 -49
  242. package/dist/lifecycle/index.d.ts +0 -20
  243. package/dist/lifecycle/index.js +0 -15
  244. package/dist/live/live.cursor.d.ts +0 -22
  245. package/dist/live/live.cursor.js +0 -56
  246. package/dist/live/live.decorators.d.ts +0 -32
  247. package/dist/live/live.decorators.js +0 -46
  248. package/dist/live/live.delta.d.ts +0 -15
  249. package/dist/live/live.delta.js +0 -51
  250. package/dist/live/live.engine.d.ts +0 -81
  251. package/dist/live/live.engine.js +0 -448
  252. package/dist/live/live.invalidation.d.ts +0 -45
  253. package/dist/live/live.invalidation.js +0 -99
  254. package/dist/live/live.module.d.ts +0 -28
  255. package/dist/live/live.module.js +0 -87
  256. package/dist/live/live.tokens.d.ts +0 -9
  257. package/dist/live/live.tokens.js +0 -8
  258. package/dist/live/live.types.d.ts +0 -138
  259. package/dist/live/live.types.js +0 -1
  260. package/dist/live/presence.d.ts +0 -44
  261. package/dist/live/presence.js +0 -130
  262. package/dist/metadata.d.ts +0 -10
  263. package/dist/metadata.js +0 -20
  264. package/dist/module/configurable-module.builder.d.ts +0 -56
  265. package/dist/module/configurable-module.builder.js +0 -84
  266. package/dist/module/configurable-module.types.d.ts +0 -93
  267. package/dist/module/configurable-module.types.js +0 -5
  268. package/dist/module/decorators.d.ts +0 -10
  269. package/dist/module/decorators.js +0 -47
  270. package/dist/module/define-module.d.ts +0 -112
  271. package/dist/module/define-module.js +0 -232
  272. package/dist/module/graph.d.ts +0 -10
  273. package/dist/module/graph.js +0 -35
  274. package/dist/module/index.d.ts +0 -10
  275. package/dist/module/index.js +0 -7
  276. package/dist/module/lazy-modules.d.ts +0 -82
  277. package/dist/module/lazy-modules.js +0 -231
  278. package/dist/module/lazy-provider.d.ts +0 -65
  279. package/dist/module/lazy-provider.js +0 -111
  280. package/dist/module/middleware.d.ts +0 -30
  281. package/dist/module/middleware.js +0 -67
  282. package/dist/module/module-loader.d.ts +0 -58
  283. package/dist/module/module-loader.js +0 -484
  284. package/dist/module/stable-hash.d.ts +0 -15
  285. package/dist/module/stable-hash.js +0 -52
  286. package/dist/module/types.d.ts +0 -1
  287. package/dist/module/types.js +0 -1
  288. package/dist/openapi/decorators.d.ts +0 -34
  289. package/dist/openapi/decorators.js +0 -66
  290. package/dist/openapi/document.d.ts +0 -3
  291. package/dist/openapi/document.js +0 -316
  292. package/dist/openapi/index.d.ts +0 -7
  293. package/dist/openapi/index.js +0 -6
  294. package/dist/openapi/redoc-ui.d.ts +0 -1
  295. package/dist/openapi/redoc-ui.js +0 -19
  296. package/dist/openapi/scalar-ui.d.ts +0 -1
  297. package/dist/openapi/scalar-ui.js +0 -19
  298. package/dist/openapi/swagger-ui.d.ts +0 -1
  299. package/dist/openapi/swagger-ui.js +0 -23
  300. package/dist/openapi/types.d.ts +0 -182
  301. package/dist/openapi/types.js +0 -4
  302. package/dist/openapi/zod-to-json-schema.d.ts +0 -4
  303. package/dist/openapi/zod-to-json-schema.js +0 -57
  304. package/dist/pipeline/app-providers.d.ts +0 -10
  305. package/dist/pipeline/app-providers.js +0 -43
  306. package/dist/pipeline/component.manager.d.ts +0 -25
  307. package/dist/pipeline/component.manager.js +0 -66
  308. package/dist/pipeline/decorators.d.ts +0 -10
  309. package/dist/pipeline/decorators.js +0 -42
  310. package/dist/pipeline/index.d.ts +0 -12
  311. package/dist/pipeline/index.js +0 -7
  312. package/dist/pipeline/pipeline-runner.d.ts +0 -31
  313. package/dist/pipeline/pipeline-runner.js +0 -40
  314. package/dist/pipeline/pipes.d.ts +0 -48
  315. package/dist/pipeline/pipes.js +0 -104
  316. package/dist/pipeline/reflector.d.ts +0 -86
  317. package/dist/pipeline/reflector.js +0 -121
  318. package/dist/pipeline/scoped-components.d.ts +0 -26
  319. package/dist/pipeline/scoped-components.js +0 -27
  320. package/dist/pipeline/tokens.d.ts +0 -33
  321. package/dist/pipeline/tokens.js +0 -27
  322. package/dist/pipeline/types.d.ts +0 -64
  323. package/dist/pipeline/types.js +0 -1
  324. package/dist/plugin/plugin.d.ts +0 -31
  325. package/dist/plugin/plugin.js +0 -111
  326. package/dist/queue/inline.driver.d.ts +0 -30
  327. package/dist/queue/inline.driver.js +0 -58
  328. package/dist/queue/queue.binding.d.ts +0 -23
  329. package/dist/queue/queue.binding.js +0 -53
  330. package/dist/queue/queue.client.d.ts +0 -20
  331. package/dist/queue/queue.client.js +0 -33
  332. package/dist/queue/queue.decorators.d.ts +0 -23
  333. package/dist/queue/queue.decorators.js +0 -46
  334. package/dist/queue/queue.dispatch.d.ts +0 -36
  335. package/dist/queue/queue.dispatch.js +0 -102
  336. package/dist/queue/queue.module.d.ts +0 -32
  337. package/dist/queue/queue.module.js +0 -80
  338. package/dist/queue/queue.tokens.d.ts +0 -21
  339. package/dist/queue/queue.tokens.js +0 -34
  340. package/dist/queue/queue.types.d.ts +0 -61
  341. package/dist/queue/queue.types.js +0 -4
  342. package/dist/registry/index.d.ts +0 -2
  343. package/dist/registry/index.js +0 -1
  344. package/dist/registry/metadata.registry.d.ts +0 -73
  345. package/dist/registry/metadata.registry.js +0 -357
  346. package/dist/registry/paths.d.ts +0 -3
  347. package/dist/registry/paths.js +0 -15
  348. package/dist/registry/types.d.ts +0 -116
  349. package/dist/registry/types.js +0 -1
  350. package/dist/registry/util.d.ts +0 -3
  351. package/dist/registry/util.js +0 -8
  352. package/dist/schedule/cron-matcher.d.ts +0 -2
  353. package/dist/schedule/cron-matcher.js +0 -62
  354. package/dist/schedule/index.d.ts +0 -8
  355. package/dist/schedule/index.js +0 -5
  356. package/dist/schedule/schedule.decorators.d.ts +0 -2
  357. package/dist/schedule/schedule.decorators.js +0 -18
  358. package/dist/schedule/schedule.module.d.ts +0 -9
  359. package/dist/schedule/schedule.module.js +0 -28
  360. package/dist/schedule/schedule.registry.d.ts +0 -23
  361. package/dist/schedule/schedule.registry.js +0 -63
  362. package/dist/schedule/schedule.tokens.d.ts +0 -2
  363. package/dist/schedule/schedule.tokens.js +0 -2
  364. package/dist/schedule/schedule.types.d.ts +0 -8
  365. package/dist/schedule/schedule.types.js +0 -1
  366. package/dist/schedule-node/schedule-node.module.d.ts +0 -9
  367. package/dist/schedule-node/schedule-node.module.js +0 -28
  368. package/dist/schedule-node/schedule.executor.d.ts +0 -19
  369. package/dist/schedule-node/schedule.executor.js +0 -107
  370. package/dist/seeder/seeder.decorator.d.ts +0 -7
  371. package/dist/seeder/seeder.decorator.js +0 -15
  372. package/dist/seeder/seeder.module.d.ts +0 -16
  373. package/dist/seeder/seeder.module.js +0 -44
  374. package/dist/seeder/seeder.registry.d.ts +0 -23
  375. package/dist/seeder/seeder.registry.js +0 -83
  376. package/dist/seeder/seeder.tokens.d.ts +0 -2
  377. package/dist/seeder/seeder.tokens.js +0 -1
  378. package/dist/seeder/seeder.types.d.ts +0 -20
  379. package/dist/seeder/seeder.types.js +0 -1
  380. package/dist/serialization/index.d.ts +0 -2
  381. package/dist/serialization/index.js +0 -2
  382. package/dist/serialization/serialize.decorator.d.ts +0 -6
  383. package/dist/serialization/serialize.decorator.js +0 -7
  384. package/dist/serialization/serializer.interceptor.d.ts +0 -4
  385. package/dist/serialization/serializer.interceptor.js +0 -16
  386. package/dist/services/index.d.ts +0 -2
  387. package/dist/services/index.js +0 -1
  388. package/dist/services/logger.d.ts +0 -59
  389. package/dist/services/logger.js +0 -159
  390. package/dist/storage/path-template.d.ts +0 -9
  391. package/dist/storage/path-template.js +0 -20
  392. package/dist/storage/storage.types.d.ts +0 -41
  393. package/dist/storage/storage.types.js +0 -5
  394. package/dist/throttler/index.d.ts +0 -6
  395. package/dist/throttler/index.js +0 -5
  396. package/dist/throttler/throttler.decorators.d.ts +0 -3
  397. package/dist/throttler/throttler.decorators.js +0 -4
  398. package/dist/throttler/throttler.guard.d.ts +0 -9
  399. package/dist/throttler/throttler.guard.js +0 -72
  400. package/dist/throttler/throttler.module.d.ts +0 -7
  401. package/dist/throttler/throttler.module.js +0 -41
  402. package/dist/throttler/throttler.storage.d.ts +0 -10
  403. package/dist/throttler/throttler.storage.js +0 -44
  404. package/dist/throttler/throttler.tokens.d.ts +0 -6
  405. package/dist/throttler/throttler.tokens.js +0 -5
  406. package/dist/throttler/throttler.types.d.ts +0 -25
  407. package/dist/throttler/throttler.types.js +0 -1
  408. package/dist/validation/create-zod-dto.d.ts +0 -13
  409. package/dist/validation/create-zod-dto.js +0 -18
  410. package/dist/validation/index.d.ts +0 -3
  411. package/dist/validation/index.js +0 -2
  412. package/dist/validation/validation.pipe.d.ts +0 -4
  413. package/dist/validation/validation.pipe.js +0 -19
  414. package/dist/websocket/websocket.decorators.d.ts +0 -47
  415. package/dist/websocket/websocket.decorators.js +0 -80
  416. package/dist/websocket/websocket.module.d.ts +0 -35
  417. package/dist/websocket/websocket.module.js +0 -63
  418. package/dist/websocket/websocket.tokens.d.ts +0 -30
  419. package/dist/websocket/websocket.tokens.js +0 -27
  420. package/dist/websocket/websocket.types.d.ts +0 -102
  421. package/dist/websocket/websocket.types.js +0 -4
  422. package/dist/websocket/ws-argument-resolver.d.ts +0 -13
  423. package/dist/websocket/ws-argument-resolver.js +0 -40
  424. package/dist/websocket/ws-dispatcher.d.ts +0 -54
  425. package/dist/websocket/ws-dispatcher.js +0 -322
  426. package/dist/websocket/ws-exception.d.ts +0 -16
  427. package/dist/websocket/ws-exception.js +0 -32
  428. package/dist/websocket/ws-execution-context.d.ts +0 -9
  429. package/dist/websocket/ws-execution-context.js +0 -24
  430. package/dist/websocket/ws-server.d.ts +0 -31
  431. package/dist/websocket/ws-server.js +0 -74
  432. package/dist/websocket/ws-sync.d.ts +0 -47
  433. package/dist/websocket/ws-sync.js +0 -74
  434. package/dist/websocket-node/node-ws-client.d.ts +0 -24
  435. package/dist/websocket-node/node-ws-client.js +0 -49
  436. package/dist/websocket-node/redis-live.d.ts +0 -24
  437. package/dist/websocket-node/redis-live.js +0 -57
  438. package/dist/websocket-node/redis-sync.d.ts +0 -33
  439. package/dist/websocket-node/redis-sync.js +0 -56
  440. package/dist/websocket-node/register-gateways.d.ts +0 -20
  441. package/dist/websocket-node/register-gateways.js +0 -61
@@ -1,26 +0,0 @@
1
- import type { Container } from '../container/container';
2
- import type { ComponentType, Constructor } from '../registry/types';
3
- import type { CanActivate, ExceptionFilter, NestInterceptor, NestMiddleware, PipeTransform } from './types';
4
- export interface ResolvedComponentMap {
5
- guard: CanActivate;
6
- pipe: PipeTransform;
7
- interceptor: NestInterceptor;
8
- filter: ExceptionFilter;
9
- middleware: NestMiddleware;
10
- }
11
- /**
12
- * Public seam for custom dispatchers: the `@UseGuards`/`@UsePipes`/
13
- * `@UseInterceptors`/`@UseFilters` components scoped to a handler (class-level
14
- * then method-level, declaration order), resolved to instances through the
15
- * given container (classes constructed with DI; instances passed through).
16
- *
17
- * Order is preserved exactly as declared — conventions stay with the CALLER:
18
- * filters run closest-first, so dispatchers reverse them
19
- * (`resolveScopedComponents('filter', ...).reverse()`), and app-wide `APP_*`
20
- * components are a separate, transport-specific decision.
21
- *
22
- * Promoted to the public API by the QueueModule work (the "openness proof"):
23
- * it was the one capability custom entrypoint dispatchers needed that only
24
- * the internal `ComponentManager` provided.
25
- */
26
- export declare function resolveScopedComponents<T extends ComponentType>(type: T, targetClass: Constructor, methodName: string | symbol, container: Container): ResolvedComponentMap[T][];
@@ -1,27 +0,0 @@
1
- import { ComponentManager } from "./component.manager.js";
2
- const RESOLVERS = {
3
- guard: ComponentManager.resolveGuards.bind(ComponentManager),
4
- pipe: ComponentManager.resolvePipes.bind(ComponentManager),
5
- interceptor: ComponentManager.resolveInterceptors.bind(ComponentManager),
6
- filter: ComponentManager.resolveFilters.bind(ComponentManager),
7
- middleware: ComponentManager.resolveMiddleware.bind(ComponentManager)
8
- };
9
- /**
10
- * Public seam for custom dispatchers: the `@UseGuards`/`@UsePipes`/
11
- * `@UseInterceptors`/`@UseFilters` components scoped to a handler (class-level
12
- * then method-level, declaration order), resolved to instances through the
13
- * given container (classes constructed with DI; instances passed through).
14
- *
15
- * Order is preserved exactly as declared — conventions stay with the CALLER:
16
- * filters run closest-first, so dispatchers reverse them
17
- * (`resolveScopedComponents('filter', ...).reverse()`), and app-wide `APP_*`
18
- * components are a separate, transport-specific decision.
19
- *
20
- * Promoted to the public API by the QueueModule work (the "openness proof"):
21
- * it was the one capability custom entrypoint dispatchers needed that only
22
- * the internal `ComponentManager` provided.
23
- */ export function resolveScopedComponents(type, targetClass, methodName, container) {
24
- const scoped = ComponentManager.getScopedComponents(type, targetClass, methodName);
25
- const resolve = RESOLVERS[type];
26
- return resolve(scoped, container);
27
- }
@@ -1,33 +0,0 @@
1
- import { InjectionToken } from '../container/types';
2
- import type { CanActivate, ExceptionFilter, NestInterceptor, NestMiddleware, PipeTransform } from './types';
3
- /**
4
- * Register global guards via module providers instead of app.useGlobalGuards().
5
- *
6
- * @example
7
- * ```ts
8
- * @Module({
9
- * providers: [
10
- * AuthGuard,
11
- * { provide: APP_GUARD, useClass: AuthGuard },
12
- * ],
13
- * })
14
- * class AppModule {}
15
- * ```
16
- */
17
- export declare const APP_GUARD: InjectionToken<CanActivate>;
18
- /**
19
- * Register global pipes via module providers.
20
- */
21
- export declare const APP_PIPE: InjectionToken<PipeTransform<unknown, unknown>>;
22
- /**
23
- * Register global interceptors via module providers.
24
- */
25
- export declare const APP_INTERCEPTOR: InjectionToken<NestInterceptor>;
26
- /**
27
- * Register global filters via module providers.
28
- */
29
- export declare const APP_FILTER: InjectionToken<ExceptionFilter<unknown>>;
30
- /**
31
- * Register global middleware via module providers.
32
- */
33
- export declare const APP_MIDDLEWARE: InjectionToken<NestMiddleware>;
@@ -1,27 +0,0 @@
1
- import { InjectionToken } from "../container/types.js";
2
- /**
3
- * Register global guards via module providers instead of app.useGlobalGuards().
4
- *
5
- * @example
6
- * ```ts
7
- * @Module({
8
- * providers: [
9
- * AuthGuard,
10
- * { provide: APP_GUARD, useClass: AuthGuard },
11
- * ],
12
- * })
13
- * class AppModule {}
14
- * ```
15
- */ export const APP_GUARD = new InjectionToken('APP_GUARD');
16
- /**
17
- * Register global pipes via module providers.
18
- */ export const APP_PIPE = new InjectionToken('APP_PIPE');
19
- /**
20
- * Register global interceptors via module providers.
21
- */ export const APP_INTERCEPTOR = new InjectionToken('APP_INTERCEPTOR');
22
- /**
23
- * Register global filters via module providers.
24
- */ export const APP_FILTER = new InjectionToken('APP_FILTER');
25
- /**
26
- * Register global middleware via module providers.
27
- */ export const APP_MIDDLEWARE = new InjectionToken('APP_MIDDLEWARE');
@@ -1,64 +0,0 @@
1
- import type { Context } from 'hono';
2
- import type { Type } from '../container/types';
3
- /**
4
- * HTTP-specific arguments host returned by `ExecutionContext.switchToHttp()`.
5
- * In Vela/Hono, the `Context` object holds both request and response state.
6
- *
7
- * - `getRequest()` — the Web `Request` object
8
- * - `getResponse()` — the Hono `Context` (use `c.header()`, `c.setCookie()`, etc.)
9
- */
10
- export interface HttpArgumentsHost {
11
- getRequest<T = Request>(): T;
12
- getResponse<T = Context>(): T;
13
- }
14
- /**
15
- * WebSocket-specific arguments host returned by `ExecutionContext.switchToWs()`.
16
- * Populated by `@velajs/vela/websocket` when a gateway message is dispatched.
17
- *
18
- * - `getClient()` — the connected socket (`WsClient`)
19
- * - `getData()` — the inbound message payload (the envelope's `data`)
20
- * - `getPattern()` — the subscribed event name that matched
21
- */
22
- export interface WsArgumentsHost {
23
- getClient<T = unknown>(): T;
24
- getData<T = unknown>(): T;
25
- getPattern<T = string>(): T;
26
- }
27
- /** The transport a component is executing under. `'http'` for routes, `'ws'` for gateway messages. */
28
- export type ContextType = 'http' | 'ws';
29
- export interface ExecutionContext {
30
- getType<T extends string = ContextType>(): T;
31
- getClass(): Type;
32
- getHandler(): string | symbol;
33
- /** Returns the Hono `Context` directly. Throws on a WebSocket context. */
34
- getContext<T = Context>(): T;
35
- /** Shorthand for `switchToHttp().getRequest()` — returns the Web `Request`. Throws on a WebSocket context. */
36
- getRequest(): Request;
37
- /** Switch to the HTTP arguments host. Throws on a WebSocket context. */
38
- switchToHttp(): HttpArgumentsHost;
39
- /** Switch to the WebSocket arguments host. Throws on an HTTP context. */
40
- switchToWs(): WsArgumentsHost;
41
- }
42
- export interface CanActivate {
43
- canActivate(context: ExecutionContext): boolean | Promise<boolean>;
44
- }
45
- export interface CallHandler {
46
- handle(): Promise<unknown>;
47
- }
48
- export interface NestInterceptor {
49
- intercept(context: ExecutionContext, next: CallHandler): Promise<unknown>;
50
- }
51
- export interface ArgumentMetadata {
52
- type: string;
53
- metatype?: Type;
54
- data?: string;
55
- }
56
- export interface PipeTransform<T = unknown, R = unknown> {
57
- transform(value: T, metadata: ArgumentMetadata): R | Promise<R>;
58
- }
59
- export interface ExceptionFilter<T = unknown> {
60
- catch(exception: T, context: ExecutionContext): unknown | Promise<unknown>;
61
- }
62
- export interface NestMiddleware {
63
- use(c: import('hono').Context, next: import('hono').Next): Promise<Response | void>;
64
- }
@@ -1 +0,0 @@
1
- export { };
@@ -1,31 +0,0 @@
1
- import { InjectionToken } from '../container/types';
2
- import type { Type } from '../container/types';
3
- import type { DynamicModule } from '../registry/types';
4
- export interface Plugin {
5
- id: string;
6
- version: string;
7
- module: Type | DynamicModule;
8
- dependsOn?: string[];
9
- metadata?: Record<string, unknown>;
10
- }
11
- /**
12
- * Freeze and validate a plugin manifest. Returns the same object so it can
13
- * be used in `composePlugins([definePlugin(...), ...])`.
14
- */
15
- export declare function definePlugin(plugin: Plugin): Plugin;
16
- export declare class PluginRegistry {
17
- private byId;
18
- constructor(plugins: readonly Plugin[]);
19
- list(): Plugin[];
20
- get(id: string): Plugin | undefined;
21
- dependents(id: string): Plugin[];
22
- }
23
- export declare const PLUGIN_REGISTRY_TOKEN: InjectionToken<PluginRegistry>;
24
- export declare class PluginRootModule {
25
- }
26
- /**
27
- * Compose a list of plugins into a single dynamic module that imports each
28
- * plugin's module in dependency order, registers a `PluginRegistry`, and
29
- * exposes it globally so any plugin can introspect peers.
30
- */
31
- export declare function composePlugins(plugins: readonly Plugin[]): DynamicModule;
@@ -1,111 +0,0 @@
1
- function _ts_decorate(decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- }
7
- import { InjectionToken } from "../container/types.js";
8
- import { Module } from "../module/decorators.js";
9
- /**
10
- * Freeze and validate a plugin manifest. Returns the same object so it can
11
- * be used in `composePlugins([definePlugin(...), ...])`.
12
- */ export function definePlugin(plugin) {
13
- if (!plugin.id) throw new Error('Plugin requires an id');
14
- if (!plugin.version) throw new Error('Plugin requires a version');
15
- if (!plugin.module) throw new Error('Plugin requires a module');
16
- return Object.freeze({
17
- ...plugin
18
- });
19
- }
20
- export class PluginRegistry {
21
- byId;
22
- constructor(plugins){
23
- this.byId = new Map();
24
- for (const p of plugins){
25
- if (this.byId.has(p.id)) {
26
- throw new Error(`Duplicate plugin id: '${p.id}'`);
27
- }
28
- this.byId.set(p.id, p);
29
- }
30
- }
31
- list() {
32
- return [
33
- ...this.byId.values()
34
- ];
35
- }
36
- get(id) {
37
- return this.byId.get(id);
38
- }
39
- dependents(id) {
40
- return this.list().filter((p)=>p.dependsOn?.includes(id) ?? false);
41
- }
42
- }
43
- export const PLUGIN_REGISTRY_TOKEN = new InjectionToken('PLUGIN_REGISTRY');
44
- export class PluginRootModule {
45
- }
46
- PluginRootModule = _ts_decorate([
47
- Module({})
48
- ], PluginRootModule);
49
- /**
50
- * Topologically sort plugins so each plugin's dependencies appear first.
51
- * Throws on missing dependencies and cycles.
52
- */ function topologicalSort(plugins) {
53
- const byId = new Map();
54
- for (const p of plugins){
55
- if (byId.has(p.id)) {
56
- throw new Error(`Duplicate plugin id: '${p.id}'`);
57
- }
58
- byId.set(p.id, p);
59
- }
60
- const result = [];
61
- const visiting = new Set();
62
- const visited = new Set();
63
- const visit = (p, path)=>{
64
- if (visited.has(p.id)) return;
65
- if (visiting.has(p.id)) {
66
- const cycle = [
67
- ...path,
68
- p.id
69
- ].join(' -> ');
70
- throw new Error(`Plugin cycle detected: ${cycle}`);
71
- }
72
- visiting.add(p.id);
73
- for (const depId of p.dependsOn ?? []){
74
- const dep = byId.get(depId);
75
- if (!dep) {
76
- throw new Error(`Plugin '${p.id}' depends on missing plugin '${depId}'`);
77
- }
78
- visit(dep, [
79
- ...path,
80
- p.id
81
- ]);
82
- }
83
- visiting.delete(p.id);
84
- visited.add(p.id);
85
- result.push(p);
86
- };
87
- for (const p of plugins)visit(p, []);
88
- return result;
89
- }
90
- /**
91
- * Compose a list of plugins into a single dynamic module that imports each
92
- * plugin's module in dependency order, registers a `PluginRegistry`, and
93
- * exposes it globally so any plugin can introspect peers.
94
- */ export function composePlugins(plugins) {
95
- const sorted = topologicalSort(plugins);
96
- const registry = new PluginRegistry(sorted);
97
- return {
98
- module: PluginRootModule,
99
- imports: sorted.map((p)=>p.module),
100
- providers: [
101
- {
102
- provide: PLUGIN_REGISTRY_TOKEN,
103
- useValue: registry
104
- }
105
- ],
106
- exports: [
107
- PLUGIN_REGISTRY_TOKEN
108
- ],
109
- global: true
110
- };
111
- }
@@ -1,30 +0,0 @@
1
- import type { QueueDriver } from './queue.types';
2
- export interface InlineQueueOptions {
3
- /**
4
- * `immediate` (default): deliver on a microtask after `enqueue` resolves —
5
- * `add()` resolving does NOT mean the job was handled. Handler errors are
6
- * routed to the binding's error hook (container diagnostics), never thrown
7
- * into the detached microtask.
8
- *
9
- * `manual`: buffer until `flush()` — deterministic delivery for tests.
10
- */
11
- mode?: 'immediate' | 'manual';
12
- }
13
- export interface InlineQueueDriver extends QueueDriver {
14
- /**
15
- * Deliver everything buffered (manual mode; also drains jobs enqueued
16
- * before the driver was bound). Resolves with the delivered count; rejects
17
- * with an `AggregateError` after attempting ALL buffered jobs if any
18
- * handler error went unclaimed — the awaiter exists here, so the
19
- * platform-retry rethrow contract is meaningful.
20
- */
21
- flush(): Promise<number>;
22
- /** Jobs currently buffered (unbound immediate + all manual). */
23
- readonly size: number;
24
- }
25
- /**
26
- * In-process driver for dev, tests, and single-isolate apps. Edge-pure: no
27
- * timers — `immediate` mode uses `queueMicrotask`. `delayMs` is not
28
- * supported (warns once through the bound error hook's diagnostics side).
29
- */
30
- export declare function inline(options?: InlineQueueOptions): InlineQueueDriver;
@@ -1,58 +0,0 @@
1
- /**
2
- * In-process driver for dev, tests, and single-isolate apps. Edge-pure: no
3
- * timers — `immediate` mode uses `queueMicrotask`. `delayMs` is not
4
- * supported (warns once through the bound error hook's diagnostics side).
5
- */ export function inline(options = {}) {
6
- const mode = options.mode ?? 'immediate';
7
- const buffer = [];
8
- let dispatch;
9
- let onError;
10
- let warnedDelay = false;
11
- const deliverDetached = (job)=>{
12
- queueMicrotask(()=>{
13
- void dispatch(job).catch((error)=>onError?.(error, job));
14
- });
15
- };
16
- return {
17
- kind: 'inline',
18
- get size () {
19
- return buffer.length;
20
- },
21
- async enqueue (job, addOptions) {
22
- if (addOptions?.delayMs !== undefined && !warnedDelay) {
23
- warnedDelay = true;
24
- console.warn(`[vela] inline() queue driver does not support delayMs — job '${job.name}' delivers without delay.`);
25
- }
26
- if (mode === 'manual' || !dispatch) {
27
- buffer.push(job);
28
- return;
29
- }
30
- deliverDetached(job);
31
- },
32
- bind (fn, hooks) {
33
- dispatch = fn;
34
- onError = hooks?.onError;
35
- if (mode === 'immediate' && buffer.length > 0) {
36
- for (const job of buffer.splice(0))deliverDetached(job);
37
- }
38
- },
39
- async flush () {
40
- if (!dispatch) return 0;
41
- const jobs = buffer.splice(0);
42
- const errors = [];
43
- let delivered = 0;
44
- for (const job of jobs){
45
- try {
46
- await dispatch(job);
47
- delivered++;
48
- } catch (error) {
49
- errors.push(error);
50
- }
51
- }
52
- if (errors.length > 0) {
53
- throw new AggregateError(errors, `queue flush: ${errors.length} of ${jobs.length} jobs failed (${delivered} delivered)`);
54
- }
55
- return delivered;
56
- }
57
- };
58
- }
@@ -1,23 +0,0 @@
1
- import type { Container, DiscoveryService } from '../index';
2
- import type { QueueDriver } from './queue.types';
3
- /**
4
- * Wires a `QueueModule` instance's driver to the app: binds in-process
5
- * delivery to the dispatch core and validates that no other module instance
6
- * provides the same queue names.
7
- *
8
- * Delivery resolves processors from the per-app `EntrypointRegistry` once it
9
- * exists (registered into the container at the end of
10
- * `callOnApplicationBootstrap`); deliveries that arrive earlier (a producer's
11
- * `onModuleInit` calling `add()`) fall back to `DiscoveryService` with
12
- * `deferLazy` — identical entries, no buffering, no lost jobs.
13
- *
14
- * Every `QueueClient` injects this binding, so the driver is always bound
15
- * before the first `add()` — including when the module materializes lazily.
16
- */
17
- export declare class QueueDispatchBinding {
18
- private readonly container;
19
- private readonly discovery;
20
- constructor(container: Container, discovery: DiscoveryService, driver: QueueDriver, queues: string[]);
21
- private deliver;
22
- private routeError;
23
- }
@@ -1,53 +0,0 @@
1
- import { EntrypointRegistry } from "../index.js";
2
- import { dispatchJobToEntries } from "./queue.dispatch.js";
3
- import { PROCESSOR_METADATA, queueToken } from "./queue.tokens.js";
4
- /**
5
- * Wires a `QueueModule` instance's driver to the app: binds in-process
6
- * delivery to the dispatch core and validates that no other module instance
7
- * provides the same queue names.
8
- *
9
- * Delivery resolves processors from the per-app `EntrypointRegistry` once it
10
- * exists (registered into the container at the end of
11
- * `callOnApplicationBootstrap`); deliveries that arrive earlier (a producer's
12
- * `onModuleInit` calling `add()`) fall back to `DiscoveryService` with
13
- * `deferLazy` — identical entries, no buffering, no lost jobs.
14
- *
15
- * Every `QueueClient` injects this binding, so the driver is always bound
16
- * before the first `add()` — including when the module materializes lazily.
17
- */ export class QueueDispatchBinding {
18
- container;
19
- discovery;
20
- constructor(container, discovery, driver, queues){
21
- this.container = container;
22
- this.discovery = discovery;
23
- for (const queue of queues){
24
- const owners = container.getOwnerModuleIds(queueToken(queue));
25
- if (owners.length > 1) {
26
- throw new Error(`Queue '${queue}' is provided by multiple QueueModule instances (${owners.join(', ')}). ` + `Queue names must be unique per app — either dedup the forRoot options or rename the queue.`);
27
- }
28
- }
29
- driver.bind?.((job)=>this.deliver(job), {
30
- onError: (error, job)=>this.routeError(error, job)
31
- });
32
- }
33
- async deliver(job) {
34
- const entries = this.container.has(EntrypointRegistry) ? this.container.resolve(EntrypointRegistry).ofKind('queue').map((ep)=>({
35
- token: ep.token,
36
- meta: ep.meta
37
- })) : this.discovery.providersWithMeta(PROCESSOR_METADATA, {
38
- deferLazy: true
39
- }).map((found)=>({
40
- token: found.token,
41
- meta: found.meta
42
- }));
43
- await dispatchJobToEntries(this.container, entries, job);
44
- }
45
- routeError(error, job) {
46
- const mode = this.container.getDiagnostics();
47
- if (mode === 'silent') return;
48
- if (mode === 'throw') {
49
- throw error instanceof Error ? error : new Error(String(error));
50
- }
51
- console.error(`[vela] unhandled error processing queue job '${job.name}' on '${job.queue}':`, error);
52
- }
53
- }
@@ -1,20 +0,0 @@
1
- import type { AddJobOptions, QueueDriver, QueueJob } from './queue.types';
2
- /**
3
- * Producer handle for one named queue — inject via `queueToken(name)`:
4
- *
5
- * ```ts
6
- * constructor(@Inject(queueToken('email')) private readonly email: QueueClient) {}
7
- * await this.email.add('welcome', { userId });
8
- * ```
9
- *
10
- * `add()` resolves when the DRIVER accepted the job, not when a processor
11
- * handled it (the inline driver's `immediate` mode delivers on a following
12
- * microtask; platform drivers deliver in another isolate entirely).
13
- */
14
- export declare class QueueClient {
15
- private readonly queue;
16
- private readonly driver;
17
- constructor(queue: string, driver: QueueDriver);
18
- get name(): string;
19
- add<T>(jobName: string, data: T, options?: AddJobOptions): Promise<QueueJob<T>>;
20
- }
@@ -1,33 +0,0 @@
1
- /**
2
- * Producer handle for one named queue — inject via `queueToken(name)`:
3
- *
4
- * ```ts
5
- * constructor(@Inject(queueToken('email')) private readonly email: QueueClient) {}
6
- * await this.email.add('welcome', { userId });
7
- * ```
8
- *
9
- * `add()` resolves when the DRIVER accepted the job, not when a processor
10
- * handled it (the inline driver's `immediate` mode delivers on a following
11
- * microtask; platform drivers deliver in another isolate entirely).
12
- */ export class QueueClient {
13
- queue;
14
- driver;
15
- constructor(queue, driver){
16
- this.queue = queue;
17
- this.driver = driver;
18
- }
19
- get name() {
20
- return this.queue;
21
- }
22
- async add(jobName, data, options = {}) {
23
- const job = {
24
- id: crypto.randomUUID(),
25
- queue: this.queue,
26
- name: jobName,
27
- data,
28
- attempt: 1
29
- };
30
- await this.driver.enqueue(job, options);
31
- return job;
32
- }
33
- }
@@ -1,23 +0,0 @@
1
- import type { ProcessMetadata } from './queue.types';
2
- /**
3
- * Marks a provider class as a processor for one queue:
4
- *
5
- * ```ts
6
- * @Processor('email')
7
- * @Injectable()
8
- * class EmailProcessor {
9
- * @Process('welcome')
10
- * async sendWelcome(job: QueueJob<{ userId: string }>) { ... }
11
- * }
12
- * ```
13
- */
14
- export declare function Processor(queueName: string): ClassDecorator;
15
- /**
16
- * Marks a processor method as the handler for a job name. Omit the name for
17
- * the wildcard handler (receives every job on the queue that has no named
18
- * handler). Named handlers win over the wildcard; a duplicate registration
19
- * for the same name is first-wins with a diagnostics warning at dispatch.
20
- */
21
- export declare function Process(jobName?: string): MethodDecorator;
22
- /** `@Process` entries declared on a processor class (declaration order). */
23
- export declare function getProcessHandlers(processorClass: object): ProcessMetadata[];
@@ -1,46 +0,0 @@
1
- import { createDiscoverableDecorator, defineMetadata, getMetadata, registerEntrypointKind } from "../index.js";
2
- import { PROCESS_METADATA, PROCESSOR_METADATA } from "./queue.tokens.js";
3
- const ProcessorMeta = createDiscoverableDecorator(PROCESSOR_METADATA);
4
- // The open entrypoint kind: adapters enumerate processors via
5
- // `app.entrypoints.ofKind<ProcessorMetadata>('queue')`. Declared at import
6
- // time next to the decorator — zero kernel involvement.
7
- registerEntrypointKind({
8
- kind: 'queue',
9
- metaKey: PROCESSOR_METADATA,
10
- level: 'class'
11
- });
12
- /**
13
- * Marks a provider class as a processor for one queue:
14
- *
15
- * ```ts
16
- * @Processor('email')
17
- * @Injectable()
18
- * class EmailProcessor {
19
- * @Process('welcome')
20
- * async sendWelcome(job: QueueJob<{ userId: string }>) { ... }
21
- * }
22
- * ```
23
- */ export function Processor(queueName) {
24
- return ProcessorMeta({
25
- queueName
26
- });
27
- }
28
- /**
29
- * Marks a processor method as the handler for a job name. Omit the name for
30
- * the wildcard handler (receives every job on the queue that has no named
31
- * handler). Named handlers win over the wildcard; a duplicate registration
32
- * for the same name is first-wins with a diagnostics warning at dispatch.
33
- */ export function Process(jobName) {
34
- return (target, propertyKey)=>{
35
- const ctor = target.constructor;
36
- const existing = getMetadata(PROCESS_METADATA, ctor) ?? [];
37
- existing.push({
38
- jobName,
39
- methodName: propertyKey
40
- });
41
- defineMetadata(PROCESS_METADATA, existing, ctor);
42
- };
43
- }
44
- /** `@Process` entries declared on a processor class (declaration order). */ export function getProcessHandlers(processorClass) {
45
- return getMetadata(PROCESS_METADATA, processorClass) ?? [];
46
- }
@@ -1,36 +0,0 @@
1
- import type { Container, EntrypointRegistry, Token } from '../index';
2
- import type { ProcessorMetadata, QueueJob } from './queue.types';
3
- export interface QueueDispatchResult {
4
- /** Processors that ran a handler for this job. */
5
- handled: number;
6
- }
7
- /** One dispatchable processor: its class token + `@Processor` meta. */
8
- export interface QueueEntry {
9
- token: Token;
10
- meta: ProcessorMetadata;
11
- }
12
- /**
13
- * Deliver one job to every `@Processor` of its queue — the primitive both the
14
- * in-core `inline()` driver and platform adapters call.
15
- *
16
- * Each matching processor runs inside `runInEntrypointScope` (request-scoped
17
- * dependencies rebuild per job) and is re-resolved BY TOKEN through the async
18
- * seam, so processors living in `lazy: true` modules materialize cleanly on
19
- * first dispatch — async providers and lifecycle hooks included. Scoped
20
- * guards/interceptors/filters run through `PipelineRunner`
21
- * (`getType() === 'queue'`, `getPayload()` is the job); app-wide `APP_*`
22
- * components deliberately do NOT apply (cloudflare queue/scheduled parity —
23
- * documented divergence from the WebSocket dispatcher).
24
- *
25
- * Errors no scoped filter claims RETHROW so awaiting platforms keep their
26
- * retry semantics; fire-and-forget callers (inline `immediate` mode) must
27
- * catch — `QueueDispatchBinding` routes those to diagnostics.
28
- */
29
- export declare function dispatchQueueJob(container: Container, entrypoints: EntrypointRegistry, job: QueueJob): Promise<QueueDispatchResult>;
30
- /**
31
- * Entry-list core shared by `dispatchQueueJob` (registry) and the in-process
32
- * driver binding (discovery fallback before the registry exists). Entries are
33
- * tokens + meta ONLY — every processor is re-resolved by token in its own
34
- * scope, so request-scoped and lazy-module processors work on both paths.
35
- */
36
- export declare function dispatchJobToEntries(container: Container, entries: QueueEntry[], job: QueueJob): Promise<QueueDispatchResult>;