@geekmidas/constructs 10.0.0-alpha.9 → 10.0.0-alpha.90

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 (425) hide show
  1. package/README.md +222 -158
  2. package/dist/{Construct-BD5neF7w.mjs → Construct-B1vGBPme.mjs} +33 -34
  3. package/dist/Construct-B1vGBPme.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-DUSXuTHP.cjs} +53 -48
  7. package/dist/Construct-DUSXuTHP.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-DmQ8vQ4b.d.cts → Cron-DI3nKoic.d.cts} +15 -9
  11. package/dist/Cron-DI3nKoic.d.cts.map +1 -0
  12. package/dist/{Cron-dh4rUgib.d.mts → Cron-uYAHPnp7.d.mts} +15 -9
  13. package/dist/Cron-uYAHPnp7.d.mts.map +1 -0
  14. package/dist/{CronBuilder-Da0C0edR.cjs → CronBuilder-C0Ek1-RA.cjs} +47 -31
  15. package/dist/CronBuilder-C0Ek1-RA.cjs.map +1 -0
  16. package/dist/CronBuilder-DaSUm2Na.d.mts +47 -0
  17. package/dist/CronBuilder-DaSUm2Na.d.mts.map +1 -0
  18. package/dist/{CronBuilder-CYKT5RiO.mjs → CronBuilder-Dmix_Pen.mjs} +37 -21
  19. package/dist/CronBuilder-Dmix_Pen.mjs.map +1 -0
  20. package/dist/CronBuilder-g1lZLWyG.d.cts +47 -0
  21. package/dist/CronBuilder-g1lZLWyG.d.cts.map +1 -0
  22. package/dist/{Endpoint-DCQPMdUX.mjs → Endpoint-BG4UJ9oA.mjs} +146 -109
  23. package/dist/Endpoint-BG4UJ9oA.mjs.map +1 -0
  24. package/dist/{Endpoint-DcWXE-SZ.cjs → Endpoint-BoUg8ocM.cjs} +174 -131
  25. package/dist/Endpoint-BoUg8ocM.cjs.map +1 -0
  26. package/dist/{Endpoint-BjWKinFA.d.mts → Endpoint-Du-NwPX2.d.mts} +83 -91
  27. package/dist/Endpoint-Du-NwPX2.d.mts.map +1 -0
  28. package/dist/{Endpoint-dav89W6-.d.cts → Endpoint-aCvBMPoH.d.cts} +82 -90
  29. package/dist/Endpoint-aCvBMPoH.d.cts.map +1 -0
  30. package/dist/{EndpointFactory-CjV8F_lJ.mjs → EndpointFactory-BDtsrEvJ.mjs} +57 -76
  31. package/dist/EndpointFactory-BDtsrEvJ.mjs.map +1 -0
  32. package/dist/{EndpointFactory-CdWB7wPw.cjs → EndpointFactory-DJ7gXLpR.cjs} +93 -112
  33. package/dist/EndpointFactory-DJ7gXLpR.cjs.map +1 -0
  34. package/dist/{index-Bd5FqCoe.d.cts → EndpointFactory-DMYdJCOj.d.mts} +78 -134
  35. package/dist/EndpointFactory-DMYdJCOj.d.mts.map +1 -0
  36. package/dist/{index-lAO9egTb.d.mts → EndpointFactory-I7s1co3Y.d.cts} +79 -135
  37. package/dist/EndpointFactory-I7s1co3Y.d.cts.map +1 -0
  38. package/dist/Function-DuqGcbOI.d.mts +76 -0
  39. package/dist/Function-DuqGcbOI.d.mts.map +1 -0
  40. package/dist/Function-Pu-1kKZz.d.cts +76 -0
  41. package/dist/Function-Pu-1kKZz.d.cts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-P1ahhZHu.mjs → HonoEndpointAdaptor-PtPlbeKY.mjs} +75 -56
  43. package/dist/HonoEndpointAdaptor-PtPlbeKY.mjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-DtL9j19R.cjs → HonoEndpointAdaptor-zVzVLJEO.cjs} +83 -61
  45. package/dist/HonoEndpointAdaptor-zVzVLJEO.cjs.map +1 -0
  46. package/dist/Queue-A3wfD0it.cjs +109 -0
  47. package/dist/Queue-A3wfD0it.cjs.map +1 -0
  48. package/dist/Queue-D6USGS4q.mjs +104 -0
  49. package/dist/Queue-D6USGS4q.mjs.map +1 -0
  50. package/dist/{Queue-D7ZuwBhy.d.cts → Queue-DlsHRzUp.d.mts} +48 -48
  51. package/dist/Queue-DlsHRzUp.d.mts.map +1 -0
  52. package/dist/{Queue-gVGfi2Yk.d.mts → Queue-HPyi0e1i.d.cts} +49 -49
  53. package/dist/Queue-HPyi0e1i.d.cts.map +1 -0
  54. package/dist/QueueBuilder-BjuF0UBl.cjs +135 -0
  55. package/dist/QueueBuilder-BjuF0UBl.cjs.map +1 -0
  56. package/dist/QueueBuilder-Cue73M4t.mjs +118 -0
  57. package/dist/QueueBuilder-Cue73M4t.mjs.map +1 -0
  58. package/dist/QueueBuilder-OSi6LkV9.d.cts +75 -0
  59. package/dist/QueueBuilder-OSi6LkV9.d.cts.map +1 -0
  60. package/dist/QueueBuilder-QHsnVt1P.d.mts +75 -0
  61. package/dist/QueueBuilder-QHsnVt1P.d.mts.map +1 -0
  62. package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-Bpp02cGr.d.cts} +29 -20
  63. package/dist/Subscriber-Bpp02cGr.d.cts.map +1 -0
  64. package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-CtN9R48-.d.mts} +29 -20
  65. package/dist/Subscriber-CtN9R48-.d.mts.map +1 -0
  66. package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-CDy4nHCz.mjs} +50 -24
  67. package/dist/SubscriberBuilder-CDy4nHCz.mjs.map +1 -0
  68. package/dist/SubscriberBuilder-CuCMFpYW.d.mts +67 -0
  69. package/dist/SubscriberBuilder-CuCMFpYW.d.mts.map +1 -0
  70. package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-D_owVoHo.cjs} +61 -36
  71. package/dist/SubscriberBuilder-D_owVoHo.cjs.map +1 -0
  72. package/dist/SubscriberBuilder-g3fAVWgs.d.cts +67 -0
  73. package/dist/SubscriberBuilder-g3fAVWgs.d.cts.map +1 -0
  74. package/dist/Topic-D74b5cgs.mjs +99 -0
  75. package/dist/Topic-D74b5cgs.mjs.map +1 -0
  76. package/dist/Topic-GHxcU8AG.cjs +104 -0
  77. package/dist/Topic-GHxcU8AG.cjs.map +1 -0
  78. package/dist/adaptors/aws.cjs +131 -220
  79. package/dist/adaptors/aws.cjs.map +1 -1
  80. package/dist/adaptors/aws.d.cts +34 -53
  81. package/dist/adaptors/aws.d.cts.map +1 -1
  82. package/dist/adaptors/aws.d.mts +34 -53
  83. package/dist/adaptors/aws.d.mts.map +1 -1
  84. package/dist/adaptors/aws.mjs +102 -193
  85. package/dist/adaptors/aws.mjs.map +1 -1
  86. package/dist/adaptors/hono.cjs +3 -10
  87. package/dist/adaptors/hono.d.cts +7 -16
  88. package/dist/adaptors/hono.d.cts.map +1 -1
  89. package/dist/adaptors/hono.d.mts +8 -17
  90. package/dist/adaptors/hono.d.mts.map +1 -1
  91. package/dist/adaptors/hono.mjs +2 -10
  92. package/dist/adaptors/testing.cjs +743 -89
  93. package/dist/adaptors/testing.cjs.map +1 -1
  94. package/dist/adaptors/testing.d.cts +351 -54
  95. package/dist/adaptors/testing.d.cts.map +1 -1
  96. package/dist/adaptors/testing.d.mts +351 -54
  97. package/dist/adaptors/testing.d.mts.map +1 -1
  98. package/dist/adaptors/testing.mjs +706 -70
  99. package/dist/adaptors/testing.mjs.map +1 -1
  100. package/dist/auth-BMCJN30Y.d.cts +268 -0
  101. package/dist/auth-BMCJN30Y.d.cts.map +1 -0
  102. package/dist/auth-CcuceLYo.d.mts +268 -0
  103. package/dist/auth-CcuceLYo.d.mts.map +1 -0
  104. package/dist/auth.cjs +301 -33
  105. package/dist/auth.cjs.map +1 -1
  106. package/dist/auth.d.cts +2 -108
  107. package/dist/auth.d.mts +2 -108
  108. package/dist/auth.mjs +289 -27
  109. package/dist/auth.mjs.map +1 -1
  110. package/dist/{cache-BrRz3fEB.d.mts → cache-CXh6GIgb.d.mts} +3 -6
  111. package/dist/cache-CXh6GIgb.d.mts.map +1 -0
  112. package/dist/{cache-BtZY_tHe.d.cts → cache-DnGDGly3.d.cts} +3 -6
  113. package/dist/cache-DnGDGly3.d.cts.map +1 -0
  114. package/dist/cache.cjs +68 -2
  115. package/dist/cache.cjs.map +1 -0
  116. package/dist/cache.d.cts +1 -2
  117. package/dist/cache.d.mts +1 -2
  118. package/dist/cache.mjs +67 -2
  119. package/dist/cache.mjs.map +1 -0
  120. package/dist/cipher-C1lEFX63.mjs +225 -0
  121. package/dist/cipher-C1lEFX63.mjs.map +1 -0
  122. package/dist/cipher-CVxfwLjk.cjs +332 -0
  123. package/dist/cipher-CVxfwLjk.cjs.map +1 -0
  124. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  125. package/dist/clone-EKNovYHu.mjs.map +1 -0
  126. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  127. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  128. package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-B1AfqRl4.d.cts} +42 -11
  129. package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
  130. package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-DluK3_da.d.mts} +42 -11
  131. package/dist/construct-interface-DluK3_da.d.mts.map +1 -0
  132. package/dist/construct-interface.cjs +113 -7
  133. package/dist/construct-interface.cjs.map +1 -0
  134. package/dist/construct-interface.d.cts +2 -2
  135. package/dist/construct-interface.d.mts +2 -2
  136. package/dist/construct-interface.mjs +106 -2
  137. package/dist/construct-interface.mjs.map +1 -0
  138. package/dist/credential.cjs +77 -17
  139. package/dist/credential.cjs.map +1 -1
  140. package/dist/credential.d.cts +34 -9
  141. package/dist/credential.d.cts.map +1 -1
  142. package/dist/credential.d.mts +34 -9
  143. package/dist/credential.d.mts.map +1 -1
  144. package/dist/credential.mjs +71 -13
  145. package/dist/credential.mjs.map +1 -1
  146. package/dist/crons/index.cjs +129 -7
  147. package/dist/crons/index.cjs.map +1 -1
  148. package/dist/crons/index.d.cts +45 -11
  149. package/dist/crons/index.d.cts.map +1 -1
  150. package/dist/crons/index.d.mts +45 -11
  151. package/dist/crons/index.d.mts.map +1 -1
  152. package/dist/crons/index.mjs +127 -8
  153. package/dist/crons/index.mjs.map +1 -1
  154. package/dist/database/kysely.cjs +4 -181
  155. package/dist/database/kysely.d.cts +2 -152
  156. package/dist/database/kysely.d.mts +2 -152
  157. package/dist/database/kysely.mjs +2 -180
  158. package/dist/email.cjs +25 -12
  159. package/dist/email.cjs.map +1 -1
  160. package/dist/email.d.cts +3 -7
  161. package/dist/email.d.cts.map +1 -1
  162. package/dist/email.d.mts +3 -7
  163. package/dist/email.d.mts.map +1 -1
  164. package/dist/email.mjs +16 -3
  165. package/dist/email.mjs.map +1 -1
  166. package/dist/encryption.cjs +96 -0
  167. package/dist/encryption.cjs.map +1 -0
  168. package/dist/encryption.d.cts +117 -0
  169. package/dist/encryption.d.cts.map +1 -0
  170. package/dist/encryption.d.mts +117 -0
  171. package/dist/encryption.d.mts.map +1 -0
  172. package/dist/encryption.mjs +83 -0
  173. package/dist/encryption.mjs.map +1 -0
  174. package/dist/endpoints/index.cjs +8 -10
  175. package/dist/endpoints/index.d.cts +51 -7
  176. package/dist/endpoints/index.d.cts.map +1 -0
  177. package/dist/endpoints/index.d.mts +51 -7
  178. package/dist/endpoints/index.d.mts.map +1 -0
  179. package/dist/endpoints/index.mjs +6 -10
  180. package/dist/external-api-MJ8id87V.d.mts +105 -0
  181. package/dist/external-api-MJ8id87V.d.mts.map +1 -0
  182. package/dist/external-api-O107yzZJ.d.cts +105 -0
  183. package/dist/external-api-O107yzZJ.d.cts.map +1 -0
  184. package/dist/external-api.cjs +142 -0
  185. package/dist/external-api.cjs.map +1 -0
  186. package/dist/external-api.d.cts +2 -0
  187. package/dist/external-api.d.mts +2 -0
  188. package/dist/external-api.mjs +139 -0
  189. package/dist/external-api.mjs.map +1 -0
  190. package/dist/file-server.cjs +42 -10
  191. package/dist/file-server.cjs.map +1 -1
  192. package/dist/file-server.d.cts +6 -10
  193. package/dist/file-server.d.cts.map +1 -1
  194. package/dist/file-server.d.mts +6 -10
  195. package/dist/file-server.d.mts.map +1 -1
  196. package/dist/file-server.mjs +34 -2
  197. package/dist/file-server.mjs.map +1 -1
  198. package/dist/functions/index.cjs +3 -6
  199. package/dist/functions/index.d.cts +3 -4
  200. package/dist/functions/index.d.mts +3 -4
  201. package/dist/functions/index.mjs +2 -6
  202. package/dist/{functions-14lpEFL4.mjs → functions-BFizikJU.mjs} +376 -238
  203. package/dist/{functions-14lpEFL4.mjs.map → functions-BFizikJU.mjs.map} +1 -1
  204. package/dist/{functions-i_la-N5r.cjs → functions-CfzJG9hK.cjs} +414 -264
  205. package/dist/functions-CfzJG9hK.cjs.map +1 -0
  206. package/dist/index-BuzRvKOQ.d.cts +115 -0
  207. package/dist/index-BuzRvKOQ.d.cts.map +1 -0
  208. package/dist/index-CTkKOer4.d.mts +115 -0
  209. package/dist/index-CTkKOer4.d.mts.map +1 -0
  210. package/dist/index-CeEtxDmK.d.cts +79 -0
  211. package/dist/index-CeEtxDmK.d.cts.map +1 -0
  212. package/dist/index-CeEtxDmK.d.mts +79 -0
  213. package/dist/index-CeEtxDmK.d.mts.map +1 -0
  214. package/dist/index.cjs +6 -3
  215. package/dist/index.d.cts +27 -4
  216. package/dist/index.d.cts.map +1 -0
  217. package/dist/index.d.mts +27 -4
  218. package/dist/index.d.mts.map +1 -0
  219. package/dist/index.mjs +3 -3
  220. package/dist/kms-B-Hm3d5r.cjs +85 -0
  221. package/dist/kms-B-Hm3d5r.cjs.map +1 -0
  222. package/dist/kms-BdUlMJEZ.mjs +85 -0
  223. package/dist/kms-BdUlMJEZ.mjs.map +1 -0
  224. package/dist/kysely-Bii4l6eP.mjs +370 -0
  225. package/dist/kysely-Bii4l6eP.mjs.map +1 -0
  226. package/dist/kysely-CO_Dk43W.cjs +383 -0
  227. package/dist/kysely-CO_Dk43W.cjs.map +1 -0
  228. package/dist/kysely-D0bpzgPs.d.cts +175 -0
  229. package/dist/kysely-D0bpzgPs.d.cts.map +1 -0
  230. package/dist/kysely-DUqC3Ie0.d.mts +175 -0
  231. package/dist/kysely-DUqC3Ie0.d.mts.map +1 -0
  232. package/dist/{telemetry-C3L0iS28.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +3 -6
  233. package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
  234. package/dist/{telemetry-D7bVFLGi.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +3 -6
  235. package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
  236. package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-CFanua0O.mjs} +20 -60
  237. package/dist/lazyAccessors-CFanua0O.mjs.map +1 -0
  238. package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-hJKGv8Ay.cjs} +60 -113
  239. package/dist/lazyAccessors-hJKGv8Ay.cjs.map +1 -0
  240. package/dist/mobile-app.cjs +73 -0
  241. package/dist/mobile-app.cjs.map +1 -0
  242. package/dist/mobile-app.d.cts +61 -0
  243. package/dist/mobile-app.d.cts.map +1 -0
  244. package/dist/mobile-app.d.mts +61 -0
  245. package/dist/mobile-app.d.mts.map +1 -0
  246. package/dist/mobile-app.mjs +72 -0
  247. package/dist/mobile-app.mjs.map +1 -0
  248. package/dist/object-storage.cjs +18 -10
  249. package/dist/object-storage.cjs.map +1 -1
  250. package/dist/object-storage.d.cts +3 -7
  251. package/dist/object-storage.d.cts.map +1 -1
  252. package/dist/object-storage.d.mts +3 -7
  253. package/dist/object-storage.d.mts.map +1 -1
  254. package/dist/object-storage.mjs +11 -3
  255. package/dist/object-storage.mjs.map +1 -1
  256. package/dist/processAudits-BRRVVHUB.mjs +131 -0
  257. package/dist/processAudits-BRRVVHUB.mjs.map +1 -0
  258. package/dist/processAudits-DasOZjPl.cjs +154 -0
  259. package/dist/processAudits-DasOZjPl.cjs.map +1 -0
  260. package/dist/queue/index.cjs +6 -189
  261. package/dist/queue/index.d.cts +3 -60
  262. package/dist/queue/index.d.mts +3 -60
  263. package/dist/queue/index.mjs +3 -186
  264. package/dist/rest-api.cjs +90 -59
  265. package/dist/rest-api.cjs.map +1 -1
  266. package/dist/rest-api.d.cts +70 -42
  267. package/dist/rest-api.d.cts.map +1 -1
  268. package/dist/rest-api.d.mts +70 -42
  269. package/dist/rest-api.d.mts.map +1 -1
  270. package/dist/rest-api.mjs +82 -51
  271. package/dist/rest-api.mjs.map +1 -1
  272. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  273. package/dist/runSubscriber-BHvJ8POr.mjs +109 -0
  274. package/dist/runSubscriber-BHvJ8POr.mjs.map +1 -0
  275. package/dist/runSubscriber-D8nLXIv1.cjs +126 -0
  276. package/dist/runSubscriber-D8nLXIv1.cjs.map +1 -0
  277. package/dist/shutdown-BMJmAhSt.cjs +38 -0
  278. package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
  279. package/dist/shutdown-C7xa8x9S.mjs +27 -0
  280. package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
  281. package/dist/site.cjs +33 -7
  282. package/dist/site.cjs.map +1 -1
  283. package/dist/site.d.cts +17 -7
  284. package/dist/site.d.cts.map +1 -1
  285. package/dist/site.d.mts +17 -7
  286. package/dist/site.d.mts.map +1 -1
  287. package/dist/site.mjs +29 -3
  288. package/dist/site.mjs.map +1 -1
  289. package/dist/stages-BSCF19o2.d.cts +56 -0
  290. package/dist/stages-BSCF19o2.d.cts.map +1 -0
  291. package/dist/stages-BSCF19o2.d.mts +56 -0
  292. package/dist/stages-BSCF19o2.d.mts.map +1 -0
  293. package/dist/subscribers/index.cjs +118 -6
  294. package/dist/subscribers/index.cjs.map +1 -0
  295. package/dist/subscribers/index.d.cts +51 -6
  296. package/dist/subscribers/index.d.cts.map +1 -0
  297. package/dist/subscribers/index.d.mts +51 -6
  298. package/dist/subscribers/index.d.mts.map +1 -0
  299. package/dist/subscribers/index.mjs +115 -5
  300. package/dist/subscribers/index.mjs.map +1 -0
  301. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  302. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  303. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  304. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  305. package/dist/telemetry-B48RLjyk.d.cts +40 -0
  306. package/dist/telemetry-B48RLjyk.d.cts.map +1 -0
  307. package/dist/telemetry-DRtT1_0A.d.mts +40 -0
  308. package/dist/telemetry-DRtT1_0A.d.mts.map +1 -0
  309. package/dist/telemetry.cjs +56 -0
  310. package/dist/telemetry.cjs.map +1 -0
  311. package/dist/telemetry.d.cts +2 -0
  312. package/dist/telemetry.d.mts +2 -0
  313. package/dist/telemetry.mjs +55 -0
  314. package/dist/telemetry.mjs.map +1 -0
  315. package/dist/topic/index.cjs +3 -137
  316. package/dist/topic/index.d.cts +2 -4
  317. package/dist/topic/index.d.mts +2 -4
  318. package/dist/topic/index.mjs +2 -134
  319. package/dist/tracing-CxaZ98IB.mjs +110 -0
  320. package/dist/tracing-CxaZ98IB.mjs.map +1 -0
  321. package/dist/tracing-DPMidF_r.cjs +127 -0
  322. package/dist/tracing-DPMidF_r.cjs.map +1 -0
  323. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  324. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  325. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  326. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  327. package/dist/types.d.cts +1 -1
  328. package/dist/types.d.mts +1 -1
  329. package/dist/types.mjs +1 -0
  330. package/dist/worker.cjs +59 -34
  331. package/dist/worker.cjs.map +1 -1
  332. package/dist/worker.d.cts +70 -45
  333. package/dist/worker.d.cts.map +1 -1
  334. package/dist/worker.d.mts +70 -44
  335. package/dist/worker.d.mts.map +1 -1
  336. package/dist/worker.mjs +54 -29
  337. package/dist/worker.mjs.map +1 -1
  338. package/package.json +96 -42
  339. package/dist/Construct-BD5neF7w.mjs.map +0 -1
  340. package/dist/Construct-C0ijr2qp.d.cts +0 -117
  341. package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
  342. package/dist/Construct-Ct8nalEi.d.mts +0 -117
  343. package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
  344. package/dist/Construct-CyS3RpTL.cjs.map +0 -1
  345. package/dist/Cron-DmQ8vQ4b.d.cts.map +0 -1
  346. package/dist/Cron-dh4rUgib.d.mts.map +0 -1
  347. package/dist/CronBuilder-BquXDbDI.d.cts +0 -44
  348. package/dist/CronBuilder-BquXDbDI.d.cts.map +0 -1
  349. package/dist/CronBuilder-CGgY2080.d.mts +0 -44
  350. package/dist/CronBuilder-CGgY2080.d.mts.map +0 -1
  351. package/dist/CronBuilder-CYKT5RiO.mjs.map +0 -1
  352. package/dist/CronBuilder-Da0C0edR.cjs.map +0 -1
  353. package/dist/Endpoint-BjWKinFA.d.mts.map +0 -1
  354. package/dist/Endpoint-DCQPMdUX.mjs.map +0 -1
  355. package/dist/Endpoint-DcWXE-SZ.cjs.map +0 -1
  356. package/dist/Endpoint-dav89W6-.d.cts.map +0 -1
  357. package/dist/EndpointFactory-CdWB7wPw.cjs.map +0 -1
  358. package/dist/EndpointFactory-CjV8F_lJ.mjs.map +0 -1
  359. package/dist/HonoEndpointAdaptor-DtL9j19R.cjs.map +0 -1
  360. package/dist/HonoEndpointAdaptor-P1ahhZHu.mjs.map +0 -1
  361. package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
  362. package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
  363. package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
  364. package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
  365. package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
  366. package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
  367. package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
  368. package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
  369. package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
  370. package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
  371. package/dist/Topic-19QeHBIR.d.cts +0 -91
  372. package/dist/Topic-19QeHBIR.d.cts.map +0 -1
  373. package/dist/Topic-DuFeqkBh.d.mts +0 -91
  374. package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
  375. package/dist/auth.d.cts.map +0 -1
  376. package/dist/auth.d.mts.map +0 -1
  377. package/dist/cache-0ANvRQnD.mjs +0 -51
  378. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  379. package/dist/cache-3WSvAulx.cjs +0 -57
  380. package/dist/cache-3WSvAulx.cjs.map +0 -1
  381. package/dist/cache-BrRz3fEB.d.mts.map +0 -1
  382. package/dist/cache-BtZY_tHe.d.cts.map +0 -1
  383. package/dist/clone-DblgEZZa.mjs.map +0 -1
  384. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  385. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  386. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  387. package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
  388. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  389. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  390. package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
  391. package/dist/database/kysely.cjs.map +0 -1
  392. package/dist/database/kysely.d.cts.map +0 -1
  393. package/dist/database/kysely.d.mts.map +0 -1
  394. package/dist/database/kysely.mjs.map +0 -1
  395. package/dist/functions-i_la-N5r.cjs.map +0 -1
  396. package/dist/index-Bd5FqCoe.d.cts.map +0 -1
  397. package/dist/index-BknhM6Ux.d.mts +0 -31
  398. package/dist/index-BknhM6Ux.d.mts.map +0 -1
  399. package/dist/index-CBSfrowv.d.cts +0 -31
  400. package/dist/index-CBSfrowv.d.cts.map +0 -1
  401. package/dist/index-D24Xm79M.d.cts +0 -171
  402. package/dist/index-D24Xm79M.d.cts.map +0 -1
  403. package/dist/index-_ajboYxK.d.mts +0 -171
  404. package/dist/index-_ajboYxK.d.mts.map +0 -1
  405. package/dist/index-lAO9egTb.d.mts.map +0 -1
  406. package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
  407. package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
  408. package/dist/processAudits-CGqttuXm.cjs +0 -92
  409. package/dist/processAudits-CGqttuXm.cjs.map +0 -1
  410. package/dist/processAudits-Dmts9H_b.mjs +0 -80
  411. package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
  412. package/dist/queue/index.cjs.map +0 -1
  413. package/dist/queue/index.d.cts.map +0 -1
  414. package/dist/queue/index.d.mts.map +0 -1
  415. package/dist/queue/index.mjs.map +0 -1
  416. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  417. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  418. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  419. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  420. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  421. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  422. package/dist/topic/index.cjs.map +0 -1
  423. package/dist/topic/index.mjs.map +0 -1
  424. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  425. package/dist/types-aKksMEWL.d.mts.map +0 -1
@@ -1,152 +1,2 @@
1
- import { Construct } from "../construct-interface-g5GM5pwR.mjs";
2
- import { Cache } from "../cache-BrRz3fEB.mjs";
3
- import { ConstructName, Declaration, PostgresVersion } from "@geekmidas/manifest";
4
- import { Service } from "@geekmidas/services";
5
- import { Kysely, KyselyConfig } from "kysely";
6
-
7
- //#region src/database/kysely.d.ts
8
-
9
- /**
10
- * Everything Kysely takes, plus what this construct declares.
11
- *
12
- * `dialect` is omitted because the construct owns it — it is built from the one
13
- * URL the adapter supplied, which is the whole point of the construct. The rest
14
- * of `KyselyConfig` (`plugins`, `log`) is the app's business and passes
15
- * straight through, so anything Kysely adds later arrives without being
16
- * tracked here.
17
- */
18
- interface KyselyDatabaseOptions extends Omit<KyselyConfig, 'dialect'> {
19
- /**
20
- * The schema, pinned on both roles' `search_path`.
21
- *
22
- * Defaults to `app` — the role the schema plays, rather than a restatement
23
- * of the database's own name, which reads correctly beside `auth` and
24
- * `pgboss` and keeps the application off `public`.
25
- */
26
- schema?: string;
27
- /**
28
- * Provision the owner/runtime role split. Defaults to on.
29
- *
30
- * Off falls back to the cluster's master credential in both URLs, giving up
31
- * the DDL/DML split and putting credentials that can drop a table into the
32
- * function's environment. A deliberate downgrade, not a default.
33
- */
34
- roles?: boolean;
35
- /**
36
- * The Postgres major version to provision.
37
- *
38
- * Declared here so one statement reaches both targets. It was previously
39
- * set in two unrelated places — a container tag locally, nothing at all on
40
- * AWS (so Aurora chose) — which is how local came to run 18 while deployed
41
- * ran 17.7 with nothing recording the difference.
42
- *
43
- * Defaults to {@link DEFAULT_POSTGRES_VERSION}.
44
- */
45
- version?: PostgresVersion;
46
- }
47
- /** What makes a construct derived rather than a database in its own right. */
48
- interface DerivedFrom {
49
- kind: 'database-reader' | 'database-schema';
50
- of: string;
51
- schema?: string;
52
- }
53
- /**
54
- * @typeParam DB - the database's schema.
55
- * @typeParam TName - the canonical id. TypeScript has no partial
56
- * type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
57
- * this at its default and the service key widens to `string`. `db` still types
58
- * through `.database()`, which infers from the service.
59
- */
60
- declare class KyselyDatabase<DB = unknown, TName extends string = string> implements Construct<TName, Kysely<DB>> {
61
- private readonly options;
62
- readonly id: TName;
63
- readonly service: Service<Uncapitalize<TName>, Kysely<DB>>;
64
- /**
65
- * Declared once and read by both `declare()` and `connect()`, so the key the
66
- * build publishes and the key the client reads cannot drift.
67
- */
68
- private readonly config;
69
- private readonly schemaName;
70
- private readonly roles;
71
- private readonly version;
72
- private readonly derivedFrom?;
73
- constructor(id: ConstructName<TName>, options?: KyselyDatabaseOptions, derivedFrom?: DerivedFrom);
74
- declare(): Declaration[];
75
- /**
76
- * A read-only endpoint on this database.
77
- *
78
- * Read-only is enforced by the reader role's grants rather than by which
79
- * endpoint it resolves to, so falling back to the writer where no replica
80
- * exists is safe rather than a silently writable connection behind a name
81
- * that says reader. There is no `writer()`: the database *is* the writer, so
82
- * a replica can never be reached by accident.
83
- *
84
- * The return type is narrower than this class on purpose — see
85
- * {@link ReadOnlyDatabase}.
86
- */
87
- reader(): ReadOnlyDatabase<DB, `${TName}Reader`>;
88
- /**
89
- * A cache that lives in this database.
90
- *
91
- * The same strengthening `schema()` is over a second database: `new
92
- * Cache('Sessions')` says the app caches and leaves where to the deployment,
93
- * while this says it caches *here* — which is a fact about the application
94
- * and so belongs in its code.
95
- *
96
- * What it buys beyond being explicit: the table's schema and the role that
97
- * reaches it come from this database rather than from a second convention,
98
- * and the backend no longer has to guess which database "the database" meant
99
- * when an app declares two.
100
- *
101
- * A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
102
- * is a key/value store, not a query builder, and typing it as the parent
103
- * would be a convenience that lies.
104
- */
105
- cache<TCache extends string = `${TName}Cache`>(id?: ConstructName<TCache>, options?: {
106
- table?: string;
107
- }): Cache<TCache>;
108
- /**
109
- * A second schema in this database, with its own role(s) and its own URL —
110
- * so this database's role holds no grant on those tables at all.
111
- *
112
- * Typed separately because a tenant has its own tables: the point is that
113
- * `auth.selectFrom('sessions')` type-checks and
114
- * `orders.selectFrom('sessions')` does not.
115
- */
116
- schema<TenantDB, TTenant extends string>(id: ConstructName<TTenant>, options?: KyselyDatabaseOptions): KyselyDatabase<TenantDB, TTenant>;
117
- /**
118
- * A connection as the *owner* role — the one that may create, alter and drop.
119
- *
120
- * A `Service` rather than part of the construct, and deliberately so: a
121
- * construct is what `.dependsOn()` accepts, and nothing should be able to
122
- * depend on this. A migrator asks for it by name; a handler cannot ask at
123
- * all, which is the security property the role split exists for.
124
- *
125
- * Falls back to the runtime URL where no owner URL was published — the
126
- * `roles: false` downgrade, where there is only one credential and it is the
127
- * cluster master's.
128
- */
129
- get owner(): Service<`${Uncapitalize<TName>}Owner`, Kysely<DB>>;
130
- private connect;
131
- }
132
- /**
133
- * A database you may read through, and derive nothing from.
134
- *
135
- * A reader is terminal in the graph, and this is that fact in the type system.
136
- * `DERIVES_FROM` gives `cache` and `database-schema` no `database-reader`
137
- * parent, and there is no reader of a reader — so `orders.reader().cache(…)`
138
- * has always been illegal, but it type-checked and failed later at
139
- * `assertDerivations`. That is a long way round to learn that a read-only
140
- * endpoint cannot own a table something writes to.
141
- *
142
- * Omitting the three deriving methods rather than making them throw keeps the
143
- * failure where it costs least: the editor, on the line that wrote it.
144
- *
145
- * The result is deliberately not assignable back to `KyselyDatabase` — a
146
- * reader is not one, and anything that genuinely needs the writer should say
147
- * so.
148
- */
149
- type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
150
- //#endregion
151
- export { KyselyDatabase, KyselyDatabaseOptions, ReadOnlyDatabase };
152
- //# sourceMappingURL=kysely.d.mts.map
1
+ import { i as closeDatabasePools, n as KyselyDatabaseOptions, r as ReadOnlyDatabase, t as KyselyDatabase } from "../kysely-DUqC3Ie0.mjs";
2
+ export { KyselyDatabase, KyselyDatabaseOptions, ReadOnlyDatabase, closeDatabasePools };
@@ -1,180 +1,2 @@
1
- import { Cache } from "../cache-0ANvRQnD.mjs";
2
- import { DEFAULT_POSTGRES_VERSION, canonicalId, provideKey, serviceKey } from "@geekmidas/manifest";
3
- import { Kysely, PostgresDialect } from "kysely";
4
- import pg from "pg";
5
-
6
- //#region src/database/kysely.ts
7
- /** The schema a database uses when it does not say otherwise. */
8
- const DEFAULT_SCHEMA = "app";
9
- /**
10
- * @typeParam DB - the database's schema.
11
- * @typeParam TName - the canonical id. TypeScript has no partial
12
- * type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
13
- * this at its default and the service key widens to `string`. `db` still types
14
- * through `.database()`, which infers from the service.
15
- */
16
- var KyselyDatabase = class KyselyDatabase {
17
- id;
18
- service;
19
- /**
20
- * Declared once and read by both `declare()` and `connect()`, so the key the
21
- * build publishes and the key the client reads cannot drift.
22
- */
23
- config;
24
- schemaName;
25
- roles;
26
- version;
27
- derivedFrom;
28
- constructor(id, options = {}, derivedFrom) {
29
- this.options = options;
30
- const canonical = canonicalId(id);
31
- this.id = canonical;
32
- this.config = {
33
- url: provideKey(canonical, "url"),
34
- ownerUrl: provideKey(canonical, "ownerUrl")
35
- };
36
- this.schemaName = options.schema ?? DEFAULT_SCHEMA;
37
- this.roles = options.roles ?? true;
38
- this.version = options.version ?? DEFAULT_POSTGRES_VERSION;
39
- this.derivedFrom = derivedFrom;
40
- this.service = {
41
- serviceName: serviceKey(canonical),
42
- register: (registerOptions) => this.connect(registerOptions)
43
- };
44
- }
45
- declare() {
46
- if (this.derivedFrom) {
47
- const { kind, of, schema } = this.derivedFrom;
48
- return [kind === "database-schema" ? {
49
- kind,
50
- id: this.id,
51
- of,
52
- schema: schema ?? this.schemaName,
53
- provides: [this.config.url]
54
- } : {
55
- kind,
56
- id: this.id,
57
- of,
58
- provides: [this.config.url]
59
- }];
60
- }
61
- return [{
62
- kind: "database",
63
- id: this.id,
64
- engine: "postgres",
65
- schema: this.schemaName,
66
- version: this.version,
67
- provides: [this.config.url],
68
- ...this.roles ? {} : { roles: false }
69
- }];
70
- }
71
- /**
72
- * A read-only endpoint on this database.
73
- *
74
- * Read-only is enforced by the reader role's grants rather than by which
75
- * endpoint it resolves to, so falling back to the writer where no replica
76
- * exists is safe rather than a silently writable connection behind a name
77
- * that says reader. There is no `writer()`: the database *is* the writer, so
78
- * a replica can never be reached by accident.
79
- *
80
- * The return type is narrower than this class on purpose — see
81
- * {@link ReadOnlyDatabase}.
82
- */
83
- reader() {
84
- return new KyselyDatabase(`${this.id}Reader`, this.options, {
85
- kind: "database-reader",
86
- of: this.id
87
- });
88
- }
89
- /**
90
- * A cache that lives in this database.
91
- *
92
- * The same strengthening `schema()` is over a second database: `new
93
- * Cache('Sessions')` says the app caches and leaves where to the deployment,
94
- * while this says it caches *here* — which is a fact about the application
95
- * and so belongs in its code.
96
- *
97
- * What it buys beyond being explicit: the table's schema and the role that
98
- * reaches it come from this database rather than from a second convention,
99
- * and the backend no longer has to guess which database "the database" meant
100
- * when an app declares two.
101
- *
102
- * A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
103
- * is a key/value store, not a query builder, and typing it as the parent
104
- * would be a convenience that lies.
105
- */
106
- cache(id = `${this.id}Cache`, options = {}) {
107
- return new Cache(id, {
108
- of: this.id,
109
- ...options.table ? { table: options.table } : {}
110
- });
111
- }
112
- /**
113
- * A second schema in this database, with its own role(s) and its own URL —
114
- * so this database's role holds no grant on those tables at all.
115
- *
116
- * Typed separately because a tenant has its own tables: the point is that
117
- * `auth.selectFrom('sessions')` type-checks and
118
- * `orders.selectFrom('sessions')` does not.
119
- */
120
- schema(id, options = {}) {
121
- return new KyselyDatabase(id, options, {
122
- kind: "database-schema",
123
- of: this.id,
124
- schema: options.schema ?? id.toLowerCase()
125
- });
126
- }
127
- /**
128
- * A connection as the *owner* role — the one that may create, alter and drop.
129
- *
130
- * A `Service` rather than part of the construct, and deliberately so: a
131
- * construct is what `.dependsOn()` accepts, and nothing should be able to
132
- * depend on this. A migrator asks for it by name; a handler cannot ask at
133
- * all, which is the security property the role split exists for.
134
- *
135
- * Falls back to the runtime URL where no owner URL was published — the
136
- * `roles: false` downgrade, where there is only one credential and it is the
137
- * cluster master's.
138
- */
139
- get owner() {
140
- return {
141
- serviceName: `${serviceKey(this.id)}Owner`,
142
- register: (options) => this.connect(options, { owner: true })
143
- };
144
- }
145
- async connect(options, as = {}) {
146
- const { url, ownerUrl } = options.envParser.create((get) => ({
147
- url: get(this.config.url).string(),
148
- ownerUrl: get(this.config.ownerUrl).string().optional()
149
- })).parse();
150
- const { schema: _schema, roles: _roles,...kysely } = this.options;
151
- return new Kysely({
152
- ...kysely,
153
- dialect: new PostgresDialect({ pool: pool(as.owner ? ownerUrl ?? url : url) })
154
- });
155
- }
156
- };
157
- /**
158
- * A pool for one URL, with its schema actually on the search path.
159
- *
160
- * `?search_path=` is not a libpq parameter — a URL carrying it connects
161
- * happily and then resolves every unqualified name against `public`, which is
162
- * how a schema tenant silently writes its tables into the database it was
163
- * separated from. Postgres takes it as a startup option instead, so the URL
164
- * keeps the readable form the target derives and this turns it into the thing
165
- * the server understands.
166
- */
167
- function pool(url) {
168
- const parsed = new URL(url);
169
- const searchPath = parsed.searchParams.get("search_path");
170
- if (!searchPath) return new pg.Pool({ connectionString: url });
171
- parsed.searchParams.delete("search_path");
172
- return new pg.Pool({
173
- connectionString: parsed.toString(),
174
- options: `-c search_path=${searchPath}`
175
- });
176
- }
177
-
178
- //#endregion
179
- export { KyselyDatabase };
180
- //# sourceMappingURL=kysely.mjs.map
1
+ import { n as closeDatabasePools, t as KyselyDatabase } from "../kysely-Bii4l6eP.mjs";
2
+ export { KyselyDatabase, closeDatabasePools };
package/dist/email.cjs CHANGED
@@ -1,9 +1,22 @@
1
- const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const __geekmidas_manifest = require_chunk.__toESM(require("@geekmidas/manifest"));
3
- const __geekmidas_emailkit = require_chunk.__toESM(require("@geekmidas/emailkit"));
4
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _geekmidas_manifest = require("@geekmidas/manifest");
3
+ let _geekmidas_emailkit = require("@geekmidas/emailkit");
5
4
  //#region src/email.ts
5
+ /**
6
+ * `Email` — declared outbound mail.
7
+ *
8
+ * The same three-package meeting point as `ObjectStorage`: it implements the
9
+ * construct contract, derives its env key through `@geekmidas/manifest`, and
10
+ * hands back an `@geekmidas/emailkit` client. It names no provider — locally the
11
+ * injected URL points at Mailpit, deployed it points at SES or whichever service
12
+ * config selected.
13
+ *
14
+ * Where object storage needs a driver per provider, this needs none: mail is
15
+ * delivered over SMTP whoever delivers it, so there is one client and one URL
16
+ * shape, and the provider survives only as a host and a credential.
17
+ */
6
18
  var Email = class {
19
+ options;
7
20
  id;
8
21
  service;
9
22
  /**
@@ -13,15 +26,15 @@ var Email = class {
13
26
  keys;
14
27
  constructor(id, options) {
15
28
  this.options = options;
16
- const canonical = (0, __geekmidas_manifest.canonicalId)(id);
29
+ const canonical = (0, _geekmidas_manifest.canonicalId)(id);
17
30
  this.id = canonical;
18
31
  this.keys = {
19
- url: (0, __geekmidas_manifest.provideKey)(canonical, "url"),
20
- from: (0, __geekmidas_manifest.provideKey)(canonical, "from")
32
+ url: (0, _geekmidas_manifest.provideKey)(canonical, "url"),
33
+ from: (0, _geekmidas_manifest.provideKey)(canonical, "from")
21
34
  };
22
35
  this.service = {
23
- serviceName: (0, __geekmidas_manifest.serviceKey)(canonical),
24
- register: (options$1) => this.connect(options$1)
36
+ serviceName: (0, _geekmidas_manifest.serviceKey)(canonical),
37
+ register: (options) => this.connect(options)
25
38
  };
26
39
  }
27
40
  declare() {
@@ -43,8 +56,8 @@ var Email = class {
43
56
  url: get(this.keys.url).string(),
44
57
  from: get(this.keys.from).string()
45
58
  })).parse();
46
- return (0, __geekmidas_emailkit.createEmailClient)({
47
- smtp: (0, __geekmidas_emailkit.parseEmailUrl)(url),
59
+ return (0, _geekmidas_emailkit.createEmailClient)({
60
+ smtp: (0, _geekmidas_emailkit.parseEmailUrl)(url),
48
61
  templates: this.options.templates,
49
62
  defaults: {
50
63
  from,
@@ -53,7 +66,7 @@ var Email = class {
53
66
  });
54
67
  }
55
68
  };
56
-
57
69
  //#endregion
58
70
  exports.Email = Email;
71
+
59
72
  //# sourceMappingURL=email.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.cjs","names":["id: ConstructName<TName>","options: EmailOptions<TTemplates>","options"],"sources":["../src/email.ts"],"sourcesContent":["/**\n * `Email` — declared outbound mail.\n *\n * The same three-package meeting point as `ObjectStorage`: it implements the\n * construct contract, derives its env key through `@geekmidas/manifest`, and\n * hands back an `@geekmidas/emailkit` client. It names no provider — locally the\n * injected URL points at Mailpit, deployed it points at SES or whichever service\n * config selected.\n *\n * Where object storage needs a driver per provider, this needs none: mail is\n * delivered over SMTP whoever delivers it, so there is one client and one URL\n * shape, and the provider survives only as a host and a credential.\n */\n\nimport {\n\tcreateEmailClient,\n\ttype EmailClient,\n\tparseEmailUrl,\n\ttype TemplateRecord,\n} from '@geekmidas/emailkit';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport type { Construct } from './construct-interface';\n\nexport interface EmailOptions<TTemplates extends TemplateRecord> {\n\t/**\n\t * The React templates this app can send.\n\t *\n\t * Structural — they are code, they ship with the handler, and which ones\n\t * exist cannot differ between stages. They are also what types\n\t * `sendTemplate`, so passing them here is what makes the client's call sites\n\t * checkable.\n\t */\n\ttemplates: TTemplates;\n\t/**\n\t * A reply-to address for every send.\n\t *\n\t * `from` is deliberately absent: it belongs to the verified sending domain,\n\t * which is `myapp.test` locally and the real domain deployed, so it arrives\n\t * as stage config rather than being written here.\n\t */\n\treplyTo?: string;\n}\n\nexport class Email<\n\tTName extends string = string,\n\tTTemplates extends TemplateRecord = TemplateRecord,\n> implements Construct<TName, EmailClient<TTemplates>>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, EmailClient<TTemplates>>;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the key the\n\t * build publishes and the key the client reads cannot drift.\n\t */\n\tprivate readonly keys: { url: string; from: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: EmailOptions<TTemplates>,\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.keys = {\n\t\t\turl: provideKey(canonical, 'url'),\n\t\t\t// The sending identity travels with the URL rather than being a second\n\t\t\t// construct option, for the same reason the URL does: it is the one\n\t\t\t// thing about mail that differs per stage.\n\t\t\tfrom: provideKey(canonical, 'from'),\n\t\t};\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (options) => this.connect(options),\n\t\t};\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'email',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.url, this.keys.from],\n\t\t\t},\n\t\t];\n\t}\n\n\t/**\n\t * Builds the client from the URL the adapter supplied.\n\t *\n\t * No provider branch and no driver lookup — `parseEmailUrl` turns any of\n\t * Mailpit, SES, or Resend into the same transport config, which is the whole\n\t * reason the scheme is always `smtp://`.\n\t */\n\tprivate async connect({\n\t\tenvParser,\n\t}: ServiceRegisterOptions): Promise<EmailClient<TTemplates>> {\n\t\tconst { url, from } = envParser\n\t\t\t.create((get) => ({\n\t\t\t\turl: get(this.keys.url).string(),\n\t\t\t\tfrom: get(this.keys.from).string(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\treturn createEmailClient({\n\t\t\tsmtp: parseEmailUrl(url),\n\t\t\ttemplates: this.options.templates,\n\t\t\tdefaults: {\n\t\t\t\tfrom,\n\t\t\t\t...(this.options.replyTo ? { replyTo: this.options.replyTo } : {}),\n\t\t\t},\n\t\t});\n\t}\n}\n"],"mappings":";;;;;AAkDA,IAAa,QAAb,MAIA;CACC,AAAS;CACT,AAAS;;;;;CAMT,AAAiB;CAEjB,YACCA,IACiBC,SAChB;EADgB;EAEjB,MAAM,YAAY,sCAAY,GAAa;AAE3C,OAAK,KAAK;AACV,OAAK,OAAO;GACX,KAAK,qCAAW,WAAW,MAAM;GAIjC,MAAM,qCAAW,WAAW,OAAO;EACnC;AAGD,OAAK,UAAU;GACd,aAAa,qCAAW,UAAU;GAClC,UAAU,CAACC,cAAY,KAAK,QAAQA,UAAQ;EAC5C;CACD;CAED,UAAyB;AACxB,SAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,IAAK;EACzC,CACD;CACD;;;;;;;;CASD,MAAc,QAAQ,EACrB,WACwB,EAAoC;EAC5D,MAAM,EAAE,KAAK,MAAM,GAAG,UACpB,OAAO,CAAC,SAAS;GACjB,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,QAAQ;GAChC,MAAM,IAAI,KAAK,KAAK,KAAK,CAAC,QAAQ;EAClC,GAAE,CACF,OAAO;AAET,SAAO,4CAAkB;GACxB,MAAM,wCAAc,IAAI;GACxB,WAAW,KAAK,QAAQ;GACxB,UAAU;IACT;IACA,GAAI,KAAK,QAAQ,UAAU,EAAE,SAAS,KAAK,QAAQ,QAAS,IAAG,CAAE;GACjE;EACD,EAAC;CACF;AACD"}
1
+ {"version":3,"file":"email.cjs","names":["canonicalId","provideKey","serviceKey","createEmailClient","parseEmailUrl"],"sources":["../src/email.ts"],"sourcesContent":["/**\n * `Email` — declared outbound mail.\n *\n * The same three-package meeting point as `ObjectStorage`: it implements the\n * construct contract, derives its env key through `@geekmidas/manifest`, and\n * hands back an `@geekmidas/emailkit` client. It names no provider — locally the\n * injected URL points at Mailpit, deployed it points at SES or whichever service\n * config selected.\n *\n * Where object storage needs a driver per provider, this needs none: mail is\n * delivered over SMTP whoever delivers it, so there is one client and one URL\n * shape, and the provider survives only as a host and a credential.\n */\n\nimport {\n\tcreateEmailClient,\n\ttype EmailClient,\n\tparseEmailUrl,\n\ttype TemplateRecord,\n} from '@geekmidas/emailkit';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport type { Construct } from './construct-interface';\n\nexport interface EmailOptions<TTemplates extends TemplateRecord> {\n\t/**\n\t * The React templates this app can send.\n\t *\n\t * Structural — they are code, they ship with the handler, and which ones\n\t * exist cannot differ between stages. They are also what types\n\t * `sendTemplate`, so passing them here is what makes the client's call sites\n\t * checkable.\n\t */\n\ttemplates: TTemplates;\n\t/**\n\t * A reply-to address for every send.\n\t *\n\t * `from` is deliberately absent: it belongs to the verified sending domain,\n\t * which is `myapp.test` locally and the real domain deployed, so it arrives\n\t * as stage config rather than being written here.\n\t */\n\treplyTo?: string;\n}\n\nexport class Email<\n\tTName extends string = string,\n\tTTemplates extends TemplateRecord = TemplateRecord,\n> implements Construct<TName, EmailClient<TTemplates>>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, EmailClient<TTemplates>>;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the key the\n\t * build publishes and the key the client reads cannot drift.\n\t */\n\tprivate readonly keys: { url: string; from: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: EmailOptions<TTemplates>,\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.keys = {\n\t\t\turl: provideKey(canonical, 'url'),\n\t\t\t// The sending identity travels with the URL rather than being a second\n\t\t\t// construct option, for the same reason the URL does: it is the one\n\t\t\t// thing about mail that differs per stage.\n\t\t\tfrom: provideKey(canonical, 'from'),\n\t\t};\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (options) => this.connect(options),\n\t\t};\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'email',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.url, this.keys.from],\n\t\t\t},\n\t\t];\n\t}\n\n\t/**\n\t * Builds the client from the URL the adapter supplied.\n\t *\n\t * No provider branch and no driver lookup — `parseEmailUrl` turns any of\n\t * Mailpit, SES, or Resend into the same transport config, which is the whole\n\t * reason the scheme is always `smtp://`.\n\t */\n\tprivate async connect({\n\t\tenvParser,\n\t}: ServiceRegisterOptions): Promise<EmailClient<TTemplates>> {\n\t\tconst { url, from } = envParser\n\t\t\t.create((get) => ({\n\t\t\t\turl: get(this.keys.url).string(),\n\t\t\t\tfrom: get(this.keys.from).string(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\treturn createEmailClient({\n\t\t\tsmtp: parseEmailUrl(url),\n\t\t\ttemplates: this.options.templates,\n\t\t\tdefaults: {\n\t\t\t\tfrom,\n\t\t\t\t...(this.options.replyTo ? { replyTo: this.options.replyTo } : {}),\n\t\t\t},\n\t\t});\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkDA,IAAa,QAAb,MAIA;CAYmB;CAXlB;CACA;;;;;CAMA;CAEA,YACC,IACA,SACC;EADgB,KAAA,UAAA;EAEjB,MAAM,aAAA,GAAYA,oBAAAA,YAAAA,CAAY,EAAY;EAE1C,KAAK,KAAK;EACV,KAAK,OAAO;GACX,MAAA,GAAKC,oBAAAA,WAAAA,CAAW,WAAW,KAAK;GAIhC,OAAA,GAAMA,oBAAAA,WAAAA,CAAW,WAAW,MAAM;EACnC;EAGA,KAAK,UAAU;GACd,cAAA,GAAaC,oBAAAA,WAAAA,CAAW,SAAS;GACjC,WAAW,YAAY,KAAK,QAAQ,OAAO;EAC5C;CACD;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI;EACzC,CACD;CACD;;;;;;;;CASA,MAAc,QAAQ,EACrB,aAC4D;EAC5D,MAAM,EAAE,KAAK,SAAS,UACpB,QAAQ,SAAS;GACjB,KAAK,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC,OAAO;GAC/B,MAAM,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,OAAO;EAClC,EAAE,CAAC,CACF,MAAM;EAER,QAAA,GAAOC,oBAAAA,kBAAAA,CAAkB;GACxB,OAAA,GAAMC,oBAAAA,cAAAA,CAAc,GAAG;GACvB,WAAW,KAAK,QAAQ;GACxB,UAAU;IACT;IACA,GAAI,KAAK,QAAQ,UAAU,EAAE,SAAS,KAAK,QAAQ,QAAQ,IAAI,CAAC;GACjE;EACD,CAAC;CACF;AACD"}
package/dist/email.d.cts CHANGED
@@ -1,11 +1,9 @@
1
- import { Construct } from "./construct-interface-D9d4Gm4p.cjs";
1
+ import { n as Construct } from "./construct-interface-B1AfqRl4.cjs";
2
2
  import { Service } from "@geekmidas/services";
3
3
  import { ConstructName, Declaration } from "@geekmidas/manifest";
4
4
  import { EmailClient, TemplateRecord } from "@geekmidas/emailkit";
5
-
6
5
  //#region src/email.d.ts
7
-
8
- interface EmailOptions<TTemplates extends TemplateRecord> {
6
+ export interface EmailOptions<TTemplates extends TemplateRecord> {
9
7
  /**
10
8
  * The React templates this app can send.
11
9
  *
@@ -24,7 +22,7 @@ interface EmailOptions<TTemplates extends TemplateRecord> {
24
22
  */
25
23
  replyTo?: string;
26
24
  }
27
- declare class Email<TName extends string = string, TTemplates extends TemplateRecord = TemplateRecord> implements Construct<TName, EmailClient<TTemplates>> {
25
+ export declare class Email<TName extends string = string, TTemplates extends TemplateRecord = TemplateRecord> implements Construct<TName, EmailClient<TTemplates>> {
28
26
  private readonly options;
29
27
  readonly id: TName;
30
28
  readonly service: Service<Uncapitalize<TName>, EmailClient<TTemplates>>;
@@ -44,7 +42,5 @@ declare class Email<TName extends string = string, TTemplates extends TemplateRe
44
42
  */
45
43
  private connect;
46
44
  }
47
- //# sourceMappingURL=email.d.ts.map
48
45
  //#endregion
49
- export { Email, EmailOptions };
50
46
  //# sourceMappingURL=email.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.cts","names":[],"sources":["../src/email.ts"],"sourcesContent":[],"mappings":";;;;;;;AAqD8B,UAvBb,YAuBa,CAAA,mBAvBmB,cAuBnB,CAAA,CAAA;EAAW;;;;;;;;EAYtB,SACsB,EA3B7B,UA2B6B;EAAU;;;AAb7B;;;;;;cAHT,wDAEO,iBAAiB,2BACxB,UAAU,OAAO,YAAY;;eAE5B;oBACK,QAAQ,aAAa,QAAQ,YAAY;;;;;;kBAStD,cAAc,iBACQ,aAAa;aAoB7B"}
1
+ {"version":3,"file":"email.d.cts","names":[],"sources":["../src/email.ts"],"mappings":";;;;;iBA8BiB,aAAa,mBAAmB;;;;;;;;;EAShD,WAAW;;;;;;;;EAQX;;qBAGY,MACZ,+BACA,mBAAmB,iBAAiB,2BACxB,UAAU,OAAO,YAAY;mBAavB;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,YAAY;;;;;mBAM1C;EAEjB,YACC,IAAI,cAAc,QACD,SAAS,aAAa;EAoBxC,WAAW;;;;;;;;UAiBG"}
package/dist/email.d.mts CHANGED
@@ -1,11 +1,9 @@
1
- import { Construct } from "./construct-interface-g5GM5pwR.mjs";
1
+ import { n as Construct } from "./construct-interface-DluK3_da.mjs";
2
2
  import { ConstructName, Declaration } from "@geekmidas/manifest";
3
3
  import { EmailClient, TemplateRecord } from "@geekmidas/emailkit";
4
4
  import { Service } from "@geekmidas/services";
5
-
6
5
  //#region src/email.d.ts
7
-
8
- interface EmailOptions<TTemplates extends TemplateRecord> {
6
+ export interface EmailOptions<TTemplates extends TemplateRecord> {
9
7
  /**
10
8
  * The React templates this app can send.
11
9
  *
@@ -24,7 +22,7 @@ interface EmailOptions<TTemplates extends TemplateRecord> {
24
22
  */
25
23
  replyTo?: string;
26
24
  }
27
- declare class Email<TName extends string = string, TTemplates extends TemplateRecord = TemplateRecord> implements Construct<TName, EmailClient<TTemplates>> {
25
+ export declare class Email<TName extends string = string, TTemplates extends TemplateRecord = TemplateRecord> implements Construct<TName, EmailClient<TTemplates>> {
28
26
  private readonly options;
29
27
  readonly id: TName;
30
28
  readonly service: Service<Uncapitalize<TName>, EmailClient<TTemplates>>;
@@ -44,7 +42,5 @@ declare class Email<TName extends string = string, TTemplates extends TemplateRe
44
42
  */
45
43
  private connect;
46
44
  }
47
- //# sourceMappingURL=email.d.ts.map
48
45
  //#endregion
49
- export { Email, EmailOptions };
50
46
  //# sourceMappingURL=email.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.mts","names":[],"sources":["../src/email.ts"],"sourcesContent":[],"mappings":";;;;;;;AAqD8B,UAvBb,YAuBa,CAAA,mBAvBmB,cAuBnB,CAAA,CAAA;EAAW;;;;;;;;EAYtB,SACsB,EA3B7B,UA2B6B;EAAU;;;AAb7B;;;;;;cAHT,wDAEO,iBAAiB,2BACxB,UAAU,OAAO,YAAY;;eAE5B;oBACK,QAAQ,aAAa,QAAQ,YAAY;;;;;;kBAStD,cAAc,iBACQ,aAAa;aAoB7B"}
1
+ {"version":3,"file":"email.d.mts","names":[],"sources":["../src/email.ts"],"mappings":";;;;;iBA8BiB,aAAa,mBAAmB;;;;;;;;;EAShD,WAAW;;;;;;;;EAQX;;qBAGY,MACZ,+BACA,mBAAmB,iBAAiB,2BACxB,UAAU,OAAO,YAAY;mBAavB;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,YAAY;;;;;mBAM1C;EAEjB,YACC,IAAI,cAAc,QACD,SAAS,aAAa;EAoBxC,WAAW;;;;;;;;UAiBG"}
package/dist/email.mjs CHANGED
@@ -1,8 +1,21 @@
1
1
  import { canonicalId, provideKey, serviceKey } from "@geekmidas/manifest";
2
2
  import { createEmailClient, parseEmailUrl } from "@geekmidas/emailkit";
3
-
4
3
  //#region src/email.ts
4
+ /**
5
+ * `Email` — declared outbound mail.
6
+ *
7
+ * The same three-package meeting point as `ObjectStorage`: it implements the
8
+ * construct contract, derives its env key through `@geekmidas/manifest`, and
9
+ * hands back an `@geekmidas/emailkit` client. It names no provider — locally the
10
+ * injected URL points at Mailpit, deployed it points at SES or whichever service
11
+ * config selected.
12
+ *
13
+ * Where object storage needs a driver per provider, this needs none: mail is
14
+ * delivered over SMTP whoever delivers it, so there is one client and one URL
15
+ * shape, and the provider survives only as a host and a credential.
16
+ */
5
17
  var Email = class {
18
+ options;
6
19
  id;
7
20
  service;
8
21
  /**
@@ -20,7 +33,7 @@ var Email = class {
20
33
  };
21
34
  this.service = {
22
35
  serviceName: serviceKey(canonical),
23
- register: (options$1) => this.connect(options$1)
36
+ register: (options) => this.connect(options)
24
37
  };
25
38
  }
26
39
  declare() {
@@ -52,7 +65,7 @@ var Email = class {
52
65
  });
53
66
  }
54
67
  };
55
-
56
68
  //#endregion
57
69
  export { Email };
70
+
58
71
  //# sourceMappingURL=email.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.mjs","names":["id: ConstructName<TName>","options: EmailOptions<TTemplates>","options"],"sources":["../src/email.ts"],"sourcesContent":["/**\n * `Email` — declared outbound mail.\n *\n * The same three-package meeting point as `ObjectStorage`: it implements the\n * construct contract, derives its env key through `@geekmidas/manifest`, and\n * hands back an `@geekmidas/emailkit` client. It names no provider — locally the\n * injected URL points at Mailpit, deployed it points at SES or whichever service\n * config selected.\n *\n * Where object storage needs a driver per provider, this needs none: mail is\n * delivered over SMTP whoever delivers it, so there is one client and one URL\n * shape, and the provider survives only as a host and a credential.\n */\n\nimport {\n\tcreateEmailClient,\n\ttype EmailClient,\n\tparseEmailUrl,\n\ttype TemplateRecord,\n} from '@geekmidas/emailkit';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport type { Construct } from './construct-interface';\n\nexport interface EmailOptions<TTemplates extends TemplateRecord> {\n\t/**\n\t * The React templates this app can send.\n\t *\n\t * Structural — they are code, they ship with the handler, and which ones\n\t * exist cannot differ between stages. They are also what types\n\t * `sendTemplate`, so passing them here is what makes the client's call sites\n\t * checkable.\n\t */\n\ttemplates: TTemplates;\n\t/**\n\t * A reply-to address for every send.\n\t *\n\t * `from` is deliberately absent: it belongs to the verified sending domain,\n\t * which is `myapp.test` locally and the real domain deployed, so it arrives\n\t * as stage config rather than being written here.\n\t */\n\treplyTo?: string;\n}\n\nexport class Email<\n\tTName extends string = string,\n\tTTemplates extends TemplateRecord = TemplateRecord,\n> implements Construct<TName, EmailClient<TTemplates>>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, EmailClient<TTemplates>>;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the key the\n\t * build publishes and the key the client reads cannot drift.\n\t */\n\tprivate readonly keys: { url: string; from: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: EmailOptions<TTemplates>,\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.keys = {\n\t\t\turl: provideKey(canonical, 'url'),\n\t\t\t// The sending identity travels with the URL rather than being a second\n\t\t\t// construct option, for the same reason the URL does: it is the one\n\t\t\t// thing about mail that differs per stage.\n\t\t\tfrom: provideKey(canonical, 'from'),\n\t\t};\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (options) => this.connect(options),\n\t\t};\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'email',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.url, this.keys.from],\n\t\t\t},\n\t\t];\n\t}\n\n\t/**\n\t * Builds the client from the URL the adapter supplied.\n\t *\n\t * No provider branch and no driver lookup — `parseEmailUrl` turns any of\n\t * Mailpit, SES, or Resend into the same transport config, which is the whole\n\t * reason the scheme is always `smtp://`.\n\t */\n\tprivate async connect({\n\t\tenvParser,\n\t}: ServiceRegisterOptions): Promise<EmailClient<TTemplates>> {\n\t\tconst { url, from } = envParser\n\t\t\t.create((get) => ({\n\t\t\t\turl: get(this.keys.url).string(),\n\t\t\t\tfrom: get(this.keys.from).string(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\treturn createEmailClient({\n\t\t\tsmtp: parseEmailUrl(url),\n\t\t\ttemplates: this.options.templates,\n\t\t\tdefaults: {\n\t\t\t\tfrom,\n\t\t\t\t...(this.options.replyTo ? { replyTo: this.options.replyTo } : {}),\n\t\t\t},\n\t\t});\n\t}\n}\n"],"mappings":";;;;AAkDA,IAAa,QAAb,MAIA;CACC,AAAS;CACT,AAAS;;;;;CAMT,AAAiB;CAEjB,YACCA,IACiBC,SAChB;EADgB;EAEjB,MAAM,YAAY,YAAY,GAAa;AAE3C,OAAK,KAAK;AACV,OAAK,OAAO;GACX,KAAK,WAAW,WAAW,MAAM;GAIjC,MAAM,WAAW,WAAW,OAAO;EACnC;AAGD,OAAK,UAAU;GACd,aAAa,WAAW,UAAU;GAClC,UAAU,CAACC,cAAY,KAAK,QAAQA,UAAQ;EAC5C;CACD;CAED,UAAyB;AACxB,SAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,IAAK;EACzC,CACD;CACD;;;;;;;;CASD,MAAc,QAAQ,EACrB,WACwB,EAAoC;EAC5D,MAAM,EAAE,KAAK,MAAM,GAAG,UACpB,OAAO,CAAC,SAAS;GACjB,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,QAAQ;GAChC,MAAM,IAAI,KAAK,KAAK,KAAK,CAAC,QAAQ;EAClC,GAAE,CACF,OAAO;AAET,SAAO,kBAAkB;GACxB,MAAM,cAAc,IAAI;GACxB,WAAW,KAAK,QAAQ;GACxB,UAAU;IACT;IACA,GAAI,KAAK,QAAQ,UAAU,EAAE,SAAS,KAAK,QAAQ,QAAS,IAAG,CAAE;GACjE;EACD,EAAC;CACF;AACD"}
1
+ {"version":3,"file":"email.mjs","names":[],"sources":["../src/email.ts"],"sourcesContent":["/**\n * `Email` — declared outbound mail.\n *\n * The same three-package meeting point as `ObjectStorage`: it implements the\n * construct contract, derives its env key through `@geekmidas/manifest`, and\n * hands back an `@geekmidas/emailkit` client. It names no provider — locally the\n * injected URL points at Mailpit, deployed it points at SES or whichever service\n * config selected.\n *\n * Where object storage needs a driver per provider, this needs none: mail is\n * delivered over SMTP whoever delivers it, so there is one client and one URL\n * shape, and the provider survives only as a host and a credential.\n */\n\nimport {\n\tcreateEmailClient,\n\ttype EmailClient,\n\tparseEmailUrl,\n\ttype TemplateRecord,\n} from '@geekmidas/emailkit';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport type { Construct } from './construct-interface';\n\nexport interface EmailOptions<TTemplates extends TemplateRecord> {\n\t/**\n\t * The React templates this app can send.\n\t *\n\t * Structural — they are code, they ship with the handler, and which ones\n\t * exist cannot differ between stages. They are also what types\n\t * `sendTemplate`, so passing them here is what makes the client's call sites\n\t * checkable.\n\t */\n\ttemplates: TTemplates;\n\t/**\n\t * A reply-to address for every send.\n\t *\n\t * `from` is deliberately absent: it belongs to the verified sending domain,\n\t * which is `myapp.test` locally and the real domain deployed, so it arrives\n\t * as stage config rather than being written here.\n\t */\n\treplyTo?: string;\n}\n\nexport class Email<\n\tTName extends string = string,\n\tTTemplates extends TemplateRecord = TemplateRecord,\n> implements Construct<TName, EmailClient<TTemplates>>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, EmailClient<TTemplates>>;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the key the\n\t * build publishes and the key the client reads cannot drift.\n\t */\n\tprivate readonly keys: { url: string; from: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: EmailOptions<TTemplates>,\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.keys = {\n\t\t\turl: provideKey(canonical, 'url'),\n\t\t\t// The sending identity travels with the URL rather than being a second\n\t\t\t// construct option, for the same reason the URL does: it is the one\n\t\t\t// thing about mail that differs per stage.\n\t\t\tfrom: provideKey(canonical, 'from'),\n\t\t};\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (options) => this.connect(options),\n\t\t};\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'email',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.url, this.keys.from],\n\t\t\t},\n\t\t];\n\t}\n\n\t/**\n\t * Builds the client from the URL the adapter supplied.\n\t *\n\t * No provider branch and no driver lookup — `parseEmailUrl` turns any of\n\t * Mailpit, SES, or Resend into the same transport config, which is the whole\n\t * reason the scheme is always `smtp://`.\n\t */\n\tprivate async connect({\n\t\tenvParser,\n\t}: ServiceRegisterOptions): Promise<EmailClient<TTemplates>> {\n\t\tconst { url, from } = envParser\n\t\t\t.create((get) => ({\n\t\t\t\turl: get(this.keys.url).string(),\n\t\t\t\tfrom: get(this.keys.from).string(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\treturn createEmailClient({\n\t\t\tsmtp: parseEmailUrl(url),\n\t\t\ttemplates: this.options.templates,\n\t\t\tdefaults: {\n\t\t\t\tfrom,\n\t\t\t\t...(this.options.replyTo ? { replyTo: this.options.replyTo } : {}),\n\t\t\t},\n\t\t});\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkDA,IAAa,QAAb,MAIA;CAYmB;CAXlB;CACA;;;;;CAMA;CAEA,YACC,IACA,SACC;EADgB,KAAA,UAAA;EAEjB,MAAM,YAAY,YAAY,EAAY;EAE1C,KAAK,KAAK;EACV,KAAK,OAAO;GACX,KAAK,WAAW,WAAW,KAAK;GAIhC,MAAM,WAAW,WAAW,MAAM;EACnC;EAGA,KAAK,UAAU;GACd,aAAa,WAAW,SAAS;GACjC,WAAW,YAAY,KAAK,QAAQ,OAAO;EAC5C;CACD;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI;EACzC,CACD;CACD;;;;;;;;CASA,MAAc,QAAQ,EACrB,aAC4D;EAC5D,MAAM,EAAE,KAAK,SAAS,UACpB,QAAQ,SAAS;GACjB,KAAK,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC,OAAO;GAC/B,MAAM,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,OAAO;EAClC,EAAE,CAAC,CACF,MAAM;EAER,OAAO,kBAAkB;GACxB,MAAM,cAAc,GAAG;GACvB,WAAW,KAAK,QAAQ;GACxB,UAAU;IACT;IACA,GAAI,KAAK,QAAQ,UAAU,EAAE,SAAS,KAAK,QAAQ,QAAQ,IAAI,CAAC;GACjE;EACD,CAAC;CACF;AACD"}