@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
package/package.json CHANGED
@@ -1,8 +1,41 @@
1
1
  {
2
2
  "name": "@velajs/vela",
3
- "version": "1.19.0",
3
+ "version": "1.19.1",
4
4
  "description": "NestJS-compatible framework for edge runtimes, powered by Hono",
5
+ "keywords": [
6
+ "bun",
7
+ "cloudflare-workers",
8
+ "decorators",
9
+ "deno",
10
+ "dependency-injection",
11
+ "edge",
12
+ "framework",
13
+ "hono",
14
+ "nestjs",
15
+ "typescript"
16
+ ],
17
+ "homepage": "https://github.com/velajs/vela#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/velajs/vela/issues"
20
+ },
21
+ "license": "MIT",
22
+ "author": "ksh",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/velajs/vela.git"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "README.md",
30
+ "LICENSE",
31
+ "CHANGELOG.md"
32
+ ],
5
33
  "type": "module",
34
+ "sideEffects": [
35
+ "./dist/index.js",
36
+ "./dist/metadata.js",
37
+ "./dist/schedule-node/index.js"
38
+ ],
6
39
  "main": "./dist/index.js",
7
40
  "types": "./dist/index.d.ts",
8
41
  "exports": {
@@ -51,47 +84,29 @@
51
84
  "import": "./dist/seeder/index.js"
52
85
  }
53
86
  },
54
- "files": [
55
- "dist",
56
- "README.md",
57
- "LICENSE",
58
- "CHANGELOG.md"
59
- ],
60
- "sideEffects": [
61
- "./dist/index.js",
62
- "./dist/metadata.js",
63
- "./dist/schedule-node/index.js"
64
- ],
65
- "keywords": [
66
- "edge",
67
- "hono",
68
- "nestjs",
69
- "framework",
70
- "decorators",
71
- "dependency-injection",
72
- "cloudflare-workers",
73
- "deno",
74
- "bun",
75
- "typescript"
76
- ],
77
- "author": "ksh",
78
- "license": "MIT",
79
- "repository": {
80
- "type": "git",
81
- "url": "git+https://github.com/velajs/vela.git"
82
- },
83
- "homepage": "https://github.com/velajs/vela#readme",
84
- "bugs": {
85
- "url": "https://github.com/velajs/vela/issues"
86
- },
87
- "engines": {
88
- "node": ">=20"
89
- },
90
87
  "dependencies": {
91
88
  "@velajs/errors": "^1.0.0",
92
89
  "@velajs/live-protocol": "^1.0.0",
93
90
  "hono": "^4.12.26"
94
91
  },
92
+ "devDependencies": {
93
+ "@arethetypeswrong/cli": "^0.18.5",
94
+ "@changesets/cli": "^2.31.0",
95
+ "@cloudflare/vitest-pool-workers": "^0.16.18",
96
+ "@swc/core": "^1.15.43",
97
+ "@types/bun": "latest",
98
+ "@vitest/runner": "^4.1.10",
99
+ "@vitest/snapshot": "^4.1.10",
100
+ "intl-messageformat": "^11.2.9",
101
+ "oxfmt": "^0.58.0",
102
+ "oxlint": "^1.73.0",
103
+ "publint": "^0.3.21",
104
+ "tsdown": "^0.22.4",
105
+ "typescript": "^7.0.2",
106
+ "unplugin-swc": "^1.5.9",
107
+ "vitest": "^4.1.10",
108
+ "zod": "^4.4.3"
109
+ },
95
110
  "peerDependencies": {
96
111
  "intl-messageformat": ">=10"
97
112
  },
@@ -100,28 +115,26 @@
100
115
  "optional": true
101
116
  }
102
117
  },
103
- "devDependencies": {
104
- "@cloudflare/vitest-pool-workers": "^0.16.18",
105
- "@swc/cli": "^0.8.1",
106
- "@swc/core": "^1.15.41",
107
- "@types/bun": "latest",
108
- "@vitest/runner": "^4.1.9",
109
- "@vitest/snapshot": "^4.1.9",
110
- "intl-messageformat": "^11.2.9",
111
- "typedoc": "~0.28.19",
112
- "typescript": "^6.0.3",
113
- "unplugin-swc": "^1.5.9",
114
- "vitest": "^4.1.9",
115
- "zod": "^4.4.3"
118
+ "engines": {
119
+ "node": ">=24"
116
120
  },
117
121
  "scripts": {
118
- "build": "rm -rf dist && swc src -d dist --strip-leading-paths && tsc --emitDeclarationOnly",
122
+ "build": "tsdown",
119
123
  "test": "vitest run",
120
124
  "test:workers": "vitest run --config vitest.config.workers.ts",
121
125
  "test:workers:als": "vitest run --config vitest.config.workers-als.ts",
122
126
  "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.type-tests.json",
123
127
  "check:skill": "node scripts/check-skill.mjs",
124
- "docs": "typedoc",
125
- "docs:check": "typedoc --emit none"
128
+ "docs": "pnpm --dir tools/docs docs",
129
+ "docs:check": "pnpm --dir tools/docs docs:check",
130
+ "lint": "oxlint .",
131
+ "format": "oxfmt .",
132
+ "format:check": "oxfmt --check .",
133
+ "publint": "publint",
134
+ "attw": "attw --pack . --profile esm-only",
135
+ "changeset": "changeset",
136
+ "version-packages": "changeset version && node scripts/sync-skill-version.mjs",
137
+ "release": "pnpm build && changeset publish",
138
+ "verify": "pnpm lint && pnpm format:check && pnpm build && pnpm typecheck && pnpm check:skill && pnpm docs:check && pnpm test && pnpm test:workers && pnpm test:workers:als && pnpm publint && pnpm attw"
126
139
  }
127
140
  }
@@ -1,9 +0,0 @@
1
- declare const _default: {
2
- fetch(request: Request, _env: unknown, _ctx: unknown): Promise<Response>;
3
- };
4
- export default _default;
5
- declare global {
6
- interface ExportedHandler<Env = unknown> {
7
- fetch?(request: Request, env: Env, ctx: unknown): Response | Promise<Response>;
8
- }
9
- }
@@ -1,9 +0,0 @@
1
- declare const _default: {
2
- fetch(request: Request): Promise<Response>;
3
- };
4
- export default _default;
5
- declare global {
6
- interface ExportedHandler<Env = unknown> {
7
- fetch?(request: Request, env: Env, ctx: unknown): Response | Promise<Response>;
8
- }
9
- }
@@ -1,104 +0,0 @@
1
- import type { Hono } from 'hono';
2
- import type { Container } from './container/container';
3
- import type { Token, Type } from './container/types';
4
- import type { ExceptionHandler } from './exceptions/exception-handler';
5
- import { EntrypointRegistry } from './entrypoint/entrypoint.registry';
6
- import type { RouteDescription, RouteManager } from './http/route.manager';
7
- import type { MountOpenApiOptions } from './openapi/types';
8
- import type { FilterType, GuardType, InterceptorType, PipeType } from './registry/types';
9
- export declare class VelaApplication {
10
- private readonly container;
11
- private readonly routeManager;
12
- private instances;
13
- private honoApp;
14
- private entrypointRegistry;
15
- private disposed;
16
- private readonly lazyManager;
17
- private readonly knownInstances;
18
- constructor(container: Container, routeManager: RouteManager);
19
- private trackNew;
20
- /** Pre-build routes (handles async CRUD imports). Called by VelaFactory. */
21
- initRoutes(): Promise<void>;
22
- private getApp;
23
- get fetch(): Hono['fetch'];
24
- getInstances(): unknown[];
25
- getContainer(): Container;
26
- setInstances(instances: unknown[]): void;
27
- get<T>(token: Token<T>): T;
28
- getHonoApp(): Hono;
29
- /**
30
- * Every explicit controller route as the framework registered it (fully
31
- * composed paths — the `vela route list` seam). Requires built routes;
32
- * contributed routes (`@velajs/crud`) mount directly on Hono and are
33
- * observable via `getHonoApp().routes` instead.
34
- */
35
- describeRoutes(): RouteDescription[];
36
- /** The global route prefix in effect ('' when none). */
37
- getGlobalPrefix(): string;
38
- useGlobalPipes(...pipes: PipeType[]): this;
39
- useGlobalGuards(...guards: GuardType[]): this;
40
- useGlobalInterceptors(...interceptors: InterceptorType[]): this;
41
- useGlobalFilters(...filters: FilterType[]): this;
42
- /**
43
- * Register the application-wide {@link ExceptionHandler} imperatively — the
44
- * sibling of `ErrorsModule.forRoot({ handler })`. A class is constructed
45
- * through DI (`useClass`); a plain handler object is registered verbatim
46
- * (`useValue`). Consumed by `resolveErrorReporter` at every transport edge,
47
- * so it takes effect on the next request without a rebuild.
48
- *
49
- * ```ts
50
- * app.useGlobalExceptionHandler({ report: (e) => sentry.capture(e) });
51
- * ```
52
- */
53
- useGlobalExceptionHandler(handler: Type<ExceptionHandler> | ExceptionHandler): this;
54
- /**
55
- * Serve a pre-built OpenAPI document and one or more interactive doc UIs
56
- * (Swagger UI, Scalar, ReDoc) on the underlying Hono app, mirroring the
57
- * hono-crud docs convention. Edge-safe: each UI is a tiny self-contained
58
- * HTML shell that loads its renderer from a CDN at runtime so nothing is
59
- * bundled server-side and no extra dependency is required.
60
- *
61
- * Defaults: spec at `/openapi.json`, Scalar at `/scalar`, Swagger UI at
62
- * `/docs`, ReDoc at `/redoc`. The deprecated `path` / `uiPath` aliases are
63
- * retained for migration from the previous single-UI shape.
64
- *
65
- * ```ts
66
- * const doc = createOpenApiDocument(AppModule);
67
- * app.mountOpenApi({ document: doc }); // Scalar @ /scalar
68
- * app.mountOpenApi({ document: doc, ui: 'all' }); // swagger + scalar + redoc
69
- * ```
70
- */
71
- mountOpenApi(options: MountOpenApiOptions): this;
72
- /**
73
- * Pull instances materialized during the bootstrap phase (lazy modules
74
- * dragged in by eager consumers) into the front of the instance list —
75
- * dependency-before-consumer: a group absorbed because an eager provider
76
- * injected it must be initialized before that consumer's hooks read it.
77
- */
78
- private absorbLazyInstances;
79
- callOnModuleInit(): Promise<void>;
80
- callOnApplicationBootstrap(): Promise<void>;
81
- /**
82
- * Materialize every still-pending lazy module (async-safe): construct the
83
- * groups, replay their lifecycle hooks, and add their instances to the
84
- * shutdown flow. Warmup escape hatch for tests and node runtimes that want
85
- * eager-everything semantics back after bootstrap.
86
- */
87
- materializeLazyModules(): Promise<void>;
88
- /**
89
- * Every entrypoint contributed by the module graph, grouped by kind —
90
- * what runtime adapters/transports query instead of re-scanning providers:
91
- * `app.entrypoints.ofKind('websocket')`.
92
- */
93
- get entrypoints(): EntrypointRegistry;
94
- close(signal?: string): Promise<void>;
95
- /**
96
- * Full teardown: run shutdown lifecycle hooks ({@link close}) then dispose
97
- * container-held instances (LIFO) and clear cached singletons. Use for
98
- * graceful shutdown and dev HMR so old and new DI graphs never coexist.
99
- *
100
- * On runtimes/TS supporting explicit resource management this is also exposed
101
- * as `Symbol.asyncDispose`, enabling `await using app = await VelaFactory.create(...)`.
102
- */
103
- dispose(signal?: string): Promise<void>;
104
- }
@@ -1,364 +0,0 @@
1
- import { HTTPException } from "hono/http-exception";
2
- import { toErrorBody } from "@velajs/errors";
3
- import { APP_EXCEPTION_HANDLER } from "./pipeline/tokens.js";
4
- import { resolveErrorReporter } from "./exceptions/reporter.js";
5
- import { DiscoveryService } from "./discovery/discovery.service.js";
6
- import { EntrypointRegistry } from "./entrypoint/entrypoint.registry.js";
7
- import { LazyModuleManager } from "./module/lazy-modules.js";
8
- import { hasBeforeApplicationShutdown, hasOnApplicationBootstrap, hasOnApplicationShutdown, hasOnModuleDestroy, hasOnModuleInit } from "./lifecycle/index.js";
9
- import { renderScalarUi } from "./openapi/scalar-ui.js";
10
- import { renderSwaggerUi } from "./openapi/swagger-ui.js";
11
- import { renderRedocUi } from "./openapi/redoc-ui.js";
12
- export class VelaApplication {
13
- container;
14
- routeManager;
15
- instances = [];
16
- honoApp = null;
17
- entrypointRegistry = null;
18
- disposed = false;
19
- lazyManager;
20
- // Identity guard for the instance flow: a token registered by BOTH a lazy
21
- // and an eager module reaches us through the eager pass AND the absorbed
22
- // batch — without dedup its hooks would run twice.
23
- knownInstances = new Set();
24
- constructor(container, routeManager){
25
- this.container = container;
26
- this.routeManager = routeManager;
27
- // bootstrap() registers the manager; a hand-built container may not have
28
- // one (container unit tests) — lazy semantics simply don't engage then.
29
- this.lazyManager = container.has(LazyModuleManager) ? container.resolve(LazyModuleManager) : undefined;
30
- // Live-phase materializations join the instance flow so close()/dispose()
31
- // run shutdown hooks over them (LIFO — appended last, destroyed first).
32
- this.lazyManager?.setOnMaterialized((instances)=>{
33
- this.instances.push(...this.trackNew(instances));
34
- });
35
- }
36
- trackNew(batch) {
37
- const fresh = batch.filter((i)=>!this.knownInstances.has(i));
38
- for (const i of fresh)this.knownInstances.add(i);
39
- return fresh;
40
- }
41
- /** Pre-build routes (handles async CRUD imports). Called by VelaFactory. */ async initRoutes() {
42
- this.honoApp = await this.routeManager.build();
43
- // Last line of defense for the HTTP edge. HandlerExecutor's catch tail
44
- // only sees controller-handler errors; a raw Hono middleware (or any
45
- // hono-level throw that bypasses route.manager's wrapMiddlewareWithFilters)
46
- // would otherwise reach Hono's default error handler unreported and
47
- // unredacted. `onError` funnels it through the same report-first + canonical
48
- // redacted body path every other edge uses.
49
- this.honoApp.onError((err, c)=>{
50
- const reporter = resolveErrorReporter(this.container);
51
- // Hono's own HTTPException (e.g. `bodyLimit`'s 413) carries a deliberate,
52
- // author-intended client response — honor it exactly as Hono's default
53
- // error handler would, without treating it as a server fault to redact.
54
- // But a 5xx HTTPException is still a server fault: every other edge reports
55
- // before returning, so report status>=500 here too (leaving the verbatim
56
- // response — and its redaction/status — untouched).
57
- if (err instanceof HTTPException) {
58
- if (err.status >= 500) {
59
- reporter.report(err, {
60
- edge: 'hono',
61
- source: `${c.req.method} ${c.req.path}`
62
- });
63
- }
64
- return err.getResponse();
65
- }
66
- reporter.report(err, {
67
- edge: 'hono',
68
- source: `${c.req.method} ${c.req.path}`
69
- });
70
- const { body, status } = toErrorBody(err, {
71
- catalog: reporter.catalog
72
- });
73
- return c.json(body, status);
74
- });
75
- }
76
- getApp() {
77
- if (!this.honoApp) {
78
- throw new Error('Routes not built. This should not happen — VelaFactory.create() builds routes automatically.');
79
- }
80
- return this.honoApp;
81
- }
82
- get fetch() {
83
- return this.getApp().fetch;
84
- }
85
- getInstances() {
86
- return this.instances;
87
- }
88
- getContainer() {
89
- return this.container;
90
- }
91
- setInstances(instances) {
92
- this.instances = instances;
93
- this.knownInstances.clear();
94
- for (const i of instances)this.knownInstances.add(i);
95
- }
96
- get(token) {
97
- return this.container.resolve(token);
98
- }
99
- getHonoApp() {
100
- return this.getApp();
101
- }
102
- /**
103
- * Every explicit controller route as the framework registered it (fully
104
- * composed paths — the `vela route list` seam). Requires built routes;
105
- * contributed routes (`@velajs/crud`) mount directly on Hono and are
106
- * observable via `getHonoApp().routes` instead.
107
- */ describeRoutes() {
108
- this.getApp(); // same routes-not-built guard as every HTTP accessor
109
- return this.routeManager.getRouteDescriptions();
110
- }
111
- /** The global route prefix in effect ('' when none). */ getGlobalPrefix() {
112
- return this.routeManager.getGlobalPrefix();
113
- }
114
- // Pipeline components — applied at request time, no rebuild needed
115
- useGlobalPipes(...pipes) {
116
- this.routeManager.useGlobalPipes(...pipes);
117
- return this;
118
- }
119
- useGlobalGuards(...guards) {
120
- this.routeManager.useGlobalGuards(...guards);
121
- return this;
122
- }
123
- useGlobalInterceptors(...interceptors) {
124
- this.routeManager.useGlobalInterceptors(...interceptors);
125
- return this;
126
- }
127
- useGlobalFilters(...filters) {
128
- this.routeManager.useGlobalFilters(...filters);
129
- return this;
130
- }
131
- /**
132
- * Register the application-wide {@link ExceptionHandler} imperatively — the
133
- * sibling of `ErrorsModule.forRoot({ handler })`. A class is constructed
134
- * through DI (`useClass`); a plain handler object is registered verbatim
135
- * (`useValue`). Consumed by `resolveErrorReporter` at every transport edge,
136
- * so it takes effect on the next request without a rebuild.
137
- *
138
- * ```ts
139
- * app.useGlobalExceptionHandler({ report: (e) => sentry.capture(e) });
140
- * ```
141
- */ useGlobalExceptionHandler(handler) {
142
- this.container.register(typeof handler === 'function' ? {
143
- provide: APP_EXCEPTION_HANDLER,
144
- useClass: handler
145
- } : {
146
- provide: APP_EXCEPTION_HANDLER,
147
- useValue: handler
148
- });
149
- return this;
150
- }
151
- /**
152
- * Serve a pre-built OpenAPI document and one or more interactive doc UIs
153
- * (Swagger UI, Scalar, ReDoc) on the underlying Hono app, mirroring the
154
- * hono-crud docs convention. Edge-safe: each UI is a tiny self-contained
155
- * HTML shell that loads its renderer from a CDN at runtime so nothing is
156
- * bundled server-side and no extra dependency is required.
157
- *
158
- * Defaults: spec at `/openapi.json`, Scalar at `/scalar`, Swagger UI at
159
- * `/docs`, ReDoc at `/redoc`. The deprecated `path` / `uiPath` aliases are
160
- * retained for migration from the previous single-UI shape.
161
- *
162
- * ```ts
163
- * const doc = createOpenApiDocument(AppModule);
164
- * app.mountOpenApi({ document: doc }); // Scalar @ /scalar
165
- * app.mountOpenApi({ document: doc, ui: 'all' }); // swagger + scalar + redoc
166
- * ```
167
- */ mountOpenApi(options) {
168
- const app = this.getApp();
169
- const doc = options.document;
170
- const title = options.title;
171
- // Spec JSON: new default `/openapi.json`. The deprecated `path` alias is
172
- // honored as an override only (does not change the default).
173
- const specPath = options.specPath ?? options.path ?? '/openapi.json';
174
- app.get(specPath, (c)=>c.json(doc));
175
- // Normalize the requested UI set. Default is Scalar only.
176
- const uiOption = options.ui;
177
- let uis;
178
- let singleStringUi = false;
179
- if (uiOption === undefined) {
180
- uis = [
181
- 'scalar'
182
- ];
183
- } else if (uiOption === 'all') {
184
- uis = [
185
- 'swagger',
186
- 'scalar',
187
- 'redoc'
188
- ];
189
- } else if (Array.isArray(uiOption)) {
190
- uis = uiOption;
191
- } else {
192
- uis = [
193
- uiOption
194
- ];
195
- singleStringUi = true;
196
- }
197
- for (const ui of uis){
198
- // Back-compat: the old `{ ui: 'scalar', uiPath }` form mapped a single
199
- // string UI to `uiPath`. Honor that only when exactly one UI was
200
- // requested as a string.
201
- const legacyPath = singleStringUi && uis.length === 1 ? options.uiPath : undefined;
202
- if (ui === 'swagger') {
203
- const path = legacyPath ?? options.swaggerPath ?? '/docs';
204
- const html = renderSwaggerUi(specPath, title);
205
- app.get(path, (c)=>c.html(html));
206
- } else if (ui === 'redoc') {
207
- const path = legacyPath ?? options.redocPath ?? '/redoc';
208
- const html = renderRedocUi(specPath, title);
209
- app.get(path, (c)=>c.html(html));
210
- } else {
211
- const path = legacyPath ?? options.scalarPath ?? '/scalar';
212
- const html = renderScalarUi(specPath, title);
213
- app.get(path, (c)=>c.html(html));
214
- }
215
- }
216
- return this;
217
- }
218
- // Lifecycle hooks
219
- /**
220
- * Pull instances materialized during the bootstrap phase (lazy modules
221
- * dragged in by eager consumers) into the front of the instance list —
222
- * dependency-before-consumer: a group absorbed because an eager provider
223
- * injected it must be initialized before that consumer's hooks read it.
224
- */ absorbLazyInstances(prepend) {
225
- const batch = this.trackNew(this.lazyManager?.takeAbsorbed() ?? []);
226
- if (batch.length === 0) return batch;
227
- if (prepend) {
228
- this.instances = [
229
- ...batch,
230
- ...this.instances
231
- ];
232
- } else {
233
- this.instances.push(...batch);
234
- }
235
- return batch;
236
- }
237
- async callOnModuleInit() {
238
- this.absorbLazyInstances(true);
239
- // Index loop: hooks can trigger further absorptions, which append —
240
- // the loop naturally covers them.
241
- for(let i = 0; i < this.instances.length; i++){
242
- const instance = this.instances[i];
243
- if (hasOnModuleInit(instance)) {
244
- await instance.onModuleInit();
245
- }
246
- this.absorbLazyInstances(false);
247
- }
248
- }
249
- async callOnApplicationBootstrap() {
250
- for(let i = 0; i < this.instances.length; i++){
251
- const instance = this.instances[i];
252
- if (hasOnApplicationBootstrap(instance)) {
253
- await instance.onApplicationBootstrap();
254
- }
255
- // Instances absorbed mid-phase already missed the init pass — run
256
- // onModuleInit now; the loop then reaches them for the bootstrap hook.
257
- for (const late of this.absorbLazyInstances(false)){
258
- if (hasOnModuleInit(late)) await late.onModuleInit();
259
- }
260
- }
261
- // Computed-entrypoint contributors (ContributesEntrypoints) in lazy
262
- // modules must exist before the snapshot below — materialize them now
263
- // (the documented cost of contributing computed entrypoints), then run
264
- // their hooks through the same absorb loop.
265
- if (this.lazyManager) {
266
- await this.lazyManager.materializeContributors();
267
- let batch;
268
- while((batch = this.absorbLazyInstances(false)).length > 0){
269
- for (const late of batch){
270
- if (hasOnModuleInit(late)) await late.onModuleInit();
271
- }
272
- for (const late of batch){
273
- if (hasOnApplicationBootstrap(late)) await late.onApplicationBootstrap();
274
- }
275
- }
276
- // From here on, materializations replay their hooks at the trigger.
277
- this.lazyManager.setPhaseLive();
278
- }
279
- // Build the per-app entrypoint registry AFTER the hooks: dispatchers that
280
- // implement ContributesEntrypoints (WsDispatcher) finish their own
281
- // discovery inside onApplicationBootstrap. Built here — not in
282
- // VelaFactory/initRoutes — so slim bootstrap paths that never build HTTP
283
- // routes (the Cloudflare Durable Object) still get `app.entrypoints`.
284
- // Lazy-pending providers of declared kinds yield metadata-only entries
285
- // (instance: undefined) — dispatchers re-resolve by token per event,
286
- // which materializes the owning module at dispatch time.
287
- const discovery = this.container.has(DiscoveryService) ? this.container.resolve(DiscoveryService) : new DiscoveryService(this.container);
288
- this.entrypointRegistry = await EntrypointRegistry.build(discovery, this.instances, {
289
- deferLazy: true
290
- });
291
- // Make the per-app registry injectable (global token): providers that
292
- // dispatch entrypoints themselves (the queue module's in-process driver
293
- // binding) resolve it instead of needing a back-reference to the app.
294
- // Registered AFTER build so anything resolving it sees the final registry;
295
- // pre-bootstrap resolution attempts fail the `has()` probe and defer.
296
- this.container.register({
297
- provide: EntrypointRegistry,
298
- useValue: this.entrypointRegistry
299
- });
300
- this.container.markGlobalToken(EntrypointRegistry);
301
- }
302
- /**
303
- * Materialize every still-pending lazy module (async-safe): construct the
304
- * groups, replay their lifecycle hooks, and add their instances to the
305
- * shutdown flow. Warmup escape hatch for tests and node runtimes that want
306
- * eager-everything semantics back after bootstrap.
307
- */ async materializeLazyModules() {
308
- await this.lazyManager?.materializeAll();
309
- }
310
- /**
311
- * Every entrypoint contributed by the module graph, grouped by kind —
312
- * what runtime adapters/transports query instead of re-scanning providers:
313
- * `app.entrypoints.ofKind('websocket')`.
314
- */ get entrypoints() {
315
- if (!this.entrypointRegistry) {
316
- throw new Error('Entrypoints are not built yet — they are assembled at the end of ' + 'callOnApplicationBootstrap(). Finish bootstrapping before querying them.');
317
- }
318
- return this.entrypointRegistry;
319
- }
320
- async close(signal) {
321
- const reversed = [
322
- ...this.instances
323
- ].reverse();
324
- for (const instance of reversed){
325
- if (hasBeforeApplicationShutdown(instance)) {
326
- await instance.beforeApplicationShutdown(signal);
327
- }
328
- }
329
- for (const instance of reversed){
330
- if (hasOnModuleDestroy(instance)) {
331
- await instance.onModuleDestroy();
332
- }
333
- }
334
- for (const instance of reversed){
335
- if (hasOnApplicationShutdown(instance)) {
336
- await instance.onApplicationShutdown(signal);
337
- }
338
- }
339
- }
340
- /**
341
- * Full teardown: run shutdown lifecycle hooks ({@link close}) then dispose
342
- * container-held instances (LIFO) and clear cached singletons. Use for
343
- * graceful shutdown and dev HMR so old and new DI graphs never coexist.
344
- *
345
- * On runtimes/TS supporting explicit resource management this is also exposed
346
- * as `Symbol.asyncDispose`, enabling `await using app = await VelaFactory.create(...)`.
347
- */ async dispose(signal) {
348
- // Idempotent: `await using` + an explicit dispose(), or repeated shutdown
349
- // signals, must not re-run shutdown lifecycle hooks.
350
- if (this.disposed) return;
351
- this.disposed = true;
352
- await this.close(signal);
353
- await this.container.dispose();
354
- }
355
- }
356
- // Attach the well-known async-dispose symbol at runtime (it is not in the
357
- // ES2022 lib the project compiles against) so `await using` works where
358
- // supported, without a type dependency on esnext.disposable.
359
- const ASYNC_DISPOSE = Symbol.asyncDispose;
360
- if (ASYNC_DISPOSE) {
361
- VelaApplication.prototype[ASYNC_DISPOSE] = function() {
362
- return this.dispose();
363
- };
364
- }
@@ -1,2 +0,0 @@
1
- export declare const CacheKey: (key: string) => (target: object, propertyKey?: string | symbol) => void;
2
- export declare const CacheTTL: (seconds: number) => (target: object, propertyKey?: string | symbol) => void;
@@ -1,4 +0,0 @@
1
- import { SetMetadata } from "../pipeline/reflector.js";
2
- import { CACHE_KEY_METADATA, CACHE_TTL_METADATA } from "./cache.tokens.js";
3
- export const CacheKey = (key)=>SetMetadata(CACHE_KEY_METADATA, key);
4
- export const CacheTTL = (seconds)=>SetMetadata(CACHE_TTL_METADATA, seconds);
@@ -1,9 +0,0 @@
1
- import type { ExecutionContext, CallHandler, NestInterceptor } from '../pipeline/types';
2
- import type { CacheModuleOptions, CacheStore } from './cache.types';
3
- export declare class CacheInterceptor implements NestInterceptor {
4
- private cacheStore;
5
- private options;
6
- private reflector;
7
- constructor(cacheStore: CacheStore, options: CacheModuleOptions);
8
- intercept(context: ExecutionContext, next: CallHandler): Promise<unknown>;
9
- }