@geekmidas/constructs 10.0.0-alpha.17 → 10.0.0-alpha.170
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 +246 -158
- package/dist/Construct-127M7yrl.d.cts +231 -0
- package/dist/Construct-127M7yrl.d.cts.map +1 -0
- package/dist/Construct-BMk_CRSD.d.mts +231 -0
- package/dist/Construct-BMk_CRSD.d.mts.map +1 -0
- package/dist/{Construct-BeYVu_QF.mjs → Construct-CGuc_Ijk.mjs} +8 -9
- package/dist/Construct-CGuc_Ijk.mjs.map +1 -0
- package/dist/{Construct-DqdlARxq.cjs → Construct-DorKS0Ua.cjs} +8 -9
- package/dist/Construct-DorKS0Ua.cjs.map +1 -0
- package/dist/{Cron-l4Wlz6G9.d.mts → Cron-Ca_qHQu2.d.cts} +16 -9
- package/dist/Cron-Ca_qHQu2.d.cts.map +1 -0
- package/dist/{Cron-zsoSAwZo.d.cts → Cron-DPJiR7Lt.d.mts} +15 -8
- package/dist/Cron-DPJiR7Lt.d.mts.map +1 -0
- package/dist/CronBuilder-BC4za5Bx.d.mts +47 -0
- package/dist/CronBuilder-BC4za5Bx.d.mts.map +1 -0
- package/dist/{CronBuilder-D_0HNBTr.mjs → CronBuilder-BJ5LoadF.mjs} +28 -11
- package/dist/CronBuilder-BJ5LoadF.mjs.map +1 -0
- package/dist/{CronBuilder-BdnI6lxF.cjs → CronBuilder-B_NSP-Y5.cjs} +27 -10
- package/dist/CronBuilder-B_NSP-Y5.cjs.map +1 -0
- package/dist/CronBuilder-C3RrAF1-.d.cts +47 -0
- package/dist/CronBuilder-C3RrAF1-.d.cts.map +1 -0
- package/dist/Endpoint-52z1P0Ue.cjs +581 -0
- package/dist/Endpoint-52z1P0Ue.cjs.map +1 -0
- package/dist/{Endpoint-DBflWAe4.d.cts → Endpoint-BlIZLsBQ.d.cts} +101 -20
- package/dist/Endpoint-BlIZLsBQ.d.cts.map +1 -0
- package/dist/{Endpoint-oS-Fe3d_.d.mts → Endpoint-DC7mreOr.d.mts} +104 -23
- package/dist/Endpoint-DC7mreOr.d.mts.map +1 -0
- package/dist/Endpoint-sUOU7uLx.mjs +552 -0
- package/dist/Endpoint-sUOU7uLx.mjs.map +1 -0
- package/dist/{EndpointFactory-Bm3aKRdV.mjs → EndpointFactory-Bzi9Sl7r.mjs} +269 -53
- package/dist/EndpointFactory-Bzi9Sl7r.mjs.map +1 -0
- package/dist/{EndpointFactory-CLvWuHyt.cjs → EndpointFactory-Cf_Cs1ym.cjs} +309 -51
- package/dist/EndpointFactory-Cf_Cs1ym.cjs.map +1 -0
- package/dist/{index-Cc4kKPag.d.mts → EndpointFactory-DCmnCmkX.d.mts} +189 -106
- package/dist/EndpointFactory-DCmnCmkX.d.mts.map +1 -0
- package/dist/{index-C1ZwNOOk.d.cts → EndpointFactory-cVTb8kCc.d.cts} +187 -104
- package/dist/EndpointFactory-cVTb8kCc.d.cts.map +1 -0
- package/dist/Function-BIEsY0Hm.d.cts +76 -0
- package/dist/Function-BIEsY0Hm.d.cts.map +1 -0
- package/dist/Function-BKReud5p.d.mts +76 -0
- package/dist/Function-BKReud5p.d.mts.map +1 -0
- package/dist/{HonoEndpointAdaptor-92zavCsV.cjs → HonoEndpointAdaptor-BTbqfSaa.cjs} +115 -41
- package/dist/HonoEndpointAdaptor-BTbqfSaa.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-yYaU7jVJ.mjs → HonoEndpointAdaptor-CBVey2cY.mjs} +112 -38
- package/dist/HonoEndpointAdaptor-CBVey2cY.mjs.map +1 -0
- package/dist/ObjectSubscriberBuilder-AwGKoUKy.d.mts +129 -0
- package/dist/ObjectSubscriberBuilder-AwGKoUKy.d.mts.map +1 -0
- package/dist/ObjectSubscriberBuilder-CB6imsX4.d.cts +129 -0
- package/dist/ObjectSubscriberBuilder-CB6imsX4.d.cts.map +1 -0
- package/dist/ProcessorBuilder-CeEZ2vCx.d.cts +216 -0
- package/dist/ProcessorBuilder-CeEZ2vCx.d.cts.map +1 -0
- package/dist/ProcessorBuilder-CwIlm75W.d.mts +216 -0
- package/dist/ProcessorBuilder-CwIlm75W.d.mts.map +1 -0
- package/dist/Queue-9Hh20ZCk.mjs +104 -0
- package/dist/Queue-9Hh20ZCk.mjs.map +1 -0
- package/dist/{Queue-D9X6OoON.d.mts → Queue-B8HGg439.d.mts} +42 -41
- package/dist/Queue-B8HGg439.d.mts.map +1 -0
- package/dist/{Queue-DYPB2KWL.d.cts → Queue-C4rijiM7.d.cts} +43 -42
- package/dist/Queue-C4rijiM7.d.cts.map +1 -0
- package/dist/Queue-W1wueijP.cjs +109 -0
- package/dist/Queue-W1wueijP.cjs.map +1 -0
- package/dist/QueueBuilder-BDcv9B71.cjs +135 -0
- package/dist/QueueBuilder-BDcv9B71.cjs.map +1 -0
- package/dist/QueueBuilder-CUERv8jt.d.mts +75 -0
- package/dist/QueueBuilder-CUERv8jt.d.mts.map +1 -0
- package/dist/QueueBuilder-CmB1vOgn.d.cts +75 -0
- package/dist/QueueBuilder-CmB1vOgn.d.cts.map +1 -0
- package/dist/QueueBuilder-CrZL8HHs.mjs +118 -0
- package/dist/QueueBuilder-CrZL8HHs.mjs.map +1 -0
- package/dist/Subscriber-5rCX1Nph.d.cts +83 -0
- package/dist/Subscriber-5rCX1Nph.d.cts.map +1 -0
- package/dist/Subscriber-CtQXhcL7.d.mts +83 -0
- package/dist/Subscriber-CtQXhcL7.d.mts.map +1 -0
- package/dist/SubscriberBuilder-CpFhShTJ.mjs +238 -0
- package/dist/SubscriberBuilder-CpFhShTJ.mjs.map +1 -0
- package/dist/SubscriberBuilder-DJEvNRdD.cjs +261 -0
- package/dist/SubscriberBuilder-DJEvNRdD.cjs.map +1 -0
- package/dist/Topic-BGoOeCT6.mjs +99 -0
- package/dist/Topic-BGoOeCT6.mjs.map +1 -0
- package/dist/Topic-DLCZBNwK.cjs +104 -0
- package/dist/Topic-DLCZBNwK.cjs.map +1 -0
- package/dist/adaptors/aws.cjs +147 -168
- package/dist/adaptors/aws.cjs.map +1 -1
- package/dist/adaptors/aws.d.cts +57 -48
- package/dist/adaptors/aws.d.cts.map +1 -1
- package/dist/adaptors/aws.d.mts +58 -49
- package/dist/adaptors/aws.d.mts.map +1 -1
- package/dist/adaptors/aws.mjs +142 -164
- package/dist/adaptors/aws.mjs.map +1 -1
- package/dist/adaptors/awsWebsocket.cjs +354 -0
- package/dist/adaptors/awsWebsocket.cjs.map +1 -0
- package/dist/adaptors/awsWebsocket.d.cts +156 -0
- package/dist/adaptors/awsWebsocket.d.cts.map +1 -0
- package/dist/adaptors/awsWebsocket.d.mts +156 -0
- package/dist/adaptors/awsWebsocket.d.mts.map +1 -0
- package/dist/adaptors/awsWebsocket.mjs +347 -0
- package/dist/adaptors/awsWebsocket.mjs.map +1 -0
- package/dist/adaptors/hono.cjs +1 -1
- package/dist/adaptors/hono.d.cts +8 -7
- package/dist/adaptors/hono.d.cts.map +1 -1
- package/dist/adaptors/hono.d.mts +10 -9
- package/dist/adaptors/hono.d.mts.map +1 -1
- package/dist/adaptors/hono.mjs +1 -1
- package/dist/adaptors/testing.cjs +1174 -41
- package/dist/adaptors/testing.cjs.map +1 -1
- package/dist/adaptors/testing.d.cts +517 -40
- package/dist/adaptors/testing.d.cts.map +1 -1
- package/dist/adaptors/testing.d.mts +517 -40
- package/dist/adaptors/testing.d.mts.map +1 -1
- package/dist/adaptors/testing.mjs +1140 -36
- package/dist/adaptors/testing.mjs.map +1 -1
- package/dist/auth-1yI2wR-4.d.cts +274 -0
- package/dist/auth-1yI2wR-4.d.cts.map +1 -0
- package/dist/auth-D4NMXgLt.d.mts +274 -0
- package/dist/auth-D4NMXgLt.d.mts.map +1 -0
- package/dist/auth.cjs +311 -26
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +2 -104
- package/dist/auth.d.mts +2 -104
- package/dist/auth.mjs +307 -28
- package/dist/auth.mjs.map +1 -1
- package/dist/cache-0VoeOTF9.d.mts +44 -0
- package/dist/cache-0VoeOTF9.d.mts.map +1 -0
- package/dist/cache-CW-sArzS.d.cts +44 -0
- package/dist/cache-CW-sArzS.d.cts.map +1 -0
- package/dist/cache.cjs +4 -20
- package/dist/cache.cjs.map +1 -1
- package/dist/cache.d.cts +2 -43
- package/dist/cache.d.mts +2 -43
- package/dist/cache.mjs +4 -20
- package/dist/cache.mjs.map +1 -1
- 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/cipher-DSDxPRIp.d.cts +106 -0
- package/dist/cipher-DSDxPRIp.d.cts.map +1 -0
- package/dist/cipher-DSDxPRIp.d.mts +106 -0
- package/dist/cipher-DSDxPRIp.d.mts.map +1 -0
- package/dist/{construct-interface-DPlxfpoS.d.mts → construct-interface-DhbaONW2.d.cts} +63 -8
- package/dist/construct-interface-DhbaONW2.d.cts.map +1 -0
- package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-DxfkFxkl.d.mts} +63 -8
- package/dist/construct-interface-DxfkFxkl.d.mts.map +1 -0
- package/dist/construct-interface.cjs +47 -4
- package/dist/construct-interface.cjs.map +1 -1
- package/dist/construct-interface.d.cts +2 -2
- package/dist/construct-interface.d.mts +2 -2
- package/dist/construct-interface.mjs +45 -5
- package/dist/construct-interface.mjs.map +1 -1
- package/dist/credential-B80mOxwT.mjs +222 -0
- package/dist/credential-B80mOxwT.mjs.map +1 -0
- package/dist/credential-RlgbzZAc.cjs +257 -0
- package/dist/credential-RlgbzZAc.cjs.map +1 -0
- package/dist/credential.cjs +7 -129
- package/dist/credential.d.cts +2 -58
- package/dist/credential.d.mts +2 -58
- package/dist/credential.mjs +2 -128
- package/dist/crons/index.cjs +127 -1
- package/dist/crons/index.cjs.map +1 -1
- package/dist/crons/index.d.cts +43 -3
- package/dist/crons/index.d.cts.map +1 -1
- package/dist/crons/index.d.mts +43 -3
- package/dist/crons/index.d.mts.map +1 -1
- package/dist/crons/index.mjs +126 -2
- package/dist/crons/index.mjs.map +1 -1
- package/dist/database/kysely.cjs +3 -194
- package/dist/database/kysely.d.cts +2 -149
- package/dist/database/kysely.d.mts +2 -149
- package/dist/database/kysely.mjs +2 -192
- package/dist/email.cjs +24 -17
- package/dist/email.cjs.map +1 -1
- package/dist/email.d.cts +15 -5
- package/dist/email.d.cts.map +1 -1
- package/dist/email.d.mts +16 -6
- package/dist/email.d.mts.map +1 -1
- package/dist/email.mjs +23 -17
- package/dist/email.mjs.map +1 -1
- package/dist/encryption/kms.cjs +95 -0
- package/dist/encryption/kms.cjs.map +1 -0
- package/dist/encryption/kms.d.cts +7 -0
- package/dist/encryption/kms.d.cts.map +1 -0
- package/dist/encryption/kms.d.mts +7 -0
- package/dist/encryption/kms.d.mts.map +1 -0
- package/dist/encryption/kms.mjs +93 -0
- package/dist/encryption/kms.mjs.map +1 -0
- package/dist/encryption.cjs +116 -0
- package/dist/encryption.cjs.map +1 -0
- package/dist/encryption.d.cts +37 -0
- package/dist/encryption.d.cts.map +1 -0
- package/dist/encryption.d.mts +37 -0
- package/dist/encryption.d.mts.map +1 -0
- package/dist/encryption.mjs +101 -0
- package/dist/encryption.mjs.map +1 -0
- package/dist/endpoints/index.cjs +32 -10
- package/dist/endpoints/index.d.cts +106 -3
- package/dist/endpoints/index.d.cts.map +1 -0
- package/dist/endpoints/index.d.mts +106 -3
- package/dist/endpoints/index.d.mts.map +1 -0
- package/dist/endpoints/index.mjs +6 -4
- package/dist/expire-C586zznE.d.cts +38 -0
- package/dist/expire-C586zznE.d.cts.map +1 -0
- package/dist/expire-C586zznE.d.mts +38 -0
- package/dist/expire-C586zznE.d.mts.map +1 -0
- package/dist/expire-CieftS01.cjs +67 -0
- package/dist/expire-CieftS01.cjs.map +1 -0
- package/dist/expire-CpzUAfr9.mjs +50 -0
- package/dist/expire-CpzUAfr9.mjs.map +1 -0
- 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-BvOXkZmj.d.mts +201 -0
- package/dist/fake-BvOXkZmj.d.mts.map +1 -0
- package/dist/fake-Djx8E0o1.d.cts +201 -0
- package/dist/fake-Djx8E0o1.d.cts.map +1 -0
- package/dist/file-server.cjs +200 -48
- package/dist/file-server.cjs.map +1 -1
- package/dist/file-server.d.cts +147 -15
- package/dist/file-server.d.cts.map +1 -1
- package/dist/file-server.d.mts +147 -15
- package/dist/file-server.d.mts.map +1 -1
- package/dist/file-server.mjs +198 -50
- package/dist/file-server.mjs.map +1 -1
- package/dist/functions/index.cjs +1 -1
- package/dist/functions/index.d.cts +2 -1
- package/dist/functions/index.d.mts +2 -1
- package/dist/functions/index.mjs +1 -1
- package/dist/{functions-C53GW2eQ.mjs → functions-BvIDQKAA.mjs} +117 -22
- package/dist/functions-BvIDQKAA.mjs.map +1 -0
- package/dist/{functions-B6qCvfmy.cjs → functions-DLF6-IK8.cjs} +122 -18
- package/dist/functions-DLF6-IK8.cjs.map +1 -0
- package/dist/inbox-BjvMs7EJ.d.cts +195 -0
- package/dist/inbox-BjvMs7EJ.d.cts.map +1 -0
- package/dist/inbox-C8bOR9UL.d.mts +195 -0
- package/dist/inbox-C8bOR9UL.d.mts.map +1 -0
- package/dist/inbox.cjs +291 -0
- package/dist/inbox.cjs.map +1 -0
- package/dist/inbox.d.cts +2 -0
- package/dist/inbox.d.mts +2 -0
- package/dist/inbox.mjs +283 -0
- package/dist/inbox.mjs.map +1 -0
- package/dist/index-DaK-C7N3.d.cts +115 -0
- package/dist/index-DaK-C7N3.d.cts.map +1 -0
- package/dist/{index-CeEtxDmK.d.cts → index-DdRjYhiJ.d.cts} +42 -2
- package/dist/{index-CeEtxDmK.d.cts.map → index-DdRjYhiJ.d.cts.map} +1 -1
- package/dist/{index-CeEtxDmK.d.mts → index-DdRjYhiJ.d.mts} +42 -2
- package/dist/{index-CeEtxDmK.d.mts.map → index-DdRjYhiJ.d.mts.map} +1 -1
- package/dist/index-vCS4HBEG.d.mts +115 -0
- package/dist/index-vCS4HBEG.d.mts.map +1 -0
- package/dist/index.cjs +4 -1
- package/dist/index.d.cts +26 -3
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +26 -3
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -2
- package/dist/kysely-2HqIQ2fC.d.cts +216 -0
- package/dist/kysely-2HqIQ2fC.d.cts.map +1 -0
- package/dist/kysely-BGvpd_ZH.d.mts +216 -0
- package/dist/kysely-BGvpd_ZH.d.mts.map +1 -0
- package/dist/kysely-Bc9xzaik.mjs +371 -0
- package/dist/kysely-Bc9xzaik.mjs.map +1 -0
- package/dist/kysely-D7f6J2lh.cjs +384 -0
- package/dist/kysely-D7f6J2lh.cjs.map +1 -0
- package/dist/{telemetry-DGcFlVpB.d.cts → lambdaTelemetry-8vnmVZQ5.d.cts} +2 -2
- package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +1 -0
- package/dist/{telemetry-DGcFlVpB.d.mts → lambdaTelemetry-8vnmVZQ5.d.mts} +2 -2
- package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +1 -0
- package/dist/mobile-app.cjs +78 -0
- package/dist/mobile-app.cjs.map +1 -0
- package/dist/mobile-app.d.cts +77 -0
- package/dist/mobile-app.d.cts.map +1 -0
- package/dist/mobile-app.d.mts +77 -0
- package/dist/mobile-app.d.mts.map +1 -0
- package/dist/mobile-app.mjs +77 -0
- package/dist/mobile-app.mjs.map +1 -0
- package/dist/object-storage.cjs +14 -7
- package/dist/object-storage.cjs.map +1 -1
- package/dist/object-storage.d.cts +12 -3
- package/dist/object-storage.d.cts.map +1 -1
- package/dist/object-storage.d.mts +12 -3
- package/dist/object-storage.d.mts.map +1 -1
- package/dist/object-storage.mjs +14 -9
- package/dist/object-storage.mjs.map +1 -1
- package/dist/optionalPeers-D7Wt6dnF.mjs +140 -0
- package/dist/optionalPeers-D7Wt6dnF.mjs.map +1 -0
- package/dist/optionalPeers-DuNQXXe1.cjs +223 -0
- package/dist/optionalPeers-DuNQXXe1.cjs.map +1 -0
- package/dist/origins-BjxYht13.cjs +96 -0
- package/dist/origins-BjxYht13.cjs.map +1 -0
- package/dist/origins-Boc9qbo-.mjs +73 -0
- package/dist/origins-Boc9qbo-.mjs.map +1 -0
- package/dist/pattern-C1CEcglD.mjs +241 -0
- package/dist/pattern-C1CEcglD.mjs.map +1 -0
- package/dist/pattern-QFaUIr77.cjs +288 -0
- package/dist/pattern-QFaUIr77.cjs.map +1 -0
- package/dist/privateAddress-Bg5fUsbp.mjs +21 -0
- package/dist/privateAddress-Bg5fUsbp.mjs.map +1 -0
- package/dist/privateAddress-CqGyuFHn.cjs +26 -0
- package/dist/privateAddress-CqGyuFHn.cjs.map +1 -0
- package/dist/processors/index.cjs +214 -0
- package/dist/processors/index.cjs.map +1 -0
- package/dist/processors/index.d.cts +78 -0
- package/dist/processors/index.d.cts.map +1 -0
- package/dist/processors/index.d.mts +78 -0
- package/dist/processors/index.d.mts.map +1 -0
- package/dist/processors/index.mjs +193 -0
- package/dist/processors/index.mjs.map +1 -0
- package/dist/queue/index.cjs +5 -192
- package/dist/queue/index.d.cts +3 -53
- package/dist/queue/index.d.mts +3 -53
- package/dist/queue/index.mjs +3 -190
- 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/readRequestBody-BmKnPl0a.mjs +293 -0
- package/dist/readRequestBody-BmKnPl0a.mjs.map +1 -0
- package/dist/{lazyAccessors-Dx9NLwJZ.cjs → readRequestBody-CN9GVdeE.cjs} +141 -47
- package/dist/readRequestBody-CN9GVdeE.cjs.map +1 -0
- package/dist/{processAudits-D_2W5x8k.cjs → requestLogger-CnoYd-Ah.cjs} +63 -3
- package/dist/requestLogger-CnoYd-Ah.cjs.map +1 -0
- package/dist/{processAudits-BpRlPQMW.mjs → requestLogger-D2JS7pPM.mjs} +51 -3
- package/dist/requestLogger-D2JS7pPM.mjs.map +1 -0
- package/dist/rest-api.cjs +100 -73
- package/dist/rest-api.cjs.map +1 -1
- package/dist/rest-api.d.cts +83 -59
- package/dist/rest-api.d.cts.map +1 -1
- package/dist/rest-api.d.mts +83 -59
- package/dist/rest-api.d.mts.map +1 -1
- package/dist/rest-api.mjs +97 -76
- package/dist/rest-api.mjs.map +1 -1
- package/dist/runSubscriber-HEqXkin1.mjs +117 -0
- package/dist/runSubscriber-HEqXkin1.mjs.map +1 -0
- package/dist/runSubscriber-sVJfLA0-.cjs +134 -0
- package/dist/runSubscriber-sVJfLA0-.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 +137 -10
- package/dist/site.cjs.map +1 -1
- package/dist/site.d.cts +153 -3
- package/dist/site.d.cts.map +1 -1
- package/dist/site.d.mts +153 -3
- package/dist/site.d.mts.map +1 -1
- package/dist/site.mjs +117 -13
- package/dist/site.mjs.map +1 -1
- package/dist/stages-DaTaoQei.d.cts +73 -0
- package/dist/stages-DaTaoQei.d.cts.map +1 -0
- package/dist/stages-DaTaoQei.d.mts +73 -0
- package/dist/stages-DaTaoQei.d.mts.map +1 -0
- package/dist/subscribers/index.cjs +134 -1
- package/dist/subscribers/index.cjs.map +1 -0
- package/dist/subscribers/index.d.cts +74 -3
- package/dist/subscribers/index.d.cts.map +1 -0
- package/dist/subscribers/index.d.mts +74 -3
- package/dist/subscribers/index.d.mts.map +1 -0
- package/dist/subscribers/index.mjs +132 -2
- package/dist/subscribers/index.mjs.map +1 -0
- package/dist/telemetry-BirKau0X.d.mts +40 -0
- package/dist/telemetry-BirKau0X.d.mts.map +1 -0
- package/dist/telemetry-DjJgtQ_N.d.cts +40 -0
- package/dist/telemetry-DjJgtQ_N.d.cts.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 +2 -134
- package/dist/topic/index.d.cts +2 -3
- package/dist/topic/index.d.mts +2 -3
- package/dist/topic/index.mjs +2 -132
- 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/websocket-api-C6LGg9-D.mjs +1716 -0
- package/dist/websocket-api-C6LGg9-D.mjs.map +1 -0
- package/dist/websocket-api-CD-E5Ogr.d.cts +1207 -0
- package/dist/websocket-api-CD-E5Ogr.d.cts.map +1 -0
- package/dist/websocket-api-CoKPJJRl.cjs +1895 -0
- package/dist/websocket-api-CoKPJJRl.cjs.map +1 -0
- package/dist/websocket-api-pJJfeTcm.d.mts +1207 -0
- package/dist/websocket-api-pJJfeTcm.d.mts.map +1 -0
- package/dist/websocket-api.cjs +42 -0
- package/dist/websocket-api.d.cts +2 -0
- package/dist/websocket-api.d.mts +2 -0
- package/dist/websocket-api.mjs +3 -0
- package/dist/worker.cjs +174 -32
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +147 -47
- package/dist/worker.d.cts.map +1 -1
- package/dist/worker.d.mts +147 -47
- package/dist/worker.d.mts.map +1 -1
- package/dist/worker.mjs +175 -33
- package/dist/worker.mjs.map +1 -1
- package/package.json +180 -43
- package/dist/Construct-BeYVu_QF.mjs.map +0 -1
- package/dist/Construct-DfbwIntp.d.cts +0 -115
- package/dist/Construct-DfbwIntp.d.cts.map +0 -1
- package/dist/Construct-DqdlARxq.cjs.map +0 -1
- package/dist/Construct-l5aOn_jv.d.mts +0 -115
- package/dist/Construct-l5aOn_jv.d.mts.map +0 -1
- package/dist/Cron-l4Wlz6G9.d.mts.map +0 -1
- package/dist/Cron-zsoSAwZo.d.cts.map +0 -1
- package/dist/CronBuilder-BdnI6lxF.cjs.map +0 -1
- package/dist/CronBuilder-CyT71Nzg.d.cts +0 -41
- package/dist/CronBuilder-CyT71Nzg.d.cts.map +0 -1
- package/dist/CronBuilder-D_0HNBTr.mjs.map +0 -1
- package/dist/CronBuilder-UoNgFe8S.d.mts +0 -41
- package/dist/CronBuilder-UoNgFe8S.d.mts.map +0 -1
- package/dist/Endpoint-BpZHtJ2W.cjs +0 -1689
- package/dist/Endpoint-BpZHtJ2W.cjs.map +0 -1
- package/dist/Endpoint-DBflWAe4.d.cts.map +0 -1
- package/dist/Endpoint-ONsly_dq.mjs +0 -1671
- package/dist/Endpoint-ONsly_dq.mjs.map +0 -1
- package/dist/Endpoint-oS-Fe3d_.d.mts.map +0 -1
- package/dist/EndpointFactory-Bm3aKRdV.mjs.map +0 -1
- package/dist/EndpointFactory-CLvWuHyt.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-92zavCsV.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-yYaU7jVJ.mjs.map +0 -1
- package/dist/Queue-D9X6OoON.d.mts.map +0 -1
- package/dist/Queue-DYPB2KWL.d.cts.map +0 -1
- package/dist/Subscriber-C4heaAyO.d.mts +0 -51
- package/dist/Subscriber-C4heaAyO.d.mts.map +0 -1
- package/dist/Subscriber-CotDUELC.d.cts +0 -51
- package/dist/Subscriber-CotDUELC.d.cts.map +0 -1
- package/dist/SubscriberBuilder-BEv0eoHy.d.cts +0 -59
- package/dist/SubscriberBuilder-BEv0eoHy.d.cts.map +0 -1
- package/dist/SubscriberBuilder-C0ZEtGDI.cjs +0 -125
- package/dist/SubscriberBuilder-C0ZEtGDI.cjs.map +0 -1
- package/dist/SubscriberBuilder-h7B_cHMr.mjs +0 -114
- package/dist/SubscriberBuilder-h7B_cHMr.mjs.map +0 -1
- package/dist/SubscriberBuilder-tyH5yTk5.d.mts +0 -59
- package/dist/SubscriberBuilder-tyH5yTk5.d.mts.map +0 -1
- package/dist/Topic-DEVGo0Dm.d.cts +0 -89
- package/dist/Topic-DEVGo0Dm.d.cts.map +0 -1
- package/dist/Topic-zk_6Gthr.d.mts +0 -89
- package/dist/Topic-zk_6Gthr.d.mts.map +0 -1
- package/dist/auth.d.cts.map +0 -1
- package/dist/auth.d.mts.map +0 -1
- package/dist/cache.d.cts.map +0 -1
- package/dist/cache.d.mts.map +0 -1
- package/dist/construct-interface-DPlxfpoS.d.mts.map +0 -1
- package/dist/construct-interface-DgXTJcOD.d.cts.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-B6qCvfmy.cjs.map +0 -1
- package/dist/functions-C53GW2eQ.mjs.map +0 -1
- package/dist/index-B2urf3YI.d.cts +0 -26
- package/dist/index-B2urf3YI.d.cts.map +0 -1
- package/dist/index-C1ZwNOOk.d.cts.map +0 -1
- package/dist/index-Cc4kKPag.d.mts.map +0 -1
- package/dist/index-DMCDvnsM.d.mts +0 -26
- package/dist/index-DMCDvnsM.d.mts.map +0 -1
- package/dist/index-D_frT6MP.d.cts +0 -165
- package/dist/index-D_frT6MP.d.cts.map +0 -1
- package/dist/index-DcyIYbDS.d.mts +0 -165
- package/dist/index-DcyIYbDS.d.mts.map +0 -1
- package/dist/lazyAccessors-BHtcqgz2.mjs +0 -211
- package/dist/lazyAccessors-BHtcqgz2.mjs.map +0 -1
- package/dist/lazyAccessors-Dx9NLwJZ.cjs.map +0 -1
- package/dist/processAudits-BpRlPQMW.mjs.map +0 -1
- package/dist/processAudits-D_2W5x8k.cjs.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/telemetry-DGcFlVpB.d.cts.map +0 -1
- package/dist/telemetry-DGcFlVpB.d.mts.map +0 -1
- package/dist/topic/index.cjs.map +0 -1
- package/dist/topic/index.mjs.map +0 -1
package/dist/rest-api.d.cts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { i as Declarable, n as Construct, t as Authenticator } from "./construct-interface-DhbaONW2.cjs";
|
|
2
|
+
import { n as Telemetry } from "./telemetry-DjJgtQ_N.cjs";
|
|
3
|
+
import { D as BuiltInSecuritySchemeId } from "./Endpoint-BlIZLsBQ.cjs";
|
|
4
|
+
import { t as EndpointFactory } from "./EndpointFactory-cVTb8kCc.cjs";
|
|
4
5
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
5
6
|
import { Logger } from "@geekmidas/logger";
|
|
6
|
-
import {
|
|
7
|
+
import { Service } from "@geekmidas/services";
|
|
8
|
+
import { ConstructName, Declaration, InvalidHostLabel } from "@geekmidas/manifest";
|
|
7
9
|
import { Telescope } from "@geekmidas/telescope";
|
|
8
10
|
//#region src/rest-api.d.ts
|
|
11
|
+
/** The factory a surface builds its endpoints from. */
|
|
12
|
+
type Endpoints = EndpointFactory<[], '', Logger>;
|
|
9
13
|
export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
10
14
|
/**
|
|
11
15
|
* The app that serves this surface, relative to the workspace root —
|
|
@@ -19,6 +23,18 @@ export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly
|
|
|
19
23
|
* `constructs` glob.
|
|
20
24
|
*/
|
|
21
25
|
path: string;
|
|
26
|
+
/**
|
|
27
|
+
* The label it answers on under a stage's domain — `api` for
|
|
28
|
+
* `api.myapp.com`, from `domains` — and under the project locally,
|
|
29
|
+
* `api.myapp.localhost`. Absent, its id kebab-cased.
|
|
30
|
+
*/
|
|
31
|
+
subdomain?: string;
|
|
32
|
+
/**
|
|
33
|
+
* More labels it answers on under the stage's domain, exactly as on its
|
|
34
|
+
* own — `['rest']` serves `rest.myapp.com` beside `api.myapp.com`. Its own
|
|
35
|
+
* label stays canonical: `<ID>_URL`, clients and OpenAPI are built on it.
|
|
36
|
+
*/
|
|
37
|
+
aliases?: readonly string[];
|
|
22
38
|
/**
|
|
23
39
|
* CORS tunables. The *origins* are never here — they are read off the
|
|
24
40
|
* constructs that declared an edge to this surface, which is the whole point
|
|
@@ -81,29 +97,44 @@ export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly
|
|
|
81
97
|
* printed an import for. The entry already imports the surface.
|
|
82
98
|
*/
|
|
83
99
|
telescope?: Telescope;
|
|
100
|
+
/**
|
|
101
|
+
* What this surface's process emits — the `Telemetry` construct, passed
|
|
102
|
+
* like the logger: a fact about the process, not a grant to a route.
|
|
103
|
+
*
|
|
104
|
+
* An edge to the node, so the deploy hands this process the `OTEL_*` keys
|
|
105
|
+
* its stage resolves, and the build fails without the OpenTelemetry
|
|
106
|
+
* packages. Where the telemetry goes is never here: it is the deploy's,
|
|
107
|
+
* per stage.
|
|
108
|
+
*/
|
|
109
|
+
telemetry?: Telemetry;
|
|
84
110
|
}
|
|
85
111
|
/**
|
|
86
112
|
* What is *not* here, and why.
|
|
87
113
|
*
|
|
88
|
-
* `dependsOn`, `database`, `auditor` and `
|
|
114
|
+
* `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
|
|
89
115
|
* into a handler. Putting one on the surface hands it to every route the
|
|
90
116
|
* surface serves — a health check gets the database because a report needed it
|
|
91
|
-
* — which is the thing least privilege forbids
|
|
92
|
-
*
|
|
93
|
-
*
|
|
117
|
+
* — which is the thing least privilege forbids. They belong to the endpoint, or to a branch —
|
|
118
|
+
* `api.database(db)` — for a group of endpoints that genuinely share them. A
|
|
119
|
+
* branch is a new factory; the surface config stays free of grants.
|
|
94
120
|
*
|
|
95
121
|
* `auth` is not here either: `.auth(construct)` already declares it, and a
|
|
96
122
|
* second way to say the same thing is the duplication this whole model removes.
|
|
97
123
|
*
|
|
98
124
|
* What is left is what the *process* is rather than what a route may reach.
|
|
99
125
|
*/
|
|
100
|
-
export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
126
|
+
export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName>, Construct<TName, string> {
|
|
127
|
+
#private;
|
|
101
128
|
private readonly config;
|
|
102
|
-
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
103
|
-
private readonly dependencies;
|
|
104
129
|
/** Internal: how `.auth()` carries the authenticator into its copy. */
|
|
105
130
|
private readonly authenticator?;
|
|
106
131
|
readonly id: TName;
|
|
132
|
+
/**
|
|
133
|
+
* Its public address, `https://api.example.com` — what a worker or another
|
|
134
|
+
* surface's endpoint that `.dependsOn([api])` reads to build a link or a
|
|
135
|
+
* callback URL. The same `<ID>_URL` on every command and stage.
|
|
136
|
+
*/
|
|
137
|
+
readonly service: Service<Uncapitalize<TName>, string>;
|
|
107
138
|
/**
|
|
108
139
|
* Declared once and read by both `declare()` and anything that consumes this
|
|
109
140
|
* surface, so what the target publishes and what a consumer reads cannot
|
|
@@ -133,68 +164,60 @@ export declare class RestApi<TName extends string = string, const TAuthorizers e
|
|
|
133
164
|
readonly envParser: EnvironmentParser<{}>;
|
|
134
165
|
/** The Telescope instance, when this surface was given one. */
|
|
135
166
|
readonly telescope?: Telescope;
|
|
167
|
+
/** What this surface's process emits, when it was given a `Telemetry`. */
|
|
168
|
+
readonly telemetry?: Telemetry;
|
|
136
169
|
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
137
|
-
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
138
|
-
dependencies?: readonly Dependency[],
|
|
139
170
|
/** Internal: how `.auth()` carries the authenticator into its copy. */
|
|
140
|
-
authenticator?:
|
|
171
|
+
authenticator?: Authenticator | undefined);
|
|
172
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
173
|
+
readonly get: Endpoints['get'];
|
|
174
|
+
readonly post: Endpoints['post'];
|
|
175
|
+
readonly put: Endpoints['put'];
|
|
176
|
+
readonly patch: Endpoints['patch'];
|
|
177
|
+
readonly delete: Endpoints['delete'];
|
|
178
|
+
readonly options: Endpoints['options'];
|
|
141
179
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* `api.get('/users')` is the short form and covers most routes. Reach for
|
|
145
|
-
* this one when a *group* of endpoints shares something a single route would
|
|
146
|
-
* otherwise repeat — a database, an auditor, a publisher:
|
|
180
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
181
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
147
182
|
*
|
|
148
183
|
* ```ts
|
|
149
|
-
* const
|
|
150
|
-
* export const createUser =
|
|
184
|
+
* export const router = api.database(database);
|
|
185
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
151
186
|
* ```
|
|
152
187
|
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*/
|
|
158
|
-
readonly endpoints: EndpointFactory<[], '', Logger>;
|
|
159
|
-
/** `api.get('/users')` — sugar for `api.endpoints.get('/users')`. */
|
|
160
|
-
get<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "GET", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
161
|
-
post<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "POST", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
162
|
-
put<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PUT", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
163
|
-
patch<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PATCH", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
164
|
-
delete<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "DELETE", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
165
|
-
options<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "OPTIONS", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
166
|
-
/**
|
|
167
|
-
* What authenticates this surface.
|
|
168
|
-
*
|
|
169
|
-
* An edge like `.calls()` — the auth server learns this origin, and the two
|
|
170
|
-
* share a cookie domain — but a named one, because *who authenticates me* is
|
|
171
|
-
* a different fact from *who I happen to call*, and only one of them decides
|
|
172
|
-
* what a request is allowed to be. A surface with two of the first is a
|
|
173
|
-
* mistake; two of the second is Tuesday.
|
|
188
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
189
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
190
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
191
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
174
192
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* shares, whether the server is mounted in this process, deployed beside it,
|
|
178
|
-
* or an OIDC issuer somebody else runs.
|
|
193
|
+
* `dependsOn` is deliberately not here. It is per endpoint: what the API's
|
|
194
|
+
* process reaches is the edges of the endpoints it serves.
|
|
179
195
|
*/
|
|
180
|
-
|
|
196
|
+
readonly database: Endpoints['database'];
|
|
197
|
+
readonly session: Endpoints['session'];
|
|
198
|
+
readonly auditor: Endpoints['auditor'];
|
|
199
|
+
readonly actor: Endpoints['actor'];
|
|
200
|
+
readonly authorizer: Endpoints['authorizer'];
|
|
201
|
+
readonly authorize: Endpoints['authorize'];
|
|
202
|
+
readonly rls: Endpoints['rls'];
|
|
203
|
+
readonly route: Endpoints['route'];
|
|
181
204
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* **Not `.dependsOn()`, and the difference matters.** An endpoint's
|
|
185
|
-
* `.dependsOn()` injects a client into that handler and grants it exactly
|
|
186
|
-
* what it named. This grants nothing and injects nothing: it records that
|
|
187
|
-
* this API calls another surface, which is what puts this API's origin on
|
|
188
|
-
* that surface's trusted-origin list.
|
|
205
|
+
* What authenticates this surface.
|
|
189
206
|
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
207
|
+
* An edge — the auth server learns this origin, and the two share a cookie
|
|
208
|
+
* domain — but a named one, because *who authenticates me* is a different
|
|
209
|
+
* fact from *who an endpoint happens to call*, and only one of them decides
|
|
210
|
+
* what a request is allowed to be.
|
|
192
211
|
*
|
|
193
|
-
*
|
|
212
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
213
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
214
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
215
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
216
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
194
217
|
*/
|
|
195
|
-
|
|
218
|
+
auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
|
|
196
219
|
/**
|
|
197
|
-
* One surface node, with its endpoints left to
|
|
220
|
+
* One surface node, with its endpoints left to discovery.
|
|
198
221
|
*
|
|
199
222
|
* The three provided keys are one fact about this surface and two about its
|
|
200
223
|
* callers. Declaring the caller-derived pair here rather than having the
|
|
@@ -205,4 +228,5 @@ export declare class RestApi<TName extends string = string, const TAuthorizers e
|
|
|
205
228
|
declare(): Declaration[];
|
|
206
229
|
}
|
|
207
230
|
//#endregion
|
|
231
|
+
export { type Authenticator, InvalidHostLabel };
|
|
208
232
|
//# 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":[
|
|
1
|
+
{"version":3,"file":"rest-api.d.cts","names":[],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;;;;KA2DK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;EAUZ,YAAY;;;;;;;;;;;;;;;;;qBAmBA,QACZ,qCACM,iEACM,WAAW,QAAQ,UAAU;;mBAiDvB;;mBAEA;WAjDT,IAAI;;;;;;WAOJ,SAAS,QAAQ,aAAa;;;;;;WAO9B;IACR;IACA;IACA;;;;;;;;;WAUQ,QAAQ;;;;;;;;;WAUR,WAAW;;WAGX,YAAY;;WAGZ,YAAY;EAErB,YACC,IAAI,cAAc,QACD,QAAQ,cAAc,eAEtB;;EAAA,gBAAgB;;WAoFzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;WAmBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,YAAY;WACZ,WAAW;WACX,KAAK;WACL,OAAO;;;;;;;;;;;;;;;EAgBhB,KAAK,WAAW,gBAAgB,QAAQ,OAAO;;;;;;;;;;EAiB/C,WAAW"}
|
package/dist/rest-api.d.mts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { i as Declarable, n as Construct, t as Authenticator } from "./construct-interface-DxfkFxkl.mjs";
|
|
2
|
+
import { n as Telemetry } from "./telemetry-BirKau0X.mjs";
|
|
3
|
+
import { D as BuiltInSecuritySchemeId } from "./Endpoint-DC7mreOr.mjs";
|
|
4
|
+
import { t as EndpointFactory } from "./EndpointFactory-DCmnCmkX.mjs";
|
|
5
|
+
import { ConstructName, Declaration, InvalidHostLabel } from "@geekmidas/manifest";
|
|
6
|
+
import { Service } from "@geekmidas/services";
|
|
5
7
|
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
6
8
|
import { Logger } from "@geekmidas/logger";
|
|
7
9
|
import { Telescope } from "@geekmidas/telescope";
|
|
8
10
|
//#region src/rest-api.d.ts
|
|
11
|
+
/** The factory a surface builds its endpoints from. */
|
|
12
|
+
type Endpoints = EndpointFactory<[], '', Logger>;
|
|
9
13
|
export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly []> {
|
|
10
14
|
/**
|
|
11
15
|
* The app that serves this surface, relative to the workspace root —
|
|
@@ -19,6 +23,18 @@ export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly
|
|
|
19
23
|
* `constructs` glob.
|
|
20
24
|
*/
|
|
21
25
|
path: string;
|
|
26
|
+
/**
|
|
27
|
+
* The label it answers on under a stage's domain — `api` for
|
|
28
|
+
* `api.myapp.com`, from `domains` — and under the project locally,
|
|
29
|
+
* `api.myapp.localhost`. Absent, its id kebab-cased.
|
|
30
|
+
*/
|
|
31
|
+
subdomain?: string;
|
|
32
|
+
/**
|
|
33
|
+
* More labels it answers on under the stage's domain, exactly as on its
|
|
34
|
+
* own — `['rest']` serves `rest.myapp.com` beside `api.myapp.com`. Its own
|
|
35
|
+
* label stays canonical: `<ID>_URL`, clients and OpenAPI are built on it.
|
|
36
|
+
*/
|
|
37
|
+
aliases?: readonly string[];
|
|
22
38
|
/**
|
|
23
39
|
* CORS tunables. The *origins* are never here — they are read off the
|
|
24
40
|
* constructs that declared an edge to this surface, which is the whole point
|
|
@@ -81,29 +97,44 @@ export interface RestApiConfig<TAuthorizers extends readonly string[] = readonly
|
|
|
81
97
|
* printed an import for. The entry already imports the surface.
|
|
82
98
|
*/
|
|
83
99
|
telescope?: Telescope;
|
|
100
|
+
/**
|
|
101
|
+
* What this surface's process emits — the `Telemetry` construct, passed
|
|
102
|
+
* like the logger: a fact about the process, not a grant to a route.
|
|
103
|
+
*
|
|
104
|
+
* An edge to the node, so the deploy hands this process the `OTEL_*` keys
|
|
105
|
+
* its stage resolves, and the build fails without the OpenTelemetry
|
|
106
|
+
* packages. Where the telemetry goes is never here: it is the deploy's,
|
|
107
|
+
* per stage.
|
|
108
|
+
*/
|
|
109
|
+
telemetry?: Telemetry;
|
|
84
110
|
}
|
|
85
111
|
/**
|
|
86
112
|
* What is *not* here, and why.
|
|
87
113
|
*
|
|
88
|
-
* `dependsOn`, `database`, `auditor` and `
|
|
114
|
+
* `dependsOn`, `database`, `auditor` and `.event(topic, …)` all inject a capability
|
|
89
115
|
* into a handler. Putting one on the surface hands it to every route the
|
|
90
116
|
* surface serves — a health check gets the database because a report needed it
|
|
91
|
-
* — which is the thing least privilege forbids
|
|
92
|
-
*
|
|
93
|
-
*
|
|
117
|
+
* — which is the thing least privilege forbids. They belong to the endpoint, or to a branch —
|
|
118
|
+
* `api.database(db)` — for a group of endpoints that genuinely share them. A
|
|
119
|
+
* branch is a new factory; the surface config stays free of grants.
|
|
94
120
|
*
|
|
95
121
|
* `auth` is not here either: `.auth(construct)` already declares it, and a
|
|
96
122
|
* second way to say the same thing is the duplication this whole model removes.
|
|
97
123
|
*
|
|
98
124
|
* What is left is what the *process* is rather than what a route may reach.
|
|
99
125
|
*/
|
|
100
|
-
export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName> {
|
|
126
|
+
export declare class RestApi<TName extends string = string, const TAuthorizers extends readonly string[] = readonly []> implements Declarable<TName>, Construct<TName, string> {
|
|
127
|
+
#private;
|
|
101
128
|
private readonly config;
|
|
102
|
-
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
103
|
-
private readonly dependencies;
|
|
104
129
|
/** Internal: how `.auth()` carries the authenticator into its copy. */
|
|
105
130
|
private readonly authenticator?;
|
|
106
131
|
readonly id: TName;
|
|
132
|
+
/**
|
|
133
|
+
* Its public address, `https://api.example.com` — what a worker or another
|
|
134
|
+
* surface's endpoint that `.dependsOn([api])` reads to build a link or a
|
|
135
|
+
* callback URL. The same `<ID>_URL` on every command and stage.
|
|
136
|
+
*/
|
|
137
|
+
readonly service: Service<Uncapitalize<TName>, string>;
|
|
107
138
|
/**
|
|
108
139
|
* Declared once and read by both `declare()` and anything that consumes this
|
|
109
140
|
* surface, so what the target publishes and what a consumer reads cannot
|
|
@@ -133,68 +164,60 @@ export declare class RestApi<TName extends string = string, const TAuthorizers e
|
|
|
133
164
|
readonly envParser: EnvironmentParser<{}>;
|
|
134
165
|
/** The Telescope instance, when this surface was given one. */
|
|
135
166
|
readonly telescope?: Telescope;
|
|
167
|
+
/** What this surface's process emits, when it was given a `Telemetry`. */
|
|
168
|
+
readonly telemetry?: Telemetry;
|
|
136
169
|
constructor(id: ConstructName<TName>, config: RestApiConfig<TAuthorizers>,
|
|
137
|
-
/** Internal: how `.calls()` carries edges into the copy it returns. */
|
|
138
|
-
dependencies?: readonly Dependency[],
|
|
139
170
|
/** Internal: how `.auth()` carries the authenticator into its copy. */
|
|
140
|
-
authenticator?:
|
|
171
|
+
authenticator?: Authenticator | undefined);
|
|
172
|
+
/** `api.get('/users')` — one route on this surface. */
|
|
173
|
+
readonly get: Endpoints['get'];
|
|
174
|
+
readonly post: Endpoints['post'];
|
|
175
|
+
readonly put: Endpoints['put'];
|
|
176
|
+
readonly patch: Endpoints['patch'];
|
|
177
|
+
readonly delete: Endpoints['delete'];
|
|
178
|
+
readonly options: Endpoints['options'];
|
|
141
179
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* `api.get('/users')` is the short form and covers most routes. Reach for
|
|
145
|
-
* this one when a *group* of endpoints shares something a single route would
|
|
146
|
-
* otherwise repeat — a database, an auditor, a publisher:
|
|
180
|
+
* A branch for a *group* of endpoints that shares what a single route would
|
|
181
|
+
* otherwise repeat — a database, an auditor, a publisher, a session:
|
|
147
182
|
*
|
|
148
183
|
* ```ts
|
|
149
|
-
* const
|
|
150
|
-
* export const createUser =
|
|
184
|
+
* export const router = api.database(database);
|
|
185
|
+
* export const createUser = router.post('/users').handle(({ db }) => …);
|
|
151
186
|
* ```
|
|
152
187
|
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*/
|
|
158
|
-
readonly endpoints: EndpointFactory<[], '', Logger>;
|
|
159
|
-
/** `api.get('/users')` — sugar for `api.endpoints.get('/users')`. */
|
|
160
|
-
get<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "GET", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
161
|
-
post<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "POST", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
162
|
-
put<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PUT", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
163
|
-
patch<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "PATCH", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
164
|
-
delete<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "DELETE", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
165
|
-
options<TPath extends string>(path: TPath): EndpointBuilder<RemoveTrailingSlash<TPath>, "OPTIONS", {}, [], Logger, undefined, unknown, undefined, string, readonly string[], undefined, string, ExtractStorageAuditAction<NonNullable<TAuditStorage>>, undefined, string>;
|
|
166
|
-
/**
|
|
167
|
-
* What authenticates this surface.
|
|
168
|
-
*
|
|
169
|
-
* An edge like `.calls()` — the auth server learns this origin, and the two
|
|
170
|
-
* share a cookie domain — but a named one, because *who authenticates me* is
|
|
171
|
-
* a different fact from *who I happen to call*, and only one of them decides
|
|
172
|
-
* what a request is allowed to be. A surface with two of the first is a
|
|
173
|
-
* mistake; two of the second is Tuesday.
|
|
188
|
+
* Each returns a new factory and leaves the surface as it was. That is the
|
|
189
|
+
* whole difference from putting the same thing in the surface's config: a
|
|
190
|
+
* group opts in, where the surface would grant it to every route it serves —
|
|
191
|
+
* a health check handed the database because a profile endpoint needed it.
|
|
174
192
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* shares, whether the server is mounted in this process, deployed beside it,
|
|
178
|
-
* or an OIDC issuer somebody else runs.
|
|
193
|
+
* `dependsOn` is deliberately not here. It is per endpoint: what the API's
|
|
194
|
+
* process reaches is the edges of the endpoints it serves.
|
|
179
195
|
*/
|
|
180
|
-
|
|
196
|
+
readonly database: Endpoints['database'];
|
|
197
|
+
readonly session: Endpoints['session'];
|
|
198
|
+
readonly auditor: Endpoints['auditor'];
|
|
199
|
+
readonly actor: Endpoints['actor'];
|
|
200
|
+
readonly authorizer: Endpoints['authorizer'];
|
|
201
|
+
readonly authorize: Endpoints['authorize'];
|
|
202
|
+
readonly rls: Endpoints['rls'];
|
|
203
|
+
readonly route: Endpoints['route'];
|
|
181
204
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* **Not `.dependsOn()`, and the difference matters.** An endpoint's
|
|
185
|
-
* `.dependsOn()` injects a client into that handler and grants it exactly
|
|
186
|
-
* what it named. This grants nothing and injects nothing: it records that
|
|
187
|
-
* this API calls another surface, which is what puts this API's origin on
|
|
188
|
-
* that surface's trusted-origin list.
|
|
205
|
+
* What authenticates this surface.
|
|
189
206
|
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
207
|
+
* An edge — the auth server learns this origin, and the two share a cookie
|
|
208
|
+
* domain — but a named one, because *who authenticates me* is a different
|
|
209
|
+
* fact from *who an endpoint happens to call*, and only one of them decides
|
|
210
|
+
* what a request is allowed to be.
|
|
192
211
|
*
|
|
193
|
-
*
|
|
212
|
+
* It declares the id, and keeps the construct: a session callback reads from
|
|
213
|
+
* it as `auth` — `session(async ({ auth }) => auth.getSession())` — which
|
|
214
|
+
* calls the construct's `verify(headers)`. That is the one thing every
|
|
215
|
+
* provider shares, whether the server is mounted in this process, deployed
|
|
216
|
+
* beside it, or an OIDC issuer somebody else runs.
|
|
194
217
|
*/
|
|
195
|
-
|
|
218
|
+
auth(construct: Authenticator): RestApi<TName, TAuthorizers>;
|
|
196
219
|
/**
|
|
197
|
-
* One surface node, with its endpoints left to
|
|
220
|
+
* One surface node, with its endpoints left to discovery.
|
|
198
221
|
*
|
|
199
222
|
* The three provided keys are one fact about this surface and two about its
|
|
200
223
|
* callers. Declaring the caller-derived pair here rather than having the
|
|
@@ -205,4 +228,5 @@ export declare class RestApi<TName extends string = string, const TAuthorizers e
|
|
|
205
228
|
declare(): Declaration[];
|
|
206
229
|
}
|
|
207
230
|
//#endregion
|
|
231
|
+
export { type Authenticator, InvalidHostLabel };
|
|
208
232
|
//# 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":[
|
|
1
|
+
{"version":3,"file":"rest-api.d.mts","names":[],"sources":["../src/rest-api.ts"],"mappings":";;;;;;;;;;;KA2DK,YAAY,wBAAwB;iBAExB,cAIhB;;;;;;;;;;;;EAaA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA;IACC;IACA;IACA;IACA;;;;;;;EAOD,cAAc;;;;;;;;;;;;;;;;;;;EAmBd,mBAAmB,uBAAuB;;;;;;;;;;EAU1C,SAAS;;;;;;;;EAQT,YAAY;;;;;;;;EAQZ,YAAY;;;;;;;;;;EAUZ,YAAY;;;;;;;;;;;;;;;;;qBAmBA,QACZ,qCACM,iEACM,WAAW,QAAQ,UAAU;;mBAiDvB;;mBAEA;WAjDT,IAAI;;;;;;WAOJ,SAAS,QAAQ,aAAa;;;;;;WAO9B;IACR;IACA;IACA;;;;;;;;;WAUQ,QAAQ;;;;;;;;;WAUR,WAAW;;WAGX,YAAY;;WAGZ,YAAY;EAErB,YACC,IAAI,cAAc,QACD,QAAQ,cAAc,eAEtB;;EAAA,gBAAgB;;WAoFzB,KAAK;WACL,MAAM;WACN,KAAK;WACL,OAAO;WACP,QAAQ;WACR,SAAS;;;;;;;;;;;;;;;;;;WAmBT,UAAU;WACV,SAAS;WACT,SAAS;WACT,OAAO;WACP,YAAY;WACZ,WAAW;WACX,KAAK;WACL,OAAO;;;;;;;;;;;;;;;EAgBhB,KAAK,WAAW,gBAAgB,QAAQ,OAAO;;;;;;;;;;EAiB/C,WAAW"}
|