@geekmidas/constructs 10.0.0-alpha.14 → 10.0.0-alpha.140

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-127M7yrl.d.cts +231 -0
  3. package/dist/Construct-127M7yrl.d.cts.map +1 -0
  4. package/dist/{Construct-BeYVu_QF.mjs → Construct-CGuc_Ijk.mjs} +8 -9
  5. package/dist/Construct-CGuc_Ijk.mjs.map +1 -0
  6. package/dist/{Construct-DqdlARxq.cjs → Construct-DorKS0Ua.cjs} +8 -9
  7. package/dist/Construct-DorKS0Ua.cjs.map +1 -0
  8. package/dist/Construct-DySlwh8o.d.mts +231 -0
  9. package/dist/Construct-DySlwh8o.d.mts.map +1 -0
  10. package/dist/{Cron-DKqnnTdH.d.cts → Cron-CFkpEys6.d.cts} +14 -7
  11. package/dist/Cron-CFkpEys6.d.cts.map +1 -0
  12. package/dist/{Cron-SyqS5oWJ.d.mts → Cron-CQoDSu-n.d.mts} +14 -7
  13. package/dist/Cron-CQoDSu-n.d.mts.map +1 -0
  14. package/dist/CronBuilder-1W-G_i15.d.mts +47 -0
  15. package/dist/CronBuilder-1W-G_i15.d.mts.map +1 -0
  16. package/dist/{CronBuilder-D_0HNBTr.mjs → CronBuilder-BJ5LoadF.mjs} +28 -11
  17. package/dist/CronBuilder-BJ5LoadF.mjs.map +1 -0
  18. package/dist/{CronBuilder-BdnI6lxF.cjs → CronBuilder-B_NSP-Y5.cjs} +27 -10
  19. package/dist/CronBuilder-B_NSP-Y5.cjs.map +1 -0
  20. package/dist/CronBuilder-OaCRRFVk.d.cts +47 -0
  21. package/dist/CronBuilder-OaCRRFVk.d.cts.map +1 -0
  22. package/dist/{Endpoint-C6yyHpRS.d.cts → Endpoint-BEh-jW-f.d.cts} +122 -41
  23. package/dist/Endpoint-BEh-jW-f.d.cts.map +1 -0
  24. package/dist/Endpoint-BcUorcBa.cjs +576 -0
  25. package/dist/Endpoint-BcUorcBa.cjs.map +1 -0
  26. package/dist/Endpoint-BgvG36NO.mjs +547 -0
  27. package/dist/Endpoint-BgvG36NO.mjs.map +1 -0
  28. package/dist/{Endpoint-DuT4TEEq.d.mts → Endpoint-DTXDggNl.d.mts} +124 -43
  29. package/dist/Endpoint-DTXDggNl.d.mts.map +1 -0
  30. package/dist/{index-BPSZ_Lp_.d.cts → EndpointFactory-B2dCS9dy.d.cts} +187 -104
  31. package/dist/EndpointFactory-B2dCS9dy.d.cts.map +1 -0
  32. package/dist/{EndpointFactory-Bm3aKRdV.mjs → EndpointFactory-C1NlpCAS.mjs} +269 -53
  33. package/dist/EndpointFactory-C1NlpCAS.mjs.map +1 -0
  34. package/dist/{index-BoZ-iisU.d.mts → EndpointFactory-D2HXcUrJ.d.mts} +188 -105
  35. package/dist/EndpointFactory-D2HXcUrJ.d.mts.map +1 -0
  36. package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-gqmIRVWg.cjs} +309 -51
  37. package/dist/EndpointFactory-gqmIRVWg.cjs.map +1 -0
  38. package/dist/Function-BIEsY0Hm.d.cts +76 -0
  39. package/dist/Function-BIEsY0Hm.d.cts.map +1 -0
  40. package/dist/Function-DfMzTGS4.d.mts +76 -0
  41. package/dist/Function-DfMzTGS4.d.mts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-92zavCsV.cjs → HonoEndpointAdaptor-BJlj20fQ.cjs} +79 -31
  43. package/dist/HonoEndpointAdaptor-BJlj20fQ.cjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-yYaU7jVJ.mjs → HonoEndpointAdaptor-BlbkUDNo.mjs} +76 -28
  45. package/dist/HonoEndpointAdaptor-BlbkUDNo.mjs.map +1 -0
  46. package/dist/ObjectSubscriberBuilder-BuuaYcrm.d.cts +129 -0
  47. package/dist/ObjectSubscriberBuilder-BuuaYcrm.d.cts.map +1 -0
  48. package/dist/ObjectSubscriberBuilder-CzgYmOUH.d.mts +129 -0
  49. package/dist/ObjectSubscriberBuilder-CzgYmOUH.d.mts.map +1 -0
  50. package/dist/ProcessorBuilder-B2_stA8f.d.mts +216 -0
  51. package/dist/ProcessorBuilder-B2_stA8f.d.mts.map +1 -0
  52. package/dist/ProcessorBuilder-C62bIOwj.d.cts +216 -0
  53. package/dist/ProcessorBuilder-C62bIOwj.d.cts.map +1 -0
  54. package/dist/{Queue-D9X6OoON.d.mts → Queue-BnK3UH8r.d.mts} +42 -41
  55. package/dist/Queue-BnK3UH8r.d.mts.map +1 -0
  56. package/dist/{Queue-DYPB2KWL.d.cts → Queue-C4rijiM7.d.cts} +43 -42
  57. package/dist/Queue-C4rijiM7.d.cts.map +1 -0
  58. package/dist/Queue-D4Iaidrs.cjs +109 -0
  59. package/dist/Queue-D4Iaidrs.cjs.map +1 -0
  60. package/dist/Queue-u8w8_HpE.mjs +104 -0
  61. package/dist/Queue-u8w8_HpE.mjs.map +1 -0
  62. package/dist/QueueBuilder-2wP5lEC8.mjs +118 -0
  63. package/dist/QueueBuilder-2wP5lEC8.mjs.map +1 -0
  64. package/dist/QueueBuilder-B3vL1ED2.d.mts +75 -0
  65. package/dist/QueueBuilder-B3vL1ED2.d.mts.map +1 -0
  66. package/dist/QueueBuilder-BcPBQSSX.d.cts +75 -0
  67. package/dist/QueueBuilder-BcPBQSSX.d.cts.map +1 -0
  68. package/dist/QueueBuilder-BxsZ9o5z.cjs +135 -0
  69. package/dist/QueueBuilder-BxsZ9o5z.cjs.map +1 -0
  70. package/dist/Subscriber-5rCX1Nph.d.cts +83 -0
  71. package/dist/Subscriber-5rCX1Nph.d.cts.map +1 -0
  72. package/dist/Subscriber-CW_Dl-YR.d.mts +83 -0
  73. package/dist/Subscriber-CW_Dl-YR.d.mts.map +1 -0
  74. package/dist/SubscriberBuilder-BL_GTcwh.mjs +237 -0
  75. package/dist/SubscriberBuilder-BL_GTcwh.mjs.map +1 -0
  76. package/dist/SubscriberBuilder-CWzKwX1p.cjs +260 -0
  77. package/dist/SubscriberBuilder-CWzKwX1p.cjs.map +1 -0
  78. package/dist/Topic-DN2gYJ-p.mjs +99 -0
  79. package/dist/Topic-DN2gYJ-p.mjs.map +1 -0
  80. package/dist/Topic-Dp9Q7Lj2.cjs +104 -0
  81. package/dist/Topic-Dp9Q7Lj2.cjs.map +1 -0
  82. package/dist/adaptors/aws.cjs +134 -160
  83. package/dist/adaptors/aws.cjs.map +1 -1
  84. package/dist/adaptors/aws.d.cts +57 -48
  85. package/dist/adaptors/aws.d.cts.map +1 -1
  86. package/dist/adaptors/aws.d.mts +58 -49
  87. package/dist/adaptors/aws.d.mts.map +1 -1
  88. package/dist/adaptors/aws.mjs +130 -157
  89. package/dist/adaptors/aws.mjs.map +1 -1
  90. package/dist/adaptors/hono.cjs +1 -1
  91. package/dist/adaptors/hono.d.cts +5 -6
  92. package/dist/adaptors/hono.d.cts.map +1 -1
  93. package/dist/adaptors/hono.d.mts +6 -7
  94. package/dist/adaptors/hono.d.mts.map +1 -1
  95. package/dist/adaptors/hono.mjs +1 -1
  96. package/dist/adaptors/testing.cjs +955 -38
  97. package/dist/adaptors/testing.cjs.map +1 -1
  98. package/dist/adaptors/testing.d.cts +437 -39
  99. package/dist/adaptors/testing.d.cts.map +1 -1
  100. package/dist/adaptors/testing.d.mts +436 -38
  101. package/dist/adaptors/testing.d.mts.map +1 -1
  102. package/dist/adaptors/testing.mjs +929 -34
  103. package/dist/adaptors/testing.mjs.map +1 -1
  104. package/dist/auth-BMCJN30Y.d.cts +268 -0
  105. package/dist/auth-BMCJN30Y.d.cts.map +1 -0
  106. package/dist/auth-D_0788uW.d.mts +268 -0
  107. package/dist/auth-D_0788uW.d.mts.map +1 -0
  108. package/dist/auth.cjs +290 -46
  109. package/dist/auth.cjs.map +1 -1
  110. package/dist/auth.d.cts +2 -104
  111. package/dist/auth.d.mts +2 -104
  112. package/dist/auth.mjs +286 -48
  113. package/dist/auth.mjs.map +1 -1
  114. package/dist/cache-5QZzh5Er.d.mts +44 -0
  115. package/dist/cache-5QZzh5Er.d.mts.map +1 -0
  116. package/dist/cache-DnGDGly3.d.cts +44 -0
  117. package/dist/cache-DnGDGly3.d.cts.map +1 -0
  118. package/dist/cache.d.cts +2 -43
  119. package/dist/cache.d.mts +2 -43
  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/{construct-interface-DPlxfpoS.d.mts → construct-interface-B1AfqRl4.d.cts} +42 -8
  129. package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
  130. package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-ZvYQbivO.d.mts} +42 -8
  131. package/dist/construct-interface-ZvYQbivO.d.mts.map +1 -0
  132. package/dist/construct-interface.cjs +30 -4
  133. package/dist/construct-interface.cjs.map +1 -1
  134. package/dist/construct-interface.d.cts +2 -2
  135. package/dist/construct-interface.d.mts +2 -2
  136. package/dist/construct-interface.mjs +30 -5
  137. package/dist/construct-interface.mjs.map +1 -1
  138. package/dist/credential-DYymbp_7.cjs +257 -0
  139. package/dist/credential-DYymbp_7.cjs.map +1 -0
  140. package/dist/credential-DfSAOOdY.mjs +222 -0
  141. package/dist/credential-DfSAOOdY.mjs.map +1 -0
  142. package/dist/credential.cjs +7 -129
  143. package/dist/credential.d.cts +2 -58
  144. package/dist/credential.d.mts +2 -58
  145. package/dist/credential.mjs +2 -128
  146. package/dist/crons/index.cjs +126 -1
  147. package/dist/crons/index.cjs.map +1 -1
  148. package/dist/crons/index.d.cts +43 -3
  149. package/dist/crons/index.d.cts.map +1 -1
  150. package/dist/crons/index.d.mts +43 -3
  151. package/dist/crons/index.d.mts.map +1 -1
  152. package/dist/crons/index.mjs +125 -2
  153. package/dist/crons/index.mjs.map +1 -1
  154. package/dist/database/kysely.cjs +3 -194
  155. package/dist/database/kysely.d.cts +2 -149
  156. package/dist/database/kysely.d.mts +2 -149
  157. package/dist/database/kysely.mjs +2 -192
  158. package/dist/email.d.cts +1 -1
  159. package/dist/email.d.cts.map +1 -1
  160. package/dist/email.d.mts +2 -2
  161. package/dist/email.d.mts.map +1 -1
  162. package/dist/encryption/kms.cjs +95 -0
  163. package/dist/encryption/kms.cjs.map +1 -0
  164. package/dist/encryption/kms.d.cts +7 -0
  165. package/dist/encryption/kms.d.cts.map +1 -0
  166. package/dist/encryption/kms.d.mts +7 -0
  167. package/dist/encryption/kms.d.mts.map +1 -0
  168. package/dist/encryption/kms.mjs +93 -0
  169. package/dist/encryption/kms.mjs.map +1 -0
  170. package/dist/encryption.cjs +116 -0
  171. package/dist/encryption.cjs.map +1 -0
  172. package/dist/encryption.d.cts +37 -0
  173. package/dist/encryption.d.cts.map +1 -0
  174. package/dist/encryption.d.mts +37 -0
  175. package/dist/encryption.d.mts.map +1 -0
  176. package/dist/encryption.mjs +101 -0
  177. package/dist/encryption.mjs.map +1 -0
  178. package/dist/endpoints/index.cjs +32 -10
  179. package/dist/endpoints/index.d.cts +106 -3
  180. package/dist/endpoints/index.d.cts.map +1 -0
  181. package/dist/endpoints/index.d.mts +106 -3
  182. package/dist/endpoints/index.d.mts.map +1 -0
  183. package/dist/endpoints/index.mjs +6 -4
  184. package/dist/expire-C586zznE.d.cts +38 -0
  185. package/dist/expire-C586zznE.d.cts.map +1 -0
  186. package/dist/expire-C586zznE.d.mts +38 -0
  187. package/dist/expire-C586zznE.d.mts.map +1 -0
  188. package/dist/expire-CieftS01.cjs +67 -0
  189. package/dist/expire-CieftS01.cjs.map +1 -0
  190. package/dist/expire-CpzUAfr9.mjs +50 -0
  191. package/dist/expire-CpzUAfr9.mjs.map +1 -0
  192. package/dist/external-api.cjs +106 -0
  193. package/dist/external-api.cjs.map +1 -0
  194. package/dist/external-api.d.cts +2 -0
  195. package/dist/external-api.d.mts +2 -0
  196. package/dist/external-api.mjs +103 -0
  197. package/dist/external-api.mjs.map +1 -0
  198. package/dist/fake-BUgcX2Dk.d.cts +201 -0
  199. package/dist/fake-BUgcX2Dk.d.cts.map +1 -0
  200. package/dist/fake-D472nkKb.d.mts +201 -0
  201. package/dist/fake-D472nkKb.d.mts.map +1 -0
  202. package/dist/file-server.cjs +123 -30
  203. package/dist/file-server.cjs.map +1 -1
  204. package/dist/file-server.d.cts +115 -1
  205. package/dist/file-server.d.cts.map +1 -1
  206. package/dist/file-server.d.mts +115 -1
  207. package/dist/file-server.d.mts.map +1 -1
  208. package/dist/file-server.mjs +122 -32
  209. package/dist/file-server.mjs.map +1 -1
  210. package/dist/functions/index.cjs +1 -1
  211. package/dist/functions/index.d.cts +2 -1
  212. package/dist/functions/index.d.mts +2 -1
  213. package/dist/functions/index.mjs +1 -1
  214. package/dist/{functions-C53GW2eQ.mjs → functions-BvIDQKAA.mjs} +117 -22
  215. package/dist/functions-BvIDQKAA.mjs.map +1 -0
  216. package/dist/{functions-B6qCvfmy.cjs → functions-DLF6-IK8.cjs} +122 -18
  217. package/dist/functions-DLF6-IK8.cjs.map +1 -0
  218. package/dist/inbox-DZdICa8F.d.mts +195 -0
  219. package/dist/inbox-DZdICa8F.d.mts.map +1 -0
  220. package/dist/inbox-DqaxrpEk.d.cts +195 -0
  221. package/dist/inbox-DqaxrpEk.d.cts.map +1 -0
  222. package/dist/inbox.cjs +291 -0
  223. package/dist/inbox.cjs.map +1 -0
  224. package/dist/inbox.d.cts +2 -0
  225. package/dist/inbox.d.mts +2 -0
  226. package/dist/inbox.mjs +283 -0
  227. package/dist/inbox.mjs.map +1 -0
  228. package/dist/index-BtzMzhMA.d.cts +115 -0
  229. package/dist/index-BtzMzhMA.d.cts.map +1 -0
  230. package/dist/{index-CeEtxDmK.d.cts → index-DdRjYhiJ.d.cts} +42 -2
  231. package/dist/{index-CeEtxDmK.d.cts.map → index-DdRjYhiJ.d.cts.map} +1 -1
  232. package/dist/{index-CeEtxDmK.d.mts → index-DdRjYhiJ.d.mts} +42 -2
  233. package/dist/{index-CeEtxDmK.d.mts.map → index-DdRjYhiJ.d.mts.map} +1 -1
  234. package/dist/index-DuriFjYD.d.mts +115 -0
  235. package/dist/index-DuriFjYD.d.mts.map +1 -0
  236. package/dist/index.cjs +4 -1
  237. package/dist/index.d.cts +26 -3
  238. package/dist/index.d.cts.map +1 -0
  239. package/dist/index.d.mts +26 -3
  240. package/dist/index.d.mts.map +1 -0
  241. package/dist/index.mjs +3 -2
  242. package/dist/kysely-BHYV-WC-.d.cts +216 -0
  243. package/dist/kysely-BHYV-WC-.d.cts.map +1 -0
  244. package/dist/kysely-CAW3QSqp.d.mts +216 -0
  245. package/dist/kysely-CAW3QSqp.d.mts.map +1 -0
  246. package/dist/kysely-Cs4uPO8k.mjs +371 -0
  247. package/dist/kysely-Cs4uPO8k.mjs.map +1 -0
  248. package/dist/kysely-CukArHJ0.cjs +384 -0
  249. package/dist/kysely-CukArHJ0.cjs.map +1 -0
  250. package/dist/{telemetry-DGcFlVpB.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +2 -2
  251. package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
  252. package/dist/{telemetry-DGcFlVpB.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +2 -2
  253. package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
  254. package/dist/mobile-app.cjs +74 -0
  255. package/dist/mobile-app.cjs.map +1 -0
  256. package/dist/mobile-app.d.cts +73 -0
  257. package/dist/mobile-app.d.cts.map +1 -0
  258. package/dist/mobile-app.d.mts +73 -0
  259. package/dist/mobile-app.d.mts.map +1 -0
  260. package/dist/mobile-app.mjs +73 -0
  261. package/dist/mobile-app.mjs.map +1 -0
  262. package/dist/object-storage.cjs +8 -1
  263. package/dist/object-storage.cjs.map +1 -1
  264. package/dist/object-storage.d.cts +10 -1
  265. package/dist/object-storage.d.cts.map +1 -1
  266. package/dist/object-storage.d.mts +10 -1
  267. package/dist/object-storage.d.mts.map +1 -1
  268. package/dist/object-storage.mjs +7 -2
  269. package/dist/object-storage.mjs.map +1 -1
  270. package/dist/pattern-C1CEcglD.mjs +241 -0
  271. package/dist/pattern-C1CEcglD.mjs.map +1 -0
  272. package/dist/pattern-QFaUIr77.cjs +288 -0
  273. package/dist/pattern-QFaUIr77.cjs.map +1 -0
  274. package/dist/processors/index.cjs +214 -0
  275. package/dist/processors/index.cjs.map +1 -0
  276. package/dist/processors/index.d.cts +78 -0
  277. package/dist/processors/index.d.cts.map +1 -0
  278. package/dist/processors/index.d.mts +78 -0
  279. package/dist/processors/index.d.mts.map +1 -0
  280. package/dist/processors/index.mjs +193 -0
  281. package/dist/processors/index.mjs.map +1 -0
  282. package/dist/queue/index.cjs +5 -192
  283. package/dist/queue/index.d.cts +3 -53
  284. package/dist/queue/index.d.mts +3 -53
  285. package/dist/queue/index.mjs +3 -190
  286. package/dist/random-password.cjs +86 -0
  287. package/dist/random-password.cjs.map +1 -0
  288. package/dist/random-password.d.cts +30 -0
  289. package/dist/random-password.d.cts.map +1 -0
  290. package/dist/random-password.d.mts +30 -0
  291. package/dist/random-password.d.mts.map +1 -0
  292. package/dist/random-password.mjs +84 -0
  293. package/dist/random-password.mjs.map +1 -0
  294. package/dist/{lazyAccessors-BHtcqgz2.mjs → readRequestBody-BTIl3k-D.mjs} +99 -39
  295. package/dist/readRequestBody-BTIl3k-D.mjs.map +1 -0
  296. package/dist/{lazyAccessors-Dx9NLwJZ.cjs → readRequestBody-Dej_L3c4.cjs} +118 -46
  297. package/dist/readRequestBody-Dej_L3c4.cjs.map +1 -0
  298. package/dist/requestLogger-BZcXwdBs.cjs +207 -0
  299. package/dist/requestLogger-BZcXwdBs.cjs.map +1 -0
  300. package/dist/requestLogger-pA4gi3E1.mjs +178 -0
  301. package/dist/requestLogger-pA4gi3E1.mjs.map +1 -0
  302. package/dist/rest-api.cjs +74 -70
  303. package/dist/rest-api.cjs.map +1 -1
  304. package/dist/rest-api.d.cts +69 -58
  305. package/dist/rest-api.d.cts.map +1 -1
  306. package/dist/rest-api.d.mts +69 -58
  307. package/dist/rest-api.d.mts.map +1 -1
  308. package/dist/rest-api.mjs +74 -70
  309. package/dist/rest-api.mjs.map +1 -1
  310. package/dist/runSubscriber-CC_2C9F2.cjs +133 -0
  311. package/dist/runSubscriber-CC_2C9F2.cjs.map +1 -0
  312. package/dist/runSubscriber-DyHWp_Lf.mjs +116 -0
  313. package/dist/runSubscriber-DyHWp_Lf.mjs.map +1 -0
  314. package/dist/shutdown-BMJmAhSt.cjs +38 -0
  315. package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
  316. package/dist/shutdown-C7xa8x9S.mjs +27 -0
  317. package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
  318. package/dist/site.cjs +64 -4
  319. package/dist/site.cjs.map +1 -1
  320. package/dist/site.d.cts +90 -1
  321. package/dist/site.d.cts.map +1 -1
  322. package/dist/site.d.mts +90 -1
  323. package/dist/site.d.mts.map +1 -1
  324. package/dist/site.mjs +62 -6
  325. package/dist/site.mjs.map +1 -1
  326. package/dist/stages-DaTaoQei.d.cts +73 -0
  327. package/dist/stages-DaTaoQei.d.cts.map +1 -0
  328. package/dist/stages-DaTaoQei.d.mts +73 -0
  329. package/dist/stages-DaTaoQei.d.mts.map +1 -0
  330. package/dist/subscribers/index.cjs +134 -1
  331. package/dist/subscribers/index.cjs.map +1 -0
  332. package/dist/subscribers/index.d.cts +74 -3
  333. package/dist/subscribers/index.d.cts.map +1 -0
  334. package/dist/subscribers/index.d.mts +74 -3
  335. package/dist/subscribers/index.d.mts.map +1 -0
  336. package/dist/subscribers/index.mjs +132 -2
  337. package/dist/subscribers/index.mjs.map +1 -0
  338. package/dist/telemetry-B48RLjyk.d.cts +40 -0
  339. package/dist/telemetry-B48RLjyk.d.cts.map +1 -0
  340. package/dist/telemetry-BEoBn6GO.d.mts +40 -0
  341. package/dist/telemetry-BEoBn6GO.d.mts.map +1 -0
  342. package/dist/telemetry.cjs +56 -0
  343. package/dist/telemetry.cjs.map +1 -0
  344. package/dist/telemetry.d.cts +2 -0
  345. package/dist/telemetry.d.mts +2 -0
  346. package/dist/telemetry.mjs +55 -0
  347. package/dist/telemetry.mjs.map +1 -0
  348. package/dist/topic/index.cjs +2 -134
  349. package/dist/topic/index.d.cts +2 -3
  350. package/dist/topic/index.d.mts +2 -3
  351. package/dist/topic/index.mjs +2 -132
  352. package/dist/tracing-Bbj1uoFJ.mjs +127 -0
  353. package/dist/tracing-Bbj1uoFJ.mjs.map +1 -0
  354. package/dist/tracing-C0ooU0V2.cjs +150 -0
  355. package/dist/tracing-C0ooU0V2.cjs.map +1 -0
  356. package/dist/websocket-api.cjs +762 -0
  357. package/dist/websocket-api.cjs.map +1 -0
  358. package/dist/websocket-api.d.cts +443 -0
  359. package/dist/websocket-api.d.cts.map +1 -0
  360. package/dist/websocket-api.d.mts +443 -0
  361. package/dist/websocket-api.d.mts.map +1 -0
  362. package/dist/websocket-api.mjs +748 -0
  363. package/dist/websocket-api.mjs.map +1 -0
  364. package/dist/worker.cjs +140 -32
  365. package/dist/worker.cjs.map +1 -1
  366. package/dist/worker.d.cts +139 -47
  367. package/dist/worker.d.cts.map +1 -1
  368. package/dist/worker.d.mts +139 -47
  369. package/dist/worker.d.mts.map +1 -1
  370. package/dist/worker.mjs +141 -33
  371. package/dist/worker.mjs.map +1 -1
  372. package/package.json +155 -44
  373. package/dist/Construct-BeYVu_QF.mjs.map +0 -1
  374. package/dist/Construct-DfbwIntp.d.cts +0 -115
  375. package/dist/Construct-DfbwIntp.d.cts.map +0 -1
  376. package/dist/Construct-DqdlARxq.cjs.map +0 -1
  377. package/dist/Construct-l5aOn_jv.d.mts +0 -115
  378. package/dist/Construct-l5aOn_jv.d.mts.map +0 -1
  379. package/dist/Cron-DKqnnTdH.d.cts.map +0 -1
  380. package/dist/Cron-SyqS5oWJ.d.mts.map +0 -1
  381. package/dist/CronBuilder-BdnI6lxF.cjs.map +0 -1
  382. package/dist/CronBuilder-CRGnDfTq.d.mts +0 -41
  383. package/dist/CronBuilder-CRGnDfTq.d.mts.map +0 -1
  384. package/dist/CronBuilder-D_0HNBTr.mjs.map +0 -1
  385. package/dist/CronBuilder-Df1q9PNy.d.cts +0 -41
  386. package/dist/CronBuilder-Df1q9PNy.d.cts.map +0 -1
  387. package/dist/Endpoint-BpZHtJ2W.cjs +0 -1689
  388. package/dist/Endpoint-BpZHtJ2W.cjs.map +0 -1
  389. package/dist/Endpoint-C6yyHpRS.d.cts.map +0 -1
  390. package/dist/Endpoint-DuT4TEEq.d.mts.map +0 -1
  391. package/dist/Endpoint-ONsly_dq.mjs +0 -1671
  392. package/dist/Endpoint-ONsly_dq.mjs.map +0 -1
  393. package/dist/EndpointFactory-Bm3aKRdV.mjs.map +0 -1
  394. package/dist/EndpointFactory-CLvWuHyt.cjs.map +0 -1
  395. package/dist/HonoEndpointAdaptor-92zavCsV.cjs.map +0 -1
  396. package/dist/HonoEndpointAdaptor-yYaU7jVJ.mjs.map +0 -1
  397. package/dist/Queue-D9X6OoON.d.mts.map +0 -1
  398. package/dist/Queue-DYPB2KWL.d.cts.map +0 -1
  399. package/dist/Subscriber-C4heaAyO.d.mts +0 -51
  400. package/dist/Subscriber-C4heaAyO.d.mts.map +0 -1
  401. package/dist/Subscriber-CotDUELC.d.cts +0 -51
  402. package/dist/Subscriber-CotDUELC.d.cts.map +0 -1
  403. package/dist/SubscriberBuilder-BEv0eoHy.d.cts +0 -59
  404. package/dist/SubscriberBuilder-BEv0eoHy.d.cts.map +0 -1
  405. package/dist/SubscriberBuilder-C0ZEtGDI.cjs +0 -125
  406. package/dist/SubscriberBuilder-C0ZEtGDI.cjs.map +0 -1
  407. package/dist/SubscriberBuilder-h7B_cHMr.mjs +0 -114
  408. package/dist/SubscriberBuilder-h7B_cHMr.mjs.map +0 -1
  409. package/dist/SubscriberBuilder-tyH5yTk5.d.mts +0 -59
  410. package/dist/SubscriberBuilder-tyH5yTk5.d.mts.map +0 -1
  411. package/dist/Topic-DEVGo0Dm.d.cts +0 -89
  412. package/dist/Topic-DEVGo0Dm.d.cts.map +0 -1
  413. package/dist/Topic-zk_6Gthr.d.mts +0 -89
  414. package/dist/Topic-zk_6Gthr.d.mts.map +0 -1
  415. package/dist/auth.d.cts.map +0 -1
  416. package/dist/auth.d.mts.map +0 -1
  417. package/dist/cache.d.cts.map +0 -1
  418. package/dist/cache.d.mts.map +0 -1
  419. package/dist/construct-interface-DPlxfpoS.d.mts.map +0 -1
  420. package/dist/construct-interface-DgXTJcOD.d.cts.map +0 -1
  421. package/dist/credential.cjs.map +0 -1
  422. package/dist/credential.d.cts.map +0 -1
  423. package/dist/credential.d.mts.map +0 -1
  424. package/dist/credential.mjs.map +0 -1
  425. package/dist/database/kysely.cjs.map +0 -1
  426. package/dist/database/kysely.d.cts.map +0 -1
  427. package/dist/database/kysely.d.mts.map +0 -1
  428. package/dist/database/kysely.mjs.map +0 -1
  429. package/dist/functions-B6qCvfmy.cjs.map +0 -1
  430. package/dist/functions-C53GW2eQ.mjs.map +0 -1
  431. package/dist/index-B2urf3YI.d.cts +0 -26
  432. package/dist/index-B2urf3YI.d.cts.map +0 -1
  433. package/dist/index-BPSZ_Lp_.d.cts.map +0 -1
  434. package/dist/index-BoZ-iisU.d.mts.map +0 -1
  435. package/dist/index-CdaU--_B.d.cts +0 -165
  436. package/dist/index-CdaU--_B.d.cts.map +0 -1
  437. package/dist/index-DMCDvnsM.d.mts +0 -26
  438. package/dist/index-DMCDvnsM.d.mts.map +0 -1
  439. package/dist/index-PQRWOQj4.d.mts +0 -165
  440. package/dist/index-PQRWOQj4.d.mts.map +0 -1
  441. package/dist/lazyAccessors-BHtcqgz2.mjs.map +0 -1
  442. package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +0 -1
  443. package/dist/processAudits-BpRlPQMW.mjs +0 -77
  444. package/dist/processAudits-BpRlPQMW.mjs.map +0 -1
  445. package/dist/processAudits-D_2W5x8k.cjs +0 -88
  446. package/dist/processAudits-D_2W5x8k.cjs.map +0 -1
  447. package/dist/queue/index.cjs.map +0 -1
  448. package/dist/queue/index.d.cts.map +0 -1
  449. package/dist/queue/index.d.mts.map +0 -1
  450. package/dist/queue/index.mjs.map +0 -1
  451. package/dist/telemetry-DGcFlVpB.d.cts.map +0 -1
  452. package/dist/telemetry-DGcFlVpB.d.mts.map +0 -1
  453. package/dist/topic/index.cjs.map +0 -1
  454. package/dist/topic/index.mjs.map +0 -1
@@ -1,190 +1,3 @@
1
- import { t as Construct } from "../Construct-BeYVu_QF.mjs";
2
- import { idsOf, servicesOf } from "../construct-interface.mjs";
3
- import { t as cloneWith } from "../clone-EKNovYHu.mjs";
4
- import { canonicalId, provideKey, serviceKey } from "@geekmidas/manifest";
5
- import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
6
- import { Publisher } from "@geekmidas/events";
7
- //#region src/queue/Queue.ts
8
- /**
9
- * A queue worker — a point-to-point SQS-style queue and its single consumer.
10
- * Unlike a `Subscriber` (topic fan-out, filtered by `subscribedEvents`), a queue
11
- * drains every message of its one `message` type. Build one with `q` (see
12
- * `QueueBuilder`); `gkm build` discovers it into the manifest's `queues` field.
13
- *
14
- * The producer side is {@link Queue.publisher} — a ready-to-inject `Service`
15
- * that any endpoint/function drops into `.services([...])` to send messages.
16
- */
17
- var Queue = class extends Construct {
18
- name;
19
- handler;
20
- messageSchema;
21
- timeout;
22
- services;
23
- logger;
24
- batchSize;
25
- fifo;
26
- __IS_QUEUE__ = true;
27
- static isQueue(obj) {
28
- return Boolean(obj && obj.__IS_QUEUE__ === true && obj.type === "dev.geekmidas.function.queue");
29
- }
30
- /**
31
- * The canonical id this queue is declared under.
32
- *
33
- * Derived from the name rather than given separately, so `emails` and
34
- * `Emails` are one queue. The name stays what it was: it is the wire `type`
35
- * a producer sends and the worker subscribes to, and changing that would
36
- * silently orphan in-flight messages.
37
- */
38
- id;
39
- /**
40
- * The producer's env key. Read by both {@link declare} and
41
- * {@link publisher}, so what the target publishes and what the producer
42
- * looks up cannot drift.
43
- */
44
- connectionKey;
45
- constructor(name, handler, messageSchema, timeout = 3e4, services = [], logger = DEFAULT_LOGGER, batchSize, fifo, constructs = []) {
46
- super("dev.geekmidas.function.queue", logger, services, [], void 0, void 0, timeout, void 0, void 0, constructs);
47
- this.name = name;
48
- this.handler = handler;
49
- this.messageSchema = messageSchema;
50
- this.timeout = timeout;
51
- this.services = services;
52
- this.logger = logger;
53
- this.batchSize = batchSize;
54
- this.fifo = fifo;
55
- this.id = canonicalId(name);
56
- this.connectionKey = provideKey(this.id, "publisherConnectionString");
57
- }
58
- /**
59
- * What this queue is in the manifest.
60
- *
61
- * A queue is a resource, not a handler: the worker is reached *through* it,
62
- * so the declaration carries the producer's key and nothing about the code
63
- * that drains it. The local target reads this to know which broker has to be
64
- * running and what connection string to inject.
65
- */
66
- declare() {
67
- return [{
68
- kind: "queue",
69
- id: this.id,
70
- provides: [this.connectionKey],
71
- ...this.fifo ? { fifo: true } : {},
72
- worker: {
73
- id: `${this.id}Worker`,
74
- handler: `${this.id}.handler`,
75
- dependencies: []
76
- }
77
- }];
78
- }
79
- /**
80
- * The producer side — a `Service` exposing an `EventPublisher` typed to this
81
- * queue's message. Inject it via `.services([queue.publisher])`; the handler
82
- * then calls `services.<name>Publisher.publish([{ type, payload }])`.
83
- *
84
- * It reads `<NAME>_PUBLISHER_CONNECTION_STRING` and builds the transport from
85
- * the URL protocol — `pgboss://` locally, `sqs://` deployed — so the same
86
- * code publishes to Postgres in dev and SQS in prod. Because it's a `Service`,
87
- * `Construct.getEnvironment()` sniffs it, so the env requirement flows into
88
- * the manifest and infra links exactly this queue with least privilege.
89
- */
90
- /**
91
- * The queue as a dependency — what `.dependsOn([emailsQueue])` dissolves
92
- * into, reachable as `services.emails`.
93
- *
94
- * It is the producer: a consumer is the worker written right here, so the
95
- * only thing another construct can want from a queue is the ability to send
96
- * to it. {@link publisher} is the same service under its older
97
- * `<name>Publisher` key, kept for `.services([queue.publisher])`.
98
- */
99
- get service() {
100
- const { register } = this.publisher;
101
- return {
102
- serviceName: serviceKey(this.id),
103
- register
104
- };
105
- }
106
- get publisher() {
107
- const envVar = this.connectionKey;
108
- return {
109
- serviceName: `${this.name}Publisher`,
110
- async register({ envParser }) {
111
- const { connectionString } = envParser.create((get) => ({ connectionString: get(envVar).string() })).parse();
112
- return Publisher.fromConnectionString(connectionString);
113
- }
114
- };
115
- }
116
- };
117
- //#endregion
118
- //#region src/queue/QueueBuilder.ts
119
- /**
120
- * Builds a {@link Queue} worker — `q.queue('orders').services([db]).message(schema).handle(fn)`.
121
- * Services are an array (sniffed for required env vars); `message` is the typed
122
- * job payload; `handle` is the single consumer. The queue name is captured as a
123
- * literal so `queue.publisher` is typed to `{ type: '<name>', payload }`.
124
- */
125
- var QueueBuilder = class {
126
- _name;
127
- _messageSchema;
128
- _timeout = 3e4;
129
- _batchSize;
130
- _fifo;
131
- _services = [];
132
- /** The construct ids `.dependsOn()` named — what the manifest records. */
133
- _constructs = [];
134
- _logger = DEFAULT_LOGGER;
135
- /** The queue name — drives the infra queue and its `<NAME>_*` env vars. */
136
- queue(name) {
137
- return cloneWith(this, { _name: name });
138
- }
139
- timeout(timeout) {
140
- return cloneWith(this, { _timeout: timeout });
141
- }
142
- /** SQS event-source batch size (deployed). */
143
- batchSize(batchSize) {
144
- return cloneWith(this, { _batchSize: batchSize });
145
- }
146
- /** Mark the queue as FIFO (deployed). */
147
- fifo(fifo = true) {
148
- return cloneWith(this, { _fifo: fifo });
149
- }
150
- /**
151
- * Depend on constructs — a database, a bucket, a mail sender, a queue, a
152
- * topic.
153
- *
154
- * It records the edge and dissolves each construct's client into the
155
- * handler's service record under the construct's own id, so
156
- * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
157
- *
158
- * Constructs only. A `Service` does not match the shape, which is what keeps
159
- * env sniffing confined to `.services()` and the explicit lift.
160
- */
161
- dependsOn(constructs) {
162
- const services = servicesOf(constructs);
163
- return cloneWith(this, {
164
- _services: [...this._services, ...services],
165
- _constructs: idsOf(constructs, this._constructs)
166
- });
167
- }
168
- services(services) {
169
- return cloneWith(this, { _services: [...this._services, ...services] });
170
- }
171
- logger(logger) {
172
- return cloneWith(this, { _logger: logger });
173
- }
174
- /** The typed message (job) payload the queue carries. */
175
- message(schema) {
176
- return cloneWith(this, { _messageSchema: schema });
177
- }
178
- handle(fn) {
179
- if (!this._name) throw new Error("Queue requires a name — call .queue(name) before .handle().");
180
- if (!this._messageSchema) throw new Error("Queue requires a message schema — call .message(schema) before .handle().");
181
- return new Queue(this._name, fn, this._messageSchema, this._timeout, this._services, this._logger, this._batchSize, this._fifo, this._constructs);
182
- }
183
- };
184
- //#endregion
185
- //#region src/queue/index.ts
186
- const q = new QueueBuilder();
187
- //#endregion
188
- export { Queue, QueueBuilder, q };
189
-
190
- //# sourceMappingURL=index.mjs.map
1
+ import { t as Queue } from "../Queue-u8w8_HpE.mjs";
2
+ import { n as QueueNeedsMessage, r as QueueNeedsName } from "../QueueBuilder-2wP5lEC8.mjs";
3
+ export { Queue, QueueNeedsMessage, QueueNeedsName };
@@ -0,0 +1,86 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _geekmidas_manifest = require("@geekmidas/manifest");
3
+ //#region src/random-password.ts
4
+ /**
5
+ * `RandomPassword` — a password the platform generates, once per stage.
6
+ *
7
+ * ```ts
8
+ * export const adminPassword = new RandomPassword('AdminPassword');
9
+ *
10
+ * // an endpoint that `.dependsOn([adminPassword])`
11
+ * services.adminPassword // 'k3J…' — a string, no await
12
+ * ```
13
+ *
14
+ * The app's own `secret`: the kind an auth server's signing key already is,
15
+ * with nothing else attached. Nobody issues it and nobody sets it, which is
16
+ * the line between it and a `Credential`:
17
+ *
18
+ * - **A deployed stage** generates it on the first deploy that needs it and
19
+ * keeps it — a server stage in its secrets store, an AWS stage in its
20
+ * state — so every later deploy reads the same value back. One set by hand
21
+ * (`gkm secrets:set`, `sst secret set`) is kept, never replaced.
22
+ * - **`gkm dev` and `gkm test`** derive it from the project, the stage and the
23
+ * id, so nothing has to be set and it is the same on every run.
24
+ *
25
+ * Its key is its name, as a secret's is: `AdminPassword` is `ADMIN_PASSWORD`.
26
+ *
27
+ * 43 letters, digits, `-` and `_` unless told otherwise — for a system with
28
+ * rules of its own:
29
+ *
30
+ * ```ts
31
+ * new RandomPassword('RouterPassword', { length: 24, symbols: '!@#$%' });
32
+ * ```
33
+ *
34
+ * The format is read when the password is generated, so changing it later
35
+ * leaves a deployed stage's existing password as it is.
36
+ */
37
+ var RandomPassword = class {
38
+ format;
39
+ id;
40
+ service;
41
+ /**
42
+ * Declared once and read by both `declare()` and `connect()`, so the key the
43
+ * target publishes and the key the client reads cannot drift.
44
+ */
45
+ key;
46
+ constructor(id, format = {}) {
47
+ this.format = format;
48
+ const canonical = (0, _geekmidas_manifest.canonicalId)(id);
49
+ const { length } = format;
50
+ if (length !== void 0 && !(Number.isInteger(length) && length > 0)) throw new InvalidPasswordLength(canonical, length);
51
+ this.id = canonical;
52
+ this.key = (0, _geekmidas_manifest.environmentCase)(canonical);
53
+ this.service = {
54
+ serviceName: (0, _geekmidas_manifest.serviceKey)(canonical),
55
+ register: (options) => this.connect(options)
56
+ };
57
+ }
58
+ declare() {
59
+ return [{
60
+ kind: "secret",
61
+ id: this.id,
62
+ provides: [this.key],
63
+ ...this.format.length !== void 0 ? { length: this.format.length } : {},
64
+ ...this.format.symbols !== void 0 ? { symbols: this.format.symbols } : {}
65
+ }];
66
+ }
67
+ connect(options) {
68
+ return options.envParser.create((get) => ({ password: get(this.key).string() })).parse().password;
69
+ }
70
+ };
71
+ /** A `RandomPassword` given a length no password can have. */
72
+ var InvalidPasswordLength = class extends Error {
73
+ id;
74
+ length;
75
+ constructor(id, length) {
76
+ super(`${id} asks for a password ${length} characters long. Give it a whole number of characters, at least 1 — or leave length out for 43.`);
77
+ this.id = id;
78
+ this.length = length;
79
+ this.name = "InvalidPasswordLength";
80
+ }
81
+ };
82
+ //#endregion
83
+ exports.InvalidPasswordLength = InvalidPasswordLength;
84
+ exports.RandomPassword = RandomPassword;
85
+
86
+ //# sourceMappingURL=random-password.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-password.cjs","names":["canonicalId","environmentCase","serviceKey"],"sources":["../src/random-password.ts"],"sourcesContent":["/**\n * `RandomPassword` — a password the platform generates, once per stage.\n *\n * ```ts\n * export const adminPassword = new RandomPassword('AdminPassword');\n *\n * // an endpoint that `.dependsOn([adminPassword])`\n * services.adminPassword // 'k3J…' — a string, no await\n * ```\n *\n * The app's own `secret`: the kind an auth server's signing key already is,\n * with nothing else attached. Nobody issues it and nobody sets it, which is\n * the line between it and a `Credential`:\n *\n * - **A deployed stage** generates it on the first deploy that needs it and\n * keeps it — a server stage in its secrets store, an AWS stage in its\n * state — so every later deploy reads the same value back. One set by hand\n * (`gkm secrets:set`, `sst secret set`) is kept, never replaced.\n * - **`gkm dev` and `gkm test`** derive it from the project, the stage and the\n * id, so nothing has to be set and it is the same on every run.\n *\n * Its key is its name, as a secret's is: `AdminPassword` is `ADMIN_PASSWORD`.\n *\n * 43 letters, digits, `-` and `_` unless told otherwise — for a system with\n * rules of its own:\n *\n * ```ts\n * new RandomPassword('RouterPassword', { length: 24, symbols: '!@#$%' });\n * ```\n *\n * The format is read when the password is generated, so changing it later\n * leaves a deployed stage's existing password as it is.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tenvironmentCase,\n\ttype SecretFormat,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport type { Construct } from './construct-interface';\n\nexport class RandomPassword<TName extends string = string>\n\timplements Construct<TName, string>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, string>;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the key the\n\t * target publishes and the key the client reads cannot drift.\n\t */\n\tprivate readonly key: string;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly format: RandomPasswordOptions = {},\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\t\tconst { length } = format;\n\n\t\tif (length !== undefined && !(Number.isInteger(length) && length > 0)) {\n\t\t\tthrow new InvalidPasswordLength(canonical, length);\n\t\t}\n\n\t\tthis.id = canonical as TName;\n\t\tthis.key = environmentCase(canonical);\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: 'secret',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.key],\n\t\t\t\t...(this.format.length !== undefined\n\t\t\t\t\t? { length: this.format.length }\n\t\t\t\t\t: {}),\n\t\t\t\t...(this.format.symbols !== undefined\n\t\t\t\t\t? { symbols: this.format.symbols }\n\t\t\t\t\t: {}),\n\t\t\t},\n\t\t];\n\t}\n\n\tprivate connect(options: ServiceRegisterOptions): string {\n\t\treturn options.envParser\n\t\t\t.create((get) => ({ password: get(this.key).string() }))\n\t\t\t.parse().password;\n\t}\n}\n\n/**\n * What a password is drawn as. Letters and digits always; `symbols` beside\n * them, one of which is always present.\n */\nexport type RandomPasswordOptions = SecretFormat;\n\n/** A `RandomPassword` given a length no password can have. */\nexport class InvalidPasswordLength extends Error {\n\tconstructor(\n\t\treadonly id: string,\n\t\treadonly length: number,\n\t) {\n\t\tsuper(\n\t\t\t`${id} asks for a password ${length} characters long. ` +\n\t\t\t\t'Give it a whole number of characters, at least 1 — or leave length out for 43.',\n\t\t);\n\t\tthis.name = 'InvalidPasswordLength';\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAa,iBAAb,MAEA;CAYmB;CAXlB;CACA;;;;;CAMA;CAEA,YACC,IACA,SAAiD,CAAC,GACjD;EADgB,KAAA,SAAA;EAEjB,MAAM,aAAA,GAAYA,oBAAAA,YAAAA,CAAY,EAAY;EAC1C,MAAM,EAAE,WAAW;EAEnB,IAAI,WAAW,KAAA,KAAa,EAAE,OAAO,UAAU,MAAM,KAAK,SAAS,IAClE,MAAM,IAAI,sBAAsB,WAAW,MAAM;EAGlD,KAAK,KAAK;EACV,KAAK,OAAA,GAAMC,oBAAAA,gBAAAA,CAAgB,SAAS;EAGpC,KAAK,UAAU;GACd,cAAA,GAAaC,oBAAAA,WAAAA,CAAW,SAAS;GACjC,WAAW,YAAY,KAAK,QAAQ,OAAO;EAC5C;CACD;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,GAAG;GACnB,GAAI,KAAK,OAAO,WAAW,KAAA,IACxB,EAAE,QAAQ,KAAK,OAAO,OAAO,IAC7B,CAAC;GACJ,GAAI,KAAK,OAAO,YAAY,KAAA,IACzB,EAAE,SAAS,KAAK,OAAO,QAAQ,IAC/B,CAAC;EACL,CACD;CACD;CAEA,QAAgB,SAAyC;EACxD,OAAO,QAAQ,UACb,QAAQ,SAAS,EAAE,UAAU,IAAI,KAAK,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACvD,MAAM,CAAC,CAAC;CACX;AACD;;AASA,IAAa,wBAAb,cAA2C,MAAM;CAEtC;CACA;CAFV,YACC,IACA,QACC;EACD,MACC,GAAG,GAAG,uBAAuB,OAAO,iGAErC;EANS,KAAA,KAAA;EACA,KAAA,SAAA;EAMT,KAAK,OAAO;CACb;AACD"}
@@ -0,0 +1,30 @@
1
+ import { n as Construct } from "./construct-interface-B1AfqRl4.cjs";
2
+ import { Service } from "@geekmidas/services";
3
+ import { ConstructName, Declaration, SecretFormat } from "@geekmidas/manifest";
4
+ //#region src/random-password.d.ts
5
+ export declare class RandomPassword<TName extends string = string> implements Construct<TName, string> {
6
+ private readonly format;
7
+ readonly id: TName;
8
+ readonly service: Service<Uncapitalize<TName>, string>;
9
+ /**
10
+ * Declared once and read by both `declare()` and `connect()`, so the key the
11
+ * target publishes and the key the client reads cannot drift.
12
+ */
13
+ private readonly key;
14
+ constructor(id: ConstructName<TName>, format?: RandomPasswordOptions);
15
+ declare(): Declaration[];
16
+ private connect;
17
+ }
18
+ /**
19
+ * What a password is drawn as. Letters and digits always; `symbols` beside
20
+ * them, one of which is always present.
21
+ */
22
+ export type RandomPasswordOptions = SecretFormat;
23
+ /** A `RandomPassword` given a length no password can have. */
24
+ export declare class InvalidPasswordLength extends Error {
25
+ readonly id: string;
26
+ readonly length: number;
27
+ constructor(id: string, length: number);
28
+ }
29
+ //#endregion
30
+ //# sourceMappingURL=random-password.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-password.d.cts","names":[],"sources":["../src/random-password.ts"],"mappings":";;;;qBA6Ca,eAAe,0CAChB,UAAU;mBAaH;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa;;;;;mBAMtB;EAEjB,YACC,IAAI,cAAc,QACD,SAAQ;EAmB1B,WAAW;UAgBH;;;;;;YAWG,wBAAwB;;qBAGvB,8BAA8B;WAEhC;WACA;EAFV,YACU,YACA"}
@@ -0,0 +1,30 @@
1
+ import { n as Construct } from "./construct-interface-ZvYQbivO.mjs";
2
+ import { ConstructName, Declaration, SecretFormat } from "@geekmidas/manifest";
3
+ import { Service } from "@geekmidas/services";
4
+ //#region src/random-password.d.ts
5
+ export declare class RandomPassword<TName extends string = string> implements Construct<TName, string> {
6
+ private readonly format;
7
+ readonly id: TName;
8
+ readonly service: Service<Uncapitalize<TName>, string>;
9
+ /**
10
+ * Declared once and read by both `declare()` and `connect()`, so the key the
11
+ * target publishes and the key the client reads cannot drift.
12
+ */
13
+ private readonly key;
14
+ constructor(id: ConstructName<TName>, format?: RandomPasswordOptions);
15
+ declare(): Declaration[];
16
+ private connect;
17
+ }
18
+ /**
19
+ * What a password is drawn as. Letters and digits always; `symbols` beside
20
+ * them, one of which is always present.
21
+ */
22
+ export type RandomPasswordOptions = SecretFormat;
23
+ /** A `RandomPassword` given a length no password can have. */
24
+ export declare class InvalidPasswordLength extends Error {
25
+ readonly id: string;
26
+ readonly length: number;
27
+ constructor(id: string, length: number);
28
+ }
29
+ //#endregion
30
+ //# sourceMappingURL=random-password.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-password.d.mts","names":[],"sources":["../src/random-password.ts"],"mappings":";;;;qBA6Ca,eAAe,0CAChB,UAAU;mBAaH;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa;;;;;mBAMtB;EAEjB,YACC,IAAI,cAAc,QACD,SAAQ;EAmB1B,WAAW;UAgBH;;;;;;YAWG,wBAAwB;;qBAGvB,8BAA8B;WAEhC;WACA;EAFV,YACU,YACA"}
@@ -0,0 +1,84 @@
1
+ import { canonicalId, environmentCase, serviceKey } from "@geekmidas/manifest";
2
+ //#region src/random-password.ts
3
+ /**
4
+ * `RandomPassword` — a password the platform generates, once per stage.
5
+ *
6
+ * ```ts
7
+ * export const adminPassword = new RandomPassword('AdminPassword');
8
+ *
9
+ * // an endpoint that `.dependsOn([adminPassword])`
10
+ * services.adminPassword // 'k3J…' — a string, no await
11
+ * ```
12
+ *
13
+ * The app's own `secret`: the kind an auth server's signing key already is,
14
+ * with nothing else attached. Nobody issues it and nobody sets it, which is
15
+ * the line between it and a `Credential`:
16
+ *
17
+ * - **A deployed stage** generates it on the first deploy that needs it and
18
+ * keeps it — a server stage in its secrets store, an AWS stage in its
19
+ * state — so every later deploy reads the same value back. One set by hand
20
+ * (`gkm secrets:set`, `sst secret set`) is kept, never replaced.
21
+ * - **`gkm dev` and `gkm test`** derive it from the project, the stage and the
22
+ * id, so nothing has to be set and it is the same on every run.
23
+ *
24
+ * Its key is its name, as a secret's is: `AdminPassword` is `ADMIN_PASSWORD`.
25
+ *
26
+ * 43 letters, digits, `-` and `_` unless told otherwise — for a system with
27
+ * rules of its own:
28
+ *
29
+ * ```ts
30
+ * new RandomPassword('RouterPassword', { length: 24, symbols: '!@#$%' });
31
+ * ```
32
+ *
33
+ * The format is read when the password is generated, so changing it later
34
+ * leaves a deployed stage's existing password as it is.
35
+ */
36
+ var RandomPassword = class {
37
+ format;
38
+ id;
39
+ service;
40
+ /**
41
+ * Declared once and read by both `declare()` and `connect()`, so the key the
42
+ * target publishes and the key the client reads cannot drift.
43
+ */
44
+ key;
45
+ constructor(id, format = {}) {
46
+ this.format = format;
47
+ const canonical = canonicalId(id);
48
+ const { length } = format;
49
+ if (length !== void 0 && !(Number.isInteger(length) && length > 0)) throw new InvalidPasswordLength(canonical, length);
50
+ this.id = canonical;
51
+ this.key = environmentCase(canonical);
52
+ this.service = {
53
+ serviceName: serviceKey(canonical),
54
+ register: (options) => this.connect(options)
55
+ };
56
+ }
57
+ declare() {
58
+ return [{
59
+ kind: "secret",
60
+ id: this.id,
61
+ provides: [this.key],
62
+ ...this.format.length !== void 0 ? { length: this.format.length } : {},
63
+ ...this.format.symbols !== void 0 ? { symbols: this.format.symbols } : {}
64
+ }];
65
+ }
66
+ connect(options) {
67
+ return options.envParser.create((get) => ({ password: get(this.key).string() })).parse().password;
68
+ }
69
+ };
70
+ /** A `RandomPassword` given a length no password can have. */
71
+ var InvalidPasswordLength = class extends Error {
72
+ id;
73
+ length;
74
+ constructor(id, length) {
75
+ super(`${id} asks for a password ${length} characters long. Give it a whole number of characters, at least 1 — or leave length out for 43.`);
76
+ this.id = id;
77
+ this.length = length;
78
+ this.name = "InvalidPasswordLength";
79
+ }
80
+ };
81
+ //#endregion
82
+ export { InvalidPasswordLength, RandomPassword };
83
+
84
+ //# sourceMappingURL=random-password.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-password.mjs","names":[],"sources":["../src/random-password.ts"],"sourcesContent":["/**\n * `RandomPassword` — a password the platform generates, once per stage.\n *\n * ```ts\n * export const adminPassword = new RandomPassword('AdminPassword');\n *\n * // an endpoint that `.dependsOn([adminPassword])`\n * services.adminPassword // 'k3J…' — a string, no await\n * ```\n *\n * The app's own `secret`: the kind an auth server's signing key already is,\n * with nothing else attached. Nobody issues it and nobody sets it, which is\n * the line between it and a `Credential`:\n *\n * - **A deployed stage** generates it on the first deploy that needs it and\n * keeps it — a server stage in its secrets store, an AWS stage in its\n * state — so every later deploy reads the same value back. One set by hand\n * (`gkm secrets:set`, `sst secret set`) is kept, never replaced.\n * - **`gkm dev` and `gkm test`** derive it from the project, the stage and the\n * id, so nothing has to be set and it is the same on every run.\n *\n * Its key is its name, as a secret's is: `AdminPassword` is `ADMIN_PASSWORD`.\n *\n * 43 letters, digits, `-` and `_` unless told otherwise — for a system with\n * rules of its own:\n *\n * ```ts\n * new RandomPassword('RouterPassword', { length: 24, symbols: '!@#$%' });\n * ```\n *\n * The format is read when the password is generated, so changing it later\n * leaves a deployed stage's existing password as it is.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tenvironmentCase,\n\ttype SecretFormat,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport type { Construct } from './construct-interface';\n\nexport class RandomPassword<TName extends string = string>\n\timplements Construct<TName, string>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, string>;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the key the\n\t * target publishes and the key the client reads cannot drift.\n\t */\n\tprivate readonly key: string;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly format: RandomPasswordOptions = {},\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\t\tconst { length } = format;\n\n\t\tif (length !== undefined && !(Number.isInteger(length) && length > 0)) {\n\t\t\tthrow new InvalidPasswordLength(canonical, length);\n\t\t}\n\n\t\tthis.id = canonical as TName;\n\t\tthis.key = environmentCase(canonical);\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: 'secret',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.key],\n\t\t\t\t...(this.format.length !== undefined\n\t\t\t\t\t? { length: this.format.length }\n\t\t\t\t\t: {}),\n\t\t\t\t...(this.format.symbols !== undefined\n\t\t\t\t\t? { symbols: this.format.symbols }\n\t\t\t\t\t: {}),\n\t\t\t},\n\t\t];\n\t}\n\n\tprivate connect(options: ServiceRegisterOptions): string {\n\t\treturn options.envParser\n\t\t\t.create((get) => ({ password: get(this.key).string() }))\n\t\t\t.parse().password;\n\t}\n}\n\n/**\n * What a password is drawn as. Letters and digits always; `symbols` beside\n * them, one of which is always present.\n */\nexport type RandomPasswordOptions = SecretFormat;\n\n/** A `RandomPassword` given a length no password can have. */\nexport class InvalidPasswordLength extends Error {\n\tconstructor(\n\t\treadonly id: string,\n\t\treadonly length: number,\n\t) {\n\t\tsuper(\n\t\t\t`${id} asks for a password ${length} characters long. ` +\n\t\t\t\t'Give it a whole number of characters, at least 1 — or leave length out for 43.',\n\t\t);\n\t\tthis.name = 'InvalidPasswordLength';\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAa,iBAAb,MAEA;CAYmB;CAXlB;CACA;;;;;CAMA;CAEA,YACC,IACA,SAAiD,CAAC,GACjD;EADgB,KAAA,SAAA;EAEjB,MAAM,YAAY,YAAY,EAAY;EAC1C,MAAM,EAAE,WAAW;EAEnB,IAAI,WAAW,KAAA,KAAa,EAAE,OAAO,UAAU,MAAM,KAAK,SAAS,IAClE,MAAM,IAAI,sBAAsB,WAAW,MAAM;EAGlD,KAAK,KAAK;EACV,KAAK,MAAM,gBAAgB,SAAS;EAGpC,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,GAAG;GACnB,GAAI,KAAK,OAAO,WAAW,KAAA,IACxB,EAAE,QAAQ,KAAK,OAAO,OAAO,IAC7B,CAAC;GACJ,GAAI,KAAK,OAAO,YAAY,KAAA,IACzB,EAAE,SAAS,KAAK,OAAO,QAAQ,IAC/B,CAAC;EACL,CACD;CACD;CAEA,QAAgB,SAAyC;EACxD,OAAO,QAAQ,UACb,QAAQ,SAAS,EAAE,UAAU,IAAI,KAAK,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACvD,MAAM,CAAC,CAAC;CACX;AACD;;AASA,IAAa,wBAAb,cAA2C,MAAM;CAEtC;CACA;CAFV,YACC,IACA,QACC;EACD,MACC,GAAG,GAAG,uBAAuB,OAAO,iGAErC;EANS,KAAA,KAAA;EACA,KAAA,SAAA;EAMT,KAAK,OAAO;CACb;AACD"}
@@ -1,41 +1,5 @@
1
+ import { HttpError } from "@geekmidas/errors";
1
2
  import { getCookie } from "hono/cookie";
2
- //#region src/publisher.ts
3
- async function publishEvents(logger, serviceDiscovery, ev = [], response, publisherService) {
4
- try {
5
- if (!ev?.length) {
6
- logger.debug("No events to publish");
7
- return;
8
- }
9
- if (!publisherService) {
10
- logger.warn("No publisher service available");
11
- return;
12
- }
13
- const publisher = (await serviceDiscovery.register([publisherService]))[publisherService.serviceName];
14
- const events = [];
15
- for (const { when, payload, type, ...e } of ev) {
16
- logger.debug({ event: type }, "Processing event");
17
- const resolvedPayload = await payload(response);
18
- const event = {
19
- ...e,
20
- type,
21
- payload: resolvedPayload
22
- };
23
- if (!when || when(response)) events.push(event);
24
- }
25
- if (events.length) {
26
- logger.debug({ eventCount: ev.length }, "Publishing events");
27
- await publisher.publish(events).catch((err) => {
28
- logger.error(err, "Failed to publish events");
29
- });
30
- }
31
- } catch (error) {
32
- logger.error(error, "Something went wrong publishing events");
33
- }
34
- }
35
- async function publishConstructEvents(construct, response, serviceDiscovery, logger = construct.logger) {
36
- return publishEvents(logger, serviceDiscovery, construct.events, response, construct.publisherService);
37
- }
38
- //#endregion
39
3
  //#region src/endpoints/lazyAccessors.ts
40
4
  /**
41
5
  * Create a lazy header accessor for Hono.
@@ -206,6 +170,102 @@ function createNoopCookies() {
206
170
  });
207
171
  }
208
172
  //#endregion
209
- export { createHonoHeaders as a, createObjectHeaders as c, createHonoCookies as i, publishConstructEvents as l, createApiGatewayHeaders as n, createNoopCookies as o, createCookieHeaderAccessor as r, createNoopHeaders as s, createApiGatewayCookies as t, publishEvents as u };
173
+ //#region src/endpoints/readRequestBody.ts
174
+ /**
175
+ * The media types an endpoint's `.body()` schema can be handed — as written
176
+ * in the 415 a request in any other type is answered with.
177
+ */
178
+ const SUPPORTED_BODY_TYPES = [
179
+ "application/json",
180
+ "application/x-www-form-urlencoded",
181
+ "multipart/form-data",
182
+ "text/*"
183
+ ];
184
+ /**
185
+ * A request whose body is in a media type no endpoint reads — XML, a bare
186
+ * octet stream. Answered with a 415, before the body schema runs.
187
+ */
188
+ var UnsupportedRequestContentType = class extends HttpError {
189
+ contentType;
190
+ constructor(contentType) {
191
+ super(415, `A body sent as '${contentType}' can't be read. Send it as ${SUPPORTED_BODY_TYPES.join(", ")}.`, {
192
+ statusMessage: "Unsupported Media Type",
193
+ details: {
194
+ contentType,
195
+ supported: [...SUPPORTED_BODY_TYPES]
196
+ }
197
+ });
198
+ this.contentType = contentType;
199
+ this.name = "UnsupportedRequestContentType";
200
+ }
201
+ };
202
+ /**
203
+ * A body that says it is JSON and is not. Answered with a 400 — the request
204
+ * is broken, not merely invalid against the schema.
205
+ */
206
+ var MalformedRequestBody = class extends HttpError {
207
+ contentType;
208
+ constructor(contentType, cause) {
209
+ super(400, `The body says it is '${contentType}' but can't be parsed as that. Send a well-formed body, with the Content-Type it is written in.`, { cause });
210
+ this.contentType = contentType;
211
+ this.name = "MalformedRequestBody";
212
+ }
213
+ };
214
+ /**
215
+ * A request body, read by its Content-Type into what an endpoint's `.body()`
216
+ * schema validates — the one place every adaptor reads a body:
217
+ *
218
+ * - `application/json` (and `application/*+json`) — the parsed JSON.
219
+ * - `application/x-www-form-urlencoded` and `multipart/form-data` — a plain
220
+ * object of fields, as an HTML form posts them. A repeated field, or one
221
+ * named `field[]`, is an array; a file part is a `File`.
222
+ * - `text/*` — the text.
223
+ *
224
+ * Anything else is an {@link UnsupportedRequestContentType}.
225
+ */
226
+ async function readRequestBody(source, contentType, options) {
227
+ const mediaType = contentType?.split(";")[0]?.trim().toLowerCase();
228
+ if (!mediaType) {
229
+ if (options.untyped === "empty") return {};
230
+ return readJson(source, "application/json");
231
+ }
232
+ if (isJson(mediaType)) return readJson(source, mediaType);
233
+ if (mediaType === "application/x-www-form-urlencoded" || mediaType === "multipart/form-data") return formFields(await readForm(source, mediaType));
234
+ if (mediaType.startsWith("text/")) return source.text();
235
+ throw new UnsupportedRequestContentType(mediaType);
236
+ }
237
+ function isJson(mediaType) {
238
+ return mediaType === "application/json" || mediaType.startsWith("application/") && mediaType.endsWith("+json");
239
+ }
240
+ async function readJson(source, mediaType) {
241
+ try {
242
+ return await source.json();
243
+ } catch (error) {
244
+ throw new MalformedRequestBody(mediaType, error);
245
+ }
246
+ }
247
+ async function readForm(source, mediaType) {
248
+ try {
249
+ return await source.formData();
250
+ } catch (error) {
251
+ throw new MalformedRequestBody(mediaType, error);
252
+ }
253
+ }
254
+ /**
255
+ * A form's fields as an object, the way Hono's `parseBody({ all: true })`
256
+ * reads them. Without a prototype, so a field named `__proto__` is a field.
257
+ */
258
+ function formFields(form) {
259
+ const fields = Object.create(null);
260
+ for (const [key, value] of form.entries()) {
261
+ const existing = fields[key];
262
+ if (existing === void 0) fields[key] = key.endsWith("[]") ? [value] : value;
263
+ else if (Array.isArray(existing)) existing.push(value);
264
+ else fields[key] = [existing, value];
265
+ }
266
+ return fields;
267
+ }
268
+ //#endregion
269
+ export { createApiGatewayCookies as a, createHonoCookies as c, createNoopHeaders as d, createObjectHeaders as f, readRequestBody as i, createHonoHeaders as l, SUPPORTED_BODY_TYPES as n, createApiGatewayHeaders as o, UnsupportedRequestContentType as r, createCookieHeaderAccessor as s, MalformedRequestBody as t, createNoopCookies as u };
210
270
 
211
- //# sourceMappingURL=lazyAccessors-BHtcqgz2.mjs.map
271
+ //# sourceMappingURL=readRequestBody-BTIl3k-D.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readRequestBody-BTIl3k-D.mjs","names":[],"sources":["../src/endpoints/lazyAccessors.ts","../src/endpoints/readRequestBody.ts"],"sourcesContent":["/**\n * Lazy header and cookie accessors for different adaptors.\n *\n * Instead of parsing all headers/cookies upfront, these accessors\n * use native adaptor methods for single lookups and only parse\n * everything when `header()` or `cookie()` is called without arguments.\n */\nimport type { Context } from 'hono';\nimport { getCookie } from 'hono/cookie';\nimport type { CookieFn, HeaderFn } from './Endpoint';\n\n/**\n * Create a lazy header accessor for Hono.\n * Uses `c.req.header(name)` for single lookups (native, case-insensitive).\n * Only calls `c.req.header()` to get all headers when needed.\n */\nexport function createHonoHeaders(c: Context): HeaderFn {\n\tlet allHeaders: Record<string, string> | null = null;\n\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) {\n\t\t\t// Single header lookup - use native Hono method (case-insensitive)\n\t\t\treturn c.req.header(key);\n\t\t}\n\t\t// Get all headers - cache the result\n\t\tif (!allHeaders) {\n\t\t\tallHeaders = c.req.header();\n\t\t}\n\t\treturn allHeaders;\n\t}) as HeaderFn;\n}\n\n/**\n * Create a lazy cookie accessor for Hono.\n * Uses `getCookie(c, name)` for single lookups (native).\n * Only parses the cookie header when all cookies are requested.\n */\nexport function createHonoCookies(c: Context): CookieFn {\n\tlet allCookies: Record<string, string> | null = null;\n\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) {\n\t\t\t// Single cookie lookup - use native Hono method\n\t\t\treturn getCookie(c, name);\n\t\t}\n\t\t// Get all cookies - parse and cache\n\t\tif (!allCookies) {\n\t\t\tallCookies = {};\n\t\t\tconst cookieHeader = c.req.header('cookie');\n\t\t\tif (cookieHeader) {\n\t\t\t\tfor (const part of cookieHeader.split(';')) {\n\t\t\t\t\tconst trimmed = part.trim();\n\t\t\t\t\tconst eqIndex = trimmed.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = trimmed.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = trimmed.slice(eqIndex + 1);\n\t\t\t\t\t\tallCookies[key] = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn allCookies;\n\t}) as CookieFn;\n}\n\n/**\n * Create a lazy header accessor for API Gateway events.\n * Handles case-insensitive lookups.\n */\nexport function createApiGatewayHeaders(\n\theaders: Record<string, string | undefined> | null | undefined,\n): HeaderFn {\n\tlet normalizedHeaders: Record<string, string> | null = null;\n\n\tconst normalize = () => {\n\t\tif (!normalizedHeaders) {\n\t\t\tnormalizedHeaders = {};\n\t\t\tif (headers) {\n\t\t\t\tfor (const [k, v] of Object.entries(headers)) {\n\t\t\t\t\tif (v !== undefined) {\n\t\t\t\t\t\tnormalizedHeaders[k.toLowerCase()] = v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn normalizedHeaders;\n\t};\n\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) {\n\t\t\t// Try direct lookup first (common case: headers already lowercase)\n\t\t\tif (headers) {\n\t\t\t\tconst direct = headers[key] ?? headers[key.toLowerCase()];\n\t\t\t\tif (direct !== undefined) return direct;\n\t\t\t\t// Fall back to normalized lookup\n\t\t\t\treturn normalize()[key.toLowerCase()];\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t\treturn normalize();\n\t}) as HeaderFn;\n}\n\n/**\n * Create a lazy cookie accessor for API Gateway events.\n * Decodes URL-encoded values to match browser behavior.\n */\nexport function createApiGatewayCookies(\n\tcookies: string[] | undefined,\n\tcookieHeader: string | undefined,\n): CookieFn {\n\tlet parsed: Record<string, string> | null = null;\n\n\tconst parse = () => {\n\t\tif (!parsed) {\n\t\t\tparsed = {};\n\t\t\t// API Gateway v2 provides cookies as array\n\t\t\tif (cookies) {\n\t\t\t\tfor (const cookie of cookies) {\n\t\t\t\t\tconst eqIndex = cookie.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = cookie.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = cookie.slice(eqIndex + 1);\n\t\t\t\t\t\tparsed[key] = decodeURIComponent(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (cookieHeader) {\n\t\t\t\t// Fall back to parsing cookie header\n\t\t\t\tfor (const part of cookieHeader.split(';')) {\n\t\t\t\t\tconst trimmed = part.trim();\n\t\t\t\t\tconst eqIndex = trimmed.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = trimmed.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = trimmed.slice(eqIndex + 1);\n\t\t\t\t\t\tparsed[key] = decodeURIComponent(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parsed;\n\t};\n\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) {\n\t\t\treturn parse()[name];\n\t\t}\n\t\treturn parse();\n\t}) as CookieFn;\n}\n\n/**\n * Create a lazy header accessor for plain object headers (test adaptor, etc).\n * Headers are already available as an object, just provide lazy access.\n */\nexport function createObjectHeaders(\n\theaders: Record<string, string> | undefined,\n): HeaderFn {\n\tlet normalized: Record<string, string> | null = null;\n\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) {\n\t\t\t// Try direct lookup first (common case)\n\t\t\tif (headers) {\n\t\t\t\tconst direct = headers[key] ?? headers[key.toLowerCase()];\n\t\t\t\tif (direct !== undefined) return direct;\n\t\t\t}\n\t\t\t// Fall back to normalized lookup for case-insensitivity\n\t\t\tif (!normalized && headers) {\n\t\t\t\tnormalized = {};\n\t\t\t\tfor (const [k, v] of Object.entries(headers)) {\n\t\t\t\t\tnormalized[k.toLowerCase()] = v;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn normalized?.[key.toLowerCase()];\n\t\t}\n\t\t// Return all headers\n\t\tif (!normalized && headers) {\n\t\t\tnormalized = {};\n\t\t\tfor (const [k, v] of Object.entries(headers)) {\n\t\t\t\tnormalized[k.toLowerCase()] = v;\n\t\t\t}\n\t\t}\n\t\treturn normalized ?? {};\n\t}) as HeaderFn;\n}\n\n/**\n * Create a lazy cookie accessor from a cookie header string.\n * Decodes URL-encoded values to match browser behavior.\n */\nexport function createCookieHeaderAccessor(\n\tcookieHeader: string | undefined,\n): CookieFn {\n\tlet parsed: Record<string, string> | null = null;\n\n\tconst parse = () => {\n\t\tif (!parsed) {\n\t\t\tparsed = {};\n\t\t\tif (cookieHeader) {\n\t\t\t\tfor (const part of cookieHeader.split(';')) {\n\t\t\t\t\tconst trimmed = part.trim();\n\t\t\t\t\tconst eqIndex = trimmed.indexOf('=');\n\t\t\t\t\tif (eqIndex > 0) {\n\t\t\t\t\t\tconst key = trimmed.slice(0, eqIndex);\n\t\t\t\t\t\tconst value = trimmed.slice(eqIndex + 1);\n\t\t\t\t\t\t// Decode URL-encoded values to match Endpoint.createCookies behavior\n\t\t\t\t\t\tparsed[key] = decodeURIComponent(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parsed;\n\t};\n\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) {\n\t\t\treturn parse()[name];\n\t\t}\n\t\treturn parse();\n\t}) as CookieFn;\n}\n\n/**\n * Create a no-op header accessor (for minimal endpoints that don't use headers).\n */\nexport function createNoopHeaders(): HeaderFn {\n\treturn ((key?: string) => {\n\t\tif (key !== undefined) return undefined;\n\t\treturn {};\n\t}) as HeaderFn;\n}\n\n/**\n * Create a no-op cookie accessor (for minimal endpoints that don't use cookies).\n */\nexport function createNoopCookies(): CookieFn {\n\treturn ((name?: string) => {\n\t\tif (name !== undefined) return undefined;\n\t\treturn {};\n\t}) as CookieFn;\n}\n","import { HttpError } from '@geekmidas/errors';\n\n/**\n * The media types an endpoint's `.body()` schema can be handed — as written\n * in the 415 a request in any other type is answered with.\n */\nexport const SUPPORTED_BODY_TYPES = [\n\t'application/json',\n\t'application/x-www-form-urlencoded',\n\t'multipart/form-data',\n\t'text/*',\n] as const;\n\n/**\n * A request whose body is in a media type no endpoint reads — XML, a bare\n * octet stream. Answered with a 415, before the body schema runs.\n */\nexport class UnsupportedRequestContentType extends HttpError {\n\tconstructor(readonly contentType: string) {\n\t\tsuper(\n\t\t\t415,\n\t\t\t`A body sent as '${contentType}' can't be read. Send it as ${SUPPORTED_BODY_TYPES.join(', ')}.`,\n\t\t\t{\n\t\t\t\tstatusMessage: 'Unsupported Media Type',\n\t\t\t\tdetails: { contentType, supported: [...SUPPORTED_BODY_TYPES] },\n\t\t\t},\n\t\t);\n\t\tthis.name = 'UnsupportedRequestContentType';\n\t}\n}\n\n/**\n * A body that says it is JSON and is not. Answered with a 400 — the request\n * is broken, not merely invalid against the schema.\n */\nexport class MalformedRequestBody extends HttpError {\n\tconstructor(\n\t\treadonly contentType: string,\n\t\tcause?: Error,\n\t) {\n\t\tsuper(\n\t\t\t400,\n\t\t\t`The body says it is '${contentType}' but can't be parsed as that. Send a well-formed body, with the Content-Type it is written in.`,\n\t\t\t{ cause },\n\t\t);\n\t\tthis.name = 'MalformedRequestBody';\n\t}\n}\n\n/**\n * What a body is read from: a `Request`, or Hono's request — which caches\n * what it read, so a later reader is not handed a spent stream.\n */\nexport interface RequestBodySource {\n\tjson(): Promise<unknown>;\n\ttext(): Promise<string>;\n\tformData(): Promise<FormData>;\n}\n\nexport interface ReadRequestBodyOptions {\n\t/**\n\t * A body with no Content-Type: read as JSON (`'json'`, what API Gateway\n\t * has always done), or not read at all and handed to the schema as `{}`\n\t * (`'empty'`, what a Hono server has always done).\n\t */\n\tuntyped: 'json' | 'empty';\n}\n\n/**\n * A request body, read by its Content-Type into what an endpoint's `.body()`\n * schema validates — the one place every adaptor reads a body:\n *\n * - `application/json` (and `application/*+json`) — the parsed JSON.\n * - `application/x-www-form-urlencoded` and `multipart/form-data` — a plain\n * object of fields, as an HTML form posts them. A repeated field, or one\n * named `field[]`, is an array; a file part is a `File`.\n * - `text/*` — the text.\n *\n * Anything else is an {@link UnsupportedRequestContentType}.\n */\nexport async function readRequestBody(\n\tsource: RequestBodySource,\n\tcontentType: string | null | undefined,\n\toptions: ReadRequestBodyOptions,\n): Promise<unknown> {\n\tconst mediaType = contentType?.split(';')[0]?.trim().toLowerCase();\n\n\tif (!mediaType) {\n\t\tif (options.untyped === 'empty') return {};\n\t\treturn readJson(source, 'application/json');\n\t}\n\n\tif (isJson(mediaType)) return readJson(source, mediaType);\n\n\tif (\n\t\tmediaType === 'application/x-www-form-urlencoded' ||\n\t\tmediaType === 'multipart/form-data'\n\t) {\n\t\treturn formFields(await readForm(source, mediaType));\n\t}\n\n\tif (mediaType.startsWith('text/')) return source.text();\n\n\tthrow new UnsupportedRequestContentType(mediaType);\n}\n\nfunction isJson(mediaType: string): boolean {\n\treturn (\n\t\tmediaType === 'application/json' ||\n\t\t(mediaType.startsWith('application/') && mediaType.endsWith('+json'))\n\t);\n}\n\nasync function readJson(\n\tsource: RequestBodySource,\n\tmediaType: string,\n): Promise<unknown> {\n\ttry {\n\t\treturn await source.json();\n\t} catch (error) {\n\t\tthrow new MalformedRequestBody(mediaType, error as Error);\n\t}\n}\n\nasync function readForm(\n\tsource: RequestBodySource,\n\tmediaType: string,\n): Promise<FormData> {\n\ttry {\n\t\treturn await source.formData();\n\t} catch (error) {\n\t\tthrow new MalformedRequestBody(mediaType, error as Error);\n\t}\n}\n\n/** A form field's value: its text, or a `File` for a file part. */\ntype FormValue = NonNullable<ReturnType<FormData['get']>>;\n\n/**\n * A form's fields as an object, the way Hono's `parseBody({ all: true })`\n * reads them. Without a prototype, so a field named `__proto__` is a field.\n */\nfunction formFields(form: FormData): Record<string, FormValue | FormValue[]> {\n\tconst fields: Record<string, FormValue | FormValue[]> = Object.create(null);\n\n\tfor (const [key, value] of form.entries()) {\n\t\tconst existing = fields[key];\n\t\tif (existing === undefined) {\n\t\t\tfields[key] = key.endsWith('[]') ? [value] : value;\n\t\t} else if (Array.isArray(existing)) {\n\t\t\texisting.push(value);\n\t\t} else {\n\t\t\tfields[key] = [existing, value];\n\t\t}\n\t}\n\n\treturn fields;\n}\n"],"mappings":"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"}