@geekmidas/constructs 10.0.0-alpha.6 → 10.0.0-alpha.60
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 +223 -158
- package/dist/{Construct-BD5neF7w.mjs → Construct-BO1X-kt9.mjs} +32 -33
- package/dist/Construct-BO1X-kt9.mjs.map +1 -0
- package/dist/Construct-BQALFCh2.d.cts +230 -0
- package/dist/Construct-BQALFCh2.d.cts.map +1 -0
- package/dist/{Construct-CyS3RpTL.cjs → Construct-DmvXceVY.cjs} +52 -47
- package/dist/Construct-DmvXceVY.cjs.map +1 -0
- package/dist/Construct-QXnl3VqT.d.mts +230 -0
- package/dist/Construct-QXnl3VqT.d.mts.map +1 -0
- package/dist/{Cron-DmQ8vQ4b.d.cts → Cron-DI3nKoic.d.cts} +15 -9
- package/dist/Cron-DI3nKoic.d.cts.map +1 -0
- package/dist/{Cron-dh4rUgib.d.mts → Cron-uYAHPnp7.d.mts} +15 -9
- package/dist/Cron-uYAHPnp7.d.mts.map +1 -0
- package/dist/{CronBuilder-Da0C0edR.cjs → CronBuilder-BoHzlWU_.cjs} +47 -31
- package/dist/CronBuilder-BoHzlWU_.cjs.map +1 -0
- package/dist/{CronBuilder-CYKT5RiO.mjs → CronBuilder-CCgt0wCE.mjs} +37 -21
- package/dist/CronBuilder-CCgt0wCE.mjs.map +1 -0
- package/dist/CronBuilder-DaSUm2Na.d.mts +47 -0
- package/dist/CronBuilder-DaSUm2Na.d.mts.map +1 -0
- package/dist/CronBuilder-g1lZLWyG.d.cts +47 -0
- package/dist/CronBuilder-g1lZLWyG.d.cts.map +1 -0
- package/dist/{Endpoint-BjWKinFA.d.mts → Endpoint-Bm9HjTPc.d.cts} +70 -93
- package/dist/Endpoint-Bm9HjTPc.d.cts.map +1 -0
- package/dist/{Endpoint-DCQPMdUX.mjs → Endpoint-CQ9RJ7p2.mjs} +130 -109
- package/dist/Endpoint-CQ9RJ7p2.mjs.map +1 -0
- package/dist/{Endpoint-DcWXE-SZ.cjs → Endpoint-DOi8c_Gy.cjs} +158 -131
- package/dist/Endpoint-DOi8c_Gy.cjs.map +1 -0
- package/dist/{Endpoint-dav89W6-.d.cts → Endpoint-KyMeR-B-.d.mts} +71 -94
- package/dist/Endpoint-KyMeR-B-.d.mts.map +1 -0
- package/dist/{index-Bd5FqCoe.d.cts → EndpointFactory-B6eZ3RDd.d.cts} +62 -132
- package/dist/EndpointFactory-B6eZ3RDd.d.cts.map +1 -0
- package/dist/{EndpointFactory-CdWB7wPw.cjs → EndpointFactory-Bo9lkMqB.cjs} +75 -110
- package/dist/EndpointFactory-Bo9lkMqB.cjs.map +1 -0
- package/dist/{EndpointFactory-CjV8F_lJ.mjs → EndpointFactory-DR1rebok.mjs} +39 -74
- package/dist/EndpointFactory-DR1rebok.mjs.map +1 -0
- package/dist/{index-lAO9egTb.d.mts → EndpointFactory-GYkAuG3u.d.mts} +63 -133
- package/dist/EndpointFactory-GYkAuG3u.d.mts.map +1 -0
- package/dist/Function-DuqGcbOI.d.mts +76 -0
- package/dist/Function-DuqGcbOI.d.mts.map +1 -0
- package/dist/Function-Pu-1kKZz.d.cts +76 -0
- package/dist/Function-Pu-1kKZz.d.cts.map +1 -0
- package/dist/{HonoEndpointAdaptor-DtL9j19R.cjs → HonoEndpointAdaptor-XyxwoFnE.cjs} +52 -54
- package/dist/HonoEndpointAdaptor-XyxwoFnE.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-P1ahhZHu.mjs → HonoEndpointAdaptor-ja49poBI.mjs} +42 -47
- package/dist/HonoEndpointAdaptor-ja49poBI.mjs.map +1 -0
- package/dist/Queue-D5jcw0mu.cjs +109 -0
- package/dist/Queue-D5jcw0mu.cjs.map +1 -0
- package/dist/{Queue-D7ZuwBhy.d.cts → Queue-DlsHRzUp.d.mts} +48 -48
- package/dist/Queue-DlsHRzUp.d.mts.map +1 -0
- package/dist/{Queue-gVGfi2Yk.d.mts → Queue-HPyi0e1i.d.cts} +49 -49
- package/dist/Queue-HPyi0e1i.d.cts.map +1 -0
- package/dist/Queue-hwPN-t31.mjs +104 -0
- package/dist/Queue-hwPN-t31.mjs.map +1 -0
- package/dist/QueueBuilder-BFQn3OzZ.cjs +135 -0
- package/dist/QueueBuilder-BFQn3OzZ.cjs.map +1 -0
- package/dist/QueueBuilder-DCuYdjMw.mjs +118 -0
- package/dist/QueueBuilder-DCuYdjMw.mjs.map +1 -0
- package/dist/QueueBuilder-OSi6LkV9.d.cts +75 -0
- package/dist/QueueBuilder-OSi6LkV9.d.cts.map +1 -0
- package/dist/QueueBuilder-QHsnVt1P.d.mts +75 -0
- package/dist/QueueBuilder-QHsnVt1P.d.mts.map +1 -0
- package/dist/{Subscriber-2mEi0ImH.d.cts → Subscriber-Bpp02cGr.d.cts} +29 -20
- package/dist/Subscriber-Bpp02cGr.d.cts.map +1 -0
- package/dist/{Subscriber-xTJ9ayPN.d.mts → Subscriber-CtN9R48-.d.mts} +29 -20
- package/dist/Subscriber-CtN9R48-.d.mts.map +1 -0
- package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-C2PwqwIl.cjs} +61 -36
- package/dist/SubscriberBuilder-C2PwqwIl.cjs.map +1 -0
- package/dist/SubscriberBuilder-CuCMFpYW.d.mts +67 -0
- package/dist/SubscriberBuilder-CuCMFpYW.d.mts.map +1 -0
- package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-DMFk_Ap1.mjs} +50 -24
- package/dist/SubscriberBuilder-DMFk_Ap1.mjs.map +1 -0
- package/dist/SubscriberBuilder-g3fAVWgs.d.cts +67 -0
- package/dist/SubscriberBuilder-g3fAVWgs.d.cts.map +1 -0
- package/dist/Topic-CkxOTrMv.cjs +104 -0
- package/dist/Topic-CkxOTrMv.cjs.map +1 -0
- package/dist/Topic-hPffOsot.mjs +99 -0
- package/dist/Topic-hPffOsot.mjs.map +1 -0
- package/dist/adaptors/aws.cjs +118 -216
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +34 -53
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +35 -54
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +91 -191
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/hono.cjs +3 -10
- package/dist/adaptors/hono.d.cts +7 -16
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +8 -17
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +2 -10
- package/dist/adaptors/testing.cjs +711 -89
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +325 -54
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +325 -54
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +676 -70
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-CIFXNuDk.d.cts +194 -0
- package/dist/auth-CIFXNuDk.d.cts.map +1 -0
- package/dist/auth-CJ9Ff6Lu.d.mts +194 -0
- package/dist/auth-CJ9Ff6Lu.d.mts.map +1 -0
- package/dist/auth.cjs +172 -31
- 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 +161 -24
- package/dist/auth.mjs.map +1 -1
- package/dist/{cache-BrRz3fEB.d.mts → cache-CXh6GIgb.d.mts} +3 -6
- package/dist/cache-CXh6GIgb.d.mts.map +1 -0
- package/dist/{cache-BtZY_tHe.d.cts → cache-DnGDGly3.d.cts} +3 -6
- package/dist/cache-DnGDGly3.d.cts.map +1 -0
- package/dist/cache.cjs +68 -2
- package/dist/cache.cjs.map +1 -0
- package/dist/cache.d.cts +1 -2
- package/dist/cache.d.mts +1 -2
- package/dist/cache.mjs +67 -2
- package/dist/cache.mjs.map +1 -0
- package/dist/cipher-C1lEFX63.mjs +225 -0
- package/dist/cipher-C1lEFX63.mjs.map +1 -0
- package/dist/cipher-CVxfwLjk.cjs +332 -0
- package/dist/cipher-CVxfwLjk.cjs.map +1 -0
- package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
- package/dist/clone-EKNovYHu.mjs.map +1 -0
- package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
- package/dist/clone-UGJpvQnL.cjs.map +1 -0
- package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-B1AfqRl4.d.cts} +42 -11
- package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
- package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-DluK3_da.d.mts} +42 -11
- package/dist/construct-interface-DluK3_da.d.mts.map +1 -0
- package/dist/construct-interface.cjs +113 -7
- package/dist/construct-interface.cjs.map +1 -0
- package/dist/construct-interface.d.cts +2 -2
- package/dist/construct-interface.d.mts +2 -2
- package/dist/construct-interface.mjs +106 -2
- package/dist/construct-interface.mjs.map +1 -0
- package/dist/credential.cjs +63 -16
- package/dist/credential.cjs.map +1 -1
- package/dist/credential.d.cts +16 -9
- package/dist/credential.d.cts.map +1 -1
- package/dist/credential.d.mts +16 -9
- package/dist/credential.d.mts.map +1 -1
- package/dist/credential.mjs +58 -12
- package/dist/credential.mjs.map +1 -1
- package/dist/crons/index.cjs +105 -7
- package/dist/crons/index.cjs.map +1 -1
- package/dist/crons/index.d.cts +40 -11
- package/dist/crons/index.d.cts.map +1 -1
- package/dist/crons/index.d.mts +40 -11
- package/dist/crons/index.d.mts.map +1 -1
- package/dist/crons/index.mjs +103 -8
- package/dist/crons/index.mjs.map +1 -1
- package/dist/database/kysely.cjs +4 -181
- package/dist/database/kysely.d.cts +2 -152
- package/dist/database/kysely.d.mts +2 -152
- package/dist/database/kysely.mjs +2 -180
- package/dist/email.cjs +25 -12
- package/dist/email.cjs.map +1 -1
- package/dist/email.d.cts +3 -7
- package/dist/email.d.cts.map +1 -1
- package/dist/email.d.mts +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/encryption.cjs +96 -0
- package/dist/encryption.cjs.map +1 -0
- package/dist/encryption.d.cts +117 -0
- package/dist/encryption.d.cts.map +1 -0
- package/dist/encryption.d.mts +117 -0
- package/dist/encryption.d.mts.map +1 -0
- package/dist/encryption.mjs +83 -0
- package/dist/encryption.mjs.map +1 -0
- package/dist/endpoints/index.cjs +8 -10
- package/dist/endpoints/index.d.cts +51 -7
- package/dist/endpoints/index.d.cts.map +1 -0
- package/dist/endpoints/index.d.mts +51 -7
- package/dist/endpoints/index.d.mts.map +1 -0
- package/dist/endpoints/index.mjs +6 -10
- package/dist/external-api-CWY9orcO.d.mts +86 -0
- package/dist/external-api-CWY9orcO.d.mts.map +1 -0
- package/dist/external-api-D-5WB-sr.d.cts +86 -0
- package/dist/external-api-D-5WB-sr.d.cts.map +1 -0
- package/dist/external-api.cjs +124 -0
- package/dist/external-api.cjs.map +1 -0
- package/dist/external-api.d.cts +2 -0
- package/dist/external-api.d.mts +2 -0
- package/dist/external-api.mjs +121 -0
- package/dist/external-api.mjs.map +1 -0
- 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 +3 -6
- package/dist/functions/index.d.cts +3 -4
- package/dist/functions/index.d.mts +3 -4
- package/dist/functions/index.mjs +2 -6
- package/dist/{functions-i_la-N5r.cjs → functions-CbP5ZKma.cjs} +414 -264
- package/dist/functions-CbP5ZKma.cjs.map +1 -0
- package/dist/{functions-14lpEFL4.mjs → functions-Di6n5ltG.mjs} +376 -238
- package/dist/{functions-14lpEFL4.mjs.map → functions-Di6n5ltG.mjs.map} +1 -1
- package/dist/index-BuzRvKOQ.d.cts +115 -0
- package/dist/index-BuzRvKOQ.d.cts.map +1 -0
- package/dist/index-CTkKOer4.d.mts +115 -0
- package/dist/index-CTkKOer4.d.mts.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.cjs +6 -3
- package/dist/index.d.cts +26 -4
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +26 -4
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -3
- package/dist/kms-B-Hm3d5r.cjs +85 -0
- package/dist/kms-B-Hm3d5r.cjs.map +1 -0
- package/dist/kms-BdUlMJEZ.mjs +85 -0
- package/dist/kms-BdUlMJEZ.mjs.map +1 -0
- package/dist/kysely-BEm5sDlU.d.cts +173 -0
- package/dist/kysely-BEm5sDlU.d.cts.map +1 -0
- package/dist/kysely-BRzzawr2.cjs +301 -0
- package/dist/kysely-BRzzawr2.cjs.map +1 -0
- package/dist/kysely-BYfM6Zby.mjs +288 -0
- package/dist/kysely-BYfM6Zby.mjs.map +1 -0
- package/dist/kysely-CjuvdXEV.d.mts +173 -0
- package/dist/kysely-CjuvdXEV.d.mts.map +1 -0
- package/dist/{lazyAccessors-BoJN3SMd.mjs → lazyAccessors-CFanua0O.mjs} +20 -60
- package/dist/lazyAccessors-CFanua0O.mjs.map +1 -0
- package/dist/{lazyAccessors-e3j2oE2m.cjs → lazyAccessors-hJKGv8Ay.cjs} +60 -113
- package/dist/lazyAccessors-hJKGv8Ay.cjs.map +1 -0
- package/dist/mobile-app.cjs +73 -0
- package/dist/mobile-app.cjs.map +1 -0
- package/dist/mobile-app.d.cts +61 -0
- package/dist/mobile-app.d.cts.map +1 -0
- package/dist/mobile-app.d.mts +61 -0
- package/dist/mobile-app.d.mts.map +1 -0
- package/dist/mobile-app.mjs +72 -0
- package/dist/mobile-app.mjs.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 +6 -189
- package/dist/queue/index.d.cts +3 -60
- package/dist/queue/index.d.mts +3 -60
- package/dist/queue/index.mjs +3 -186
- package/dist/rest-api.cjs +88 -63
- package/dist/rest-api.cjs.map +1 -1
- package/dist/rest-api.d.cts +68 -61
- package/dist/rest-api.d.cts.map +1 -1
- package/dist/rest-api.d.mts +68 -61
- package/dist/rest-api.d.mts.map +1 -1
- package/dist/rest-api.mjs +80 -55
- package/dist/rest-api.mjs.map +1 -1
- package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
- package/dist/runSubscriber-BRp9a_qi.cjs +126 -0
- package/dist/runSubscriber-BRp9a_qi.cjs.map +1 -0
- package/dist/runSubscriber-BYEY_bfA.mjs +109 -0
- package/dist/runSubscriber-BYEY_bfA.mjs.map +1 -0
- package/dist/shutdown-BMJmAhSt.cjs +38 -0
- package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
- package/dist/shutdown-C7xa8x9S.mjs +27 -0
- package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
- package/dist/site.cjs +34 -9
- package/dist/site.cjs.map +1 -1
- package/dist/site.d.cts +17 -22
- package/dist/site.d.cts.map +1 -1
- package/dist/site.d.mts +17 -22
- package/dist/site.d.mts.map +1 -1
- package/dist/site.mjs +30 -5
- package/dist/site.mjs.map +1 -1
- package/dist/subscribers/index.cjs +111 -6
- package/dist/subscribers/index.cjs.map +1 -0
- package/dist/subscribers/index.d.cts +50 -6
- package/dist/subscribers/index.d.cts.map +1 -0
- package/dist/subscribers/index.d.mts +50 -6
- package/dist/subscribers/index.d.mts.map +1 -0
- package/dist/subscribers/index.mjs +108 -5
- package/dist/subscribers/index.mjs.map +1 -0
- package/dist/surfaceEnv-CNimK76p.cjs +56 -0
- package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
- package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
- package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
- package/dist/{telemetry-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 +3 -137
- package/dist/topic/index.d.cts +2 -4
- package/dist/topic/index.d.mts +2 -4
- package/dist/topic/index.mjs +2 -134
- package/dist/{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 +58 -34
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +63 -45
- package/dist/worker.d.cts.map +1 -1
- package/dist/worker.d.mts +63 -44
- package/dist/worker.d.mts.map +1 -1
- package/dist/worker.mjs +53 -29
- package/dist/worker.mjs.map +1 -1
- package/package.json +82 -41
- package/dist/Construct-BD5neF7w.mjs.map +0 -1
- package/dist/Construct-C0ijr2qp.d.cts +0 -117
- package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
- package/dist/Construct-Ct8nalEi.d.mts +0 -117
- package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
- package/dist/Construct-CyS3RpTL.cjs.map +0 -1
- package/dist/Cron-DmQ8vQ4b.d.cts.map +0 -1
- package/dist/Cron-dh4rUgib.d.mts.map +0 -1
- package/dist/CronBuilder-BquXDbDI.d.cts +0 -44
- package/dist/CronBuilder-BquXDbDI.d.cts.map +0 -1
- package/dist/CronBuilder-CGgY2080.d.mts +0 -44
- package/dist/CronBuilder-CGgY2080.d.mts.map +0 -1
- package/dist/CronBuilder-CYKT5RiO.mjs.map +0 -1
- package/dist/CronBuilder-Da0C0edR.cjs.map +0 -1
- package/dist/Endpoint-BjWKinFA.d.mts.map +0 -1
- package/dist/Endpoint-DCQPMdUX.mjs.map +0 -1
- package/dist/Endpoint-DcWXE-SZ.cjs.map +0 -1
- package/dist/Endpoint-dav89W6-.d.cts.map +0 -1
- package/dist/EndpointFactory-CdWB7wPw.cjs.map +0 -1
- package/dist/EndpointFactory-CjV8F_lJ.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-DtL9j19R.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-P1ahhZHu.mjs.map +0 -1
- package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
- package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
- package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
- package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
- package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
- package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
- package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
- package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
- package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
- package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
- package/dist/Topic-19QeHBIR.d.cts +0 -91
- package/dist/Topic-19QeHBIR.d.cts.map +0 -1
- package/dist/Topic-DuFeqkBh.d.mts +0 -91
- package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
- package/dist/auth.d.cts.map +0 -1
- package/dist/auth.d.mts.map +0 -1
- package/dist/cache-0ANvRQnD.mjs +0 -51
- package/dist/cache-0ANvRQnD.mjs.map +0 -1
- package/dist/cache-3WSvAulx.cjs +0 -57
- package/dist/cache-3WSvAulx.cjs.map +0 -1
- package/dist/cache-BrRz3fEB.d.mts.map +0 -1
- package/dist/cache-BtZY_tHe.d.cts.map +0 -1
- package/dist/clone-DblgEZZa.mjs.map +0 -1
- package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
- package/dist/construct-interface-BfjcOD_E.cjs +0 -117
- package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
- package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
- package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
- package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
- package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
- package/dist/database/kysely.cjs.map +0 -1
- package/dist/database/kysely.d.cts.map +0 -1
- package/dist/database/kysely.d.mts.map +0 -1
- package/dist/database/kysely.mjs.map +0 -1
- package/dist/functions-i_la-N5r.cjs.map +0 -1
- package/dist/index-Bd5FqCoe.d.cts.map +0 -1
- package/dist/index-BknhM6Ux.d.mts +0 -31
- package/dist/index-BknhM6Ux.d.mts.map +0 -1
- package/dist/index-CBSfrowv.d.cts +0 -31
- package/dist/index-CBSfrowv.d.cts.map +0 -1
- package/dist/index-D24Xm79M.d.cts +0 -171
- package/dist/index-D24Xm79M.d.cts.map +0 -1
- package/dist/index-_ajboYxK.d.mts +0 -171
- package/dist/index-_ajboYxK.d.mts.map +0 -1
- package/dist/index-lAO9egTb.d.mts.map +0 -1
- package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
- package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
- package/dist/processAudits-CGqttuXm.cjs.map +0 -1
- package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
- package/dist/queue/index.cjs.map +0 -1
- package/dist/queue/index.d.cts.map +0 -1
- package/dist/queue/index.d.mts.map +0 -1
- package/dist/queue/index.mjs.map +0 -1
- package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
- package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
- package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
- package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
- package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
- package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
- package/dist/topic/index.cjs.map +0 -1
- package/dist/topic/index.mjs.map +0 -1
- package/dist/types-BlAkSuGI.d.cts.map +0 -1
- package/dist/types-aKksMEWL.d.mts.map +0 -1
package/dist/rest-api.d.cts
CHANGED
|
@@ -1,37 +1,32 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./types-BlAkSuGI.cjs";
|
|
5
|
-
import { BuiltInSecuritySchemeId } from "./Endpoint-dav89W6-.cjs";
|
|
6
|
-
import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-Bd5FqCoe.cjs";
|
|
1
|
+
import { i as Declarable, t as Authenticator } from "./construct-interface-B1AfqRl4.cjs";
|
|
2
|
+
import { T as BuiltInSecuritySchemeId } from "./Endpoint-Bm9HjTPc.cjs";
|
|
3
|
+
import { t as EndpointFactory } from "./EndpointFactory-B6eZ3RDd.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;
|
|
24
|
+
/**
|
|
25
|
+
* The label it answers on under a stage's domain — `api` for
|
|
26
|
+
* `api.myapp.com`, from `deploy.domains` — and under the project locally,
|
|
27
|
+
* `api.myapp.localhost`. Absent, its id kebab-cased.
|
|
28
|
+
*/
|
|
29
|
+
subdomain?: string;
|
|
35
30
|
/**
|
|
36
31
|
* CORS tunables. The *origins* are never here — they are read off the
|
|
37
32
|
* constructs that declared an edge to this surface, which is the whole point
|
|
@@ -98,19 +93,21 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
|
98
93
|
/**
|
|
99
94
|
* What is *not* here, and why.
|
|
100
95
|
*
|
|
101
|
-
* `dependsOn`, `database`, `auditor` and `
|
|
96
|
+
* `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
|
|
102
97
|
* into a handler. Putting one on the surface hands it to every route the
|
|
103
98
|
* surface serves — a health check gets the database because a report needed it
|
|
104
99
|
* — 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
|
-
*
|
|
100
|
+
* spelled `dependsOn`. They belong to the endpoint, or to a branch —
|
|
101
|
+
* `api.database(db)` — for a group of endpoints that genuinely share them. A
|
|
102
|
+
* branch is a new factory; the surface config stays free of grants.
|
|
107
103
|
*
|
|
108
104
|
* `auth` is not here either: `.auth(construct)` already declares it, and a
|
|
109
105
|
* second way to say the same thing is the duplication this whole model removes.
|
|
110
106
|
*
|
|
111
107
|
* What is left is what the *process* is rather than what a route may reach.
|
|
112
108
|
*/
|
|
113
|
-
declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
109
|
+
export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
110
|
+
#private;
|
|
114
111
|
private readonly config;
|
|
115
112
|
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
116
113
|
private readonly dependencies;
|
|
@@ -146,34 +143,44 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
146
143
|
readonly envParser: EnvironmentParser<{}>;
|
|
147
144
|
/** The Telescope instance, when this surface was given one. */
|
|
148
145
|
readonly telescope?: Telescope;
|
|
149
|
-
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
147
|
+
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
148
|
+
dependencies?: readonly Dependency[],
|
|
149
|
+
/** Internal: how `.auth()` carries the authenticator into its copy. */
|
|
150
|
+
authenticator?: Authenticator | undefined);
|
|
151
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
152
|
+
readonly get: Endpoints['get'];
|
|
153
|
+
readonly post: Endpoints['post'];
|
|
154
|
+
readonly put: Endpoints['put'];
|
|
155
|
+
readonly patch: Endpoints['patch'];
|
|
156
|
+
readonly delete: Endpoints['delete'];
|
|
157
|
+
readonly options: Endpoints['options'];
|
|
152
158
|
/**
|
|
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:
|
|
159
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
160
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
158
161
|
*
|
|
159
162
|
* ```ts
|
|
160
|
-
* const
|
|
161
|
-
* export const createUser =
|
|
163
|
+
* export const router = api.database(database);
|
|
164
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
162
165
|
* ```
|
|
163
166
|
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
167
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
168
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
169
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
170
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
171
|
+
*
|
|
172
|
+
* `dependsOn` is deliberately not here. It is per endpoint, and on the
|
|
173
|
+
* surface it would read as the API depending on something, which is what
|
|
174
|
+
* `.calls()` and `.auth()` say instead.
|
|
168
175
|
*/
|
|
169
|
-
readonly
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
readonly database: Endpoints['database'];
|
|
177
|
+
readonly session: Endpoints['session'];
|
|
178
|
+
readonly auditor: Endpoints['auditor'];
|
|
179
|
+
readonly actor: Endpoints['actor'];
|
|
180
|
+
readonly authorizer: Endpoints['authorizer'];
|
|
181
|
+
readonly authorize: Endpoints['authorize'];
|
|
182
|
+
readonly rls: Endpoints['rls'];
|
|
183
|
+
readonly route: Endpoints['route'];
|
|
177
184
|
/**
|
|
178
185
|
* What authenticates this surface.
|
|
179
186
|
*
|
|
@@ -183,12 +190,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
183
190
|
* what a request is allowed to be. A surface with two of the first is a
|
|
184
191
|
* mistake; two of the second is Tuesday.
|
|
185
192
|
*
|
|
186
|
-
* It
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
193
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
194
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
195
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
196
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
197
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
190
198
|
*/
|
|
191
|
-
auth(construct:
|
|
199
|
+
auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
|
|
192
200
|
/**
|
|
193
201
|
* Other surfaces this one calls.
|
|
194
202
|
*
|
|
@@ -215,7 +223,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
215
223
|
*/
|
|
216
224
|
declare(): Declaration[];
|
|
217
225
|
}
|
|
218
|
-
//# sourceMappingURL=rest-api.d.ts.map
|
|
219
226
|
//#endregion
|
|
220
|
-
export {
|
|
227
|
+
export type { Authenticator };
|
|
221
228
|
//# 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;;;;;;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;;WAwEzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;;WAoBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,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,32 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import { BuiltInSecuritySchemeId } from "./Endpoint-BjWKinFA.mjs";
|
|
6
|
-
import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-lAO9egTb.mjs";
|
|
7
|
-
import { AppSpec, ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
|
|
1
|
+
import { i as Declarable, t as Authenticator } from "./construct-interface-DluK3_da.mjs";
|
|
2
|
+
import { T as BuiltInSecuritySchemeId } from "./Endpoint-KyMeR-B-.mjs";
|
|
3
|
+
import { t as EndpointFactory } from "./EndpointFactory-GYkAuG3u.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;
|
|
24
|
+
/**
|
|
25
|
+
* The label it answers on under a stage's domain — `api` for
|
|
26
|
+
* `api.myapp.com`, from `deploy.domains` — and under the project locally,
|
|
27
|
+
* `api.myapp.localhost`. Absent, its id kebab-cased.
|
|
28
|
+
*/
|
|
29
|
+
subdomain?: string;
|
|
35
30
|
/**
|
|
36
31
|
* CORS tunables. The *origins* are never here — they are read off the
|
|
37
32
|
* constructs that declared an edge to this surface, which is the whole point
|
|
@@ -98,19 +93,21 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
|
98
93
|
/**
|
|
99
94
|
* What is *not* here, and why.
|
|
100
95
|
*
|
|
101
|
-
* `dependsOn`, `database`, `auditor` and `
|
|
96
|
+
* `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
|
|
102
97
|
* into a handler. Putting one on the surface hands it to every route the
|
|
103
98
|
* surface serves — a health check gets the database because a report needed it
|
|
104
99
|
* — 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
|
-
*
|
|
100
|
+
* spelled `dependsOn`. They belong to the endpoint, or to a branch —
|
|
101
|
+
* `api.database(db)` — for a group of endpoints that genuinely share them. A
|
|
102
|
+
* branch is a new factory; the surface config stays free of grants.
|
|
107
103
|
*
|
|
108
104
|
* `auth` is not here either: `.auth(construct)` already declares it, and a
|
|
109
105
|
* second way to say the same thing is the duplication this whole model removes.
|
|
110
106
|
*
|
|
111
107
|
* What is left is what the *process* is rather than what a route may reach.
|
|
112
108
|
*/
|
|
113
|
-
declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
109
|
+
export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
110
|
+
#private;
|
|
114
111
|
private readonly config;
|
|
115
112
|
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
116
113
|
private readonly dependencies;
|
|
@@ -146,34 +143,44 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
146
143
|
readonly envParser: EnvironmentParser<{}>;
|
|
147
144
|
/** The Telescope instance, when this surface was given one. */
|
|
148
145
|
readonly telescope?: Telescope;
|
|
149
|
-
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
147
|
+
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
148
|
+
dependencies?: readonly Dependency[],
|
|
149
|
+
/** Internal: how `.auth()` carries the authenticator into its copy. */
|
|
150
|
+
authenticator?: Authenticator | undefined);
|
|
151
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
152
|
+
readonly get: Endpoints['get'];
|
|
153
|
+
readonly post: Endpoints['post'];
|
|
154
|
+
readonly put: Endpoints['put'];
|
|
155
|
+
readonly patch: Endpoints['patch'];
|
|
156
|
+
readonly delete: Endpoints['delete'];
|
|
157
|
+
readonly options: Endpoints['options'];
|
|
152
158
|
/**
|
|
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:
|
|
159
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
160
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
158
161
|
*
|
|
159
162
|
* ```ts
|
|
160
|
-
* const
|
|
161
|
-
* export const createUser =
|
|
163
|
+
* export const router = api.database(database);
|
|
164
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
162
165
|
* ```
|
|
163
166
|
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
167
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
168
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
169
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
170
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
171
|
+
*
|
|
172
|
+
* `dependsOn` is deliberately not here. It is per endpoint, and on the
|
|
173
|
+
* surface it would read as the API depending on something, which is what
|
|
174
|
+
* `.calls()` and `.auth()` say instead.
|
|
168
175
|
*/
|
|
169
|
-
readonly
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
readonly database: Endpoints['database'];
|
|
177
|
+
readonly session: Endpoints['session'];
|
|
178
|
+
readonly auditor: Endpoints['auditor'];
|
|
179
|
+
readonly actor: Endpoints['actor'];
|
|
180
|
+
readonly authorizer: Endpoints['authorizer'];
|
|
181
|
+
readonly authorize: Endpoints['authorize'];
|
|
182
|
+
readonly rls: Endpoints['rls'];
|
|
183
|
+
readonly route: Endpoints['route'];
|
|
177
184
|
/**
|
|
178
185
|
* What authenticates this surface.
|
|
179
186
|
*
|
|
@@ -183,12 +190,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
183
190
|
* what a request is allowed to be. A surface with two of the first is a
|
|
184
191
|
* mistake; two of the second is Tuesday.
|
|
185
192
|
*
|
|
186
|
-
* It
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
193
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
194
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
195
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
196
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
197
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
190
198
|
*/
|
|
191
|
-
auth(construct:
|
|
199
|
+
auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
|
|
192
200
|
/**
|
|
193
201
|
* Other surfaces this one calls.
|
|
194
202
|
*
|
|
@@ -215,7 +223,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
215
223
|
*/
|
|
216
224
|
declare(): Declaration[];
|
|
217
225
|
}
|
|
218
|
-
//# sourceMappingURL=rest-api.d.ts.map
|
|
219
226
|
//#endregion
|
|
220
|
-
export {
|
|
227
|
+
export type { Authenticator };
|
|
221
228
|
//# 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;;;;;;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;;WAwEzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;;WAoBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,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,23 +1,19 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
import "./
|
|
4
|
-
import { EndpointFactory } from "./EndpointFactory-CjV8F_lJ.mjs";
|
|
5
|
-
import "./clone-DblgEZZa.mjs";
|
|
6
|
-
import "./Endpoint-DCQPMdUX.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-DR1rebok.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.
|
|
14
9
|
*
|
|
15
|
-
* `dependsOn`, `database`, `auditor` and `
|
|
10
|
+
* `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
|
|
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,79 @@ 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.authorizer = endpoints.authorizer.bind(endpoints);
|
|
98
|
+
this.authorize = endpoints.authorize.bind(endpoints);
|
|
99
|
+
this.rls = endpoints.rls.bind(endpoints);
|
|
100
|
+
this.route = endpoints.route.bind(endpoints);
|
|
80
101
|
}
|
|
81
102
|
/**
|
|
82
|
-
* This surface's endpoint factory.
|
|
103
|
+
* This surface's endpoint factory, which every method below starts from.
|
|
83
104
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
105
|
+
* Private: a surface *is* where endpoints are built, so there is no second
|
|
106
|
+
* object to reach through first. `api.database(db)` said the same
|
|
107
|
+
* thing as `api.database(db)` with one more word to learn.
|
|
108
|
+
*/
|
|
109
|
+
#endpoints;
|
|
110
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
111
|
+
get;
|
|
112
|
+
post;
|
|
113
|
+
put;
|
|
114
|
+
patch;
|
|
115
|
+
delete;
|
|
116
|
+
options;
|
|
117
|
+
/**
|
|
118
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
119
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
87
120
|
*
|
|
88
121
|
* ```ts
|
|
89
|
-
* const
|
|
90
|
-
* export const createUser =
|
|
122
|
+
* export const router = api.database(database);
|
|
123
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
91
124
|
* ```
|
|
92
125
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
126
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
127
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
128
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
129
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
130
|
+
*
|
|
131
|
+
* `dependsOn` is deliberately not here. It is per endpoint, and on the
|
|
132
|
+
* surface it would read as the API depending on something, which is what
|
|
133
|
+
* `.calls()` and `.auth()` say instead.
|
|
97
134
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
put(path) {
|
|
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
|
-
}
|
|
135
|
+
database;
|
|
136
|
+
session;
|
|
137
|
+
auditor;
|
|
138
|
+
actor;
|
|
139
|
+
authorizer;
|
|
140
|
+
authorize;
|
|
141
|
+
rls;
|
|
142
|
+
route;
|
|
118
143
|
/**
|
|
119
144
|
* What authenticates this surface.
|
|
120
145
|
*
|
|
@@ -124,13 +149,14 @@ var RestApi = class RestApi {
|
|
|
124
149
|
* what a request is allowed to be. A surface with two of the first is a
|
|
125
150
|
* mistake; two of the second is Tuesday.
|
|
126
151
|
*
|
|
127
|
-
* It
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
152
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
153
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
154
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
155
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
156
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
131
157
|
*/
|
|
132
158
|
auth(construct) {
|
|
133
|
-
return new RestApi(this.id, this.config, [...this.dependencies, edgeTo(construct)], construct
|
|
159
|
+
return new RestApi(this.id, this.config, [...this.dependencies, edgeTo(construct)], construct);
|
|
134
160
|
}
|
|
135
161
|
/**
|
|
136
162
|
* Other surfaces this one calls.
|
|
@@ -162,12 +188,11 @@ var RestApi = class RestApi {
|
|
|
162
188
|
return [{
|
|
163
189
|
kind: "rest-api",
|
|
164
190
|
id: this.id,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
},
|
|
191
|
+
path: this.config.path,
|
|
192
|
+
...this.config.subdomain ? { subdomain: this.config.subdomain } : {},
|
|
193
|
+
...this.config.telescope ? { telescope: true } : {},
|
|
169
194
|
...this.config.cors ? { cors: this.config.cors } : {},
|
|
170
|
-
...this.authenticator ? { auth: this.authenticator } : {},
|
|
195
|
+
...this.authenticator ? { auth: this.authenticator.id } : {},
|
|
171
196
|
endpoints: [],
|
|
172
197
|
...this.dependencies.length ? { calls: this.dependencies } : {},
|
|
173
198
|
...this.config.authorizers?.length ? { authorizers: this.config.authorizers } : {},
|
|
@@ -180,7 +205,7 @@ var RestApi = class RestApi {
|
|
|
180
205
|
}];
|
|
181
206
|
}
|
|
182
207
|
};
|
|
183
|
-
|
|
184
208
|
//#endregion
|
|
185
209
|
export { RestApi };
|
|
210
|
+
|
|
186
211
|
//# sourceMappingURL=rest-api.mjs.map
|