@geekmidas/constructs 10.0.0-alpha.5 → 10.0.0-alpha.50
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-B2OFsfDM.d.cts → Cron-DI3nKoic.d.cts} +22 -8
- package/dist/Cron-DI3nKoic.d.cts.map +1 -0
- package/dist/{Cron-CqEbBbwH.d.mts → Cron-uYAHPnp7.d.mts} +22 -8
- package/dist/Cron-uYAHPnp7.d.mts.map +1 -0
- package/dist/CronBuilder-BoHzlWU_.cjs +121 -0
- package/dist/CronBuilder-BoHzlWU_.cjs.map +1 -0
- package/dist/CronBuilder-CCgt0wCE.mjs +109 -0
- 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-Dem2XyCu.d.mts → Endpoint-BkzU6nn1.d.cts} +70 -93
- package/dist/Endpoint-BkzU6nn1.d.cts.map +1 -0
- package/dist/{Endpoint-DrD8a1yH.d.cts → Endpoint-BpboleFh.d.mts} +71 -94
- package/dist/Endpoint-BpboleFh.d.mts.map +1 -0
- package/dist/{Endpoint-Dij_wOcc.mjs → Endpoint-CQ9RJ7p2.mjs} +130 -109
- package/dist/Endpoint-CQ9RJ7p2.mjs.map +1 -0
- package/dist/{Endpoint-DODn1RhN.cjs → Endpoint-DOi8c_Gy.cjs} +158 -131
- package/dist/Endpoint-DOi8c_Gy.cjs.map +1 -0
- package/dist/{index-B8g8POkr.d.cts → EndpointFactory-BZZOleQT.d.cts} +62 -132
- package/dist/EndpointFactory-BZZOleQT.d.cts.map +1 -0
- package/dist/{EndpointFactory-BHFMmFkV.cjs → EndpointFactory-Bo9lkMqB.cjs} +75 -110
- package/dist/EndpointFactory-Bo9lkMqB.cjs.map +1 -0
- package/dist/{EndpointFactory-b4ituq-s.mjs → EndpointFactory-DR1rebok.mjs} +39 -74
- package/dist/EndpointFactory-DR1rebok.mjs.map +1 -0
- package/dist/{index-DbKmfl-q.d.mts → EndpointFactory-DnNlYflU.d.mts} +63 -133
- package/dist/EndpointFactory-DnNlYflU.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-BM2jbWht.mjs → HonoEndpointAdaptor-BIS0O3M9.mjs} +41 -47
- package/dist/HonoEndpointAdaptor-BIS0O3M9.mjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-De6IlBZe.cjs → HonoEndpointAdaptor-CMi0MJsF.cjs} +50 -53
- package/dist/HonoEndpointAdaptor-CMi0MJsF.cjs.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 +189 -110
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +81 -45
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +82 -46
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +161 -85
- 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 +704 -90
- 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 +669 -71
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-3OAmK42n.d.cts +188 -0
- package/dist/auth-3OAmK42n.d.cts.map +1 -0
- package/dist/auth-BWbiewHa.d.mts +188 -0
- package/dist/auth-BWbiewHa.d.mts.map +1 -0
- package/dist/auth.cjs +171 -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 +160 -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 +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/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 +2 -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-DJJA7VGc.cjs → functions-CbP5ZKma.cjs} +421 -273
- package/dist/functions-CbP5ZKma.cjs.map +1 -0
- package/dist/{functions-Ck21Uyq0.mjs → functions-Di6n5ltG.mjs} +383 -241
- package/dist/functions-Di6n5ltG.mjs.map +1 -0
- 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 +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +2 -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-Bqov3fwv.d.mts +159 -0
- package/dist/kysely-Bqov3fwv.d.mts.map +1 -0
- package/dist/kysely-DTnkZsub.d.cts +159 -0
- package/dist/kysely-DTnkZsub.d.cts.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 +87 -63
- package/dist/rest-api.cjs.map +1 -1
- package/dist/rest-api.d.cts +62 -61
- package/dist/rest-api.d.cts.map +1 -1
- package/dist/rest-api.d.mts +62 -61
- package/dist/rest-api.d.mts.map +1 -1
- package/dist/rest-api.mjs +79 -55
- 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 +3 -137
- package/dist/topic/index.d.cts +2 -32
- package/dist/topic/index.d.mts +2 -32
- 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 +137 -38
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +113 -44
- package/dist/worker.d.cts.map +1 -1
- package/dist/worker.d.mts +113 -43
- package/dist/worker.d.mts.map +1 -1
- package/dist/worker.mjs +132 -33
- package/dist/worker.mjs.map +1 -1
- package/package.json +81 -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-B2OFsfDM.d.cts.map +0 -1
- package/dist/Cron-CqEbBbwH.d.mts.map +0 -1
- package/dist/CronBuilder-Bg-9h2cc.d.mts +0 -44
- package/dist/CronBuilder-Bg-9h2cc.d.mts.map +0 -1
- package/dist/CronBuilder-CdibiHNB.mjs +0 -84
- package/dist/CronBuilder-CdibiHNB.mjs.map +0 -1
- package/dist/CronBuilder-DyUr6nYz.cjs +0 -96
- package/dist/CronBuilder-DyUr6nYz.cjs.map +0 -1
- package/dist/CronBuilder-LSJMfqnq.d.cts +0 -44
- package/dist/CronBuilder-LSJMfqnq.d.cts.map +0 -1
- package/dist/Endpoint-DODn1RhN.cjs.map +0 -1
- package/dist/Endpoint-Dem2XyCu.d.mts.map +0 -1
- package/dist/Endpoint-Dij_wOcc.mjs.map +0 -1
- package/dist/Endpoint-DrD8a1yH.d.cts.map +0 -1
- package/dist/EndpointFactory-BHFMmFkV.cjs.map +0 -1
- package/dist/EndpointFactory-b4ituq-s.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-BM2jbWht.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-De6IlBZe.cjs.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.d.cts.map +0 -1
- package/dist/database/kysely.d.mts.map +0 -1
- package/dist/functions-Ck21Uyq0.mjs.map +0 -1
- package/dist/functions-DJJA7VGc.cjs.map +0 -1
- package/dist/index-AIfVzkhi.d.cts +0 -170
- package/dist/index-AIfVzkhi.d.cts.map +0 -1
- package/dist/index-B8g8POkr.d.cts.map +0 -1
- package/dist/index-D3zjrwjr.d.mts +0 -169
- package/dist/index-D3zjrwjr.d.mts.map +0 -1
- package/dist/index-DbKmfl-q.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/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.cjs.map +0 -1
- package/dist/topic/index.d.cts.map +0 -1
- package/dist/topic/index.d.mts.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,26 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./types-BlAkSuGI.cjs";
|
|
5
|
-
import { BuiltInSecuritySchemeId } from "./Endpoint-DrD8a1yH.cjs";
|
|
6
|
-
import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-B8g8POkr.cjs";
|
|
1
|
+
import { i as Declarable, t as Authenticator } from "./construct-interface-B1AfqRl4.cjs";
|
|
2
|
+
import { T as BuiltInSecuritySchemeId } from "./Endpoint-BkzU6nn1.cjs";
|
|
3
|
+
import { t as EndpointFactory } from "./EndpointFactory-BZZOleQT.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
|
|
@@ -98,19 +87,21 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
|
98
87
|
/**
|
|
99
88
|
* What is *not* here, and why.
|
|
100
89
|
*
|
|
101
|
-
* `dependsOn`, `database`, `auditor` and `
|
|
90
|
+
* `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
|
|
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,44 @@ 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 authorizer: Endpoints['authorizer'];
|
|
175
|
+
readonly authorize: Endpoints['authorize'];
|
|
176
|
+
readonly rls: Endpoints['rls'];
|
|
177
|
+
readonly route: Endpoints['route'];
|
|
177
178
|
/**
|
|
178
179
|
* What authenticates this surface.
|
|
179
180
|
*
|
|
@@ -183,12 +184,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
183
184
|
* what a request is allowed to be. A surface with two of the first is a
|
|
184
185
|
* mistake; two of the second is Tuesday.
|
|
185
186
|
*
|
|
186
|
-
* It
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
187
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
188
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
189
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
190
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
191
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
190
192
|
*/
|
|
191
|
-
auth(construct:
|
|
193
|
+
auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
|
|
192
194
|
/**
|
|
193
195
|
* Other surfaces this one calls.
|
|
194
196
|
*
|
|
@@ -215,7 +217,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
215
217
|
*/
|
|
216
218
|
declare(): Declaration[];
|
|
217
219
|
}
|
|
218
|
-
//# sourceMappingURL=rest-api.d.ts.map
|
|
219
220
|
//#endregion
|
|
220
|
-
export {
|
|
221
|
+
export type { Authenticator };
|
|
221
222
|
//# 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;;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,26 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import { BuiltInSecuritySchemeId } from "./Endpoint-Dem2XyCu.mjs";
|
|
6
|
-
import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-DbKmfl-q.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-BpboleFh.mjs";
|
|
3
|
+
import { t as EndpointFactory } from "./EndpointFactory-DnNlYflU.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
|
|
@@ -98,19 +87,21 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
|
98
87
|
/**
|
|
99
88
|
* What is *not* here, and why.
|
|
100
89
|
*
|
|
101
|
-
* `dependsOn`, `database`, `auditor` and `
|
|
90
|
+
* `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
|
|
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,44 @@ 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 authorizer: Endpoints['authorizer'];
|
|
175
|
+
readonly authorize: Endpoints['authorize'];
|
|
176
|
+
readonly rls: Endpoints['rls'];
|
|
177
|
+
readonly route: Endpoints['route'];
|
|
177
178
|
/**
|
|
178
179
|
* What authenticates this surface.
|
|
179
180
|
*
|
|
@@ -183,12 +184,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
183
184
|
* what a request is allowed to be. A surface with two of the first is a
|
|
184
185
|
* mistake; two of the second is Tuesday.
|
|
185
186
|
*
|
|
186
|
-
* It
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
187
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
188
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
189
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
190
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
191
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
190
192
|
*/
|
|
191
|
-
auth(construct:
|
|
193
|
+
auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
|
|
192
194
|
/**
|
|
193
195
|
* Other surfaces this one calls.
|
|
194
196
|
*
|
|
@@ -215,7 +217,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
215
217
|
*/
|
|
216
218
|
declare(): Declaration[];
|
|
217
219
|
}
|
|
218
|
-
//# sourceMappingURL=rest-api.d.ts.map
|
|
219
220
|
//#endregion
|
|
220
|
-
export {
|
|
221
|
+
export type { Authenticator };
|
|
221
222
|
//# 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;;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-b4ituq-s.mjs";
|
|
5
|
-
import "./clone-DblgEZZa.mjs";
|
|
6
|
-
import "./Endpoint-Dij_wOcc.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,10 @@ var RestApi = class RestApi {
|
|
|
162
188
|
return [{
|
|
163
189
|
kind: "rest-api",
|
|
164
190
|
id: this.id,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
...this.config.telescope ? { telescope: true } : {}
|
|
168
|
-
},
|
|
191
|
+
path: this.config.path,
|
|
192
|
+
...this.config.telescope ? { telescope: true } : {},
|
|
169
193
|
...this.config.cors ? { cors: this.config.cors } : {},
|
|
170
|
-
...this.authenticator ? { auth: this.authenticator } : {},
|
|
194
|
+
...this.authenticator ? { auth: this.authenticator.id } : {},
|
|
171
195
|
endpoints: [],
|
|
172
196
|
...this.dependencies.length ? { calls: this.dependencies } : {},
|
|
173
197
|
...this.config.authorizers?.length ? { authorizers: this.config.authorizers } : {},
|
|
@@ -180,7 +204,7 @@ var RestApi = class RestApi {
|
|
|
180
204
|
}];
|
|
181
205
|
}
|
|
182
206
|
};
|
|
183
|
-
|
|
184
207
|
//#endregion
|
|
185
208
|
export { RestApi };
|
|
209
|
+
|
|
186
210
|
//# sourceMappingURL=rest-api.mjs.map
|