@geekmidas/constructs 10.0.0-alpha.11 → 10.0.0-alpha.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +222 -158
- package/dist/Construct-BQALFCh2.d.cts +230 -0
- package/dist/Construct-BQALFCh2.d.cts.map +1 -0
- package/dist/{Construct-BD5neF7w.mjs → Construct-CKUA-CTA.mjs} +35 -35
- package/dist/Construct-CKUA-CTA.mjs.map +1 -0
- package/dist/{Construct-CyS3RpTL.cjs → Construct-DEOVauyA.cjs} +55 -49
- package/dist/Construct-DEOVauyA.cjs.map +1 -0
- package/dist/Construct-QXnl3VqT.d.mts +230 -0
- package/dist/Construct-QXnl3VqT.d.mts.map +1 -0
- package/dist/{Cron-DmQ8vQ4b.d.cts → Cron-CQJqqkhY.d.mts} +17 -11
- package/dist/Cron-CQJqqkhY.d.mts.map +1 -0
- package/dist/{Cron-dh4rUgib.d.mts → Cron-DI3nKoic.d.cts} +17 -11
- package/dist/Cron-DI3nKoic.d.cts.map +1 -0
- package/dist/{CronBuilder-Da0C0edR.cjs → CronBuilder-BXTG10u5.cjs} +47 -31
- package/dist/CronBuilder-BXTG10u5.cjs.map +1 -0
- package/dist/{CronBuilder-CYKT5RiO.mjs → CronBuilder-D3sF9tS_.mjs} +37 -21
- package/dist/CronBuilder-D3sF9tS_.mjs.map +1 -0
- package/dist/CronBuilder-Xx_zakuc.d.mts +47 -0
- package/dist/CronBuilder-Xx_zakuc.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-BWyKCa2x.d.cts} +130 -100
- package/dist/Endpoint-BWyKCa2x.d.cts.map +1 -0
- package/dist/{Endpoint-dav89W6-.d.cts → Endpoint-CrE9Ppdk.d.mts} +130 -100
- package/dist/Endpoint-CrE9Ppdk.d.mts.map +1 -0
- package/dist/{Endpoint-DCQPMdUX.mjs → Endpoint-gPXhHKhJ.mjs} +208 -100
- package/dist/Endpoint-gPXhHKhJ.mjs.map +1 -0
- package/dist/{Endpoint-DcWXE-SZ.cjs → Endpoint-yhR2T2Wt.cjs} +248 -122
- package/dist/Endpoint-yhR2T2Wt.cjs.map +1 -0
- package/dist/{index-lAO9egTb.d.mts → EndpointFactory-BV-nfnaP.d.mts} +85 -136
- package/dist/EndpointFactory-BV-nfnaP.d.mts.map +1 -0
- package/dist/{EndpointFactory-CdWB7wPw.cjs → EndpointFactory-BVv6EIDu.cjs} +98 -112
- package/dist/EndpointFactory-BVv6EIDu.cjs.map +1 -0
- package/dist/{index-Bd5FqCoe.d.cts → EndpointFactory-C1-IBwm4.d.cts} +84 -135
- package/dist/EndpointFactory-C1-IBwm4.d.cts.map +1 -0
- package/dist/{EndpointFactory-CjV8F_lJ.mjs → EndpointFactory-Cs8IHvwF.mjs} +62 -76
- package/dist/EndpointFactory-Cs8IHvwF.mjs.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-CN1jjUBJ.cjs} +115 -71
- package/dist/HonoEndpointAdaptor-CN1jjUBJ.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-P1ahhZHu.mjs → HonoEndpointAdaptor-euH1oSdY.mjs} +105 -64
- package/dist/HonoEndpointAdaptor-euH1oSdY.mjs.map +1 -0
- package/dist/Queue-BhuofM3k.cjs +109 -0
- package/dist/Queue-BhuofM3k.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-cmhqEBOB.mjs +104 -0
- package/dist/Queue-cmhqEBOB.mjs.map +1 -0
- package/dist/QueueBuilder-Cx9lKC5d.d.mts +75 -0
- package/dist/QueueBuilder-Cx9lKC5d.d.mts.map +1 -0
- package/dist/QueueBuilder-DXu1qxT1.mjs +118 -0
- package/dist/QueueBuilder-DXu1qxT1.mjs.map +1 -0
- package/dist/QueueBuilder-DdU2klPu.cjs +135 -0
- package/dist/QueueBuilder-DdU2klPu.cjs.map +1 -0
- package/dist/QueueBuilder-OSi6LkV9.d.cts +75 -0
- package/dist/QueueBuilder-OSi6LkV9.d.cts.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-4DWe9feX.d.mts +67 -0
- package/dist/SubscriberBuilder-4DWe9feX.d.mts.map +1 -0
- package/dist/{SubscriberBuilder-BjkbeT9l.mjs → SubscriberBuilder-DRXfxWn_.mjs} +50 -24
- package/dist/SubscriberBuilder-DRXfxWn_.mjs.map +1 -0
- package/dist/{SubscriberBuilder-4OPehf2R.cjs → SubscriberBuilder-M2EAgQhC.cjs} +61 -36
- package/dist/SubscriberBuilder-M2EAgQhC.cjs.map +1 -0
- package/dist/SubscriberBuilder-g3fAVWgs.d.cts +67 -0
- package/dist/SubscriberBuilder-g3fAVWgs.d.cts.map +1 -0
- package/dist/Topic-D2R0r24C.mjs +99 -0
- package/dist/Topic-D2R0r24C.mjs.map +1 -0
- package/dist/Topic-DwS3QO0m.cjs +104 -0
- package/dist/Topic-DwS3QO0m.cjs.map +1 -0
- package/dist/adaptors/aws.cjs +200 -246
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +58 -62
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +59 -63
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +171 -219
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/hono.cjs +3 -10
- package/dist/adaptors/hono.d.cts +7 -16
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +9 -18
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +2 -10
- package/dist/adaptors/testing.cjs +765 -99
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +351 -54
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +351 -54
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +726 -78
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-BMCJN30Y.d.cts +268 -0
- package/dist/auth-BMCJN30Y.d.cts.map +1 -0
- package/dist/auth-D_0788uW.d.mts +268 -0
- package/dist/auth-D_0788uW.d.mts.map +1 -0
- package/dist/auth.cjs +301 -33
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +2 -108
- package/dist/auth.d.mts +2 -108
- package/dist/auth.mjs +289 -27
- package/dist/auth.mjs.map +1 -1
- package/dist/{cache-BrRz3fEB.d.mts → cache-5QZzh5Er.d.mts} +3 -6
- package/dist/cache-5QZzh5Er.d.mts.map +1 -0
- package/dist/{cache-BtZY_tHe.d.cts → cache-DnGDGly3.d.cts} +3 -6
- package/dist/cache-DnGDGly3.d.cts.map +1 -0
- package/dist/cache.cjs +68 -2
- package/dist/cache.cjs.map +1 -0
- package/dist/cache.d.cts +1 -2
- package/dist/cache.d.mts +1 -2
- package/dist/cache.mjs +67 -2
- package/dist/cache.mjs.map +1 -0
- package/dist/cipher-C1lEFX63.mjs +225 -0
- package/dist/cipher-C1lEFX63.mjs.map +1 -0
- package/dist/cipher-CVxfwLjk.cjs +332 -0
- package/dist/cipher-CVxfwLjk.cjs.map +1 -0
- package/dist/{clone-DblgEZZa.mjs → clone-EKNovYHu.mjs} +3 -3
- package/dist/clone-EKNovYHu.mjs.map +1 -0
- package/dist/{clone-Dy0cR2SZ.cjs → clone-UGJpvQnL.cjs} +7 -8
- package/dist/clone-UGJpvQnL.cjs.map +1 -0
- package/dist/{construct-interface-D9d4Gm4p.d.cts → construct-interface-B1AfqRl4.d.cts} +42 -11
- package/dist/construct-interface-B1AfqRl4.d.cts.map +1 -0
- package/dist/{construct-interface-g5GM5pwR.d.mts → construct-interface-ZvYQbivO.d.mts} +42 -11
- package/dist/construct-interface-ZvYQbivO.d.mts.map +1 -0
- package/dist/construct-interface.cjs +113 -7
- package/dist/construct-interface.cjs.map +1 -0
- package/dist/construct-interface.d.cts +2 -2
- package/dist/construct-interface.d.mts +2 -2
- package/dist/construct-interface.mjs +106 -2
- package/dist/construct-interface.mjs.map +1 -0
- package/dist/credential-DYymbp_7.cjs +257 -0
- package/dist/credential-DYymbp_7.cjs.map +1 -0
- package/dist/credential-DfSAOOdY.mjs +222 -0
- package/dist/credential-DfSAOOdY.mjs.map +1 -0
- package/dist/credential.cjs +8 -96
- package/dist/credential.d.cts +2 -61
- package/dist/credential.d.mts +2 -61
- package/dist/credential.mjs +2 -94
- package/dist/crons/index.cjs +129 -7
- package/dist/crons/index.cjs.map +1 -1
- package/dist/crons/index.d.cts +45 -11
- package/dist/crons/index.d.cts.map +1 -1
- package/dist/crons/index.d.mts +45 -11
- package/dist/crons/index.d.mts.map +1 -1
- package/dist/crons/index.mjs +127 -8
- package/dist/crons/index.mjs.map +1 -1
- package/dist/database/kysely.cjs +4 -181
- package/dist/database/kysely.d.cts +2 -152
- package/dist/database/kysely.d.mts +2 -152
- package/dist/database/kysely.mjs +2 -180
- package/dist/email.cjs +25 -12
- package/dist/email.cjs.map +1 -1
- package/dist/email.d.cts +3 -7
- package/dist/email.d.cts.map +1 -1
- package/dist/email.d.mts +4 -8
- package/dist/email.d.mts.map +1 -1
- package/dist/email.mjs +16 -3
- package/dist/email.mjs.map +1 -1
- package/dist/encryption.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 +20 -16
- package/dist/endpoints/index.d.cts +105 -7
- package/dist/endpoints/index.d.cts.map +1 -0
- package/dist/endpoints/index.d.mts +105 -7
- package/dist/endpoints/index.d.mts.map +1 -0
- package/dist/endpoints/index.mjs +6 -10
- package/dist/external-api.cjs +106 -0
- package/dist/external-api.cjs.map +1 -0
- package/dist/external-api.d.cts +2 -0
- package/dist/external-api.d.mts +2 -0
- package/dist/external-api.mjs +103 -0
- package/dist/external-api.mjs.map +1 -0
- package/dist/fake-DqKo8INJ.d.mts +201 -0
- package/dist/fake-DqKo8INJ.d.mts.map +1 -0
- package/dist/fake-Dvion_Fh.d.cts +201 -0
- package/dist/fake-Dvion_Fh.d.cts.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-14lpEFL4.mjs → functions-CTI-hDem.mjs} +376 -238
- package/dist/{functions-14lpEFL4.mjs.map → functions-CTI-hDem.mjs.map} +1 -1
- package/dist/{functions-i_la-N5r.cjs → functions-D7O5SGVc.cjs} +414 -264
- package/dist/functions-D7O5SGVc.cjs.map +1 -0
- package/dist/index-B13kQB_U.d.mts +115 -0
- package/dist/index-B13kQB_U.d.mts.map +1 -0
- package/dist/index-BuzRvKOQ.d.cts +115 -0
- package/dist/index-BuzRvKOQ.d.cts.map +1 -0
- package/dist/index-CeEtxDmK.d.cts +79 -0
- package/dist/index-CeEtxDmK.d.cts.map +1 -0
- package/dist/index-CeEtxDmK.d.mts +79 -0
- package/dist/index-CeEtxDmK.d.mts.map +1 -0
- package/dist/index.cjs +6 -3
- package/dist/index.d.cts +27 -4
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +27 -4
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -3
- package/dist/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-B3zfg9ti.cjs +383 -0
- package/dist/kysely-B3zfg9ti.cjs.map +1 -0
- package/dist/kysely-B_0BAr0T.mjs +370 -0
- package/dist/kysely-B_0BAr0T.mjs.map +1 -0
- package/dist/kysely-D0bpzgPs.d.cts +175 -0
- package/dist/kysely-D0bpzgPs.d.cts.map +1 -0
- package/dist/kysely-DKwnl0nf.d.mts +175 -0
- package/dist/kysely-DKwnl0nf.d.mts.map +1 -0
- package/dist/{telemetry-C3L0iS28.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +3 -6
- package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
- package/dist/{telemetry-D7bVFLGi.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +3 -6
- package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
- package/dist/mobile-app.cjs +74 -0
- package/dist/mobile-app.cjs.map +1 -0
- package/dist/mobile-app.d.cts +73 -0
- package/dist/mobile-app.d.cts.map +1 -0
- package/dist/mobile-app.d.mts +73 -0
- package/dist/mobile-app.d.mts.map +1 -0
- package/dist/mobile-app.mjs +73 -0
- package/dist/mobile-app.mjs.map +1 -0
- package/dist/object-storage.cjs +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/queue/index.cjs +6 -189
- package/dist/queue/index.d.cts +3 -60
- package/dist/queue/index.d.mts +3 -60
- package/dist/queue/index.mjs +3 -186
- package/dist/random-password.cjs +86 -0
- package/dist/random-password.cjs.map +1 -0
- package/dist/random-password.d.cts +30 -0
- package/dist/random-password.d.cts.map +1 -0
- package/dist/random-password.d.mts +30 -0
- package/dist/random-password.d.mts.map +1 -0
- package/dist/random-password.mjs +84 -0
- package/dist/random-password.mjs.map +1 -0
- package/dist/{lazyAccessors-BoJN3SMd.mjs → readRequestBody-BTIl3k-D.mjs} +117 -60
- package/dist/readRequestBody-BTIl3k-D.mjs.map +1 -0
- package/dist/readRequestBody-Dej_L3c4.cjs +342 -0
- package/dist/readRequestBody-Dej_L3c4.cjs.map +1 -0
- package/dist/requestLogger-BZcXwdBs.cjs +207 -0
- package/dist/requestLogger-BZcXwdBs.cjs.map +1 -0
- package/dist/requestLogger-pA4gi3E1.mjs +178 -0
- package/dist/requestLogger-pA4gi3E1.mjs.map +1 -0
- package/dist/rest-api.cjs +90 -59
- package/dist/rest-api.cjs.map +1 -1
- package/dist/rest-api.d.cts +70 -42
- package/dist/rest-api.d.cts.map +1 -1
- package/dist/rest-api.d.mts +70 -42
- package/dist/rest-api.d.mts.map +1 -1
- package/dist/rest-api.mjs +82 -51
- package/dist/rest-api.mjs.map +1 -1
- package/dist/{chunk-DWy1uDak.cjs → rolldown-runtime-y5ARvAq5.cjs} +14 -18
- package/dist/runSubscriber-BHvJ8POr.mjs +109 -0
- package/dist/runSubscriber-BHvJ8POr.mjs.map +1 -0
- package/dist/runSubscriber-D8nLXIv1.cjs +126 -0
- package/dist/runSubscriber-D8nLXIv1.cjs.map +1 -0
- package/dist/shutdown-BMJmAhSt.cjs +38 -0
- package/dist/shutdown-BMJmAhSt.cjs.map +1 -0
- package/dist/shutdown-C7xa8x9S.mjs +27 -0
- package/dist/shutdown-C7xa8x9S.mjs.map +1 -0
- package/dist/site.cjs +33 -7
- package/dist/site.cjs.map +1 -1
- package/dist/site.d.cts +17 -7
- package/dist/site.d.cts.map +1 -1
- package/dist/site.d.mts +17 -7
- package/dist/site.d.mts.map +1 -1
- package/dist/site.mjs +29 -3
- package/dist/site.mjs.map +1 -1
- package/dist/stages-BSCF19o2.d.cts +56 -0
- package/dist/stages-BSCF19o2.d.cts.map +1 -0
- package/dist/stages-BSCF19o2.d.mts +56 -0
- package/dist/stages-BSCF19o2.d.mts.map +1 -0
- package/dist/subscribers/index.cjs +118 -6
- package/dist/subscribers/index.cjs.map +1 -0
- package/dist/subscribers/index.d.cts +51 -6
- package/dist/subscribers/index.d.cts.map +1 -0
- package/dist/subscribers/index.d.mts +51 -6
- package/dist/subscribers/index.d.mts.map +1 -0
- package/dist/subscribers/index.mjs +115 -5
- package/dist/subscribers/index.mjs.map +1 -0
- package/dist/surfaceEnv-CNimK76p.cjs +56 -0
- package/dist/surfaceEnv-CNimK76p.cjs.map +1 -0
- package/dist/surfaceEnv-wMT5QzgZ.mjs +45 -0
- package/dist/surfaceEnv-wMT5QzgZ.mjs.map +1 -0
- package/dist/telemetry-B48RLjyk.d.cts +40 -0
- package/dist/telemetry-B48RLjyk.d.cts.map +1 -0
- package/dist/telemetry-BEoBn6GO.d.mts +40 -0
- package/dist/telemetry-BEoBn6GO.d.mts.map +1 -0
- package/dist/telemetry.cjs +56 -0
- package/dist/telemetry.cjs.map +1 -0
- package/dist/telemetry.d.cts +2 -0
- package/dist/telemetry.d.mts +2 -0
- package/dist/telemetry.mjs +55 -0
- package/dist/telemetry.mjs.map +1 -0
- package/dist/topic/index.cjs +3 -137
- package/dist/topic/index.d.cts +2 -4
- package/dist/topic/index.d.mts +2 -4
- package/dist/topic/index.mjs +2 -134
- package/dist/tracing-Bbj1uoFJ.mjs +127 -0
- package/dist/tracing-Bbj1uoFJ.mjs.map +1 -0
- package/dist/tracing-C0ooU0V2.cjs +150 -0
- package/dist/tracing-C0ooU0V2.cjs.map +1 -0
- package/dist/{types-BlAkSuGI.d.cts → types-DMuSQeLL.d.cts} +3 -5
- package/dist/types-DMuSQeLL.d.cts.map +1 -0
- package/dist/{types-aKksMEWL.d.mts → types-DMuSQeLL.d.mts} +3 -5
- package/dist/types-DMuSQeLL.d.mts.map +1 -0
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.mjs +1 -0
- package/dist/worker.cjs +59 -34
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +70 -45
- package/dist/worker.d.cts.map +1 -1
- package/dist/worker.d.mts +71 -46
- package/dist/worker.d.mts.map +1 -1
- package/dist/worker.mjs +54 -29
- package/dist/worker.mjs.map +1 -1
- package/package.json +106 -42
- package/dist/Construct-BD5neF7w.mjs.map +0 -1
- package/dist/Construct-C0ijr2qp.d.cts +0 -117
- package/dist/Construct-C0ijr2qp.d.cts.map +0 -1
- package/dist/Construct-Ct8nalEi.d.mts +0 -117
- package/dist/Construct-Ct8nalEi.d.mts.map +0 -1
- package/dist/Construct-CyS3RpTL.cjs.map +0 -1
- package/dist/Cron-DmQ8vQ4b.d.cts.map +0 -1
- package/dist/Cron-dh4rUgib.d.mts.map +0 -1
- package/dist/CronBuilder-BquXDbDI.d.cts +0 -44
- package/dist/CronBuilder-BquXDbDI.d.cts.map +0 -1
- package/dist/CronBuilder-CGgY2080.d.mts +0 -44
- package/dist/CronBuilder-CGgY2080.d.mts.map +0 -1
- package/dist/CronBuilder-CYKT5RiO.mjs.map +0 -1
- package/dist/CronBuilder-Da0C0edR.cjs.map +0 -1
- package/dist/Endpoint-BjWKinFA.d.mts.map +0 -1
- package/dist/Endpoint-DCQPMdUX.mjs.map +0 -1
- package/dist/Endpoint-DcWXE-SZ.cjs.map +0 -1
- package/dist/Endpoint-dav89W6-.d.cts.map +0 -1
- package/dist/EndpointFactory-CdWB7wPw.cjs.map +0 -1
- package/dist/EndpointFactory-CjV8F_lJ.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-DtL9j19R.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-P1ahhZHu.mjs.map +0 -1
- package/dist/Queue-D7ZuwBhy.d.cts.map +0 -1
- package/dist/Queue-gVGfi2Yk.d.mts.map +0 -1
- package/dist/Subscriber-2mEi0ImH.d.cts.map +0 -1
- package/dist/Subscriber-xTJ9ayPN.d.mts.map +0 -1
- package/dist/SubscriberBuilder-4OPehf2R.cjs.map +0 -1
- package/dist/SubscriberBuilder-BjkbeT9l.mjs.map +0 -1
- package/dist/SubscriberBuilder-Dptmo-1A.d.mts +0 -62
- package/dist/SubscriberBuilder-Dptmo-1A.d.mts.map +0 -1
- package/dist/SubscriberBuilder-waNhzjSM.d.cts +0 -62
- package/dist/SubscriberBuilder-waNhzjSM.d.cts.map +0 -1
- package/dist/Topic-19QeHBIR.d.cts +0 -91
- package/dist/Topic-19QeHBIR.d.cts.map +0 -1
- package/dist/Topic-DuFeqkBh.d.mts +0 -91
- package/dist/Topic-DuFeqkBh.d.mts.map +0 -1
- package/dist/auth.d.cts.map +0 -1
- package/dist/auth.d.mts.map +0 -1
- package/dist/cache-0ANvRQnD.mjs +0 -51
- package/dist/cache-0ANvRQnD.mjs.map +0 -1
- package/dist/cache-3WSvAulx.cjs +0 -57
- package/dist/cache-3WSvAulx.cjs.map +0 -1
- package/dist/cache-BrRz3fEB.d.mts.map +0 -1
- package/dist/cache-BtZY_tHe.d.cts.map +0 -1
- package/dist/clone-DblgEZZa.mjs.map +0 -1
- package/dist/clone-Dy0cR2SZ.cjs.map +0 -1
- package/dist/construct-interface-BfjcOD_E.cjs +0 -117
- package/dist/construct-interface-BfjcOD_E.cjs.map +0 -1
- package/dist/construct-interface-D9d4Gm4p.d.cts.map +0 -1
- package/dist/construct-interface-Z4CpS8tK.mjs +0 -81
- package/dist/construct-interface-Z4CpS8tK.mjs.map +0 -1
- package/dist/construct-interface-g5GM5pwR.d.mts.map +0 -1
- package/dist/credential.cjs.map +0 -1
- package/dist/credential.d.cts.map +0 -1
- package/dist/credential.d.mts.map +0 -1
- package/dist/credential.mjs.map +0 -1
- package/dist/database/kysely.cjs.map +0 -1
- package/dist/database/kysely.d.cts.map +0 -1
- package/dist/database/kysely.d.mts.map +0 -1
- package/dist/database/kysely.mjs.map +0 -1
- package/dist/functions-i_la-N5r.cjs.map +0 -1
- package/dist/index-Bd5FqCoe.d.cts.map +0 -1
- package/dist/index-BknhM6Ux.d.mts +0 -31
- package/dist/index-BknhM6Ux.d.mts.map +0 -1
- package/dist/index-CBSfrowv.d.cts +0 -31
- package/dist/index-CBSfrowv.d.cts.map +0 -1
- package/dist/index-D24Xm79M.d.cts +0 -171
- package/dist/index-D24Xm79M.d.cts.map +0 -1
- package/dist/index-_ajboYxK.d.mts +0 -171
- package/dist/index-_ajboYxK.d.mts.map +0 -1
- package/dist/index-lAO9egTb.d.mts.map +0 -1
- package/dist/lazyAccessors-BoJN3SMd.mjs.map +0 -1
- package/dist/lazyAccessors-e3j2oE2m.cjs +0 -274
- package/dist/lazyAccessors-e3j2oE2m.cjs.map +0 -1
- package/dist/processAudits-CGqttuXm.cjs +0 -92
- package/dist/processAudits-CGqttuXm.cjs.map +0 -1
- package/dist/processAudits-Dmts9H_b.mjs +0 -80
- package/dist/processAudits-Dmts9H_b.mjs.map +0 -1
- package/dist/queue/index.cjs.map +0 -1
- package/dist/queue/index.d.cts.map +0 -1
- package/dist/queue/index.d.mts.map +0 -1
- package/dist/queue/index.mjs.map +0 -1
- package/dist/surfaceEnv-BFXEms2f.cjs +0 -39
- package/dist/surfaceEnv-BFXEms2f.cjs.map +0 -1
- package/dist/surfaceEnv-C3Ktahea.mjs +0 -27
- package/dist/surfaceEnv-C3Ktahea.mjs.map +0 -1
- package/dist/telemetry-C3L0iS28.d.cts.map +0 -1
- package/dist/telemetry-D7bVFLGi.d.mts.map +0 -1
- package/dist/topic/index.cjs.map +0 -1
- package/dist/topic/index.mjs.map +0 -1
- package/dist/types-BlAkSuGI.d.cts.map +0 -1
- package/dist/types-aKksMEWL.d.mts.map +0 -1
package/dist/rest-api.d.cts
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
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 { n as Telemetry } from "./telemetry-B48RLjyk.cjs";
|
|
3
|
+
import { D as BuiltInSecuritySchemeId } from "./Endpoint-BWyKCa2x.cjs";
|
|
4
|
+
import { t as EndpointFactory } from "./EndpointFactory-C1-IBwm4.cjs";
|
|
7
5
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
8
6
|
import { Logger } from "@geekmidas/logger";
|
|
9
7
|
import { ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
|
|
10
8
|
import { Telescope } from "@geekmidas/telescope";
|
|
11
|
-
|
|
12
9
|
//#region src/rest-api.d.ts
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
/** The factory a surface builds its endpoints from. */
|
|
11
|
+
type Endpoints = EndpointFactory<[], '', Logger>;
|
|
12
|
+
export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
15
13
|
/**
|
|
16
14
|
* The app that serves this surface, relative to the workspace root —
|
|
17
15
|
* `'apps/api'`, or `'.'` in a single-app project.
|
|
@@ -24,6 +22,12 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
|
24
22
|
* `constructs` glob.
|
|
25
23
|
*/
|
|
26
24
|
path: string;
|
|
25
|
+
/**
|
|
26
|
+
* The label it answers on under a stage's domain — `api` for
|
|
27
|
+
* `api.myapp.com`, from `domains` — and under the project locally,
|
|
28
|
+
* `api.myapp.localhost`. Absent, its id kebab-cased.
|
|
29
|
+
*/
|
|
30
|
+
subdomain?: string;
|
|
27
31
|
/**
|
|
28
32
|
* CORS tunables. The *origins* are never here — they are read off the
|
|
29
33
|
* constructs that declared an edge to this surface, which is the whole point
|
|
@@ -86,23 +90,35 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
|
86
90
|
* printed an import for. The entry already imports the surface.
|
|
87
91
|
*/
|
|
88
92
|
telescope?: Telescope;
|
|
93
|
+
/**
|
|
94
|
+
* What this surface's process emits — the `Telemetry` construct, passed
|
|
95
|
+
* like the logger: a fact about the process, not a grant to a route.
|
|
96
|
+
*
|
|
97
|
+
* An edge to the node, so the deploy hands this process the `OTEL_*` keys
|
|
98
|
+
* its stage resolves, and the build fails without the OpenTelemetry
|
|
99
|
+
* packages. Where the telemetry goes is never here: it is the deploy's,
|
|
100
|
+
* per stage.
|
|
101
|
+
*/
|
|
102
|
+
telemetry?: Telemetry;
|
|
89
103
|
}
|
|
90
104
|
/**
|
|
91
105
|
* What is *not* here, and why.
|
|
92
106
|
*
|
|
93
|
-
* `dependsOn`, `database`, `auditor` and `
|
|
107
|
+
* `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
|
|
94
108
|
* into a handler. Putting one on the surface hands it to every route the
|
|
95
109
|
* surface serves — a health check gets the database because a report needed it
|
|
96
110
|
* — which is the thing least privilege forbids and the reason `.calls()` is not
|
|
97
|
-
* spelled `dependsOn`. They belong to the endpoint, or to a
|
|
98
|
-
*
|
|
111
|
+
* spelled `dependsOn`. They belong to the endpoint, or to a branch —
|
|
112
|
+
* `api.database(db)` — for a group of endpoints that genuinely share them. A
|
|
113
|
+
* branch is a new factory; the surface config stays free of grants.
|
|
99
114
|
*
|
|
100
115
|
* `auth` is not here either: `.auth(construct)` already declares it, and a
|
|
101
116
|
* second way to say the same thing is the duplication this whole model removes.
|
|
102
117
|
*
|
|
103
118
|
* What is left is what the *process* is rather than what a route may reach.
|
|
104
119
|
*/
|
|
105
|
-
declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
120
|
+
export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
121
|
+
#private;
|
|
106
122
|
private readonly config;
|
|
107
123
|
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
108
124
|
private readonly dependencies;
|
|
@@ -138,34 +154,46 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
138
154
|
readonly envParser: EnvironmentParser<{}>;
|
|
139
155
|
/** The Telescope instance, when this surface was given one. */
|
|
140
156
|
readonly telescope?: Telescope;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
157
|
+
/** What this surface's process emits, when it was given a `Telemetry`. */
|
|
158
|
+
readonly telemetry?: Telemetry;
|
|
159
|
+
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
160
|
+
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
161
|
+
dependencies?: readonly Dependency[],
|
|
162
|
+
/** Internal: how `.auth()` carries the authenticator into its copy. */
|
|
163
|
+
authenticator?: Authenticator | undefined);
|
|
164
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
165
|
+
readonly get: Endpoints['get'];
|
|
166
|
+
readonly post: Endpoints['post'];
|
|
167
|
+
readonly put: Endpoints['put'];
|
|
168
|
+
readonly patch: Endpoints['patch'];
|
|
169
|
+
readonly delete: Endpoints['delete'];
|
|
170
|
+
readonly options: Endpoints['options'];
|
|
144
171
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* `api.get('/users')` is the short form and covers most routes. Reach for
|
|
148
|
-
* this one when a *group* of endpoints shares something a single route would
|
|
149
|
-
* otherwise repeat — a database, an auditor, a publisher:
|
|
172
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
173
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
150
174
|
*
|
|
151
175
|
* ```ts
|
|
152
|
-
* const
|
|
153
|
-
* export const createUser =
|
|
176
|
+
* export const router = api.database(database);
|
|
177
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
154
178
|
* ```
|
|
155
179
|
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
180
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
181
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
182
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
183
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
184
|
+
*
|
|
185
|
+
* `dependsOn` is deliberately not here. It is per endpoint, and on the
|
|
186
|
+
* surface it would read as the API depending on something, which is what
|
|
187
|
+
* `.calls()` and `.auth()` say instead.
|
|
160
188
|
*/
|
|
161
|
-
readonly
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
189
|
+
readonly database: Endpoints['database'];
|
|
190
|
+
readonly session: Endpoints['session'];
|
|
191
|
+
readonly auditor: Endpoints['auditor'];
|
|
192
|
+
readonly actor: Endpoints['actor'];
|
|
193
|
+
readonly authorizer: Endpoints['authorizer'];
|
|
194
|
+
readonly authorize: Endpoints['authorize'];
|
|
195
|
+
readonly rls: Endpoints['rls'];
|
|
196
|
+
readonly route: Endpoints['route'];
|
|
169
197
|
/**
|
|
170
198
|
* What authenticates this surface.
|
|
171
199
|
*
|
|
@@ -175,12 +203,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
175
203
|
* what a request is allowed to be. A surface with two of the first is a
|
|
176
204
|
* mistake; two of the second is Tuesday.
|
|
177
205
|
*
|
|
178
|
-
* It
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
206
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
207
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
208
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
209
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
210
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
182
211
|
*/
|
|
183
|
-
auth(construct:
|
|
212
|
+
auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
|
|
184
213
|
/**
|
|
185
214
|
* Other surfaces this one calls.
|
|
186
215
|
*
|
|
@@ -207,7 +236,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
207
236
|
*/
|
|
208
237
|
declare(): Declaration[];
|
|
209
238
|
}
|
|
210
|
-
//# sourceMappingURL=rest-api.d.ts.map
|
|
211
239
|
//#endregion
|
|
212
|
-
export {
|
|
240
|
+
export type { Authenticator };
|
|
213
241
|
//# 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":";;;;;;;;;;KAmDK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;EAUZ,YAAY;;;;;;;;;;;;;;;;;;qBAoBA,QACZ,qCACM,iEACM,WAAW;;mBA0CL;;mBAEA;;mBAEA;WA5CT,IAAI;;;;;;WAOJ;IACR;IACA;IACA;;;;;;;;;WAUQ,QAAQ;;;;;;;;;WAUR,WAAW;;WAGX,YAAY;;WAGZ,YAAY;EAErB,YACC,IAAI,cAAc,QACD,QAAQ,cAAc,eAEtB;;EAAA,wBAAuB,cAEvB;;EAAA,gBAAgB;;WAyEzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;;WAoBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,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,17 +1,15 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import { BuiltInSecuritySchemeId } from "./Endpoint-BjWKinFA.mjs";
|
|
6
|
-
import { EndpointBuilder, EndpointFactory, RemoveTrailingSlash } from "./index-lAO9egTb.mjs";
|
|
1
|
+
import { i as Declarable, t as Authenticator } from "./construct-interface-ZvYQbivO.mjs";
|
|
2
|
+
import { n as Telemetry } from "./telemetry-BEoBn6GO.mjs";
|
|
3
|
+
import { D as BuiltInSecuritySchemeId } from "./Endpoint-CrE9Ppdk.mjs";
|
|
4
|
+
import { t as EndpointFactory } from "./EndpointFactory-BV-nfnaP.mjs";
|
|
7
5
|
import { ConstructName, Declaration, Dependency } from "@geekmidas/manifest";
|
|
8
6
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
9
7
|
import { Logger } from "@geekmidas/logger";
|
|
10
8
|
import { Telescope } from "@geekmidas/telescope";
|
|
11
|
-
|
|
12
9
|
//#region src/rest-api.d.ts
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
/** The factory a surface builds its endpoints from. */
|
|
11
|
+
type Endpoints = EndpointFactory<[], '', Logger>;
|
|
12
|
+
export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
15
13
|
/**
|
|
16
14
|
* The app that serves this surface, relative to the workspace root —
|
|
17
15
|
* `'apps/api'`, or `'.'` in a single-app project.
|
|
@@ -24,6 +22,12 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
|
24
22
|
* `constructs` glob.
|
|
25
23
|
*/
|
|
26
24
|
path: string;
|
|
25
|
+
/**
|
|
26
|
+
* The label it answers on under a stage's domain — `api` for
|
|
27
|
+
* `api.myapp.com`, from `domains` — and under the project locally,
|
|
28
|
+
* `api.myapp.localhost`. Absent, its id kebab-cased.
|
|
29
|
+
*/
|
|
30
|
+
subdomain?: string;
|
|
27
31
|
/**
|
|
28
32
|
* CORS tunables. The *origins* are never here — they are read off the
|
|
29
33
|
* constructs that declared an edge to this surface, which is the whole point
|
|
@@ -86,23 +90,35 @@ interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
|
86
90
|
* printed an import for. The entry already imports the surface.
|
|
87
91
|
*/
|
|
88
92
|
telescope?: Telescope;
|
|
93
|
+
/**
|
|
94
|
+
* What this surface's process emits — the `Telemetry` construct, passed
|
|
95
|
+
* like the logger: a fact about the process, not a grant to a route.
|
|
96
|
+
*
|
|
97
|
+
* An edge to the node, so the deploy hands this process the `OTEL_*` keys
|
|
98
|
+
* its stage resolves, and the build fails without the OpenTelemetry
|
|
99
|
+
* packages. Where the telemetry goes is never here: it is the deploy's,
|
|
100
|
+
* per stage.
|
|
101
|
+
*/
|
|
102
|
+
telemetry?: Telemetry;
|
|
89
103
|
}
|
|
90
104
|
/**
|
|
91
105
|
* What is *not* here, and why.
|
|
92
106
|
*
|
|
93
|
-
* `dependsOn`, `database`, `auditor` and `
|
|
107
|
+
* `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
|
|
94
108
|
* into a handler. Putting one on the surface hands it to every route the
|
|
95
109
|
* surface serves — a health check gets the database because a report needed it
|
|
96
110
|
* — which is the thing least privilege forbids and the reason `.calls()` is not
|
|
97
|
-
* spelled `dependsOn`. They belong to the endpoint, or to a
|
|
98
|
-
*
|
|
111
|
+
* spelled `dependsOn`. They belong to the endpoint, or to a branch —
|
|
112
|
+
* `api.database(db)` — for a group of endpoints that genuinely share them. A
|
|
113
|
+
* branch is a new factory; the surface config stays free of grants.
|
|
99
114
|
*
|
|
100
115
|
* `auth` is not here either: `.auth(construct)` already declares it, and a
|
|
101
116
|
* second way to say the same thing is the duplication this whole model removes.
|
|
102
117
|
*
|
|
103
118
|
* What is left is what the *process* is rather than what a route may reach.
|
|
104
119
|
*/
|
|
105
|
-
declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
120
|
+
export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
121
|
+
#private;
|
|
106
122
|
private readonly config;
|
|
107
123
|
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
108
124
|
private readonly dependencies;
|
|
@@ -138,34 +154,46 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
138
154
|
readonly envParser: EnvironmentParser<{}>;
|
|
139
155
|
/** The Telescope instance, when this surface was given one. */
|
|
140
156
|
readonly telescope?: Telescope;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
157
|
+
/** What this surface's process emits, when it was given a `Telemetry`. */
|
|
158
|
+
readonly telemetry?: Telemetry;
|
|
159
|
+
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
160
|
+
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
161
|
+
dependencies?: readonly Dependency[],
|
|
162
|
+
/** Internal: how `.auth()` carries the authenticator into its copy. */
|
|
163
|
+
authenticator?: Authenticator | undefined);
|
|
164
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
165
|
+
readonly get: Endpoints['get'];
|
|
166
|
+
readonly post: Endpoints['post'];
|
|
167
|
+
readonly put: Endpoints['put'];
|
|
168
|
+
readonly patch: Endpoints['patch'];
|
|
169
|
+
readonly delete: Endpoints['delete'];
|
|
170
|
+
readonly options: Endpoints['options'];
|
|
144
171
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* `api.get('/users')` is the short form and covers most routes. Reach for
|
|
148
|
-
* this one when a *group* of endpoints shares something a single route would
|
|
149
|
-
* otherwise repeat — a database, an auditor, a publisher:
|
|
172
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
173
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
150
174
|
*
|
|
151
175
|
* ```ts
|
|
152
|
-
* const
|
|
153
|
-
* export const createUser =
|
|
176
|
+
* export const router = api.database(database);
|
|
177
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
154
178
|
* ```
|
|
155
179
|
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
180
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
181
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
182
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
183
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
184
|
+
*
|
|
185
|
+
* `dependsOn` is deliberately not here. It is per endpoint, and on the
|
|
186
|
+
* surface it would read as the API depending on something, which is what
|
|
187
|
+
* `.calls()` and `.auth()` say instead.
|
|
160
188
|
*/
|
|
161
|
-
readonly
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
189
|
+
readonly database: Endpoints['database'];
|
|
190
|
+
readonly session: Endpoints['session'];
|
|
191
|
+
readonly auditor: Endpoints['auditor'];
|
|
192
|
+
readonly actor: Endpoints['actor'];
|
|
193
|
+
readonly authorizer: Endpoints['authorizer'];
|
|
194
|
+
readonly authorize: Endpoints['authorize'];
|
|
195
|
+
readonly rls: Endpoints['rls'];
|
|
196
|
+
readonly route: Endpoints['route'];
|
|
169
197
|
/**
|
|
170
198
|
* What authenticates this surface.
|
|
171
199
|
*
|
|
@@ -175,12 +203,13 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
175
203
|
* what a request is allowed to be. A surface with two of the first is a
|
|
176
204
|
* mistake; two of the second is Tuesday.
|
|
177
205
|
*
|
|
178
|
-
* It
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
206
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
207
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
208
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
209
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
210
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
182
211
|
*/
|
|
183
|
-
auth(construct:
|
|
212
|
+
auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
|
|
184
213
|
/**
|
|
185
214
|
* Other surfaces this one calls.
|
|
186
215
|
*
|
|
@@ -207,7 +236,6 @@ declare class RestApi<TName extends string = string, const TAuthorizers extends
|
|
|
207
236
|
*/
|
|
208
237
|
declare(): Declaration[];
|
|
209
238
|
}
|
|
210
|
-
//# sourceMappingURL=rest-api.d.ts.map
|
|
211
239
|
//#endregion
|
|
212
|
-
export {
|
|
240
|
+
export type { Authenticator };
|
|
213
241
|
//# 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":";;;;;;;;;;KAmDK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;EAUZ,YAAY;;;;;;;;;;;;;;;;;;qBAoBA,QACZ,qCACM,iEACM,WAAW;;mBA0CL;;mBAEA;;mBAEA;WA5CT,IAAI;;;;;;WAOJ;IACR;IACA;IACA;;;;;;;;;WAUQ,QAAQ;;;;;;;;;WAUR,WAAW;;WAGX,YAAY;;WAGZ,YAAY;EAErB,YACC,IAAI,cAAc,QACD,QAAQ,cAAc,eAEtB;;EAAA,wBAAuB,cAEvB;;EAAA,gBAAgB;;WAyEzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;;WAoBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,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-Cs8IHvwF.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
|
|
@@ -51,6 +50,8 @@ var RestApi = class RestApi {
|
|
|
51
50
|
envParser;
|
|
52
51
|
/** The Telescope instance, when this surface was given one. */
|
|
53
52
|
telescope;
|
|
53
|
+
/** What this surface's process emits, when it was given a `Telemetry`. */
|
|
54
|
+
telemetry;
|
|
54
55
|
constructor(id, config, dependencies = [], authenticator) {
|
|
55
56
|
this.config = config;
|
|
56
57
|
this.dependencies = dependencies;
|
|
@@ -64,57 +65,84 @@ var RestApi = class RestApi {
|
|
|
64
65
|
};
|
|
65
66
|
this.logger = config.logger ?? DEFAULT_LOGGER;
|
|
66
67
|
this.telescope = config.telescope;
|
|
68
|
+
this.telemetry = config.telemetry;
|
|
67
69
|
this.envParser = envParserFor(config.envParser ? {
|
|
68
70
|
id: canonical,
|
|
69
71
|
envParser: config.envParser
|
|
70
72
|
} : void 0);
|
|
71
|
-
this
|
|
73
|
+
this.#endpoints = new EndpointFactory({
|
|
72
74
|
defaultLogger: this.logger,
|
|
73
|
-
...config.authorizers ? { availableAuthorizers: config.authorizers.map((name) =>
|
|
75
|
+
...config.authorizers ? { availableAuthorizers: config.authorizers.map((name) => {
|
|
76
|
+
const securityScheme = getSecurityScheme(name);
|
|
77
|
+
return securityScheme ? {
|
|
78
|
+
name,
|
|
79
|
+
securityScheme
|
|
80
|
+
} : { name };
|
|
81
|
+
}) } : {},
|
|
74
82
|
...config.defaultAuthorizer && config.defaultAuthorizer !== "none" ? { defaultAuthorizerName: config.defaultAuthorizer } : {},
|
|
75
83
|
surface: {
|
|
76
84
|
id: this.id,
|
|
77
|
-
envParser: this.envParser
|
|
85
|
+
envParser: this.envParser,
|
|
86
|
+
...authenticator ? { auth: authenticator } : {}
|
|
78
87
|
}
|
|
79
88
|
});
|
|
89
|
+
const endpoints = this.#endpoints;
|
|
90
|
+
this.get = endpoints.get.bind(endpoints);
|
|
91
|
+
this.post = endpoints.post.bind(endpoints);
|
|
92
|
+
this.put = endpoints.put.bind(endpoints);
|
|
93
|
+
this.patch = endpoints.patch.bind(endpoints);
|
|
94
|
+
this.delete = endpoints.delete.bind(endpoints);
|
|
95
|
+
this.options = endpoints.options.bind(endpoints);
|
|
96
|
+
this.database = endpoints.database.bind(endpoints);
|
|
97
|
+
this.session = endpoints.session.bind(endpoints);
|
|
98
|
+
this.auditor = endpoints.auditor.bind(endpoints);
|
|
99
|
+
this.actor = endpoints.actor.bind(endpoints);
|
|
100
|
+
this.authorizer = endpoints.authorizer.bind(endpoints);
|
|
101
|
+
this.authorize = endpoints.authorize.bind(endpoints);
|
|
102
|
+
this.rls = endpoints.rls.bind(endpoints);
|
|
103
|
+
this.route = endpoints.route.bind(endpoints);
|
|
80
104
|
}
|
|
81
105
|
/**
|
|
82
|
-
* This surface's endpoint factory.
|
|
106
|
+
* This surface's endpoint factory, which every method below starts from.
|
|
83
107
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
108
|
+
* Private: a surface *is* where endpoints are built, so there is no second
|
|
109
|
+
* object to reach through first. `api.database(db)` said the same
|
|
110
|
+
* thing as `api.database(db)` with one more word to learn.
|
|
111
|
+
*/
|
|
112
|
+
#endpoints;
|
|
113
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
114
|
+
get;
|
|
115
|
+
post;
|
|
116
|
+
put;
|
|
117
|
+
patch;
|
|
118
|
+
delete;
|
|
119
|
+
options;
|
|
120
|
+
/**
|
|
121
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
122
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
87
123
|
*
|
|
88
124
|
* ```ts
|
|
89
|
-
* const
|
|
90
|
-
* export const createUser =
|
|
125
|
+
* export const router = api.database(database);
|
|
126
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
91
127
|
* ```
|
|
92
128
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
129
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
130
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
131
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
132
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
133
|
+
*
|
|
134
|
+
* `dependsOn` is deliberately not here. It is per endpoint, and on the
|
|
135
|
+
* surface it would read as the API depending on something, which is what
|
|
136
|
+
* `.calls()` and `.auth()` say instead.
|
|
97
137
|
*/
|
|
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
|
-
}
|
|
138
|
+
database;
|
|
139
|
+
session;
|
|
140
|
+
auditor;
|
|
141
|
+
actor;
|
|
142
|
+
authorizer;
|
|
143
|
+
authorize;
|
|
144
|
+
rls;
|
|
145
|
+
route;
|
|
118
146
|
/**
|
|
119
147
|
* What authenticates this surface.
|
|
120
148
|
*
|
|
@@ -124,13 +152,14 @@ var RestApi = class RestApi {
|
|
|
124
152
|
* what a request is allowed to be. A surface with two of the first is a
|
|
125
153
|
* mistake; two of the second is Tuesday.
|
|
126
154
|
*
|
|
127
|
-
* It
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
155
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
156
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
157
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
158
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
159
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
131
160
|
*/
|
|
132
161
|
auth(construct) {
|
|
133
|
-
return new RestApi(this.id, this.config, [...this.dependencies, edgeTo(construct)], construct
|
|
162
|
+
return new RestApi(this.id, this.config, [...this.dependencies, edgeTo(construct)], construct);
|
|
134
163
|
}
|
|
135
164
|
/**
|
|
136
165
|
* Other surfaces this one calls.
|
|
@@ -163,11 +192,13 @@ var RestApi = class RestApi {
|
|
|
163
192
|
kind: "rest-api",
|
|
164
193
|
id: this.id,
|
|
165
194
|
path: this.config.path,
|
|
195
|
+
...this.config.subdomain ? { subdomain: this.config.subdomain } : {},
|
|
166
196
|
...this.config.telescope ? { telescope: true } : {},
|
|
167
197
|
...this.config.cors ? { cors: this.config.cors } : {},
|
|
168
|
-
...this.authenticator ? { auth: this.authenticator } : {},
|
|
198
|
+
...this.authenticator ? { auth: this.authenticator.id } : {},
|
|
169
199
|
endpoints: [],
|
|
170
200
|
...this.dependencies.length ? { calls: this.dependencies } : {},
|
|
201
|
+
...this.config.telemetry ? { telemetry: this.config.telemetry.id } : {},
|
|
171
202
|
...this.config.authorizers?.length ? { authorizers: this.config.authorizers } : {},
|
|
172
203
|
defaultAuthorizer: this.config.defaultAuthorizer,
|
|
173
204
|
provides: [
|
|
@@ -178,7 +209,7 @@ var RestApi = class RestApi {
|
|
|
178
209
|
}];
|
|
179
210
|
}
|
|
180
211
|
};
|
|
181
|
-
|
|
182
212
|
//#endregion
|
|
183
213
|
export { RestApi };
|
|
214
|
+
|
|
184
215
|
//# sourceMappingURL=rest-api.mjs.map
|