@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,357 +0,0 @@
1
- import { getOrCreate, getOrCreateArray, getOrCreateMap } from "./util.js";
2
- function emptyComponentByOwner() {
3
- return {
4
- middleware: new Map(),
5
- guard: new Map(),
6
- pipe: new Map(),
7
- interceptor: new Map(),
8
- filter: new Map()
9
- };
10
- }
11
- function createRegistryState() {
12
- return {
13
- routes: new Map(),
14
- controllers: new Map(),
15
- controllerOptions: new Map(),
16
- modules: new Map(),
17
- parameters: new Map(),
18
- injectables: new Set(),
19
- scopes: new Map(),
20
- injectTokens: new Map(),
21
- handlerHttpMeta: new Map(),
22
- catchTypes: new Map(),
23
- routeVersions: new Map(),
24
- classMeta: new Map(),
25
- handlerMeta: new Map(),
26
- classMetaIndex: new Map(),
27
- handlerMetaIndex: new Map(),
28
- controllerComponents: emptyComponentByOwner(),
29
- handlerComponents: {
30
- middleware: new Map(),
31
- guard: new Map(),
32
- pipe: new Map(),
33
- interceptor: new Map(),
34
- filter: new Map()
35
- }
36
- };
37
- }
38
- // HMR-safe: anchor ALL backing state on `globalThis` so a Vite dev re-eval of
39
- // this module reuses the SAME maps that classes were already decorated against.
40
- // Without this, re-eval creates fresh empty statics → split-brain (lost routes,
41
- // spurious "not @Injectable" warnings, duplicated global components). The
42
- // versioned symbol avoids collisions across framework major versions in one
43
- // process. `globalThis` + `Symbol.for` exist on every target runtime; no node:*.
44
- const REGISTRY_STATE_KEY = Symbol.for('vela:registry:v1');
45
- // Shared empty result for index misses — avoids allocating per lookup.
46
- const EMPTY_TARGET_SET = new Set();
47
- function registryState() {
48
- const g = globalThis;
49
- const state = g[REGISTRY_STATE_KEY] ??= createRegistryState();
50
- // Backfill fields added after the v1 state shape was first anchored: a state
51
- // created by an older copy of this module (dist/src coexistence in tests,
52
- // mixed package versions in one process) must not crash newer readers.
53
- state.classMetaIndex ??= new Map();
54
- state.handlerMetaIndex ??= new Map();
55
- return state;
56
- }
57
- export class MetadataRegistry {
58
- // Every field is a getter over the globalThis-anchored state (registryState).
59
- // Method bodies keep using `this.<field>`; the getter returns the live map so
60
- // `.set`/`.get`/`.clear` mutate the shared state.
61
- static get routes() {
62
- return registryState().routes;
63
- }
64
- static get controllers() {
65
- return registryState().controllers;
66
- }
67
- static get controllerOptions() {
68
- return registryState().controllerOptions;
69
- }
70
- static get modules() {
71
- return registryState().modules;
72
- }
73
- static get parameters() {
74
- return registryState().parameters;
75
- }
76
- static get injectables() {
77
- return registryState().injectables;
78
- }
79
- static get scopes() {
80
- return registryState().scopes;
81
- }
82
- static get injectTokens() {
83
- return registryState().injectTokens;
84
- }
85
- static get handlerHttpMeta() {
86
- return registryState().handlerHttpMeta;
87
- }
88
- static get catchTypes() {
89
- return registryState().catchTypes;
90
- }
91
- static get routeVersions() {
92
- return registryState().routeVersions;
93
- }
94
- static get classMeta() {
95
- return registryState().classMeta;
96
- }
97
- static get handlerMeta() {
98
- return registryState().handlerMeta;
99
- }
100
- static get classMetaIndex() {
101
- return registryState().classMetaIndex;
102
- }
103
- static get handlerMetaIndex() {
104
- return registryState().handlerMetaIndex;
105
- }
106
- static get controllerComponents() {
107
- return registryState().controllerComponents;
108
- }
109
- static get handlerComponents() {
110
- return registryState().handlerComponents;
111
- }
112
- // Routes
113
- static getRoutes(controller) {
114
- return this.routes.get(controller) ?? [];
115
- }
116
- static addRoute(controller, route) {
117
- getOrCreateArray(this.routes, controller).push(route);
118
- }
119
- // Controllers
120
- static getControllerPath(controller) {
121
- return this.controllers.get(controller) ?? '';
122
- }
123
- static setControllerPath(controller, path) {
124
- this.controllers.set(controller, path);
125
- }
126
- static getControllerOptions(controller) {
127
- return this.controllerOptions.get(controller) ?? {};
128
- }
129
- static setControllerOptions(controller, options) {
130
- this.controllerOptions.set(controller, options);
131
- }
132
- // Modules
133
- static getModuleOptions(module) {
134
- return this.modules.get(module);
135
- }
136
- static setModuleOptions(module, options) {
137
- this.modules.set(module, options);
138
- }
139
- // Parameters
140
- static getParameters(controller) {
141
- return this.parameters.get(controller) ?? new Map();
142
- }
143
- static addParameter(controller, methodName, param) {
144
- const methodMap = getOrCreateMap(this.parameters, controller);
145
- getOrCreateArray(methodMap, methodName).push(param);
146
- }
147
- // Component registration — controller-level. (There is deliberately NO
148
- // global tier here: app-wide components live on the per-app RouteManager,
149
- // one source, never process-global state.)
150
- static registerController(type, controller, component) {
151
- const map = this.controllerComponents[type];
152
- getOrCreateArray(map, controller).push(component);
153
- }
154
- static getController(type, controller) {
155
- const map = this.controllerComponents[type];
156
- return map.get(controller) ?? [];
157
- }
158
- // Component registration — handler-level
159
- static registerHandler(type, controller, methodName, component) {
160
- const map = this.handlerComponents[type];
161
- const methodMap = getOrCreateMap(map, controller);
162
- getOrCreateArray(methodMap, methodName).push(component);
163
- }
164
- static getHandler(type, controller, methodName) {
165
- const map = this.handlerComponents[type];
166
- return map.get(controller)?.get(methodName) ?? [];
167
- }
168
- // DI metadata
169
- static markInjectable(target) {
170
- this.injectables.add(target);
171
- }
172
- static hasInjectable(target) {
173
- return this.injectables.has(target);
174
- }
175
- static setScope(target, scope) {
176
- this.scopes.set(target, scope);
177
- }
178
- static getScope(target) {
179
- return this.scopes.get(target);
180
- }
181
- static setInjectTokens(target, tokens) {
182
- this.injectTokens.set(target, tokens);
183
- }
184
- static getInjectTokens(target) {
185
- return this.injectTokens.get(target);
186
- }
187
- // HTTP handler metadata
188
- static setHandlerHttpMeta(controller, method, meta) {
189
- const methodMap = getOrCreateMap(this.handlerHttpMeta, controller);
190
- const existing = methodMap.get(method) ?? {};
191
- const merged = {
192
- ...existing,
193
- ...meta
194
- };
195
- if (meta.responseHeaders) {
196
- merged.responseHeaders = [
197
- ...existing.responseHeaders ?? [],
198
- ...meta.responseHeaders
199
- ];
200
- }
201
- methodMap.set(method, merged);
202
- }
203
- static getHandlerHttpMeta(controller, method) {
204
- return this.handlerHttpMeta.get(controller)?.get(method);
205
- }
206
- // Exception filter types
207
- static setCatchTypes(filter, types) {
208
- this.catchTypes.set(filter, types);
209
- }
210
- static getCatchTypes(filter) {
211
- return this.catchTypes.get(filter);
212
- }
213
- static hasCatchTypes(filter) {
214
- return this.catchTypes.has(filter);
215
- }
216
- // Route versions
217
- static setRouteVersion(controller, method, version) {
218
- getOrCreateMap(this.routeVersions, controller).set(method, version);
219
- }
220
- static getRouteVersion(controller, method) {
221
- return this.routeVersions.get(controller)?.get(method);
222
- }
223
- // Custom class/handler metadata. One slot per (target, key) for class-level,
224
- // (target, handler, key) for handler-level. The same slots back @SetMetadata,
225
- // every feature decorator (@Cron, @OnEvent, @ApiDoc, …), the SWC shim, and
226
- // external Reflect.defineMetadata calls — one model, one source of truth.
227
- static setCustomClassMeta(target, key, value) {
228
- getOrCreate(this.classMeta, target, ()=>new Map()).set(key, value);
229
- if (!key.startsWith('design:')) {
230
- getOrCreate(this.classMetaIndex, key, ()=>new Set()).add(target);
231
- }
232
- }
233
- static getCustomClassMeta(target, key) {
234
- return this.classMeta.get(target)?.get(key);
235
- }
236
- static getCustomClassMetaAll(target) {
237
- return this.classMeta.get(target);
238
- }
239
- static setCustomHandlerMeta(target, handler, key, value) {
240
- const byHandler = getOrCreate(this.handlerMeta, target, ()=>new Map());
241
- getOrCreate(byHandler, handler, ()=>new Map()).set(key, value);
242
- if (!key.startsWith('design:')) {
243
- getOrCreate(this.handlerMetaIndex, key, ()=>new Set()).add(target);
244
- }
245
- }
246
- static getCustomHandlerMeta(target, handler, key) {
247
- return this.handlerMeta.get(target)?.get(handler)?.get(key);
248
- }
249
- static getCustomHandlerMetaAll(target, handler) {
250
- return this.handlerMeta.get(target)?.get(handler);
251
- }
252
- // Append helpers — for stackable metadata like @Cron / @Interval / @OnEvent / @ApiResponse.
253
- static appendCustomClassMeta(target, key, item) {
254
- const list = this.getCustomClassMeta(target, key) ?? [];
255
- list.push(item);
256
- this.setCustomClassMeta(target, key, list);
257
- }
258
- static appendCustomHandlerMeta(target, handler, key, item) {
259
- const list = this.getCustomHandlerMeta(target, handler, key) ?? [];
260
- list.push(item);
261
- this.setCustomHandlerMeta(target, handler, key, list);
262
- }
263
- // Reverse-index readers — the DiscoveryService seam. Return the constructors
264
- // known to carry class-level (resp. handler-level) metadata under `key`.
265
- // Callers must still intersect with container-registered tokens: decoration
266
- // alone does not make a class a provider.
267
- static getClassesWithClassMeta(key) {
268
- return this.classMetaIndex.get(key) ?? EMPTY_TARGET_SET;
269
- }
270
- static getClassesWithHandlerMeta(key) {
271
- return this.handlerMetaIndex.get(key) ?? EMPTY_TARGET_SET;
272
- }
273
- /** Every (handler, value) pair on `target` carrying metadata under `key`. */ static getHandlersWithMeta(target, key) {
274
- const byHandler = this.handlerMeta.get(target);
275
- if (!byHandler) return [];
276
- const out = [];
277
- for (const [handler, metaMap] of byHandler){
278
- if (metaMap.has(key)) out.push({
279
- handler,
280
- value: metaMap.get(key)
281
- });
282
- }
283
- return out;
284
- }
285
- // Reflect-style API — same storage as the typed setters above. Lets external
286
- // code (and the SWC shim's Reflect.metadata polyfill) write/read uniformly.
287
- static setReflectMetadata(target, key, value, propertyKey) {
288
- if (propertyKey !== undefined) {
289
- this.setCustomHandlerMeta(target, propertyKey, key, value);
290
- } else {
291
- this.setCustomClassMeta(target, key, value);
292
- }
293
- }
294
- static getReflectMetadata(target, key, propertyKey) {
295
- if (propertyKey !== undefined) {
296
- return this.getCustomHandlerMeta(target, propertyKey, key);
297
- }
298
- return this.getCustomClassMeta(target, key);
299
- }
300
- // SWC-emitted design:paramtypes — class-level for constructors, handler-level for methods.
301
- static getParamTypes(target, propertyKey) {
302
- return this.getReflectMetadata(target, 'design:paramtypes', propertyKey);
303
- }
304
- // Propagate all controller-level components from one class to another.
305
- static propagateControllerComponents(from, to) {
306
- for (const type of [
307
- 'middleware',
308
- 'guard',
309
- 'pipe',
310
- 'interceptor',
311
- 'filter'
312
- ]){
313
- const map = this.controllerComponents[type];
314
- const components = map.get(from);
315
- if (components && components.length > 0) {
316
- const target = getOrCreateArray(map, to);
317
- target.push(...components);
318
- }
319
- }
320
- }
321
- // Clear app-time state. Decoration metadata persists — once a class is
322
- // decorated, that fact is permanent for the lifetime of the process.
323
- // Currently a no-op: the last piece of app-time registry state (the global
324
- // component tier) moved to the per-app RouteManager. Kept because test
325
- // suites call it between cases and future app-time state belongs here.
326
- static clear() {
327
- // no app-time state to clear
328
- }
329
- // Full reset, including decoration metadata. Used in framework-internal scenarios.
330
- static reset() {
331
- this.routes.clear();
332
- this.controllers.clear();
333
- this.controllerOptions.clear();
334
- this.modules.clear();
335
- this.parameters.clear();
336
- this.injectables.clear();
337
- this.scopes.clear();
338
- this.injectTokens.clear();
339
- this.handlerHttpMeta.clear();
340
- this.catchTypes.clear();
341
- this.routeVersions.clear();
342
- this.classMeta.clear();
343
- this.handlerMeta.clear();
344
- this.classMetaIndex.clear();
345
- this.handlerMetaIndex.clear();
346
- for (const type of [
347
- 'middleware',
348
- 'guard',
349
- 'pipe',
350
- 'interceptor',
351
- 'filter'
352
- ]){
353
- this.controllerComponents[type].clear();
354
- this.handlerComponents[type].clear();
355
- }
356
- }
357
- }
@@ -1,3 +0,0 @@
1
- export declare function normalizePath(path: string): string;
2
- export declare function joinPaths(prefix: string, path: string): string;
3
- export declare function toOpenApiPath(path: string): string;
@@ -1,15 +0,0 @@
1
- // Single home for path manipulation. Used by route building, openapi docs,
2
- // and decorator metadata.
3
- export function normalizePath(path) {
4
- if (!path) return path;
5
- return path.startsWith('/') ? path : `/${path}`;
6
- }
7
- export function joinPaths(prefix, path) {
8
- const cleanPrefix = prefix.endsWith('/') ? prefix.slice(0, -1) : prefix;
9
- const cleanPath = path && !path.startsWith('/') ? `/${path}` : path;
10
- return `${cleanPrefix}${cleanPath}` || '/';
11
- }
12
- // Convert ':id' Hono syntax to '{id}' OpenAPI syntax.
13
- export function toOpenApiPath(path) {
14
- return path.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g, '{$1}');
15
- }
@@ -1,116 +0,0 @@
1
- import type { Context } from 'hono';
2
- import type { CanActivate, ExceptionFilter, NestInterceptor, NestMiddleware, PipeTransform } from '../pipeline/types';
3
- import type { Constructor, ForwardRef, InferToken, InferTokens, InjectionToken, ProviderOptions, Token, Type } from '../container/types';
4
- export type { Constructor, ForwardRef, InferToken, InferTokens, InjectionToken, ProviderOptions, Token, Type };
5
- export type ComponentType = 'middleware' | 'guard' | 'pipe' | 'interceptor' | 'filter';
6
- export type MiddlewareType = Type<NestMiddleware> | NestMiddleware;
7
- export type GuardType = Type<CanActivate> | CanActivate;
8
- export type PipeType = Type<PipeTransform> | PipeTransform;
9
- export type InterceptorType = Type<NestInterceptor> | NestInterceptor;
10
- export type FilterType = Type<ExceptionFilter> | ExceptionFilter;
11
- export interface ComponentTypeMap {
12
- middleware: MiddlewareType;
13
- guard: GuardType;
14
- pipe: PipeType;
15
- interceptor: InterceptorType;
16
- filter: FilterType;
17
- }
18
- export type ComponentInstance = MiddlewareType | GuardType | PipeType | InterceptorType | FilterType;
19
- export interface RouteDefinition {
20
- method: string;
21
- path: string;
22
- handlerName: string | symbol;
23
- version?: number | number[];
24
- /** Route name for URL generation / OpenAPI operationId (`@Get(path, { name })`). */
25
- name?: string;
26
- }
27
- export interface ParameterMetadata {
28
- index: number;
29
- type: string;
30
- name?: string;
31
- pipes?: PipeType[];
32
- factory?: (data: unknown, ctx: Context) => unknown;
33
- /**
34
- * Explicit param type for programmatic routes. Methods synthesized at
35
- * runtime (e.g. `@Crud()` verb handlers) have no `design:paramtypes`, so
36
- * ValidationPipe and the OpenAPI walk read this instead when present.
37
- */
38
- metatype?: unknown;
39
- }
40
- export interface HttpHandlerMeta {
41
- httpCode?: number;
42
- responseHeaders?: Array<[string, string]>;
43
- redirect?: {
44
- url: string;
45
- statusCode: number;
46
- };
47
- }
48
- export type ModuleImport = Type | DynamicModule | ForwardRef;
49
- /**
50
- * Async module options with **type-inferred `useFactory` parameters**.
51
- *
52
- * The `Inject` generic captures the literal `inject` tuple via `const` type
53
- * parameter inference at the call site (TS 5.0+ — vela already requires it).
54
- * `useFactory`'s parameter types are computed from that tuple via
55
- * `InferTokens<Inject>`, so:
56
- *
57
- * ```ts
58
- * SomeModule.forRootAsync({
59
- * inject: [D1Service, ConfigService], // captured as readonly [typeof D1Service, typeof ConfigService]
60
- * useFactory: (d1, config) => { ... }, // d1: D1Service, config: ConfigService — inferred
61
- * });
62
- * ```
63
- *
64
- * Backwards compatible: when `inject` isn't a literal tuple (or is omitted),
65
- * `Inject` falls back to `readonly Token<unknown>[]`, `InferTokens` resolves
66
- * to `unknown[]`, and `useFactory` accepts variadic `unknown[]` — the prior
67
- * loose-typing behavior. Existing callers don't break.
68
- */
69
- export interface AsyncModuleOptions<T = unknown, Inject extends readonly Token<unknown>[] = readonly Token<unknown>[]> {
70
- imports?: ModuleImport[];
71
- inject?: Inject;
72
- useFactory: (...args: InferTokens<Inject>) => T | Promise<T>;
73
- }
74
- export interface DynamicModule {
75
- module: Type;
76
- /**
77
- * Author-supplied instance discriminator. Two DynamicModules with the same
78
- * `module` class and the same `key` dedup; with different keys they coexist
79
- * as separate module instances. Defaults to `"default"` when absent — which
80
- * preserves single-instance dedup for the common case.
81
- *
82
- * For `forRoot(options)`, derive `key: stableHash(options)` so identical
83
- * options dedup automatically. For `forRootAsync` (factories aren't
84
- * structurally hashable), pass an explicit string.
85
- */
86
- key?: string;
87
- imports?: ModuleImport[];
88
- providers?: Array<Type | ProviderOptions>;
89
- controllers?: Type[];
90
- exports?: Array<Type | InjectionToken>;
91
- global?: boolean;
92
- /**
93
- * Defer this module instance's providers/controllers to first use: nothing
94
- * constructs at bootstrap; the first resolution of any of its tokens
95
- * materializes the whole group and replays its lifecycle hooks (memoized).
96
- * See MODULE_AUTHORING.md "Lazy modules" for the contract.
97
- */
98
- lazy?: boolean;
99
- }
100
- export interface ModuleOptions {
101
- providers?: Array<Type | ProviderOptions>;
102
- controllers?: Type[];
103
- imports?: ModuleImport[];
104
- exports?: Array<Type | InjectionToken>;
105
- isGlobal?: boolean;
106
- /** Defer to first use (see {@link DynamicModule.lazy}). */
107
- lazy?: boolean;
108
- }
109
- export interface ModuleMetadata {
110
- providers: Array<Type | ProviderOptions>;
111
- controllers: Type[];
112
- imports: ModuleImport[];
113
- exports: Array<Type | InjectionToken>;
114
- isGlobal: boolean;
115
- lazy: boolean;
116
- }
@@ -1 +0,0 @@
1
- export { };
@@ -1,3 +0,0 @@
1
- export declare function getOrCreate<K, V>(map: Map<K, V>, key: K, factory: () => V): V;
2
- export declare const getOrCreateMap: <K, NK, NV>(map: Map<K, Map<NK, NV>>, key: K) => Map<NK, NV>;
3
- export declare const getOrCreateArray: <K, V>(map: Map<K, V[]>, key: K) => V[];
@@ -1,8 +0,0 @@
1
- // Single map.get + optional set. Replaces `map.has(key) || map.set(key, …); map.get(key)!` patterns.
2
- export function getOrCreate(map, key, factory) {
3
- let v = map.get(key);
4
- if (v === undefined) map.set(key, v = factory());
5
- return v;
6
- }
7
- export const getOrCreateMap = (map, key)=>getOrCreate(map, key, ()=>new Map());
8
- export const getOrCreateArray = (map, key)=>getOrCreate(map, key, ()=>[]);
@@ -1,2 +0,0 @@
1
- export type CronMatcher = (date: Date) => boolean;
2
- export declare function parseCron(expression: string): CronMatcher | null;
@@ -1,62 +0,0 @@
1
- export function parseCron(expression) {
2
- const fields = expression.trim().split(/\s+/);
3
- if (fields.length !== 5) return null;
4
- const [minuteField, hourField, dayField, monthField, weekdayField] = fields;
5
- const minute = parseField(minuteField, 0, 59);
6
- const hour = parseField(hourField, 0, 23);
7
- const day = parseField(dayField, 1, 31);
8
- const month = parseField(monthField, 1, 12);
9
- const weekday = parseField(weekdayField, 0, 7);
10
- if (!minute || !hour || !day || !month || !weekday) return null;
11
- return (date)=>minute(date.getMinutes()) && hour(date.getHours()) && day(date.getDate()) && month(date.getMonth() + 1) && weekday(date.getDay());
12
- }
13
- function parseField(field, min, max) {
14
- const segments = field.split(',');
15
- const predicates = [];
16
- for (const rawSegment of segments){
17
- const segment = rawSegment.trim();
18
- if (!segment) return null;
19
- const stepParts = segment.split('/');
20
- if (stepParts.length > 2) return null;
21
- const step = stepParts.length === 2 ? Number(stepParts[1]) : 1;
22
- if (!Number.isInteger(step) || step <= 0) return null;
23
- const range = parseRange(stepParts[0], min, max);
24
- if (!range) return null;
25
- predicates.push((value)=>{
26
- if (value < range.start || value > range.end) return false;
27
- return (value - range.start) % step === 0;
28
- });
29
- }
30
- return (value)=>predicates.some((p)=>p(value));
31
- }
32
- function parseRange(segment, min, max) {
33
- if (segment === '*') return {
34
- start: min,
35
- end: max
36
- };
37
- const bounds = segment.split('-');
38
- if (bounds.length === 1) {
39
- const value = parseCronNumber(bounds[0], min, max);
40
- if (value === null) return null;
41
- return {
42
- start: value,
43
- end: value
44
- };
45
- }
46
- if (bounds.length !== 2) return null;
47
- const start = parseCronNumber(bounds[0], min, max);
48
- const end = parseCronNumber(bounds[1], min, max);
49
- if (start === null || end === null || start > end) return null;
50
- return {
51
- start,
52
- end
53
- };
54
- }
55
- function parseCronNumber(raw, min, max) {
56
- const value = Number(raw);
57
- if (!Number.isInteger(value)) return null;
58
- // Cron allows 0 and 7 as Sunday.
59
- const normalized = max === 7 && value === 7 ? 0 : value;
60
- if (normalized < min || normalized > max) return null;
61
- return normalized;
62
- }
@@ -1,8 +0,0 @@
1
- export { ScheduleModule } from './schedule.module';
2
- export { ScheduleRegistry } from './schedule.registry';
3
- export type { RegisteredCronJob, RegisteredIntervalJob } from './schedule.registry';
4
- export { Cron, Interval } from './schedule.decorators';
5
- export { CRON_METADATA, INTERVAL_METADATA } from './schedule.tokens';
6
- export type { CronMetadata, IntervalMetadata } from './schedule.types';
7
- export { parseCron } from './cron-matcher';
8
- export type { CronMatcher } from './cron-matcher';
@@ -1,5 +0,0 @@
1
- export { ScheduleModule } from "./schedule.module.js";
2
- export { ScheduleRegistry } from "./schedule.registry.js";
3
- export { Cron, Interval } from "./schedule.decorators.js";
4
- export { CRON_METADATA, INTERVAL_METADATA } from "./schedule.tokens.js";
5
- export { parseCron } from "./cron-matcher.js";
@@ -1,2 +0,0 @@
1
- export declare function Cron(expression: string): MethodDecorator;
2
- export declare function Interval(ms: number): MethodDecorator;
@@ -1,18 +0,0 @@
1
- import { MetadataRegistry } from "../registry/metadata.registry.js";
2
- import { CRON_METADATA, INTERVAL_METADATA } from "./schedule.tokens.js";
3
- export function Cron(expression) {
4
- return (target, propertyKey)=>{
5
- MetadataRegistry.appendCustomClassMeta(target.constructor, CRON_METADATA, {
6
- expression,
7
- methodName: String(propertyKey)
8
- });
9
- };
10
- }
11
- export function Interval(ms) {
12
- return (target, propertyKey)=>{
13
- MetadataRegistry.appendCustomClassMeta(target.constructor, INTERVAL_METADATA, {
14
- ms,
15
- methodName: String(propertyKey)
16
- });
17
- };
18
- }
@@ -1,9 +0,0 @@
1
- import type { DynamicModule } from '../module/types';
2
- /**
3
- * Zero-config module (Tier C): providers live on the `@Module` bag; the
4
- * `forRoot()` static is NestJS-parity sugar returning the bare dynamic module
5
- * (default key — repeated calls dedup).
6
- */
7
- export declare class ScheduleModule {
8
- static forRoot(): DynamicModule;
9
- }
@@ -1,28 +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 { Module } from "../module/decorators.js";
8
- import { ScheduleRegistry } from "./schedule.registry.js";
9
- export class ScheduleModule {
10
- static forRoot() {
11
- return {
12
- module: ScheduleModule
13
- };
14
- }
15
- }
16
- ScheduleModule = _ts_decorate([
17
- Module({
18
- // Lazy: the @Cron/@Interval discovery pass runs when ScheduleRegistry is
19
- // first resolved (executor bootstrap, introspection, first dispatch).
20
- lazy: true,
21
- providers: [
22
- ScheduleRegistry
23
- ],
24
- exports: [
25
- ScheduleRegistry
26
- ]
27
- })
28
- ], ScheduleModule);
@@ -1,23 +0,0 @@
1
- import { DiscoveryService } from '../discovery/discovery.service';
2
- import type { OnApplicationBootstrap } from '../lifecycle/index';
3
- export interface RegisteredCronJob {
4
- expression: string;
5
- methodName: string;
6
- instance: unknown;
7
- target: Function;
8
- }
9
- export interface RegisteredIntervalJob {
10
- ms: number;
11
- methodName: string;
12
- instance: unknown;
13
- target: Function;
14
- }
15
- export declare class ScheduleRegistry implements OnApplicationBootstrap {
16
- private readonly discovery;
17
- private cronJobs;
18
- private intervalJobs;
19
- constructor(discovery: DiscoveryService);
20
- onApplicationBootstrap(): void;
21
- getCronJobs(): RegisteredCronJob[];
22
- getIntervalJobs(): RegisteredIntervalJob[];
23
- }