@geekmidas/constructs 10.0.0-alpha.12 → 10.0.0-alpha.121

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 (454) hide show
  1. package/README.md +222 -158
  2. package/dist/Construct-B7AXn0xH.d.mts +230 -0
  3. package/dist/Construct-B7AXn0xH.d.mts.map +1 -0
  4. package/dist/Construct-CFW0zjdD.d.cts +230 -0
  5. package/dist/Construct-CFW0zjdD.d.cts.map +1 -0
  6. package/dist/{Construct-BD5neF7w.mjs → Construct-CKUA-CTA.mjs} +35 -35
  7. package/dist/Construct-CKUA-CTA.mjs.map +1 -0
  8. package/dist/{Construct-CyS3RpTL.cjs → Construct-DEOVauyA.cjs} +55 -49
  9. package/dist/Construct-DEOVauyA.cjs.map +1 -0
  10. package/dist/{Cron-DmQ8vQ4b.d.cts → Cron-bdGRSROY.d.cts} +15 -9
  11. package/dist/Cron-bdGRSROY.d.cts.map +1 -0
  12. package/dist/{Cron-dh4rUgib.d.mts → Cron-i4Uetezh.d.mts} +15 -9
  13. package/dist/Cron-i4Uetezh.d.mts.map +1 -0
  14. package/dist/CronBuilder-9H4BnD6W.d.mts +47 -0
  15. package/dist/CronBuilder-9H4BnD6W.d.mts.map +1 -0
  16. package/dist/{CronBuilder-Da0C0edR.cjs → CronBuilder-BXTG10u5.cjs} +47 -31
  17. package/dist/CronBuilder-BXTG10u5.cjs.map +1 -0
  18. package/dist/CronBuilder-B_24LZpn.d.cts +47 -0
  19. package/dist/CronBuilder-B_24LZpn.d.cts.map +1 -0
  20. package/dist/{CronBuilder-CYKT5RiO.mjs → CronBuilder-D3sF9tS_.mjs} +37 -21
  21. package/dist/CronBuilder-D3sF9tS_.mjs.map +1 -0
  22. package/dist/{Endpoint-BjWKinFA.d.mts → Endpoint-CeFkSwh5.d.mts} +129 -99
  23. package/dist/Endpoint-CeFkSwh5.d.mts.map +1 -0
  24. package/dist/{Endpoint-dav89W6-.d.cts → Endpoint-DgrpG15P.d.cts} +127 -97
  25. package/dist/Endpoint-DgrpG15P.d.cts.map +1 -0
  26. package/dist/{Endpoint-DCQPMdUX.mjs → Endpoint-gPXhHKhJ.mjs} +208 -100
  27. package/dist/Endpoint-gPXhHKhJ.mjs.map +1 -0
  28. package/dist/{Endpoint-DcWXE-SZ.cjs → Endpoint-yhR2T2Wt.cjs} +248 -122
  29. package/dist/Endpoint-yhR2T2Wt.cjs.map +1 -0
  30. package/dist/{EndpointFactory-CdWB7wPw.cjs → EndpointFactory-CSrAyazj.cjs} +361 -112
  31. package/dist/EndpointFactory-CSrAyazj.cjs.map +1 -0
  32. package/dist/{index-lAO9egTb.d.mts → EndpointFactory-Cc863XJS.d.cts} +190 -136
  33. package/dist/EndpointFactory-Cc863XJS.d.cts.map +1 -0
  34. package/dist/{index-Bd5FqCoe.d.cts → EndpointFactory-Dbw9ugkX.d.mts} +189 -135
  35. package/dist/EndpointFactory-Dbw9ugkX.d.mts.map +1 -0
  36. package/dist/{EndpointFactory-CjV8F_lJ.mjs → EndpointFactory-c2ZugGig.mjs} +283 -76
  37. package/dist/EndpointFactory-c2ZugGig.mjs.map +1 -0
  38. package/dist/Function-B0uZhZnU.d.cts +76 -0
  39. package/dist/Function-B0uZhZnU.d.cts.map +1 -0
  40. package/dist/Function-B_9R7Zy1.d.mts +76 -0
  41. package/dist/Function-B_9R7Zy1.d.mts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-DtL9j19R.cjs → HonoEndpointAdaptor-CN1jjUBJ.cjs} +115 -71
  43. package/dist/HonoEndpointAdaptor-CN1jjUBJ.cjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-P1ahhZHu.mjs → HonoEndpointAdaptor-euH1oSdY.mjs} +105 -64
  45. package/dist/HonoEndpointAdaptor-euH1oSdY.mjs.map +1 -0
  46. package/dist/{Queue-D7ZuwBhy.d.cts → Queue-B-dDXyjF.d.mts} +48 -48
  47. package/dist/Queue-B-dDXyjF.d.mts.map +1 -0
  48. package/dist/Queue-BhuofM3k.cjs +109 -0
  49. package/dist/Queue-BhuofM3k.cjs.map +1 -0
  50. package/dist/{Queue-gVGfi2Yk.d.mts → Queue-JbIjVtTf.d.cts} +49 -49
  51. package/dist/Queue-JbIjVtTf.d.cts.map +1 -0
  52. package/dist/Queue-cmhqEBOB.mjs +104 -0
  53. package/dist/Queue-cmhqEBOB.mjs.map +1 -0
  54. package/dist/QueueBuilder-48W-q8In.d.mts +75 -0
  55. package/dist/QueueBuilder-48W-q8In.d.mts.map +1 -0
  56. package/dist/QueueBuilder-DXu1qxT1.mjs +118 -0
  57. package/dist/QueueBuilder-DXu1qxT1.mjs.map +1 -0
  58. package/dist/QueueBuilder-DdU2klPu.cjs +135 -0
  59. package/dist/QueueBuilder-DdU2klPu.cjs.map +1 -0
  60. package/dist/QueueBuilder-MfpkJ3R9.d.cts +75 -0
  61. package/dist/QueueBuilder-MfpkJ3R9.d.cts.map +1 -0
  62. package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-CEt7kHkc.d.cts} +29 -20
  63. package/dist/Subscriber-CEt7kHkc.d.cts.map +1 -0
  64. package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-dsxc5LKa.d.mts} +29 -20
  65. package/dist/Subscriber-dsxc5LKa.d.mts.map +1 -0
  66. package/dist/SubscriberBuilder-BRa_nrmH.d.cts +67 -0
  67. package/dist/SubscriberBuilder-BRa_nrmH.d.cts.map +1 -0
  68. package/dist/SubscriberBuilder-D9bkrYzH.d.mts +67 -0
  69. package/dist/SubscriberBuilder-D9bkrYzH.d.mts.map +1 -0
  70. package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-DRXfxWn_.mjs} +50 -24
  71. package/dist/SubscriberBuilder-DRXfxWn_.mjs.map +1 -0
  72. package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-M2EAgQhC.cjs} +61 -36
  73. package/dist/SubscriberBuilder-M2EAgQhC.cjs.map +1 -0
  74. package/dist/Topic-D2R0r24C.mjs +99 -0
  75. package/dist/Topic-D2R0r24C.mjs.map +1 -0
  76. package/dist/Topic-DwS3QO0m.cjs +104 -0
  77. package/dist/Topic-DwS3QO0m.cjs.map +1 -0
  78. package/dist/adaptors/aws.cjs +200 -246
  79. package/dist/adaptors/aws.cjs.map +1 -1
  80. package/dist/adaptors/aws.d.cts +58 -62
  81. package/dist/adaptors/aws.d.cts.map +1 -1
  82. package/dist/adaptors/aws.d.mts +59 -63
  83. package/dist/adaptors/aws.d.mts.map +1 -1
  84. package/dist/adaptors/aws.mjs +171 -219
  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 +9 -18
  90. package/dist/adaptors/hono.d.mts.map +1 -1
  91. package/dist/adaptors/hono.mjs +2 -10
  92. package/dist/adaptors/testing.cjs +765 -99
  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 +726 -78
  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-D_0788uW.d.mts +268 -0
  103. package/dist/auth-D_0788uW.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-5QZzh5Er.d.mts} +3 -6
  111. package/dist/cache-5QZzh5Er.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/cipher-DSDxPRIp.d.cts +106 -0
  125. package/dist/cipher-DSDxPRIp.d.cts.map +1 -0
  126. package/dist/cipher-DSDxPRIp.d.mts +106 -0
  127. package/dist/cipher-DSDxPRIp.d.mts.map +1 -0
  128. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  129. package/dist/clone-EKNovYHu.mjs.map +1 -0
  130. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  131. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  132. package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-B1AfqRl4.d.cts} +42 -11
  133. package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
  134. package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-ZvYQbivO.d.mts} +42 -11
  135. package/dist/construct-interface-ZvYQbivO.d.mts.map +1 -0
  136. package/dist/construct-interface.cjs +113 -7
  137. package/dist/construct-interface.cjs.map +1 -0
  138. package/dist/construct-interface.d.cts +2 -2
  139. package/dist/construct-interface.d.mts +2 -2
  140. package/dist/construct-interface.mjs +106 -2
  141. package/dist/construct-interface.mjs.map +1 -0
  142. package/dist/credential-DYymbp_7.cjs +257 -0
  143. package/dist/credential-DYymbp_7.cjs.map +1 -0
  144. package/dist/credential-DfSAOOdY.mjs +222 -0
  145. package/dist/credential-DfSAOOdY.mjs.map +1 -0
  146. package/dist/credential.cjs +8 -96
  147. package/dist/credential.d.cts +2 -61
  148. package/dist/credential.d.mts +2 -61
  149. package/dist/credential.mjs +2 -94
  150. package/dist/crons/index.cjs +129 -7
  151. package/dist/crons/index.cjs.map +1 -1
  152. package/dist/crons/index.d.cts +45 -11
  153. package/dist/crons/index.d.cts.map +1 -1
  154. package/dist/crons/index.d.mts +45 -11
  155. package/dist/crons/index.d.mts.map +1 -1
  156. package/dist/crons/index.mjs +127 -8
  157. package/dist/crons/index.mjs.map +1 -1
  158. package/dist/database/kysely.cjs +4 -181
  159. package/dist/database/kysely.d.cts +2 -152
  160. package/dist/database/kysely.d.mts +2 -152
  161. package/dist/database/kysely.mjs +2 -180
  162. package/dist/email.cjs +25 -12
  163. package/dist/email.cjs.map +1 -1
  164. package/dist/email.d.cts +3 -7
  165. package/dist/email.d.cts.map +1 -1
  166. package/dist/email.d.mts +4 -8
  167. package/dist/email.d.mts.map +1 -1
  168. package/dist/email.mjs +16 -3
  169. package/dist/email.mjs.map +1 -1
  170. package/dist/encryption/kms.cjs +95 -0
  171. package/dist/encryption/kms.cjs.map +1 -0
  172. package/dist/encryption/kms.d.cts +7 -0
  173. package/dist/encryption/kms.d.cts.map +1 -0
  174. package/dist/encryption/kms.d.mts +7 -0
  175. package/dist/encryption/kms.d.mts.map +1 -0
  176. package/dist/encryption/kms.mjs +93 -0
  177. package/dist/encryption/kms.mjs.map +1 -0
  178. package/dist/encryption.cjs +116 -0
  179. package/dist/encryption.cjs.map +1 -0
  180. package/dist/encryption.d.cts +37 -0
  181. package/dist/encryption.d.cts.map +1 -0
  182. package/dist/encryption.d.mts +37 -0
  183. package/dist/encryption.d.mts.map +1 -0
  184. package/dist/encryption.mjs +101 -0
  185. package/dist/encryption.mjs.map +1 -0
  186. package/dist/endpoints/index.cjs +27 -16
  187. package/dist/endpoints/index.d.cts +105 -7
  188. package/dist/endpoints/index.d.cts.map +1 -0
  189. package/dist/endpoints/index.d.mts +105 -7
  190. package/dist/endpoints/index.d.mts.map +1 -0
  191. package/dist/endpoints/index.mjs +6 -10
  192. package/dist/expire-C586zznE.d.cts +38 -0
  193. package/dist/expire-C586zznE.d.cts.map +1 -0
  194. package/dist/expire-C586zznE.d.mts +38 -0
  195. package/dist/expire-C586zznE.d.mts.map +1 -0
  196. package/dist/expire-CieftS01.cjs +67 -0
  197. package/dist/expire-CieftS01.cjs.map +1 -0
  198. package/dist/expire-CpzUAfr9.mjs +50 -0
  199. package/dist/expire-CpzUAfr9.mjs.map +1 -0
  200. package/dist/external-api.cjs +106 -0
  201. package/dist/external-api.cjs.map +1 -0
  202. package/dist/external-api.d.cts +2 -0
  203. package/dist/external-api.d.mts +2 -0
  204. package/dist/external-api.mjs +103 -0
  205. package/dist/external-api.mjs.map +1 -0
  206. package/dist/fake-B7rvi4Qp.d.cts +201 -0
  207. package/dist/fake-B7rvi4Qp.d.cts.map +1 -0
  208. package/dist/fake-JXbkdao8.d.mts +201 -0
  209. package/dist/fake-JXbkdao8.d.mts.map +1 -0
  210. package/dist/file-server.cjs +66 -11
  211. package/dist/file-server.cjs.map +1 -1
  212. package/dist/file-server.d.cts +25 -10
  213. package/dist/file-server.d.cts.map +1 -1
  214. package/dist/file-server.d.mts +25 -10
  215. package/dist/file-server.d.mts.map +1 -1
  216. package/dist/file-server.mjs +58 -4
  217. package/dist/file-server.mjs.map +1 -1
  218. package/dist/functions/index.cjs +3 -6
  219. package/dist/functions/index.d.cts +3 -4
  220. package/dist/functions/index.d.mts +3 -4
  221. package/dist/functions/index.mjs +2 -6
  222. package/dist/{functions-14lpEFL4.mjs → functions-CTI-hDem.mjs} +376 -238
  223. package/dist/{functions-14lpEFL4.mjs.map → functions-CTI-hDem.mjs.map} +1 -1
  224. package/dist/{functions-i_la-N5r.cjs → functions-D7O5SGVc.cjs} +414 -264
  225. package/dist/functions-D7O5SGVc.cjs.map +1 -0
  226. package/dist/index-Cd2w-DRL.d.cts +115 -0
  227. package/dist/index-Cd2w-DRL.d.cts.map +1 -0
  228. package/dist/index-DdRjYhiJ.d.cts +119 -0
  229. package/dist/index-DdRjYhiJ.d.cts.map +1 -0
  230. package/dist/index-DdRjYhiJ.d.mts +119 -0
  231. package/dist/index-DdRjYhiJ.d.mts.map +1 -0
  232. package/dist/index-aBIcAiH5.d.mts +115 -0
  233. package/dist/index-aBIcAiH5.d.mts.map +1 -0
  234. package/dist/index.cjs +6 -3
  235. package/dist/index.d.cts +27 -4
  236. package/dist/index.d.cts.map +1 -0
  237. package/dist/index.d.mts +27 -4
  238. package/dist/index.d.mts.map +1 -0
  239. package/dist/index.mjs +3 -3
  240. package/dist/kysely-BHYV-WC-.d.cts +216 -0
  241. package/dist/kysely-BHYV-WC-.d.cts.map +1 -0
  242. package/dist/kysely-CAW3QSqp.d.mts +216 -0
  243. package/dist/kysely-CAW3QSqp.d.mts.map +1 -0
  244. package/dist/kysely-Cs4uPO8k.mjs +371 -0
  245. package/dist/kysely-Cs4uPO8k.mjs.map +1 -0
  246. package/dist/kysely-CukArHJ0.cjs +384 -0
  247. package/dist/kysely-CukArHJ0.cjs.map +1 -0
  248. package/dist/{telemetry-C3L0iS28.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +3 -6
  249. package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
  250. package/dist/{telemetry-D7bVFLGi.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +3 -6
  251. package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
  252. package/dist/mobile-app.cjs +74 -0
  253. package/dist/mobile-app.cjs.map +1 -0
  254. package/dist/mobile-app.d.cts +73 -0
  255. package/dist/mobile-app.d.cts.map +1 -0
  256. package/dist/mobile-app.d.mts +73 -0
  257. package/dist/mobile-app.d.mts.map +1 -0
  258. package/dist/mobile-app.mjs +73 -0
  259. package/dist/mobile-app.mjs.map +1 -0
  260. package/dist/object-storage.cjs +26 -11
  261. package/dist/object-storage.cjs.map +1 -1
  262. package/dist/object-storage.d.cts +12 -7
  263. package/dist/object-storage.d.cts.map +1 -1
  264. package/dist/object-storage.d.mts +12 -7
  265. package/dist/object-storage.d.mts.map +1 -1
  266. package/dist/object-storage.mjs +18 -5
  267. package/dist/object-storage.mjs.map +1 -1
  268. package/dist/queue/index.cjs +6 -189
  269. package/dist/queue/index.d.cts +3 -60
  270. package/dist/queue/index.d.mts +3 -60
  271. package/dist/queue/index.mjs +3 -186
  272. package/dist/random-password.cjs +86 -0
  273. package/dist/random-password.cjs.map +1 -0
  274. package/dist/random-password.d.cts +30 -0
  275. package/dist/random-password.d.cts.map +1 -0
  276. package/dist/random-password.d.mts +30 -0
  277. package/dist/random-password.d.mts.map +1 -0
  278. package/dist/random-password.mjs +84 -0
  279. package/dist/random-password.mjs.map +1 -0
  280. package/dist/{lazyAccessors-BoJN3SMd.mjs → readRequestBody-BTIl3k-D.mjs} +117 -60
  281. package/dist/readRequestBody-BTIl3k-D.mjs.map +1 -0
  282. package/dist/readRequestBody-Dej_L3c4.cjs +342 -0
  283. package/dist/readRequestBody-Dej_L3c4.cjs.map +1 -0
  284. package/dist/requestLogger-BZcXwdBs.cjs +207 -0
  285. package/dist/requestLogger-BZcXwdBs.cjs.map +1 -0
  286. package/dist/requestLogger-pA4gi3E1.mjs +178 -0
  287. package/dist/requestLogger-pA4gi3E1.mjs.map +1 -0
  288. package/dist/rest-api.cjs +90 -59
  289. package/dist/rest-api.cjs.map +1 -1
  290. package/dist/rest-api.d.cts +70 -42
  291. package/dist/rest-api.d.cts.map +1 -1
  292. package/dist/rest-api.d.mts +70 -42
  293. package/dist/rest-api.d.mts.map +1 -1
  294. package/dist/rest-api.mjs +82 -51
  295. package/dist/rest-api.mjs.map +1 -1
  296. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  297. package/dist/runSubscriber-BHvJ8POr.mjs +109 -0
  298. package/dist/runSubscriber-BHvJ8POr.mjs.map +1 -0
  299. package/dist/runSubscriber-D8nLXIv1.cjs +126 -0
  300. package/dist/runSubscriber-D8nLXIv1.cjs.map +1 -0
  301. package/dist/shutdown-BMJmAhSt.cjs +38 -0
  302. package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
  303. package/dist/shutdown-C7xa8x9S.mjs +27 -0
  304. package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
  305. package/dist/site.cjs +33 -7
  306. package/dist/site.cjs.map +1 -1
  307. package/dist/site.d.cts +17 -7
  308. package/dist/site.d.cts.map +1 -1
  309. package/dist/site.d.mts +17 -7
  310. package/dist/site.d.mts.map +1 -1
  311. package/dist/site.mjs +29 -3
  312. package/dist/site.mjs.map +1 -1
  313. package/dist/stages-BSCF19o2.d.cts +56 -0
  314. package/dist/stages-BSCF19o2.d.cts.map +1 -0
  315. package/dist/stages-BSCF19o2.d.mts +56 -0
  316. package/dist/stages-BSCF19o2.d.mts.map +1 -0
  317. package/dist/subscribers/index.cjs +118 -6
  318. package/dist/subscribers/index.cjs.map +1 -0
  319. package/dist/subscribers/index.d.cts +51 -6
  320. package/dist/subscribers/index.d.cts.map +1 -0
  321. package/dist/subscribers/index.d.mts +51 -6
  322. package/dist/subscribers/index.d.mts.map +1 -0
  323. package/dist/subscribers/index.mjs +115 -5
  324. package/dist/subscribers/index.mjs.map +1 -0
  325. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  326. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  327. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  328. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  329. package/dist/telemetry-B48RLjyk.d.cts +40 -0
  330. package/dist/telemetry-B48RLjyk.d.cts.map +1 -0
  331. package/dist/telemetry-BEoBn6GO.d.mts +40 -0
  332. package/dist/telemetry-BEoBn6GO.d.mts.map +1 -0
  333. package/dist/telemetry.cjs +56 -0
  334. package/dist/telemetry.cjs.map +1 -0
  335. package/dist/telemetry.d.cts +2 -0
  336. package/dist/telemetry.d.mts +2 -0
  337. package/dist/telemetry.mjs +55 -0
  338. package/dist/telemetry.mjs.map +1 -0
  339. package/dist/topic/index.cjs +3 -137
  340. package/dist/topic/index.d.cts +2 -4
  341. package/dist/topic/index.d.mts +2 -4
  342. package/dist/topic/index.mjs +2 -134
  343. package/dist/tracing-Bbj1uoFJ.mjs +127 -0
  344. package/dist/tracing-Bbj1uoFJ.mjs.map +1 -0
  345. package/dist/tracing-C0ooU0V2.cjs +150 -0
  346. package/dist/tracing-C0ooU0V2.cjs.map +1 -0
  347. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  348. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  349. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  350. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  351. package/dist/types.d.cts +1 -1
  352. package/dist/types.d.mts +1 -1
  353. package/dist/types.mjs +1 -0
  354. package/dist/worker.cjs +59 -34
  355. package/dist/worker.cjs.map +1 -1
  356. package/dist/worker.d.cts +70 -45
  357. package/dist/worker.d.cts.map +1 -1
  358. package/dist/worker.d.mts +71 -45
  359. package/dist/worker.d.mts.map +1 -1
  360. package/dist/worker.mjs +54 -29
  361. package/dist/worker.mjs.map +1 -1
  362. package/package.json +115 -41
  363. package/dist/Construct-BD5neF7w.mjs.map +0 -1
  364. package/dist/Construct-C0ijr2qp.d.cts +0 -117
  365. package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
  366. package/dist/Construct-Ct8nalEi.d.mts +0 -117
  367. package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
  368. package/dist/Construct-CyS3RpTL.cjs.map +0 -1
  369. package/dist/Cron-DmQ8vQ4b.d.cts.map +0 -1
  370. package/dist/Cron-dh4rUgib.d.mts.map +0 -1
  371. package/dist/CronBuilder-BquXDbDI.d.cts +0 -44
  372. package/dist/CronBuilder-BquXDbDI.d.cts.map +0 -1
  373. package/dist/CronBuilder-CGgY2080.d.mts +0 -44
  374. package/dist/CronBuilder-CGgY2080.d.mts.map +0 -1
  375. package/dist/CronBuilder-CYKT5RiO.mjs.map +0 -1
  376. package/dist/CronBuilder-Da0C0edR.cjs.map +0 -1
  377. package/dist/Endpoint-BjWKinFA.d.mts.map +0 -1
  378. package/dist/Endpoint-DCQPMdUX.mjs.map +0 -1
  379. package/dist/Endpoint-DcWXE-SZ.cjs.map +0 -1
  380. package/dist/Endpoint-dav89W6-.d.cts.map +0 -1
  381. package/dist/EndpointFactory-CdWB7wPw.cjs.map +0 -1
  382. package/dist/EndpointFactory-CjV8F_lJ.mjs.map +0 -1
  383. package/dist/HonoEndpointAdaptor-DtL9j19R.cjs.map +0 -1
  384. package/dist/HonoEndpointAdaptor-P1ahhZHu.mjs.map +0 -1
  385. package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
  386. package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
  387. package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
  388. package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
  389. package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
  390. package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
  391. package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
  392. package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
  393. package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
  394. package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
  395. package/dist/Topic-19QeHBIR.d.cts +0 -91
  396. package/dist/Topic-19QeHBIR.d.cts.map +0 -1
  397. package/dist/Topic-DuFeqkBh.d.mts +0 -91
  398. package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
  399. package/dist/auth.d.cts.map +0 -1
  400. package/dist/auth.d.mts.map +0 -1
  401. package/dist/cache-0ANvRQnD.mjs +0 -51
  402. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  403. package/dist/cache-3WSvAulx.cjs +0 -57
  404. package/dist/cache-3WSvAulx.cjs.map +0 -1
  405. package/dist/cache-BrRz3fEB.d.mts.map +0 -1
  406. package/dist/cache-BtZY_tHe.d.cts.map +0 -1
  407. package/dist/clone-DblgEZZa.mjs.map +0 -1
  408. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  409. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  410. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  411. package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
  412. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  413. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  414. package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
  415. package/dist/credential.cjs.map +0 -1
  416. package/dist/credential.d.cts.map +0 -1
  417. package/dist/credential.d.mts.map +0 -1
  418. package/dist/credential.mjs.map +0 -1
  419. package/dist/database/kysely.cjs.map +0 -1
  420. package/dist/database/kysely.d.cts.map +0 -1
  421. package/dist/database/kysely.d.mts.map +0 -1
  422. package/dist/database/kysely.mjs.map +0 -1
  423. package/dist/functions-i_la-N5r.cjs.map +0 -1
  424. package/dist/index-Bd5FqCoe.d.cts.map +0 -1
  425. package/dist/index-BknhM6Ux.d.mts +0 -31
  426. package/dist/index-BknhM6Ux.d.mts.map +0 -1
  427. package/dist/index-CBSfrowv.d.cts +0 -31
  428. package/dist/index-CBSfrowv.d.cts.map +0 -1
  429. package/dist/index-D24Xm79M.d.cts +0 -171
  430. package/dist/index-D24Xm79M.d.cts.map +0 -1
  431. package/dist/index-_ajboYxK.d.mts +0 -171
  432. package/dist/index-_ajboYxK.d.mts.map +0 -1
  433. package/dist/index-lAO9egTb.d.mts.map +0 -1
  434. package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
  435. package/dist/lazyAccessors-e3j2oE2m.cjs +0 -274
  436. package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
  437. package/dist/processAudits-CGqttuXm.cjs +0 -92
  438. package/dist/processAudits-CGqttuXm.cjs.map +0 -1
  439. package/dist/processAudits-Dmts9H_b.mjs +0 -80
  440. package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
  441. package/dist/queue/index.cjs.map +0 -1
  442. package/dist/queue/index.d.cts.map +0 -1
  443. package/dist/queue/index.d.mts.map +0 -1
  444. package/dist/queue/index.mjs.map +0 -1
  445. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  446. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  447. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  448. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  449. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  450. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  451. package/dist/topic/index.cjs.map +0 -1
  452. package/dist/topic/index.mjs.map +0 -1
  453. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  454. package/dist/types-aKksMEWL.d.mts.map +0 -1
@@ -1,7 +1,105 @@
1
- import "../Construct-C0ijr2qp.cjs";
2
- import "../index-D24Xm79M.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-dav89W6-.cjs";
6
- import { EndpointBuilder, EndpointFactory, createApiGatewayCookies, createApiGatewayHeaders, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, defaultEnvParser, envParserFor, publishConstructEvents } from "../index-Bd5FqCoe.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 { s as publishConstructEvents } from "../Construct-CFW0zjdD.cjs";
2
+ import { A as SecurityScheme, C as ActorExtractor, D as BuiltInSecuritySchemeId, E as BUILT_IN_SECURITY_SCHEMES, M as getSecurityScheme, N as isBuiltInSecurityScheme, O as OAuthFlow, S as RlsContextExtractor, T as Authorizer, _ as SessionAuth, a as EndpointContext, b as RlsConfig, c as EndpointSchemas, d as HeaderFn, f as RedirectStatus, g as NoAuthenticator, h as SuccessStatus, i as Endpoint, j as createAuthorizer, k as OAuthFlows, l as EndpointStatus, n as ConvertRouteParams, o as EndpointHandler, p as ResponseBuilder, r as CookieFn, s as EndpointOutput, u as EndpointSurface, v as RLS_BYPASS, w as MappedAudit, x as RlsContext, y as RlsBypass } from "../Endpoint-DgrpG15P.cjs";
3
+ import { a as UPLOAD_POST_SCHEMA, c as UploadContentTypeUnresolved, d as UploadOptions, f as UploadPost, i as UploadHandler, l as UploadExpiryInvalid, n as EndpointBuilder, o as UploadAcceptInvalid, r as UploadEndpointBuilder, s as UploadContentTypeRefused, t as EndpointFactory, u as UploadMaxSizeInvalid } from "../EndpointFactory-Cc863XJS.cjs";
4
+ import { EnvironmentParser } from "@geekmidas/envkit";
5
+ import { Context } from "hono";
6
+ import { HttpError } from "@geekmidas/errors";
7
+ //#region src/endpoints/lazyAccessors.d.ts
8
+ /**
9
+ * Create a lazy header accessor for Hono.
10
+ * Uses `c.req.header(name)` for single lookups (native, case-insensitive).
11
+ * Only calls `c.req.header()` to get all headers when needed.
12
+ */
13
+ export declare function createHonoHeaders(c: Context): HeaderFn;
14
+ /**
15
+ * Create a lazy cookie accessor for Hono.
16
+ * Uses `getCookie(c, name)` for single lookups (native).
17
+ * Only parses the cookie header when all cookies are requested.
18
+ */
19
+ export declare function createHonoCookies(c: Context): CookieFn;
20
+ /**
21
+ * Create a lazy header accessor for API Gateway events.
22
+ * Handles case-insensitive lookups.
23
+ */
24
+ export declare function createApiGatewayHeaders(headers: Record<string, string | undefined> | null | undefined): HeaderFn;
25
+ /**
26
+ * Create a lazy cookie accessor for API Gateway events.
27
+ * Decodes URL-encoded values to match browser behavior.
28
+ */
29
+ export declare function createApiGatewayCookies(cookies: string[] | undefined, cookieHeader: string | undefined): CookieFn;
30
+ /**
31
+ * Create a no-op header accessor (for minimal endpoints that don't use headers).
32
+ */
33
+ export declare function createNoopHeaders(): HeaderFn;
34
+ /**
35
+ * Create a no-op cookie accessor (for minimal endpoints that don't use cookies).
36
+ */
37
+ export declare function createNoopCookies(): CookieFn;
38
+ //#endregion
39
+ //#region src/endpoints/readRequestBody.d.ts
40
+ /**
41
+ * The media types an endpoint's `.body()` schema can be handed — as written
42
+ * in the 415 a request in any other type is answered with.
43
+ */
44
+ export declare const SUPPORTED_BODY_TYPES: readonly ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data', 'text/*'];
45
+ /**
46
+ * A request whose body is in a media type no endpoint reads — XML, a bare
47
+ * octet stream. Answered with a 415, before the body schema runs.
48
+ */
49
+ export declare class UnsupportedRequestContentType extends HttpError {
50
+ readonly contentType: string;
51
+ constructor(contentType: string);
52
+ }
53
+ /**
54
+ * A body that says it is JSON and is not. Answered with a 400 — the request
55
+ * is broken, not merely invalid against the schema.
56
+ */
57
+ export declare class MalformedRequestBody extends HttpError {
58
+ readonly contentType: string;
59
+ constructor(contentType: string, cause?: Error);
60
+ }
61
+ /**
62
+ * What a body is read from: a `Request`, or Hono's request — which caches
63
+ * what it read, so a later reader is not handed a spent stream.
64
+ */
65
+ interface RequestBodySource {
66
+ json(): Promise<unknown>;
67
+ text(): Promise<string>;
68
+ formData(): Promise<FormData>;
69
+ }
70
+ interface ReadRequestBodyOptions {
71
+ /**
72
+ * A body with no Content-Type: read as JSON (`'json'`, what API Gateway
73
+ * has always done), or not read at all and handed to the schema as `{}`
74
+ * (`'empty'`, what a Hono server has always done).
75
+ */
76
+ untyped: 'json' | 'empty';
77
+ }
78
+ /**
79
+ * A request body, read by its Content-Type into what an endpoint's `.body()`
80
+ * schema validates — the one place every adaptor reads a body:
81
+ *
82
+ * - `application/json` (and `application/*+json`) — the parsed JSON.
83
+ * - `application/x-www-form-urlencoded` and `multipart/form-data` — a plain
84
+ * object of fields, as an HTML form posts them. A repeated field, or one
85
+ * named `field[]`, is an array; a file part is a `File`.
86
+ * - `text/*` — the text.
87
+ *
88
+ * Anything else is an {@link UnsupportedRequestContentType}.
89
+ */
90
+ export declare function readRequestBody(source: RequestBodySource, contentType: string | null | undefined, options: ReadRequestBodyOptions): Promise<unknown>;
91
+ //#endregion
92
+ //#region src/endpoints/surfaceEnv.d.ts
93
+ /**
94
+ * The default parser, built once.
95
+ *
96
+ * Once because `Credentials` resolves through `globalThis` and decryption is
97
+ * not free, and because two parsers over the same environment are two caches of
98
+ * the same answer.
99
+ */
100
+ export declare function defaultEnvParser(): EnvironmentParser<{}>;
101
+ /** The parser for an endpoint, from its surface or the default. */
102
+ export declare function envParserFor(surface: EndpointSurface | undefined): EnvironmentParser<{}>;
103
+ //#endregion
104
+ 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 EndpointStatus, type MappedAudit, NoAuthenticator, type OAuthFlow, type OAuthFlows, RLS_BYPASS, RedirectStatus, type RequestBodySource, ResponseBuilder, type RlsBypass, type RlsConfig, type RlsContext, type RlsContextExtractor, type SecurityScheme, type SessionAuth, SuccessStatus, UPLOAD_POST_SCHEMA, UploadAcceptInvalid, UploadContentTypeRefused, UploadContentTypeUnresolved, UploadEndpointBuilder, UploadExpiryInvalid, type UploadHandler, UploadMaxSizeInvalid, type UploadOptions, type UploadPost, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme, publishConstructEvents };
105
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/endpoints/lazyAccessors.ts","../../src/endpoints/readRequestBody.ts","../../src/endpoints/surfaceEnv.ts"],"mappings":";;;;;;;;;;;;wBAgBgB,kBAAkB,GAAG,UAAU;;;;;;wBAqB/B,kBAAkB,GAAG,UAAU;;;;;wBAgC/B,wBACf,SAAS,wDACP;;;;;wBAoCa,wBACf,+BACA,mCACE;;;;wBAmHa,qBAAqB;;;;wBAUrB,qBAAqB;;;;;;;qBCrOxB;;;;;qBAWA,sCAAsC;WAC7B;EAArB,YAAqB;;;;;;qBAiBT,6BAA6B;WAE/B;EADV,YACU,qBACT,QAAQ;;;;;;UAeO;EAChB,QAAQ;EACR,QAAQ;EACR,YAAY,QAAQ;;UAGJ;;;;;;EAMhB;;;;;;;;;;;;;;wBAeqB,gBACrB,QAAQ,mBACR,wCACA,SAAS,yBACP;;;;;;;;;;wBCnDa,oBAAoB;;wBASpB,aACf,SAAS,8BACP"}
@@ -1,7 +1,105 @@
1
- import "../Construct-Ct8nalEi.mjs";
2
- import "../index-_ajboYxK.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-BjWKinFA.mjs";
6
- import { EndpointBuilder, EndpointFactory, createApiGatewayCookies, createApiGatewayHeaders, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, defaultEnvParser, envParserFor, publishConstructEvents } from "../index-lAO9egTb.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 { s as publishConstructEvents } from "../Construct-B7AXn0xH.mjs";
2
+ import { A as SecurityScheme, C as ActorExtractor, D as BuiltInSecuritySchemeId, E as BUILT_IN_SECURITY_SCHEMES, M as getSecurityScheme, N as isBuiltInSecurityScheme, O as OAuthFlow, S as RlsContextExtractor, T as Authorizer, _ as SessionAuth, a as EndpointContext, b as RlsConfig, c as EndpointSchemas, d as HeaderFn, f as RedirectStatus, g as NoAuthenticator, h as SuccessStatus, i as Endpoint, j as createAuthorizer, k as OAuthFlows, l as EndpointStatus, n as ConvertRouteParams, o as EndpointHandler, p as ResponseBuilder, r as CookieFn, s as EndpointOutput, u as EndpointSurface, v as RLS_BYPASS, w as MappedAudit, x as RlsContext, y as RlsBypass } from "../Endpoint-CeFkSwh5.mjs";
3
+ import { a as UPLOAD_POST_SCHEMA, c as UploadContentTypeUnresolved, d as UploadOptions, f as UploadPost, i as UploadHandler, l as UploadExpiryInvalid, n as EndpointBuilder, o as UploadAcceptInvalid, r as UploadEndpointBuilder, s as UploadContentTypeRefused, t as EndpointFactory, u as UploadMaxSizeInvalid } from "../EndpointFactory-Dbw9ugkX.mjs";
4
+ import { HttpError } from "@geekmidas/errors";
5
+ import { EnvironmentParser } from "@geekmidas/envkit";
6
+ import { Context } from "hono";
7
+ //#region src/endpoints/lazyAccessors.d.ts
8
+ /**
9
+ * Create a lazy header accessor for Hono.
10
+ * Uses `c.req.header(name)` for single lookups (native, case-insensitive).
11
+ * Only calls `c.req.header()` to get all headers when needed.
12
+ */
13
+ export declare function createHonoHeaders(c: Context): HeaderFn;
14
+ /**
15
+ * Create a lazy cookie accessor for Hono.
16
+ * Uses `getCookie(c, name)` for single lookups (native).
17
+ * Only parses the cookie header when all cookies are requested.
18
+ */
19
+ export declare function createHonoCookies(c: Context): CookieFn;
20
+ /**
21
+ * Create a lazy header accessor for API Gateway events.
22
+ * Handles case-insensitive lookups.
23
+ */
24
+ export declare function createApiGatewayHeaders(headers: Record<string, string | undefined> | null | undefined): HeaderFn;
25
+ /**
26
+ * Create a lazy cookie accessor for API Gateway events.
27
+ * Decodes URL-encoded values to match browser behavior.
28
+ */
29
+ export declare function createApiGatewayCookies(cookies: string[] | undefined, cookieHeader: string | undefined): CookieFn;
30
+ /**
31
+ * Create a no-op header accessor (for minimal endpoints that don't use headers).
32
+ */
33
+ export declare function createNoopHeaders(): HeaderFn;
34
+ /**
35
+ * Create a no-op cookie accessor (for minimal endpoints that don't use cookies).
36
+ */
37
+ export declare function createNoopCookies(): CookieFn;
38
+ //#endregion
39
+ //#region src/endpoints/readRequestBody.d.ts
40
+ /**
41
+ * The media types an endpoint's `.body()` schema can be handed — as written
42
+ * in the 415 a request in any other type is answered with.
43
+ */
44
+ export declare const SUPPORTED_BODY_TYPES: readonly ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data', 'text/*'];
45
+ /**
46
+ * A request whose body is in a media type no endpoint reads — XML, a bare
47
+ * octet stream. Answered with a 415, before the body schema runs.
48
+ */
49
+ export declare class UnsupportedRequestContentType extends HttpError {
50
+ readonly contentType: string;
51
+ constructor(contentType: string);
52
+ }
53
+ /**
54
+ * A body that says it is JSON and is not. Answered with a 400 — the request
55
+ * is broken, not merely invalid against the schema.
56
+ */
57
+ export declare class MalformedRequestBody extends HttpError {
58
+ readonly contentType: string;
59
+ constructor(contentType: string, cause?: Error);
60
+ }
61
+ /**
62
+ * What a body is read from: a `Request`, or Hono's request — which caches
63
+ * what it read, so a later reader is not handed a spent stream.
64
+ */
65
+ interface RequestBodySource {
66
+ json(): Promise<unknown>;
67
+ text(): Promise<string>;
68
+ formData(): Promise<FormData>;
69
+ }
70
+ interface ReadRequestBodyOptions {
71
+ /**
72
+ * A body with no Content-Type: read as JSON (`'json'`, what API Gateway
73
+ * has always done), or not read at all and handed to the schema as `{}`
74
+ * (`'empty'`, what a Hono server has always done).
75
+ */
76
+ untyped: 'json' | 'empty';
77
+ }
78
+ /**
79
+ * A request body, read by its Content-Type into what an endpoint's `.body()`
80
+ * schema validates — the one place every adaptor reads a body:
81
+ *
82
+ * - `application/json` (and `application/*+json`) — the parsed JSON.
83
+ * - `application/x-www-form-urlencoded` and `multipart/form-data` — a plain
84
+ * object of fields, as an HTML form posts them. A repeated field, or one
85
+ * named `field[]`, is an array; a file part is a `File`.
86
+ * - `text/*` — the text.
87
+ *
88
+ * Anything else is an {@link UnsupportedRequestContentType}.
89
+ */
90
+ export declare function readRequestBody(source: RequestBodySource, contentType: string | null | undefined, options: ReadRequestBodyOptions): Promise<unknown>;
91
+ //#endregion
92
+ //#region src/endpoints/surfaceEnv.d.ts
93
+ /**
94
+ * The default parser, built once.
95
+ *
96
+ * Once because `Credentials` resolves through `globalThis` and decryption is
97
+ * not free, and because two parsers over the same environment are two caches of
98
+ * the same answer.
99
+ */
100
+ export declare function defaultEnvParser(): EnvironmentParser<{}>;
101
+ /** The parser for an endpoint, from its surface or the default. */
102
+ export declare function envParserFor(surface: EndpointSurface | undefined): EnvironmentParser<{}>;
103
+ //#endregion
104
+ 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 EndpointStatus, type MappedAudit, NoAuthenticator, type OAuthFlow, type OAuthFlows, RLS_BYPASS, RedirectStatus, type RequestBodySource, ResponseBuilder, type RlsBypass, type RlsConfig, type RlsContext, type RlsContextExtractor, type SecurityScheme, type SessionAuth, SuccessStatus, UPLOAD_POST_SCHEMA, UploadAcceptInvalid, UploadContentTypeRefused, UploadContentTypeUnresolved, UploadEndpointBuilder, UploadExpiryInvalid, type UploadHandler, UploadMaxSizeInvalid, type UploadOptions, type UploadPost, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme, publishConstructEvents };
105
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/endpoints/lazyAccessors.ts","../../src/endpoints/readRequestBody.ts","../../src/endpoints/surfaceEnv.ts"],"mappings":";;;;;;;;;;;;wBAgBgB,kBAAkB,GAAG,UAAU;;;;;;wBAqB/B,kBAAkB,GAAG,UAAU;;;;;wBAgC/B,wBACf,SAAS,wDACP;;;;;wBAoCa,wBACf,+BACA,mCACE;;;;wBAmHa,qBAAqB;;;;wBAUrB,qBAAqB;;;;;;;qBCrOxB;;;;;qBAWA,sCAAsC;WAC7B;EAArB,YAAqB;;;;;;qBAiBT,6BAA6B;WAE/B;EADV,YACU,qBACT,QAAQ;;;;;;UAeO;EAChB,QAAQ;EACR,QAAQ;EACR,YAAY,QAAQ;;UAGJ;;;;;;EAMhB;;;;;;;;;;;;;;wBAeqB,gBACrB,QAAQ,mBACR,wCACA,SAAS,yBACP;;;;;;;;;;wBCnDa,oBAAoB;;wBASpB,aACf,SAAS,8BACP"}
@@ -1,10 +1,6 @@
1
- import "../Construct-BD5neF7w.mjs";
2
- import "../construct-interface-Z4CpS8tK.mjs";
3
- import "../functions-14lpEFL4.mjs";
4
- import { BUILT_IN_SECURITY_SCHEMES, EndpointBuilder, EndpointFactory, RLS_BYPASS, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme } from "../EndpointFactory-CjV8F_lJ.mjs";
5
- import "../clone-DblgEZZa.mjs";
6
- import { Endpoint, ResponseBuilder } from "../Endpoint-DCQPMdUX.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 UploadAcceptInvalid, c as UploadExpiryInvalid, d as BUILT_IN_SECURITY_SCHEMES, f as createAuthorizer, i as UPLOAD_POST_SCHEMA, l as UploadMaxSizeInvalid, m as isBuiltInSecurityScheme, n as EndpointBuilder, o as UploadContentTypeRefused, p as getSecurityScheme, r as UploadEndpointBuilder, s as UploadContentTypeUnresolved, t as EndpointFactory, u as RLS_BYPASS } from "../EndpointFactory-c2ZugGig.mjs";
2
+ import { i as publishConstructEvents } from "../functions-CTI-hDem.mjs";
3
+ import { a as NoAuthenticator, i as SuccessStatus, n as RedirectStatus, r as ResponseBuilder, t as Endpoint } from "../Endpoint-gPXhHKhJ.mjs";
4
+ import { n as envParserFor, t as defaultEnvParser } from "../surfaceEnv-wMT5QzgZ.mjs";
5
+ import { a as createApiGatewayCookies, c as createHonoCookies, d as createNoopHeaders, i as readRequestBody, l as createHonoHeaders, n as SUPPORTED_BODY_TYPES, o as createApiGatewayHeaders, r as UnsupportedRequestContentType, t as MalformedRequestBody, u as createNoopCookies } from "../readRequestBody-BTIl3k-D.mjs";
6
+ export { BUILT_IN_SECURITY_SCHEMES, Endpoint, EndpointBuilder, EndpointFactory, MalformedRequestBody, NoAuthenticator, RLS_BYPASS, RedirectStatus, ResponseBuilder, SUPPORTED_BODY_TYPES, SuccessStatus, UPLOAD_POST_SCHEMA, UnsupportedRequestContentType, UploadAcceptInvalid, UploadContentTypeRefused, UploadContentTypeUnresolved, UploadEndpointBuilder, UploadExpiryInvalid, UploadMaxSizeInvalid, createApiGatewayCookies, createApiGatewayHeaders, createAuthorizer, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, defaultEnvParser, envParserFor, getSecurityScheme, isBuiltInSecurityScheme, publishConstructEvents, readRequestBody };
@@ -0,0 +1,38 @@
1
+ //#region src/expire.d.ts
2
+ /**
3
+ * How long a bucket keeps the objects under a prefix.
4
+ *
5
+ * Shared by `ObjectStorage` and the bucket a `FileServer` vends, because it is
6
+ * a fact about the bucket rather than about who serves it: a prefix of
7
+ * generated files that nobody reads back grows for ever unless the bucket
8
+ * itself is told to drop them.
9
+ *
10
+ * ```ts
11
+ * new ObjectStorage('Private', { expire: { 'quotes/': { days: 30 } } });
12
+ * ```
13
+ *
14
+ * Whole days, because that is the unit S3's lifecycle — and MinIO's — counts
15
+ * in. Prefixes are literal: a lifecycle rule matches the start of a key and
16
+ * has no globs, so a pattern that looks like one is refused rather than
17
+ * silently matching nothing.
18
+ */
19
+ type ObjectExpiry = Readonly<Record<string, {
20
+ readonly days: number;
21
+ }>>;
22
+ /** An expiry prefix the bucket could not match the way it reads. */
23
+ declare class ExpiryPrefixInvalid extends Error {
24
+ readonly bucket: string;
25
+ readonly prefix: string;
26
+ readonly reason: string;
27
+ constructor(bucket: string, prefix: string, reason: string);
28
+ }
29
+ /** An expiry that is not a whole number of days, one or more. */
30
+ declare class ExpiryDaysInvalid extends Error {
31
+ readonly bucket: string;
32
+ readonly prefix: string;
33
+ readonly days: unknown;
34
+ constructor(bucket: string, prefix: string, days: unknown);
35
+ }
36
+ //#endregion
37
+ export { ExpiryPrefixInvalid as n, ObjectExpiry as r, ExpiryDaysInvalid as t };
38
+ //# sourceMappingURL=expire-C586zznE.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expire-C586zznE.d.cts","names":[],"sources":["../src/expire.ts"],"mappings":";;;;;;;;;;;;;;;;;;KAiBY,eAAe,SAAS;WAA0B;;;cAGjD,4BAA4B;WAE9B;WACA;WACA;EAHV,YACU,gBACA,gBACA;;;cAWE,0BAA0B;WAE5B;WACA;WACA;EAHV,YACU,gBACA,gBACA"}
@@ -0,0 +1,38 @@
1
+ //#region src/expire.d.ts
2
+ /**
3
+ * How long a bucket keeps the objects under a prefix.
4
+ *
5
+ * Shared by `ObjectStorage` and the bucket a `FileServer` vends, because it is
6
+ * a fact about the bucket rather than about who serves it: a prefix of
7
+ * generated files that nobody reads back grows for ever unless the bucket
8
+ * itself is told to drop them.
9
+ *
10
+ * ```ts
11
+ * new ObjectStorage('Private', { expire: { 'quotes/': { days: 30 } } });
12
+ * ```
13
+ *
14
+ * Whole days, because that is the unit S3's lifecycle — and MinIO's — counts
15
+ * in. Prefixes are literal: a lifecycle rule matches the start of a key and
16
+ * has no globs, so a pattern that looks like one is refused rather than
17
+ * silently matching nothing.
18
+ */
19
+ type ObjectExpiry = Readonly<Record<string, {
20
+ readonly days: number;
21
+ }>>;
22
+ /** An expiry prefix the bucket could not match the way it reads. */
23
+ declare class ExpiryPrefixInvalid extends Error {
24
+ readonly bucket: string;
25
+ readonly prefix: string;
26
+ readonly reason: string;
27
+ constructor(bucket: string, prefix: string, reason: string);
28
+ }
29
+ /** An expiry that is not a whole number of days, one or more. */
30
+ declare class ExpiryDaysInvalid extends Error {
31
+ readonly bucket: string;
32
+ readonly prefix: string;
33
+ readonly days: unknown;
34
+ constructor(bucket: string, prefix: string, days: unknown);
35
+ }
36
+ //#endregion
37
+ export { ExpiryPrefixInvalid as n, ObjectExpiry as r, ExpiryDaysInvalid as t };
38
+ //# sourceMappingURL=expire-C586zznE.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expire-C586zznE.d.mts","names":[],"sources":["../src/expire.ts"],"mappings":";;;;;;;;;;;;;;;;;;KAiBY,eAAe,SAAS;WAA0B;;;cAGjD,4BAA4B;WAE9B;WACA;WACA;EAHV,YACU,gBACA,gBACA;;;cAWE,0BAA0B;WAE5B;WACA;WACA;EAHV,YACU,gBACA,gBACA"}
@@ -0,0 +1,67 @@
1
+ //#region src/expire.ts
2
+ /** An expiry prefix the bucket could not match the way it reads. */
3
+ var ExpiryPrefixInvalid = class extends Error {
4
+ bucket;
5
+ prefix;
6
+ reason;
7
+ constructor(bucket, prefix, reason) {
8
+ super(`'${bucket}' expires objects under '${prefix}', which ${reason}. Name the start of the keys as they are stored, e.g. 'quotes/'.`);
9
+ this.bucket = bucket;
10
+ this.prefix = prefix;
11
+ this.reason = reason;
12
+ this.name = "ExpiryPrefixInvalid";
13
+ }
14
+ };
15
+ /** An expiry that is not a whole number of days, one or more. */
16
+ var ExpiryDaysInvalid = class extends Error {
17
+ bucket;
18
+ prefix;
19
+ days;
20
+ constructor(bucket, prefix, days) {
21
+ super(`'${bucket}' expires '${prefix}' after ${String(days)} days. A bucket counts lifecycle in whole days, so give an integer of 1 or more.`);
22
+ this.bucket = bucket;
23
+ this.prefix = prefix;
24
+ this.days = days;
25
+ this.name = "ExpiryDaysInvalid";
26
+ }
27
+ };
28
+ /**
29
+ * The expiry as the manifest records it — prefix → days — after checking
30
+ * each entry, or nothing when there is none.
31
+ *
32
+ * @throws {ExpiryPrefixInvalid} for an empty, rooted or globbed prefix
33
+ * @throws {ExpiryDaysInvalid} for anything but a positive integer of days
34
+ */
35
+ function expiryDays(bucket, expire) {
36
+ if (!expire) return void 0;
37
+ const days = {};
38
+ for (const [prefix, { days: count }] of Object.entries(expire)) {
39
+ if (prefix.length === 0) throw new ExpiryPrefixInvalid(bucket, prefix, "is empty");
40
+ if (prefix.startsWith("/")) throw new ExpiryPrefixInvalid(bucket, prefix, "starts with '/', which no stored key does");
41
+ if (/[*?]/.test(prefix)) throw new ExpiryPrefixInvalid(bucket, prefix, "is a pattern, and a lifecycle prefix is matched literally");
42
+ if (!Number.isInteger(count) || count < 1) throw new ExpiryDaysInvalid(bucket, prefix, count);
43
+ days[prefix] = count;
44
+ }
45
+ return Object.keys(days).length > 0 ? days : void 0;
46
+ }
47
+ //#endregion
48
+ Object.defineProperty(exports, "ExpiryDaysInvalid", {
49
+ enumerable: true,
50
+ get: function() {
51
+ return ExpiryDaysInvalid;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "ExpiryPrefixInvalid", {
55
+ enumerable: true,
56
+ get: function() {
57
+ return ExpiryPrefixInvalid;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "expiryDays", {
61
+ enumerable: true,
62
+ get: function() {
63
+ return expiryDays;
64
+ }
65
+ });
66
+
67
+ //# sourceMappingURL=expire-CieftS01.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expire-CieftS01.cjs","names":[],"sources":["../src/expire.ts"],"sourcesContent":["/**\n * How long a bucket keeps the objects under a prefix.\n *\n * Shared by `ObjectStorage` and the bucket a `FileServer` vends, because it is\n * a fact about the bucket rather than about who serves it: a prefix of\n * generated files that nobody reads back grows for ever unless the bucket\n * itself is told to drop them.\n *\n * ```ts\n * new ObjectStorage('Private', { expire: { 'quotes/': { days: 30 } } });\n * ```\n *\n * Whole days, because that is the unit S3's lifecycle — and MinIO's — counts\n * in. Prefixes are literal: a lifecycle rule matches the start of a key and\n * has no globs, so a pattern that looks like one is refused rather than\n * silently matching nothing.\n */\nexport type ObjectExpiry = Readonly<Record<string, { readonly days: number }>>;\n\n/** An expiry prefix the bucket could not match the way it reads. */\nexport class ExpiryPrefixInvalid extends Error {\n\tconstructor(\n\t\treadonly bucket: string,\n\t\treadonly prefix: string,\n\t\treadonly reason: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${bucket}' expires objects under '${prefix}', which ${reason}. ` +\n\t\t\t\t`Name the start of the keys as they are stored, e.g. 'quotes/'.`,\n\t\t);\n\t\tthis.name = 'ExpiryPrefixInvalid';\n\t}\n}\n\n/** An expiry that is not a whole number of days, one or more. */\nexport class ExpiryDaysInvalid extends Error {\n\tconstructor(\n\t\treadonly bucket: string,\n\t\treadonly prefix: string,\n\t\treadonly days: unknown,\n\t) {\n\t\tsuper(\n\t\t\t`'${bucket}' expires '${prefix}' after ${String(days)} days. A bucket ` +\n\t\t\t\t`counts lifecycle in whole days, so give an integer of 1 or more.`,\n\t\t);\n\t\tthis.name = 'ExpiryDaysInvalid';\n\t}\n}\n\n/**\n * The expiry as the manifest records it — prefix → days — after checking\n * each entry, or nothing when there is none.\n *\n * @throws {ExpiryPrefixInvalid} for an empty, rooted or globbed prefix\n * @throws {ExpiryDaysInvalid} for anything but a positive integer of days\n */\nexport function expiryDays(\n\tbucket: string,\n\texpire: ObjectExpiry | undefined,\n): Record<string, number> | undefined {\n\tif (!expire) return undefined;\n\n\tconst days: Record<string, number> = {};\n\tfor (const [prefix, { days: count }] of Object.entries(expire)) {\n\t\tif (prefix.length === 0) {\n\t\t\tthrow new ExpiryPrefixInvalid(bucket, prefix, 'is empty');\n\t\t}\n\t\tif (prefix.startsWith('/')) {\n\t\t\tthrow new ExpiryPrefixInvalid(\n\t\t\t\tbucket,\n\t\t\t\tprefix,\n\t\t\t\t\"starts with '/', which no stored key does\",\n\t\t\t);\n\t\t}\n\t\tif (/[*?]/.test(prefix)) {\n\t\t\tthrow new ExpiryPrefixInvalid(\n\t\t\t\tbucket,\n\t\t\t\tprefix,\n\t\t\t\t'is a pattern, and a lifecycle prefix is matched literally',\n\t\t\t);\n\t\t}\n\t\tif (!Number.isInteger(count) || count < 1) {\n\t\t\tthrow new ExpiryDaysInvalid(bucket, prefix, count);\n\t\t}\n\t\tdays[prefix] = count;\n\t}\n\n\treturn Object.keys(days).length > 0 ? days : undefined;\n}\n"],"mappings":";;AAoBA,IAAa,sBAAb,cAAyC,MAAM;CAEpC;CACA;CACA;CAHV,YACC,QACA,QACA,QACC;EACD,MACC,IAAI,OAAO,2BAA2B,OAAO,WAAW,OAAO,iEAEhE;EAPS,KAAA,SAAA;EACA,KAAA,SAAA;EACA,KAAA,SAAA;EAMT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,oBAAb,cAAuC,MAAM;CAElC;CACA;CACA;CAHV,YACC,QACA,QACA,MACC;EACD,MACC,IAAI,OAAO,aAAa,OAAO,UAAU,OAAO,IAAI,EAAE,iFAEvD;EAPS,KAAA,SAAA;EACA,KAAA,SAAA;EACA,KAAA,OAAA;EAMT,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,SAAgB,WACf,QACA,QACqC;CACrC,IAAI,CAAC,QAAQ,OAAO,KAAA;CAEpB,MAAM,OAA+B,CAAC;CACtC,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,YAAY,OAAO,QAAQ,MAAM,GAAG;EAC/D,IAAI,OAAO,WAAW,GACrB,MAAM,IAAI,oBAAoB,QAAQ,QAAQ,UAAU;EAEzD,IAAI,OAAO,WAAW,GAAG,GACxB,MAAM,IAAI,oBACT,QACA,QACA,2CACD;EAED,IAAI,OAAO,KAAK,MAAM,GACrB,MAAM,IAAI,oBACT,QACA,QACA,2DACD;EAED,IAAI,CAAC,OAAO,UAAU,KAAK,KAAK,QAAQ,GACvC,MAAM,IAAI,kBAAkB,QAAQ,QAAQ,KAAK;EAElD,KAAK,UAAU;CAChB;CAEA,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,SAAS,IAAI,OAAO,KAAA;AAC9C"}
@@ -0,0 +1,50 @@
1
+ //#region src/expire.ts
2
+ /** An expiry prefix the bucket could not match the way it reads. */
3
+ var ExpiryPrefixInvalid = class extends Error {
4
+ bucket;
5
+ prefix;
6
+ reason;
7
+ constructor(bucket, prefix, reason) {
8
+ super(`'${bucket}' expires objects under '${prefix}', which ${reason}. Name the start of the keys as they are stored, e.g. 'quotes/'.`);
9
+ this.bucket = bucket;
10
+ this.prefix = prefix;
11
+ this.reason = reason;
12
+ this.name = "ExpiryPrefixInvalid";
13
+ }
14
+ };
15
+ /** An expiry that is not a whole number of days, one or more. */
16
+ var ExpiryDaysInvalid = class extends Error {
17
+ bucket;
18
+ prefix;
19
+ days;
20
+ constructor(bucket, prefix, days) {
21
+ super(`'${bucket}' expires '${prefix}' after ${String(days)} days. A bucket counts lifecycle in whole days, so give an integer of 1 or more.`);
22
+ this.bucket = bucket;
23
+ this.prefix = prefix;
24
+ this.days = days;
25
+ this.name = "ExpiryDaysInvalid";
26
+ }
27
+ };
28
+ /**
29
+ * The expiry as the manifest records it — prefix → days — after checking
30
+ * each entry, or nothing when there is none.
31
+ *
32
+ * @throws {ExpiryPrefixInvalid} for an empty, rooted or globbed prefix
33
+ * @throws {ExpiryDaysInvalid} for anything but a positive integer of days
34
+ */
35
+ function expiryDays(bucket, expire) {
36
+ if (!expire) return void 0;
37
+ const days = {};
38
+ for (const [prefix, { days: count }] of Object.entries(expire)) {
39
+ if (prefix.length === 0) throw new ExpiryPrefixInvalid(bucket, prefix, "is empty");
40
+ if (prefix.startsWith("/")) throw new ExpiryPrefixInvalid(bucket, prefix, "starts with '/', which no stored key does");
41
+ if (/[*?]/.test(prefix)) throw new ExpiryPrefixInvalid(bucket, prefix, "is a pattern, and a lifecycle prefix is matched literally");
42
+ if (!Number.isInteger(count) || count < 1) throw new ExpiryDaysInvalid(bucket, prefix, count);
43
+ days[prefix] = count;
44
+ }
45
+ return Object.keys(days).length > 0 ? days : void 0;
46
+ }
47
+ //#endregion
48
+ export { ExpiryPrefixInvalid as n, expiryDays as r, ExpiryDaysInvalid as t };
49
+
50
+ //# sourceMappingURL=expire-CpzUAfr9.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expire-CpzUAfr9.mjs","names":[],"sources":["../src/expire.ts"],"sourcesContent":["/**\n * How long a bucket keeps the objects under a prefix.\n *\n * Shared by `ObjectStorage` and the bucket a `FileServer` vends, because it is\n * a fact about the bucket rather than about who serves it: a prefix of\n * generated files that nobody reads back grows for ever unless the bucket\n * itself is told to drop them.\n *\n * ```ts\n * new ObjectStorage('Private', { expire: { 'quotes/': { days: 30 } } });\n * ```\n *\n * Whole days, because that is the unit S3's lifecycle — and MinIO's — counts\n * in. Prefixes are literal: a lifecycle rule matches the start of a key and\n * has no globs, so a pattern that looks like one is refused rather than\n * silently matching nothing.\n */\nexport type ObjectExpiry = Readonly<Record<string, { readonly days: number }>>;\n\n/** An expiry prefix the bucket could not match the way it reads. */\nexport class ExpiryPrefixInvalid extends Error {\n\tconstructor(\n\t\treadonly bucket: string,\n\t\treadonly prefix: string,\n\t\treadonly reason: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${bucket}' expires objects under '${prefix}', which ${reason}. ` +\n\t\t\t\t`Name the start of the keys as they are stored, e.g. 'quotes/'.`,\n\t\t);\n\t\tthis.name = 'ExpiryPrefixInvalid';\n\t}\n}\n\n/** An expiry that is not a whole number of days, one or more. */\nexport class ExpiryDaysInvalid extends Error {\n\tconstructor(\n\t\treadonly bucket: string,\n\t\treadonly prefix: string,\n\t\treadonly days: unknown,\n\t) {\n\t\tsuper(\n\t\t\t`'${bucket}' expires '${prefix}' after ${String(days)} days. A bucket ` +\n\t\t\t\t`counts lifecycle in whole days, so give an integer of 1 or more.`,\n\t\t);\n\t\tthis.name = 'ExpiryDaysInvalid';\n\t}\n}\n\n/**\n * The expiry as the manifest records it — prefix → days — after checking\n * each entry, or nothing when there is none.\n *\n * @throws {ExpiryPrefixInvalid} for an empty, rooted or globbed prefix\n * @throws {ExpiryDaysInvalid} for anything but a positive integer of days\n */\nexport function expiryDays(\n\tbucket: string,\n\texpire: ObjectExpiry | undefined,\n): Record<string, number> | undefined {\n\tif (!expire) return undefined;\n\n\tconst days: Record<string, number> = {};\n\tfor (const [prefix, { days: count }] of Object.entries(expire)) {\n\t\tif (prefix.length === 0) {\n\t\t\tthrow new ExpiryPrefixInvalid(bucket, prefix, 'is empty');\n\t\t}\n\t\tif (prefix.startsWith('/')) {\n\t\t\tthrow new ExpiryPrefixInvalid(\n\t\t\t\tbucket,\n\t\t\t\tprefix,\n\t\t\t\t\"starts with '/', which no stored key does\",\n\t\t\t);\n\t\t}\n\t\tif (/[*?]/.test(prefix)) {\n\t\t\tthrow new ExpiryPrefixInvalid(\n\t\t\t\tbucket,\n\t\t\t\tprefix,\n\t\t\t\t'is a pattern, and a lifecycle prefix is matched literally',\n\t\t\t);\n\t\t}\n\t\tif (!Number.isInteger(count) || count < 1) {\n\t\t\tthrow new ExpiryDaysInvalid(bucket, prefix, count);\n\t\t}\n\t\tdays[prefix] = count;\n\t}\n\n\treturn Object.keys(days).length > 0 ? days : undefined;\n}\n"],"mappings":";;AAoBA,IAAa,sBAAb,cAAyC,MAAM;CAEpC;CACA;CACA;CAHV,YACC,QACA,QACA,QACC;EACD,MACC,IAAI,OAAO,2BAA2B,OAAO,WAAW,OAAO,iEAEhE;EAPS,KAAA,SAAA;EACA,KAAA,SAAA;EACA,KAAA,SAAA;EAMT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,oBAAb,cAAuC,MAAM;CAElC;CACA;CACA;CAHV,YACC,QACA,QACA,MACC;EACD,MACC,IAAI,OAAO,aAAa,OAAO,UAAU,OAAO,IAAI,EAAE,iFAEvD;EAPS,KAAA,SAAA;EACA,KAAA,SAAA;EACA,KAAA,OAAA;EAMT,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,SAAgB,WACf,QACA,QACqC;CACrC,IAAI,CAAC,QAAQ,OAAO,KAAA;CAEpB,MAAM,OAA+B,CAAC;CACtC,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,YAAY,OAAO,QAAQ,MAAM,GAAG;EAC/D,IAAI,OAAO,WAAW,GACrB,MAAM,IAAI,oBAAoB,QAAQ,QAAQ,UAAU;EAEzD,IAAI,OAAO,WAAW,GAAG,GACxB,MAAM,IAAI,oBACT,QACA,QACA,2CACD;EAED,IAAI,OAAO,KAAK,MAAM,GACrB,MAAM,IAAI,oBACT,QACA,QACA,2DACD;EAED,IAAI,CAAC,OAAO,UAAU,KAAK,KAAK,QAAQ,GACvC,MAAM,IAAI,kBAAkB,QAAQ,QAAQ,KAAK;EAElD,KAAK,UAAU;CAChB;CAEA,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,SAAS,IAAI,OAAO,KAAA;AAC9C"}
@@ -0,0 +1,106 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_credential = require("./credential-DYymbp_7.cjs");
3
+ const require_tracing = require("./tracing-C0ooU0V2.cjs");
4
+ let _geekmidas_manifest = require("@geekmidas/manifest");
5
+ //#region src/external-api.ts
6
+ /**
7
+ * `ExternalApi` — an HTTP API somebody else runs.
8
+ *
9
+ * Polar, Stripe, a payment gateway: nothing to provision, but an address that
10
+ * changes by stage and credentials the provider issued for each one. Without a
11
+ * construct every integration writes that switching by hand — an optional
12
+ * `POLAR_URL`, a fake started somewhere, a client built in a service — and the
13
+ * target cannot see any of it.
14
+ *
15
+ * ```ts
16
+ * // constructs/polar.ts
17
+ * export const polar = new ExternalApi('Polar', {
18
+ * url: 'https://www.polaraccesslink.com',
19
+ * credentials: z.object({ clientId: z.string(), clientSecret: z.string() }),
20
+ * client: ({ url, credentials }) => new PolarClient(url, credentials),
21
+ * });
22
+ *
23
+ * // test/fakes/polar.ts
24
+ * export default fake.app(new Hono().post('/v3/oauth2/token', …), {
25
+ * credentials: { clientId: 'fake', clientSecret: 'fake' },
26
+ * });
27
+ *
28
+ * // in a handler — the real API deployed, the fake locally and in tests
29
+ * .dependsOn([polar])
30
+ * .handle(({ services }) => services.polar.exchangeCode(code))
31
+ * ```
32
+ *
33
+ * Deployed, the URL is `url` — one for every stage, or one per stage name with
34
+ * a `default` — and the credentials are the stage's `<ID>_CREDENTIALS`, one
35
+ * JSON value read the way a `Credential`'s is. Locally and in tests both come
36
+ * from the fake.
37
+ *
38
+ * **The construct never names its fake.** It is found by convention, at
39
+ * `test/fakes/<id>.ts`, and read only by gkm and the generated test harness —
40
+ * so a fake, and the recorded responses it answers from, cannot end up in a
41
+ * deployed bundle however the bundler follows imports.
42
+ */
43
+ var ExternalApi = class {
44
+ options;
45
+ id;
46
+ service;
47
+ /** Read by both `declare()` and `connect()`, so the two cannot drift. */
48
+ keys;
49
+ /** The promise, so concurrent registrations share one client. */
50
+ connected;
51
+ constructor(id, options) {
52
+ this.options = options;
53
+ const canonical = (0, _geekmidas_manifest.canonicalId)(id);
54
+ this.id = canonical;
55
+ this.keys = {
56
+ url: (0, _geekmidas_manifest.provideKey)(canonical, "url"),
57
+ credentials: (0, _geekmidas_manifest.provideKey)(canonical, "credentials")
58
+ };
59
+ this.service = {
60
+ serviceName: (0, _geekmidas_manifest.serviceKey)(canonical),
61
+ register: (registerOptions) => {
62
+ this.connected ??= this.connect(registerOptions);
63
+ return this.connected;
64
+ }
65
+ };
66
+ }
67
+ /**
68
+ * What the stage's `<ID>_CREDENTIALS` must look like — the schema the value
69
+ * is validated against where it is read. Public so a tool setting the value
70
+ * (`gkm secrets:add`) can check it, and describe its fields, before it is
71
+ * stored rather than at the first request.
72
+ */
73
+ get credentialsSchema() {
74
+ return this.options.credentials;
75
+ }
76
+ declare() {
77
+ return [{
78
+ kind: "external-api",
79
+ id: this.id,
80
+ url: this.options.url,
81
+ provides: [this.keys.url, this.keys.credentials]
82
+ }];
83
+ }
84
+ async connect(options) {
85
+ const { url } = options.envParser.create((get) => ({ url: get(this.keys.url).string() })).parse();
86
+ const credentials = await require_credential.readCredentials(this.id, this.keys.credentials, this.options.credentials, options.envParser);
87
+ const client = await this.options.client({
88
+ url,
89
+ credentials
90
+ });
91
+ return require_tracing.traceClient(this.id, client, { "server.address": hostOf(url) });
92
+ }
93
+ };
94
+ function hostOf(url) {
95
+ try {
96
+ return new URL(url).host;
97
+ } catch {
98
+ return url;
99
+ }
100
+ }
101
+ //#endregion
102
+ exports.ExternalApi = ExternalApi;
103
+ exports.fake = require_credential.fake;
104
+ exports.isFake = require_credential.isFake;
105
+
106
+ //# sourceMappingURL=external-api.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-api.cjs","names":["canonicalId","provideKey","serviceKey","readCredentials","traceClient"],"sources":["../src/external-api.ts"],"sourcesContent":["/**\n * `ExternalApi` — an HTTP API somebody else runs.\n *\n * Polar, Stripe, a payment gateway: nothing to provision, but an address that\n * changes by stage and credentials the provider issued for each one. Without a\n * construct every integration writes that switching by hand — an optional\n * `POLAR_URL`, a fake started somewhere, a client built in a service — and the\n * target cannot see any of it.\n *\n * ```ts\n * // constructs/polar.ts\n * export const polar = new ExternalApi('Polar', {\n * url: 'https://www.polaraccesslink.com',\n * credentials: z.object({ clientId: z.string(), clientSecret: z.string() }),\n * client: ({ url, credentials }) => new PolarClient(url, credentials),\n * });\n *\n * // test/fakes/polar.ts\n * export default fake.app(new Hono().post('/v3/oauth2/token', …), {\n * credentials: { clientId: 'fake', clientSecret: 'fake' },\n * });\n *\n * // in a handler — the real API deployed, the fake locally and in tests\n * .dependsOn([polar])\n * .handle(({ services }) => services.polar.exchangeCode(code))\n * ```\n *\n * Deployed, the URL is `url` — one for every stage, or one per stage name with\n * a `default` — and the credentials are the stage's `<ID>_CREDENTIALS`, one\n * JSON value read the way a `Credential`'s is. Locally and in tests both come\n * from the fake.\n *\n * **The construct never names its fake.** It is found by convention, at\n * `test/fakes/<id>.ts`, and read only by gkm and the generated test harness —\n * so a fake, and the recorded responses it answers from, cannot end up in a\n * deployed bundle however the bundler follows imports.\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 type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { Consumable } from './construct-interface';\nimport { readCredentials } from './credential';\nimport type { DeployedStage, LocalStage } from './stages';\nimport { traceClient } from './tracing';\n\n/** What a credentials schema yields. */\ntype Value<TSchema extends StandardSchemaV1> =\n\tStandardSchemaV1.InferOutput<TSchema>;\n\n/**\n * Where an external API answers: one URL for every stage, or one per stage\n * name with `default` for any stage not listed.\n *\n * Keyed by the stages `gkm.config.ts` declares once `.gkm/stages.d.ts` exists,\n * so a key that names no stage — `prodution` — is a type error rather than a\n * URL nothing reads. Without the file any key goes, as before.\n */\nexport type ExternalApiUrl =\n\t| string\n\t| (string extends LocalStage | DeployedStage\n\t\t\t? Readonly<Record<string, string>>\n\t\t\t: { readonly [S in LocalStage | DeployedStage]?: string } & {\n\t\t\t\t\treadonly default?: string;\n\t\t\t\t});\n\nexport interface ExternalApiOptions<TSchema extends StandardSchemaV1, TClient> {\n\t/**\n\t * Where it answers deployed: one URL for every stage, or one per stage\n\t * name, with `default` for any stage not listed.\n\t */\n\turl: ExternalApiUrl;\n\t/** What the stage's `<ID>_CREDENTIALS` must look like. */\n\tcredentials: TSchema;\n\t/** What a handler is handed, built from where it answers and the credentials. */\n\tclient: (connection: {\n\t\turl: string;\n\t\tcredentials: Value<TSchema>;\n\t}) => TClient | Promise<TClient>;\n}\n\nexport class ExternalApi<\n\tTName extends string = string,\n\tTSchema extends StandardSchemaV1 = StandardSchemaV1,\n\tTClient = unknown,\n> implements Consumable<TName, TClient>\n{\n\t// `Consumable` for the reason `Credential` gives: a client generic in\n\t// `TClient` cannot satisfy `Construct`'s conditional service type.\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\n\t/** Read by both `declare()` and `connect()`, so the two cannot drift. */\n\tprivate readonly keys: { url: string; credentials: string };\n\n\t/** The promise, so concurrent registrations share one client. */\n\tprivate connected?: Promise<TClient>;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: ExternalApiOptions<TSchema, TClient>,\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\tcredentials: provideKey(canonical, 'credentials'),\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) => {\n\t\t\t\tthis.connected ??= this.connect(registerOptions);\n\t\t\t\treturn this.connected;\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * What the stage's `<ID>_CREDENTIALS` must look like — the schema the value\n\t * is validated against where it is read. Public so a tool setting the value\n\t * (`gkm secrets:add`) can check it, and describe its fields, before it is\n\t * stored rather than at the first request.\n\t */\n\tget credentialsSchema(): TSchema {\n\t\treturn this.options.credentials;\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'external-api',\n\t\t\t\tid: this.id,\n\t\t\t\t// The stage-keyed map is a record of URLs to the manifest, which\n\t\t\t\t// reads it by whatever stage it is resolving.\n\t\t\t\turl: this.options.url as Readonly<Record<string, string>> | string,\n\t\t\t\tprovides: [this.keys.url, this.keys.credentials],\n\t\t\t},\n\t\t];\n\t}\n\n\tprivate async connect(options: ServiceRegisterOptions): Promise<TClient> {\n\t\tconst { url } = options.envParser\n\t\t\t.create((get) => ({ url: get(this.keys.url).string() }))\n\t\t\t.parse();\n\t\tconst credentials = await readCredentials(\n\t\t\tthis.id,\n\t\t\tthis.keys.credentials,\n\t\t\tthis.options.credentials,\n\t\t\toptions.envParser,\n\t\t);\n\n\t\tconst client = await this.options.client({ url, credentials });\n\t\t// Each call a span carrying this API's name — the parent of the fetch\n\t\t// it makes, which is traced already.\n\t\treturn traceClient(this.id, client, {\n\t\t\t'server.address': hostOf(url),\n\t\t});\n\t}\n}\n\nfunction hostOf(url: string): string {\n\ttry {\n\t\treturn new URL(url).host;\n\t} catch {\n\t\treturn url;\n\t}\n}\n\nexport {\n\ttype Fake,\n\ttype FetchHandler,\n\tfake,\n\tisFake,\n} from './fake';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,IAAa,cAAb,MAKA;CAcmB;CAXlB;CACA;;CAGA;;CAGA;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;GAChC,cAAA,GAAaA,oBAAAA,WAAAA,CAAW,WAAW,aAAa;EACjD;EAGA,KAAK,UAAU;GACd,cAAA,GAAaC,oBAAAA,WAAAA,CAAW,SAAS;GACjC,WAAW,oBAAoB;IAC9B,KAAK,cAAc,KAAK,QAAQ,eAAe;IAC/C,OAAO,KAAK;GACb;EACD;CACD;;;;;;;CAQA,IAAI,oBAA6B;EAChC,OAAO,KAAK,QAAQ;CACrB;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GAGT,KAAK,KAAK,QAAQ;GAClB,UAAU,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,WAAW;EAChD,CACD;CACD;CAEA,MAAc,QAAQ,SAAmD;EACxE,MAAM,EAAE,QAAQ,QAAQ,UACtB,QAAQ,SAAS,EAAE,KAAK,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACvD,MAAM;EACR,MAAM,cAAc,MAAMC,mBAAAA,gBACzB,KAAK,IACL,KAAK,KAAK,aACV,KAAK,QAAQ,aACb,QAAQ,SACT;EAEA,MAAM,SAAS,MAAM,KAAK,QAAQ,OAAO;GAAE;GAAK;EAAY,CAAC;EAG7D,OAAOC,gBAAAA,YAAY,KAAK,IAAI,QAAQ,EACnC,kBAAkB,OAAO,GAAG,EAC7B,CAAC;CACF;AACD;AAEA,SAAS,OAAO,KAAqB;CACpC,IAAI;EACH,OAAO,IAAI,IAAI,GAAG,CAAC,CAAC;CACrB,QAAQ;EACP,OAAO;CACR;AACD"}
@@ -0,0 +1,2 @@
1
+ import { a as ExternalApi, i as isFake, n as FetchHandler, o as ExternalApiOptions, r as fake, s as ExternalApiUrl, t as Fake } from "./fake-B7rvi4Qp.cjs";
2
+ export { ExternalApi, ExternalApiOptions, ExternalApiUrl, type Fake, type FetchHandler, fake, isFake };
@@ -0,0 +1,2 @@
1
+ import { a as ExternalApi, i as isFake, n as FetchHandler, o as ExternalApiOptions, r as fake, s as ExternalApiUrl, t as Fake } from "./fake-JXbkdao8.mjs";
2
+ export { ExternalApi, ExternalApiOptions, ExternalApiUrl, type Fake, type FetchHandler, fake, isFake };