@geekmidas/constructs 10.0.0-alpha.5 → 10.0.0-alpha.50

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 (392) hide show
  1. package/README.md +223 -158
  2. package/dist/{Construct-BD5neF7w.mjs → Construct-BO1X-kt9.mjs} +32 -33
  3. package/dist/Construct-BO1X-kt9.mjs.map +1 -0
  4. package/dist/Construct-BQALFCh2.d.cts +230 -0
  5. package/dist/Construct-BQALFCh2.d.cts.map +1 -0
  6. package/dist/{Construct-CyS3RpTL.cjs → Construct-DmvXceVY.cjs} +52 -47
  7. package/dist/Construct-DmvXceVY.cjs.map +1 -0
  8. package/dist/Construct-QXnl3VqT.d.mts +230 -0
  9. package/dist/Construct-QXnl3VqT.d.mts.map +1 -0
  10. package/dist/{Cron-B2OFsfDM.d.cts → Cron-DI3nKoic.d.cts} +22 -8
  11. package/dist/Cron-DI3nKoic.d.cts.map +1 -0
  12. package/dist/{Cron-CqEbBbwH.d.mts → Cron-uYAHPnp7.d.mts} +22 -8
  13. package/dist/Cron-uYAHPnp7.d.mts.map +1 -0
  14. package/dist/CronBuilder-BoHzlWU_.cjs +121 -0
  15. package/dist/CronBuilder-BoHzlWU_.cjs.map +1 -0
  16. package/dist/CronBuilder-CCgt0wCE.mjs +109 -0
  17. package/dist/CronBuilder-CCgt0wCE.mjs.map +1 -0
  18. package/dist/CronBuilder-DaSUm2Na.d.mts +47 -0
  19. package/dist/CronBuilder-DaSUm2Na.d.mts.map +1 -0
  20. package/dist/CronBuilder-g1lZLWyG.d.cts +47 -0
  21. package/dist/CronBuilder-g1lZLWyG.d.cts.map +1 -0
  22. package/dist/{Endpoint-Dem2XyCu.d.mts → Endpoint-BkzU6nn1.d.cts} +70 -93
  23. package/dist/Endpoint-BkzU6nn1.d.cts.map +1 -0
  24. package/dist/{Endpoint-DrD8a1yH.d.cts → Endpoint-BpboleFh.d.mts} +71 -94
  25. package/dist/Endpoint-BpboleFh.d.mts.map +1 -0
  26. package/dist/{Endpoint-Dij_wOcc.mjs → Endpoint-CQ9RJ7p2.mjs} +130 -109
  27. package/dist/Endpoint-CQ9RJ7p2.mjs.map +1 -0
  28. package/dist/{Endpoint-DODn1RhN.cjs → Endpoint-DOi8c_Gy.cjs} +158 -131
  29. package/dist/Endpoint-DOi8c_Gy.cjs.map +1 -0
  30. package/dist/{index-B8g8POkr.d.cts → EndpointFactory-BZZOleQT.d.cts} +62 -132
  31. package/dist/EndpointFactory-BZZOleQT.d.cts.map +1 -0
  32. package/dist/{EndpointFactory-BHFMmFkV.cjs → EndpointFactory-Bo9lkMqB.cjs} +75 -110
  33. package/dist/EndpointFactory-Bo9lkMqB.cjs.map +1 -0
  34. package/dist/{EndpointFactory-b4ituq-s.mjs → EndpointFactory-DR1rebok.mjs} +39 -74
  35. package/dist/EndpointFactory-DR1rebok.mjs.map +1 -0
  36. package/dist/{index-DbKmfl-q.d.mts → EndpointFactory-DnNlYflU.d.mts} +63 -133
  37. package/dist/EndpointFactory-DnNlYflU.d.mts.map +1 -0
  38. package/dist/Function-DuqGcbOI.d.mts +76 -0
  39. package/dist/Function-DuqGcbOI.d.mts.map +1 -0
  40. package/dist/Function-Pu-1kKZz.d.cts +76 -0
  41. package/dist/Function-Pu-1kKZz.d.cts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-BM2jbWht.mjs → HonoEndpointAdaptor-BIS0O3M9.mjs} +41 -47
  43. package/dist/HonoEndpointAdaptor-BIS0O3M9.mjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-De6IlBZe.cjs → HonoEndpointAdaptor-CMi0MJsF.cjs} +50 -53
  45. package/dist/HonoEndpointAdaptor-CMi0MJsF.cjs.map +1 -0
  46. package/dist/Queue-D5jcw0mu.cjs +109 -0
  47. package/dist/Queue-D5jcw0mu.cjs.map +1 -0
  48. package/dist/{Queue-D7ZuwBhy.d.cts → Queue-DlsHRzUp.d.mts} +48 -48
  49. package/dist/Queue-DlsHRzUp.d.mts.map +1 -0
  50. package/dist/{Queue-gVGfi2Yk.d.mts → Queue-HPyi0e1i.d.cts} +49 -49
  51. package/dist/Queue-HPyi0e1i.d.cts.map +1 -0
  52. package/dist/Queue-hwPN-t31.mjs +104 -0
  53. package/dist/Queue-hwPN-t31.mjs.map +1 -0
  54. package/dist/QueueBuilder-BFQn3OzZ.cjs +135 -0
  55. package/dist/QueueBuilder-BFQn3OzZ.cjs.map +1 -0
  56. package/dist/QueueBuilder-DCuYdjMw.mjs +118 -0
  57. package/dist/QueueBuilder-DCuYdjMw.mjs.map +1 -0
  58. package/dist/QueueBuilder-OSi6LkV9.d.cts +75 -0
  59. package/dist/QueueBuilder-OSi6LkV9.d.cts.map +1 -0
  60. package/dist/QueueBuilder-QHsnVt1P.d.mts +75 -0
  61. package/dist/QueueBuilder-QHsnVt1P.d.mts.map +1 -0
  62. package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-Bpp02cGr.d.cts} +29 -20
  63. package/dist/Subscriber-Bpp02cGr.d.cts.map +1 -0
  64. package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-CtN9R48-.d.mts} +29 -20
  65. package/dist/Subscriber-CtN9R48-.d.mts.map +1 -0
  66. package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-C2PwqwIl.cjs} +61 -36
  67. package/dist/SubscriberBuilder-C2PwqwIl.cjs.map +1 -0
  68. package/dist/SubscriberBuilder-CuCMFpYW.d.mts +67 -0
  69. package/dist/SubscriberBuilder-CuCMFpYW.d.mts.map +1 -0
  70. package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-DMFk_Ap1.mjs} +50 -24
  71. package/dist/SubscriberBuilder-DMFk_Ap1.mjs.map +1 -0
  72. package/dist/SubscriberBuilder-g3fAVWgs.d.cts +67 -0
  73. package/dist/SubscriberBuilder-g3fAVWgs.d.cts.map +1 -0
  74. package/dist/Topic-CkxOTrMv.cjs +104 -0
  75. package/dist/Topic-CkxOTrMv.cjs.map +1 -0
  76. package/dist/Topic-hPffOsot.mjs +99 -0
  77. package/dist/Topic-hPffOsot.mjs.map +1 -0
  78. package/dist/adaptors/aws.cjs +189 -110
  79. package/dist/adaptors/aws.cjs.map +1 -1
  80. package/dist/adaptors/aws.d.cts +81 -45
  81. package/dist/adaptors/aws.d.cts.map +1 -1
  82. package/dist/adaptors/aws.d.mts +82 -46
  83. package/dist/adaptors/aws.d.mts.map +1 -1
  84. package/dist/adaptors/aws.mjs +161 -85
  85. package/dist/adaptors/aws.mjs.map +1 -1
  86. package/dist/adaptors/hono.cjs +3 -10
  87. package/dist/adaptors/hono.d.cts +7 -16
  88. package/dist/adaptors/hono.d.cts.map +1 -1
  89. package/dist/adaptors/hono.d.mts +8 -17
  90. package/dist/adaptors/hono.d.mts.map +1 -1
  91. package/dist/adaptors/hono.mjs +2 -10
  92. package/dist/adaptors/testing.cjs +704 -90
  93. package/dist/adaptors/testing.cjs.map +1 -1
  94. package/dist/adaptors/testing.d.cts +325 -54
  95. package/dist/adaptors/testing.d.cts.map +1 -1
  96. package/dist/adaptors/testing.d.mts +325 -54
  97. package/dist/adaptors/testing.d.mts.map +1 -1
  98. package/dist/adaptors/testing.mjs +669 -71
  99. package/dist/adaptors/testing.mjs.map +1 -1
  100. package/dist/auth-3OAmK42n.d.cts +188 -0
  101. package/dist/auth-3OAmK42n.d.cts.map +1 -0
  102. package/dist/auth-BWbiewHa.d.mts +188 -0
  103. package/dist/auth-BWbiewHa.d.mts.map +1 -0
  104. package/dist/auth.cjs +171 -31
  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 +160 -24
  109. package/dist/auth.mjs.map +1 -1
  110. package/dist/{cache-BrRz3fEB.d.mts → cache-CXh6GIgb.d.mts} +3 -6
  111. package/dist/cache-CXh6GIgb.d.mts.map +1 -0
  112. package/dist/{cache-BtZY_tHe.d.cts → cache-DnGDGly3.d.cts} +3 -6
  113. package/dist/cache-DnGDGly3.d.cts.map +1 -0
  114. package/dist/cache.cjs +68 -2
  115. package/dist/cache.cjs.map +1 -0
  116. package/dist/cache.d.cts +1 -2
  117. package/dist/cache.d.mts +1 -2
  118. package/dist/cache.mjs +67 -2
  119. package/dist/cache.mjs.map +1 -0
  120. package/dist/cipher-C1lEFX63.mjs +225 -0
  121. package/dist/cipher-C1lEFX63.mjs.map +1 -0
  122. package/dist/cipher-CVxfwLjk.cjs +332 -0
  123. package/dist/cipher-CVxfwLjk.cjs.map +1 -0
  124. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  125. package/dist/clone-EKNovYHu.mjs.map +1 -0
  126. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  127. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  128. package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-B1AfqRl4.d.cts} +42 -11
  129. package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
  130. package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-DluK3_da.d.mts} +42 -11
  131. package/dist/construct-interface-DluK3_da.d.mts.map +1 -0
  132. package/dist/construct-interface.cjs +113 -7
  133. package/dist/construct-interface.cjs.map +1 -0
  134. package/dist/construct-interface.d.cts +2 -2
  135. package/dist/construct-interface.d.mts +2 -2
  136. package/dist/construct-interface.mjs +106 -2
  137. package/dist/construct-interface.mjs.map +1 -0
  138. package/dist/credential.cjs +63 -16
  139. package/dist/credential.cjs.map +1 -1
  140. package/dist/credential.d.cts +16 -9
  141. package/dist/credential.d.cts.map +1 -1
  142. package/dist/credential.d.mts +16 -9
  143. package/dist/credential.d.mts.map +1 -1
  144. package/dist/credential.mjs +58 -12
  145. package/dist/credential.mjs.map +1 -1
  146. package/dist/crons/index.cjs +68 -10
  147. package/dist/crons/index.cjs.map +1 -1
  148. package/dist/crons/index.d.cts +32 -14
  149. package/dist/crons/index.d.cts.map +1 -1
  150. package/dist/crons/index.d.mts +32 -14
  151. package/dist/crons/index.d.mts.map +1 -1
  152. package/dist/crons/index.mjs +66 -10
  153. package/dist/crons/index.mjs.map +1 -1
  154. package/dist/database/kysely.cjs +40 -15
  155. package/dist/database/kysely.cjs.map +1 -1
  156. package/dist/database/kysely.d.cts +2 -152
  157. package/dist/database/kysely.d.mts +2 -152
  158. package/dist/database/kysely.mjs +28 -5
  159. package/dist/database/kysely.mjs.map +1 -1
  160. package/dist/email.cjs +25 -12
  161. package/dist/email.cjs.map +1 -1
  162. package/dist/email.d.cts +3 -7
  163. package/dist/email.d.cts.map +1 -1
  164. package/dist/email.d.mts +3 -7
  165. package/dist/email.d.mts.map +1 -1
  166. package/dist/email.mjs +16 -3
  167. package/dist/email.mjs.map +1 -1
  168. package/dist/encryption.cjs +96 -0
  169. package/dist/encryption.cjs.map +1 -0
  170. package/dist/encryption.d.cts +117 -0
  171. package/dist/encryption.d.cts.map +1 -0
  172. package/dist/encryption.d.mts +117 -0
  173. package/dist/encryption.d.mts.map +1 -0
  174. package/dist/encryption.mjs +83 -0
  175. package/dist/encryption.mjs.map +1 -0
  176. package/dist/endpoints/index.cjs +8 -10
  177. package/dist/endpoints/index.d.cts +51 -7
  178. package/dist/endpoints/index.d.cts.map +1 -0
  179. package/dist/endpoints/index.d.mts +51 -7
  180. package/dist/endpoints/index.d.mts.map +1 -0
  181. package/dist/endpoints/index.mjs +6 -10
  182. package/dist/external-api-CWY9orcO.d.mts +86 -0
  183. package/dist/external-api-CWY9orcO.d.mts.map +1 -0
  184. package/dist/external-api-D-5WB-sr.d.cts +86 -0
  185. package/dist/external-api-D-5WB-sr.d.cts.map +1 -0
  186. package/dist/external-api.cjs +124 -0
  187. package/dist/external-api.cjs.map +1 -0
  188. package/dist/external-api.d.cts +2 -0
  189. package/dist/external-api.d.mts +2 -0
  190. package/dist/external-api.mjs +121 -0
  191. package/dist/external-api.mjs.map +1 -0
  192. package/dist/file-server.cjs +42 -10
  193. package/dist/file-server.cjs.map +1 -1
  194. package/dist/file-server.d.cts +6 -10
  195. package/dist/file-server.d.cts.map +1 -1
  196. package/dist/file-server.d.mts +6 -10
  197. package/dist/file-server.d.mts.map +1 -1
  198. package/dist/file-server.mjs +34 -2
  199. package/dist/file-server.mjs.map +1 -1
  200. package/dist/functions/index.cjs +2 -6
  201. package/dist/functions/index.d.cts +3 -4
  202. package/dist/functions/index.d.mts +3 -4
  203. package/dist/functions/index.mjs +2 -6
  204. package/dist/{functions-DJJA7VGc.cjs → functions-CbP5ZKma.cjs} +421 -273
  205. package/dist/functions-CbP5ZKma.cjs.map +1 -0
  206. package/dist/{functions-Ck21Uyq0.mjs → functions-Di6n5ltG.mjs} +383 -241
  207. package/dist/functions-Di6n5ltG.mjs.map +1 -0
  208. package/dist/index-BuzRvKOQ.d.cts +115 -0
  209. package/dist/index-BuzRvKOQ.d.cts.map +1 -0
  210. package/dist/index-CTkKOer4.d.mts +115 -0
  211. package/dist/index-CTkKOer4.d.mts.map +1 -0
  212. package/dist/index-CeEtxDmK.d.cts +79 -0
  213. package/dist/index-CeEtxDmK.d.cts.map +1 -0
  214. package/dist/index-CeEtxDmK.d.mts +79 -0
  215. package/dist/index-CeEtxDmK.d.mts.map +1 -0
  216. package/dist/index.cjs +3 -3
  217. package/dist/index.d.cts +4 -4
  218. package/dist/index.d.mts +4 -4
  219. package/dist/index.mjs +2 -3
  220. package/dist/kms-B-Hm3d5r.cjs +85 -0
  221. package/dist/kms-B-Hm3d5r.cjs.map +1 -0
  222. package/dist/kms-BdUlMJEZ.mjs +85 -0
  223. package/dist/kms-BdUlMJEZ.mjs.map +1 -0
  224. package/dist/kysely-Bqov3fwv.d.mts +159 -0
  225. package/dist/kysely-Bqov3fwv.d.mts.map +1 -0
  226. package/dist/kysely-DTnkZsub.d.cts +159 -0
  227. package/dist/kysely-DTnkZsub.d.cts.map +1 -0
  228. package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-CFanua0O.mjs} +20 -60
  229. package/dist/lazyAccessors-CFanua0O.mjs.map +1 -0
  230. package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-hJKGv8Ay.cjs} +60 -113
  231. package/dist/lazyAccessors-hJKGv8Ay.cjs.map +1 -0
  232. package/dist/mobile-app.cjs +73 -0
  233. package/dist/mobile-app.cjs.map +1 -0
  234. package/dist/mobile-app.d.cts +61 -0
  235. package/dist/mobile-app.d.cts.map +1 -0
  236. package/dist/mobile-app.d.mts +61 -0
  237. package/dist/mobile-app.d.mts.map +1 -0
  238. package/dist/mobile-app.mjs +72 -0
  239. package/dist/mobile-app.mjs.map +1 -0
  240. package/dist/object-storage.cjs +18 -10
  241. package/dist/object-storage.cjs.map +1 -1
  242. package/dist/object-storage.d.cts +3 -7
  243. package/dist/object-storage.d.cts.map +1 -1
  244. package/dist/object-storage.d.mts +3 -7
  245. package/dist/object-storage.d.mts.map +1 -1
  246. package/dist/object-storage.mjs +11 -3
  247. package/dist/object-storage.mjs.map +1 -1
  248. package/dist/{processAudits-Dmts9H_b.mjs → processAudits-BpRlPQMW.mjs} +16 -19
  249. package/dist/processAudits-BpRlPQMW.mjs.map +1 -0
  250. package/dist/{processAudits-CGqttuXm.cjs → processAudits-D_2W5x8k.cjs} +26 -30
  251. package/dist/processAudits-D_2W5x8k.cjs.map +1 -0
  252. package/dist/queue/index.cjs +6 -189
  253. package/dist/queue/index.d.cts +3 -60
  254. package/dist/queue/index.d.mts +3 -60
  255. package/dist/queue/index.mjs +3 -186
  256. package/dist/rest-api.cjs +87 -63
  257. package/dist/rest-api.cjs.map +1 -1
  258. package/dist/rest-api.d.cts +62 -61
  259. package/dist/rest-api.d.cts.map +1 -1
  260. package/dist/rest-api.d.mts +62 -61
  261. package/dist/rest-api.d.mts.map +1 -1
  262. package/dist/rest-api.mjs +79 -55
  263. package/dist/rest-api.mjs.map +1 -1
  264. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  265. package/dist/site.cjs +33 -9
  266. package/dist/site.cjs.map +1 -1
  267. package/dist/site.d.cts +11 -22
  268. package/dist/site.d.cts.map +1 -1
  269. package/dist/site.d.mts +11 -22
  270. package/dist/site.d.mts.map +1 -1
  271. package/dist/site.mjs +29 -5
  272. package/dist/site.mjs.map +1 -1
  273. package/dist/subscribers/index.cjs +2 -11
  274. package/dist/subscribers/index.d.cts +3 -14
  275. package/dist/subscribers/index.d.mts +3 -14
  276. package/dist/subscribers/index.mjs +2 -11
  277. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  278. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  279. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  280. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  281. package/dist/{telemetry-C3L0iS28.d.cts → telemetry-DGcFlVpB.d.cts} +2 -5
  282. package/dist/telemetry-DGcFlVpB.d.cts.map +1 -0
  283. package/dist/{telemetry-D7bVFLGi.d.mts → telemetry-DGcFlVpB.d.mts} +2 -5
  284. package/dist/telemetry-DGcFlVpB.d.mts.map +1 -0
  285. package/dist/topic/index.cjs +3 -137
  286. package/dist/topic/index.d.cts +2 -32
  287. package/dist/topic/index.d.mts +2 -32
  288. package/dist/topic/index.mjs +2 -134
  289. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  290. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  291. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  292. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  293. package/dist/types.d.cts +1 -1
  294. package/dist/types.d.mts +1 -1
  295. package/dist/types.mjs +1 -0
  296. package/dist/worker.cjs +137 -38
  297. package/dist/worker.cjs.map +1 -1
  298. package/dist/worker.d.cts +113 -44
  299. package/dist/worker.d.cts.map +1 -1
  300. package/dist/worker.d.mts +113 -43
  301. package/dist/worker.d.mts.map +1 -1
  302. package/dist/worker.mjs +132 -33
  303. package/dist/worker.mjs.map +1 -1
  304. package/package.json +81 -41
  305. package/dist/Construct-BD5neF7w.mjs.map +0 -1
  306. package/dist/Construct-C0ijr2qp.d.cts +0 -117
  307. package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
  308. package/dist/Construct-Ct8nalEi.d.mts +0 -117
  309. package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
  310. package/dist/Construct-CyS3RpTL.cjs.map +0 -1
  311. package/dist/Cron-B2OFsfDM.d.cts.map +0 -1
  312. package/dist/Cron-CqEbBbwH.d.mts.map +0 -1
  313. package/dist/CronBuilder-Bg-9h2cc.d.mts +0 -44
  314. package/dist/CronBuilder-Bg-9h2cc.d.mts.map +0 -1
  315. package/dist/CronBuilder-CdibiHNB.mjs +0 -84
  316. package/dist/CronBuilder-CdibiHNB.mjs.map +0 -1
  317. package/dist/CronBuilder-DyUr6nYz.cjs +0 -96
  318. package/dist/CronBuilder-DyUr6nYz.cjs.map +0 -1
  319. package/dist/CronBuilder-LSJMfqnq.d.cts +0 -44
  320. package/dist/CronBuilder-LSJMfqnq.d.cts.map +0 -1
  321. package/dist/Endpoint-DODn1RhN.cjs.map +0 -1
  322. package/dist/Endpoint-Dem2XyCu.d.mts.map +0 -1
  323. package/dist/Endpoint-Dij_wOcc.mjs.map +0 -1
  324. package/dist/Endpoint-DrD8a1yH.d.cts.map +0 -1
  325. package/dist/EndpointFactory-BHFMmFkV.cjs.map +0 -1
  326. package/dist/EndpointFactory-b4ituq-s.mjs.map +0 -1
  327. package/dist/HonoEndpointAdaptor-BM2jbWht.mjs.map +0 -1
  328. package/dist/HonoEndpointAdaptor-De6IlBZe.cjs.map +0 -1
  329. package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
  330. package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
  331. package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
  332. package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
  333. package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
  334. package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
  335. package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
  336. package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
  337. package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
  338. package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
  339. package/dist/Topic-19QeHBIR.d.cts +0 -91
  340. package/dist/Topic-19QeHBIR.d.cts.map +0 -1
  341. package/dist/Topic-DuFeqkBh.d.mts +0 -91
  342. package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
  343. package/dist/auth.d.cts.map +0 -1
  344. package/dist/auth.d.mts.map +0 -1
  345. package/dist/cache-0ANvRQnD.mjs +0 -51
  346. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  347. package/dist/cache-3WSvAulx.cjs +0 -57
  348. package/dist/cache-3WSvAulx.cjs.map +0 -1
  349. package/dist/cache-BrRz3fEB.d.mts.map +0 -1
  350. package/dist/cache-BtZY_tHe.d.cts.map +0 -1
  351. package/dist/clone-DblgEZZa.mjs.map +0 -1
  352. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  353. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  354. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  355. package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
  356. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  357. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  358. package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
  359. package/dist/database/kysely.d.cts.map +0 -1
  360. package/dist/database/kysely.d.mts.map +0 -1
  361. package/dist/functions-Ck21Uyq0.mjs.map +0 -1
  362. package/dist/functions-DJJA7VGc.cjs.map +0 -1
  363. package/dist/index-AIfVzkhi.d.cts +0 -170
  364. package/dist/index-AIfVzkhi.d.cts.map +0 -1
  365. package/dist/index-B8g8POkr.d.cts.map +0 -1
  366. package/dist/index-D3zjrwjr.d.mts +0 -169
  367. package/dist/index-D3zjrwjr.d.mts.map +0 -1
  368. package/dist/index-DbKmfl-q.d.mts.map +0 -1
  369. package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
  370. package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
  371. package/dist/processAudits-CGqttuXm.cjs.map +0 -1
  372. package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
  373. package/dist/queue/index.cjs.map +0 -1
  374. package/dist/queue/index.d.cts.map +0 -1
  375. package/dist/queue/index.d.mts.map +0 -1
  376. package/dist/queue/index.mjs.map +0 -1
  377. package/dist/subscribers/index.cjs.map +0 -1
  378. package/dist/subscribers/index.d.cts.map +0 -1
  379. package/dist/subscribers/index.d.mts.map +0 -1
  380. package/dist/subscribers/index.mjs.map +0 -1
  381. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  382. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  383. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  384. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  385. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  386. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  387. package/dist/topic/index.cjs.map +0 -1
  388. package/dist/topic/index.d.cts.map +0 -1
  389. package/dist/topic/index.d.mts.map +0 -1
  390. package/dist/topic/index.mjs.map +0 -1
  391. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  392. package/dist/types-aKksMEWL.d.mts.map +0 -1
@@ -0,0 +1,159 @@
1
+ import { n as Construct } from "./construct-interface-DluK3_da.mjs";
2
+ import { t as Cache } from "./cache-CXh6GIgb.mjs";
3
+ import { ConstructName, Declaration, PostgresVersion } from "@geekmidas/manifest";
4
+ import { Kysely, KyselyConfig } from "kysely";
5
+ import { Service } from "@geekmidas/services";
6
+ //#region src/database/kysely.d.ts
7
+ /**
8
+ * Everything Kysely takes, plus what this construct declares.
9
+ *
10
+ * `dialect` is omitted because the construct owns it — it is built from the one
11
+ * URL the adapter supplied, which is the whole point of the construct. The rest
12
+ * of `KyselyConfig` (`plugins`, `log`) is the app's business and passes
13
+ * straight through, so anything Kysely adds later arrives without being
14
+ * tracked here.
15
+ */
16
+ interface KyselyDatabaseOptions extends Omit<KyselyConfig, 'dialect'> {
17
+ /**
18
+ * The schema, pinned on both roles' `search_path`.
19
+ *
20
+ * Defaults to `app` — the role the schema plays, rather than a restatement
21
+ * of the database's own name, which reads correctly beside `auth` and
22
+ * `pgboss` and keeps the application off `public`.
23
+ */
24
+ schema?: string;
25
+ /**
26
+ * Provision the owner/runtime role split. Defaults to on.
27
+ *
28
+ * Off falls back to the cluster's master credential in both URLs, giving up
29
+ * the DDL/DML split and putting credentials that can drop a table into the
30
+ * function's environment. A deliberate downgrade, not a default.
31
+ */
32
+ roles?: boolean;
33
+ /**
34
+ * The Postgres major version to provision.
35
+ *
36
+ * Declared here so one statement reaches both targets. It was previously
37
+ * set in two unrelated places — a container tag locally, nothing at all on
38
+ * AWS (so Aurora chose) — which is how local came to run 18 while deployed
39
+ * ran 17.7 with nothing recording the difference.
40
+ *
41
+ * Defaults to {@link DEFAULT_POSTGRES_VERSION}.
42
+ */
43
+ version?: PostgresVersion;
44
+ }
45
+ /** What makes a construct derived rather than a database in its own right. */
46
+ interface DerivedFrom {
47
+ kind: 'database-reader' | 'database-schema';
48
+ of: string;
49
+ schema?: string;
50
+ }
51
+ /**
52
+ * @typeParam DB - the database's schema.
53
+ * @typeParam TName - the canonical id. TypeScript has no partial
54
+ * type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
55
+ * this at its default and the service key widens to `string`. `db` still types
56
+ * through `.database()`, which infers from the service.
57
+ */
58
+ declare class KyselyDatabase<DB = unknown, TName extends string = string> implements Construct<TName, Kysely<DB>> {
59
+ private readonly options;
60
+ readonly id: TName;
61
+ readonly service: Service<Uncapitalize<TName>, Kysely<DB>>;
62
+ /**
63
+ * Declared once and read by both `declare()` and `connect()`, so the key the
64
+ * build publishes and the key the client reads cannot drift.
65
+ */
66
+ private readonly config;
67
+ private readonly schemaName;
68
+ private readonly roles;
69
+ private readonly version;
70
+ private readonly derivedFrom?;
71
+ constructor(id: ConstructName<TName>, options?: KyselyDatabaseOptions, derivedFrom?: DerivedFrom);
72
+ declare(): Declaration[];
73
+ /**
74
+ * A read-only endpoint on this database.
75
+ *
76
+ * Read-only is enforced by the reader role's grants rather than by which
77
+ * endpoint it resolves to, so falling back to the writer where no replica
78
+ * exists is safe rather than a silently writable connection behind a name
79
+ * that says reader. There is no `writer()`: the database *is* the writer, so
80
+ * a replica can never be reached by accident.
81
+ *
82
+ * The return type is narrower than this class on purpose — see
83
+ * {@link ReadOnlyDatabase}.
84
+ */
85
+ reader(): ReadOnlyDatabase<DB, `${TName}Reader`>;
86
+ /**
87
+ * A cache that lives in this database.
88
+ *
89
+ * The same strengthening `schema()` is over a second database: `new
90
+ * Cache('Sessions')` says the app caches and leaves where to the deployment,
91
+ * while this says it caches *here* — which is a fact about the application
92
+ * and so belongs in its code.
93
+ *
94
+ * What it buys beyond being explicit: the table's schema and the role that
95
+ * reaches it come from this database rather than from a second convention,
96
+ * and the backend no longer has to guess which database "the database" meant
97
+ * when an app declares two.
98
+ *
99
+ * A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
100
+ * is a key/value store, not a query builder, and typing it as the parent
101
+ * would be a convenience that lies.
102
+ */
103
+ cache<TCache extends string = `${TName}Cache`>(id?: ConstructName<TCache>, options?: {
104
+ table?: string;
105
+ }): Cache<TCache>;
106
+ /**
107
+ * A second schema in this database, with its own role(s) and its own URL —
108
+ * so this database's role holds no grant on those tables at all.
109
+ *
110
+ * Typed separately because a tenant has its own tables: the point is that
111
+ * `auth.selectFrom('sessions')` type-checks and
112
+ * `orders.selectFrom('sessions')` does not.
113
+ */
114
+ schema<TenantDB, TTenant extends string>(id: ConstructName<TTenant>, options?: KyselyDatabaseOptions): KyselyDatabase<TenantDB, TTenant>;
115
+ /**
116
+ * A connection as the *owner* role — the one that may create, alter and drop.
117
+ *
118
+ * A `Service` rather than part of the construct, and deliberately so: a
119
+ * construct is what `.dependsOn()` accepts, and nothing should be able to
120
+ * depend on this. A migrator asks for it by name; a handler cannot ask at
121
+ * all, which is the security property the role split exists for.
122
+ *
123
+ * Falls back to the runtime URL where no owner URL was published — the
124
+ * `roles: false` downgrade, where there is only one credential and it is the
125
+ * cluster master's.
126
+ */
127
+ get owner(): Service<`${Uncapitalize<TName>}Owner`, Kysely<DB>>;
128
+ /**
129
+ * What this database's clients are built with besides a dialect — the
130
+ * plugins and logging it was declared with.
131
+ *
132
+ * Public so that whatever opens a connection to it outside \`connect()\` —
133
+ * a test's transaction — builds the same client. A test that dropped the
134
+ * plugins would write \`createdAt\` where production writes \`created_at\`.
135
+ */
136
+ get clientConfig(): Omit<KyselyConfig, 'dialect'>;
137
+ private connect;
138
+ }
139
+ /**
140
+ * A database you may read through, and derive nothing from.
141
+ *
142
+ * A reader is terminal in the graph, and this is that fact in the type system.
143
+ * `DERIVES_FROM` gives `cache` and `database-schema` no `database-reader`
144
+ * parent, and there is no reader of a reader — so `orders.reader().cache(…)`
145
+ * has always been illegal, but it type-checked and failed later at
146
+ * `assertDerivations`. That is a long way round to learn that a read-only
147
+ * endpoint cannot own a table something writes to.
148
+ *
149
+ * Omitting the three deriving methods rather than making them throw keeps the
150
+ * failure where it costs least: the editor, on the line that wrote it.
151
+ *
152
+ * The result is deliberately not assignable back to `KyselyDatabase` — a
153
+ * reader is not one, and anything that genuinely needs the writer should say
154
+ * so.
155
+ */
156
+ type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
157
+ //#endregion
158
+ export { KyselyDatabaseOptions as n, ReadOnlyDatabase as r, KyselyDatabase as t };
159
+ //# sourceMappingURL=kysely-Bqov3fwv.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kysely-Bqov3fwv.d.mts","names":[],"sources":["../src/database/kysely.ts"],"mappings":";;;;;;;;;;;;;;;UAwCiB,8BAA8B,KAAK;;;;;;;;EAQnD;;;;;;;;EAQA;;;;;;;;;;;EAWA,UAAU;;;UAID;EACT;EACA;EACA;;;;;;;;;cAUY,eAAe,cAAc,0CAC9B,UAAU,OAAO,OAAO;mBAiBjB;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,OAAO;;;;;mBAMrC;mBACA;mBACA;mBACA;mBACA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,uBAC1B,cAAc;EAyBf,WAAW;;;;;;;;;;;;;EAqDX,UAAU,iBAAiB,OAAO;;;;;;;;;;;;;;;;;;EAyBlC,MAAM,2BAA2B,cAChC,KAAI,cAAc,SAClB;IAAW;MACT,MAAM;;;;;;;;;EAeT,OAAO,UAAU,wBAChB,IAAI,cAAc,UAClB,UAAS,wBACP,eAAe,UAAU;;;;;;;;;;;;;MAoBxB,SAAS,WAAW,aAAa,eAAe,OAAO;;;;;;;;;MAgBvD,gBAAgB,KAAK;UAaX;;;;;;;;;;;;;;;;;;;KA6DH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
@@ -0,0 +1,159 @@
1
+ import { n as Construct } from "./construct-interface-B1AfqRl4.cjs";
2
+ import { t as Cache } from "./cache-DnGDGly3.cjs";
3
+ import { Service } from "@geekmidas/services";
4
+ import { ConstructName, Declaration, PostgresVersion } from "@geekmidas/manifest";
5
+ import { Kysely, KyselyConfig } from "kysely";
6
+ //#region src/database/kysely.d.ts
7
+ /**
8
+ * Everything Kysely takes, plus what this construct declares.
9
+ *
10
+ * `dialect` is omitted because the construct owns it — it is built from the one
11
+ * URL the adapter supplied, which is the whole point of the construct. The rest
12
+ * of `KyselyConfig` (`plugins`, `log`) is the app's business and passes
13
+ * straight through, so anything Kysely adds later arrives without being
14
+ * tracked here.
15
+ */
16
+ interface KyselyDatabaseOptions extends Omit<KyselyConfig, 'dialect'> {
17
+ /**
18
+ * The schema, pinned on both roles' `search_path`.
19
+ *
20
+ * Defaults to `app` — the role the schema plays, rather than a restatement
21
+ * of the database's own name, which reads correctly beside `auth` and
22
+ * `pgboss` and keeps the application off `public`.
23
+ */
24
+ schema?: string;
25
+ /**
26
+ * Provision the owner/runtime role split. Defaults to on.
27
+ *
28
+ * Off falls back to the cluster's master credential in both URLs, giving up
29
+ * the DDL/DML split and putting credentials that can drop a table into the
30
+ * function's environment. A deliberate downgrade, not a default.
31
+ */
32
+ roles?: boolean;
33
+ /**
34
+ * The Postgres major version to provision.
35
+ *
36
+ * Declared here so one statement reaches both targets. It was previously
37
+ * set in two unrelated places — a container tag locally, nothing at all on
38
+ * AWS (so Aurora chose) — which is how local came to run 18 while deployed
39
+ * ran 17.7 with nothing recording the difference.
40
+ *
41
+ * Defaults to {@link DEFAULT_POSTGRES_VERSION}.
42
+ */
43
+ version?: PostgresVersion;
44
+ }
45
+ /** What makes a construct derived rather than a database in its own right. */
46
+ interface DerivedFrom {
47
+ kind: 'database-reader' | 'database-schema';
48
+ of: string;
49
+ schema?: string;
50
+ }
51
+ /**
52
+ * @typeParam DB - the database's schema.
53
+ * @typeParam TName - the canonical id. TypeScript has no partial
54
+ * type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
55
+ * this at its default and the service key widens to `string`. `db` still types
56
+ * through `.database()`, which infers from the service.
57
+ */
58
+ declare class KyselyDatabase<DB = unknown, TName extends string = string> implements Construct<TName, Kysely<DB>> {
59
+ private readonly options;
60
+ readonly id: TName;
61
+ readonly service: Service<Uncapitalize<TName>, Kysely<DB>>;
62
+ /**
63
+ * Declared once and read by both `declare()` and `connect()`, so the key the
64
+ * build publishes and the key the client reads cannot drift.
65
+ */
66
+ private readonly config;
67
+ private readonly schemaName;
68
+ private readonly roles;
69
+ private readonly version;
70
+ private readonly derivedFrom?;
71
+ constructor(id: ConstructName<TName>, options?: KyselyDatabaseOptions, derivedFrom?: DerivedFrom);
72
+ declare(): Declaration[];
73
+ /**
74
+ * A read-only endpoint on this database.
75
+ *
76
+ * Read-only is enforced by the reader role's grants rather than by which
77
+ * endpoint it resolves to, so falling back to the writer where no replica
78
+ * exists is safe rather than a silently writable connection behind a name
79
+ * that says reader. There is no `writer()`: the database *is* the writer, so
80
+ * a replica can never be reached by accident.
81
+ *
82
+ * The return type is narrower than this class on purpose — see
83
+ * {@link ReadOnlyDatabase}.
84
+ */
85
+ reader(): ReadOnlyDatabase<DB, `${TName}Reader`>;
86
+ /**
87
+ * A cache that lives in this database.
88
+ *
89
+ * The same strengthening `schema()` is over a second database: `new
90
+ * Cache('Sessions')` says the app caches and leaves where to the deployment,
91
+ * while this says it caches *here* — which is a fact about the application
92
+ * and so belongs in its code.
93
+ *
94
+ * What it buys beyond being explicit: the table's schema and the role that
95
+ * reaches it come from this database rather than from a second convention,
96
+ * and the backend no longer has to guess which database "the database" meant
97
+ * when an app declares two.
98
+ *
99
+ * A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
100
+ * is a key/value store, not a query builder, and typing it as the parent
101
+ * would be a convenience that lies.
102
+ */
103
+ cache<TCache extends string = `${TName}Cache`>(id?: ConstructName<TCache>, options?: {
104
+ table?: string;
105
+ }): Cache<TCache>;
106
+ /**
107
+ * A second schema in this database, with its own role(s) and its own URL —
108
+ * so this database's role holds no grant on those tables at all.
109
+ *
110
+ * Typed separately because a tenant has its own tables: the point is that
111
+ * `auth.selectFrom('sessions')` type-checks and
112
+ * `orders.selectFrom('sessions')` does not.
113
+ */
114
+ schema<TenantDB, TTenant extends string>(id: ConstructName<TTenant>, options?: KyselyDatabaseOptions): KyselyDatabase<TenantDB, TTenant>;
115
+ /**
116
+ * A connection as the *owner* role — the one that may create, alter and drop.
117
+ *
118
+ * A `Service` rather than part of the construct, and deliberately so: a
119
+ * construct is what `.dependsOn()` accepts, and nothing should be able to
120
+ * depend on this. A migrator asks for it by name; a handler cannot ask at
121
+ * all, which is the security property the role split exists for.
122
+ *
123
+ * Falls back to the runtime URL where no owner URL was published — the
124
+ * `roles: false` downgrade, where there is only one credential and it is the
125
+ * cluster master's.
126
+ */
127
+ get owner(): Service<`${Uncapitalize<TName>}Owner`, Kysely<DB>>;
128
+ /**
129
+ * What this database's clients are built with besides a dialect — the
130
+ * plugins and logging it was declared with.
131
+ *
132
+ * Public so that whatever opens a connection to it outside \`connect()\` —
133
+ * a test's transaction — builds the same client. A test that dropped the
134
+ * plugins would write \`createdAt\` where production writes \`created_at\`.
135
+ */
136
+ get clientConfig(): Omit<KyselyConfig, 'dialect'>;
137
+ private connect;
138
+ }
139
+ /**
140
+ * A database you may read through, and derive nothing from.
141
+ *
142
+ * A reader is terminal in the graph, and this is that fact in the type system.
143
+ * `DERIVES_FROM` gives `cache` and `database-schema` no `database-reader`
144
+ * parent, and there is no reader of a reader — so `orders.reader().cache(…)`
145
+ * has always been illegal, but it type-checked and failed later at
146
+ * `assertDerivations`. That is a long way round to learn that a read-only
147
+ * endpoint cannot own a table something writes to.
148
+ *
149
+ * Omitting the three deriving methods rather than making them throw keeps the
150
+ * failure where it costs least: the editor, on the line that wrote it.
151
+ *
152
+ * The result is deliberately not assignable back to `KyselyDatabase` — a
153
+ * reader is not one, and anything that genuinely needs the writer should say
154
+ * so.
155
+ */
156
+ type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
157
+ //#endregion
158
+ export { KyselyDatabaseOptions as n, ReadOnlyDatabase as r, KyselyDatabase as t };
159
+ //# sourceMappingURL=kysely-DTnkZsub.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kysely-DTnkZsub.d.cts","names":[],"sources":["../src/database/kysely.ts"],"mappings":";;;;;;;;;;;;;;;UAwCiB,8BAA8B,KAAK;;;;;;;;EAQnD;;;;;;;;EAQA;;;;;;;;;;;EAWA,UAAU;;;UAID;EACT;EACA;EACA;;;;;;;;;cAUY,eAAe,cAAc,0CAC9B,UAAU,OAAO,OAAO;mBAiBjB;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,OAAO;;;;;mBAMrC;mBACA;mBACA;mBACA;mBACA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,uBAC1B,cAAc;EAyBf,WAAW;;;;;;;;;;;;;EAqDX,UAAU,iBAAiB,OAAO;;;;;;;;;;;;;;;;;;EAyBlC,MAAM,2BAA2B,cAChC,KAAI,cAAc,SAClB;IAAW;MACT,MAAM;;;;;;;;;EAeT,OAAO,UAAU,wBAChB,IAAI,cAAc,UAClB,UAAS,wBACP,eAAe,UAAU;;;;;;;;;;;;;MAoBxB,SAAS,WAAW,aAAa,eAAe,OAAO;;;;;;;;;MAgBvD,gBAAgB,KAAK;UAaX;;;;;;;;;;;;;;;;;;;KA6DH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
@@ -1,44 +1,4 @@
1
1
  import { getCookie } from "hono/cookie";
2
-
3
- //#region src/publisher.ts
4
- async function publishEvents(logger, serviceDiscovery, ev = [], response, publisherService) {
5
- try {
6
- if (!ev?.length) {
7
- logger.debug("No events to publish");
8
- return;
9
- }
10
- if (!publisherService) {
11
- logger.warn("No publisher service available");
12
- return;
13
- }
14
- const services = await serviceDiscovery.register([publisherService]);
15
- const publisher = services[publisherService.serviceName];
16
- const events = [];
17
- for (const { when, payload, type,...e } of ev) {
18
- logger.debug({ event: type }, "Processing event");
19
- const resolvedPayload = await payload(response);
20
- const event = {
21
- ...e,
22
- type,
23
- payload: resolvedPayload
24
- };
25
- if (!when || when(response)) events.push(event);
26
- }
27
- if (events.length) {
28
- logger.debug({ eventCount: ev.length }, "Publishing events");
29
- await publisher.publish(events).catch((err) => {
30
- logger.error(err, "Failed to publish events");
31
- });
32
- }
33
- } catch (error) {
34
- logger.error(error, "Something went wrong publishing events");
35
- }
36
- }
37
- async function publishConstructEvents(construct, response, serviceDiscovery, logger = construct.logger) {
38
- return publishEvents(logger, serviceDiscovery, construct.events, response, construct.publisherService);
39
- }
40
-
41
- //#endregion
42
2
  //#region src/endpoints/lazyAccessors.ts
43
3
  /**
44
4
  * Create a lazy header accessor for Hono.
@@ -47,11 +7,11 @@ async function publishConstructEvents(construct, response, serviceDiscovery, log
47
7
  */
48
8
  function createHonoHeaders(c) {
49
9
  let allHeaders = null;
50
- return (key) => {
10
+ return ((key) => {
51
11
  if (key !== void 0) return c.req.header(key);
52
12
  if (!allHeaders) allHeaders = c.req.header();
53
13
  return allHeaders;
54
- };
14
+ });
55
15
  }
56
16
  /**
57
17
  * Create a lazy cookie accessor for Hono.
@@ -60,7 +20,7 @@ function createHonoHeaders(c) {
60
20
  */
61
21
  function createHonoCookies(c) {
62
22
  let allCookies = null;
63
- return (name) => {
23
+ return ((name) => {
64
24
  if (name !== void 0) return getCookie(c, name);
65
25
  if (!allCookies) {
66
26
  allCookies = {};
@@ -76,7 +36,7 @@ function createHonoCookies(c) {
76
36
  }
77
37
  }
78
38
  return allCookies;
79
- };
39
+ });
80
40
  }
81
41
  /**
82
42
  * Create a lazy header accessor for API Gateway events.
@@ -93,17 +53,17 @@ function createApiGatewayHeaders(headers) {
93
53
  }
94
54
  return normalizedHeaders;
95
55
  };
96
- return (key) => {
56
+ return ((key) => {
97
57
  if (key !== void 0) {
98
58
  if (headers) {
99
59
  const direct = headers[key] ?? headers[key.toLowerCase()];
100
60
  if (direct !== void 0) return direct;
101
61
  return normalize()[key.toLowerCase()];
102
62
  }
103
- return void 0;
63
+ return;
104
64
  }
105
65
  return normalize();
106
- };
66
+ });
107
67
  }
108
68
  /**
109
69
  * Create a lazy cookie accessor for API Gateway events.
@@ -134,10 +94,10 @@ function createApiGatewayCookies(cookies, cookieHeader) {
134
94
  }
135
95
  return parsed;
136
96
  };
137
- return (name) => {
97
+ return ((name) => {
138
98
  if (name !== void 0) return parse()[name];
139
99
  return parse();
140
- };
100
+ });
141
101
  }
142
102
  /**
143
103
  * Create a lazy header accessor for plain object headers (test adaptor, etc).
@@ -145,7 +105,7 @@ function createApiGatewayCookies(cookies, cookieHeader) {
145
105
  */
146
106
  function createObjectHeaders(headers) {
147
107
  let normalized = null;
148
- return (key) => {
108
+ return ((key) => {
149
109
  if (key !== void 0) {
150
110
  if (headers) {
151
111
  const direct = headers[key] ?? headers[key.toLowerCase()];
@@ -162,7 +122,7 @@ function createObjectHeaders(headers) {
162
122
  for (const [k, v] of Object.entries(headers)) normalized[k.toLowerCase()] = v;
163
123
  }
164
124
  return normalized ?? {};
165
- };
125
+ });
166
126
  }
167
127
  /**
168
128
  * Create a lazy cookie accessor from a cookie header string.
@@ -185,30 +145,30 @@ function createCookieHeaderAccessor(cookieHeader) {
185
145
  }
186
146
  return parsed;
187
147
  };
188
- return (name) => {
148
+ return ((name) => {
189
149
  if (name !== void 0) return parse()[name];
190
150
  return parse();
191
- };
151
+ });
192
152
  }
193
153
  /**
194
154
  * Create a no-op header accessor (for minimal endpoints that don't use headers).
195
155
  */
196
156
  function createNoopHeaders() {
197
- return (key) => {
157
+ return ((key) => {
198
158
  if (key !== void 0) return void 0;
199
159
  return {};
200
- };
160
+ });
201
161
  }
202
162
  /**
203
163
  * Create a no-op cookie accessor (for minimal endpoints that don't use cookies).
204
164
  */
205
165
  function createNoopCookies() {
206
- return (name) => {
166
+ return ((name) => {
207
167
  if (name !== void 0) return void 0;
208
168
  return {};
209
- };
169
+ });
210
170
  }
211
-
212
171
  //#endregion
213
- export { createApiGatewayCookies, createApiGatewayHeaders, createCookieHeaderAccessor, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, createObjectHeaders, publishConstructEvents, publishEvents };
214
- //# sourceMappingURL=lazyAccessors-BoJN3SMd.mjs.map
172
+ export { createHonoHeaders as a, createObjectHeaders as c, createHonoCookies as i, createApiGatewayHeaders as n, createNoopCookies as o, createCookieHeaderAccessor as r, createNoopHeaders as s, createApiGatewayCookies as t };
173
+
174
+ //# sourceMappingURL=lazyAccessors-CFanua0O.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazyAccessors-CFanua0O.mjs","names":[],"sources":["../src/endpoints/lazyAccessors.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"],"mappings":"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"}