@geekmidas/constructs 10.0.0-alpha.16 → 10.0.0-alpha.161

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 (485) hide show
  1. package/README.md +246 -158
  2. package/dist/Construct-127M7yrl.d.cts +231 -0
  3. package/dist/Construct-127M7yrl.d.cts.map +1 -0
  4. package/dist/Construct-BMk_CRSD.d.mts +231 -0
  5. package/dist/Construct-BMk_CRSD.d.mts.map +1 -0
  6. package/dist/{Construct-BeYVu_QF.mjs → Construct-CGuc_Ijk.mjs} +8 -9
  7. package/dist/Construct-CGuc_Ijk.mjs.map +1 -0
  8. package/dist/{Construct-DqdlARxq.cjs → Construct-DorKS0Ua.cjs} +8 -9
  9. package/dist/Construct-DorKS0Ua.cjs.map +1 -0
  10. package/dist/{Cron-l4Wlz6G9.d.mts → Cron-D6Y7BBt3.d.mts} +15 -8
  11. package/dist/Cron-D6Y7BBt3.d.mts.map +1 -0
  12. package/dist/{Cron-zsoSAwZo.d.cts → Cron-D_sfaMGz.d.cts} +14 -7
  13. package/dist/Cron-D_sfaMGz.d.cts.map +1 -0
  14. package/dist/CronBuilder-4BZhkChG.d.mts +47 -0
  15. package/dist/CronBuilder-4BZhkChG.d.mts.map +1 -0
  16. package/dist/{CronBuilder-D_0HNBTr.mjs → CronBuilder-BJ5LoadF.mjs} +28 -11
  17. package/dist/CronBuilder-BJ5LoadF.mjs.map +1 -0
  18. package/dist/{CronBuilder-BdnI6lxF.cjs → CronBuilder-B_NSP-Y5.cjs} +27 -10
  19. package/dist/CronBuilder-B_NSP-Y5.cjs.map +1 -0
  20. package/dist/CronBuilder-C91MVLSr.d.cts +47 -0
  21. package/dist/CronBuilder-C91MVLSr.d.cts.map +1 -0
  22. package/dist/Endpoint-52z1P0Ue.cjs +581 -0
  23. package/dist/Endpoint-52z1P0Ue.cjs.map +1 -0
  24. package/dist/{Endpoint-oS-Fe3d_.d.mts → Endpoint-BUoDD96P.d.mts} +104 -23
  25. package/dist/Endpoint-BUoDD96P.d.mts.map +1 -0
  26. package/dist/{Endpoint-DBflWAe4.d.cts → Endpoint-YYwjqtS1.d.cts} +101 -20
  27. package/dist/Endpoint-YYwjqtS1.d.cts.map +1 -0
  28. package/dist/Endpoint-sUOU7uLx.mjs +552 -0
  29. package/dist/Endpoint-sUOU7uLx.mjs.map +1 -0
  30. package/dist/{index-Cc4kKPag.d.mts → EndpointFactory-BbVOeryo.d.mts} +189 -106
  31. package/dist/EndpointFactory-BbVOeryo.d.mts.map +1 -0
  32. package/dist/{EndpointFactory-Bm3aKRdV.mjs → EndpointFactory-Bzi9Sl7r.mjs} +269 -53
  33. package/dist/EndpointFactory-Bzi9Sl7r.mjs.map +1 -0
  34. package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-Cf_Cs1ym.cjs} +309 -51
  35. package/dist/EndpointFactory-Cf_Cs1ym.cjs.map +1 -0
  36. package/dist/{index-C1ZwNOOk.d.cts → EndpointFactory-Hh1r6J_C.d.cts} +187 -104
  37. package/dist/EndpointFactory-Hh1r6J_C.d.cts.map +1 -0
  38. package/dist/Function-BIEsY0Hm.d.cts +76 -0
  39. package/dist/Function-BIEsY0Hm.d.cts.map +1 -0
  40. package/dist/Function-BKReud5p.d.mts +76 -0
  41. package/dist/Function-BKReud5p.d.mts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-92zavCsV.cjs → HonoEndpointAdaptor-BTbqfSaa.cjs} +115 -41
  43. package/dist/HonoEndpointAdaptor-BTbqfSaa.cjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-yYaU7jVJ.mjs → HonoEndpointAdaptor-CBVey2cY.mjs} +112 -38
  45. package/dist/HonoEndpointAdaptor-CBVey2cY.mjs.map +1 -0
  46. package/dist/ObjectSubscriberBuilder-DfzXQEKW.d.mts +129 -0
  47. package/dist/ObjectSubscriberBuilder-DfzXQEKW.d.mts.map +1 -0
  48. package/dist/ObjectSubscriberBuilder-LWkey_oq.d.cts +129 -0
  49. package/dist/ObjectSubscriberBuilder-LWkey_oq.d.cts.map +1 -0
  50. package/dist/ProcessorBuilder-D4oYvZeG.d.mts +216 -0
  51. package/dist/ProcessorBuilder-D4oYvZeG.d.mts.map +1 -0
  52. package/dist/ProcessorBuilder-_jdZlbfW.d.cts +216 -0
  53. package/dist/ProcessorBuilder-_jdZlbfW.d.cts.map +1 -0
  54. package/dist/{Queue-D9X6OoON.d.mts → Queue-B8HGg439.d.mts} +42 -41
  55. package/dist/Queue-B8HGg439.d.mts.map +1 -0
  56. package/dist/{Queue-DYPB2KWL.d.cts → Queue-C4rijiM7.d.cts} +43 -42
  57. package/dist/Queue-C4rijiM7.d.cts.map +1 -0
  58. package/dist/Queue-D4Iaidrs.cjs +109 -0
  59. package/dist/Queue-D4Iaidrs.cjs.map +1 -0
  60. package/dist/Queue-u8w8_HpE.mjs +104 -0
  61. package/dist/Queue-u8w8_HpE.mjs.map +1 -0
  62. package/dist/QueueBuilder-2wP5lEC8.mjs +118 -0
  63. package/dist/QueueBuilder-2wP5lEC8.mjs.map +1 -0
  64. package/dist/QueueBuilder-BxsZ9o5z.cjs +135 -0
  65. package/dist/QueueBuilder-BxsZ9o5z.cjs.map +1 -0
  66. package/dist/QueueBuilder-CVS_qPuo.d.mts +75 -0
  67. package/dist/QueueBuilder-CVS_qPuo.d.mts.map +1 -0
  68. package/dist/QueueBuilder-SQli59An.d.cts +75 -0
  69. package/dist/QueueBuilder-SQli59An.d.cts.map +1 -0
  70. package/dist/Subscriber-5rCX1Nph.d.cts +83 -0
  71. package/dist/Subscriber-5rCX1Nph.d.cts.map +1 -0
  72. package/dist/Subscriber-CtQXhcL7.d.mts +83 -0
  73. package/dist/Subscriber-CtQXhcL7.d.mts.map +1 -0
  74. package/dist/SubscriberBuilder-CpFhShTJ.mjs +238 -0
  75. package/dist/SubscriberBuilder-CpFhShTJ.mjs.map +1 -0
  76. package/dist/SubscriberBuilder-DJEvNRdD.cjs +261 -0
  77. package/dist/SubscriberBuilder-DJEvNRdD.cjs.map +1 -0
  78. package/dist/Topic-DN2gYJ-p.mjs +99 -0
  79. package/dist/Topic-DN2gYJ-p.mjs.map +1 -0
  80. package/dist/Topic-Dp9Q7Lj2.cjs +104 -0
  81. package/dist/Topic-Dp9Q7Lj2.cjs.map +1 -0
  82. package/dist/adaptors/aws.cjs +147 -168
  83. package/dist/adaptors/aws.cjs.map +1 -1
  84. package/dist/adaptors/aws.d.cts +57 -48
  85. package/dist/adaptors/aws.d.cts.map +1 -1
  86. package/dist/adaptors/aws.d.mts +58 -49
  87. package/dist/adaptors/aws.d.mts.map +1 -1
  88. package/dist/adaptors/aws.mjs +142 -164
  89. package/dist/adaptors/aws.mjs.map +1 -1
  90. package/dist/adaptors/awsWebsocket.cjs +354 -0
  91. package/dist/adaptors/awsWebsocket.cjs.map +1 -0
  92. package/dist/adaptors/awsWebsocket.d.cts +156 -0
  93. package/dist/adaptors/awsWebsocket.d.cts.map +1 -0
  94. package/dist/adaptors/awsWebsocket.d.mts +156 -0
  95. package/dist/adaptors/awsWebsocket.d.mts.map +1 -0
  96. package/dist/adaptors/awsWebsocket.mjs +347 -0
  97. package/dist/adaptors/awsWebsocket.mjs.map +1 -0
  98. package/dist/adaptors/hono.cjs +1 -1
  99. package/dist/adaptors/hono.d.cts +8 -7
  100. package/dist/adaptors/hono.d.cts.map +1 -1
  101. package/dist/adaptors/hono.d.mts +10 -9
  102. package/dist/adaptors/hono.d.mts.map +1 -1
  103. package/dist/adaptors/hono.mjs +1 -1
  104. package/dist/adaptors/testing.cjs +1174 -41
  105. package/dist/adaptors/testing.cjs.map +1 -1
  106. package/dist/adaptors/testing.d.cts +517 -40
  107. package/dist/adaptors/testing.d.cts.map +1 -1
  108. package/dist/adaptors/testing.d.mts +517 -40
  109. package/dist/adaptors/testing.d.mts.map +1 -1
  110. package/dist/adaptors/testing.mjs +1140 -36
  111. package/dist/adaptors/testing.mjs.map +1 -1
  112. package/dist/auth-BqWz2JxC.d.cts +274 -0
  113. package/dist/auth-BqWz2JxC.d.cts.map +1 -0
  114. package/dist/auth-DnB9H9KL.d.mts +274 -0
  115. package/dist/auth-DnB9H9KL.d.mts.map +1 -0
  116. package/dist/auth.cjs +308 -23
  117. package/dist/auth.cjs.map +1 -1
  118. package/dist/auth.d.cts +2 -104
  119. package/dist/auth.d.mts +2 -104
  120. package/dist/auth.mjs +304 -25
  121. package/dist/auth.mjs.map +1 -1
  122. package/dist/cache-CCHcO9Oo.d.mts +44 -0
  123. package/dist/cache-CCHcO9Oo.d.mts.map +1 -0
  124. package/dist/cache-CQjMNPrC.d.cts +44 -0
  125. package/dist/cache-CQjMNPrC.d.cts.map +1 -0
  126. package/dist/cache.cjs +3 -19
  127. package/dist/cache.cjs.map +1 -1
  128. package/dist/cache.d.cts +2 -43
  129. package/dist/cache.d.mts +2 -43
  130. package/dist/cache.mjs +2 -18
  131. package/dist/cache.mjs.map +1 -1
  132. package/dist/cipher-C1lEFX63.mjs +225 -0
  133. package/dist/cipher-C1lEFX63.mjs.map +1 -0
  134. package/dist/cipher-CVxfwLjk.cjs +332 -0
  135. package/dist/cipher-CVxfwLjk.cjs.map +1 -0
  136. package/dist/cipher-DSDxPRIp.d.cts +106 -0
  137. package/dist/cipher-DSDxPRIp.d.cts.map +1 -0
  138. package/dist/cipher-DSDxPRIp.d.mts +106 -0
  139. package/dist/cipher-DSDxPRIp.d.mts.map +1 -0
  140. package/dist/{construct-interface-DPlxfpoS.d.mts → construct-interface-CSA9VeWM.d.mts} +47 -8
  141. package/dist/construct-interface-CSA9VeWM.d.mts.map +1 -0
  142. package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-DugP0E5q.d.cts} +47 -8
  143. package/dist/construct-interface-DugP0E5q.d.cts.map +1 -0
  144. package/dist/construct-interface.cjs +38 -4
  145. package/dist/construct-interface.cjs.map +1 -1
  146. package/dist/construct-interface.d.cts +2 -2
  147. package/dist/construct-interface.d.mts +2 -2
  148. package/dist/construct-interface.mjs +37 -5
  149. package/dist/construct-interface.mjs.map +1 -1
  150. package/dist/credential-DYymbp_7.cjs +257 -0
  151. package/dist/credential-DYymbp_7.cjs.map +1 -0
  152. package/dist/credential-DfSAOOdY.mjs +222 -0
  153. package/dist/credential-DfSAOOdY.mjs.map +1 -0
  154. package/dist/credential.cjs +7 -129
  155. package/dist/credential.d.cts +2 -58
  156. package/dist/credential.d.mts +2 -58
  157. package/dist/credential.mjs +2 -128
  158. package/dist/crons/index.cjs +127 -1
  159. package/dist/crons/index.cjs.map +1 -1
  160. package/dist/crons/index.d.cts +43 -3
  161. package/dist/crons/index.d.cts.map +1 -1
  162. package/dist/crons/index.d.mts +43 -3
  163. package/dist/crons/index.d.mts.map +1 -1
  164. package/dist/crons/index.mjs +126 -2
  165. package/dist/crons/index.mjs.map +1 -1
  166. package/dist/database/kysely.cjs +3 -194
  167. package/dist/database/kysely.d.cts +2 -149
  168. package/dist/database/kysely.d.mts +2 -149
  169. package/dist/database/kysely.mjs +2 -192
  170. package/dist/email.cjs +4 -16
  171. package/dist/email.cjs.map +1 -1
  172. package/dist/email.d.cts +1 -1
  173. package/dist/email.d.cts.map +1 -1
  174. package/dist/email.d.mts +2 -2
  175. package/dist/email.d.mts.map +1 -1
  176. package/dist/email.mjs +2 -14
  177. package/dist/email.mjs.map +1 -1
  178. package/dist/encryption/kms.cjs +95 -0
  179. package/dist/encryption/kms.cjs.map +1 -0
  180. package/dist/encryption/kms.d.cts +7 -0
  181. package/dist/encryption/kms.d.cts.map +1 -0
  182. package/dist/encryption/kms.d.mts +7 -0
  183. package/dist/encryption/kms.d.mts.map +1 -0
  184. package/dist/encryption/kms.mjs +93 -0
  185. package/dist/encryption/kms.mjs.map +1 -0
  186. package/dist/encryption.cjs +116 -0
  187. package/dist/encryption.cjs.map +1 -0
  188. package/dist/encryption.d.cts +37 -0
  189. package/dist/encryption.d.cts.map +1 -0
  190. package/dist/encryption.d.mts +37 -0
  191. package/dist/encryption.d.mts.map +1 -0
  192. package/dist/encryption.mjs +101 -0
  193. package/dist/encryption.mjs.map +1 -0
  194. package/dist/endpoints/index.cjs +32 -10
  195. package/dist/endpoints/index.d.cts +106 -3
  196. package/dist/endpoints/index.d.cts.map +1 -0
  197. package/dist/endpoints/index.d.mts +106 -3
  198. package/dist/endpoints/index.d.mts.map +1 -0
  199. package/dist/endpoints/index.mjs +6 -4
  200. package/dist/expire-C586zznE.d.cts +38 -0
  201. package/dist/expire-C586zznE.d.cts.map +1 -0
  202. package/dist/expire-C586zznE.d.mts +38 -0
  203. package/dist/expire-C586zznE.d.mts.map +1 -0
  204. package/dist/expire-CieftS01.cjs +67 -0
  205. package/dist/expire-CieftS01.cjs.map +1 -0
  206. package/dist/expire-CpzUAfr9.mjs +50 -0
  207. package/dist/expire-CpzUAfr9.mjs.map +1 -0
  208. package/dist/external-api.cjs +106 -0
  209. package/dist/external-api.cjs.map +1 -0
  210. package/dist/external-api.d.cts +2 -0
  211. package/dist/external-api.d.mts +2 -0
  212. package/dist/external-api.mjs +103 -0
  213. package/dist/external-api.mjs.map +1 -0
  214. package/dist/fake-BqhP8RRQ.d.mts +201 -0
  215. package/dist/fake-BqhP8RRQ.d.mts.map +1 -0
  216. package/dist/fake-DqieDYYA.d.cts +201 -0
  217. package/dist/fake-DqieDYYA.d.cts.map +1 -0
  218. package/dist/file-server.cjs +123 -30
  219. package/dist/file-server.cjs.map +1 -1
  220. package/dist/file-server.d.cts +115 -1
  221. package/dist/file-server.d.cts.map +1 -1
  222. package/dist/file-server.d.mts +115 -1
  223. package/dist/file-server.d.mts.map +1 -1
  224. package/dist/file-server.mjs +122 -32
  225. package/dist/file-server.mjs.map +1 -1
  226. package/dist/functions/index.cjs +1 -1
  227. package/dist/functions/index.d.cts +2 -1
  228. package/dist/functions/index.d.mts +2 -1
  229. package/dist/functions/index.mjs +1 -1
  230. package/dist/{functions-C53GW2eQ.mjs → functions-BvIDQKAA.mjs} +117 -22
  231. package/dist/functions-BvIDQKAA.mjs.map +1 -0
  232. package/dist/{functions-B6qCvfmy.cjs → functions-DLF6-IK8.cjs} +122 -18
  233. package/dist/functions-DLF6-IK8.cjs.map +1 -0
  234. package/dist/inbox-CR3L1fOI.d.cts +195 -0
  235. package/dist/inbox-CR3L1fOI.d.cts.map +1 -0
  236. package/dist/inbox-YOdxlyfj.d.mts +195 -0
  237. package/dist/inbox-YOdxlyfj.d.mts.map +1 -0
  238. package/dist/inbox.cjs +291 -0
  239. package/dist/inbox.cjs.map +1 -0
  240. package/dist/inbox.d.cts +2 -0
  241. package/dist/inbox.d.mts +2 -0
  242. package/dist/inbox.mjs +283 -0
  243. package/dist/inbox.mjs.map +1 -0
  244. package/dist/index-BoQ3-M-K.d.mts +115 -0
  245. package/dist/index-BoQ3-M-K.d.mts.map +1 -0
  246. package/dist/index-DPTHa6Ud.d.cts +115 -0
  247. package/dist/index-DPTHa6Ud.d.cts.map +1 -0
  248. package/dist/{index-CeEtxDmK.d.cts → index-DdRjYhiJ.d.cts} +42 -2
  249. package/dist/{index-CeEtxDmK.d.cts.map → index-DdRjYhiJ.d.cts.map} +1 -1
  250. package/dist/{index-CeEtxDmK.d.mts → index-DdRjYhiJ.d.mts} +42 -2
  251. package/dist/{index-CeEtxDmK.d.mts.map → index-DdRjYhiJ.d.mts.map} +1 -1
  252. package/dist/index.cjs +4 -1
  253. package/dist/index.d.cts +26 -3
  254. package/dist/index.d.cts.map +1 -0
  255. package/dist/index.d.mts +26 -3
  256. package/dist/index.d.mts.map +1 -0
  257. package/dist/index.mjs +3 -2
  258. package/dist/kysely-CebjCWTl.d.cts +216 -0
  259. package/dist/kysely-CebjCWTl.d.cts.map +1 -0
  260. package/dist/kysely-Cs4uPO8k.mjs +371 -0
  261. package/dist/kysely-Cs4uPO8k.mjs.map +1 -0
  262. package/dist/kysely-CukArHJ0.cjs +384 -0
  263. package/dist/kysely-CukArHJ0.cjs.map +1 -0
  264. package/dist/kysely-De5rAC-E.d.mts +216 -0
  265. package/dist/kysely-De5rAC-E.d.mts.map +1 -0
  266. package/dist/{telemetry-DGcFlVpB.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +2 -2
  267. package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
  268. package/dist/{telemetry-DGcFlVpB.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +2 -2
  269. package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
  270. package/dist/mobile-app.cjs +74 -0
  271. package/dist/mobile-app.cjs.map +1 -0
  272. package/dist/mobile-app.d.cts +73 -0
  273. package/dist/mobile-app.d.cts.map +1 -0
  274. package/dist/mobile-app.d.mts +73 -0
  275. package/dist/mobile-app.d.mts.map +1 -0
  276. package/dist/mobile-app.mjs +73 -0
  277. package/dist/mobile-app.mjs.map +1 -0
  278. package/dist/object-storage.cjs +8 -1
  279. package/dist/object-storage.cjs.map +1 -1
  280. package/dist/object-storage.d.cts +10 -1
  281. package/dist/object-storage.d.cts.map +1 -1
  282. package/dist/object-storage.d.mts +10 -1
  283. package/dist/object-storage.d.mts.map +1 -1
  284. package/dist/object-storage.mjs +7 -2
  285. package/dist/object-storage.mjs.map +1 -1
  286. package/dist/optionalPeers-D7Wt6dnF.mjs +140 -0
  287. package/dist/optionalPeers-D7Wt6dnF.mjs.map +1 -0
  288. package/dist/optionalPeers-DuNQXXe1.cjs +223 -0
  289. package/dist/optionalPeers-DuNQXXe1.cjs.map +1 -0
  290. package/dist/origins-BjxYht13.cjs +96 -0
  291. package/dist/origins-BjxYht13.cjs.map +1 -0
  292. package/dist/origins-Boc9qbo-.mjs +73 -0
  293. package/dist/origins-Boc9qbo-.mjs.map +1 -0
  294. package/dist/pattern-C1CEcglD.mjs +241 -0
  295. package/dist/pattern-C1CEcglD.mjs.map +1 -0
  296. package/dist/pattern-QFaUIr77.cjs +288 -0
  297. package/dist/pattern-QFaUIr77.cjs.map +1 -0
  298. package/dist/privateAddress-Bg5fUsbp.mjs +21 -0
  299. package/dist/privateAddress-Bg5fUsbp.mjs.map +1 -0
  300. package/dist/privateAddress-CqGyuFHn.cjs +26 -0
  301. package/dist/privateAddress-CqGyuFHn.cjs.map +1 -0
  302. package/dist/processors/index.cjs +214 -0
  303. package/dist/processors/index.cjs.map +1 -0
  304. package/dist/processors/index.d.cts +78 -0
  305. package/dist/processors/index.d.cts.map +1 -0
  306. package/dist/processors/index.d.mts +78 -0
  307. package/dist/processors/index.d.mts.map +1 -0
  308. package/dist/processors/index.mjs +193 -0
  309. package/dist/processors/index.mjs.map +1 -0
  310. package/dist/queue/index.cjs +5 -192
  311. package/dist/queue/index.d.cts +3 -53
  312. package/dist/queue/index.d.mts +3 -53
  313. package/dist/queue/index.mjs +3 -190
  314. package/dist/random-password.cjs +86 -0
  315. package/dist/random-password.cjs.map +1 -0
  316. package/dist/random-password.d.cts +30 -0
  317. package/dist/random-password.d.cts.map +1 -0
  318. package/dist/random-password.d.mts +30 -0
  319. package/dist/random-password.d.mts.map +1 -0
  320. package/dist/random-password.mjs +84 -0
  321. package/dist/random-password.mjs.map +1 -0
  322. package/dist/readRequestBody-BmKnPl0a.mjs +293 -0
  323. package/dist/readRequestBody-BmKnPl0a.mjs.map +1 -0
  324. package/dist/{lazyAccessors-Dx9NLwJZ.cjs → readRequestBody-CN9GVdeE.cjs} +141 -47
  325. package/dist/readRequestBody-CN9GVdeE.cjs.map +1 -0
  326. package/dist/{processAudits-D_2W5x8k.cjs → requestLogger-CnoYd-Ah.cjs} +63 -3
  327. package/dist/requestLogger-CnoYd-Ah.cjs.map +1 -0
  328. package/dist/{processAudits-BpRlPQMW.mjs → requestLogger-D2JS7pPM.mjs} +51 -3
  329. package/dist/requestLogger-D2JS7pPM.mjs.map +1 -0
  330. package/dist/rest-api.cjs +85 -70
  331. package/dist/rest-api.cjs.map +1 -1
  332. package/dist/rest-api.d.cts +77 -59
  333. package/dist/rest-api.d.cts.map +1 -1
  334. package/dist/rest-api.d.mts +77 -59
  335. package/dist/rest-api.d.mts.map +1 -1
  336. package/dist/rest-api.mjs +87 -72
  337. package/dist/rest-api.mjs.map +1 -1
  338. package/dist/runSubscriber-HEqXkin1.mjs +117 -0
  339. package/dist/runSubscriber-HEqXkin1.mjs.map +1 -0
  340. package/dist/runSubscriber-sVJfLA0-.cjs +134 -0
  341. package/dist/runSubscriber-sVJfLA0-.cjs.map +1 -0
  342. package/dist/shutdown-BMJmAhSt.cjs +38 -0
  343. package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
  344. package/dist/shutdown-C7xa8x9S.mjs +27 -0
  345. package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
  346. package/dist/site.cjs +104 -8
  347. package/dist/site.cjs.map +1 -1
  348. package/dist/site.d.cts +132 -2
  349. package/dist/site.d.cts.map +1 -1
  350. package/dist/site.d.mts +132 -2
  351. package/dist/site.d.mts.map +1 -1
  352. package/dist/site.mjs +102 -11
  353. package/dist/site.mjs.map +1 -1
  354. package/dist/stages-DaTaoQei.d.cts +73 -0
  355. package/dist/stages-DaTaoQei.d.cts.map +1 -0
  356. package/dist/stages-DaTaoQei.d.mts +73 -0
  357. package/dist/stages-DaTaoQei.d.mts.map +1 -0
  358. package/dist/subscribers/index.cjs +134 -1
  359. package/dist/subscribers/index.cjs.map +1 -0
  360. package/dist/subscribers/index.d.cts +74 -3
  361. package/dist/subscribers/index.d.cts.map +1 -0
  362. package/dist/subscribers/index.d.mts +74 -3
  363. package/dist/subscribers/index.d.mts.map +1 -0
  364. package/dist/subscribers/index.mjs +132 -2
  365. package/dist/subscribers/index.mjs.map +1 -0
  366. package/dist/telemetry-C1oqncFY.d.cts +40 -0
  367. package/dist/telemetry-C1oqncFY.d.cts.map +1 -0
  368. package/dist/telemetry-CObow3Dn.d.mts +40 -0
  369. package/dist/telemetry-CObow3Dn.d.mts.map +1 -0
  370. package/dist/telemetry.cjs +56 -0
  371. package/dist/telemetry.cjs.map +1 -0
  372. package/dist/telemetry.d.cts +2 -0
  373. package/dist/telemetry.d.mts +2 -0
  374. package/dist/telemetry.mjs +55 -0
  375. package/dist/telemetry.mjs.map +1 -0
  376. package/dist/topic/index.cjs +2 -134
  377. package/dist/topic/index.d.cts +2 -3
  378. package/dist/topic/index.d.mts +2 -3
  379. package/dist/topic/index.mjs +2 -132
  380. package/dist/tracing-Bbj1uoFJ.mjs +127 -0
  381. package/dist/tracing-Bbj1uoFJ.mjs.map +1 -0
  382. package/dist/tracing-C0ooU0V2.cjs +150 -0
  383. package/dist/tracing-C0ooU0V2.cjs.map +1 -0
  384. package/dist/websocket-api-Bg9SowJ5.mjs +1710 -0
  385. package/dist/websocket-api-Bg9SowJ5.mjs.map +1 -0
  386. package/dist/websocket-api-CPEzJyDt.d.mts +1201 -0
  387. package/dist/websocket-api-CPEzJyDt.d.mts.map +1 -0
  388. package/dist/websocket-api-DkF8Hva-.d.cts +1201 -0
  389. package/dist/websocket-api-DkF8Hva-.d.cts.map +1 -0
  390. package/dist/websocket-api-czxhekGG.cjs +1889 -0
  391. package/dist/websocket-api-czxhekGG.cjs.map +1 -0
  392. package/dist/websocket-api.cjs +35 -0
  393. package/dist/websocket-api.d.cts +2 -0
  394. package/dist/websocket-api.d.mts +2 -0
  395. package/dist/websocket-api.mjs +3 -0
  396. package/dist/worker.cjs +174 -32
  397. package/dist/worker.cjs.map +1 -1
  398. package/dist/worker.d.cts +147 -47
  399. package/dist/worker.d.cts.map +1 -1
  400. package/dist/worker.d.mts +147 -47
  401. package/dist/worker.d.mts.map +1 -1
  402. package/dist/worker.mjs +175 -33
  403. package/dist/worker.mjs.map +1 -1
  404. package/package.json +180 -43
  405. package/dist/Construct-BeYVu_QF.mjs.map +0 -1
  406. package/dist/Construct-DfbwIntp.d.cts +0 -115
  407. package/dist/Construct-DfbwIntp.d.cts.map +0 -1
  408. package/dist/Construct-DqdlARxq.cjs.map +0 -1
  409. package/dist/Construct-l5aOn_jv.d.mts +0 -115
  410. package/dist/Construct-l5aOn_jv.d.mts.map +0 -1
  411. package/dist/Cron-l4Wlz6G9.d.mts.map +0 -1
  412. package/dist/Cron-zsoSAwZo.d.cts.map +0 -1
  413. package/dist/CronBuilder-BdnI6lxF.cjs.map +0 -1
  414. package/dist/CronBuilder-CyT71Nzg.d.cts +0 -41
  415. package/dist/CronBuilder-CyT71Nzg.d.cts.map +0 -1
  416. package/dist/CronBuilder-D_0HNBTr.mjs.map +0 -1
  417. package/dist/CronBuilder-UoNgFe8S.d.mts +0 -41
  418. package/dist/CronBuilder-UoNgFe8S.d.mts.map +0 -1
  419. package/dist/Endpoint-BpZHtJ2W.cjs +0 -1689
  420. package/dist/Endpoint-BpZHtJ2W.cjs.map +0 -1
  421. package/dist/Endpoint-DBflWAe4.d.cts.map +0 -1
  422. package/dist/Endpoint-ONsly_dq.mjs +0 -1671
  423. package/dist/Endpoint-ONsly_dq.mjs.map +0 -1
  424. package/dist/Endpoint-oS-Fe3d_.d.mts.map +0 -1
  425. package/dist/EndpointFactory-Bm3aKRdV.mjs.map +0 -1
  426. package/dist/EndpointFactory-CLvWuHyt.cjs.map +0 -1
  427. package/dist/HonoEndpointAdaptor-92zavCsV.cjs.map +0 -1
  428. package/dist/HonoEndpointAdaptor-yYaU7jVJ.mjs.map +0 -1
  429. package/dist/Queue-D9X6OoON.d.mts.map +0 -1
  430. package/dist/Queue-DYPB2KWL.d.cts.map +0 -1
  431. package/dist/Subscriber-C4heaAyO.d.mts +0 -51
  432. package/dist/Subscriber-C4heaAyO.d.mts.map +0 -1
  433. package/dist/Subscriber-CotDUELC.d.cts +0 -51
  434. package/dist/Subscriber-CotDUELC.d.cts.map +0 -1
  435. package/dist/SubscriberBuilder-BEv0eoHy.d.cts +0 -59
  436. package/dist/SubscriberBuilder-BEv0eoHy.d.cts.map +0 -1
  437. package/dist/SubscriberBuilder-C0ZEtGDI.cjs +0 -125
  438. package/dist/SubscriberBuilder-C0ZEtGDI.cjs.map +0 -1
  439. package/dist/SubscriberBuilder-h7B_cHMr.mjs +0 -114
  440. package/dist/SubscriberBuilder-h7B_cHMr.mjs.map +0 -1
  441. package/dist/SubscriberBuilder-tyH5yTk5.d.mts +0 -59
  442. package/dist/SubscriberBuilder-tyH5yTk5.d.mts.map +0 -1
  443. package/dist/Topic-DEVGo0Dm.d.cts +0 -89
  444. package/dist/Topic-DEVGo0Dm.d.cts.map +0 -1
  445. package/dist/Topic-zk_6Gthr.d.mts +0 -89
  446. package/dist/Topic-zk_6Gthr.d.mts.map +0 -1
  447. package/dist/auth.d.cts.map +0 -1
  448. package/dist/auth.d.mts.map +0 -1
  449. package/dist/cache.d.cts.map +0 -1
  450. package/dist/cache.d.mts.map +0 -1
  451. package/dist/construct-interface-DPlxfpoS.d.mts.map +0 -1
  452. package/dist/construct-interface-DgXTJcOD.d.cts.map +0 -1
  453. package/dist/credential.cjs.map +0 -1
  454. package/dist/credential.d.cts.map +0 -1
  455. package/dist/credential.d.mts.map +0 -1
  456. package/dist/credential.mjs.map +0 -1
  457. package/dist/database/kysely.cjs.map +0 -1
  458. package/dist/database/kysely.d.cts.map +0 -1
  459. package/dist/database/kysely.d.mts.map +0 -1
  460. package/dist/database/kysely.mjs.map +0 -1
  461. package/dist/functions-B6qCvfmy.cjs.map +0 -1
  462. package/dist/functions-C53GW2eQ.mjs.map +0 -1
  463. package/dist/index-B2urf3YI.d.cts +0 -26
  464. package/dist/index-B2urf3YI.d.cts.map +0 -1
  465. package/dist/index-C1ZwNOOk.d.cts.map +0 -1
  466. package/dist/index-Cc4kKPag.d.mts.map +0 -1
  467. package/dist/index-DMCDvnsM.d.mts +0 -26
  468. package/dist/index-DMCDvnsM.d.mts.map +0 -1
  469. package/dist/index-D_frT6MP.d.cts +0 -165
  470. package/dist/index-D_frT6MP.d.cts.map +0 -1
  471. package/dist/index-DcyIYbDS.d.mts +0 -165
  472. package/dist/index-DcyIYbDS.d.mts.map +0 -1
  473. package/dist/lazyAccessors-BHtcqgz2.mjs +0 -211
  474. package/dist/lazyAccessors-BHtcqgz2.mjs.map +0 -1
  475. package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +0 -1
  476. package/dist/processAudits-BpRlPQMW.mjs.map +0 -1
  477. package/dist/processAudits-D_2W5x8k.cjs.map +0 -1
  478. package/dist/queue/index.cjs.map +0 -1
  479. package/dist/queue/index.d.cts.map +0 -1
  480. package/dist/queue/index.d.mts.map +0 -1
  481. package/dist/queue/index.mjs.map +0 -1
  482. package/dist/telemetry-DGcFlVpB.d.cts.map +0 -1
  483. package/dist/telemetry-DGcFlVpB.d.mts.map +0 -1
  484. package/dist/topic/index.cjs.map +0 -1
  485. package/dist/topic/index.mjs.map +0 -1
@@ -0,0 +1,135 @@
1
+ const require_construct_interface = require("./construct-interface.cjs");
2
+ const require_clone = require("./clone-UGJpvQnL.cjs");
3
+ const require_Queue = require("./Queue-D4Iaidrs.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 }`. The handler's `db` is the worker's database
12
+ * unless `.database(other)` names another.
13
+ */
14
+ var QueueBuilder = class {
15
+ _name;
16
+ _messageSchema;
17
+ _timeout = 3e4;
18
+ _batchSize;
19
+ _fifo;
20
+ _services = [];
21
+ /** The construct ids `.dependsOn()` named — what the manifest records. */
22
+ _constructs = [];
23
+ _logger = _geekmidas_logger_console.DEFAULT_LOGGER;
24
+ /** The worker that runs this queue's consumer — stamped by `worker.queue()`. */
25
+ _owner;
26
+ /** What the handler's `db` comes from — the worker's, unless overridden. */
27
+ _databaseService;
28
+ /** The edge `.database()` added, so the next one can replace it. */
29
+ _databaseEdge;
30
+ /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
31
+ queue(name) {
32
+ return require_clone.cloneWith(this, { _name: name });
33
+ }
34
+ timeout(timeout) {
35
+ return require_clone.cloneWith(this, { _timeout: timeout });
36
+ }
37
+ /** SQS event-source batch size (deployed). */
38
+ batchSize(batchSize) {
39
+ return require_clone.cloneWith(this, { _batchSize: batchSize });
40
+ }
41
+ /** Mark the queue as FIFO (deployed). */
42
+ fifo(fifo = true) {
43
+ return require_clone.cloneWith(this, { _fifo: fifo });
44
+ }
45
+ /**
46
+ * Depend on constructs — a database, a bucket, a mail sender, a queue, a
47
+ * topic.
48
+ *
49
+ * It records the edge and dissolves each construct's client into the
50
+ * handler's service record under the construct's own id, so
51
+ * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
52
+ *
53
+ * Constructs only. A `Service` does not match the shape, which is what keeps
54
+ * env sniffing confined to `.services()` and the explicit lift.
55
+ */
56
+ dependsOn(constructs) {
57
+ const services = require_construct_interface.servicesOf(constructs);
58
+ return require_clone.cloneWith(this, {
59
+ _services: [...this._services, ...services],
60
+ _constructs: require_construct_interface.idsOf(constructs, this._constructs)
61
+ });
62
+ }
63
+ services(services) {
64
+ return require_clone.cloneWith(this, { _services: [...this._services, ...services] });
65
+ }
66
+ logger(logger) {
67
+ return require_clone.cloneWith(this, { _logger: logger });
68
+ }
69
+ /**
70
+ * The database the handler receives as `db`.
71
+ *
72
+ * A queue built from a worker already has the worker's, when the worker
73
+ * named one with `.database(db)`; this replaces it — the edge as well as
74
+ * the client — for a consumer that works against a different database.
75
+ */
76
+ database(source) {
77
+ return require_clone.cloneWith(this, {
78
+ _databaseService: require_construct_interface.serviceOf(source),
79
+ ...require_construct_interface.databaseEdges({
80
+ constructs: this._constructs,
81
+ edge: this._databaseEdge,
82
+ service: this._databaseService,
83
+ services: this._services
84
+ }, source)
85
+ });
86
+ }
87
+ /** The typed message (job) payload the queue carries. */
88
+ message(schema) {
89
+ return require_clone.cloneWith(this, { _messageSchema: schema });
90
+ }
91
+ handle(fn) {
92
+ if (!this._name) throw new QueueNeedsName();
93
+ if (!this._messageSchema) throw new QueueNeedsMessage(this._name);
94
+ const queue = new require_Queue.Queue(this._name, fn, this._messageSchema, this._timeout, this._services, this._logger, this._batchSize, this._fifo, this._constructs, this._databaseService);
95
+ queue.owner = this._owner;
96
+ return queue;
97
+ }
98
+ };
99
+ /** A queue built without a name — only reachable by building one by hand. */
100
+ var QueueNeedsName = class extends Error {
101
+ constructor() {
102
+ super("A queue needs a name: build it from a worker, worker.queue('Emails').");
103
+ this.name = "QueueNeedsName";
104
+ }
105
+ };
106
+ /** A queue whose message was never described. */
107
+ var QueueNeedsMessage = class extends Error {
108
+ queue;
109
+ constructor(queue) {
110
+ super(`Queue '${queue}' has no message: call .message(schema) before .handle(), so its producers and its consumer agree on what it carries.`);
111
+ this.queue = queue;
112
+ this.name = "QueueNeedsMessage";
113
+ }
114
+ };
115
+ //#endregion
116
+ Object.defineProperty(exports, "QueueBuilder", {
117
+ enumerable: true,
118
+ get: function() {
119
+ return QueueBuilder;
120
+ }
121
+ });
122
+ Object.defineProperty(exports, "QueueNeedsMessage", {
123
+ enumerable: true,
124
+ get: function() {
125
+ return QueueNeedsMessage;
126
+ }
127
+ });
128
+ Object.defineProperty(exports, "QueueNeedsName", {
129
+ enumerable: true,
130
+ get: function() {
131
+ return QueueNeedsName;
132
+ }
133
+ });
134
+
135
+ //# sourceMappingURL=QueueBuilder-BxsZ9o5z.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueBuilder-BxsZ9o5z.cjs","names":["DEFAULT_LOGGER","cloneWith","servicesOf","idsOf","serviceOf","databaseEdges","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\tdatabaseEdges,\n\tidsOf,\n\ttype ServicesOf,\n\tserviceOf,\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 }`. The handler's `db` is the worker's database\n * unless `.database(other)` names another.\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\tTDatabase = undefined,\n\tTDatabaseServiceName extends string = string,\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\t/** What the handler's `db` comes from — the worker's, unless overridden. */\n\tprivate _databaseService?: Service<TDatabaseServiceName, TDatabase>;\n\t/** The edge `.database()` added, so the next one can replace it. */\n\tprivate _databaseEdge?: 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<\n\t\tT,\n\t\tTMessage,\n\t\tTServices,\n\t\tTLogger,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\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\tTDatabase,\n\t\t\tTDatabaseServiceName\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<\n\t\tTName,\n\t\tTMessage,\n\t\t[...TServices, ...ServicesOf<T>],\n\t\tTLogger,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\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\tTDatabase,\n\t\t\tTDatabaseServiceName\n\t\t>;\n\t}\n\n\tservices<T extends Service[]>(\n\t\tservices: T,\n\t): QueueBuilder<\n\t\tTName,\n\t\tTMessage,\n\t\t[...TServices, ...T],\n\t\tTLogger,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\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\tTDatabase,\n\t\t\tTDatabaseServiceName\n\t\t>;\n\t}\n\n\tlogger<T extends Logger>(\n\t\tlogger: T,\n\t): QueueBuilder<\n\t\tTName,\n\t\tTMessage,\n\t\tTServices,\n\t\tT,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\n\t\treturn cloneWith(this, {\n\t\t\t_logger: logger as unknown as TLogger,\n\t\t}) as unknown as QueueBuilder<\n\t\t\tTName,\n\t\t\tTMessage,\n\t\t\tTServices,\n\t\t\tT,\n\t\t\tTDatabase,\n\t\t\tTDatabaseServiceName\n\t\t>;\n\t}\n\n\t/**\n\t * The database the handler receives as `db`.\n\t *\n\t * A queue built from a worker already has the worker's, when the worker\n\t * named one with `.database(db)`; this replaces it — the edge as well as\n\t * the client — for a consumer that works against a different database.\n\t */\n\tdatabase<T, TDbName extends string>(\n\t\tsource: Consumable<TDbName, T> | Service<TDbName, T>,\n\t): QueueBuilder<TName, TMessage, TServices, TLogger, T, TDbName> {\n\t\treturn cloneWith(this, {\n\t\t\t_databaseService: serviceOf(source),\n\t\t\t...databaseEdges(\n\t\t\t\t{\n\t\t\t\t\tconstructs: this._constructs,\n\t\t\t\t\tedge: this._databaseEdge,\n\t\t\t\t\tservice: this._databaseService as Service | undefined,\n\t\t\t\t\tservices: this._services,\n\t\t\t\t},\n\t\t\t\tsource,\n\t\t\t),\n\t\t}) as unknown as QueueBuilder<\n\t\t\tTName,\n\t\t\tTMessage,\n\t\t\tTServices,\n\t\t\tTLogger,\n\t\t\tT,\n\t\t\tTDbName\n\t\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<\n\t\tTName,\n\t\tT,\n\t\tTServices,\n\t\tTLogger,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\n\t\treturn cloneWith(this, {\n\t\t\t_messageSchema: schema as unknown as TMessage,\n\t\t}) as unknown as QueueBuilder<\n\t\t\tTName,\n\t\t\tT,\n\t\t\tTServices,\n\t\t\tTLogger,\n\t\t\tTDatabase,\n\t\t\tTDatabaseServiceName\n\t\t>;\n\t}\n\n\thandle(\n\t\tfn: QueueHandler<NonNullable<TMessage>, TServices, TLogger, TDatabase>,\n\t): Queue<\n\t\tTName,\n\t\tNonNullable<TMessage>,\n\t\tTServices,\n\t\tTLogger,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t> {\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<\n\t\t\tTName,\n\t\t\tNonNullable<TMessage>,\n\t\t\tTServices,\n\t\t\tTLogger,\n\t\t\tTDatabase,\n\t\t\tTDatabaseServiceName\n\t\t>(\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\tthis._databaseService,\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":";;;;;;;;;;;;;AAuBA,IAAa,eAAb,MAOE;CACD;CACA;CACA,WAAmB;CACnB;CACA;CACA,YAA+B,CAAC;;CAEhC,cAA+B,CAAC;CAChC,UAA2BA,0BAAAA;;CAE3B;;CAEA;;CAEA;;CAGA,MACC,MAQC;EACD,OAAOC,cAAAA,UAAU,MAAM,EAAE,OAAO,KAAK,CAAC;CAQvC;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,YAQC;EAQD,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;CAQF;CAEA,SACC,UAQC;EACD,OAAOF,cAAAA,UAAU,MAAM,EACtB,WAAW,CAAC,GAAG,KAAK,WAAW,GAAG,QAAQ,EAC3C,CAAC;CAQF;CAEA,OACC,QAQC;EACD,OAAOA,cAAAA,UAAU,MAAM,EACtB,SAAS,OACV,CAAC;CAQF;;;;;;;;CASA,SACC,QACgE;EAChE,OAAOA,cAAAA,UAAU,MAAM;GACtB,kBAAkBG,4BAAAA,UAAU,MAAM;GAClC,GAAGC,4BAAAA,cACF;IACC,YAAY,KAAK;IACjB,MAAM,KAAK;IACX,SAAS,KAAK;IACd,UAAU,KAAK;GAChB,GACA,MACD;EACD,CAAC;CAQF;;CAGA,QACC,QAQC;EACD,OAAOJ,cAAAA,UAAU,MAAM,EACtB,gBAAgB,OACjB,CAAC;CAQF;CAEA,OACC,IAQC;EACD,IAAI,CAAC,KAAK,OAAO,MAAM,IAAI,eAAe;EAC1C,IAAI,CAAC,KAAK,gBAAgB,MAAM,IAAI,kBAAkB,KAAK,KAAK;EAEhE,MAAM,QAAQ,IAAIK,cAAAA,MAQjB,KAAK,OACL,IACA,KAAK,gBACL,KAAK,UACL,KAAK,WACL,KAAK,SACL,KAAK,YACL,KAAK,OACL,KAAK,aACL,KAAK,gBACN;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,75 @@
1
+ import { n as StandardSchemaV1 } from "./index-DdRjYhiJ.mjs";
2
+ import { c as ServicesOf, r as Consumable } from "./construct-interface-CSA9VeWM.mjs";
3
+ import { r as QueueHandler, t as Queue } from "./Queue-B8HGg439.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 }`. The handler's `db` is the worker's database
13
+ * unless `.database(other)` names another.
14
+ */
15
+ declare class QueueBuilder<TName extends string = string, TMessage extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TDatabase = undefined, TDatabaseServiceName extends string = string> {
16
+ private _name?;
17
+ private _messageSchema?;
18
+ private _timeout;
19
+ private _batchSize?;
20
+ private _fifo?;
21
+ private _services;
22
+ /** The construct ids `.dependsOn()` named — what the manifest records. */
23
+ _constructs: string[];
24
+ private _logger;
25
+ /** The worker that runs this queue's consumer — stamped by `worker.queue()`. */
26
+ _owner?: string;
27
+ /** What the handler's `db` comes from — the worker's, unless overridden. */
28
+ private _databaseService?;
29
+ /** The edge `.database()` added, so the next one can replace it. */
30
+ private _databaseEdge?;
31
+ /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
32
+ queue<T extends string>(name: T): QueueBuilder<T, TMessage, TServices, TLogger, TDatabase, TDatabaseServiceName>;
33
+ timeout(timeout: number): this;
34
+ /** SQS event-source batch size (deployed). */
35
+ batchSize(batchSize: number): this;
36
+ /** Mark the queue as FIFO (deployed). */
37
+ fifo(fifo?: boolean): this;
38
+ /**
39
+ * Depend on constructs — a database, a bucket, a mail sender, a queue, a
40
+ * topic.
41
+ *
42
+ * It records the edge and dissolves each construct's client into the
43
+ * handler's service record under the construct's own id, so
44
+ * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
45
+ *
46
+ * Constructs only. A `Service` does not match the shape, which is what keeps
47
+ * env sniffing confined to `.services()` and the explicit lift.
48
+ */
49
+ dependsOn<const T extends readonly Consumable[]>(constructs: T): QueueBuilder<TName, TMessage, [...TServices, ...ServicesOf<T>], TLogger, TDatabase, TDatabaseServiceName>;
50
+ services<T extends Service[]>(services: T): QueueBuilder<TName, TMessage, [...TServices, ...T], TLogger, TDatabase, TDatabaseServiceName>;
51
+ logger<T extends Logger>(logger: T): QueueBuilder<TName, TMessage, TServices, T, TDatabase, TDatabaseServiceName>;
52
+ /**
53
+ * The database the handler receives as `db`.
54
+ *
55
+ * A queue built from a worker already has the worker's, when the worker
56
+ * named one with `.database(db)`; this replaces it — the edge as well as
57
+ * the client — for a consumer that works against a different database.
58
+ */
59
+ database<T, TDbName extends string>(source: Consumable<TDbName, T> | Service<TDbName, T>): QueueBuilder<TName, TMessage, TServices, TLogger, T, TDbName>;
60
+ /** The typed message (job) payload the queue carries. */
61
+ message<T extends StandardSchemaV1>(schema: T): QueueBuilder<TName, T, TServices, TLogger, TDatabase, TDatabaseServiceName>;
62
+ handle(fn: QueueHandler<NonNullable<TMessage>, TServices, TLogger, TDatabase>): Queue<TName, NonNullable<TMessage>, TServices, TLogger, TDatabase, TDatabaseServiceName>;
63
+ }
64
+ /** A queue built without a name — only reachable by building one by hand. */
65
+ declare class QueueNeedsName extends Error {
66
+ constructor();
67
+ }
68
+ /** A queue whose message was never described. */
69
+ declare class QueueNeedsMessage extends Error {
70
+ readonly queue: string;
71
+ constructor(queue: string);
72
+ }
73
+ //#endregion
74
+ export { QueueNeedsMessage as n, QueueNeedsName as r, QueueBuilder as t };
75
+ //# sourceMappingURL=QueueBuilder-CVS_qPuo.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueBuilder-CVS_qPuo.d.mts","names":[],"sources":["../src/queue/QueueBuilder.ts"],"mappings":";;;;;;;;;;;;;;cAuBa,aACZ,+BACA,iBAAiB,0CACjB,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,uBACA;UAEQ;UACA;UACA;UACA;UACA;UACA;;EAED;UACC;;EAED;;UAEC;;UAEA;;EAGR,MAAM,kBACL,MAAM,IACJ,aACF,GACA,UACA,WACA,SACA,WACA;EAYD,QAAQ;;EAKR,UAAU;;EAKV,KAAK;;;;;;;;;;;;EAeL,gBAAgB,mBAAmB,cAClC,YAAY,IACV,aACF,OACA,cACI,cAAc,WAAW,KAC7B,SACA,WACA;EAwBD,SAAS,UAAU,WAClB,UAAU,IACR,aACF,OACA,cACI,cAAc,IAClB,SACA,WACA;EAcD,OAAO,UAAU,QAChB,QAAQ,IACN,aACF,OACA,UACA,WACA,GACA,WACA;;;;;;;;EAqBD,SAAS,GAAG,wBACX,QAAQ,WAAW,SAAS,KAAK,QAAQ,SAAS,KAChD,aAAa,OAAO,UAAU,WAAW,SAAS,GAAG;;EAuBxD,QAAQ,UAAU,kBACjB,QAAQ,IACN,aACF,OACA,GACA,WACA,SACA,WACA;EAcD,OACC,IAAI,aAAa,YAAY,WAAW,WAAW,SAAS,aAC1D,MACF,OACA,YAAY,WACZ,WACA,SACA,WACA;;;cAsCW,uBAAuB;EACnC;;;cASY,0BAA0B;WACjB;EAArB,YAAqB"}
@@ -0,0 +1,75 @@
1
+ import { n as StandardSchemaV1 } from "./index-DdRjYhiJ.cjs";
2
+ import { c as ServicesOf, r as Consumable } from "./construct-interface-DugP0E5q.cjs";
3
+ import { r as QueueHandler, t as Queue } from "./Queue-C4rijiM7.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 }`. The handler's `db` is the worker's database
13
+ * unless `.database(other)` names another.
14
+ */
15
+ declare class QueueBuilder<TName extends string = string, TMessage extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TDatabase = undefined, TDatabaseServiceName extends string = string> {
16
+ private _name?;
17
+ private _messageSchema?;
18
+ private _timeout;
19
+ private _batchSize?;
20
+ private _fifo?;
21
+ private _services;
22
+ /** The construct ids `.dependsOn()` named — what the manifest records. */
23
+ _constructs: string[];
24
+ private _logger;
25
+ /** The worker that runs this queue's consumer — stamped by `worker.queue()`. */
26
+ _owner?: string;
27
+ /** What the handler's `db` comes from — the worker's, unless overridden. */
28
+ private _databaseService?;
29
+ /** The edge `.database()` added, so the next one can replace it. */
30
+ private _databaseEdge?;
31
+ /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
32
+ queue<T extends string>(name: T): QueueBuilder<T, TMessage, TServices, TLogger, TDatabase, TDatabaseServiceName>;
33
+ timeout(timeout: number): this;
34
+ /** SQS event-source batch size (deployed). */
35
+ batchSize(batchSize: number): this;
36
+ /** Mark the queue as FIFO (deployed). */
37
+ fifo(fifo?: boolean): this;
38
+ /**
39
+ * Depend on constructs — a database, a bucket, a mail sender, a queue, a
40
+ * topic.
41
+ *
42
+ * It records the edge and dissolves each construct's client into the
43
+ * handler's service record under the construct's own id, so
44
+ * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
45
+ *
46
+ * Constructs only. A `Service` does not match the shape, which is what keeps
47
+ * env sniffing confined to `.services()` and the explicit lift.
48
+ */
49
+ dependsOn<const T extends readonly Consumable[]>(constructs: T): QueueBuilder<TName, TMessage, [...TServices, ...ServicesOf<T>], TLogger, TDatabase, TDatabaseServiceName>;
50
+ services<T extends Service[]>(services: T): QueueBuilder<TName, TMessage, [...TServices, ...T], TLogger, TDatabase, TDatabaseServiceName>;
51
+ logger<T extends Logger>(logger: T): QueueBuilder<TName, TMessage, TServices, T, TDatabase, TDatabaseServiceName>;
52
+ /**
53
+ * The database the handler receives as `db`.
54
+ *
55
+ * A queue built from a worker already has the worker's, when the worker
56
+ * named one with `.database(db)`; this replaces it — the edge as well as
57
+ * the client — for a consumer that works against a different database.
58
+ */
59
+ database<T, TDbName extends string>(source: Consumable<TDbName, T> | Service<TDbName, T>): QueueBuilder<TName, TMessage, TServices, TLogger, T, TDbName>;
60
+ /** The typed message (job) payload the queue carries. */
61
+ message<T extends StandardSchemaV1>(schema: T): QueueBuilder<TName, T, TServices, TLogger, TDatabase, TDatabaseServiceName>;
62
+ handle(fn: QueueHandler<NonNullable<TMessage>, TServices, TLogger, TDatabase>): Queue<TName, NonNullable<TMessage>, TServices, TLogger, TDatabase, TDatabaseServiceName>;
63
+ }
64
+ /** A queue built without a name — only reachable by building one by hand. */
65
+ declare class QueueNeedsName extends Error {
66
+ constructor();
67
+ }
68
+ /** A queue whose message was never described. */
69
+ declare class QueueNeedsMessage extends Error {
70
+ readonly queue: string;
71
+ constructor(queue: string);
72
+ }
73
+ //#endregion
74
+ export { QueueNeedsMessage as n, QueueNeedsName as r, QueueBuilder as t };
75
+ //# sourceMappingURL=QueueBuilder-SQli59An.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueueBuilder-SQli59An.d.cts","names":[],"sources":["../src/queue/QueueBuilder.ts"],"mappings":";;;;;;;;;;;;;;cAuBa,aACZ,+BACA,iBAAiB,0CACjB,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,uBACA;UAEQ;UACA;UACA;UACA;UACA;UACA;;EAED;UACC;;EAED;;UAEC;;UAEA;;EAGR,MAAM,kBACL,MAAM,IACJ,aACF,GACA,UACA,WACA,SACA,WACA;EAYD,QAAQ;;EAKR,UAAU;;EAKV,KAAK;;;;;;;;;;;;EAeL,gBAAgB,mBAAmB,cAClC,YAAY,IACV,aACF,OACA,cACI,cAAc,WAAW,KAC7B,SACA,WACA;EAwBD,SAAS,UAAU,WAClB,UAAU,IACR,aACF,OACA,cACI,cAAc,IAClB,SACA,WACA;EAcD,OAAO,UAAU,QAChB,QAAQ,IACN,aACF,OACA,UACA,WACA,GACA,WACA;;;;;;;;EAqBD,SAAS,GAAG,wBACX,QAAQ,WAAW,SAAS,KAAK,QAAQ,SAAS,KAChD,aAAa,OAAO,UAAU,WAAW,SAAS,GAAG;;EAuBxD,QAAQ,UAAU,kBACjB,QAAQ,IACN,aACF,OACA,GACA,WACA,SACA,WACA;EAcD,OACC,IAAI,aAAa,YAAY,WAAW,WAAW,SAAS,aAC1D,MACF,OACA,YAAY,WACZ,WACA,SACA,WACA;;;cAsCW,uBAAuB;EACnC;;;cASY,0BAA0B;WACjB;EAArB,YAAqB"}
@@ -0,0 +1,83 @@
1
+ import { n as StandardSchemaV1 } from "./index-DdRjYhiJ.cjs";
2
+ import { t as Construct } from "./Construct-127M7yrl.cjs";
3
+ import { t as DatabaseContext } from "./Function-BIEsY0Hm.cjs";
4
+ import { Logger } from "@geekmidas/logger";
5
+ import { InferStandardSchema } from "@geekmidas/schema";
6
+ import { Service, ServiceRecord } from "@geekmidas/services";
7
+ import { EventPublisher, ExtractPublisherMessage } from "@geekmidas/events";
8
+ //#region src/subscribers/Subscriber.d.ts
9
+ type ExtractEventPayloads<TPublisher extends EventPublisher<any> | undefined, TEventTypes extends any[]> = TPublisher extends EventPublisher<any> ? Extract<ExtractPublisherMessage<TPublisher>, {
10
+ type: TEventTypes[number];
11
+ }> : never;
12
+ /**
13
+ * A runnable that consumes a topic. Its handler gets `db` when it has a
14
+ * database: the worker's, declared once with `worker.database(db)`, or its own
15
+ * with `.database(other)`.
16
+ */
17
+ declare class Subscriber<TServices extends Service[] = [], TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined,
18
+ /** The topic's message union — what types the events this subscriber receives. */
19
+ TEventPublisher extends EventPublisher<any> | undefined = undefined, TSubscribedEvents extends ExtractPublisherMessage<TEventPublisher>['type'][] = ExtractPublisherMessage<TEventPublisher>['type'][], TDatabase = undefined, TDatabaseServiceName extends string = string> extends Construct<TLogger, OutSchema, TServices, string, undefined, TDatabaseServiceName, TDatabase> {
20
+ readonly handler: SubscriberHandler<TEventPublisher, TSubscribedEvents, TServices, TLogger, OutSchema, TDatabase>;
21
+ readonly timeout: number;
22
+ protected _subscribedEvents?: TSubscribedEvents | undefined;
23
+ readonly outputSchema?: OutSchema | undefined;
24
+ readonly services: TServices;
25
+ readonly logger: TLogger;
26
+ /**
27
+ * The name of the {@link Topic} this subscriber binds to (via
28
+ * `worker.topic(topic)`), recorded for the manifest so infra wires the
29
+ * SNS subscription.
30
+ */
31
+ readonly topicName?: string | undefined;
32
+ __IS_SUBSCRIBER__: boolean;
33
+ static isSubscriber(obj: any): obj is Subscriber<any, any, any, any, any, any>;
34
+ constructor(handler: SubscriberHandler<TEventPublisher, TSubscribedEvents, TServices, TLogger, OutSchema, TDatabase>, timeout?: number, _subscribedEvents?: TSubscribedEvents | undefined, outputSchema?: OutSchema | undefined, services?: TServices, logger?: TLogger,
35
+ /**
36
+ * The name of the {@link Topic} this subscriber binds to (via
37
+ * `worker.topic(topic)`), recorded for the manifest so infra wires the
38
+ * SNS subscription.
39
+ */
40
+ topicName?: string | undefined,
41
+ /**
42
+ * The construct ids `.dependsOn()` named — last, so no existing positional
43
+ * argument moves.
44
+ */
45
+ constructs?: string[],
46
+ /**
47
+ * What the handler's `db` is registered from — after `constructs`, for
48
+ * the same reason.
49
+ */
50
+ databaseService?: Service<TDatabaseServiceName, TDatabase>);
51
+ /**
52
+ * The id of the bucket this subscriber is bound to (via
53
+ * `worker.objects(bucket)`), when its topic is the storage itself — read
54
+ * by the build to bind it, and by the adaptors to read what the storage
55
+ * sends as object events.
56
+ */
57
+ bucketName?: string;
58
+ /** Which of the bucket's keys it watches — see `worker.objects()`. */
59
+ objectFilter?: {
60
+ prefix?: string;
61
+ suffix?: string;
62
+ };
63
+ /**
64
+ * The inbox it is bound to, by id — see `worker.inbox()`. Set, it reads what
65
+ * the provider publishes (a receipt notification) as an `email.received`.
66
+ */
67
+ inboxName?: string;
68
+ /** Its inbox's addressing, which the local receiver routes by. */
69
+ inboxAddressing?: {
70
+ addresses: readonly string[];
71
+ subdomains?: boolean;
72
+ };
73
+ get subscribedEvents(): TSubscribedEvents | undefined;
74
+ }
75
+ type SubscriberHandler<TEventPublisher extends EventPublisher<any> | undefined, TSubscribedEvents extends ExtractPublisherMessage<TEventPublisher>['type'][], TServices extends Service[] = [], TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined, TDatabase = undefined> = (ctx: SubscriberContext<TEventPublisher, TSubscribedEvents, TServices, TLogger, TDatabase>) => OutSchema extends StandardSchemaV1 ? InferStandardSchema<OutSchema> | Promise<InferStandardSchema<OutSchema>> : any | Promise<any>;
76
+ type SubscriberContext<TEventPublisher extends EventPublisher<any> | undefined, TSubscribedEvents extends ExtractPublisherMessage<TEventPublisher>['type'][], TServices extends Service[] = [], TLogger extends Logger = Logger, TDatabase = undefined> = {
77
+ events: ExtractEventPayloads<TEventPublisher, TSubscribedEvents>[];
78
+ services: ServiceRecord<TServices>;
79
+ logger: TLogger;
80
+ } & DatabaseContext<TDatabase>;
81
+ //#endregion
82
+ export { SubscriberHandler as n, Subscriber as t };
83
+ //# sourceMappingURL=Subscriber-5rCX1Nph.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Subscriber-5rCX1Nph.d.cts","names":[],"sources":["../src/subscribers/Subscriber.ts"],"mappings":";;;;;;;;KAaK,qBACJ,mBAAmB,iCACnB,6BACG,mBAAmB,sBACpB,QAAQ,wBAAwB;EAAe,MAAM;;;;;;;cAQ3C,WACZ,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB;;AAElB,wBAAwB,6CACxB,0BACC,wBAAwB,6BAA6B,wBAAwB,4BAC9E,uBACA,sDACS,UACT,SACA,WACA,8BAGA,sBACA;WAeiB,SAAS,kBACxB,iBACA,mBACA,WACA,SACA,WACA;WAEwB;YACf,oBAAoB;WACL,eAAe;WACf,UAAU;WACV,QAAQ;;;;;;WAMjB;EA/BjB;SAEO,aACN,WACE,OAAO;EAQV,YACiB,SAAS,kBACxB,iBACA,mBACA,WACA,SACA,WACA,YAEwB,kBACf,oBAAoB,+BACL,eAAe,uBACf,WAAU,WACV,SAAQ,SAMjB;;;;;;EAAA,gCAKhB;;;;;EAAA,uBAKA;;;;;EAAA,kBAAkB,QAAQ,sBAAsB;;;;;;;EAuBjD;;EAGA;IAAiB;IAAiB;;;;;;EAMlC;;EAGA;IAAoB;IAA8B;;MAE9C,oBAAoB;;KAMb,kBACX,wBAAwB,iCACxB,0BAA0B,wBAAwB,4BAClD,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,0BAEA,KAAK,kBACJ,iBACA,mBACA,WACA,SACA,eAEG,kBAAkB,mBACpB,oBAAoB,aAAa,QAAQ,oBAAoB,oBACvD;KAGG,kBACX,wBAAwB,iCACxB,0BAA0B,wBAAwB,4BAClD,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB;EAEA,QAAQ,qBAAqB,iBAAiB;EAC9C,UAAU,cAAc;EACxB,QAAQ;IACL,gBAAgB"}
@@ -0,0 +1,83 @@
1
+ import { n as StandardSchemaV1 } from "./index-DdRjYhiJ.mjs";
2
+ import { t as Construct } from "./Construct-BMk_CRSD.mjs";
3
+ import { t as DatabaseContext } from "./Function-BKReud5p.mjs";
4
+ import { EventPublisher, ExtractPublisherMessage } from "@geekmidas/events";
5
+ import { Service, ServiceRecord } from "@geekmidas/services";
6
+ import { Logger } from "@geekmidas/logger";
7
+ import { InferStandardSchema } from "@geekmidas/schema";
8
+ //#region src/subscribers/Subscriber.d.ts
9
+ type ExtractEventPayloads<TPublisher extends EventPublisher<any> | undefined, TEventTypes extends any[]> = TPublisher extends EventPublisher<any> ? Extract<ExtractPublisherMessage<TPublisher>, {
10
+ type: TEventTypes[number];
11
+ }> : never;
12
+ /**
13
+ * A runnable that consumes a topic. Its handler gets `db` when it has a
14
+ * database: the worker's, declared once with `worker.database(db)`, or its own
15
+ * with `.database(other)`.
16
+ */
17
+ declare class Subscriber<TServices extends Service[] = [], TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined,
18
+ /** The topic's message union — what types the events this subscriber receives. */
19
+ TEventPublisher extends EventPublisher<any> | undefined = undefined, TSubscribedEvents extends ExtractPublisherMessage<TEventPublisher>['type'][] = ExtractPublisherMessage<TEventPublisher>['type'][], TDatabase = undefined, TDatabaseServiceName extends string = string> extends Construct<TLogger, OutSchema, TServices, string, undefined, TDatabaseServiceName, TDatabase> {
20
+ readonly handler: SubscriberHandler<TEventPublisher, TSubscribedEvents, TServices, TLogger, OutSchema, TDatabase>;
21
+ readonly timeout: number;
22
+ protected _subscribedEvents?: TSubscribedEvents | undefined;
23
+ readonly outputSchema?: OutSchema | undefined;
24
+ readonly services: TServices;
25
+ readonly logger: TLogger;
26
+ /**
27
+ * The name of the {@link Topic} this subscriber binds to (via
28
+ * `worker.topic(topic)`), recorded for the manifest so infra wires the
29
+ * SNS subscription.
30
+ */
31
+ readonly topicName?: string | undefined;
32
+ __IS_SUBSCRIBER__: boolean;
33
+ static isSubscriber(obj: any): obj is Subscriber<any, any, any, any, any, any>;
34
+ constructor(handler: SubscriberHandler<TEventPublisher, TSubscribedEvents, TServices, TLogger, OutSchema, TDatabase>, timeout?: number, _subscribedEvents?: TSubscribedEvents | undefined, outputSchema?: OutSchema | undefined, services?: TServices, logger?: TLogger,
35
+ /**
36
+ * The name of the {@link Topic} this subscriber binds to (via
37
+ * `worker.topic(topic)`), recorded for the manifest so infra wires the
38
+ * SNS subscription.
39
+ */
40
+ topicName?: string | undefined,
41
+ /**
42
+ * The construct ids `.dependsOn()` named — last, so no existing positional
43
+ * argument moves.
44
+ */
45
+ constructs?: string[],
46
+ /**
47
+ * What the handler's `db` is registered from — after `constructs`, for
48
+ * the same reason.
49
+ */
50
+ databaseService?: Service<TDatabaseServiceName, TDatabase>);
51
+ /**
52
+ * The id of the bucket this subscriber is bound to (via
53
+ * `worker.objects(bucket)`), when its topic is the storage itself — read
54
+ * by the build to bind it, and by the adaptors to read what the storage
55
+ * sends as object events.
56
+ */
57
+ bucketName?: string;
58
+ /** Which of the bucket's keys it watches — see `worker.objects()`. */
59
+ objectFilter?: {
60
+ prefix?: string;
61
+ suffix?: string;
62
+ };
63
+ /**
64
+ * The inbox it is bound to, by id — see `worker.inbox()`. Set, it reads what
65
+ * the provider publishes (a receipt notification) as an `email.received`.
66
+ */
67
+ inboxName?: string;
68
+ /** Its inbox's addressing, which the local receiver routes by. */
69
+ inboxAddressing?: {
70
+ addresses: readonly string[];
71
+ subdomains?: boolean;
72
+ };
73
+ get subscribedEvents(): TSubscribedEvents | undefined;
74
+ }
75
+ type SubscriberHandler<TEventPublisher extends EventPublisher<any> | undefined, TSubscribedEvents extends ExtractPublisherMessage<TEventPublisher>['type'][], TServices extends Service[] = [], TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined, TDatabase = undefined> = (ctx: SubscriberContext<TEventPublisher, TSubscribedEvents, TServices, TLogger, TDatabase>) => OutSchema extends StandardSchemaV1 ? InferStandardSchema<OutSchema> | Promise<InferStandardSchema<OutSchema>> : any | Promise<any>;
76
+ type SubscriberContext<TEventPublisher extends EventPublisher<any> | undefined, TSubscribedEvents extends ExtractPublisherMessage<TEventPublisher>['type'][], TServices extends Service[] = [], TLogger extends Logger = Logger, TDatabase = undefined> = {
77
+ events: ExtractEventPayloads<TEventPublisher, TSubscribedEvents>[];
78
+ services: ServiceRecord<TServices>;
79
+ logger: TLogger;
80
+ } & DatabaseContext<TDatabase>;
81
+ //#endregion
82
+ export { SubscriberHandler as n, Subscriber as t };
83
+ //# sourceMappingURL=Subscriber-CtQXhcL7.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Subscriber-CtQXhcL7.d.mts","names":[],"sources":["../src/subscribers/Subscriber.ts"],"mappings":";;;;;;;;KAaK,qBACJ,mBAAmB,iCACnB,6BACG,mBAAmB,sBACpB,QAAQ,wBAAwB;EAAe,MAAM;;;;;;;cAQ3C,WACZ,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB;;AAElB,wBAAwB,6CACxB,0BACC,wBAAwB,6BAA6B,wBAAwB,4BAC9E,uBACA,sDACS,UACT,SACA,WACA,8BAGA,sBACA;WAeiB,SAAS,kBACxB,iBACA,mBACA,WACA,SACA,WACA;WAEwB;YACf,oBAAoB;WACL,eAAe;WACf,UAAU;WACV,QAAQ;;;;;;WAMjB;EA/BjB;SAEO,aACN,WACE,OAAO;EAQV,YACiB,SAAS,kBACxB,iBACA,mBACA,WACA,SACA,WACA,YAEwB,kBACf,oBAAoB,+BACL,eAAe,uBACf,WAAU,WACV,SAAQ,SAMjB;;;;;;EAAA,gCAKhB;;;;;EAAA,uBAKA;;;;;EAAA,kBAAkB,QAAQ,sBAAsB;;;;;;;EAuBjD;;EAGA;IAAiB;IAAiB;;;;;;EAMlC;;EAGA;IAAoB;IAA8B;;MAE9C,oBAAoB;;KAMb,kBACX,wBAAwB,iCACxB,0BAA0B,wBAAwB,4BAClD,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,0BAEA,KAAK,kBACJ,iBACA,mBACA,WACA,SACA,eAEG,kBAAkB,mBACpB,oBAAoB,aAAa,QAAQ,oBAAoB,oBACvD;KAGG,kBACX,wBAAwB,iCACxB,0BAA0B,wBAAwB,4BAClD,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB;EAEA,QAAQ,qBAAqB,iBAAiB;EAC9C,UAAU,cAAc;EACxB,QAAQ;IACL,gBAAgB"}