@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
package/dist/site.d.mts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { i as Declarable, n as Construct } from "./construct-interface-Nw5Dt9AC.mjs";
|
|
2
|
+
import { n as Telemetry } from "./telemetry-DWX-qKUh.mjs";
|
|
3
|
+
import { n as DeployedStage } from "./stages-DaTaoQei.mjs";
|
|
4
|
+
import { RandomPassword } from "./random-password.mjs";
|
|
5
|
+
import { ConstructName, Declaration, Dependency, HostLabelBothAliasAndRedirect, InvalidHostLabel, SiteDeclaration, WildcardSiteCannotHaveAliases } from "@geekmidas/manifest";
|
|
6
|
+
import { Service } from "@geekmidas/services";
|
|
3
7
|
//#region src/site.d.ts
|
|
4
8
|
/**
|
|
5
9
|
* Where a site's source lives, and the little else a layout can differ by.
|
|
@@ -15,6 +19,39 @@ export interface StaticSiteConfig {
|
|
|
15
19
|
* inferred from the id, which made a site's home whatever was on disk.
|
|
16
20
|
*/
|
|
17
21
|
path: string;
|
|
22
|
+
/**
|
|
23
|
+
* The label it answers on under a stage's domain — `api` for
|
|
24
|
+
* `api.myapp.com`, from `domains` — and under the project locally,
|
|
25
|
+
* `api.myapp.localhost`. Absent, its id kebab-cased.
|
|
26
|
+
*
|
|
27
|
+
* `'*'` answers on every subdomain nothing else does — one host per
|
|
28
|
+
* tenant, `acme.myapp.com` — and then `hosts` names which of them are
|
|
29
|
+
* real. Every other app keeps its own host, and a project has at most one
|
|
30
|
+
* such site.
|
|
31
|
+
*/
|
|
32
|
+
subdomain?: string;
|
|
33
|
+
/**
|
|
34
|
+
* More labels it answers on under the stage's domain, exactly as on its
|
|
35
|
+
* own: each a host the site really serves, and an origin every surface it
|
|
36
|
+
* depends on trusts. Its own host stays canonical (`<ID>_URL`).
|
|
37
|
+
*/
|
|
38
|
+
aliases?: readonly string[];
|
|
39
|
+
/**
|
|
40
|
+
* Labels that answer with a permanent (301) redirect to its own host,
|
|
41
|
+
* path and query kept — `['www']` sends `www.myapp.com` to `myapp.com`.
|
|
42
|
+
* Nothing answers on a host unless a construct names it, so there is no
|
|
43
|
+
* automatic `www`. Sites only: an API client does not reliably follow a
|
|
44
|
+
* redirect on a `POST`.
|
|
45
|
+
*/
|
|
46
|
+
redirects?: readonly string[];
|
|
47
|
+
/**
|
|
48
|
+
* With `subdomain: '*'`, the route that says which hosts are tenants: an
|
|
49
|
+
* exported `GET` endpoint the edge asks before it serves a host,
|
|
50
|
+
* `?domain=<host>`, answering `200` for a tenant and `404` otherwise.
|
|
51
|
+
*
|
|
52
|
+
* It runs without a session and belongs to no public API.
|
|
53
|
+
*/
|
|
54
|
+
hosts?: SiteHostsEndpoint;
|
|
18
55
|
/**
|
|
19
56
|
* The port it answers on locally.
|
|
20
57
|
*
|
|
@@ -50,8 +87,109 @@ export interface StaticSiteConfig {
|
|
|
50
87
|
* else.
|
|
51
88
|
*/
|
|
52
89
|
variant?: SiteDeclaration['variant'];
|
|
90
|
+
/**
|
|
91
|
+
* What the site emits — the `Telemetry` construct. An edge to the node and
|
|
92
|
+
* nothing more for now: a site is handed none of its server keys, and the
|
|
93
|
+
* browser half (propagation from the generated client, then a browser SDK
|
|
94
|
+
* exporting through the API) builds on this edge.
|
|
95
|
+
*/
|
|
96
|
+
telemetry?: Telemetry;
|
|
97
|
+
/**
|
|
98
|
+
* A login the site is served behind on the stages named, so a staging
|
|
99
|
+
* build is not public while it is tried.
|
|
100
|
+
*
|
|
101
|
+
* ```ts
|
|
102
|
+
* export const sitePassword = new RandomPassword('SitePassword');
|
|
103
|
+
*
|
|
104
|
+
* export const web = new StaticSite('Web', {
|
|
105
|
+
* path: 'apps/web',
|
|
106
|
+
* password: { secret: sitePassword, stages: ['staging'] },
|
|
107
|
+
* });
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* The edge asks for it with HTTP basic auth before a request reaches the
|
|
111
|
+
* site: the user is the stage's name, the password the `RandomPassword`'s
|
|
112
|
+
* value on that stage. Like any `RandomPassword` it is generated on the
|
|
113
|
+
* first deploy and kept, and one set by hand wins. It is not an edge — the
|
|
114
|
+
* site is handed none of it — so export it from a constructs file of its
|
|
115
|
+
* own, as any construct is.
|
|
116
|
+
*
|
|
117
|
+
* The compose target alone serves it so far; another refuses the stage
|
|
118
|
+
* rather than serving it publicly.
|
|
119
|
+
*/
|
|
120
|
+
password?: {
|
|
121
|
+
secret: RandomPassword;
|
|
122
|
+
stages: readonly [DeployedStage, ...DeployedStage[]];
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* `'stage'` for a `static` site that pre-renders data at build time
|
|
126
|
+
* (vite-ssg and similar): its build fetches from the APIs it
|
|
127
|
+
* `.dependsOn()`, and bakes their answers into its files.
|
|
128
|
+
*
|
|
129
|
+
* ```ts
|
|
130
|
+
* new StaticSite('Web', {
|
|
131
|
+
* path: 'apps/web',
|
|
132
|
+
* variant: 'static',
|
|
133
|
+
* prerender: 'stage',
|
|
134
|
+
* }).dependsOn([api]);
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* The deploy then builds the site only once those APIs are up and
|
|
138
|
+
* healthy on the stage, and the build reaches them at their public
|
|
139
|
+
* addresses, as a browser would. Without it, a site is built offline,
|
|
140
|
+
* before its stage runs (`GKM_BUILD_OFFLINE=1`), and nothing at runtime
|
|
141
|
+
* can fill a page built without its data.
|
|
142
|
+
*
|
|
143
|
+
* Opt-in, because the image then holds that stage's data: the same commit
|
|
144
|
+
* builds a different image per stage, and `gkm compose --build --push`
|
|
145
|
+
* needs the stage it builds for already running.
|
|
146
|
+
*/
|
|
147
|
+
prerender?: 'stage';
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The shape of the endpoint `hosts` names — read structurally, so a site
|
|
151
|
+
* module never loads the endpoint machinery to say which route it means.
|
|
152
|
+
*/
|
|
153
|
+
export interface SiteHostsEndpoint {
|
|
154
|
+
route: string;
|
|
155
|
+
method: string;
|
|
156
|
+
surface: {
|
|
157
|
+
id: string;
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/** `subdomain: '*'` without `hosts`: nothing would say which hosts are tenants. */
|
|
161
|
+
export declare class WildcardSiteNeedsHosts extends Error {
|
|
162
|
+
readonly id: string;
|
|
163
|
+
constructor(id: string);
|
|
53
164
|
}
|
|
54
|
-
|
|
165
|
+
/** `hosts` on a site with one host, where there is nothing to check. */
|
|
166
|
+
export declare class SiteHostsNeedsWildcard extends Error {
|
|
167
|
+
readonly id: string;
|
|
168
|
+
constructor(id: string);
|
|
169
|
+
}
|
|
170
|
+
/** A `hosts` endpoint that is not a `GET`: the edge only ever asks with one. */
|
|
171
|
+
export declare class SiteHostsNotGet extends Error {
|
|
172
|
+
readonly id: string;
|
|
173
|
+
readonly method: string;
|
|
174
|
+
readonly route: string;
|
|
175
|
+
constructor(id: string, method: string, route: string);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* `prerender: 'stage'` on a site that renders its pages on a server, where a
|
|
179
|
+
* page renders on its first request — which the deploy's warm-up makes — and
|
|
180
|
+
* needs no data at build.
|
|
181
|
+
*/
|
|
182
|
+
export declare class PrerenderNeedsStaticSite extends Error {
|
|
183
|
+
readonly id: string;
|
|
184
|
+
readonly variant: SiteDeclaration['variant'];
|
|
185
|
+
constructor(id: string, variant: SiteDeclaration['variant']);
|
|
186
|
+
}
|
|
187
|
+
/** A wildcard site that says it holds the base domain. */
|
|
188
|
+
export declare class WildcardSiteCannotBeRoot extends Error {
|
|
189
|
+
readonly id: string;
|
|
190
|
+
constructor(id: string);
|
|
191
|
+
}
|
|
192
|
+
export declare class StaticSite<TName extends string = string> implements Declarable<TName>, Construct<TName, string> {
|
|
55
193
|
private readonly config;
|
|
56
194
|
/**
|
|
57
195
|
* Internal: how `.dependsOn()` carries edges into the copy it returns.
|
|
@@ -64,6 +202,12 @@ export declare class StaticSite<TName extends string = string> implements Declar
|
|
|
64
202
|
readonly keys: {
|
|
65
203
|
url: string;
|
|
66
204
|
};
|
|
205
|
+
/**
|
|
206
|
+
* Its public address, `https://web.example.com` — a string, no await. The
|
|
207
|
+
* same `<ID>_URL` on every command and stage, so a link built from it opens
|
|
208
|
+
* in a browser.
|
|
209
|
+
*/
|
|
210
|
+
readonly service: Service<Uncapitalize<TName>, string>;
|
|
67
211
|
constructor(id: ConstructName<TName>, config: StaticSiteConfig,
|
|
68
212
|
/**
|
|
69
213
|
* Internal: how `.dependsOn()` carries edges into the copy it returns.
|
|
@@ -82,9 +226,18 @@ export declare class StaticSite<TName extends string = string> implements Declar
|
|
|
82
226
|
* Takes {@link Declarable} rather than {@link Consumable} because a site's
|
|
83
227
|
* edge is a build-time link and not a service injection — requiring a client
|
|
84
228
|
* would exclude exactly the surfaces a frontend actually depends on.
|
|
229
|
+
*
|
|
230
|
+
* A plain edge to a `FileServer` is to its public face: the site is built
|
|
231
|
+
* with the address its objects are served on, and handed nothing that
|
|
232
|
+
* writes to the bucket. A plain edge to an `ObjectStorage` is to where its
|
|
233
|
+
* links are signed (`<PREFIX><T>_SIGNED_ORIGIN`), and to nothing else of
|
|
234
|
+
* it. `.dependsOn([assets.server])` or `.dependsOn([documents.server])`
|
|
235
|
+
* asks for the bucket and its credentials too, for a server half that
|
|
236
|
+
* uploads or presigns.
|
|
85
237
|
*/
|
|
86
238
|
dependsOn(constructs: readonly Declarable[]): StaticSite<TName>;
|
|
87
239
|
declare(): Declaration[];
|
|
88
240
|
}
|
|
89
241
|
//#endregion
|
|
242
|
+
export { HostLabelBothAliasAndRedirect, InvalidHostLabel, WildcardSiteCannotHaveAliases };
|
|
90
243
|
//# sourceMappingURL=site.d.mts.map
|
package/dist/site.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.mts","names":[],"sources":["../src/site.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"site.d.mts","names":[],"sources":["../src/site.ts"],"mappings":";;;;;;;;;;;;;iBAmEiB;;;;;;;EAOhB;;;;;;;;;;;EAWA;;;;;;EAMA;;;;;;;;EAQA;;;;;;;;EAQA,QAAQ;;;;;;;EAOR;;;;;;;EAOA;IAAW;IAAiB;;;;;;;;;;EAS5B;;;;;;;;;EASA,UAAU;;;;;;;EAOV,YAAY;;;;;;;;;;;;;;;;;;;;;;;;EAwBZ;IACC,QAAQ;IACR,kBAAkB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;EAyBrC;;;;;;iBAOgB;EAChB;EACA;EACA;IAAW;;;;qBAIC,+BAA+B;WACtB;EAArB,YAAqB;;;qBAWT,+BAA+B;WACtB;EAArB,YAAqB;;;qBAUT,wBAAwB;WAE1B;WACA;WACA;EAHV,YACU,YACA,gBACA;;;;;;;qBAeE,iCAAiC;WAEnC;WACA,SAAS;EAFnB,YACU,YACA,SAAS;;;qBAcP,iCAAiC;WACxB;EAArB,YAAqB;;qBAUT,WAAW,0CACZ,WAAW,QAAQ,UAAU;mBActB;;;;;;;mBAOA;WAnBT,IAAI;WACJ;IAAQ;;;;;;;WAOR,SAAS,QAAQ,aAAa;EAEvC,YACC,IAAI,cAAc,QACD,QAAQ,kBAOR;;;;;;;EAAA,wBAAuB;;;;;;;;;;;;;;;;;;;;EAoDzC,UAAU,qBAAqB,eAAe,WAAW;EAOzD,WAAW"}
|
package/dist/site.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { canonicalId,
|
|
1
|
+
import { frontendEdgeTo, publicUrl } from "./construct-interface.mjs";
|
|
2
|
+
import { HostLabelBothAliasAndRedirect, InvalidHostLabel, WILDCARD_SUBDOMAIN, WildcardSiteCannotHaveAliases, assertHostLabels, canonicalId, providedKeyFor, serviceKey } from "@geekmidas/manifest";
|
|
3
3
|
//#region src/site.ts
|
|
4
4
|
/**
|
|
5
5
|
* `StaticSite` — a frontend, declared like anything else.
|
|
@@ -14,26 +14,111 @@ import { canonicalId, provideKey } from "@geekmidas/manifest";
|
|
|
14
14
|
* .dependsOn([api, auth]);
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* A site consumes addresses, not connections: it is built, and the values it
|
|
18
|
+
* needs are inlined or fetched by its own framework, so its own edges take any
|
|
19
|
+
* {@link Declarable}. Its `.service` is its public address — what a worker's
|
|
20
|
+
* cron or an endpoint that builds links to it reads:
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* export const digest = worker
|
|
24
|
+
* .cron('rate(1 day)')
|
|
25
|
+
* .dependsOn([web])
|
|
26
|
+
* .handle(async ({ services }) => link(services.web, '/inbox'));
|
|
27
|
+
* ```
|
|
21
28
|
*
|
|
22
29
|
* Only the static variant ships. SSR deploy shapes are unstable and each one is
|
|
23
|
-
* its own maintenance, so they follow rather than arrive together
|
|
24
|
-
*
|
|
25
|
-
*
|
|
30
|
+
* its own maintenance, so they follow rather than arrive together. A mobile app
|
|
31
|
+
* is not a site — it is reached by a scheme, not a URL — and is its own
|
|
32
|
+
* construct: see `MobileApp`.
|
|
33
|
+
*/
|
|
34
|
+
/** `subdomain: '*'` without `hosts`: nothing would say which hosts are tenants. */
|
|
35
|
+
var WildcardSiteNeedsHosts = class extends Error {
|
|
36
|
+
id;
|
|
37
|
+
constructor(id) {
|
|
38
|
+
super(`'${id}' answers on every subdomain, so it has to say which of them are tenants: pass \`hosts\`, a GET endpoint answering 200 for a host it serves and 404 otherwise.`);
|
|
39
|
+
this.id = id;
|
|
40
|
+
this.name = "WildcardSiteNeedsHosts";
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
/** `hosts` on a site with one host, where there is nothing to check. */
|
|
44
|
+
var SiteHostsNeedsWildcard = class extends Error {
|
|
45
|
+
id;
|
|
46
|
+
constructor(id) {
|
|
47
|
+
super(`'${id}' names a \`hosts\` check but answers on one host. Declare \`subdomain: '*'\` to serve every subdomain, or drop \`hosts\`.`);
|
|
48
|
+
this.id = id;
|
|
49
|
+
this.name = "SiteHostsNeedsWildcard";
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
/** A `hosts` endpoint that is not a `GET`: the edge only ever asks with one. */
|
|
53
|
+
var SiteHostsNotGet = class extends Error {
|
|
54
|
+
id;
|
|
55
|
+
method;
|
|
56
|
+
route;
|
|
57
|
+
constructor(id, method, route) {
|
|
58
|
+
super(`'${id}' checks its hosts with ${method} ${route}, but the edge asks with GET ${route}?domain=<host>. Make it a GET endpoint.`);
|
|
59
|
+
this.id = id;
|
|
60
|
+
this.method = method;
|
|
61
|
+
this.route = route;
|
|
62
|
+
this.name = "SiteHostsNotGet";
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* `prerender: 'stage'` on a site that renders its pages on a server, where a
|
|
67
|
+
* page renders on its first request — which the deploy's warm-up makes — and
|
|
68
|
+
* needs no data at build.
|
|
26
69
|
*/
|
|
70
|
+
var PrerenderNeedsStaticSite = class extends Error {
|
|
71
|
+
id;
|
|
72
|
+
variant;
|
|
73
|
+
constructor(id, variant) {
|
|
74
|
+
super(`'${id}' is a '${variant}' site, which renders its pages on its own server, so it never needs its APIs at build: drop \`prerender\`, and render data-backed pages on request (the deploy warms them). \`prerender: 'stage'\` is for a 'static' site that bakes data into its files.`);
|
|
75
|
+
this.id = id;
|
|
76
|
+
this.variant = variant;
|
|
77
|
+
this.name = "PrerenderNeedsStaticSite";
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
/** A wildcard site that says it holds the base domain. */
|
|
81
|
+
var WildcardSiteCannotBeRoot = class extends Error {
|
|
82
|
+
id;
|
|
83
|
+
constructor(id) {
|
|
84
|
+
super(`'${id}' answers on every subdomain, so it cannot also hold the base domain. Drop \`root: true\`, and declare the site the base domain points at separately.`);
|
|
85
|
+
this.id = id;
|
|
86
|
+
this.name = "WildcardSiteCannotBeRoot";
|
|
87
|
+
}
|
|
88
|
+
};
|
|
27
89
|
var StaticSite = class StaticSite {
|
|
28
90
|
config;
|
|
29
91
|
dependencies;
|
|
30
92
|
id;
|
|
31
93
|
keys;
|
|
94
|
+
/**
|
|
95
|
+
* Its public address, `https://web.example.com` — a string, no await. The
|
|
96
|
+
* same `<ID>_URL` on every command and stage, so a link built from it opens
|
|
97
|
+
* in a browser.
|
|
98
|
+
*/
|
|
99
|
+
service;
|
|
32
100
|
constructor(id, config, dependencies = []) {
|
|
33
101
|
this.config = config;
|
|
34
102
|
this.dependencies = dependencies;
|
|
35
103
|
this.id = canonicalId(id);
|
|
36
|
-
this.keys = { url:
|
|
104
|
+
this.keys = { url: providedKeyFor(this.id, "site", "url") };
|
|
105
|
+
this.service = {
|
|
106
|
+
serviceName: serviceKey(this.id),
|
|
107
|
+
register: (options) => publicUrl(options, this.keys.url)
|
|
108
|
+
};
|
|
109
|
+
const wildcard = config.subdomain === WILDCARD_SUBDOMAIN;
|
|
110
|
+
if (wildcard && !config.hosts) throw new WildcardSiteNeedsHosts(this.id);
|
|
111
|
+
if (!wildcard && config.hosts) throw new SiteHostsNeedsWildcard(this.id);
|
|
112
|
+
if (wildcard && config.root) throw new WildcardSiteCannotBeRoot(this.id);
|
|
113
|
+
assertHostLabels({
|
|
114
|
+
id: this.id,
|
|
115
|
+
...config.subdomain ? { subdomain: config.subdomain } : {},
|
|
116
|
+
...config.aliases ? { aliases: config.aliases } : {},
|
|
117
|
+
...config.redirects ? { redirects: config.redirects } : {}
|
|
118
|
+
});
|
|
119
|
+
const variant = config.variant ?? "static";
|
|
120
|
+
if (config.prerender && variant !== "static") throw new PrerenderNeedsStaticSite(this.id, variant);
|
|
121
|
+
if (config.hosts && config.hosts.method.toUpperCase() !== "GET") throw new SiteHostsNotGet(this.id, config.hosts.method, config.hosts.route);
|
|
37
122
|
}
|
|
38
123
|
/**
|
|
39
124
|
* What this site calls.
|
|
@@ -45,15 +130,31 @@ var StaticSite = class StaticSite {
|
|
|
45
130
|
* Takes {@link Declarable} rather than {@link Consumable} because a site's
|
|
46
131
|
* edge is a build-time link and not a service injection — requiring a client
|
|
47
132
|
* would exclude exactly the surfaces a frontend actually depends on.
|
|
133
|
+
*
|
|
134
|
+
* A plain edge to a `FileServer` is to its public face: the site is built
|
|
135
|
+
* with the address its objects are served on, and handed nothing that
|
|
136
|
+
* writes to the bucket. A plain edge to an `ObjectStorage` is to where its
|
|
137
|
+
* links are signed (`<PREFIX><T>_SIGNED_ORIGIN`), and to nothing else of
|
|
138
|
+
* it. `.dependsOn([assets.server])` or `.dependsOn([documents.server])`
|
|
139
|
+
* asks for the bucket and its credentials too, for a server half that
|
|
140
|
+
* uploads or presigns.
|
|
48
141
|
*/
|
|
49
142
|
dependsOn(constructs) {
|
|
50
|
-
return new StaticSite(this.id, this.config, [...this.dependencies, ...constructs.map(
|
|
143
|
+
return new StaticSite(this.id, this.config, [...this.dependencies, ...constructs.map(frontendEdgeTo)]);
|
|
51
144
|
}
|
|
52
145
|
declare() {
|
|
146
|
+
const { hosts } = this.config;
|
|
53
147
|
return [{
|
|
54
148
|
kind: "site",
|
|
55
149
|
id: this.id,
|
|
56
150
|
variant: this.config.variant ?? "static",
|
|
151
|
+
...this.config.subdomain ? { subdomain: this.config.subdomain } : {},
|
|
152
|
+
...this.config.aliases?.length ? { aliases: [...this.config.aliases] } : {},
|
|
153
|
+
...this.config.redirects?.length ? { redirects: [...this.config.redirects] } : {},
|
|
154
|
+
...hosts ? { hosts: {
|
|
155
|
+
surface: canonicalId(hosts.surface.id),
|
|
156
|
+
path: hosts.route
|
|
157
|
+
} } : {},
|
|
57
158
|
app: {
|
|
58
159
|
path: this.config.path,
|
|
59
160
|
...this.config.port ? { port: this.config.port } : {},
|
|
@@ -61,11 +162,17 @@ var StaticSite = class StaticSite {
|
|
|
61
162
|
},
|
|
62
163
|
...this.config.root ? { root: true } : {},
|
|
63
164
|
dependencies: this.dependencies,
|
|
64
|
-
|
|
165
|
+
...this.config.telemetry ? { telemetry: this.config.telemetry.id } : {},
|
|
166
|
+
...this.config.password ? { password: {
|
|
167
|
+
secret: this.config.password.secret.id,
|
|
168
|
+
stages: [...this.config.password.stages]
|
|
169
|
+
} } : {},
|
|
170
|
+
...this.config.prerender ? { prerender: this.config.prerender } : {},
|
|
171
|
+
provides: [this.keys.url, ...hosts ? [providedKeyFor(this.id, "site", "domain"), providedKeyFor(this.id, "site", "protectedSubdomains")] : []]
|
|
65
172
|
}];
|
|
66
173
|
}
|
|
67
174
|
};
|
|
68
175
|
//#endregion
|
|
69
|
-
export { StaticSite };
|
|
176
|
+
export { HostLabelBothAliasAndRedirect, InvalidHostLabel, PrerenderNeedsStaticSite, SiteHostsNeedsWildcard, SiteHostsNotGet, StaticSite, WildcardSiteCannotBeRoot, WildcardSiteCannotHaveAliases, WildcardSiteNeedsHosts };
|
|
70
177
|
|
|
71
178
|
//# sourceMappingURL=site.mjs.map
|
package/dist/site.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.mjs","names":[],"sources":["../src/site.ts"],"sourcesContent":["/**\n * `StaticSite` — a frontend, declared like anything else.\n *\n * The point is not that a site needs provisioning; it is that a site is the\n * *consumer* whose edges make four hand-maintained lists derivable. Declaring it\n * is what turns \"which origins does the API allow\" from something a person keeps\n * in step into something the graph already knows.\n *\n * ```ts\n * export const console = new StaticSite('Console', { path: 'apps/console' })\n * .dependsOn([api, auth]);\n * ```\n *\n * It has no `.service`. A site is not a process that registers clients — it is\n * built, and the values it needs are inlined or fetched by its own framework —\n * so the edge is {@link Declarable} rather than {@link Consumable}, and the\n * asymmetry is the honest one: a site consumes addresses, not connections.\n *\n * Only the static variant ships. SSR deploy shapes are unstable and each one is\n * its own maintenance, so they follow rather than arrive together; Expo and\n * mobile are out of scope entirely, because an app store is not infrastructure\n * and there is no URL to hand anyone.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\tprovideKey,\n\ttype SiteDeclaration,\n} from '@geekmidas/manifest';\nimport { type Declarable, edgeTo } from './construct-interface';\n\n/**\n * Where a site's source lives, and the little else a layout can differ by.\n *\n * Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a\n * complete site.\n */\nexport interface StaticSiteConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root — `'apps/web'`.\n\t *\n\t * Required, the same field `RestApi` and `BetterAuth` take. It was\n\t * inferred from the id, which made a site's home whatever was on disk.\n\t */\n\tpath: string;\n\t/**\n\t * The port it answers on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, so adding a site\n\t * does not renumber the ones already running.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars this site reads.\n\t *\n\t * A frontend's values are inlined at build time, so the build has to know\n\t * which ones it reads before it reads them.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Whether the base domain points at this site.\n\t *\n\t * A project with one site needs this no more than a project with one\n\t * database needs to say which database. It matters when there are several\n\t * and none is called `web`: the base domain then belongs to whichever site\n\t * says so, rather than to whichever file the glob happened to reach first.\n\t */\n\troot?: boolean;\n\t/**\n\t * Which framework builds it.\n\t *\n\t * It selects how values are delivered — `VITE_`, `NEXT_PUBLIC_`, a fetched\n\t * `config.json` — and never which values there are. One neutral name from the\n\t * construct, one serialisation per framework, the same rule as everywhere\n\t * else.\n\t */\n\tvariant?: SiteDeclaration['variant'];\n}\n\nexport class StaticSite<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\treadonly keys: { url: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: StaticSiteConfig,\n\t\t/**\n\t\t * Internal: how `.dependsOn()` carries edges into the copy it returns.\n\t\t * Written as a parameter rather than a mutable field so the builder can\n\t\t * stay immutable without a clone method, the same shape\n\t\t * `KyselyDatabase` uses for its derived forms.\n\t\t */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { url: provideKey(this.id, 'url') };\n\t}\n\n\t/**\n\t * What this site calls.\n\t *\n\t * Immutable, like every other builder here: it returns a new site rather than\n\t * mutating this one, so a module that exports both a base and a variant of it\n\t * cannot have the second silently change the first.\n\t *\n\t * Takes {@link Declarable} rather than {@link Consumable} because a site's\n\t * edge is a build-time link and not a service injection — requiring a client\n\t * would exclude exactly the surfaces a frontend actually depends on.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): StaticSite<TName> {\n\t\treturn new StaticSite<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(edgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'site',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'static',\n\t\t\t\tapp: {\n\t\t\t\t\tpath: this.config.path,\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.root ? { root: true } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\tprovides: [this.keys.url],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkFA,IAAa,aAAb,MAAa,WAEb;CAMmB;CAOA;CAZlB;CACA;CAEA,YACC,IACA,QAOA,eAAuD,CAAC,GACvD;EARgB,KAAA,SAAA;EAOA,KAAA,eAAA;EAEjB,KAAK,KAAK,YAAY,EAAY;EAClC,KAAK,OAAO,EAAE,KAAK,WAAW,KAAK,IAAI,KAAK,EAAE;CAC/C;;;;;;;;;;;;CAaA,UAAU,YAAsD;EAC/D,OAAO,IAAI,WAAkB,KAAK,IAA4B,KAAK,QAAQ,CAC1E,GAAG,KAAK,cACR,GAAG,WAAW,IAAI,MAAM,CACzB,CAAC;CACF;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,KAAK;IACJ,MAAM,KAAK,OAAO;IAClB,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;IACrD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC5D;GACA,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;GACzC,cAAc,KAAK;GACnB,UAAU,CAAC,KAAK,KAAK,GAAG;EACzB,CACD;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"site.mjs","names":[],"sources":["../src/site.ts"],"sourcesContent":["/**\n * `StaticSite` — a frontend, declared like anything else.\n *\n * The point is not that a site needs provisioning; it is that a site is the\n * *consumer* whose edges make four hand-maintained lists derivable. Declaring it\n * is what turns \"which origins does the API allow\" from something a person keeps\n * in step into something the graph already knows.\n *\n * ```ts\n * export const console = new StaticSite('Console', { path: 'apps/console' })\n * .dependsOn([api, auth]);\n * ```\n *\n * A site consumes addresses, not connections: it is built, and the values it\n * needs are inlined or fetched by its own framework, so its own edges take any\n * {@link Declarable}. Its `.service` is its public address — what a worker's\n * cron or an endpoint that builds links to it reads:\n *\n * ```ts\n * export const digest = worker\n * .cron('rate(1 day)')\n * .dependsOn([web])\n * .handle(async ({ services }) => link(services.web, '/inbox'));\n * ```\n *\n * Only the static variant ships. SSR deploy shapes are unstable and each one is\n * its own maintenance, so they follow rather than arrive together. A mobile app\n * is not a site — it is reached by a scheme, not a URL — and is its own\n * construct: see `MobileApp`.\n */\n\nimport {\n\tassertHostLabels,\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\tprovidedKeyFor,\n\ttype SiteDeclaration,\n\tserviceKey,\n\tWILDCARD_SUBDOMAIN,\n} from '@geekmidas/manifest';\n\n/** Thrown at construction for an alias or redirect that cannot be a host label. */\nexport {\n\tHostLabelBothAliasAndRedirect,\n\tInvalidHostLabel,\n\tWildcardSiteCannotHaveAliases,\n} from '@geekmidas/manifest';\n\nimport type { Service } from '@geekmidas/services';\nimport {\n\ttype Construct,\n\ttype Declarable,\n\tfrontendEdgeTo,\n\tpublicUrl,\n} from './construct-interface';\nimport type { RandomPassword } from './random-password';\nimport type { DeployedStage } from './stages';\nimport type { Telemetry } from './telemetry';\n\n/**\n * Where a site's source lives, and the little else a layout can differ by.\n *\n * Only `path` is required: `new StaticSite('Web', { path: 'apps/web' })` is a\n * complete site.\n */\nexport interface StaticSiteConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root — `'apps/web'`.\n\t *\n\t * Required, the same field `RestApi` and `BetterAuth` take. It was\n\t * inferred from the id, which made a site's home whatever was on disk.\n\t */\n\tpath: string;\n\t/**\n\t * The label it answers on under a stage's domain — `api` for\n\t * `api.myapp.com`, from `domains` — and under the project locally,\n\t * `api.myapp.localhost`. Absent, its id kebab-cased.\n\t *\n\t * `'*'` answers on every subdomain nothing else does — one host per\n\t * tenant, `acme.myapp.com` — and then `hosts` names which of them are\n\t * real. Every other app keeps its own host, and a project has at most one\n\t * such site.\n\t */\n\tsubdomain?: string;\n\t/**\n\t * More labels it answers on under the stage's domain, exactly as on its\n\t * own: each a host the site really serves, and an origin every surface it\n\t * depends on trusts. Its own host stays canonical (`<ID>_URL`).\n\t */\n\taliases?: readonly string[];\n\t/**\n\t * Labels that answer with a permanent (301) redirect to its own host,\n\t * path and query kept — `['www']` sends `www.myapp.com` to `myapp.com`.\n\t * Nothing answers on a host unless a construct names it, so there is no\n\t * automatic `www`. Sites only: an API client does not reliably follow a\n\t * redirect on a `POST`.\n\t */\n\tredirects?: readonly string[];\n\t/**\n\t * With `subdomain: '*'`, the route that says which hosts are tenants: an\n\t * exported `GET` endpoint the edge asks before it serves a host,\n\t * `?domain=<host>`, answering `200` for a tenant and `404` otherwise.\n\t *\n\t * It runs without a session and belongs to no public API.\n\t */\n\thosts?: SiteHostsEndpoint;\n\t/**\n\t * The port it answers on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, so adding a site\n\t * does not renumber the ones already running.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars this site reads.\n\t *\n\t * A frontend's values are inlined at build time, so the build has to know\n\t * which ones it reads before it reads them.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Whether the base domain points at this site.\n\t *\n\t * A project with one site needs this no more than a project with one\n\t * database needs to say which database. It matters when there are several\n\t * and none is called `web`: the base domain then belongs to whichever site\n\t * says so, rather than to whichever file the glob happened to reach first.\n\t */\n\troot?: boolean;\n\t/**\n\t * Which framework builds it.\n\t *\n\t * It selects how values are delivered — `VITE_`, `NEXT_PUBLIC_`, a fetched\n\t * `config.json` — and never which values there are. One neutral name from the\n\t * construct, one serialisation per framework, the same rule as everywhere\n\t * else.\n\t */\n\tvariant?: SiteDeclaration['variant'];\n\t/**\n\t * What the site emits — the `Telemetry` construct. An edge to the node and\n\t * nothing more for now: a site is handed none of its server keys, and the\n\t * browser half (propagation from the generated client, then a browser SDK\n\t * exporting through the API) builds on this edge.\n\t */\n\ttelemetry?: Telemetry;\n\t/**\n\t * A login the site is served behind on the stages named, so a staging\n\t * build is not public while it is tried.\n\t *\n\t * ```ts\n\t * export const sitePassword = new RandomPassword('SitePassword');\n\t *\n\t * export const web = new StaticSite('Web', {\n\t * path: 'apps/web',\n\t * password: { secret: sitePassword, stages: ['staging'] },\n\t * });\n\t * ```\n\t *\n\t * The edge asks for it with HTTP basic auth before a request reaches the\n\t * site: the user is the stage's name, the password the `RandomPassword`'s\n\t * value on that stage. Like any `RandomPassword` it is generated on the\n\t * first deploy and kept, and one set by hand wins. It is not an edge — the\n\t * site is handed none of it — so export it from a constructs file of its\n\t * own, as any construct is.\n\t *\n\t * The compose target alone serves it so far; another refuses the stage\n\t * rather than serving it publicly.\n\t */\n\tpassword?: {\n\t\tsecret: RandomPassword;\n\t\tstages: readonly [DeployedStage, ...DeployedStage[]];\n\t};\n\t/**\n\t * `'stage'` for a `static` site that pre-renders data at build time\n\t * (vite-ssg and similar): its build fetches from the APIs it\n\t * `.dependsOn()`, and bakes their answers into its files.\n\t *\n\t * ```ts\n\t * new StaticSite('Web', {\n\t * path: 'apps/web',\n\t * variant: 'static',\n\t * prerender: 'stage',\n\t * }).dependsOn([api]);\n\t * ```\n\t *\n\t * The deploy then builds the site only once those APIs are up and\n\t * healthy on the stage, and the build reaches them at their public\n\t * addresses, as a browser would. Without it, a site is built offline,\n\t * before its stage runs (`GKM_BUILD_OFFLINE=1`), and nothing at runtime\n\t * can fill a page built without its data.\n\t *\n\t * Opt-in, because the image then holds that stage's data: the same commit\n\t * builds a different image per stage, and `gkm compose --build --push`\n\t * needs the stage it builds for already running.\n\t */\n\tprerender?: 'stage';\n}\n\n/**\n * The shape of the endpoint `hosts` names — read structurally, so a site\n * module never loads the endpoint machinery to say which route it means.\n */\nexport interface SiteHostsEndpoint {\n\troute: string;\n\tmethod: string;\n\tsurface: { id: string };\n}\n\n/** `subdomain: '*'` without `hosts`: nothing would say which hosts are tenants. */\nexport class WildcardSiteNeedsHosts extends Error {\n\tconstructor(readonly id: string) {\n\t\tsuper(\n\t\t\t`'${id}' answers on every subdomain, so it has to say which of them ` +\n\t\t\t\t`are tenants: pass \\`hosts\\`, a GET endpoint answering 200 for a ` +\n\t\t\t\t`host it serves and 404 otherwise.`,\n\t\t);\n\t\tthis.name = 'WildcardSiteNeedsHosts';\n\t}\n}\n\n/** `hosts` on a site with one host, where there is nothing to check. */\nexport class SiteHostsNeedsWildcard extends Error {\n\tconstructor(readonly id: string) {\n\t\tsuper(\n\t\t\t`'${id}' names a \\`hosts\\` check but answers on one host. ` +\n\t\t\t\t`Declare \\`subdomain: '*'\\` to serve every subdomain, or drop \\`hosts\\`.`,\n\t\t);\n\t\tthis.name = 'SiteHostsNeedsWildcard';\n\t}\n}\n\n/** A `hosts` endpoint that is not a `GET`: the edge only ever asks with one. */\nexport class SiteHostsNotGet extends Error {\n\tconstructor(\n\t\treadonly id: string,\n\t\treadonly method: string,\n\t\treadonly route: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${id}' checks its hosts with ${method} ${route}, but the edge asks ` +\n\t\t\t\t`with GET ${route}?domain=<host>. Make it a GET endpoint.`,\n\t\t);\n\t\tthis.name = 'SiteHostsNotGet';\n\t}\n}\n\n/**\n * `prerender: 'stage'` on a site that renders its pages on a server, where a\n * page renders on its first request — which the deploy's warm-up makes — and\n * needs no data at build.\n */\nexport class PrerenderNeedsStaticSite extends Error {\n\tconstructor(\n\t\treadonly id: string,\n\t\treadonly variant: SiteDeclaration['variant'],\n\t) {\n\t\tsuper(\n\t\t\t`'${id}' is a '${variant}' site, which renders its pages on its own ` +\n\t\t\t\t`server, so it never needs its APIs at build: drop \\`prerender\\`, ` +\n\t\t\t\t`and render data-backed pages on request (the deploy warms them). ` +\n\t\t\t\t`\\`prerender: 'stage'\\` is for a 'static' site that bakes data into ` +\n\t\t\t\t`its files.`,\n\t\t);\n\t\tthis.name = 'PrerenderNeedsStaticSite';\n\t}\n}\n\n/** A wildcard site that says it holds the base domain. */\nexport class WildcardSiteCannotBeRoot extends Error {\n\tconstructor(readonly id: string) {\n\t\tsuper(\n\t\t\t`'${id}' answers on every subdomain, so it cannot also hold the base ` +\n\t\t\t\t`domain. Drop \\`root: true\\`, and declare the site the base domain ` +\n\t\t\t\t`points at separately.`,\n\t\t);\n\t\tthis.name = 'WildcardSiteCannotBeRoot';\n\t}\n}\n\nexport class StaticSite<TName extends string = string>\n\timplements Declarable<TName>, Construct<TName, string>\n{\n\treadonly id: TName;\n\treadonly keys: { url: string };\n\n\t/**\n\t * Its public address, `https://web.example.com` — a string, no await. The\n\t * same `<ID>_URL` on every command and stage, so a link built from it opens\n\t * in a browser.\n\t */\n\treadonly service: Service<Uncapitalize<TName>, string>;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: StaticSiteConfig,\n\t\t/**\n\t\t * Internal: how `.dependsOn()` carries edges into the copy it returns.\n\t\t * Written as a parameter rather than a mutable field so the builder can\n\t\t * stay immutable without a clone method, the same shape\n\t\t * `KyselyDatabase` uses for its derived forms.\n\t\t */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { url: providedKeyFor(this.id, 'site', 'url') };\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(this.id) as Uncapitalize<TName>,\n\t\t\tregister: (options) => publicUrl(options, this.keys.url),\n\t\t};\n\n\t\tconst wildcard = config.subdomain === WILDCARD_SUBDOMAIN;\n\t\tif (wildcard && !config.hosts) throw new WildcardSiteNeedsHosts(this.id);\n\t\tif (!wildcard && config.hosts) throw new SiteHostsNeedsWildcard(this.id);\n\t\tif (wildcard && config.root) throw new WildcardSiteCannotBeRoot(this.id);\n\t\tassertHostLabels({\n\t\t\tid: this.id,\n\t\t\t...(config.subdomain ? { subdomain: config.subdomain } : {}),\n\t\t\t...(config.aliases ? { aliases: config.aliases } : {}),\n\t\t\t...(config.redirects ? { redirects: config.redirects } : {}),\n\t\t});\n\t\tconst variant = config.variant ?? 'static';\n\t\tif (config.prerender && variant !== 'static') {\n\t\t\tthrow new PrerenderNeedsStaticSite(this.id, variant);\n\t\t}\n\t\tif (config.hosts && config.hosts.method.toUpperCase() !== 'GET') {\n\t\t\tthrow new SiteHostsNotGet(\n\t\t\t\tthis.id,\n\t\t\t\tconfig.hosts.method,\n\t\t\t\tconfig.hosts.route,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * What this site calls.\n\t *\n\t * Immutable, like every other builder here: it returns a new site rather than\n\t * mutating this one, so a module that exports both a base and a variant of it\n\t * cannot have the second silently change the first.\n\t *\n\t * Takes {@link Declarable} rather than {@link Consumable} because a site's\n\t * edge is a build-time link and not a service injection — requiring a client\n\t * would exclude exactly the surfaces a frontend actually depends on.\n\t *\n\t * A plain edge to a `FileServer` is to its public face: the site is built\n\t * with the address its objects are served on, and handed nothing that\n\t * writes to the bucket. A plain edge to an `ObjectStorage` is to where its\n\t * links are signed (`<PREFIX><T>_SIGNED_ORIGIN`), and to nothing else of\n\t * it. `.dependsOn([assets.server])` or `.dependsOn([documents.server])`\n\t * asks for the bucket and its credentials too, for a server half that\n\t * uploads or presigns.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): StaticSite<TName> {\n\t\treturn new StaticSite<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(frontendEdgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\tconst { hosts } = this.config;\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'site',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'static',\n\t\t\t\t...(this.config.subdomain ? { subdomain: this.config.subdomain } : {}),\n\t\t\t\t...(this.config.aliases?.length\n\t\t\t\t\t? { aliases: [...this.config.aliases] }\n\t\t\t\t\t: {}),\n\t\t\t\t...(this.config.redirects?.length\n\t\t\t\t\t? { redirects: [...this.config.redirects] }\n\t\t\t\t\t: {}),\n\t\t\t\t...(hosts\n\t\t\t\t\t? {\n\t\t\t\t\t\t\thosts: {\n\t\t\t\t\t\t\t\tsurface: canonicalId(hosts.surface.id),\n\t\t\t\t\t\t\t\tpath: hosts.route,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t\tapp: {\n\t\t\t\t\tpath: this.config.path,\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.root ? { root: true } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\t...(this.config.telemetry\n\t\t\t\t\t? { telemetry: this.config.telemetry.id }\n\t\t\t\t\t: {}),\n\t\t\t\t...(this.config.password\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tpassword: {\n\t\t\t\t\t\t\t\tsecret: this.config.password.secret.id,\n\t\t\t\t\t\t\t\tstages: [...this.config.password.stages],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t\t...(this.config.prerender ? { prerender: this.config.prerender } : {}),\n\t\t\t\tprovides: [\n\t\t\t\t\tthis.keys.url,\n\t\t\t\t\t...(hosts\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\tprovidedKeyFor(this.id, 'site', 'domain'),\n\t\t\t\t\t\t\t\tprovidedKeyFor(this.id, 'site', 'protectedSubdomains'),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t: []),\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmNA,IAAa,yBAAb,cAA4C,MAAM;CAC5B;CAArB,YAAY,IAAqB;EAChC,MACC,IAAI,GAAG,+JAGR;EALoB,KAAA,KAAA;EAMpB,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,yBAAb,cAA4C,MAAM;CAC5B;CAArB,YAAY,IAAqB;EAChC,MACC,IAAI,GAAG,2HAER;EAJoB,KAAA,KAAA;EAKpB,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,kBAAb,cAAqC,MAAM;CAEhC;CACA;CACA;CAHV,YACC,IACA,QACA,OACC;EACD,MACC,IAAI,GAAG,0BAA0B,OAAO,GAAG,MAAM,+BACpC,MAAM,wCACpB;EAPS,KAAA,KAAA;EACA,KAAA,SAAA;EACA,KAAA,QAAA;EAMT,KAAK,OAAO;CACb;AACD;;;;;;AAOA,IAAa,2BAAb,cAA8C,MAAM;CAEzC;CACA;CAFV,YACC,IACA,SACC;EACD,MACC,IAAI,GAAG,UAAU,QAAQ,2PAK1B;EATS,KAAA,KAAA;EACA,KAAA,UAAA;EAST,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,2BAAb,cAA8C,MAAM;CAC9B;CAArB,YAAY,IAAqB;EAChC,MACC,IAAI,GAAG,sJAGR;EALoB,KAAA,KAAA;EAMpB,KAAK,OAAO;CACb;AACD;AAEA,IAAa,aAAb,MAAa,WAEb;CAamB;CAOA;CAnBlB;CACA;;;;;;CAOA;CAEA,YACC,IACA,QAOA,eAAuD,CAAC,GACvD;EARgB,KAAA,SAAA;EAOA,KAAA,eAAA;EAEjB,KAAK,KAAK,YAAY,EAAY;EAClC,KAAK,OAAO,EAAE,KAAK,eAAe,KAAK,IAAI,QAAQ,KAAK,EAAE;EAE1D,KAAK,UAAU;GACd,aAAa,WAAW,KAAK,EAAE;GAC/B,WAAW,YAAY,UAAU,SAAS,KAAK,KAAK,GAAG;EACxD;EAEA,MAAM,WAAW,OAAO,cAAc;EACtC,IAAI,YAAY,CAAC,OAAO,OAAO,MAAM,IAAI,uBAAuB,KAAK,EAAE;EACvE,IAAI,CAAC,YAAY,OAAO,OAAO,MAAM,IAAI,uBAAuB,KAAK,EAAE;EACvE,IAAI,YAAY,OAAO,MAAM,MAAM,IAAI,yBAAyB,KAAK,EAAE;EACvE,iBAAiB;GAChB,IAAI,KAAK;GACT,GAAI,OAAO,YAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;GAC1D,GAAI,OAAO,UAAU,EAAE,SAAS,OAAO,QAAQ,IAAI,CAAC;GACpD,GAAI,OAAO,YAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;EAC3D,CAAC;EACD,MAAM,UAAU,OAAO,WAAW;EAClC,IAAI,OAAO,aAAa,YAAY,UACnC,MAAM,IAAI,yBAAyB,KAAK,IAAI,OAAO;EAEpD,IAAI,OAAO,SAAS,OAAO,MAAM,OAAO,YAAY,MAAM,OACzD,MAAM,IAAI,gBACT,KAAK,IACL,OAAO,MAAM,QACb,OAAO,MAAM,KACd;CAEF;;;;;;;;;;;;;;;;;;;;CAqBA,UAAU,YAAsD;EAC/D,OAAO,IAAI,WAAkB,KAAK,IAA4B,KAAK,QAAQ,CAC1E,GAAG,KAAK,cACR,GAAG,WAAW,IAAI,cAAc,CACjC,CAAC;CACF;CAEA,UAAyB;EACxB,MAAM,EAAE,UAAU,KAAK;EACvB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,GAAI,KAAK,OAAO,YAAY,EAAE,WAAW,KAAK,OAAO,UAAU,IAAI,CAAC;GACpE,GAAI,KAAK,OAAO,SAAS,SACtB,EAAE,SAAS,CAAC,GAAG,KAAK,OAAO,OAAO,EAAE,IACpC,CAAC;GACJ,GAAI,KAAK,OAAO,WAAW,SACxB,EAAE,WAAW,CAAC,GAAG,KAAK,OAAO,SAAS,EAAE,IACxC,CAAC;GACJ,GAAI,QACD,EACA,OAAO;IACN,SAAS,YAAY,MAAM,QAAQ,EAAE;IACrC,MAAM,MAAM;GACb,EACD,IACC,CAAC;GACJ,KAAK;IACJ,MAAM,KAAK,OAAO;IAClB,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;IACrD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC5D;GACA,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;GACzC,cAAc,KAAK;GACnB,GAAI,KAAK,OAAO,YACb,EAAE,WAAW,KAAK,OAAO,UAAU,GAAG,IACtC,CAAC;GACJ,GAAI,KAAK,OAAO,WACb,EACA,UAAU;IACT,QAAQ,KAAK,OAAO,SAAS,OAAO;IACpC,QAAQ,CAAC,GAAG,KAAK,OAAO,SAAS,MAAM;GACxC,EACD,IACC,CAAC;GACJ,GAAI,KAAK,OAAO,YAAY,EAAE,WAAW,KAAK,OAAO,UAAU,IAAI,CAAC;GACpE,UAAU,CACT,KAAK,KAAK,KACV,GAAI,QACD,CACA,eAAe,KAAK,IAAI,QAAQ,QAAQ,GACxC,eAAe,KAAK,IAAI,QAAQ,qBAAqB,CACtD,IACC,CAAC,CACL;EACD,CACD;CACD;AACD"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//#region src/stages.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The project's stage names, as types.
|
|
4
|
+
*
|
|
5
|
+
* `gkm.config.ts` declares the stages — `stages: { local: 'dev', deployed:
|
|
6
|
+
* ['staging', 'prod'] }` — but constructs and application code cannot import
|
|
7
|
+
* the config, so a stage name written anywhere else was a bare `string`: a
|
|
8
|
+
* typo'd key in an `ExternalApi`'s `url` map was silently never read, and a
|
|
9
|
+
* seed's `stage === 'prodution'` branch silently never ran.
|
|
10
|
+
*
|
|
11
|
+
* `gkm dev`, `gkm build` and `gkm test --prepare` write `.gkm/stages.d.ts`,
|
|
12
|
+
* which fills this interface in from the loaded workspace:
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* declare module '@geekmidas/constructs' {
|
|
16
|
+
* interface Stages { local: 'dev'; deployed: 'staging' | 'prod' }
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Until that file exists — a fresh clone, before the first run — the interface
|
|
21
|
+
* is empty and every stage type below is `string`, so nothing fails to compile
|
|
22
|
+
* for want of a generated file.
|
|
23
|
+
*/
|
|
24
|
+
interface Stages {}
|
|
25
|
+
/** What `Stages` says under `key`, or `string` while it says nothing. */
|
|
26
|
+
type Declared<TKey extends string> = Stages extends { [K in TKey]: infer TStage extends string; } ? TStage : string;
|
|
27
|
+
/** The stage `gkm dev`, `exec`, `setup` and `test` run as: `stages.local`. */
|
|
28
|
+
type LocalStage = Declared<'local'>;
|
|
29
|
+
/** A stage `gkm deploy --stage` accepts: one of `stages.deployed`. */
|
|
30
|
+
type DeployedStage = Declared<'deployed'>;
|
|
31
|
+
/** What `gkm test` runs as. The CLI's own; no project stage may take it. */
|
|
32
|
+
type TestStage = 'test';
|
|
33
|
+
/** Any stage the project's code can find itself running as. */
|
|
34
|
+
type AnyStage = LocalStage | TestStage | DeployedStage;
|
|
35
|
+
/**
|
|
36
|
+
* What a seed is handed beside its database.
|
|
37
|
+
*
|
|
38
|
+
* Seeds run on every stage, production included, so a seed that should write
|
|
39
|
+
* something only somewhere — a demo tenant on the local stage, never on a
|
|
40
|
+
* deployed one — decides by the stage it is given:
|
|
41
|
+
*
|
|
42
|
+
* ```ts
|
|
43
|
+
* import type { SeedContext } from '@geekmidas/constructs';
|
|
44
|
+
*
|
|
45
|
+
* export async function seed(db: Kysely<Database>, { stage }: SeedContext) {
|
|
46
|
+
* if (stage === 'dev') await insertDemoTenant(db);
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* A seed reaching a construct's service — a bucket, a cache — builds it from
|
|
51
|
+
* the stage's `env`, as a handler's service is built from its own:
|
|
52
|
+
*
|
|
53
|
+
* ```ts
|
|
54
|
+
* export async function seed(db, { stage, env }: SeedContext) {
|
|
55
|
+
* const bucket = await assets.service.register({
|
|
56
|
+
* envParser: new EnvironmentParser(env),
|
|
57
|
+
* context: serviceContext,
|
|
58
|
+
* });
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
interface SeedContext {
|
|
63
|
+
/** The stage being seeded: the local one, `test`, or a deployed one. */
|
|
64
|
+
stage: AnyStage;
|
|
65
|
+
/**
|
|
66
|
+
* The stage's resolved environment — every construct's URL, as the runner
|
|
67
|
+
* resolved it. Not `process.env`, which a seed run never populates.
|
|
68
|
+
*/
|
|
69
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { Stages as a, SeedContext as i, DeployedStage as n, TestStage as o, LocalStage as r, AnyStage as t };
|
|
73
|
+
//# sourceMappingURL=stages-DaTaoQei.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stages-DaTaoQei.d.cts","names":[],"sources":["../src/stages.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAuBiB;;KAGZ,SAAS,uBAAuB,kBACnC,KAAK,aAAa,2BAEjB;;KAIS,aAAa;;KAGb,gBAAgB;;KAGhB;;KAGA,WAAW,aAAa,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6B/B;;EAEhB,OAAO;;;;;EAKP,KAAK,SAAS"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//#region src/stages.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The project's stage names, as types.
|
|
4
|
+
*
|
|
5
|
+
* `gkm.config.ts` declares the stages — `stages: { local: 'dev', deployed:
|
|
6
|
+
* ['staging', 'prod'] }` — but constructs and application code cannot import
|
|
7
|
+
* the config, so a stage name written anywhere else was a bare `string`: a
|
|
8
|
+
* typo'd key in an `ExternalApi`'s `url` map was silently never read, and a
|
|
9
|
+
* seed's `stage === 'prodution'` branch silently never ran.
|
|
10
|
+
*
|
|
11
|
+
* `gkm dev`, `gkm build` and `gkm test --prepare` write `.gkm/stages.d.ts`,
|
|
12
|
+
* which fills this interface in from the loaded workspace:
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* declare module '@geekmidas/constructs' {
|
|
16
|
+
* interface Stages { local: 'dev'; deployed: 'staging' | 'prod' }
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Until that file exists — a fresh clone, before the first run — the interface
|
|
21
|
+
* is empty and every stage type below is `string`, so nothing fails to compile
|
|
22
|
+
* for want of a generated file.
|
|
23
|
+
*/
|
|
24
|
+
interface Stages {}
|
|
25
|
+
/** What `Stages` says under `key`, or `string` while it says nothing. */
|
|
26
|
+
type Declared<TKey extends string> = Stages extends { [K in TKey]: infer TStage extends string; } ? TStage : string;
|
|
27
|
+
/** The stage `gkm dev`, `exec`, `setup` and `test` run as: `stages.local`. */
|
|
28
|
+
type LocalStage = Declared<'local'>;
|
|
29
|
+
/** A stage `gkm deploy --stage` accepts: one of `stages.deployed`. */
|
|
30
|
+
type DeployedStage = Declared<'deployed'>;
|
|
31
|
+
/** What `gkm test` runs as. The CLI's own; no project stage may take it. */
|
|
32
|
+
type TestStage = 'test';
|
|
33
|
+
/** Any stage the project's code can find itself running as. */
|
|
34
|
+
type AnyStage = LocalStage | TestStage | DeployedStage;
|
|
35
|
+
/**
|
|
36
|
+
* What a seed is handed beside its database.
|
|
37
|
+
*
|
|
38
|
+
* Seeds run on every stage, production included, so a seed that should write
|
|
39
|
+
* something only somewhere — a demo tenant on the local stage, never on a
|
|
40
|
+
* deployed one — decides by the stage it is given:
|
|
41
|
+
*
|
|
42
|
+
* ```ts
|
|
43
|
+
* import type { SeedContext } from '@geekmidas/constructs';
|
|
44
|
+
*
|
|
45
|
+
* export async function seed(db: Kysely<Database>, { stage }: SeedContext) {
|
|
46
|
+
* if (stage === 'dev') await insertDemoTenant(db);
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* A seed reaching a construct's service — a bucket, a cache — builds it from
|
|
51
|
+
* the stage's `env`, as a handler's service is built from its own:
|
|
52
|
+
*
|
|
53
|
+
* ```ts
|
|
54
|
+
* export async function seed(db, { stage, env }: SeedContext) {
|
|
55
|
+
* const bucket = await assets.service.register({
|
|
56
|
+
* envParser: new EnvironmentParser(env),
|
|
57
|
+
* context: serviceContext,
|
|
58
|
+
* });
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
interface SeedContext {
|
|
63
|
+
/** The stage being seeded: the local one, `test`, or a deployed one. */
|
|
64
|
+
stage: AnyStage;
|
|
65
|
+
/**
|
|
66
|
+
* The stage's resolved environment — every construct's URL, as the runner
|
|
67
|
+
* resolved it. Not `process.env`, which a seed run never populates.
|
|
68
|
+
*/
|
|
69
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { Stages as a, SeedContext as i, DeployedStage as n, TestStage as o, LocalStage as r, AnyStage as t };
|
|
73
|
+
//# sourceMappingURL=stages-DaTaoQei.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stages-DaTaoQei.d.mts","names":[],"sources":["../src/stages.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAuBiB;;KAGZ,SAAS,uBAAuB,kBACnC,KAAK,aAAa,2BAEjB;;KAIS,aAAa;;KAGb,gBAAgB;;KAGhB;;KAGA,WAAW,aAAa,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6B/B;;EAEhB,OAAO;;;;;EAKP,KAAK,SAAS"}
|