@geekmidas/constructs 10.0.0-alpha.18 → 10.0.0-alpha.181
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-BcA8F0S-.d.cts} +16 -9
- package/dist/Cron-BcA8F0S-.d.cts.map +1 -0
- package/dist/{Cron-zsoSAwZo.d.cts → Cron-z2CiuQT_.d.mts} +15 -8
- package/dist/Cron-z2CiuQT_.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-BZvo34X2.d.cts +47 -0
- package/dist/CronBuilder-BZvo34X2.d.cts.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-BbgKo8OI.d.mts +47 -0
- package/dist/CronBuilder-BbgKo8OI.d.mts.map +1 -0
- package/dist/Endpoint-52z1P0Ue.cjs +581 -0
- package/dist/Endpoint-52z1P0Ue.cjs.map +1 -0
- package/dist/{Endpoint-oS-Fe3d_.d.mts → Endpoint-CIDUreMW.d.mts} +104 -23
- package/dist/Endpoint-CIDUreMW.d.mts.map +1 -0
- package/dist/{Endpoint-DBflWAe4.d.cts → Endpoint-COisi9jw.d.cts} +101 -20
- package/dist/Endpoint-COisi9jw.d.cts.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/{index-Cc4kKPag.d.mts → EndpointFactory-CIM80WIK.d.mts} +189 -106
- package/dist/EndpointFactory-CIM80WIK.d.mts.map +1 -0
- package/dist/{index-C1ZwNOOk.d.cts → EndpointFactory-CfBg6jJE.d.cts} +187 -104
- package/dist/EndpointFactory-CfBg6jJE.d.cts.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/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-Ci_Cc-WZ.d.mts +129 -0
- package/dist/ObjectSubscriberBuilder-Ci_Cc-WZ.d.mts.map +1 -0
- package/dist/ObjectSubscriberBuilder-DWtLxfAJ.d.cts +129 -0
- package/dist/ObjectSubscriberBuilder-DWtLxfAJ.d.cts.map +1 -0
- package/dist/ProcessorBuilder-CdLwJK4k.d.mts +216 -0
- package/dist/ProcessorBuilder-CdLwJK4k.d.mts.map +1 -0
- package/dist/ProcessorBuilder-ClD7tmEe.d.cts +216 -0
- package/dist/ProcessorBuilder-ClD7tmEe.d.cts.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-CjULiiDN.d.mts +75 -0
- package/dist/QueueBuilder-CjULiiDN.d.mts.map +1 -0
- package/dist/QueueBuilder-CrZL8HHs.mjs +118 -0
- package/dist/QueueBuilder-CrZL8HHs.mjs.map +1 -0
- package/dist/QueueBuilder-Dacm9qAv.d.cts +75 -0
- package/dist/QueueBuilder-Dacm9qAv.d.cts.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-CutSfNlr.d.mts +274 -0
- package/dist/auth-CutSfNlr.d.mts.map +1 -0
- package/dist/auth-b9ADezz9.d.cts +274 -0
- package/dist/auth-b9ADezz9.d.cts.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-9wLNSy3O.d.cts +44 -0
- package/dist/cache-9wLNSy3O.d.cts.map +1 -0
- package/dist/cache-BFPs_CGs.d.mts +44 -0
- package/dist/cache-BFPs_CGs.d.mts.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-CVoejIpo.d.cts} +79 -8
- package/dist/construct-interface-CVoejIpo.d.cts.map +1 -0
- package/dist/{construct-interface-DgXTJcOD.d.cts → construct-interface-Nw5Dt9AC.d.mts} +79 -8
- package/dist/construct-interface-Nw5Dt9AC.d.mts.map +1 -0
- package/dist/construct-interface.cjs +62 -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 +59 -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/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-JI5uN1SF.d.cts +201 -0
- package/dist/fake-JI5uN1SF.d.cts.map +1 -0
- package/dist/fake-zpuXpBmY.d.mts +201 -0
- package/dist/fake-zpuXpBmY.d.mts.map +1 -0
- package/dist/file-server.cjs +170 -49
- package/dist/file-server.cjs.map +1 -1
- package/dist/file-server.d.cts +148 -16
- package/dist/file-server.d.cts.map +1 -1
- package/dist/file-server.d.mts +148 -16
- package/dist/file-server.d.mts.map +1 -1
- package/dist/file-server.mjs +168 -51
- 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-CXLU7h_8.d.cts +195 -0
- package/dist/inbox-CXLU7h_8.d.cts.map +1 -0
- package/dist/inbox-DYFsLd9A.d.mts +195 -0
- package/dist/inbox-DYFsLd9A.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-BpE9_6l5.d.mts +115 -0
- package/dist/index-BpE9_6l5.d.mts.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-zRChehJ9.d.cts +115 -0
- package/dist/index-zRChehJ9.d.cts.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-5PAqFBzo.d.mts +216 -0
- package/dist/kysely-5PAqFBzo.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/kysely-lxNUBSTP.d.cts +216 -0
- package/dist/kysely-lxNUBSTP.d.cts.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 +79 -0
- package/dist/mobile-app.cjs.map +1 -0
- package/dist/mobile-app.d.cts +78 -0
- package/dist/mobile-app.d.cts.map +1 -0
- package/dist/mobile-app.d.mts +78 -0
- package/dist/mobile-app.d.mts.map +1 -0
- package/dist/mobile-app.mjs +78 -0
- package/dist/mobile-app.mjs.map +1 -0
- package/dist/object-storage.cjs +50 -7
- package/dist/object-storage.cjs.map +1 -1
- package/dist/object-storage.d.cts +37 -3
- package/dist/object-storage.d.cts.map +1 -1
- package/dist/object-storage.d.mts +37 -3
- package/dist/object-storage.d.mts.map +1 -1
- package/dist/object-storage.mjs +49 -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/readOnlyStorage-C7bCe-z5.cjs +101 -0
- package/dist/readOnlyStorage-C7bCe-z5.cjs.map +1 -0
- package/dist/readOnlyStorage-DMCeLuS2.mjs +78 -0
- package/dist/readOnlyStorage-DMCeLuS2.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 +140 -10
- package/dist/site.cjs.map +1 -1
- package/dist/site.d.cts +156 -3
- package/dist/site.d.cts.map +1 -1
- package/dist/site.d.mts +156 -3
- package/dist/site.d.mts.map +1 -1
- package/dist/site.mjs +120 -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-BbLyS7ln.d.cts +57 -0
- package/dist/telemetry-BbLyS7ln.d.cts.map +1 -0
- package/dist/telemetry-DWX-qKUh.d.mts +57 -0
- package/dist/telemetry-DWX-qKUh.d.mts.map +1 -0
- package/dist/telemetry.cjs +64 -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 +63 -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-9ndLBolx.d.cts +1207 -0
- package/dist/websocket-api-9ndLBolx.d.cts.map +1 -0
- package/dist/websocket-api-BPPXF79i.d.mts +1207 -0
- package/dist/websocket-api-BPPXF79i.d.mts.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-CoKPJJRl.cjs +1895 -0
- package/dist/websocket-api-CoKPJJRl.cjs.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
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region src/encryption/cipher.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The cipher behind an `Encryption` construct, and the format it writes.
|
|
4
|
+
*
|
|
5
|
+
* Every ciphertext names the key that wrote it — `gkm1.<keyId>.<payload>` — so
|
|
6
|
+
* `decrypt` never has to guess, a rotated key still opens what it wrote, and
|
|
7
|
+
* retiring a key is a decision made against data rather than a hope. The
|
|
8
|
+
* format version leads, so the day it has to change, both can be read.
|
|
9
|
+
*
|
|
10
|
+
* Two backends, picked by the scheme of the construct's URL, the way a queue's
|
|
11
|
+
* connection string picks its broker:
|
|
12
|
+
*
|
|
13
|
+
* - `aes256gcm://` — a keyring this process holds: AES-256-GCM with the newest
|
|
14
|
+
* key, HMAC-SHA256 for the blind index. Local, test and server stages.
|
|
15
|
+
* - `kms://` — envelope encryption under an AWS KMS key, and a KMS HMAC key for
|
|
16
|
+
* the index. The key material never leaves KMS. See `./kms`.
|
|
17
|
+
*/
|
|
18
|
+
/** What a handler is given: `services.pii.encrypt(…)` and the rest. */
|
|
19
|
+
interface Cipher {
|
|
20
|
+
/** Plaintext in, a self-describing ciphertext string out. */
|
|
21
|
+
encrypt(plaintext: string): Promise<string>;
|
|
22
|
+
/** Opens any ciphertext this construct wrote, under whichever key wrote it. */
|
|
23
|
+
decrypt(ciphertext: string): Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* A blind index: the same value always gives the same string, so an
|
|
26
|
+
* encrypted column can still be looked up by an indexed column beside it.
|
|
27
|
+
*
|
|
28
|
+
* Deterministic on purpose, which is also why its key never rotates — a
|
|
29
|
+
* rotated index key would make every stored index miss.
|
|
30
|
+
*/
|
|
31
|
+
index(value: string): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* The same plaintext under the current key — what a sweep runs over a
|
|
34
|
+
* column before an old key is retired. Unchanged when it is already current.
|
|
35
|
+
*/
|
|
36
|
+
reencrypt(ciphertext: string): Promise<string>;
|
|
37
|
+
}
|
|
38
|
+
declare class EncryptionUrlInvalid extends Error {
|
|
39
|
+
readonly construct: string;
|
|
40
|
+
readonly reason: string;
|
|
41
|
+
constructor(construct: string, reason: string);
|
|
42
|
+
}
|
|
43
|
+
declare class UnknownEncryptionScheme extends Error {
|
|
44
|
+
readonly construct: string;
|
|
45
|
+
readonly scheme: string;
|
|
46
|
+
constructor(construct: string, scheme: string);
|
|
47
|
+
}
|
|
48
|
+
declare class CiphertextMalformed extends Error {
|
|
49
|
+
readonly construct: string;
|
|
50
|
+
constructor(construct: string);
|
|
51
|
+
}
|
|
52
|
+
declare class EncryptionKeyRetired extends Error {
|
|
53
|
+
readonly construct: string;
|
|
54
|
+
readonly keyId: string;
|
|
55
|
+
constructor(construct: string, keyId: string);
|
|
56
|
+
}
|
|
57
|
+
declare class CiphertextNotAuthentic extends Error {
|
|
58
|
+
readonly construct: string;
|
|
59
|
+
constructor(construct: string);
|
|
60
|
+
}
|
|
61
|
+
declare class CurrentKeyCannotRetire extends Error {
|
|
62
|
+
readonly construct: string;
|
|
63
|
+
readonly keyId: string;
|
|
64
|
+
constructor(construct: string, keyId: string);
|
|
65
|
+
}
|
|
66
|
+
/** A local keyring: newest key first, and the index key that never rotates. */
|
|
67
|
+
interface Keyring {
|
|
68
|
+
keys: {
|
|
69
|
+
id: string;
|
|
70
|
+
key: Buffer;
|
|
71
|
+
}[];
|
|
72
|
+
index: Buffer;
|
|
73
|
+
}
|
|
74
|
+
/** Parse `aes256gcm://local?keys=k2.<key>,k1.<key>&index=<key>`. */
|
|
75
|
+
declare function parseKeyring(construct: string, url: string): Keyring;
|
|
76
|
+
declare function formatKeyring(keyring: Keyring): string;
|
|
77
|
+
/** A keyring with one fresh key, `k1`, and a fresh index key. */
|
|
78
|
+
declare function generateKeyring(): string;
|
|
79
|
+
/**
|
|
80
|
+
* The keyring with a new current key in front, and every older one kept.
|
|
81
|
+
*
|
|
82
|
+
* Nothing is dropped: what the old keys wrote still has to open until a sweep
|
|
83
|
+
* has re-encrypted it — see {@link retireKey}.
|
|
84
|
+
*/
|
|
85
|
+
declare function rotateKeyring(construct: string, url: string): string;
|
|
86
|
+
/** The keyring without `keyId`, which must not be the current key. */
|
|
87
|
+
declare function retireKey(construct: string, url: string, keyId: string): string;
|
|
88
|
+
/** Says, once per key per process, that a value is still under an old key. */
|
|
89
|
+
type StaleKeyReporter = (keyId: string, current: string) => void;
|
|
90
|
+
/** The `aes256gcm://` cipher: a keyring held in process. */
|
|
91
|
+
declare function keyringCipher(construct: string, url: string, onStaleKey?: StaleKeyReporter): Cipher;
|
|
92
|
+
/**
|
|
93
|
+
* A cipher for a URL scheme other than `aes256gcm:` — `kms:` on AWS.
|
|
94
|
+
*
|
|
95
|
+
* Registered by the entry point a build generates, and only for a target
|
|
96
|
+
* whose keys live there, so a process that never holds such a key never
|
|
97
|
+
* imports the SDK it would need.
|
|
98
|
+
*/
|
|
99
|
+
interface CipherDriver {
|
|
100
|
+
/** The scheme it opens, with its colon: `'kms:'`. */
|
|
101
|
+
readonly scheme: string;
|
|
102
|
+
open(construct: string, url: string): Cipher;
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { CurrentKeyCannotRetire as a, Keyring as c, generateKeyring as d, keyringCipher as f, rotateKeyring as h, CiphertextNotAuthentic as i, UnknownEncryptionScheme as l, retireKey as m, CipherDriver as n, EncryptionKeyRetired as o, parseKeyring as p, CiphertextMalformed as r, EncryptionUrlInvalid as s, Cipher as t, formatKeyring as u };
|
|
106
|
+
//# sourceMappingURL=cipher-DSDxPRIp.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cipher-DSDxPRIp.d.cts","names":[],"sources":["../src/encryption/cipher.ts"],"mappings":";;;;;;;;;;;;;;;;;;UAyBiB;;EAEhB,QAAQ,oBAAoB;;EAE5B,QAAQ,qBAAqB;;;;;;;;EAQ7B,MAAM,gBAAgB;;;;;EAKtB,UAAU,qBAAqB;;cAanB,6BAA6B;WAE/B;WACA;EAFV,YACU,mBACA;;cASE,gCAAgC;WAElC;WACA;EAFV,YACU,mBACA;;cASE,4BAA4B;WACnB;EAArB,YAAqB;;cAQT,6BAA6B;WAE/B;WACA;EAFV,YACU,mBACA;;cASE,+BAA+B;WACtB;EAArB,YAAqB;;cAQT,+BAA+B;WAEjC;WACA;EAFV,YACU,mBACA;;;UAuEM;EAChB;IAAQ;IAAY,KAAK;;EACzB,OAAO;;;iBAIQ,aAAa,mBAAmB,cAAc;iBAqC9C,cAAc,SAAS;;iBAQvB;;;;;;;iBAaA,cAAc,mBAAmB;;iBAYjC,UACf,mBACA,aACA;;KAiBW,oBAAoB,eAAe;;iBAG/B,cACf,mBACA,aACA,aAAY,mBACV;;;;;;;;UAsDc;;WAEP;EACT,KAAK,mBAAmB,cAAc"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region src/encryption/cipher.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The cipher behind an `Encryption` construct, and the format it writes.
|
|
4
|
+
*
|
|
5
|
+
* Every ciphertext names the key that wrote it — `gkm1.<keyId>.<payload>` — so
|
|
6
|
+
* `decrypt` never has to guess, a rotated key still opens what it wrote, and
|
|
7
|
+
* retiring a key is a decision made against data rather than a hope. The
|
|
8
|
+
* format version leads, so the day it has to change, both can be read.
|
|
9
|
+
*
|
|
10
|
+
* Two backends, picked by the scheme of the construct's URL, the way a queue's
|
|
11
|
+
* connection string picks its broker:
|
|
12
|
+
*
|
|
13
|
+
* - `aes256gcm://` — a keyring this process holds: AES-256-GCM with the newest
|
|
14
|
+
* key, HMAC-SHA256 for the blind index. Local, test and server stages.
|
|
15
|
+
* - `kms://` — envelope encryption under an AWS KMS key, and a KMS HMAC key for
|
|
16
|
+
* the index. The key material never leaves KMS. See `./kms`.
|
|
17
|
+
*/
|
|
18
|
+
/** What a handler is given: `services.pii.encrypt(…)` and the rest. */
|
|
19
|
+
interface Cipher {
|
|
20
|
+
/** Plaintext in, a self-describing ciphertext string out. */
|
|
21
|
+
encrypt(plaintext: string): Promise<string>;
|
|
22
|
+
/** Opens any ciphertext this construct wrote, under whichever key wrote it. */
|
|
23
|
+
decrypt(ciphertext: string): Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* A blind index: the same value always gives the same string, so an
|
|
26
|
+
* encrypted column can still be looked up by an indexed column beside it.
|
|
27
|
+
*
|
|
28
|
+
* Deterministic on purpose, which is also why its key never rotates — a
|
|
29
|
+
* rotated index key would make every stored index miss.
|
|
30
|
+
*/
|
|
31
|
+
index(value: string): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* The same plaintext under the current key — what a sweep runs over a
|
|
34
|
+
* column before an old key is retired. Unchanged when it is already current.
|
|
35
|
+
*/
|
|
36
|
+
reencrypt(ciphertext: string): Promise<string>;
|
|
37
|
+
}
|
|
38
|
+
declare class EncryptionUrlInvalid extends Error {
|
|
39
|
+
readonly construct: string;
|
|
40
|
+
readonly reason: string;
|
|
41
|
+
constructor(construct: string, reason: string);
|
|
42
|
+
}
|
|
43
|
+
declare class UnknownEncryptionScheme extends Error {
|
|
44
|
+
readonly construct: string;
|
|
45
|
+
readonly scheme: string;
|
|
46
|
+
constructor(construct: string, scheme: string);
|
|
47
|
+
}
|
|
48
|
+
declare class CiphertextMalformed extends Error {
|
|
49
|
+
readonly construct: string;
|
|
50
|
+
constructor(construct: string);
|
|
51
|
+
}
|
|
52
|
+
declare class EncryptionKeyRetired extends Error {
|
|
53
|
+
readonly construct: string;
|
|
54
|
+
readonly keyId: string;
|
|
55
|
+
constructor(construct: string, keyId: string);
|
|
56
|
+
}
|
|
57
|
+
declare class CiphertextNotAuthentic extends Error {
|
|
58
|
+
readonly construct: string;
|
|
59
|
+
constructor(construct: string);
|
|
60
|
+
}
|
|
61
|
+
declare class CurrentKeyCannotRetire extends Error {
|
|
62
|
+
readonly construct: string;
|
|
63
|
+
readonly keyId: string;
|
|
64
|
+
constructor(construct: string, keyId: string);
|
|
65
|
+
}
|
|
66
|
+
/** A local keyring: newest key first, and the index key that never rotates. */
|
|
67
|
+
interface Keyring {
|
|
68
|
+
keys: {
|
|
69
|
+
id: string;
|
|
70
|
+
key: Buffer;
|
|
71
|
+
}[];
|
|
72
|
+
index: Buffer;
|
|
73
|
+
}
|
|
74
|
+
/** Parse `aes256gcm://local?keys=k2.<key>,k1.<key>&index=<key>`. */
|
|
75
|
+
declare function parseKeyring(construct: string, url: string): Keyring;
|
|
76
|
+
declare function formatKeyring(keyring: Keyring): string;
|
|
77
|
+
/** A keyring with one fresh key, `k1`, and a fresh index key. */
|
|
78
|
+
declare function generateKeyring(): string;
|
|
79
|
+
/**
|
|
80
|
+
* The keyring with a new current key in front, and every older one kept.
|
|
81
|
+
*
|
|
82
|
+
* Nothing is dropped: what the old keys wrote still has to open until a sweep
|
|
83
|
+
* has re-encrypted it — see {@link retireKey}.
|
|
84
|
+
*/
|
|
85
|
+
declare function rotateKeyring(construct: string, url: string): string;
|
|
86
|
+
/** The keyring without `keyId`, which must not be the current key. */
|
|
87
|
+
declare function retireKey(construct: string, url: string, keyId: string): string;
|
|
88
|
+
/** Says, once per key per process, that a value is still under an old key. */
|
|
89
|
+
type StaleKeyReporter = (keyId: string, current: string) => void;
|
|
90
|
+
/** The `aes256gcm://` cipher: a keyring held in process. */
|
|
91
|
+
declare function keyringCipher(construct: string, url: string, onStaleKey?: StaleKeyReporter): Cipher;
|
|
92
|
+
/**
|
|
93
|
+
* A cipher for a URL scheme other than `aes256gcm:` — `kms:` on AWS.
|
|
94
|
+
*
|
|
95
|
+
* Registered by the entry point a build generates, and only for a target
|
|
96
|
+
* whose keys live there, so a process that never holds such a key never
|
|
97
|
+
* imports the SDK it would need.
|
|
98
|
+
*/
|
|
99
|
+
interface CipherDriver {
|
|
100
|
+
/** The scheme it opens, with its colon: `'kms:'`. */
|
|
101
|
+
readonly scheme: string;
|
|
102
|
+
open(construct: string, url: string): Cipher;
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { CurrentKeyCannotRetire as a, Keyring as c, generateKeyring as d, keyringCipher as f, rotateKeyring as h, CiphertextNotAuthentic as i, UnknownEncryptionScheme as l, retireKey as m, CipherDriver as n, EncryptionKeyRetired as o, parseKeyring as p, CiphertextMalformed as r, EncryptionUrlInvalid as s, Cipher as t, formatKeyring as u };
|
|
106
|
+
//# sourceMappingURL=cipher-DSDxPRIp.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cipher-DSDxPRIp.d.mts","names":[],"sources":["../src/encryption/cipher.ts"],"mappings":";;;;;;;;;;;;;;;;;;UAyBiB;;EAEhB,QAAQ,oBAAoB;;EAE5B,QAAQ,qBAAqB;;;;;;;;EAQ7B,MAAM,gBAAgB;;;;;EAKtB,UAAU,qBAAqB;;cAanB,6BAA6B;WAE/B;WACA;EAFV,YACU,mBACA;;cASE,gCAAgC;WAElC;WACA;EAFV,YACU,mBACA;;cASE,4BAA4B;WACnB;EAArB,YAAqB;;cAQT,6BAA6B;WAE/B;WACA;EAFV,YACU,mBACA;;cASE,+BAA+B;WACtB;EAArB,YAAqB;;cAQT,+BAA+B;WAEjC;WACA;EAFV,YACU,mBACA;;;UAuEM;EAChB;IAAQ;IAAY,KAAK;;EACzB,OAAO;;;iBAIQ,aAAa,mBAAmB,cAAc;iBAqC9C,cAAc,SAAS;;iBAQvB;;;;;;;iBAaA,cAAc,mBAAmB;;iBAYjC,UACf,mBACA,aACA;;KAiBW,oBAAoB,eAAe;;iBAG/B,cACf,mBACA,aACA,aAAY,mBACV;;;;;;;;UAsDc;;WAEP;EACT,KAAK,mBAAmB,cAAc"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
2
|
+
import { Service, ServiceRegisterOptions } from "@geekmidas/services";
|
|
1
3
|
import { Declaration, Dependency } from "@geekmidas/manifest";
|
|
2
|
-
import { Service } from "@geekmidas/services";
|
|
3
4
|
//#region src/construct-interface.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* @typeParam TName - the construct's canonical id, PascalCase. Keeping it a
|
|
@@ -25,8 +26,8 @@ interface Construct<TName extends string = string, TClient = never> {
|
|
|
25
26
|
* The consumable face — the address this construct owns, as a client.
|
|
26
27
|
*
|
|
27
28
|
* A field assigned once rather than a getter. `Construct.getEnvironment`
|
|
28
|
-
*
|
|
29
|
-
* on every access
|
|
29
|
+
* and `ServiceDiscovery` cache by service *object*, so a getter returning a
|
|
30
|
+
* fresh literal on every access would never hit either cache.
|
|
30
31
|
*/
|
|
31
32
|
readonly service: [TClient] extends [never] ? never : Service<Uncapitalize<TName>, TClient>;
|
|
32
33
|
}
|
|
@@ -43,6 +44,17 @@ interface Declarable<TName extends string = string> {
|
|
|
43
44
|
readonly id: TName;
|
|
44
45
|
declare(): Declaration[];
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* A construct that authenticates requests — what `RestApi.auth()` takes.
|
|
49
|
+
*
|
|
50
|
+
* `verify` is the one thing every provider shares: given a request's headers,
|
|
51
|
+
* whose request is it — the session, or `null` when there is none. Whether the
|
|
52
|
+
* provider is a server mounted beside the API, deployed elsewhere, or an issuer
|
|
53
|
+
* somebody else runs is its own business; a surface only ever asks this.
|
|
54
|
+
*/
|
|
55
|
+
interface Authenticator<TSession = unknown> extends Declarable {
|
|
56
|
+
verify(headers: Headers, envParser: EnvironmentParser<{}>): Promise<TSession | null>;
|
|
57
|
+
}
|
|
46
58
|
/**
|
|
47
59
|
* The edge that points at a construct.
|
|
48
60
|
*
|
|
@@ -56,6 +68,38 @@ interface Declarable<TName extends string = string> {
|
|
|
56
68
|
* @throws {NotAConstruct} when the value declares nothing under its own id.
|
|
57
69
|
*/
|
|
58
70
|
declare function edgeTo(construct: Declarable): Dependency;
|
|
71
|
+
/**
|
|
72
|
+
* A construct whose public half is a node of its own: what a site's or a
|
|
73
|
+
* mobile app's plain edge points at instead of the construct itself.
|
|
74
|
+
*
|
|
75
|
+
* A `FileServer` is the one: its own node is the bucket, which presigns and
|
|
76
|
+
* writes, and a frontend that only shows the objects needs the address they
|
|
77
|
+
* are served on and nothing that can write to them.
|
|
78
|
+
*/
|
|
79
|
+
interface HasPublicFace {
|
|
80
|
+
readonly publicFace: Declarable;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A construct's server half, as a frontend names it: `documents.server`,
|
|
84
|
+
* `assets.server`.
|
|
85
|
+
*
|
|
86
|
+
* A `Declarable` and not a `Consumable`, so only a site or a mobile app can
|
|
87
|
+
* depend on it — a backend's plain edge is already the full one. A frontend's
|
|
88
|
+
* plain edge to a bucket holds where its links are signed and nothing that
|
|
89
|
+
* writes to it; this one hands its server half the connection and the key
|
|
90
|
+
* pair too.
|
|
91
|
+
*/
|
|
92
|
+
interface ServerHalf extends Declarable {
|
|
93
|
+
readonly serverHalf: true;
|
|
94
|
+
}
|
|
95
|
+
/** `construct`, as the server half a frontend's edge can name. */
|
|
96
|
+
declare function serverHalfOf(construct: Declarable): ServerHalf;
|
|
97
|
+
/**
|
|
98
|
+
* The edge a frontend — a site or a mobile app — has to a construct: to its
|
|
99
|
+
* server half when it named one (`.server`, marked `server: true`), to its
|
|
100
|
+
* public face where it has one, to the construct itself otherwise.
|
|
101
|
+
*/
|
|
102
|
+
declare function frontendEdgeTo(construct: Declarable): Dependency;
|
|
59
103
|
/** What consuming a construct hands you. */
|
|
60
104
|
type Infer<C> = C extends Construct<string, infer TClient> ? TClient : never;
|
|
61
105
|
/** A construct's canonical id. */
|
|
@@ -102,6 +146,28 @@ declare function servicesOf<const T extends readonly Consumable[]>(constructs: T
|
|
|
102
146
|
* calls accumulate the way `.services()` already does.
|
|
103
147
|
*/
|
|
104
148
|
declare function idsOf(constructs: readonly Consumable[], existing?: readonly string[]): string[];
|
|
149
|
+
/**
|
|
150
|
+
* The edges after `.database(source)` names a builder's database.
|
|
151
|
+
*
|
|
152
|
+
* A database replaces the one before it — a worker's default, overridden by a
|
|
153
|
+
* runnable that names its own — so the edge the previous one added goes with
|
|
154
|
+
* it. Left behind, a Lambda built from a queue that moved to another database
|
|
155
|
+
* would still be granted the worker's.
|
|
156
|
+
*
|
|
157
|
+
* Only an edge `.database()` added is removed, which is why it is returned as
|
|
158
|
+
* `_databaseEdge` for the next call to read — and not even that one when
|
|
159
|
+
* `.dependsOn()` has since named the same construct, since the handler still
|
|
160
|
+
* reaches it through `services`.
|
|
161
|
+
*/
|
|
162
|
+
declare function databaseEdges(current: {
|
|
163
|
+
constructs: readonly string[];
|
|
164
|
+
edge: string | undefined;
|
|
165
|
+
service: Service | undefined;
|
|
166
|
+
services: readonly Service[];
|
|
167
|
+
}, source: unknown): {
|
|
168
|
+
_constructs: string[];
|
|
169
|
+
_databaseEdge: string | undefined;
|
|
170
|
+
};
|
|
105
171
|
/** Something that is not a construct was passed to `.dependsOn()`. */
|
|
106
172
|
declare class NotAConstruct extends Error {
|
|
107
173
|
readonly value: unknown;
|
|
@@ -118,11 +184,16 @@ declare function isConsumable(value: unknown): value is Consumable;
|
|
|
118
184
|
/**
|
|
119
185
|
* The service behind either face.
|
|
120
186
|
*
|
|
121
|
-
* `.database()` and the
|
|
122
|
-
* `Service` before and still do, because
|
|
123
|
-
*
|
|
187
|
+
* `.database()` and the auditor slot take a construct now; they took a
|
|
188
|
+
* `Service` before and still do, because not every hand-written service has a
|
|
189
|
+
* construct to stand for it.
|
|
124
190
|
*/
|
|
125
191
|
declare function serviceOf<TName extends string, TClient>(source: Consumable<TName, TClient> | Service<TName, TClient>): Service<TName, TClient>;
|
|
192
|
+
/**
|
|
193
|
+
* A surface's or a site's public address, read from its `<ID>_URL` — the
|
|
194
|
+
* client a `RestApi` or a `StaticSite` hands whatever `.dependsOn()` it.
|
|
195
|
+
*/
|
|
196
|
+
declare function publicUrl(options: ServiceRegisterOptions, key: string): string;
|
|
126
197
|
//#endregion
|
|
127
|
-
export {
|
|
128
|
-
//# sourceMappingURL=construct-interface-
|
|
198
|
+
export { serverHalfOf as _, HasPublicFace as a, NotAConstruct as c, databaseEdges as d, edgeTo as f, publicUrl as g, isConsumable as h, Declarable as i, ServerHalf as l, idsOf as m, Construct as n, Infer as o, frontendEdgeTo as p, Consumable as r, NameOf as s, Authenticator as t, ServicesOf as u, serviceOf as v, servicesOf as y };
|
|
199
|
+
//# sourceMappingURL=construct-interface-CVoejIpo.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"construct-interface-CVoejIpo.d.cts","names":[],"sources":["../src/construct-interface.ts"],"mappings":";;;;;;;;;;;;;UA8BiB,UAAU,+BAA+B;;WAEhD,IAAI;;;;;;;;EASb,WAAW;;;;;;;;WASF,UAAU,mCAEhB,QAAQ,aAAa,QAAQ;;;;;;;;;;;UAYhB,WAAW;WAClB,IAAI;EACb,WAAW;;;;;;;;;;UAWK,cAAc,4BAA4B;EAC1D,OACC,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;;;;;;;;;;iBAeI,OAAO,WAAW,aAAa;;;;;;;;;UAkB9B;WACP,YAAY;;;;;;;;;;;;UAaL,mBAAmB;WAC1B;;;iBAIM,aAAa,WAAW,aAAa;;;;;;iBAcrC,eAAe,WAAW,aAAa;;KAS3C,MAAM,KACjB,UAAU,wBAAwB,WAAW;;KAGlC,OAAO,KAClB,UAAU,gBAAgB,kBAAkB;;;;;;;;;;;UAY5B,WAAW,+BAA+B;WACjD,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;EAC/C,WAAW;;;;;;;;;;KAWA,WAAW,mBAAmB,mBACxC,WAAW,IAAI,EAAE;;;;;;;;iBAUH,iBAAiB,mBAAmB,cACnD,YAAY,IACV,WAAW;;;;;;;;;;iBAiBE,MACf,qBAAqB,cACrB;;;;;;;;;;;;;;iBAkBe,cACf;EACC;EACA;EACA,SAAS;EACT,mBAAmB;GAEpB;EACI;EAAuB;;;cAgBf,sBAAsB;WACb;EAArB,YAAqB;;;;;;;;;iBAqBN,aAAa,iBAAiB,SAAS;;;;;;;;iBAmBvC,UAAU,sBAAsB,SAC/C,QAAQ,WAAW,OAAO,WAAW,QAAQ,OAAO,WAClD,QAAQ,OAAO;;;;;iBAYF,UACf,SAAS,wBACT"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Service } from "@geekmidas/services";
|
|
2
1
|
import { Declaration, Dependency } from "@geekmidas/manifest";
|
|
2
|
+
import { Service, ServiceRegisterOptions } from "@geekmidas/services";
|
|
3
|
+
import { EnvironmentParser } from "@geekmidas/envkit";
|
|
3
4
|
//#region src/construct-interface.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* @typeParam TName - the construct's canonical id, PascalCase. Keeping it a
|
|
@@ -25,8 +26,8 @@ interface Construct<TName extends string = string, TClient = never> {
|
|
|
25
26
|
* The consumable face — the address this construct owns, as a client.
|
|
26
27
|
*
|
|
27
28
|
* A field assigned once rather than a getter. `Construct.getEnvironment`
|
|
28
|
-
*
|
|
29
|
-
* on every access
|
|
29
|
+
* and `ServiceDiscovery` cache by service *object*, so a getter returning a
|
|
30
|
+
* fresh literal on every access would never hit either cache.
|
|
30
31
|
*/
|
|
31
32
|
readonly service: [TClient] extends [never] ? never : Service<Uncapitalize<TName>, TClient>;
|
|
32
33
|
}
|
|
@@ -43,6 +44,17 @@ interface Declarable<TName extends string = string> {
|
|
|
43
44
|
readonly id: TName;
|
|
44
45
|
declare(): Declaration[];
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* A construct that authenticates requests — what `RestApi.auth()` takes.
|
|
49
|
+
*
|
|
50
|
+
* `verify` is the one thing every provider shares: given a request's headers,
|
|
51
|
+
* whose request is it — the session, or `null` when there is none. Whether the
|
|
52
|
+
* provider is a server mounted beside the API, deployed elsewhere, or an issuer
|
|
53
|
+
* somebody else runs is its own business; a surface only ever asks this.
|
|
54
|
+
*/
|
|
55
|
+
interface Authenticator<TSession = unknown> extends Declarable {
|
|
56
|
+
verify(headers: Headers, envParser: EnvironmentParser<{}>): Promise<TSession | null>;
|
|
57
|
+
}
|
|
46
58
|
/**
|
|
47
59
|
* The edge that points at a construct.
|
|
48
60
|
*
|
|
@@ -56,6 +68,38 @@ interface Declarable<TName extends string = string> {
|
|
|
56
68
|
* @throws {NotAConstruct} when the value declares nothing under its own id.
|
|
57
69
|
*/
|
|
58
70
|
declare function edgeTo(construct: Declarable): Dependency;
|
|
71
|
+
/**
|
|
72
|
+
* A construct whose public half is a node of its own: what a site's or a
|
|
73
|
+
* mobile app's plain edge points at instead of the construct itself.
|
|
74
|
+
*
|
|
75
|
+
* A `FileServer` is the one: its own node is the bucket, which presigns and
|
|
76
|
+
* writes, and a frontend that only shows the objects needs the address they
|
|
77
|
+
* are served on and nothing that can write to them.
|
|
78
|
+
*/
|
|
79
|
+
interface HasPublicFace {
|
|
80
|
+
readonly publicFace: Declarable;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A construct's server half, as a frontend names it: `documents.server`,
|
|
84
|
+
* `assets.server`.
|
|
85
|
+
*
|
|
86
|
+
* A `Declarable` and not a `Consumable`, so only a site or a mobile app can
|
|
87
|
+
* depend on it — a backend's plain edge is already the full one. A frontend's
|
|
88
|
+
* plain edge to a bucket holds where its links are signed and nothing that
|
|
89
|
+
* writes to it; this one hands its server half the connection and the key
|
|
90
|
+
* pair too.
|
|
91
|
+
*/
|
|
92
|
+
interface ServerHalf extends Declarable {
|
|
93
|
+
readonly serverHalf: true;
|
|
94
|
+
}
|
|
95
|
+
/** `construct`, as the server half a frontend's edge can name. */
|
|
96
|
+
declare function serverHalfOf(construct: Declarable): ServerHalf;
|
|
97
|
+
/**
|
|
98
|
+
* The edge a frontend — a site or a mobile app — has to a construct: to its
|
|
99
|
+
* server half when it named one (`.server`, marked `server: true`), to its
|
|
100
|
+
* public face where it has one, to the construct itself otherwise.
|
|
101
|
+
*/
|
|
102
|
+
declare function frontendEdgeTo(construct: Declarable): Dependency;
|
|
59
103
|
/** What consuming a construct hands you. */
|
|
60
104
|
type Infer<C> = C extends Construct<string, infer TClient> ? TClient : never;
|
|
61
105
|
/** A construct's canonical id. */
|
|
@@ -102,6 +146,28 @@ declare function servicesOf<const T extends readonly Consumable[]>(constructs: T
|
|
|
102
146
|
* calls accumulate the way `.services()` already does.
|
|
103
147
|
*/
|
|
104
148
|
declare function idsOf(constructs: readonly Consumable[], existing?: readonly string[]): string[];
|
|
149
|
+
/**
|
|
150
|
+
* The edges after `.database(source)` names a builder's database.
|
|
151
|
+
*
|
|
152
|
+
* A database replaces the one before it — a worker's default, overridden by a
|
|
153
|
+
* runnable that names its own — so the edge the previous one added goes with
|
|
154
|
+
* it. Left behind, a Lambda built from a queue that moved to another database
|
|
155
|
+
* would still be granted the worker's.
|
|
156
|
+
*
|
|
157
|
+
* Only an edge `.database()` added is removed, which is why it is returned as
|
|
158
|
+
* `_databaseEdge` for the next call to read — and not even that one when
|
|
159
|
+
* `.dependsOn()` has since named the same construct, since the handler still
|
|
160
|
+
* reaches it through `services`.
|
|
161
|
+
*/
|
|
162
|
+
declare function databaseEdges(current: {
|
|
163
|
+
constructs: readonly string[];
|
|
164
|
+
edge: string | undefined;
|
|
165
|
+
service: Service | undefined;
|
|
166
|
+
services: readonly Service[];
|
|
167
|
+
}, source: unknown): {
|
|
168
|
+
_constructs: string[];
|
|
169
|
+
_databaseEdge: string | undefined;
|
|
170
|
+
};
|
|
105
171
|
/** Something that is not a construct was passed to `.dependsOn()`. */
|
|
106
172
|
declare class NotAConstruct extends Error {
|
|
107
173
|
readonly value: unknown;
|
|
@@ -118,11 +184,16 @@ declare function isConsumable(value: unknown): value is Consumable;
|
|
|
118
184
|
/**
|
|
119
185
|
* The service behind either face.
|
|
120
186
|
*
|
|
121
|
-
* `.database()` and the
|
|
122
|
-
* `Service` before and still do, because
|
|
123
|
-
*
|
|
187
|
+
* `.database()` and the auditor slot take a construct now; they took a
|
|
188
|
+
* `Service` before and still do, because not every hand-written service has a
|
|
189
|
+
* construct to stand for it.
|
|
124
190
|
*/
|
|
125
191
|
declare function serviceOf<TName extends string, TClient>(source: Consumable<TName, TClient> | Service<TName, TClient>): Service<TName, TClient>;
|
|
192
|
+
/**
|
|
193
|
+
* A surface's or a site's public address, read from its `<ID>_URL` — the
|
|
194
|
+
* client a `RestApi` or a `StaticSite` hands whatever `.dependsOn()` it.
|
|
195
|
+
*/
|
|
196
|
+
declare function publicUrl(options: ServiceRegisterOptions, key: string): string;
|
|
126
197
|
//#endregion
|
|
127
|
-
export {
|
|
128
|
-
//# sourceMappingURL=construct-interface-
|
|
198
|
+
export { serverHalfOf as _, HasPublicFace as a, NotAConstruct as c, databaseEdges as d, edgeTo as f, publicUrl as g, isConsumable as h, Declarable as i, ServerHalf as l, idsOf as m, Construct as n, Infer as o, frontendEdgeTo as p, Consumable as r, NameOf as s, Authenticator as t, ServicesOf as u, serviceOf as v, servicesOf as y };
|
|
199
|
+
//# sourceMappingURL=construct-interface-Nw5Dt9AC.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"construct-interface-Nw5Dt9AC.d.mts","names":[],"sources":["../src/construct-interface.ts"],"mappings":";;;;;;;;;;;;;UA8BiB,UAAU,+BAA+B;;WAEhD,IAAI;;;;;;;;EASb,WAAW;;;;;;;;WASF,UAAU,mCAEhB,QAAQ,aAAa,QAAQ;;;;;;;;;;;UAYhB,WAAW;WAClB,IAAI;EACb,WAAW;;;;;;;;;;UAWK,cAAc,4BAA4B;EAC1D,OACC,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;;;;;;;;;;iBAeI,OAAO,WAAW,aAAa;;;;;;;;;UAkB9B;WACP,YAAY;;;;;;;;;;;;UAaL,mBAAmB;WAC1B;;;iBAIM,aAAa,WAAW,aAAa;;;;;;iBAcrC,eAAe,WAAW,aAAa;;KAS3C,MAAM,KACjB,UAAU,wBAAwB,WAAW;;KAGlC,OAAO,KAClB,UAAU,gBAAgB,kBAAkB;;;;;;;;;;;UAY5B,WAAW,+BAA+B;WACjD,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;EAC/C,WAAW;;;;;;;;;;KAWA,WAAW,mBAAmB,mBACxC,WAAW,IAAI,EAAE;;;;;;;;iBAUH,iBAAiB,mBAAmB,cACnD,YAAY,IACV,WAAW;;;;;;;;;;iBAiBE,MACf,qBAAqB,cACrB;;;;;;;;;;;;;;iBAkBe,cACf;EACC;EACA;EACA,SAAS;EACT,mBAAmB;GAEpB;EACI;EAAuB;;;cAgBf,sBAAsB;WACb;EAArB,YAAqB;;;;;;;;;iBAqBN,aAAa,iBAAiB,SAAS;;;;;;;;iBAmBvC,UAAU,sBAAsB,SAC/C,QAAQ,WAAW,OAAO,WAAW,QAAQ,OAAO,WAClD,QAAQ,OAAO;;;;;iBAYF,UACf,SAAS,wBACT"}
|
|
@@ -20,6 +20,28 @@ function edgeTo(construct) {
|
|
|
20
20
|
kind: canonical.kind
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
+
/** `construct`, as the server half a frontend's edge can name. */
|
|
24
|
+
function serverHalfOf(construct) {
|
|
25
|
+
const declarations = construct.declare();
|
|
26
|
+
return {
|
|
27
|
+
id: construct.id,
|
|
28
|
+
declare: () => declarations,
|
|
29
|
+
serverHalf: true
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The edge a frontend — a site or a mobile app — has to a construct: to its
|
|
34
|
+
* server half when it named one (`.server`, marked `server: true`), to its
|
|
35
|
+
* public face where it has one, to the construct itself otherwise.
|
|
36
|
+
*/
|
|
37
|
+
function frontendEdgeTo(construct) {
|
|
38
|
+
if (construct.serverHalf) return {
|
|
39
|
+
...edgeTo(construct),
|
|
40
|
+
server: true
|
|
41
|
+
};
|
|
42
|
+
const face = construct.publicFace;
|
|
43
|
+
return edgeTo(face ?? construct);
|
|
44
|
+
}
|
|
23
45
|
/**
|
|
24
46
|
* The services of a list of constructs, at runtime.
|
|
25
47
|
*
|
|
@@ -45,12 +67,37 @@ function servicesOf(constructs) {
|
|
|
45
67
|
function idsOf(constructs, existing = []) {
|
|
46
68
|
return [.../* @__PURE__ */ new Set([...existing, ...constructs.map(({ id }) => id)])];
|
|
47
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* The edges after `.database(source)` names a builder's database.
|
|
72
|
+
*
|
|
73
|
+
* A database replaces the one before it — a worker's default, overridden by a
|
|
74
|
+
* runnable that names its own — so the edge the previous one added goes with
|
|
75
|
+
* it. Left behind, a Lambda built from a queue that moved to another database
|
|
76
|
+
* would still be granted the worker's.
|
|
77
|
+
*
|
|
78
|
+
* Only an edge `.database()` added is removed, which is why it is returned as
|
|
79
|
+
* `_databaseEdge` for the next call to read — and not even that one when
|
|
80
|
+
* `.dependsOn()` has since named the same construct, since the handler still
|
|
81
|
+
* reaches it through `services`.
|
|
82
|
+
*/
|
|
83
|
+
function databaseEdges(current, source) {
|
|
84
|
+
const stillDependedOn = current.service !== void 0 && current.services.includes(current.service);
|
|
85
|
+
const kept = current.edge && !stillDependedOn ? current.constructs.filter((id) => id !== current.edge) : [...current.constructs];
|
|
86
|
+
if (!isConsumable(source) || kept.includes(source.id)) return {
|
|
87
|
+
_constructs: kept,
|
|
88
|
+
_databaseEdge: void 0
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
_constructs: [...kept, source.id],
|
|
92
|
+
_databaseEdge: source.id
|
|
93
|
+
};
|
|
94
|
+
}
|
|
48
95
|
/** Something that is not a construct was passed to `.dependsOn()`. */
|
|
49
96
|
var NotAConstruct = class extends Error {
|
|
50
97
|
value;
|
|
51
98
|
constructor(value) {
|
|
52
99
|
const name = typeof value === "object" && value !== null && "serviceName" in value ? `the service '${String(value.serviceName)}'` : `a ${typeof value}`;
|
|
53
|
-
super(`.dependsOn() takes constructs, and was given ${name}. Pass it to .services([…]) instead
|
|
100
|
+
super(`.dependsOn() takes constructs, and was given ${name}. Pass it to .services([…]) instead.`);
|
|
54
101
|
this.value = value;
|
|
55
102
|
this.name = "NotAConstruct";
|
|
56
103
|
}
|
|
@@ -70,18 +117,29 @@ function isConsumable(value) {
|
|
|
70
117
|
/**
|
|
71
118
|
* The service behind either face.
|
|
72
119
|
*
|
|
73
|
-
* `.database()` and the
|
|
74
|
-
* `Service` before and still do, because
|
|
75
|
-
*
|
|
120
|
+
* `.database()` and the auditor slot take a construct now; they took a
|
|
121
|
+
* `Service` before and still do, because not every hand-written service has a
|
|
122
|
+
* construct to stand for it.
|
|
76
123
|
*/
|
|
77
124
|
function serviceOf(source) {
|
|
78
125
|
return isConsumable(source) ? source.service : source;
|
|
79
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* A surface's or a site's public address, read from its `<ID>_URL` — the
|
|
129
|
+
* client a `RestApi` or a `StaticSite` hands whatever `.dependsOn()` it.
|
|
130
|
+
*/
|
|
131
|
+
function publicUrl(options, key) {
|
|
132
|
+
return options.envParser.create((get) => ({ url: get(key).string() })).parse().url;
|
|
133
|
+
}
|
|
80
134
|
//#endregion
|
|
81
135
|
exports.NotAConstruct = NotAConstruct;
|
|
136
|
+
exports.databaseEdges = databaseEdges;
|
|
82
137
|
exports.edgeTo = edgeTo;
|
|
138
|
+
exports.frontendEdgeTo = frontendEdgeTo;
|
|
83
139
|
exports.idsOf = idsOf;
|
|
84
140
|
exports.isConsumable = isConsumable;
|
|
141
|
+
exports.publicUrl = publicUrl;
|
|
142
|
+
exports.serverHalfOf = serverHalfOf;
|
|
85
143
|
exports.serviceOf = serviceOf;
|
|
86
144
|
exports.servicesOf = servicesOf;
|
|
87
145
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"construct-interface.cjs","names":[],"sources":["../src/construct-interface.ts"],"sourcesContent":["/**\n * The construct contract.\n *\n * A construct is three things at once — an infrastructure requirement at build\n * time, a runtime capability, and something other code can consume — which is\n * what forces exactly these three members.\n *\n * An **interface**, not a base class: `Endpoint`, `Cron`, `Queue`, and `Topic`\n * can satisfy it without inheritance surgery, a lifted `Service` can satisfy it\n * as a plain object, and `.dependsOn()` gets its enforcement structurally — a\n * `Service` (`{ serviceName, register }`) simply does not match\n * `{ id, declare, service }`, with no `instanceof` anywhere.\n *\n * Lives in its own module while the existing abstract `Construct` class is\n * still in use; it takes that name once the class is gone.\n */\n\nimport type { Declaration, Dependency } from '@geekmidas/manifest';\nimport type { Service } from '@geekmidas/services';\n\n/**\n * @typeParam TName - the construct's canonical id, PascalCase. Keeping it a\n * literal is what lets the service key be `Uncapitalize<TName>` — a TypeScript\n * intrinsic, so no custom transform needs a runtime twin.\n * @typeParam TClient - what consuming this construct hands you. `never` means it\n * owns no address and cannot be consumed: a `Cron` is fired by a schedule and a\n * `Subscriber` is reached through its topic, so `.dependsOn()` on either is a\n * compile error rather than a stub that throws.\n */\nexport interface Construct<TName extends string = string, TClient = never> {\n\t/** Canonical, PascalCase, unique within the manifest. */\n\treadonly id: TName;\n\n\t/**\n\t * The build-time face: what this construct contributes to the manifest.\n\t *\n\t * Returns an array because some constructs contribute more than one node — a\n\t * queue declares the queue and its worker, a database declares its migrator\n\t * and seeder. Most return one.\n\t */\n\tdeclare(): Declaration[];\n\n\t/**\n\t * The consumable face — the address this construct owns, as a client.\n\t *\n\t * A field assigned once rather than a getter. `Construct.getEnvironment`\n\t * caches by service *object*, and `Topic.publisher` returns a fresh literal\n\t * on every access, so that cache never hits for topics or queues today.\n\t */\n\treadonly service: [TClient] extends [never]\n\t\t? never\n\t\t: Service<Uncapitalize<TName>, TClient>;\n}\n\n/**\n * The build-time face alone — an id and what it contributes to the manifest.\n *\n * Weaker than {@link Consumable} on purpose. An edge is not always an\n * injection: a site depending on an API needs that API's *address at build\n * time* and has no service record to put a client into, so requiring one would\n * make the weakest kind of edge impossible to express with the strongest\n * interface. Discovery asks this same question and nothing more.\n */\nexport interface Declarable<TName extends string = string> {\n\treadonly id: TName;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The edge that points at a construct.\n *\n * A construct's *canonical* node is the one carrying its own id — the others are\n * things it owns rather than things it is, like the signing secret beside an\n * auth server — so the kind an edge records is read off that node instead of\n * being written down beside it. Hand-written kinds are the same fact stated\n * twice, and the copy is what goes stale when a construct changes what it\n * declares.\n *\n * @throws {NotAConstruct} when the value declares nothing under its own id.\n */\nexport function edgeTo(construct: Declarable): Dependency {\n\tconst canonical = construct\n\t\t.declare()\n\t\t.find((declaration) => declaration.id === construct.id);\n\n\tif (!canonical) throw new NotAConstruct(construct);\n\n\treturn { target: construct.id, kind: canonical.kind };\n}\n\n/** What consuming a construct hands you. */\nexport type Infer<C> =\n\tC extends Construct<string, infer TClient> ? TClient : never;\n\n/** A construct's canonical id. */\nexport type NameOf<C> =\n\tC extends Construct<infer TName, unknown> ? TName : never;\n\n/**\n * What `.dependsOn([…])` accepts: a construct that owns a client.\n *\n * Structural, and deliberately narrower than {@link Construct} — it is the\n * face a *consumer* needs, so the builders can accept a database, a bucket, a\n * mail sender, a queue, or a topic without importing any of them. A plain\n * `Service` is not one of these, which is the point: constructs-only confines\n * env sniffing to `.services()` and the explicit lift, so retiring that method\n * retires implicit inference with it.\n */\nexport interface Consumable<TName extends string = string, TClient = unknown> {\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The services a list of constructs dissolves into.\n *\n * A mapped tuple, so `[db, uploads]` types as `[Service<'orders', Kysely<DB>>,\n * Service<'uploads', StorageClient>]` and the handler's service record gains\n * both keys — the same machinery `.services()` already uses, which is why\n * `dependsOn` needs no type plumbing of its own.\n */\nexport type ServicesOf<T extends readonly Consumable[]> = {\n\t[K in keyof T]: T[K]['service'];\n};\n\n/**\n * The services of a list of constructs, at runtime.\n *\n * @throws {NotAConstruct} when handed something else. The type already refuses\n * it, but a JavaScript caller gets no such warning, and a `Service` slipping\n * through would fail later as an undefined key in the handler.\n */\nexport function servicesOf<const T extends readonly Consumable[]>(\n\tconstructs: T,\n): ServicesOf<T> {\n\treturn constructs.map((construct) => {\n\t\tif (!isConsumable(construct)) throw new NotAConstruct(construct);\n\n\t\treturn construct.service;\n\t}) as ServicesOf<T>;\n}\n\n/**\n * The other half of `servicesOf`: the same edge, as the manifest records it.\n *\n * `.dependsOn()` used to keep only the services, which is what a handler runs\n * with — and an id cannot be recovered from a service name reliably, so the\n * edges were gone by the time the build could read them. Both halves are taken\n * from one call now, and `existing` is folded in so repeated `.dependsOn()`\n * calls accumulate the way `.services()` already does.\n */\nexport function idsOf(\n\tconstructs: readonly Consumable[],\n\texisting: readonly string[] = [],\n): string[] {\n\treturn [...new Set([...existing, ...constructs.map(({ id }) => id)])];\n}\n\n/** Something that is not a construct was passed to `.dependsOn()`. */\nexport class NotAConstruct extends Error {\n\tconstructor(readonly value: unknown) {\n\t\tconst name =\n\t\t\ttypeof value === 'object' && value !== null && 'serviceName' in value\n\t\t\t\t? `the service '${String((value as { serviceName: unknown }).serviceName)}'`\n\t\t\t\t: `a ${typeof value}`;\n\n\t\tsuper(\n\t\t\t`.dependsOn() takes constructs, and was given ${name}. ` +\n\t\t\t\t`Pass it to .services([…]) instead, or lift it with ` +\n\t\t\t\t`Construct.fromService().`,\n\t\t);\n\t\tthis.name = 'NotAConstruct';\n\t}\n}\n\n/**\n * Whether a value is a construct rather than a bare `Service`.\n *\n * Structural rather than `instanceof`: a construct from a second copy of\n * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is\n * still a construct, and `instanceof` is exactly the check that says otherwise.\n */\nexport function isConsumable(value: unknown): value is Consumable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Consumable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\ttypeof candidate.declare === 'function' &&\n\t\ttypeof (candidate.service as Service | undefined)?.serviceName === 'string'\n\t);\n}\n\n/**\n * The service behind either face.\n *\n * `.database()` and the publisher slots take a construct now; they took a\n * `Service` before and still do, because a hand-written one is exactly what\n * `Construct.fromService` exists to lift and not everything has been lifted.\n */\nexport function serviceOf<TName extends string, TClient>(\n\tsource: Consumable<TName, TClient> | Service<TName, TClient>,\n): Service<TName, TClient> {\n\t// A construct's service key is `Uncapitalize<TName>` and the slot is typed\n\t// by `TName`; the two describe the same key, and only the cast says so.\n\treturn isConsumable(source)\n\t\t? (source.service as unknown as Service<TName, TClient>)\n\t\t: (source as Service<TName, TClient>);\n}\n"],"mappings":";;;;;;;;;;;;;;AAgFA,SAAgB,OAAO,WAAmC;CACzD,MAAM,YAAY,UAChB,QAAQ,CAAC,CACT,MAAM,gBAAgB,YAAY,OAAO,UAAU,EAAE;CAEvD,IAAI,CAAC,WAAW,MAAM,IAAI,cAAc,SAAS;CAEjD,OAAO;EAAE,QAAQ,UAAU;EAAI,MAAM,UAAU;CAAK;AACrD;;;;;;;;AA6CA,SAAgB,WACf,YACgB;CAChB,OAAO,WAAW,KAAK,cAAc;EACpC,IAAI,CAAC,aAAa,SAAS,GAAG,MAAM,IAAI,cAAc,SAAS;EAE/D,OAAO,UAAU;CAClB,CAAC;AACF;;;;;;;;;;AAWA,SAAgB,MACf,YACA,WAA8B,CAAC,GACpB;CACX,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACrE;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACnB;CAArB,YAAY,OAAyB;EACpC,MAAM,OACL,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,QAC7D,gBAAgB,OAAQ,MAAmC,WAAW,EAAE,KACxE,KAAK,OAAO;EAEhB,MACC,gDAAgD,KAAK,8EAGtD;EAVoB,KAAA,QAAA;EAWpB,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,YAAY,cAC7B,OAAQ,UAAU,SAAiC,gBAAgB;AAErE;;;;;;;;AASA,SAAgB,UACf,QAC0B;CAG1B,OAAO,aAAa,MAAM,IACtB,OAAO,UACP;AACL"}
|
|
1
|
+
{"version":3,"file":"construct-interface.cjs","names":[],"sources":["../src/construct-interface.ts"],"sourcesContent":["/**\n * The construct contract.\n *\n * A construct is three things at once — an infrastructure requirement at build\n * time, a runtime capability, and something other code can consume — which is\n * what forces exactly these three members.\n *\n * An **interface**, not a base class: `Endpoint`, `Cron`, `Queue`, and `Topic`\n * can satisfy it without inheritance surgery, a lifted `Service` can satisfy it\n * as a plain object, and `.dependsOn()` gets its enforcement structurally — a\n * `Service` (`{ serviceName, register }`) simply does not match\n * `{ id, declare, service }`, with no `instanceof` anywhere.\n *\n * Lives in its own module while the existing abstract `Construct` class is\n * still in use; it takes that name once the class is gone.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Declaration, Dependency } from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\n\n/**\n * @typeParam TName - the construct's canonical id, PascalCase. Keeping it a\n * literal is what lets the service key be `Uncapitalize<TName>` — a TypeScript\n * intrinsic, so no custom transform needs a runtime twin.\n * @typeParam TClient - what consuming this construct hands you. `never` means it\n * owns no address and cannot be consumed: a `Cron` is fired by a schedule and a\n * `Subscriber` is reached through its topic, so `.dependsOn()` on either is a\n * compile error rather than a stub that throws.\n */\nexport interface Construct<TName extends string = string, TClient = never> {\n\t/** Canonical, PascalCase, unique within the manifest. */\n\treadonly id: TName;\n\n\t/**\n\t * The build-time face: what this construct contributes to the manifest.\n\t *\n\t * Returns an array because some constructs contribute more than one node — a\n\t * queue declares the queue and its worker, a database declares its migrator\n\t * and seeder. Most return one.\n\t */\n\tdeclare(): Declaration[];\n\n\t/**\n\t * The consumable face — the address this construct owns, as a client.\n\t *\n\t * A field assigned once rather than a getter. `Construct.getEnvironment`\n\t * and `ServiceDiscovery` cache by service *object*, so a getter returning a\n\t * fresh literal on every access would never hit either cache.\n\t */\n\treadonly service: [TClient] extends [never]\n\t\t? never\n\t\t: Service<Uncapitalize<TName>, TClient>;\n}\n\n/**\n * The build-time face alone — an id and what it contributes to the manifest.\n *\n * Weaker than {@link Consumable} on purpose. An edge is not always an\n * injection: a site depending on an API needs that API's *address at build\n * time* and has no service record to put a client into, so requiring one would\n * make the weakest kind of edge impossible to express with the strongest\n * interface. Discovery asks this same question and nothing more.\n */\nexport interface Declarable<TName extends string = string> {\n\treadonly id: TName;\n\tdeclare(): Declaration[];\n}\n\n/**\n * A construct that authenticates requests — what `RestApi.auth()` takes.\n *\n * `verify` is the one thing every provider shares: given a request's headers,\n * whose request is it — the session, or `null` when there is none. Whether the\n * provider is a server mounted beside the API, deployed elsewhere, or an issuer\n * somebody else runs is its own business; a surface only ever asks this.\n */\nexport interface Authenticator<TSession = unknown> extends Declarable {\n\tverify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<TSession | null>;\n}\n\n/**\n * The edge that points at a construct.\n *\n * A construct's *canonical* node is the one carrying its own id — the others are\n * things it owns rather than things it is, like the signing secret beside an\n * auth server — so the kind an edge records is read off that node instead of\n * being written down beside it. Hand-written kinds are the same fact stated\n * twice, and the copy is what goes stale when a construct changes what it\n * declares.\n *\n * @throws {NotAConstruct} when the value declares nothing under its own id.\n */\nexport function edgeTo(construct: Declarable): Dependency {\n\tconst canonical = construct\n\t\t.declare()\n\t\t.find((declaration) => declaration.id === construct.id);\n\n\tif (!canonical) throw new NotAConstruct(construct);\n\n\treturn { target: construct.id, kind: canonical.kind };\n}\n\n/**\n * A construct whose public half is a node of its own: what a site's or a\n * mobile app's plain edge points at instead of the construct itself.\n *\n * A `FileServer` is the one: its own node is the bucket, which presigns and\n * writes, and a frontend that only shows the objects needs the address they\n * are served on and nothing that can write to them.\n */\nexport interface HasPublicFace {\n\treadonly publicFace: Declarable;\n}\n\n/**\n * A construct's server half, as a frontend names it: `documents.server`,\n * `assets.server`.\n *\n * A `Declarable` and not a `Consumable`, so only a site or a mobile app can\n * depend on it — a backend's plain edge is already the full one. A frontend's\n * plain edge to a bucket holds where its links are signed and nothing that\n * writes to it; this one hands its server half the connection and the key\n * pair too.\n */\nexport interface ServerHalf extends Declarable {\n\treadonly serverHalf: true;\n}\n\n/** `construct`, as the server half a frontend's edge can name. */\nexport function serverHalfOf(construct: Declarable): ServerHalf {\n\tconst declarations = construct.declare();\n\treturn {\n\t\tid: construct.id,\n\t\tdeclare: () => declarations,\n\t\tserverHalf: true,\n\t};\n}\n\n/**\n * The edge a frontend — a site or a mobile app — has to a construct: to its\n * server half when it named one (`.server`, marked `server: true`), to its\n * public face where it has one, to the construct itself otherwise.\n */\nexport function frontendEdgeTo(construct: Declarable): Dependency {\n\tif ((construct as Partial<ServerHalf>).serverHalf) {\n\t\treturn { ...edgeTo(construct), server: true };\n\t}\n\tconst face = (construct as Partial<HasPublicFace>).publicFace;\n\treturn edgeTo(face ?? construct);\n}\n\n/** What consuming a construct hands you. */\nexport type Infer<C> =\n\tC extends Construct<string, infer TClient> ? TClient : never;\n\n/** A construct's canonical id. */\nexport type NameOf<C> =\n\tC extends Construct<infer TName, unknown> ? TName : never;\n\n/**\n * What `.dependsOn([…])` accepts: a construct that owns a client.\n *\n * Structural, and deliberately narrower than {@link Construct} — it is the\n * face a *consumer* needs, so the builders can accept a database, a bucket, a\n * mail sender, a queue, or a topic without importing any of them. A plain\n * `Service` is not one of these, which is the point: constructs-only confines\n * env sniffing to `.services()` and the explicit lift, so retiring that method\n * retires implicit inference with it.\n */\nexport interface Consumable<TName extends string = string, TClient = unknown> {\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The services a list of constructs dissolves into.\n *\n * A mapped tuple, so `[db, uploads]` types as `[Service<'orders', Kysely<DB>>,\n * Service<'uploads', StorageClient>]` and the handler's service record gains\n * both keys — the same machinery `.services()` already uses, which is why\n * `dependsOn` needs no type plumbing of its own.\n */\nexport type ServicesOf<T extends readonly Consumable[]> = {\n\t[K in keyof T]: T[K]['service'];\n};\n\n/**\n * The services of a list of constructs, at runtime.\n *\n * @throws {NotAConstruct} when handed something else. The type already refuses\n * it, but a JavaScript caller gets no such warning, and a `Service` slipping\n * through would fail later as an undefined key in the handler.\n */\nexport function servicesOf<const T extends readonly Consumable[]>(\n\tconstructs: T,\n): ServicesOf<T> {\n\treturn constructs.map((construct) => {\n\t\tif (!isConsumable(construct)) throw new NotAConstruct(construct);\n\n\t\treturn construct.service;\n\t}) as ServicesOf<T>;\n}\n\n/**\n * The other half of `servicesOf`: the same edge, as the manifest records it.\n *\n * `.dependsOn()` used to keep only the services, which is what a handler runs\n * with — and an id cannot be recovered from a service name reliably, so the\n * edges were gone by the time the build could read them. Both halves are taken\n * from one call now, and `existing` is folded in so repeated `.dependsOn()`\n * calls accumulate the way `.services()` already does.\n */\nexport function idsOf(\n\tconstructs: readonly Consumable[],\n\texisting: readonly string[] = [],\n): string[] {\n\treturn [...new Set([...existing, ...constructs.map(({ id }) => id)])];\n}\n\n/**\n * The edges after `.database(source)` names a builder's database.\n *\n * A database replaces the one before it — a worker's default, overridden by a\n * runnable that names its own — so the edge the previous one added goes with\n * it. Left behind, a Lambda built from a queue that moved to another database\n * would still be granted the worker's.\n *\n * Only an edge `.database()` added is removed, which is why it is returned as\n * `_databaseEdge` for the next call to read — and not even that one when\n * `.dependsOn()` has since named the same construct, since the handler still\n * reaches it through `services`.\n */\nexport function databaseEdges(\n\tcurrent: {\n\t\tconstructs: readonly string[];\n\t\tedge: string | undefined;\n\t\tservice: Service | undefined;\n\t\tservices: readonly Service[];\n\t},\n\tsource: unknown,\n): { _constructs: string[]; _databaseEdge: string | undefined } {\n\tconst stillDependedOn =\n\t\tcurrent.service !== undefined && current.services.includes(current.service);\n\tconst kept =\n\t\tcurrent.edge && !stillDependedOn\n\t\t\t? current.constructs.filter((id) => id !== current.edge)\n\t\t\t: [...current.constructs];\n\n\tif (!isConsumable(source) || kept.includes(source.id)) {\n\t\treturn { _constructs: kept, _databaseEdge: undefined };\n\t}\n\n\treturn { _constructs: [...kept, source.id], _databaseEdge: source.id };\n}\n\n/** Something that is not a construct was passed to `.dependsOn()`. */\nexport class NotAConstruct extends Error {\n\tconstructor(readonly value: unknown) {\n\t\tconst name =\n\t\t\ttypeof value === 'object' && value !== null && 'serviceName' in value\n\t\t\t\t? `the service '${String((value as { serviceName: unknown }).serviceName)}'`\n\t\t\t\t: `a ${typeof value}`;\n\n\t\tsuper(\n\t\t\t`.dependsOn() takes constructs, and was given ${name}. ` +\n\t\t\t\t`Pass it to .services([…]) instead.`,\n\t\t);\n\t\tthis.name = 'NotAConstruct';\n\t}\n}\n\n/**\n * Whether a value is a construct rather than a bare `Service`.\n *\n * Structural rather than `instanceof`: a construct from a second copy of\n * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is\n * still a construct, and `instanceof` is exactly the check that says otherwise.\n */\nexport function isConsumable(value: unknown): value is Consumable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Consumable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\ttypeof candidate.declare === 'function' &&\n\t\ttypeof (candidate.service as Service | undefined)?.serviceName === 'string'\n\t);\n}\n\n/**\n * The service behind either face.\n *\n * `.database()` and the auditor slot take a construct now; they took a\n * `Service` before and still do, because not every hand-written service has a\n * construct to stand for it.\n */\nexport function serviceOf<TName extends string, TClient>(\n\tsource: Consumable<TName, TClient> | Service<TName, TClient>,\n): Service<TName, TClient> {\n\t// A construct's service key is `Uncapitalize<TName>` and the slot is typed\n\t// by `TName`; the two describe the same key, and only the cast says so.\n\treturn isConsumable(source)\n\t\t? (source.service as unknown as Service<TName, TClient>)\n\t\t: (source as Service<TName, TClient>);\n}\n\n/**\n * A surface's or a site's public address, read from its `<ID>_URL` — the\n * client a `RestApi` or a `StaticSite` hands whatever `.dependsOn()` it.\n */\nexport function publicUrl(\n\toptions: ServiceRegisterOptions,\n\tkey: string,\n): string {\n\treturn options.envParser.create((get) => ({ url: get(key).string() })).parse()\n\t\t.url;\n}\n"],"mappings":";;;;;;;;;;;;;;AAgGA,SAAgB,OAAO,WAAmC;CACzD,MAAM,YAAY,UAChB,QAAQ,CAAC,CACT,MAAM,gBAAgB,YAAY,OAAO,UAAU,EAAE;CAEvD,IAAI,CAAC,WAAW,MAAM,IAAI,cAAc,SAAS;CAEjD,OAAO;EAAE,QAAQ,UAAU;EAAI,MAAM,UAAU;CAAK;AACrD;;AA6BA,SAAgB,aAAa,WAAmC;CAC/D,MAAM,eAAe,UAAU,QAAQ;CACvC,OAAO;EACN,IAAI,UAAU;EACd,eAAe;EACf,YAAY;CACb;AACD;;;;;;AAOA,SAAgB,eAAe,WAAmC;CACjE,IAAK,UAAkC,YACtC,OAAO;EAAE,GAAG,OAAO,SAAS;EAAG,QAAQ;CAAK;CAE7C,MAAM,OAAQ,UAAqC;CACnD,OAAO,OAAO,QAAQ,SAAS;AAChC;;;;;;;;AA6CA,SAAgB,WACf,YACgB;CAChB,OAAO,WAAW,KAAK,cAAc;EACpC,IAAI,CAAC,aAAa,SAAS,GAAG,MAAM,IAAI,cAAc,SAAS;EAE/D,OAAO,UAAU;CAClB,CAAC;AACF;;;;;;;;;;AAWA,SAAgB,MACf,YACA,WAA8B,CAAC,GACpB;CACX,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACrE;;;;;;;;;;;;;;AAeA,SAAgB,cACf,SAMA,QAC+D;CAC/D,MAAM,kBACL,QAAQ,YAAY,KAAA,KAAa,QAAQ,SAAS,SAAS,QAAQ,OAAO;CAC3E,MAAM,OACL,QAAQ,QAAQ,CAAC,kBACd,QAAQ,WAAW,QAAQ,OAAO,OAAO,QAAQ,IAAI,IACrD,CAAC,GAAG,QAAQ,UAAU;CAE1B,IAAI,CAAC,aAAa,MAAM,KAAK,KAAK,SAAS,OAAO,EAAE,GACnD,OAAO;EAAE,aAAa;EAAM,eAAe,KAAA;CAAU;CAGtD,OAAO;EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,EAAE;EAAG,eAAe,OAAO;CAAG;AACtE;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACnB;CAArB,YAAY,OAAyB;EACpC,MAAM,OACL,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,QAC7D,gBAAgB,OAAQ,MAAmC,WAAW,EAAE,KACxE,KAAK,OAAO;EAEhB,MACC,gDAAgD,KAAK,qCAEtD;EAToB,KAAA,QAAA;EAUpB,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,YAAY,cAC7B,OAAQ,UAAU,SAAiC,gBAAgB;AAErE;;;;;;;;AASA,SAAgB,UACf,QAC0B;CAG1B,OAAO,aAAa,MAAM,IACtB,OAAO,UACP;AACL;;;;;AAMA,SAAgB,UACf,SACA,KACS;CACT,OAAO,QAAQ,UAAU,QAAQ,SAAS,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAC5E;AACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { Construct, Consumable, Declarable, Infer, NameOf, NotAConstruct, ServicesOf, edgeTo, idsOf, isConsumable, serviceOf, servicesOf };
|
|
1
|
+
import { _ as serverHalfOf, a as HasPublicFace, c as NotAConstruct, d as databaseEdges, f as edgeTo, g as publicUrl, h as isConsumable, i as Declarable, l as ServerHalf, m as idsOf, n as Construct, o as Infer, p as frontendEdgeTo, r as Consumable, s as NameOf, t as Authenticator, u as ServicesOf, v as serviceOf, y as servicesOf } from "./construct-interface-CVoejIpo.cjs";
|
|
2
|
+
export { Authenticator, Construct, Consumable, Declarable, HasPublicFace, Infer, NameOf, NotAConstruct, ServerHalf, ServicesOf, databaseEdges, edgeTo, frontendEdgeTo, idsOf, isConsumable, publicUrl, serverHalfOf, serviceOf, servicesOf };
|