@geekmidas/constructs 10.0.0-alpha.3 → 10.0.0-alpha.31

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 (341) hide show
  1. package/README.md +52 -3
  2. package/dist/{Construct-Ct8nalEi.d.mts → Construct-DTqYvkPG.d.cts} +11 -13
  3. package/dist/Construct-DTqYvkPG.d.cts.map +1 -0
  4. package/dist/{Construct-BD5neF7w.mjs → Construct-Detz65RA.mjs} +31 -29
  5. package/dist/Construct-Detz65RA.mjs.map +1 -0
  6. package/dist/{Construct-C0ijr2qp.d.cts → Construct-pVadmURD.d.mts} +10 -12
  7. package/dist/Construct-pVadmURD.d.mts.map +1 -0
  8. package/dist/{Construct-CyS3RpTL.cjs → Construct-yG9Sw-5p.cjs} +51 -43
  9. package/dist/Construct-yG9Sw-5p.cjs.map +1 -0
  10. package/dist/{Cron-ByxdOfpE.d.mts → Cron-B_iuyNxr.d.mts} +17 -6
  11. package/dist/Cron-B_iuyNxr.d.mts.map +1 -0
  12. package/dist/{Cron-Wqh464aO.d.cts → Cron-CA2oa2nC.d.cts} +16 -5
  13. package/dist/Cron-CA2oa2nC.d.cts.map +1 -0
  14. package/dist/{CronBuilder-BL0AP6fs.d.mts → CronBuilder-BIKCLWu7.d.mts} +7 -10
  15. package/dist/CronBuilder-BIKCLWu7.d.mts.map +1 -0
  16. package/dist/{CronBuilder-BmABazzH.mjs → CronBuilder-BRkzUOAs.mjs} +35 -17
  17. package/dist/CronBuilder-BRkzUOAs.mjs.map +1 -0
  18. package/dist/{CronBuilder-BqpEzMPQ.d.cts → CronBuilder-B_KqaodP.d.cts} +6 -9
  19. package/dist/CronBuilder-B_KqaodP.d.cts.map +1 -0
  20. package/dist/{CronBuilder-CkXPJiGO.cjs → CronBuilder-BbnT7tqo.cjs} +45 -27
  21. package/dist/CronBuilder-BbnT7tqo.cjs.map +1 -0
  22. package/dist/{Endpoint-2Wg7T7Cq.d.mts → Endpoint-BojvdQoh.d.mts} +63 -84
  23. package/dist/Endpoint-BojvdQoh.d.mts.map +1 -0
  24. package/dist/{Endpoint-VIOpSo0S.mjs → Endpoint-DO332Dnm.mjs} +117 -109
  25. package/dist/Endpoint-DO332Dnm.mjs.map +1 -0
  26. package/dist/{Endpoint-BiaaMEn_.cjs → Endpoint-QKuFg5gs.cjs} +145 -131
  27. package/dist/Endpoint-QKuFg5gs.cjs.map +1 -0
  28. package/dist/{Endpoint-CH9Fn1AD.d.cts → Endpoint-xNGuv2Fq.d.cts} +61 -82
  29. package/dist/Endpoint-xNGuv2Fq.d.cts.map +1 -0
  30. package/dist/{EndpointFactory-DTTCkGEL.mjs → EndpointFactory-B9HAjDAP.mjs} +26 -32
  31. package/dist/EndpointFactory-B9HAjDAP.mjs.map +1 -0
  32. package/dist/{EndpointFactory-ChxLZllA.cjs → EndpointFactory-BmO0WnXE.cjs} +63 -69
  33. package/dist/EndpointFactory-BmO0WnXE.cjs.map +1 -0
  34. package/dist/{index-BxHDdy6a.d.mts → EndpointFactory-CaYTrUOO.d.mts} +12 -92
  35. package/dist/EndpointFactory-CaYTrUOO.d.mts.map +1 -0
  36. package/dist/{index-V2nksZIJ.d.cts → EndpointFactory-DyT1yOJL.d.cts} +10 -90
  37. package/dist/EndpointFactory-DyT1yOJL.d.cts.map +1 -0
  38. package/dist/{HonoEndpointAdaptor-NKQQQbBY.mjs → HonoEndpointAdaptor-CiqAZ5Mt.mjs} +40 -47
  39. package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs.map → HonoEndpointAdaptor-CiqAZ5Mt.mjs.map} +1 -1
  40. package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs → HonoEndpointAdaptor-DoEQdC3r.cjs} +48 -52
  41. package/dist/HonoEndpointAdaptor-DoEQdC3r.cjs.map +1 -0
  42. package/dist/Queue-B7yRXQmL.cjs +124 -0
  43. package/dist/Queue-B7yRXQmL.cjs.map +1 -0
  44. package/dist/{Queue-D7ZuwBhy.d.cts → Queue-Bhzi2WQC.d.cts} +8 -9
  45. package/dist/Queue-Bhzi2WQC.d.cts.map +1 -0
  46. package/dist/{Queue-gVGfi2Yk.d.mts → Queue-BoUA-e83.d.mts} +9 -10
  47. package/dist/Queue-BoUA-e83.d.mts.map +1 -0
  48. package/dist/Queue-DpKTLl6E.mjs +119 -0
  49. package/dist/Queue-DpKTLl6E.mjs.map +1 -0
  50. package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-CIO3pwji.d.mts} +7 -8
  51. package/dist/Subscriber-CIO3pwji.d.mts.map +1 -0
  52. package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-DQCaiOXF.d.cts} +7 -8
  53. package/dist/Subscriber-DQCaiOXF.d.cts.map +1 -0
  54. package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-B4YRTBng.mjs} +16 -10
  55. package/dist/SubscriberBuilder-B4YRTBng.mjs.map +1 -0
  56. package/dist/{SubscriberBuilder-Dptmo-1A.d.mts → SubscriberBuilder-C2FRfd26.d.mts} +8 -11
  57. package/dist/SubscriberBuilder-C2FRfd26.d.mts.map +1 -0
  58. package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-C2bCOuPT.cjs} +28 -23
  59. package/dist/SubscriberBuilder-C2bCOuPT.cjs.map +1 -0
  60. package/dist/{SubscriberBuilder-waNhzjSM.d.cts → SubscriberBuilder-CjDGSTZc.d.cts} +7 -10
  61. package/dist/SubscriberBuilder-CjDGSTZc.d.cts.map +1 -0
  62. package/dist/Topic-Ct3Le8Wt.mjs +103 -0
  63. package/dist/Topic-Ct3Le8Wt.mjs.map +1 -0
  64. package/dist/Topic-D5rlM9wS.cjs +108 -0
  65. package/dist/Topic-D5rlM9wS.cjs.map +1 -0
  66. package/dist/{Topic-19QeHBIR.d.cts → Topic-D6blllEn.d.cts} +5 -7
  67. package/dist/Topic-D6blllEn.d.cts.map +1 -0
  68. package/dist/{Topic-DuFeqkBh.d.mts → Topic-DVvheJ_-.d.mts} +6 -8
  69. package/dist/Topic-DVvheJ_-.d.mts.map +1 -0
  70. package/dist/adaptors/aws.cjs +87 -106
  71. package/dist/adaptors/aws.cjs.map +1 -1
  72. package/dist/adaptors/aws.d.cts +14 -27
  73. package/dist/adaptors/aws.d.cts.map +1 -1
  74. package/dist/adaptors/aws.d.mts +16 -29
  75. package/dist/adaptors/aws.d.mts.map +1 -1
  76. package/dist/adaptors/aws.mjs +60 -81
  77. package/dist/adaptors/aws.mjs.map +1 -1
  78. package/dist/adaptors/hono.cjs +3 -10
  79. package/dist/adaptors/hono.d.cts +5 -13
  80. package/dist/adaptors/hono.d.cts.map +1 -1
  81. package/dist/adaptors/hono.d.mts +7 -15
  82. package/dist/adaptors/hono.d.mts.map +1 -1
  83. package/dist/adaptors/hono.mjs +2 -10
  84. package/dist/adaptors/testing.cjs +396 -82
  85. package/dist/adaptors/testing.cjs.map +1 -1
  86. package/dist/adaptors/testing.d.cts +150 -33
  87. package/dist/adaptors/testing.d.cts.map +1 -1
  88. package/dist/adaptors/testing.d.mts +151 -34
  89. package/dist/adaptors/testing.d.mts.map +1 -1
  90. package/dist/adaptors/testing.mjs +368 -63
  91. package/dist/adaptors/testing.mjs.map +1 -1
  92. package/dist/auth-Bmo1wSQF.d.cts +177 -0
  93. package/dist/auth-Bmo1wSQF.d.cts.map +1 -0
  94. package/dist/auth-CJ5dp7T7.d.mts +177 -0
  95. package/dist/auth-CJ5dp7T7.d.mts.map +1 -0
  96. package/dist/auth.cjs +113 -28
  97. package/dist/auth.cjs.map +1 -1
  98. package/dist/auth.d.cts +2 -108
  99. package/dist/auth.d.mts +2 -108
  100. package/dist/auth.mjs +103 -20
  101. package/dist/auth.mjs.map +1 -1
  102. package/dist/{cache-BrRz3fEB.d.mts → cache-B2s0b-ss.d.mts} +3 -6
  103. package/dist/cache-B2s0b-ss.d.mts.map +1 -0
  104. package/dist/{cache-BtZY_tHe.d.cts → cache-CYe2Kzjc.d.cts} +3 -6
  105. package/dist/cache-CYe2Kzjc.d.cts.map +1 -0
  106. package/dist/cache.cjs +68 -2
  107. package/dist/cache.cjs.map +1 -0
  108. package/dist/cache.d.cts +1 -2
  109. package/dist/cache.d.mts +1 -2
  110. package/dist/cache.mjs +67 -2
  111. package/dist/cache.mjs.map +1 -0
  112. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  113. package/dist/clone-EKNovYHu.mjs.map +1 -0
  114. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  115. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  116. package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-D2gesxos.d.mts} +28 -10
  117. package/dist/construct-interface-D2gesxos.d.mts.map +1 -0
  118. package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-DPusCUSQ.d.cts} +28 -10
  119. package/dist/construct-interface-DPusCUSQ.d.cts.map +1 -0
  120. package/dist/construct-interface.cjs +116 -7
  121. package/dist/construct-interface.cjs.map +1 -0
  122. package/dist/construct-interface.d.cts +2 -2
  123. package/dist/construct-interface.d.mts +2 -2
  124. package/dist/construct-interface.mjs +108 -2
  125. package/dist/construct-interface.mjs.map +1 -0
  126. package/dist/credential.cjs +43 -9
  127. package/dist/credential.cjs.map +1 -1
  128. package/dist/credential.d.cts +5 -8
  129. package/dist/credential.d.cts.map +1 -1
  130. package/dist/credential.d.mts +5 -8
  131. package/dist/credential.d.mts.map +1 -1
  132. package/dist/credential.mjs +36 -2
  133. package/dist/credential.mjs.map +1 -1
  134. package/dist/crons/index.cjs +68 -10
  135. package/dist/crons/index.cjs.map +1 -1
  136. package/dist/crons/index.d.cts +32 -14
  137. package/dist/crons/index.d.cts.map +1 -1
  138. package/dist/crons/index.d.mts +32 -14
  139. package/dist/crons/index.d.mts.map +1 -1
  140. package/dist/crons/index.mjs +66 -10
  141. package/dist/crons/index.mjs.map +1 -1
  142. package/dist/database/kysely.cjs +40 -15
  143. package/dist/database/kysely.cjs.map +1 -1
  144. package/dist/database/kysely.d.cts +2 -152
  145. package/dist/database/kysely.d.mts +2 -152
  146. package/dist/database/kysely.mjs +28 -5
  147. package/dist/database/kysely.mjs.map +1 -1
  148. package/dist/email.cjs +25 -12
  149. package/dist/email.cjs.map +1 -1
  150. package/dist/email.d.cts +3 -7
  151. package/dist/email.d.cts.map +1 -1
  152. package/dist/email.d.mts +3 -7
  153. package/dist/email.d.mts.map +1 -1
  154. package/dist/email.mjs +16 -3
  155. package/dist/email.mjs.map +1 -1
  156. package/dist/endpoints/index.cjs +7 -10
  157. package/dist/endpoints/index.d.cts +60 -7
  158. package/dist/endpoints/index.d.cts.map +1 -0
  159. package/dist/endpoints/index.d.mts +60 -7
  160. package/dist/endpoints/index.d.mts.map +1 -0
  161. package/dist/endpoints/index.mjs +5 -10
  162. package/dist/file-server.cjs +42 -10
  163. package/dist/file-server.cjs.map +1 -1
  164. package/dist/file-server.d.cts +6 -10
  165. package/dist/file-server.d.cts.map +1 -1
  166. package/dist/file-server.d.mts +6 -10
  167. package/dist/file-server.d.mts.map +1 -1
  168. package/dist/file-server.mjs +34 -2
  169. package/dist/file-server.mjs.map +1 -1
  170. package/dist/functions/index.cjs +2 -6
  171. package/dist/functions/index.d.cts +2 -4
  172. package/dist/functions/index.d.mts +2 -4
  173. package/dist/functions/index.mjs +2 -6
  174. package/dist/{functions-Bd3TPxid.cjs → functions-DKN6aQWJ.cjs} +325 -268
  175. package/dist/functions-DKN6aQWJ.cjs.map +1 -0
  176. package/dist/{functions-Cxbo-pEd.mjs → functions-DlFm8HmH.mjs} +298 -238
  177. package/dist/functions-DlFm8HmH.mjs.map +1 -0
  178. package/dist/{index-JSf9xNIJ.d.cts → index-BI23K3wy.d.cts} +17 -22
  179. package/dist/index-BI23K3wy.d.cts.map +1 -0
  180. package/dist/index-CeEtxDmK.d.cts +79 -0
  181. package/dist/index-CeEtxDmK.d.cts.map +1 -0
  182. package/dist/index-CeEtxDmK.d.mts +79 -0
  183. package/dist/index-CeEtxDmK.d.mts.map +1 -0
  184. package/dist/index-fnpjXiA-.d.mts +26 -0
  185. package/dist/index-fnpjXiA-.d.mts.map +1 -0
  186. package/dist/index-tE_119SX.d.cts +26 -0
  187. package/dist/index-tE_119SX.d.cts.map +1 -0
  188. package/dist/{index-CubPzHd9.d.mts → index-yb3fXNyH.d.mts} +18 -23
  189. package/dist/index-yb3fXNyH.d.mts.map +1 -0
  190. package/dist/index.cjs +3 -3
  191. package/dist/index.d.cts +4 -4
  192. package/dist/index.d.mts +4 -4
  193. package/dist/index.mjs +2 -3
  194. package/dist/kysely-CEVXacPN.d.cts +159 -0
  195. package/dist/kysely-CEVXacPN.d.cts.map +1 -0
  196. package/dist/kysely-mcTdPNhl.d.mts +159 -0
  197. package/dist/kysely-mcTdPNhl.d.mts.map +1 -0
  198. package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-BHtcqgz2.mjs} +22 -25
  199. package/dist/lazyAccessors-BHtcqgz2.mjs.map +1 -0
  200. package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-Dx9NLwJZ.cjs} +72 -76
  201. package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +1 -0
  202. package/dist/object-storage.cjs +18 -10
  203. package/dist/object-storage.cjs.map +1 -1
  204. package/dist/object-storage.d.cts +3 -7
  205. package/dist/object-storage.d.cts.map +1 -1
  206. package/dist/object-storage.d.mts +3 -7
  207. package/dist/object-storage.d.mts.map +1 -1
  208. package/dist/object-storage.mjs +11 -3
  209. package/dist/object-storage.mjs.map +1 -1
  210. package/dist/{processAudits-Dmts9H_b.mjs → processAudits-BpRlPQMW.mjs} +16 -19
  211. package/dist/processAudits-BpRlPQMW.mjs.map +1 -0
  212. package/dist/{processAudits-CGqttuXm.cjs → processAudits-D_2W5x8k.cjs} +26 -30
  213. package/dist/processAudits-D_2W5x8k.cjs.map +1 -0
  214. package/dist/queue/index.cjs +9 -118
  215. package/dist/queue/index.cjs.map +1 -1
  216. package/dist/queue/index.d.cts +8 -15
  217. package/dist/queue/index.d.cts.map +1 -1
  218. package/dist/queue/index.d.mts +8 -15
  219. package/dist/queue/index.d.mts.map +1 -1
  220. package/dist/queue/index.mjs +5 -114
  221. package/dist/queue/index.mjs.map +1 -1
  222. package/dist/rest-api.cjs +88 -62
  223. package/dist/rest-api.cjs.map +1 -1
  224. package/dist/rest-api.d.cts +62 -60
  225. package/dist/rest-api.d.cts.map +1 -1
  226. package/dist/rest-api.d.mts +62 -60
  227. package/dist/rest-api.d.mts.map +1 -1
  228. package/dist/rest-api.mjs +80 -54
  229. package/dist/rest-api.mjs.map +1 -1
  230. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  231. package/dist/site.cjs +33 -9
  232. package/dist/site.cjs.map +1 -1
  233. package/dist/site.d.cts +11 -22
  234. package/dist/site.d.cts.map +1 -1
  235. package/dist/site.d.mts +11 -22
  236. package/dist/site.d.mts.map +1 -1
  237. package/dist/site.mjs +29 -5
  238. package/dist/site.mjs.map +1 -1
  239. package/dist/subscribers/index.cjs +2 -11
  240. package/dist/subscribers/index.d.cts +3 -14
  241. package/dist/subscribers/index.d.mts +3 -14
  242. package/dist/subscribers/index.mjs +2 -11
  243. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  244. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  245. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  246. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  247. package/dist/{telemetry-C3L0iS28.d.cts → telemetry-DGcFlVpB.d.cts} +2 -5
  248. package/dist/telemetry-DGcFlVpB.d.cts.map +1 -0
  249. package/dist/{telemetry-D7bVFLGi.d.mts → telemetry-DGcFlVpB.d.mts} +2 -5
  250. package/dist/telemetry-DGcFlVpB.d.mts.map +1 -0
  251. package/dist/topic/index.cjs +8 -107
  252. package/dist/topic/index.cjs.map +1 -1
  253. package/dist/topic/index.d.cts +3 -32
  254. package/dist/topic/index.d.mts +3 -32
  255. package/dist/topic/index.mjs +4 -103
  256. package/dist/topic/index.mjs.map +1 -1
  257. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  258. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  259. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  260. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  261. package/dist/types.d.cts +1 -1
  262. package/dist/types.d.mts +1 -1
  263. package/dist/types.mjs +1 -0
  264. package/dist/worker.cjs +109 -35
  265. package/dist/worker.cjs.map +1 -1
  266. package/dist/worker.d.cts +87 -42
  267. package/dist/worker.d.cts.map +1 -1
  268. package/dist/worker.d.mts +87 -42
  269. package/dist/worker.d.mts.map +1 -1
  270. package/dist/worker.mjs +104 -30
  271. package/dist/worker.mjs.map +1 -1
  272. package/package.json +59 -55
  273. package/dist/Construct-BD5neF7w.mjs.map +0 -1
  274. package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
  275. package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
  276. package/dist/Construct-CyS3RpTL.cjs.map +0 -1
  277. package/dist/Cron-ByxdOfpE.d.mts.map +0 -1
  278. package/dist/Cron-Wqh464aO.d.cts.map +0 -1
  279. package/dist/CronBuilder-BL0AP6fs.d.mts.map +0 -1
  280. package/dist/CronBuilder-BmABazzH.mjs.map +0 -1
  281. package/dist/CronBuilder-BqpEzMPQ.d.cts.map +0 -1
  282. package/dist/CronBuilder-CkXPJiGO.cjs.map +0 -1
  283. package/dist/Endpoint-2Wg7T7Cq.d.mts.map +0 -1
  284. package/dist/Endpoint-BiaaMEn_.cjs.map +0 -1
  285. package/dist/Endpoint-CH9Fn1AD.d.cts.map +0 -1
  286. package/dist/Endpoint-VIOpSo0S.mjs.map +0 -1
  287. package/dist/EndpointFactory-ChxLZllA.cjs.map +0 -1
  288. package/dist/EndpointFactory-DTTCkGEL.mjs.map +0 -1
  289. package/dist/HonoEndpointAdaptor-NKQQQbBY.mjs.map +0 -1
  290. package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
  291. package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
  292. package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
  293. package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
  294. package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
  295. package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
  296. package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
  297. package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
  298. package/dist/Topic-19QeHBIR.d.cts.map +0 -1
  299. package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
  300. package/dist/auth.d.cts.map +0 -1
  301. package/dist/auth.d.mts.map +0 -1
  302. package/dist/cache-0ANvRQnD.mjs +0 -51
  303. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  304. package/dist/cache-3WSvAulx.cjs +0 -57
  305. package/dist/cache-3WSvAulx.cjs.map +0 -1
  306. package/dist/cache-BrRz3fEB.d.mts.map +0 -1
  307. package/dist/cache-BtZY_tHe.d.cts.map +0 -1
  308. package/dist/clone-DblgEZZa.mjs.map +0 -1
  309. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  310. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  311. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  312. package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
  313. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  314. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  315. package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
  316. package/dist/database/kysely.d.cts.map +0 -1
  317. package/dist/database/kysely.d.mts.map +0 -1
  318. package/dist/functions-Bd3TPxid.cjs.map +0 -1
  319. package/dist/functions-Cxbo-pEd.mjs.map +0 -1
  320. package/dist/index-BxHDdy6a.d.mts.map +0 -1
  321. package/dist/index-CubPzHd9.d.mts.map +0 -1
  322. package/dist/index-JSf9xNIJ.d.cts.map +0 -1
  323. package/dist/index-V2nksZIJ.d.cts.map +0 -1
  324. package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
  325. package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
  326. package/dist/processAudits-CGqttuXm.cjs.map +0 -1
  327. package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
  328. package/dist/subscribers/index.cjs.map +0 -1
  329. package/dist/subscribers/index.d.cts.map +0 -1
  330. package/dist/subscribers/index.d.mts.map +0 -1
  331. package/dist/subscribers/index.mjs.map +0 -1
  332. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  333. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  334. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  335. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  336. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  337. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  338. package/dist/topic/index.d.cts.map +0 -1
  339. package/dist/topic/index.d.mts.map +0 -1
  340. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  341. package/dist/types-aKksMEWL.d.mts.map +0 -1
@@ -0,0 +1,45 @@
1
+ import { EnvironmentParser } from "@geekmidas/envkit";
2
+ import { Credentials } from "@geekmidas/envkit/credentials";
3
+ //#region src/endpoints/surfaceEnv.ts
4
+ /**
5
+ * The environment parser an endpoint runs with.
6
+ *
7
+ * Three facts, in order:
8
+ *
9
+ * 1. An endpoint built from a surface carries whatever parser that surface was
10
+ * given. This is the whole point of `api.get()` — the handler already has
11
+ * the thing, so nothing has to be named in config and nothing has to be
12
+ * printed into generated code.
13
+ * 2. A surface that named none gets this default, which is what every
14
+ * application's own `config/env.ts` was: `process.env` merged with the
15
+ * credentials `gkm dev`/`gkm exec` injected. It was boilerplate identical in
16
+ * every project, and mandatory, which is a poor combination.
17
+ * 3. An endpoint with no surface at all — a test, an MSW handler — gets the
18
+ * same default. Nothing has to opt in.
19
+ *
20
+ * Named a parser only when it is genuinely different: a merged secret source, a
21
+ * fixture, a parser that reads from somewhere other than the process.
22
+ */
23
+ let fallback;
24
+ /**
25
+ * The default parser, built once.
26
+ *
27
+ * Once because `Credentials` resolves through `globalThis` and decryption is
28
+ * not free, and because two parsers over the same environment are two caches of
29
+ * the same answer.
30
+ */
31
+ function defaultEnvParser() {
32
+ if (!fallback) fallback = new EnvironmentParser({
33
+ ...process.env,
34
+ ...Credentials
35
+ });
36
+ return fallback;
37
+ }
38
+ /** The parser for an endpoint, from its surface or the default. */
39
+ function envParserFor(surface) {
40
+ return surface?.envParser ?? defaultEnvParser();
41
+ }
42
+ //#endregion
43
+ export { envParserFor as n, defaultEnvParser as t };
44
+
45
+ //# sourceMappingURL=surfaceEnv-wMT5QzgZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surfaceEnv-wMT5QzgZ.mjs","names":[],"sources":["../src/endpoints/surfaceEnv.ts"],"sourcesContent":["/**\n * The environment parser an endpoint runs with.\n *\n * Three facts, in order:\n *\n * 1. An endpoint built from a surface carries whatever parser that surface was\n * given. This is the whole point of `api.get()` — the handler already has\n * the thing, so nothing has to be named in config and nothing has to be\n * printed into generated code.\n * 2. A surface that named none gets this default, which is what every\n * application's own `config/env.ts` was: `process.env` merged with the\n * credentials `gkm dev`/`gkm exec` injected. It was boilerplate identical in\n * every project, and mandatory, which is a poor combination.\n * 3. An endpoint with no surface at all — a test, an MSW handler — gets the\n * same default. Nothing has to opt in.\n *\n * Named a parser only when it is genuinely different: a merged secret source, a\n * fixture, a parser that reads from somewhere other than the process.\n */\n\nimport { EnvironmentParser } from '@geekmidas/envkit';\nimport { Credentials } from '@geekmidas/envkit/credentials';\nimport type { EndpointSurface } from './Endpoint';\n\nlet fallback: EnvironmentParser<{}> | undefined;\n\n/**\n * The default parser, built once.\n *\n * Once because `Credentials` resolves through `globalThis` and decryption is\n * not free, and because two parsers over the same environment are two caches of\n * the same answer.\n */\nexport function defaultEnvParser(): EnvironmentParser<{}> {\n\tif (!fallback) {\n\t\tfallback = new EnvironmentParser({ ...process.env, ...Credentials });\n\t}\n\n\treturn fallback;\n}\n\n/** The parser for an endpoint, from its surface or the default. */\nexport function envParserFor(\n\tsurface: EndpointSurface | undefined,\n): EnvironmentParser<{}> {\n\treturn surface?.envParser ?? defaultEnvParser();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAI;;;;;;;;AASJ,SAAgB,mBAA0C;CACzD,IAAI,CAAC,UACJ,WAAW,IAAI,kBAAkB;EAAE,GAAG,QAAQ;EAAK,GAAG;CAAY,CAAC;CAGpE,OAAO;AACR;;AAGA,SAAgB,aACf,SACwB;CACxB,OAAO,SAAS,aAAa,iBAAiB;AAC/C"}
@@ -1,7 +1,5 @@
1
1
  import { Context } from "aws-lambda";
2
-
3
2
  //#region src/telemetry.d.ts
4
-
5
3
  /**
6
4
  * Context object returned by onRequestStart, passed to subsequent hooks
7
5
  */
@@ -89,7 +87,6 @@ interface Telemetry {
89
87
  */
90
88
  onRequestError(ctx: TelemetryContext, error: Error): void;
91
89
  }
92
- //# sourceMappingURL=telemetry.d.ts.map
93
90
  //#endregion
94
- export { Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse };
95
- //# sourceMappingURL=telemetry-C3L0iS28.d.cts.map
91
+ export { TelemetryResponse as i, TelemetryContext as n, TelemetryRequest as r, Telemetry as t };
92
+ //# sourceMappingURL=telemetry-DGcFlVpB.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-DGcFlVpB.d.cts","names":["LambdaContext"],"sources":["../src/telemetry.ts"],"mappings":";;;;;UAWiB;;;;GAIf;;;;;UAMe;;;;EAIhB;;;;EAKA,SAASA;;;;;UAMO;;;;EAIhB;;;;EAKA;;;;EAKA,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4BM;;;;;;;EAOhB,eAAe,SAAS,mBAAmB;;;;;;;EAQ3C,aAAa,KAAK,kBAAkB,UAAU;;;;;;;EAQ9C,eAAe,KAAK,kBAAkB,OAAO"}
@@ -1,7 +1,5 @@
1
1
  import { Context } from "aws-lambda";
2
-
3
2
  //#region src/telemetry.d.ts
4
-
5
3
  /**
6
4
  * Context object returned by onRequestStart, passed to subsequent hooks
7
5
  */
@@ -89,7 +87,6 @@ interface Telemetry {
89
87
  */
90
88
  onRequestError(ctx: TelemetryContext, error: Error): void;
91
89
  }
92
- //# sourceMappingURL=telemetry.d.ts.map
93
90
  //#endregion
94
- export { Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse };
95
- //# sourceMappingURL=telemetry-D7bVFLGi.d.mts.map
91
+ export { TelemetryResponse as i, TelemetryContext as n, TelemetryRequest as r, Telemetry as t };
92
+ //# sourceMappingURL=telemetry-DGcFlVpB.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-DGcFlVpB.d.mts","names":["LambdaContext"],"sources":["../src/telemetry.ts"],"mappings":";;;;;UAWiB;;;;GAIf;;;;;UAMe;;;;EAIhB;;;;EAKA,SAASA;;;;;UAMO;;;;EAIhB;;;;EAKA;;;;EAKA,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4BM;;;;;;;EAOhB,eAAe,SAAS,mBAAmB;;;;;;;EAQ3C,aAAa,KAAK,kBAAkB,UAAU;;;;;;;EAQ9C,eAAe,KAAK,kBAAkB,OAAO"}
@@ -1,104 +1,7 @@
1
- const require_chunk = require('../chunk-DWy1uDak.cjs');
2
- const require_Construct = require('../Construct-CyS3RpTL.cjs');
3
- const require_clone = require('../clone-Dy0cR2SZ.cjs');
4
- const __geekmidas_manifest = require_chunk.__toESM(require("@geekmidas/manifest"));
5
- const __geekmidas_logger_console = require_chunk.__toESM(require("@geekmidas/logger/console"));
6
- const __geekmidas_events = require_chunk.__toESM(require("@geekmidas/events"));
7
-
8
- //#region src/topic/Topic.ts
9
- /**
10
- * A topic — pub/sub fan-out. Unlike a `Queue` (point-to-point, one consumer), a
11
- * topic is a *resource* owned by no single handler: it declares the event
12
- * contract, derives a typed producer (`topic.publisher`), and any number of
13
- * subscribers (`s.topic(topic)`) bind to it. `gkm build` discovers it into the
14
- * manifest's `topics` field; infra provisions an SNS topic.
15
- *
16
- * This replaces hand-writing a publisher `Service`: the publisher is *derived*
17
- * from the declared event contract, the same way `Queue` derives its publisher.
18
- */
19
- var Topic = class extends require_Construct.Construct {
20
- __IS_TOPIC__ = true;
21
- static isTopic(obj) {
22
- return Boolean(obj && obj.__IS_TOPIC__ === true && obj.type === require_Construct.ConstructType.Topic);
23
- }
24
- /**
25
- * The canonical id this topic is declared under.
26
- *
27
- * Derived from the name, so `users` and `Users` are one topic. The name is
28
- * left alone: subscribers bind to it and it is what the broker routes on.
29
- */
30
- id;
31
- /**
32
- * The producer's env key, read by both {@link declare} and
33
- * {@link publisher} so the two cannot drift.
34
- */
35
- connectionKey;
36
- constructor(name, eventSchemas, logger = __geekmidas_logger_console.DEFAULT_LOGGER) {
37
- super(require_Construct.ConstructType.Topic, logger, [], []);
38
- this.name = name;
39
- this.eventSchemas = eventSchemas;
40
- this.id = (0, __geekmidas_manifest.canonicalId)(name);
41
- this.connectionKey = (0, __geekmidas_manifest.provideKey)(this.id, "publisherConnectionString");
42
- }
43
- /**
44
- * What this topic is in the manifest.
45
- *
46
- * Only the producer's key: a subscriber is *bound* to a topic rather than
47
- * depending on it, so the binding is an edge the deploy target reads and not
48
- * an env key anyone can hold. Locally both sides meet on the same broker.
49
- */
50
- declare() {
51
- return [{
52
- kind: "topic",
53
- id: this.id,
54
- provides: [this.connectionKey],
55
- events: this.eventTypes,
56
- subscribers: []
57
- }];
58
- }
59
- /** The event type names this topic carries. */
60
- get eventTypes() {
61
- return Object.keys(this.eventSchemas);
62
- }
63
- /**
64
- * The producer side — a `Service` exposing an `EventPublisher` typed to the
65
- * union of this topic's events. Inject via `.publisher(topic.publisher)` (for
66
- * declarative `.event(...)`) or `.services([topic.publisher])` (to publish
67
- * imperatively). Reads `<NAME>_PUBLISHER_CONNECTION_STRING` and selects the
68
- * transport from the URL protocol — `pgboss://` locally, `sns://` deployed.
69
- *
70
- * Because it's a `Service`, the connection-string requirement is sniffed into
71
- * the manifest of whatever construct injects it (least-privilege linking).
72
- */
73
- /**
74
- * The topic as a dependency — what `.dependsOn([users])` dissolves into,
75
- * reachable as `services.users`.
76
- *
77
- * It is the producer, because publishing is the only thing depending on a
78
- * topic can mean: a subscriber *binds* with `s.topic(…)` instead, and is
79
- * deliberately never handed this. {@link publisher} is the same service
80
- * under its older `<name>Publisher` key.
81
- */
82
- get service() {
83
- const { register } = this.publisher;
84
- return {
85
- serviceName: (0, __geekmidas_manifest.serviceKey)(this.id),
86
- register
87
- };
88
- }
89
- get publisher() {
90
- const envVar = this.connectionKey;
91
- return {
92
- serviceName: `${this.name}Publisher`,
93
- async register({ envParser }) {
94
- const { connectionString } = envParser.create((get) => ({ connectionString: get(envVar).string() })).parse();
95
- return __geekmidas_events.Publisher.fromConnectionString(connectionString);
96
- }
97
- };
98
- }
99
- };
100
-
101
- //#endregion
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_clone = require("../clone-UGJpvQnL.cjs");
3
+ const require_Topic = require("../Topic-D5rlM9wS.cjs");
4
+ let _geekmidas_logger_console = require("@geekmidas/logger/console");
102
5
  //#region src/topic/TopicBuilder.ts
103
6
  /**
104
7
  * Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.
@@ -107,7 +10,7 @@ var Topic = class extends require_Construct.Construct {
107
10
  */
108
11
  var TopicBuilder = class {
109
12
  _name;
110
- _logger = __geekmidas_logger_console.DEFAULT_LOGGER;
13
+ _logger = _geekmidas_logger_console.DEFAULT_LOGGER;
111
14
  /** The topic name — drives the infra topic and its `<NAME>_*` env vars. */
112
15
  topic(name) {
113
16
  return require_clone.cloneWith(this, { _name: name });
@@ -121,17 +24,15 @@ var TopicBuilder = class {
121
24
  */
122
25
  events(events) {
123
26
  if (!this._name) throw new Error("Topic requires a name — call .topic(name) before .events().");
124
- const topic = new Topic(this._name, events, this._logger);
125
- return topic;
27
+ return new require_Topic.Topic(this._name, events, this._logger);
126
28
  }
127
29
  };
128
-
129
30
  //#endregion
130
31
  //#region src/topic/index.ts
131
32
  const t = new TopicBuilder();
132
-
133
33
  //#endregion
134
- exports.Topic = Topic;
34
+ exports.Topic = require_Topic.Topic;
135
35
  exports.TopicBuilder = TopicBuilder;
136
36
  exports.t = t;
37
+
137
38
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["Construct","obj: unknown","ConstructType","name: TName","eventSchemas: TEvents","logger: Logger","DEFAULT_LOGGER","DEFAULT_LOGGER","name: T","logger: Logger","events: T"],"sources":["../../src/topic/Topic.ts","../../src/topic/TopicBuilder.ts","../../src/topic/index.ts"],"sourcesContent":["import {\n\ttype EventPublisher,\n\ttype EventPublisherConnectionString,\n\ttype PublishableMessage,\n\tPublisher,\n} from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport {\n\tcanonicalId,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { InferStandardSchema } from '@geekmidas/schema';\nimport type { Service } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { Construct, ConstructType } from '../Construct';\n\n/** A topic's event contract — a map of event type → payload schema. */\nexport type TopicEvents = Record<string, StandardSchemaV1>;\n\n/**\n * The union of wire messages a topic carries, derived from its event map:\n * `{ type: 'user.created'; payload: … } | { type: 'user.updated'; payload: … }`.\n */\nexport type TopicMessage<TEvents extends TopicEvents> = {\n\t[K in keyof TEvents & string]: PublishableMessage<\n\t\tK,\n\t\tInferStandardSchema<TEvents[K]>\n\t>;\n}[keyof TEvents & string];\n\n/**\n * A topic — pub/sub fan-out. Unlike a `Queue` (point-to-point, one consumer), a\n * topic is a *resource* owned by no single handler: it declares the event\n * contract, derives a typed producer (`topic.publisher`), and any number of\n * subscribers (`s.topic(topic)`) bind to it. `gkm build` discovers it into the\n * manifest's `topics` field; infra provisions an SNS topic.\n *\n * This replaces hand-writing a publisher `Service`: the publisher is *derived*\n * from the declared event contract, the same way `Queue` derives its publisher.\n */\nexport class Topic<\n\tTName extends string = string,\n\tTEvents extends TopicEvents = TopicEvents,\n> extends Construct {\n\t__IS_TOPIC__ = true;\n\n\tstatic isTopic(obj: unknown): obj is Topic<string, TopicEvents> {\n\t\treturn Boolean(\n\t\t\tobj &&\n\t\t\t\t(obj as { __IS_TOPIC__?: boolean }).__IS_TOPIC__ === true &&\n\t\t\t\t(obj as Construct).type === ConstructType.Topic,\n\t\t);\n\t}\n\n\t/**\n\t * The canonical id this topic is declared under.\n\t *\n\t * Derived from the name, so `users` and `Users` are one topic. The name is\n\t * left alone: subscribers bind to it and it is what the broker routes on.\n\t */\n\treadonly id: string;\n\n\t/**\n\t * The producer's env key, read by both {@link declare} and\n\t * {@link publisher} so the two cannot drift.\n\t */\n\tprivate readonly connectionKey: string;\n\n\tconstructor(\n\t\tpublic readonly name: TName,\n\t\t/**\n\t\t * The event contract — a map of event type → payload schema. Named\n\t\t * `eventSchemas` (not `events`) to avoid clashing with `Construct.events`,\n\t\t * which is the array of `MappedEvent`s a construct *publishes*.\n\t\t */\n\t\tpublic readonly eventSchemas: TEvents,\n\t\tlogger: Logger = DEFAULT_LOGGER,\n\t) {\n\t\tsuper(ConstructType.Topic, logger, [], []);\n\n\t\tthis.id = canonicalId(name);\n\t\tthis.connectionKey = provideKey(this.id, 'publisherConnectionString');\n\t}\n\n\t/**\n\t * What this topic is in the manifest.\n\t *\n\t * Only the producer's key: a subscriber is *bound* to a topic rather than\n\t * depending on it, so the binding is an edge the deploy target reads and not\n\t * an env key anyone can hold. Locally both sides meet on the same broker.\n\t */\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'topic',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.connectionKey],\n\t\t\t\t// The contract this topic carries. Structural: which events exist\n\t\t\t\t// is a fact about the application, and a subscriber binding to one\n\t\t\t\t// that does not is a mistake worth catching at build.\n\t\t\t\tevents: this.eventTypes,\n\t\t\t\t// Bound rather than declared here — a subscriber names the topic,\n\t\t\t\t// not the other way round — so the build fills these from what it\n\t\t\t\t// found. Nested when it does, because position is the trigger.\n\t\t\t\tsubscribers: [],\n\t\t\t},\n\t\t];\n\t}\n\n\t/** The event type names this topic carries. */\n\tget eventTypes(): (keyof TEvents & string)[] {\n\t\treturn Object.keys(this.eventSchemas) as (keyof TEvents & string)[];\n\t}\n\n\t/**\n\t * The producer side — a `Service` exposing an `EventPublisher` typed to the\n\t * union of this topic's events. Inject via `.publisher(topic.publisher)` (for\n\t * declarative `.event(...)`) or `.services([topic.publisher])` (to publish\n\t * imperatively). Reads `<NAME>_PUBLISHER_CONNECTION_STRING` and selects the\n\t * transport from the URL protocol — `pgboss://` locally, `sns://` deployed.\n\t *\n\t * Because it's a `Service`, the connection-string requirement is sniffed into\n\t * the manifest of whatever construct injects it (least-privilege linking).\n\t */\n\t/**\n\t * The topic as a dependency — what `.dependsOn([users])` dissolves into,\n\t * reachable as `services.users`.\n\t *\n\t * It is the producer, because publishing is the only thing depending on a\n\t * topic can mean: a subscriber *binds* with `s.topic(…)` instead, and is\n\t * deliberately never handed this. {@link publisher} is the same service\n\t * under its older `<name>Publisher` key.\n\t */\n\tget service(): Service<\n\t\tUncapitalize<TName>,\n\t\tEventPublisher<TopicMessage<TEvents>>\n\t> {\n\t\tconst { register } = this.publisher;\n\n\t\treturn {\n\t\t\tserviceName: serviceKey(this.id) as Uncapitalize<TName>,\n\t\t\tregister,\n\t\t};\n\t}\n\n\tget publisher(): Service<\n\t\t`${TName}Publisher`,\n\t\tEventPublisher<TopicMessage<TEvents>>\n\t> {\n\t\tconst envVar = this.connectionKey;\n\t\treturn {\n\t\t\tserviceName: `${this.name}Publisher`,\n\t\t\tasync register({ envParser }) {\n\t\t\t\tconst { connectionString } = envParser\n\t\t\t\t\t.create((get) => ({\n\t\t\t\t\t\tconnectionString: get(envVar).string(),\n\t\t\t\t\t}))\n\t\t\t\t\t.parse();\n\n\t\t\t\treturn Publisher.fromConnectionString<TopicMessage<TEvents>>(\n\t\t\t\t\tconnectionString as EventPublisherConnectionString,\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n}\n","import type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport { cloneWith } from '../clone';\nimport { Topic, type TopicEvents } from './Topic';\n\n/**\n * Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.\n * The event map is the topic's contract: it types the derived `topic.publisher`\n * and the subscribers that bind via `s.topic(topic)`.\n */\nexport class TopicBuilder<\n\tTName extends string = string,\n\tTEvents extends TopicEvents = TopicEvents,\n> {\n\tprivate _name?: string;\n\tprivate _logger: Logger = DEFAULT_LOGGER;\n\n\t/** The topic name — drives the infra topic and its `<NAME>_*` env vars. */\n\ttopic<T extends string>(name: T): TopicBuilder<T, TEvents> {\n\t\treturn cloneWith(this, { _name: name }) as unknown as TopicBuilder<\n\t\t\tT,\n\t\t\tTEvents\n\t\t>;\n\t}\n\n\tlogger(logger: Logger): this {\n\t\treturn cloneWith(this, { _logger: logger });\n\t}\n\n\t/**\n\t * The event contract — a map of event type → payload schema. Building the\n\t * topic requires this; it's what types the publisher and subscribers.\n\t */\n\tevents<T extends TopicEvents>(events: T): Topic<TName, T> {\n\t\tif (!this._name) {\n\t\t\tthrow new Error(\n\t\t\t\t'Topic requires a name — call .topic(name) before .events().',\n\t\t\t);\n\t\t}\n\n\t\tconst topic = new Topic<TName, T>(\n\t\t\tthis._name as TName,\n\t\t\tevents,\n\t\t\tthis._logger,\n\t\t);\n\n\t\t// No reset. `.events()` reads this builder and leaves it alone, so a\n\t\t// configured base stays usable for the next topic — and two chains off one\n\t\t// base cannot feed each other.\n\t\treturn topic;\n\t}\n}\n","export {\n\tTopic,\n\ttype TopicEvents,\n\ttype TopicMessage,\n} from './Topic';\n\nimport { TopicBuilder } from './TopicBuilder';\n\nexport { TopicBuilder } from './TopicBuilder';\n\nexport const t = new TopicBuilder();\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2CA,IAAa,QAAb,cAGUA,4BAAU;CACnB,eAAe;CAEf,OAAO,QAAQC,KAAiD;AAC/D,SAAO,QACN,OACE,IAAmC,iBAAiB,QACpD,IAAkB,SAASC,gCAAc,MAC3C;CACD;;;;;;;CAQD,AAAS;;;;;CAMT,AAAiB;CAEjB,YACiBC,MAMAC,cAChBC,SAAiBC,2CAChB;AACD,QAAMJ,gCAAc,OAAO,QAAQ,CAAE,GAAE,CAAE,EAAC;EAT1B;EAMA;AAKhB,OAAK,KAAK,sCAAY,KAAK;AAC3B,OAAK,gBAAgB,qCAAW,KAAK,IAAI,4BAA4B;CACrE;;;;;;;;CASD,UAAyB;AACxB,SAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,aAAc;GAI9B,QAAQ,KAAK;GAIb,aAAa,CAAE;EACf,CACD;CACD;;CAGD,IAAI,aAAyC;AAC5C,SAAO,OAAO,KAAK,KAAK,aAAa;CACrC;;;;;;;;;;;;;;;;;;;;CAqBD,IAAI,UAGF;EACD,MAAM,EAAE,UAAU,GAAG,KAAK;AAE1B,SAAO;GACN,aAAa,qCAAW,KAAK,GAAG;GAChC;EACA;CACD;CAED,IAAI,YAGF;EACD,MAAM,SAAS,KAAK;AACpB,SAAO;GACN,cAAc,EAAE,KAAK,KAAK;GAC1B,MAAM,SAAS,EAAE,WAAW,EAAE;IAC7B,MAAM,EAAE,kBAAkB,GAAG,UAC3B,OAAO,CAAC,SAAS,EACjB,kBAAkB,IAAI,OAAO,CAAC,QAAQ,CACtC,GAAE,CACF,OAAO;AAET,WAAO,6BAAU,qBAChB,iBACA;GACD;EACD;CACD;AACD;;;;;;;;;AC9JD,IAAa,eAAb,MAGE;CACD,AAAQ;CACR,AAAQ,UAAkBK;;CAG1B,MAAwBC,MAAmC;AAC1D,SAAO,wBAAU,MAAM,EAAE,OAAO,KAAM,EAAC;CAIvC;CAED,OAAOC,QAAsB;AAC5B,SAAO,wBAAU,MAAM,EAAE,SAAS,OAAQ,EAAC;CAC3C;;;;;CAMD,OAA8BC,QAA4B;AACzD,OAAK,KAAK,MACT,OAAM,IAAI,MACT;EAIF,MAAM,QAAQ,IAAI,MACjB,KAAK,OACL,QACA,KAAK;AAMN,SAAO;CACP;AACD;;;;ACzCD,MAAa,IAAI,IAAI"}
1
+ {"version":3,"file":"index.cjs","names":["DEFAULT_LOGGER","cloneWith","Topic"],"sources":["../../src/topic/TopicBuilder.ts","../../src/topic/index.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport { cloneWith } from '../clone';\nimport { Topic, type TopicEvents } from './Topic';\n\n/**\n * Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.\n * The event map is the topic's contract: it types the derived `topic.publisher`\n * and the subscribers that bind via `s.topic(topic)`.\n */\nexport class TopicBuilder<\n\tTName extends string = string,\n\tTEvents extends TopicEvents = TopicEvents,\n> {\n\tprivate _name?: string;\n\tprivate _logger: Logger = DEFAULT_LOGGER;\n\n\t/** The topic name — drives the infra topic and its `<NAME>_*` env vars. */\n\ttopic<T extends string>(name: T): TopicBuilder<T, TEvents> {\n\t\treturn cloneWith(this, { _name: name }) as unknown as TopicBuilder<\n\t\t\tT,\n\t\t\tTEvents\n\t\t>;\n\t}\n\n\tlogger(logger: Logger): this {\n\t\treturn cloneWith(this, { _logger: logger });\n\t}\n\n\t/**\n\t * The event contract — a map of event type → payload schema. Building the\n\t * topic requires this; it's what types the publisher and subscribers.\n\t */\n\tevents<T extends TopicEvents>(events: T): Topic<TName, T> {\n\t\tif (!this._name) {\n\t\t\tthrow new Error(\n\t\t\t\t'Topic requires a name — call .topic(name) before .events().',\n\t\t\t);\n\t\t}\n\n\t\tconst topic = new Topic<TName, T>(\n\t\t\tthis._name as TName,\n\t\t\tevents,\n\t\t\tthis._logger,\n\t\t);\n\n\t\t// No reset. `.events()` reads this builder and leaves it alone, so a\n\t\t// configured base stays usable for the next topic — and two chains off one\n\t\t// base cannot feed each other.\n\t\treturn topic;\n\t}\n}\n","export {\n\tTopic,\n\ttype TopicEvents,\n\ttype TopicMessage,\n} from './Topic';\n\nimport { TopicBuilder } from './TopicBuilder';\n\nexport { TopicBuilder } from './TopicBuilder';\n\nexport const t = new TopicBuilder();\n"],"mappings":";;;;;;;;;;AAUA,IAAa,eAAb,MAGE;CACD;CACA,UAA0BA,0BAAAA;;CAG1B,MAAwB,MAAmC;EAC1D,OAAOC,cAAAA,UAAU,MAAM,EAAE,OAAO,KAAK,CAAC;CAIvC;CAEA,OAAO,QAAsB;EAC5B,OAAOA,cAAAA,UAAU,MAAM,EAAE,SAAS,OAAO,CAAC;CAC3C;;;;;CAMA,OAA8B,QAA4B;EACzD,IAAI,CAAC,KAAK,OACT,MAAM,IAAI,MACT,6DACD;EAYD,OAAO,IATWC,cAAAA,MACjB,KAAK,OACL,QACA,KAAK,OAMK;CACZ;AACD;;;ACzCA,MAAa,IAAI,IAAI,aAAa"}
@@ -1,32 +1,3 @@
1
- import "../Construct-C0ijr2qp.cjs";
2
- import { Topic, TopicEvents, TopicMessage } from "../Topic-19QeHBIR.cjs";
3
- import { Logger } from "@geekmidas/logger";
4
-
5
- //#region src/topic/TopicBuilder.d.ts
6
-
7
- /**
8
- * Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.
9
- * The event map is the topic's contract: it types the derived `topic.publisher`
10
- * and the subscribers that bind via `s.topic(topic)`.
11
- */
12
- declare class TopicBuilder<TName extends string = string, TEvents extends TopicEvents = TopicEvents> {
13
- private _name?;
14
- private _logger;
15
- /** The topic name — drives the infra topic and its `<NAME>_*` env vars. */
16
- topic<T extends string>(name: T): TopicBuilder<T, TEvents>;
17
- logger(logger: Logger): this;
18
- /**
19
- * The event contract — a map of event type → payload schema. Building the
20
- * topic requires this; it's what types the publisher and subscribers.
21
- */
22
- events<T extends TopicEvents>(events: T): Topic<TName, T>;
23
- }
24
- //# sourceMappingURL=TopicBuilder.d.ts.map
25
- //#endregion
26
- //#region src/topic/index.d.ts
27
- declare const t: TopicBuilder<string, TopicEvents>;
28
- //# sourceMappingURL=index.d.ts.map
29
-
30
- //#endregion
31
- export { Topic, TopicBuilder, TopicEvents, TopicMessage, t };
32
- //# sourceMappingURL=index.d.cts.map
1
+ import { n as TopicEvents, r as TopicMessage, t as Topic } from "../Topic-D6blllEn.cjs";
2
+ import { n as TopicBuilder, t } from "../index-tE_119SX.cjs";
3
+ export { Topic, TopicBuilder, type TopicEvents, type TopicMessage, t };
@@ -1,32 +1,3 @@
1
- import "../Construct-Ct8nalEi.mjs";
2
- import { Topic, TopicEvents, TopicMessage } from "../Topic-DuFeqkBh.mjs";
3
- import { Logger } from "@geekmidas/logger";
4
-
5
- //#region src/topic/TopicBuilder.d.ts
6
-
7
- /**
8
- * Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.
9
- * The event map is the topic's contract: it types the derived `topic.publisher`
10
- * and the subscribers that bind via `s.topic(topic)`.
11
- */
12
- declare class TopicBuilder<TName extends string = string, TEvents extends TopicEvents = TopicEvents> {
13
- private _name?;
14
- private _logger;
15
- /** The topic name — drives the infra topic and its `<NAME>_*` env vars. */
16
- topic<T extends string>(name: T): TopicBuilder<T, TEvents>;
17
- logger(logger: Logger): this;
18
- /**
19
- * The event contract — a map of event type → payload schema. Building the
20
- * topic requires this; it's what types the publisher and subscribers.
21
- */
22
- events<T extends TopicEvents>(events: T): Topic<TName, T>;
23
- }
24
- //# sourceMappingURL=TopicBuilder.d.ts.map
25
- //#endregion
26
- //#region src/topic/index.d.ts
27
- declare const t: TopicBuilder<string, TopicEvents>;
28
- //# sourceMappingURL=index.d.ts.map
29
-
30
- //#endregion
31
- export { Topic, TopicBuilder, TopicEvents, TopicMessage, t };
32
- //# sourceMappingURL=index.d.mts.map
1
+ import { n as TopicEvents, r as TopicMessage, t as Topic } from "../Topic-DVvheJ_-.mjs";
2
+ import { n as TopicBuilder, t } from "../index-fnpjXiA-.mjs";
3
+ export { Topic, TopicBuilder, type TopicEvents, type TopicMessage, t };
@@ -1,103 +1,6 @@
1
- import { Construct, ConstructType } from "../Construct-BD5neF7w.mjs";
2
- import { cloneWith } from "../clone-DblgEZZa.mjs";
3
- import { canonicalId, provideKey, serviceKey } from "@geekmidas/manifest";
1
+ import { t as cloneWith } from "../clone-EKNovYHu.mjs";
2
+ import { t as Topic } from "../Topic-Ct3Le8Wt.mjs";
4
3
  import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
5
- import { Publisher } from "@geekmidas/events";
6
-
7
- //#region src/topic/Topic.ts
8
- /**
9
- * A topic — pub/sub fan-out. Unlike a `Queue` (point-to-point, one consumer), a
10
- * topic is a *resource* owned by no single handler: it declares the event
11
- * contract, derives a typed producer (`topic.publisher`), and any number of
12
- * subscribers (`s.topic(topic)`) bind to it. `gkm build` discovers it into the
13
- * manifest's `topics` field; infra provisions an SNS topic.
14
- *
15
- * This replaces hand-writing a publisher `Service`: the publisher is *derived*
16
- * from the declared event contract, the same way `Queue` derives its publisher.
17
- */
18
- var Topic = class extends Construct {
19
- __IS_TOPIC__ = true;
20
- static isTopic(obj) {
21
- return Boolean(obj && obj.__IS_TOPIC__ === true && obj.type === ConstructType.Topic);
22
- }
23
- /**
24
- * The canonical id this topic is declared under.
25
- *
26
- * Derived from the name, so `users` and `Users` are one topic. The name is
27
- * left alone: subscribers bind to it and it is what the broker routes on.
28
- */
29
- id;
30
- /**
31
- * The producer's env key, read by both {@link declare} and
32
- * {@link publisher} so the two cannot drift.
33
- */
34
- connectionKey;
35
- constructor(name, eventSchemas, logger = DEFAULT_LOGGER) {
36
- super(ConstructType.Topic, logger, [], []);
37
- this.name = name;
38
- this.eventSchemas = eventSchemas;
39
- this.id = canonicalId(name);
40
- this.connectionKey = provideKey(this.id, "publisherConnectionString");
41
- }
42
- /**
43
- * What this topic is in the manifest.
44
- *
45
- * Only the producer's key: a subscriber is *bound* to a topic rather than
46
- * depending on it, so the binding is an edge the deploy target reads and not
47
- * an env key anyone can hold. Locally both sides meet on the same broker.
48
- */
49
- declare() {
50
- return [{
51
- kind: "topic",
52
- id: this.id,
53
- provides: [this.connectionKey],
54
- events: this.eventTypes,
55
- subscribers: []
56
- }];
57
- }
58
- /** The event type names this topic carries. */
59
- get eventTypes() {
60
- return Object.keys(this.eventSchemas);
61
- }
62
- /**
63
- * The producer side — a `Service` exposing an `EventPublisher` typed to the
64
- * union of this topic's events. Inject via `.publisher(topic.publisher)` (for
65
- * declarative `.event(...)`) or `.services([topic.publisher])` (to publish
66
- * imperatively). Reads `<NAME>_PUBLISHER_CONNECTION_STRING` and selects the
67
- * transport from the URL protocol — `pgboss://` locally, `sns://` deployed.
68
- *
69
- * Because it's a `Service`, the connection-string requirement is sniffed into
70
- * the manifest of whatever construct injects it (least-privilege linking).
71
- */
72
- /**
73
- * The topic as a dependency — what `.dependsOn([users])` dissolves into,
74
- * reachable as `services.users`.
75
- *
76
- * It is the producer, because publishing is the only thing depending on a
77
- * topic can mean: a subscriber *binds* with `s.topic(…)` instead, and is
78
- * deliberately never handed this. {@link publisher} is the same service
79
- * under its older `<name>Publisher` key.
80
- */
81
- get service() {
82
- const { register } = this.publisher;
83
- return {
84
- serviceName: serviceKey(this.id),
85
- register
86
- };
87
- }
88
- get publisher() {
89
- const envVar = this.connectionKey;
90
- return {
91
- serviceName: `${this.name}Publisher`,
92
- async register({ envParser }) {
93
- const { connectionString } = envParser.create((get) => ({ connectionString: get(envVar).string() })).parse();
94
- return Publisher.fromConnectionString(connectionString);
95
- }
96
- };
97
- }
98
- };
99
-
100
- //#endregion
101
4
  //#region src/topic/TopicBuilder.ts
102
5
  /**
103
6
  * Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.
@@ -120,15 +23,13 @@ var TopicBuilder = class {
120
23
  */
121
24
  events(events) {
122
25
  if (!this._name) throw new Error("Topic requires a name — call .topic(name) before .events().");
123
- const topic = new Topic(this._name, events, this._logger);
124
- return topic;
26
+ return new Topic(this._name, events, this._logger);
125
27
  }
126
28
  };
127
-
128
29
  //#endregion
129
30
  //#region src/topic/index.ts
130
31
  const t = new TopicBuilder();
131
-
132
32
  //#endregion
133
33
  export { Topic, TopicBuilder, t };
34
+
134
35
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["obj: unknown","name: TName","eventSchemas: TEvents","logger: Logger","name: T","logger: Logger","events: T"],"sources":["../../src/topic/Topic.ts","../../src/topic/TopicBuilder.ts","../../src/topic/index.ts"],"sourcesContent":["import {\n\ttype EventPublisher,\n\ttype EventPublisherConnectionString,\n\ttype PublishableMessage,\n\tPublisher,\n} from '@geekmidas/events';\nimport type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport {\n\tcanonicalId,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { InferStandardSchema } from '@geekmidas/schema';\nimport type { Service } from '@geekmidas/services';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { Construct, ConstructType } from '../Construct';\n\n/** A topic's event contract — a map of event type → payload schema. */\nexport type TopicEvents = Record<string, StandardSchemaV1>;\n\n/**\n * The union of wire messages a topic carries, derived from its event map:\n * `{ type: 'user.created'; payload: … } | { type: 'user.updated'; payload: … }`.\n */\nexport type TopicMessage<TEvents extends TopicEvents> = {\n\t[K in keyof TEvents & string]: PublishableMessage<\n\t\tK,\n\t\tInferStandardSchema<TEvents[K]>\n\t>;\n}[keyof TEvents & string];\n\n/**\n * A topic — pub/sub fan-out. Unlike a `Queue` (point-to-point, one consumer), a\n * topic is a *resource* owned by no single handler: it declares the event\n * contract, derives a typed producer (`topic.publisher`), and any number of\n * subscribers (`s.topic(topic)`) bind to it. `gkm build` discovers it into the\n * manifest's `topics` field; infra provisions an SNS topic.\n *\n * This replaces hand-writing a publisher `Service`: the publisher is *derived*\n * from the declared event contract, the same way `Queue` derives its publisher.\n */\nexport class Topic<\n\tTName extends string = string,\n\tTEvents extends TopicEvents = TopicEvents,\n> extends Construct {\n\t__IS_TOPIC__ = true;\n\n\tstatic isTopic(obj: unknown): obj is Topic<string, TopicEvents> {\n\t\treturn Boolean(\n\t\t\tobj &&\n\t\t\t\t(obj as { __IS_TOPIC__?: boolean }).__IS_TOPIC__ === true &&\n\t\t\t\t(obj as Construct).type === ConstructType.Topic,\n\t\t);\n\t}\n\n\t/**\n\t * The canonical id this topic is declared under.\n\t *\n\t * Derived from the name, so `users` and `Users` are one topic. The name is\n\t * left alone: subscribers bind to it and it is what the broker routes on.\n\t */\n\treadonly id: string;\n\n\t/**\n\t * The producer's env key, read by both {@link declare} and\n\t * {@link publisher} so the two cannot drift.\n\t */\n\tprivate readonly connectionKey: string;\n\n\tconstructor(\n\t\tpublic readonly name: TName,\n\t\t/**\n\t\t * The event contract — a map of event type → payload schema. Named\n\t\t * `eventSchemas` (not `events`) to avoid clashing with `Construct.events`,\n\t\t * which is the array of `MappedEvent`s a construct *publishes*.\n\t\t */\n\t\tpublic readonly eventSchemas: TEvents,\n\t\tlogger: Logger = DEFAULT_LOGGER,\n\t) {\n\t\tsuper(ConstructType.Topic, logger, [], []);\n\n\t\tthis.id = canonicalId(name);\n\t\tthis.connectionKey = provideKey(this.id, 'publisherConnectionString');\n\t}\n\n\t/**\n\t * What this topic is in the manifest.\n\t *\n\t * Only the producer's key: a subscriber is *bound* to a topic rather than\n\t * depending on it, so the binding is an edge the deploy target reads and not\n\t * an env key anyone can hold. Locally both sides meet on the same broker.\n\t */\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'topic',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.connectionKey],\n\t\t\t\t// The contract this topic carries. Structural: which events exist\n\t\t\t\t// is a fact about the application, and a subscriber binding to one\n\t\t\t\t// that does not is a mistake worth catching at build.\n\t\t\t\tevents: this.eventTypes,\n\t\t\t\t// Bound rather than declared here — a subscriber names the topic,\n\t\t\t\t// not the other way round — so the build fills these from what it\n\t\t\t\t// found. Nested when it does, because position is the trigger.\n\t\t\t\tsubscribers: [],\n\t\t\t},\n\t\t];\n\t}\n\n\t/** The event type names this topic carries. */\n\tget eventTypes(): (keyof TEvents & string)[] {\n\t\treturn Object.keys(this.eventSchemas) as (keyof TEvents & string)[];\n\t}\n\n\t/**\n\t * The producer side — a `Service` exposing an `EventPublisher` typed to the\n\t * union of this topic's events. Inject via `.publisher(topic.publisher)` (for\n\t * declarative `.event(...)`) or `.services([topic.publisher])` (to publish\n\t * imperatively). Reads `<NAME>_PUBLISHER_CONNECTION_STRING` and selects the\n\t * transport from the URL protocol — `pgboss://` locally, `sns://` deployed.\n\t *\n\t * Because it's a `Service`, the connection-string requirement is sniffed into\n\t * the manifest of whatever construct injects it (least-privilege linking).\n\t */\n\t/**\n\t * The topic as a dependency — what `.dependsOn([users])` dissolves into,\n\t * reachable as `services.users`.\n\t *\n\t * It is the producer, because publishing is the only thing depending on a\n\t * topic can mean: a subscriber *binds* with `s.topic(…)` instead, and is\n\t * deliberately never handed this. {@link publisher} is the same service\n\t * under its older `<name>Publisher` key.\n\t */\n\tget service(): Service<\n\t\tUncapitalize<TName>,\n\t\tEventPublisher<TopicMessage<TEvents>>\n\t> {\n\t\tconst { register } = this.publisher;\n\n\t\treturn {\n\t\t\tserviceName: serviceKey(this.id) as Uncapitalize<TName>,\n\t\t\tregister,\n\t\t};\n\t}\n\n\tget publisher(): Service<\n\t\t`${TName}Publisher`,\n\t\tEventPublisher<TopicMessage<TEvents>>\n\t> {\n\t\tconst envVar = this.connectionKey;\n\t\treturn {\n\t\t\tserviceName: `${this.name}Publisher`,\n\t\t\tasync register({ envParser }) {\n\t\t\t\tconst { connectionString } = envParser\n\t\t\t\t\t.create((get) => ({\n\t\t\t\t\t\tconnectionString: get(envVar).string(),\n\t\t\t\t\t}))\n\t\t\t\t\t.parse();\n\n\t\t\t\treturn Publisher.fromConnectionString<TopicMessage<TEvents>>(\n\t\t\t\t\tconnectionString as EventPublisherConnectionString,\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n}\n","import type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport { cloneWith } from '../clone';\nimport { Topic, type TopicEvents } from './Topic';\n\n/**\n * Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.\n * The event map is the topic's contract: it types the derived `topic.publisher`\n * and the subscribers that bind via `s.topic(topic)`.\n */\nexport class TopicBuilder<\n\tTName extends string = string,\n\tTEvents extends TopicEvents = TopicEvents,\n> {\n\tprivate _name?: string;\n\tprivate _logger: Logger = DEFAULT_LOGGER;\n\n\t/** The topic name — drives the infra topic and its `<NAME>_*` env vars. */\n\ttopic<T extends string>(name: T): TopicBuilder<T, TEvents> {\n\t\treturn cloneWith(this, { _name: name }) as unknown as TopicBuilder<\n\t\t\tT,\n\t\t\tTEvents\n\t\t>;\n\t}\n\n\tlogger(logger: Logger): this {\n\t\treturn cloneWith(this, { _logger: logger });\n\t}\n\n\t/**\n\t * The event contract — a map of event type → payload schema. Building the\n\t * topic requires this; it's what types the publisher and subscribers.\n\t */\n\tevents<T extends TopicEvents>(events: T): Topic<TName, T> {\n\t\tif (!this._name) {\n\t\t\tthrow new Error(\n\t\t\t\t'Topic requires a name — call .topic(name) before .events().',\n\t\t\t);\n\t\t}\n\n\t\tconst topic = new Topic<TName, T>(\n\t\t\tthis._name as TName,\n\t\t\tevents,\n\t\t\tthis._logger,\n\t\t);\n\n\t\t// No reset. `.events()` reads this builder and leaves it alone, so a\n\t\t// configured base stays usable for the next topic — and two chains off one\n\t\t// base cannot feed each other.\n\t\treturn topic;\n\t}\n}\n","export {\n\tTopic,\n\ttype TopicEvents,\n\ttype TopicMessage,\n} from './Topic';\n\nimport { TopicBuilder } from './TopicBuilder';\n\nexport { TopicBuilder } from './TopicBuilder';\n\nexport const t = new TopicBuilder();\n"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,IAAa,QAAb,cAGU,UAAU;CACnB,eAAe;CAEf,OAAO,QAAQA,KAAiD;AAC/D,SAAO,QACN,OACE,IAAmC,iBAAiB,QACpD,IAAkB,SAAS,cAAc,MAC3C;CACD;;;;;;;CAQD,AAAS;;;;;CAMT,AAAiB;CAEjB,YACiBC,MAMAC,cAChBC,SAAiB,gBAChB;AACD,QAAM,cAAc,OAAO,QAAQ,CAAE,GAAE,CAAE,EAAC;EAT1B;EAMA;AAKhB,OAAK,KAAK,YAAY,KAAK;AAC3B,OAAK,gBAAgB,WAAW,KAAK,IAAI,4BAA4B;CACrE;;;;;;;;CASD,UAAyB;AACxB,SAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,aAAc;GAI9B,QAAQ,KAAK;GAIb,aAAa,CAAE;EACf,CACD;CACD;;CAGD,IAAI,aAAyC;AAC5C,SAAO,OAAO,KAAK,KAAK,aAAa;CACrC;;;;;;;;;;;;;;;;;;;;CAqBD,IAAI,UAGF;EACD,MAAM,EAAE,UAAU,GAAG,KAAK;AAE1B,SAAO;GACN,aAAa,WAAW,KAAK,GAAG;GAChC;EACA;CACD;CAED,IAAI,YAGF;EACD,MAAM,SAAS,KAAK;AACpB,SAAO;GACN,cAAc,EAAE,KAAK,KAAK;GAC1B,MAAM,SAAS,EAAE,WAAW,EAAE;IAC7B,MAAM,EAAE,kBAAkB,GAAG,UAC3B,OAAO,CAAC,SAAS,EACjB,kBAAkB,IAAI,OAAO,CAAC,QAAQ,CACtC,GAAE,CACF,OAAO;AAET,WAAO,UAAU,qBAChB,iBACA;GACD;EACD;CACD;AACD;;;;;;;;;AC9JD,IAAa,eAAb,MAGE;CACD,AAAQ;CACR,AAAQ,UAAkB;;CAG1B,MAAwBC,MAAmC;AAC1D,SAAO,UAAU,MAAM,EAAE,OAAO,KAAM,EAAC;CAIvC;CAED,OAAOC,QAAsB;AAC5B,SAAO,UAAU,MAAM,EAAE,SAAS,OAAQ,EAAC;CAC3C;;;;;CAMD,OAA8BC,QAA4B;AACzD,OAAK,KAAK,MACT,OAAM,IAAI,MACT;EAIF,MAAM,QAAQ,IAAI,MACjB,KAAK,OACL,QACA,KAAK;AAMN,SAAO;CACP;AACD;;;;ACzCD,MAAa,IAAI,IAAI"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/topic/TopicBuilder.ts","../../src/topic/index.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport { cloneWith } from '../clone';\nimport { Topic, type TopicEvents } from './Topic';\n\n/**\n * Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.\n * The event map is the topic's contract: it types the derived `topic.publisher`\n * and the subscribers that bind via `s.topic(topic)`.\n */\nexport class TopicBuilder<\n\tTName extends string = string,\n\tTEvents extends TopicEvents = TopicEvents,\n> {\n\tprivate _name?: string;\n\tprivate _logger: Logger = DEFAULT_LOGGER;\n\n\t/** The topic name — drives the infra topic and its `<NAME>_*` env vars. */\n\ttopic<T extends string>(name: T): TopicBuilder<T, TEvents> {\n\t\treturn cloneWith(this, { _name: name }) as unknown as TopicBuilder<\n\t\t\tT,\n\t\t\tTEvents\n\t\t>;\n\t}\n\n\tlogger(logger: Logger): this {\n\t\treturn cloneWith(this, { _logger: logger });\n\t}\n\n\t/**\n\t * The event contract — a map of event type → payload schema. Building the\n\t * topic requires this; it's what types the publisher and subscribers.\n\t */\n\tevents<T extends TopicEvents>(events: T): Topic<TName, T> {\n\t\tif (!this._name) {\n\t\t\tthrow new Error(\n\t\t\t\t'Topic requires a name — call .topic(name) before .events().',\n\t\t\t);\n\t\t}\n\n\t\tconst topic = new Topic<TName, T>(\n\t\t\tthis._name as TName,\n\t\t\tevents,\n\t\t\tthis._logger,\n\t\t);\n\n\t\t// No reset. `.events()` reads this builder and leaves it alone, so a\n\t\t// configured base stays usable for the next topic — and two chains off one\n\t\t// base cannot feed each other.\n\t\treturn topic;\n\t}\n}\n","export {\n\tTopic,\n\ttype TopicEvents,\n\ttype TopicMessage,\n} from './Topic';\n\nimport { TopicBuilder } from './TopicBuilder';\n\nexport { TopicBuilder } from './TopicBuilder';\n\nexport const t = new TopicBuilder();\n"],"mappings":";;;;;;;;;AAUA,IAAa,eAAb,MAGE;CACD;CACA,UAA0B;;CAG1B,MAAwB,MAAmC;EAC1D,OAAO,UAAU,MAAM,EAAE,OAAO,KAAK,CAAC;CAIvC;CAEA,OAAO,QAAsB;EAC5B,OAAO,UAAU,MAAM,EAAE,SAAS,OAAO,CAAC;CAC3C;;;;;CAMA,OAA8B,QAA4B;EACzD,IAAI,CAAC,KAAK,OACT,MAAM,IAAI,MACT,6DACD;EAYD,OAAO,IATW,MACjB,KAAK,OACL,QACA,KAAK,OAMK;CACZ;AACD;;;ACzCA,MAAa,IAAI,IAAI,aAAa"}
@@ -1,9 +1,7 @@
1
1
  //#region src/types.d.ts
2
- type RemoveUndefined<T> = { [K in keyof T as T[K] extends undefined ? never : K]: T[K] };
2
+ type RemoveUndefined<T> = { [K in keyof T as T[K] extends undefined ? never : K]: T[K]; };
3
3
  type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
4
4
  type LowerHttpMethod<T extends HttpMethod> = Lowercase<T>;
5
- //# sourceMappingURL=types.d.ts.map
6
-
7
5
  //#endregion
8
- export { HttpMethod, LowerHttpMethod, RemoveUndefined };
9
- //# sourceMappingURL=types-BlAkSuGI.d.cts.map
6
+ export { LowerHttpMethod as n, RemoveUndefined as r, HttpMethod as t };
7
+ //# sourceMappingURL=types-DMuSQeLL.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DMuSQeLL.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";KAAY,gBAAgB,QAC1B,WAAW,KAAK,EAAE,+BAA+B,IAAI,EAAE;KAG7C;KAQA,gBAAgB,UAAU,cAAc,UAAU"}
@@ -1,9 +1,7 @@
1
1
  //#region src/types.d.ts
2
- type RemoveUndefined<T> = { [K in keyof T as T[K] extends undefined ? never : K]: T[K] };
2
+ type RemoveUndefined<T> = { [K in keyof T as T[K] extends undefined ? never : K]: T[K]; };
3
3
  type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
4
4
  type LowerHttpMethod<T extends HttpMethod> = Lowercase<T>;
5
- //# sourceMappingURL=types.d.ts.map
6
-
7
5
  //#endregion
8
- export { HttpMethod, LowerHttpMethod, RemoveUndefined };
9
- //# sourceMappingURL=types-aKksMEWL.d.mts.map
6
+ export { LowerHttpMethod as n, RemoveUndefined as r, HttpMethod as t };
7
+ //# sourceMappingURL=types-DMuSQeLL.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DMuSQeLL.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";KAAY,gBAAgB,QAC1B,WAAW,KAAK,EAAE,+BAA+B,IAAI,EAAE;KAG7C;KAQA,gBAAgB,UAAU,cAAc,UAAU"}
package/dist/types.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { HttpMethod, LowerHttpMethod, RemoveUndefined } from "./types-BlAkSuGI.cjs";
1
+ import { n as LowerHttpMethod, r as RemoveUndefined, t as HttpMethod } from "./types-DMuSQeLL.cjs";
2
2
  export { HttpMethod, LowerHttpMethod, RemoveUndefined };
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { HttpMethod, LowerHttpMethod, RemoveUndefined } from "./types-aKksMEWL.mjs";
1
+ import { n as LowerHttpMethod, r as RemoveUndefined, t as HttpMethod } from "./types-DMuSQeLL.mjs";
2
2
  export { HttpMethod, LowerHttpMethod, RemoveUndefined };
package/dist/types.mjs CHANGED
@@ -0,0 +1 @@
1
+ export {};