@geekmidas/constructs 10.0.0-alpha.17 → 10.0.0-alpha.171
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
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as ServerHalf, n as Construct } from "./construct-interface-Nw5Dt9AC.mjs";
|
|
2
|
+
import { n as ExpiryPrefixInvalid, r as ObjectExpiry, t as ExpiryDaysInvalid } from "./expire-C586zznE.mjs";
|
|
2
3
|
import { ConstructName, Declaration } from "@geekmidas/manifest";
|
|
3
4
|
import { StorageClient } from "@geekmidas/storage";
|
|
4
5
|
import { Service } from "@geekmidas/services";
|
|
@@ -6,6 +7,22 @@ import { Service } from "@geekmidas/services";
|
|
|
6
7
|
export interface ObjectStorageOptions {
|
|
7
8
|
/** Keep previous versions of an object. */
|
|
8
9
|
versioned?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Delete the objects under each prefix this many days after they were
|
|
12
|
+
* written — `{ 'quotes/': { days: 30 } }`.
|
|
13
|
+
*/
|
|
14
|
+
expire?: ObjectExpiry;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A bucket method called on a client that holds no connection — a site's or
|
|
18
|
+
* a mobile app's plain edge, which holds where the bucket's links are signed
|
|
19
|
+
* and nothing that writes to it.
|
|
20
|
+
*/
|
|
21
|
+
export declare class ObjectStorageReadOnly extends Error {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly method: string;
|
|
24
|
+
readonly key: string;
|
|
25
|
+
constructor(id: string, method: string, key: string);
|
|
9
26
|
}
|
|
10
27
|
export declare class ObjectStorage<TName extends string = string> implements Construct<TName, StorageClient> {
|
|
11
28
|
private readonly options;
|
|
@@ -17,16 +34,33 @@ export declare class ObjectStorage<TName extends string = string> implements Con
|
|
|
17
34
|
* of the construct owning both faces.
|
|
18
35
|
*/
|
|
19
36
|
private readonly keys;
|
|
37
|
+
/** Checked once, at declaration: prefix → days. */
|
|
38
|
+
private readonly expire;
|
|
20
39
|
constructor(id: ConstructName<TName>, options?: ObjectStorageOptions);
|
|
21
40
|
declare(): Declaration[];
|
|
22
41
|
/**
|
|
23
|
-
*
|
|
42
|
+
* The bucket, its connection and the key pair that signs for it, for a
|
|
43
|
+
* site's or a mobile app's server half that uploads or presigns:
|
|
44
|
+
* `.dependsOn([documents.server])`.
|
|
45
|
+
*
|
|
46
|
+
* A frontend's plain `.dependsOn([documents])` holds where the bucket's
|
|
47
|
+
* links are signed (`DOCUMENTS_SIGNED_ORIGIN`, inlined as
|
|
48
|
+
* `<PREFIX>DOCUMENTS_SIGNED_ORIGIN`) and nothing that writes to it. A
|
|
49
|
+
* backend's plain edge is already this one, and a backend cannot name it:
|
|
50
|
+
* it is a `Declarable`, not a `Consumable`.
|
|
51
|
+
*/
|
|
52
|
+
get server(): ServerHalf;
|
|
53
|
+
/**
|
|
54
|
+
* Builds the client from the connection string the adapter supplied —
|
|
55
|
+
* or, where none was, a client whose every method throws
|
|
56
|
+
* {@link ObjectStorageReadOnly}.
|
|
24
57
|
*
|
|
25
|
-
*
|
|
58
|
+
* Its scheme selects the driver, so this construct imports no provider
|
|
26
59
|
* and an app that never touches S3 never resolves the AWS SDK. Whoever
|
|
27
60
|
* assembles the application registers the drivers its target needs.
|
|
28
61
|
*/
|
|
29
62
|
private connect;
|
|
30
63
|
}
|
|
31
64
|
//#endregion
|
|
65
|
+
export { ExpiryDaysInvalid, ExpiryPrefixInvalid, type ObjectExpiry };
|
|
32
66
|
//# sourceMappingURL=object-storage.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-storage.d.mts","names":[],"sources":["../src/object-storage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"object-storage.d.mts","names":[],"sources":["../src/object-storage.ts"],"mappings":";;;;;;iBAgCiB;;EAEhB;;;;;EAKA,SAAS;;;;;;;qBAQG,8BAA8B;WAEhC;WACA;WACA;EAHV,YACU,YACA,gBACA;;qBAaE,cAAc,0CACf,UAAU,OAAO;mBAiBV;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;;;;;mBAO9B;;mBAGA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS;EAuB3B,WAAW;;;;;;;;;;;;MAuBP,UAAU;;;;;;;;;;UAaA"}
|
package/dist/object-storage.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { serverHalfOf } from "./construct-interface.mjs";
|
|
2
|
+
import { i as expiryDays, n as ExpiryDaysInvalid, r as ExpiryPrefixInvalid, t as readOnlyStorage } from "./readOnlyStorage-DMCeLuS2.mjs";
|
|
3
|
+
import { canonicalId, providedKeyFor, serviceKey } from "@geekmidas/manifest";
|
|
2
4
|
import { createStorageClient } from "@geekmidas/storage";
|
|
3
5
|
//#region src/object-storage.ts
|
|
4
6
|
/**
|
|
@@ -9,6 +11,23 @@ import { createStorageClient } from "@geekmidas/storage";
|
|
|
9
11
|
* `@geekmidas/storage` client. It names no cloud — `--target=aws` fills the
|
|
10
12
|
* injected URL with S3's values, local dev with MinIO's.
|
|
11
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* A bucket method called on a client that holds no connection — a site's or
|
|
16
|
+
* a mobile app's plain edge, which holds where the bucket's links are signed
|
|
17
|
+
* and nothing that writes to it.
|
|
18
|
+
*/
|
|
19
|
+
var ObjectStorageReadOnly = class extends Error {
|
|
20
|
+
id;
|
|
21
|
+
method;
|
|
22
|
+
key;
|
|
23
|
+
constructor(id, method, key) {
|
|
24
|
+
super(`'${id}' cannot ${method}(): ${key} is not in this process's environment. A site's or app's plain edge to a bucket holds only where its links are signed. A server half that uploads, presigns or reads depends on '${id}'.server instead — .dependsOn([${id.charAt(0).toLowerCase()}${id.slice(1)}.server]).`);
|
|
25
|
+
this.id = id;
|
|
26
|
+
this.method = method;
|
|
27
|
+
this.key = key;
|
|
28
|
+
this.name = "ObjectStorageReadOnly";
|
|
29
|
+
}
|
|
30
|
+
};
|
|
12
31
|
var ObjectStorage = class {
|
|
13
32
|
options;
|
|
14
33
|
id;
|
|
@@ -19,11 +38,14 @@ var ObjectStorage = class {
|
|
|
19
38
|
* of the construct owning both faces.
|
|
20
39
|
*/
|
|
21
40
|
keys;
|
|
41
|
+
/** Checked once, at declaration: prefix → days. */
|
|
42
|
+
expire;
|
|
22
43
|
constructor(id, options = {}) {
|
|
23
44
|
this.options = options;
|
|
24
45
|
const canonical = canonicalId(id);
|
|
25
46
|
this.id = canonical;
|
|
26
|
-
this.keys = {
|
|
47
|
+
this.keys = { connectionString: providedKeyFor(canonical, "objects", "connectionString") };
|
|
48
|
+
this.expire = expiryDays(canonical, options.expire);
|
|
27
49
|
this.service = {
|
|
28
50
|
serviceName: serviceKey(canonical),
|
|
29
51
|
register: (options) => this.connect(options)
|
|
@@ -33,23 +55,41 @@ var ObjectStorage = class {
|
|
|
33
55
|
return [{
|
|
34
56
|
kind: "objects",
|
|
35
57
|
id: this.id,
|
|
36
|
-
provides: [this.keys.
|
|
37
|
-
...this.options.versioned ? { versioned: true } : {}
|
|
58
|
+
provides: [this.keys.connectionString],
|
|
59
|
+
...this.options.versioned ? { versioned: true } : {},
|
|
60
|
+
...this.expire ? { expire: this.expire } : {}
|
|
38
61
|
}];
|
|
39
62
|
}
|
|
40
63
|
/**
|
|
41
|
-
*
|
|
64
|
+
* The bucket, its connection and the key pair that signs for it, for a
|
|
65
|
+
* site's or a mobile app's server half that uploads or presigns:
|
|
66
|
+
* `.dependsOn([documents.server])`.
|
|
67
|
+
*
|
|
68
|
+
* A frontend's plain `.dependsOn([documents])` holds where the bucket's
|
|
69
|
+
* links are signed (`DOCUMENTS_SIGNED_ORIGIN`, inlined as
|
|
70
|
+
* `<PREFIX>DOCUMENTS_SIGNED_ORIGIN`) and nothing that writes to it. A
|
|
71
|
+
* backend's plain edge is already this one, and a backend cannot name it:
|
|
72
|
+
* it is a `Declarable`, not a `Consumable`.
|
|
73
|
+
*/
|
|
74
|
+
get server() {
|
|
75
|
+
return serverHalfOf(this);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Builds the client from the connection string the adapter supplied —
|
|
79
|
+
* or, where none was, a client whose every method throws
|
|
80
|
+
* {@link ObjectStorageReadOnly}.
|
|
42
81
|
*
|
|
43
|
-
*
|
|
82
|
+
* Its scheme selects the driver, so this construct imports no provider
|
|
44
83
|
* and an app that never touches S3 never resolves the AWS SDK. Whoever
|
|
45
84
|
* assembles the application registers the drivers its target needs.
|
|
46
85
|
*/
|
|
47
86
|
async connect({ envParser }) {
|
|
48
|
-
const {
|
|
49
|
-
return
|
|
87
|
+
const { connectionString } = envParser.create((get) => ({ connectionString: get(this.keys.connectionString).string().optional() })).parse();
|
|
88
|
+
if (!connectionString) return readOnlyStorage((method) => new ObjectStorageReadOnly(this.id, method, this.keys.connectionString));
|
|
89
|
+
return createStorageClient(connectionString);
|
|
50
90
|
}
|
|
51
91
|
};
|
|
52
92
|
//#endregion
|
|
53
|
-
export { ObjectStorage };
|
|
93
|
+
export { ExpiryDaysInvalid, ExpiryPrefixInvalid, ObjectStorage, ObjectStorageReadOnly };
|
|
54
94
|
|
|
55
95
|
//# sourceMappingURL=object-storage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-storage.mjs","names":[],"sources":["../src/object-storage.ts"],"sourcesContent":["/**\n * `ObjectStorage` — a declared bucket.\n *\n * Where the three packages meet: it implements the construct contract, derives\n * its env key through `@geekmidas/manifest`, and hands back a\n * `@geekmidas/storage` client. It names no cloud — `--target=aws` fills the\n * injected URL with S3's values, local dev with MinIO's.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\
|
|
1
|
+
{"version":3,"file":"object-storage.mjs","names":[],"sources":["../src/object-storage.ts"],"sourcesContent":["/**\n * `ObjectStorage` — a declared bucket.\n *\n * Where the three packages meet: it implements the construct contract, derives\n * its env key through `@geekmidas/manifest`, and hands back a\n * `@geekmidas/storage` client. It names no cloud — `--target=aws` fills the\n * injected URL with S3's values, local dev with MinIO's.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tprovidedKeyFor,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport { createStorageClient, type StorageClient } from '@geekmidas/storage';\nimport {\n\ttype Construct,\n\ttype ServerHalf,\n\tserverHalfOf,\n} from './construct-interface';\nimport { expiryDays, type ObjectExpiry } from './expire';\nimport { readOnlyStorage } from './readOnlyStorage';\n\nexport {\n\tExpiryDaysInvalid,\n\tExpiryPrefixInvalid,\n\ttype ObjectExpiry,\n} from './expire';\n\nexport interface ObjectStorageOptions {\n\t/** Keep previous versions of an object. */\n\tversioned?: boolean;\n\t/**\n\t * Delete the objects under each prefix this many days after they were\n\t * written — `{ 'quotes/': { days: 30 } }`.\n\t */\n\texpire?: ObjectExpiry;\n}\n\n/**\n * A bucket method called on a client that holds no connection — a site's or\n * a mobile app's plain edge, which holds where the bucket's links are signed\n * and nothing that writes to it.\n */\nexport class ObjectStorageReadOnly extends Error {\n\tconstructor(\n\t\treadonly id: string,\n\t\treadonly method: string,\n\t\treadonly key: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${id}' cannot ${method}(): ${key} is not in this process's ` +\n\t\t\t\t`environment. A site's or app's plain edge to a bucket holds only ` +\n\t\t\t\t`where its links are signed. A server half that uploads, presigns ` +\n\t\t\t\t`or reads depends on '${id}'.server instead — ` +\n\t\t\t\t`.dependsOn([${id.charAt(0).toLowerCase()}${id.slice(1)}.server]).`,\n\t\t);\n\t\tthis.name = 'ObjectStorageReadOnly';\n\t}\n}\n\nexport class ObjectStorage<TName extends string = string>\n\timplements Construct<TName, StorageClient>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, StorageClient>;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the key the\n\t * build publishes and the key the client reads cannot drift — the whole point\n\t * of the construct owning both faces.\n\t */\n\tprivate readonly keys: { connectionString: string };\n\n\t/** Checked once, at declaration: prefix → days. */\n\tprivate readonly expire: Record<string, number> | undefined;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: ObjectStorageOptions = {},\n\t) {\n\t\t// Canonicalises, so `uploads` and `Uploads` are one construct rather than\n\t\t// two that collide. Throws on anything that cannot become a valid id.\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.keys = {\n\t\t\tconnectionString: providedKeyFor(\n\t\t\t\tcanonical,\n\t\t\t\t'objects',\n\t\t\t\t'connectionString',\n\t\t\t),\n\t\t};\n\t\tthis.expire = expiryDays(canonical, options.expire);\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (options) => this.connect(options),\n\t\t};\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'objects',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.connectionString],\n\t\t\t\t...(this.options.versioned ? { versioned: true } : {}),\n\t\t\t\t...(this.expire ? { expire: this.expire } : {}),\n\t\t\t},\n\t\t];\n\t}\n\n\t/**\n\t * The bucket, its connection and the key pair that signs for it, for a\n\t * site's or a mobile app's server half that uploads or presigns:\n\t * `.dependsOn([documents.server])`.\n\t *\n\t * A frontend's plain `.dependsOn([documents])` holds where the bucket's\n\t * links are signed (`DOCUMENTS_SIGNED_ORIGIN`, inlined as\n\t * `<PREFIX>DOCUMENTS_SIGNED_ORIGIN`) and nothing that writes to it. A\n\t * backend's plain edge is already this one, and a backend cannot name it:\n\t * it is a `Declarable`, not a `Consumable`.\n\t */\n\tget server(): ServerHalf {\n\t\treturn serverHalfOf(this);\n\t}\n\n\t/**\n\t * Builds the client from the connection string the adapter supplied —\n\t * or, where none was, a client whose every method throws\n\t * {@link ObjectStorageReadOnly}.\n\t *\n\t * Its scheme selects the driver, so this construct imports no provider\n\t * and an app that never touches S3 never resolves the AWS SDK. Whoever\n\t * assembles the application registers the drivers its target needs.\n\t */\n\tprivate async connect({\n\t\tenvParser,\n\t}: ServiceRegisterOptions): Promise<StorageClient> {\n\t\tconst { connectionString } = envParser\n\t\t\t.create((get) => ({\n\t\t\t\tconnectionString: get(this.keys.connectionString).string().optional(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\t// A frontend's plain edge holds no connection, so its client has\n\t\t// nothing to call: every method says to depend on `.server`.\n\t\tif (!connectionString) {\n\t\t\treturn readOnlyStorage(\n\t\t\t\t(method) =>\n\t\t\t\t\tnew ObjectStorageReadOnly(\n\t\t\t\t\t\tthis.id,\n\t\t\t\t\t\tmethod,\n\t\t\t\t\t\tthis.keys.connectionString,\n\t\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn createStorageClient(connectionString);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+CA,IAAa,wBAAb,cAA2C,MAAM;CAEtC;CACA;CACA;CAHV,YACC,IACA,QACA,KACC;EACD,MACC,IAAI,GAAG,WAAW,OAAO,MAAM,IAAI,mLAGV,GAAG,iCACZ,GAAG,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,GAAG,MAAM,CAAC,EAAE,WAC1D;EAVS,KAAA,KAAA;EACA,KAAA,SAAA;EACA,KAAA,MAAA;EAST,KAAK,OAAO;CACb;AACD;AAEA,IAAa,gBAAb,MAEA;CAgBmB;CAflB;CACA;;;;;;CAOA;;CAGA;CAEA,YACC,IACA,UAAiD,CAAC,GACjD;EADgB,KAAA,UAAA;EAIjB,MAAM,YAAY,YAAY,EAAY;EAE1C,KAAK,KAAK;EACV,KAAK,OAAO,EACX,kBAAkB,eACjB,WACA,WACA,kBACD,EACD;EACA,KAAK,SAAS,WAAW,WAAW,QAAQ,MAAM;EAGlD,KAAK,UAAU;GACd,aAAa,WAAW,SAAS;GACjC,WAAW,YAAY,KAAK,QAAQ,OAAO;EAC5C;CACD;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,KAAK,gBAAgB;GACrC,GAAI,KAAK,QAAQ,YAAY,EAAE,WAAW,KAAK,IAAI,CAAC;GACpD,GAAI,KAAK,SAAS,EAAE,QAAQ,KAAK,OAAO,IAAI,CAAC;EAC9C,CACD;CACD;;;;;;;;;;;;CAaA,IAAI,SAAqB;EACxB,OAAO,aAAa,IAAI;CACzB;;;;;;;;;;CAWA,MAAc,QAAQ,EACrB,aACkD;EAClD,MAAM,EAAE,qBAAqB,UAC3B,QAAQ,SAAS,EACjB,kBAAkB,IAAI,KAAK,KAAK,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EACrE,EAAE,CAAC,CACF,MAAM;EAIR,IAAI,CAAC,kBACJ,OAAO,iBACL,WACA,IAAI,sBACH,KAAK,IACL,QACA,KAAK,KAAK,gBACX,CACF;EAGD,OAAO,oBAAoB,gBAAgB;CAC5C;AACD"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
//#region src/optionalPeers.ts
|
|
2
|
+
/**
|
|
3
|
+
* The optional peers a construct needs only for a feature it opted into.
|
|
4
|
+
*
|
|
5
|
+
* `@geekmidas/audit`, `@geekmidas/rate-limit`, `@geekmidas/db`,
|
|
6
|
+
* `@geekmidas/cache`, `@geekmidas/emailkit`, `@geekmidas/storage`, `hono`,
|
|
7
|
+
* `ws`, `ioredis` and `better-auth` are optional peers of this package: an app
|
|
8
|
+
* that audits nothing, limits nothing, sends no mail and serves no WebSocket
|
|
9
|
+
* need not install them. Entries that every app loads (`./endpoints`,
|
|
10
|
+
* `./crons`, `./worker`, `./testing`, the CLI's discovery) used to import them
|
|
11
|
+
* at the top, so loading any of them needed them all — and a production bundle
|
|
12
|
+
* of an app without them failed to build. They are loaded here instead, when
|
|
13
|
+
* the construct that uses one runs, which is also when the app declaring that
|
|
14
|
+
* construct has installed it.
|
|
15
|
+
*
|
|
16
|
+
* The `try` around each `import()` is load-bearing beyond the error it names:
|
|
17
|
+
* a bundler leaves an import it cannot resolve to run time when the import is
|
|
18
|
+
* guarded, and fails the build when it is not. `scripts/check-optional-peers.mjs`
|
|
19
|
+
* holds every entry to that: an optional peer is reached from its own adaptor
|
|
20
|
+
* subpath, or through a guarded `import()` like these.
|
|
21
|
+
*/
|
|
22
|
+
/** A construct uses a feature whose optional peer is not installed. */
|
|
23
|
+
var OptionalPeerMissing = class extends Error {
|
|
24
|
+
packageName;
|
|
25
|
+
feature;
|
|
26
|
+
constructor(packageName, feature, cause) {
|
|
27
|
+
super(`${feature} needs '${packageName}', which could not be loaded. Add it to the dependencies of the app that declares it.`, { cause });
|
|
28
|
+
this.packageName = packageName;
|
|
29
|
+
this.feature = feature;
|
|
30
|
+
this.name = "OptionalPeerMissing";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/** `@geekmidas/audit`, for an endpoint, function or cron with an auditor. */
|
|
34
|
+
async function loadAudit() {
|
|
35
|
+
try {
|
|
36
|
+
return await import("@geekmidas/audit");
|
|
37
|
+
} catch (cause) {
|
|
38
|
+
throw new OptionalPeerMissing("@geekmidas/audit", "An auditor", cause);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** `@geekmidas/audit/kysely`, for audits written in the handler's transaction. */
|
|
42
|
+
async function loadAuditKysely() {
|
|
43
|
+
try {
|
|
44
|
+
return await import("@geekmidas/audit/kysely");
|
|
45
|
+
} catch (cause) {
|
|
46
|
+
throw new OptionalPeerMissing("@geekmidas/audit", "An auditor that stores in the database", cause);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** `@geekmidas/rate-limit`, for an endpoint with a rate limit. */
|
|
50
|
+
async function loadRateLimit() {
|
|
51
|
+
try {
|
|
52
|
+
return await import("@geekmidas/rate-limit");
|
|
53
|
+
} catch (cause) {
|
|
54
|
+
throw new OptionalPeerMissing("@geekmidas/rate-limit", "An endpoint with a rate limit", cause);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** `@geekmidas/db/rls`, for an endpoint with row-level security. */
|
|
58
|
+
async function loadRls() {
|
|
59
|
+
try {
|
|
60
|
+
return await import("@geekmidas/db/rls");
|
|
61
|
+
} catch (cause) {
|
|
62
|
+
throw new OptionalPeerMissing("@geekmidas/db", "An endpoint with row-level security", cause);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** `@geekmidas/cache`, for a `Cache` construct's client. */
|
|
66
|
+
async function loadCache() {
|
|
67
|
+
try {
|
|
68
|
+
return await import("@geekmidas/cache");
|
|
69
|
+
} catch (cause) {
|
|
70
|
+
throw new OptionalPeerMissing("@geekmidas/cache", "A Cache", cause);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** `@geekmidas/emailkit`, for an `Email` construct's client. */
|
|
74
|
+
async function loadEmailkit() {
|
|
75
|
+
try {
|
|
76
|
+
return await import("@geekmidas/emailkit");
|
|
77
|
+
} catch (cause) {
|
|
78
|
+
throw new OptionalPeerMissing("@geekmidas/emailkit", "An Email", cause);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** `@geekmidas/storage/events`, for a subscriber to a bucket's objects. */
|
|
82
|
+
async function loadStorageEvents() {
|
|
83
|
+
try {
|
|
84
|
+
return await import("@geekmidas/storage/events");
|
|
85
|
+
} catch (cause) {
|
|
86
|
+
throw new OptionalPeerMissing("@geekmidas/storage", "A subscriber to a bucket's objects", cause);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** `hono`, for a surface that serves HTTP itself. */
|
|
90
|
+
async function loadHono(feature) {
|
|
91
|
+
try {
|
|
92
|
+
return await import("hono");
|
|
93
|
+
} catch (cause) {
|
|
94
|
+
throw new OptionalPeerMissing("hono", feature, cause);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/** `hono/cors`, beside {@link loadHono}. */
|
|
98
|
+
async function loadHonoCors(feature) {
|
|
99
|
+
try {
|
|
100
|
+
return await import("hono/cors");
|
|
101
|
+
} catch (cause) {
|
|
102
|
+
throw new OptionalPeerMissing("hono", feature, cause);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** `ws`, for a `WebSocketApi`'s server. */
|
|
106
|
+
async function loadWs() {
|
|
107
|
+
try {
|
|
108
|
+
return await import("ws");
|
|
109
|
+
} catch (cause) {
|
|
110
|
+
throw new OptionalPeerMissing("ws", "A WebSocketApi", cause);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/** `ioredis`, for a `WebSocketApi` that fans out through Redis. */
|
|
114
|
+
async function loadIoredis() {
|
|
115
|
+
try {
|
|
116
|
+
return await import("ioredis");
|
|
117
|
+
} catch (cause) {
|
|
118
|
+
throw new OptionalPeerMissing("ioredis", "A WebSocketApi with a redis:// transport", cause);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** `better-auth`, for an `Auth` construct's server. */
|
|
122
|
+
async function loadBetterAuth() {
|
|
123
|
+
try {
|
|
124
|
+
return await import("better-auth");
|
|
125
|
+
} catch (cause) {
|
|
126
|
+
throw new OptionalPeerMissing("better-auth", "An Auth", cause);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** `better-auth/db/migration`, for migrating an `Auth` construct's tables. */
|
|
130
|
+
async function loadBetterAuthMigration() {
|
|
131
|
+
try {
|
|
132
|
+
return await import("better-auth/db/migration");
|
|
133
|
+
} catch (cause) {
|
|
134
|
+
throw new OptionalPeerMissing("better-auth", "An Auth", cause);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
export { loadBetterAuthMigration as a, loadHono as c, loadRateLimit as d, loadRls as f, loadBetterAuth as i, loadHonoCors as l, loadWs as m, loadAudit as n, loadCache as o, loadStorageEvents as p, loadAuditKysely as r, loadEmailkit as s, OptionalPeerMissing as t, loadIoredis as u };
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=optionalPeers-D7Wt6dnF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optionalPeers-D7Wt6dnF.mjs","names":[],"sources":["../src/optionalPeers.ts"],"sourcesContent":["/**\n * The optional peers a construct needs only for a feature it opted into.\n *\n * `@geekmidas/audit`, `@geekmidas/rate-limit`, `@geekmidas/db`,\n * `@geekmidas/cache`, `@geekmidas/emailkit`, `@geekmidas/storage`, `hono`,\n * `ws`, `ioredis` and `better-auth` are optional peers of this package: an app\n * that audits nothing, limits nothing, sends no mail and serves no WebSocket\n * need not install them. Entries that every app loads (`./endpoints`,\n * `./crons`, `./worker`, `./testing`, the CLI's discovery) used to import them\n * at the top, so loading any of them needed them all — and a production bundle\n * of an app without them failed to build. They are loaded here instead, when\n * the construct that uses one runs, which is also when the app declaring that\n * construct has installed it.\n *\n * The `try` around each `import()` is load-bearing beyond the error it names:\n * a bundler leaves an import it cannot resolve to run time when the import is\n * guarded, and fails the build when it is not. `scripts/check-optional-peers.mjs`\n * holds every entry to that: an optional peer is reached from its own adaptor\n * subpath, or through a guarded `import()` like these.\n */\n\n/** A construct uses a feature whose optional peer is not installed. */\nexport class OptionalPeerMissing extends Error {\n\tconstructor(\n\t\treadonly packageName: string,\n\t\treadonly feature: string,\n\t\tcause: unknown,\n\t) {\n\t\tsuper(\n\t\t\t`${feature} needs '${packageName}', which could not be loaded. ` +\n\t\t\t\t`Add it to the dependencies of the app that declares it.`,\n\t\t\t{ cause },\n\t\t);\n\t\tthis.name = 'OptionalPeerMissing';\n\t}\n}\n\n/** `@geekmidas/audit`, for an endpoint, function or cron with an auditor. */\nexport async function loadAudit(): Promise<typeof import('@geekmidas/audit')> {\n\ttry {\n\t\treturn await import('@geekmidas/audit');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('@geekmidas/audit', 'An auditor', cause);\n\t}\n}\n\n/** `@geekmidas/audit/kysely`, for audits written in the handler's transaction. */\nexport async function loadAuditKysely(): Promise<\n\ttypeof import('@geekmidas/audit/kysely')\n> {\n\ttry {\n\t\treturn await import('@geekmidas/audit/kysely');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'@geekmidas/audit',\n\t\t\t'An auditor that stores in the database',\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `@geekmidas/rate-limit`, for an endpoint with a rate limit. */\nexport async function loadRateLimit(): Promise<\n\ttypeof import('@geekmidas/rate-limit')\n> {\n\ttry {\n\t\treturn await import('@geekmidas/rate-limit');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'@geekmidas/rate-limit',\n\t\t\t'An endpoint with a rate limit',\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `@geekmidas/db/rls`, for an endpoint with row-level security. */\nexport async function loadRls(): Promise<typeof import('@geekmidas/db/rls')> {\n\ttry {\n\t\treturn await import('@geekmidas/db/rls');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'@geekmidas/db',\n\t\t\t'An endpoint with row-level security',\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `@geekmidas/cache`, for a `Cache` construct's client. */\nexport async function loadCache(): Promise<typeof import('@geekmidas/cache')> {\n\ttry {\n\t\treturn await import('@geekmidas/cache');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('@geekmidas/cache', 'A Cache', cause);\n\t}\n}\n\n/** `@geekmidas/emailkit`, for an `Email` construct's client. */\nexport async function loadEmailkit(): Promise<\n\ttypeof import('@geekmidas/emailkit')\n> {\n\ttry {\n\t\treturn await import('@geekmidas/emailkit');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('@geekmidas/emailkit', 'An Email', cause);\n\t}\n}\n\n/** `@geekmidas/emailkit/autoSubmitted`, for a subscriber to an `Inbox`. */\nexport async function loadAutoSubmitted(): Promise<\n\ttypeof import('@geekmidas/emailkit/autoSubmitted')\n> {\n\ttry {\n\t\treturn await import('@geekmidas/emailkit/autoSubmitted');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'@geekmidas/emailkit',\n\t\t\t'A subscriber to an Inbox',\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `@geekmidas/storage/events`, for a subscriber to a bucket's objects. */\nexport async function loadStorageEvents(): Promise<\n\ttypeof import('@geekmidas/storage/events')\n> {\n\ttry {\n\t\treturn await import('@geekmidas/storage/events');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'@geekmidas/storage',\n\t\t\t\"A subscriber to a bucket's objects\",\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `hono`, for a surface that serves HTTP itself. */\nexport async function loadHono(\n\tfeature: string,\n): Promise<typeof import('hono')> {\n\ttry {\n\t\treturn await import('hono');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('hono', feature, cause);\n\t}\n}\n\n/** `hono/cors`, beside {@link loadHono}. */\nexport async function loadHonoCors(\n\tfeature: string,\n): Promise<typeof import('hono/cors')> {\n\ttry {\n\t\treturn await import('hono/cors');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('hono', feature, cause);\n\t}\n}\n\n/** `ws`, for a `WebSocketApi`'s server. */\nexport async function loadWs(): Promise<typeof import('ws')> {\n\ttry {\n\t\treturn await import('ws');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('ws', 'A WebSocketApi', cause);\n\t}\n}\n\n/** `ioredis`, for a `WebSocketApi` that fans out through Redis. */\nexport async function loadIoredis(): Promise<typeof import('ioredis')> {\n\ttry {\n\t\treturn await import('ioredis');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'ioredis',\n\t\t\t'A WebSocketApi with a redis:// transport',\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `better-auth`, for an `Auth` construct's server. */\nexport async function loadBetterAuth(): Promise<typeof import('better-auth')> {\n\ttry {\n\t\treturn await import('better-auth');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('better-auth', 'An Auth', cause);\n\t}\n}\n\n/** `better-auth/db/migration`, for migrating an `Auth` construct's tables. */\nexport async function loadBetterAuthMigration(): Promise<\n\ttypeof import('better-auth/db/migration')\n> {\n\ttry {\n\t\treturn await import('better-auth/db/migration');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('better-auth', 'An Auth', cause);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAa,sBAAb,cAAyC,MAAM;CAEpC;CACA;CAFV,YACC,aACA,SACA,OACC;EACD,MACC,GAAG,QAAQ,UAAU,YAAY,wFAEjC,EAAE,MAAM,CACT;EARS,KAAA,cAAA;EACA,KAAA,UAAA;EAQT,KAAK,OAAO;CACb;AACD;;AAGA,eAAsB,YAAwD;CAC7E,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,oBAAoB,cAAc,KAAK;CACtE;AACD;;AAGA,eAAsB,kBAEpB;CACD,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBACT,oBACA,0CACA,KACD;CACD;AACD;;AAGA,eAAsB,gBAEpB;CACD,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBACT,yBACA,iCACA,KACD;CACD;AACD;;AAGA,eAAsB,UAAuD;CAC5E,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBACT,iBACA,uCACA,KACD;CACD;AACD;;AAGA,eAAsB,YAAwD;CAC7E,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,oBAAoB,WAAW,KAAK;CACnE;AACD;;AAGA,eAAsB,eAEpB;CACD,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,uBAAuB,YAAY,KAAK;CACvE;AACD;;AAkBA,eAAsB,oBAEpB;CACD,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBACT,sBACA,sCACA,KACD;CACD;AACD;;AAGA,eAAsB,SACrB,SACiC;CACjC,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,QAAQ,SAAS,KAAK;CACrD;AACD;;AAGA,eAAsB,aACrB,SACsC;CACtC,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,QAAQ,SAAS,KAAK;CACrD;AACD;;AAGA,eAAsB,SAAuC;CAC5D,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,MAAM,kBAAkB,KAAK;CAC5D;AACD;;AAGA,eAAsB,cAAiD;CACtE,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBACT,WACA,4CACA,KACD;CACD;AACD;;AAGA,eAAsB,iBAAwD;CAC7E,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,eAAe,WAAW,KAAK;CAC9D;AACD;;AAGA,eAAsB,0BAEpB;CACD,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,eAAe,WAAW,KAAK;CAC9D;AACD"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
//#region src/optionalPeers.ts
|
|
2
|
+
/**
|
|
3
|
+
* The optional peers a construct needs only for a feature it opted into.
|
|
4
|
+
*
|
|
5
|
+
* `@geekmidas/audit`, `@geekmidas/rate-limit`, `@geekmidas/db`,
|
|
6
|
+
* `@geekmidas/cache`, `@geekmidas/emailkit`, `@geekmidas/storage`, `hono`,
|
|
7
|
+
* `ws`, `ioredis` and `better-auth` are optional peers of this package: an app
|
|
8
|
+
* that audits nothing, limits nothing, sends no mail and serves no WebSocket
|
|
9
|
+
* need not install them. Entries that every app loads (`./endpoints`,
|
|
10
|
+
* `./crons`, `./worker`, `./testing`, the CLI's discovery) used to import them
|
|
11
|
+
* at the top, so loading any of them needed them all — and a production bundle
|
|
12
|
+
* of an app without them failed to build. They are loaded here instead, when
|
|
13
|
+
* the construct that uses one runs, which is also when the app declaring that
|
|
14
|
+
* construct has installed it.
|
|
15
|
+
*
|
|
16
|
+
* The `try` around each `import()` is load-bearing beyond the error it names:
|
|
17
|
+
* a bundler leaves an import it cannot resolve to run time when the import is
|
|
18
|
+
* guarded, and fails the build when it is not. `scripts/check-optional-peers.mjs`
|
|
19
|
+
* holds every entry to that: an optional peer is reached from its own adaptor
|
|
20
|
+
* subpath, or through a guarded `import()` like these.
|
|
21
|
+
*/
|
|
22
|
+
/** A construct uses a feature whose optional peer is not installed. */
|
|
23
|
+
var OptionalPeerMissing = class extends Error {
|
|
24
|
+
packageName;
|
|
25
|
+
feature;
|
|
26
|
+
constructor(packageName, feature, cause) {
|
|
27
|
+
super(`${feature} needs '${packageName}', which could not be loaded. Add it to the dependencies of the app that declares it.`, { cause });
|
|
28
|
+
this.packageName = packageName;
|
|
29
|
+
this.feature = feature;
|
|
30
|
+
this.name = "OptionalPeerMissing";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/** `@geekmidas/audit`, for an endpoint, function or cron with an auditor. */
|
|
34
|
+
async function loadAudit() {
|
|
35
|
+
try {
|
|
36
|
+
return await import("@geekmidas/audit");
|
|
37
|
+
} catch (cause) {
|
|
38
|
+
throw new OptionalPeerMissing("@geekmidas/audit", "An auditor", cause);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** `@geekmidas/audit/kysely`, for audits written in the handler's transaction. */
|
|
42
|
+
async function loadAuditKysely() {
|
|
43
|
+
try {
|
|
44
|
+
return await import("@geekmidas/audit/kysely");
|
|
45
|
+
} catch (cause) {
|
|
46
|
+
throw new OptionalPeerMissing("@geekmidas/audit", "An auditor that stores in the database", cause);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** `@geekmidas/rate-limit`, for an endpoint with a rate limit. */
|
|
50
|
+
async function loadRateLimit() {
|
|
51
|
+
try {
|
|
52
|
+
return await import("@geekmidas/rate-limit");
|
|
53
|
+
} catch (cause) {
|
|
54
|
+
throw new OptionalPeerMissing("@geekmidas/rate-limit", "An endpoint with a rate limit", cause);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** `@geekmidas/db/rls`, for an endpoint with row-level security. */
|
|
58
|
+
async function loadRls() {
|
|
59
|
+
try {
|
|
60
|
+
return await import("@geekmidas/db/rls");
|
|
61
|
+
} catch (cause) {
|
|
62
|
+
throw new OptionalPeerMissing("@geekmidas/db", "An endpoint with row-level security", cause);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** `@geekmidas/cache`, for a `Cache` construct's client. */
|
|
66
|
+
async function loadCache() {
|
|
67
|
+
try {
|
|
68
|
+
return await import("@geekmidas/cache");
|
|
69
|
+
} catch (cause) {
|
|
70
|
+
throw new OptionalPeerMissing("@geekmidas/cache", "A Cache", cause);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** `@geekmidas/emailkit`, for an `Email` construct's client. */
|
|
74
|
+
async function loadEmailkit() {
|
|
75
|
+
try {
|
|
76
|
+
return await import("@geekmidas/emailkit");
|
|
77
|
+
} catch (cause) {
|
|
78
|
+
throw new OptionalPeerMissing("@geekmidas/emailkit", "An Email", cause);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** `@geekmidas/storage/events`, for a subscriber to a bucket's objects. */
|
|
82
|
+
async function loadStorageEvents() {
|
|
83
|
+
try {
|
|
84
|
+
return await import("@geekmidas/storage/events");
|
|
85
|
+
} catch (cause) {
|
|
86
|
+
throw new OptionalPeerMissing("@geekmidas/storage", "A subscriber to a bucket's objects", cause);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** `hono`, for a surface that serves HTTP itself. */
|
|
90
|
+
async function loadHono(feature) {
|
|
91
|
+
try {
|
|
92
|
+
return await import("hono");
|
|
93
|
+
} catch (cause) {
|
|
94
|
+
throw new OptionalPeerMissing("hono", feature, cause);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/** `hono/cors`, beside {@link loadHono}. */
|
|
98
|
+
async function loadHonoCors(feature) {
|
|
99
|
+
try {
|
|
100
|
+
return await import("hono/cors");
|
|
101
|
+
} catch (cause) {
|
|
102
|
+
throw new OptionalPeerMissing("hono", feature, cause);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** `ws`, for a `WebSocketApi`'s server. */
|
|
106
|
+
async function loadWs() {
|
|
107
|
+
try {
|
|
108
|
+
return await import("ws");
|
|
109
|
+
} catch (cause) {
|
|
110
|
+
throw new OptionalPeerMissing("ws", "A WebSocketApi", cause);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/** `ioredis`, for a `WebSocketApi` that fans out through Redis. */
|
|
114
|
+
async function loadIoredis() {
|
|
115
|
+
try {
|
|
116
|
+
return await import("ioredis");
|
|
117
|
+
} catch (cause) {
|
|
118
|
+
throw new OptionalPeerMissing("ioredis", "A WebSocketApi with a redis:// transport", cause);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** `better-auth`, for an `Auth` construct's server. */
|
|
122
|
+
async function loadBetterAuth() {
|
|
123
|
+
try {
|
|
124
|
+
return await import("better-auth");
|
|
125
|
+
} catch (cause) {
|
|
126
|
+
throw new OptionalPeerMissing("better-auth", "An Auth", cause);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** `better-auth/db/migration`, for migrating an `Auth` construct's tables. */
|
|
130
|
+
async function loadBetterAuthMigration() {
|
|
131
|
+
try {
|
|
132
|
+
return await import("better-auth/db/migration");
|
|
133
|
+
} catch (cause) {
|
|
134
|
+
throw new OptionalPeerMissing("better-auth", "An Auth", cause);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
Object.defineProperty(exports, "OptionalPeerMissing", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function() {
|
|
141
|
+
return OptionalPeerMissing;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "loadAudit", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function() {
|
|
147
|
+
return loadAudit;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "loadAuditKysely", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function() {
|
|
153
|
+
return loadAuditKysely;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "loadBetterAuth", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function() {
|
|
159
|
+
return loadBetterAuth;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "loadBetterAuthMigration", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function() {
|
|
165
|
+
return loadBetterAuthMigration;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "loadCache", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function() {
|
|
171
|
+
return loadCache;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "loadEmailkit", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function() {
|
|
177
|
+
return loadEmailkit;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "loadHono", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function() {
|
|
183
|
+
return loadHono;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "loadHonoCors", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function() {
|
|
189
|
+
return loadHonoCors;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "loadIoredis", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function() {
|
|
195
|
+
return loadIoredis;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "loadRateLimit", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function() {
|
|
201
|
+
return loadRateLimit;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "loadRls", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function() {
|
|
207
|
+
return loadRls;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "loadStorageEvents", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function() {
|
|
213
|
+
return loadStorageEvents;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "loadWs", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function() {
|
|
219
|
+
return loadWs;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
//# sourceMappingURL=optionalPeers-DuNQXXe1.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optionalPeers-DuNQXXe1.cjs","names":[],"sources":["../src/optionalPeers.ts"],"sourcesContent":["/**\n * The optional peers a construct needs only for a feature it opted into.\n *\n * `@geekmidas/audit`, `@geekmidas/rate-limit`, `@geekmidas/db`,\n * `@geekmidas/cache`, `@geekmidas/emailkit`, `@geekmidas/storage`, `hono`,\n * `ws`, `ioredis` and `better-auth` are optional peers of this package: an app\n * that audits nothing, limits nothing, sends no mail and serves no WebSocket\n * need not install them. Entries that every app loads (`./endpoints`,\n * `./crons`, `./worker`, `./testing`, the CLI's discovery) used to import them\n * at the top, so loading any of them needed them all — and a production bundle\n * of an app without them failed to build. They are loaded here instead, when\n * the construct that uses one runs, which is also when the app declaring that\n * construct has installed it.\n *\n * The `try` around each `import()` is load-bearing beyond the error it names:\n * a bundler leaves an import it cannot resolve to run time when the import is\n * guarded, and fails the build when it is not. `scripts/check-optional-peers.mjs`\n * holds every entry to that: an optional peer is reached from its own adaptor\n * subpath, or through a guarded `import()` like these.\n */\n\n/** A construct uses a feature whose optional peer is not installed. */\nexport class OptionalPeerMissing extends Error {\n\tconstructor(\n\t\treadonly packageName: string,\n\t\treadonly feature: string,\n\t\tcause: unknown,\n\t) {\n\t\tsuper(\n\t\t\t`${feature} needs '${packageName}', which could not be loaded. ` +\n\t\t\t\t`Add it to the dependencies of the app that declares it.`,\n\t\t\t{ cause },\n\t\t);\n\t\tthis.name = 'OptionalPeerMissing';\n\t}\n}\n\n/** `@geekmidas/audit`, for an endpoint, function or cron with an auditor. */\nexport async function loadAudit(): Promise<typeof import('@geekmidas/audit')> {\n\ttry {\n\t\treturn await import('@geekmidas/audit');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('@geekmidas/audit', 'An auditor', cause);\n\t}\n}\n\n/** `@geekmidas/audit/kysely`, for audits written in the handler's transaction. */\nexport async function loadAuditKysely(): Promise<\n\ttypeof import('@geekmidas/audit/kysely')\n> {\n\ttry {\n\t\treturn await import('@geekmidas/audit/kysely');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'@geekmidas/audit',\n\t\t\t'An auditor that stores in the database',\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `@geekmidas/rate-limit`, for an endpoint with a rate limit. */\nexport async function loadRateLimit(): Promise<\n\ttypeof import('@geekmidas/rate-limit')\n> {\n\ttry {\n\t\treturn await import('@geekmidas/rate-limit');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'@geekmidas/rate-limit',\n\t\t\t'An endpoint with a rate limit',\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `@geekmidas/db/rls`, for an endpoint with row-level security. */\nexport async function loadRls(): Promise<typeof import('@geekmidas/db/rls')> {\n\ttry {\n\t\treturn await import('@geekmidas/db/rls');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'@geekmidas/db',\n\t\t\t'An endpoint with row-level security',\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `@geekmidas/cache`, for a `Cache` construct's client. */\nexport async function loadCache(): Promise<typeof import('@geekmidas/cache')> {\n\ttry {\n\t\treturn await import('@geekmidas/cache');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('@geekmidas/cache', 'A Cache', cause);\n\t}\n}\n\n/** `@geekmidas/emailkit`, for an `Email` construct's client. */\nexport async function loadEmailkit(): Promise<\n\ttypeof import('@geekmidas/emailkit')\n> {\n\ttry {\n\t\treturn await import('@geekmidas/emailkit');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('@geekmidas/emailkit', 'An Email', cause);\n\t}\n}\n\n/** `@geekmidas/emailkit/autoSubmitted`, for a subscriber to an `Inbox`. */\nexport async function loadAutoSubmitted(): Promise<\n\ttypeof import('@geekmidas/emailkit/autoSubmitted')\n> {\n\ttry {\n\t\treturn await import('@geekmidas/emailkit/autoSubmitted');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'@geekmidas/emailkit',\n\t\t\t'A subscriber to an Inbox',\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `@geekmidas/storage/events`, for a subscriber to a bucket's objects. */\nexport async function loadStorageEvents(): Promise<\n\ttypeof import('@geekmidas/storage/events')\n> {\n\ttry {\n\t\treturn await import('@geekmidas/storage/events');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'@geekmidas/storage',\n\t\t\t\"A subscriber to a bucket's objects\",\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `hono`, for a surface that serves HTTP itself. */\nexport async function loadHono(\n\tfeature: string,\n): Promise<typeof import('hono')> {\n\ttry {\n\t\treturn await import('hono');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('hono', feature, cause);\n\t}\n}\n\n/** `hono/cors`, beside {@link loadHono}. */\nexport async function loadHonoCors(\n\tfeature: string,\n): Promise<typeof import('hono/cors')> {\n\ttry {\n\t\treturn await import('hono/cors');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('hono', feature, cause);\n\t}\n}\n\n/** `ws`, for a `WebSocketApi`'s server. */\nexport async function loadWs(): Promise<typeof import('ws')> {\n\ttry {\n\t\treturn await import('ws');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('ws', 'A WebSocketApi', cause);\n\t}\n}\n\n/** `ioredis`, for a `WebSocketApi` that fans out through Redis. */\nexport async function loadIoredis(): Promise<typeof import('ioredis')> {\n\ttry {\n\t\treturn await import('ioredis');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing(\n\t\t\t'ioredis',\n\t\t\t'A WebSocketApi with a redis:// transport',\n\t\t\tcause,\n\t\t);\n\t}\n}\n\n/** `better-auth`, for an `Auth` construct's server. */\nexport async function loadBetterAuth(): Promise<typeof import('better-auth')> {\n\ttry {\n\t\treturn await import('better-auth');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('better-auth', 'An Auth', cause);\n\t}\n}\n\n/** `better-auth/db/migration`, for migrating an `Auth` construct's tables. */\nexport async function loadBetterAuthMigration(): Promise<\n\ttypeof import('better-auth/db/migration')\n> {\n\ttry {\n\t\treturn await import('better-auth/db/migration');\n\t} catch (cause) {\n\t\tthrow new OptionalPeerMissing('better-auth', 'An Auth', cause);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAa,sBAAb,cAAyC,MAAM;CAEpC;CACA;CAFV,YACC,aACA,SACA,OACC;EACD,MACC,GAAG,QAAQ,UAAU,YAAY,wFAEjC,EAAE,MAAM,CACT;EARS,KAAA,cAAA;EACA,KAAA,UAAA;EAQT,KAAK,OAAO;CACb;AACD;;AAGA,eAAsB,YAAwD;CAC7E,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,oBAAoB,cAAc,KAAK;CACtE;AACD;;AAGA,eAAsB,kBAEpB;CACD,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBACT,oBACA,0CACA,KACD;CACD;AACD;;AAGA,eAAsB,gBAEpB;CACD,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBACT,yBACA,iCACA,KACD;CACD;AACD;;AAGA,eAAsB,UAAuD;CAC5E,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBACT,iBACA,uCACA,KACD;CACD;AACD;;AAGA,eAAsB,YAAwD;CAC7E,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,oBAAoB,WAAW,KAAK;CACnE;AACD;;AAGA,eAAsB,eAEpB;CACD,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,uBAAuB,YAAY,KAAK;CACvE;AACD;;AAkBA,eAAsB,oBAEpB;CACD,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBACT,sBACA,sCACA,KACD;CACD;AACD;;AAGA,eAAsB,SACrB,SACiC;CACjC,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,QAAQ,SAAS,KAAK;CACrD;AACD;;AAGA,eAAsB,aACrB,SACsC;CACtC,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,QAAQ,SAAS,KAAK;CACrD;AACD;;AAGA,eAAsB,SAAuC;CAC5D,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,MAAM,kBAAkB,KAAK;CAC5D;AACD;;AAGA,eAAsB,cAAiD;CACtE,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBACT,WACA,4CACA,KACD;CACD;AACD;;AAGA,eAAsB,iBAAwD;CAC7E,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,eAAe,WAAW,KAAK;CAC9D;AACD;;AAGA,eAAsB,0BAEpB;CACD,IAAI;EACH,OAAO,MAAM,OAAO;CACrB,SAAS,OAAO;EACf,MAAM,IAAI,oBAAoB,eAAe,WAAW,KAAK;CAC9D;AACD"}
|