@geekmidas/constructs 10.0.0-alpha.12 → 10.0.0-alpha.120
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.
- package/README.md +222 -158
- package/dist/Construct-B7AXn0xH.d.mts +230 -0
- package/dist/Construct-B7AXn0xH.d.mts.map +1 -0
- package/dist/Construct-CFW0zjdD.d.cts +230 -0
- package/dist/Construct-CFW0zjdD.d.cts.map +1 -0
- package/dist/{Construct-BD5neF7w.mjs → Construct-CKUA-CTA.mjs} +35 -35
- package/dist/Construct-CKUA-CTA.mjs.map +1 -0
- package/dist/{Construct-CyS3RpTL.cjs → Construct-DEOVauyA.cjs} +55 -49
- package/dist/Construct-DEOVauyA.cjs.map +1 -0
- package/dist/{Cron-DmQ8vQ4b.d.cts → Cron-bdGRSROY.d.cts} +15 -9
- package/dist/Cron-bdGRSROY.d.cts.map +1 -0
- package/dist/{Cron-dh4rUgib.d.mts → Cron-i4Uetezh.d.mts} +15 -9
- package/dist/Cron-i4Uetezh.d.mts.map +1 -0
- package/dist/CronBuilder-9H4BnD6W.d.mts +47 -0
- package/dist/CronBuilder-9H4BnD6W.d.mts.map +1 -0
- package/dist/{CronBuilder-Da0C0edR.cjs → CronBuilder-BXTG10u5.cjs} +47 -31
- package/dist/CronBuilder-BXTG10u5.cjs.map +1 -0
- package/dist/CronBuilder-B_24LZpn.d.cts +47 -0
- package/dist/CronBuilder-B_24LZpn.d.cts.map +1 -0
- package/dist/{CronBuilder-CYKT5RiO.mjs → CronBuilder-D3sF9tS_.mjs} +37 -21
- package/dist/CronBuilder-D3sF9tS_.mjs.map +1 -0
- package/dist/{Endpoint-BjWKinFA.d.mts → Endpoint-CeFkSwh5.d.mts} +129 -99
- package/dist/Endpoint-CeFkSwh5.d.mts.map +1 -0
- package/dist/{Endpoint-dav89W6-.d.cts → Endpoint-DgrpG15P.d.cts} +127 -97
- package/dist/Endpoint-DgrpG15P.d.cts.map +1 -0
- package/dist/{Endpoint-DCQPMdUX.mjs → Endpoint-gPXhHKhJ.mjs} +208 -100
- package/dist/Endpoint-gPXhHKhJ.mjs.map +1 -0
- package/dist/{Endpoint-DcWXE-SZ.cjs → Endpoint-yhR2T2Wt.cjs} +248 -122
- package/dist/Endpoint-yhR2T2Wt.cjs.map +1 -0
- package/dist/{EndpointFactory-CdWB7wPw.cjs → EndpointFactory-CSrAyazj.cjs} +361 -112
- package/dist/EndpointFactory-CSrAyazj.cjs.map +1 -0
- package/dist/{index-lAO9egTb.d.mts → EndpointFactory-Cc863XJS.d.cts} +190 -136
- package/dist/EndpointFactory-Cc863XJS.d.cts.map +1 -0
- package/dist/{index-Bd5FqCoe.d.cts → EndpointFactory-Dbw9ugkX.d.mts} +189 -135
- package/dist/EndpointFactory-Dbw9ugkX.d.mts.map +1 -0
- package/dist/{EndpointFactory-CjV8F_lJ.mjs → EndpointFactory-c2ZugGig.mjs} +283 -76
- package/dist/EndpointFactory-c2ZugGig.mjs.map +1 -0
- package/dist/Function-B0uZhZnU.d.cts +76 -0
- package/dist/Function-B0uZhZnU.d.cts.map +1 -0
- package/dist/Function-B_9R7Zy1.d.mts +76 -0
- package/dist/Function-B_9R7Zy1.d.mts.map +1 -0
- package/dist/{HonoEndpointAdaptor-DtL9j19R.cjs → HonoEndpointAdaptor-CN1jjUBJ.cjs} +115 -71
- package/dist/HonoEndpointAdaptor-CN1jjUBJ.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-P1ahhZHu.mjs → HonoEndpointAdaptor-euH1oSdY.mjs} +105 -64
- package/dist/HonoEndpointAdaptor-euH1oSdY.mjs.map +1 -0
- package/dist/{Queue-D7ZuwBhy.d.cts → Queue-B-dDXyjF.d.mts} +48 -48
- package/dist/Queue-B-dDXyjF.d.mts.map +1 -0
- package/dist/Queue-BhuofM3k.cjs +109 -0
- package/dist/Queue-BhuofM3k.cjs.map +1 -0
- package/dist/{Queue-gVGfi2Yk.d.mts → Queue-JbIjVtTf.d.cts} +49 -49
- package/dist/Queue-JbIjVtTf.d.cts.map +1 -0
- package/dist/Queue-cmhqEBOB.mjs +104 -0
- package/dist/Queue-cmhqEBOB.mjs.map +1 -0
- package/dist/QueueBuilder-48W-q8In.d.mts +75 -0
- package/dist/QueueBuilder-48W-q8In.d.mts.map +1 -0
- package/dist/QueueBuilder-DXu1qxT1.mjs +118 -0
- package/dist/QueueBuilder-DXu1qxT1.mjs.map +1 -0
- package/dist/QueueBuilder-DdU2klPu.cjs +135 -0
- package/dist/QueueBuilder-DdU2klPu.cjs.map +1 -0
- package/dist/QueueBuilder-MfpkJ3R9.d.cts +75 -0
- package/dist/QueueBuilder-MfpkJ3R9.d.cts.map +1 -0
- package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-CEt7kHkc.d.cts} +29 -20
- package/dist/Subscriber-CEt7kHkc.d.cts.map +1 -0
- package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-dsxc5LKa.d.mts} +29 -20
- package/dist/Subscriber-dsxc5LKa.d.mts.map +1 -0
- package/dist/SubscriberBuilder-BRa_nrmH.d.cts +67 -0
- package/dist/SubscriberBuilder-BRa_nrmH.d.cts.map +1 -0
- package/dist/SubscriberBuilder-D9bkrYzH.d.mts +67 -0
- package/dist/SubscriberBuilder-D9bkrYzH.d.mts.map +1 -0
- package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-DRXfxWn_.mjs} +50 -24
- package/dist/SubscriberBuilder-DRXfxWn_.mjs.map +1 -0
- package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-M2EAgQhC.cjs} +61 -36
- package/dist/SubscriberBuilder-M2EAgQhC.cjs.map +1 -0
- package/dist/Topic-D2R0r24C.mjs +99 -0
- package/dist/Topic-D2R0r24C.mjs.map +1 -0
- package/dist/Topic-DwS3QO0m.cjs +104 -0
- package/dist/Topic-DwS3QO0m.cjs.map +1 -0
- package/dist/adaptors/aws.cjs +200 -246
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +58 -62
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +59 -63
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +171 -219
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/hono.cjs +3 -10
- package/dist/adaptors/hono.d.cts +7 -16
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +9 -18
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +2 -10
- package/dist/adaptors/testing.cjs +765 -99
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +351 -54
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +351 -54
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +726 -78
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-BMCJN30Y.d.cts +268 -0
- package/dist/auth-BMCJN30Y.d.cts.map +1 -0
- package/dist/auth-D_0788uW.d.mts +268 -0
- package/dist/auth-D_0788uW.d.mts.map +1 -0
- package/dist/auth.cjs +301 -33
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +2 -108
- package/dist/auth.d.mts +2 -108
- package/dist/auth.mjs +289 -27
- package/dist/auth.mjs.map +1 -1
- package/dist/{cache-BrRz3fEB.d.mts → cache-5QZzh5Er.d.mts} +3 -6
- package/dist/cache-5QZzh5Er.d.mts.map +1 -0
- package/dist/{cache-BtZY_tHe.d.cts → cache-DnGDGly3.d.cts} +3 -6
- package/dist/cache-DnGDGly3.d.cts.map +1 -0
- package/dist/cache.cjs +68 -2
- package/dist/cache.cjs.map +1 -0
- package/dist/cache.d.cts +1 -2
- package/dist/cache.d.mts +1 -2
- package/dist/cache.mjs +67 -2
- package/dist/cache.mjs.map +1 -0
- package/dist/cipher-C1lEFX63.mjs +225 -0
- package/dist/cipher-C1lEFX63.mjs.map +1 -0
- package/dist/cipher-CVxfwLjk.cjs +332 -0
- package/dist/cipher-CVxfwLjk.cjs.map +1 -0
- package/dist/cipher-DSDxPRIp.d.cts +106 -0
- package/dist/cipher-DSDxPRIp.d.cts.map +1 -0
- package/dist/cipher-DSDxPRIp.d.mts +106 -0
- package/dist/cipher-DSDxPRIp.d.mts.map +1 -0
- package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
- package/dist/clone-EKNovYHu.mjs.map +1 -0
- package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
- package/dist/clone-UGJpvQnL.cjs.map +1 -0
- package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-B1AfqRl4.d.cts} +42 -11
- package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
- package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-ZvYQbivO.d.mts} +42 -11
- package/dist/construct-interface-ZvYQbivO.d.mts.map +1 -0
- package/dist/construct-interface.cjs +113 -7
- package/dist/construct-interface.cjs.map +1 -0
- package/dist/construct-interface.d.cts +2 -2
- package/dist/construct-interface.d.mts +2 -2
- package/dist/construct-interface.mjs +106 -2
- package/dist/construct-interface.mjs.map +1 -0
- package/dist/credential-DYymbp_7.cjs +257 -0
- package/dist/credential-DYymbp_7.cjs.map +1 -0
- package/dist/credential-DfSAOOdY.mjs +222 -0
- package/dist/credential-DfSAOOdY.mjs.map +1 -0
- package/dist/credential.cjs +8 -96
- package/dist/credential.d.cts +2 -61
- package/dist/credential.d.mts +2 -61
- package/dist/credential.mjs +2 -94
- package/dist/crons/index.cjs +129 -7
- package/dist/crons/index.cjs.map +1 -1
- package/dist/crons/index.d.cts +45 -11
- package/dist/crons/index.d.cts.map +1 -1
- package/dist/crons/index.d.mts +45 -11
- package/dist/crons/index.d.mts.map +1 -1
- package/dist/crons/index.mjs +127 -8
- package/dist/crons/index.mjs.map +1 -1
- package/dist/database/kysely.cjs +4 -181
- package/dist/database/kysely.d.cts +2 -152
- package/dist/database/kysely.d.mts +2 -152
- package/dist/database/kysely.mjs +2 -180
- package/dist/email.cjs +25 -12
- package/dist/email.cjs.map +1 -1
- package/dist/email.d.cts +3 -7
- package/dist/email.d.cts.map +1 -1
- package/dist/email.d.mts +4 -8
- package/dist/email.d.mts.map +1 -1
- package/dist/email.mjs +16 -3
- package/dist/email.mjs.map +1 -1
- package/dist/encryption/kms.cjs +95 -0
- package/dist/encryption/kms.cjs.map +1 -0
- package/dist/encryption/kms.d.cts +7 -0
- package/dist/encryption/kms.d.cts.map +1 -0
- package/dist/encryption/kms.d.mts +7 -0
- package/dist/encryption/kms.d.mts.map +1 -0
- package/dist/encryption/kms.mjs +93 -0
- package/dist/encryption/kms.mjs.map +1 -0
- package/dist/encryption.cjs +116 -0
- package/dist/encryption.cjs.map +1 -0
- package/dist/encryption.d.cts +37 -0
- package/dist/encryption.d.cts.map +1 -0
- package/dist/encryption.d.mts +37 -0
- package/dist/encryption.d.mts.map +1 -0
- package/dist/encryption.mjs +101 -0
- package/dist/encryption.mjs.map +1 -0
- package/dist/endpoints/index.cjs +27 -16
- package/dist/endpoints/index.d.cts +105 -7
- package/dist/endpoints/index.d.cts.map +1 -0
- package/dist/endpoints/index.d.mts +105 -7
- package/dist/endpoints/index.d.mts.map +1 -0
- package/dist/endpoints/index.mjs +6 -10
- package/dist/expire-C586zznE.d.cts +38 -0
- package/dist/expire-C586zznE.d.cts.map +1 -0
- package/dist/expire-C586zznE.d.mts +38 -0
- package/dist/expire-C586zznE.d.mts.map +1 -0
- package/dist/expire-CieftS01.cjs +67 -0
- package/dist/expire-CieftS01.cjs.map +1 -0
- package/dist/expire-CpzUAfr9.mjs +50 -0
- package/dist/expire-CpzUAfr9.mjs.map +1 -0
- package/dist/external-api.cjs +106 -0
- package/dist/external-api.cjs.map +1 -0
- package/dist/external-api.d.cts +2 -0
- package/dist/external-api.d.mts +2 -0
- package/dist/external-api.mjs +103 -0
- package/dist/external-api.mjs.map +1 -0
- package/dist/fake-B7rvi4Qp.d.cts +201 -0
- package/dist/fake-B7rvi4Qp.d.cts.map +1 -0
- package/dist/fake-JXbkdao8.d.mts +201 -0
- package/dist/fake-JXbkdao8.d.mts.map +1 -0
- package/dist/file-server.cjs +66 -11
- package/dist/file-server.cjs.map +1 -1
- package/dist/file-server.d.cts +25 -10
- package/dist/file-server.d.cts.map +1 -1
- package/dist/file-server.d.mts +25 -10
- package/dist/file-server.d.mts.map +1 -1
- package/dist/file-server.mjs +58 -4
- package/dist/file-server.mjs.map +1 -1
- package/dist/functions/index.cjs +3 -6
- package/dist/functions/index.d.cts +3 -4
- package/dist/functions/index.d.mts +3 -4
- package/dist/functions/index.mjs +2 -6
- package/dist/{functions-14lpEFL4.mjs → functions-CTI-hDem.mjs} +376 -238
- package/dist/{functions-14lpEFL4.mjs.map → functions-CTI-hDem.mjs.map} +1 -1
- package/dist/{functions-i_la-N5r.cjs → functions-D7O5SGVc.cjs} +414 -264
- package/dist/functions-D7O5SGVc.cjs.map +1 -0
- package/dist/index-Cd2w-DRL.d.cts +115 -0
- package/dist/index-Cd2w-DRL.d.cts.map +1 -0
- package/dist/index-DdRjYhiJ.d.cts +119 -0
- package/dist/index-DdRjYhiJ.d.cts.map +1 -0
- package/dist/index-DdRjYhiJ.d.mts +119 -0
- package/dist/index-DdRjYhiJ.d.mts.map +1 -0
- package/dist/index-aBIcAiH5.d.mts +115 -0
- package/dist/index-aBIcAiH5.d.mts.map +1 -0
- package/dist/index.cjs +6 -3
- package/dist/index.d.cts +27 -4
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +27 -4
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -3
- package/dist/kysely-BHYV-WC-.d.cts +216 -0
- package/dist/kysely-BHYV-WC-.d.cts.map +1 -0
- package/dist/kysely-CAW3QSqp.d.mts +216 -0
- package/dist/kysely-CAW3QSqp.d.mts.map +1 -0
- package/dist/kysely-Cs4uPO8k.mjs +371 -0
- package/dist/kysely-Cs4uPO8k.mjs.map +1 -0
- package/dist/kysely-CukArHJ0.cjs +384 -0
- package/dist/kysely-CukArHJ0.cjs.map +1 -0
- package/dist/{telemetry-C3L0iS28.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +3 -6
- package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
- package/dist/{telemetry-D7bVFLGi.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +3 -6
- package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
- package/dist/mobile-app.cjs +74 -0
- package/dist/mobile-app.cjs.map +1 -0
- package/dist/mobile-app.d.cts +73 -0
- package/dist/mobile-app.d.cts.map +1 -0
- package/dist/mobile-app.d.mts +73 -0
- package/dist/mobile-app.d.mts.map +1 -0
- package/dist/mobile-app.mjs +73 -0
- package/dist/mobile-app.mjs.map +1 -0
- package/dist/object-storage.cjs +26 -11
- package/dist/object-storage.cjs.map +1 -1
- package/dist/object-storage.d.cts +12 -7
- package/dist/object-storage.d.cts.map +1 -1
- package/dist/object-storage.d.mts +12 -7
- package/dist/object-storage.d.mts.map +1 -1
- package/dist/object-storage.mjs +18 -5
- package/dist/object-storage.mjs.map +1 -1
- package/dist/queue/index.cjs +6 -189
- package/dist/queue/index.d.cts +3 -60
- package/dist/queue/index.d.mts +3 -60
- package/dist/queue/index.mjs +3 -186
- package/dist/random-password.cjs +86 -0
- package/dist/random-password.cjs.map +1 -0
- package/dist/random-password.d.cts +30 -0
- package/dist/random-password.d.cts.map +1 -0
- package/dist/random-password.d.mts +30 -0
- package/dist/random-password.d.mts.map +1 -0
- package/dist/random-password.mjs +84 -0
- package/dist/random-password.mjs.map +1 -0
- package/dist/{lazyAccessors-BoJN3SMd.mjs → readRequestBody-BTIl3k-D.mjs} +117 -60
- package/dist/readRequestBody-BTIl3k-D.mjs.map +1 -0
- package/dist/readRequestBody-Dej_L3c4.cjs +342 -0
- package/dist/readRequestBody-Dej_L3c4.cjs.map +1 -0
- package/dist/requestLogger-BZcXwdBs.cjs +207 -0
- package/dist/requestLogger-BZcXwdBs.cjs.map +1 -0
- package/dist/requestLogger-pA4gi3E1.mjs +178 -0
- package/dist/requestLogger-pA4gi3E1.mjs.map +1 -0
- package/dist/rest-api.cjs +90 -59
- package/dist/rest-api.cjs.map +1 -1
- package/dist/rest-api.d.cts +70 -42
- package/dist/rest-api.d.cts.map +1 -1
- package/dist/rest-api.d.mts +70 -42
- package/dist/rest-api.d.mts.map +1 -1
- package/dist/rest-api.mjs +82 -51
- package/dist/rest-api.mjs.map +1 -1
- package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
- package/dist/runSubscriber-BHvJ8POr.mjs +109 -0
- package/dist/runSubscriber-BHvJ8POr.mjs.map +1 -0
- package/dist/runSubscriber-D8nLXIv1.cjs +126 -0
- package/dist/runSubscriber-D8nLXIv1.cjs.map +1 -0
- package/dist/shutdown-BMJmAhSt.cjs +38 -0
- package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
- package/dist/shutdown-C7xa8x9S.mjs +27 -0
- package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
- package/dist/site.cjs +33 -7
- package/dist/site.cjs.map +1 -1
- package/dist/site.d.cts +17 -7
- package/dist/site.d.cts.map +1 -1
- package/dist/site.d.mts +17 -7
- package/dist/site.d.mts.map +1 -1
- package/dist/site.mjs +29 -3
- package/dist/site.mjs.map +1 -1
- package/dist/stages-BSCF19o2.d.cts +56 -0
- package/dist/stages-BSCF19o2.d.cts.map +1 -0
- package/dist/stages-BSCF19o2.d.mts +56 -0
- package/dist/stages-BSCF19o2.d.mts.map +1 -0
- package/dist/subscribers/index.cjs +118 -6
- package/dist/subscribers/index.cjs.map +1 -0
- package/dist/subscribers/index.d.cts +51 -6
- package/dist/subscribers/index.d.cts.map +1 -0
- package/dist/subscribers/index.d.mts +51 -6
- package/dist/subscribers/index.d.mts.map +1 -0
- package/dist/subscribers/index.mjs +115 -5
- package/dist/subscribers/index.mjs.map +1 -0
- package/dist/surfaceEnv-CNimK76p.cjs +56 -0
- package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
- package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
- package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
- package/dist/telemetry-B48RLjyk.d.cts +40 -0
- package/dist/telemetry-B48RLjyk.d.cts.map +1 -0
- package/dist/telemetry-BEoBn6GO.d.mts +40 -0
- package/dist/telemetry-BEoBn6GO.d.mts.map +1 -0
- package/dist/telemetry.cjs +56 -0
- package/dist/telemetry.cjs.map +1 -0
- package/dist/telemetry.d.cts +2 -0
- package/dist/telemetry.d.mts +2 -0
- package/dist/telemetry.mjs +55 -0
- package/dist/telemetry.mjs.map +1 -0
- package/dist/topic/index.cjs +3 -137
- package/dist/topic/index.d.cts +2 -4
- package/dist/topic/index.d.mts +2 -4
- package/dist/topic/index.mjs +2 -134
- package/dist/tracing-Bbj1uoFJ.mjs +127 -0
- package/dist/tracing-Bbj1uoFJ.mjs.map +1 -0
- package/dist/tracing-C0ooU0V2.cjs +150 -0
- package/dist/tracing-C0ooU0V2.cjs.map +1 -0
- package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
- package/dist/types-DMuSQeLL.d.cts.map +1 -0
- package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
- package/dist/types-DMuSQeLL.d.mts.map +1 -0
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.mjs +1 -0
- package/dist/worker.cjs +59 -34
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +70 -45
- package/dist/worker.d.cts.map +1 -1
- package/dist/worker.d.mts +71 -45
- package/dist/worker.d.mts.map +1 -1
- package/dist/worker.mjs +54 -29
- package/dist/worker.mjs.map +1 -1
- package/package.json +115 -41
- package/dist/Construct-BD5neF7w.mjs.map +0 -1
- package/dist/Construct-C0ijr2qp.d.cts +0 -117
- package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
- package/dist/Construct-Ct8nalEi.d.mts +0 -117
- package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
- package/dist/Construct-CyS3RpTL.cjs.map +0 -1
- package/dist/Cron-DmQ8vQ4b.d.cts.map +0 -1
- package/dist/Cron-dh4rUgib.d.mts.map +0 -1
- package/dist/CronBuilder-BquXDbDI.d.cts +0 -44
- package/dist/CronBuilder-BquXDbDI.d.cts.map +0 -1
- package/dist/CronBuilder-CGgY2080.d.mts +0 -44
- package/dist/CronBuilder-CGgY2080.d.mts.map +0 -1
- package/dist/CronBuilder-CYKT5RiO.mjs.map +0 -1
- package/dist/CronBuilder-Da0C0edR.cjs.map +0 -1
- package/dist/Endpoint-BjWKinFA.d.mts.map +0 -1
- package/dist/Endpoint-DCQPMdUX.mjs.map +0 -1
- package/dist/Endpoint-DcWXE-SZ.cjs.map +0 -1
- package/dist/Endpoint-dav89W6-.d.cts.map +0 -1
- package/dist/EndpointFactory-CdWB7wPw.cjs.map +0 -1
- package/dist/EndpointFactory-CjV8F_lJ.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-DtL9j19R.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-P1ahhZHu.mjs.map +0 -1
- package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
- package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
- package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
- package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
- package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
- package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
- package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
- package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
- package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
- package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
- package/dist/Topic-19QeHBIR.d.cts +0 -91
- package/dist/Topic-19QeHBIR.d.cts.map +0 -1
- package/dist/Topic-DuFeqkBh.d.mts +0 -91
- package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
- package/dist/auth.d.cts.map +0 -1
- package/dist/auth.d.mts.map +0 -1
- package/dist/cache-0ANvRQnD.mjs +0 -51
- package/dist/cache-0ANvRQnD.mjs.map +0 -1
- package/dist/cache-3WSvAulx.cjs +0 -57
- package/dist/cache-3WSvAulx.cjs.map +0 -1
- package/dist/cache-BrRz3fEB.d.mts.map +0 -1
- package/dist/cache-BtZY_tHe.d.cts.map +0 -1
- package/dist/clone-DblgEZZa.mjs.map +0 -1
- package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
- package/dist/construct-interface-BfjcOD_E.cjs +0 -117
- package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
- package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
- package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
- package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
- package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
- package/dist/credential.cjs.map +0 -1
- package/dist/credential.d.cts.map +0 -1
- package/dist/credential.d.mts.map +0 -1
- package/dist/credential.mjs.map +0 -1
- package/dist/database/kysely.cjs.map +0 -1
- package/dist/database/kysely.d.cts.map +0 -1
- package/dist/database/kysely.d.mts.map +0 -1
- package/dist/database/kysely.mjs.map +0 -1
- package/dist/functions-i_la-N5r.cjs.map +0 -1
- package/dist/index-Bd5FqCoe.d.cts.map +0 -1
- package/dist/index-BknhM6Ux.d.mts +0 -31
- package/dist/index-BknhM6Ux.d.mts.map +0 -1
- package/dist/index-CBSfrowv.d.cts +0 -31
- package/dist/index-CBSfrowv.d.cts.map +0 -1
- package/dist/index-D24Xm79M.d.cts +0 -171
- package/dist/index-D24Xm79M.d.cts.map +0 -1
- package/dist/index-_ajboYxK.d.mts +0 -171
- package/dist/index-_ajboYxK.d.mts.map +0 -1
- package/dist/index-lAO9egTb.d.mts.map +0 -1
- package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
- package/dist/lazyAccessors-e3j2oE2m.cjs +0 -274
- package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
- package/dist/processAudits-CGqttuXm.cjs +0 -92
- package/dist/processAudits-CGqttuXm.cjs.map +0 -1
- package/dist/processAudits-Dmts9H_b.mjs +0 -80
- package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
- package/dist/queue/index.cjs.map +0 -1
- package/dist/queue/index.d.cts.map +0 -1
- package/dist/queue/index.d.mts.map +0 -1
- package/dist/queue/index.mjs.map +0 -1
- package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
- package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
- package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
- package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
- package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
- package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
- package/dist/topic/index.cjs.map +0 -1
- package/dist/topic/index.mjs.map +0 -1
- package/dist/types-BlAkSuGI.d.cts.map +0 -1
- package/dist/types-aKksMEWL.d.mts.map +0 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { n as Construct } from "./construct-interface-B1AfqRl4.cjs";
|
|
2
|
+
import { t as Cache } from "./cache-DnGDGly3.cjs";
|
|
3
|
+
import { Service } from "@geekmidas/services";
|
|
4
|
+
import { ConstructName, Declaration, PostgresVersion } from "@geekmidas/manifest";
|
|
5
|
+
import { Kysely, KyselyConfig } from "kysely";
|
|
6
|
+
import "pg";
|
|
7
|
+
//#region src/database/pool.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* End every pool opened, waiting for checked-out connections to come back.
|
|
10
|
+
* For a server's shutdown, after it has stopped taking requests.
|
|
11
|
+
*/
|
|
12
|
+
declare function closeDatabasePools(): Promise<void>;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/database/kysely.d.ts
|
|
15
|
+
/**
|
|
16
|
+
* Everything Kysely takes, plus what this construct declares.
|
|
17
|
+
*
|
|
18
|
+
* `dialect` is omitted because the construct owns it — it is built from the one
|
|
19
|
+
* URL the adapter supplied, which is the whole point of the construct. The rest
|
|
20
|
+
* of `KyselyConfig` (`plugins`, `log`) is the app's business and passes
|
|
21
|
+
* straight through, so anything Kysely adds later arrives without being
|
|
22
|
+
* tracked here.
|
|
23
|
+
*/
|
|
24
|
+
interface KyselyDatabaseBaseOptions extends Omit<KyselyConfig, 'dialect'> {
|
|
25
|
+
/**
|
|
26
|
+
* The schema, pinned on both roles' `search_path`.
|
|
27
|
+
*
|
|
28
|
+
* Defaults to `app` — the role the schema plays, rather than a restatement
|
|
29
|
+
* of the database's own name, which reads correctly beside `auth` and
|
|
30
|
+
* `pgboss` and keeps the application off `public`.
|
|
31
|
+
*/
|
|
32
|
+
schema?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Provision the owner/runtime role split. Defaults to on.
|
|
35
|
+
*
|
|
36
|
+
* Off falls back to the cluster's master credential in both URLs, giving up
|
|
37
|
+
* the DDL/DML split and putting credentials that can drop a table into the
|
|
38
|
+
* function's environment. A deliberate downgrade, not a default.
|
|
39
|
+
*/
|
|
40
|
+
roles?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Extensions to create in this database, as the cluster master, before the
|
|
43
|
+
* first migration — for the ones the owner role a migration runs as may not
|
|
44
|
+
* create (PostGIS is not a trusted extension). They are created in
|
|
45
|
+
* `public`, which joins this database's roles' `search_path`, so their
|
|
46
|
+
* types resolve unqualified.
|
|
47
|
+
*
|
|
48
|
+
* Only attempted: the image has to ship them.
|
|
49
|
+
*/
|
|
50
|
+
extensions?: readonly string[];
|
|
51
|
+
/**
|
|
52
|
+
* End each query run inside a request with a comment naming what ran it —
|
|
53
|
+
* `/*operation='POST /orders',request_id='…'*\/` — so `pg_stat_activity`
|
|
54
|
+
* and the server's logs can tie a query to its endpoint — and, inside a
|
|
55
|
+
* trace, with the query span's `traceparent='00-…'` (sqlcommenter), so
|
|
56
|
+
* they can tie it to the trace too. Defaults to on.
|
|
57
|
+
*/
|
|
58
|
+
queryTags?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Which Postgres the database runs: a major on the stock image, or an image
|
|
62
|
+
* the project names. One or the other, never both — an image's tag already
|
|
63
|
+
* says its major, and a second statement of it is one that can disagree.
|
|
64
|
+
*/
|
|
65
|
+
type PostgresRuntime = {
|
|
66
|
+
/**
|
|
67
|
+
* The Postgres major version to provision, on the stock image.
|
|
68
|
+
*
|
|
69
|
+
* Declared here so one statement reaches every target. It was
|
|
70
|
+
* previously set in two unrelated places — a container tag locally,
|
|
71
|
+
* nothing at all on AWS (so Aurora chose) — which is how local came to
|
|
72
|
+
* run 18 while deployed ran 17.7 with nothing recording the difference.
|
|
73
|
+
*
|
|
74
|
+
* Defaults to {@link DEFAULT_POSTGRES_VERSION}.
|
|
75
|
+
*/
|
|
76
|
+
version?: PostgresVersion;
|
|
77
|
+
image?: never;
|
|
78
|
+
} | {
|
|
79
|
+
/**
|
|
80
|
+
* The container image to run, wherever a target runs one (local,
|
|
81
|
+
* Dokploy), in place of `postgres:<version>`.
|
|
82
|
+
*
|
|
83
|
+
* Yours to choose and used as written: its tag is the major, and it
|
|
84
|
+
* should ship every extension in `extensions`. AWS runs RDS, ignores
|
|
85
|
+
* it, and provisions {@link DEFAULT_POSTGRES_VERSION}.
|
|
86
|
+
*
|
|
87
|
+
* ```ts
|
|
88
|
+
* new KyselyDatabase<GeoDB>('Geo', {
|
|
89
|
+
* image: 'postgis/postgis:18-3.6-alpine',
|
|
90
|
+
* extensions: ['postgis'],
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
image: string;
|
|
95
|
+
version?: never;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Everything Kysely takes, plus what this construct declares — including
|
|
99
|
+
* which Postgres it runs, as a version or an image.
|
|
100
|
+
*/
|
|
101
|
+
type KyselyDatabaseOptions = KyselyDatabaseBaseOptions & PostgresRuntime;
|
|
102
|
+
/** What makes a construct derived rather than a database in its own right. */
|
|
103
|
+
interface DerivedFrom {
|
|
104
|
+
kind: 'database-reader' | 'database-schema';
|
|
105
|
+
of: string;
|
|
106
|
+
schema?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @typeParam DB - the database's schema.
|
|
110
|
+
* @typeParam TName - the canonical id. TypeScript has no partial
|
|
111
|
+
* type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
|
|
112
|
+
* this at its default and the service key widens to `string`. `db` still types
|
|
113
|
+
* through `.database()`, which infers from the service.
|
|
114
|
+
*/
|
|
115
|
+
declare class KyselyDatabase<DB = unknown, TName extends string = string> implements Construct<TName, Kysely<DB>> {
|
|
116
|
+
private readonly options;
|
|
117
|
+
readonly id: TName;
|
|
118
|
+
readonly service: Service<Uncapitalize<TName>, Kysely<DB>>;
|
|
119
|
+
/**
|
|
120
|
+
* Declared once and read by both `declare()` and `connect()`, so the key the
|
|
121
|
+
* build publishes and the key the client reads cannot drift.
|
|
122
|
+
*/
|
|
123
|
+
private readonly config;
|
|
124
|
+
private readonly schemaName;
|
|
125
|
+
private readonly roles;
|
|
126
|
+
private readonly runtime;
|
|
127
|
+
private readonly derivedFrom?;
|
|
128
|
+
constructor(id: ConstructName<TName>, options?: KyselyDatabaseOptions, derivedFrom?: DerivedFrom);
|
|
129
|
+
declare(): Declaration[];
|
|
130
|
+
/**
|
|
131
|
+
* A read-only endpoint on this database.
|
|
132
|
+
*
|
|
133
|
+
* Read-only is enforced by the reader role's grants rather than by which
|
|
134
|
+
* endpoint it resolves to, so falling back to the writer where no replica
|
|
135
|
+
* exists is safe rather than a silently writable connection behind a name
|
|
136
|
+
* that says reader. There is no `writer()`: the database *is* the writer, so
|
|
137
|
+
* a replica can never be reached by accident.
|
|
138
|
+
*
|
|
139
|
+
* The return type is narrower than this class on purpose — see
|
|
140
|
+
* {@link ReadOnlyDatabase}.
|
|
141
|
+
*/
|
|
142
|
+
reader(): ReadOnlyDatabase<DB, `${TName}Reader`>;
|
|
143
|
+
/**
|
|
144
|
+
* A cache that lives in this database.
|
|
145
|
+
*
|
|
146
|
+
* The same strengthening `schema()` is over a second database: `new
|
|
147
|
+
* Cache('Sessions')` says the app caches and leaves where to the deployment,
|
|
148
|
+
* while this says it caches *here* — which is a fact about the application
|
|
149
|
+
* and so belongs in its code.
|
|
150
|
+
*
|
|
151
|
+
* What it buys beyond being explicit: the table's schema and the role that
|
|
152
|
+
* reaches it come from this database rather than from a second convention,
|
|
153
|
+
* and the backend no longer has to guess which database "the database" meant
|
|
154
|
+
* when an app declares two.
|
|
155
|
+
*
|
|
156
|
+
* A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
|
|
157
|
+
* is a key/value store, not a query builder, and typing it as the parent
|
|
158
|
+
* would be a convenience that lies.
|
|
159
|
+
*/
|
|
160
|
+
cache<TCache extends string = `${TName}Cache`>(id?: ConstructName<TCache>, options?: {
|
|
161
|
+
table?: string;
|
|
162
|
+
}): Cache<TCache>;
|
|
163
|
+
/**
|
|
164
|
+
* A second schema in this database, with its own role(s) and its own URL —
|
|
165
|
+
* so this database's role holds no grant on those tables at all.
|
|
166
|
+
*
|
|
167
|
+
* Typed separately because a tenant has its own tables: the point is that
|
|
168
|
+
* `auth.selectFrom('sessions')` type-checks and
|
|
169
|
+
* `orders.selectFrom('sessions')` does not.
|
|
170
|
+
*/
|
|
171
|
+
schema<TenantDB, TTenant extends string>(id: ConstructName<TTenant>, options?: KyselyDatabaseOptions): KyselyDatabase<TenantDB, TTenant>;
|
|
172
|
+
/**
|
|
173
|
+
* A connection as the *owner* role — the one that may create, alter and drop.
|
|
174
|
+
*
|
|
175
|
+
* A `Service` rather than part of the construct, and deliberately so: a
|
|
176
|
+
* construct is what `.dependsOn()` accepts, and nothing should be able to
|
|
177
|
+
* depend on this. A migrator asks for it by name; a handler cannot ask at
|
|
178
|
+
* all, which is the security property the role split exists for.
|
|
179
|
+
*
|
|
180
|
+
* Falls back to the runtime URL where no owner URL was published — the
|
|
181
|
+
* `roles: false` downgrade, where there is only one credential and it is the
|
|
182
|
+
* cluster master's.
|
|
183
|
+
*/
|
|
184
|
+
get owner(): Service<`${Uncapitalize<TName>}Owner`, Kysely<DB>>;
|
|
185
|
+
/**
|
|
186
|
+
* What this database's clients are built with besides a dialect — the
|
|
187
|
+
* plugins and logging it was declared with.
|
|
188
|
+
*
|
|
189
|
+
* Public so that whatever opens a connection to it outside \`connect()\` —
|
|
190
|
+
* a test's transaction — builds the same client. A test that dropped the
|
|
191
|
+
* plugins would write \`createdAt\` where production writes \`created_at\`.
|
|
192
|
+
*/
|
|
193
|
+
get clientConfig(): Omit<KyselyConfig, 'dialect'>;
|
|
194
|
+
private connect;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* A database you may read through, and derive nothing from.
|
|
198
|
+
*
|
|
199
|
+
* A reader is terminal in the graph, and this is that fact in the type system.
|
|
200
|
+
* `DERIVES_FROM` gives `cache` and `database-schema` no `database-reader`
|
|
201
|
+
* parent, and there is no reader of a reader — so `orders.reader().cache(…)`
|
|
202
|
+
* has always been illegal, but it type-checked and failed later at
|
|
203
|
+
* `assertDerivations`. That is a long way round to learn that a read-only
|
|
204
|
+
* endpoint cannot own a table something writes to.
|
|
205
|
+
*
|
|
206
|
+
* Omitting the three deriving methods rather than making them throw keeps the
|
|
207
|
+
* failure where it costs least: the editor, on the line that wrote it.
|
|
208
|
+
*
|
|
209
|
+
* The result is deliberately not assignable back to `KyselyDatabase` — a
|
|
210
|
+
* reader is not one, and anything that genuinely needs the writer should say
|
|
211
|
+
* so.
|
|
212
|
+
*/
|
|
213
|
+
type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
|
|
214
|
+
//#endregion
|
|
215
|
+
export { closeDatabasePools as a, ReadOnlyDatabase as i, KyselyDatabaseOptions as n, PostgresRuntime as r, KyselyDatabase as t };
|
|
216
|
+
//# sourceMappingURL=kysely-BHYV-WC-.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kysely-BHYV-WC-.d.cts","names":[],"sources":["../src/database/pool.ts","../src/database/kysely.ts"],"mappings":";;;;;;;;;;;iBAwGsB,sBAAsB;;;;;;;;;;;;UChElC,kCAAkC,KAAK;;;;;;;;EAQhD;;;;;;;;EAQA;;;;;;;;;;EAUA;;;;;;;;EAQA;;;;;;;KAQW;;;;;;;;;;;EAYT,UAAU;EACV;;;;;;;;;;;;;;;;;EAkBA;EACA;;;;;;KAOS,wBAAwB,4BAA4B;;UAGtD;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;EA2Bf,WAAW;;;;;;;;;;;;;EAyDX,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;UAiBX;;;;;;;;;;;;;;;;;;;KAuCH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { n as Construct } from "./construct-interface-ZvYQbivO.mjs";
|
|
2
|
+
import { t as Cache } from "./cache-5QZzh5Er.mjs";
|
|
3
|
+
import { ConstructName, Declaration, PostgresVersion } from "@geekmidas/manifest";
|
|
4
|
+
import { Service } from "@geekmidas/services";
|
|
5
|
+
import { Kysely, KyselyConfig } from "kysely";
|
|
6
|
+
import pg from "pg";
|
|
7
|
+
//#region src/database/pool.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* End every pool opened, waiting for checked-out connections to come back.
|
|
10
|
+
* For a server's shutdown, after it has stopped taking requests.
|
|
11
|
+
*/
|
|
12
|
+
declare function closeDatabasePools(): Promise<void>;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/database/kysely.d.ts
|
|
15
|
+
/**
|
|
16
|
+
* Everything Kysely takes, plus what this construct declares.
|
|
17
|
+
*
|
|
18
|
+
* `dialect` is omitted because the construct owns it — it is built from the one
|
|
19
|
+
* URL the adapter supplied, which is the whole point of the construct. The rest
|
|
20
|
+
* of `KyselyConfig` (`plugins`, `log`) is the app's business and passes
|
|
21
|
+
* straight through, so anything Kysely adds later arrives without being
|
|
22
|
+
* tracked here.
|
|
23
|
+
*/
|
|
24
|
+
interface KyselyDatabaseBaseOptions extends Omit<KyselyConfig, 'dialect'> {
|
|
25
|
+
/**
|
|
26
|
+
* The schema, pinned on both roles' `search_path`.
|
|
27
|
+
*
|
|
28
|
+
* Defaults to `app` — the role the schema plays, rather than a restatement
|
|
29
|
+
* of the database's own name, which reads correctly beside `auth` and
|
|
30
|
+
* `pgboss` and keeps the application off `public`.
|
|
31
|
+
*/
|
|
32
|
+
schema?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Provision the owner/runtime role split. Defaults to on.
|
|
35
|
+
*
|
|
36
|
+
* Off falls back to the cluster's master credential in both URLs, giving up
|
|
37
|
+
* the DDL/DML split and putting credentials that can drop a table into the
|
|
38
|
+
* function's environment. A deliberate downgrade, not a default.
|
|
39
|
+
*/
|
|
40
|
+
roles?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Extensions to create in this database, as the cluster master, before the
|
|
43
|
+
* first migration — for the ones the owner role a migration runs as may not
|
|
44
|
+
* create (PostGIS is not a trusted extension). They are created in
|
|
45
|
+
* `public`, which joins this database's roles' `search_path`, so their
|
|
46
|
+
* types resolve unqualified.
|
|
47
|
+
*
|
|
48
|
+
* Only attempted: the image has to ship them.
|
|
49
|
+
*/
|
|
50
|
+
extensions?: readonly string[];
|
|
51
|
+
/**
|
|
52
|
+
* End each query run inside a request with a comment naming what ran it —
|
|
53
|
+
* `/*operation='POST /orders',request_id='…'*\/` — so `pg_stat_activity`
|
|
54
|
+
* and the server's logs can tie a query to its endpoint — and, inside a
|
|
55
|
+
* trace, with the query span's `traceparent='00-…'` (sqlcommenter), so
|
|
56
|
+
* they can tie it to the trace too. Defaults to on.
|
|
57
|
+
*/
|
|
58
|
+
queryTags?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Which Postgres the database runs: a major on the stock image, or an image
|
|
62
|
+
* the project names. One or the other, never both — an image's tag already
|
|
63
|
+
* says its major, and a second statement of it is one that can disagree.
|
|
64
|
+
*/
|
|
65
|
+
type PostgresRuntime = {
|
|
66
|
+
/**
|
|
67
|
+
* The Postgres major version to provision, on the stock image.
|
|
68
|
+
*
|
|
69
|
+
* Declared here so one statement reaches every target. It was
|
|
70
|
+
* previously set in two unrelated places — a container tag locally,
|
|
71
|
+
* nothing at all on AWS (so Aurora chose) — which is how local came to
|
|
72
|
+
* run 18 while deployed ran 17.7 with nothing recording the difference.
|
|
73
|
+
*
|
|
74
|
+
* Defaults to {@link DEFAULT_POSTGRES_VERSION}.
|
|
75
|
+
*/
|
|
76
|
+
version?: PostgresVersion;
|
|
77
|
+
image?: never;
|
|
78
|
+
} | {
|
|
79
|
+
/**
|
|
80
|
+
* The container image to run, wherever a target runs one (local,
|
|
81
|
+
* Dokploy), in place of `postgres:<version>`.
|
|
82
|
+
*
|
|
83
|
+
* Yours to choose and used as written: its tag is the major, and it
|
|
84
|
+
* should ship every extension in `extensions`. AWS runs RDS, ignores
|
|
85
|
+
* it, and provisions {@link DEFAULT_POSTGRES_VERSION}.
|
|
86
|
+
*
|
|
87
|
+
* ```ts
|
|
88
|
+
* new KyselyDatabase<GeoDB>('Geo', {
|
|
89
|
+
* image: 'postgis/postgis:18-3.6-alpine',
|
|
90
|
+
* extensions: ['postgis'],
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
image: string;
|
|
95
|
+
version?: never;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Everything Kysely takes, plus what this construct declares — including
|
|
99
|
+
* which Postgres it runs, as a version or an image.
|
|
100
|
+
*/
|
|
101
|
+
type KyselyDatabaseOptions = KyselyDatabaseBaseOptions & PostgresRuntime;
|
|
102
|
+
/** What makes a construct derived rather than a database in its own right. */
|
|
103
|
+
interface DerivedFrom {
|
|
104
|
+
kind: 'database-reader' | 'database-schema';
|
|
105
|
+
of: string;
|
|
106
|
+
schema?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @typeParam DB - the database's schema.
|
|
110
|
+
* @typeParam TName - the canonical id. TypeScript has no partial
|
|
111
|
+
* type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
|
|
112
|
+
* this at its default and the service key widens to `string`. `db` still types
|
|
113
|
+
* through `.database()`, which infers from the service.
|
|
114
|
+
*/
|
|
115
|
+
declare class KyselyDatabase<DB = unknown, TName extends string = string> implements Construct<TName, Kysely<DB>> {
|
|
116
|
+
private readonly options;
|
|
117
|
+
readonly id: TName;
|
|
118
|
+
readonly service: Service<Uncapitalize<TName>, Kysely<DB>>;
|
|
119
|
+
/**
|
|
120
|
+
* Declared once and read by both `declare()` and `connect()`, so the key the
|
|
121
|
+
* build publishes and the key the client reads cannot drift.
|
|
122
|
+
*/
|
|
123
|
+
private readonly config;
|
|
124
|
+
private readonly schemaName;
|
|
125
|
+
private readonly roles;
|
|
126
|
+
private readonly runtime;
|
|
127
|
+
private readonly derivedFrom?;
|
|
128
|
+
constructor(id: ConstructName<TName>, options?: KyselyDatabaseOptions, derivedFrom?: DerivedFrom);
|
|
129
|
+
declare(): Declaration[];
|
|
130
|
+
/**
|
|
131
|
+
* A read-only endpoint on this database.
|
|
132
|
+
*
|
|
133
|
+
* Read-only is enforced by the reader role's grants rather than by which
|
|
134
|
+
* endpoint it resolves to, so falling back to the writer where no replica
|
|
135
|
+
* exists is safe rather than a silently writable connection behind a name
|
|
136
|
+
* that says reader. There is no `writer()`: the database *is* the writer, so
|
|
137
|
+
* a replica can never be reached by accident.
|
|
138
|
+
*
|
|
139
|
+
* The return type is narrower than this class on purpose — see
|
|
140
|
+
* {@link ReadOnlyDatabase}.
|
|
141
|
+
*/
|
|
142
|
+
reader(): ReadOnlyDatabase<DB, `${TName}Reader`>;
|
|
143
|
+
/**
|
|
144
|
+
* A cache that lives in this database.
|
|
145
|
+
*
|
|
146
|
+
* The same strengthening `schema()` is over a second database: `new
|
|
147
|
+
* Cache('Sessions')` says the app caches and leaves where to the deployment,
|
|
148
|
+
* while this says it caches *here* — which is a fact about the application
|
|
149
|
+
* and so belongs in its code.
|
|
150
|
+
*
|
|
151
|
+
* What it buys beyond being explicit: the table's schema and the role that
|
|
152
|
+
* reaches it come from this database rather than from a second convention,
|
|
153
|
+
* and the backend no longer has to guess which database "the database" meant
|
|
154
|
+
* when an app declares two.
|
|
155
|
+
*
|
|
156
|
+
* A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
|
|
157
|
+
* is a key/value store, not a query builder, and typing it as the parent
|
|
158
|
+
* would be a convenience that lies.
|
|
159
|
+
*/
|
|
160
|
+
cache<TCache extends string = `${TName}Cache`>(id?: ConstructName<TCache>, options?: {
|
|
161
|
+
table?: string;
|
|
162
|
+
}): Cache<TCache>;
|
|
163
|
+
/**
|
|
164
|
+
* A second schema in this database, with its own role(s) and its own URL —
|
|
165
|
+
* so this database's role holds no grant on those tables at all.
|
|
166
|
+
*
|
|
167
|
+
* Typed separately because a tenant has its own tables: the point is that
|
|
168
|
+
* `auth.selectFrom('sessions')` type-checks and
|
|
169
|
+
* `orders.selectFrom('sessions')` does not.
|
|
170
|
+
*/
|
|
171
|
+
schema<TenantDB, TTenant extends string>(id: ConstructName<TTenant>, options?: KyselyDatabaseOptions): KyselyDatabase<TenantDB, TTenant>;
|
|
172
|
+
/**
|
|
173
|
+
* A connection as the *owner* role — the one that may create, alter and drop.
|
|
174
|
+
*
|
|
175
|
+
* A `Service` rather than part of the construct, and deliberately so: a
|
|
176
|
+
* construct is what `.dependsOn()` accepts, and nothing should be able to
|
|
177
|
+
* depend on this. A migrator asks for it by name; a handler cannot ask at
|
|
178
|
+
* all, which is the security property the role split exists for.
|
|
179
|
+
*
|
|
180
|
+
* Falls back to the runtime URL where no owner URL was published — the
|
|
181
|
+
* `roles: false` downgrade, where there is only one credential and it is the
|
|
182
|
+
* cluster master's.
|
|
183
|
+
*/
|
|
184
|
+
get owner(): Service<`${Uncapitalize<TName>}Owner`, Kysely<DB>>;
|
|
185
|
+
/**
|
|
186
|
+
* What this database's clients are built with besides a dialect — the
|
|
187
|
+
* plugins and logging it was declared with.
|
|
188
|
+
*
|
|
189
|
+
* Public so that whatever opens a connection to it outside \`connect()\` —
|
|
190
|
+
* a test's transaction — builds the same client. A test that dropped the
|
|
191
|
+
* plugins would write \`createdAt\` where production writes \`created_at\`.
|
|
192
|
+
*/
|
|
193
|
+
get clientConfig(): Omit<KyselyConfig, 'dialect'>;
|
|
194
|
+
private connect;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* A database you may read through, and derive nothing from.
|
|
198
|
+
*
|
|
199
|
+
* A reader is terminal in the graph, and this is that fact in the type system.
|
|
200
|
+
* `DERIVES_FROM` gives `cache` and `database-schema` no `database-reader`
|
|
201
|
+
* parent, and there is no reader of a reader — so `orders.reader().cache(…)`
|
|
202
|
+
* has always been illegal, but it type-checked and failed later at
|
|
203
|
+
* `assertDerivations`. That is a long way round to learn that a read-only
|
|
204
|
+
* endpoint cannot own a table something writes to.
|
|
205
|
+
*
|
|
206
|
+
* Omitting the three deriving methods rather than making them throw keeps the
|
|
207
|
+
* failure where it costs least: the editor, on the line that wrote it.
|
|
208
|
+
*
|
|
209
|
+
* The result is deliberately not assignable back to `KyselyDatabase` — a
|
|
210
|
+
* reader is not one, and anything that genuinely needs the writer should say
|
|
211
|
+
* so.
|
|
212
|
+
*/
|
|
213
|
+
type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
|
|
214
|
+
//#endregion
|
|
215
|
+
export { closeDatabasePools as a, ReadOnlyDatabase as i, KyselyDatabaseOptions as n, PostgresRuntime as r, KyselyDatabase as t };
|
|
216
|
+
//# sourceMappingURL=kysely-CAW3QSqp.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kysely-CAW3QSqp.d.mts","names":[],"sources":["../src/database/pool.ts","../src/database/kysely.ts"],"mappings":";;;;;;;;;;;iBAwGsB,sBAAsB;;;;;;;;;;;;UChElC,kCAAkC,KAAK;;;;;;;;EAQhD;;;;;;;;EAQA;;;;;;;;;;EAUA;;;;;;;;EAQA;;;;;;;KAQW;;;;;;;;;;;EAYT,UAAU;EACV;;;;;;;;;;;;;;;;;EAkBA;EACA;;;;;;KAOS,wBAAwB,4BAA4B;;UAGtD;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;EA2Bf,WAAW;;;;;;;;;;;;;EAyDX,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;UAiBX;;;;;;;;;;;;;;;;;;;KAuCH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
|