@geekmidas/constructs 10.0.0-alpha.4 → 10.0.0-alpha.41

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 (370) hide show
  1. package/README.md +223 -158
  2. package/dist/{Construct-BD5neF7w.mjs → Construct-BO1X-kt9.mjs} +32 -33
  3. package/dist/Construct-BO1X-kt9.mjs.map +1 -0
  4. package/dist/Construct-BQALFCh2.d.cts +230 -0
  5. package/dist/Construct-BQALFCh2.d.cts.map +1 -0
  6. package/dist/{Construct-CyS3RpTL.cjs → Construct-DmvXceVY.cjs} +52 -47
  7. package/dist/Construct-DmvXceVY.cjs.map +1 -0
  8. package/dist/Construct-QXnl3VqT.d.mts +230 -0
  9. package/dist/Construct-QXnl3VqT.d.mts.map +1 -0
  10. package/dist/{Cron-B2OFsfDM.d.cts → Cron-CMEGfRs8.d.cts} +21 -8
  11. package/dist/Cron-CMEGfRs8.d.cts.map +1 -0
  12. package/dist/{Cron-ByxdOfpE.d.mts → Cron-D6X4-xjB.d.mts} +21 -8
  13. package/dist/Cron-D6X4-xjB.d.mts.map +1 -0
  14. package/dist/CronBuilder-CEK7aOqD.d.cts +46 -0
  15. package/dist/CronBuilder-CEK7aOqD.d.cts.map +1 -0
  16. package/dist/CronBuilder-DB35T5dL.cjs +116 -0
  17. package/dist/CronBuilder-DB35T5dL.cjs.map +1 -0
  18. package/dist/CronBuilder-Dv0IlZs0.mjs +104 -0
  19. package/dist/CronBuilder-Dv0IlZs0.mjs.map +1 -0
  20. package/dist/CronBuilder-O_gvButp.d.mts +46 -0
  21. package/dist/CronBuilder-O_gvButp.d.mts.map +1 -0
  22. package/dist/{Endpoint-Dij_wOcc.mjs → Endpoint-CQAeh1Rh.mjs} +117 -109
  23. package/dist/Endpoint-CQAeh1Rh.mjs.map +1 -0
  24. package/dist/{Endpoint-DODn1RhN.cjs → Endpoint-D1L9qu5C.cjs} +145 -131
  25. package/dist/Endpoint-D1L9qu5C.cjs.map +1 -0
  26. package/dist/{Endpoint-2Wg7T7Cq.d.mts → Endpoint-Dp5AKIXl.d.cts} +69 -93
  27. package/dist/Endpoint-Dp5AKIXl.d.cts.map +1 -0
  28. package/dist/{Endpoint-DrD8a1yH.d.cts → Endpoint-DtI7heFm.d.mts} +70 -94
  29. package/dist/Endpoint-DtI7heFm.d.mts.map +1 -0
  30. package/dist/{EndpointFactory-b4ituq-s.mjs → EndpointFactory-BBdNeaGJ.mjs} +39 -74
  31. package/dist/EndpointFactory-BBdNeaGJ.mjs.map +1 -0
  32. package/dist/{EndpointFactory-BHFMmFkV.cjs → EndpointFactory-BZOCOaK6.cjs} +75 -110
  33. package/dist/EndpointFactory-BZOCOaK6.cjs.map +1 -0
  34. package/dist/{index-BxHDdy6a.d.mts → EndpointFactory-CgMDvERK.d.mts} +63 -133
  35. package/dist/EndpointFactory-CgMDvERK.d.mts.map +1 -0
  36. package/dist/{index-B8g8POkr.d.cts → EndpointFactory-FeFRmlDZ.d.cts} +62 -132
  37. package/dist/EndpointFactory-FeFRmlDZ.d.cts.map +1 -0
  38. package/dist/{HonoEndpointAdaptor-BM2jbWht.mjs → HonoEndpointAdaptor-Aui-x9Lg.mjs} +41 -47
  39. package/dist/HonoEndpointAdaptor-Aui-x9Lg.mjs.map +1 -0
  40. package/dist/{HonoEndpointAdaptor-De6IlBZe.cjs → HonoEndpointAdaptor-Cq99r9H7.cjs} +50 -53
  41. package/dist/HonoEndpointAdaptor-Cq99r9H7.cjs.map +1 -0
  42. package/dist/Queue-C1uDgjxt.mjs +100 -0
  43. package/dist/Queue-C1uDgjxt.mjs.map +1 -0
  44. package/dist/Queue-Ckmudcm8.cjs +105 -0
  45. package/dist/Queue-Ckmudcm8.cjs.map +1 -0
  46. package/dist/{Queue-D7ZuwBhy.d.cts → Queue-CpQIGB_2.d.cts} +28 -40
  47. package/dist/Queue-CpQIGB_2.d.cts.map +1 -0
  48. package/dist/{Queue-gVGfi2Yk.d.mts → Queue-YmvN2vEP.d.mts} +28 -40
  49. package/dist/Queue-YmvN2vEP.d.mts.map +1 -0
  50. package/dist/QueueBuilder-CJNcv4dy.cjs +112 -0
  51. package/dist/QueueBuilder-CJNcv4dy.cjs.map +1 -0
  52. package/dist/QueueBuilder-CM0WUxfw.d.mts +62 -0
  53. package/dist/QueueBuilder-CM0WUxfw.d.mts.map +1 -0
  54. package/dist/QueueBuilder-XEnnOWGe.d.cts +62 -0
  55. package/dist/QueueBuilder-XEnnOWGe.d.cts.map +1 -0
  56. package/dist/QueueBuilder-XuPKZwKH.mjs +95 -0
  57. package/dist/QueueBuilder-XuPKZwKH.mjs.map +1 -0
  58. package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-B91YSkZt.d.cts} +14 -16
  59. package/dist/Subscriber-B91YSkZt.d.cts.map +1 -0
  60. package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-BjHYe5hK.d.mts} +14 -16
  61. package/dist/Subscriber-BjHYe5hK.d.mts.map +1 -0
  62. package/dist/SubscriberBuilder-BSpQX1JT.d.cts +55 -0
  63. package/dist/SubscriberBuilder-BSpQX1JT.d.cts.map +1 -0
  64. package/dist/SubscriberBuilder-BhMphk4z.d.mts +55 -0
  65. package/dist/SubscriberBuilder-BhMphk4z.d.mts.map +1 -0
  66. package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-Duk028pD.cjs} +34 -37
  67. package/dist/SubscriberBuilder-Duk028pD.cjs.map +1 -0
  68. package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-DzQUWE08.mjs} +23 -25
  69. package/dist/SubscriberBuilder-DzQUWE08.mjs.map +1 -0
  70. package/dist/Topic-CkxOTrMv.cjs +104 -0
  71. package/dist/Topic-CkxOTrMv.cjs.map +1 -0
  72. package/dist/Topic-hPffOsot.mjs +99 -0
  73. package/dist/Topic-hPffOsot.mjs.map +1 -0
  74. package/dist/adaptors/aws.cjs +171 -108
  75. package/dist/adaptors/aws.cjs.map +1 -1
  76. package/dist/adaptors/aws.d.cts +75 -43
  77. package/dist/adaptors/aws.d.cts.map +1 -1
  78. package/dist/adaptors/aws.d.mts +76 -44
  79. package/dist/adaptors/aws.d.mts.map +1 -1
  80. package/dist/adaptors/aws.mjs +143 -83
  81. package/dist/adaptors/aws.mjs.map +1 -1
  82. package/dist/adaptors/hono.cjs +3 -10
  83. package/dist/adaptors/hono.d.cts +7 -16
  84. package/dist/adaptors/hono.d.cts.map +1 -1
  85. package/dist/adaptors/hono.d.mts +8 -17
  86. package/dist/adaptors/hono.d.mts.map +1 -1
  87. package/dist/adaptors/hono.mjs +2 -10
  88. package/dist/adaptors/testing.cjs +515 -87
  89. package/dist/adaptors/testing.cjs.map +1 -1
  90. package/dist/adaptors/testing.d.cts +250 -48
  91. package/dist/adaptors/testing.d.cts.map +1 -1
  92. package/dist/adaptors/testing.d.mts +250 -48
  93. package/dist/adaptors/testing.d.mts.map +1 -1
  94. package/dist/adaptors/testing.mjs +484 -68
  95. package/dist/adaptors/testing.mjs.map +1 -1
  96. package/dist/auth-CMwml9QN.d.mts +188 -0
  97. package/dist/auth-CMwml9QN.d.mts.map +1 -0
  98. package/dist/auth-rVRDjIw_.d.cts +188 -0
  99. package/dist/auth-rVRDjIw_.d.cts.map +1 -0
  100. package/dist/auth.cjs +171 -31
  101. package/dist/auth.cjs.map +1 -1
  102. package/dist/auth.d.cts +2 -108
  103. package/dist/auth.d.mts +2 -108
  104. package/dist/auth.mjs +160 -24
  105. package/dist/auth.mjs.map +1 -1
  106. package/dist/{cache-BrRz3fEB.d.mts → cache-C9a_hVCc.d.cts} +4 -7
  107. package/dist/cache-C9a_hVCc.d.cts.map +1 -0
  108. package/dist/{cache-BtZY_tHe.d.cts → cache-CeTMI8LR.d.mts} +4 -7
  109. package/dist/cache-CeTMI8LR.d.mts.map +1 -0
  110. package/dist/cache.cjs +68 -2
  111. package/dist/cache.cjs.map +1 -0
  112. package/dist/cache.d.cts +1 -2
  113. package/dist/cache.d.mts +1 -2
  114. package/dist/cache.mjs +67 -2
  115. package/dist/cache.mjs.map +1 -0
  116. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  117. package/dist/clone-EKNovYHu.mjs.map +1 -0
  118. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  119. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  120. package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-_3zgxzXl.d.mts} +20 -11
  121. package/dist/construct-interface-_3zgxzXl.d.mts.map +1 -0
  122. package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-_xi4BPN8.d.cts} +20 -11
  123. package/dist/construct-interface-_xi4BPN8.d.cts.map +1 -0
  124. package/dist/construct-interface.cjs +87 -7
  125. package/dist/construct-interface.cjs.map +1 -0
  126. package/dist/construct-interface.d.cts +2 -2
  127. package/dist/construct-interface.d.mts +2 -2
  128. package/dist/construct-interface.mjs +81 -2
  129. package/dist/construct-interface.mjs.map +1 -0
  130. package/dist/credential.cjs +63 -16
  131. package/dist/credential.cjs.map +1 -1
  132. package/dist/credential.d.cts +16 -9
  133. package/dist/credential.d.cts.map +1 -1
  134. package/dist/credential.d.mts +16 -9
  135. package/dist/credential.d.mts.map +1 -1
  136. package/dist/credential.mjs +58 -12
  137. package/dist/credential.mjs.map +1 -1
  138. package/dist/crons/index.cjs +68 -10
  139. package/dist/crons/index.cjs.map +1 -1
  140. package/dist/crons/index.d.cts +32 -14
  141. package/dist/crons/index.d.cts.map +1 -1
  142. package/dist/crons/index.d.mts +32 -14
  143. package/dist/crons/index.d.mts.map +1 -1
  144. package/dist/crons/index.mjs +66 -10
  145. package/dist/crons/index.mjs.map +1 -1
  146. package/dist/database/kysely.cjs +40 -15
  147. package/dist/database/kysely.cjs.map +1 -1
  148. package/dist/database/kysely.d.cts +2 -152
  149. package/dist/database/kysely.d.mts +2 -152
  150. package/dist/database/kysely.mjs +28 -5
  151. package/dist/database/kysely.mjs.map +1 -1
  152. package/dist/email.cjs +25 -12
  153. package/dist/email.cjs.map +1 -1
  154. package/dist/email.d.cts +3 -7
  155. package/dist/email.d.cts.map +1 -1
  156. package/dist/email.d.mts +3 -7
  157. package/dist/email.d.mts.map +1 -1
  158. package/dist/email.mjs +16 -3
  159. package/dist/email.mjs.map +1 -1
  160. package/dist/endpoints/index.cjs +8 -10
  161. package/dist/endpoints/index.d.cts +51 -7
  162. package/dist/endpoints/index.d.cts.map +1 -0
  163. package/dist/endpoints/index.d.mts +51 -7
  164. package/dist/endpoints/index.d.mts.map +1 -0
  165. package/dist/endpoints/index.mjs +6 -10
  166. package/dist/external-api-DS3mujT5.d.mts +86 -0
  167. package/dist/external-api-DS3mujT5.d.mts.map +1 -0
  168. package/dist/external-api-LBfE-q3g.d.cts +86 -0
  169. package/dist/external-api-LBfE-q3g.d.cts.map +1 -0
  170. package/dist/external-api.cjs +124 -0
  171. package/dist/external-api.cjs.map +1 -0
  172. package/dist/external-api.d.cts +2 -0
  173. package/dist/external-api.d.mts +2 -0
  174. package/dist/external-api.mjs +121 -0
  175. package/dist/external-api.mjs.map +1 -0
  176. package/dist/file-server.cjs +42 -10
  177. package/dist/file-server.cjs.map +1 -1
  178. package/dist/file-server.d.cts +6 -10
  179. package/dist/file-server.d.cts.map +1 -1
  180. package/dist/file-server.d.mts +6 -10
  181. package/dist/file-server.d.mts.map +1 -1
  182. package/dist/file-server.mjs +34 -2
  183. package/dist/file-server.mjs.map +1 -1
  184. package/dist/functions/index.cjs +2 -6
  185. package/dist/functions/index.d.cts +2 -4
  186. package/dist/functions/index.d.mts +2 -4
  187. package/dist/functions/index.mjs +2 -6
  188. package/dist/{functions-Ck21Uyq0.mjs → functions-DCIfCRR-.mjs} +371 -241
  189. package/dist/functions-DCIfCRR-.mjs.map +1 -0
  190. package/dist/{functions-DJJA7VGc.cjs → functions-ZH60FE7H.cjs} +409 -273
  191. package/dist/functions-ZH60FE7H.cjs.map +1 -0
  192. package/dist/{index-AIfVzkhi.d.cts → index-B0kxstwf.d.cts} +49 -42
  193. package/dist/index-B0kxstwf.d.cts.map +1 -0
  194. package/dist/index-CeEtxDmK.d.cts +79 -0
  195. package/dist/index-CeEtxDmK.d.cts.map +1 -0
  196. package/dist/index-CeEtxDmK.d.mts +79 -0
  197. package/dist/index-CeEtxDmK.d.mts.map +1 -0
  198. package/dist/{index-CubPzHd9.d.mts → index-CjVEjOw0.d.mts} +49 -42
  199. package/dist/index-CjVEjOw0.d.mts.map +1 -0
  200. package/dist/index.cjs +3 -3
  201. package/dist/index.d.cts +4 -4
  202. package/dist/index.d.mts +4 -4
  203. package/dist/index.mjs +2 -3
  204. package/dist/kysely-BJ8IQ_1P.d.mts +159 -0
  205. package/dist/kysely-BJ8IQ_1P.d.mts.map +1 -0
  206. package/dist/kysely-DVF8wOT4.d.cts +159 -0
  207. package/dist/kysely-DVF8wOT4.d.cts.map +1 -0
  208. package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-CFanua0O.mjs} +20 -60
  209. package/dist/lazyAccessors-CFanua0O.mjs.map +1 -0
  210. package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-hJKGv8Ay.cjs} +60 -113
  211. package/dist/lazyAccessors-hJKGv8Ay.cjs.map +1 -0
  212. package/dist/mobile-app.cjs +70 -0
  213. package/dist/mobile-app.cjs.map +1 -0
  214. package/dist/mobile-app.d.cts +61 -0
  215. package/dist/mobile-app.d.cts.map +1 -0
  216. package/dist/mobile-app.d.mts +61 -0
  217. package/dist/mobile-app.d.mts.map +1 -0
  218. package/dist/mobile-app.mjs +69 -0
  219. package/dist/mobile-app.mjs.map +1 -0
  220. package/dist/object-storage.cjs +18 -10
  221. package/dist/object-storage.cjs.map +1 -1
  222. package/dist/object-storage.d.cts +3 -7
  223. package/dist/object-storage.d.cts.map +1 -1
  224. package/dist/object-storage.d.mts +3 -7
  225. package/dist/object-storage.d.mts.map +1 -1
  226. package/dist/object-storage.mjs +11 -3
  227. package/dist/object-storage.mjs.map +1 -1
  228. package/dist/{processAudits-Dmts9H_b.mjs → processAudits-BpRlPQMW.mjs} +16 -19
  229. package/dist/processAudits-BpRlPQMW.mjs.map +1 -0
  230. package/dist/{processAudits-CGqttuXm.cjs → processAudits-D_2W5x8k.cjs} +26 -30
  231. package/dist/processAudits-D_2W5x8k.cjs.map +1 -0
  232. package/dist/queue/index.cjs +6 -189
  233. package/dist/queue/index.d.cts +3 -60
  234. package/dist/queue/index.d.mts +3 -60
  235. package/dist/queue/index.mjs +3 -186
  236. package/dist/rest-api.cjs +87 -63
  237. package/dist/rest-api.cjs.map +1 -1
  238. package/dist/rest-api.d.cts +62 -61
  239. package/dist/rest-api.d.cts.map +1 -1
  240. package/dist/rest-api.d.mts +62 -61
  241. package/dist/rest-api.d.mts.map +1 -1
  242. package/dist/rest-api.mjs +79 -55
  243. package/dist/rest-api.mjs.map +1 -1
  244. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  245. package/dist/site.cjs +33 -9
  246. package/dist/site.cjs.map +1 -1
  247. package/dist/site.d.cts +11 -22
  248. package/dist/site.d.cts.map +1 -1
  249. package/dist/site.d.mts +11 -22
  250. package/dist/site.d.mts.map +1 -1
  251. package/dist/site.mjs +29 -5
  252. package/dist/site.mjs.map +1 -1
  253. package/dist/subscribers/index.cjs +2 -11
  254. package/dist/subscribers/index.d.cts +3 -14
  255. package/dist/subscribers/index.d.mts +3 -14
  256. package/dist/subscribers/index.mjs +2 -11
  257. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  258. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  259. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  260. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  261. package/dist/{telemetry-C3L0iS28.d.cts → telemetry-DGcFlVpB.d.cts} +2 -5
  262. package/dist/telemetry-DGcFlVpB.d.cts.map +1 -0
  263. package/dist/{telemetry-D7bVFLGi.d.mts → telemetry-DGcFlVpB.d.mts} +2 -5
  264. package/dist/telemetry-DGcFlVpB.d.mts.map +1 -0
  265. package/dist/topic/index.cjs +3 -137
  266. package/dist/topic/index.d.cts +2 -32
  267. package/dist/topic/index.d.mts +2 -32
  268. package/dist/topic/index.mjs +2 -134
  269. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  270. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  271. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  272. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  273. package/dist/types.d.cts +1 -1
  274. package/dist/types.d.mts +1 -1
  275. package/dist/types.mjs +1 -0
  276. package/dist/worker.cjs +118 -35
  277. package/dist/worker.cjs.map +1 -1
  278. package/dist/worker.d.cts +95 -42
  279. package/dist/worker.d.cts.map +1 -1
  280. package/dist/worker.d.mts +95 -42
  281. package/dist/worker.d.mts.map +1 -1
  282. package/dist/worker.mjs +113 -30
  283. package/dist/worker.mjs.map +1 -1
  284. package/package.json +66 -41
  285. package/dist/Construct-BD5neF7w.mjs.map +0 -1
  286. package/dist/Construct-C0ijr2qp.d.cts +0 -117
  287. package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
  288. package/dist/Construct-Ct8nalEi.d.mts +0 -117
  289. package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
  290. package/dist/Construct-CyS3RpTL.cjs.map +0 -1
  291. package/dist/Cron-B2OFsfDM.d.cts.map +0 -1
  292. package/dist/Cron-ByxdOfpE.d.mts.map +0 -1
  293. package/dist/CronBuilder-BL0AP6fs.d.mts +0 -44
  294. package/dist/CronBuilder-BL0AP6fs.d.mts.map +0 -1
  295. package/dist/CronBuilder-CdibiHNB.mjs +0 -84
  296. package/dist/CronBuilder-CdibiHNB.mjs.map +0 -1
  297. package/dist/CronBuilder-DyUr6nYz.cjs +0 -96
  298. package/dist/CronBuilder-DyUr6nYz.cjs.map +0 -1
  299. package/dist/CronBuilder-LSJMfqnq.d.cts +0 -44
  300. package/dist/CronBuilder-LSJMfqnq.d.cts.map +0 -1
  301. package/dist/Endpoint-2Wg7T7Cq.d.mts.map +0 -1
  302. package/dist/Endpoint-DODn1RhN.cjs.map +0 -1
  303. package/dist/Endpoint-Dij_wOcc.mjs.map +0 -1
  304. package/dist/Endpoint-DrD8a1yH.d.cts.map +0 -1
  305. package/dist/EndpointFactory-BHFMmFkV.cjs.map +0 -1
  306. package/dist/EndpointFactory-b4ituq-s.mjs.map +0 -1
  307. package/dist/HonoEndpointAdaptor-BM2jbWht.mjs.map +0 -1
  308. package/dist/HonoEndpointAdaptor-De6IlBZe.cjs.map +0 -1
  309. package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
  310. package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
  311. package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
  312. package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
  313. package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
  314. package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
  315. package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
  316. package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
  317. package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
  318. package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
  319. package/dist/Topic-19QeHBIR.d.cts +0 -91
  320. package/dist/Topic-19QeHBIR.d.cts.map +0 -1
  321. package/dist/Topic-DuFeqkBh.d.mts +0 -91
  322. package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
  323. package/dist/auth.d.cts.map +0 -1
  324. package/dist/auth.d.mts.map +0 -1
  325. package/dist/cache-0ANvRQnD.mjs +0 -51
  326. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  327. package/dist/cache-3WSvAulx.cjs +0 -57
  328. package/dist/cache-3WSvAulx.cjs.map +0 -1
  329. package/dist/cache-BrRz3fEB.d.mts.map +0 -1
  330. package/dist/cache-BtZY_tHe.d.cts.map +0 -1
  331. package/dist/clone-DblgEZZa.mjs.map +0 -1
  332. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  333. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  334. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  335. package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
  336. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  337. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  338. package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
  339. package/dist/database/kysely.d.cts.map +0 -1
  340. package/dist/database/kysely.d.mts.map +0 -1
  341. package/dist/functions-Ck21Uyq0.mjs.map +0 -1
  342. package/dist/functions-DJJA7VGc.cjs.map +0 -1
  343. package/dist/index-AIfVzkhi.d.cts.map +0 -1
  344. package/dist/index-B8g8POkr.d.cts.map +0 -1
  345. package/dist/index-BxHDdy6a.d.mts.map +0 -1
  346. package/dist/index-CubPzHd9.d.mts.map +0 -1
  347. package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
  348. package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
  349. package/dist/processAudits-CGqttuXm.cjs.map +0 -1
  350. package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
  351. package/dist/queue/index.cjs.map +0 -1
  352. package/dist/queue/index.d.cts.map +0 -1
  353. package/dist/queue/index.d.mts.map +0 -1
  354. package/dist/queue/index.mjs.map +0 -1
  355. package/dist/subscribers/index.cjs.map +0 -1
  356. package/dist/subscribers/index.d.cts.map +0 -1
  357. package/dist/subscribers/index.d.mts.map +0 -1
  358. package/dist/subscribers/index.mjs.map +0 -1
  359. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  360. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  361. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  362. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  363. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  364. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  365. package/dist/topic/index.cjs.map +0 -1
  366. package/dist/topic/index.d.cts.map +0 -1
  367. package/dist/topic/index.d.mts.map +0 -1
  368. package/dist/topic/index.mjs.map +0 -1
  369. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  370. package/dist/types-aKksMEWL.d.mts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Queue-Ckmudcm8.cjs","names":["Construct","DEFAULT_LOGGER","canonicalId","provideKey","serviceKey","Publisher"],"sources":["../src/queue/Queue.ts"],"sourcesContent":["import {\n\ttype EventPublisher,\n\ttype EventPublisherConnectionString,\n\ttype PublishableMessage,\n\tPublisher,\n} from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport {\n\tcanonicalId,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { InferStandardSchema } from '@geekmidas/schema';\nimport type { Service, ServiceRecord } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { Construct, ConstructType } from '../Construct';\n\n/**\n * The wire message a queue carries: `{ type: <queue name>, payload: <message> }`.\n * The producer publishes this shape and the worker receives the `payload`s as\n * its `messages`. Typing `type` to the queue name keeps the publisher fully\n * typed and lets pg-boss (local) / SQS (deployed) route by name.\n */\nexport type QueueMessage<\n\tTName extends string,\n\tTMessage extends StandardSchemaV1,\n> = PublishableMessage<TName, InferStandardSchema<TMessage>>;\n\n/**\n * A queue worker — a point-to-point SQS-style queue and its single consumer.\n * Unlike a `Subscriber` (topic fan-out, filtered by `subscribedEvents`), a queue\n * drains every message of its one `message` type. Build one from the worker\n * that runs it — `worker.queue('Emails').message(schema).handle(…)` — and\n * `gkm build` discovers it into the manifest's `queues` field.\n *\n * Producers send to it by depending on it: `.dependsOn([emails])` makes\n * `services.emails` the publisher.\n */\nexport class Queue<\n\tTName extends string = string,\n\tTMessage extends StandardSchemaV1 = StandardSchemaV1,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> extends Construct<TLogger, undefined, TServices> {\n\t__IS_QUEUE__ = true;\n\n\tstatic isQueue(\n\t\tobj: unknown,\n\t): obj is Queue<string, StandardSchemaV1, Service[], Logger> {\n\t\treturn Boolean(\n\t\t\tobj &&\n\t\t\t\t(obj as { __IS_QUEUE__?: boolean }).__IS_QUEUE__ === true &&\n\t\t\t\t(obj as Construct).type === ConstructType.Queue,\n\t\t);\n\t}\n\n\t/**\n\t * The canonical id this queue is declared under.\n\t *\n\t * Derived from the name rather than given separately, so `emails` and\n\t * `Emails` are one queue. The name stays what it was: it is the wire `type`\n\t * a producer sends and the worker subscribes to, and changing that would\n\t * silently orphan in-flight messages.\n\t */\n\treadonly id: string;\n\n\t/**\n\t * The queue as a dependency — what `.dependsOn([emails])` dissolves into,\n\t * reachable as `services.emails`.\n\t *\n\t * The producer: the queue's one consumer is the handler it was built with,\n\t * so the only thing another construct can want from a queue is to send to\n\t * it. It reads `<NAME>_PUBLISHER_CONNECTION_STRING` and picks the transport\n\t * from its protocol — `pgboss://` locally, `sqs://` deployed. A field\n\t * assigned once, not a getter: services are cached by object identity.\n\t */\n\treadonly service: Service<\n\t\tUncapitalize<TName>,\n\t\tEventPublisher<QueueMessage<TName, TMessage>>\n\t>;\n\n\t/**\n\t * The producer's env key. Read by both {@link declare} and the service, so\n\t * what the target publishes and what the producer looks up cannot drift.\n\t */\n\tprivate readonly connectionKey: string;\n\n\tconstructor(\n\t\tpublic readonly name: TName,\n\t\tpublic readonly handler: QueueHandler<TMessage, TServices, TLogger>,\n\t\tpublic readonly messageSchema: TMessage,\n\t\tpublic override readonly timeout: number = 30000,\n\t\tpublic override readonly services: TServices = [] as unknown as TServices,\n\t\tpublic override readonly logger: TLogger = DEFAULT_LOGGER as TLogger,\n\t\t/** SQS event-source batch size (deployed). */\n\t\tpublic readonly batchSize?: number,\n\t\t/** Whether the queue is FIFO (deployed). */\n\t\tpublic readonly fifo?: boolean,\n\t\t/**\n\t\t * The construct ids the *worker* `.dependsOn()` named — last, so no\n\t\t * existing positional argument moves.\n\t\t */\n\t\tconstructs: string[] = [],\n\t) {\n\t\tsuper(\n\t\t\tConstructType.Queue,\n\t\t\tlogger,\n\t\t\tservices,\n\t\t\t[],\n\t\t\tundefined,\n\t\t\ttimeout,\n\t\t\tundefined, // memorySize\n\t\t\tundefined, // auditorStorageService\n\t\t\tconstructs,\n\t\t);\n\n\t\tthis.id = canonicalId(name);\n\t\tthis.connectionKey = provideKey(this.id, 'publisherConnectionString');\n\n\t\tconst envVar = this.connectionKey;\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(this.id) as Uncapitalize<TName>,\n\t\t\tasync register({ envParser }) {\n\t\t\t\tconst { connectionString } = envParser\n\t\t\t\t\t.create((get) => ({ connectionString: get(envVar).string() }))\n\t\t\t\t\t.parse();\n\n\t\t\t\treturn Publisher.fromConnectionString<QueueMessage<TName, TMessage>>(\n\t\t\t\t\tconnectionString as EventPublisherConnectionString,\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * What this queue is in the manifest.\n\t *\n\t * A queue is a resource, not a handler: the worker is reached *through* it,\n\t * so the declaration carries the producer's key and nothing about the code\n\t * that drains it. The local target reads this to know which broker has to be\n\t * running and what connection string to inject.\n\t */\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'queue',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.connectionKey],\n\t\t\t\t...(this.fifo ? { fifo: true } : {}),\n\t\t\t\t// Nested rather than a sibling node, because position carries the\n\t\t\t\t// trigger: this handler is reached by messages on this queue and\n\t\t\t\t// by nothing else, so there is no `trigger` field to keep in step.\n\t\t\t\t//\n\t\t\t\t// `handler` is the export name; which directory the build wrote it\n\t\t\t\t// to is the target's business, and a path with a cloud in it does\n\t\t\t\t// not belong in a neutral declaration.\n\t\t\t\tworker: {\n\t\t\t\t\tid: `${this.id}Worker`,\n\t\t\t\t\thandler: `${this.id}.handler`,\n\t\t\t\t\t// Filled by the build from what the worker declared. Empty is a\n\t\t\t\t\t// stated gap, not a claim that it reaches nothing.\n\t\t\t\t\tdependencies: [],\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}\n}\n\n/** The context a queue handler receives — a batch of typed messages. */\nexport type QueueContext<\n\tTMessage extends StandardSchemaV1,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> = {\n\tmessages: InferStandardSchema<TMessage>[];\n\tservices: ServiceRecord<TServices>;\n\tlogger: TLogger;\n};\n\nexport type QueueHandler<\n\tTMessage extends StandardSchemaV1,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> = (\n\tctx: QueueContext<TMessage, TServices, TLogger>,\n) => unknown | Promise<unknown>;\n"],"mappings":";;;;;;;;;;;;;;;AAwCA,IAAa,QAAb,cAKUA,kBAAAA,UAAyC;CA6CjC;CACA;CACA;CACS;CACA;CACA;CAET;CAEA;CArDjB,eAAe;CAEf,OAAO,QACN,KAC4D;EAC5D,OAAO,QACN,OACE,IAAmC,iBAAiB,QACpD,IAAkB,SAAA,8BACrB;CACD;;;;;;;;;CAUA;;;;;;;;;;;CAYA;;;;;CASA;CAEA,YACC,MACA,SACA,eACA,UAA2C,KAC3C,WAA+C,CAAC,GAChD,SAA2CC,0BAAAA,gBAE3C,WAEA,MAKA,aAAuB,CAAC,GACvB;EACD,MAAA,gCAEC,QACA,UACA,CAAC,GACD,KAAA,GACA,SACA,KAAA,GACA,KAAA,GACA,UACD;EA1BgB,KAAA,OAAA;EACA,KAAA,UAAA;EACA,KAAA,gBAAA;EACS,KAAA,UAAA;EACA,KAAA,WAAA;EACA,KAAA,SAAA;EAET,KAAA,YAAA;EAEA,KAAA,OAAA;EAmBhB,KAAK,MAAA,GAAKC,oBAAAA,YAAAA,CAAY,IAAI;EAC1B,KAAK,iBAAA,GAAgBC,oBAAAA,WAAAA,CAAW,KAAK,IAAI,2BAA2B;EAEpE,MAAM,SAAS,KAAK;EACpB,KAAK,UAAU;GACd,cAAA,GAAaC,oBAAAA,WAAAA,CAAW,KAAK,EAAE;GAC/B,MAAM,SAAS,EAAE,aAAa;IAC7B,MAAM,EAAE,qBAAqB,UAC3B,QAAQ,SAAS,EAAE,kBAAkB,IAAI,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC7D,MAAM;IAER,OAAOC,kBAAAA,UAAU,qBAChB,gBACD;GACD;EACD;CACD;;;;;;;;;CAUA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,aAAa;GAC7B,GAAI,KAAK,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;GAQlC,QAAQ;IACP,IAAI,GAAG,KAAK,GAAG;IACf,SAAS,GAAG,KAAK,GAAG;IAGpB,cAAc,CAAC;GAChB;EACD,CACD;CACD;AACD"}
@@ -1,13 +1,11 @@
1
- import { Construct } from "./Construct-C0ijr2qp.cjs";
2
- import { EventPublisher, PublishableMessage } from "@geekmidas/events";
1
+ import { t as StandardSchemaV1 } from "./index-CeEtxDmK.cjs";
2
+ import { t as Construct } from "./Construct-BQALFCh2.cjs";
3
3
  import { Logger } from "@geekmidas/logger";
4
4
  import { InferStandardSchema } from "@geekmidas/schema";
5
5
  import { Service, ServiceRecord } from "@geekmidas/services";
6
- import { StandardSchemaV1 } from "@standard-schema/spec";
6
+ import { EventPublisher, PublishableMessage } from "@geekmidas/events";
7
7
  import { Declaration } from "@geekmidas/manifest";
8
-
9
8
  //#region src/queue/Queue.d.ts
10
-
11
9
  /**
12
10
  * The wire message a queue carries: `{ type: <queue name>, payload: <message> }`.
13
11
  * The producer publishes this shape and the worker receives the `payload`s as
@@ -18,13 +16,14 @@ type QueueMessage<TName extends string, TMessage extends StandardSchemaV1> = Pub
18
16
  /**
19
17
  * A queue worker — a point-to-point SQS-style queue and its single consumer.
20
18
  * Unlike a `Subscriber` (topic fan-out, filtered by `subscribedEvents`), a queue
21
- * drains every message of its one `message` type. Build one with `q` (see
22
- * `QueueBuilder`); `gkm build` discovers it into the manifest's `queues` field.
19
+ * drains every message of its one `message` type. Build one from the worker
20
+ * that runs it — `worker.queue('Emails').message(schema).handle(…)` — and
21
+ * `gkm build` discovers it into the manifest's `queues` field.
23
22
  *
24
- * The producer side is {@link Queue.publisher} — a ready-to-inject `Service`
25
- * that any endpoint/function drops into `.services([...])` to send messages.
23
+ * Producers send to it by depending on it: `.dependsOn([emails])` makes
24
+ * `services.emails` the publisher.
26
25
  */
27
- declare class Queue<TName extends string = string, TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger> extends Construct<TLogger, string, undefined, undefined, TServices> {
26
+ declare class Queue<TName extends string = string, TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger> extends Construct<TLogger, undefined, TServices> {
28
27
  readonly name: TName;
29
28
  readonly handler: QueueHandler<TMessage, TServices, TLogger>;
30
29
  readonly messageSchema: TMessage;
@@ -47,13 +46,25 @@ declare class Queue<TName extends string = string, TMessage extends StandardSche
47
46
  */
48
47
  readonly id: string;
49
48
  /**
50
- * The producer's env key. Read by both {@link declare} and
51
- * {@link publisher}, so what the target publishes and what the producer
52
- * looks up cannot drift.
49
+ * The queue as a dependency — what `.dependsOn([emails])` dissolves into,
50
+ * reachable as `services.emails`.
51
+ *
52
+ * The producer: the queue's one consumer is the handler it was built with,
53
+ * so the only thing another construct can want from a queue is to send to
54
+ * it. It reads `<NAME>_PUBLISHER_CONNECTION_STRING` and picks the transport
55
+ * from its protocol — `pgboss://` locally, `sqs://` deployed. A field
56
+ * assigned once, not a getter: services are cached by object identity.
57
+ */
58
+ readonly service: Service<Uncapitalize<TName>, EventPublisher<QueueMessage<TName, TMessage>>>;
59
+ /**
60
+ * The producer's env key. Read by both {@link declare} and the service, so
61
+ * what the target publishes and what the producer looks up cannot drift.
53
62
  */
54
63
  private readonly connectionKey;
55
- constructor(name: TName, handler: QueueHandler<TMessage, TServices, TLogger>, messageSchema: TMessage, timeout?: number, services?: TServices, logger?: TLogger, /** SQS event-source batch size (deployed). */
56
- batchSize?: number | undefined, /** Whether the queue is FIFO (deployed). */
64
+ constructor(name: TName, handler: QueueHandler<TMessage, TServices, TLogger>, messageSchema: TMessage, timeout?: number, services?: TServices, logger?: TLogger,
65
+ /** SQS event-source batch size (deployed). */
66
+ batchSize?: number | undefined,
67
+ /** Whether the queue is FIFO (deployed). */
57
68
  fifo?: boolean | undefined,
58
69
  /**
59
70
  * The construct ids the *worker* `.dependsOn()` named — last, so no
@@ -69,28 +80,6 @@ declare class Queue<TName extends string = string, TMessage extends StandardSche
69
80
  * running and what connection string to inject.
70
81
  */
71
82
  declare(): Declaration[];
72
- /**
73
- * The producer side — a `Service` exposing an `EventPublisher` typed to this
74
- * queue's message. Inject it via `.services([queue.publisher])`; the handler
75
- * then calls `services.<name>Publisher.publish([{ type, payload }])`.
76
- *
77
- * It reads `<NAME>_PUBLISHER_CONNECTION_STRING` and builds the transport from
78
- * the URL protocol — `pgboss://` locally, `sqs://` deployed — so the same
79
- * code publishes to Postgres in dev and SQS in prod. Because it's a `Service`,
80
- * `Construct.getEnvironment()` sniffs it, so the env requirement flows into
81
- * the manifest and infra links exactly this queue with least privilege.
82
- */
83
- /**
84
- * The queue as a dependency — what `.dependsOn([emailsQueue])` dissolves
85
- * into, reachable as `services.emails`.
86
- *
87
- * It is the producer: a consumer is the worker written right here, so the
88
- * only thing another construct can want from a queue is the ability to send
89
- * to it. {@link publisher} is the same service under its older
90
- * `<name>Publisher` key, kept for `.services([queue.publisher])`.
91
- */
92
- get service(): Service<Uncapitalize<TName>, EventPublisher<QueueMessage<TName, TMessage>>>;
93
- get publisher(): Service<`${TName}Publisher`, EventPublisher<QueueMessage<TName, TMessage>>>;
94
83
  }
95
84
  /** The context a queue handler receives — a batch of typed messages. */
96
85
  type QueueContext<TMessage extends StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger> = {
@@ -99,7 +88,6 @@ type QueueContext<TMessage extends StandardSchemaV1, TServices extends Service[]
99
88
  logger: TLogger;
100
89
  };
101
90
  type QueueHandler<TMessage extends StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger> = (ctx: QueueContext<TMessage, TServices, TLogger>) => unknown | Promise<unknown>;
102
- //# sourceMappingURL=Queue.d.ts.map
103
91
  //#endregion
104
- export { Queue, QueueContext, QueueHandler, QueueMessage };
105
- //# sourceMappingURL=Queue-D7ZuwBhy.d.cts.map
92
+ export { QueueMessage as i, QueueContext as n, QueueHandler as r, Queue as t };
93
+ //# sourceMappingURL=Queue-CpQIGB_2.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Queue-CpQIGB_2.d.cts","names":[],"sources":["../src/queue/Queue.ts"],"mappings":";;;;;;;;;;;;;;KAyBY,aACX,sBACA,iBAAiB,oBACd,mBAAmB,OAAO,oBAAoB;;;;;;;;;;;cAYrC,MACZ,+BACA,iBAAiB,mBAAmB,kBACpC,kBAAkB,gBAClB,gBAAgB,SAAS,gBAChB,UAAU,oBAAoB;WA6CtB,MAAM;WACN,SAAS,aAAa,UAAU,WAAW;WAC3C,eAAe;WACN;WACA,UAAU;WACV,QAAQ;;WAEjB;;WAEA;EArDjB;SAEO,QACN,eACE,OAAO,cAAc,kBAAkB,WAAW;;;;;;;;;WAgB5C;;;;;;;;;;;WAYA,SAAS,QACjB,aAAa,QACb,eAAe,aAAa,OAAO;;;;;mBAOnB;EAEjB,YACiB,MAAM,OACN,SAAS,aAAa,UAAU,WAAW,UAC3C,eAAe,UACN,kBACA,WAAU,WACV,SAAQ,SAEjB;;EAAA,gCAEA;;EAAA,4BAKhB;;;;;EAAA;;;;;;;;;EAwCD,WAAW;;;KA2BA,aACX,iBAAiB,kBACjB,kBAAkB,gBAClB,gBAAgB,SAAS;EAEzB,UAAU,oBAAoB;EAC9B,UAAU,cAAc;EACxB,QAAQ;;KAGG,aACX,iBAAiB,kBACjB,kBAAkB,gBAClB,gBAAgB,SAAS,WAEzB,KAAK,aAAa,UAAU,WAAW,uBACzB"}
@@ -1,13 +1,11 @@
1
- import { Construct } from "./Construct-Ct8nalEi.mjs";
1
+ import { t as StandardSchemaV1 } from "./index-CeEtxDmK.mjs";
2
+ import { t as Construct } from "./Construct-QXnl3VqT.mjs";
2
3
  import { Declaration } from "@geekmidas/manifest";
3
- import { Service, ServiceRecord } from "@geekmidas/services";
4
4
  import { EventPublisher, PublishableMessage } from "@geekmidas/events";
5
+ import { Service, ServiceRecord } from "@geekmidas/services";
5
6
  import { Logger } from "@geekmidas/logger";
6
7
  import { InferStandardSchema } from "@geekmidas/schema";
7
- import { StandardSchemaV1 } from "@standard-schema/spec";
8
-
9
8
  //#region src/queue/Queue.d.ts
10
-
11
9
  /**
12
10
  * The wire message a queue carries: `{ type: <queue name>, payload: <message> }`.
13
11
  * The producer publishes this shape and the worker receives the `payload`s as
@@ -18,13 +16,14 @@ type QueueMessage<TName extends string, TMessage extends StandardSchemaV1> = Pub
18
16
  /**
19
17
  * A queue worker — a point-to-point SQS-style queue and its single consumer.
20
18
  * Unlike a `Subscriber` (topic fan-out, filtered by `subscribedEvents`), a queue
21
- * drains every message of its one `message` type. Build one with `q` (see
22
- * `QueueBuilder`); `gkm build` discovers it into the manifest's `queues` field.
19
+ * drains every message of its one `message` type. Build one from the worker
20
+ * that runs it — `worker.queue('Emails').message(schema).handle(…)` — and
21
+ * `gkm build` discovers it into the manifest's `queues` field.
23
22
  *
24
- * The producer side is {@link Queue.publisher} — a ready-to-inject `Service`
25
- * that any endpoint/function drops into `.services([...])` to send messages.
23
+ * Producers send to it by depending on it: `.dependsOn([emails])` makes
24
+ * `services.emails` the publisher.
26
25
  */
27
- declare class Queue<TName extends string = string, TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger> extends Construct<TLogger, string, undefined, undefined, TServices> {
26
+ declare class Queue<TName extends string = string, TMessage extends StandardSchemaV1 = StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger> extends Construct<TLogger, undefined, TServices> {
28
27
  readonly name: TName;
29
28
  readonly handler: QueueHandler<TMessage, TServices, TLogger>;
30
29
  readonly messageSchema: TMessage;
@@ -47,13 +46,25 @@ declare class Queue<TName extends string = string, TMessage extends StandardSche
47
46
  */
48
47
  readonly id: string;
49
48
  /**
50
- * The producer's env key. Read by both {@link declare} and
51
- * {@link publisher}, so what the target publishes and what the producer
52
- * looks up cannot drift.
49
+ * The queue as a dependency — what `.dependsOn([emails])` dissolves into,
50
+ * reachable as `services.emails`.
51
+ *
52
+ * The producer: the queue's one consumer is the handler it was built with,
53
+ * so the only thing another construct can want from a queue is to send to
54
+ * it. It reads `<NAME>_PUBLISHER_CONNECTION_STRING` and picks the transport
55
+ * from its protocol — `pgboss://` locally, `sqs://` deployed. A field
56
+ * assigned once, not a getter: services are cached by object identity.
57
+ */
58
+ readonly service: Service<Uncapitalize<TName>, EventPublisher<QueueMessage<TName, TMessage>>>;
59
+ /**
60
+ * The producer's env key. Read by both {@link declare} and the service, so
61
+ * what the target publishes and what the producer looks up cannot drift.
53
62
  */
54
63
  private readonly connectionKey;
55
- constructor(name: TName, handler: QueueHandler<TMessage, TServices, TLogger>, messageSchema: TMessage, timeout?: number, services?: TServices, logger?: TLogger, /** SQS event-source batch size (deployed). */
56
- batchSize?: number | undefined, /** Whether the queue is FIFO (deployed). */
64
+ constructor(name: TName, handler: QueueHandler<TMessage, TServices, TLogger>, messageSchema: TMessage, timeout?: number, services?: TServices, logger?: TLogger,
65
+ /** SQS event-source batch size (deployed). */
66
+ batchSize?: number | undefined,
67
+ /** Whether the queue is FIFO (deployed). */
57
68
  fifo?: boolean | undefined,
58
69
  /**
59
70
  * The construct ids the *worker* `.dependsOn()` named — last, so no
@@ -69,28 +80,6 @@ declare class Queue<TName extends string = string, TMessage extends StandardSche
69
80
  * running and what connection string to inject.
70
81
  */
71
82
  declare(): Declaration[];
72
- /**
73
- * The producer side — a `Service` exposing an `EventPublisher` typed to this
74
- * queue's message. Inject it via `.services([queue.publisher])`; the handler
75
- * then calls `services.<name>Publisher.publish([{ type, payload }])`.
76
- *
77
- * It reads `<NAME>_PUBLISHER_CONNECTION_STRING` and builds the transport from
78
- * the URL protocol — `pgboss://` locally, `sqs://` deployed — so the same
79
- * code publishes to Postgres in dev and SQS in prod. Because it's a `Service`,
80
- * `Construct.getEnvironment()` sniffs it, so the env requirement flows into
81
- * the manifest and infra links exactly this queue with least privilege.
82
- */
83
- /**
84
- * The queue as a dependency — what `.dependsOn([emailsQueue])` dissolves
85
- * into, reachable as `services.emails`.
86
- *
87
- * It is the producer: a consumer is the worker written right here, so the
88
- * only thing another construct can want from a queue is the ability to send
89
- * to it. {@link publisher} is the same service under its older
90
- * `<name>Publisher` key, kept for `.services([queue.publisher])`.
91
- */
92
- get service(): Service<Uncapitalize<TName>, EventPublisher<QueueMessage<TName, TMessage>>>;
93
- get publisher(): Service<`${TName}Publisher`, EventPublisher<QueueMessage<TName, TMessage>>>;
94
83
  }
95
84
  /** The context a queue handler receives — a batch of typed messages. */
96
85
  type QueueContext<TMessage extends StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger> = {
@@ -99,7 +88,6 @@ type QueueContext<TMessage extends StandardSchemaV1, TServices extends Service[]
99
88
  logger: TLogger;
100
89
  };
101
90
  type QueueHandler<TMessage extends StandardSchemaV1, TServices extends Service[] = [], TLogger extends Logger = Logger> = (ctx: QueueContext<TMessage, TServices, TLogger>) => unknown | Promise<unknown>;
102
- //# sourceMappingURL=Queue.d.ts.map
103
91
  //#endregion
104
- export { Queue, QueueContext, QueueHandler, QueueMessage };
105
- //# sourceMappingURL=Queue-gVGfi2Yk.d.mts.map
92
+ export { QueueMessage as i, QueueContext as n, QueueHandler as r, Queue as t };
93
+ //# sourceMappingURL=Queue-YmvN2vEP.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Queue-YmvN2vEP.d.mts","names":[],"sources":["../src/queue/Queue.ts"],"mappings":";;;;;;;;;;;;;;KAyBY,aACX,sBACA,iBAAiB,oBACd,mBAAmB,OAAO,oBAAoB;;;;;;;;;;;cAYrC,MACZ,+BACA,iBAAiB,mBAAmB,kBACpC,kBAAkB,gBAClB,gBAAgB,SAAS,gBAChB,UAAU,oBAAoB;WA6CtB,MAAM;WACN,SAAS,aAAa,UAAU,WAAW;WAC3C,eAAe;WACN;WACA,UAAU;WACV,QAAQ;;WAEjB;;WAEA;EArDjB;SAEO,QACN,eACE,OAAO,cAAc,kBAAkB,WAAW;;;;;;;;;WAgB5C;;;;;;;;;;;WAYA,SAAS,QACjB,aAAa,QACb,eAAe,aAAa,OAAO;;;;;mBAOnB;EAEjB,YACiB,MAAM,OACN,SAAS,aAAa,UAAU,WAAW,UAC3C,eAAe,UACN,kBACA,WAAU,WACV,SAAQ,SAEjB;;EAAA,gCAEA;;EAAA,4BAKhB;;;;;EAAA;;;;;;;;;EAwCD,WAAW;;;KA2BA,aACX,iBAAiB,kBACjB,kBAAkB,gBAClB,gBAAgB,SAAS;EAEzB,UAAU,oBAAoB;EAC9B,UAAU,cAAc;EACxB,QAAQ;;KAGG,aACX,iBAAiB,kBACjB,kBAAkB,gBAClB,gBAAgB,SAAS,WAEzB,KAAK,aAAa,UAAU,WAAW,uBACzB"}
@@ -0,0 +1,112 @@
1
+ const require_construct_interface = require("./construct-interface.cjs");
2
+ const require_clone = require("./clone-UGJpvQnL.cjs");
3
+ const require_Queue = require("./Queue-Ckmudcm8.cjs");
4
+ let _geekmidas_logger_console = require("@geekmidas/logger/console");
5
+ //#region src/queue/QueueBuilder.ts
6
+ /**
7
+ * Builds a {@link Queue} and its one consumer. Reached through
8
+ * `worker.queue('orders')`, never constructed by hand: the worker stamps itself
9
+ * as the owner. `message` is the typed job payload and `handle` the consumer.
10
+ * The queue name is captured as a literal so `queue.service` publishes
11
+ * `{ type: '<name>', payload }`.
12
+ */
13
+ var QueueBuilder = class {
14
+ _name;
15
+ _messageSchema;
16
+ _timeout = 3e4;
17
+ _batchSize;
18
+ _fifo;
19
+ _services = [];
20
+ /** The construct ids `.dependsOn()` named — what the manifest records. */
21
+ _constructs = [];
22
+ _logger = _geekmidas_logger_console.DEFAULT_LOGGER;
23
+ /** The worker that runs this queue's consumer — stamped by `worker.queue()`. */
24
+ _owner;
25
+ /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
26
+ queue(name) {
27
+ return require_clone.cloneWith(this, { _name: name });
28
+ }
29
+ timeout(timeout) {
30
+ return require_clone.cloneWith(this, { _timeout: timeout });
31
+ }
32
+ /** SQS event-source batch size (deployed). */
33
+ batchSize(batchSize) {
34
+ return require_clone.cloneWith(this, { _batchSize: batchSize });
35
+ }
36
+ /** Mark the queue as FIFO (deployed). */
37
+ fifo(fifo = true) {
38
+ return require_clone.cloneWith(this, { _fifo: fifo });
39
+ }
40
+ /**
41
+ * Depend on constructs — a database, a bucket, a mail sender, a queue, a
42
+ * topic.
43
+ *
44
+ * It records the edge and dissolves each construct's client into the
45
+ * handler's service record under the construct's own id, so
46
+ * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
47
+ *
48
+ * Constructs only. A `Service` does not match the shape, which is what keeps
49
+ * env sniffing confined to `.services()` and the explicit lift.
50
+ */
51
+ dependsOn(constructs) {
52
+ const services = require_construct_interface.servicesOf(constructs);
53
+ return require_clone.cloneWith(this, {
54
+ _services: [...this._services, ...services],
55
+ _constructs: require_construct_interface.idsOf(constructs, this._constructs)
56
+ });
57
+ }
58
+ services(services) {
59
+ return require_clone.cloneWith(this, { _services: [...this._services, ...services] });
60
+ }
61
+ logger(logger) {
62
+ return require_clone.cloneWith(this, { _logger: logger });
63
+ }
64
+ /** The typed message (job) payload the queue carries. */
65
+ message(schema) {
66
+ return require_clone.cloneWith(this, { _messageSchema: schema });
67
+ }
68
+ handle(fn) {
69
+ if (!this._name) throw new QueueNeedsName();
70
+ if (!this._messageSchema) throw new QueueNeedsMessage(this._name);
71
+ const queue = new require_Queue.Queue(this._name, fn, this._messageSchema, this._timeout, this._services, this._logger, this._batchSize, this._fifo, this._constructs);
72
+ queue.owner = this._owner;
73
+ return queue;
74
+ }
75
+ };
76
+ /** A queue built without a name — only reachable by building one by hand. */
77
+ var QueueNeedsName = class extends Error {
78
+ constructor() {
79
+ super("A queue needs a name: build it from a worker, worker.queue('Emails').");
80
+ this.name = "QueueNeedsName";
81
+ }
82
+ };
83
+ /** A queue whose message was never described. */
84
+ var QueueNeedsMessage = class extends Error {
85
+ queue;
86
+ constructor(queue) {
87
+ super(`Queue '${queue}' has no message: call .message(schema) before .handle(), so its producers and its consumer agree on what it carries.`);
88
+ this.queue = queue;
89
+ this.name = "QueueNeedsMessage";
90
+ }
91
+ };
92
+ //#endregion
93
+ Object.defineProperty(exports, "QueueBuilder", {
94
+ enumerable: true,
95
+ get: function() {
96
+ return QueueBuilder;
97
+ }
98
+ });
99
+ Object.defineProperty(exports, "QueueNeedsMessage", {
100
+ enumerable: true,
101
+ get: function() {
102
+ return QueueNeedsMessage;
103
+ }
104
+ });
105
+ Object.defineProperty(exports, "QueueNeedsName", {
106
+ enumerable: true,
107
+ get: function() {
108
+ return QueueNeedsName;
109
+ }
110
+ });
111
+
112
+ //# sourceMappingURL=QueueBuilder-CJNcv4dy.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueBuilder-CJNcv4dy.cjs","names":["DEFAULT_LOGGER","cloneWith","servicesOf","idsOf","Queue"],"sources":["../src/queue/QueueBuilder.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport type { Service } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { cloneWith } from '../clone';\nimport {\n\ttype Consumable,\n\tidsOf,\n\ttype ServicesOf,\n\tservicesOf,\n} from '../construct-interface';\nimport { Queue, type QueueHandler } from './Queue';\n\n/**\n * Builds a {@link Queue} and its one consumer. Reached through\n * `worker.queue('orders')`, never constructed by hand: the worker stamps itself\n * as the owner. `message` is the typed job payload and `handle` the consumer.\n * The queue name is captured as a literal so `queue.service` publishes\n * `{ type: '<name>', payload }`.\n */\nexport class QueueBuilder<\n\tTName extends string = string,\n\tTMessage extends StandardSchemaV1 | undefined = undefined,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> {\n\tprivate _name?: string;\n\tprivate _messageSchema?: TMessage;\n\tprivate _timeout = 30000;\n\tprivate _batchSize?: number;\n\tprivate _fifo?: boolean;\n\tprivate _services: TServices = [] as Service[] as TServices;\n\t/** The construct ids `.dependsOn()` named — what the manifest records. */\n\tpublic _constructs: string[] = [];\n\tprivate _logger: TLogger = DEFAULT_LOGGER as TLogger;\n\t/** The worker that runs this queue's consumer — stamped by `worker.queue()`. */\n\tpublic _owner?: string;\n\n\t/** The queue name — drives the infra queue and its `<NAME>_*` env vars. */\n\tqueue<T extends string>(\n\t\tname: T,\n\t): QueueBuilder<T, TMessage, TServices, TLogger> {\n\t\treturn cloneWith(this, { _name: name }) as unknown as QueueBuilder<\n\t\t\tT,\n\t\t\tTMessage,\n\t\t\tTServices,\n\t\t\tTLogger\n\t\t>;\n\t}\n\n\ttimeout(timeout: number): this {\n\t\treturn cloneWith(this, { _timeout: timeout });\n\t}\n\n\t/** SQS event-source batch size (deployed). */\n\tbatchSize(batchSize: number): this {\n\t\treturn cloneWith(this, { _batchSize: batchSize });\n\t}\n\n\t/** Mark the queue as FIFO (deployed). */\n\tfifo(fifo = true): this {\n\t\treturn cloneWith(this, { _fifo: fifo });\n\t}\n\n\t/**\n\t * Depend on constructs — a database, a bucket, a mail sender, a queue, a\n\t * topic.\n\t *\n\t * It records the edge and dissolves each construct's client into the\n\t * handler's service record under the construct's own id, so\n\t * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.\n\t *\n\t * Constructs only. A `Service` does not match the shape, which is what keeps\n\t * env sniffing confined to `.services()` and the explicit lift.\n\t */\n\tdependsOn<const T extends readonly Consumable[]>(\n\t\tconstructs: T,\n\t): QueueBuilder<TName, TMessage, [...TServices, ...ServicesOf<T>], TLogger> {\n\t\t// Both halves of the edge, from one call and one clone: the services the\n\t\t// handler runs with, and the ids the manifest records. Recording them\n\t\t// separately is what let them drift apart.\n\t\t//\n\t\t// `servicesOf` is the half that validates, so it runs first — recording\n\t\t// ids ahead of it left a caught `NotAConstruct` with `undefined` already\n\t\t// on a `string[]`.\n\t\tconst services = servicesOf(constructs) as unknown as Service[];\n\n\t\treturn cloneWith(this, {\n\t\t\t_services: [...this._services, ...services],\n\t\t\t_constructs: idsOf(constructs, this._constructs),\n\t\t}) as unknown as QueueBuilder<\n\t\t\tTName,\n\t\t\tTMessage,\n\t\t\t[...TServices, ...ServicesOf<T>],\n\t\t\tTLogger\n\t\t>;\n\t}\n\n\tservices<T extends Service[]>(\n\t\tservices: T,\n\t): QueueBuilder<TName, TMessage, [...TServices, ...T], TLogger> {\n\t\treturn cloneWith(this, {\n\t\t\t_services: [...this._services, ...services] as unknown as TServices,\n\t\t}) as unknown as QueueBuilder<\n\t\t\tTName,\n\t\t\tTMessage,\n\t\t\t[...TServices, ...T],\n\t\t\tTLogger\n\t\t>;\n\t}\n\n\tlogger<T extends Logger>(\n\t\tlogger: T,\n\t): QueueBuilder<TName, TMessage, TServices, T> {\n\t\treturn cloneWith(this, {\n\t\t\t_logger: logger as unknown as TLogger,\n\t\t}) as unknown as QueueBuilder<TName, TMessage, TServices, T>;\n\t}\n\n\t/** The typed message (job) payload the queue carries. */\n\tmessage<T extends StandardSchemaV1>(\n\t\tschema: T,\n\t): QueueBuilder<TName, T, TServices, TLogger> {\n\t\treturn cloneWith(this, {\n\t\t\t_messageSchema: schema as unknown as TMessage,\n\t\t}) as unknown as QueueBuilder<TName, T, TServices, TLogger>;\n\t}\n\n\thandle(\n\t\tfn: QueueHandler<NonNullable<TMessage>, TServices, TLogger>,\n\t): Queue<TName, NonNullable<TMessage>, TServices, TLogger> {\n\t\tif (!this._name) throw new QueueNeedsName();\n\t\tif (!this._messageSchema) throw new QueueNeedsMessage(this._name);\n\n\t\tconst queue = new Queue<TName, NonNullable<TMessage>, TServices, TLogger>(\n\t\t\tthis._name as TName,\n\t\t\tfn,\n\t\t\tthis._messageSchema as NonNullable<TMessage>,\n\t\t\tthis._timeout,\n\t\t\tthis._services,\n\t\t\tthis._logger,\n\t\t\tthis._batchSize,\n\t\t\tthis._fifo,\n\t\t\tthis._constructs,\n\t\t);\n\t\t// Which process runs the consumer: the worker it was built from.\n\t\tqueue.owner = this._owner;\n\n\t\t// No reset. `.handle()` reads this builder and leaves it alone, so a\n\t\t// configured base — `const fn = f.logger(log).timeout(60_000)` — keeps\n\t\t// its configuration for every construct built from it. The reset that\n\t\t// used to be here wiped the base on first use, which made a base usable\n\t\t// exactly once, and quietly reverted the logger to the default.\n\n\t\treturn queue;\n\t}\n}\n\n/** A queue built without a name — only reachable by building one by hand. */\nexport class QueueNeedsName extends Error {\n\tconstructor() {\n\t\tsuper(\n\t\t\t\"A queue needs a name: build it from a worker, worker.queue('Emails').\",\n\t\t);\n\t\tthis.name = 'QueueNeedsName';\n\t}\n}\n\n/** A queue whose message was never described. */\nexport class QueueNeedsMessage extends Error {\n\tconstructor(readonly queue: string) {\n\t\tsuper(\n\t\t\t`Queue '${queue}' has no message: call .message(schema) before .handle(), ` +\n\t\t\t\t'so its producers and its consumer agree on what it carries.',\n\t\t);\n\t\tthis.name = 'QueueNeedsMessage';\n\t}\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAa,eAAb,MAKE;CACD;CACA;CACA,WAAmB;CACnB;CACA;CACA,YAA+B,CAAC;;CAEhC,cAA+B,CAAC;CAChC,UAA2BA,0BAAAA;;CAE3B;;CAGA,MACC,MACgD;EAChD,OAAOC,cAAAA,UAAU,MAAM,EAAE,OAAO,KAAK,CAAC;CAMvC;CAEA,QAAQ,SAAuB;EAC9B,OAAOA,cAAAA,UAAU,MAAM,EAAE,UAAU,QAAQ,CAAC;CAC7C;;CAGA,UAAU,WAAyB;EAClC,OAAOA,cAAAA,UAAU,MAAM,EAAE,YAAY,UAAU,CAAC;CACjD;;CAGA,KAAK,OAAO,MAAY;EACvB,OAAOA,cAAAA,UAAU,MAAM,EAAE,OAAO,KAAK,CAAC;CACvC;;;;;;;;;;;;CAaA,UACC,YAC2E;EAQ3E,MAAM,WAAWC,4BAAAA,WAAW,UAAU;EAEtC,OAAOD,cAAAA,UAAU,MAAM;GACtB,WAAW,CAAC,GAAG,KAAK,WAAW,GAAG,QAAQ;GAC1C,aAAaE,4BAAAA,MAAM,YAAY,KAAK,WAAW;EAChD,CAAC;CAMF;CAEA,SACC,UAC+D;EAC/D,OAAOF,cAAAA,UAAU,MAAM,EACtB,WAAW,CAAC,GAAG,KAAK,WAAW,GAAG,QAAQ,EAC3C,CAAC;CAMF;CAEA,OACC,QAC8C;EAC9C,OAAOA,cAAAA,UAAU,MAAM,EACtB,SAAS,OACV,CAAC;CACF;;CAGA,QACC,QAC6C;EAC7C,OAAOA,cAAAA,UAAU,MAAM,EACtB,gBAAgB,OACjB,CAAC;CACF;CAEA,OACC,IAC0D;EAC1D,IAAI,CAAC,KAAK,OAAO,MAAM,IAAI,eAAe;EAC1C,IAAI,CAAC,KAAK,gBAAgB,MAAM,IAAI,kBAAkB,KAAK,KAAK;EAEhE,MAAM,QAAQ,IAAIG,cAAAA,MACjB,KAAK,OACL,IACA,KAAK,gBACL,KAAK,UACL,KAAK,WACL,KAAK,SACL,KAAK,YACL,KAAK,OACL,KAAK,WACN;EAEA,MAAM,QAAQ,KAAK;EAQnB,OAAO;CACR;AACD;;AAGA,IAAa,iBAAb,cAAoC,MAAM;CACzC,cAAc;EACb,MACC,uEACD;EACA,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,oBAAb,cAAuC,MAAM;CACvB;CAArB,YAAY,OAAwB;EACnC,MACC,UAAU,MAAM,sHAEjB;EAJoB,KAAA,QAAA;EAKpB,KAAK,OAAO;CACb;AACD"}
@@ -0,0 +1,62 @@
1
+ import { t as StandardSchemaV1 } from "./index-CeEtxDmK.mjs";
2
+ import { c as ServicesOf, r as Consumable } from "./construct-interface-_3zgxzXl.mjs";
3
+ import { r as QueueHandler, t as Queue } from "./Queue-YmvN2vEP.mjs";
4
+ import { Service } from "@geekmidas/services";
5
+ import { Logger } from "@geekmidas/logger";
6
+ //#region src/queue/QueueBuilder.d.ts
7
+ /**
8
+ * Builds a {@link Queue} and its one consumer. Reached through
9
+ * `worker.queue('orders')`, never constructed by hand: the worker stamps itself
10
+ * as the owner. `message` is the typed job payload and `handle` the consumer.
11
+ * The queue name is captured as a literal so `queue.service` publishes
12
+ * `{ type: '<name>', payload }`.
13
+ */
14
+ declare class QueueBuilder<TName extends string = string, TMessage extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger> {
15
+ private _name?;
16
+ private _messageSchema?;
17
+ private _timeout;
18
+ private _batchSize?;
19
+ private _fifo?;
20
+ private _services;
21
+ /** The construct ids `.dependsOn()` named — what the manifest records. */
22
+ _constructs: string[];
23
+ private _logger;
24
+ /** The worker that runs this queue's consumer — stamped by `worker.queue()`. */
25
+ _owner?: string;
26
+ /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
27
+ queue<T extends string>(name: T): QueueBuilder<T, TMessage, TServices, TLogger>;
28
+ timeout(timeout: number): this;
29
+ /** SQS event-source batch size (deployed). */
30
+ batchSize(batchSize: number): this;
31
+ /** Mark the queue as FIFO (deployed). */
32
+ fifo(fifo?: boolean): this;
33
+ /**
34
+ * Depend on constructs — a database, a bucket, a mail sender, a queue, a
35
+ * topic.
36
+ *
37
+ * It records the edge and dissolves each construct's client into the
38
+ * handler's service record under the construct's own id, so
39
+ * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
40
+ *
41
+ * Constructs only. A `Service` does not match the shape, which is what keeps
42
+ * env sniffing confined to `.services()` and the explicit lift.
43
+ */
44
+ dependsOn<const T extends readonly Consumable[]>(constructs: T): QueueBuilder<TName, TMessage, [...TServices, ...ServicesOf<T>], TLogger>;
45
+ services<T extends Service[]>(services: T): QueueBuilder<TName, TMessage, [...TServices, ...T], TLogger>;
46
+ logger<T extends Logger>(logger: T): QueueBuilder<TName, TMessage, TServices, T>;
47
+ /** The typed message (job) payload the queue carries. */
48
+ message<T extends StandardSchemaV1>(schema: T): QueueBuilder<TName, T, TServices, TLogger>;
49
+ handle(fn: QueueHandler<NonNullable<TMessage>, TServices, TLogger>): Queue<TName, NonNullable<TMessage>, TServices, TLogger>;
50
+ }
51
+ /** A queue built without a name — only reachable by building one by hand. */
52
+ declare class QueueNeedsName extends Error {
53
+ constructor();
54
+ }
55
+ /** A queue whose message was never described. */
56
+ declare class QueueNeedsMessage extends Error {
57
+ readonly queue: string;
58
+ constructor(queue: string);
59
+ }
60
+ //#endregion
61
+ export { QueueNeedsMessage as n, QueueNeedsName as r, QueueBuilder as t };
62
+ //# sourceMappingURL=QueueBuilder-CM0WUxfw.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueBuilder-CM0WUxfw.d.mts","names":[],"sources":["../src/queue/QueueBuilder.ts"],"mappings":";;;;;;;;;;;;;cAoBa,aACZ,+BACA,iBAAiB,0CACjB,kBAAkB,gBAClB,gBAAgB,SAAS;UAEjB;UACA;UACA;UACA;UACA;UACA;;EAED;UACC;;EAED;;EAGP,MAAM,kBACL,MAAM,IACJ,aAAa,GAAG,UAAU,WAAW;EASxC,QAAQ;;EAKR,UAAU;;EAKV,KAAK;;;;;;;;;;;;EAeL,gBAAgB,mBAAmB,cAClC,YAAY,IACV,aAAa,OAAO,cAAc,cAAc,WAAW,KAAK;EAqBnE,SAAS,UAAU,WAClB,UAAU,IACR,aAAa,OAAO,cAAc,cAAc,IAAI;EAWvD,OAAO,UAAU,QAChB,QAAQ,IACN,aAAa,OAAO,UAAU,WAAW;;EAO5C,QAAQ,UAAU,kBACjB,QAAQ,IACN,aAAa,OAAO,GAAG,WAAW;EAMrC,OACC,IAAI,aAAa,YAAY,WAAW,WAAW,WACjD,MAAM,OAAO,YAAY,WAAW,WAAW;;;cA6BtC,uBAAuB;EACnC;;;cASY,0BAA0B;WACjB;EAArB,YAAqB"}
@@ -0,0 +1,62 @@
1
+ import { t as StandardSchemaV1 } from "./index-CeEtxDmK.cjs";
2
+ import { c as ServicesOf, r as Consumable } from "./construct-interface-_xi4BPN8.cjs";
3
+ import { r as QueueHandler, t as Queue } from "./Queue-CpQIGB_2.cjs";
4
+ import { Logger } from "@geekmidas/logger";
5
+ import { Service } from "@geekmidas/services";
6
+ //#region src/queue/QueueBuilder.d.ts
7
+ /**
8
+ * Builds a {@link Queue} and its one consumer. Reached through
9
+ * `worker.queue('orders')`, never constructed by hand: the worker stamps itself
10
+ * as the owner. `message` is the typed job payload and `handle` the consumer.
11
+ * The queue name is captured as a literal so `queue.service` publishes
12
+ * `{ type: '<name>', payload }`.
13
+ */
14
+ declare class QueueBuilder<TName extends string = string, TMessage extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger> {
15
+ private _name?;
16
+ private _messageSchema?;
17
+ private _timeout;
18
+ private _batchSize?;
19
+ private _fifo?;
20
+ private _services;
21
+ /** The construct ids `.dependsOn()` named — what the manifest records. */
22
+ _constructs: string[];
23
+ private _logger;
24
+ /** The worker that runs this queue's consumer — stamped by `worker.queue()`. */
25
+ _owner?: string;
26
+ /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
27
+ queue<T extends string>(name: T): QueueBuilder<T, TMessage, TServices, TLogger>;
28
+ timeout(timeout: number): this;
29
+ /** SQS event-source batch size (deployed). */
30
+ batchSize(batchSize: number): this;
31
+ /** Mark the queue as FIFO (deployed). */
32
+ fifo(fifo?: boolean): this;
33
+ /**
34
+ * Depend on constructs — a database, a bucket, a mail sender, a queue, a
35
+ * topic.
36
+ *
37
+ * It records the edge and dissolves each construct's client into the
38
+ * handler's service record under the construct's own id, so
39
+ * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
40
+ *
41
+ * Constructs only. A `Service` does not match the shape, which is what keeps
42
+ * env sniffing confined to `.services()` and the explicit lift.
43
+ */
44
+ dependsOn<const T extends readonly Consumable[]>(constructs: T): QueueBuilder<TName, TMessage, [...TServices, ...ServicesOf<T>], TLogger>;
45
+ services<T extends Service[]>(services: T): QueueBuilder<TName, TMessage, [...TServices, ...T], TLogger>;
46
+ logger<T extends Logger>(logger: T): QueueBuilder<TName, TMessage, TServices, T>;
47
+ /** The typed message (job) payload the queue carries. */
48
+ message<T extends StandardSchemaV1>(schema: T): QueueBuilder<TName, T, TServices, TLogger>;
49
+ handle(fn: QueueHandler<NonNullable<TMessage>, TServices, TLogger>): Queue<TName, NonNullable<TMessage>, TServices, TLogger>;
50
+ }
51
+ /** A queue built without a name — only reachable by building one by hand. */
52
+ declare class QueueNeedsName extends Error {
53
+ constructor();
54
+ }
55
+ /** A queue whose message was never described. */
56
+ declare class QueueNeedsMessage extends Error {
57
+ readonly queue: string;
58
+ constructor(queue: string);
59
+ }
60
+ //#endregion
61
+ export { QueueNeedsMessage as n, QueueNeedsName as r, QueueBuilder as t };
62
+ //# sourceMappingURL=QueueBuilder-XEnnOWGe.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueBuilder-XEnnOWGe.d.cts","names":[],"sources":["../src/queue/QueueBuilder.ts"],"mappings":";;;;;;;;;;;;;cAoBa,aACZ,+BACA,iBAAiB,0CACjB,kBAAkB,gBAClB,gBAAgB,SAAS;UAEjB;UACA;UACA;UACA;UACA;UACA;;EAED;UACC;;EAED;;EAGP,MAAM,kBACL,MAAM,IACJ,aAAa,GAAG,UAAU,WAAW;EASxC,QAAQ;;EAKR,UAAU;;EAKV,KAAK;;;;;;;;;;;;EAeL,gBAAgB,mBAAmB,cAClC,YAAY,IACV,aAAa,OAAO,cAAc,cAAc,WAAW,KAAK;EAqBnE,SAAS,UAAU,WAClB,UAAU,IACR,aAAa,OAAO,cAAc,cAAc,IAAI;EAWvD,OAAO,UAAU,QAChB,QAAQ,IACN,aAAa,OAAO,UAAU,WAAW;;EAO5C,QAAQ,UAAU,kBACjB,QAAQ,IACN,aAAa,OAAO,GAAG,WAAW;EAMrC,OACC,IAAI,aAAa,YAAY,WAAW,WAAW,WACjD,MAAM,OAAO,YAAY,WAAW,WAAW;;;cA6BtC,uBAAuB;EACnC;;;cASY,0BAA0B;WACjB;EAArB,YAAqB"}
@@ -0,0 +1,95 @@
1
+ import { idsOf, servicesOf } from "./construct-interface.mjs";
2
+ import { t as cloneWith } from "./clone-EKNovYHu.mjs";
3
+ import { t as Queue } from "./Queue-C1uDgjxt.mjs";
4
+ import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
5
+ //#region src/queue/QueueBuilder.ts
6
+ /**
7
+ * Builds a {@link Queue} and its one consumer. Reached through
8
+ * `worker.queue('orders')`, never constructed by hand: the worker stamps itself
9
+ * as the owner. `message` is the typed job payload and `handle` the consumer.
10
+ * The queue name is captured as a literal so `queue.service` publishes
11
+ * `{ type: '<name>', payload }`.
12
+ */
13
+ var QueueBuilder = class {
14
+ _name;
15
+ _messageSchema;
16
+ _timeout = 3e4;
17
+ _batchSize;
18
+ _fifo;
19
+ _services = [];
20
+ /** The construct ids `.dependsOn()` named — what the manifest records. */
21
+ _constructs = [];
22
+ _logger = DEFAULT_LOGGER;
23
+ /** The worker that runs this queue's consumer — stamped by `worker.queue()`. */
24
+ _owner;
25
+ /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
26
+ queue(name) {
27
+ return cloneWith(this, { _name: name });
28
+ }
29
+ timeout(timeout) {
30
+ return cloneWith(this, { _timeout: timeout });
31
+ }
32
+ /** SQS event-source batch size (deployed). */
33
+ batchSize(batchSize) {
34
+ return cloneWith(this, { _batchSize: batchSize });
35
+ }
36
+ /** Mark the queue as FIFO (deployed). */
37
+ fifo(fifo = true) {
38
+ return cloneWith(this, { _fifo: fifo });
39
+ }
40
+ /**
41
+ * Depend on constructs — a database, a bucket, a mail sender, a queue, a
42
+ * topic.
43
+ *
44
+ * It records the edge and dissolves each construct's client into the
45
+ * handler's service record under the construct's own id, so
46
+ * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
47
+ *
48
+ * Constructs only. A `Service` does not match the shape, which is what keeps
49
+ * env sniffing confined to `.services()` and the explicit lift.
50
+ */
51
+ dependsOn(constructs) {
52
+ const services = servicesOf(constructs);
53
+ return cloneWith(this, {
54
+ _services: [...this._services, ...services],
55
+ _constructs: idsOf(constructs, this._constructs)
56
+ });
57
+ }
58
+ services(services) {
59
+ return cloneWith(this, { _services: [...this._services, ...services] });
60
+ }
61
+ logger(logger) {
62
+ return cloneWith(this, { _logger: logger });
63
+ }
64
+ /** The typed message (job) payload the queue carries. */
65
+ message(schema) {
66
+ return cloneWith(this, { _messageSchema: schema });
67
+ }
68
+ handle(fn) {
69
+ if (!this._name) throw new QueueNeedsName();
70
+ if (!this._messageSchema) throw new QueueNeedsMessage(this._name);
71
+ const queue = new Queue(this._name, fn, this._messageSchema, this._timeout, this._services, this._logger, this._batchSize, this._fifo, this._constructs);
72
+ queue.owner = this._owner;
73
+ return queue;
74
+ }
75
+ };
76
+ /** A queue built without a name — only reachable by building one by hand. */
77
+ var QueueNeedsName = class extends Error {
78
+ constructor() {
79
+ super("A queue needs a name: build it from a worker, worker.queue('Emails').");
80
+ this.name = "QueueNeedsName";
81
+ }
82
+ };
83
+ /** A queue whose message was never described. */
84
+ var QueueNeedsMessage = class extends Error {
85
+ queue;
86
+ constructor(queue) {
87
+ super(`Queue '${queue}' has no message: call .message(schema) before .handle(), so its producers and its consumer agree on what it carries.`);
88
+ this.queue = queue;
89
+ this.name = "QueueNeedsMessage";
90
+ }
91
+ };
92
+ //#endregion
93
+ export { QueueNeedsMessage as n, QueueNeedsName as r, QueueBuilder as t };
94
+
95
+ //# sourceMappingURL=QueueBuilder-XuPKZwKH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueBuilder-XuPKZwKH.mjs","names":[],"sources":["../src/queue/QueueBuilder.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport type { Service } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { cloneWith } from '../clone';\nimport {\n\ttype Consumable,\n\tidsOf,\n\ttype ServicesOf,\n\tservicesOf,\n} from '../construct-interface';\nimport { Queue, type QueueHandler } from './Queue';\n\n/**\n * Builds a {@link Queue} and its one consumer. Reached through\n * `worker.queue('orders')`, never constructed by hand: the worker stamps itself\n * as the owner. `message` is the typed job payload and `handle` the consumer.\n * The queue name is captured as a literal so `queue.service` publishes\n * `{ type: '<name>', payload }`.\n */\nexport class QueueBuilder<\n\tTName extends string = string,\n\tTMessage extends StandardSchemaV1 | undefined = undefined,\n\tTServices extends Service[] = [],\n\tTLogger extends Logger = Logger,\n> {\n\tprivate _name?: string;\n\tprivate _messageSchema?: TMessage;\n\tprivate _timeout = 30000;\n\tprivate _batchSize?: number;\n\tprivate _fifo?: boolean;\n\tprivate _services: TServices = [] as Service[] as TServices;\n\t/** The construct ids `.dependsOn()` named — what the manifest records. */\n\tpublic _constructs: string[] = [];\n\tprivate _logger: TLogger = DEFAULT_LOGGER as TLogger;\n\t/** The worker that runs this queue's consumer — stamped by `worker.queue()`. */\n\tpublic _owner?: string;\n\n\t/** The queue name — drives the infra queue and its `<NAME>_*` env vars. */\n\tqueue<T extends string>(\n\t\tname: T,\n\t): QueueBuilder<T, TMessage, TServices, TLogger> {\n\t\treturn cloneWith(this, { _name: name }) as unknown as QueueBuilder<\n\t\t\tT,\n\t\t\tTMessage,\n\t\t\tTServices,\n\t\t\tTLogger\n\t\t>;\n\t}\n\n\ttimeout(timeout: number): this {\n\t\treturn cloneWith(this, { _timeout: timeout });\n\t}\n\n\t/** SQS event-source batch size (deployed). */\n\tbatchSize(batchSize: number): this {\n\t\treturn cloneWith(this, { _batchSize: batchSize });\n\t}\n\n\t/** Mark the queue as FIFO (deployed). */\n\tfifo(fifo = true): this {\n\t\treturn cloneWith(this, { _fifo: fifo });\n\t}\n\n\t/**\n\t * Depend on constructs — a database, a bucket, a mail sender, a queue, a\n\t * topic.\n\t *\n\t * It records the edge and dissolves each construct's client into the\n\t * handler's service record under the construct's own id, so\n\t * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.\n\t *\n\t * Constructs only. A `Service` does not match the shape, which is what keeps\n\t * env sniffing confined to `.services()` and the explicit lift.\n\t */\n\tdependsOn<const T extends readonly Consumable[]>(\n\t\tconstructs: T,\n\t): QueueBuilder<TName, TMessage, [...TServices, ...ServicesOf<T>], TLogger> {\n\t\t// Both halves of the edge, from one call and one clone: the services the\n\t\t// handler runs with, and the ids the manifest records. Recording them\n\t\t// separately is what let them drift apart.\n\t\t//\n\t\t// `servicesOf` is the half that validates, so it runs first — recording\n\t\t// ids ahead of it left a caught `NotAConstruct` with `undefined` already\n\t\t// on a `string[]`.\n\t\tconst services = servicesOf(constructs) as unknown as Service[];\n\n\t\treturn cloneWith(this, {\n\t\t\t_services: [...this._services, ...services],\n\t\t\t_constructs: idsOf(constructs, this._constructs),\n\t\t}) as unknown as QueueBuilder<\n\t\t\tTName,\n\t\t\tTMessage,\n\t\t\t[...TServices, ...ServicesOf<T>],\n\t\t\tTLogger\n\t\t>;\n\t}\n\n\tservices<T extends Service[]>(\n\t\tservices: T,\n\t): QueueBuilder<TName, TMessage, [...TServices, ...T], TLogger> {\n\t\treturn cloneWith(this, {\n\t\t\t_services: [...this._services, ...services] as unknown as TServices,\n\t\t}) as unknown as QueueBuilder<\n\t\t\tTName,\n\t\t\tTMessage,\n\t\t\t[...TServices, ...T],\n\t\t\tTLogger\n\t\t>;\n\t}\n\n\tlogger<T extends Logger>(\n\t\tlogger: T,\n\t): QueueBuilder<TName, TMessage, TServices, T> {\n\t\treturn cloneWith(this, {\n\t\t\t_logger: logger as unknown as TLogger,\n\t\t}) as unknown as QueueBuilder<TName, TMessage, TServices, T>;\n\t}\n\n\t/** The typed message (job) payload the queue carries. */\n\tmessage<T extends StandardSchemaV1>(\n\t\tschema: T,\n\t): QueueBuilder<TName, T, TServices, TLogger> {\n\t\treturn cloneWith(this, {\n\t\t\t_messageSchema: schema as unknown as TMessage,\n\t\t}) as unknown as QueueBuilder<TName, T, TServices, TLogger>;\n\t}\n\n\thandle(\n\t\tfn: QueueHandler<NonNullable<TMessage>, TServices, TLogger>,\n\t): Queue<TName, NonNullable<TMessage>, TServices, TLogger> {\n\t\tif (!this._name) throw new QueueNeedsName();\n\t\tif (!this._messageSchema) throw new QueueNeedsMessage(this._name);\n\n\t\tconst queue = new Queue<TName, NonNullable<TMessage>, TServices, TLogger>(\n\t\t\tthis._name as TName,\n\t\t\tfn,\n\t\t\tthis._messageSchema as NonNullable<TMessage>,\n\t\t\tthis._timeout,\n\t\t\tthis._services,\n\t\t\tthis._logger,\n\t\t\tthis._batchSize,\n\t\t\tthis._fifo,\n\t\t\tthis._constructs,\n\t\t);\n\t\t// Which process runs the consumer: the worker it was built from.\n\t\tqueue.owner = this._owner;\n\n\t\t// No reset. `.handle()` reads this builder and leaves it alone, so a\n\t\t// configured base — `const fn = f.logger(log).timeout(60_000)` — keeps\n\t\t// its configuration for every construct built from it. The reset that\n\t\t// used to be here wiped the base on first use, which made a base usable\n\t\t// exactly once, and quietly reverted the logger to the default.\n\n\t\treturn queue;\n\t}\n}\n\n/** A queue built without a name — only reachable by building one by hand. */\nexport class QueueNeedsName extends Error {\n\tconstructor() {\n\t\tsuper(\n\t\t\t\"A queue needs a name: build it from a worker, worker.queue('Emails').\",\n\t\t);\n\t\tthis.name = 'QueueNeedsName';\n\t}\n}\n\n/** A queue whose message was never described. */\nexport class QueueNeedsMessage extends Error {\n\tconstructor(readonly queue: string) {\n\t\tsuper(\n\t\t\t`Queue '${queue}' has no message: call .message(schema) before .handle(), ` +\n\t\t\t\t'so its producers and its consumer agree on what it carries.',\n\t\t);\n\t\tthis.name = 'QueueNeedsMessage';\n\t}\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAa,eAAb,MAKE;CACD;CACA;CACA,WAAmB;CACnB;CACA;CACA,YAA+B,CAAC;;CAEhC,cAA+B,CAAC;CAChC,UAA2B;;CAE3B;;CAGA,MACC,MACgD;EAChD,OAAO,UAAU,MAAM,EAAE,OAAO,KAAK,CAAC;CAMvC;CAEA,QAAQ,SAAuB;EAC9B,OAAO,UAAU,MAAM,EAAE,UAAU,QAAQ,CAAC;CAC7C;;CAGA,UAAU,WAAyB;EAClC,OAAO,UAAU,MAAM,EAAE,YAAY,UAAU,CAAC;CACjD;;CAGA,KAAK,OAAO,MAAY;EACvB,OAAO,UAAU,MAAM,EAAE,OAAO,KAAK,CAAC;CACvC;;;;;;;;;;;;CAaA,UACC,YAC2E;EAQ3E,MAAM,WAAW,WAAW,UAAU;EAEtC,OAAO,UAAU,MAAM;GACtB,WAAW,CAAC,GAAG,KAAK,WAAW,GAAG,QAAQ;GAC1C,aAAa,MAAM,YAAY,KAAK,WAAW;EAChD,CAAC;CAMF;CAEA,SACC,UAC+D;EAC/D,OAAO,UAAU,MAAM,EACtB,WAAW,CAAC,GAAG,KAAK,WAAW,GAAG,QAAQ,EAC3C,CAAC;CAMF;CAEA,OACC,QAC8C;EAC9C,OAAO,UAAU,MAAM,EACtB,SAAS,OACV,CAAC;CACF;;CAGA,QACC,QAC6C;EAC7C,OAAO,UAAU,MAAM,EACtB,gBAAgB,OACjB,CAAC;CACF;CAEA,OACC,IAC0D;EAC1D,IAAI,CAAC,KAAK,OAAO,MAAM,IAAI,eAAe;EAC1C,IAAI,CAAC,KAAK,gBAAgB,MAAM,IAAI,kBAAkB,KAAK,KAAK;EAEhE,MAAM,QAAQ,IAAI,MACjB,KAAK,OACL,IACA,KAAK,gBACL,KAAK,UACL,KAAK,WACL,KAAK,SACL,KAAK,YACL,KAAK,OACL,KAAK,WACN;EAEA,MAAM,QAAQ,KAAK;EAQnB,OAAO;CACR;AACD;;AAGA,IAAa,iBAAb,cAAoC,MAAM;CACzC,cAAc;EACb,MACC,uEACD;EACA,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,oBAAb,cAAuC,MAAM;CACvB;CAArB,YAAY,OAAwB;EACnC,MACC,UAAU,MAAM,sHAEjB;EAJoB,KAAA,QAAA;EAKpB,KAAK,OAAO;CACb;AACD"}