@geekmidas/constructs 10.0.0-alpha.2 → 10.0.0-alpha.21

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 (333) hide show
  1. package/README.md +46 -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-AYpQq725.d.mts} +13 -6
  11. package/dist/Cron-AYpQq725.d.mts.map +1 -0
  12. package/dist/{Cron-Wqh464aO.d.cts → Cron-Bdcg9OAL.d.cts} +12 -5
  13. package/dist/Cron-Bdcg9OAL.d.cts.map +1 -0
  14. package/dist/{CronBuilder-BL0AP6fs.d.mts → CronBuilder-DR21m9h2.d.cts} +7 -10
  15. package/dist/CronBuilder-DR21m9h2.d.cts.map +1 -0
  16. package/dist/{CronBuilder-BqpEzMPQ.d.cts → CronBuilder-DeBnPVIT.d.mts} +7 -10
  17. package/dist/CronBuilder-DeBnPVIT.d.mts.map +1 -0
  18. package/dist/{CronBuilder-BmABazzH.mjs → CronBuilder-vkjuo1UP.mjs} +23 -15
  19. package/dist/CronBuilder-vkjuo1UP.mjs.map +1 -0
  20. package/dist/{CronBuilder-CkXPJiGO.cjs → CronBuilder-zdTdaT-e.cjs} +33 -25
  21. package/dist/CronBuilder-zdTdaT-e.cjs.map +1 -0
  22. package/dist/{Endpoint-2Wg7T7Cq.d.mts → Endpoint-BxkRWQ8G.d.mts} +63 -84
  23. package/dist/Endpoint-BxkRWQ8G.d.mts.map +1 -0
  24. package/dist/{Endpoint-BiaaMEn_.cjs → Endpoint-CtiPUpRX.cjs} +145 -131
  25. package/dist/Endpoint-CtiPUpRX.cjs.map +1 -0
  26. package/dist/{Endpoint-VIOpSo0S.mjs → Endpoint-DCr5tlbJ.mjs} +117 -109
  27. package/dist/Endpoint-DCr5tlbJ.mjs.map +1 -0
  28. package/dist/{Endpoint-CH9Fn1AD.d.cts → Endpoint-DbYQJgb-.d.cts} +61 -82
  29. package/dist/Endpoint-DbYQJgb-.d.cts.map +1 -0
  30. package/dist/{EndpointFactory-DTTCkGEL.mjs → EndpointFactory-Bs8pu-yY.mjs} +20 -29
  31. package/dist/EndpointFactory-Bs8pu-yY.mjs.map +1 -0
  32. package/dist/{index-BxHDdy6a.d.mts → EndpointFactory-DE6nKtFZ.d.cts} +12 -92
  33. package/dist/EndpointFactory-DE6nKtFZ.d.cts.map +1 -0
  34. package/dist/{index-V2nksZIJ.d.cts → EndpointFactory-T06kTFHg.d.mts} +12 -92
  35. package/dist/EndpointFactory-T06kTFHg.d.mts.map +1 -0
  36. package/dist/{EndpointFactory-ChxLZllA.cjs → EndpointFactory-vE2C1NG1.cjs} +57 -66
  37. package/dist/EndpointFactory-vE2C1NG1.cjs.map +1 -0
  38. package/dist/{HonoEndpointAdaptor-NKQQQbBY.mjs → HonoEndpointAdaptor-Be6UdK0r.mjs} +40 -47
  39. package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs.map → HonoEndpointAdaptor-Be6UdK0r.mjs.map} +1 -1
  40. package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs → HonoEndpointAdaptor-C9aivwKl.cjs} +48 -52
  41. package/dist/HonoEndpointAdaptor-C9aivwKl.cjs.map +1 -0
  42. package/dist/{Queue-D7ZuwBhy.d.cts → Queue-Bhzi2WQC.d.cts} +8 -9
  43. package/dist/Queue-Bhzi2WQC.d.cts.map +1 -0
  44. package/dist/{Queue-gVGfi2Yk.d.mts → Queue-BoUA-e83.d.mts} +9 -10
  45. package/dist/Queue-BoUA-e83.d.mts.map +1 -0
  46. package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-CIO3pwji.d.mts} +7 -8
  47. package/dist/Subscriber-CIO3pwji.d.mts.map +1 -0
  48. package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-DQCaiOXF.d.cts} +7 -8
  49. package/dist/Subscriber-DQCaiOXF.d.cts.map +1 -0
  50. package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-B4YRTBng.mjs} +16 -10
  51. package/dist/SubscriberBuilder-B4YRTBng.mjs.map +1 -0
  52. package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-C2bCOuPT.cjs} +28 -23
  53. package/dist/SubscriberBuilder-C2bCOuPT.cjs.map +1 -0
  54. package/dist/{SubscriberBuilder-Dptmo-1A.d.mts → SubscriberBuilder-ChX5v948.d.cts} +8 -11
  55. package/dist/SubscriberBuilder-ChX5v948.d.cts.map +1 -0
  56. package/dist/{SubscriberBuilder-waNhzjSM.d.cts → SubscriberBuilder-Dbiaskfi.d.mts} +8 -11
  57. package/dist/SubscriberBuilder-Dbiaskfi.d.mts.map +1 -0
  58. package/dist/{Topic-19QeHBIR.d.cts → Topic-D6blllEn.d.cts} +5 -7
  59. package/dist/Topic-D6blllEn.d.cts.map +1 -0
  60. package/dist/{Topic-DuFeqkBh.d.mts → Topic-DVvheJ_-.d.mts} +6 -8
  61. package/dist/Topic-DVvheJ_-.d.mts.map +1 -0
  62. package/dist/adaptors/aws.cjs +87 -106
  63. package/dist/adaptors/aws.cjs.map +1 -1
  64. package/dist/adaptors/aws.d.cts +14 -27
  65. package/dist/adaptors/aws.d.cts.map +1 -1
  66. package/dist/adaptors/aws.d.mts +16 -29
  67. package/dist/adaptors/aws.d.mts.map +1 -1
  68. package/dist/adaptors/aws.mjs +60 -81
  69. package/dist/adaptors/aws.mjs.map +1 -1
  70. package/dist/adaptors/hono.cjs +3 -10
  71. package/dist/adaptors/hono.d.cts +5 -13
  72. package/dist/adaptors/hono.d.cts.map +1 -1
  73. package/dist/adaptors/hono.d.mts +7 -15
  74. package/dist/adaptors/hono.d.mts.map +1 -1
  75. package/dist/adaptors/hono.mjs +2 -10
  76. package/dist/adaptors/testing.cjs +271 -82
  77. package/dist/adaptors/testing.cjs.map +1 -1
  78. package/dist/adaptors/testing.d.cts +62 -33
  79. package/dist/adaptors/testing.d.cts.map +1 -1
  80. package/dist/adaptors/testing.d.mts +63 -34
  81. package/dist/adaptors/testing.d.mts.map +1 -1
  82. package/dist/adaptors/testing.mjs +249 -63
  83. package/dist/adaptors/testing.mjs.map +1 -1
  84. package/dist/auth-BlO8MUkR.d.cts +123 -0
  85. package/dist/auth-BlO8MUkR.d.cts.map +1 -0
  86. package/dist/auth-CHWIdcQO.d.mts +123 -0
  87. package/dist/auth-CHWIdcQO.d.mts.map +1 -0
  88. package/dist/auth.cjs +41 -16
  89. package/dist/auth.cjs.map +1 -1
  90. package/dist/auth.d.cts +2 -108
  91. package/dist/auth.d.mts +2 -108
  92. package/dist/auth.mjs +32 -8
  93. package/dist/auth.mjs.map +1 -1
  94. package/dist/{cache-BrRz3fEB.d.mts → cache-AgQUMma6.d.mts} +3 -6
  95. package/dist/cache-AgQUMma6.d.mts.map +1 -0
  96. package/dist/{cache-BtZY_tHe.d.cts → cache-obq0fOIM.d.cts} +3 -6
  97. package/dist/cache-obq0fOIM.d.cts.map +1 -0
  98. package/dist/cache.cjs +68 -2
  99. package/dist/cache.cjs.map +1 -0
  100. package/dist/cache.d.cts +1 -2
  101. package/dist/cache.d.mts +1 -2
  102. package/dist/cache.mjs +67 -2
  103. package/dist/cache.mjs.map +1 -0
  104. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  105. package/dist/clone-EKNovYHu.mjs.map +1 -0
  106. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  107. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  108. package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-Clz7_BwB.d.mts} +15 -6
  109. package/dist/construct-interface-Clz7_BwB.d.mts.map +1 -0
  110. package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-DIaTNKax.d.cts} +15 -6
  111. package/dist/construct-interface-DIaTNKax.d.cts.map +1 -0
  112. package/dist/construct-interface.cjs +87 -7
  113. package/dist/construct-interface.cjs.map +1 -0
  114. package/dist/construct-interface.d.cts +2 -2
  115. package/dist/construct-interface.d.mts +2 -2
  116. package/dist/construct-interface.mjs +81 -2
  117. package/dist/construct-interface.mjs.map +1 -0
  118. package/dist/credential.cjs +43 -9
  119. package/dist/credential.cjs.map +1 -1
  120. package/dist/credential.d.cts +5 -8
  121. package/dist/credential.d.cts.map +1 -1
  122. package/dist/credential.d.mts +5 -8
  123. package/dist/credential.d.mts.map +1 -1
  124. package/dist/credential.mjs +36 -2
  125. package/dist/credential.mjs.map +1 -1
  126. package/dist/crons/index.cjs +68 -10
  127. package/dist/crons/index.cjs.map +1 -1
  128. package/dist/crons/index.d.cts +32 -14
  129. package/dist/crons/index.d.cts.map +1 -1
  130. package/dist/crons/index.d.mts +32 -14
  131. package/dist/crons/index.d.mts.map +1 -1
  132. package/dist/crons/index.mjs +66 -10
  133. package/dist/crons/index.mjs.map +1 -1
  134. package/dist/database/kysely.cjs +28 -14
  135. package/dist/database/kysely.cjs.map +1 -1
  136. package/dist/database/kysely.d.cts +2 -152
  137. package/dist/database/kysely.d.mts +2 -152
  138. package/dist/database/kysely.mjs +16 -4
  139. package/dist/database/kysely.mjs.map +1 -1
  140. package/dist/email.cjs +25 -12
  141. package/dist/email.cjs.map +1 -1
  142. package/dist/email.d.cts +3 -7
  143. package/dist/email.d.cts.map +1 -1
  144. package/dist/email.d.mts +3 -7
  145. package/dist/email.d.mts.map +1 -1
  146. package/dist/email.mjs +16 -3
  147. package/dist/email.mjs.map +1 -1
  148. package/dist/endpoints/index.cjs +7 -10
  149. package/dist/endpoints/index.d.cts +60 -7
  150. package/dist/endpoints/index.d.cts.map +1 -0
  151. package/dist/endpoints/index.d.mts +60 -7
  152. package/dist/endpoints/index.d.mts.map +1 -0
  153. package/dist/endpoints/index.mjs +5 -10
  154. package/dist/file-server.cjs +42 -10
  155. package/dist/file-server.cjs.map +1 -1
  156. package/dist/file-server.d.cts +6 -10
  157. package/dist/file-server.d.cts.map +1 -1
  158. package/dist/file-server.d.mts +6 -10
  159. package/dist/file-server.d.mts.map +1 -1
  160. package/dist/file-server.mjs +34 -2
  161. package/dist/file-server.mjs.map +1 -1
  162. package/dist/functions/index.cjs +2 -6
  163. package/dist/functions/index.d.cts +2 -4
  164. package/dist/functions/index.d.mts +2 -4
  165. package/dist/functions/index.mjs +2 -6
  166. package/dist/{functions-Bd3TPxid.cjs → functions-VnOTEp74.cjs} +309 -264
  167. package/dist/functions-VnOTEp74.cjs.map +1 -0
  168. package/dist/{functions-Cxbo-pEd.mjs → functions-faoJOUmr.mjs} +282 -234
  169. package/dist/functions-faoJOUmr.mjs.map +1 -0
  170. package/dist/index-CeEtxDmK.d.cts +79 -0
  171. package/dist/index-CeEtxDmK.d.cts.map +1 -0
  172. package/dist/index-CeEtxDmK.d.mts +79 -0
  173. package/dist/index-CeEtxDmK.d.mts.map +1 -0
  174. package/dist/{index-JSf9xNIJ.d.cts → index-DU3Twmwh.d.mts} +19 -24
  175. package/dist/index-DU3Twmwh.d.mts.map +1 -0
  176. package/dist/index-fnpjXiA-.d.mts +26 -0
  177. package/dist/index-fnpjXiA-.d.mts.map +1 -0
  178. package/dist/{index-CubPzHd9.d.mts → index-nBQT1tAh.d.cts} +19 -24
  179. package/dist/index-nBQT1tAh.d.cts.map +1 -0
  180. package/dist/index-tE_119SX.d.cts +26 -0
  181. package/dist/index-tE_119SX.d.cts.map +1 -0
  182. package/dist/index.cjs +3 -3
  183. package/dist/index.d.cts +4 -4
  184. package/dist/index.d.mts +4 -4
  185. package/dist/index.mjs +2 -3
  186. package/dist/kysely-CXi49zc2.d.cts +150 -0
  187. package/dist/kysely-CXi49zc2.d.cts.map +1 -0
  188. package/dist/kysely-D3-G5b0j.d.mts +150 -0
  189. package/dist/kysely-D3-G5b0j.d.mts.map +1 -0
  190. package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-BHtcqgz2.mjs} +22 -25
  191. package/dist/lazyAccessors-BHtcqgz2.mjs.map +1 -0
  192. package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-Dx9NLwJZ.cjs} +72 -76
  193. package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +1 -0
  194. package/dist/object-storage.cjs +18 -10
  195. package/dist/object-storage.cjs.map +1 -1
  196. package/dist/object-storage.d.cts +3 -7
  197. package/dist/object-storage.d.cts.map +1 -1
  198. package/dist/object-storage.d.mts +3 -7
  199. package/dist/object-storage.d.mts.map +1 -1
  200. package/dist/object-storage.mjs +11 -3
  201. package/dist/object-storage.mjs.map +1 -1
  202. package/dist/{processAudits-Dmts9H_b.mjs → processAudits-BpRlPQMW.mjs} +16 -19
  203. package/dist/processAudits-BpRlPQMW.mjs.map +1 -0
  204. package/dist/{processAudits-CGqttuXm.cjs → processAudits-D_2W5x8k.cjs} +26 -30
  205. package/dist/processAudits-D_2W5x8k.cjs.map +1 -0
  206. package/dist/queue/index.cjs +25 -21
  207. package/dist/queue/index.cjs.map +1 -1
  208. package/dist/queue/index.d.cts +8 -15
  209. package/dist/queue/index.d.cts.map +1 -1
  210. package/dist/queue/index.d.mts +8 -15
  211. package/dist/queue/index.d.mts.map +1 -1
  212. package/dist/queue/index.mjs +15 -11
  213. package/dist/queue/index.mjs.map +1 -1
  214. package/dist/rest-api.cjs +88 -62
  215. package/dist/rest-api.cjs.map +1 -1
  216. package/dist/rest-api.d.cts +62 -60
  217. package/dist/rest-api.d.cts.map +1 -1
  218. package/dist/rest-api.d.mts +62 -60
  219. package/dist/rest-api.d.mts.map +1 -1
  220. package/dist/rest-api.mjs +80 -54
  221. package/dist/rest-api.mjs.map +1 -1
  222. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  223. package/dist/site.cjs +33 -9
  224. package/dist/site.cjs.map +1 -1
  225. package/dist/site.d.cts +11 -22
  226. package/dist/site.d.cts.map +1 -1
  227. package/dist/site.d.mts +11 -22
  228. package/dist/site.d.mts.map +1 -1
  229. package/dist/site.mjs +29 -5
  230. package/dist/site.mjs.map +1 -1
  231. package/dist/subscribers/index.cjs +2 -11
  232. package/dist/subscribers/index.d.cts +3 -14
  233. package/dist/subscribers/index.d.mts +3 -14
  234. package/dist/subscribers/index.mjs +2 -11
  235. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  236. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  237. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  238. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  239. package/dist/{telemetry-C3L0iS28.d.cts → telemetry-DGcFlVpB.d.cts} +2 -5
  240. package/dist/telemetry-DGcFlVpB.d.cts.map +1 -0
  241. package/dist/{telemetry-D7bVFLGi.d.mts → telemetry-DGcFlVpB.d.mts} +2 -5
  242. package/dist/telemetry-DGcFlVpB.d.mts.map +1 -0
  243. package/dist/topic/index.cjs +18 -20
  244. package/dist/topic/index.cjs.map +1 -1
  245. package/dist/topic/index.d.cts +3 -32
  246. package/dist/topic/index.d.mts +3 -32
  247. package/dist/topic/index.mjs +8 -10
  248. package/dist/topic/index.mjs.map +1 -1
  249. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  250. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  251. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  252. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  253. package/dist/types.d.cts +1 -1
  254. package/dist/types.d.mts +1 -1
  255. package/dist/types.mjs +1 -0
  256. package/dist/worker.cjs +109 -35
  257. package/dist/worker.cjs.map +1 -1
  258. package/dist/worker.d.cts +87 -42
  259. package/dist/worker.d.cts.map +1 -1
  260. package/dist/worker.d.mts +87 -42
  261. package/dist/worker.d.mts.map +1 -1
  262. package/dist/worker.mjs +104 -30
  263. package/dist/worker.mjs.map +1 -1
  264. package/package.json +59 -55
  265. package/dist/Construct-BD5neF7w.mjs.map +0 -1
  266. package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
  267. package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
  268. package/dist/Construct-CyS3RpTL.cjs.map +0 -1
  269. package/dist/Cron-ByxdOfpE.d.mts.map +0 -1
  270. package/dist/Cron-Wqh464aO.d.cts.map +0 -1
  271. package/dist/CronBuilder-BL0AP6fs.d.mts.map +0 -1
  272. package/dist/CronBuilder-BmABazzH.mjs.map +0 -1
  273. package/dist/CronBuilder-BqpEzMPQ.d.cts.map +0 -1
  274. package/dist/CronBuilder-CkXPJiGO.cjs.map +0 -1
  275. package/dist/Endpoint-2Wg7T7Cq.d.mts.map +0 -1
  276. package/dist/Endpoint-BiaaMEn_.cjs.map +0 -1
  277. package/dist/Endpoint-CH9Fn1AD.d.cts.map +0 -1
  278. package/dist/Endpoint-VIOpSo0S.mjs.map +0 -1
  279. package/dist/EndpointFactory-ChxLZllA.cjs.map +0 -1
  280. package/dist/EndpointFactory-DTTCkGEL.mjs.map +0 -1
  281. package/dist/HonoEndpointAdaptor-NKQQQbBY.mjs.map +0 -1
  282. package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
  283. package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
  284. package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
  285. package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
  286. package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
  287. package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
  288. package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
  289. package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
  290. package/dist/Topic-19QeHBIR.d.cts.map +0 -1
  291. package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
  292. package/dist/auth.d.cts.map +0 -1
  293. package/dist/auth.d.mts.map +0 -1
  294. package/dist/cache-0ANvRQnD.mjs +0 -51
  295. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  296. package/dist/cache-3WSvAulx.cjs +0 -57
  297. package/dist/cache-3WSvAulx.cjs.map +0 -1
  298. package/dist/cache-BrRz3fEB.d.mts.map +0 -1
  299. package/dist/cache-BtZY_tHe.d.cts.map +0 -1
  300. package/dist/clone-DblgEZZa.mjs.map +0 -1
  301. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  302. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  303. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  304. package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
  305. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  306. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  307. package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
  308. package/dist/database/kysely.d.cts.map +0 -1
  309. package/dist/database/kysely.d.mts.map +0 -1
  310. package/dist/functions-Bd3TPxid.cjs.map +0 -1
  311. package/dist/functions-Cxbo-pEd.mjs.map +0 -1
  312. package/dist/index-BxHDdy6a.d.mts.map +0 -1
  313. package/dist/index-CubPzHd9.d.mts.map +0 -1
  314. package/dist/index-JSf9xNIJ.d.cts.map +0 -1
  315. package/dist/index-V2nksZIJ.d.cts.map +0 -1
  316. package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
  317. package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
  318. package/dist/processAudits-CGqttuXm.cjs.map +0 -1
  319. package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
  320. package/dist/subscribers/index.cjs.map +0 -1
  321. package/dist/subscribers/index.d.cts.map +0 -1
  322. package/dist/subscribers/index.d.mts.map +0 -1
  323. package/dist/subscribers/index.mjs.map +0 -1
  324. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  325. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  326. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  327. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  328. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  329. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  330. package/dist/topic/index.d.cts.map +0 -1
  331. package/dist/topic/index.d.mts.map +0 -1
  332. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  333. package/dist/types-aKksMEWL.d.mts.map +0 -1
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-Clz7_BwB.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"}
@@ -1,16 +1,13 @@
1
- require('../construct-interface-BfjcOD_E.cjs');
2
- require('../Construct-CyS3RpTL.cjs');
3
- require('../functions-Bd3TPxid.cjs');
4
- const require_EndpointFactory = require('../EndpointFactory-ChxLZllA.cjs');
5
- require('../clone-Dy0cR2SZ.cjs');
6
- const require_Endpoint = require('../Endpoint-BiaaMEn_.cjs');
7
- const require_surfaceEnv = require('../surfaceEnv-BFXEms2f.cjs');
8
- const require_lazyAccessors = require('../lazyAccessors-e3j2oE2m.cjs');
9
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_EndpointFactory = require("../EndpointFactory-vE2C1NG1.cjs");
3
+ const require_Endpoint = require("../Endpoint-CtiPUpRX.cjs");
4
+ const require_surfaceEnv = require("../surfaceEnv-CNimK76p.cjs");
5
+ const require_lazyAccessors = require("../lazyAccessors-Dx9NLwJZ.cjs");
10
6
  exports.BUILT_IN_SECURITY_SCHEMES = require_EndpointFactory.BUILT_IN_SECURITY_SCHEMES;
11
7
  exports.Endpoint = require_Endpoint.Endpoint;
12
8
  exports.EndpointBuilder = require_EndpointFactory.EndpointBuilder;
13
9
  exports.EndpointFactory = require_EndpointFactory.EndpointFactory;
10
+ exports.NoAuthenticator = require_Endpoint.NoAuthenticator;
14
11
  exports.RLS_BYPASS = require_EndpointFactory.RLS_BYPASS;
15
12
  exports.ResponseBuilder = require_Endpoint.ResponseBuilder;
16
13
  exports.createApiGatewayCookies = require_lazyAccessors.createApiGatewayCookies;
@@ -24,4 +21,4 @@ exports.defaultEnvParser = require_surfaceEnv.defaultEnvParser;
24
21
  exports.envParserFor = require_surfaceEnv.envParserFor;
25
22
  exports.getSecurityScheme = require_EndpointFactory.getSecurityScheme;
26
23
  exports.isBuiltInSecurityScheme = require_EndpointFactory.isBuiltInSecurityScheme;
27
- exports.publishConstructEvents = require_lazyAccessors.publishConstructEvents;
24
+ exports.publishConstructEvents = require_lazyAccessors.publishConstructEvents;
@@ -1,7 +1,60 @@
1
- import "../Construct-C0ijr2qp.cjs";
2
- import "../index-JSf9xNIJ.cjs";
3
- import "../construct-interface-D9d4Gm4p.cjs";
4
- import "../types-BlAkSuGI.cjs";
5
- import { ActorExtractor, Authorizer, BUILT_IN_SECURITY_SCHEMES, BuiltInSecuritySchemeId, Endpoint, EndpointContext, EndpointHandler, EndpointOutput, EndpointSchemas, MappedAudit, OAuthFlow, OAuthFlows, RLS_BYPASS, ResponseBuilder, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor, SecurityScheme, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme } from "../Endpoint-CH9Fn1AD.cjs";
6
- import { EndpointBuilder, EndpointFactory, createApiGatewayCookies, createApiGatewayHeaders, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, defaultEnvParser, envParserFor, publishConstructEvents } from "../index-V2nksZIJ.cjs";
7
- export { ActorExtractor, Authorizer, BUILT_IN_SECURITY_SCHEMES, BuiltInSecuritySchemeId, Endpoint, EndpointBuilder, EndpointContext, EndpointFactory, EndpointHandler, EndpointOutput, EndpointSchemas, MappedAudit, OAuthFlow, OAuthFlows, RLS_BYPASS, ResponseBuilder, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor, SecurityScheme, createApiGatewayCookies, createApiGatewayHeaders, createAuthorizer, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, defaultEnvParser, envParserFor, getSecurityScheme, isBuiltInSecurityScheme, publishConstructEvents };
1
+ import { t as StandardSchemaV1 } from "../index-CeEtxDmK.cjs";
2
+ import { t as Construct } from "../Construct-DTqYvkPG.cjs";
3
+ import { A as getSecurityScheme, C as Authorizer, D as OAuthFlows, E as OAuthFlow, O as SecurityScheme, S as MappedAudit, T as BuiltInSecuritySchemeId, _ as RlsBypass, a as EndpointContext, b as RlsContextExtractor, c as EndpointSchemas, d as ResponseBuilder, g as RLS_BYPASS, h as SessionAuth, i as Endpoint, j as isBuiltInSecurityScheme, k as createAuthorizer, l as EndpointSurface, m as NoAuthenticator, n as ConvertRouteParams, o as EndpointHandler, r as CookieFn, s as EndpointOutput, u as HeaderFn, v as RlsConfig, w as BUILT_IN_SECURITY_SCHEMES, x as ActorExtractor, y as RlsContext } from "../Endpoint-DbYQJgb-.cjs";
4
+ import { n as EndpointBuilder, t as EndpointFactory } from "../EndpointFactory-DE6nKtFZ.cjs";
5
+ import { EnvironmentParser } from "@geekmidas/envkit";
6
+ import { EventPublisher, MappedEvent } from "@geekmidas/events";
7
+ import { Logger } from "@geekmidas/logger";
8
+ import { InferStandardSchema } from "@geekmidas/schema";
9
+ import { Service, ServiceDiscovery } from "@geekmidas/services";
10
+ import { AuditStorage } from "@geekmidas/audit";
11
+ import { Context } from "hono";
12
+ //#region src/publisher.d.ts
13
+ export declare function publishConstructEvents<T extends EventPublisher<any> | undefined, OutSchema extends StandardSchemaV1 | undefined = undefined, TServiceName extends string = string, TServices extends Service[] = [], TAuditStorageServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined>(construct: Construct<Logger, TServiceName, T, OutSchema, TServices, TAuditStorageServiceName, TAuditStorage>, response: InferStandardSchema<OutSchema>, serviceDiscovery: ServiceDiscovery<any>, logger?: Logger): Promise<void>;
14
+ //#endregion
15
+ //#region src/endpoints/lazyAccessors.d.ts
16
+ /**
17
+ * Create a lazy header accessor for Hono.
18
+ * Uses `c.req.header(name)` for single lookups (native, case-insensitive).
19
+ * Only calls `c.req.header()` to get all headers when needed.
20
+ */
21
+ export declare function createHonoHeaders(c: Context): HeaderFn;
22
+ /**
23
+ * Create a lazy cookie accessor for Hono.
24
+ * Uses `getCookie(c, name)` for single lookups (native).
25
+ * Only parses the cookie header when all cookies are requested.
26
+ */
27
+ export declare function createHonoCookies(c: Context): CookieFn;
28
+ /**
29
+ * Create a lazy header accessor for API Gateway events.
30
+ * Handles case-insensitive lookups.
31
+ */
32
+ export declare function createApiGatewayHeaders(headers: Record<string, string | undefined> | null | undefined): HeaderFn;
33
+ /**
34
+ * Create a lazy cookie accessor for API Gateway events.
35
+ * Decodes URL-encoded values to match browser behavior.
36
+ */
37
+ export declare function createApiGatewayCookies(cookies: string[] | undefined, cookieHeader: string | undefined): CookieFn;
38
+ /**
39
+ * Create a no-op header accessor (for minimal endpoints that don't use headers).
40
+ */
41
+ export declare function createNoopHeaders(): HeaderFn;
42
+ /**
43
+ * Create a no-op cookie accessor (for minimal endpoints that don't use cookies).
44
+ */
45
+ export declare function createNoopCookies(): CookieFn;
46
+ //#endregion
47
+ //#region src/endpoints/surfaceEnv.d.ts
48
+ /**
49
+ * The default parser, built once.
50
+ *
51
+ * Once because `Credentials` resolves through `globalThis` and decryption is
52
+ * not free, and because two parsers over the same environment are two caches of
53
+ * the same answer.
54
+ */
55
+ export declare function defaultEnvParser(): EnvironmentParser<{}>;
56
+ /** The parser for an endpoint, from its surface or the default. */
57
+ export declare function envParserFor(surface: EndpointSurface | undefined): EnvironmentParser<{}>;
58
+ //#endregion
59
+ export { type ActorExtractor, type Authorizer, BUILT_IN_SECURITY_SCHEMES, type BuiltInSecuritySchemeId, type ConvertRouteParams, Endpoint, EndpointBuilder, type EndpointContext, EndpointFactory, type EndpointHandler, type EndpointOutput, type EndpointSchemas, type MappedAudit, NoAuthenticator, type OAuthFlow, type OAuthFlows, RLS_BYPASS, ResponseBuilder, type RlsBypass, type RlsConfig, type RlsContext, type RlsContextExtractor, type SecurityScheme, type SessionAuth, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme };
60
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/publisher.ts","../../src/endpoints/lazyAccessors.ts","../../src/endpoints/surfaceEnv.ts"],"mappings":";;;;;;;;;;;;wBAgEsB,uBACrB,UAAU,iCACV,kBAAkB,0CAClB,sCACA,kBAAkB,gBAClB,kDACA,sBAAsB,sCAEtB,WAAW,UACV,QACA,cACA,GACA,WACA,WACA,0BACA,gBAED,UAAU,oBAAoB,YAC9B,kBAAkB,uBAClB,SAAQ,SAAyB;;;;;;;;wBCnElB,kBAAkB,GAAG,UAAU;;;;;;wBAqB/B,kBAAkB,GAAG,UAAU;;;;;wBAgC/B,wBACf,SAAS,wDACP;;;;;wBAoCa,wBACf,+BACA,mCACE;;;;wBAmHa,qBAAqB;;;;wBAUrB,qBAAqB;;;;;;;;;;wBC1MrB,oBAAoB;;wBASpB,aACf,SAAS,8BACP"}
@@ -1,7 +1,60 @@
1
- import "../Construct-Ct8nalEi.mjs";
2
- import "../index-CubPzHd9.mjs";
3
- import "../construct-interface-g5GM5pwR.mjs";
4
- import "../types-aKksMEWL.mjs";
5
- import { ActorExtractor, Authorizer, BUILT_IN_SECURITY_SCHEMES, BuiltInSecuritySchemeId, Endpoint, EndpointContext, EndpointHandler, EndpointOutput, EndpointSchemas, MappedAudit, OAuthFlow, OAuthFlows, RLS_BYPASS, ResponseBuilder, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor, SecurityScheme, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme } from "../Endpoint-2Wg7T7Cq.mjs";
6
- import { EndpointBuilder, EndpointFactory, createApiGatewayCookies, createApiGatewayHeaders, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, defaultEnvParser, envParserFor, publishConstructEvents } from "../index-BxHDdy6a.mjs";
7
- export { ActorExtractor, Authorizer, BUILT_IN_SECURITY_SCHEMES, BuiltInSecuritySchemeId, Endpoint, EndpointBuilder, EndpointContext, EndpointFactory, EndpointHandler, EndpointOutput, EndpointSchemas, MappedAudit, OAuthFlow, OAuthFlows, RLS_BYPASS, ResponseBuilder, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor, SecurityScheme, createApiGatewayCookies, createApiGatewayHeaders, createAuthorizer, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, defaultEnvParser, envParserFor, getSecurityScheme, isBuiltInSecurityScheme, publishConstructEvents };
1
+ import { t as StandardSchemaV1 } from "../index-CeEtxDmK.mjs";
2
+ import { t as Construct } from "../Construct-pVadmURD.mjs";
3
+ import { A as getSecurityScheme, C as Authorizer, D as OAuthFlows, E as OAuthFlow, O as SecurityScheme, S as MappedAudit, T as BuiltInSecuritySchemeId, _ as RlsBypass, a as EndpointContext, b as RlsContextExtractor, c as EndpointSchemas, d as ResponseBuilder, g as RLS_BYPASS, h as SessionAuth, i as Endpoint, j as isBuiltInSecurityScheme, k as createAuthorizer, l as EndpointSurface, m as NoAuthenticator, n as ConvertRouteParams, o as EndpointHandler, r as CookieFn, s as EndpointOutput, u as HeaderFn, v as RlsConfig, w as BUILT_IN_SECURITY_SCHEMES, x as ActorExtractor, y as RlsContext } from "../Endpoint-BxkRWQ8G.mjs";
4
+ import { n as EndpointBuilder, t as EndpointFactory } from "../EndpointFactory-T06kTFHg.mjs";
5
+ import { EnvironmentParser } from "@geekmidas/envkit";
6
+ import { EventPublisher, MappedEvent } from "@geekmidas/events";
7
+ import { Service, ServiceDiscovery } from "@geekmidas/services";
8
+ import { Context } from "hono";
9
+ import { AuditStorage } from "@geekmidas/audit";
10
+ import { Logger } from "@geekmidas/logger";
11
+ import { InferStandardSchema } from "@geekmidas/schema";
12
+ //#region src/publisher.d.ts
13
+ export declare function publishConstructEvents<T extends EventPublisher<any> | undefined, OutSchema extends StandardSchemaV1 | undefined = undefined, TServiceName extends string = string, TServices extends Service[] = [], TAuditStorageServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined>(construct: Construct<Logger, TServiceName, T, OutSchema, TServices, TAuditStorageServiceName, TAuditStorage>, response: InferStandardSchema<OutSchema>, serviceDiscovery: ServiceDiscovery<any>, logger?: Logger): Promise<void>;
14
+ //#endregion
15
+ //#region src/endpoints/lazyAccessors.d.ts
16
+ /**
17
+ * Create a lazy header accessor for Hono.
18
+ * Uses `c.req.header(name)` for single lookups (native, case-insensitive).
19
+ * Only calls `c.req.header()` to get all headers when needed.
20
+ */
21
+ export declare function createHonoHeaders(c: Context): HeaderFn;
22
+ /**
23
+ * Create a lazy cookie accessor for Hono.
24
+ * Uses `getCookie(c, name)` for single lookups (native).
25
+ * Only parses the cookie header when all cookies are requested.
26
+ */
27
+ export declare function createHonoCookies(c: Context): CookieFn;
28
+ /**
29
+ * Create a lazy header accessor for API Gateway events.
30
+ * Handles case-insensitive lookups.
31
+ */
32
+ export declare function createApiGatewayHeaders(headers: Record<string, string | undefined> | null | undefined): HeaderFn;
33
+ /**
34
+ * Create a lazy cookie accessor for API Gateway events.
35
+ * Decodes URL-encoded values to match browser behavior.
36
+ */
37
+ export declare function createApiGatewayCookies(cookies: string[] | undefined, cookieHeader: string | undefined): CookieFn;
38
+ /**
39
+ * Create a no-op header accessor (for minimal endpoints that don't use headers).
40
+ */
41
+ export declare function createNoopHeaders(): HeaderFn;
42
+ /**
43
+ * Create a no-op cookie accessor (for minimal endpoints that don't use cookies).
44
+ */
45
+ export declare function createNoopCookies(): CookieFn;
46
+ //#endregion
47
+ //#region src/endpoints/surfaceEnv.d.ts
48
+ /**
49
+ * The default parser, built once.
50
+ *
51
+ * Once because `Credentials` resolves through `globalThis` and decryption is
52
+ * not free, and because two parsers over the same environment are two caches of
53
+ * the same answer.
54
+ */
55
+ export declare function defaultEnvParser(): EnvironmentParser<{}>;
56
+ /** The parser for an endpoint, from its surface or the default. */
57
+ export declare function envParserFor(surface: EndpointSurface | undefined): EnvironmentParser<{}>;
58
+ //#endregion
59
+ export { type ActorExtractor, type Authorizer, BUILT_IN_SECURITY_SCHEMES, type BuiltInSecuritySchemeId, type ConvertRouteParams, Endpoint, EndpointBuilder, type EndpointContext, EndpointFactory, type EndpointHandler, type EndpointOutput, type EndpointSchemas, type MappedAudit, NoAuthenticator, type OAuthFlow, type OAuthFlows, RLS_BYPASS, ResponseBuilder, type RlsBypass, type RlsConfig, type RlsContext, type RlsContextExtractor, type SecurityScheme, type SessionAuth, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme };
60
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/publisher.ts","../../src/endpoints/lazyAccessors.ts","../../src/endpoints/surfaceEnv.ts"],"mappings":";;;;;;;;;;;;wBAgEsB,uBACrB,UAAU,iCACV,kBAAkB,0CAClB,sCACA,kBAAkB,gBAClB,kDACA,sBAAsB,sCAEtB,WAAW,UACV,QACA,cACA,GACA,WACA,WACA,0BACA,gBAED,UAAU,oBAAoB,YAC9B,kBAAkB,uBAClB,SAAQ,SAAyB;;;;;;;;wBCnElB,kBAAkB,GAAG,UAAU;;;;;;wBAqB/B,kBAAkB,GAAG,UAAU;;;;;wBAgC/B,wBACf,SAAS,wDACP;;;;;wBAoCa,wBACf,+BACA,mCACE;;;;wBAmHa,qBAAqB;;;;wBAUrB,qBAAqB;;;;;;;;;;wBC1MrB,oBAAoB;;wBASpB,aACf,SAAS,8BACP"}
@@ -1,10 +1,5 @@
1
- import "../Construct-BD5neF7w.mjs";
2
- import "../construct-interface-Z4CpS8tK.mjs";
3
- import "../functions-Cxbo-pEd.mjs";
4
- import { BUILT_IN_SECURITY_SCHEMES, EndpointBuilder, EndpointFactory, RLS_BYPASS, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme } from "../EndpointFactory-DTTCkGEL.mjs";
5
- import "../clone-DblgEZZa.mjs";
6
- import { Endpoint, ResponseBuilder } from "../Endpoint-VIOpSo0S.mjs";
7
- import { defaultEnvParser, envParserFor } from "../surfaceEnv-C3Ktahea.mjs";
8
- import { createApiGatewayCookies, createApiGatewayHeaders, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, publishConstructEvents } from "../lazyAccessors-BoJN3SMd.mjs";
9
-
10
- export { BUILT_IN_SECURITY_SCHEMES, Endpoint, EndpointBuilder, EndpointFactory, RLS_BYPASS, ResponseBuilder, createApiGatewayCookies, createApiGatewayHeaders, createAuthorizer, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, defaultEnvParser, envParserFor, getSecurityScheme, isBuiltInSecurityScheme, publishConstructEvents };
1
+ import { a as createAuthorizer, i as BUILT_IN_SECURITY_SCHEMES, n as EndpointBuilder, o as getSecurityScheme, r as RLS_BYPASS, s as isBuiltInSecurityScheme, t as EndpointFactory } from "../EndpointFactory-Bs8pu-yY.mjs";
2
+ import { n as ResponseBuilder, r as NoAuthenticator, t as Endpoint } from "../Endpoint-DCr5tlbJ.mjs";
3
+ import { n as envParserFor, t as defaultEnvParser } from "../surfaceEnv-wMT5QzgZ.mjs";
4
+ import { a as createHonoHeaders, i as createHonoCookies, l as publishConstructEvents, n as createApiGatewayHeaders, o as createNoopCookies, s as createNoopHeaders, t as createApiGatewayCookies } from "../lazyAccessors-BHtcqgz2.mjs";
5
+ export { BUILT_IN_SECURITY_SCHEMES, Endpoint, EndpointBuilder, EndpointFactory, NoAuthenticator, RLS_BYPASS, ResponseBuilder, createApiGatewayCookies, createApiGatewayHeaders, createAuthorizer, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, defaultEnvParser, envParserFor, getSecurityScheme, isBuiltInSecurityScheme, publishConstructEvents };
@@ -1,10 +1,41 @@
1
- const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const __geekmidas_manifest = require_chunk.__toESM(require("@geekmidas/manifest"));
3
- const __geekmidas_storage = require_chunk.__toESM(require("@geekmidas/storage"));
4
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _geekmidas_manifest = require("@geekmidas/manifest");
3
+ let _geekmidas_storage = require("@geekmidas/storage");
5
4
  //#region src/file-server.ts
5
+ /**
6
+ * `FileServer` — a domain that serves a bucket's objects.
7
+ *
8
+ * `ObjectStorage` is the bucket: it writes, it presigns, and its URL is never
9
+ * public. Serving those objects on a domain is a different thing, and it is a
10
+ * construct of its own rather than a flag on the bucket — see
11
+ * `docs/design/constructs-paradigm.md`, "Why a separate construct, and what it
12
+ * costs", for the comparison that rules the other two shapes out.
13
+ *
14
+ * ```ts
15
+ * export const uploads = new FileServer('Uploads', { open: ['brand/**'] });
16
+ *
17
+ * uploads.getUploadURL({ path, contentType }) // an S3 presign at the bucket
18
+ * uploads.url('brand/logo.png') // open path — no signature
19
+ * uploads.signedUrl('invoices/7.pdf') // one object, one recipient
20
+ * ```
21
+ *
22
+ * **One construct, one client, both halves.** How a file lands in the bucket is
23
+ * the same whether or not it is served, so splitting the upload half from the
24
+ * serving half would be ceremony rather than safety. The client is a *superset*
25
+ * of `StorageClient`, made literal in the type, so anything taking
26
+ * `services.uploads` keeps compiling when the construct behind it grows a
27
+ * serving half.
28
+ *
29
+ * **The id names the bucket, not the surface.** This is the detail that has to
30
+ * be right before anything ships, because getting it backwards is destructive:
31
+ * the migration people actually perform is serving a bucket they already have,
32
+ * and naming the bucket after the construct makes that edit *add* a node rather
33
+ * than rename the one holding the data.
34
+ */
6
35
  /** A key was asked to be served unsigned, and no open pattern admits it. */
7
36
  var NotOpen = class extends Error {
37
+ key;
38
+ open;
8
39
  constructor(key, open) {
9
40
  super(`'${key}' is not served without a signature. ` + (open.length ? `Open paths: ${open.join(", ")}. Use signedUrl() for anything else.` : "This file server declares no open paths, so every object needs signedUrl()."));
10
41
  this.key = key;
@@ -13,6 +44,7 @@ var NotOpen = class extends Error {
13
44
  }
14
45
  };
15
46
  var FileServer = class {
47
+ options;
16
48
  id;
17
49
  service;
18
50
  /** The id of the surface node, as opposed to the bucket's. */
@@ -25,17 +57,17 @@ var FileServer = class {
25
57
  keys;
26
58
  constructor(id, options = {}) {
27
59
  this.options = options;
28
- const canonical = (0, __geekmidas_manifest.canonicalId)(id);
60
+ const canonical = (0, _geekmidas_manifest.canonicalId)(id);
29
61
  this.id = canonical;
30
62
  this.open = options.open ?? [];
31
63
  const originId = options.origin?.id ?? canonical;
32
64
  this.surfaceId = `${canonical}Server`;
33
65
  this.keys = {
34
- origin: (0, __geekmidas_manifest.provideKey)(originId, "url"),
35
- server: (0, __geekmidas_manifest.provideKey)(this.surfaceId, "url")
66
+ origin: (0, _geekmidas_manifest.provideKey)(originId, "url"),
67
+ server: (0, _geekmidas_manifest.provideKey)(this.surfaceId, "url")
36
68
  };
37
69
  this.service = {
38
- serviceName: (0, __geekmidas_manifest.serviceKey)(canonical),
70
+ serviceName: (0, _geekmidas_manifest.serviceKey)(canonical),
39
71
  register: (registerOptions) => this.connect(registerOptions)
40
72
  };
41
73
  }
@@ -99,7 +131,7 @@ var FileServer = class {
99
131
  origin: get(this.keys.origin).string(),
100
132
  server: get(this.keys.server).string()
101
133
  })).parse();
102
- const storage = (0, __geekmidas_storage.createStorageClient)(origin);
134
+ const storage = (0, _geekmidas_storage.createStorageClient)(origin);
103
135
  const base = server.replace(/\/+$/, "");
104
136
  const serve = (key) => {
105
137
  if (!this.serves(key)) throw new NotOpen(key, this.open);
@@ -147,8 +179,8 @@ function globToRegExp(pattern) {
147
179
  }
148
180
  return new RegExp(`^${source}$`);
149
181
  }
150
-
151
182
  //#endregion
152
183
  exports.FileServer = FileServer;
153
184
  exports.NotOpen = NotOpen;
185
+
154
186
  //# sourceMappingURL=file-server.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-server.cjs","names":["key: string","open: readonly string[]","id: ConstructName<TName>","options: FileServerOptions<TOpen>","surface: Declaration","options: ServiceRegisterOptions","expiresIn?: number","pattern: string"],"sources":["../src/file-server.ts"],"sourcesContent":["/**\n * `FileServer` — a domain that serves a bucket's objects.\n *\n * `ObjectStorage` is the bucket: it writes, it presigns, and its URL is never\n * public. Serving those objects on a domain is a different thing, and it is a\n * construct of its own rather than a flag on the bucket — see\n * `docs/design/constructs-paradigm.md`, \"Why a separate construct, and what it\n * costs\", for the comparison that rules the other two shapes out.\n *\n * ```ts\n * export const uploads = new FileServer('Uploads', { open: ['brand/**'] });\n *\n * uploads.getUploadURL({ path, contentType }) // an S3 presign at the bucket\n * uploads.url('brand/logo.png') // open path — no signature\n * uploads.signedUrl('invoices/7.pdf') // one object, one recipient\n * ```\n *\n * **One construct, one client, both halves.** How a file lands in the bucket is\n * the same whether or not it is served, so splitting the upload half from the\n * serving half would be ceremony rather than safety. The client is a *superset*\n * of `StorageClient`, made literal in the type, so anything taking\n * `services.uploads` keeps compiling when the construct behind it grows a\n * serving half.\n *\n * **The id names the bucket, not the surface.** This is the detail that has to\n * be right before anything ships, because getting it backwards is destructive:\n * the migration people actually perform is serving a bucket they already have,\n * and naming the bucket after the construct makes that edit *add* a node rather\n * than rename the one holding the data.\n */\n\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 { createStorageClient, type StorageClient } from '@geekmidas/storage';\nimport type { Construct, Declarable } from './construct-interface';\n\n/**\n * A key an open pattern admits.\n *\n * The same template-literal trick `ConstructName` uses, so `open` is checked at\n * the call site rather than only at the edge:\n *\n * ```ts\n * files.url('brand/logo.png') // ok\n * files.url(`avatars/${id}.png`) // ok — a template literal still matches\n * files.url('invoices/7.pdf') // not assignable — never served unsigned\n * ```\n *\n * A single star and a double star resolve to the same type, stated rather than\n * discovered: a template literal cannot exclude `/`, so this is a prefix-and-\n * suffix guard while the *exact* pattern is enforced by the bucket policy, by\n * the cache behaviour, and by this construct's own runtime check. The type says\n * plausibly open; the infrastructure says definitely.\n */\nexport type Served<P extends string> = P extends `${infer Head}**`\n\t? `${Head}${string}`\n\t: P extends `${infer Head}*${infer Tail}`\n\t\t? `${Head}${string}${Tail}`\n\t\t: P;\n\n/** What consuming a file server hands you: a bucket client that also serves. */\nexport interface FileServerClient<TOpen extends string = never>\n\textends StorageClient {\n\t/**\n\t * The unsigned address of an open object.\n\t *\n\t * Compile-checked against the declared patterns, *and* checked again at\n\t * runtime — a JavaScript caller gets no compiler, and minting an unsigned\n\t * URL for a private object is a leak rather than a mistake.\n\t *\n\t * @throws {NotOpen} when the key matches no declared pattern.\n\t */\n\turl(key: Served<TOpen>): string;\n\n\t/**\n\t * The same thing for a key the compiler cannot see.\n\t *\n\t * A fully dynamic key does not type, which is correct and is also the case\n\t * people will hit — so the escape hatch is a named method rather than a\n\t * cast, and it runs the *same* runtime check rather than being a way around\n\t * it.\n\t *\n\t * @throws {NotOpen} when the key matches no declared pattern.\n\t */\n\topenUrl(key: string): string;\n\n\t/**\n\t * A signed address for one object and one recipient.\n\t *\n\t * Today this is an **S3 presign at the bucket**, which is what works\n\t * unchanged against MinIO locally and against S3 deployed. It is deliberately\n\t * not described as a CDN URL: CloudFront signing is a different mechanism,\n\t * with different keys, against a different host, and it needs key material\n\t * this construct does not yet declare.\n\t *\n\t * @param expiresIn - minutes, matching `getUploadURL`.\n\t */\n\tsignedUrl(key: string, expiresIn?: number): Promise<string>;\n}\n\nexport interface FileServerOptions<TOpen extends string = never> {\n\t/**\n\t * Paths served without a signature. Everything else needs one.\n\t *\n\t * Private by default: a bucket where forgetting a flag publishes user\n\t * uploads is the wrong default, so this is an exception list, and listing it\n\t * in code means exactly one set of paths is unauthenticated and it is\n\t * reviewable in a diff.\n\t *\n\t * Uploading is deliberately *not* restricted to these. Writing to a path\n\t * that happens to be open is ordinary; the only asymmetry worth enforcing is\n\t * that you cannot hand out an unsigned URL for something the server would\n\t * refuse to serve unsigned.\n\t */\n\topen?: readonly TOpen[];\n\t/** Keep previous versions of an object. */\n\tversioned?: boolean;\n\t/**\n\t * A bucket declared elsewhere, instead of one of this server's own.\n\t *\n\t * `new FileServer('Uploads')` declares both nodes; this fronts a bucket that\n\t * already exists, which is also how the two edges come back when you want\n\t * them separately — a handler depending on the bucket writes, a handler\n\t * depending on the server mints URLs.\n\t */\n\torigin?: Declarable;\n}\n\n/** A key was asked to be served unsigned, and no open pattern admits it. */\nexport class NotOpen extends Error {\n\tconstructor(\n\t\treadonly key: string,\n\t\treadonly open: readonly string[],\n\t) {\n\t\tsuper(\n\t\t\t`'${key}' is not served without a signature. ` +\n\t\t\t\t(open.length\n\t\t\t\t\t? `Open paths: ${open.join(', ')}. Use signedUrl() for anything else.`\n\t\t\t\t\t: 'This file server declares no open paths, so every object needs signedUrl().'),\n\t\t);\n\t\tthis.name = 'NotOpen';\n\t}\n}\n\nexport class FileServer<\n\tTName extends string = string,\n\tTOpen extends string = never,\n> implements Construct<TName, FileServerClient<TOpen>>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, FileServerClient<TOpen>>;\n\n\t/** The id of the surface node, as opposed to the bucket's. */\n\treadonly surfaceId: string;\n\n\tprivate readonly open: readonly string[];\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the keys the\n\t * target publishes and the keys the client reads cannot drift.\n\t */\n\tprivate readonly keys: { origin: string; server: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: FileServerOptions<TOpen> = {},\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.open = options.open ?? [];\n\n\t\t// The surface takes the suffix and the bucket keeps the plain id, which\n\t\t// is what makes \"serve a bucket I already have\" an edit that adds a node\n\t\t// instead of renaming the one holding the data.\n\t\tconst originId = options.origin?.id ?? canonical;\n\t\tthis.surfaceId = `${canonical}Server`;\n\n\t\tthis.keys = {\n\t\t\torigin: provideKey(originId, 'url'),\n\t\t\tserver: provideKey(this.surfaceId, 'url'),\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: (registerOptions) => this.connect(registerOptions),\n\t\t};\n\t}\n\n\t/**\n\t * The served surface, as something an edge can point at.\n\t *\n\t * Depending on the `FileServer` itself points at the **bucket** — its\n\t * canonical node — which is right for a handler: it presigns and writes. But\n\t * a bucket's URL is never public, so a site depending on it gets nothing\n\t * inlined, which is correct and also useless.\n\t *\n\t * This is the other half: `.dependsOn([uploads.server])` points at the\n\t * surface, whose address *is* public, and is what puts\n\t * `VITE_UPLOADS_SERVER_URL` in a bundle. The same accessor shape\n\t * `database.reader()` uses, and for the same reason — one construct owning\n\t * two addresses needs a way to name the second.\n\t */\n\tget server(): Declarable {\n\t\tconst surface = this.declare().find(\n\t\t\t(declaration) => declaration.id === this.surfaceId,\n\t\t);\n\n\t\treturn {\n\t\t\tid: this.surfaceId,\n\t\t\tdeclare: () => (surface ? [surface] : []),\n\t\t};\n\t}\n\n\t/**\n\t * The bucket and the surface over it — or just the surface, when the bucket\n\t * was declared elsewhere.\n\t *\n\t * The surface names its origin through `of`, which is what makes the\n\t * reference check work: an origin resolving to nothing is a build failure,\n\t * the same guarantee `assertDerivations` already gives a reader and a schema\n\t * tenant.\n\t */\n\tdeclare(): Declaration[] {\n\t\tconst origin = this.options.origin;\n\n\t\tconst surface: Declaration = {\n\t\t\tkind: 'file-server',\n\t\t\tid: this.surfaceId,\n\t\t\tof: origin?.id ?? this.id,\n\t\t\t...(this.open.length ? { open: this.open } : {}),\n\t\t\tprovides: [this.keys.server],\n\t\t};\n\n\t\t// A vended bucket is declared here; a given one already declares itself,\n\t\t// and declaring it twice is the duplication the whole model removes.\n\t\tif (origin) return [surface];\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'objects',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.origin],\n\t\t\t\t...(this.options.versioned ? { versioned: true } : {}),\n\t\t\t},\n\t\t\tsurface,\n\t\t];\n\t}\n\n\t/**\n\t * The bucket's client, with the serving half added.\n\t *\n\t * Both addresses are read here, which is also how the environment reaches a\n\t * handler: the sniffer records what this reads, so `.dependsOn([uploads])`\n\t * carries the bucket URL and the server URL without either being written\n\t * down beside the handler.\n\t */\n\tprivate async connect(\n\t\toptions: ServiceRegisterOptions,\n\t): Promise<FileServerClient<TOpen>> {\n\t\tconst { origin, server } = options.envParser\n\t\t\t.create((get) => ({\n\t\t\t\torigin: get(this.keys.origin).string(),\n\t\t\t\tserver: get(this.keys.server).string(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\tconst storage = createStorageClient(origin);\n\t\tconst base = server.replace(/\\/+$/, '');\n\n\t\tconst serve = (key: string): string => {\n\t\t\tif (!this.serves(key)) throw new NotOpen(key, this.open);\n\n\t\t\treturn `${base}/${key.replace(/^\\/+/, '')}`;\n\t\t};\n\n\t\t// Delegating rather than copying: the bucket half is whatever the driver\n\t\t// produced, including anything it grows later, and only the serving half\n\t\t// is added on top.\n\t\treturn Object.assign(Object.create(storage) as StorageClient, {\n\t\t\turl: serve as (key: Served<TOpen>) => string,\n\t\t\topenUrl: serve,\n\t\t\tsignedUrl: (key: string, expiresIn?: number) =>\n\t\t\t\tstorage.getDownloadURL({ path: key } as never, expiresIn),\n\t\t}) as FileServerClient<TOpen>;\n\t}\n\n\t/**\n\t * Whether an open pattern admits a key.\n\t *\n\t * The runtime half of {@link Served}, and stricter than it: here a single\n\t * star stops at a segment boundary and a double star does not, which is the\n\t * distinction a template-literal type cannot draw and the infrastructure\n\t * does.\n\t */\n\tprivate serves(key: string): boolean {\n\t\treturn this.open.some((pattern) => globToRegExp(pattern).test(key));\n\t}\n}\n\n/**\n * One open pattern as an anchored expression.\n *\n * A double star crosses `/`; a single star does not. Both are consumed in one\n * left-to-right pass rather than by substitution, so a pattern cannot be\n * rewritten into a placeholder that a later pass mistakes for literal text.\n */\nfunction globToRegExp(pattern: string): RegExp {\n\tlet source = '';\n\n\tfor (let index = 0; index < pattern.length; index++) {\n\t\tconst character = pattern[index];\n\n\t\tif (character !== '*') {\n\t\t\tsource += character?.replace(/[.+^${}()|[\\]\\\\?]/, '\\\\$&') ?? '';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (pattern[index + 1] === '*') {\n\t\t\tsource += '.*';\n\t\t\tindex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tsource += '[^/]*';\n\t}\n\n\treturn new RegExp(`^${source}$`);\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"file-server.cjs","names":["canonicalId","provideKey","serviceKey","createStorageClient"],"sources":["../src/file-server.ts"],"sourcesContent":["/**\n * `FileServer` — a domain that serves a bucket's objects.\n *\n * `ObjectStorage` is the bucket: it writes, it presigns, and its URL is never\n * public. Serving those objects on a domain is a different thing, and it is a\n * construct of its own rather than a flag on the bucket — see\n * `docs/design/constructs-paradigm.md`, \"Why a separate construct, and what it\n * costs\", for the comparison that rules the other two shapes out.\n *\n * ```ts\n * export const uploads = new FileServer('Uploads', { open: ['brand/**'] });\n *\n * uploads.getUploadURL({ path, contentType }) // an S3 presign at the bucket\n * uploads.url('brand/logo.png') // open path — no signature\n * uploads.signedUrl('invoices/7.pdf') // one object, one recipient\n * ```\n *\n * **One construct, one client, both halves.** How a file lands in the bucket is\n * the same whether or not it is served, so splitting the upload half from the\n * serving half would be ceremony rather than safety. The client is a *superset*\n * of `StorageClient`, made literal in the type, so anything taking\n * `services.uploads` keeps compiling when the construct behind it grows a\n * serving half.\n *\n * **The id names the bucket, not the surface.** This is the detail that has to\n * be right before anything ships, because getting it backwards is destructive:\n * the migration people actually perform is serving a bucket they already have,\n * and naming the bucket after the construct makes that edit *add* a node rather\n * than rename the one holding the data.\n */\n\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 { createStorageClient, type StorageClient } from '@geekmidas/storage';\nimport type { Construct, Declarable } from './construct-interface';\n\n/**\n * A key an open pattern admits.\n *\n * The same template-literal trick `ConstructName` uses, so `open` is checked at\n * the call site rather than only at the edge:\n *\n * ```ts\n * files.url('brand/logo.png') // ok\n * files.url(`avatars/${id}.png`) // ok — a template literal still matches\n * files.url('invoices/7.pdf') // not assignable — never served unsigned\n * ```\n *\n * A single star and a double star resolve to the same type, stated rather than\n * discovered: a template literal cannot exclude `/`, so this is a prefix-and-\n * suffix guard while the *exact* pattern is enforced by the bucket policy, by\n * the cache behaviour, and by this construct's own runtime check. The type says\n * plausibly open; the infrastructure says definitely.\n */\nexport type Served<P extends string> = P extends `${infer Head}**`\n\t? `${Head}${string}`\n\t: P extends `${infer Head}*${infer Tail}`\n\t\t? `${Head}${string}${Tail}`\n\t\t: P;\n\n/** What consuming a file server hands you: a bucket client that also serves. */\nexport interface FileServerClient<TOpen extends string = never>\n\textends StorageClient {\n\t/**\n\t * The unsigned address of an open object.\n\t *\n\t * Compile-checked against the declared patterns, *and* checked again at\n\t * runtime — a JavaScript caller gets no compiler, and minting an unsigned\n\t * URL for a private object is a leak rather than a mistake.\n\t *\n\t * @throws {NotOpen} when the key matches no declared pattern.\n\t */\n\turl(key: Served<TOpen>): string;\n\n\t/**\n\t * The same thing for a key the compiler cannot see.\n\t *\n\t * A fully dynamic key does not type, which is correct and is also the case\n\t * people will hit — so the escape hatch is a named method rather than a\n\t * cast, and it runs the *same* runtime check rather than being a way around\n\t * it.\n\t *\n\t * @throws {NotOpen} when the key matches no declared pattern.\n\t */\n\topenUrl(key: string): string;\n\n\t/**\n\t * A signed address for one object and one recipient.\n\t *\n\t * Today this is an **S3 presign at the bucket**, which is what works\n\t * unchanged against MinIO locally and against S3 deployed. It is deliberately\n\t * not described as a CDN URL: CloudFront signing is a different mechanism,\n\t * with different keys, against a different host, and it needs key material\n\t * this construct does not yet declare.\n\t *\n\t * @param expiresIn - minutes, matching `getUploadURL`.\n\t */\n\tsignedUrl(key: string, expiresIn?: number): Promise<string>;\n}\n\nexport interface FileServerOptions<TOpen extends string = never> {\n\t/**\n\t * Paths served without a signature. Everything else needs one.\n\t *\n\t * Private by default: a bucket where forgetting a flag publishes user\n\t * uploads is the wrong default, so this is an exception list, and listing it\n\t * in code means exactly one set of paths is unauthenticated and it is\n\t * reviewable in a diff.\n\t *\n\t * Uploading is deliberately *not* restricted to these. Writing to a path\n\t * that happens to be open is ordinary; the only asymmetry worth enforcing is\n\t * that you cannot hand out an unsigned URL for something the server would\n\t * refuse to serve unsigned.\n\t */\n\topen?: readonly TOpen[];\n\t/** Keep previous versions of an object. */\n\tversioned?: boolean;\n\t/**\n\t * A bucket declared elsewhere, instead of one of this server's own.\n\t *\n\t * `new FileServer('Uploads')` declares both nodes; this fronts a bucket that\n\t * already exists, which is also how the two edges come back when you want\n\t * them separately — a handler depending on the bucket writes, a handler\n\t * depending on the server mints URLs.\n\t */\n\torigin?: Declarable;\n}\n\n/** A key was asked to be served unsigned, and no open pattern admits it. */\nexport class NotOpen extends Error {\n\tconstructor(\n\t\treadonly key: string,\n\t\treadonly open: readonly string[],\n\t) {\n\t\tsuper(\n\t\t\t`'${key}' is not served without a signature. ` +\n\t\t\t\t(open.length\n\t\t\t\t\t? `Open paths: ${open.join(', ')}. Use signedUrl() for anything else.`\n\t\t\t\t\t: 'This file server declares no open paths, so every object needs signedUrl().'),\n\t\t);\n\t\tthis.name = 'NotOpen';\n\t}\n}\n\nexport class FileServer<\n\tTName extends string = string,\n\tTOpen extends string = never,\n> implements Construct<TName, FileServerClient<TOpen>>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, FileServerClient<TOpen>>;\n\n\t/** The id of the surface node, as opposed to the bucket's. */\n\treadonly surfaceId: string;\n\n\tprivate readonly open: readonly string[];\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the keys the\n\t * target publishes and the keys the client reads cannot drift.\n\t */\n\tprivate readonly keys: { origin: string; server: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: FileServerOptions<TOpen> = {},\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.open = options.open ?? [];\n\n\t\t// The surface takes the suffix and the bucket keeps the plain id, which\n\t\t// is what makes \"serve a bucket I already have\" an edit that adds a node\n\t\t// instead of renaming the one holding the data.\n\t\tconst originId = options.origin?.id ?? canonical;\n\t\tthis.surfaceId = `${canonical}Server`;\n\n\t\tthis.keys = {\n\t\t\torigin: provideKey(originId, 'url'),\n\t\t\tserver: provideKey(this.surfaceId, 'url'),\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: (registerOptions) => this.connect(registerOptions),\n\t\t};\n\t}\n\n\t/**\n\t * The served surface, as something an edge can point at.\n\t *\n\t * Depending on the `FileServer` itself points at the **bucket** — its\n\t * canonical node — which is right for a handler: it presigns and writes. But\n\t * a bucket's URL is never public, so a site depending on it gets nothing\n\t * inlined, which is correct and also useless.\n\t *\n\t * This is the other half: `.dependsOn([uploads.server])` points at the\n\t * surface, whose address *is* public, and is what puts\n\t * `VITE_UPLOADS_SERVER_URL` in a bundle. The same accessor shape\n\t * `database.reader()` uses, and for the same reason — one construct owning\n\t * two addresses needs a way to name the second.\n\t */\n\tget server(): Declarable {\n\t\tconst surface = this.declare().find(\n\t\t\t(declaration) => declaration.id === this.surfaceId,\n\t\t);\n\n\t\treturn {\n\t\t\tid: this.surfaceId,\n\t\t\tdeclare: () => (surface ? [surface] : []),\n\t\t};\n\t}\n\n\t/**\n\t * The bucket and the surface over it — or just the surface, when the bucket\n\t * was declared elsewhere.\n\t *\n\t * The surface names its origin through `of`, which is what makes the\n\t * reference check work: an origin resolving to nothing is a build failure,\n\t * the same guarantee `assertDerivations` already gives a reader and a schema\n\t * tenant.\n\t */\n\tdeclare(): Declaration[] {\n\t\tconst origin = this.options.origin;\n\n\t\tconst surface: Declaration = {\n\t\t\tkind: 'file-server',\n\t\t\tid: this.surfaceId,\n\t\t\tof: origin?.id ?? this.id,\n\t\t\t...(this.open.length ? { open: this.open } : {}),\n\t\t\tprovides: [this.keys.server],\n\t\t};\n\n\t\t// A vended bucket is declared here; a given one already declares itself,\n\t\t// and declaring it twice is the duplication the whole model removes.\n\t\tif (origin) return [surface];\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'objects',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.origin],\n\t\t\t\t...(this.options.versioned ? { versioned: true } : {}),\n\t\t\t},\n\t\t\tsurface,\n\t\t];\n\t}\n\n\t/**\n\t * The bucket's client, with the serving half added.\n\t *\n\t * Both addresses are read here, which is also how the environment reaches a\n\t * handler: the sniffer records what this reads, so `.dependsOn([uploads])`\n\t * carries the bucket URL and the server URL without either being written\n\t * down beside the handler.\n\t */\n\tprivate async connect(\n\t\toptions: ServiceRegisterOptions,\n\t): Promise<FileServerClient<TOpen>> {\n\t\tconst { origin, server } = options.envParser\n\t\t\t.create((get) => ({\n\t\t\t\torigin: get(this.keys.origin).string(),\n\t\t\t\tserver: get(this.keys.server).string(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\tconst storage = createStorageClient(origin);\n\t\tconst base = server.replace(/\\/+$/, '');\n\n\t\tconst serve = (key: string): string => {\n\t\t\tif (!this.serves(key)) throw new NotOpen(key, this.open);\n\n\t\t\treturn `${base}/${key.replace(/^\\/+/, '')}`;\n\t\t};\n\n\t\t// Delegating rather than copying: the bucket half is whatever the driver\n\t\t// produced, including anything it grows later, and only the serving half\n\t\t// is added on top.\n\t\treturn Object.assign(Object.create(storage) as StorageClient, {\n\t\t\turl: serve as (key: Served<TOpen>) => string,\n\t\t\topenUrl: serve,\n\t\t\tsignedUrl: (key: string, expiresIn?: number) =>\n\t\t\t\tstorage.getDownloadURL({ path: key } as never, expiresIn),\n\t\t}) as FileServerClient<TOpen>;\n\t}\n\n\t/**\n\t * Whether an open pattern admits a key.\n\t *\n\t * The runtime half of {@link Served}, and stricter than it: here a single\n\t * star stops at a segment boundary and a double star does not, which is the\n\t * distinction a template-literal type cannot draw and the infrastructure\n\t * does.\n\t */\n\tprivate serves(key: string): boolean {\n\t\treturn this.open.some((pattern) => globToRegExp(pattern).test(key));\n\t}\n}\n\n/**\n * One open pattern as an anchored expression.\n *\n * A double star crosses `/`; a single star does not. Both are consumed in one\n * left-to-right pass rather than by substitution, so a pattern cannot be\n * rewritten into a placeholder that a later pass mistakes for literal text.\n */\nfunction globToRegExp(pattern: string): RegExp {\n\tlet source = '';\n\n\tfor (let index = 0; index < pattern.length; index++) {\n\t\tconst character = pattern[index];\n\n\t\tif (character !== '*') {\n\t\t\tsource += character?.replace(/[.+^${}()|[\\]\\\\?]/, '\\\\$&') ?? '';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (pattern[index + 1] === '*') {\n\t\t\tsource += '.*';\n\t\t\tindex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tsource += '[^/]*';\n\t}\n\n\treturn new RegExp(`^${source}$`);\n}\n"],"mappings":"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"}
@@ -1,10 +1,8 @@
1
- import { Construct, Declarable } from "./construct-interface-D9d4Gm4p.cjs";
1
+ import { i as Declarable, n as Construct } from "./construct-interface-DIaTNKax.cjs";
2
2
  import { Service } from "@geekmidas/services";
3
3
  import { ConstructName, Declaration } from "@geekmidas/manifest";
4
4
  import { StorageClient } from "@geekmidas/storage";
5
-
6
5
  //#region src/file-server.d.ts
7
-
8
6
  /**
9
7
  * A key an open pattern admits.
10
8
  *
@@ -23,9 +21,9 @@ import { StorageClient } from "@geekmidas/storage";
23
21
  * the cache behaviour, and by this construct's own runtime check. The type says
24
22
  * plausibly open; the infrastructure says definitely.
25
23
  */
26
- type Served<P extends string> = P extends `${infer Head}**` ? `${Head}${string}` : P extends `${infer Head}*${infer Tail}` ? `${Head}${string}${Tail}` : P;
24
+ export type Served<P extends string> = P extends `${infer Head}**` ? `${Head}${string}` : P extends `${infer Head}*${infer Tail}` ? `${Head}${string}${Tail}` : P;
27
25
  /** What consuming a file server hands you: a bucket client that also serves. */
28
- interface FileServerClient<TOpen extends string = never> extends StorageClient {
26
+ export interface FileServerClient<TOpen extends string = never> extends StorageClient {
29
27
  /**
30
28
  * The unsigned address of an open object.
31
29
  *
@@ -60,7 +58,7 @@ interface FileServerClient<TOpen extends string = never> extends StorageClient {
60
58
  */
61
59
  signedUrl(key: string, expiresIn?: number): Promise<string>;
62
60
  }
63
- interface FileServerOptions<TOpen extends string = never> {
61
+ export interface FileServerOptions<TOpen extends string = never> {
64
62
  /**
65
63
  * Paths served without a signature. Everything else needs one.
66
64
  *
@@ -88,12 +86,12 @@ interface FileServerOptions<TOpen extends string = never> {
88
86
  origin?: Declarable;
89
87
  }
90
88
  /** A key was asked to be served unsigned, and no open pattern admits it. */
91
- declare class NotOpen extends Error {
89
+ export declare class NotOpen extends Error {
92
90
  readonly key: string;
93
91
  readonly open: readonly string[];
94
92
  constructor(key: string, open: readonly string[]);
95
93
  }
96
- declare class FileServer<TName extends string = string, TOpen extends string = never> implements Construct<TName, FileServerClient<TOpen>> {
94
+ export declare class FileServer<TName extends string = string, TOpen extends string = never> implements Construct<TName, FileServerClient<TOpen>> {
97
95
  private readonly options;
98
96
  readonly id: TName;
99
97
  readonly service: Service<Uncapitalize<TName>, FileServerClient<TOpen>>;
@@ -150,7 +148,5 @@ declare class FileServer<TName extends string = string, TOpen extends string = n
150
148
  */
151
149
  private serves;
152
150
  }
153
- //# sourceMappingURL=file-server.d.ts.map
154
151
  //#endregion
155
- export { FileServer, FileServerClient, FileServerOptions, NotOpen, Served };
156
152
  //# sourceMappingURL=file-server.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-server.d.cts","names":[],"sources":["../src/file-server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;AAyJsB;;;;;;KA7FV,2BAA2B,iCACjC,kBACH,6CACI,gBAAgB,SACnB;;UAGa,uDACR;;;;;;;;;;WAUC,OAAO;;;;;;;;;;;;;;;;;;;;;;;8CAyB4B;;UAG5B;;;;;;;;;;;;;;kBAcA;;;;;;;;;;;WAWP;;;cAIG,OAAA,SAAgB,KAAK;;;;;cAerB,mFAGA,UAAU,OAAO,iBAAiB;;eAEjC;oBACK,QAAQ,aAAa,QAAQ,iBAAiB;;;;;;;;;kBAc3D,cAAc,kBACQ,kBAAkB;;;;;;;;;;;;;;;gBAuC/B;;;;;;;;;;aAoBH"}
1
+ {"version":3,"file":"file-server.d.cts","names":[],"sources":["../src/file-server.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YA4DY,OAAO,oBAAoB,mBAAmB,cACpD,kBACH,mBAAmB,cAAc,YAC7B,gBAAgB,SACnB;;iBAGa,iBAAiB,sCACzB;;;;;;;;;;EAUR,IAAI,KAAK,OAAO;;;;;;;;;;;EAYhB,QAAQ;;;;;;;;;;;;EAaR,UAAU,aAAa,qBAAqB;;iBAG5B,kBAAkB;;;;;;;;;;;;;;EAclC,gBAAgB;;EAEhB;;;;;;;;;EASA,SAAS;;;qBAIG,gBAAgB;WAElB;WACA;EAFV,YACU,aACA;;qBAYE,WACZ,+BACA,yCACY,UAAU,OAAO,iBAAiB;mBAkB5B;WAhBT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,iBAAiB;;WAGvD;mBAEQ;;;;;mBAMA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,kBAAkB;;;;;;;;;;;;;;;MAuCzC,UAAU;;;;;;;;;;EAoBd,WAAW;;;;;;;;;UAkCG;;;;;;;;;UAsCN"}
@@ -1,10 +1,8 @@
1
- import { Construct, Declarable } from "./construct-interface-g5GM5pwR.mjs";
1
+ import { i as Declarable, n as Construct } from "./construct-interface-Clz7_BwB.mjs";
2
2
  import { ConstructName, Declaration } from "@geekmidas/manifest";
3
3
  import { StorageClient } from "@geekmidas/storage";
4
4
  import { Service } from "@geekmidas/services";
5
-
6
5
  //#region src/file-server.d.ts
7
-
8
6
  /**
9
7
  * A key an open pattern admits.
10
8
  *
@@ -23,9 +21,9 @@ import { Service } from "@geekmidas/services";
23
21
  * the cache behaviour, and by this construct's own runtime check. The type says
24
22
  * plausibly open; the infrastructure says definitely.
25
23
  */
26
- type Served<P extends string> = P extends `${infer Head}**` ? `${Head}${string}` : P extends `${infer Head}*${infer Tail}` ? `${Head}${string}${Tail}` : P;
24
+ export type Served<P extends string> = P extends `${infer Head}**` ? `${Head}${string}` : P extends `${infer Head}*${infer Tail}` ? `${Head}${string}${Tail}` : P;
27
25
  /** What consuming a file server hands you: a bucket client that also serves. */
28
- interface FileServerClient<TOpen extends string = never> extends StorageClient {
26
+ export interface FileServerClient<TOpen extends string = never> extends StorageClient {
29
27
  /**
30
28
  * The unsigned address of an open object.
31
29
  *
@@ -60,7 +58,7 @@ interface FileServerClient<TOpen extends string = never> extends StorageClient {
60
58
  */
61
59
  signedUrl(key: string, expiresIn?: number): Promise<string>;
62
60
  }
63
- interface FileServerOptions<TOpen extends string = never> {
61
+ export interface FileServerOptions<TOpen extends string = never> {
64
62
  /**
65
63
  * Paths served without a signature. Everything else needs one.
66
64
  *
@@ -88,12 +86,12 @@ interface FileServerOptions<TOpen extends string = never> {
88
86
  origin?: Declarable;
89
87
  }
90
88
  /** A key was asked to be served unsigned, and no open pattern admits it. */
91
- declare class NotOpen extends Error {
89
+ export declare class NotOpen extends Error {
92
90
  readonly key: string;
93
91
  readonly open: readonly string[];
94
92
  constructor(key: string, open: readonly string[]);
95
93
  }
96
- declare class FileServer<TName extends string = string, TOpen extends string = never> implements Construct<TName, FileServerClient<TOpen>> {
94
+ export declare class FileServer<TName extends string = string, TOpen extends string = never> implements Construct<TName, FileServerClient<TOpen>> {
97
95
  private readonly options;
98
96
  readonly id: TName;
99
97
  readonly service: Service<Uncapitalize<TName>, FileServerClient<TOpen>>;
@@ -150,7 +148,5 @@ declare class FileServer<TName extends string = string, TOpen extends string = n
150
148
  */
151
149
  private serves;
152
150
  }
153
- //# sourceMappingURL=file-server.d.ts.map
154
151
  //#endregion
155
- export { FileServer, FileServerClient, FileServerOptions, NotOpen, Served };
156
152
  //# sourceMappingURL=file-server.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-server.d.mts","names":[],"sources":["../src/file-server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;AAyJsB;;;;;;KA7FV,2BAA2B,iCACjC,kBACH,6CACI,gBAAgB,SACnB;;UAGa,uDACR;;;;;;;;;;WAUC,OAAO;;;;;;;;;;;;;;;;;;;;;;;8CAyB4B;;UAG5B;;;;;;;;;;;;;;kBAcA;;;;;;;;;;;WAWP;;;cAIG,OAAA,SAAgB,KAAK;;;;;cAerB,mFAGA,UAAU,OAAO,iBAAiB;;eAEjC;oBACK,QAAQ,aAAa,QAAQ,iBAAiB;;;;;;;;;kBAc3D,cAAc,kBACQ,kBAAkB;;;;;;;;;;;;;;;gBAuC/B;;;;;;;;;;aAoBH"}
1
+ {"version":3,"file":"file-server.d.mts","names":[],"sources":["../src/file-server.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YA4DY,OAAO,oBAAoB,mBAAmB,cACpD,kBACH,mBAAmB,cAAc,YAC7B,gBAAgB,SACnB;;iBAGa,iBAAiB,sCACzB;;;;;;;;;;EAUR,IAAI,KAAK,OAAO;;;;;;;;;;;EAYhB,QAAQ;;;;;;;;;;;;EAaR,UAAU,aAAa,qBAAqB;;iBAG5B,kBAAkB;;;;;;;;;;;;;;EAclC,gBAAgB;;EAEhB;;;;;;;;;EASA,SAAS;;;qBAIG,gBAAgB;WAElB;WACA;EAFV,YACU,aACA;;qBAYE,WACZ,+BACA,yCACY,UAAU,OAAO,iBAAiB;mBAkB5B;WAhBT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,iBAAiB;;WAGvD;mBAEQ;;;;;mBAMA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,kBAAkB;;;;;;;;;;;;;;;MAuCzC,UAAU;;;;;;;;;;EAoBd,WAAW;;;;;;;;;UAkCG;;;;;;;;;UAsCN"}