@geekmidas/cli 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 +323 -380
- package/bin/adjacent-tsconfig.mjs +46 -8
- package/bin/gkm.mjs +11 -3
- package/bin/owning-tsconfig-jsx-register.mjs +18 -0
- package/bin/owning-tsconfig-jsx.mjs +108 -0
- package/dist/EndpointGenerator-CBKH87_b.mjs +1043 -0
- package/dist/EndpointGenerator-CBKH87_b.mjs.map +1 -0
- package/dist/EndpointGenerator-iyA3HkOH.cjs +1102 -0
- package/dist/EndpointGenerator-iyA3HkOH.cjs.map +1 -0
- package/dist/LegacyStateStore-DvufVJjQ.cjs +124 -0
- package/dist/LegacyStateStore-DvufVJjQ.cjs.map +1 -0
- package/dist/LegacyStateStore-p-_Z8ucw.mjs +124 -0
- package/dist/LegacyStateStore-p-_Z8ucw.mjs.map +1 -0
- package/dist/LocalStateStore-BKAi5XsN.mjs +167 -0
- package/dist/LocalStateStore-BKAi5XsN.mjs.map +1 -0
- package/dist/LocalStateStore-DLDD6udB.cjs +178 -0
- package/dist/LocalStateStore-DLDD6udB.cjs.map +1 -0
- package/dist/OpenApiTsGenerator-CoVA3Ykv.mjs +534 -0
- package/dist/OpenApiTsGenerator-CoVA3Ykv.mjs.map +1 -0
- package/dist/OpenApiTsGenerator-vy-fOJgs.cjs +539 -0
- package/dist/OpenApiTsGenerator-vy-fOJgs.cjs.map +1 -0
- package/dist/S3StateStore-C8thID2w.mjs +223 -0
- package/dist/S3StateStore-C8thID2w.mjs.map +1 -0
- package/dist/S3StateStore-J3FztlVC.cjs +222 -0
- package/dist/S3StateStore-J3FztlVC.cjs.map +1 -0
- package/dist/SSMStateStore-0TQsme40.mjs +205 -0
- package/dist/SSMStateStore-0TQsme40.mjs.map +1 -0
- package/dist/SSMStateStore-DhkkSF1D.cjs +204 -0
- package/dist/SSMStateStore-DhkkSF1D.cjs.map +1 -0
- package/dist/SubscriberGenerator-B3jHf26s.mjs +787 -0
- package/dist/SubscriberGenerator-B3jHf26s.mjs.map +1 -0
- package/dist/SubscriberGenerator-JhwVlWBS.cjs +852 -0
- package/dist/SubscriberGenerator-JhwVlWBS.cjs.map +1 -0
- package/dist/add-DWCzdPLz.mjs +711 -0
- package/dist/add-DWCzdPLz.mjs.map +1 -0
- package/dist/add-gs34ewLG.cjs +713 -0
- package/dist/add-gs34ewLG.cjs.map +1 -0
- package/dist/appPorts-BoXMwolc.mjs +249 -0
- package/dist/appPorts-BoXMwolc.mjs.map +1 -0
- package/dist/appPorts-IW-OZmRi.cjs +296 -0
- package/dist/appPorts-IW-OZmRi.cjs.map +1 -0
- package/dist/apps-C27qrbEe.cjs +5174 -0
- package/dist/apps-C27qrbEe.cjs.map +1 -0
- package/dist/apps-D2oTQasd.mjs +4650 -0
- package/dist/apps-D2oTQasd.mjs.map +1 -0
- package/dist/aws-BXfiWNbi.cjs +108 -0
- package/dist/aws-BXfiWNbi.cjs.map +1 -0
- package/dist/aws-BjvSTTcE.mjs +97 -0
- package/dist/aws-BjvSTTcE.mjs.map +1 -0
- package/dist/awsStore-BYYCmXiq.mjs +121 -0
- package/dist/awsStore-BYYCmXiq.mjs.map +1 -0
- package/dist/awsStore-DKQUElJL.cjs +138 -0
- package/dist/awsStore-DKQUElJL.cjs.map +1 -0
- package/dist/{backup-provisioner-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
- package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
- package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
- package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
- package/dist/backups/runner.cjs +519 -0
- package/dist/backups/runner.cjs.map +1 -0
- package/dist/backups/runner.d.cts +102 -0
- package/dist/backups/runner.d.cts.map +1 -0
- package/dist/backups/runner.d.mts +102 -0
- package/dist/backups/runner.d.mts.map +1 -0
- package/dist/backups/runner.mjs +506 -0
- package/dist/backups/runner.mjs.map +1 -0
- package/dist/{bundler-mwH7WOb1.mjs → bundler-CbT4y4H_.mjs} +68 -15
- package/dist/bundler-CbT4y4H_.mjs.map +1 -0
- package/dist/{bundler-mjqGAvu1.cjs → bundler-DGeOugof.cjs} +67 -14
- package/dist/bundler-DGeOugof.cjs.map +1 -0
- package/dist/cli-C-jUNT69.cjs +80 -0
- package/dist/cli-C-jUNT69.cjs.map +1 -0
- package/dist/cli-DKEJryS7.mjs +80 -0
- package/dist/cli-DKEJryS7.mjs.map +1 -0
- package/dist/clientTelemetry-BAwj6MOf.d.cts +10 -0
- package/dist/clientTelemetry-BAwj6MOf.d.cts.map +1 -0
- package/dist/clientTelemetry-CvamPJj_.d.mts +10 -0
- package/dist/clientTelemetry-CvamPJj_.d.mts.map +1 -0
- package/dist/compose-BpnSP2x7.mjs +2434 -0
- package/dist/compose-BpnSP2x7.mjs.map +1 -0
- package/dist/compose-DJAaJEqL.cjs +2925 -0
- package/dist/compose-DJAaJEqL.cjs.map +1 -0
- package/dist/compose-DmtR2f0l.cjs +3564 -0
- package/dist/compose-DmtR2f0l.cjs.map +1 -0
- package/dist/compose-Glqs13is.mjs +3451 -0
- package/dist/compose-Glqs13is.mjs.map +1 -0
- package/dist/config-BODxZemw.d.mts +291 -0
- package/dist/config-BODxZemw.d.mts.map +1 -0
- package/dist/config-C3U5HulX.d.cts +291 -0
- package/dist/config-C3U5HulX.d.cts.map +1 -0
- package/dist/config.cjs +457 -9
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +4 -117
- package/dist/config.d.mts +4 -117
- package/dist/config.mjs +441 -3
- package/dist/config.mjs.map +1 -0
- package/dist/credentialSchemas-D_85KW2k.mjs +236 -0
- package/dist/credentialSchemas-D_85KW2k.mjs.map +1 -0
- package/dist/credentialSchemas-DjK6xKMk.cjs +271 -0
- package/dist/credentialSchemas-DjK6xKMk.cjs.map +1 -0
- package/dist/databases-CV22HzrI.mjs +588 -0
- package/dist/databases-CV22HzrI.mjs.map +1 -0
- package/dist/databases-DwYYH2mX.cjs +703 -0
- package/dist/databases-DwYYH2mX.cjs.map +1 -0
- package/dist/dbTunnel-DUudiQWj.cjs +154 -0
- package/dist/dbTunnel-DUudiQWj.cjs.map +1 -0
- package/dist/dbTunnel-KgbAh2v1.mjs +154 -0
- package/dist/dbTunnel-KgbAh2v1.mjs.map +1 -0
- package/dist/define-BfrNaY82.mjs +106 -0
- package/dist/define-BfrNaY82.mjs.map +1 -0
- package/dist/define-zKgLY65H.cjs +153 -0
- package/dist/define-zKgLY65H.cjs.map +1 -0
- package/dist/deploy/public.cjs +211 -0
- package/dist/deploy/public.cjs.map +1 -0
- package/dist/deploy/public.d.cts +659 -0
- package/dist/deploy/public.d.cts.map +1 -0
- package/dist/deploy/public.d.mts +659 -0
- package/dist/deploy/public.d.mts.map +1 -0
- package/dist/deploy/public.mjs +144 -0
- package/dist/deploy/public.mjs.map +1 -0
- package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
- package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
- package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
- package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
- package/dist/deploy/sniffer-hooks.cjs +1 -1
- package/dist/deploy/sniffer-hooks.mjs +1 -1
- package/dist/deploy/sniffer-loader.cjs +2 -2
- package/dist/deploy/sniffer-loader.mjs +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +2 -2
- package/dist/deploy/sniffer-routes-worker.mjs +1 -1
- package/dist/deploy-UkAiPzTp.mjs +3838 -0
- package/dist/deploy-UkAiPzTp.mjs.map +1 -0
- package/dist/deploy-ycRCutW9.cjs +3894 -0
- package/dist/deploy-ycRCutW9.cjs.map +1 -0
- package/dist/destroy-Cq5Un0kf.mjs +789 -0
- package/dist/destroy-Cq5Un0kf.mjs.map +1 -0
- package/dist/destroy-DzRzQcAR.cjs +790 -0
- package/dist/destroy-DzRzQcAR.cjs.map +1 -0
- package/dist/discover-Dfmn6HQ7.mjs +940 -0
- package/dist/discover-Dfmn6HQ7.mjs.map +1 -0
- package/dist/discover-OXczlq08.cjs +1085 -0
- package/dist/discover-OXczlq08.cjs.map +1 -0
- package/dist/dns-7zc-Mc9k.cjs +2257 -0
- package/dist/dns-7zc-Mc9k.cjs.map +1 -0
- package/dist/dns-dl7WUWmB.mjs +1820 -0
- package/dist/dns-dl7WUWmB.mjs.map +1 -0
- package/dist/docker-BDqp9Pfn.cjs +1798 -0
- package/dist/docker-BDqp9Pfn.cjs.map +1 -0
- package/dist/docker-MjMWQSEN.mjs +1649 -0
- package/dist/docker-MjMWQSEN.mjs.map +1 -0
- package/dist/dokploy-B0xtYCzY.mjs +38 -0
- package/dist/dokploy-B0xtYCzY.mjs.map +1 -0
- package/dist/dokploy-D-pBRnSV.cjs +38 -0
- package/dist/dokploy-D-pBRnSV.cjs.map +1 -0
- package/dist/drivers-BQRb3KsL.mjs +294 -0
- package/dist/drivers-BQRb3KsL.mjs.map +1 -0
- package/dist/drivers-DP7__dJX.cjs +377 -0
- package/dist/drivers-DP7__dJX.cjs.map +1 -0
- package/dist/eas-9danFNrJ.mjs +334 -0
- package/dist/eas-9danFNrJ.mjs.map +1 -0
- package/dist/eas-BJRA27vb.cjs +337 -0
- package/dist/eas-BJRA27vb.cjs.map +1 -0
- package/dist/emit-C4KSXOeS.mjs +153 -0
- package/dist/emit-C4KSXOeS.mjs.map +1 -0
- package/dist/emit-DiW0kbue.cjs +164 -0
- package/dist/emit-DiW0kbue.cjs.map +1 -0
- package/dist/encryption-0IiNCA3O.cjs +90 -0
- package/dist/encryption-0IiNCA3O.cjs.map +1 -0
- package/dist/encryption-ZDhvgGvu.mjs +89 -0
- package/dist/encryption-ZDhvgGvu.mjs.map +1 -0
- package/dist/engine-Csnr6XDu.mjs +3217 -0
- package/dist/engine-Csnr6XDu.mjs.map +1 -0
- package/dist/engine-DpjIgsGn.cjs +3330 -0
- package/dist/engine-DpjIgsGn.cjs.map +1 -0
- package/dist/errors-C9uIyIDt.mjs +27 -0
- package/dist/errors-C9uIyIDt.mjs.map +1 -0
- package/dist/errors-D1x8duqI.cjs +38 -0
- package/dist/errors-D1x8duqI.cjs.map +1 -0
- package/dist/github-Dej8EWxH.mjs +986 -0
- package/dist/github-Dej8EWxH.mjs.map +1 -0
- package/dist/github-HHxVur1m.cjs +987 -0
- package/dist/github-HHxVur1m.cjs.map +1 -0
- package/dist/googlePlay-DNrD-67X.mjs +931 -0
- package/dist/googlePlay-DNrD-67X.mjs.map +1 -0
- package/dist/googlePlay-NK1zgJJm.cjs +931 -0
- package/dist/googlePlay-NK1zgJJm.cjs.map +1 -0
- package/dist/iam-BzFyFf7T.mjs +442 -0
- package/dist/iam-BzFyFf7T.mjs.map +1 -0
- package/dist/iam-WIoKnLBp.cjs +521 -0
- package/dist/iam-WIoKnLBp.cjs.map +1 -0
- package/dist/{index-RCUizGxL.d.cts → index-BKgOlfK2.d.mts} +38 -14
- package/dist/index-BKgOlfK2.d.mts.map +1 -0
- package/dist/{index-B4H4XF7A.d.mts → index-zPzigXh-.d.cts} +38 -14
- package/dist/index-zPzigXh-.d.cts.map +1 -0
- package/dist/index.cjs +14502 -12767
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +15137 -13400
- package/dist/index.mjs.map +1 -1
- package/dist/local-BW_VIsx0.cjs +241 -0
- package/dist/local-BW_VIsx0.cjs.map +1 -0
- package/dist/local-CVp-4wDb.mjs +224 -0
- package/dist/local-CVp-4wDb.mjs.map +1 -0
- package/dist/migrate-B8fq5egU.cjs +272 -0
- package/dist/migrate-B8fq5egU.cjs.map +1 -0
- package/dist/migrate-C8yCZ5P3.mjs +181 -0
- package/dist/migrate-C8yCZ5P3.mjs.map +1 -0
- package/dist/migrate-CkSq2f7k.mjs +267 -0
- package/dist/migrate-CkSq2f7k.mjs.map +1 -0
- package/dist/migrate-FOc2erAl.cjs +181 -0
- package/dist/migrate-FOc2erAl.cjs.map +1 -0
- package/dist/next.cjs +59 -0
- package/dist/next.cjs.map +1 -0
- package/dist/next.d.cts +44 -0
- package/dist/next.d.cts.map +1 -0
- package/dist/next.d.mts +44 -0
- package/dist/next.d.mts.map +1 -0
- package/dist/next.mjs +58 -0
- package/dist/next.mjs.map +1 -0
- package/dist/notes--JQyDHim.cjs +510 -0
- package/dist/notes--JQyDHim.cjs.map +1 -0
- package/dist/notes-DXl9qERh.mjs +409 -0
- package/dist/notes-DXl9qERh.mjs.map +1 -0
- package/dist/openapi.cjs +213 -7
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.d.cts +27 -8
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +27 -8
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +208 -2
- package/dist/openapi.mjs.map +1 -0
- package/dist/projectBucket-CGpcWqyY.cjs +263 -0
- package/dist/projectBucket-CGpcWqyY.cjs.map +1 -0
- package/dist/projectBucket-TigJy25c.mjs +222 -0
- package/dist/projectBucket-TigJy25c.mjs.map +1 -0
- package/dist/provider-BvjDbsTR.mjs +46 -0
- package/dist/provider-BvjDbsTR.mjs.map +1 -0
- package/dist/provider-DLhgo-mB.cjs +57 -0
- package/dist/provider-DLhgo-mB.cjs.map +1 -0
- package/dist/publish-BPfW3DWi.mjs +123 -0
- package/dist/publish-BPfW3DWi.mjs.map +1 -0
- package/dist/publish-D4pC6_G0.cjs +124 -0
- package/dist/publish-D4pC6_G0.cjs.map +1 -0
- package/dist/ready-BcV28QoW.mjs +375 -0
- package/dist/ready-BcV28QoW.mjs.map +1 -0
- package/dist/ready-ByQvw4-W.cjs +404 -0
- package/dist/ready-ByQvw4-W.cjs.map +1 -0
- package/dist/reconcile/public.cjs +3 -5
- package/dist/reconcile/public.d.cts +33 -89
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +33 -89
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -3
- package/dist/reconcile--I7V4Klj.mjs +34 -0
- package/dist/reconcile--I7V4Klj.mjs.map +1 -0
- package/dist/reconcile-CuCQBa5-.cjs +34 -0
- package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
- package/dist/resolve-BmBR1vBr.cjs +316 -0
- package/dist/resolve-BmBR1vBr.cjs.map +1 -0
- package/dist/resolve-DA1kORng.mjs +263 -0
- package/dist/resolve-DA1kORng.mjs.map +1 -0
- package/dist/rollback-DlgQDX8m.mjs +136 -0
- package/dist/rollback-DlgQDX8m.mjs.map +1 -0
- package/dist/rollback-tsy4pyEp.cjs +165 -0
- package/dist/rollback-tsy4pyEp.cjs.map +1 -0
- package/dist/runtime-CaejlcZt.d.mts +82 -0
- package/dist/runtime-CaejlcZt.d.mts.map +1 -0
- package/dist/runtime-D3jD4Dvn.d.cts +82 -0
- package/dist/runtime-D3jD4Dvn.d.cts.map +1 -0
- package/dist/s3-BLEF-PQU.cjs +240 -0
- package/dist/s3-BLEF-PQU.cjs.map +1 -0
- package/dist/s3-DVYiOqWs.mjs +240 -0
- package/dist/s3-DVYiOqWs.mjs.map +1 -0
- package/dist/sandbox/config-worker.cjs +43 -0
- package/dist/sandbox/config-worker.cjs.map +1 -0
- package/dist/sandbox/config-worker.d.cts +1 -0
- package/dist/sandbox/config-worker.d.mts +1 -0
- package/dist/sandbox/config-worker.mjs +44 -0
- package/dist/sandbox/config-worker.mjs.map +1 -0
- package/dist/sandbox/credentials-worker.cjs +53 -0
- package/dist/sandbox/credentials-worker.cjs.map +1 -0
- package/dist/sandbox/credentials-worker.d.cts +1 -0
- package/dist/sandbox/credentials-worker.d.mts +1 -0
- package/dist/sandbox/credentials-worker.mjs +54 -0
- package/dist/sandbox/credentials-worker.mjs.map +1 -0
- package/dist/sandbox/discover-worker.cjs +47 -0
- package/dist/sandbox/discover-worker.cjs.map +1 -0
- package/dist/sandbox/discover-worker.d.cts +1 -0
- package/dist/sandbox/discover-worker.d.mts +1 -0
- package/dist/sandbox/discover-worker.mjs +48 -0
- package/dist/sandbox/discover-worker.mjs.map +1 -0
- package/dist/sandbox/migrate-worker.cjs +75 -0
- package/dist/sandbox/migrate-worker.cjs.map +1 -0
- package/dist/sandbox/migrate-worker.d.cts +1 -0
- package/dist/sandbox/migrate-worker.d.mts +1 -0
- package/dist/sandbox/migrate-worker.mjs +76 -0
- package/dist/sandbox/migrate-worker.mjs.map +1 -0
- package/dist/{workspace-CRD9YinV.cjs → schemas-BCwKKA42.mjs} +399 -1179
- package/dist/schemas-BCwKKA42.mjs.map +1 -0
- package/dist/{workspace-Bu3xNCej.mjs → schemas-BQ_v0lEX.cjs} +487 -982
- package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
- package/dist/secretsManager-CjTo6CRq.mjs +113 -0
- package/dist/secretsManager-CjTo6CRq.mjs.map +1 -0
- package/dist/secretsManager-CvmBGjdM.cjs +124 -0
- package/dist/secretsManager-CvmBGjdM.cjs.map +1 -0
- package/dist/seeds-Bc3niNVb.cjs +382 -0
- package/dist/seeds-Bc3niNVb.cjs.map +1 -0
- package/dist/seeds-Ccn0Ru2T.mjs +299 -0
- package/dist/seeds-Ccn0Ru2T.mjs.map +1 -0
- package/dist/serverSetup-B_O65wLb.cjs +685 -0
- package/dist/serverSetup-B_O65wLb.cjs.map +1 -0
- package/dist/serverSetup-Dsy8drIb.mjs +685 -0
- package/dist/serverSetup-Dsy8drIb.mjs.map +1 -0
- package/dist/sniffer-Ckx4cr-o.cjs +1997 -0
- package/dist/sniffer-Ckx4cr-o.cjs.map +1 -0
- package/dist/sniffer-fBefNUuJ.mjs +1824 -0
- package/dist/sniffer-fBefNUuJ.mjs.map +1 -0
- package/dist/snsSubscriptions-BJ0LErGk.mjs +1010 -0
- package/dist/snsSubscriptions-BJ0LErGk.mjs.map +1 -0
- package/dist/snsSubscriptions-ChbFp-QP.cjs +1135 -0
- package/dist/snsSubscriptions-ChbFp-QP.cjs.map +1 -0
- package/dist/sst-BnuPeGyy.cjs +501 -0
- package/dist/sst-BnuPeGyy.cjs.map +1 -0
- package/dist/sst-Y7H_zaEZ.mjs +478 -0
- package/dist/sst-Y7H_zaEZ.mjs.map +1 -0
- package/dist/stack-BAipv5Js.cjs +1887 -0
- package/dist/stack-BAipv5Js.cjs.map +1 -0
- package/dist/stack-BHrGbsGA.mjs +1777 -0
- package/dist/stack-BHrGbsGA.mjs.map +1 -0
- package/dist/stage-BSZ9890H.mjs +303 -0
- package/dist/stage-BSZ9890H.mjs.map +1 -0
- package/dist/stage-D7vBtLXL.cjs +332 -0
- package/dist/stage-D7vBtLXL.cjs.map +1 -0
- package/dist/stages-BeSQQQ4z.cjs +190 -0
- package/dist/stages-BeSQQQ4z.cjs.map +1 -0
- package/dist/stages-DjFKQv08.mjs +190 -0
- package/dist/stages-DjFKQv08.mjs.map +1 -0
- package/dist/target/public.cjs +15 -0
- package/dist/target/public.d.cts +28 -0
- package/dist/target/public.d.cts.map +1 -0
- package/dist/target/public.d.mts +28 -0
- package/dist/target/public.d.mts.map +1 -0
- package/dist/target/public.mjs +4 -0
- package/dist/terminal-B7G-FtkD.cjs +85 -0
- package/dist/terminal-B7G-FtkD.cjs.map +1 -0
- package/dist/terminal-lp8RwHdX.mjs +85 -0
- package/dist/terminal-lp8RwHdX.mjs.map +1 -0
- package/dist/{types-7R81hu0i.d.mts → types-CLxsw-QY.d.cts} +2135 -428
- package/dist/types-CLxsw-QY.d.cts.map +1 -0
- package/dist/{types-N7c2O2m7.d.cts → types-wLlwkSib.d.mts} +2133 -428
- package/dist/types-wLlwkSib.d.mts.map +1 -0
- package/dist/utils-D2Nk1Nv2.cjs +205 -0
- package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
- package/dist/utils-D_fxUqvU.mjs +156 -0
- package/dist/utils-D_fxUqvU.mjs.map +1 -0
- package/dist/vitest.cjs +65 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +29 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +29 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +65 -0
- package/dist/vitest.mjs.map +1 -0
- package/dist/workerRuntime-BXfhbe13.cjs +108 -0
- package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
- package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
- package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
- package/dist/workspace/index.cjs +6 -2
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -2
- package/dist/workspace-DJjhfAGf.mjs +3027 -0
- package/dist/workspace-DJjhfAGf.mjs.map +1 -0
- package/dist/workspace-wTLnc1Ef.cjs +3577 -0
- package/dist/workspace-wTLnc1Ef.cjs.map +1 -0
- package/package.json +76 -13
- package/dist/HostingerProvider-BY26bWwB.mjs +0 -243
- package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
- package/dist/HostingerProvider-BZFGYYVA.cjs +0 -243
- package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
- package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
- package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
- package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
- package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
- package/dist/Route53Provider-Cvj40A8I.mjs +0 -209
- package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
- package/dist/Route53Provider-DVILBsvV.cjs +0 -209
- package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
- package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
- package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
- package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
- package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
- package/dist/bundler-mjqGAvu1.cjs.map +0 -1
- package/dist/bundler-mwH7WOb1.mjs.map +0 -1
- package/dist/config-DSXI480r.cjs +0 -467
- package/dist/config-DSXI480r.cjs.map +0 -1
- package/dist/config-DdKkoUE1.mjs +0 -414
- package/dist/config-DdKkoUE1.mjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.map +0 -1
- package/dist/credentials-C6Pfn6GY.cjs +0 -2939
- package/dist/credentials-C6Pfn6GY.cjs.map +0 -1
- package/dist/credentials-lbv-j0Be.mjs +0 -2802
- package/dist/credentials-lbv-j0Be.mjs.map +0 -1
- package/dist/discover-BERGFg8v.cjs +0 -288
- package/dist/discover-BERGFg8v.cjs.map +0 -1
- package/dist/discover-CK-n3w6b.mjs +0 -244
- package/dist/discover-CK-n3w6b.mjs.map +0 -1
- package/dist/emit-BdoPFjZf.cjs +0 -253
- package/dist/emit-BdoPFjZf.cjs.map +0 -1
- package/dist/emit-Bzq7JsMP.mjs +0 -224
- package/dist/emit-Bzq7JsMP.mjs.map +0 -1
- package/dist/generator-LfZU7NlU.mjs +0 -247
- package/dist/generator-LfZU7NlU.mjs.map +0 -1
- package/dist/generator-Wdfp0jCS.cjs +0 -282
- package/dist/generator-Wdfp0jCS.cjs.map +0 -1
- package/dist/github-DlIrXPee.mjs +0 -216
- package/dist/github-DlIrXPee.mjs.map +0 -1
- package/dist/github-n7N9yOff.cjs +0 -216
- package/dist/github-n7N9yOff.cjs.map +0 -1
- package/dist/index-B4H4XF7A.d.mts.map +0 -1
- package/dist/index-RCUizGxL.d.cts.map +0 -1
- package/dist/openapi-B8bu_OXN.cjs +0 -2038
- package/dist/openapi-B8bu_OXN.cjs.map +0 -1
- package/dist/openapi-DfjbhrsM.mjs +0 -1991
- package/dist/openapi-DfjbhrsM.mjs.map +0 -1
- package/dist/reconcile-Cq4cO83R.cjs +0 -136
- package/dist/reconcile-Cq4cO83R.cjs.map +0 -1
- package/dist/reconcile-fmoluZmZ.mjs +0 -113
- package/dist/reconcile-fmoluZmZ.mjs.map +0 -1
- package/dist/ssm-BKN1Cg4z.mjs +0 -60
- package/dist/ssm-BKN1Cg4z.mjs.map +0 -1
- package/dist/ssm-FxeSAt35.cjs +0 -60
- package/dist/ssm-FxeSAt35.cjs.map +0 -1
- package/dist/storage-DgypfSD6.cjs +0 -351
- package/dist/storage-DgypfSD6.cjs.map +0 -1
- package/dist/storage-TP0x118M.mjs +0 -304
- package/dist/storage-TP0x118M.mjs.map +0 -1
- package/dist/transfer-2aRVVJ6I.mjs +0 -122
- package/dist/transfer-2aRVVJ6I.mjs.map +0 -1
- package/dist/transfer-C3WZVmj_.cjs +0 -151
- package/dist/transfer-C3WZVmj_.cjs.map +0 -1
- package/dist/types-7R81hu0i.d.mts.map +0 -1
- package/dist/types-N7c2O2m7.d.cts.map +0 -1
- package/dist/workspace-Bu3xNCej.mjs.map +0 -1
- package/dist/workspace-CRD9YinV.cjs.map +0 -1
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
let node_path = require("node:path");
|
|
2
|
+
let node_fs = require("node:fs");
|
|
3
|
+
//#region src/types.ts
|
|
4
|
+
/** Whether `value` names a cache backend. */
|
|
5
|
+
function isCacheBackend(value) {
|
|
6
|
+
return value === "upstash" || value === "elasticache" || value === "db" || value === "redis";
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Whether a backend holds every declared cache, a cache declared from a
|
|
10
|
+
* database (`database.cache('Sessions')`) included.
|
|
11
|
+
*
|
|
12
|
+
* Every other backend leaves such a cache where its declaration put it: the
|
|
13
|
+
* declaration is the stronger statement. The stack's own Redis is the
|
|
14
|
+
* exception, because a stack that runs one runs it *for* the cache — a table
|
|
15
|
+
* beside it would be a second cache nobody asked for.
|
|
16
|
+
*/
|
|
17
|
+
function holdsEveryCache(backend) {
|
|
18
|
+
return backend === "redis";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The backend a project gets when it says nothing, by where it deploys.
|
|
22
|
+
*
|
|
23
|
+
* Flat defaults could not be right for both: `upstash` on a single box means a
|
|
24
|
+
* SaaS round-trip for a cache the database could have held, and `minio` on AWS
|
|
25
|
+
* means running a bucket beside S3. So the default is a function of the target,
|
|
26
|
+
* and an app that says nothing gets the obvious answer in both places — which
|
|
27
|
+
* is the whole of what "zero config" can mean once there is more than one
|
|
28
|
+
* target.
|
|
29
|
+
*
|
|
30
|
+
* `server` covers Dokploy and a bare host alike: the question these answer is
|
|
31
|
+
* whether the app is next to a managed cloud or next to its own containers, and
|
|
32
|
+
* on that question the two are the same.
|
|
33
|
+
*
|
|
34
|
+
* A per-construct, per-stage override is the layer above this — see
|
|
35
|
+
* `constructs-outstanding.md` — so two buckets in one app can differ. This is
|
|
36
|
+
* only what happens when nobody has said anything at all.
|
|
37
|
+
*/
|
|
38
|
+
const DEFAULT_CACHE = {
|
|
39
|
+
aws: "upstash",
|
|
40
|
+
server: "db"
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Which broker carries a declared queue or topic, by target.
|
|
44
|
+
*
|
|
45
|
+
* Whether there are events at all is the manifest's answer — a declared
|
|
46
|
+
* `Topic` or `Queue` — so this only ever answers the second question. AWS
|
|
47
|
+
* deploys them to SNS and SQS, and locally the AWS emulator stands in, so the
|
|
48
|
+
* broker a developer runs is the one production has. A server has a Postgres
|
|
49
|
+
* already, and pg-boss keeps its queues there.
|
|
50
|
+
*/
|
|
51
|
+
const DEFAULT_EVENTS = {
|
|
52
|
+
aws: "sns",
|
|
53
|
+
server: "pgboss"
|
|
54
|
+
};
|
|
55
|
+
/** Where a bucket lives when nobody said — see {@link DEFAULT_CACHE}. */
|
|
56
|
+
const DEFAULT_STORAGE = {
|
|
57
|
+
aws: "s3",
|
|
58
|
+
server: "minio"
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/generators/drivers.ts
|
|
62
|
+
/**
|
|
63
|
+
* Driver registration for generated entry points.
|
|
64
|
+
*
|
|
65
|
+
* A construct declares that it needs object storage and is handed one URL; the
|
|
66
|
+
* scheme in that URL picks the driver that builds the client. Which drivers
|
|
67
|
+
* exist is therefore the *entry point's* decision, not the construct's and not
|
|
68
|
+
* the application's — an app that never talks to S3 should never resolve the AWS
|
|
69
|
+
* SDK, and application code that registers a driver has named a provider in the
|
|
70
|
+
* one layer this design keeps provider-free.
|
|
71
|
+
*
|
|
72
|
+
* So the generated entries register: `gkm dev`'s server for local development,
|
|
73
|
+
* and each Lambda handler for its own target. Registration is an explicit call
|
|
74
|
+
* rather than an import side effect, because a side-effecting module is exactly
|
|
75
|
+
* what a bundler is entitled to drop.
|
|
76
|
+
*/
|
|
77
|
+
/** The `s3://` driver, which serves MinIO locally and S3 deployed. */
|
|
78
|
+
const S3 = {
|
|
79
|
+
imports: `import { registerStorageDriver } from '@geekmidas/storage';\nimport { s3Driver } from '@geekmidas/storage/aws';`,
|
|
80
|
+
setup: "registerStorageDriver(s3Driver);"
|
|
81
|
+
};
|
|
82
|
+
const NONE = {
|
|
83
|
+
imports: "",
|
|
84
|
+
setup: ""
|
|
85
|
+
};
|
|
86
|
+
/** The Redis wire protocol's drivers: both schemes, plain and TLS. */
|
|
87
|
+
const REDIS = {
|
|
88
|
+
imports: `import { registerCacheDriver } from '@geekmidas/cache';\nimport { redisCacheDriver, redissCacheDriver } from '@geekmidas/cache/redis';`,
|
|
89
|
+
setup: "registerCacheDriver(redisCacheDriver);\nregisterCacheDriver(redissCacheDriver);"
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* The cache driver for a backend — exactly one, never all three.
|
|
93
|
+
*
|
|
94
|
+
* Keyed off the *backend* rather than off a dependency, because unlike storage
|
|
95
|
+
* the backend already says which driver is right: a project caching in Postgres
|
|
96
|
+
* resolves `pg` and never `ioredis`, and one caching in Upstash resolves
|
|
97
|
+
* neither. That is the whole reason the drivers live behind separate subpaths.
|
|
98
|
+
*
|
|
99
|
+
* Both HTTP schemes are registered for Upstash, because the local proxy speaks
|
|
100
|
+
* `http://` and Upstash speaks `https://`, and an entry that registered one
|
|
101
|
+
* would work in exactly one of the two places.
|
|
102
|
+
*/
|
|
103
|
+
const CACHE_DRIVERS = {
|
|
104
|
+
upstash: {
|
|
105
|
+
imports: `import { registerCacheDriver } from '@geekmidas/cache';\nimport { upstashCacheDriver, upstashInsecureCacheDriver } from '@geekmidas/cache/upstash';`,
|
|
106
|
+
setup: "registerCacheDriver(upstashCacheDriver);\nregisterCacheDriver(upstashInsecureCacheDriver);"
|
|
107
|
+
},
|
|
108
|
+
elasticache: REDIS,
|
|
109
|
+
redis: REDIS,
|
|
110
|
+
db: {
|
|
111
|
+
imports: `import { registerCacheDriver } from '@geekmidas/cache';\nimport { postgresCacheDriver } from '@geekmidas/cache/postgres';`,
|
|
112
|
+
setup: "registerCacheDriver(postgresCacheDriver);"
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* The events drivers for a broker — only its own, so a bundle never resolves
|
|
117
|
+
* another broker's client library.
|
|
118
|
+
*
|
|
119
|
+
* Keyed off the backend, as the cache is: the target already says which broker
|
|
120
|
+
* carries the app's topics and queues. SNS registers SQS beside it, because on
|
|
121
|
+
* AWS a topic is `sns://` and a queue is `sqs://`, and an entry registering one
|
|
122
|
+
* would publish to topics and fail on the first queue.
|
|
123
|
+
*/
|
|
124
|
+
const EVENTS_DRIVERS = {
|
|
125
|
+
pgboss: {
|
|
126
|
+
imports: `import { registerEventsDriver } from '@geekmidas/events';\nimport { pgbossEventsDriver } from '@geekmidas/events/pgboss';`,
|
|
127
|
+
setup: "registerEventsDriver(pgbossEventsDriver);"
|
|
128
|
+
},
|
|
129
|
+
sns: {
|
|
130
|
+
imports: `import { registerEventsDriver } from '@geekmidas/events';\nimport { snsEventsDriver } from '@geekmidas/events/sns';\nimport { sqsEventsDriver } from '@geekmidas/events/sqs';`,
|
|
131
|
+
setup: "registerEventsDriver(snsEventsDriver);\nregisterEventsDriver(sqsEventsDriver);"
|
|
132
|
+
},
|
|
133
|
+
rabbitmq: {
|
|
134
|
+
imports: `import { registerEventsDriver } from '@geekmidas/events';\nimport { rabbitmqEventsDriver } from '@geekmidas/events/rabbitmq';`,
|
|
135
|
+
setup: "registerEventsDriver(rabbitmqEventsDriver);"
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* The KMS cipher, for an entry whose keys are on AWS. `aes256gcm:` is built
|
|
140
|
+
* into `Encryption`; only this one needs a driver, because only it needs an
|
|
141
|
+
* SDK — and only an AWS build has `kms://` keys to open.
|
|
142
|
+
*/
|
|
143
|
+
const KMS = {
|
|
144
|
+
imports: `import { registerCipherDriver } from '@geekmidas/constructs/encryption';\nimport { kmsCipherDriver } from '@geekmidas/constructs/encryption/kms';`,
|
|
145
|
+
setup: "registerCipherDriver(kmsCipherDriver);"
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* The API Gateway sink, for an AWS entry that reaches a `WebSocketApi`: its
|
|
149
|
+
* `services.<surface>` publishes through the gateway's management API, and
|
|
150
|
+
* only this subpath imports that SDK.
|
|
151
|
+
*/
|
|
152
|
+
const AWS_WEBSOCKET = {
|
|
153
|
+
imports: `import { registerWebSocketSinkDriver } from '@geekmidas/constructs/websocket-api';\nimport { apiGatewayWebSocketDriver } from '@geekmidas/constructs/aws-websocket';`,
|
|
154
|
+
setup: "registerWebSocketSinkDriver(apiGatewayWebSocketDriver);"
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Whether an entry publishes to a `WebSocketApi` on API Gateway: built for
|
|
158
|
+
* AWS, from a process that reaches one. A server's surfaces are `redis://` or
|
|
159
|
+
* `memory://`, which need no driver.
|
|
160
|
+
*/
|
|
161
|
+
function publishesToApiGateway(manifest, target) {
|
|
162
|
+
return target === "aws" && Object.values(manifest).some((d) => d.kind === "websocket-api");
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Whether an entry opens KMS keys: built for AWS, from a process that reaches
|
|
166
|
+
* an `Encryption`. A server's keys are keyrings, and `gkm dev` and `gkm test`
|
|
167
|
+
* derive theirs locally — none of them imports `@aws-sdk/client-kms`.
|
|
168
|
+
*/
|
|
169
|
+
function opensKmsKeys(manifest, target) {
|
|
170
|
+
return target === "aws" && Object.values(manifest).some((d) => d.kind === "encryption");
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Whether an entry reaches a bucket: an `objects`, or a file server that
|
|
174
|
+
* serves one. Only answerable from a reach that is complete — one Lambda
|
|
175
|
+
* handler's — which is why a server's entry still asks the dependency.
|
|
176
|
+
*/
|
|
177
|
+
function readsObjects(manifest) {
|
|
178
|
+
return Object.values(manifest).some((d) => d.kind === "objects" || d.kind === "file-server");
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Whether one Lambda handler speaks the broker: it reaches a topic or a
|
|
182
|
+
* queue. Not {@link eventsBackendsIn}, whose worker-beside-a-database rule is
|
|
183
|
+
* a server scheduling its crons through pg-boss — on AWS a cron is an
|
|
184
|
+
* EventBridge rule, and a handler that publishes nothing loads no broker.
|
|
185
|
+
*/
|
|
186
|
+
function handlerEventsBackends(manifest, configured) {
|
|
187
|
+
return Object.values(manifest).some((d) => d.kind === "topic" || d.kind === "queue") ? [configured] : [];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The drivers one generated handler registers: its own, where the build
|
|
191
|
+
* worked them out from what the construct reaches, else the app's.
|
|
192
|
+
*/
|
|
193
|
+
function driversOf(context, construct) {
|
|
194
|
+
return context.handlerDrivers?.(construct) ?? context.storageDrivers;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Everything a generated entry should register: object storage, the cache,
|
|
198
|
+
* the events broker and the KMS cipher.
|
|
199
|
+
*
|
|
200
|
+
* Merged here rather than threaded separately, because a generated file has one
|
|
201
|
+
* import block and one setup block whatever fills them.
|
|
202
|
+
*/
|
|
203
|
+
function driversFor(options) {
|
|
204
|
+
const backends = listOf(options.cache);
|
|
205
|
+
const brokers = listOf(options.events);
|
|
206
|
+
const parts = [
|
|
207
|
+
...options.storage === false ? [] : [storageDriversFor(options.appRoot)],
|
|
208
|
+
...[...new Set(backends)].map((backend) => CACHE_DRIVERS[backend] ?? CACHE_DRIVERS[DEFAULT_CACHE.aws]),
|
|
209
|
+
...[...new Set(brokers)].map((broker) => EVENTS_DRIVERS[broker]),
|
|
210
|
+
...options.kms ? [KMS] : [],
|
|
211
|
+
...options.apiGatewayWebSockets ? [AWS_WEBSOCKET] : []
|
|
212
|
+
].filter((part) => part.imports || part.setup);
|
|
213
|
+
if (parts.length === 0) return NONE;
|
|
214
|
+
return {
|
|
215
|
+
imports: parts.map((part) => part.imports).join("\n"),
|
|
216
|
+
setup: parts.map((part) => part.setup).join("\n")
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function listOf(value) {
|
|
220
|
+
if (value === false || value === void 0) return [];
|
|
221
|
+
return typeof value === "string" ? [value] : value;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Which events brokers an app's entry has to speak: the target's, when the app
|
|
225
|
+
* declares a `Topic` or a `Queue` — and none at all when it declares neither,
|
|
226
|
+
* so a project without events never resolves `@geekmidas/events`.
|
|
227
|
+
*
|
|
228
|
+
* A worker on pg-boss counts too: a server schedules its crons through the
|
|
229
|
+
* pg-boss broker, which the plan provisions for a declared worker beside a
|
|
230
|
+
* declared database (`workerBroker` in `reconcile/plan.ts`) whether or not
|
|
231
|
+
* anything publishes.
|
|
232
|
+
*/
|
|
233
|
+
function eventsBackendsIn(manifest, configured) {
|
|
234
|
+
const kinds = new Set(Object.values(manifest).map((d) => d.kind));
|
|
235
|
+
return kinds.has("topic") || kinds.has("queue") || configured === "pgboss" && kinds.has("worker") && kinds.has("database") ? [configured] : [];
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Which cache backends an app's entry actually has to speak.
|
|
239
|
+
*
|
|
240
|
+
* The config answers this for a cache that named nowhere, and the *declaration*
|
|
241
|
+
* answers it for one that named a database — `orders.cache('Sessions')` is a
|
|
242
|
+
* statement about the application, so a deployment cannot move that cache and
|
|
243
|
+
* the entry cannot register a driver for somewhere else.
|
|
244
|
+
*
|
|
245
|
+
* Reading only the config is how an entry ends up registering the Upstash
|
|
246
|
+
* driver for a URL the target composed as `postgres://`, which fails at the
|
|
247
|
+
* first request with `UnregisteredCacheScheme` and a stack that points at the
|
|
248
|
+
* cache rather than at the config that disagreed.
|
|
249
|
+
*/
|
|
250
|
+
function cacheBackendsIn(manifest, configured) {
|
|
251
|
+
const caches = Object.values(manifest).filter((d) => d.kind === "cache");
|
|
252
|
+
return [...new Set(caches.map((c) => c.of && !holdsEveryCache(configured) ? "db" : configured))];
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* The drivers an app's entry points should register.
|
|
256
|
+
*
|
|
257
|
+
* Keyed off the dependency rather than off a declared bucket, because the entry
|
|
258
|
+
* is generated before discovery has run on the watcher's rebuild path — and an
|
|
259
|
+
* app that installed `@geekmidas/storage` has already paid for the SDK it would
|
|
260
|
+
* otherwise resolve lazily.
|
|
261
|
+
*
|
|
262
|
+
* "Installed" the way Node resolves it: the app's own `package.json`, or any
|
|
263
|
+
* directory above it. A workspace that lists `@geekmidas/storage` once, at its
|
|
264
|
+
* root, is the common case — and reading only the app's file registered no S3
|
|
265
|
+
* driver there, so the first service to inject a bucket threw
|
|
266
|
+
* `UnregisteredStorageScheme`. A queue whose consumer depended on one logged
|
|
267
|
+
* that once and was never polled.
|
|
268
|
+
*/
|
|
269
|
+
function storageDriversFor(appRoot) {
|
|
270
|
+
return installedFrom(appRoot, "@geekmidas/storage") ? S3 : NONE;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Whether `pkg` is a dependency of the app at `appRoot` the way Node resolves
|
|
274
|
+
* it: listed in the app's own `package.json`, or in any directory above it.
|
|
275
|
+
*/
|
|
276
|
+
function installedFrom(appRoot, pkg) {
|
|
277
|
+
for (let dir = (0, node_path.resolve)(appRoot);; dir = (0, node_path.dirname)(dir)) {
|
|
278
|
+
if (lists((0, node_path.join)(dir, "package.json"), pkg)) return true;
|
|
279
|
+
if ((0, node_path.dirname)(dir) === dir) return false;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
function lists(manifest, dependency) {
|
|
283
|
+
if (!(0, node_fs.existsSync)(manifest)) return false;
|
|
284
|
+
try {
|
|
285
|
+
const pkg = JSON.parse((0, node_fs.readFileSync)(manifest, "utf8"));
|
|
286
|
+
return Boolean(pkg.dependencies?.[dependency] ?? pkg.devDependencies?.[dependency]);
|
|
287
|
+
} catch {
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
//#endregion
|
|
292
|
+
Object.defineProperty(exports, "DEFAULT_CACHE", {
|
|
293
|
+
enumerable: true,
|
|
294
|
+
get: function() {
|
|
295
|
+
return DEFAULT_CACHE;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
Object.defineProperty(exports, "DEFAULT_EVENTS", {
|
|
299
|
+
enumerable: true,
|
|
300
|
+
get: function() {
|
|
301
|
+
return DEFAULT_EVENTS;
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
Object.defineProperty(exports, "DEFAULT_STORAGE", {
|
|
305
|
+
enumerable: true,
|
|
306
|
+
get: function() {
|
|
307
|
+
return DEFAULT_STORAGE;
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
Object.defineProperty(exports, "cacheBackendsIn", {
|
|
311
|
+
enumerable: true,
|
|
312
|
+
get: function() {
|
|
313
|
+
return cacheBackendsIn;
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
Object.defineProperty(exports, "driversFor", {
|
|
317
|
+
enumerable: true,
|
|
318
|
+
get: function() {
|
|
319
|
+
return driversFor;
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
Object.defineProperty(exports, "driversOf", {
|
|
323
|
+
enumerable: true,
|
|
324
|
+
get: function() {
|
|
325
|
+
return driversOf;
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
Object.defineProperty(exports, "eventsBackendsIn", {
|
|
329
|
+
enumerable: true,
|
|
330
|
+
get: function() {
|
|
331
|
+
return eventsBackendsIn;
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
Object.defineProperty(exports, "handlerEventsBackends", {
|
|
335
|
+
enumerable: true,
|
|
336
|
+
get: function() {
|
|
337
|
+
return handlerEventsBackends;
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
Object.defineProperty(exports, "holdsEveryCache", {
|
|
341
|
+
enumerable: true,
|
|
342
|
+
get: function() {
|
|
343
|
+
return holdsEveryCache;
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
Object.defineProperty(exports, "installedFrom", {
|
|
347
|
+
enumerable: true,
|
|
348
|
+
get: function() {
|
|
349
|
+
return installedFrom;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
Object.defineProperty(exports, "isCacheBackend", {
|
|
353
|
+
enumerable: true,
|
|
354
|
+
get: function() {
|
|
355
|
+
return isCacheBackend;
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
Object.defineProperty(exports, "opensKmsKeys", {
|
|
359
|
+
enumerable: true,
|
|
360
|
+
get: function() {
|
|
361
|
+
return opensKmsKeys;
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
Object.defineProperty(exports, "publishesToApiGateway", {
|
|
365
|
+
enumerable: true,
|
|
366
|
+
get: function() {
|
|
367
|
+
return publishesToApiGateway;
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
Object.defineProperty(exports, "readsObjects", {
|
|
371
|
+
enumerable: true,
|
|
372
|
+
get: function() {
|
|
373
|
+
return readsObjects;
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
//# sourceMappingURL=drivers-DP7__dJX.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drivers-DP7__dJX.cjs","names":["resolve","dirname","join","existsSync","readFileSync"],"sources":["../src/types.ts","../src/generators/drivers.ts"],"sourcesContent":["import type {\n\tDevConfig,\n\tSecretsConfig,\n\tStagesConfig,\n\tTestConfig,\n} from './workspace/types.js';\n\nexport type MainProvider = 'aws' | 'server';\n\nexport type Routes = string | string[];\n\n/**\n * Supported event backend types.\n *\n * - `pgboss`: Reuses PostgreSQL with a dedicated user/schema. Auto-enables db service.\n * - `sns`: Adds the AWS emulator (floci) container; each topic and queue is\n * created on it and addressed by its own string.\n * - `rabbitmq`: Adds RabbitMQ container.\n *\n * Each topic and queue resolves its own `<ID>_PUBLISHER_CONNECTION_STRING`,\n * which its producers and its consumers both read. pg-boss and RabbitMQ also\n * resolve `EVENT_PUBLISHER_CONNECTION_STRING`, the one broker crons schedule\n * through.\n */\nexport type EventsBackend = 'pgboss' | 'sns' | 'rabbitmq';\n\n/**\n * Where a declared cache actually lives.\n *\n * A deployment choice, not an application one — the same code caches into any\n * of these — so it is config here beside `events` rather than a field on the\n * construct. Each backend is consistent between local and deployed, which is\n * the property worth having: a cache that behaves differently in the two places\n * is worse than a slower one.\n *\n * - `upstash` (default) — HTTP with a token. Reachable from a Lambda with no\n * VPC and no connection pool, which is why it is the default; locally the\n * `serverless-redis-http` proxy in front of Redis speaks the same protocol.\n * - `elasticache` — the Redis wire protocol, inside a VPC. Locally, plain Redis.\n * - `db` — a table in the database the app already declared. No infrastructure\n * at all, and the same relationship pg-boss has to Postgres: it creates its\n * own table on first use and needs a declared database to live in.\n * - `redis` — a Redis the stack runs beside the apps, on its network. It holds\n * *every* declared cache, one declared from a database included, so the\n * cache never competes with the database for its connections. Only the\n * compose target selects it today (`gkm compose`).\n */\nexport type CacheBackend = 'upstash' | 'elasticache' | 'db' | 'redis';\n\n/**\n * The backends a deploy target defaults to — every one but the compose\n * stack's own Redis, which only that target runs.\n */\nexport type TargetCacheBackend = Exclude<CacheBackend, 'redis'>;\n\n/** Whether `value` names a cache backend. */\nexport function isCacheBackend(value: string): value is CacheBackend {\n\treturn (\n\t\tvalue === 'upstash' ||\n\t\tvalue === 'elasticache' ||\n\t\tvalue === 'db' ||\n\t\tvalue === 'redis'\n\t);\n}\n\n/**\n * Whether a backend holds every declared cache, a cache declared from a\n * database (`database.cache('Sessions')`) included.\n *\n * Every other backend leaves such a cache where its declaration put it: the\n * declaration is the stronger statement. The stack's own Redis is the\n * exception, because a stack that runs one runs it *for* the cache — a table\n * beside it would be a second cache nobody asked for.\n */\nexport function holdsEveryCache(backend: CacheBackend): boolean {\n\treturn backend === 'redis';\n}\n\n/**\n * Where a declared bucket actually lives.\n *\n * The fourth of these selectors and the last to arrive, which is why\n * `UPLOADS_URL` had no answer on a container target: there was nothing to\n * choose with. Like the others it changes no application code — the `s3://`\n * scheme picks the driver, and every one of these speaks it.\n *\n * - `s3` — a real bucket. Nothing is created on the host; the URL is composed\n * against credentials you already hold, the same way `resend` is an API key\n * rather than infrastructure.\n * - `r2` — Cloudflare's, reached through the same S3 API and differing only in\n * its endpoint.\n * - `minio` — a container. Everything the app declares lives on the box, which\n * is what makes a single-host deploy self-contained, and what makes it a\n * single disk with no replication. Locally this is what every backend is.\n */\nexport type StorageBackend = 'minio' | 's3' | 'r2';\n\n/**\n * The backend a project gets when it says nothing, by where it deploys.\n *\n * Flat defaults could not be right for both: `upstash` on a single box means a\n * SaaS round-trip for a cache the database could have held, and `minio` on AWS\n * means running a bucket beside S3. So the default is a function of the target,\n * and an app that says nothing gets the obvious answer in both places — which\n * is the whole of what \"zero config\" can mean once there is more than one\n * target.\n *\n * `server` covers Dokploy and a bare host alike: the question these answer is\n * whether the app is next to a managed cloud or next to its own containers, and\n * on that question the two are the same.\n *\n * A per-construct, per-stage override is the layer above this — see\n * `constructs-outstanding.md` — so two buckets in one app can differ. This is\n * only what happens when nobody has said anything at all.\n */\nexport const DEFAULT_CACHE: Record<MainProvider, TargetCacheBackend> = {\n\t// Reachable from a Lambda with no VPC and no connection pool.\n\taws: 'upstash',\n\t// The database is already there and already has a connection pool open to\n\t// it. Anything else is a second service to run for a table.\n\tserver: 'db',\n};\n\n/**\n * Which broker carries a declared queue or topic, by target.\n *\n * Whether there are events at all is the manifest's answer — a declared\n * `Topic` or `Queue` — so this only ever answers the second question. AWS\n * deploys them to SNS and SQS, and locally the AWS emulator stands in, so the\n * broker a developer runs is the one production has. A server has a Postgres\n * already, and pg-boss keeps its queues there.\n */\nexport const DEFAULT_EVENTS: Record<MainProvider, EventsBackend> = {\n\taws: 'sns',\n\tserver: 'pgboss',\n};\n\n/** Where a bucket lives when nobody said — see {@link DEFAULT_CACHE}. */\nexport const DEFAULT_STORAGE: Record<MainProvider, StorageBackend> = {\n\taws: 's3',\n\tserver: 'minio',\n};\n\n/**\n * Who delivers a declared app's mail.\n *\n * Unlike a cache, this changes *nothing* about the client. Every backend speaks\n * SMTP, so the declaration's `smtp://` URL is true of all of them and only the\n * provisioner differs — which is the same reason the declaration has no\n * `provider` field and there is no `ses://` scheme.\n *\n * - `ses` (default) — the only backend that can be a *chain* of resources: an\n * identity, a user, an access key, and an SMTP password derived from it,\n * because SES issues IAM credentials rather than SMTP ones. Hand it a URL and\n * it uses that instead, which is what you want when the credentials already\n * exist — provisioning a second set of sending credentials for an identity\n * that already has them is not a thing to do by default.\n * - `resend` — an API key you hold, composed into an SMTP URL. Nothing to\n * provision: a SaaS account is not infrastructure.\n * - `smtp` — a URL supplied whole, for a relay somebody else runs.\n *\n * Locally every one of them is Mailpit, because locally none of it matters.\n */\nexport type EmailBackend = 'resend' | 'ses' | 'smtp';\n\n/**\n * Who delivers mail when nobody said.\n *\n * Flat, unlike the others, and deliberately: mail is a SaaS on every target.\n * There is no self-hosted preset to default a container deploy to — Mailpit is\n * a development inbox, not a sender — so `server` has no answer of its own to\n * give and would only be `ses` written twice.\n */\nexport const DEFAULT_EMAIL: EmailBackend = 'ses';\n\n/** Supported docker-compose service names */\nexport type ComposeServiceName =\n\t| 'postgres'\n\t| 'redis'\n\t| 'rabbitmq'\n\t| 'minio'\n\t| 'mailpit'\n\t| 'localstack';\n\nexport interface DockerConfig {\n\t/** Container registry URL (e.g., 'ghcr.io/myorg') */\n\tregistry?: string;\n\t/** Docker image name (default: derived from package.json name) */\n\timageName?: string;\n\t/** Base Docker image (default: 'node:22.23.4-alpine', a Node security release) */\n\tbaseImage?: string;\n\t/** Container port (default: 3000) */\n\tport?: number;\n}\n\nexport type Runtime = 'node' | 'bun';\n\nexport interface TelescopeConfig {\n\t/** Enable/disable telescope (default: true in development) */\n\tenabled?: boolean;\n\t/** Port for telescope to use (defaults to server port) */\n\tport?: number;\n\t/** Path prefix for telescope UI (default: /__telescope) */\n\tpath?: string;\n\t/** Ignore patterns for telescope (e.g., ['/health', '/metrics']) */\n\tignore?: string[];\n\t/** Record request/response bodies (default: true) */\n\trecordBody?: boolean;\n\t/** Maximum entries to keep in memory (default: 1000) */\n\tmaxEntries?: number;\n\t/** Enable WebSocket for real-time updates (default: true, requires @hono/node-ws for Node.js) */\n\twebsocket?: boolean;\n}\n\nexport interface OpenApiConfig {\n\t/** Enable OpenAPI generation (default: true) */\n\tenabled?: boolean;\n\t/** API title */\n\ttitle?: string;\n\t/** API version */\n\tversion?: string;\n\t/** API description */\n\tdescription?: string;\n}\n\nexport interface HooksConfig {\n\t/**\n\t * Path to a module exporting server lifecycle hooks.\n\t * The module should export `beforeSetup` and/or `afterSetup` functions.\n\t *\n\t * @example\n\t * ```typescript\n\t * // src/config/hooks.ts\n\t * import type { Hono } from 'hono';\n\t * import type { Logger } from '@geekmidas/logger';\n\t * import type { EnvironmentParser } from '@geekmidas/envkit';\n\t *\n\t * // Called BEFORE gkm endpoints are registered\n\t * export function beforeSetup(app: Hono, ctx: { envParser: EnvironmentParser; logger: Logger }) {\n\t * app.use('*', cors());\n\t * app.get('/custom/health', (c) => c.json({ status: 'ok' }));\n\t * }\n\t *\n\t * // Called AFTER gkm endpoints are registered\n\t * export function afterSetup(app: Hono, ctx: { envParser: EnvironmentParser; logger: Logger }) {\n\t * app.notFound((c) => c.json({ error: 'Not found' }, 404));\n\t * app.onError((err, c) => c.json({ error: err.message }, 500));\n\t * }\n\t * ```\n\t */\n\tserver?: string;\n}\n\nexport interface GkmConfig {\n\t/**\n\t * What this app is called, and therefore how everything it declares is named.\n\t *\n\t * The same field `sst.config.ts` carries, doing the same job: every physical\n\t * name is `{stage}-{name}-{construct}`, so `Database` in the `production`\n\t * stage of `kitchen-sink` is `production-kitchen-sink-database` on AWS and on\n\t * Dokploy alike. One statement, in the config, rather than a rule each\n\t * provider restates.\n\t *\n\t * `defineWorkspace` has always had this. A single-app config did not, so its\n\t * names fell back to whatever the directory happened to be called — the\n\t * monorepo's package name for the project and the app's for the application,\n\t * two accidents of layout standing in for a decision.\n\t *\n\t * Defaults to the package.json name with any scope stripped, then the\n\t * directory name.\n\t */\n\tname?: string;\n\t/** The project's stages: which one is local, which deploy */\n\tstages: StagesConfig;\n\t/** Encrypted secrets, and where deployed stages' secrets are stored */\n\tsecrets?: SecretsConfig;\n\t/** What `gkm test` hands a feature test: where the factories are. */\n\ttest?: TestConfig;\n\t/** How `gkm dev` is reached: the discovery endpoint's port and origins. */\n\tdev?: DevConfig;\n\t/**\n\t * Constructs glob pattern — one glob, every kind.\n\t *\n\t * What reconcile reads to derive the containers a stage needs: a database\n\t * implies Postgres, objects imply MinIO, mail implies Mailpit. A glob per\n\t * kind cannot find a resource, because a declared `ObjectStorage` has no\n\t * kind to be listed under.\n\t *\n\t * @example './src/**\\/*.ts'\n\t */\n\tconstructs: Routes;\n\t/**\n\t * Server lifecycle hooks for customizing the Hono app.\n\t * Allows adding custom routes, middleware, error handlers, etc.\n\t *\n\t * @example\n\t * hooks: {\n\t * server: './src/config/hooks'\n\t * }\n\t */\n\thooks?: HooksConfig;\n\t/**\n\t * Telescope configuration for debugging/monitoring.\n\t * Can be:\n\t * - A string path to a module that exports a Telescope instance (recommended)\n\t * - A boolean to enable/disable with defaults\n\t * - A TelescopeConfig object for inline configuration\n\t */\n\ttelescope?: string | boolean | TelescopeConfig;\n\t/**\n\t * OpenAPI generation configuration.\n\t * Can be:\n\t * - A boolean to enable/disable with defaults (output: ./src/api/openapi.ts)\n\t * - An OpenApiConfig object for customization\n\t *\n\t * When enabled, OpenAPI spec is generated on startup and regenerated on route changes.\n\t *\n\t * @example\n\t * openapi: true\n\t *\n\t * @example\n\t * openapi: {\n\t * output: './src/api/openapi.ts',\n\t * title: 'My API',\n\t * version: '1.0.0',\n\t * }\n\t */\n\topenapi?: boolean | OpenApiConfig;\n\t/** Runtime to use for dev server (default: 'node') */\n\truntime?: Runtime;\n\t/**\n\t * Environment file(s) to load for development.\n\t * Can be:\n\t * - A string path to a single env file (e.g., '.env.local')\n\t * - An array of paths to load in order (later files override earlier)\n\t * - Defaults to '.env' if not specified\n\t *\n\t * @example\n\t * env: '.env.local'\n\t *\n\t * @example\n\t * env: ['.env', '.env.local']\n\t */\n\tenv?: string | string[];\n\t/**\n\t * Docker deployment configuration.\n\t * Used by `gkm docker` and `gkm prepack` commands.\n\t *\n\t * @example\n\t * docker: {\n\t * registry: 'ghcr.io/myorg',\n\t * imageName: 'my-api',\n\t * compose: {\n\t * services: ['postgres', 'redis']\n\t * }\n\t * }\n\t */\n\tdocker?: DockerConfig;\n\t/**\n\t * Where this app deploys, and what the target needs to know.\n\t *\n\t * Absent until now, which meant a single-app project could not configure a\n\t * Dokploy deploy at all: the wrap that turns one into a workspace hardcoded\n\t * `{ default: 'dokploy' }` and dropped everything else, so there was no\n\t * endpoint, no registry and no domain — and `resolveHost` failed with \"no\n\t * domain configured for stage\" on a config that had nowhere to put one.\n\t *\n\t * The same shape a workspace config uses, so moving from one to the other is\n\t * a rename rather than a rewrite.\n\t */\n\tdeploy?: import('./workspace/types').DeployConfig;\n\t/** Each deployed stage's base domain — the same field a workspace has. */\n\tdomains?: import('./workspace/types').DomainsConfig;\n\t/** Each root domain's DNS provider — the same field a workspace has. */\n\tdns?: import('./workspace/types').WorkspaceDnsConfig;\n}\n\nexport interface BuildOptions {\n\t/** Overrides the deploy target's: a Dockerfile builds a server regardless. */\n\tprovider?: MainProvider;\n\t/**\n\t * The workspace app to build, `webhooks` — set by an image whose app shares\n\t * its directory with another, where the directory alone names the first.\n\t */\n\tapp?: string;\n\t/**\n\t * Overrides the target's cache backend for the drivers the entry\n\t * registers — set by the Dockerfiles `gkm compose` writes, whose stack runs\n\t * its own Redis.\n\t */\n\tcache?: CacheBackend;\n\tenableOpenApi?: boolean;\n\t/** Build for production (no dev tools, bundled output) */\n\tproduction?: boolean;\n\t/** Skip bundling step in production build */\n\tskipBundle?: boolean;\n\t/** Stage for secrets injection (e.g., 'production', 'staging') */\n\tstage?: string;\n\t/**\n\t * When true, optional environment variables (those with `.optional()` or\n\t * `.default()` in the envParser) are suffixed with `?` within each\n\t * construct's `environment` array in the manifest (e.g. `PORT?`).\n\t * Defaults to false.\n\t */\n\tmarkOptional?: boolean;\n\t/**\n\t * Where the apps' own build scripts (turbo) run. Defaults to a\n\t * `LocalSandbox` on the workspace: this machine, with an allowlisted\n\t * environment.\n\t */\n\tsandbox?: import('./sandbox/sandbox').Sandbox;\n}\n\n/** Result from build command when secrets are injected */\nexport interface BuildResult {\n\t/** Ephemeral master key for deployment (only if stage was provided) */\n\tmasterKey?: string;\n}\n\n// The deployment manifest types are a shared, dependency-free data contract\n// in `@geekmidas/manifest`, re-exported here for back-compat with existing\n// `@geekmidas/cli` imports.\nexport type {\n\tCronInfo,\n\tFunctionInfo,\n\tProcessorInfo,\n\tQueueInfo,\n\tRouteInfo,\n\tSubscriberInfo,\n\tTopicInfo,\n} from '@geekmidas/manifest';\n","/**\n * Driver registration for generated entry points.\n *\n * A construct declares that it needs object storage and is handed one URL; the\n * scheme in that URL picks the driver that builds the client. Which drivers\n * exist is therefore the *entry point's* decision, not the construct's and not\n * the application's — an app that never talks to S3 should never resolve the AWS\n * SDK, and application code that registers a driver has named a provider in the\n * one layer this design keeps provider-free.\n *\n * So the generated entries register: `gkm dev`'s server for local development,\n * and each Lambda handler for its own target. Registration is an explicit call\n * rather than an import side effect, because a side-effecting module is exactly\n * what a bundler is entitled to drop.\n */\n\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport {\n\ttype CacheBackend,\n\tDEFAULT_CACHE,\n\ttype EventsBackend,\n\tholdsEveryCache,\n} from '../types.js';\n\n/** The `s3://` driver, which serves MinIO locally and S3 deployed. */\nconst S3 = {\n\timports: `import { registerStorageDriver } from '@geekmidas/storage';\\nimport { s3Driver } from '@geekmidas/storage/aws';`,\n\tsetup: 'registerStorageDriver(s3Driver);',\n};\n\n/** What a generated entry needs in order to register the drivers it uses. */\nexport interface RuntimeDrivers {\n\t/** Import lines, or `''` when there is nothing to register. */\n\timports: string;\n\t/** The registration calls, or `''`. */\n\tsetup: string;\n}\n\n/** @deprecated The same shape, from when only storage had drivers. */\nexport type StorageDrivers = RuntimeDrivers;\n\nconst NONE: RuntimeDrivers = { imports: '', setup: '' };\n\n/** The Redis wire protocol's drivers: both schemes, plain and TLS. */\nconst REDIS: RuntimeDrivers = {\n\timports: `import { registerCacheDriver } from '@geekmidas/cache';\\nimport { redisCacheDriver, redissCacheDriver } from '@geekmidas/cache/redis';`,\n\tsetup:\n\t\t'registerCacheDriver(redisCacheDriver);\\nregisterCacheDriver(redissCacheDriver);',\n};\n\n/**\n * The cache driver for a backend — exactly one, never all three.\n *\n * Keyed off the *backend* rather than off a dependency, because unlike storage\n * the backend already says which driver is right: a project caching in Postgres\n * resolves `pg` and never `ioredis`, and one caching in Upstash resolves\n * neither. That is the whole reason the drivers live behind separate subpaths.\n *\n * Both HTTP schemes are registered for Upstash, because the local proxy speaks\n * `http://` and Upstash speaks `https://`, and an entry that registered one\n * would work in exactly one of the two places.\n */\nconst CACHE_DRIVERS: Record<CacheBackend, RuntimeDrivers> = {\n\tupstash: {\n\t\timports: `import { registerCacheDriver } from '@geekmidas/cache';\\nimport { upstashCacheDriver, upstashInsecureCacheDriver } from '@geekmidas/cache/upstash';`,\n\t\tsetup:\n\t\t\t'registerCacheDriver(upstashCacheDriver);\\nregisterCacheDriver(upstashInsecureCacheDriver);',\n\t},\n\telasticache: REDIS,\n\t// The stack's own Redis speaks the same wire protocol — and a managed\n\t// Redis set in its place may be `rediss://`.\n\tredis: REDIS,\n\tdb: {\n\t\timports: `import { registerCacheDriver } from '@geekmidas/cache';\\nimport { postgresCacheDriver } from '@geekmidas/cache/postgres';`,\n\t\tsetup: 'registerCacheDriver(postgresCacheDriver);',\n\t},\n};\n\n/**\n * The events drivers for a broker — only its own, so a bundle never resolves\n * another broker's client library.\n *\n * Keyed off the backend, as the cache is: the target already says which broker\n * carries the app's topics and queues. SNS registers SQS beside it, because on\n * AWS a topic is `sns://` and a queue is `sqs://`, and an entry registering one\n * would publish to topics and fail on the first queue.\n */\nconst EVENTS_DRIVERS: Record<EventsBackend, RuntimeDrivers> = {\n\tpgboss: {\n\t\timports: `import { registerEventsDriver } from '@geekmidas/events';\\nimport { pgbossEventsDriver } from '@geekmidas/events/pgboss';`,\n\t\tsetup: 'registerEventsDriver(pgbossEventsDriver);',\n\t},\n\tsns: {\n\t\timports: `import { registerEventsDriver } from '@geekmidas/events';\\nimport { snsEventsDriver } from '@geekmidas/events/sns';\\nimport { sqsEventsDriver } from '@geekmidas/events/sqs';`,\n\t\tsetup:\n\t\t\t'registerEventsDriver(snsEventsDriver);\\nregisterEventsDriver(sqsEventsDriver);',\n\t},\n\trabbitmq: {\n\t\timports: `import { registerEventsDriver } from '@geekmidas/events';\\nimport { rabbitmqEventsDriver } from '@geekmidas/events/rabbitmq';`,\n\t\tsetup: 'registerEventsDriver(rabbitmqEventsDriver);',\n\t},\n};\n\n/**\n * The KMS cipher, for an entry whose keys are on AWS. `aes256gcm:` is built\n * into `Encryption`; only this one needs a driver, because only it needs an\n * SDK — and only an AWS build has `kms://` keys to open.\n */\nconst KMS: RuntimeDrivers = {\n\timports: `import { registerCipherDriver } from '@geekmidas/constructs/encryption';\\nimport { kmsCipherDriver } from '@geekmidas/constructs/encryption/kms';`,\n\tsetup: 'registerCipherDriver(kmsCipherDriver);',\n};\n\n/**\n * The API Gateway sink, for an AWS entry that reaches a `WebSocketApi`: its\n * `services.<surface>` publishes through the gateway's management API, and\n * only this subpath imports that SDK.\n */\nconst AWS_WEBSOCKET: RuntimeDrivers = {\n\timports: `import { registerWebSocketSinkDriver } from '@geekmidas/constructs/websocket-api';\\nimport { apiGatewayWebSocketDriver } from '@geekmidas/constructs/aws-websocket';`,\n\tsetup: 'registerWebSocketSinkDriver(apiGatewayWebSocketDriver);',\n};\n\n/**\n * Whether an entry publishes to a `WebSocketApi` on API Gateway: built for\n * AWS, from a process that reaches one. A server's surfaces are `redis://` or\n * `memory://`, which need no driver.\n */\nexport function publishesToApiGateway(\n\tmanifest: Record<string, { kind: string }>,\n\ttarget: 'aws' | 'server',\n): boolean {\n\treturn (\n\t\ttarget === 'aws' &&\n\t\tObject.values(manifest).some((d) => d.kind === 'websocket-api')\n\t);\n}\n\n/**\n * Whether an entry opens KMS keys: built for AWS, from a process that reaches\n * an `Encryption`. A server's keys are keyrings, and `gkm dev` and `gkm test`\n * derive theirs locally — none of them imports `@aws-sdk/client-kms`.\n */\nexport function opensKmsKeys(\n\tmanifest: Record<string, { kind: string }>,\n\ttarget: 'aws' | 'server',\n): boolean {\n\treturn (\n\t\ttarget === 'aws' &&\n\t\tObject.values(manifest).some((d) => d.kind === 'encryption')\n\t);\n}\n\n/**\n * Whether an entry reaches a bucket: an `objects`, or a file server that\n * serves one. Only answerable from a reach that is complete — one Lambda\n * handler's — which is why a server's entry still asks the dependency.\n */\nexport function readsObjects(\n\tmanifest: Record<string, { kind: string }>,\n): boolean {\n\treturn Object.values(manifest).some(\n\t\t(d) => d.kind === 'objects' || d.kind === 'file-server',\n\t);\n}\n\n/**\n * Whether one Lambda handler speaks the broker: it reaches a topic or a\n * queue. Not {@link eventsBackendsIn}, whose worker-beside-a-database rule is\n * a server scheduling its crons through pg-boss — on AWS a cron is an\n * EventBridge rule, and a handler that publishes nothing loads no broker.\n */\nexport function handlerEventsBackends(\n\tmanifest: Record<string, { kind: string }>,\n\tconfigured: EventsBackend,\n): EventsBackend[] {\n\treturn Object.values(manifest).some(\n\t\t(d) => d.kind === 'topic' || d.kind === 'queue',\n\t)\n\t\t? [configured]\n\t\t: [];\n}\n\n/**\n * The drivers one generated handler registers: its own, where the build\n * worked them out from what the construct reaches, else the app's.\n */\nexport function driversOf(\n\tcontext: {\n\t\tstorageDrivers?: RuntimeDrivers;\n\t\thandlerDrivers?: (construct: {\n\t\t\towner?: string;\n\t\t\tconstructs?: readonly string[];\n\t\t}) => RuntimeDrivers | undefined;\n\t},\n\tconstruct: { owner?: string; constructs?: readonly string[] },\n): RuntimeDrivers | undefined {\n\treturn context.handlerDrivers?.(construct) ?? context.storageDrivers;\n}\n\n/**\n * Everything a generated entry should register: object storage, the cache,\n * the events broker and the KMS cipher.\n *\n * Merged here rather than threaded separately, because a generated file has one\n * import block and one setup block whatever fills them.\n */\nexport function driversFor(options: {\n\tappRoot: string;\n\t/**\n\t * The cache backends actually in play — normally one, and more than one only\n\t * where an app declares two caches that live in different places.\n\t *\n\t * Absent or empty means nothing declared a cache, so no cache driver is\n\t * registered at all.\n\t */\n\tcache?: CacheBackend | readonly CacheBackend[] | false;\n\t/**\n\t * The events brokers in play — see {@link eventsBackendsIn}. Absent or\n\t * empty means nothing declared a topic or a queue, so no events driver is\n\t * registered and `@geekmidas/events` is never resolved.\n\t */\n\tevents?: EventsBackend | readonly EventsBackend[] | false;\n\t/** Whether it opens KMS keys — see {@link opensKmsKeys}. */\n\tkms?: boolean;\n\t/** Whether it publishes through API Gateway — see {@link publishesToApiGateway}. */\n\tapiGatewayWebSockets?: boolean;\n\t/**\n\t * Whether it reads or writes objects — see {@link readsObjects}. Absent\n\t * means it may, so the S3 driver is registered wherever\n\t * `@geekmidas/storage` is installed.\n\t */\n\tstorage?: boolean;\n}): RuntimeDrivers {\n\tconst backends = listOf(options.cache);\n\tconst brokers = listOf(options.events);\n\n\tconst parts = [\n\t\t...(options.storage === false ? [] : [storageDriversFor(options.appRoot)]),\n\t\t...[...new Set(backends)].map(\n\t\t\t(backend) => CACHE_DRIVERS[backend] ?? CACHE_DRIVERS[DEFAULT_CACHE.aws],\n\t\t),\n\t\t...[...new Set(brokers)].map((broker) => EVENTS_DRIVERS[broker]),\n\t\t...(options.kms ? [KMS] : []),\n\t\t...(options.apiGatewayWebSockets ? [AWS_WEBSOCKET] : []),\n\t].filter((part) => part.imports || part.setup);\n\n\tif (parts.length === 0) return NONE;\n\n\treturn {\n\t\timports: parts.map((part) => part.imports).join('\\n'),\n\t\tsetup: parts.map((part) => part.setup).join('\\n'),\n\t};\n}\n\nfunction listOf<T extends string>(\n\tvalue: T | readonly T[] | false | undefined,\n): readonly T[] {\n\tif (value === false || value === undefined) return [];\n\treturn typeof value === 'string' ? [value] : (value as readonly T[]);\n}\n\n/**\n * Which events brokers an app's entry has to speak: the target's, when the app\n * declares a `Topic` or a `Queue` — and none at all when it declares neither,\n * so a project without events never resolves `@geekmidas/events`.\n *\n * A worker on pg-boss counts too: a server schedules its crons through the\n * pg-boss broker, which the plan provisions for a declared worker beside a\n * declared database (`workerBroker` in `reconcile/plan.ts`) whether or not\n * anything publishes.\n */\nexport function eventsBackendsIn(\n\tmanifest: Record<string, { kind: string }>,\n\tconfigured: EventsBackend,\n): EventsBackend[] {\n\tconst kinds = new Set(Object.values(manifest).map((d) => d.kind));\n\tconst declared =\n\t\tkinds.has('topic') ||\n\t\tkinds.has('queue') ||\n\t\t(configured === 'pgboss' && kinds.has('worker') && kinds.has('database'));\n\n\treturn declared ? [configured] : [];\n}\n\n/**\n * Which cache backends an app's entry actually has to speak.\n *\n * The config answers this for a cache that named nowhere, and the *declaration*\n * answers it for one that named a database — `orders.cache('Sessions')` is a\n * statement about the application, so a deployment cannot move that cache and\n * the entry cannot register a driver for somewhere else.\n *\n * Reading only the config is how an entry ends up registering the Upstash\n * driver for a URL the target composed as `postgres://`, which fails at the\n * first request with `UnregisteredCacheScheme` and a stack that points at the\n * cache rather than at the config that disagreed.\n */\nexport function cacheBackendsIn(\n\tmanifest: Record<string, { kind: string; of?: string }>,\n\tconfigured: CacheBackend,\n): CacheBackend[] {\n\tconst caches = Object.values(manifest).filter((d) => d.kind === 'cache');\n\n\t// The stack's own Redis holds every cache, one that named a database too.\n\treturn [\n\t\t...new Set(\n\t\t\tcaches.map((c) =>\n\t\t\t\tc.of && !holdsEveryCache(configured) ? 'db' : configured,\n\t\t\t),\n\t\t),\n\t];\n}\n\n/**\n * The drivers an app's entry points should register.\n *\n * Keyed off the dependency rather than off a declared bucket, because the entry\n * is generated before discovery has run on the watcher's rebuild path — and an\n * app that installed `@geekmidas/storage` has already paid for the SDK it would\n * otherwise resolve lazily.\n *\n * \"Installed\" the way Node resolves it: the app's own `package.json`, or any\n * directory above it. A workspace that lists `@geekmidas/storage` once, at its\n * root, is the common case — and reading only the app's file registered no S3\n * driver there, so the first service to inject a bucket threw\n * `UnregisteredStorageScheme`. A queue whose consumer depended on one logged\n * that once and was never polled.\n */\nexport function storageDriversFor(appRoot: string): RuntimeDrivers {\n\treturn installedFrom(appRoot, '@geekmidas/storage') ? S3 : NONE;\n}\n\n/**\n * Whether `pkg` is a dependency of the app at `appRoot` the way Node resolves\n * it: listed in the app's own `package.json`, or in any directory above it.\n */\nexport function installedFrom(appRoot: string, pkg: string): boolean {\n\tfor (let dir = resolve(appRoot); ; dir = dirname(dir)) {\n\t\tif (lists(join(dir, 'package.json'), pkg)) return true;\n\t\tif (dirname(dir) === dir) return false;\n\t}\n}\n\nfunction lists(manifest: string, dependency: string): boolean {\n\tif (!existsSync(manifest)) return false;\n\n\ttry {\n\t\tconst pkg = JSON.parse(readFileSync(manifest, 'utf8')) as {\n\t\t\tdependencies?: Record<string, string>;\n\t\t\tdevDependencies?: Record<string, string>;\n\t\t};\n\n\t\treturn Boolean(\n\t\t\tpkg.dependencies?.[dependency] ?? pkg.devDependencies?.[dependency],\n\t\t);\n\t} catch {\n\t\t// An unreadable package.json is the build's problem, not this function's.\n\t\treturn false;\n\t}\n}\n"],"mappings":"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"}
|