@geekmidas/constructs 10.0.0-alpha.4 → 10.0.0-alpha.41

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 (370) 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-CMEGfRs8.d.cts} +21 -8
  11. package/dist/Cron-CMEGfRs8.d.cts.map +1 -0
  12. package/dist/{Cron-ByxdOfpE.d.mts → Cron-D6X4-xjB.d.mts} +21 -8
  13. package/dist/Cron-D6X4-xjB.d.mts.map +1 -0
  14. package/dist/CronBuilder-CEK7aOqD.d.cts +46 -0
  15. package/dist/CronBuilder-CEK7aOqD.d.cts.map +1 -0
  16. package/dist/CronBuilder-DB35T5dL.cjs +116 -0
  17. package/dist/CronBuilder-DB35T5dL.cjs.map +1 -0
  18. package/dist/CronBuilder-Dv0IlZs0.mjs +104 -0
  19. package/dist/CronBuilder-Dv0IlZs0.mjs.map +1 -0
  20. package/dist/CronBuilder-O_gvButp.d.mts +46 -0
  21. package/dist/CronBuilder-O_gvButp.d.mts.map +1 -0
  22. package/dist/{Endpoint-Dij_wOcc.mjs → Endpoint-CQAeh1Rh.mjs} +117 -109
  23. package/dist/Endpoint-CQAeh1Rh.mjs.map +1 -0
  24. package/dist/{Endpoint-DODn1RhN.cjs → Endpoint-D1L9qu5C.cjs} +145 -131
  25. package/dist/Endpoint-D1L9qu5C.cjs.map +1 -0
  26. package/dist/{Endpoint-2Wg7T7Cq.d.mts → Endpoint-Dp5AKIXl.d.cts} +69 -93
  27. package/dist/Endpoint-Dp5AKIXl.d.cts.map +1 -0
  28. package/dist/{Endpoint-DrD8a1yH.d.cts → Endpoint-DtI7heFm.d.mts} +70 -94
  29. package/dist/Endpoint-DtI7heFm.d.mts.map +1 -0
  30. package/dist/{EndpointFactory-b4ituq-s.mjs → EndpointFactory-BBdNeaGJ.mjs} +39 -74
  31. package/dist/EndpointFactory-BBdNeaGJ.mjs.map +1 -0
  32. package/dist/{EndpointFactory-BHFMmFkV.cjs → EndpointFactory-BZOCOaK6.cjs} +75 -110
  33. package/dist/EndpointFactory-BZOCOaK6.cjs.map +1 -0
  34. package/dist/{index-BxHDdy6a.d.mts → EndpointFactory-CgMDvERK.d.mts} +63 -133
  35. package/dist/EndpointFactory-CgMDvERK.d.mts.map +1 -0
  36. package/dist/{index-B8g8POkr.d.cts → EndpointFactory-FeFRmlDZ.d.cts} +62 -132
  37. package/dist/EndpointFactory-FeFRmlDZ.d.cts.map +1 -0
  38. package/dist/{HonoEndpointAdaptor-BM2jbWht.mjs → HonoEndpointAdaptor-Aui-x9Lg.mjs} +41 -47
  39. package/dist/HonoEndpointAdaptor-Aui-x9Lg.mjs.map +1 -0
  40. package/dist/{HonoEndpointAdaptor-De6IlBZe.cjs → HonoEndpointAdaptor-Cq99r9H7.cjs} +50 -53
  41. package/dist/HonoEndpointAdaptor-Cq99r9H7.cjs.map +1 -0
  42. package/dist/Queue-C1uDgjxt.mjs +100 -0
  43. package/dist/Queue-C1uDgjxt.mjs.map +1 -0
  44. package/dist/Queue-Ckmudcm8.cjs +105 -0
  45. package/dist/Queue-Ckmudcm8.cjs.map +1 -0
  46. package/dist/{Queue-D7ZuwBhy.d.cts → Queue-CpQIGB_2.d.cts} +28 -40
  47. package/dist/Queue-CpQIGB_2.d.cts.map +1 -0
  48. package/dist/{Queue-gVGfi2Yk.d.mts → Queue-YmvN2vEP.d.mts} +28 -40
  49. package/dist/Queue-YmvN2vEP.d.mts.map +1 -0
  50. package/dist/QueueBuilder-CJNcv4dy.cjs +112 -0
  51. package/dist/QueueBuilder-CJNcv4dy.cjs.map +1 -0
  52. package/dist/QueueBuilder-CM0WUxfw.d.mts +62 -0
  53. package/dist/QueueBuilder-CM0WUxfw.d.mts.map +1 -0
  54. package/dist/QueueBuilder-XEnnOWGe.d.cts +62 -0
  55. package/dist/QueueBuilder-XEnnOWGe.d.cts.map +1 -0
  56. package/dist/QueueBuilder-XuPKZwKH.mjs +95 -0
  57. package/dist/QueueBuilder-XuPKZwKH.mjs.map +1 -0
  58. package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-B91YSkZt.d.cts} +14 -16
  59. package/dist/Subscriber-B91YSkZt.d.cts.map +1 -0
  60. package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-BjHYe5hK.d.mts} +14 -16
  61. package/dist/Subscriber-BjHYe5hK.d.mts.map +1 -0
  62. package/dist/SubscriberBuilder-BSpQX1JT.d.cts +55 -0
  63. package/dist/SubscriberBuilder-BSpQX1JT.d.cts.map +1 -0
  64. package/dist/SubscriberBuilder-BhMphk4z.d.mts +55 -0
  65. package/dist/SubscriberBuilder-BhMphk4z.d.mts.map +1 -0
  66. package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-Duk028pD.cjs} +34 -37
  67. package/dist/SubscriberBuilder-Duk028pD.cjs.map +1 -0
  68. package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-DzQUWE08.mjs} +23 -25
  69. package/dist/SubscriberBuilder-DzQUWE08.mjs.map +1 -0
  70. package/dist/Topic-CkxOTrMv.cjs +104 -0
  71. package/dist/Topic-CkxOTrMv.cjs.map +1 -0
  72. package/dist/Topic-hPffOsot.mjs +99 -0
  73. package/dist/Topic-hPffOsot.mjs.map +1 -0
  74. package/dist/adaptors/aws.cjs +171 -108
  75. package/dist/adaptors/aws.cjs.map +1 -1
  76. package/dist/adaptors/aws.d.cts +75 -43
  77. package/dist/adaptors/aws.d.cts.map +1 -1
  78. package/dist/adaptors/aws.d.mts +76 -44
  79. package/dist/adaptors/aws.d.mts.map +1 -1
  80. package/dist/adaptors/aws.mjs +143 -83
  81. package/dist/adaptors/aws.mjs.map +1 -1
  82. package/dist/adaptors/hono.cjs +3 -10
  83. package/dist/adaptors/hono.d.cts +7 -16
  84. package/dist/adaptors/hono.d.cts.map +1 -1
  85. package/dist/adaptors/hono.d.mts +8 -17
  86. package/dist/adaptors/hono.d.mts.map +1 -1
  87. package/dist/adaptors/hono.mjs +2 -10
  88. package/dist/adaptors/testing.cjs +515 -87
  89. package/dist/adaptors/testing.cjs.map +1 -1
  90. package/dist/adaptors/testing.d.cts +250 -48
  91. package/dist/adaptors/testing.d.cts.map +1 -1
  92. package/dist/adaptors/testing.d.mts +250 -48
  93. package/dist/adaptors/testing.d.mts.map +1 -1
  94. package/dist/adaptors/testing.mjs +484 -68
  95. package/dist/adaptors/testing.mjs.map +1 -1
  96. package/dist/auth-CMwml9QN.d.mts +188 -0
  97. package/dist/auth-CMwml9QN.d.mts.map +1 -0
  98. package/dist/auth-rVRDjIw_.d.cts +188 -0
  99. package/dist/auth-rVRDjIw_.d.cts.map +1 -0
  100. package/dist/auth.cjs +171 -31
  101. package/dist/auth.cjs.map +1 -1
  102. package/dist/auth.d.cts +2 -108
  103. package/dist/auth.d.mts +2 -108
  104. package/dist/auth.mjs +160 -24
  105. package/dist/auth.mjs.map +1 -1
  106. package/dist/{cache-BrRz3fEB.d.mts → cache-C9a_hVCc.d.cts} +4 -7
  107. package/dist/cache-C9a_hVCc.d.cts.map +1 -0
  108. package/dist/{cache-BtZY_tHe.d.cts → cache-CeTMI8LR.d.mts} +4 -7
  109. package/dist/cache-CeTMI8LR.d.mts.map +1 -0
  110. package/dist/cache.cjs +68 -2
  111. package/dist/cache.cjs.map +1 -0
  112. package/dist/cache.d.cts +1 -2
  113. package/dist/cache.d.mts +1 -2
  114. package/dist/cache.mjs +67 -2
  115. package/dist/cache.mjs.map +1 -0
  116. package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
  117. package/dist/clone-EKNovYHu.mjs.map +1 -0
  118. package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
  119. package/dist/clone-UGJpvQnL.cjs.map +1 -0
  120. package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-_3zgxzXl.d.mts} +20 -11
  121. package/dist/construct-interface-_3zgxzXl.d.mts.map +1 -0
  122. package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-_xi4BPN8.d.cts} +20 -11
  123. package/dist/construct-interface-_xi4BPN8.d.cts.map +1 -0
  124. package/dist/construct-interface.cjs +87 -7
  125. package/dist/construct-interface.cjs.map +1 -0
  126. package/dist/construct-interface.d.cts +2 -2
  127. package/dist/construct-interface.d.mts +2 -2
  128. package/dist/construct-interface.mjs +81 -2
  129. package/dist/construct-interface.mjs.map +1 -0
  130. package/dist/credential.cjs +63 -16
  131. package/dist/credential.cjs.map +1 -1
  132. package/dist/credential.d.cts +16 -9
  133. package/dist/credential.d.cts.map +1 -1
  134. package/dist/credential.d.mts +16 -9
  135. package/dist/credential.d.mts.map +1 -1
  136. package/dist/credential.mjs +58 -12
  137. package/dist/credential.mjs.map +1 -1
  138. package/dist/crons/index.cjs +68 -10
  139. package/dist/crons/index.cjs.map +1 -1
  140. package/dist/crons/index.d.cts +32 -14
  141. package/dist/crons/index.d.cts.map +1 -1
  142. package/dist/crons/index.d.mts +32 -14
  143. package/dist/crons/index.d.mts.map +1 -1
  144. package/dist/crons/index.mjs +66 -10
  145. package/dist/crons/index.mjs.map +1 -1
  146. package/dist/database/kysely.cjs +40 -15
  147. package/dist/database/kysely.cjs.map +1 -1
  148. package/dist/database/kysely.d.cts +2 -152
  149. package/dist/database/kysely.d.mts +2 -152
  150. package/dist/database/kysely.mjs +28 -5
  151. package/dist/database/kysely.mjs.map +1 -1
  152. package/dist/email.cjs +25 -12
  153. package/dist/email.cjs.map +1 -1
  154. package/dist/email.d.cts +3 -7
  155. package/dist/email.d.cts.map +1 -1
  156. package/dist/email.d.mts +3 -7
  157. package/dist/email.d.mts.map +1 -1
  158. package/dist/email.mjs +16 -3
  159. package/dist/email.mjs.map +1 -1
  160. package/dist/endpoints/index.cjs +8 -10
  161. package/dist/endpoints/index.d.cts +51 -7
  162. package/dist/endpoints/index.d.cts.map +1 -0
  163. package/dist/endpoints/index.d.mts +51 -7
  164. package/dist/endpoints/index.d.mts.map +1 -0
  165. package/dist/endpoints/index.mjs +6 -10
  166. package/dist/external-api-DS3mujT5.d.mts +86 -0
  167. package/dist/external-api-DS3mujT5.d.mts.map +1 -0
  168. package/dist/external-api-LBfE-q3g.d.cts +86 -0
  169. package/dist/external-api-LBfE-q3g.d.cts.map +1 -0
  170. package/dist/external-api.cjs +124 -0
  171. package/dist/external-api.cjs.map +1 -0
  172. package/dist/external-api.d.cts +2 -0
  173. package/dist/external-api.d.mts +2 -0
  174. package/dist/external-api.mjs +121 -0
  175. package/dist/external-api.mjs.map +1 -0
  176. package/dist/file-server.cjs +42 -10
  177. package/dist/file-server.cjs.map +1 -1
  178. package/dist/file-server.d.cts +6 -10
  179. package/dist/file-server.d.cts.map +1 -1
  180. package/dist/file-server.d.mts +6 -10
  181. package/dist/file-server.d.mts.map +1 -1
  182. package/dist/file-server.mjs +34 -2
  183. package/dist/file-server.mjs.map +1 -1
  184. package/dist/functions/index.cjs +2 -6
  185. package/dist/functions/index.d.cts +2 -4
  186. package/dist/functions/index.d.mts +2 -4
  187. package/dist/functions/index.mjs +2 -6
  188. package/dist/{functions-Ck21Uyq0.mjs → functions-DCIfCRR-.mjs} +371 -241
  189. package/dist/functions-DCIfCRR-.mjs.map +1 -0
  190. package/dist/{functions-DJJA7VGc.cjs → functions-ZH60FE7H.cjs} +409 -273
  191. package/dist/functions-ZH60FE7H.cjs.map +1 -0
  192. package/dist/{index-AIfVzkhi.d.cts → index-B0kxstwf.d.cts} +49 -42
  193. package/dist/index-B0kxstwf.d.cts.map +1 -0
  194. package/dist/index-CeEtxDmK.d.cts +79 -0
  195. package/dist/index-CeEtxDmK.d.cts.map +1 -0
  196. package/dist/index-CeEtxDmK.d.mts +79 -0
  197. package/dist/index-CeEtxDmK.d.mts.map +1 -0
  198. package/dist/{index-CubPzHd9.d.mts → index-CjVEjOw0.d.mts} +49 -42
  199. package/dist/index-CjVEjOw0.d.mts.map +1 -0
  200. package/dist/index.cjs +3 -3
  201. package/dist/index.d.cts +4 -4
  202. package/dist/index.d.mts +4 -4
  203. package/dist/index.mjs +2 -3
  204. package/dist/kysely-BJ8IQ_1P.d.mts +159 -0
  205. package/dist/kysely-BJ8IQ_1P.d.mts.map +1 -0
  206. package/dist/kysely-DVF8wOT4.d.cts +159 -0
  207. package/dist/kysely-DVF8wOT4.d.cts.map +1 -0
  208. package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-CFanua0O.mjs} +20 -60
  209. package/dist/lazyAccessors-CFanua0O.mjs.map +1 -0
  210. package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-hJKGv8Ay.cjs} +60 -113
  211. package/dist/lazyAccessors-hJKGv8Ay.cjs.map +1 -0
  212. package/dist/mobile-app.cjs +70 -0
  213. package/dist/mobile-app.cjs.map +1 -0
  214. package/dist/mobile-app.d.cts +61 -0
  215. package/dist/mobile-app.d.cts.map +1 -0
  216. package/dist/mobile-app.d.mts +61 -0
  217. package/dist/mobile-app.d.mts.map +1 -0
  218. package/dist/mobile-app.mjs +69 -0
  219. package/dist/mobile-app.mjs.map +1 -0
  220. package/dist/object-storage.cjs +18 -10
  221. package/dist/object-storage.cjs.map +1 -1
  222. package/dist/object-storage.d.cts +3 -7
  223. package/dist/object-storage.d.cts.map +1 -1
  224. package/dist/object-storage.d.mts +3 -7
  225. package/dist/object-storage.d.mts.map +1 -1
  226. package/dist/object-storage.mjs +11 -3
  227. package/dist/object-storage.mjs.map +1 -1
  228. package/dist/{processAudits-Dmts9H_b.mjs → processAudits-BpRlPQMW.mjs} +16 -19
  229. package/dist/processAudits-BpRlPQMW.mjs.map +1 -0
  230. package/dist/{processAudits-CGqttuXm.cjs → processAudits-D_2W5x8k.cjs} +26 -30
  231. package/dist/processAudits-D_2W5x8k.cjs.map +1 -0
  232. package/dist/queue/index.cjs +6 -189
  233. package/dist/queue/index.d.cts +3 -60
  234. package/dist/queue/index.d.mts +3 -60
  235. package/dist/queue/index.mjs +3 -186
  236. package/dist/rest-api.cjs +87 -63
  237. package/dist/rest-api.cjs.map +1 -1
  238. package/dist/rest-api.d.cts +62 -61
  239. package/dist/rest-api.d.cts.map +1 -1
  240. package/dist/rest-api.d.mts +62 -61
  241. package/dist/rest-api.d.mts.map +1 -1
  242. package/dist/rest-api.mjs +79 -55
  243. package/dist/rest-api.mjs.map +1 -1
  244. package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
  245. package/dist/site.cjs +33 -9
  246. package/dist/site.cjs.map +1 -1
  247. package/dist/site.d.cts +11 -22
  248. package/dist/site.d.cts.map +1 -1
  249. package/dist/site.d.mts +11 -22
  250. package/dist/site.d.mts.map +1 -1
  251. package/dist/site.mjs +29 -5
  252. package/dist/site.mjs.map +1 -1
  253. package/dist/subscribers/index.cjs +2 -11
  254. package/dist/subscribers/index.d.cts +3 -14
  255. package/dist/subscribers/index.d.mts +3 -14
  256. package/dist/subscribers/index.mjs +2 -11
  257. package/dist/surfaceEnv-CNimK76p.cjs +56 -0
  258. package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
  259. package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
  260. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
  261. package/dist/{telemetry-C3L0iS28.d.cts → telemetry-DGcFlVpB.d.cts} +2 -5
  262. package/dist/telemetry-DGcFlVpB.d.cts.map +1 -0
  263. package/dist/{telemetry-D7bVFLGi.d.mts → telemetry-DGcFlVpB.d.mts} +2 -5
  264. package/dist/telemetry-DGcFlVpB.d.mts.map +1 -0
  265. package/dist/topic/index.cjs +3 -137
  266. package/dist/topic/index.d.cts +2 -32
  267. package/dist/topic/index.d.mts +2 -32
  268. package/dist/topic/index.mjs +2 -134
  269. package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
  270. package/dist/types-DMuSQeLL.d.cts.map +1 -0
  271. package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
  272. package/dist/types-DMuSQeLL.d.mts.map +1 -0
  273. package/dist/types.d.cts +1 -1
  274. package/dist/types.d.mts +1 -1
  275. package/dist/types.mjs +1 -0
  276. package/dist/worker.cjs +118 -35
  277. package/dist/worker.cjs.map +1 -1
  278. package/dist/worker.d.cts +95 -42
  279. package/dist/worker.d.cts.map +1 -1
  280. package/dist/worker.d.mts +95 -42
  281. package/dist/worker.d.mts.map +1 -1
  282. package/dist/worker.mjs +113 -30
  283. package/dist/worker.mjs.map +1 -1
  284. package/package.json +66 -41
  285. package/dist/Construct-BD5neF7w.mjs.map +0 -1
  286. package/dist/Construct-C0ijr2qp.d.cts +0 -117
  287. package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
  288. package/dist/Construct-Ct8nalEi.d.mts +0 -117
  289. package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
  290. package/dist/Construct-CyS3RpTL.cjs.map +0 -1
  291. package/dist/Cron-B2OFsfDM.d.cts.map +0 -1
  292. package/dist/Cron-ByxdOfpE.d.mts.map +0 -1
  293. package/dist/CronBuilder-BL0AP6fs.d.mts +0 -44
  294. package/dist/CronBuilder-BL0AP6fs.d.mts.map +0 -1
  295. package/dist/CronBuilder-CdibiHNB.mjs +0 -84
  296. package/dist/CronBuilder-CdibiHNB.mjs.map +0 -1
  297. package/dist/CronBuilder-DyUr6nYz.cjs +0 -96
  298. package/dist/CronBuilder-DyUr6nYz.cjs.map +0 -1
  299. package/dist/CronBuilder-LSJMfqnq.d.cts +0 -44
  300. package/dist/CronBuilder-LSJMfqnq.d.cts.map +0 -1
  301. package/dist/Endpoint-2Wg7T7Cq.d.mts.map +0 -1
  302. package/dist/Endpoint-DODn1RhN.cjs.map +0 -1
  303. package/dist/Endpoint-Dij_wOcc.mjs.map +0 -1
  304. package/dist/Endpoint-DrD8a1yH.d.cts.map +0 -1
  305. package/dist/EndpointFactory-BHFMmFkV.cjs.map +0 -1
  306. package/dist/EndpointFactory-b4ituq-s.mjs.map +0 -1
  307. package/dist/HonoEndpointAdaptor-BM2jbWht.mjs.map +0 -1
  308. package/dist/HonoEndpointAdaptor-De6IlBZe.cjs.map +0 -1
  309. package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
  310. package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
  311. package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
  312. package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
  313. package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
  314. package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
  315. package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
  316. package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
  317. package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
  318. package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
  319. package/dist/Topic-19QeHBIR.d.cts +0 -91
  320. package/dist/Topic-19QeHBIR.d.cts.map +0 -1
  321. package/dist/Topic-DuFeqkBh.d.mts +0 -91
  322. package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
  323. package/dist/auth.d.cts.map +0 -1
  324. package/dist/auth.d.mts.map +0 -1
  325. package/dist/cache-0ANvRQnD.mjs +0 -51
  326. package/dist/cache-0ANvRQnD.mjs.map +0 -1
  327. package/dist/cache-3WSvAulx.cjs +0 -57
  328. package/dist/cache-3WSvAulx.cjs.map +0 -1
  329. package/dist/cache-BrRz3fEB.d.mts.map +0 -1
  330. package/dist/cache-BtZY_tHe.d.cts.map +0 -1
  331. package/dist/clone-DblgEZZa.mjs.map +0 -1
  332. package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
  333. package/dist/construct-interface-BfjcOD_E.cjs +0 -117
  334. package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
  335. package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
  336. package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
  337. package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
  338. package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
  339. package/dist/database/kysely.d.cts.map +0 -1
  340. package/dist/database/kysely.d.mts.map +0 -1
  341. package/dist/functions-Ck21Uyq0.mjs.map +0 -1
  342. package/dist/functions-DJJA7VGc.cjs.map +0 -1
  343. package/dist/index-AIfVzkhi.d.cts.map +0 -1
  344. package/dist/index-B8g8POkr.d.cts.map +0 -1
  345. package/dist/index-BxHDdy6a.d.mts.map +0 -1
  346. package/dist/index-CubPzHd9.d.mts.map +0 -1
  347. package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
  348. package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
  349. package/dist/processAudits-CGqttuXm.cjs.map +0 -1
  350. package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
  351. package/dist/queue/index.cjs.map +0 -1
  352. package/dist/queue/index.d.cts.map +0 -1
  353. package/dist/queue/index.d.mts.map +0 -1
  354. package/dist/queue/index.mjs.map +0 -1
  355. package/dist/subscribers/index.cjs.map +0 -1
  356. package/dist/subscribers/index.d.cts.map +0 -1
  357. package/dist/subscribers/index.d.mts.map +0 -1
  358. package/dist/subscribers/index.mjs.map +0 -1
  359. package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
  360. package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
  361. package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
  362. package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
  363. package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
  364. package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
  365. package/dist/topic/index.cjs.map +0 -1
  366. package/dist/topic/index.d.cts.map +0 -1
  367. package/dist/topic/index.d.mts.map +0 -1
  368. package/dist/topic/index.mjs.map +0 -1
  369. package/dist/types-BlAkSuGI.d.cts.map +0 -1
  370. package/dist/types-aKksMEWL.d.mts.map +0 -1
@@ -0,0 +1,159 @@
1
+ import { n as Construct } from "./construct-interface-_xi4BPN8.cjs";
2
+ import { t as Cache } from "./cache-C9a_hVCc.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-DVF8wOT4.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kysely-DVF8wOT4.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":";;;;;;;AAgBA,SAAgB,kBAAkB,GAAsB;CACvD,IAAI,aAA4C;CAEhD,SAAS,QAAiB;EACzB,IAAI,QAAQ,KAAA,GAEX,OAAO,EAAE,IAAI,OAAO,GAAG;EAGxB,IAAI,CAAC,YACJ,aAAa,EAAE,IAAI,OAAO;EAE3B,OAAO;CACR;AACD;;;;;;AAOA,SAAgB,kBAAkB,GAAsB;CACvD,IAAI,aAA4C;CAEhD,SAAS,SAAkB;EAC1B,IAAI,SAAS,KAAA,GAEZ,OAAO,UAAU,GAAG,IAAI;EAGzB,IAAI,CAAC,YAAY;GAChB,aAAa,CAAC;GACd,MAAM,eAAe,EAAE,IAAI,OAAO,QAAQ;GAC1C,IAAI,cACH,KAAK,MAAM,QAAQ,aAAa,MAAM,GAAG,GAAG;IAC3C,MAAM,UAAU,KAAK,KAAK;IAC1B,MAAM,UAAU,QAAQ,QAAQ,GAAG;IACnC,IAAI,UAAU,GAAG;KAChB,MAAM,MAAM,QAAQ,MAAM,GAAG,OAAO;KACpC,MAAM,QAAQ,QAAQ,MAAM,UAAU,CAAC;KACvC,WAAW,OAAO;IACnB;GACD;EAEF;EACA,OAAO;CACR;AACD;;;;;AAMA,SA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AAKA,SAAgB,oBAA8B;CAC7C,SAAS,SAAkB;EAC1B,IAAI,SAAS,KAAA,GAAW,OAAO,KAAA;EAC/B,OAAO,CAAC;CACT;AACD"}
@@ -1,45 +1,4 @@
1
- const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const hono_cookie = require_chunk.__toESM(require("hono/cookie"));
3
-
4
- //#region src/publisher.ts
5
- async function publishEvents(logger, serviceDiscovery, ev = [], response, publisherService) {
6
- try {
7
- if (!ev?.length) {
8
- logger.debug("No events to publish");
9
- return;
10
- }
11
- if (!publisherService) {
12
- logger.warn("No publisher service available");
13
- return;
14
- }
15
- const services = await serviceDiscovery.register([publisherService]);
16
- const publisher = services[publisherService.serviceName];
17
- const events = [];
18
- for (const { when, payload, type,...e } of ev) {
19
- logger.debug({ event: type }, "Processing event");
20
- const resolvedPayload = await payload(response);
21
- const event = {
22
- ...e,
23
- type,
24
- payload: resolvedPayload
25
- };
26
- if (!when || when(response)) events.push(event);
27
- }
28
- if (events.length) {
29
- logger.debug({ eventCount: ev.length }, "Publishing events");
30
- await publisher.publish(events).catch((err) => {
31
- logger.error(err, "Failed to publish events");
32
- });
33
- }
34
- } catch (error) {
35
- logger.error(error, "Something went wrong publishing events");
36
- }
37
- }
38
- async function publishConstructEvents(construct, response, serviceDiscovery, logger = construct.logger) {
39
- return publishEvents(logger, serviceDiscovery, construct.events, response, construct.publisherService);
40
- }
41
-
42
- //#endregion
1
+ let hono_cookie = require("hono/cookie");
43
2
  //#region src/endpoints/lazyAccessors.ts
44
3
  /**
45
4
  * Create a lazy header accessor for Hono.
@@ -48,11 +7,11 @@ async function publishConstructEvents(construct, response, serviceDiscovery, log
48
7
  */
49
8
  function createHonoHeaders(c) {
50
9
  let allHeaders = null;
51
- return (key) => {
10
+ return ((key) => {
52
11
  if (key !== void 0) return c.req.header(key);
53
12
  if (!allHeaders) allHeaders = c.req.header();
54
13
  return allHeaders;
55
- };
14
+ });
56
15
  }
57
16
  /**
58
17
  * Create a lazy cookie accessor for Hono.
@@ -61,7 +20,7 @@ function createHonoHeaders(c) {
61
20
  */
62
21
  function createHonoCookies(c) {
63
22
  let allCookies = null;
64
- return (name) => {
23
+ return ((name) => {
65
24
  if (name !== void 0) return (0, hono_cookie.getCookie)(c, name);
66
25
  if (!allCookies) {
67
26
  allCookies = {};
@@ -77,7 +36,7 @@ function createHonoCookies(c) {
77
36
  }
78
37
  }
79
38
  return allCookies;
80
- };
39
+ });
81
40
  }
82
41
  /**
83
42
  * Create a lazy header accessor for API Gateway events.
@@ -94,17 +53,17 @@ function createApiGatewayHeaders(headers) {
94
53
  }
95
54
  return normalizedHeaders;
96
55
  };
97
- return (key) => {
56
+ return ((key) => {
98
57
  if (key !== void 0) {
99
58
  if (headers) {
100
59
  const direct = headers[key] ?? headers[key.toLowerCase()];
101
60
  if (direct !== void 0) return direct;
102
61
  return normalize()[key.toLowerCase()];
103
62
  }
104
- return void 0;
63
+ return;
105
64
  }
106
65
  return normalize();
107
- };
66
+ });
108
67
  }
109
68
  /**
110
69
  * Create a lazy cookie accessor for API Gateway events.
@@ -135,10 +94,10 @@ function createApiGatewayCookies(cookies, cookieHeader) {
135
94
  }
136
95
  return parsed;
137
96
  };
138
- return (name) => {
97
+ return ((name) => {
139
98
  if (name !== void 0) return parse()[name];
140
99
  return parse();
141
- };
100
+ });
142
101
  }
143
102
  /**
144
103
  * Create a lazy header accessor for plain object headers (test adaptor, etc).
@@ -146,7 +105,7 @@ function createApiGatewayCookies(cookies, cookieHeader) {
146
105
  */
147
106
  function createObjectHeaders(headers) {
148
107
  let normalized = null;
149
- return (key) => {
108
+ return ((key) => {
150
109
  if (key !== void 0) {
151
110
  if (headers) {
152
111
  const direct = headers[key] ?? headers[key.toLowerCase()];
@@ -163,7 +122,7 @@ function createObjectHeaders(headers) {
163
122
  for (const [k, v] of Object.entries(headers)) normalized[k.toLowerCase()] = v;
164
123
  }
165
124
  return normalized ?? {};
166
- };
125
+ });
167
126
  }
168
127
  /**
169
128
  * Create a lazy cookie accessor from a cookie header string.
@@ -186,89 +145,77 @@ function createCookieHeaderAccessor(cookieHeader) {
186
145
  }
187
146
  return parsed;
188
147
  };
189
- return (name) => {
148
+ return ((name) => {
190
149
  if (name !== void 0) return parse()[name];
191
150
  return parse();
192
- };
151
+ });
193
152
  }
194
153
  /**
195
154
  * Create a no-op header accessor (for minimal endpoints that don't use headers).
196
155
  */
197
156
  function createNoopHeaders() {
198
- return (key) => {
157
+ return ((key) => {
199
158
  if (key !== void 0) return void 0;
200
159
  return {};
201
- };
160
+ });
202
161
  }
203
162
  /**
204
163
  * Create a no-op cookie accessor (for minimal endpoints that don't use cookies).
205
164
  */
206
165
  function createNoopCookies() {
207
- return (name) => {
166
+ return ((name) => {
208
167
  if (name !== void 0) return void 0;
209
168
  return {};
210
- };
169
+ });
211
170
  }
212
-
213
171
  //#endregion
214
- Object.defineProperty(exports, 'createApiGatewayCookies', {
215
- enumerable: true,
216
- get: function () {
217
- return createApiGatewayCookies;
218
- }
219
- });
220
- Object.defineProperty(exports, 'createApiGatewayHeaders', {
221
- enumerable: true,
222
- get: function () {
223
- return createApiGatewayHeaders;
224
- }
225
- });
226
- Object.defineProperty(exports, 'createCookieHeaderAccessor', {
227
- enumerable: true,
228
- get: function () {
229
- return createCookieHeaderAccessor;
230
- }
172
+ Object.defineProperty(exports, "createApiGatewayCookies", {
173
+ enumerable: true,
174
+ get: function() {
175
+ return createApiGatewayCookies;
176
+ }
231
177
  });
232
- Object.defineProperty(exports, 'createHonoCookies', {
233
- enumerable: true,
234
- get: function () {
235
- return createHonoCookies;
236
- }
178
+ Object.defineProperty(exports, "createApiGatewayHeaders", {
179
+ enumerable: true,
180
+ get: function() {
181
+ return createApiGatewayHeaders;
182
+ }
237
183
  });
238
- Object.defineProperty(exports, 'createHonoHeaders', {
239
- enumerable: true,
240
- get: function () {
241
- return createHonoHeaders;
242
- }
184
+ Object.defineProperty(exports, "createCookieHeaderAccessor", {
185
+ enumerable: true,
186
+ get: function() {
187
+ return createCookieHeaderAccessor;
188
+ }
243
189
  });
244
- Object.defineProperty(exports, 'createNoopCookies', {
245
- enumerable: true,
246
- get: function () {
247
- return createNoopCookies;
248
- }
190
+ Object.defineProperty(exports, "createHonoCookies", {
191
+ enumerable: true,
192
+ get: function() {
193
+ return createHonoCookies;
194
+ }
249
195
  });
250
- Object.defineProperty(exports, 'createNoopHeaders', {
251
- enumerable: true,
252
- get: function () {
253
- return createNoopHeaders;
254
- }
196
+ Object.defineProperty(exports, "createHonoHeaders", {
197
+ enumerable: true,
198
+ get: function() {
199
+ return createHonoHeaders;
200
+ }
255
201
  });
256
- Object.defineProperty(exports, 'createObjectHeaders', {
257
- enumerable: true,
258
- get: function () {
259
- return createObjectHeaders;
260
- }
202
+ Object.defineProperty(exports, "createNoopCookies", {
203
+ enumerable: true,
204
+ get: function() {
205
+ return createNoopCookies;
206
+ }
261
207
  });
262
- Object.defineProperty(exports, 'publishConstructEvents', {
263
- enumerable: true,
264
- get: function () {
265
- return publishConstructEvents;
266
- }
208
+ Object.defineProperty(exports, "createNoopHeaders", {
209
+ enumerable: true,
210
+ get: function() {
211
+ return createNoopHeaders;
212
+ }
267
213
  });
268
- Object.defineProperty(exports, 'publishEvents', {
269
- enumerable: true,
270
- get: function () {
271
- return publishEvents;
272
- }
214
+ Object.defineProperty(exports, "createObjectHeaders", {
215
+ enumerable: true,
216
+ get: function() {
217
+ return createObjectHeaders;
218
+ }
273
219
  });
274
- //# sourceMappingURL=lazyAccessors-e3j2oE2m.cjs.map
220
+
221
+ //# sourceMappingURL=lazyAccessors-hJKGv8Ay.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazyAccessors-hJKGv8Ay.cjs","names":["getCookie"],"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":";;;;;;;AAgBA,SAAgB,kBAAkB,GAAsB;CACvD,IAAI,aAA4C;CAEhD,SAAS,QAAiB;EACzB,IAAI,QAAQ,KAAA,GAEX,OAAO,EAAE,IAAI,OAAO,GAAG;EAGxB,IAAI,CAAC,YACJ,aAAa,EAAE,IAAI,OAAO;EAE3B,OAAO;CACR;AACD;;;;;;AAOA,SAAgB,kBAAkB,GAAsB;CACvD,IAAI,aAA4C;CAEhD,SAAS,SAAkB;EAC1B,IAAI,SAAS,KAAA,GAEZ,QAAA,GAAOA,YAAAA,UAAAA,CAAU,GAAG,IAAI;EAGzB,IAAI,CAAC,YAAY;GAChB,aAAa,CAAC;GACd,MAAM,eAAe,EAA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