@geekmidas/constructs 10.0.0-alpha.15 → 10.0.0-alpha.150

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. package/README.md +222 -158
  2. package/dist/Construct-127M7yrl.d.cts +231 -0
  3. package/dist/Construct-127M7yrl.d.cts.map +1 -0
  4. package/dist/{Construct-BeYVu_QF.mjs → Construct-CGuc_Ijk.mjs} +8 -9
  5. package/dist/Construct-CGuc_Ijk.mjs.map +1 -0
  6. package/dist/{Construct-DqdlARxq.cjs → Construct-DorKS0Ua.cjs} +8 -9
  7. package/dist/Construct-DorKS0Ua.cjs.map +1 -0
  8. package/dist/Construct-DySlwh8o.d.mts +231 -0
  9. package/dist/Construct-DySlwh8o.d.mts.map +1 -0
  10. package/dist/{Cron-DKqnnTdH.d.cts → Cron-D8mB_cPX.d.mts} +16 -9
  11. package/dist/Cron-D8mB_cPX.d.mts.map +1 -0
  12. package/dist/{Cron-SyqS5oWJ.d.mts → Cron-D_sfaMGz.d.cts} +16 -9
  13. package/dist/Cron-D_sfaMGz.d.cts.map +1 -0
  14. package/dist/{CronBuilder-D_0HNBTr.mjs → CronBuilder-BJ5LoadF.mjs} +28 -11
  15. package/dist/CronBuilder-BJ5LoadF.mjs.map +1 -0
  16. package/dist/{CronBuilder-BdnI6lxF.cjs → CronBuilder-B_NSP-Y5.cjs} +27 -10
  17. package/dist/CronBuilder-B_NSP-Y5.cjs.map +1 -0
  18. package/dist/CronBuilder-C91MVLSr.d.cts +47 -0
  19. package/dist/CronBuilder-C91MVLSr.d.cts.map +1 -0
  20. package/dist/CronBuilder-Cmajva3g.d.mts +47 -0
  21. package/dist/CronBuilder-Cmajva3g.d.mts.map +1 -0
  22. package/dist/Endpoint-52z1P0Ue.cjs +581 -0
  23. package/dist/Endpoint-52z1P0Ue.cjs.map +1 -0
  24. package/dist/{Endpoint-DuT4TEEq.d.mts → Endpoint-BbHh3Qoc.d.mts} +124 -43
  25. package/dist/Endpoint-BbHh3Qoc.d.mts.map +1 -0
  26. package/dist/{Endpoint-C6yyHpRS.d.cts → Endpoint-YYwjqtS1.d.cts} +122 -41
  27. package/dist/Endpoint-YYwjqtS1.d.cts.map +1 -0
  28. package/dist/Endpoint-sUOU7uLx.mjs +552 -0
  29. package/dist/Endpoint-sUOU7uLx.mjs.map +1 -0
  30. package/dist/{EndpointFactory-Bm3aKRdV.mjs → EndpointFactory-Bzi9Sl7r.mjs} +269 -53
  31. package/dist/EndpointFactory-Bzi9Sl7r.mjs.map +1 -0
  32. package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-Cf_Cs1ym.cjs} +309 -51
  33. package/dist/EndpointFactory-Cf_Cs1ym.cjs.map +1 -0
  34. package/dist/{index-BPSZ_Lp_.d.cts → EndpointFactory-Hh1r6J_C.d.cts} +187 -104
  35. package/dist/EndpointFactory-Hh1r6J_C.d.cts.map +1 -0
  36. package/dist/{index-BoZ-iisU.d.mts → EndpointFactory-qcLzi4f-.d.mts} +188 -105
  37. package/dist/EndpointFactory-qcLzi4f-.d.mts.map +1 -0
  38. package/dist/Function-BIEsY0Hm.d.cts +76 -0
  39. package/dist/Function-BIEsY0Hm.d.cts.map +1 -0
  40. package/dist/Function-DfMzTGS4.d.mts +76 -0
  41. package/dist/Function-DfMzTGS4.d.mts.map +1 -0
  42. package/dist/{HonoEndpointAdaptor-92zavCsV.cjs → HonoEndpointAdaptor-BXBdb2Bt.cjs} +79 -31
  43. package/dist/HonoEndpointAdaptor-BXBdb2Bt.cjs.map +1 -0
  44. package/dist/{HonoEndpointAdaptor-yYaU7jVJ.mjs → HonoEndpointAdaptor-DR3j7S35.mjs} +76 -28
  45. package/dist/HonoEndpointAdaptor-DR3j7S35.mjs.map +1 -0
  46. package/dist/ObjectSubscriberBuilder-Cv8C7yS1.d.mts +129 -0
  47. package/dist/ObjectSubscriberBuilder-Cv8C7yS1.d.mts.map +1 -0
  48. package/dist/ObjectSubscriberBuilder-LWkey_oq.d.cts +129 -0
  49. package/dist/ObjectSubscriberBuilder-LWkey_oq.d.cts.map +1 -0
  50. package/dist/ProcessorBuilder-CwfP-M33.d.mts +216 -0
  51. package/dist/ProcessorBuilder-CwfP-M33.d.mts.map +1 -0
  52. package/dist/ProcessorBuilder-_jdZlbfW.d.cts +216 -0
  53. package/dist/ProcessorBuilder-_jdZlbfW.d.cts.map +1 -0
  54. package/dist/{Queue-D9X6OoON.d.mts → Queue-BnK3UH8r.d.mts} +42 -41
  55. package/dist/Queue-BnK3UH8r.d.mts.map +1 -0
  56. package/dist/{Queue-DYPB2KWL.d.cts → Queue-C4rijiM7.d.cts} +43 -42
  57. package/dist/Queue-C4rijiM7.d.cts.map +1 -0
  58. package/dist/Queue-D4Iaidrs.cjs +109 -0
  59. package/dist/Queue-D4Iaidrs.cjs.map +1 -0
  60. package/dist/Queue-u8w8_HpE.mjs +104 -0
  61. package/dist/Queue-u8w8_HpE.mjs.map +1 -0
  62. package/dist/QueueBuilder-2wP5lEC8.mjs +118 -0
  63. package/dist/QueueBuilder-2wP5lEC8.mjs.map +1 -0
  64. package/dist/QueueBuilder-BxsZ9o5z.cjs +135 -0
  65. package/dist/QueueBuilder-BxsZ9o5z.cjs.map +1 -0
  66. package/dist/QueueBuilder-DmwFtLzQ.d.mts +75 -0
  67. package/dist/QueueBuilder-DmwFtLzQ.d.mts.map +1 -0
  68. package/dist/QueueBuilder-SQli59An.d.cts +75 -0
  69. package/dist/QueueBuilder-SQli59An.d.cts.map +1 -0
  70. package/dist/Subscriber-5rCX1Nph.d.cts +83 -0
  71. package/dist/Subscriber-5rCX1Nph.d.cts.map +1 -0
  72. package/dist/Subscriber-CW_Dl-YR.d.mts +83 -0
  73. package/dist/Subscriber-CW_Dl-YR.d.mts.map +1 -0
  74. package/dist/SubscriberBuilder-BL_GTcwh.mjs +237 -0
  75. package/dist/SubscriberBuilder-BL_GTcwh.mjs.map +1 -0
  76. package/dist/SubscriberBuilder-CWzKwX1p.cjs +260 -0
  77. package/dist/SubscriberBuilder-CWzKwX1p.cjs.map +1 -0
  78. package/dist/Topic-DN2gYJ-p.mjs +99 -0
  79. package/dist/Topic-DN2gYJ-p.mjs.map +1 -0
  80. package/dist/Topic-Dp9Q7Lj2.cjs +104 -0
  81. package/dist/Topic-Dp9Q7Lj2.cjs.map +1 -0
  82. package/dist/adaptors/aws.cjs +134 -160
  83. package/dist/adaptors/aws.cjs.map +1 -1
  84. package/dist/adaptors/aws.d.cts +57 -48
  85. package/dist/adaptors/aws.d.cts.map +1 -1
  86. package/dist/adaptors/aws.d.mts +58 -49
  87. package/dist/adaptors/aws.d.mts.map +1 -1
  88. package/dist/adaptors/aws.mjs +130 -157
  89. package/dist/adaptors/aws.mjs.map +1 -1
  90. package/dist/adaptors/hono.cjs +1 -1
  91. package/dist/adaptors/hono.d.cts +5 -6
  92. package/dist/adaptors/hono.d.cts.map +1 -1
  93. package/dist/adaptors/hono.d.mts +6 -7
  94. package/dist/adaptors/hono.d.mts.map +1 -1
  95. package/dist/adaptors/hono.mjs +1 -1
  96. package/dist/adaptors/testing.cjs +955 -38
  97. package/dist/adaptors/testing.cjs.map +1 -1
  98. package/dist/adaptors/testing.d.cts +437 -39
  99. package/dist/adaptors/testing.d.cts.map +1 -1
  100. package/dist/adaptors/testing.d.mts +436 -38
  101. package/dist/adaptors/testing.d.mts.map +1 -1
  102. package/dist/adaptors/testing.mjs +929 -34
  103. package/dist/adaptors/testing.mjs.map +1 -1
  104. package/dist/auth-BqWz2JxC.d.cts +274 -0
  105. package/dist/auth-BqWz2JxC.d.cts.map +1 -0
  106. package/dist/auth-DnB9H9KL.d.mts +274 -0
  107. package/dist/auth-DnB9H9KL.d.mts.map +1 -0
  108. package/dist/auth.cjs +320 -21
  109. package/dist/auth.cjs.map +1 -1
  110. package/dist/auth.d.cts +2 -104
  111. package/dist/auth.d.mts +2 -104
  112. package/dist/auth.mjs +316 -23
  113. package/dist/auth.mjs.map +1 -1
  114. package/dist/cache-CQjMNPrC.d.cts +44 -0
  115. package/dist/cache-CQjMNPrC.d.cts.map +1 -0
  116. package/dist/cache-e3tfMQ9g.d.mts +44 -0
  117. package/dist/cache-e3tfMQ9g.d.mts.map +1 -0
  118. package/dist/cache.d.cts +2 -43
  119. package/dist/cache.d.mts +2 -43
  120. package/dist/cipher-C1lEFX63.mjs +225 -0
  121. package/dist/cipher-C1lEFX63.mjs.map +1 -0
  122. package/dist/cipher-CVxfwLjk.cjs +332 -0
  123. package/dist/cipher-CVxfwLjk.cjs.map +1 -0
  124. package/dist/cipher-DSDxPRIp.d.cts +106 -0
  125. package/dist/cipher-DSDxPRIp.d.cts.map +1 -0
  126. package/dist/cipher-DSDxPRIp.d.mts +106 -0
  127. package/dist/cipher-DSDxPRIp.d.mts.map +1 -0
  128. package/dist/{construct-interface-DPlxfpoS.d.mts → construct-interface-CSA9VeWM.d.mts} +47 -8
  129. package/dist/construct-interface-CSA9VeWM.d.mts.map +1 -0
  130. package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-DugP0E5q.d.cts} +47 -8
  131. package/dist/construct-interface-DugP0E5q.d.cts.map +1 -0
  132. package/dist/construct-interface.cjs +38 -4
  133. package/dist/construct-interface.cjs.map +1 -1
  134. package/dist/construct-interface.d.cts +2 -2
  135. package/dist/construct-interface.d.mts +2 -2
  136. package/dist/construct-interface.mjs +37 -5
  137. package/dist/construct-interface.mjs.map +1 -1
  138. package/dist/credential-DYymbp_7.cjs +257 -0
  139. package/dist/credential-DYymbp_7.cjs.map +1 -0
  140. package/dist/credential-DfSAOOdY.mjs +222 -0
  141. package/dist/credential-DfSAOOdY.mjs.map +1 -0
  142. package/dist/credential.cjs +7 -129
  143. package/dist/credential.d.cts +2 -58
  144. package/dist/credential.d.mts +2 -58
  145. package/dist/credential.mjs +2 -128
  146. package/dist/crons/index.cjs +126 -1
  147. package/dist/crons/index.cjs.map +1 -1
  148. package/dist/crons/index.d.cts +43 -3
  149. package/dist/crons/index.d.cts.map +1 -1
  150. package/dist/crons/index.d.mts +43 -3
  151. package/dist/crons/index.d.mts.map +1 -1
  152. package/dist/crons/index.mjs +125 -2
  153. package/dist/crons/index.mjs.map +1 -1
  154. package/dist/database/kysely.cjs +3 -194
  155. package/dist/database/kysely.d.cts +2 -149
  156. package/dist/database/kysely.d.mts +2 -149
  157. package/dist/database/kysely.mjs +2 -192
  158. package/dist/email.d.cts +1 -1
  159. package/dist/email.d.cts.map +1 -1
  160. package/dist/email.d.mts +2 -2
  161. package/dist/email.d.mts.map +1 -1
  162. package/dist/encryption/kms.cjs +95 -0
  163. package/dist/encryption/kms.cjs.map +1 -0
  164. package/dist/encryption/kms.d.cts +7 -0
  165. package/dist/encryption/kms.d.cts.map +1 -0
  166. package/dist/encryption/kms.d.mts +7 -0
  167. package/dist/encryption/kms.d.mts.map +1 -0
  168. package/dist/encryption/kms.mjs +93 -0
  169. package/dist/encryption/kms.mjs.map +1 -0
  170. package/dist/encryption.cjs +116 -0
  171. package/dist/encryption.cjs.map +1 -0
  172. package/dist/encryption.d.cts +37 -0
  173. package/dist/encryption.d.cts.map +1 -0
  174. package/dist/encryption.d.mts +37 -0
  175. package/dist/encryption.d.mts.map +1 -0
  176. package/dist/encryption.mjs +101 -0
  177. package/dist/encryption.mjs.map +1 -0
  178. package/dist/endpoints/index.cjs +32 -10
  179. package/dist/endpoints/index.d.cts +106 -3
  180. package/dist/endpoints/index.d.cts.map +1 -0
  181. package/dist/endpoints/index.d.mts +106 -3
  182. package/dist/endpoints/index.d.mts.map +1 -0
  183. package/dist/endpoints/index.mjs +6 -4
  184. package/dist/expire-C586zznE.d.cts +38 -0
  185. package/dist/expire-C586zznE.d.cts.map +1 -0
  186. package/dist/expire-C586zznE.d.mts +38 -0
  187. package/dist/expire-C586zznE.d.mts.map +1 -0
  188. package/dist/expire-CieftS01.cjs +67 -0
  189. package/dist/expire-CieftS01.cjs.map +1 -0
  190. package/dist/expire-CpzUAfr9.mjs +50 -0
  191. package/dist/expire-CpzUAfr9.mjs.map +1 -0
  192. package/dist/external-api.cjs +106 -0
  193. package/dist/external-api.cjs.map +1 -0
  194. package/dist/external-api.d.cts +2 -0
  195. package/dist/external-api.d.mts +2 -0
  196. package/dist/external-api.mjs +103 -0
  197. package/dist/external-api.mjs.map +1 -0
  198. package/dist/fake-BqhP8RRQ.d.mts +201 -0
  199. package/dist/fake-BqhP8RRQ.d.mts.map +1 -0
  200. package/dist/fake-DqieDYYA.d.cts +201 -0
  201. package/dist/fake-DqieDYYA.d.cts.map +1 -0
  202. package/dist/file-server.cjs +123 -30
  203. package/dist/file-server.cjs.map +1 -1
  204. package/dist/file-server.d.cts +115 -1
  205. package/dist/file-server.d.cts.map +1 -1
  206. package/dist/file-server.d.mts +115 -1
  207. package/dist/file-server.d.mts.map +1 -1
  208. package/dist/file-server.mjs +122 -32
  209. package/dist/file-server.mjs.map +1 -1
  210. package/dist/functions/index.cjs +1 -1
  211. package/dist/functions/index.d.cts +2 -1
  212. package/dist/functions/index.d.mts +2 -1
  213. package/dist/functions/index.mjs +1 -1
  214. package/dist/{functions-C53GW2eQ.mjs → functions-BvIDQKAA.mjs} +117 -22
  215. package/dist/functions-BvIDQKAA.mjs.map +1 -0
  216. package/dist/{functions-B6qCvfmy.cjs → functions-DLF6-IK8.cjs} +122 -18
  217. package/dist/functions-DLF6-IK8.cjs.map +1 -0
  218. package/dist/inbox-CR3L1fOI.d.cts +195 -0
  219. package/dist/inbox-CR3L1fOI.d.cts.map +1 -0
  220. package/dist/inbox-CjxpLVkH.d.mts +195 -0
  221. package/dist/inbox-CjxpLVkH.d.mts.map +1 -0
  222. package/dist/inbox.cjs +291 -0
  223. package/dist/inbox.cjs.map +1 -0
  224. package/dist/inbox.d.cts +2 -0
  225. package/dist/inbox.d.mts +2 -0
  226. package/dist/inbox.mjs +283 -0
  227. package/dist/inbox.mjs.map +1 -0
  228. package/dist/index-DCkDQkwj.d.mts +115 -0
  229. package/dist/index-DCkDQkwj.d.mts.map +1 -0
  230. package/dist/index-DPTHa6Ud.d.cts +115 -0
  231. package/dist/index-DPTHa6Ud.d.cts.map +1 -0
  232. package/dist/{index-CeEtxDmK.d.cts → index-DdRjYhiJ.d.cts} +42 -2
  233. package/dist/{index-CeEtxDmK.d.cts.map → index-DdRjYhiJ.d.cts.map} +1 -1
  234. package/dist/{index-CeEtxDmK.d.mts → index-DdRjYhiJ.d.mts} +42 -2
  235. package/dist/{index-CeEtxDmK.d.mts.map → index-DdRjYhiJ.d.mts.map} +1 -1
  236. package/dist/index.cjs +4 -1
  237. package/dist/index.d.cts +26 -3
  238. package/dist/index.d.cts.map +1 -0
  239. package/dist/index.d.mts +26 -3
  240. package/dist/index.d.mts.map +1 -0
  241. package/dist/index.mjs +3 -2
  242. package/dist/kysely-CebjCWTl.d.cts +216 -0
  243. package/dist/kysely-CebjCWTl.d.cts.map +1 -0
  244. package/dist/kysely-Cs4uPO8k.mjs +371 -0
  245. package/dist/kysely-Cs4uPO8k.mjs.map +1 -0
  246. package/dist/kysely-CukArHJ0.cjs +384 -0
  247. package/dist/kysely-CukArHJ0.cjs.map +1 -0
  248. package/dist/kysely-DE4kADWD.d.mts +216 -0
  249. package/dist/kysely-DE4kADWD.d.mts.map +1 -0
  250. package/dist/{telemetry-DGcFlVpB.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +2 -2
  251. package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
  252. package/dist/{telemetry-DGcFlVpB.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +2 -2
  253. package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
  254. package/dist/mobile-app.cjs +74 -0
  255. package/dist/mobile-app.cjs.map +1 -0
  256. package/dist/mobile-app.d.cts +73 -0
  257. package/dist/mobile-app.d.cts.map +1 -0
  258. package/dist/mobile-app.d.mts +73 -0
  259. package/dist/mobile-app.d.mts.map +1 -0
  260. package/dist/mobile-app.mjs +73 -0
  261. package/dist/mobile-app.mjs.map +1 -0
  262. package/dist/object-storage.cjs +8 -1
  263. package/dist/object-storage.cjs.map +1 -1
  264. package/dist/object-storage.d.cts +10 -1
  265. package/dist/object-storage.d.cts.map +1 -1
  266. package/dist/object-storage.d.mts +10 -1
  267. package/dist/object-storage.d.mts.map +1 -1
  268. package/dist/object-storage.mjs +7 -2
  269. package/dist/object-storage.mjs.map +1 -1
  270. package/dist/pattern-C1CEcglD.mjs +241 -0
  271. package/dist/pattern-C1CEcglD.mjs.map +1 -0
  272. package/dist/pattern-QFaUIr77.cjs +288 -0
  273. package/dist/pattern-QFaUIr77.cjs.map +1 -0
  274. package/dist/processors/index.cjs +214 -0
  275. package/dist/processors/index.cjs.map +1 -0
  276. package/dist/processors/index.d.cts +78 -0
  277. package/dist/processors/index.d.cts.map +1 -0
  278. package/dist/processors/index.d.mts +78 -0
  279. package/dist/processors/index.d.mts.map +1 -0
  280. package/dist/processors/index.mjs +193 -0
  281. package/dist/processors/index.mjs.map +1 -0
  282. package/dist/queue/index.cjs +5 -192
  283. package/dist/queue/index.d.cts +3 -53
  284. package/dist/queue/index.d.mts +3 -53
  285. package/dist/queue/index.mjs +3 -190
  286. package/dist/random-password.cjs +86 -0
  287. package/dist/random-password.cjs.map +1 -0
  288. package/dist/random-password.d.cts +30 -0
  289. package/dist/random-password.d.cts.map +1 -0
  290. package/dist/random-password.d.mts +30 -0
  291. package/dist/random-password.d.mts.map +1 -0
  292. package/dist/random-password.mjs +84 -0
  293. package/dist/random-password.mjs.map +1 -0
  294. package/dist/{lazyAccessors-BHtcqgz2.mjs → readRequestBody-BTIl3k-D.mjs} +99 -39
  295. package/dist/readRequestBody-BTIl3k-D.mjs.map +1 -0
  296. package/dist/{lazyAccessors-Dx9NLwJZ.cjs → readRequestBody-Dej_L3c4.cjs} +118 -46
  297. package/dist/readRequestBody-Dej_L3c4.cjs.map +1 -0
  298. package/dist/requestLogger-BZcXwdBs.cjs +207 -0
  299. package/dist/requestLogger-BZcXwdBs.cjs.map +1 -0
  300. package/dist/requestLogger-pA4gi3E1.mjs +178 -0
  301. package/dist/requestLogger-pA4gi3E1.mjs.map +1 -0
  302. package/dist/rest-api.cjs +85 -70
  303. package/dist/rest-api.cjs.map +1 -1
  304. package/dist/rest-api.d.cts +77 -59
  305. package/dist/rest-api.d.cts.map +1 -1
  306. package/dist/rest-api.d.mts +77 -59
  307. package/dist/rest-api.d.mts.map +1 -1
  308. package/dist/rest-api.mjs +87 -72
  309. package/dist/rest-api.mjs.map +1 -1
  310. package/dist/runSubscriber-CC_2C9F2.cjs +133 -0
  311. package/dist/runSubscriber-CC_2C9F2.cjs.map +1 -0
  312. package/dist/runSubscriber-DyHWp_Lf.mjs +116 -0
  313. package/dist/runSubscriber-DyHWp_Lf.mjs.map +1 -0
  314. package/dist/shutdown-BMJmAhSt.cjs +38 -0
  315. package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
  316. package/dist/shutdown-C7xa8x9S.mjs +27 -0
  317. package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
  318. package/dist/site.cjs +85 -8
  319. package/dist/site.cjs.map +1 -1
  320. package/dist/site.d.cts +98 -2
  321. package/dist/site.d.cts.map +1 -1
  322. package/dist/site.d.mts +98 -2
  323. package/dist/site.d.mts.map +1 -1
  324. package/dist/site.mjs +84 -11
  325. package/dist/site.mjs.map +1 -1
  326. package/dist/stages-DaTaoQei.d.cts +73 -0
  327. package/dist/stages-DaTaoQei.d.cts.map +1 -0
  328. package/dist/stages-DaTaoQei.d.mts +73 -0
  329. package/dist/stages-DaTaoQei.d.mts.map +1 -0
  330. package/dist/subscribers/index.cjs +134 -1
  331. package/dist/subscribers/index.cjs.map +1 -0
  332. package/dist/subscribers/index.d.cts +74 -3
  333. package/dist/subscribers/index.d.cts.map +1 -0
  334. package/dist/subscribers/index.d.mts +74 -3
  335. package/dist/subscribers/index.d.mts.map +1 -0
  336. package/dist/subscribers/index.mjs +132 -2
  337. package/dist/subscribers/index.mjs.map +1 -0
  338. package/dist/telemetry-C1oqncFY.d.cts +40 -0
  339. package/dist/telemetry-C1oqncFY.d.cts.map +1 -0
  340. package/dist/telemetry-CObow3Dn.d.mts +40 -0
  341. package/dist/telemetry-CObow3Dn.d.mts.map +1 -0
  342. package/dist/telemetry.cjs +56 -0
  343. package/dist/telemetry.cjs.map +1 -0
  344. package/dist/telemetry.d.cts +2 -0
  345. package/dist/telemetry.d.mts +2 -0
  346. package/dist/telemetry.mjs +55 -0
  347. package/dist/telemetry.mjs.map +1 -0
  348. package/dist/topic/index.cjs +2 -134
  349. package/dist/topic/index.d.cts +2 -3
  350. package/dist/topic/index.d.mts +2 -3
  351. package/dist/topic/index.mjs +2 -132
  352. package/dist/tracing-Bbj1uoFJ.mjs +127 -0
  353. package/dist/tracing-Bbj1uoFJ.mjs.map +1 -0
  354. package/dist/tracing-C0ooU0V2.cjs +150 -0
  355. package/dist/tracing-C0ooU0V2.cjs.map +1 -0
  356. package/dist/websocket-api.cjs +951 -0
  357. package/dist/websocket-api.cjs.map +1 -0
  358. package/dist/websocket-api.d.cts +556 -0
  359. package/dist/websocket-api.d.cts.map +1 -0
  360. package/dist/websocket-api.d.mts +556 -0
  361. package/dist/websocket-api.d.mts.map +1 -0
  362. package/dist/websocket-api.mjs +933 -0
  363. package/dist/websocket-api.mjs.map +1 -0
  364. package/dist/worker.cjs +174 -32
  365. package/dist/worker.cjs.map +1 -1
  366. package/dist/worker.d.cts +147 -47
  367. package/dist/worker.d.cts.map +1 -1
  368. package/dist/worker.d.mts +147 -47
  369. package/dist/worker.d.mts.map +1 -1
  370. package/dist/worker.mjs +175 -33
  371. package/dist/worker.mjs.map +1 -1
  372. package/package.json +155 -44
  373. package/dist/Construct-BeYVu_QF.mjs.map +0 -1
  374. package/dist/Construct-DfbwIntp.d.cts +0 -115
  375. package/dist/Construct-DfbwIntp.d.cts.map +0 -1
  376. package/dist/Construct-DqdlARxq.cjs.map +0 -1
  377. package/dist/Construct-l5aOn_jv.d.mts +0 -115
  378. package/dist/Construct-l5aOn_jv.d.mts.map +0 -1
  379. package/dist/Cron-DKqnnTdH.d.cts.map +0 -1
  380. package/dist/Cron-SyqS5oWJ.d.mts.map +0 -1
  381. package/dist/CronBuilder-BdnI6lxF.cjs.map +0 -1
  382. package/dist/CronBuilder-CRGnDfTq.d.mts +0 -41
  383. package/dist/CronBuilder-CRGnDfTq.d.mts.map +0 -1
  384. package/dist/CronBuilder-D_0HNBTr.mjs.map +0 -1
  385. package/dist/CronBuilder-Df1q9PNy.d.cts +0 -41
  386. package/dist/CronBuilder-Df1q9PNy.d.cts.map +0 -1
  387. package/dist/Endpoint-BpZHtJ2W.cjs +0 -1689
  388. package/dist/Endpoint-BpZHtJ2W.cjs.map +0 -1
  389. package/dist/Endpoint-C6yyHpRS.d.cts.map +0 -1
  390. package/dist/Endpoint-DuT4TEEq.d.mts.map +0 -1
  391. package/dist/Endpoint-ONsly_dq.mjs +0 -1671
  392. package/dist/Endpoint-ONsly_dq.mjs.map +0 -1
  393. package/dist/EndpointFactory-Bm3aKRdV.mjs.map +0 -1
  394. package/dist/EndpointFactory-CLvWuHyt.cjs.map +0 -1
  395. package/dist/HonoEndpointAdaptor-92zavCsV.cjs.map +0 -1
  396. package/dist/HonoEndpointAdaptor-yYaU7jVJ.mjs.map +0 -1
  397. package/dist/Queue-D9X6OoON.d.mts.map +0 -1
  398. package/dist/Queue-DYPB2KWL.d.cts.map +0 -1
  399. package/dist/Subscriber-C4heaAyO.d.mts +0 -51
  400. package/dist/Subscriber-C4heaAyO.d.mts.map +0 -1
  401. package/dist/Subscriber-CotDUELC.d.cts +0 -51
  402. package/dist/Subscriber-CotDUELC.d.cts.map +0 -1
  403. package/dist/SubscriberBuilder-BEv0eoHy.d.cts +0 -59
  404. package/dist/SubscriberBuilder-BEv0eoHy.d.cts.map +0 -1
  405. package/dist/SubscriberBuilder-C0ZEtGDI.cjs +0 -125
  406. package/dist/SubscriberBuilder-C0ZEtGDI.cjs.map +0 -1
  407. package/dist/SubscriberBuilder-h7B_cHMr.mjs +0 -114
  408. package/dist/SubscriberBuilder-h7B_cHMr.mjs.map +0 -1
  409. package/dist/SubscriberBuilder-tyH5yTk5.d.mts +0 -59
  410. package/dist/SubscriberBuilder-tyH5yTk5.d.mts.map +0 -1
  411. package/dist/Topic-DEVGo0Dm.d.cts +0 -89
  412. package/dist/Topic-DEVGo0Dm.d.cts.map +0 -1
  413. package/dist/Topic-zk_6Gthr.d.mts +0 -89
  414. package/dist/Topic-zk_6Gthr.d.mts.map +0 -1
  415. package/dist/auth.d.cts.map +0 -1
  416. package/dist/auth.d.mts.map +0 -1
  417. package/dist/cache.d.cts.map +0 -1
  418. package/dist/cache.d.mts.map +0 -1
  419. package/dist/construct-interface-DPlxfpoS.d.mts.map +0 -1
  420. package/dist/construct-interface-DgXTJcOD.d.cts.map +0 -1
  421. package/dist/credential.cjs.map +0 -1
  422. package/dist/credential.d.cts.map +0 -1
  423. package/dist/credential.d.mts.map +0 -1
  424. package/dist/credential.mjs.map +0 -1
  425. package/dist/database/kysely.cjs.map +0 -1
  426. package/dist/database/kysely.d.cts.map +0 -1
  427. package/dist/database/kysely.d.mts.map +0 -1
  428. package/dist/database/kysely.mjs.map +0 -1
  429. package/dist/functions-B6qCvfmy.cjs.map +0 -1
  430. package/dist/functions-C53GW2eQ.mjs.map +0 -1
  431. package/dist/index-B2urf3YI.d.cts +0 -26
  432. package/dist/index-B2urf3YI.d.cts.map +0 -1
  433. package/dist/index-BPSZ_Lp_.d.cts.map +0 -1
  434. package/dist/index-BoZ-iisU.d.mts.map +0 -1
  435. package/dist/index-CdaU--_B.d.cts +0 -165
  436. package/dist/index-CdaU--_B.d.cts.map +0 -1
  437. package/dist/index-DMCDvnsM.d.mts +0 -26
  438. package/dist/index-DMCDvnsM.d.mts.map +0 -1
  439. package/dist/index-PQRWOQj4.d.mts +0 -165
  440. package/dist/index-PQRWOQj4.d.mts.map +0 -1
  441. package/dist/lazyAccessors-BHtcqgz2.mjs.map +0 -1
  442. package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +0 -1
  443. package/dist/processAudits-BpRlPQMW.mjs +0 -77
  444. package/dist/processAudits-BpRlPQMW.mjs.map +0 -1
  445. package/dist/processAudits-D_2W5x8k.cjs +0 -88
  446. package/dist/processAudits-D_2W5x8k.cjs.map +0 -1
  447. package/dist/queue/index.cjs.map +0 -1
  448. package/dist/queue/index.d.cts.map +0 -1
  449. package/dist/queue/index.d.mts.map +0 -1
  450. package/dist/queue/index.mjs.map +0 -1
  451. package/dist/telemetry-DGcFlVpB.d.cts.map +0 -1
  452. package/dist/telemetry-DGcFlVpB.d.mts.map +0 -1
  453. package/dist/topic/index.cjs.map +0 -1
  454. package/dist/topic/index.mjs.map +0 -1
@@ -1,195 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("../rolldown-runtime-y5ARvAq5.cjs");
3
- const require_cache = require("../cache.cjs");
4
- let _geekmidas_manifest = require("@geekmidas/manifest");
5
- let kysely = require("kysely");
6
- let pg = require("pg");
7
- pg = require_rolldown_runtime.__toESM(pg, 1);
8
- //#region src/database/kysely.ts
9
- /**
10
- * `KyselyDatabase` — a declared Postgres database, typed by its schema.
11
- *
12
- * It declares a logical database, a schema, and the roles that reach it, and
13
- * hands back a Kysely client built from the one URL the adapter supplied. It
14
- * names no cloud: `--target=aws` fills that URL from RDS, local dev from the
15
- * Postgres container.
16
- *
17
- * Transactions and RLS context are the execution wrapper's job — it opens the
18
- * transaction and puts it in `ctx.db`. This construct does not resolve
19
- * connections per request.
20
- */
21
- /** The schema a database uses when it does not say otherwise. */
22
- const DEFAULT_SCHEMA = "app";
23
- /**
24
- * @typeParam DB - the database's schema.
25
- * @typeParam TName - the canonical id. TypeScript has no partial
26
- * type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
27
- * this at its default and the service key widens to `string`. `db` still types
28
- * through `.database()`, which infers from the service.
29
- */
30
- var KyselyDatabase = class KyselyDatabase {
31
- options;
32
- id;
33
- service;
34
- /**
35
- * Declared once and read by both `declare()` and `connect()`, so the key the
36
- * build publishes and the key the client reads cannot drift.
37
- */
38
- config;
39
- schemaName;
40
- roles;
41
- version;
42
- derivedFrom;
43
- constructor(id, options = {}, derivedFrom) {
44
- this.options = options;
45
- const canonical = (0, _geekmidas_manifest.canonicalId)(id);
46
- this.id = canonical;
47
- this.config = {
48
- url: (0, _geekmidas_manifest.provideKey)(canonical, "url"),
49
- ownerUrl: (0, _geekmidas_manifest.provideKey)(canonical, "ownerUrl")
50
- };
51
- this.schemaName = options.schema ?? DEFAULT_SCHEMA;
52
- this.roles = options.roles ?? true;
53
- this.version = options.version ?? _geekmidas_manifest.DEFAULT_POSTGRES_VERSION;
54
- this.derivedFrom = derivedFrom;
55
- this.service = {
56
- serviceName: (0, _geekmidas_manifest.serviceKey)(canonical),
57
- register: (registerOptions) => this.connect(registerOptions)
58
- };
59
- }
60
- declare() {
61
- if (this.derivedFrom) {
62
- const { kind, of, schema } = this.derivedFrom;
63
- return [kind === "database-schema" ? {
64
- kind,
65
- id: this.id,
66
- of,
67
- schema: schema ?? this.schemaName,
68
- provides: [this.config.url]
69
- } : {
70
- kind,
71
- id: this.id,
72
- of,
73
- provides: [this.config.url]
74
- }];
75
- }
76
- return [{
77
- kind: "database",
78
- id: this.id,
79
- engine: "postgres",
80
- schema: this.schemaName,
81
- version: this.version,
82
- provides: [this.config.url],
83
- ...this.roles ? {} : { roles: false }
84
- }];
85
- }
86
- /**
87
- * A read-only endpoint on this database.
88
- *
89
- * Read-only is enforced by the reader role's grants rather than by which
90
- * endpoint it resolves to, so falling back to the writer where no replica
91
- * exists is safe rather than a silently writable connection behind a name
92
- * that says reader. There is no `writer()`: the database *is* the writer, so
93
- * a replica can never be reached by accident.
94
- *
95
- * The return type is narrower than this class on purpose — see
96
- * {@link ReadOnlyDatabase}.
97
- */
98
- reader() {
99
- return new KyselyDatabase(`${this.id}Reader`, this.options, {
100
- kind: "database-reader",
101
- of: this.id
102
- });
103
- }
104
- /**
105
- * A cache that lives in this database.
106
- *
107
- * The same strengthening `schema()` is over a second database: `new
108
- * Cache('Sessions')` says the app caches and leaves where to the deployment,
109
- * while this says it caches *here* — which is a fact about the application
110
- * and so belongs in its code.
111
- *
112
- * What it buys beyond being explicit: the table's schema and the role that
113
- * reaches it come from this database rather than from a second convention,
114
- * and the backend no longer has to guess which database "the database" meant
115
- * when an app declares two.
116
- *
117
- * A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
118
- * is a key/value store, not a query builder, and typing it as the parent
119
- * would be a convenience that lies.
120
- */
121
- cache(id = `${this.id}Cache`, options = {}) {
122
- return new require_cache.Cache(id, {
123
- of: this.id,
124
- ...options.table ? { table: options.table } : {}
125
- });
126
- }
127
- /**
128
- * A second schema in this database, with its own role(s) and its own URL —
129
- * so this database's role holds no grant on those tables at all.
130
- *
131
- * Typed separately because a tenant has its own tables: the point is that
132
- * `auth.selectFrom('sessions')` type-checks and
133
- * `orders.selectFrom('sessions')` does not.
134
- */
135
- schema(id, options = {}) {
136
- return new KyselyDatabase(id, options, {
137
- kind: "database-schema",
138
- of: this.id,
139
- schema: options.schema ?? id.toLowerCase()
140
- });
141
- }
142
- /**
143
- * A connection as the *owner* role — the one that may create, alter and drop.
144
- *
145
- * A `Service` rather than part of the construct, and deliberately so: a
146
- * construct is what `.dependsOn()` accepts, and nothing should be able to
147
- * depend on this. A migrator asks for it by name; a handler cannot ask at
148
- * all, which is the security property the role split exists for.
149
- *
150
- * Falls back to the runtime URL where no owner URL was published — the
151
- * `roles: false` downgrade, where there is only one credential and it is the
152
- * cluster master's.
153
- */
154
- get owner() {
155
- return {
156
- serviceName: `${(0, _geekmidas_manifest.serviceKey)(this.id)}Owner`,
157
- register: (options) => this.connect(options, { owner: true })
158
- };
159
- }
160
- async connect(options, as = {}) {
161
- const { url, ownerUrl } = options.envParser.create((get) => ({
162
- url: get(this.config.url).string(),
163
- ownerUrl: get(this.config.ownerUrl).string().optional()
164
- })).parse();
165
- const { schema: _schema, roles: _roles, ...kysely$1 } = this.options;
166
- return new kysely.Kysely({
167
- ...kysely$1,
168
- dialect: new kysely.PostgresDialect({ pool: pool(as.owner ? ownerUrl ?? url : url) })
169
- });
170
- }
171
- };
172
- /**
173
- * A pool for one URL, with its schema actually on the search path.
174
- *
175
- * `?search_path=` is not a libpq parameter — a URL carrying it connects
176
- * happily and then resolves every unqualified name against `public`, which is
177
- * how a schema tenant silently writes its tables into the database it was
178
- * separated from. Postgres takes it as a startup option instead, so the URL
179
- * keeps the readable form the target derives and this turns it into the thing
180
- * the server understands.
181
- */
182
- function pool(url) {
183
- const parsed = new URL(url);
184
- const searchPath = parsed.searchParams.get("search_path");
185
- if (!searchPath) return new pg.default.Pool({ connectionString: url });
186
- parsed.searchParams.delete("search_path");
187
- return new pg.default.Pool({
188
- connectionString: parsed.toString(),
189
- options: `-c search_path=${searchPath}`
190
- });
191
- }
192
- //#endregion
193
- exports.KyselyDatabase = KyselyDatabase;
194
-
195
- //# sourceMappingURL=kysely.cjs.map
2
+ const require_kysely = require("../kysely-CukArHJ0.cjs");
3
+ exports.KyselyDatabase = require_kysely.KyselyDatabase;
4
+ exports.closeDatabasePools = require_kysely.closeDatabasePools;
@@ -1,149 +1,2 @@
1
- import { t as Construct } from "../construct-interface-DgXTJcOD.cjs";
2
- import { Cache } from "../cache.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
- export 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
- export 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
- private connect;
129
- }
130
- /**
131
- * A database you may read through, and derive nothing from.
132
- *
133
- * A reader is terminal in the graph, and this is that fact in the type system.
134
- * `DERIVES_FROM` gives `cache` and `database-schema` no `database-reader`
135
- * parent, and there is no reader of a reader — so `orders.reader().cache(…)`
136
- * has always been illegal, but it type-checked and failed later at
137
- * `assertDerivations`. That is a long way round to learn that a read-only
138
- * endpoint cannot own a table something writes to.
139
- *
140
- * Omitting the three deriving methods rather than making them throw keeps the
141
- * failure where it costs least: the editor, on the line that wrote it.
142
- *
143
- * The result is deliberately not assignable back to `KyselyDatabase` — a
144
- * reader is not one, and anything that genuinely needs the writer should say
145
- * so.
146
- */
147
- export type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
148
- //#endregion
149
- //# sourceMappingURL=kysely.d.cts.map
1
+ import { a as closeDatabasePools, i as ReadOnlyDatabase, n as KyselyDatabaseOptions, r as PostgresRuntime, t as KyselyDatabase } from "../kysely-CebjCWTl.cjs";
2
+ export { KyselyDatabase, KyselyDatabaseOptions, PostgresRuntime, ReadOnlyDatabase, closeDatabasePools };
@@ -1,149 +1,2 @@
1
- import { t as Construct } from "../construct-interface-DPlxfpoS.mjs";
2
- import { Cache } from "../cache.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
- export 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
- export 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
- private connect;
129
- }
130
- /**
131
- * A database you may read through, and derive nothing from.
132
- *
133
- * A reader is terminal in the graph, and this is that fact in the type system.
134
- * `DERIVES_FROM` gives `cache` and `database-schema` no `database-reader`
135
- * parent, and there is no reader of a reader — so `orders.reader().cache(…)`
136
- * has always been illegal, but it type-checked and failed later at
137
- * `assertDerivations`. That is a long way round to learn that a read-only
138
- * endpoint cannot own a table something writes to.
139
- *
140
- * Omitting the three deriving methods rather than making them throw keeps the
141
- * failure where it costs least: the editor, on the line that wrote it.
142
- *
143
- * The result is deliberately not assignable back to `KyselyDatabase` — a
144
- * reader is not one, and anything that genuinely needs the writer should say
145
- * so.
146
- */
147
- export type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
148
- //#endregion
149
- //# sourceMappingURL=kysely.d.mts.map
1
+ import { a as closeDatabasePools, i as ReadOnlyDatabase, n as KyselyDatabaseOptions, r as PostgresRuntime, t as KyselyDatabase } from "../kysely-DE4kADWD.mjs";
2
+ export { KyselyDatabase, KyselyDatabaseOptions, PostgresRuntime, ReadOnlyDatabase, closeDatabasePools };
@@ -1,192 +1,2 @@
1
- import { Cache } from "../cache.mjs";
2
- import { DEFAULT_POSTGRES_VERSION, canonicalId, provideKey, serviceKey } from "@geekmidas/manifest";
3
- import { Kysely, PostgresDialect } from "kysely";
4
- import pg from "pg";
5
- //#region src/database/kysely.ts
6
- /**
7
- * `KyselyDatabase` — a declared Postgres database, typed by its schema.
8
- *
9
- * It declares a logical database, a schema, and the roles that reach it, and
10
- * hands back a Kysely client built from the one URL the adapter supplied. It
11
- * names no cloud: `--target=aws` fills that URL from RDS, local dev from the
12
- * Postgres container.
13
- *
14
- * Transactions and RLS context are the execution wrapper's job — it opens the
15
- * transaction and puts it in `ctx.db`. This construct does not resolve
16
- * connections per request.
17
- */
18
- /** The schema a database uses when it does not say otherwise. */
19
- const DEFAULT_SCHEMA = "app";
20
- /**
21
- * @typeParam DB - the database's schema.
22
- * @typeParam TName - the canonical id. TypeScript has no partial
23
- * type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
24
- * this at its default and the service key widens to `string`. `db` still types
25
- * through `.database()`, which infers from the service.
26
- */
27
- var KyselyDatabase = class KyselyDatabase {
28
- options;
29
- id;
30
- service;
31
- /**
32
- * Declared once and read by both `declare()` and `connect()`, so the key the
33
- * build publishes and the key the client reads cannot drift.
34
- */
35
- config;
36
- schemaName;
37
- roles;
38
- version;
39
- derivedFrom;
40
- constructor(id, options = {}, derivedFrom) {
41
- this.options = options;
42
- const canonical = canonicalId(id);
43
- this.id = canonical;
44
- this.config = {
45
- url: provideKey(canonical, "url"),
46
- ownerUrl: provideKey(canonical, "ownerUrl")
47
- };
48
- this.schemaName = options.schema ?? DEFAULT_SCHEMA;
49
- this.roles = options.roles ?? true;
50
- this.version = options.version ?? DEFAULT_POSTGRES_VERSION;
51
- this.derivedFrom = derivedFrom;
52
- this.service = {
53
- serviceName: serviceKey(canonical),
54
- register: (registerOptions) => this.connect(registerOptions)
55
- };
56
- }
57
- declare() {
58
- if (this.derivedFrom) {
59
- const { kind, of, schema } = this.derivedFrom;
60
- return [kind === "database-schema" ? {
61
- kind,
62
- id: this.id,
63
- of,
64
- schema: schema ?? this.schemaName,
65
- provides: [this.config.url]
66
- } : {
67
- kind,
68
- id: this.id,
69
- of,
70
- provides: [this.config.url]
71
- }];
72
- }
73
- return [{
74
- kind: "database",
75
- id: this.id,
76
- engine: "postgres",
77
- schema: this.schemaName,
78
- version: this.version,
79
- provides: [this.config.url],
80
- ...this.roles ? {} : { roles: false }
81
- }];
82
- }
83
- /**
84
- * A read-only endpoint on this database.
85
- *
86
- * Read-only is enforced by the reader role's grants rather than by which
87
- * endpoint it resolves to, so falling back to the writer where no replica
88
- * exists is safe rather than a silently writable connection behind a name
89
- * that says reader. There is no `writer()`: the database *is* the writer, so
90
- * a replica can never be reached by accident.
91
- *
92
- * The return type is narrower than this class on purpose — see
93
- * {@link ReadOnlyDatabase}.
94
- */
95
- reader() {
96
- return new KyselyDatabase(`${this.id}Reader`, this.options, {
97
- kind: "database-reader",
98
- of: this.id
99
- });
100
- }
101
- /**
102
- * A cache that lives in this database.
103
- *
104
- * The same strengthening `schema()` is over a second database: `new
105
- * Cache('Sessions')` says the app caches and leaves where to the deployment,
106
- * while this says it caches *here* — which is a fact about the application
107
- * and so belongs in its code.
108
- *
109
- * What it buys beyond being explicit: the table's schema and the role that
110
- * reaches it come from this database rather than from a second convention,
111
- * and the backend no longer has to guess which database "the database" meant
112
- * when an app declares two.
113
- *
114
- * A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
115
- * is a key/value store, not a query builder, and typing it as the parent
116
- * would be a convenience that lies.
117
- */
118
- cache(id = `${this.id}Cache`, options = {}) {
119
- return new Cache(id, {
120
- of: this.id,
121
- ...options.table ? { table: options.table } : {}
122
- });
123
- }
124
- /**
125
- * A second schema in this database, with its own role(s) and its own URL —
126
- * so this database's role holds no grant on those tables at all.
127
- *
128
- * Typed separately because a tenant has its own tables: the point is that
129
- * `auth.selectFrom('sessions')` type-checks and
130
- * `orders.selectFrom('sessions')` does not.
131
- */
132
- schema(id, options = {}) {
133
- return new KyselyDatabase(id, options, {
134
- kind: "database-schema",
135
- of: this.id,
136
- schema: options.schema ?? id.toLowerCase()
137
- });
138
- }
139
- /**
140
- * A connection as the *owner* role — the one that may create, alter and drop.
141
- *
142
- * A `Service` rather than part of the construct, and deliberately so: a
143
- * construct is what `.dependsOn()` accepts, and nothing should be able to
144
- * depend on this. A migrator asks for it by name; a handler cannot ask at
145
- * all, which is the security property the role split exists for.
146
- *
147
- * Falls back to the runtime URL where no owner URL was published — the
148
- * `roles: false` downgrade, where there is only one credential and it is the
149
- * cluster master's.
150
- */
151
- get owner() {
152
- return {
153
- serviceName: `${serviceKey(this.id)}Owner`,
154
- register: (options) => this.connect(options, { owner: true })
155
- };
156
- }
157
- async connect(options, as = {}) {
158
- const { url, ownerUrl } = options.envParser.create((get) => ({
159
- url: get(this.config.url).string(),
160
- ownerUrl: get(this.config.ownerUrl).string().optional()
161
- })).parse();
162
- const { schema: _schema, roles: _roles, ...kysely } = this.options;
163
- return new Kysely({
164
- ...kysely,
165
- dialect: new PostgresDialect({ pool: pool(as.owner ? ownerUrl ?? url : url) })
166
- });
167
- }
168
- };
169
- /**
170
- * A pool for one URL, with its schema actually on the search path.
171
- *
172
- * `?search_path=` is not a libpq parameter — a URL carrying it connects
173
- * happily and then resolves every unqualified name against `public`, which is
174
- * how a schema tenant silently writes its tables into the database it was
175
- * separated from. Postgres takes it as a startup option instead, so the URL
176
- * keeps the readable form the target derives and this turns it into the thing
177
- * the server understands.
178
- */
179
- function pool(url) {
180
- const parsed = new URL(url);
181
- const searchPath = parsed.searchParams.get("search_path");
182
- if (!searchPath) return new pg.Pool({ connectionString: url });
183
- parsed.searchParams.delete("search_path");
184
- return new pg.Pool({
185
- connectionString: parsed.toString(),
186
- options: `-c search_path=${searchPath}`
187
- });
188
- }
189
- //#endregion
190
- export { KyselyDatabase };
191
-
192
- //# sourceMappingURL=kysely.mjs.map
1
+ import { n as closeDatabasePools, t as KyselyDatabase } from "../kysely-Cs4uPO8k.mjs";
2
+ export { KyselyDatabase, closeDatabasePools };