@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,159 +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 { Injectable } from "../container/decorators.js";
11
- export const LogLevel = {
12
- VERBOSE: 0,
13
- DEBUG: 1,
14
- LOG: 2,
15
- WARN: 3,
16
- ERROR: 4,
17
- SILENT: 5
18
- };
19
- const defaultWriter = (level, line, ...rest)=>{
20
- if (level === 'ERROR') return console.error(line, ...rest);
21
- if (level === 'WARN') return console.warn(line, ...rest);
22
- if (level === 'DEBUG' || level === 'VERBOSE') return console.debug(line, ...rest);
23
- return console.log(line, ...rest);
24
- };
25
- function formatValue(v) {
26
- if (typeof v === 'string') {
27
- return /[\s="\\]/.test(v) ? JSON.stringify(v) : v;
28
- }
29
- if (typeof v === 'number' || typeof v === 'boolean') return String(v);
30
- try {
31
- return JSON.stringify(v);
32
- } catch {
33
- return String(v);
34
- }
35
- }
36
- export class Logger {
37
- static level = LogLevel.LOG;
38
- static globalLogger;
39
- static globalContextProviders = [];
40
- static globalWriter = defaultWriter;
41
- context;
42
- instanceContextProviders = [];
43
- instanceWriter;
44
- static setLogLevel(level) {
45
- Logger.level = level;
46
- }
47
- static overrideLogger(logger) {
48
- Logger.globalLogger = logger;
49
- }
50
- /** Register a context provider run on every log line from every logger. */ static addContextProvider(provider) {
51
- Logger.globalContextProviders.push(provider);
52
- }
53
- /** Remove all registered global context providers. */ static clearContextProviders() {
54
- Logger.globalContextProviders = [];
55
- }
56
- /** Replace the default console writer. Useful on edge runtimes that have
57
- * a different output sink (e.g. `env.LOGS.writeDataPoint` on Workers). */ static setWriter(writer) {
58
- Logger.globalWriter = writer;
59
- }
60
- /** Restore the default console-based writer. */ static resetWriter() {
61
- Logger.globalWriter = defaultWriter;
62
- }
63
- constructor(context){
64
- if (context) {
65
- this.context = context;
66
- }
67
- }
68
- setContext(context) {
69
- this.context = context;
70
- }
71
- /** Add a context provider that runs only for THIS logger instance.
72
- * Children created via extend() inherit these providers by copy. */ addContextProvider(provider) {
73
- this.instanceContextProviders.push(provider);
74
- return this;
75
- }
76
- /** Override the writer for this logger (and any extend() children). */ setWriter(writer) {
77
- this.instanceWriter = writer;
78
- return this;
79
- }
80
- /** Create a child logger with a nested namespace. Context becomes
81
- * `parent:child`; instance-level providers and writers are inherited
82
- * by copy so later mutations on either logger stay isolated. */ extend(namespace) {
83
- const newContext = this.context ? `${this.context}:${namespace}` : namespace;
84
- const child = new Logger(newContext);
85
- child.instanceContextProviders = [
86
- ...this.instanceContextProviders
87
- ];
88
- if (this.instanceWriter) child.instanceWriter = this.instanceWriter;
89
- return child;
90
- }
91
- log(message, ...optionalParams) {
92
- this.emit('LOG', LogLevel.LOG, message, optionalParams);
93
- }
94
- error(message, ...optionalParams) {
95
- this.emit('ERROR', LogLevel.ERROR, message, optionalParams);
96
- }
97
- warn(message, ...optionalParams) {
98
- this.emit('WARN', LogLevel.WARN, message, optionalParams);
99
- }
100
- debug(message, ...optionalParams) {
101
- this.emit('DEBUG', LogLevel.DEBUG, message, optionalParams);
102
- }
103
- verbose(message, ...optionalParams) {
104
- this.emit('VERBOSE', LogLevel.VERBOSE, message, optionalParams);
105
- }
106
- emit(levelName, levelValue, message, rest) {
107
- if (Logger.level > levelValue) return;
108
- if (Logger.globalLogger === false) return;
109
- if (Logger.globalLogger) {
110
- const method = levelName.toLowerCase();
111
- const fn = Logger.globalLogger[method];
112
- if (fn) fn.call(Logger.globalLogger, message, ...rest);
113
- return;
114
- }
115
- const line = this.formatMessage(levelName, message);
116
- const writer = this.instanceWriter ?? Logger.globalWriter;
117
- writer(levelName, line, ...rest);
118
- }
119
- formatMessage(level, message) {
120
- const timestamp = new Date().toISOString();
121
- const ctx = this.context ? ` [${this.context}]` : '';
122
- const contextStr = this.formatContextObj(this.collectContext());
123
- return `[Vela] ${timestamp} ${level}${ctx} ${message}${contextStr}`;
124
- }
125
- collectContext() {
126
- const result = {};
127
- for (const provider of Logger.globalContextProviders){
128
- try {
129
- Object.assign(result, provider());
130
- } catch {
131
- // Provider threw; drop its contribution and keep going.
132
- }
133
- }
134
- for (const provider of this.instanceContextProviders){
135
- try {
136
- Object.assign(result, provider());
137
- } catch {
138
- // Same — never let a provider break logging.
139
- }
140
- }
141
- return result;
142
- }
143
- formatContextObj(obj) {
144
- const parts = [];
145
- for (const key of Object.keys(obj)){
146
- const value = obj[key];
147
- if (value === undefined || value === null) continue;
148
- parts.push(`${key}=${formatValue(value)}`);
149
- }
150
- return parts.length > 0 ? ` ${parts.join(' ')}` : '';
151
- }
152
- }
153
- Logger = _ts_decorate([
154
- Injectable(),
155
- _ts_metadata("design:type", Function),
156
- _ts_metadata("design:paramtypes", [
157
- String
158
- ])
159
- ], Logger);
@@ -1,9 +0,0 @@
1
- export declare function expandPathTemplate(template: string, now?: Date): string;
2
- /**
3
- * Join a (templated) root with a relative path into a storage key. Segments are
4
- * sanitized: `.`, `..`, and empty segments are dropped, so a caller-supplied
5
- * `relativePath` containing `..` can never traverse above the disk root (a real
6
- * hazard for the presign proxy, where the key flows through `new URL()` which
7
- * would otherwise normalize `..`). Backslashes are treated as separators too.
8
- */
9
- export declare function joinStoragePath(root: string | undefined, relativePath: string, now?: Date): string;
@@ -1,20 +0,0 @@
1
- // Expand path-template variables in a disk root / key. Supported tokens:
2
- // {date} → YYYY-MM-DD {year} → YYYY {month} → MM {day} → DD
3
- // {uuid} → crypto.randomUUID()
4
- // `now` is injectable for deterministic tests.
5
- export function expandPathTemplate(template, now = new Date()) {
6
- const yyyy = now.getUTCFullYear().toString();
7
- const mm = (now.getUTCMonth() + 1).toString().padStart(2, '0');
8
- const dd = now.getUTCDate().toString().padStart(2, '0');
9
- return template.replace(/\{date\}/g, `${yyyy}-${mm}-${dd}`).replace(/\{year\}/g, yyyy).replace(/\{month\}/g, mm).replace(/\{day\}/g, dd).replace(/\{uuid\}/g, ()=>crypto.randomUUID());
10
- }
11
- /**
12
- * Join a (templated) root with a relative path into a storage key. Segments are
13
- * sanitized: `.`, `..`, and empty segments are dropped, so a caller-supplied
14
- * `relativePath` containing `..` can never traverse above the disk root (a real
15
- * hazard for the presign proxy, where the key flows through `new URL()` which
16
- * would otherwise normalize `..`). Backslashes are treated as separators too.
17
- */ export function joinStoragePath(root, relativePath, now) {
18
- const expandedRoot = root ? expandPathTemplate(root, now) : '';
19
- return `${expandedRoot}/${relativePath}`.split(/[/\\]+/).filter((segment)=>segment !== '' && segment !== '.' && segment !== '..').join('/');
20
- }
@@ -1,41 +0,0 @@
1
- /** Body payloads accepted by uploads. */
2
- export type StorageBody = ReadableStream | ArrayBuffer | ArrayBufferView | string | Blob | null;
3
- export type PresignMethod = 'GET' | 'PUT' | 'DELETE' | 'HEAD';
4
- export interface UploadOptions {
5
- size?: number;
6
- mimeType?: string;
7
- metadata?: Record<string, string>;
8
- }
9
- export interface UploadResult {
10
- path: string;
11
- disk: string;
12
- size?: number;
13
- mimeType: string;
14
- uploadedAt: Date;
15
- }
16
- export interface DownloadResult {
17
- toStream(): ReadableStream;
18
- toArrayBuffer(): Promise<ArrayBuffer>;
19
- toText(): Promise<string>;
20
- contentType: string;
21
- size: number;
22
- metadata?: Record<string, string>;
23
- }
24
- export interface PresignedUrlResult {
25
- url: string;
26
- method: PresignMethod;
27
- expiresIn: number;
28
- expiresAt: Date;
29
- }
30
- /**
31
- * Runtime-agnostic storage driver contract. Implement per backend (R2 in
32
- * `@velajs/cloudflare`, and e.g. S3/GCS elsewhere) so the manager/service and
33
- * multi-disk logic stay driver-independent.
34
- */
35
- export interface StorageDriver {
36
- upload(body: StorageBody, path: string, options: UploadOptions): Promise<UploadResult>;
37
- download(path: string): Promise<DownloadResult>;
38
- delete(path: string): Promise<void>;
39
- exists(path: string): Promise<boolean>;
40
- getPresignedUrl(path: string, method: PresignMethod, expiresIn: number): Promise<PresignedUrlResult>;
41
- }
@@ -1,5 +0,0 @@
1
- /** Body payloads accepted by uploads. */ /**
2
- * Runtime-agnostic storage driver contract. Implement per backend (R2 in
3
- * `@velajs/cloudflare`, and e.g. S3/GCS elsewhere) so the manager/service and
4
- * multi-disk logic stay driver-independent.
5
- */ export { };
@@ -1,6 +0,0 @@
1
- export { ThrottlerModule } from './throttler.module';
2
- export { ThrottlerGuard } from './throttler.guard';
3
- export { ThrottlerStorage } from './throttler.storage';
4
- export { Throttle, SkipThrottle } from './throttler.decorators';
5
- export { THROTTLER_OPTIONS, THROTTLER_STORAGE, THROTTLE_METADATA, SKIP_THROTTLE_METADATA } from './throttler.tokens';
6
- export type { ThrottlerModuleOptions, ThrottleConfig, ThrottlerStore, ThrottlerStorageRecord, RateLimitInfo } from './throttler.types';
@@ -1,5 +0,0 @@
1
- export { ThrottlerModule } from "./throttler.module.js";
2
- export { ThrottlerGuard } from "./throttler.guard.js";
3
- export { ThrottlerStorage } from "./throttler.storage.js";
4
- export { Throttle, SkipThrottle } from "./throttler.decorators.js";
5
- export { THROTTLER_OPTIONS, THROTTLER_STORAGE, THROTTLE_METADATA, SKIP_THROTTLE_METADATA } from "./throttler.tokens.js";
@@ -1,3 +0,0 @@
1
- import type { ThrottleConfig } from './throttler.types';
2
- export declare const Throttle: (config: ThrottleConfig) => (target: object, propertyKey?: string | symbol) => void;
3
- export declare const SkipThrottle: () => (target: object, propertyKey?: string | symbol) => void;
@@ -1,4 +0,0 @@
1
- import { SetMetadata } from "../pipeline/reflector.js";
2
- import { THROTTLE_METADATA, SKIP_THROTTLE_METADATA } from "./throttler.tokens.js";
3
- export const Throttle = (config)=>SetMetadata(THROTTLE_METADATA, config);
4
- export const SkipThrottle = ()=>SetMetadata(SKIP_THROTTLE_METADATA, true);
@@ -1,9 +0,0 @@
1
- import type { CanActivate, ExecutionContext } from '../pipeline/types';
2
- import type { ThrottlerModuleOptions, ThrottlerStore } from './throttler.types';
3
- export declare class ThrottlerGuard implements CanActivate {
4
- private options;
5
- private storage;
6
- private reflector;
7
- constructor(options: ThrottlerModuleOptions, storage: ThrottlerStore);
8
- canActivate(context: ExecutionContext): Promise<boolean>;
9
- }
@@ -1,72 +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
- function _ts_param(paramIndex, decorator) {
11
- return function(target, key) {
12
- decorator(target, key, paramIndex);
13
- };
14
- }
15
- import { Injectable, Inject } from "../container/decorators.js";
16
- import { Reflector } from "../pipeline/reflector.js";
17
- import { TooManyRequestsException } from "../errors/http-exception.js";
18
- import { THROTTLER_OPTIONS, THROTTLER_STORAGE, THROTTLE_METADATA, SKIP_THROTTLE_METADATA } from "./throttler.tokens.js";
19
- export class ThrottlerGuard {
20
- options;
21
- storage;
22
- reflector = new Reflector();
23
- constructor(options, storage){
24
- this.options = options;
25
- this.storage = storage;
26
- }
27
- async canActivate(context) {
28
- const skip = this.reflector.getAllAndOverride(SKIP_THROTTLE_METADATA, context);
29
- if (skip) {
30
- return true;
31
- }
32
- const override = this.reflector.getAllAndOverride(THROTTLE_METADATA, context);
33
- const limit = override?.limit ?? this.options.limit;
34
- const ttl = override?.ttl ?? this.options.ttl;
35
- const request = context.getRequest();
36
- const tracker = this.options.getTracker ? this.options.getTracker(request) : request.headers.get('x-forwarded-for') ?? 'anonymous';
37
- const className = context.getClass().name;
38
- const handlerName = String(context.getHandler());
39
- const key = this.options.generateKey ? this.options.generateKey(tracker, {
40
- className,
41
- handlerName
42
- }) : `throttler:${className}:${handlerName}:${tracker}`;
43
- const { count, ttlMs } = await this.storage.increment(key, ttl);
44
- const remaining = Math.max(0, limit - count);
45
- const resetSeconds = Math.ceil(ttlMs / 1000);
46
- const honoContext = context.getContext();
47
- honoContext.header('X-RateLimit-Limit', String(limit));
48
- honoContext.header('X-RateLimit-Remaining', String(remaining));
49
- honoContext.header('X-RateLimit-Reset', String(resetSeconds));
50
- const rateLimitInfo = {
51
- limit,
52
- remaining,
53
- reset: resetSeconds
54
- };
55
- honoContext.set('rateLimit', rateLimitInfo);
56
- if (count > limit) {
57
- honoContext.header('Retry-After', String(resetSeconds));
58
- throw new TooManyRequestsException();
59
- }
60
- return true;
61
- }
62
- }
63
- ThrottlerGuard = _ts_decorate([
64
- Injectable(),
65
- _ts_param(0, Inject(THROTTLER_OPTIONS)),
66
- _ts_param(1, Inject(THROTTLER_STORAGE)),
67
- _ts_metadata("design:type", Function),
68
- _ts_metadata("design:paramtypes", [
69
- typeof ThrottlerModuleOptions === "undefined" ? Object : ThrottlerModuleOptions,
70
- typeof ThrottlerStore === "undefined" ? Object : ThrottlerStore
71
- ])
72
- ], ThrottlerGuard);
@@ -1,7 +0,0 @@
1
- import type { ThrottlerModuleOptions } from './throttler.types';
2
- declare const ConfigurableModuleClass: import("..").ConfigurableModuleClassType<ThrottlerModuleOptions, "forRoot", "create", {
3
- isGlobal?: boolean;
4
- }>;
5
- export declare class ThrottlerModule extends ConfigurableModuleClass {
6
- }
7
- export {};
@@ -1,41 +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 { ConfigurableModuleBuilder } from "../module/configurable-module.builder.js";
9
- import { APP_GUARD } from "../pipeline/tokens.js";
10
- import { ThrottlerGuard } from "./throttler.guard.js";
11
- import { ThrottlerStorage } from "./throttler.storage.js";
12
- import { THROTTLER_OPTIONS, THROTTLER_STORAGE } from "./throttler.tokens.js";
13
- const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } = new ConfigurableModuleBuilder({
14
- moduleName: 'Throttler',
15
- optionsInjectionToken: THROTTLER_OPTIONS
16
- }).build();
17
- export class ThrottlerModule extends ConfigurableModuleClass {
18
- }
19
- ThrottlerModule = _ts_decorate([
20
- Module({
21
- providers: [
22
- {
23
- provide: THROTTLER_STORAGE,
24
- useFactory: (options)=>options.storage ?? new ThrottlerStorage(),
25
- inject: [
26
- MODULE_OPTIONS_TOKEN
27
- ]
28
- },
29
- ThrottlerGuard,
30
- {
31
- provide: APP_GUARD,
32
- useExisting: ThrottlerGuard
33
- }
34
- ],
35
- exports: [
36
- THROTTLER_OPTIONS,
37
- THROTTLER_STORAGE,
38
- ThrottlerGuard
39
- ]
40
- })
41
- ], ThrottlerModule);
@@ -1,10 +0,0 @@
1
- import type { ThrottlerStore, ThrottlerStorageRecord } from './throttler.types';
2
- export declare class ThrottlerStorage implements ThrottlerStore {
3
- private current;
4
- private previous;
5
- private lastSwap;
6
- private readonly swapIntervalMs;
7
- increment(key: string, ttlMs: number): ThrottlerStorageRecord;
8
- reset(key: string): void;
9
- private maybeSwap;
10
- }
@@ -1,44 +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 { Injectable } from "../container/decorators.js";
8
- export class ThrottlerStorage {
9
- current = new Map();
10
- previous = new Map();
11
- lastSwap = Date.now();
12
- swapIntervalMs = 60_000;
13
- increment(key, ttlMs) {
14
- this.maybeSwap();
15
- const now = Date.now();
16
- let entry = this.current.get(key) ?? this.previous.get(key);
17
- if (!entry || now >= entry.resetTime) {
18
- entry = {
19
- count: 0,
20
- resetTime: now + ttlMs
21
- };
22
- }
23
- entry.count++;
24
- this.current.set(key, entry);
25
- return {
26
- count: entry.count,
27
- ttlMs: entry.resetTime - now
28
- };
29
- }
30
- reset(key) {
31
- this.current.delete(key);
32
- this.previous.delete(key);
33
- }
34
- maybeSwap() {
35
- const now = Date.now();
36
- if (now - this.lastSwap < this.swapIntervalMs) return;
37
- this.previous = this.current;
38
- this.current = new Map();
39
- this.lastSwap = now;
40
- }
41
- }
42
- ThrottlerStorage = _ts_decorate([
43
- Injectable()
44
- ], ThrottlerStorage);
@@ -1,6 +0,0 @@
1
- import { InjectionToken } from '../container/types';
2
- import type { ThrottlerModuleOptions, ThrottlerStore } from './throttler.types';
3
- export declare const THROTTLER_OPTIONS: InjectionToken<ThrottlerModuleOptions>;
4
- export declare const THROTTLER_STORAGE: InjectionToken<ThrottlerStore>;
5
- export declare const THROTTLE_METADATA = "vela:throttle";
6
- export declare const SKIP_THROTTLE_METADATA = "vela:skip-throttle";
@@ -1,5 +0,0 @@
1
- import { InjectionToken } from "../container/types.js";
2
- export const THROTTLER_OPTIONS = new InjectionToken('THROTTLER_OPTIONS');
3
- export const THROTTLER_STORAGE = new InjectionToken('THROTTLER_STORAGE');
4
- export const THROTTLE_METADATA = 'vela:throttle';
5
- export const SKIP_THROTTLE_METADATA = 'vela:skip-throttle';
@@ -1,25 +0,0 @@
1
- export interface ThrottleConfig {
2
- limit: number;
3
- ttl: number;
4
- }
5
- export interface ThrottlerStorageRecord {
6
- count: number;
7
- ttlMs: number;
8
- }
9
- export interface ThrottlerStore {
10
- increment(key: string, ttlMs: number): ThrottlerStorageRecord | Promise<ThrottlerStorageRecord>;
11
- reset(key: string): void | Promise<void>;
12
- }
13
- export interface RateLimitInfo {
14
- limit: number;
15
- remaining: number;
16
- reset: number;
17
- }
18
- export interface ThrottlerModuleOptions extends ThrottleConfig {
19
- storage?: ThrottlerStore;
20
- getTracker?: (request: Request) => string;
21
- generateKey?: (tracker: string, context: {
22
- className: string;
23
- handlerName: string;
24
- }) => string;
25
- }
@@ -1 +0,0 @@
1
- export { };
@@ -1,13 +0,0 @@
1
- interface ZodLikeSchema {
2
- parse(data: unknown): unknown;
3
- }
4
- type InferOutput<T extends ZodLikeSchema> = ReturnType<T['parse']>;
5
- export interface CreateZodDtoOptions {
6
- /** Override the generated class name (useful for debugging and OpenAPI). */
7
- name?: string;
8
- }
9
- export declare function createZodDto<T extends ZodLikeSchema>(schema: T, options?: CreateZodDtoOptions): {
10
- new (initial?: InferOutput<T>): InferOutput<T>;
11
- schema: T;
12
- };
13
- export {};
@@ -1,18 +0,0 @@
1
- export function createZodDto(schema, options = {}) {
2
- // Computed-property-name idiom: NamedEvaluation reads the property key and
3
- // stamps `name` on the class at creation, so callers see `MyDto` (or the
4
- // override) directly in stack traces and OpenAPI output — no post-hoc
5
- // `Object.defineProperty` patching of the class's `name` slot.
6
- const className = options.name ?? 'ZodDto';
7
- const ZodDto = {
8
- [className]: class {
9
- static schema = schema;
10
- constructor(initial){
11
- if (initial && typeof initial === 'object') {
12
- Object.assign(this, initial);
13
- }
14
- }
15
- }
16
- }[className];
17
- return ZodDto;
18
- }
@@ -1,3 +0,0 @@
1
- export { createZodDto } from './create-zod-dto';
2
- export type { CreateZodDtoOptions } from './create-zod-dto';
3
- export { ValidationPipe } from './validation.pipe';
@@ -1,2 +0,0 @@
1
- export { createZodDto } from "./create-zod-dto.js";
2
- export { ValidationPipe } from "./validation.pipe.js";
@@ -1,4 +0,0 @@
1
- import type { ArgumentMetadata, PipeTransform } from '../pipeline/types';
2
- export declare class ValidationPipe implements PipeTransform {
3
- transform(value: unknown, metadata: ArgumentMetadata): unknown;
4
- }
@@ -1,19 +0,0 @@
1
- import { BadRequestException } from "../errors/http-exception.js";
2
- export class ValidationPipe {
3
- transform(value, metadata) {
4
- const metatype = metadata.metatype;
5
- if (!metatype?.schema?.parse) return value;
6
- try {
7
- return metatype.schema.parse(value);
8
- } catch (error) {
9
- if (error && typeof error === 'object' && 'issues' in error && Array.isArray(error.issues)) {
10
- throw new BadRequestException({
11
- statusCode: 400,
12
- message: 'Validation failed',
13
- errors: error.issues
14
- });
15
- }
16
- throw error;
17
- }
18
- }
19
- }
@@ -1,47 +0,0 @@
1
- import type { WebSocketGatewayOptions } from './websocket.types';
2
- /**
3
- * Marks a class as a WebSocket gateway. Mirrors `@Controller` for the socket
4
- * transport: registers the class as an injectable singleton and stores its
5
- * routing options (`path`, Cloudflare `binding`).
6
- *
7
- * @example
8
- * ```ts
9
- * @WebSocketGateway({ path: '/rooms/:id/ws', binding: 'CHAT_ROOM' })
10
- * class ChatGateway {}
11
- * ```
12
- */
13
- export declare function WebSocketGateway(options?: WebSocketGatewayOptions): ClassDecorator;
14
- /**
15
- * Binds a gateway method to an inbound event. Stackable — one class-level list,
16
- * exactly like `@OnEvent` (`event-emitter.decorators.ts`).
17
- */
18
- export declare function SubscribeMessage(event: string): MethodDecorator;
19
- /**
20
- * Claims a reserved (`$`-prefixed) envelope event for a framework-module
21
- * provider (see `ReservedWsEventHandler`). Reserved frames route to the
22
- * decorated provider across every gateway path — gateways themselves may not
23
- * subscribe to `$…` events. Stack with `@Injectable()` like `@Processor`.
24
- *
25
- * @example
26
- * ```ts
27
- * @ReservedWsEvent('$live')
28
- * @Injectable()
29
- * class LiveEngine implements ReservedWsEventHandler { … }
30
- * ```
31
- */
32
- export declare function ReservedWsEvent(event: string): ClassDecorator;
33
- /** Injects the inbound message payload (the envelope's `data`) into a handler parameter. */
34
- export declare const MessageBody: () => ParameterDecorator;
35
- /** Injects the connected socket (`WsClient`) into a handler parameter. */
36
- export declare const ConnectedSocket: () => ParameterDecorator;
37
- /**
38
- * Injects the gateway server handle (`WsServer`). Constructor injection only —
39
- * the container has no property-injection pass, so this is sugar for
40
- * `@Inject(WS_SERVER)` on a constructor parameter.
41
- *
42
- * @example
43
- * ```ts
44
- * constructor(@WebSocketServer() private server: WsServer) {}
45
- * ```
46
- */
47
- export declare function WebSocketServer(): ParameterDecorator;