@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
@@ -1,6 +1,4 @@
1
- const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const __geekmidas_audit = require_chunk.__toESM(require("@geekmidas/audit"));
3
-
1
+ let _geekmidas_audit = require("@geekmidas/audit");
4
2
  //#region src/endpoints/processAudits.ts
5
3
  /**
6
4
  * Create audit context for handler execution.
@@ -13,9 +11,8 @@ const __geekmidas_audit = require_chunk.__toESM(require("@geekmidas/audit"));
13
11
  * @returns Audit context with auditor and storage, or undefined if not configured
14
12
  */
15
13
  async function createAuditContext(endpoint, serviceDiscovery, logger, ctx) {
16
- if (!endpoint.auditorStorageService) return void 0;
17
- const services = await serviceDiscovery.register([endpoint.auditorStorageService]);
18
- const storage = services[endpoint.auditorStorageService.serviceName];
14
+ if (!endpoint.auditorStorageService) return;
15
+ const storage = (await serviceDiscovery.register([endpoint.auditorStorageService]))[endpoint.auditorStorageService.serviceName];
19
16
  let actor = {
20
17
  id: "system",
21
18
  type: "system"
@@ -31,16 +28,15 @@ async function createAuditContext(endpoint, serviceDiscovery, logger, ctx) {
31
28
  } catch (error) {
32
29
  logger.error(error, "Failed to extract actor for audits");
33
30
  }
34
- const auditor = new __geekmidas_audit.DefaultAuditor({
35
- actor,
36
- storage,
37
- metadata: {
38
- endpoint: endpoint.route,
39
- method: endpoint.method
40
- }
41
- });
42
31
  return {
43
- auditor,
32
+ auditor: new _geekmidas_audit.DefaultAuditor({
33
+ actor,
34
+ storage,
35
+ metadata: {
36
+ endpoint: endpoint.route,
37
+ method: endpoint.method
38
+ }
39
+ }),
44
40
  storage
45
41
  };
46
42
  }
@@ -66,27 +62,27 @@ async function executeWithAuditTransaction(auditContext, handler, onComplete, op
66
62
  if (!auditContext) return handler(void 0);
67
63
  const { auditor, storage } = auditContext;
68
64
  if (storage.withTransaction) return storage.withTransaction(auditor, async () => {
69
- const response$1 = await handler(auditor);
70
- if (onComplete) await onComplete(response$1, auditor);
71
- return response$1;
65
+ const response = await handler(auditor);
66
+ if (onComplete) await onComplete(response, auditor);
67
+ return response;
72
68
  }, options?.db);
73
69
  const response = await handler(auditor);
74
70
  if (onComplete) await onComplete(response, auditor);
75
71
  await auditor.flush();
76
72
  return response;
77
73
  }
78
-
79
74
  //#endregion
80
- Object.defineProperty(exports, 'createAuditContext', {
81
- enumerable: true,
82
- get: function () {
83
- return createAuditContext;
84
- }
75
+ Object.defineProperty(exports, "createAuditContext", {
76
+ enumerable: true,
77
+ get: function() {
78
+ return createAuditContext;
79
+ }
85
80
  });
86
- Object.defineProperty(exports, 'executeWithAuditTransaction', {
87
- enumerable: true,
88
- get: function () {
89
- return executeWithAuditTransaction;
90
- }
81
+ Object.defineProperty(exports, "executeWithAuditTransaction", {
82
+ enumerable: true,
83
+ get: function() {
84
+ return executeWithAuditTransaction;
85
+ }
91
86
  });
92
- //# sourceMappingURL=processAudits-CGqttuXm.cjs.map
87
+
88
+ //# sourceMappingURL=processAudits-D_2W5x8k.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processAudits-D_2W5x8k.cjs","names":["DefaultAuditor"],"sources":["../src/endpoints/processAudits.ts"],"sourcesContent":["import type {\n\tAuditActor,\n\tAuditableAction,\n\tAuditor,\n\tAuditStorage,\n} from '@geekmidas/audit';\nimport { DefaultAuditor } from '@geekmidas/audit';\nimport type { Logger } from '@geekmidas/logger';\nimport type { InferStandardSchema } from '@geekmidas/schema';\nimport type { Service, ServiceDiscovery } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { ActorExtractor, MappedAudit } from './audit';\nimport type { CookieFn, Endpoint, HeaderFn } from './Endpoint';\n\n/**\n * Process declarative audit definitions after successful endpoint execution.\n * Similar to publishConstructEvents for events.\n *\n * @param endpoint - The endpoint with audit configuration\n * @param response - The handler response to generate audit payloads from\n * @param serviceDiscovery - Service discovery for registering audit storage\n * @param logger - Logger for debug/error messages\n * @param ctx - Request context (session, headers, cookies, services)\n * @param existingAuditor - Optional existing auditor instance (e.g., from handler context).\n * If provided, uses this auditor (with its stored transaction).\n * If not provided, creates a new auditor.\n */\nexport async function processEndpointAudits<\n\tTServices extends Service[] = [],\n\tTSession = unknown,\n\tTLogger extends Logger = Logger,\n\tOutSchema extends StandardSchemaV1 | undefined = undefined,\n\tTAuditStorage extends AuditStorage | undefined = undefined,\n\tTAuditStorageServiceName extends string = string,\n\tTAuditAction extends AuditableAction<string, unknown> = AuditableAction<\n\t\tstring,\n\t\tunknown\n\t>,\n>(\n\tendpoint: Endpoint<\n\t\tany,\n\t\tany,\n\t\tany,\n\t\tOutSchema,\n\t\tTServices,\n\t\tTLogger,\n\t\tTSession,\n\t\tTAuditStorage,\n\t\tTAuditStorageServiceName,\n\t\tTAuditAction\n\t>,\n\tresponse: InferStandardSchema<OutSchema>,\n\tserviceDiscovery: ServiceDiscovery<any>,\n\tlogger: TLogger,\n\tctx: {\n\t\tsession: TSession;\n\t\theader: HeaderFn;\n\t\tcookie: CookieFn;\n\t\tservices: Record<string, unknown>;\n\t},\n\texistingAuditor?: Auditor<TAuditAction>,\n): Promise<void> {\n\ttry {\n\t\tconst audits = endpoint.audits as MappedAudit<TAuditAction, OutSchema>[];\n\n\t\t// If we have an existing auditor (from handler context), we need to flush\n\t\t// any manual audits it collected, even if there are no declarative audits\n\t\tconst hasExistingRecords =\n\t\t\texistingAuditor && existingAuditor.getRecords().length > 0;\n\n\t\t// Skip if no declarative audits and no existing records to flush\n\t\tif (!audits?.length && !hasExistingRecords) {\n\t\t\tlogger.debug('No audits to process');\n\t\t\treturn;\n\t\t}\n\n\t\t// If no auditor storage service and we have things to process, warn\n\t\tif (!endpoint.auditorStorageService) {\n\t\t\tif (hasExistingRecords || audits?.length) {\n\t\t\t\tlogger.warn('No auditor storage service available');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Get or create auditor\n\t\tlet auditor: Auditor<TAuditAction>;\n\n\t\tif (existingAuditor) {\n\t\t\t// Use existing auditor (preserves stored transaction and manual audits)\n\t\t\tauditor = existingAuditor;\n\t\t\tlogger.debug('Using existing auditor from handler context');\n\t\t} else {\n\t\t\t// Create new auditor (backward compatibility)\n\t\t\tconst services = await serviceDiscovery.register([\n\t\t\t\tendpoint.auditorStorageService,\n\t\t\t]);\n\t\t\tconst storage = services[\n\t\t\t\tendpoint.auditorStorageService.serviceName\n\t\t\t] as AuditStorage;\n\n\t\t\t// Extract actor if configured\n\t\t\tlet actor: AuditActor = { id: 'system', type: 'system' };\n\t\t\tif (endpoint.actorExtractor) {\n\t\t\t\ttry {\n\t\t\t\t\tactor = await (\n\t\t\t\t\t\tendpoint.actorExtractor as ActorExtractor<\n\t\t\t\t\t\t\tTServices,\n\t\t\t\t\t\t\tTSession,\n\t\t\t\t\t\t\tTLogger\n\t\t\t\t\t\t>\n\t\t\t\t\t)({\n\t\t\t\t\t\tservices: ctx.services as any,\n\t\t\t\t\t\tsession: ctx.session,\n\t\t\t\t\t\theader: ctx.header,\n\t\t\t\t\t\tcookie: ctx.cookie,\n\t\t\t\t\t\tlogger,\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlogger.error(error as Error, 'Failed to extract actor for audits');\n\t\t\t\t\t// Continue with system actor\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tauditor = new DefaultAuditor<TAuditAction>({\n\t\t\t\tactor,\n\t\t\t\tstorage,\n\t\t\t\tmetadata: {\n\t\t\t\t\tendpoint: endpoint.route,\n\t\t\t\t\tmethod: endpoint.method,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// Process each declarative audit\n\t\tif (audits?.length) {\n\t\t\tfor (const audit of audits) {\n\t\t\t\tlogger.debug({ audit: audit.type }, 'Processing declarative audit');\n\n\t\t\t\t// Check when condition\n\t\t\t\tif (audit.when && !audit.when(response as any)) {\n\t\t\t\t\tlogger.debug(\n\t\t\t\t\t\t{ audit: audit.type },\n\t\t\t\t\t\t'Audit skipped due to when condition',\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Extract payload\n\t\t\t\tconst payload = audit.payload(response as any);\n\n\t\t\t\t// Extract entityId if configured\n\t\t\t\tconst entityId = audit.entityId?.(response as any);\n\n\t\t\t\t// Record the audit\n\t\t\t\tauditor.audit(audit.type as any, payload as any, {\n\t\t\t\t\ttable: audit.table,\n\t\t\t\t\tentityId,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Flush audits to storage\n\t\t// Note: If existingAuditor has a stored transaction (via setTransaction),\n\t\t// flush() will use it automatically\n\t\tconst recordCount = auditor.getRecords().length;\n\t\tif (recordCount > 0) {\n\t\t\t// Check if auditor has a stored transaction (for logging purposes)\n\t\t\tconst trx =\n\t\t\t\t'getTransaction' in auditor\n\t\t\t\t\t? (auditor as { getTransaction(): unknown }).getTransaction()\n\t\t\t\t\t: undefined;\n\t\t\tlogger.debug(\n\t\t\t\t{ auditCount: recordCount, hasTransaction: !!trx },\n\t\t\t\t'Flushing audits',\n\t\t\t);\n\t\t\tawait auditor.flush();\n\t\t}\n\t} catch (error) {\n\t\tlogger.error(error as Error, 'Failed to process audits');\n\t\t// Don't rethrow - audit failures shouldn't fail the request\n\t}\n}\n\n/**\n * Context for audit-aware handler execution.\n */\nexport interface AuditExecutionContext<\n\tTAuditAction extends AuditableAction<string, unknown> = AuditableAction<\n\t\tstring,\n\t\tunknown\n\t>,\n> {\n\t/** The auditor instance for recording audits */\n\tauditor: Auditor<TAuditAction>;\n\t/** The audit storage instance */\n\tstorage: AuditStorage;\n}\n\n/**\n * Create audit context for handler execution.\n * Returns the auditor and storage for use in the handler.\n *\n * @param endpoint - The endpoint with audit configuration\n * @param serviceDiscovery - Service discovery for getting audit storage\n * @param logger - Logger for debug/error messages\n * @param ctx - Request context for actor extraction\n * @returns Audit context with auditor and storage, or undefined if not configured\n */\nexport async function createAuditContext<\n\tTServices extends Service[] = [],\n\tTSession = unknown,\n\tTLogger extends Logger = Logger,\n\tTAuditStorage extends AuditStorage | undefined = undefined,\n\tTAuditStorageServiceName extends string = string,\n\tTAuditAction extends AuditableAction<string, unknown> = AuditableAction<\n\t\tstring,\n\t\tunknown\n\t>,\n\tTDatabase = undefined,\n\tTDatabaseServiceName extends string = string,\n>(\n\tendpoint: Endpoint<\n\t\tany,\n\t\tany,\n\t\tany,\n\t\tany,\n\t\tTServices,\n\t\tTLogger,\n\t\tTSession,\n\t\tTAuditStorage,\n\t\tTAuditStorageServiceName,\n\t\tTAuditAction,\n\t\tTDatabase,\n\t\tTDatabaseServiceName\n\t>,\n\tserviceDiscovery: ServiceDiscovery<any>,\n\tlogger: TLogger,\n\tctx: {\n\t\tsession: TSession;\n\t\theader: HeaderFn;\n\t\tcookie: CookieFn;\n\t\tservices: Record<string, unknown>;\n\t},\n): Promise<AuditExecutionContext<TAuditAction> | undefined> {\n\tif (!endpoint.auditorStorageService) {\n\t\treturn undefined;\n\t}\n\n\tconst services = await serviceDiscovery.register([\n\t\tendpoint.auditorStorageService,\n\t]);\n\tconst storage = services[\n\t\tendpoint.auditorStorageService.serviceName\n\t] as AuditStorage;\n\n\t// Extract actor if configured\n\tlet actor: AuditActor = { id: 'system', type: 'system' };\n\tif (endpoint.actorExtractor) {\n\t\ttry {\n\t\t\tactor = await (\n\t\t\t\tendpoint.actorExtractor as ActorExtractor<TServices, TSession, TLogger>\n\t\t\t)({\n\t\t\t\tservices: ctx.services as any,\n\t\t\t\tsession: ctx.session,\n\t\t\t\theader: ctx.header,\n\t\t\t\tcookie: ctx.cookie,\n\t\t\t\tlogger,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tlogger.error(error as Error, 'Failed to extract actor for audits');\n\t\t}\n\t}\n\n\tconst auditor = new DefaultAuditor<TAuditAction>({\n\t\tactor,\n\t\tstorage,\n\t\tmetadata: {\n\t\t\tendpoint: endpoint.route,\n\t\t\tmethod: endpoint.method,\n\t\t},\n\t});\n\n\treturn { auditor, storage };\n}\n\n/**\n * Options for executeWithAuditTransaction.\n */\nexport interface ExecuteWithAuditTransactionOptions {\n\t/**\n\t * Database connection to use for the transaction.\n\t * If this is already a transaction, it will be reused instead of creating a nested one.\n\t * If not provided, the storage's internal database is used.\n\t */\n\tdb?: unknown;\n}\n\n/**\n * Execute a handler with automatic audit transaction support.\n * If the audit storage provides a withTransaction method, wraps execution\n * in a transaction so audits are atomic with handler's database operations.\n *\n * This is database-agnostic - each storage implementation provides its own\n * transaction handling based on the underlying database (Kysely, Drizzle, etc.).\n *\n * If the db parameter is provided and is already a transaction, the storage\n * will reuse it instead of creating a nested transaction (similar to\n * packages/db/src/kysely.ts#withTransaction).\n *\n * @param auditContext - The audit context from createAuditContext\n * @param handler - The handler function to execute (receives auditor)\n * @param onComplete - Called after handler with response, to process declarative audits\n * @param options - Optional configuration including database connection\n * @returns The handler result\n */\nexport async function executeWithAuditTransaction<\n\tT,\n\tTAuditAction extends AuditableAction<string, unknown> = AuditableAction<\n\t\tstring,\n\t\tunknown\n\t>,\n>(\n\tauditContext: AuditExecutionContext<TAuditAction> | undefined,\n\thandler: (auditor?: Auditor<TAuditAction>) => Promise<T>,\n\tonComplete?: (response: T, auditor: Auditor<TAuditAction>) => Promise<void>,\n\toptions?: ExecuteWithAuditTransactionOptions,\n): Promise<T> {\n\t// No audit context - just run handler\n\tif (!auditContext) {\n\t\treturn handler(undefined);\n\t}\n\n\tconst { auditor, storage } = auditContext;\n\n\t// Check if storage provides a transaction wrapper\n\tif (storage.withTransaction) {\n\t\t// Wrap in transaction - audits are atomic with handler operations\n\t\t// The storage's withTransaction handles setTransaction and flush\n\t\t// Pass db so existing transactions are reused\n\t\treturn storage.withTransaction(\n\t\t\tauditor,\n\t\t\tasync () => {\n\t\t\t\tconst response = await handler(auditor);\n\n\t\t\t\t// Process declarative audits within the transaction\n\t\t\t\tif (onComplete) {\n\t\t\t\t\tawait onComplete(response, auditor);\n\t\t\t\t}\n\n\t\t\t\treturn response;\n\t\t\t},\n\t\t\toptions?.db,\n\t\t);\n\t}\n\n\t// No transaction support - run handler and flush audits after\n\tconst response = await handler(auditor);\n\n\tif (onComplete) {\n\t\tawait onComplete(response, auditor);\n\t}\n\n\t// Flush audits (no transaction)\n\tawait auditor.flush();\n\n\treturn response;\n}\n"],"mappings":";;;;;;;;;;;;AAgNA,eAAsB,mBAarB,UAcA,kBACA,QACA,KAM2D;CAC3D,IAAI,CAAC,SAAS,uBACb;CAMD,MAAM,WAAU,MAHO,iBAAiB,SAAS,CAChD,SAAS,qBACV,CAAC,EAAA,CAEA,SAAS,sBAAsB;CAIhC,IAAI,QAAoB;EAAE,IAAI;EAAU,MAAM;CAAS;CACvD,IAAI,SAAS,gBACZ,IAAI;EACH,QAAQ,MACP,SAAS,eACR;GACD,UAAU,IAAI;GACd,SAAS,IAAI;GACb,QAAQ,IAAI;GACZ,QAAQ,IAAI;GACZ;EACD,CAAC;CACF,SAAS,OAAO;EACf,OAAO,MAAM,OAAgB,oCAAoC;CAClE;CAYD,OAAO;EAAE,SAAA,IATWA,iBAAAA,eAA6B;GAChD;GACA;GACA,UAAU;IACT,UAAU,SAAS;IACnB,QAAQ,SAAS;GAClB;EACD,CAEe;EAAG;CAAQ;AAC3B;;;;;;;;;;;;;;;;;;;AAgCA,eAAsB,4BAOrB,cACA,SACA,YACA,SACa;CAEb,IAAI,CAAC,cACJ,OAAO,QAAQ,KAAA,CAAS;CAGzB,MAAM,EAAE,SAAS,YAAY;CAG7B,IAAI,QAAQ,iBAIX,OAAO,QAAQ,gBACd,SACA,YAAY;EACX,MAAM,WAAW,MAAM,QAAQ,OAAO;EAGtC,IAAI,YACH,MAAM,WAAW,UAAU,OAAO;EAGnC,OAAO;CACR,GACA,SAAS,EACV;CAID,MAAM,WAAW,MAAM,QAAQ,OAAO;CAEtC,IAAI,YACH,MAAM,WAAW,UAAU,OAAO;CAInC,MAAM,QAAQ,MAAM;CAEpB,OAAO;AACR"}
@@ -1,189 +1,6 @@
1
- const require_chunk = require('../chunk-DWy1uDak.cjs');
2
- const require_construct_interface = require('../construct-interface-BfjcOD_E.cjs');
3
- const require_Construct = require('../Construct-CyS3RpTL.cjs');
4
- const require_clone = require('../clone-Dy0cR2SZ.cjs');
5
- const __geekmidas_manifest = require_chunk.__toESM(require("@geekmidas/manifest"));
6
- const __geekmidas_logger_console = require_chunk.__toESM(require("@geekmidas/logger/console"));
7
- const __geekmidas_events = require_chunk.__toESM(require("@geekmidas/events"));
8
-
9
- //#region src/queue/Queue.ts
10
- /**
11
- * A queue worker — a point-to-point SQS-style queue and its single consumer.
12
- * Unlike a `Subscriber` (topic fan-out, filtered by `subscribedEvents`), a queue
13
- * drains every message of its one `message` type. Build one with `q` (see
14
- * `QueueBuilder`); `gkm build` discovers it into the manifest's `queues` field.
15
- *
16
- * The producer side is {@link Queue.publisher} — a ready-to-inject `Service`
17
- * that any endpoint/function drops into `.services([...])` to send messages.
18
- */
19
- var Queue = class extends require_Construct.Construct {
20
- __IS_QUEUE__ = true;
21
- static isQueue(obj) {
22
- return Boolean(obj && obj.__IS_QUEUE__ === true && obj.type === require_Construct.ConstructType.Queue);
23
- }
24
- /**
25
- * The canonical id this queue is declared under.
26
- *
27
- * Derived from the name rather than given separately, so `emails` and
28
- * `Emails` are one queue. The name stays what it was: it is the wire `type`
29
- * a producer sends and the worker subscribes to, and changing that would
30
- * silently orphan in-flight messages.
31
- */
32
- id;
33
- /**
34
- * The producer's env key. Read by both {@link declare} and
35
- * {@link publisher}, so what the target publishes and what the producer
36
- * looks up cannot drift.
37
- */
38
- connectionKey;
39
- constructor(name, handler, messageSchema, timeout = 3e4, services = [], logger = __geekmidas_logger_console.DEFAULT_LOGGER, batchSize, fifo, constructs = []) {
40
- super(require_Construct.ConstructType.Queue, logger, services, [], void 0, void 0, timeout, void 0, void 0, constructs);
41
- this.name = name;
42
- this.handler = handler;
43
- this.messageSchema = messageSchema;
44
- this.timeout = timeout;
45
- this.services = services;
46
- this.logger = logger;
47
- this.batchSize = batchSize;
48
- this.fifo = fifo;
49
- this.id = (0, __geekmidas_manifest.canonicalId)(name);
50
- this.connectionKey = (0, __geekmidas_manifest.provideKey)(this.id, "publisherConnectionString");
51
- }
52
- /**
53
- * What this queue is in the manifest.
54
- *
55
- * A queue is a resource, not a handler: the worker is reached *through* it,
56
- * so the declaration carries the producer's key and nothing about the code
57
- * that drains it. The local target reads this to know which broker has to be
58
- * running and what connection string to inject.
59
- */
60
- declare() {
61
- return [{
62
- kind: "queue",
63
- id: this.id,
64
- provides: [this.connectionKey],
65
- ...this.fifo ? { fifo: true } : {},
66
- worker: {
67
- id: `${this.id}Worker`,
68
- handler: `${this.id}.handler`,
69
- dependencies: []
70
- }
71
- }];
72
- }
73
- /**
74
- * The producer side — a `Service` exposing an `EventPublisher` typed to this
75
- * queue's message. Inject it via `.services([queue.publisher])`; the handler
76
- * then calls `services.<name>Publisher.publish([{ type, payload }])`.
77
- *
78
- * It reads `<NAME>_PUBLISHER_CONNECTION_STRING` and builds the transport from
79
- * the URL protocol — `pgboss://` locally, `sqs://` deployed — so the same
80
- * code publishes to Postgres in dev and SQS in prod. Because it's a `Service`,
81
- * `Construct.getEnvironment()` sniffs it, so the env requirement flows into
82
- * the manifest and infra links exactly this queue with least privilege.
83
- */
84
- /**
85
- * The queue as a dependency — what `.dependsOn([emailsQueue])` dissolves
86
- * into, reachable as `services.emails`.
87
- *
88
- * It is the producer: a consumer is the worker written right here, so the
89
- * only thing another construct can want from a queue is the ability to send
90
- * to it. {@link publisher} is the same service under its older
91
- * `<name>Publisher` key, kept for `.services([queue.publisher])`.
92
- */
93
- get service() {
94
- const { register } = this.publisher;
95
- return {
96
- serviceName: (0, __geekmidas_manifest.serviceKey)(this.id),
97
- register
98
- };
99
- }
100
- get publisher() {
101
- const envVar = this.connectionKey;
102
- return {
103
- serviceName: `${this.name}Publisher`,
104
- async register({ envParser }) {
105
- const { connectionString } = envParser.create((get) => ({ connectionString: get(envVar).string() })).parse();
106
- return __geekmidas_events.Publisher.fromConnectionString(connectionString);
107
- }
108
- };
109
- }
110
- };
111
-
112
- //#endregion
113
- //#region src/queue/QueueBuilder.ts
114
- /**
115
- * Builds a {@link Queue} worker — `q.queue('orders').services([db]).message(schema).handle(fn)`.
116
- * Services are an array (sniffed for required env vars); `message` is the typed
117
- * job payload; `handle` is the single consumer. The queue name is captured as a
118
- * literal so `queue.publisher` is typed to `{ type: '<name>', payload }`.
119
- */
120
- var QueueBuilder = class {
121
- _name;
122
- _messageSchema;
123
- _timeout = 3e4;
124
- _batchSize;
125
- _fifo;
126
- _services = [];
127
- /** The construct ids `.dependsOn()` named — what the manifest records. */
128
- _constructs = [];
129
- _logger = __geekmidas_logger_console.DEFAULT_LOGGER;
130
- /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
131
- queue(name) {
132
- return require_clone.cloneWith(this, { _name: name });
133
- }
134
- timeout(timeout) {
135
- return require_clone.cloneWith(this, { _timeout: timeout });
136
- }
137
- /** SQS event-source batch size (deployed). */
138
- batchSize(batchSize) {
139
- return require_clone.cloneWith(this, { _batchSize: batchSize });
140
- }
141
- /** Mark the queue as FIFO (deployed). */
142
- fifo(fifo = true) {
143
- return require_clone.cloneWith(this, { _fifo: fifo });
144
- }
145
- /**
146
- * Depend on constructs — a database, a bucket, a mail sender, a queue, a
147
- * topic.
148
- *
149
- * It records the edge and dissolves each construct's client into the
150
- * handler's service record under the construct's own id, so
151
- * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
152
- *
153
- * Constructs only. A `Service` does not match the shape, which is what keeps
154
- * env sniffing confined to `.services()` and the explicit lift.
155
- */
156
- dependsOn(constructs) {
157
- const services = require_construct_interface.servicesOf(constructs);
158
- return require_clone.cloneWith(this, {
159
- _services: [...this._services, ...services],
160
- _constructs: require_construct_interface.idsOf(constructs, this._constructs)
161
- });
162
- }
163
- services(services) {
164
- return require_clone.cloneWith(this, { _services: [...this._services, ...services] });
165
- }
166
- logger(logger) {
167
- return require_clone.cloneWith(this, { _logger: logger });
168
- }
169
- /** The typed message (job) payload the queue carries. */
170
- message(schema) {
171
- return require_clone.cloneWith(this, { _messageSchema: schema });
172
- }
173
- handle(fn) {
174
- if (!this._name) throw new Error("Queue requires a name — call .queue(name) before .handle().");
175
- if (!this._messageSchema) throw new Error("Queue requires a message schema — call .message(schema) before .handle().");
176
- const queue = new Queue(this._name, fn, this._messageSchema, this._timeout, this._services, this._logger, this._batchSize, this._fifo, this._constructs);
177
- return queue;
178
- }
179
- };
180
-
181
- //#endregion
182
- //#region src/queue/index.ts
183
- const q = new QueueBuilder();
184
-
185
- //#endregion
186
- exports.Queue = Queue;
187
- exports.QueueBuilder = QueueBuilder;
188
- exports.q = q;
189
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_Queue = require("../Queue-Ckmudcm8.cjs");
3
+ const require_QueueBuilder = require("../QueueBuilder-CJNcv4dy.cjs");
4
+ exports.Queue = require_Queue.Queue;
5
+ exports.QueueNeedsMessage = require_QueueBuilder.QueueNeedsMessage;
6
+ exports.QueueNeedsName = require_QueueBuilder.QueueNeedsName;
@@ -1,60 +1,3 @@
1
- import "../Construct-C0ijr2qp.cjs";
2
- import { Consumable, ServicesOf } from "../construct-interface-D9d4Gm4p.cjs";
3
- import { Queue, QueueContext, QueueHandler, QueueMessage } from "../Queue-D7ZuwBhy.cjs";
4
- import * as _geekmidas_logger6 from "@geekmidas/logger";
5
- import { Logger } from "@geekmidas/logger";
6
- import { Service } from "@geekmidas/services";
7
- import { StandardSchemaV1 } from "@standard-schema/spec";
8
-
9
- //#region src/queue/QueueBuilder.d.ts
10
-
11
- /**
12
- * Builds a {@link Queue} worker — `q.queue('orders').services([db]).message(schema).handle(fn)`.
13
- * Services are an array (sniffed for required env vars); `message` is the typed
14
- * job payload; `handle` is the single consumer. The queue name is captured as a
15
- * literal so `queue.publisher` is typed to `{ type: '<name>', payload }`.
16
- */
17
- declare class QueueBuilder<TName extends string = string, TMessage extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger> {
18
- private _name?;
19
- private _messageSchema?;
20
- private _timeout;
21
- private _batchSize?;
22
- private _fifo?;
23
- private _services;
24
- /** The construct ids `.dependsOn()` named — what the manifest records. */
25
- _constructs: string[];
26
- private _logger;
27
- /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
28
- queue<T extends string>(name: T): QueueBuilder<T, TMessage, TServices, TLogger>;
29
- timeout(timeout: number): this;
30
- /** SQS event-source batch size (deployed). */
31
- batchSize(batchSize: number): this;
32
- /** Mark the queue as FIFO (deployed). */
33
- fifo(fifo?: boolean): this;
34
- /**
35
- * Depend on constructs — a database, a bucket, a mail sender, a queue, a
36
- * topic.
37
- *
38
- * It records the edge and dissolves each construct's client into the
39
- * handler's service record under the construct's own id, so
40
- * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
41
- *
42
- * Constructs only. A `Service` does not match the shape, which is what keeps
43
- * env sniffing confined to `.services()` and the explicit lift.
44
- */
45
- dependsOn<const T extends readonly Consumable[]>(constructs: T): QueueBuilder<TName, TMessage, [...TServices, ...ServicesOf<T>], TLogger>;
46
- services<T extends Service[]>(services: T): QueueBuilder<TName, TMessage, [...TServices, ...T], TLogger>;
47
- logger<T extends Logger>(logger: T): QueueBuilder<TName, TMessage, TServices, T>;
48
- /** The typed message (job) payload the queue carries. */
49
- message<T extends StandardSchemaV1>(schema: T): QueueBuilder<TName, T, TServices, TLogger>;
50
- handle(fn: QueueHandler<NonNullable<TMessage>, TServices, TLogger>): Queue<TName, NonNullable<TMessage>, TServices, TLogger>;
51
- }
52
- //# sourceMappingURL=QueueBuilder.d.ts.map
53
- //#endregion
54
- //#region src/queue/index.d.ts
55
- declare const q: QueueBuilder<string, undefined, [], _geekmidas_logger6.Logger>;
56
- //# sourceMappingURL=index.d.ts.map
57
-
58
- //#endregion
59
- export { Queue, QueueBuilder, QueueContext, QueueHandler, QueueMessage, q };
60
- //# sourceMappingURL=index.d.cts.map
1
+ import { i as QueueMessage, n as QueueContext, r as QueueHandler, t as Queue } from "../Queue-CpQIGB_2.cjs";
2
+ import { n as QueueNeedsMessage, r as QueueNeedsName } from "../QueueBuilder-XEnnOWGe.cjs";
3
+ export { Queue, type QueueContext, type QueueHandler, type QueueMessage, QueueNeedsMessage, QueueNeedsName };
@@ -1,60 +1,3 @@
1
- import "../Construct-Ct8nalEi.mjs";
2
- import { Consumable, ServicesOf } from "../construct-interface-g5GM5pwR.mjs";
3
- import { Queue, QueueContext, QueueHandler, QueueMessage } from "../Queue-gVGfi2Yk.mjs";
4
- import { Service } from "@geekmidas/services";
5
- import * as _geekmidas_logger25 from "@geekmidas/logger";
6
- import { Logger } from "@geekmidas/logger";
7
- import { StandardSchemaV1 } from "@standard-schema/spec";
8
-
9
- //#region src/queue/QueueBuilder.d.ts
10
-
11
- /**
12
- * Builds a {@link Queue} worker — `q.queue('orders').services([db]).message(schema).handle(fn)`.
13
- * Services are an array (sniffed for required env vars); `message` is the typed
14
- * job payload; `handle` is the single consumer. The queue name is captured as a
15
- * literal so `queue.publisher` is typed to `{ type: '<name>', payload }`.
16
- */
17
- declare class QueueBuilder<TName extends string = string, TMessage extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger> {
18
- private _name?;
19
- private _messageSchema?;
20
- private _timeout;
21
- private _batchSize?;
22
- private _fifo?;
23
- private _services;
24
- /** The construct ids `.dependsOn()` named — what the manifest records. */
25
- _constructs: string[];
26
- private _logger;
27
- /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
28
- queue<T extends string>(name: T): QueueBuilder<T, TMessage, TServices, TLogger>;
29
- timeout(timeout: number): this;
30
- /** SQS event-source batch size (deployed). */
31
- batchSize(batchSize: number): this;
32
- /** Mark the queue as FIFO (deployed). */
33
- fifo(fifo?: boolean): this;
34
- /**
35
- * Depend on constructs — a database, a bucket, a mail sender, a queue, a
36
- * topic.
37
- *
38
- * It records the edge and dissolves each construct's client into the
39
- * handler's service record under the construct's own id, so
40
- * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
41
- *
42
- * Constructs only. A `Service` does not match the shape, which is what keeps
43
- * env sniffing confined to `.services()` and the explicit lift.
44
- */
45
- dependsOn<const T extends readonly Consumable[]>(constructs: T): QueueBuilder<TName, TMessage, [...TServices, ...ServicesOf<T>], TLogger>;
46
- services<T extends Service[]>(services: T): QueueBuilder<TName, TMessage, [...TServices, ...T], TLogger>;
47
- logger<T extends Logger>(logger: T): QueueBuilder<TName, TMessage, TServices, T>;
48
- /** The typed message (job) payload the queue carries. */
49
- message<T extends StandardSchemaV1>(schema: T): QueueBuilder<TName, T, TServices, TLogger>;
50
- handle(fn: QueueHandler<NonNullable<TMessage>, TServices, TLogger>): Queue<TName, NonNullable<TMessage>, TServices, TLogger>;
51
- }
52
- //# sourceMappingURL=QueueBuilder.d.ts.map
53
- //#endregion
54
- //#region src/queue/index.d.ts
55
- declare const q: QueueBuilder<string, undefined, [], _geekmidas_logger25.Logger>;
56
- //# sourceMappingURL=index.d.ts.map
57
-
58
- //#endregion
59
- export { Queue, QueueBuilder, QueueContext, QueueHandler, QueueMessage, q };
60
- //# sourceMappingURL=index.d.mts.map
1
+ import { i as QueueMessage, n as QueueContext, r as QueueHandler, t as Queue } from "../Queue-YmvN2vEP.mjs";
2
+ import { n as QueueNeedsMessage, r as QueueNeedsName } from "../QueueBuilder-CM0WUxfw.mjs";
3
+ export { Queue, type QueueContext, type QueueHandler, type QueueMessage, QueueNeedsMessage, QueueNeedsName };
@@ -1,186 +1,3 @@
1
- import { Construct, ConstructType } from "../Construct-BD5neF7w.mjs";
2
- import { idsOf, servicesOf } from "../construct-interface-Z4CpS8tK.mjs";
3
- import { cloneWith } from "../clone-DblgEZZa.mjs";
4
- import { canonicalId, provideKey, serviceKey } from "@geekmidas/manifest";
5
- import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
6
- import { Publisher } from "@geekmidas/events";
7
-
8
- //#region src/queue/Queue.ts
9
- /**
10
- * A queue worker — a point-to-point SQS-style queue and its single consumer.
11
- * Unlike a `Subscriber` (topic fan-out, filtered by `subscribedEvents`), a queue
12
- * drains every message of its one `message` type. Build one with `q` (see
13
- * `QueueBuilder`); `gkm build` discovers it into the manifest's `queues` field.
14
- *
15
- * The producer side is {@link Queue.publisher} — a ready-to-inject `Service`
16
- * that any endpoint/function drops into `.services([...])` to send messages.
17
- */
18
- var Queue = class extends Construct {
19
- __IS_QUEUE__ = true;
20
- static isQueue(obj) {
21
- return Boolean(obj && obj.__IS_QUEUE__ === true && obj.type === ConstructType.Queue);
22
- }
23
- /**
24
- * The canonical id this queue is declared under.
25
- *
26
- * Derived from the name rather than given separately, so `emails` and
27
- * `Emails` are one queue. The name stays what it was: it is the wire `type`
28
- * a producer sends and the worker subscribes to, and changing that would
29
- * silently orphan in-flight messages.
30
- */
31
- id;
32
- /**
33
- * The producer's env key. Read by both {@link declare} and
34
- * {@link publisher}, so what the target publishes and what the producer
35
- * looks up cannot drift.
36
- */
37
- connectionKey;
38
- constructor(name, handler, messageSchema, timeout = 3e4, services = [], logger = DEFAULT_LOGGER, batchSize, fifo, constructs = []) {
39
- super(ConstructType.Queue, logger, services, [], void 0, void 0, timeout, void 0, void 0, constructs);
40
- this.name = name;
41
- this.handler = handler;
42
- this.messageSchema = messageSchema;
43
- this.timeout = timeout;
44
- this.services = services;
45
- this.logger = logger;
46
- this.batchSize = batchSize;
47
- this.fifo = fifo;
48
- this.id = canonicalId(name);
49
- this.connectionKey = provideKey(this.id, "publisherConnectionString");
50
- }
51
- /**
52
- * What this queue is in the manifest.
53
- *
54
- * A queue is a resource, not a handler: the worker is reached *through* it,
55
- * so the declaration carries the producer's key and nothing about the code
56
- * that drains it. The local target reads this to know which broker has to be
57
- * running and what connection string to inject.
58
- */
59
- declare() {
60
- return [{
61
- kind: "queue",
62
- id: this.id,
63
- provides: [this.connectionKey],
64
- ...this.fifo ? { fifo: true } : {},
65
- worker: {
66
- id: `${this.id}Worker`,
67
- handler: `${this.id}.handler`,
68
- dependencies: []
69
- }
70
- }];
71
- }
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() {
93
- const { register } = this.publisher;
94
- return {
95
- serviceName: serviceKey(this.id),
96
- register
97
- };
98
- }
99
- get publisher() {
100
- const envVar = this.connectionKey;
101
- return {
102
- serviceName: `${this.name}Publisher`,
103
- async register({ envParser }) {
104
- const { connectionString } = envParser.create((get) => ({ connectionString: get(envVar).string() })).parse();
105
- return Publisher.fromConnectionString(connectionString);
106
- }
107
- };
108
- }
109
- };
110
-
111
- //#endregion
112
- //#region src/queue/QueueBuilder.ts
113
- /**
114
- * Builds a {@link Queue} worker — `q.queue('orders').services([db]).message(schema).handle(fn)`.
115
- * Services are an array (sniffed for required env vars); `message` is the typed
116
- * job payload; `handle` is the single consumer. The queue name is captured as a
117
- * literal so `queue.publisher` is typed to `{ type: '<name>', payload }`.
118
- */
119
- var QueueBuilder = class {
120
- _name;
121
- _messageSchema;
122
- _timeout = 3e4;
123
- _batchSize;
124
- _fifo;
125
- _services = [];
126
- /** The construct ids `.dependsOn()` named — what the manifest records. */
127
- _constructs = [];
128
- _logger = DEFAULT_LOGGER;
129
- /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
130
- queue(name) {
131
- return cloneWith(this, { _name: name });
132
- }
133
- timeout(timeout) {
134
- return cloneWith(this, { _timeout: timeout });
135
- }
136
- /** SQS event-source batch size (deployed). */
137
- batchSize(batchSize) {
138
- return cloneWith(this, { _batchSize: batchSize });
139
- }
140
- /** Mark the queue as FIFO (deployed). */
141
- fifo(fifo = true) {
142
- return cloneWith(this, { _fifo: fifo });
143
- }
144
- /**
145
- * Depend on constructs — a database, a bucket, a mail sender, a queue, a
146
- * topic.
147
- *
148
- * It records the edge and dissolves each construct's client into the
149
- * handler's service record under the construct's own id, so
150
- * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
151
- *
152
- * Constructs only. A `Service` does not match the shape, which is what keeps
153
- * env sniffing confined to `.services()` and the explicit lift.
154
- */
155
- dependsOn(constructs) {
156
- const services = servicesOf(constructs);
157
- return cloneWith(this, {
158
- _services: [...this._services, ...services],
159
- _constructs: idsOf(constructs, this._constructs)
160
- });
161
- }
162
- services(services) {
163
- return cloneWith(this, { _services: [...this._services, ...services] });
164
- }
165
- logger(logger) {
166
- return cloneWith(this, { _logger: logger });
167
- }
168
- /** The typed message (job) payload the queue carries. */
169
- message(schema) {
170
- return cloneWith(this, { _messageSchema: schema });
171
- }
172
- handle(fn) {
173
- if (!this._name) throw new Error("Queue requires a name — call .queue(name) before .handle().");
174
- if (!this._messageSchema) throw new Error("Queue requires a message schema — call .message(schema) before .handle().");
175
- const queue = new Queue(this._name, fn, this._messageSchema, this._timeout, this._services, this._logger, this._batchSize, this._fifo, this._constructs);
176
- return queue;
177
- }
178
- };
179
-
180
- //#endregion
181
- //#region src/queue/index.ts
182
- const q = new QueueBuilder();
183
-
184
- //#endregion
185
- export { Queue, QueueBuilder, q };
186
- //# sourceMappingURL=index.mjs.map
1
+ import { t as Queue } from "../Queue-C1uDgjxt.mjs";
2
+ import { n as QueueNeedsMessage, r as QueueNeedsName } from "../QueueBuilder-XuPKZwKH.mjs";
3
+ export { Queue, QueueNeedsMessage, QueueNeedsName };