@geekmidas/constructs 10.0.0-alpha.3 → 10.0.0-alpha.31
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 +52 -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-B_iuyNxr.d.mts} +17 -6
- package/dist/Cron-B_iuyNxr.d.mts.map +1 -0
- package/dist/{Cron-Wqh464aO.d.cts → Cron-CA2oa2nC.d.cts} +16 -5
- package/dist/Cron-CA2oa2nC.d.cts.map +1 -0
- package/dist/{CronBuilder-BL0AP6fs.d.mts → CronBuilder-BIKCLWu7.d.mts} +7 -10
- package/dist/CronBuilder-BIKCLWu7.d.mts.map +1 -0
- package/dist/{CronBuilder-BmABazzH.mjs → CronBuilder-BRkzUOAs.mjs} +35 -17
- package/dist/CronBuilder-BRkzUOAs.mjs.map +1 -0
- package/dist/{CronBuilder-BqpEzMPQ.d.cts → CronBuilder-B_KqaodP.d.cts} +6 -9
- package/dist/CronBuilder-B_KqaodP.d.cts.map +1 -0
- package/dist/{CronBuilder-CkXPJiGO.cjs → CronBuilder-BbnT7tqo.cjs} +45 -27
- package/dist/CronBuilder-BbnT7tqo.cjs.map +1 -0
- package/dist/{Endpoint-2Wg7T7Cq.d.mts → Endpoint-BojvdQoh.d.mts} +63 -84
- package/dist/Endpoint-BojvdQoh.d.mts.map +1 -0
- package/dist/{Endpoint-VIOpSo0S.mjs → Endpoint-DO332Dnm.mjs} +117 -109
- package/dist/Endpoint-DO332Dnm.mjs.map +1 -0
- package/dist/{Endpoint-BiaaMEn_.cjs → Endpoint-QKuFg5gs.cjs} +145 -131
- package/dist/Endpoint-QKuFg5gs.cjs.map +1 -0
- package/dist/{Endpoint-CH9Fn1AD.d.cts → Endpoint-xNGuv2Fq.d.cts} +61 -82
- package/dist/Endpoint-xNGuv2Fq.d.cts.map +1 -0
- package/dist/{EndpointFactory-DTTCkGEL.mjs → EndpointFactory-B9HAjDAP.mjs} +26 -32
- package/dist/EndpointFactory-B9HAjDAP.mjs.map +1 -0
- package/dist/{EndpointFactory-ChxLZllA.cjs → EndpointFactory-BmO0WnXE.cjs} +63 -69
- package/dist/EndpointFactory-BmO0WnXE.cjs.map +1 -0
- package/dist/{index-BxHDdy6a.d.mts → EndpointFactory-CaYTrUOO.d.mts} +12 -92
- package/dist/EndpointFactory-CaYTrUOO.d.mts.map +1 -0
- package/dist/{index-V2nksZIJ.d.cts → EndpointFactory-DyT1yOJL.d.cts} +10 -90
- package/dist/EndpointFactory-DyT1yOJL.d.cts.map +1 -0
- package/dist/{HonoEndpointAdaptor-NKQQQbBY.mjs → HonoEndpointAdaptor-CiqAZ5Mt.mjs} +40 -47
- package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs.map → HonoEndpointAdaptor-CiqAZ5Mt.mjs.map} +1 -1
- package/dist/{HonoEndpointAdaptor-D233Jvpk.cjs → HonoEndpointAdaptor-DoEQdC3r.cjs} +48 -52
- package/dist/HonoEndpointAdaptor-DoEQdC3r.cjs.map +1 -0
- package/dist/Queue-B7yRXQmL.cjs +124 -0
- package/dist/Queue-B7yRXQmL.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/Queue-DpKTLl6E.mjs +119 -0
- package/dist/Queue-DpKTLl6E.mjs.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-Dptmo-1A.d.mts → SubscriberBuilder-C2FRfd26.d.mts} +8 -11
- package/dist/SubscriberBuilder-C2FRfd26.d.mts.map +1 -0
- package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-C2bCOuPT.cjs} +28 -23
- package/dist/SubscriberBuilder-C2bCOuPT.cjs.map +1 -0
- package/dist/{SubscriberBuilder-waNhzjSM.d.cts → SubscriberBuilder-CjDGSTZc.d.cts} +7 -10
- package/dist/SubscriberBuilder-CjDGSTZc.d.cts.map +1 -0
- package/dist/Topic-Ct3Le8Wt.mjs +103 -0
- package/dist/Topic-Ct3Le8Wt.mjs.map +1 -0
- package/dist/Topic-D5rlM9wS.cjs +108 -0
- package/dist/Topic-D5rlM9wS.cjs.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 +396 -82
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +150 -33
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +151 -34
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +368 -63
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-Bmo1wSQF.d.cts +177 -0
- package/dist/auth-Bmo1wSQF.d.cts.map +1 -0
- package/dist/auth-CJ5dp7T7.d.mts +177 -0
- package/dist/auth-CJ5dp7T7.d.mts.map +1 -0
- package/dist/auth.cjs +113 -28
- 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 +103 -20
- package/dist/auth.mjs.map +1 -1
- package/dist/{cache-BrRz3fEB.d.mts → cache-B2s0b-ss.d.mts} +3 -6
- package/dist/cache-B2s0b-ss.d.mts.map +1 -0
- package/dist/{cache-BtZY_tHe.d.cts → cache-CYe2Kzjc.d.cts} +3 -6
- package/dist/cache-CYe2Kzjc.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-D2gesxos.d.mts} +28 -10
- package/dist/construct-interface-D2gesxos.d.mts.map +1 -0
- package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-DPusCUSQ.d.cts} +28 -10
- package/dist/construct-interface-DPusCUSQ.d.cts.map +1 -0
- package/dist/construct-interface.cjs +116 -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 +108 -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 +40 -15
- 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 +28 -5
- 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-DKN6aQWJ.cjs} +325 -268
- package/dist/functions-DKN6aQWJ.cjs.map +1 -0
- package/dist/{functions-Cxbo-pEd.mjs → functions-DlFm8HmH.mjs} +298 -238
- package/dist/functions-DlFm8HmH.mjs.map +1 -0
- package/dist/{index-JSf9xNIJ.d.cts → index-BI23K3wy.d.cts} +17 -22
- package/dist/index-BI23K3wy.d.cts.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-fnpjXiA-.d.mts +26 -0
- package/dist/index-fnpjXiA-.d.mts.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-CubPzHd9.d.mts → index-yb3fXNyH.d.mts} +18 -23
- package/dist/index-yb3fXNyH.d.mts.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-CEVXacPN.d.cts +159 -0
- package/dist/kysely-CEVXacPN.d.cts.map +1 -0
- package/dist/kysely-mcTdPNhl.d.mts +159 -0
- package/dist/kysely-mcTdPNhl.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 +9 -118
- 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 +5 -114
- 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 +8 -107
- 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 +4 -103
- 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
package/dist/rest-api.d.cts
CHANGED
|
@@ -1,37 +1,26 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./types-BlAkSuGI.cjs";
|
|
5
|
-
import { BuiltInSecuritySchemeId } from "./Endpoint-CH9Fn1AD.cjs";
|
|
6
|
-
import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-V2nksZIJ.cjs";
|
|
1
|
+
import { i as Declarable, t as Authenticator } from "./construct-interface-DPusCUSQ.cjs";
|
|
2
|
+
import { T as BuiltInSecuritySchemeId } from "./Endpoint-xNGuv2Fq.cjs";
|
|
3
|
+
import { t as EndpointFactory } from "./EndpointFactory-DyT1yOJL.cjs";
|
|
7
4
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
8
5
|
import { Logger } from "@geekmidas/logger";
|
|
9
|
-
import {
|
|
6
|
+
import { ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
|
|
10
7
|
import { Telescope } from "@geekmidas/telescope";
|
|
11
|
-
|
|
12
8
|
//#region src/rest-api.d.ts
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
/** The factory a surface builds its endpoints from. */
|
|
10
|
+
type Endpoints = EndpointFactory<[], '', Logger>;
|
|
11
|
+
export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
15
12
|
/**
|
|
16
|
-
* The app that serves this surface
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* gets its process by inference gets it from whatever happened to reference
|
|
26
|
-
* it, and that was the thing worth removing.
|
|
27
|
-
*
|
|
28
|
-
* So this is an override and nothing else. Everything in it follows from
|
|
29
|
-
* this construct's id — `apps/<kebab-id>` where that directory exists, the
|
|
30
|
-
* conventional code directories under it, a port assigned in a stable
|
|
31
|
-
* order. Write one when the layout genuinely differs:
|
|
32
|
-
* `app: { path: 'services/api' }`.
|
|
13
|
+
* The app that serves this surface, relative to the workspace root —
|
|
14
|
+
* `'apps/api'`, or `'.'` in a single-app project.
|
|
15
|
+
*
|
|
16
|
+
* Required. It was inferred from the id (`apps/<kebab-id>`, or the root
|
|
17
|
+
* when no such directory existed), which meant a surface's home was
|
|
18
|
+
* whatever happened to be on disk. It is where the app's `package.json`
|
|
19
|
+
* and base `tsconfig.json` are, and which build serves this surface. It
|
|
20
|
+
* does not change discovery: constructs still load from the workspace's
|
|
21
|
+
* `constructs` glob.
|
|
33
22
|
*/
|
|
34
|
-
|
|
23
|
+
path: string;
|
|
35
24
|
/**
|
|
36
25
|
* CORS tunables. The *origins* are never here — they are read off the
|
|
37
26
|
* constructs that declared an edge to this surface, which is the whole point
|
|
@@ -102,15 +91,17 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
|
102
91
|
* into a handler. Putting one on the surface hands it to every route the
|
|
103
92
|
* surface serves — a health check gets the database because a report needed it
|
|
104
93
|
* — which is the thing least privilege forbids and the reason `.calls()` is not
|
|
105
|
-
* spelled `dependsOn`. They belong to the endpoint, or to a
|
|
106
|
-
*
|
|
94
|
+
* spelled `dependsOn`. They belong to the endpoint, or to a branch —
|
|
95
|
+
* `api.database(db)` — for a group of endpoints that genuinely share them. A
|
|
96
|
+
* branch is a new factory; the surface config stays free of grants.
|
|
107
97
|
*
|
|
108
98
|
* `auth` is not here either: `.auth(construct)` already declares it, and a
|
|
109
99
|
* second way to say the same thing is the duplication this whole model removes.
|
|
110
100
|
*
|
|
111
101
|
* What is left is what the *process* is rather than what a route may reach.
|
|
112
102
|
*/
|
|
113
|
-
declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
103
|
+
export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
104
|
+
#private;
|
|
114
105
|
private readonly config;
|
|
115
106
|
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
116
107
|
private readonly dependencies;
|
|
@@ -146,34 +137,45 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
146
137
|
readonly envParser: EnvironmentParser<{}>;
|
|
147
138
|
/** The Telescope instance, when this surface was given one. */
|
|
148
139
|
readonly telescope?: Telescope;
|
|
149
|
-
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
150
|
-
|
|
151
|
-
|
|
140
|
+
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
141
|
+
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
142
|
+
dependencies?: readonly Dependency[],
|
|
143
|
+
/** Internal: how `.auth()` carries the authenticator into its copy. */
|
|
144
|
+
authenticator?: Authenticator | undefined);
|
|
145
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
146
|
+
readonly get: Endpoints['get'];
|
|
147
|
+
readonly post: Endpoints['post'];
|
|
148
|
+
readonly put: Endpoints['put'];
|
|
149
|
+
readonly patch: Endpoints['patch'];
|
|
150
|
+
readonly delete: Endpoints['delete'];
|
|
151
|
+
readonly options: Endpoints['options'];
|
|
152
152
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* `api.get('/users')` is the short form and covers most routes. Reach for
|
|
156
|
-
* this one when a *group* of endpoints shares something a single route would
|
|
157
|
-
* otherwise repeat — a database, an auditor, a publisher:
|
|
153
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
154
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
158
155
|
*
|
|
159
156
|
* ```ts
|
|
160
|
-
* const
|
|
161
|
-
* export const createUser =
|
|
157
|
+
* export const router = api.database(database);
|
|
158
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
162
159
|
* ```
|
|
163
160
|
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
161
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
162
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
163
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
164
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
165
|
+
*
|
|
166
|
+
* `dependsOn` is deliberately not here. It is per endpoint, and on the
|
|
167
|
+
* surface it would read as the API depending on something, which is what
|
|
168
|
+
* `.calls()` and `.auth()` say instead.
|
|
168
169
|
*/
|
|
169
|
-
readonly
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
readonly database: Endpoints['database'];
|
|
171
|
+
readonly session: Endpoints['session'];
|
|
172
|
+
readonly auditor: Endpoints['auditor'];
|
|
173
|
+
readonly actor: Endpoints['actor'];
|
|
174
|
+
readonly publisher: Endpoints['publisher'];
|
|
175
|
+
readonly authorizer: Endpoints['authorizer'];
|
|
176
|
+
readonly authorize: Endpoints['authorize'];
|
|
177
|
+
readonly rls: Endpoints['rls'];
|
|
178
|
+
readonly route: Endpoints['route'];
|
|
177
179
|
/**
|
|
178
180
|
* What authenticates this surface.
|
|
179
181
|
*
|
|
@@ -183,12 +185,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
183
185
|
* what a request is allowed to be. A surface with two of the first is a
|
|
184
186
|
* mistake; two of the second is Tuesday.
|
|
185
187
|
*
|
|
186
|
-
* It
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
188
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
189
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
190
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
191
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
192
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
190
193
|
*/
|
|
191
|
-
auth(construct:
|
|
194
|
+
auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
|
|
192
195
|
/**
|
|
193
196
|
* Other surfaces this one calls.
|
|
194
197
|
*
|
|
@@ -215,7 +218,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
215
218
|
*/
|
|
216
219
|
declare(): Declaration[];
|
|
217
220
|
}
|
|
218
|
-
//# sourceMappingURL=rest-api.d.ts.map
|
|
219
221
|
//#endregion
|
|
220
|
-
export {
|
|
222
|
+
export type { Authenticator };
|
|
221
223
|
//# sourceMappingURL=rest-api.d.cts.map
|
package/dist/rest-api.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-api.d.cts","names":[],"sources":["../src/rest-api.ts"],"
|
|
1
|
+
{"version":3,"file":"rest-api.d.cts","names":[],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;;KAkDK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;;;;;;;;;qBAoBA,QACZ,qCACM,iEACM,WAAW;;mBAuCL;;mBAEA;;mBAEA;WAzCT,IAAI;;;;;;WAOJ;IACR;IACA;IACA;;;;;;;;;WAUQ,QAAQ;;;;;;;;;WAUR,WAAW;;WAGX,YAAY;EAErB,YACC,IAAI,cAAc,QACD,QAAQ,cAAc,eAEtB;;EAAA,wBAAuB,cAEvB;;EAAA,gBAAgB;;WAyEzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;;WAoBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,WAAW;WACX,YAAY;WACZ,WAAW;WACX,KAAK;WACL,OAAO;;;;;;;;;;;;;;;;EAiBhB,KAAK,WAAW,gBAAgB,QAAQ,OAAO;;;;;;;;;;;;;;;EAuB/C,MAAM,qBAAqB,eAAe,QAAQ,OAAO;;;;;;;;;;EAkBzD,WAAW"}
|
package/dist/rest-api.d.mts
CHANGED
|
@@ -1,37 +1,26 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import { BuiltInSecuritySchemeId } from "./Endpoint-2Wg7T7Cq.mjs";
|
|
6
|
-
import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-BxHDdy6a.mjs";
|
|
7
|
-
import { AppSpec, ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
|
|
1
|
+
import { i as Declarable, t as Authenticator } from "./construct-interface-D2gesxos.mjs";
|
|
2
|
+
import { T as BuiltInSecuritySchemeId } from "./Endpoint-BojvdQoh.mjs";
|
|
3
|
+
import { t as EndpointFactory } from "./EndpointFactory-CaYTrUOO.mjs";
|
|
4
|
+
import { ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
|
|
8
5
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
9
6
|
import { Logger } from "@geekmidas/logger";
|
|
10
7
|
import { Telescope } from "@geekmidas/telescope";
|
|
11
|
-
|
|
12
8
|
//#region src/rest-api.d.ts
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
/** The factory a surface builds its endpoints from. */
|
|
10
|
+
type Endpoints = EndpointFactory<[], '', Logger>;
|
|
11
|
+
export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
15
12
|
/**
|
|
16
|
-
* The app that serves this surface
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* gets its process by inference gets it from whatever happened to reference
|
|
26
|
-
* it, and that was the thing worth removing.
|
|
27
|
-
*
|
|
28
|
-
* So this is an override and nothing else. Everything in it follows from
|
|
29
|
-
* this construct's id — `apps/<kebab-id>` where that directory exists, the
|
|
30
|
-
* conventional code directories under it, a port assigned in a stable
|
|
31
|
-
* order. Write one when the layout genuinely differs:
|
|
32
|
-
* `app: { path: 'services/api' }`.
|
|
13
|
+
* The app that serves this surface, relative to the workspace root —
|
|
14
|
+
* `'apps/api'`, or `'.'` in a single-app project.
|
|
15
|
+
*
|
|
16
|
+
* Required. It was inferred from the id (`apps/<kebab-id>`, or the root
|
|
17
|
+
* when no such directory existed), which meant a surface's home was
|
|
18
|
+
* whatever happened to be on disk. It is where the app's `package.json`
|
|
19
|
+
* and base `tsconfig.json` are, and which build serves this surface. It
|
|
20
|
+
* does not change discovery: constructs still load from the workspace's
|
|
21
|
+
* `constructs` glob.
|
|
33
22
|
*/
|
|
34
|
-
|
|
23
|
+
path: string;
|
|
35
24
|
/**
|
|
36
25
|
* CORS tunables. The *origins* are never here — they are read off the
|
|
37
26
|
* constructs that declared an edge to this surface, which is the whole point
|
|
@@ -102,15 +91,17 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
|
102
91
|
* into a handler. Putting one on the surface hands it to every route the
|
|
103
92
|
* surface serves — a health check gets the database because a report needed it
|
|
104
93
|
* — which is the thing least privilege forbids and the reason `.calls()` is not
|
|
105
|
-
* spelled `dependsOn`. They belong to the endpoint, or to a
|
|
106
|
-
*
|
|
94
|
+
* spelled `dependsOn`. They belong to the endpoint, or to a branch —
|
|
95
|
+
* `api.database(db)` — for a group of endpoints that genuinely share them. A
|
|
96
|
+
* branch is a new factory; the surface config stays free of grants.
|
|
107
97
|
*
|
|
108
98
|
* `auth` is not here either: `.auth(construct)` already declares it, and a
|
|
109
99
|
* second way to say the same thing is the duplication this whole model removes.
|
|
110
100
|
*
|
|
111
101
|
* What is left is what the *process* is rather than what a route may reach.
|
|
112
102
|
*/
|
|
113
|
-
declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
103
|
+
export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
104
|
+
#private;
|
|
114
105
|
private readonly config;
|
|
115
106
|
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
116
107
|
private readonly dependencies;
|
|
@@ -146,34 +137,45 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
146
137
|
readonly envParser: EnvironmentParser<{}>;
|
|
147
138
|
/** The Telescope instance, when this surface was given one. */
|
|
148
139
|
readonly telescope?: Telescope;
|
|
149
|
-
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
150
|
-
|
|
151
|
-
|
|
140
|
+
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
141
|
+
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
142
|
+
dependencies?: readonly Dependency[],
|
|
143
|
+
/** Internal: how `.auth()` carries the authenticator into its copy. */
|
|
144
|
+
authenticator?: Authenticator | undefined);
|
|
145
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
146
|
+
readonly get: Endpoints['get'];
|
|
147
|
+
readonly post: Endpoints['post'];
|
|
148
|
+
readonly put: Endpoints['put'];
|
|
149
|
+
readonly patch: Endpoints['patch'];
|
|
150
|
+
readonly delete: Endpoints['delete'];
|
|
151
|
+
readonly options: Endpoints['options'];
|
|
152
152
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* `api.get('/users')` is the short form and covers most routes. Reach for
|
|
156
|
-
* this one when a *group* of endpoints shares something a single route would
|
|
157
|
-
* otherwise repeat — a database, an auditor, a publisher:
|
|
153
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
154
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
158
155
|
*
|
|
159
156
|
* ```ts
|
|
160
|
-
* const
|
|
161
|
-
* export const createUser =
|
|
157
|
+
* export const router = api.database(database);
|
|
158
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
162
159
|
* ```
|
|
163
160
|
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
161
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
162
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
163
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
164
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
165
|
+
*
|
|
166
|
+
* `dependsOn` is deliberately not here. It is per endpoint, and on the
|
|
167
|
+
* surface it would read as the API depending on something, which is what
|
|
168
|
+
* `.calls()` and `.auth()` say instead.
|
|
168
169
|
*/
|
|
169
|
-
readonly
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
readonly database: Endpoints['database'];
|
|
171
|
+
readonly session: Endpoints['session'];
|
|
172
|
+
readonly auditor: Endpoints['auditor'];
|
|
173
|
+
readonly actor: Endpoints['actor'];
|
|
174
|
+
readonly publisher: Endpoints['publisher'];
|
|
175
|
+
readonly authorizer: Endpoints['authorizer'];
|
|
176
|
+
readonly authorize: Endpoints['authorize'];
|
|
177
|
+
readonly rls: Endpoints['rls'];
|
|
178
|
+
readonly route: Endpoints['route'];
|
|
177
179
|
/**
|
|
178
180
|
* What authenticates this surface.
|
|
179
181
|
*
|
|
@@ -183,12 +185,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
183
185
|
* what a request is allowed to be. A surface with two of the first is a
|
|
184
186
|
* mistake; two of the second is Tuesday.
|
|
185
187
|
*
|
|
186
|
-
* It
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
188
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
189
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
190
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
191
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
192
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
190
193
|
*/
|
|
191
|
-
auth(construct:
|
|
194
|
+
auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
|
|
192
195
|
/**
|
|
193
196
|
* Other surfaces this one calls.
|
|
194
197
|
*
|
|
@@ -215,7 +218,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
215
218
|
*/
|
|
216
219
|
declare(): Declaration[];
|
|
217
220
|
}
|
|
218
|
-
//# sourceMappingURL=rest-api.d.ts.map
|
|
219
221
|
//#endregion
|
|
220
|
-
export {
|
|
222
|
+
export type { Authenticator };
|
|
221
223
|
//# sourceMappingURL=rest-api.d.mts.map
|
package/dist/rest-api.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-api.d.mts","names":[],"sources":["../src/rest-api.ts"],"
|
|
1
|
+
{"version":3,"file":"rest-api.d.mts","names":[],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;;KAkDK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;;;;;;;;;qBAoBA,QACZ,qCACM,iEACM,WAAW;;mBAuCL;;mBAEA;;mBAEA;WAzCT,IAAI;;;;;;WAOJ;IACR;IACA;IACA;;;;;;;;;WAUQ,QAAQ;;;;;;;;;WAUR,WAAW;;WAGX,YAAY;EAErB,YACC,IAAI,cAAc,QACD,QAAQ,cAAc,eAEtB;;EAAA,wBAAuB,cAEvB;;EAAA,gBAAgB;;WAyEzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;;WAoBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,WAAW;WACX,YAAY;WACZ,WAAW;WACX,KAAK;WACL,OAAO;;;;;;;;;;;;;;;;EAiBhB,KAAK,WAAW,gBAAgB,QAAQ,OAAO;;;;;;;;;;;;;;;EAuB/C,MAAM,qBAAqB,eAAe,QAAQ,OAAO;;;;;;;;;;EAkBzD,WAAW"}
|
package/dist/rest-api.mjs
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
import "./
|
|
4
|
-
import { EndpointFactory } from "./EndpointFactory-DTTCkGEL.mjs";
|
|
5
|
-
import "./clone-DblgEZZa.mjs";
|
|
6
|
-
import "./Endpoint-VIOpSo0S.mjs";
|
|
7
|
-
import { envParserFor } from "./surfaceEnv-C3Ktahea.mjs";
|
|
1
|
+
import { edgeTo } from "./construct-interface.mjs";
|
|
2
|
+
import { o as getSecurityScheme, t as EndpointFactory } from "./EndpointFactory-B9HAjDAP.mjs";
|
|
3
|
+
import { n as envParserFor } from "./surfaceEnv-wMT5QzgZ.mjs";
|
|
8
4
|
import { canonicalId, provideKey } from "@geekmidas/manifest";
|
|
9
5
|
import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
|
|
10
|
-
|
|
11
6
|
//#region src/rest-api.ts
|
|
12
7
|
/**
|
|
13
8
|
* What is *not* here, and why.
|
|
@@ -16,8 +11,9 @@ import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
|
|
|
16
11
|
* into a handler. Putting one on the surface hands it to every route the
|
|
17
12
|
* surface serves — a health check gets the database because a report needed it
|
|
18
13
|
* — which is the thing least privilege forbids and the reason `.calls()` is not
|
|
19
|
-
* spelled `dependsOn`. They belong to the endpoint, or to a
|
|
20
|
-
*
|
|
14
|
+
* spelled `dependsOn`. They belong to the endpoint, or to a branch —
|
|
15
|
+
* `api.database(db)` — for a group of endpoints that genuinely share them. A
|
|
16
|
+
* branch is a new factory; the surface config stays free of grants.
|
|
21
17
|
*
|
|
22
18
|
* `auth` is not here either: `.auth(construct)` already declares it, and a
|
|
23
19
|
* second way to say the same thing is the duplication this whole model removes.
|
|
@@ -25,6 +21,9 @@ import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
|
|
|
25
21
|
* What is left is what the *process* is rather than what a route may reach.
|
|
26
22
|
*/
|
|
27
23
|
var RestApi = class RestApi {
|
|
24
|
+
config;
|
|
25
|
+
dependencies;
|
|
26
|
+
authenticator;
|
|
28
27
|
id;
|
|
29
28
|
/**
|
|
30
29
|
* Declared once and read by both `declare()` and anything that consumes this
|
|
@@ -68,53 +67,81 @@ var RestApi = class RestApi {
|
|
|
68
67
|
id: canonical,
|
|
69
68
|
envParser: config.envParser
|
|
70
69
|
} : void 0);
|
|
71
|
-
this
|
|
70
|
+
this.#endpoints = new EndpointFactory({
|
|
72
71
|
defaultLogger: this.logger,
|
|
73
|
-
...config.authorizers ? { availableAuthorizers: config.authorizers.map((name) =>
|
|
72
|
+
...config.authorizers ? { availableAuthorizers: config.authorizers.map((name) => {
|
|
73
|
+
const securityScheme = getSecurityScheme(name);
|
|
74
|
+
return securityScheme ? {
|
|
75
|
+
name,
|
|
76
|
+
securityScheme
|
|
77
|
+
} : { name };
|
|
78
|
+
}) } : {},
|
|
74
79
|
...config.defaultAuthorizer && config.defaultAuthorizer !== "none" ? { defaultAuthorizerName: config.defaultAuthorizer } : {},
|
|
75
80
|
surface: {
|
|
76
81
|
id: this.id,
|
|
77
|
-
envParser: this.envParser
|
|
82
|
+
envParser: this.envParser,
|
|
83
|
+
...authenticator ? { auth: authenticator } : {}
|
|
78
84
|
}
|
|
79
85
|
});
|
|
86
|
+
const endpoints = this.#endpoints;
|
|
87
|
+
this.get = endpoints.get.bind(endpoints);
|
|
88
|
+
this.post = endpoints.post.bind(endpoints);
|
|
89
|
+
this.put = endpoints.put.bind(endpoints);
|
|
90
|
+
this.patch = endpoints.patch.bind(endpoints);
|
|
91
|
+
this.delete = endpoints.delete.bind(endpoints);
|
|
92
|
+
this.options = endpoints.options.bind(endpoints);
|
|
93
|
+
this.database = endpoints.database.bind(endpoints);
|
|
94
|
+
this.session = endpoints.session.bind(endpoints);
|
|
95
|
+
this.auditor = endpoints.auditor.bind(endpoints);
|
|
96
|
+
this.actor = endpoints.actor.bind(endpoints);
|
|
97
|
+
this.publisher = endpoints.publisher.bind(endpoints);
|
|
98
|
+
this.authorizer = endpoints.authorizer.bind(endpoints);
|
|
99
|
+
this.authorize = endpoints.authorize.bind(endpoints);
|
|
100
|
+
this.rls = endpoints.rls.bind(endpoints);
|
|
101
|
+
this.route = endpoints.route.bind(endpoints);
|
|
80
102
|
}
|
|
81
103
|
/**
|
|
82
|
-
* This surface's endpoint factory.
|
|
104
|
+
* This surface's endpoint factory, which every method below starts from.
|
|
83
105
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
106
|
+
* Private: a surface *is* where endpoints are built, so there is no second
|
|
107
|
+
* object to reach through first. `api.database(db)` said the same
|
|
108
|
+
* thing as `api.database(db)` with one more word to learn.
|
|
109
|
+
*/
|
|
110
|
+
#endpoints;
|
|
111
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
112
|
+
get;
|
|
113
|
+
post;
|
|
114
|
+
put;
|
|
115
|
+
patch;
|
|
116
|
+
delete;
|
|
117
|
+
options;
|
|
118
|
+
/**
|
|
119
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
120
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
87
121
|
*
|
|
88
122
|
* ```ts
|
|
89
|
-
* const
|
|
90
|
-
* export const createUser =
|
|
123
|
+
* export const router = api.database(database);
|
|
124
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
91
125
|
* ```
|
|
92
126
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
127
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
128
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
129
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
130
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
131
|
+
*
|
|
132
|
+
* `dependsOn` is deliberately not here. It is per endpoint, and on the
|
|
133
|
+
* surface it would read as the API depending on something, which is what
|
|
134
|
+
* `.calls()` and `.auth()` say instead.
|
|
97
135
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return this.endpoints.put(path);
|
|
108
|
-
}
|
|
109
|
-
patch(path) {
|
|
110
|
-
return this.endpoints.patch(path);
|
|
111
|
-
}
|
|
112
|
-
delete(path) {
|
|
113
|
-
return this.endpoints.delete(path);
|
|
114
|
-
}
|
|
115
|
-
options(path) {
|
|
116
|
-
return this.endpoints.options(path);
|
|
117
|
-
}
|
|
136
|
+
database;
|
|
137
|
+
session;
|
|
138
|
+
auditor;
|
|
139
|
+
actor;
|
|
140
|
+
publisher;
|
|
141
|
+
authorizer;
|
|
142
|
+
authorize;
|
|
143
|
+
rls;
|
|
144
|
+
route;
|
|
118
145
|
/**
|
|
119
146
|
* What authenticates this surface.
|
|
120
147
|
*
|
|
@@ -124,13 +151,14 @@ var RestApi = class RestApi {
|
|
|
124
151
|
* what a request is allowed to be. A surface with two of the first is a
|
|
125
152
|
* mistake; two of the second is Tuesday.
|
|
126
153
|
*
|
|
127
|
-
* It
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
154
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
155
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
156
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
157
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
158
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
131
159
|
*/
|
|
132
160
|
auth(construct) {
|
|
133
|
-
return new RestApi(this.id, this.config, [...this.dependencies, edgeTo(construct)], construct
|
|
161
|
+
return new RestApi(this.id, this.config, [...this.dependencies, edgeTo(construct)], construct);
|
|
134
162
|
}
|
|
135
163
|
/**
|
|
136
164
|
* Other surfaces this one calls.
|
|
@@ -162,12 +190,10 @@ var RestApi = class RestApi {
|
|
|
162
190
|
return [{
|
|
163
191
|
kind: "rest-api",
|
|
164
192
|
id: this.id,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
...this.config.telescope ? { telescope: true } : {}
|
|
168
|
-
},
|
|
193
|
+
path: this.config.path,
|
|
194
|
+
...this.config.telescope ? { telescope: true } : {},
|
|
169
195
|
...this.config.cors ? { cors: this.config.cors } : {},
|
|
170
|
-
...this.authenticator ? { auth: this.authenticator } : {},
|
|
196
|
+
...this.authenticator ? { auth: this.authenticator.id } : {},
|
|
171
197
|
endpoints: [],
|
|
172
198
|
...this.dependencies.length ? { calls: this.dependencies } : {},
|
|
173
199
|
...this.config.authorizers?.length ? { authorizers: this.config.authorizers } : {},
|
|
@@ -180,7 +206,7 @@ var RestApi = class RestApi {
|
|
|
180
206
|
}];
|
|
181
207
|
}
|
|
182
208
|
};
|
|
183
|
-
|
|
184
209
|
//#endregion
|
|
185
210
|
export { RestApi };
|
|
211
|
+
|
|
186
212
|
//# sourceMappingURL=rest-api.mjs.map
|