@geekmidas/constructs 10.0.0-alpha.2 → 10.0.0-alpha.21
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 +46 -3
- package/dist/{Construct-Ct8nalEi.d.mts → Construct-DTqYvkPG.d.cts} +11 -13
- package/dist/Construct-DTqYvkPG.d.cts.map +1 -0
- package/dist/{Construct-BD5neF7w.mjs → Construct-Detz65RA.mjs} +31 -29
- package/dist/Construct-Detz65RA.mjs.map +1 -0
- package/dist/{Construct-C0ijr2qp.d.cts → Construct-pVadmURD.d.mts} +10 -12
- package/dist/Construct-pVadmURD.d.mts.map +1 -0
- package/dist/{Construct-CyS3RpTL.cjs → Construct-yG9Sw-5p.cjs} +51 -43
- package/dist/Construct-yG9Sw-5p.cjs.map +1 -0
- package/dist/{Cron-ByxdOfpE.d.mts → Cron-AYpQq725.d.mts} +13 -6
- package/dist/Cron-AYpQq725.d.mts.map +1 -0
- package/dist/{Cron-Wqh464aO.d.cts → Cron-Bdcg9OAL.d.cts} +12 -5
- package/dist/Cron-Bdcg9OAL.d.cts.map +1 -0
- package/dist/{CronBuilder-BL0AP6fs.d.mts → CronBuilder-DR21m9h2.d.cts} +7 -10
- package/dist/CronBuilder-DR21m9h2.d.cts.map +1 -0
- package/dist/{CronBuilder-BqpEzMPQ.d.cts → CronBuilder-DeBnPVIT.d.mts} +7 -10
- package/dist/CronBuilder-DeBnPVIT.d.mts.map +1 -0
- package/dist/{CronBuilder-BmABazzH.mjs → CronBuilder-vkjuo1UP.mjs} +23 -15
- package/dist/CronBuilder-vkjuo1UP.mjs.map +1 -0
- package/dist/{CronBuilder-CkXPJiGO.cjs → CronBuilder-zdTdaT-e.cjs} +33 -25
- package/dist/CronBuilder-zdTdaT-e.cjs.map +1 -0
- package/dist/{Endpoint-2Wg7T7Cq.d.mts → Endpoint-BxkRWQ8G.d.mts} +63 -84
- package/dist/Endpoint-BxkRWQ8G.d.mts.map +1 -0
- package/dist/{Endpoint-BiaaMEn_.cjs → Endpoint-CtiPUpRX.cjs} +145 -131
- package/dist/Endpoint-CtiPUpRX.cjs.map +1 -0
- package/dist/{Endpoint-VIOpSo0S.mjs → Endpoint-DCr5tlbJ.mjs} +117 -109
- package/dist/Endpoint-DCr5tlbJ.mjs.map +1 -0
- package/dist/{Endpoint-CH9Fn1AD.d.cts → Endpoint-DbYQJgb-.d.cts} +61 -82
- package/dist/Endpoint-DbYQJgb-.d.cts.map +1 -0
- package/dist/{EndpointFactory-DTTCkGEL.mjs → EndpointFactory-Bs8pu-yY.mjs} +20 -29
- package/dist/EndpointFactory-Bs8pu-yY.mjs.map +1 -0
- package/dist/{index-BxHDdy6a.d.mts → EndpointFactory-DE6nKtFZ.d.cts} +12 -92
- package/dist/EndpointFactory-DE6nKtFZ.d.cts.map +1 -0
- package/dist/{index-V2nksZIJ.d.cts → EndpointFactory-T06kTFHg.d.mts} +12 -92
- package/dist/EndpointFactory-T06kTFHg.d.mts.map +1 -0
- package/dist/{EndpointFactory-ChxLZllA.cjs → EndpointFactory-vE2C1NG1.cjs} +57 -66
- package/dist/EndpointFactory-vE2C1NG1.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-NKQQQbBY.mjs → HonoEndpointAdaptor-Be6UdK0r.mjs} +40 -47
- package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs.map → HonoEndpointAdaptor-Be6UdK0r.mjs.map} +1 -1
- package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs → HonoEndpointAdaptor-C9aivwKl.cjs} +48 -52
- package/dist/HonoEndpointAdaptor-C9aivwKl.cjs.map +1 -0
- package/dist/{Queue-D7ZuwBhy.d.cts → Queue-Bhzi2WQC.d.cts} +8 -9
- package/dist/Queue-Bhzi2WQC.d.cts.map +1 -0
- package/dist/{Queue-gVGfi2Yk.d.mts → Queue-BoUA-e83.d.mts} +9 -10
- package/dist/Queue-BoUA-e83.d.mts.map +1 -0
- package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-CIO3pwji.d.mts} +7 -8
- package/dist/Subscriber-CIO3pwji.d.mts.map +1 -0
- package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-DQCaiOXF.d.cts} +7 -8
- package/dist/Subscriber-DQCaiOXF.d.cts.map +1 -0
- package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-B4YRTBng.mjs} +16 -10
- package/dist/SubscriberBuilder-B4YRTBng.mjs.map +1 -0
- package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-C2bCOuPT.cjs} +28 -23
- package/dist/SubscriberBuilder-C2bCOuPT.cjs.map +1 -0
- package/dist/{SubscriberBuilder-Dptmo-1A.d.mts → SubscriberBuilder-ChX5v948.d.cts} +8 -11
- package/dist/SubscriberBuilder-ChX5v948.d.cts.map +1 -0
- package/dist/{SubscriberBuilder-waNhzjSM.d.cts → SubscriberBuilder-Dbiaskfi.d.mts} +8 -11
- package/dist/SubscriberBuilder-Dbiaskfi.d.mts.map +1 -0
- package/dist/{Topic-19QeHBIR.d.cts → Topic-D6blllEn.d.cts} +5 -7
- package/dist/Topic-D6blllEn.d.cts.map +1 -0
- package/dist/{Topic-DuFeqkBh.d.mts → Topic-DVvheJ_-.d.mts} +6 -8
- package/dist/Topic-DVvheJ_-.d.mts.map +1 -0
- package/dist/adaptors/aws.cjs +87 -106
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +14 -27
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +16 -29
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +60 -81
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/hono.cjs +3 -10
- package/dist/adaptors/hono.d.cts +5 -13
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +7 -15
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +2 -10
- package/dist/adaptors/testing.cjs +271 -82
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +62 -33
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +63 -34
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +249 -63
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-BlO8MUkR.d.cts +123 -0
- package/dist/auth-BlO8MUkR.d.cts.map +1 -0
- package/dist/auth-CHWIdcQO.d.mts +123 -0
- package/dist/auth-CHWIdcQO.d.mts.map +1 -0
- package/dist/auth.cjs +41 -16
- 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 +32 -8
- package/dist/auth.mjs.map +1 -1
- package/dist/{cache-BrRz3fEB.d.mts → cache-AgQUMma6.d.mts} +3 -6
- package/dist/cache-AgQUMma6.d.mts.map +1 -0
- package/dist/{cache-BtZY_tHe.d.cts → cache-obq0fOIM.d.cts} +3 -6
- package/dist/cache-obq0fOIM.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/{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-g5GM5pwR.d.mts → construct-interface-Clz7_BwB.d.mts} +15 -6
- package/dist/construct-interface-Clz7_BwB.d.mts.map +1 -0
- package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-DIaTNKax.d.cts} +15 -6
- package/dist/construct-interface-DIaTNKax.d.cts.map +1 -0
- package/dist/construct-interface.cjs +87 -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 +81 -2
- package/dist/construct-interface.mjs.map +1 -0
- package/dist/credential.cjs +43 -9
- package/dist/credential.cjs.map +1 -1
- package/dist/credential.d.cts +5 -8
- package/dist/credential.d.cts.map +1 -1
- package/dist/credential.d.mts +5 -8
- package/dist/credential.d.mts.map +1 -1
- package/dist/credential.mjs +36 -2
- package/dist/credential.mjs.map +1 -1
- package/dist/crons/index.cjs +68 -10
- package/dist/crons/index.cjs.map +1 -1
- package/dist/crons/index.d.cts +32 -14
- package/dist/crons/index.d.cts.map +1 -1
- package/dist/crons/index.d.mts +32 -14
- package/dist/crons/index.d.mts.map +1 -1
- package/dist/crons/index.mjs +66 -10
- package/dist/crons/index.mjs.map +1 -1
- package/dist/database/kysely.cjs +28 -14
- package/dist/database/kysely.cjs.map +1 -1
- package/dist/database/kysely.d.cts +2 -152
- package/dist/database/kysely.d.mts +2 -152
- package/dist/database/kysely.mjs +16 -4
- package/dist/database/kysely.mjs.map +1 -1
- 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 +3 -7
- package/dist/email.d.mts.map +1 -1
- package/dist/email.mjs +16 -3
- package/dist/email.mjs.map +1 -1
- package/dist/endpoints/index.cjs +7 -10
- package/dist/endpoints/index.d.cts +60 -7
- package/dist/endpoints/index.d.cts.map +1 -0
- package/dist/endpoints/index.d.mts +60 -7
- package/dist/endpoints/index.d.mts.map +1 -0
- package/dist/endpoints/index.mjs +5 -10
- package/dist/file-server.cjs +42 -10
- package/dist/file-server.cjs.map +1 -1
- package/dist/file-server.d.cts +6 -10
- package/dist/file-server.d.cts.map +1 -1
- package/dist/file-server.d.mts +6 -10
- package/dist/file-server.d.mts.map +1 -1
- package/dist/file-server.mjs +34 -2
- package/dist/file-server.mjs.map +1 -1
- package/dist/functions/index.cjs +2 -6
- package/dist/functions/index.d.cts +2 -4
- package/dist/functions/index.d.mts +2 -4
- package/dist/functions/index.mjs +2 -6
- package/dist/{functions-Bd3TPxid.cjs → functions-VnOTEp74.cjs} +309 -264
- package/dist/functions-VnOTEp74.cjs.map +1 -0
- package/dist/{functions-Cxbo-pEd.mjs → functions-faoJOUmr.mjs} +282 -234
- package/dist/functions-faoJOUmr.mjs.map +1 -0
- package/dist/index-CeEtxDmK.d.cts +79 -0
- package/dist/index-CeEtxDmK.d.cts.map +1 -0
- package/dist/index-CeEtxDmK.d.mts +79 -0
- package/dist/index-CeEtxDmK.d.mts.map +1 -0
- package/dist/{index-JSf9xNIJ.d.cts → index-DU3Twmwh.d.mts} +19 -24
- package/dist/index-DU3Twmwh.d.mts.map +1 -0
- package/dist/index-fnpjXiA-.d.mts +26 -0
- package/dist/index-fnpjXiA-.d.mts.map +1 -0
- package/dist/{index-CubPzHd9.d.mts → index-nBQT1tAh.d.cts} +19 -24
- package/dist/index-nBQT1tAh.d.cts.map +1 -0
- package/dist/index-tE_119SX.d.cts +26 -0
- package/dist/index-tE_119SX.d.cts.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +2 -3
- package/dist/kysely-CXi49zc2.d.cts +150 -0
- package/dist/kysely-CXi49zc2.d.cts.map +1 -0
- package/dist/kysely-D3-G5b0j.d.mts +150 -0
- package/dist/kysely-D3-G5b0j.d.mts.map +1 -0
- package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-BHtcqgz2.mjs} +22 -25
- package/dist/lazyAccessors-BHtcqgz2.mjs.map +1 -0
- package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-Dx9NLwJZ.cjs} +72 -76
- package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +1 -0
- package/dist/object-storage.cjs +18 -10
- package/dist/object-storage.cjs.map +1 -1
- package/dist/object-storage.d.cts +3 -7
- package/dist/object-storage.d.cts.map +1 -1
- package/dist/object-storage.d.mts +3 -7
- package/dist/object-storage.d.mts.map +1 -1
- package/dist/object-storage.mjs +11 -3
- package/dist/object-storage.mjs.map +1 -1
- package/dist/{processAudits-Dmts9H_b.mjs → processAudits-BpRlPQMW.mjs} +16 -19
- package/dist/processAudits-BpRlPQMW.mjs.map +1 -0
- package/dist/{processAudits-CGqttuXm.cjs → processAudits-D_2W5x8k.cjs} +26 -30
- package/dist/processAudits-D_2W5x8k.cjs.map +1 -0
- package/dist/queue/index.cjs +25 -21
- package/dist/queue/index.cjs.map +1 -1
- package/dist/queue/index.d.cts +8 -15
- package/dist/queue/index.d.cts.map +1 -1
- package/dist/queue/index.d.mts +8 -15
- package/dist/queue/index.d.mts.map +1 -1
- package/dist/queue/index.mjs +15 -11
- package/dist/queue/index.mjs.map +1 -1
- package/dist/rest-api.cjs +88 -62
- package/dist/rest-api.cjs.map +1 -1
- package/dist/rest-api.d.cts +62 -60
- package/dist/rest-api.d.cts.map +1 -1
- package/dist/rest-api.d.mts +62 -60
- package/dist/rest-api.d.mts.map +1 -1
- package/dist/rest-api.mjs +80 -54
- package/dist/rest-api.mjs.map +1 -1
- package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
- package/dist/site.cjs +33 -9
- package/dist/site.cjs.map +1 -1
- package/dist/site.d.cts +11 -22
- package/dist/site.d.cts.map +1 -1
- package/dist/site.d.mts +11 -22
- package/dist/site.d.mts.map +1 -1
- package/dist/site.mjs +29 -5
- package/dist/site.mjs.map +1 -1
- package/dist/subscribers/index.cjs +2 -11
- package/dist/subscribers/index.d.cts +3 -14
- package/dist/subscribers/index.d.mts +3 -14
- package/dist/subscribers/index.mjs +2 -11
- 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-C3L0iS28.d.cts → telemetry-DGcFlVpB.d.cts} +2 -5
- package/dist/telemetry-DGcFlVpB.d.cts.map +1 -0
- package/dist/{telemetry-D7bVFLGi.d.mts → telemetry-DGcFlVpB.d.mts} +2 -5
- package/dist/telemetry-DGcFlVpB.d.mts.map +1 -0
- package/dist/topic/index.cjs +18 -20
- package/dist/topic/index.cjs.map +1 -1
- package/dist/topic/index.d.cts +3 -32
- package/dist/topic/index.d.mts +3 -32
- package/dist/topic/index.mjs +8 -10
- package/dist/topic/index.mjs.map +1 -1
- 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 +109 -35
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +87 -42
- package/dist/worker.d.cts.map +1 -1
- package/dist/worker.d.mts +87 -42
- package/dist/worker.d.mts.map +1 -1
- package/dist/worker.mjs +104 -30
- package/dist/worker.mjs.map +1 -1
- package/package.json +59 -55
- package/dist/Construct-BD5neF7w.mjs.map +0 -1
- package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
- package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
- package/dist/Construct-CyS3RpTL.cjs.map +0 -1
- package/dist/Cron-ByxdOfpE.d.mts.map +0 -1
- package/dist/Cron-Wqh464aO.d.cts.map +0 -1
- package/dist/CronBuilder-BL0AP6fs.d.mts.map +0 -1
- package/dist/CronBuilder-BmABazzH.mjs.map +0 -1
- package/dist/CronBuilder-BqpEzMPQ.d.cts.map +0 -1
- package/dist/CronBuilder-CkXPJiGO.cjs.map +0 -1
- package/dist/Endpoint-2Wg7T7Cq.d.mts.map +0 -1
- package/dist/Endpoint-BiaaMEn_.cjs.map +0 -1
- package/dist/Endpoint-CH9Fn1AD.d.cts.map +0 -1
- package/dist/Endpoint-VIOpSo0S.mjs.map +0 -1
- package/dist/EndpointFactory-ChxLZllA.cjs.map +0 -1
- package/dist/EndpointFactory-DTTCkGEL.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-NKQQQbBY.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.map +0 -1
- package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
- package/dist/Topic-19QeHBIR.d.cts.map +0 -1
- 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/database/kysely.d.cts.map +0 -1
- package/dist/database/kysely.d.mts.map +0 -1
- package/dist/functions-Bd3TPxid.cjs.map +0 -1
- package/dist/functions-Cxbo-pEd.mjs.map +0 -1
- package/dist/index-BxHDdy6a.d.mts.map +0 -1
- package/dist/index-CubPzHd9.d.mts.map +0 -1
- package/dist/index-JSf9xNIJ.d.cts.map +0 -1
- package/dist/index-V2nksZIJ.d.cts.map +0 -1
- package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
- package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
- package/dist/processAudits-CGqttuXm.cjs.map +0 -1
- package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
- package/dist/subscribers/index.cjs.map +0 -1
- package/dist/subscribers/index.d.cts.map +0 -1
- package/dist/subscribers/index.d.mts.map +0 -1
- package/dist/subscribers/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.d.cts.map +0 -1
- package/dist/topic/index.d.mts.map +0 -1
- package/dist/types-BlAkSuGI.d.cts.map +0 -1
- package/dist/types-aKksMEWL.d.mts.map +0 -1
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as StandardSchemaV1 } from "./index-CeEtxDmK.mjs";
|
|
2
|
+
import { n as ConstructType, t as Construct } from "./Construct-pVadmURD.mjs";
|
|
3
|
+
import { c as ServicesOf, r as Consumable } from "./construct-interface-Clz7_BwB.mjs";
|
|
3
4
|
import { EventPublisher, MappedEvent } from "@geekmidas/events";
|
|
4
|
-
import * as _geekmidas_logger22 from "@geekmidas/logger";
|
|
5
|
-
import { Logger } from "@geekmidas/logger";
|
|
6
|
-
import * as _geekmidas_schema21 from "@geekmidas/schema";
|
|
7
|
-
import { ComposableStandardSchema, InferComposableStandardSchema, InferStandardSchema } from "@geekmidas/schema";
|
|
8
5
|
import { Service, ServiceRecord } from "@geekmidas/services";
|
|
9
|
-
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
10
|
-
import * as _geekmidas_audit23 from "@geekmidas/audit";
|
|
11
6
|
import { AuditStorage, AuditableAction, Auditor } from "@geekmidas/audit";
|
|
12
|
-
|
|
7
|
+
import { Logger } from "@geekmidas/logger";
|
|
8
|
+
import { ComposableStandardSchema, InferComposableStandardSchema, InferStandardSchema } from "@geekmidas/schema";
|
|
13
9
|
//#region src/functions/Function.d.ts
|
|
14
|
-
|
|
15
10
|
declare class Function<TInput extends ComposableStandardSchema | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, Fn extends FunctionHandler<TInput, TServices, TLogger, OutSchema, TDatabase, TAuditStorage, TAuditAction> = FunctionHandler<TInput, TServices, TLogger, OutSchema, TDatabase, TAuditStorage, TAuditAction>> extends Construct<TLogger, TEventPublisherServiceName, TEventPublisher, OutSchema, TServices, TAuditStorageServiceName, TAuditStorage> {
|
|
16
11
|
readonly fn: Fn;
|
|
17
12
|
input?: TInput | undefined;
|
|
18
|
-
databaseService?: Service<TDatabaseServiceName, TDatabase
|
|
13
|
+
databaseService?: Service<TDatabaseServiceName, TDatabase>;
|
|
19
14
|
__IS_FUNCTION__: boolean;
|
|
20
15
|
static isFunction(obj: any): obj is Function<any, any, any, any, any>;
|
|
21
16
|
/**
|
|
@@ -25,7 +20,7 @@ declare class Function<TInput extends ComposableStandardSchema | undefined = und
|
|
|
25
20
|
* @param data - The data to validate
|
|
26
21
|
* @returns Validation result with value or issues
|
|
27
22
|
*/
|
|
28
|
-
static validate<T extends StandardSchemaV1>(schema: T, data: unknown): StandardSchemaV1.Result<unknown
|
|
23
|
+
static validate<T extends StandardSchemaV1>(schema: T, data: unknown): Promise<StandardSchemaV1.Result<unknown>> | StandardSchemaV1.Result<unknown>;
|
|
29
24
|
/**
|
|
30
25
|
* Parses and validates data against a schema, throwing an error if validation fails.
|
|
31
26
|
*
|
|
@@ -43,9 +38,8 @@ declare class Function<TInput extends ComposableStandardSchema | undefined = und
|
|
|
43
38
|
* @throws {UnprocessableEntityError} When output validation fails
|
|
44
39
|
*/
|
|
45
40
|
parseOutput(output: unknown): Promise<InferStandardSchema<OutSchema>>;
|
|
46
|
-
constructor(fn: Fn, timeout?: number
|
|
47
|
-
|
|
48
|
-
type?: ConstructType, input?: TInput | undefined, outputSchema?: OutSchema, services?: TServices, logger?: TLogger, publisherService?: Service<TEventPublisherServiceName, TEventPublisher>, events?: MappedEvent<TEventPublisher, OutSchema>[], memorySize?: number, auditorStorageService?: Service<TAuditStorageServiceName, TAuditStorage>, databaseService?: Service<TDatabaseServiceName, TDatabase> | undefined,
|
|
41
|
+
constructor(fn: Fn, timeout?: number // Default timeout of 30 seconds
|
|
42
|
+
, type?: ConstructType, input?: TInput | undefined, outputSchema?: OutSchema, services?: TServices, logger?: TLogger, publisherService?: Service<TEventPublisherServiceName, TEventPublisher>, events?: MappedEvent<TEventPublisher, OutSchema>[], memorySize?: number, auditorStorageService?: Service<TAuditStorageServiceName, TAuditStorage>, databaseService?: Service<TDatabaseServiceName, TDatabase>,
|
|
49
43
|
/**
|
|
50
44
|
* The construct ids `.dependsOn()` named — last, so no existing positional
|
|
51
45
|
* argument moves.
|
|
@@ -99,6 +93,14 @@ declare abstract class BaseFunctionBuilder<TInput extends ComposableStandardSche
|
|
|
99
93
|
* which process runs it without a directory having to imply it.
|
|
100
94
|
*/
|
|
101
95
|
_owner?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Where a cron built from this factory keeps its schedule.
|
|
98
|
+
*
|
|
99
|
+
* Set by the worker that handed the factory out, the same way the logger
|
|
100
|
+
* and the owner are — so a cron file names a schedule and nothing else.
|
|
101
|
+
* Only a server target reads it; on AWS the schedule is an EventBridge rule.
|
|
102
|
+
*/
|
|
103
|
+
_scheduleStore?: unknown;
|
|
102
104
|
protected _events: MappedEvent<TEventPublisher, OutSchema>[];
|
|
103
105
|
protected _publisher?: Service<TEventPublisherServiceName, TEventPublisher>;
|
|
104
106
|
protected _auditorStorage?: Service<TAuditStorageServiceName, TAuditStorage>;
|
|
@@ -120,7 +122,6 @@ declare abstract class BaseFunctionBuilder<TInput extends ComposableStandardSche
|
|
|
120
122
|
*/
|
|
121
123
|
database<T, TName extends string>(source: Consumable<TName, T> | Service<TName, T>): BaseFunctionBuilder<TInput, OutSchema, TServices, TLogger, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, T, TName>;
|
|
122
124
|
}
|
|
123
|
-
//# sourceMappingURL=BaseFunctionBuilder.d.ts.map
|
|
124
125
|
//#endregion
|
|
125
126
|
//#region src/functions/FunctionBuilder.d.ts
|
|
126
127
|
declare class FunctionBuilder<TInput extends ComposableStandardSchema, OutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>> extends BaseFunctionBuilder<TInput, OutSchema, TServices, TLogger, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName> {
|
|
@@ -159,12 +160,6 @@ declare class FunctionBuilder<TInput extends ComposableStandardSchema, OutSchema
|
|
|
159
160
|
database<T, TName extends string>(source: Consumable<TName, T> | Service<TName, T>): FunctionBuilder<TInput, OutSchema, TServices, TLogger, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, T, TName, TAuditAction>;
|
|
160
161
|
handle(fn: FunctionHandler<TInput, TServices, TLogger, OutSchema, TDatabase, TAuditStorage, TAuditAction>): Function<TInput, TServices, TLogger, OutSchema, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName, TAuditAction, FunctionHandler<TInput, TServices, TLogger, OutSchema, TDatabase, TAuditStorage, TAuditAction>>;
|
|
161
162
|
}
|
|
162
|
-
//# sourceMappingURL=FunctionBuilder.d.ts.map
|
|
163
|
-
//#endregion
|
|
164
|
-
//#region src/functions/index.d.ts
|
|
165
|
-
declare const f: FunctionBuilder<_geekmidas_schema21.ComposableStandardSchema, undefined, [], _geekmidas_logger22.Logger, undefined, string, undefined, string, undefined, string, _geekmidas_audit23.AuditableAction<string, unknown>>;
|
|
166
|
-
//# sourceMappingURL=index.d.ts.map
|
|
167
|
-
|
|
168
163
|
//#endregion
|
|
169
|
-
export { BaseFunctionBuilder, Function, FunctionBuilder
|
|
170
|
-
//# sourceMappingURL=index-
|
|
164
|
+
export { FunctionHandler as a, FunctionContext as i, BaseFunctionBuilder as n, Function as r, FunctionBuilder as t };
|
|
165
|
+
//# sourceMappingURL=index-DU3Twmwh.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DU3Twmwh.d.mts","names":[],"sources":["../src/functions/Function.ts","../src/functions/BaseFunctionBuilder.ts","../src/functions/FunctionBuilder.ts"],"mappings":";;;;;;;;;cA+Ca,SACZ,eAAe,kDACf,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,wBAAwB,6CACxB,oDACA,sBAAsB,sCACtB,kDACA,uBACA,8CACA,qBAAqB,mCAAmC,kCAIxD,WAAW,gBACV,QACA,WACA,SACA,WACA,WACA,eACA,gBACG,gBACH,QACA,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eACA,0BACA,WACA,sBACA;EAmBD,MAAM,UAAU,0BACf,QAAQ,IACN,gBACF,GACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;;;;;;;;;;;;EA8BD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,gBACF,QACA,eACI,cAAc,WAAW,KAC7B,SACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;EAgCD,SAAS,UAAU,WAClB,UAAU,IACR,gBACF,QACA,eACI,cAAc,IAClB,SACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;EAsBD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,WACA,WACA,GACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;EAmBQ,UAAU,UAAU,qBAAqB,sBACjD,WAAW,QAAQ,OAAO,KACxB,gBACF,QACA,WACA,WACA,SACA,GACA,OACA,eACA,0BACA,WACA,sBACA;EAsBQ,QAAQ,UAAU,cAAc,sBACxC,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,WACA,WACA,SACA,iBACA,4BACA,GACA,OACA,WACA,sBACA;;;;;EA0BD,QAAQ,UAAU,qCAAqC,gBACtD,QACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;;;;;EAqBQ,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,GACA,OACA;EAwBD,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,WACA,eACA,gBAEC,SACF,QACA,WACA,SACA,WACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA,cACA,gBACC,QACA,WACA,SACA,WACA,WACA,eACA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { n as TopicEvents, t as Topic } from "./Topic-DVvheJ_-.mjs";
|
|
2
|
+
import { Logger } from "@geekmidas/logger";
|
|
3
|
+
//#region src/topic/TopicBuilder.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.
|
|
6
|
+
* The event map is the topic's contract: it types the derived `topic.publisher`
|
|
7
|
+
* and the subscribers that bind via `s.topic(topic)`.
|
|
8
|
+
*/
|
|
9
|
+
declare class TopicBuilder<TName extends string = string, TEvents extends TopicEvents = TopicEvents> {
|
|
10
|
+
private _name?;
|
|
11
|
+
private _logger;
|
|
12
|
+
/** The topic name — drives the infra topic and its `<NAME>_*` env vars. */
|
|
13
|
+
topic<T extends string>(name: T): TopicBuilder<T, TEvents>;
|
|
14
|
+
logger(logger: Logger): this;
|
|
15
|
+
/**
|
|
16
|
+
* The event contract — a map of event type → payload schema. Building the
|
|
17
|
+
* topic requires this; it's what types the publisher and subscribers.
|
|
18
|
+
*/
|
|
19
|
+
events<T extends TopicEvents>(events: T): Topic<TName, T>;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/topic/index.d.ts
|
|
23
|
+
export declare const t: TopicBuilder<string, TopicEvents>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { TopicBuilder as n };
|
|
26
|
+
//# sourceMappingURL=index-fnpjXiA-.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-fnpjXiA-.d.mts","names":["_$__Topic0.TopicEvents"],"sources":["../src/topic/TopicBuilder.ts","../src/topic/index.ts"],"mappings":";;;;;;;;cAUa,aACZ,+BACA,gBAAgB,cAAc;UAEtB;UACA;;EAGR,MAAM,kBAAkB,MAAM,IAAI,aAAa,GAAG;EAOlD,OAAO,QAAQ;;;;;EAQf,OAAO,UAAU,aAAa,QAAQ,IAAI,MAAM,OAAO;;;;qBCvB3C,GAAC,qBAADA"}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import * as _geekmidas_audit23 from "@geekmidas/audit";
|
|
5
|
-
import { AuditStorage, AuditableAction, Auditor } from "@geekmidas/audit";
|
|
1
|
+
import { t as StandardSchemaV1 } from "./index-CeEtxDmK.cjs";
|
|
2
|
+
import { n as ConstructType, t as Construct } from "./Construct-DTqYvkPG.cjs";
|
|
3
|
+
import { c as ServicesOf, r as Consumable } from "./construct-interface-DIaTNKax.cjs";
|
|
6
4
|
import { EventPublisher, MappedEvent } from "@geekmidas/events";
|
|
7
|
-
import * as _geekmidas_logger22 from "@geekmidas/logger";
|
|
8
5
|
import { Logger } from "@geekmidas/logger";
|
|
9
|
-
import * as _geekmidas_schema21 from "@geekmidas/schema";
|
|
10
6
|
import { ComposableStandardSchema, InferComposableStandardSchema, InferStandardSchema } from "@geekmidas/schema";
|
|
11
|
-
import {
|
|
12
|
-
|
|
7
|
+
import { Service, ServiceRecord } from "@geekmidas/services";
|
|
8
|
+
import { AuditStorage, AuditableAction, Auditor } from "@geekmidas/audit";
|
|
13
9
|
//#region src/functions/Function.d.ts
|
|
14
|
-
|
|
15
10
|
declare class Function<TInput extends ComposableStandardSchema | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, OutSchema extends StandardSchemaV1 | undefined = undefined, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, Fn extends FunctionHandler<TInput, TServices, TLogger, OutSchema, TDatabase, TAuditStorage, TAuditAction> = FunctionHandler<TInput, TServices, TLogger, OutSchema, TDatabase, TAuditStorage, TAuditAction>> extends Construct<TLogger, TEventPublisherServiceName, TEventPublisher, OutSchema, TServices, TAuditStorageServiceName, TAuditStorage> {
|
|
16
11
|
readonly fn: Fn;
|
|
17
12
|
input?: TInput | undefined;
|
|
18
|
-
databaseService?: Service<TDatabaseServiceName, TDatabase
|
|
13
|
+
databaseService?: Service<TDatabaseServiceName, TDatabase>;
|
|
19
14
|
__IS_FUNCTION__: boolean;
|
|
20
15
|
static isFunction(obj: any): obj is Function<any, any, any, any, any>;
|
|
21
16
|
/**
|
|
@@ -25,7 +20,7 @@ declare class Function<TInput extends ComposableStandardSchema | undefined = und
|
|
|
25
20
|
* @param data - The data to validate
|
|
26
21
|
* @returns Validation result with value or issues
|
|
27
22
|
*/
|
|
28
|
-
static validate<T extends StandardSchemaV1>(schema: T, data: unknown): StandardSchemaV1.Result<unknown
|
|
23
|
+
static validate<T extends StandardSchemaV1>(schema: T, data: unknown): Promise<StandardSchemaV1.Result<unknown>> | StandardSchemaV1.Result<unknown>;
|
|
29
24
|
/**
|
|
30
25
|
* Parses and validates data against a schema, throwing an error if validation fails.
|
|
31
26
|
*
|
|
@@ -43,9 +38,8 @@ declare class Function<TInput extends ComposableStandardSchema | undefined = und
|
|
|
43
38
|
* @throws {UnprocessableEntityError} When output validation fails
|
|
44
39
|
*/
|
|
45
40
|
parseOutput(output: unknown): Promise<InferStandardSchema<OutSchema>>;
|
|
46
|
-
constructor(fn: Fn, timeout?: number
|
|
47
|
-
|
|
48
|
-
type?: ConstructType, input?: TInput | undefined, outputSchema?: OutSchema, services?: TServices, logger?: TLogger, publisherService?: Service<TEventPublisherServiceName, TEventPublisher>, events?: MappedEvent<TEventPublisher, OutSchema>[], memorySize?: number, auditorStorageService?: Service<TAuditStorageServiceName, TAuditStorage>, databaseService?: Service<TDatabaseServiceName, TDatabase> | undefined,
|
|
41
|
+
constructor(fn: Fn, timeout?: number // Default timeout of 30 seconds
|
|
42
|
+
, type?: ConstructType, input?: TInput | undefined, outputSchema?: OutSchema, services?: TServices, logger?: TLogger, publisherService?: Service<TEventPublisherServiceName, TEventPublisher>, events?: MappedEvent<TEventPublisher, OutSchema>[], memorySize?: number, auditorStorageService?: Service<TAuditStorageServiceName, TAuditStorage>, databaseService?: Service<TDatabaseServiceName, TDatabase>,
|
|
49
43
|
/**
|
|
50
44
|
* The construct ids `.dependsOn()` named — last, so no existing positional
|
|
51
45
|
* argument moves.
|
|
@@ -99,6 +93,14 @@ declare abstract class BaseFunctionBuilder<TInput extends ComposableStandardSche
|
|
|
99
93
|
* which process runs it without a directory having to imply it.
|
|
100
94
|
*/
|
|
101
95
|
_owner?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Where a cron built from this factory keeps its schedule.
|
|
98
|
+
*
|
|
99
|
+
* Set by the worker that handed the factory out, the same way the logger
|
|
100
|
+
* and the owner are — so a cron file names a schedule and nothing else.
|
|
101
|
+
* Only a server target reads it; on AWS the schedule is an EventBridge rule.
|
|
102
|
+
*/
|
|
103
|
+
_scheduleStore?: unknown;
|
|
102
104
|
protected _events: MappedEvent<TEventPublisher, OutSchema>[];
|
|
103
105
|
protected _publisher?: Service<TEventPublisherServiceName, TEventPublisher>;
|
|
104
106
|
protected _auditorStorage?: Service<TAuditStorageServiceName, TAuditStorage>;
|
|
@@ -120,7 +122,6 @@ declare abstract class BaseFunctionBuilder<TInput extends ComposableStandardSche
|
|
|
120
122
|
*/
|
|
121
123
|
database<T, TName extends string>(source: Consumable<TName, T> | Service<TName, T>): BaseFunctionBuilder<TInput, OutSchema, TServices, TLogger, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, T, TName>;
|
|
122
124
|
}
|
|
123
|
-
//# sourceMappingURL=BaseFunctionBuilder.d.ts.map
|
|
124
125
|
//#endregion
|
|
125
126
|
//#region src/functions/FunctionBuilder.d.ts
|
|
126
127
|
declare class FunctionBuilder<TInput extends ComposableStandardSchema, OutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TDatabase = undefined, TDatabaseServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>> extends BaseFunctionBuilder<TInput, OutSchema, TServices, TLogger, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName> {
|
|
@@ -159,12 +160,6 @@ declare class FunctionBuilder<TInput extends ComposableStandardSchema, OutSchema
|
|
|
159
160
|
database<T, TName extends string>(source: Consumable<TName, T> | Service<TName, T>): FunctionBuilder<TInput, OutSchema, TServices, TLogger, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, T, TName, TAuditAction>;
|
|
160
161
|
handle(fn: FunctionHandler<TInput, TServices, TLogger, OutSchema, TDatabase, TAuditStorage, TAuditAction>): Function<TInput, TServices, TLogger, OutSchema, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TDatabase, TDatabaseServiceName, TAuditAction, FunctionHandler<TInput, TServices, TLogger, OutSchema, TDatabase, TAuditStorage, TAuditAction>>;
|
|
161
162
|
}
|
|
162
|
-
//# sourceMappingURL=FunctionBuilder.d.ts.map
|
|
163
|
-
//#endregion
|
|
164
|
-
//#region src/functions/index.d.ts
|
|
165
|
-
declare const f: FunctionBuilder<_geekmidas_schema21.ComposableStandardSchema, undefined, [], _geekmidas_logger22.Logger, undefined, string, undefined, string, undefined, string, _geekmidas_audit23.AuditableAction<string, unknown>>;
|
|
166
|
-
//# sourceMappingURL=index.d.ts.map
|
|
167
|
-
|
|
168
163
|
//#endregion
|
|
169
|
-
export { BaseFunctionBuilder, Function, FunctionBuilder
|
|
170
|
-
//# sourceMappingURL=index-
|
|
164
|
+
export { FunctionHandler as a, FunctionContext as i, BaseFunctionBuilder as n, Function as r, FunctionBuilder as t };
|
|
165
|
+
//# sourceMappingURL=index-nBQT1tAh.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-nBQT1tAh.d.cts","names":[],"sources":["../src/functions/Function.ts","../src/functions/BaseFunctionBuilder.ts","../src/functions/FunctionBuilder.ts"],"mappings":";;;;;;;;;cA+Ca,SACZ,eAAe,kDACf,kBAAkB,gBAClB,gBAAgB,SAAS,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A,eACA,0BACA,WACA;EAI4B,MAAI;YAFtB;EAEV,YAA4B,OAAI;EAIvB,QAAQ;EAIjB,WAAW;EAIX,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,GACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;EAmBD,MAAM,UAAU,0BACf,QAAQ,IACN,gBACF,GACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;;;;;;;;;;;;EA8BD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,gBACF,QACA,eACI,cAAc,WAAW,KAC7B,SACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;EAgCD,SAAS,UAAU,WAClB,UAAU,IACR,gBACF,QACA,eACI,cAAc,IAClB,SACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;EAsBD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,WACA,WACA,GACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;EAmBQ,UAAU,UAAU,qBAAqB,sBACjD,WAAW,QAAQ,OAAO,KACxB,gBACF,QACA,WACA,WACA,SACA,GACA,OACA,eACA,0BACA,WACA,sBACA;EAsBQ,QAAQ,UAAU,cAAc,sBACxC,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,WACA,WACA,SACA,iBACA,4BACA,GACA,OACA,WACA,sBACA;;;;;EA0BD,QAAQ,UAAU,qCAAqC,gBACtD,QACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA;;;;;EAqBQ,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,GACA,OACA;EAwBD,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,WACA,eACA,gBAEC,SACF,QACA,WACA,SACA,WACA,iBACA,4BACA,eACA,0BACA,WACA,sBACA,cACA,gBACC,QACA,WACA,SACA,WACA,WACA,eACA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { n as TopicEvents, t as Topic } from "./Topic-D6blllEn.cjs";
|
|
2
|
+
import { Logger } from "@geekmidas/logger";
|
|
3
|
+
//#region src/topic/TopicBuilder.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Builds a {@link Topic} — `t.topic('users').events({ 'user.created': schema, … })`.
|
|
6
|
+
* The event map is the topic's contract: it types the derived `topic.publisher`
|
|
7
|
+
* and the subscribers that bind via `s.topic(topic)`.
|
|
8
|
+
*/
|
|
9
|
+
declare class TopicBuilder<TName extends string = string, TEvents extends TopicEvents = TopicEvents> {
|
|
10
|
+
private _name?;
|
|
11
|
+
private _logger;
|
|
12
|
+
/** The topic name — drives the infra topic and its `<NAME>_*` env vars. */
|
|
13
|
+
topic<T extends string>(name: T): TopicBuilder<T, TEvents>;
|
|
14
|
+
logger(logger: Logger): this;
|
|
15
|
+
/**
|
|
16
|
+
* The event contract — a map of event type → payload schema. Building the
|
|
17
|
+
* topic requires this; it's what types the publisher and subscribers.
|
|
18
|
+
*/
|
|
19
|
+
events<T extends TopicEvents>(events: T): Topic<TName, T>;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/topic/index.d.ts
|
|
23
|
+
export declare const t: TopicBuilder<string, TopicEvents>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { TopicBuilder as n };
|
|
26
|
+
//# sourceMappingURL=index-tE_119SX.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-tE_119SX.d.cts","names":["_$__Topic0.TopicEvents"],"sources":["../src/topic/TopicBuilder.ts","../src/topic/index.ts"],"mappings":";;;;;;;;cAUa,aACZ,+BACA,gBAAgB,cAAc;UAEtB;UACA;;EAGR,MAAM,kBAAkB,MAAM,IAAI,aAAa,GAAG;EAOlD,OAAO,QAAQ;;;;;EAQf,OAAO,UAAU,aAAa,QAAQ,IAAI,MAAM,OAAO;;;;qBCvB3C,GAAC,qBAADA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_Construct = require("./Construct-yG9Sw-5p.cjs");
|
|
3
3
|
exports.Construct = require_Construct.Construct;
|
|
4
4
|
exports.ConstructType = require_Construct.ConstructType;
|
|
5
5
|
exports.sniffService = require_Construct.sniffService;
|
|
6
|
-
exports.snifferContext = require_Construct.snifferContext;
|
|
6
|
+
exports.snifferContext = require_Construct.snifferContext;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { i as snifferContext, n as ConstructType, r as sniffService, t as Construct } from "./Construct-DTqYvkPG.cjs";
|
|
2
|
+
import { n as LowerHttpMethod, r as RemoveUndefined, t as HttpMethod } from "./types-DMuSQeLL.cjs";
|
|
3
|
+
import { i as TelemetryResponse, n as TelemetryContext, r as TelemetryRequest, t as Telemetry } from "./telemetry-DGcFlVpB.cjs";
|
|
4
4
|
import { Service, ServiceRecord } from "@geekmidas/services";
|
|
5
|
-
export { Construct, ConstructType, HttpMethod, LowerHttpMethod, RemoveUndefined, Service, ServiceRecord, Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse, sniffService, snifferContext };
|
|
5
|
+
export { Construct, ConstructType, type HttpMethod, type LowerHttpMethod, type RemoveUndefined, type Service, type ServiceRecord, type Telemetry, type TelemetryContext, type TelemetryRequest, type TelemetryResponse, sniffService, snifferContext };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { i as snifferContext, n as ConstructType, r as sniffService, t as Construct } from "./Construct-pVadmURD.mjs";
|
|
2
|
+
import { n as LowerHttpMethod, r as RemoveUndefined, t as HttpMethod } from "./types-DMuSQeLL.mjs";
|
|
3
|
+
import { i as TelemetryResponse, n as TelemetryContext, r as TelemetryRequest, t as Telemetry } from "./telemetry-DGcFlVpB.mjs";
|
|
4
4
|
import { Service, ServiceRecord } from "@geekmidas/services";
|
|
5
|
-
export { Construct, ConstructType, HttpMethod, LowerHttpMethod, RemoveUndefined, Service, ServiceRecord, Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse, sniffService, snifferContext };
|
|
5
|
+
export { Construct, ConstructType, type HttpMethod, type LowerHttpMethod, type RemoveUndefined, type Service, type ServiceRecord, type Telemetry, type TelemetryContext, type TelemetryRequest, type TelemetryResponse, sniffService, snifferContext };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { Construct, ConstructType, sniffService, snifferContext };
|
|
1
|
+
import { i as snifferContext, n as ConstructType, r as sniffService, t as Construct } from "./Construct-Detz65RA.mjs";
|
|
2
|
+
export { Construct, ConstructType, sniffService, snifferContext };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { n as Construct } from "./construct-interface-DIaTNKax.cjs";
|
|
2
|
+
import { t as Cache } from "./cache-obq0fOIM.cjs";
|
|
3
|
+
import { Service } from "@geekmidas/services";
|
|
4
|
+
import { ConstructName, Declaration, PostgresVersion } from "@geekmidas/manifest";
|
|
5
|
+
import { Kysely, KyselyConfig } from "kysely";
|
|
6
|
+
//#region src/database/kysely.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Everything Kysely takes, plus what this construct declares.
|
|
9
|
+
*
|
|
10
|
+
* `dialect` is omitted because the construct owns it — it is built from the one
|
|
11
|
+
* URL the adapter supplied, which is the whole point of the construct. The rest
|
|
12
|
+
* of `KyselyConfig` (`plugins`, `log`) is the app's business and passes
|
|
13
|
+
* straight through, so anything Kysely adds later arrives without being
|
|
14
|
+
* tracked here.
|
|
15
|
+
*/
|
|
16
|
+
interface KyselyDatabaseOptions extends Omit<KyselyConfig, 'dialect'> {
|
|
17
|
+
/**
|
|
18
|
+
* The schema, pinned on both roles' `search_path`.
|
|
19
|
+
*
|
|
20
|
+
* Defaults to `app` — the role the schema plays, rather than a restatement
|
|
21
|
+
* of the database's own name, which reads correctly beside `auth` and
|
|
22
|
+
* `pgboss` and keeps the application off `public`.
|
|
23
|
+
*/
|
|
24
|
+
schema?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Provision the owner/runtime role split. Defaults to on.
|
|
27
|
+
*
|
|
28
|
+
* Off falls back to the cluster's master credential in both URLs, giving up
|
|
29
|
+
* the DDL/DML split and putting credentials that can drop a table into the
|
|
30
|
+
* function's environment. A deliberate downgrade, not a default.
|
|
31
|
+
*/
|
|
32
|
+
roles?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The Postgres major version to provision.
|
|
35
|
+
*
|
|
36
|
+
* Declared here so one statement reaches both targets. It was previously
|
|
37
|
+
* set in two unrelated places — a container tag locally, nothing at all on
|
|
38
|
+
* AWS (so Aurora chose) — which is how local came to run 18 while deployed
|
|
39
|
+
* ran 17.7 with nothing recording the difference.
|
|
40
|
+
*
|
|
41
|
+
* Defaults to {@link DEFAULT_POSTGRES_VERSION}.
|
|
42
|
+
*/
|
|
43
|
+
version?: PostgresVersion;
|
|
44
|
+
}
|
|
45
|
+
/** What makes a construct derived rather than a database in its own right. */
|
|
46
|
+
interface DerivedFrom {
|
|
47
|
+
kind: 'database-reader' | 'database-schema';
|
|
48
|
+
of: string;
|
|
49
|
+
schema?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @typeParam DB - the database's schema.
|
|
53
|
+
* @typeParam TName - the canonical id. TypeScript has no partial
|
|
54
|
+
* type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
|
|
55
|
+
* this at its default and the service key widens to `string`. `db` still types
|
|
56
|
+
* through `.database()`, which infers from the service.
|
|
57
|
+
*/
|
|
58
|
+
declare class KyselyDatabase<DB = unknown, TName extends string = string> implements Construct<TName, Kysely<DB>> {
|
|
59
|
+
private readonly options;
|
|
60
|
+
readonly id: TName;
|
|
61
|
+
readonly service: Service<Uncapitalize<TName>, Kysely<DB>>;
|
|
62
|
+
/**
|
|
63
|
+
* Declared once and read by both `declare()` and `connect()`, so the key the
|
|
64
|
+
* build publishes and the key the client reads cannot drift.
|
|
65
|
+
*/
|
|
66
|
+
private readonly config;
|
|
67
|
+
private readonly schemaName;
|
|
68
|
+
private readonly roles;
|
|
69
|
+
private readonly version;
|
|
70
|
+
private readonly derivedFrom?;
|
|
71
|
+
constructor(id: ConstructName<TName>, options?: KyselyDatabaseOptions, derivedFrom?: DerivedFrom);
|
|
72
|
+
declare(): Declaration[];
|
|
73
|
+
/**
|
|
74
|
+
* A read-only endpoint on this database.
|
|
75
|
+
*
|
|
76
|
+
* Read-only is enforced by the reader role's grants rather than by which
|
|
77
|
+
* endpoint it resolves to, so falling back to the writer where no replica
|
|
78
|
+
* exists is safe rather than a silently writable connection behind a name
|
|
79
|
+
* that says reader. There is no `writer()`: the database *is* the writer, so
|
|
80
|
+
* a replica can never be reached by accident.
|
|
81
|
+
*
|
|
82
|
+
* The return type is narrower than this class on purpose — see
|
|
83
|
+
* {@link ReadOnlyDatabase}.
|
|
84
|
+
*/
|
|
85
|
+
reader(): ReadOnlyDatabase<DB, `${TName}Reader`>;
|
|
86
|
+
/**
|
|
87
|
+
* A cache that lives in this database.
|
|
88
|
+
*
|
|
89
|
+
* The same strengthening `schema()` is over a second database: `new
|
|
90
|
+
* Cache('Sessions')` says the app caches and leaves where to the deployment,
|
|
91
|
+
* while this says it caches *here* — which is a fact about the application
|
|
92
|
+
* and so belongs in its code.
|
|
93
|
+
*
|
|
94
|
+
* What it buys beyond being explicit: the table's schema and the role that
|
|
95
|
+
* reaches it come from this database rather than from a second convention,
|
|
96
|
+
* and the backend no longer has to guess which database "the database" meant
|
|
97
|
+
* when an app declares two.
|
|
98
|
+
*
|
|
99
|
+
* A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
|
|
100
|
+
* is a key/value store, not a query builder, and typing it as the parent
|
|
101
|
+
* would be a convenience that lies.
|
|
102
|
+
*/
|
|
103
|
+
cache<TCache extends string = `${TName}Cache`>(id?: ConstructName<TCache>, options?: {
|
|
104
|
+
table?: string;
|
|
105
|
+
}): Cache<TCache>;
|
|
106
|
+
/**
|
|
107
|
+
* A second schema in this database, with its own role(s) and its own URL —
|
|
108
|
+
* so this database's role holds no grant on those tables at all.
|
|
109
|
+
*
|
|
110
|
+
* Typed separately because a tenant has its own tables: the point is that
|
|
111
|
+
* `auth.selectFrom('sessions')` type-checks and
|
|
112
|
+
* `orders.selectFrom('sessions')` does not.
|
|
113
|
+
*/
|
|
114
|
+
schema<TenantDB, TTenant extends string>(id: ConstructName<TTenant>, options?: KyselyDatabaseOptions): KyselyDatabase<TenantDB, TTenant>;
|
|
115
|
+
/**
|
|
116
|
+
* A connection as the *owner* role — the one that may create, alter and drop.
|
|
117
|
+
*
|
|
118
|
+
* A `Service` rather than part of the construct, and deliberately so: a
|
|
119
|
+
* construct is what `.dependsOn()` accepts, and nothing should be able to
|
|
120
|
+
* depend on this. A migrator asks for it by name; a handler cannot ask at
|
|
121
|
+
* all, which is the security property the role split exists for.
|
|
122
|
+
*
|
|
123
|
+
* Falls back to the runtime URL where no owner URL was published — the
|
|
124
|
+
* `roles: false` downgrade, where there is only one credential and it is the
|
|
125
|
+
* cluster master's.
|
|
126
|
+
*/
|
|
127
|
+
get owner(): Service<`${Uncapitalize<TName>}Owner`, Kysely<DB>>;
|
|
128
|
+
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
|
+
type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
|
|
148
|
+
//#endregion
|
|
149
|
+
export { KyselyDatabaseOptions as n, ReadOnlyDatabase as r, KyselyDatabase as t };
|
|
150
|
+
//# sourceMappingURL=kysely-CXi49zc2.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kysely-CXi49zc2.d.cts","names":[],"sources":["../src/database/kysely.ts"],"mappings":";;;;;;;;;;;;;;;UAwCiB,8BAA8B,KAAK;;;;;;;;EAQnD;;;;;;;;EAQA;;;;;;;;;;;EAWA,UAAU;;;UAID;EACT;EACA;EACA;;;;;;;;;cAUY,eAAe,cAAc,0CAC9B,UAAU,OAAO,OAAO;mBAiBjB;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,OAAO;;;;;mBAMrC;mBACA;mBACA;mBACA;mBACA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,uBAC1B,cAAc;EAyBf,WAAW;;;;;;;;;;;;;EAqDX,UAAU,iBAAiB,OAAO;;;;;;;;;;;;;;;;;;EAyBlC,MAAM,2BAA2B,cAChC,KAAI,cAAc,SAClB;IAAW;MACT,MAAM;;;;;;;;;EAeT,OAAO,UAAU,wBAChB,IAAI,cAAc,UAClB,UAAS,wBACP,eAAe,UAAU;;;;;;;;;;;;;MAoBxB,SAAS,WAAW,aAAa,eAAe,OAAO;UAQ7C;;;;;;;;;;;;;;;;;;;KAkEH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { n as Construct } from "./construct-interface-Clz7_BwB.mjs";
|
|
2
|
+
import { t as Cache } from "./cache-AgQUMma6.mjs";
|
|
3
|
+
import { ConstructName, Declaration, PostgresVersion } from "@geekmidas/manifest";
|
|
4
|
+
import { Kysely, KyselyConfig } from "kysely";
|
|
5
|
+
import { Service } from "@geekmidas/services";
|
|
6
|
+
//#region src/database/kysely.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Everything Kysely takes, plus what this construct declares.
|
|
9
|
+
*
|
|
10
|
+
* `dialect` is omitted because the construct owns it — it is built from the one
|
|
11
|
+
* URL the adapter supplied, which is the whole point of the construct. The rest
|
|
12
|
+
* of `KyselyConfig` (`plugins`, `log`) is the app's business and passes
|
|
13
|
+
* straight through, so anything Kysely adds later arrives without being
|
|
14
|
+
* tracked here.
|
|
15
|
+
*/
|
|
16
|
+
interface KyselyDatabaseOptions extends Omit<KyselyConfig, 'dialect'> {
|
|
17
|
+
/**
|
|
18
|
+
* The schema, pinned on both roles' `search_path`.
|
|
19
|
+
*
|
|
20
|
+
* Defaults to `app` — the role the schema plays, rather than a restatement
|
|
21
|
+
* of the database's own name, which reads correctly beside `auth` and
|
|
22
|
+
* `pgboss` and keeps the application off `public`.
|
|
23
|
+
*/
|
|
24
|
+
schema?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Provision the owner/runtime role split. Defaults to on.
|
|
27
|
+
*
|
|
28
|
+
* Off falls back to the cluster's master credential in both URLs, giving up
|
|
29
|
+
* the DDL/DML split and putting credentials that can drop a table into the
|
|
30
|
+
* function's environment. A deliberate downgrade, not a default.
|
|
31
|
+
*/
|
|
32
|
+
roles?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The Postgres major version to provision.
|
|
35
|
+
*
|
|
36
|
+
* Declared here so one statement reaches both targets. It was previously
|
|
37
|
+
* set in two unrelated places — a container tag locally, nothing at all on
|
|
38
|
+
* AWS (so Aurora chose) — which is how local came to run 18 while deployed
|
|
39
|
+
* ran 17.7 with nothing recording the difference.
|
|
40
|
+
*
|
|
41
|
+
* Defaults to {@link DEFAULT_POSTGRES_VERSION}.
|
|
42
|
+
*/
|
|
43
|
+
version?: PostgresVersion;
|
|
44
|
+
}
|
|
45
|
+
/** What makes a construct derived rather than a database in its own right. */
|
|
46
|
+
interface DerivedFrom {
|
|
47
|
+
kind: 'database-reader' | 'database-schema';
|
|
48
|
+
of: string;
|
|
49
|
+
schema?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @typeParam DB - the database's schema.
|
|
53
|
+
* @typeParam TName - the canonical id. TypeScript has no partial
|
|
54
|
+
* type-argument inference, so `new KyselyDatabase<OrdersDB>('orders')` leaves
|
|
55
|
+
* this at its default and the service key widens to `string`. `db` still types
|
|
56
|
+
* through `.database()`, which infers from the service.
|
|
57
|
+
*/
|
|
58
|
+
declare class KyselyDatabase<DB = unknown, TName extends string = string> implements Construct<TName, Kysely<DB>> {
|
|
59
|
+
private readonly options;
|
|
60
|
+
readonly id: TName;
|
|
61
|
+
readonly service: Service<Uncapitalize<TName>, Kysely<DB>>;
|
|
62
|
+
/**
|
|
63
|
+
* Declared once and read by both `declare()` and `connect()`, so the key the
|
|
64
|
+
* build publishes and the key the client reads cannot drift.
|
|
65
|
+
*/
|
|
66
|
+
private readonly config;
|
|
67
|
+
private readonly schemaName;
|
|
68
|
+
private readonly roles;
|
|
69
|
+
private readonly version;
|
|
70
|
+
private readonly derivedFrom?;
|
|
71
|
+
constructor(id: ConstructName<TName>, options?: KyselyDatabaseOptions, derivedFrom?: DerivedFrom);
|
|
72
|
+
declare(): Declaration[];
|
|
73
|
+
/**
|
|
74
|
+
* A read-only endpoint on this database.
|
|
75
|
+
*
|
|
76
|
+
* Read-only is enforced by the reader role's grants rather than by which
|
|
77
|
+
* endpoint it resolves to, so falling back to the writer where no replica
|
|
78
|
+
* exists is safe rather than a silently writable connection behind a name
|
|
79
|
+
* that says reader. There is no `writer()`: the database *is* the writer, so
|
|
80
|
+
* a replica can never be reached by accident.
|
|
81
|
+
*
|
|
82
|
+
* The return type is narrower than this class on purpose — see
|
|
83
|
+
* {@link ReadOnlyDatabase}.
|
|
84
|
+
*/
|
|
85
|
+
reader(): ReadOnlyDatabase<DB, `${TName}Reader`>;
|
|
86
|
+
/**
|
|
87
|
+
* A cache that lives in this database.
|
|
88
|
+
*
|
|
89
|
+
* The same strengthening `schema()` is over a second database: `new
|
|
90
|
+
* Cache('Sessions')` says the app caches and leaves where to the deployment,
|
|
91
|
+
* while this says it caches *here* — which is a fact about the application
|
|
92
|
+
* and so belongs in its code.
|
|
93
|
+
*
|
|
94
|
+
* What it buys beyond being explicit: the table's schema and the role that
|
|
95
|
+
* reaches it come from this database rather than from a second convention,
|
|
96
|
+
* and the backend no longer has to guess which database "the database" meant
|
|
97
|
+
* when an app declares two.
|
|
98
|
+
*
|
|
99
|
+
* A cache is not a `KyselyDatabase`, so this returns a `Cache` — the client
|
|
100
|
+
* is a key/value store, not a query builder, and typing it as the parent
|
|
101
|
+
* would be a convenience that lies.
|
|
102
|
+
*/
|
|
103
|
+
cache<TCache extends string = `${TName}Cache`>(id?: ConstructName<TCache>, options?: {
|
|
104
|
+
table?: string;
|
|
105
|
+
}): Cache<TCache>;
|
|
106
|
+
/**
|
|
107
|
+
* A second schema in this database, with its own role(s) and its own URL —
|
|
108
|
+
* so this database's role holds no grant on those tables at all.
|
|
109
|
+
*
|
|
110
|
+
* Typed separately because a tenant has its own tables: the point is that
|
|
111
|
+
* `auth.selectFrom('sessions')` type-checks and
|
|
112
|
+
* `orders.selectFrom('sessions')` does not.
|
|
113
|
+
*/
|
|
114
|
+
schema<TenantDB, TTenant extends string>(id: ConstructName<TTenant>, options?: KyselyDatabaseOptions): KyselyDatabase<TenantDB, TTenant>;
|
|
115
|
+
/**
|
|
116
|
+
* A connection as the *owner* role — the one that may create, alter and drop.
|
|
117
|
+
*
|
|
118
|
+
* A `Service` rather than part of the construct, and deliberately so: a
|
|
119
|
+
* construct is what `.dependsOn()` accepts, and nothing should be able to
|
|
120
|
+
* depend on this. A migrator asks for it by name; a handler cannot ask at
|
|
121
|
+
* all, which is the security property the role split exists for.
|
|
122
|
+
*
|
|
123
|
+
* Falls back to the runtime URL where no owner URL was published — the
|
|
124
|
+
* `roles: false` downgrade, where there is only one credential and it is the
|
|
125
|
+
* cluster master's.
|
|
126
|
+
*/
|
|
127
|
+
get owner(): Service<`${Uncapitalize<TName>}Owner`, Kysely<DB>>;
|
|
128
|
+
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
|
+
type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
|
|
148
|
+
//#endregion
|
|
149
|
+
export { KyselyDatabaseOptions as n, ReadOnlyDatabase as r, KyselyDatabase as t };
|
|
150
|
+
//# sourceMappingURL=kysely-D3-G5b0j.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kysely-D3-G5b0j.d.mts","names":[],"sources":["../src/database/kysely.ts"],"mappings":";;;;;;;;;;;;;;;UAwCiB,8BAA8B,KAAK;;;;;;;;EAQnD;;;;;;;;EAQA;;;;;;;;;;;EAWA,UAAU;;;UAID;EACT;EACA;EACA;;;;;;;;;cAUY,eAAe,cAAc,0CAC9B,UAAU,OAAO,OAAO;mBAiBjB;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,OAAO;;;;;mBAMrC;mBACA;mBACA;mBACA;mBACA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,uBAC1B,cAAc;EAyBf,WAAW;;;;;;;;;;;;;EAqDX,UAAU,iBAAiB,OAAO;;;;;;;;;;;;;;;;;;EAyBlC,MAAM,2BAA2B,cAChC,KAAI,cAAc,SAClB;IAAW;MACT,MAAM;;;;;;;;;EAeT,OAAO,UAAU,wBAChB,IAAI,cAAc,UAClB,UAAS,wBACP,eAAe,UAAU;;;;;;;;;;;;;MAoBxB,SAAS,WAAW,aAAa,eAAe,OAAO;UAQ7C;;;;;;;;;;;;;;;;;;;KAkEH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
|