@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,17 +0,0 @@
1
- import { Scope } from '../constants';
2
- import type { InjectableOptions, InjectMetadata, Token } from './types';
3
- import { ForwardRef } from './types';
4
- export declare function Injectable(options?: InjectableOptions): ClassDecorator;
5
- export declare function Optional(): ParameterDecorator;
6
- export declare function Inject(token: Token | ForwardRef): ParameterDecorator;
7
- export declare function isInjectable(target: object): boolean;
8
- export declare function getScope(target: object): Scope;
9
- /**
10
- * Read through Reflect so dist/src coexistence in tests routes through the
11
- * single polyfill-installed registry — SWC writes `design:paramtypes` via
12
- * Reflect, so reads must too. The runtime contract is that each entry is a
13
- * constructor reference (a `Token`); we surface that contract directly so
14
- * callers don't need to re-cast.
15
- */
16
- export declare function getConstructorDependencies(target: object): Array<Token | undefined>;
17
- export declare function getInjectMetadata(target: object): InjectMetadata[];
@@ -1,57 +0,0 @@
1
- import { Scope } from "../constants.js";
2
- import { MetadataRegistry } from "../registry/metadata.registry.js";
3
- export function Injectable(options = {}) {
4
- return (target)=>{
5
- const { scope = Scope.SINGLETON } = options;
6
- MetadataRegistry.markInjectable(target);
7
- MetadataRegistry.setScope(target, scope);
8
- };
9
- }
10
- export function Optional() {
11
- return (target, _propertyKey, parameterIndex)=>{
12
- const existing = getInjectMetadata(target);
13
- const entry = existing.find((m)=>m.index === parameterIndex);
14
- if (entry) {
15
- entry.optional = true;
16
- } else {
17
- existing.push({
18
- index: parameterIndex,
19
- optional: true
20
- });
21
- }
22
- MetadataRegistry.setInjectTokens(target, existing);
23
- };
24
- }
25
- export function Inject(token) {
26
- return (target, _propertyKey, parameterIndex)=>{
27
- const existing = getInjectMetadata(target);
28
- const entry = existing.find((m)=>m.index === parameterIndex);
29
- if (entry) {
30
- entry.token = token;
31
- } else {
32
- existing.push({
33
- index: parameterIndex,
34
- token
35
- });
36
- }
37
- MetadataRegistry.setInjectTokens(target, existing);
38
- };
39
- }
40
- export function isInjectable(target) {
41
- return MetadataRegistry.hasInjectable(target);
42
- }
43
- export function getScope(target) {
44
- return MetadataRegistry.getScope(target) ?? Scope.SINGLETON;
45
- }
46
- /**
47
- * Read through Reflect so dist/src coexistence in tests routes through the
48
- * single polyfill-installed registry — SWC writes `design:paramtypes` via
49
- * Reflect, so reads must too. The runtime contract is that each entry is a
50
- * constructor reference (a `Token`); we surface that contract directly so
51
- * callers don't need to re-cast.
52
- */ export function getConstructorDependencies(target) {
53
- return Reflect.getMetadata('design:paramtypes', target) ?? [];
54
- }
55
- export function getInjectMetadata(target) {
56
- return MetadataRegistry.getInjectTokens(target) ?? [];
57
- }
@@ -1,5 +0,0 @@
1
- export interface Disposable {
2
- dispose?(): void | Promise<void>;
3
- }
4
- export declare function isDisposable(value: unknown): boolean;
5
- export declare function disposeInstance(value: unknown): Promise<void>;
@@ -1,33 +0,0 @@
1
- // Edge-safe disposal contract. Precedence:
2
- // Symbol.asyncDispose > Symbol.dispose > .dispose()
3
- // Symbol.asyncDispose/Symbol.dispose are resolved at runtime (they are not in
4
- // the ES2022 lib the project targets), so nothing here depends on the
5
- // esnext.disposable typings.
6
- const ASYNC_DISPOSE = Symbol.asyncDispose;
7
- const SYNC_DISPOSE = Symbol.dispose;
8
- function asRecord(value) {
9
- if (value === null) return undefined;
10
- return typeof value === 'object' || typeof value === 'function' ? value : undefined;
11
- }
12
- export function isDisposable(value) {
13
- const obj = asRecord(value);
14
- if (!obj) return false;
15
- if (ASYNC_DISPOSE && typeof obj[ASYNC_DISPOSE] === 'function') return true;
16
- if (SYNC_DISPOSE && typeof obj[SYNC_DISPOSE] === 'function') return true;
17
- return typeof obj.dispose === 'function';
18
- }
19
- export async function disposeInstance(value) {
20
- const obj = asRecord(value);
21
- if (!obj) return;
22
- if (ASYNC_DISPOSE && typeof obj[ASYNC_DISPOSE] === 'function') {
23
- await obj[ASYNC_DISPOSE].call(obj);
24
- return;
25
- }
26
- if (SYNC_DISPOSE && typeof obj[SYNC_DISPOSE] === 'function') {
27
- obj[SYNC_DISPOSE].call(obj);
28
- return;
29
- }
30
- if (typeof obj.dispose === 'function') {
31
- await obj.dispose.call(obj);
32
- }
33
- }
@@ -1,6 +0,0 @@
1
- export { Container } from './container';
2
- export { Injectable, Inject, Optional, isInjectable, getScope } from './decorators';
3
- export { InjectionToken, ForwardRef, forwardRef, ModuleVisibilityError, MultipleProvidersFoundError, ROOT_MODULE_ID, describeToken, } from './types';
4
- export { ModuleRef } from './module-ref';
5
- export { mixin } from './mixin';
6
- export type { Type, Token, InferToken, InferTokens, InjectableOptions, InjectMetadata, ProviderOptions, ProviderRegistration, InjectionTokenOptions, ModuleScope, ModuleDescription, ContainerOptions, Diagnostics, } from './types';
@@ -1,5 +0,0 @@
1
- export { Container } from "./container.js";
2
- export { Injectable, Inject, Optional, isInjectable, getScope } from "./decorators.js";
3
- export { InjectionToken, ForwardRef, forwardRef, ModuleVisibilityError, MultipleProvidersFoundError, ROOT_MODULE_ID, describeToken } from "./types.js";
4
- export { ModuleRef } from "./module-ref.js";
5
- export { mixin } from "./mixin.js";
@@ -1,24 +0,0 @@
1
- import type { Type } from './types';
2
- /**
3
- * Creates a reusable injectable mixin class from a base class.
4
- * Applies @Injectable() so the returned class can be registered as a provider.
5
- *
6
- * @example
7
- * ```ts
8
- * function RoleGuardMixin(role: string) {
9
- * class MixedRoleGuard implements CanActivate {
10
- * canActivate(ctx: ExecutionContext) {
11
- * return ctx.getRequest().headers.get('x-role') === role;
12
- * }
13
- * }
14
- * return mixin(MixedRoleGuard);
15
- * }
16
- *
17
- * const AdminGuard = RoleGuardMixin('admin');
18
- *
19
- * @UseGuards(AdminGuard)
20
- * @Get('/admin')
21
- * adminOnly() { ... }
22
- * ```
23
- */
24
- export declare function mixin<T>(mixinClass: Type<T>): Type<T>;
@@ -1,26 +0,0 @@
1
- import { Injectable } from "./decorators.js";
2
- /**
3
- * Creates a reusable injectable mixin class from a base class.
4
- * Applies @Injectable() so the returned class can be registered as a provider.
5
- *
6
- * @example
7
- * ```ts
8
- * function RoleGuardMixin(role: string) {
9
- * class MixedRoleGuard implements CanActivate {
10
- * canActivate(ctx: ExecutionContext) {
11
- * return ctx.getRequest().headers.get('x-role') === role;
12
- * }
13
- * }
14
- * return mixin(MixedRoleGuard);
15
- * }
16
- *
17
- * const AdminGuard = RoleGuardMixin('admin');
18
- *
19
- * @UseGuards(AdminGuard)
20
- * @Get('/admin')
21
- * adminOnly() { ... }
22
- * ```
23
- */ export function mixin(mixinClass) {
24
- Injectable()(mixinClass);
25
- return mixinClass;
26
- }
@@ -1,21 +0,0 @@
1
- import type { Token, Type } from './types';
2
- import type { Container } from './container';
3
- export declare class ModuleRef {
4
- private readonly container;
5
- constructor(container: Container);
6
- /**
7
- * Retrieve a provider instance from the DI container.
8
- * Returns the existing singleton (or cached value) for the token.
9
- */
10
- get<T>(token: Token<T>): T;
11
- /**
12
- * Resolve a provider, creating a new instance for TRANSIENT-scoped providers.
13
- * For SINGLETON-scoped providers this is equivalent to get().
14
- */
15
- resolve<T>(token: Token<T>): T;
16
- /**
17
- * Instantiate a class outside of the DI container's singleton cache.
18
- * Dependencies are resolved from the container. Each call returns a new instance.
19
- */
20
- create<T>(type: Type<T>): T;
21
- }
@@ -1,48 +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
- function _ts_metadata(k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- }
10
- import { Scope } from "../constants.js";
11
- import { Injectable } from "./decorators.js";
12
- export class ModuleRef {
13
- container;
14
- constructor(container){
15
- this.container = container;
16
- }
17
- /**
18
- * Retrieve a provider instance from the DI container.
19
- * Returns the existing singleton (or cached value) for the token.
20
- */ get(token) {
21
- return this.container.resolve(token);
22
- }
23
- /**
24
- * Resolve a provider, creating a new instance for TRANSIENT-scoped providers.
25
- * For SINGLETON-scoped providers this is equivalent to get().
26
- */ resolve(token) {
27
- return this.container.resolve(token);
28
- }
29
- /**
30
- * Instantiate a class outside of the DI container's singleton cache.
31
- * Dependencies are resolved from the container. Each call returns a new instance.
32
- */ create(type) {
33
- const sandbox = this.container.createDetached();
34
- sandbox.register({
35
- provide: type,
36
- useClass: type,
37
- scope: Scope.TRANSIENT
38
- });
39
- return sandbox.resolve(type);
40
- }
41
- }
42
- ModuleRef = _ts_decorate([
43
- Injectable(),
44
- _ts_metadata("design:type", Function),
45
- _ts_metadata("design:paramtypes", [
46
- typeof Container === "undefined" ? Object : Container
47
- ])
48
- ], ModuleRef);
@@ -1,154 +0,0 @@
1
- import type { Scope } from '../constants';
2
- export type Type<T = any> = new (...args: any[]) => T;
3
- export type Constructor<T = unknown> = abstract new (...args: any[]) => T;
4
- export interface InjectionTokenOptions<T> {
5
- factory?: () => T;
6
- }
7
- export declare class InjectionToken<T = unknown> {
8
- private readonly description;
9
- readonly options?: InjectionTokenOptions<T> | undefined;
10
- constructor(description: string, options?: InjectionTokenOptions<T> | undefined);
11
- toString(): string;
12
- }
13
- export declare class ForwardRef<T = unknown> {
14
- readonly factory: () => Token<T>;
15
- constructor(factory: () => Token<T>);
16
- }
17
- export declare function forwardRef<T>(factory: () => Token<T>): ForwardRef<T>;
18
- export type Token<T = any> = Type<T> | InjectionToken<T> | string | symbol;
19
- /**
20
- * Maps a single DI `Token<T>` to its resolved value type at the type level:
21
- * - `InjectionToken<T>` → `T`
22
- * - `Type<T>` / `Constructor<T>` → `T` (the instance type)
23
- * - `ForwardRef<T>` → `T`
24
- * - `string` / `symbol` → `unknown` (runtime-only tokens carry no
25
- * static type info; the consumer asserts).
26
- *
27
- * Used by `AsyncModuleOptions` to give `useFactory` parameters their real
28
- * types based on the literal `inject` tuple — without `as const` at the call
29
- * site (relies on the `const` type parameter on the consuming generic).
30
- */
31
- export type InferToken<T> = T extends InjectionToken<infer U> ? U : T extends ForwardRef<infer U> ? U : T extends abstract new (...args: any[]) => infer U ? U : unknown;
32
- /**
33
- * Map every position of a `Token[]` tuple to its resolved value type.
34
- * Pairs with `const Inject extends readonly Token<unknown>[]` generics to
35
- * give `useFactory(...deps)` parameter types inferred from the literal
36
- * `inject` array.
37
- */
38
- export type InferTokens<T extends readonly unknown[]> = {
39
- [K in keyof T]: InferToken<T[K]>;
40
- };
41
- export interface InjectableOptions {
42
- scope?: Scope;
43
- }
44
- export interface InjectMetadata {
45
- index: number;
46
- token?: Token | ForwardRef;
47
- optional?: boolean;
48
- }
49
- export interface ProviderOptions<T = unknown> {
50
- provide?: Token<T>;
51
- scope?: Scope;
52
- useValue?: T;
53
- useFactory?: (...args: any[]) => T | Promise<T>;
54
- useClass?: Type<T>;
55
- inject?: readonly Token[];
56
- useExisting?: Token<T>;
57
- }
58
- export interface ProviderRegistration<T = unknown> {
59
- provide: Token<T>;
60
- /** The declared scope (from `@Injectable`/`@Controller`/provider options). */
61
- scope: Scope;
62
- /**
63
- * Scope after request-scope bubbling: `REQUEST` if this provider (transitively)
64
- * depends on a request-scoped provider, else the declared scope. Computed once
65
- * at bootstrap (`Container.computeEffectiveScopes`); falls back to `scope`
66
- * until then. Governs caching + eager instantiation.
67
- */
68
- effectiveScope?: Scope;
69
- /**
70
- * Module that owns this registration. Used by `resolveClass` to determine
71
- * the POV from which the class's dependencies resolve. Sandbox/bootstrap
72
- * registrations land in the `"__root__"` bucket.
73
- */
74
- declaringModuleId: string;
75
- instance?: T;
76
- useValue?: T;
77
- useFactory?: (...args: any[]) => T | Promise<T>;
78
- useClass?: Type<T>;
79
- inject?: readonly Token[];
80
- useExisting?: Token<T>;
81
- }
82
- export interface ModuleScope {
83
- moduleId: string;
84
- localProviders: Set<Token>;
85
- importedModules: Set<string>;
86
- exportedTokens: Set<Token>;
87
- isGlobal: boolean;
88
- /** Module instance opted into deferred (first-use) materialization. */
89
- lazy?: boolean;
90
- }
91
- /**
92
- * The container's seam into lazy-module materialization (implemented by
93
- * `LazyModuleManager`). The container only ever *claims* a pending module at
94
- * a resolution trigger and *drains* completed claims when the resolution
95
- * stack has fully unwound — construction and hook replay live behind this
96
- * interface so the container stays module-system-agnostic.
97
- */
98
- export interface LazyResolutionHook {
99
- /** Is this module instance still deferred (untriggered)? */
100
- isPending(moduleId: string): boolean;
101
- /** Mark a pending module as triggered; idempotent. */
102
- claim(moduleId: string): void;
103
- /** Any claimed-but-unmaterialized groups? (cheap fast-path check) */
104
- hasClaimed(): boolean;
105
- /**
106
- * A drain loop is currently running. The container must NOT start (or
107
- * await) another drain from inside it — the running loop picks pending
108
- * claims up; awaiting would self-deadlock on the async path.
109
- */
110
- isDraining(): boolean;
111
- /** Complete claimed groups synchronously; throws if async work surfaces. */
112
- drainSync(): void;
113
- /** Complete claimed groups, awaiting async construction and hooks. */
114
- drainAsync(): Promise<void>;
115
- }
116
- export type Diagnostics = 'silent' | 'log' | 'throw';
117
- export interface ContainerOptions {
118
- diagnostics?: Diagnostics;
119
- }
120
- /**
121
- * Human-readable token label — class name, `InjectionToken(desc)`, symbol
122
- * string, or String() fallback. Public so introspection tooling (module
123
- * graphs, entrypoint listings) renders tokens the same way vela's own errors
124
- * do.
125
- */
126
- export declare function describeToken(token: Token): string;
127
- /**
128
- * One module instance in the loaded graph, serializable (strings only) —
129
- * what `Container.getModuleDescriptions()` returns for introspection tooling
130
- * (`vela module graph`). Reads registration state only; never constructs.
131
- */
132
- export interface ModuleDescription {
133
- moduleId: string;
134
- /** moduleIds this instance imports. */
135
- imports: string[];
136
- isGlobal: boolean;
137
- lazy: boolean;
138
- /** Token labels registered in this instance's bucket (registration order). */
139
- providers: string[];
140
- /** Token labels this instance exports. */
141
- exports: string[];
142
- }
143
- export declare class ModuleVisibilityError extends Error {
144
- readonly moduleId: string;
145
- readonly token: Token;
146
- constructor(moduleId: string, token: Token);
147
- }
148
- export declare class MultipleProvidersFoundError extends Error {
149
- readonly moduleId: string;
150
- readonly token: Token;
151
- readonly candidates: string[];
152
- constructor(moduleId: string, token: Token, candidates: string[]);
153
- }
154
- export declare const ROOT_MODULE_ID = "__root__";
@@ -1,49 +0,0 @@
1
- export class InjectionToken {
2
- description;
3
- options;
4
- constructor(description, options){
5
- this.description = description;
6
- this.options = options;
7
- }
8
- toString() {
9
- return `InjectionToken(${this.description})`;
10
- }
11
- }
12
- export class ForwardRef {
13
- factory;
14
- constructor(factory){
15
- this.factory = factory;
16
- }
17
- }
18
- export function forwardRef(factory) {
19
- return new ForwardRef(factory);
20
- }
21
- /**
22
- * Human-readable token label — class name, `InjectionToken(desc)`, symbol
23
- * string, or String() fallback. Public so introspection tooling (module
24
- * graphs, entrypoint listings) renders tokens the same way vela's own errors
25
- * do.
26
- */ export function describeToken(token) {
27
- if (token instanceof InjectionToken) return token.toString();
28
- if (typeof token === 'function') return token.name;
29
- if (typeof token === 'symbol') return token.toString();
30
- return String(token);
31
- }
32
- export class ModuleVisibilityError extends Error {
33
- moduleId;
34
- token;
35
- constructor(moduleId, token){
36
- super(`Module '${moduleId}' cannot resolve '${describeToken(token)}': ` + `not declared in providers, not imported from another module's exports, not @Global. ` + `Either add to imports/exports or mark as @Global.`), this.moduleId = moduleId, this.token = token;
37
- this.name = 'ModuleVisibilityError';
38
- }
39
- }
40
- export class MultipleProvidersFoundError extends Error {
41
- moduleId;
42
- token;
43
- candidates;
44
- constructor(moduleId, token, candidates){
45
- super(`Multiple providers found for '${describeToken(token)}' in module '${moduleId}':\n` + candidates.map((c)=>` - ${c}`).join('\n') + `\nResolve ambiguity by importing only one instance, or by using a per-instance ` + `accessor exposed by the module (e.g., Module.tokenFor(key)).`), this.moduleId = moduleId, this.token = token, this.candidates = candidates;
46
- this.name = 'MultipleProvidersFoundError';
47
- }
48
- }
49
- export const ROOT_MODULE_ID = '__root__';
@@ -1,7 +0,0 @@
1
- import type { CorsOptions } from './cors.types';
2
- declare const ConfigurableModuleClass: import("..").ConfigurableModuleClassType<CorsOptions, "forRoot", "create", {
3
- isGlobal?: boolean;
4
- }>;
5
- export declare class CorsModule extends ConfigurableModuleClass {
6
- }
7
- export {};
@@ -1,37 +0,0 @@
1
- import { cors } from "hono/cors";
2
- import { defineModule } from "../module/define-module.js";
3
- import { APP_MIDDLEWARE } from "../pipeline/tokens.js";
4
- import { CORS_OPTIONS } from "./cors.tokens.js";
5
- function buildCorsMiddleware(options) {
6
- const corsMiddleware = cors({
7
- origin: options.origin ?? '*',
8
- allowMethods: options.allowMethods,
9
- allowHeaders: options.allowHeaders,
10
- exposeHeaders: options.exposeHeaders,
11
- credentials: options.credentials,
12
- maxAge: options.maxAge
13
- });
14
- return {
15
- use: (c, next)=>corsMiddleware(c, next)
16
- };
17
- }
18
- const { ConfigurableModuleClass } = defineModule({
19
- name: 'Cors',
20
- optionsToken: CORS_OPTIONS,
21
- setup: ({ OPTIONS })=>({
22
- providers: [
23
- {
24
- provide: APP_MIDDLEWARE,
25
- useFactory: (options)=>buildCorsMiddleware(options),
26
- inject: [
27
- OPTIONS
28
- ]
29
- }
30
- ],
31
- exports: [
32
- OPTIONS
33
- ]
34
- })
35
- });
36
- export class CorsModule extends ConfigurableModuleClass {
37
- }
@@ -1,3 +0,0 @@
1
- import { InjectionToken } from '../container/types';
2
- import type { CorsOptions } from './cors.types';
3
- export declare const CORS_OPTIONS: InjectionToken<CorsOptions>;
@@ -1,2 +0,0 @@
1
- import { InjectionToken } from "../container/types.js";
2
- export const CORS_OPTIONS = new InjectionToken('CORS_OPTIONS');
@@ -1,8 +0,0 @@
1
- export interface CorsOptions {
2
- origin?: string | string[] | ((origin: string) => string | undefined | null);
3
- allowMethods?: string[];
4
- allowHeaders?: string[];
5
- exposeHeaders?: string[];
6
- credentials?: boolean;
7
- maxAge?: number;
8
- }
@@ -1 +0,0 @@
1
- export { };
@@ -1,3 +0,0 @@
1
- export { CorsModule } from './cors.module';
2
- export { CORS_OPTIONS } from './cors.tokens';
3
- export type { CorsOptions } from './cors.types';
@@ -1,2 +0,0 @@
1
- export { CorsModule } from "./cors.module.js";
2
- export { CORS_OPTIONS } from "./cors.tokens.js";
@@ -1,12 +0,0 @@
1
- export interface SignedUrlOptions {
2
- /** Time-to-live in seconds; a matching `expires` param is added + enforced. */
3
- expiresIn?: number;
4
- }
5
- /**
6
- * Sign a URL (or path) with HMAC-SHA256, appending `signature` (and `expires`).
7
- * The signature covers `pathname + search` (minus the signature param). Returns
8
- * the full URL for absolute inputs, or `pathname?search` for relative ones.
9
- */
10
- export declare function signUrl(url: string, secret: string, options?: SignedUrlOptions): Promise<string>;
11
- /** Verify a signed URL (timing-safe) and enforce `expires`. */
12
- export declare function verifySignedUrl(url: string, secret: string): Promise<boolean>;
@@ -1,60 +0,0 @@
1
- // Signed-URL utilities using HMAC-SHA256 via the Web Crypto API (edge-safe;
2
- // no node:crypto). Verification uses crypto.subtle.verify for timing-safety.
3
- // Pattern: https://developers.cloudflare.com/workers/examples/signing-requests/
4
- //
5
- // This is the canonical home for the util. `@velajs/vela/storage` re-exports it
6
- // (see src/storage/index.ts) so the storage subpath API is unchanged, while
7
- // core (the URL generator + signed-URL guard) imports it here directly — core
8
- // never reaches into a published subpath.
9
- async function importKey(secret) {
10
- return crypto.subtle.importKey('raw', new TextEncoder().encode(secret), {
11
- name: 'HMAC',
12
- hash: 'SHA-256'
13
- }, false, [
14
- 'sign',
15
- 'verify'
16
- ]);
17
- }
18
- function toBase64Url(buffer) {
19
- const bytes = new Uint8Array(buffer);
20
- let binary = '';
21
- for (const byte of bytes)binary += String.fromCharCode(byte);
22
- return btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
23
- }
24
- function fromBase64Url(value) {
25
- const base64 = value.replace(/-/g, '+').replace(/_/g, '/');
26
- const binary = atob(base64);
27
- const bytes = new Uint8Array(new ArrayBuffer(binary.length));
28
- for(let i = 0; i < binary.length; i++)bytes[i] = binary.charCodeAt(i);
29
- return bytes;
30
- }
31
- /**
32
- * Sign a URL (or path) with HMAC-SHA256, appending `signature` (and `expires`).
33
- * The signature covers `pathname + search` (minus the signature param). Returns
34
- * the full URL for absolute inputs, or `pathname?search` for relative ones.
35
- */ export async function signUrl(url, secret, options) {
36
- const parsed = new URL(url, 'https://placeholder.local');
37
- const key = await importKey(secret);
38
- if (options?.expiresIn) {
39
- const expires = Math.floor(Date.now() / 1000) + options.expiresIn;
40
- parsed.searchParams.set('expires', String(expires));
41
- }
42
- const dataToSign = `${parsed.pathname}?${parsed.searchParams.toString()}`;
43
- const signatureBuffer = await crypto.subtle.sign('HMAC', key, new TextEncoder().encode(dataToSign));
44
- parsed.searchParams.set('signature', toBase64Url(signatureBuffer));
45
- return url.startsWith('http') ? parsed.toString() : `${parsed.pathname}?${parsed.searchParams.toString()}`;
46
- }
47
- /** Verify a signed URL (timing-safe) and enforce `expires`. */ export async function verifySignedUrl(url, secret) {
48
- const parsed = new URL(url, 'https://placeholder.local');
49
- const signature = parsed.searchParams.get('signature');
50
- if (!signature) return false;
51
- const expires = parsed.searchParams.get('expires');
52
- if (expires) {
53
- const expiryTime = parseInt(expires, 10);
54
- if (Number.isNaN(expiryTime) || Math.floor(Date.now() / 1000) > expiryTime) return false;
55
- }
56
- parsed.searchParams.delete('signature');
57
- const dataToVerify = `${parsed.pathname}?${parsed.searchParams.toString()}`;
58
- const key = await importKey(secret);
59
- return crypto.subtle.verify('HMAC', key, fromBase64Url(signature), new TextEncoder().encode(dataToVerify));
60
- }
@@ -1,38 +0,0 @@
1
- /**
2
- * A decorator whose annotated classes/methods are findable through
3
- * `DiscoveryService` by the decorator itself (no string key at the call site).
4
- */
5
- export interface DiscoverableDecorator<T> {
6
- (value: T): ClassDecorator & MethodDecorator;
7
- /** The metadata key backing this decorator — stable across HMR re-evals. */
8
- KEY: string;
9
- }
10
- export interface CreateDiscoverableDecoratorOptions {
11
- /**
12
- * Append to a class-level list instead of overwriting a single slot —
13
- * for stackable method decorators (`@Cron`-style: each application pushes
14
- * `{ methodName, ...value }` onto the class's list, which
15
- * `DiscoveryService.methodsWithMeta` flattens back to per-method entries).
16
- */
17
- append?: boolean;
18
- }
19
- /**
20
- * Mint a discoverable decorator for a module's extension surface:
21
- *
22
- * ```ts
23
- * export interface QueueConsumerMeta { queue: string }
24
- * export const QueueConsumer = createDiscoverableDecorator<QueueConsumerMeta>('vela:queue:consumer');
25
- *
26
- * @QueueConsumer({ queue: 'emails' })
27
- * @Injectable()
28
- * class EmailConsumer { ... }
29
- *
30
- * // At bootstrap, anywhere:
31
- * discovery.providersWithMeta(QueueConsumer) // typed { meta: QueueConsumerMeta }
32
- * ```
33
- *
34
- * Unlike `Reflector.createDecorator`, the key is required and caller-chosen:
35
- * a random key would mint a fresh identity on every HMR re-eval and orphan
36
- * previously-decorated classes. Namespace it (`'<pkg>:<area>:<thing>'`).
37
- */
38
- export declare function createDiscoverableDecorator<T>(key: string, options?: CreateDiscoverableDecoratorOptions): DiscoverableDecorator<T>;