@geekmidas/cli 10.0.0-alpha.18 → 10.0.0-alpha.180
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-B7pQA25B.mjs +124 -0
- package/dist/LegacyStateStore-B7pQA25B.mjs.map +1 -0
- package/dist/LegacyStateStore-l0hBdv-E.cjs +124 -0
- package/dist/LegacyStateStore-l0hBdv-E.cjs.map +1 -0
- package/dist/LocalStateStore-CP0UHL85.mjs +167 -0
- package/dist/LocalStateStore-CP0UHL85.mjs.map +1 -0
- package/dist/LocalStateStore-DEE0Kc_s.cjs +178 -0
- package/dist/LocalStateStore-DEE0Kc_s.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-DE0BNuXc.cjs +222 -0
- package/dist/S3StateStore-DE0BNuXc.cjs.map +1 -0
- package/dist/S3StateStore-vmxZWMKh.mjs +223 -0
- package/dist/S3StateStore-vmxZWMKh.mjs.map +1 -0
- package/dist/SSMStateStore-DQyXnX2M.mjs +205 -0
- package/dist/SSMStateStore-DQyXnX2M.mjs.map +1 -0
- package/dist/SSMStateStore-p4hBdTg3.cjs +204 -0
- package/dist/SSMStateStore-p4hBdTg3.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-DEdpKya-.cjs +713 -0
- package/dist/add-DEdpKya-.cjs.map +1 -0
- package/dist/add-QBvDmVA-.mjs +711 -0
- package/dist/add-QBvDmVA-.mjs.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-D0LULFmU.mjs +4650 -0
- package/dist/apps-D0LULFmU.mjs.map +1 -0
- package/dist/apps-qJ5FPJGQ.cjs +5174 -0
- package/dist/apps-qJ5FPJGQ.cjs.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-mjqGAvu1.cjs → bundler-BuBCXA0t.cjs} +67 -14
- package/dist/bundler-BuBCXA0t.cjs.map +1 -0
- package/dist/{bundler-mwH7WOb1.mjs → bundler-DZKdVVKZ.mjs} +68 -15
- package/dist/bundler-DZKdVVKZ.mjs.map +1 -0
- package/dist/cli-BCGkzaR1.cjs +80 -0
- package/dist/cli-BCGkzaR1.cjs.map +1 -0
- package/dist/cli-CgEbT00Q.mjs +80 -0
- package/dist/cli-CgEbT00Q.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-AO8u4mBI.cjs +3502 -0
- package/dist/compose-AO8u4mBI.cjs.map +1 -0
- package/dist/compose-C-yjexqX.cjs +2925 -0
- package/dist/compose-C-yjexqX.cjs.map +1 -0
- package/dist/compose-C23RpAaF.mjs +3389 -0
- package/dist/compose-C23RpAaF.mjs.map +1 -0
- package/dist/compose-DtfoUChm.mjs +2434 -0
- package/dist/compose-DtfoUChm.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-Bve0zBqT.cjs +154 -0
- package/dist/dbTunnel-Bve0zBqT.cjs.map +1 -0
- package/dist/dbTunnel-CnubkLBa.mjs +154 -0
- package/dist/dbTunnel-CnubkLBa.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-C2MKxzm9.cjs +3894 -0
- package/dist/deploy-C2MKxzm9.cjs.map +1 -0
- package/dist/deploy-Qq41vtpm.mjs +3838 -0
- package/dist/deploy-Qq41vtpm.mjs.map +1 -0
- package/dist/destroy-Bg4IUf_Z.mjs +789 -0
- package/dist/destroy-Bg4IUf_Z.mjs.map +1 -0
- package/dist/destroy-CCpnHI2v.cjs +790 -0
- package/dist/destroy-CCpnHI2v.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-BAM8VH1v.mjs +1820 -0
- package/dist/dns-BAM8VH1v.mjs.map +1 -0
- package/dist/dns-D_0z9Tm1.cjs +2257 -0
- package/dist/dns-D_0z9Tm1.cjs.map +1 -0
- package/dist/docker-6EUbKrEl.cjs +1798 -0
- package/dist/docker-6EUbKrEl.cjs.map +1 -0
- package/dist/docker-DQoE3Fr7.mjs +1649 -0
- package/dist/docker-DQoE3Fr7.mjs.map +1 -0
- package/dist/dokploy-BD8NXy8y.cjs +38 -0
- package/dist/dokploy-BD8NXy8y.cjs.map +1 -0
- package/dist/dokploy-CU9iuc35.mjs +38 -0
- package/dist/dokploy-CU9iuc35.mjs.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-BhTOdQrE.cjs +337 -0
- package/dist/eas-BhTOdQrE.cjs.map +1 -0
- package/dist/eas-iYyg7Xjy.mjs +334 -0
- package/dist/eas-iYyg7Xjy.mjs.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-hgmnMZw0.mjs +89 -0
- package/dist/encryption-hgmnMZw0.mjs.map +1 -0
- package/dist/encryption-yROMpM67.cjs +90 -0
- package/dist/encryption-yROMpM67.cjs.map +1 -0
- package/dist/engine-B4whsrrE.mjs +3217 -0
- package/dist/engine-B4whsrrE.mjs.map +1 -0
- package/dist/engine-D0XYdIiE.cjs +3330 -0
- package/dist/engine-D0XYdIiE.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-CBkZF4PS.mjs +986 -0
- package/dist/github-CBkZF4PS.mjs.map +1 -0
- package/dist/github-D1-_OnGL.cjs +987 -0
- package/dist/github-D1-_OnGL.cjs.map +1 -0
- package/dist/googlePlay-Bwv8TVi8.mjs +931 -0
- package/dist/googlePlay-Bwv8TVi8.mjs.map +1 -0
- package/dist/googlePlay-s9dGfrrb.cjs +931 -0
- package/dist/googlePlay-s9dGfrrb.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-CFnHQgWC.cjs +241 -0
- package/dist/local-CFnHQgWC.cjs.map +1 -0
- package/dist/local-JOnTFJA5.mjs +224 -0
- package/dist/local-JOnTFJA5.mjs.map +1 -0
- package/dist/migrate-BtnpQocG.mjs +181 -0
- package/dist/migrate-BtnpQocG.mjs.map +1 -0
- package/dist/migrate-CGXrmZyV.cjs +272 -0
- package/dist/migrate-CGXrmZyV.cjs.map +1 -0
- package/dist/migrate-CxWXW-Lw.cjs +181 -0
- package/dist/migrate-CxWXW-Lw.cjs.map +1 -0
- package/dist/migrate-fLIgSpPB.mjs +267 -0
- package/dist/migrate-fLIgSpPB.mjs.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-ChYPaRLu.cjs +510 -0
- package/dist/notes-ChYPaRLu.cjs.map +1 -0
- package/dist/notes-LATU2vLI.mjs +409 -0
- package/dist/notes-LATU2vLI.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-BIeh2HTj.cjs +263 -0
- package/dist/projectBucket-BIeh2HTj.cjs.map +1 -0
- package/dist/projectBucket-D_4zb_oh.mjs +222 -0
- package/dist/projectBucket-D_4zb_oh.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-Dc-1GQp8.cjs +124 -0
- package/dist/publish-Dc-1GQp8.cjs.map +1 -0
- package/dist/publish-DhzRYhVZ.mjs +123 -0
- package/dist/publish-DhzRYhVZ.mjs.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-CJvM2bUx.mjs +263 -0
- package/dist/resolve-CJvM2bUx.mjs.map +1 -0
- package/dist/resolve-DyUXmA0z.cjs +316 -0
- package/dist/resolve-DyUXmA0z.cjs.map +1 -0
- package/dist/rollback-BO1asWkd.mjs +136 -0
- package/dist/rollback-BO1asWkd.mjs.map +1 -0
- package/dist/rollback-Op8Tc5N-.cjs +165 -0
- package/dist/rollback-Op8Tc5N-.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-BbtwHSod.mjs +240 -0
- package/dist/s3-BbtwHSod.mjs.map +1 -0
- package/dist/s3-CwacPd8J.cjs +240 -0
- package/dist/s3-CwacPd8J.cjs.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-BFdzPTIT.cjs +685 -0
- package/dist/serverSetup-BFdzPTIT.cjs.map +1 -0
- package/dist/serverSetup-CSxaZ7ha.mjs +685 -0
- package/dist/serverSetup-CSxaZ7ha.mjs.map +1 -0
- package/dist/sniffer-CwxpsSez.mjs +1824 -0
- package/dist/sniffer-CwxpsSez.mjs.map +1 -0
- package/dist/sniffer-D3gH7aJT.cjs +1997 -0
- package/dist/sniffer-D3gH7aJT.cjs.map +1 -0
- package/dist/snsSubscriptions-B8tGxND5.cjs +1135 -0
- package/dist/snsSubscriptions-B8tGxND5.cjs.map +1 -0
- package/dist/snsSubscriptions-n3sjbrRM.mjs +1010 -0
- package/dist/snsSubscriptions-n3sjbrRM.mjs.map +1 -0
- package/dist/sst-Cjocp7gi.cjs +501 -0
- package/dist/sst-Cjocp7gi.cjs.map +1 -0
- package/dist/sst-DeF0BfDA.mjs +478 -0
- package/dist/sst-DeF0BfDA.mjs.map +1 -0
- package/dist/stack-CyoRqyPt.mjs +1777 -0
- package/dist/stack-CyoRqyPt.mjs.map +1 -0
- package/dist/stack-Dr2FSxGm.cjs +1887 -0
- package/dist/stack-Dr2FSxGm.cjs.map +1 -0
- package/dist/stage-TAx0Gcq8.mjs +303 -0
- package/dist/stage-TAx0Gcq8.mjs.map +1 -0
- package/dist/stage-aTBLKonw.cjs +332 -0
- package/dist/stage-aTBLKonw.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-Bk4PjXWY.mjs +85 -0
- package/dist/terminal-Bk4PjXWY.mjs.map +1 -0
- package/dist/terminal-DPf137EJ.cjs +85 -0
- package/dist/terminal-DPf137EJ.cjs.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
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
-
import { i as generateSecurePassword } from "./generator-LfZU7NlU.mjs";
|
|
3
|
-
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
|
-
import { dirname, join } from "node:path";
|
|
5
|
-
//#region src/setup/fullstack-secrets.ts
|
|
6
|
-
/**
|
|
7
|
-
* Generate a secure random password for database users.
|
|
8
|
-
* Uses a combination of timestamp and random bytes for uniqueness.
|
|
9
|
-
*/
|
|
10
|
-
function generateDbPassword() {
|
|
11
|
-
return `${Date.now().toString(36)}${Math.random().toString(36).slice(2)}${Math.random().toString(36).slice(2)}`;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Generate database URL for an app.
|
|
15
|
-
* All apps connect to the same database, but use different users/schemas.
|
|
16
|
-
*/
|
|
17
|
-
function generateDbUrl(appName, password, projectName, host = "localhost", port = 5432) {
|
|
18
|
-
return `postgresql://${appName.replace(/-/g, "_")}:${password}@${host}:${port}/${`${projectName.replace(/-/g, "_")}_dev`}`;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Generate fullstack-aware custom secrets for a workspace.
|
|
22
|
-
*
|
|
23
|
-
* Generates:
|
|
24
|
-
* - Common secrets: NODE_ENV, PORT, LOG_LEVEL, JWT_SECRET
|
|
25
|
-
* - Per-app database passwords and URLs for backend apps with db service
|
|
26
|
-
* - Better-auth secrets for apps using the better-auth framework
|
|
27
|
-
*/
|
|
28
|
-
function generateFullstackCustomSecrets(workspace, containers = []) {
|
|
29
|
-
const hasDb = containers.includes("postgres");
|
|
30
|
-
const customs = {
|
|
31
|
-
NODE_ENV: "development",
|
|
32
|
-
PORT: "3000",
|
|
33
|
-
LOG_LEVEL: "debug",
|
|
34
|
-
JWT_SECRET: `dev-${Date.now()}-${Math.random().toString(36).slice(2)}`
|
|
35
|
-
};
|
|
36
|
-
if (!hasDb) return customs;
|
|
37
|
-
const frontendPorts = [];
|
|
38
|
-
for (const [appName, appConfig] of Object.entries(workspace.apps)) {
|
|
39
|
-
if (appConfig.type === "web") {
|
|
40
|
-
frontendPorts.push(appConfig.port);
|
|
41
|
-
const upperName = appName.toUpperCase();
|
|
42
|
-
customs[`${upperName}_URL`] = `http://localhost:${appConfig.port}`;
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
if (appConfig.type === "mobile") continue;
|
|
46
|
-
const password = generateDbPassword();
|
|
47
|
-
const upperName = appName.toUpperCase();
|
|
48
|
-
customs[`${upperName}_DATABASE_URL`] = generateDbUrl(appName, password, workspace.name);
|
|
49
|
-
customs[`${upperName}_DB_PASSWORD`] = password;
|
|
50
|
-
if (appConfig.framework === "better-auth") {
|
|
51
|
-
customs.AUTH_PORT = String(appConfig.port);
|
|
52
|
-
customs.AUTH_URL = `http://localhost:${appConfig.port}`;
|
|
53
|
-
customs.BETTER_AUTH_SECRET = `better-auth-${Date.now()}-${generateSecurePassword(16)}`;
|
|
54
|
-
customs.BETTER_AUTH_URL = `http://localhost:${appConfig.port}`;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (customs.BETTER_AUTH_SECRET) customs.BETTER_AUTH_TRUSTED_ORIGINS = Object.values(workspace.apps).map((a) => a.port).map((p) => `http://localhost:${p}`).join(",");
|
|
58
|
-
return customs;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Extract *_DB_PASSWORD keys from secrets and write docker/.env.
|
|
62
|
-
*
|
|
63
|
-
* The docker/.env file contains database passwords that the PostgreSQL
|
|
64
|
-
* init script reads to create per-app database users.
|
|
65
|
-
*/
|
|
66
|
-
async function writeDockerEnvFromSecrets(secrets, workspaceRoot) {
|
|
67
|
-
const dbPasswordEntries = Object.entries(secrets.custom).filter(([key]) => key.endsWith("_DB_PASSWORD"));
|
|
68
|
-
if (secrets.services.pgboss && !dbPasswordEntries.some(([key]) => key === "PGBOSS_DB_PASSWORD")) dbPasswordEntries.push(["PGBOSS_DB_PASSWORD", secrets.services.pgboss.password]);
|
|
69
|
-
if (dbPasswordEntries.length === 0) return;
|
|
70
|
-
const envContent = `# Auto-generated docker environment file
|
|
71
|
-
# Contains database passwords for docker-compose postgres init
|
|
72
|
-
# This file is gitignored - do not commit to version control
|
|
73
|
-
${dbPasswordEntries.map(([key, value]) => `${key}=${value}`).join("\n")}
|
|
74
|
-
`;
|
|
75
|
-
const envPath = join(workspaceRoot, "docker", ".env");
|
|
76
|
-
await mkdir(dirname(envPath), { recursive: true });
|
|
77
|
-
await writeFile(envPath, envContent);
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/secrets/reconcile.ts
|
|
81
|
-
var reconcile_exports = /* @__PURE__ */ __exportAll({ reconcileMissingSecrets: () => reconcileMissingSecrets });
|
|
82
|
-
/**
|
|
83
|
-
* Reconcile missing custom secrets for a workspace.
|
|
84
|
-
*
|
|
85
|
-
* Compares current secrets against what generateFullstackCustomSecrets()
|
|
86
|
-
* would produce and backfills any missing keys without overwriting
|
|
87
|
-
* existing values.
|
|
88
|
-
*
|
|
89
|
-
* @returns ReconcileResult if keys were added, null if secrets are up-to-date
|
|
90
|
-
*/
|
|
91
|
-
function reconcileMissingSecrets(secrets, workspace, containers = []) {
|
|
92
|
-
if (!(Object.keys(workspace.apps).length > 1)) return null;
|
|
93
|
-
const expectedCustom = generateFullstackCustomSecrets(workspace, containers);
|
|
94
|
-
const addedKeys = [];
|
|
95
|
-
const mergedCustom = { ...secrets.custom };
|
|
96
|
-
for (const [key, value] of Object.entries(expectedCustom)) if (!(key in mergedCustom)) {
|
|
97
|
-
mergedCustom[key] = value;
|
|
98
|
-
addedKeys.push(key);
|
|
99
|
-
}
|
|
100
|
-
if (addedKeys.length === 0) return null;
|
|
101
|
-
return {
|
|
102
|
-
secrets: {
|
|
103
|
-
...secrets,
|
|
104
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
105
|
-
custom: mergedCustom
|
|
106
|
-
},
|
|
107
|
-
addedKeys
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
111
|
-
export { writeDockerEnvFromSecrets as i, reconcile_exports as n, generateFullstackCustomSecrets as r, reconcileMissingSecrets as t };
|
|
112
|
-
|
|
113
|
-
//# sourceMappingURL=reconcile-fmoluZmZ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile-fmoluZmZ.mjs","names":[],"sources":["../src/setup/fullstack-secrets.ts","../src/secrets/reconcile.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport { generateSecurePassword } from '../secrets/generator.js';\nimport type { StageSecrets } from '../secrets/types.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\n\n/**\n * Generate a secure random password for database users.\n * Uses a combination of timestamp and random bytes for uniqueness.\n */\nexport function generateDbPassword(): string {\n\treturn `${Date.now().toString(36)}${Math.random().toString(36).slice(2)}${Math.random().toString(36).slice(2)}`;\n}\n\n/**\n * Generate database URL for an app.\n * All apps connect to the same database, but use different users/schemas.\n */\nexport function generateDbUrl(\n\tappName: string,\n\tpassword: string,\n\tprojectName: string,\n\thost = 'localhost',\n\tport = 5432,\n): string {\n\tconst userName = appName.replace(/-/g, '_');\n\tconst dbName = `${projectName.replace(/-/g, '_')}_dev`;\n\treturn `postgresql://${userName}:${password}@${host}:${port}/${dbName}`;\n}\n\n/**\n * Generate fullstack-aware custom secrets for a workspace.\n *\n * Generates:\n * - Common secrets: NODE_ENV, PORT, LOG_LEVEL, JWT_SECRET\n * - Per-app database passwords and URLs for backend apps with db service\n * - Better-auth secrets for apps using the better-auth framework\n */\nexport function generateFullstackCustomSecrets(\n\tworkspace: NormalizedWorkspace,\n\tcontainers: readonly string[] = [],\n): Record<string, string> {\n\t// A Postgres exists because something declared a database, not because\n\t// config carried a flag saying so.\n\tconst hasDb = containers.includes('postgres');\n\tconst customs: Record<string, string> = {\n\t\tNODE_ENV: 'development',\n\t\tPORT: '3000',\n\t\tLOG_LEVEL: 'debug',\n\t\tJWT_SECRET: `dev-${Date.now()}-${Math.random().toString(36).slice(2)}`,\n\t};\n\n\tif (!hasDb) {\n\t\treturn customs;\n\t}\n\n\t// Collect all frontend ports for trusted origins\n\tconst frontendPorts: number[] = [];\n\n\tfor (const [appName, appConfig] of Object.entries(workspace.apps)) {\n\t\tif (appConfig.type === 'web') {\n\t\t\tfrontendPorts.push(appConfig.port);\n\t\t\tconst upperName = appName.toUpperCase();\n\t\t\tcustoms[`${upperName}_URL`] = `http://localhost:${appConfig.port}`;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Mobile apps (Expo, etc.) don't run on a host port the backend\n\t\t// cares about for CORS, and don't need DB credentials.\n\t\tif (appConfig.type === 'mobile') {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Backend apps with database: generate per-app DB passwords and URLs\n\t\tconst password = generateDbPassword();\n\t\tconst upperName = appName.toUpperCase();\n\n\t\tcustoms[`${upperName}_DATABASE_URL`] = generateDbUrl(\n\t\t\tappName,\n\t\t\tpassword,\n\t\t\tworkspace.name,\n\t\t);\n\t\tcustoms[`${upperName}_DB_PASSWORD`] = password;\n\n\t\t// Better-auth framework secrets\n\t\tif (appConfig.framework === 'better-auth') {\n\t\t\tcustoms.AUTH_PORT = String(appConfig.port);\n\t\t\tcustoms.AUTH_URL = `http://localhost:${appConfig.port}`;\n\t\t\tcustoms.BETTER_AUTH_SECRET = `better-auth-${Date.now()}-${generateSecurePassword(16)}`;\n\t\t\tcustoms.BETTER_AUTH_URL = `http://localhost:${appConfig.port}`;\n\t\t}\n\t}\n\n\t// Generate trusted origins for better-auth (all app ports)\n\tif (customs.BETTER_AUTH_SECRET) {\n\t\tconst allPorts = Object.values(workspace.apps).map((a) => a.port);\n\t\tcustoms.BETTER_AUTH_TRUSTED_ORIGINS = allPorts\n\t\t\t.map((p) => `http://localhost:${p}`)\n\t\t\t.join(',');\n\t}\n\n\treturn customs;\n}\n\n/**\n * Extract *_DB_PASSWORD keys from secrets and write docker/.env.\n *\n * The docker/.env file contains database passwords that the PostgreSQL\n * init script reads to create per-app database users.\n */\nexport async function writeDockerEnvFromSecrets(\n\tsecrets: StageSecrets,\n\tworkspaceRoot: string,\n): Promise<void> {\n\tconst dbPasswordEntries = Object.entries(secrets.custom).filter(([key]) =>\n\t\tkey.endsWith('_DB_PASSWORD'),\n\t);\n\n\t// Always include pgboss password when pgboss credentials exist\n\tif (\n\t\tsecrets.services.pgboss &&\n\t\t!dbPasswordEntries.some(([key]) => key === 'PGBOSS_DB_PASSWORD')\n\t) {\n\t\tdbPasswordEntries.push([\n\t\t\t'PGBOSS_DB_PASSWORD',\n\t\t\tsecrets.services.pgboss.password,\n\t\t]);\n\t}\n\n\tif (dbPasswordEntries.length === 0) {\n\t\treturn;\n\t}\n\n\tconst envContent = `# Auto-generated docker environment file\n# Contains database passwords for docker-compose postgres init\n# This file is gitignored - do not commit to version control\n${dbPasswordEntries.map(([key, value]) => `${key}=${value}`).join('\\n')}\n`;\n\n\tconst envPath = join(workspaceRoot, 'docker', '.env');\n\tawait mkdir(dirname(envPath), { recursive: true });\n\tawait writeFile(envPath, envContent);\n}\n","import { generateFullstackCustomSecrets } from '../setup/fullstack-secrets.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\nimport type { StageSecrets } from './types.js';\n\nexport interface ReconcileResult {\n\t/** The updated secrets with missing keys backfilled */\n\tsecrets: StageSecrets;\n\t/** Keys that were added */\n\taddedKeys: string[];\n}\n\n/**\n * Reconcile missing custom secrets for a workspace.\n *\n * Compares current secrets against what generateFullstackCustomSecrets()\n * would produce and backfills any missing keys without overwriting\n * existing values.\n *\n * @returns ReconcileResult if keys were added, null if secrets are up-to-date\n */\nexport function reconcileMissingSecrets(\n\tsecrets: StageSecrets,\n\tworkspace: NormalizedWorkspace,\n\tcontainers: readonly string[] = [],\n): ReconcileResult | null {\n\tconst isMultiApp = Object.keys(workspace.apps).length > 1;\n\tif (!isMultiApp) {\n\t\treturn null;\n\t}\n\n\tconst expectedCustom = generateFullstackCustomSecrets(workspace, containers);\n\tconst addedKeys: string[] = [];\n\tconst mergedCustom = { ...secrets.custom };\n\n\tfor (const [key, value] of Object.entries(expectedCustom)) {\n\t\tif (!(key in mergedCustom)) {\n\t\t\tmergedCustom[key] = value;\n\t\t\taddedKeys.push(key);\n\t\t}\n\t}\n\n\tif (addedKeys.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tsecrets: {\n\t\t\t...secrets,\n\t\t\tupdatedAt: new Date().toISOString(),\n\t\t\tcustom: mergedCustom,\n\t\t},\n\t\taddedKeys,\n\t};\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgB,qBAA6B;CAC5C,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,SAAS,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,C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,QAAQ;EACT;EACA;CACD;AACD"}
|
package/dist/ssm-BKN1Cg4z.mjs
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { GetParameterCommand, ParameterNotFound, PutParameterCommand, SSMClient } from "@aws-sdk/client-ssm";
|
|
2
|
-
//#region src/secrets/ssm.ts
|
|
3
|
-
/**
|
|
4
|
-
* A stage's secrets in SSM Parameter Store, in the stage's own AWS account.
|
|
5
|
-
*
|
|
6
|
-
* One parameter per stage, `/gkm/<project>/<stage>/secrets`, a SecureString —
|
|
7
|
-
* encrypted at rest by KMS, so nothing about it needs a key file anywhere.
|
|
8
|
-
* Which account it is in is whichever credentials are active: the stage's
|
|
9
|
-
* OIDC role in a deploy job, or `--profile` on a developer's machine. With
|
|
10
|
-
* staging and production in different accounts, each stage's secrets sit
|
|
11
|
-
* beside its infrastructure, and a staging role cannot read production's.
|
|
12
|
-
*/
|
|
13
|
-
/** The parameter a stage's secrets are kept in. */
|
|
14
|
-
function secretsParameterName(project, stage) {
|
|
15
|
-
return `/gkm/${project}/${stage}/secrets`;
|
|
16
|
-
}
|
|
17
|
-
var SsmSecretsStore = class {
|
|
18
|
-
options;
|
|
19
|
-
client;
|
|
20
|
-
constructor(options) {
|
|
21
|
-
this.options = options;
|
|
22
|
-
}
|
|
23
|
-
async ssm() {
|
|
24
|
-
if (this.client) return this.client;
|
|
25
|
-
const config = { region: this.options.region };
|
|
26
|
-
if (this.options.profile) {
|
|
27
|
-
const { fromIni } = await import("@aws-sdk/credential-providers");
|
|
28
|
-
config.credentials = fromIni({ profile: this.options.profile });
|
|
29
|
-
}
|
|
30
|
-
if (this.options.endpoint) config.endpoint = this.options.endpoint;
|
|
31
|
-
this.client = new SSMClient(config);
|
|
32
|
-
return this.client;
|
|
33
|
-
}
|
|
34
|
-
async pull(stage) {
|
|
35
|
-
const ssm = await this.ssm();
|
|
36
|
-
try {
|
|
37
|
-
const { Parameter } = await ssm.send(new GetParameterCommand({
|
|
38
|
-
Name: secretsParameterName(this.options.project, stage),
|
|
39
|
-
WithDecryption: true
|
|
40
|
-
}));
|
|
41
|
-
return Parameter?.Value ? JSON.parse(Parameter.Value) : null;
|
|
42
|
-
} catch (error) {
|
|
43
|
-
if (error instanceof ParameterNotFound) return null;
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
async push(stage, secrets) {
|
|
48
|
-
await (await this.ssm()).send(new PutParameterCommand({
|
|
49
|
-
Name: secretsParameterName(this.options.project, stage),
|
|
50
|
-
Value: JSON.stringify(secrets),
|
|
51
|
-
Type: "SecureString",
|
|
52
|
-
Overwrite: true,
|
|
53
|
-
Description: `gkm secrets for ${this.options.project}/${stage}`
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
//#endregion
|
|
58
|
-
export { SsmSecretsStore };
|
|
59
|
-
|
|
60
|
-
//# sourceMappingURL=ssm-BKN1Cg4z.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ssm-BKN1Cg4z.mjs","names":[],"sources":["../src/secrets/ssm.ts"],"sourcesContent":["/**\n * A stage's secrets in SSM Parameter Store, in the stage's own AWS account.\n *\n * One parameter per stage, `/gkm/<project>/<stage>/secrets`, a SecureString —\n * encrypted at rest by KMS, so nothing about it needs a key file anywhere.\n * Which account it is in is whichever credentials are active: the stage's\n * OIDC role in a deploy job, or `--profile` on a developer's machine. With\n * staging and production in different accounts, each stage's secrets sit\n * beside its infrastructure, and a staging role cannot read production's.\n */\n\nimport {\n\tGetParameterCommand,\n\tParameterNotFound,\n\tPutParameterCommand,\n\tSSMClient,\n\ttype SSMClientConfig,\n} from '@aws-sdk/client-ssm';\nimport type { SecretsStore } from './store.js';\nimport type { StageSecrets } from './types.js';\n\nexport interface SsmSecretsStoreOptions {\n\t/** The workspace name, which scopes the parameter path. */\n\tproject: string;\n\tregion: string;\n\t/**\n\t * A named AWS profile, resolved with `fromIni` only. The default chain\n\t * reads AWS_* from the environment first, so exported staging keys would\n\t * win over `--profile prod` and put production's secrets in staging.\n\t */\n\tprofile?: string;\n\t/** For tests: an endpoint such as the AWS emulator. */\n\tendpoint?: string;\n}\n\n/** The parameter a stage's secrets are kept in. */\nexport function secretsParameterName(project: string, stage: string): string {\n\treturn `/gkm/${project}/${stage}/secrets`;\n}\n\nexport class SsmSecretsStore implements SecretsStore {\n\tprivate client?: SSMClient;\n\n\tconstructor(private readonly options: SsmSecretsStoreOptions) {}\n\n\tprivate async ssm(): Promise<SSMClient> {\n\t\tif (this.client) return this.client;\n\n\t\tconst config: SSMClientConfig = { region: this.options.region };\n\t\tif (this.options.profile) {\n\t\t\tconst { fromIni } = await import('@aws-sdk/credential-providers');\n\t\t\tconfig.credentials = fromIni({ profile: this.options.profile });\n\t\t}\n\t\tif (this.options.endpoint) {\n\t\t\tconfig.endpoint = this.options.endpoint;\n\t\t}\n\n\t\tthis.client = new SSMClient(config);\n\t\treturn this.client;\n\t}\n\n\tasync pull(stage: string): Promise<StageSecrets | null> {\n\t\tconst ssm = await this.ssm();\n\n\t\ttry {\n\t\t\tconst { Parameter } = await ssm.send(\n\t\t\t\tnew GetParameterCommand({\n\t\t\t\t\tName: secretsParameterName(this.options.project, stage),\n\t\t\t\t\tWithDecryption: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn Parameter?.Value\n\t\t\t\t? (JSON.parse(Parameter.Value) as StageSecrets)\n\t\t\t\t: null;\n\t\t} catch (error) {\n\t\t\tif (error instanceof ParameterNotFound) return null;\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tasync push(stage: string, secrets: StageSecrets): Promise<void> {\n\t\tconst ssm = await this.ssm();\n\n\t\tawait ssm.send(\n\t\t\tnew PutParameterCommand({\n\t\t\t\tName: secretsParameterName(this.options.project, stage),\n\t\t\t\tValue: JSON.stringify(secrets),\n\t\t\t\tType: 'SecureString',\n\t\t\t\tOverwrite: true,\n\t\t\t\tDescription: `gkm secrets for ${this.options.project}/${stage}`,\n\t\t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,60 +0,0 @@
|
|
|
1
|
-
let _aws_sdk_client_ssm = require("@aws-sdk/client-ssm");
|
|
2
|
-
//#region src/secrets/ssm.ts
|
|
3
|
-
/**
|
|
4
|
-
* A stage's secrets in SSM Parameter Store, in the stage's own AWS account.
|
|
5
|
-
*
|
|
6
|
-
* One parameter per stage, `/gkm/<project>/<stage>/secrets`, a SecureString —
|
|
7
|
-
* encrypted at rest by KMS, so nothing about it needs a key file anywhere.
|
|
8
|
-
* Which account it is in is whichever credentials are active: the stage's
|
|
9
|
-
* OIDC role in a deploy job, or `--profile` on a developer's machine. With
|
|
10
|
-
* staging and production in different accounts, each stage's secrets sit
|
|
11
|
-
* beside its infrastructure, and a staging role cannot read production's.
|
|
12
|
-
*/
|
|
13
|
-
/** The parameter a stage's secrets are kept in. */
|
|
14
|
-
function secretsParameterName(project, stage) {
|
|
15
|
-
return `/gkm/${project}/${stage}/secrets`;
|
|
16
|
-
}
|
|
17
|
-
var SsmSecretsStore = class {
|
|
18
|
-
options;
|
|
19
|
-
client;
|
|
20
|
-
constructor(options) {
|
|
21
|
-
this.options = options;
|
|
22
|
-
}
|
|
23
|
-
async ssm() {
|
|
24
|
-
if (this.client) return this.client;
|
|
25
|
-
const config = { region: this.options.region };
|
|
26
|
-
if (this.options.profile) {
|
|
27
|
-
const { fromIni } = await import("@aws-sdk/credential-providers");
|
|
28
|
-
config.credentials = fromIni({ profile: this.options.profile });
|
|
29
|
-
}
|
|
30
|
-
if (this.options.endpoint) config.endpoint = this.options.endpoint;
|
|
31
|
-
this.client = new _aws_sdk_client_ssm.SSMClient(config);
|
|
32
|
-
return this.client;
|
|
33
|
-
}
|
|
34
|
-
async pull(stage) {
|
|
35
|
-
const ssm = await this.ssm();
|
|
36
|
-
try {
|
|
37
|
-
const { Parameter } = await ssm.send(new _aws_sdk_client_ssm.GetParameterCommand({
|
|
38
|
-
Name: secretsParameterName(this.options.project, stage),
|
|
39
|
-
WithDecryption: true
|
|
40
|
-
}));
|
|
41
|
-
return Parameter?.Value ? JSON.parse(Parameter.Value) : null;
|
|
42
|
-
} catch (error) {
|
|
43
|
-
if (error instanceof _aws_sdk_client_ssm.ParameterNotFound) return null;
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
async push(stage, secrets) {
|
|
48
|
-
await (await this.ssm()).send(new _aws_sdk_client_ssm.PutParameterCommand({
|
|
49
|
-
Name: secretsParameterName(this.options.project, stage),
|
|
50
|
-
Value: JSON.stringify(secrets),
|
|
51
|
-
Type: "SecureString",
|
|
52
|
-
Overwrite: true,
|
|
53
|
-
Description: `gkm secrets for ${this.options.project}/${stage}`
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
//#endregion
|
|
58
|
-
exports.SsmSecretsStore = SsmSecretsStore;
|
|
59
|
-
|
|
60
|
-
//# sourceMappingURL=ssm-FxeSAt35.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ssm-FxeSAt35.cjs","names":["SSMClient","GetParameterCommand","ParameterNotFound","PutParameterCommand"],"sources":["../src/secrets/ssm.ts"],"sourcesContent":["/**\n * A stage's secrets in SSM Parameter Store, in the stage's own AWS account.\n *\n * One parameter per stage, `/gkm/<project>/<stage>/secrets`, a SecureString —\n * encrypted at rest by KMS, so nothing about it needs a key file anywhere.\n * Which account it is in is whichever credentials are active: the stage's\n * OIDC role in a deploy job, or `--profile` on a developer's machine. With\n * staging and production in different accounts, each stage's secrets sit\n * beside its infrastructure, and a staging role cannot read production's.\n */\n\nimport {\n\tGetParameterCommand,\n\tParameterNotFound,\n\tPutParameterCommand,\n\tSSMClient,\n\ttype SSMClientConfig,\n} from '@aws-sdk/client-ssm';\nimport type { SecretsStore } from './store.js';\nimport type { StageSecrets } from './types.js';\n\nexport interface SsmSecretsStoreOptions {\n\t/** The workspace name, which scopes the parameter path. */\n\tproject: string;\n\tregion: string;\n\t/**\n\t * A named AWS profile, resolved with `fromIni` only. The default chain\n\t * reads AWS_* from the environment first, so exported staging keys would\n\t * win over `--profile prod` and put production's secrets in staging.\n\t */\n\tprofile?: string;\n\t/** For tests: an endpoint such as the AWS emulator. */\n\tendpoint?: string;\n}\n\n/** The parameter a stage's secrets are kept in. */\nexport function secretsParameterName(project: string, stage: string): string {\n\treturn `/gkm/${project}/${stage}/secrets`;\n}\n\nexport class SsmSecretsStore implements SecretsStore {\n\tprivate client?: SSMClient;\n\n\tconstructor(private readonly options: SsmSecretsStoreOptions) {}\n\n\tprivate async ssm(): Promise<SSMClient> {\n\t\tif (this.client) return this.client;\n\n\t\tconst config: SSMClientConfig = { region: this.options.region };\n\t\tif (this.options.profile) {\n\t\t\tconst { fromIni } = await import('@aws-sdk/credential-providers');\n\t\t\tconfig.credentials = fromIni({ profile: this.options.profile });\n\t\t}\n\t\tif (this.options.endpoint) {\n\t\t\tconfig.endpoint = this.options.endpoint;\n\t\t}\n\n\t\tthis.client = new SSMClient(config);\n\t\treturn this.client;\n\t}\n\n\tasync pull(stage: string): Promise<StageSecrets | null> {\n\t\tconst ssm = await this.ssm();\n\n\t\ttry {\n\t\t\tconst { Parameter } = await ssm.send(\n\t\t\t\tnew GetParameterCommand({\n\t\t\t\t\tName: secretsParameterName(this.options.project, stage),\n\t\t\t\t\tWithDecryption: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn Parameter?.Value\n\t\t\t\t? (JSON.parse(Parameter.Value) as StageSecrets)\n\t\t\t\t: null;\n\t\t} catch (error) {\n\t\t\tif (error instanceof ParameterNotFound) return null;\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tasync push(stage: string, secrets: StageSecrets): Promise<void> {\n\t\tconst ssm = await this.ssm();\n\n\t\tawait ssm.send(\n\t\t\tnew PutParameterCommand({\n\t\t\t\tName: secretsParameterName(this.options.project, stage),\n\t\t\t\tValue: JSON.stringify(secrets),\n\t\t\t\tType: 'SecureString',\n\t\t\t\tOverwrite: true,\n\t\t\t\tDescription: `gkm secrets for ${this.options.project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;CACD;AACD"}
|
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
2
|
-
let node_fs = require("node:fs");
|
|
3
|
-
let node_fs_promises = require("node:fs/promises");
|
|
4
|
-
let node_os = require("node:os");
|
|
5
|
-
let node_path = require("node:path");
|
|
6
|
-
let node_crypto = require("node:crypto");
|
|
7
|
-
//#region src/secrets/keystore.ts
|
|
8
|
-
/** Key length for AES-256 encryption */
|
|
9
|
-
const KEY_LENGTH = 32;
|
|
10
|
-
/**
|
|
11
|
-
* Get the keystore directory for a project.
|
|
12
|
-
* Keys are stored at ~/.gkm/{project-name}/
|
|
13
|
-
*
|
|
14
|
-
* @param projectName - Name of the project (defaults to current directory name)
|
|
15
|
-
* @returns Path to the keystore directory
|
|
16
|
-
*/
|
|
17
|
-
function getKeystoreDir(projectName) {
|
|
18
|
-
const name = projectName ?? (0, node_path.basename)(process.cwd());
|
|
19
|
-
return (0, node_path.join)((0, node_os.homedir)(), ".gkm", name);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Get the path to a stage's encryption key.
|
|
23
|
-
*
|
|
24
|
-
* @param stage - Stage name (e.g., 'development', 'production')
|
|
25
|
-
* @param projectName - Name of the project (defaults to current directory name)
|
|
26
|
-
* @returns Path to the key file
|
|
27
|
-
*/
|
|
28
|
-
function getKeyPath(stage, projectName) {
|
|
29
|
-
return (0, node_path.join)(getKeystoreDir(projectName), `${stage}.key`);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Generate a new encryption key for a stage.
|
|
33
|
-
* The key is stored at ~/.gkm/{project-name}/{stage}.key with restricted permissions.
|
|
34
|
-
*
|
|
35
|
-
* @param stage - Stage name
|
|
36
|
-
* @param projectName - Project name (defaults to current directory name)
|
|
37
|
-
* @returns The generated key as a hex string
|
|
38
|
-
*/
|
|
39
|
-
async function generateKey(stage, projectName) {
|
|
40
|
-
const keyDir = getKeystoreDir(projectName);
|
|
41
|
-
const keyPath = getKeyPath(stage, projectName);
|
|
42
|
-
await (0, node_fs_promises.mkdir)(keyDir, {
|
|
43
|
-
recursive: true,
|
|
44
|
-
mode: 448
|
|
45
|
-
});
|
|
46
|
-
const key = (0, node_crypto.randomBytes)(KEY_LENGTH).toString("hex");
|
|
47
|
-
await (0, node_fs_promises.writeFile)(keyPath, key, {
|
|
48
|
-
mode: 384,
|
|
49
|
-
encoding: "utf-8"
|
|
50
|
-
});
|
|
51
|
-
await (0, node_fs_promises.chmod)(keyPath, 384);
|
|
52
|
-
return key;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Read an encryption key for a stage.
|
|
56
|
-
*
|
|
57
|
-
* @param stage - Stage name
|
|
58
|
-
* @param projectName - Project name (defaults to current directory name)
|
|
59
|
-
* @returns The key as a hex string, or null if not found
|
|
60
|
-
*/
|
|
61
|
-
async function readKey(stage, projectName) {
|
|
62
|
-
const keyPath = getKeyPath(stage, projectName);
|
|
63
|
-
if (!(0, node_fs.existsSync)(keyPath)) return null;
|
|
64
|
-
return (await (0, node_fs_promises.readFile)(keyPath, "utf-8")).trim();
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Get or create a key for a stage.
|
|
68
|
-
* If the key already exists, it is returned. Otherwise, a new key is generated.
|
|
69
|
-
*
|
|
70
|
-
* @param stage - Stage name
|
|
71
|
-
* @param projectName - Project name (defaults to current directory name)
|
|
72
|
-
* @returns The key as a hex string
|
|
73
|
-
*/
|
|
74
|
-
async function getOrCreateKey(stage, projectName) {
|
|
75
|
-
const existingKey = await readKey(stage, projectName);
|
|
76
|
-
if (existingKey) return existingKey;
|
|
77
|
-
return generateKey(stage, projectName);
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/secrets/storage.ts
|
|
81
|
-
var storage_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
82
|
-
getSecretsDir: () => getSecretsDir,
|
|
83
|
-
getSecretsPath: () => getSecretsPath,
|
|
84
|
-
initStageSecrets: () => initStageSecrets,
|
|
85
|
-
maskPassword: () => maskPassword,
|
|
86
|
-
readStageSecrets: () => readStageSecrets,
|
|
87
|
-
secretsExist: () => secretsExist,
|
|
88
|
-
setCustomSecret: () => setCustomSecret,
|
|
89
|
-
toEmbeddableSecrets: () => toEmbeddableSecrets,
|
|
90
|
-
validateEnvironmentVariables: () => validateEnvironmentVariables,
|
|
91
|
-
writeStageSecrets: () => writeStageSecrets
|
|
92
|
-
});
|
|
93
|
-
/** Default secrets directory relative to project root */
|
|
94
|
-
const SECRETS_DIR = ".gkm/secrets";
|
|
95
|
-
/** AES-256-GCM configuration */
|
|
96
|
-
const ALGORITHM = "aes-256-gcm";
|
|
97
|
-
const IV_LENGTH = 12;
|
|
98
|
-
/**
|
|
99
|
-
* Get the secrets directory path.
|
|
100
|
-
*/
|
|
101
|
-
function getSecretsDir(cwd = process.cwd()) {
|
|
102
|
-
return (0, node_path.join)(cwd, SECRETS_DIR);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Get the secrets file path for a stage.
|
|
106
|
-
*/
|
|
107
|
-
function getSecretsPath(stage, cwd = process.cwd()) {
|
|
108
|
-
return (0, node_path.join)(getSecretsDir(cwd), `${stage}.json`);
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Check if secrets exist for a stage.
|
|
112
|
-
*/
|
|
113
|
-
function secretsExist(stage, cwd = process.cwd()) {
|
|
114
|
-
return (0, node_fs.existsSync)(getSecretsPath(stage, cwd));
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Initialize an empty StageSecrets object for a stage.
|
|
118
|
-
*/
|
|
119
|
-
function initStageSecrets(stage) {
|
|
120
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
121
|
-
return {
|
|
122
|
-
stage,
|
|
123
|
-
createdAt: now,
|
|
124
|
-
updatedAt: now,
|
|
125
|
-
services: {},
|
|
126
|
-
urls: {},
|
|
127
|
-
custom: {}
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Encrypt secrets using a key.
|
|
132
|
-
*/
|
|
133
|
-
function encryptSecretsData(secrets, keyHex) {
|
|
134
|
-
const key = Buffer.from(keyHex, "hex");
|
|
135
|
-
const iv = (0, node_crypto.randomBytes)(IV_LENGTH);
|
|
136
|
-
const plaintext = JSON.stringify(secrets);
|
|
137
|
-
const cipher = (0, node_crypto.createCipheriv)(ALGORITHM, key, iv);
|
|
138
|
-
const ciphertext = Buffer.concat([cipher.update(plaintext, "utf-8"), cipher.final()]);
|
|
139
|
-
const authTag = cipher.getAuthTag();
|
|
140
|
-
return {
|
|
141
|
-
version: 1,
|
|
142
|
-
encrypted: Buffer.concat([ciphertext, authTag]).toString("base64"),
|
|
143
|
-
iv: iv.toString("hex")
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Decrypt secrets using a key.
|
|
148
|
-
*/
|
|
149
|
-
function decryptSecretsData(data, keyHex) {
|
|
150
|
-
const key = Buffer.from(keyHex, "hex");
|
|
151
|
-
const ivBuffer = Buffer.from(data.iv, "hex");
|
|
152
|
-
const combined = Buffer.from(data.encrypted, "base64");
|
|
153
|
-
const ciphertext = combined.subarray(0, -16);
|
|
154
|
-
const authTag = combined.subarray(-16);
|
|
155
|
-
const decipher = (0, node_crypto.createDecipheriv)(ALGORITHM, key, ivBuffer);
|
|
156
|
-
decipher.setAuthTag(authTag);
|
|
157
|
-
const plaintext = Buffer.concat([decipher.update(ciphertext), decipher.final()]);
|
|
158
|
-
return JSON.parse(plaintext.toString("utf-8"));
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Read secrets for a stage (encrypted).
|
|
162
|
-
* Requires the decryption key to be present at ~/.gkm/{project}/{stage}.key
|
|
163
|
-
*
|
|
164
|
-
* @returns StageSecrets or null if not found
|
|
165
|
-
*/
|
|
166
|
-
async function readStageSecrets(stage, cwd = process.cwd()) {
|
|
167
|
-
const path = getSecretsPath(stage, cwd);
|
|
168
|
-
if (!(0, node_fs.existsSync)(path)) return null;
|
|
169
|
-
const content = await (0, node_fs_promises.readFile)(path, "utf-8");
|
|
170
|
-
const data = JSON.parse(content);
|
|
171
|
-
if (data.version === 1 && data.encrypted && data.iv) {
|
|
172
|
-
const projectName = (0, node_path.basename)(cwd);
|
|
173
|
-
const key = await readKey(stage, projectName);
|
|
174
|
-
if (!key) throw new Error(`Decryption key not found for stage "${stage}". Expected key at: ~/.gkm/${projectName}/${stage}.key`);
|
|
175
|
-
return decryptSecretsData(data, key);
|
|
176
|
-
}
|
|
177
|
-
return data;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Write secrets for a stage (encrypted).
|
|
181
|
-
* Creates or uses existing encryption key at ~/.gkm/{project}/{stage}.key
|
|
182
|
-
*/
|
|
183
|
-
async function writeStageSecrets(secrets, cwd = process.cwd()) {
|
|
184
|
-
const dir = getSecretsDir(cwd);
|
|
185
|
-
const path = getSecretsPath(secrets.stage, cwd);
|
|
186
|
-
const projectName = (0, node_path.basename)(cwd);
|
|
187
|
-
await (0, node_fs_promises.mkdir)(dir, { recursive: true });
|
|
188
|
-
const encrypted = encryptSecretsData(secrets, await getOrCreateKey(secrets.stage, projectName));
|
|
189
|
-
await (0, node_fs_promises.writeFile)(path, JSON.stringify(encrypted, null, 2), "utf-8");
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Convert StageSecrets to embeddable format (flat key-value pairs).
|
|
193
|
-
* This is what gets encrypted and embedded in the bundle.
|
|
194
|
-
*/
|
|
195
|
-
function toEmbeddableSecrets(secrets) {
|
|
196
|
-
return {
|
|
197
|
-
...secrets.urls,
|
|
198
|
-
...secrets.custom,
|
|
199
|
-
...secrets.services.postgres && {
|
|
200
|
-
POSTGRES_USER: secrets.services.postgres.username,
|
|
201
|
-
POSTGRES_PASSWORD: secrets.services.postgres.password,
|
|
202
|
-
POSTGRES_DB: secrets.services.postgres.database ?? "app",
|
|
203
|
-
POSTGRES_HOST: secrets.services.postgres.host,
|
|
204
|
-
POSTGRES_PORT: String(secrets.services.postgres.port)
|
|
205
|
-
},
|
|
206
|
-
...secrets.services.redis && {
|
|
207
|
-
REDIS_PASSWORD: secrets.services.redis.password,
|
|
208
|
-
REDIS_HOST: secrets.services.redis.host,
|
|
209
|
-
REDIS_PORT: String(secrets.services.redis.port)
|
|
210
|
-
},
|
|
211
|
-
...secrets.services.rabbitmq && {
|
|
212
|
-
RABBITMQ_USER: secrets.services.rabbitmq.username,
|
|
213
|
-
RABBITMQ_PASSWORD: secrets.services.rabbitmq.password,
|
|
214
|
-
RABBITMQ_HOST: secrets.services.rabbitmq.host,
|
|
215
|
-
RABBITMQ_PORT: String(secrets.services.rabbitmq.port),
|
|
216
|
-
RABBITMQ_VHOST: secrets.services.rabbitmq.vhost ?? "/"
|
|
217
|
-
},
|
|
218
|
-
...secrets.services.minio && {
|
|
219
|
-
STORAGE_ACCESS_KEY_ID: secrets.services.minio.username,
|
|
220
|
-
STORAGE_SECRET_ACCESS_KEY: secrets.services.minio.password,
|
|
221
|
-
STORAGE_BUCKET: secrets.services.minio.bucket ?? "app",
|
|
222
|
-
STORAGE_REGION: "eu-west-1",
|
|
223
|
-
STORAGE_FORCE_PATH_STYLE: "true"
|
|
224
|
-
},
|
|
225
|
-
...secrets.services.mailpit && {
|
|
226
|
-
SMTP_HOST: secrets.services.mailpit.host,
|
|
227
|
-
SMTP_PORT: String(secrets.services.mailpit.port),
|
|
228
|
-
SMTP_USER: secrets.services.mailpit.username,
|
|
229
|
-
SMTP_PASS: secrets.services.mailpit.password,
|
|
230
|
-
SMTP_SECURE: "false",
|
|
231
|
-
MAIL_FROM: "noreply@localhost"
|
|
232
|
-
},
|
|
233
|
-
...secrets.services.localstack && {
|
|
234
|
-
AWS_ACCESS_KEY_ID: secrets.services.localstack.accessKeyId ?? secrets.services.localstack.username,
|
|
235
|
-
AWS_SECRET_ACCESS_KEY: secrets.services.localstack.password,
|
|
236
|
-
AWS_REGION: secrets.services.localstack.region ?? "us-east-1",
|
|
237
|
-
AWS_ENDPOINT_URL: `http://${secrets.services.localstack.host}:${secrets.services.localstack.port}`
|
|
238
|
-
},
|
|
239
|
-
...secrets.services.pgboss && {
|
|
240
|
-
PGBOSS_DB_USER: secrets.services.pgboss.username,
|
|
241
|
-
PGBOSS_DB_PASSWORD: secrets.services.pgboss.password
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Update a custom secret in the secrets file.
|
|
247
|
-
*/
|
|
248
|
-
async function setCustomSecret(stage, key, value, cwd = process.cwd()) {
|
|
249
|
-
const secrets = await readStageSecrets(stage, cwd);
|
|
250
|
-
if (!secrets) throw new Error(`Secrets not found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
251
|
-
const updated = {
|
|
252
|
-
...secrets,
|
|
253
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
254
|
-
custom: {
|
|
255
|
-
...secrets.custom,
|
|
256
|
-
[key]: value
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
await writeStageSecrets(updated, cwd);
|
|
260
|
-
return updated;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Mask a password for display (show first 4 and last 2 chars).
|
|
264
|
-
*/
|
|
265
|
-
function maskPassword(password) {
|
|
266
|
-
if (password.length <= 8) return "********";
|
|
267
|
-
return `${password.slice(0, 4)}${"*".repeat(password.length - 6)}${password.slice(-2)}`;
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Validate that all required environment variables are present in secrets.
|
|
271
|
-
*
|
|
272
|
-
* @param requiredVars - Array of environment variable names required by the application
|
|
273
|
-
* @param secrets - Stage secrets to validate against
|
|
274
|
-
* @returns Validation result with missing and provided variables
|
|
275
|
-
*
|
|
276
|
-
* @example
|
|
277
|
-
* ```typescript
|
|
278
|
-
* const required = ['DATABASE_URL', 'API_KEY', 'JWT_SECRET'];
|
|
279
|
-
* const secrets = await readStageSecrets('production');
|
|
280
|
-
* const result = validateEnvironmentVariables(required, secrets);
|
|
281
|
-
*
|
|
282
|
-
* if (!result.valid) {
|
|
283
|
-
* console.error(`Missing environment variables: ${result.missing.join(', ')}`);
|
|
284
|
-
* }
|
|
285
|
-
* ```
|
|
286
|
-
*/
|
|
287
|
-
function validateEnvironmentVariables(requiredVars, secrets) {
|
|
288
|
-
const embeddable = toEmbeddableSecrets(secrets);
|
|
289
|
-
const availableVars = new Set(Object.keys(embeddable));
|
|
290
|
-
const missing = [];
|
|
291
|
-
const provided = [];
|
|
292
|
-
for (const varName of requiredVars) if (availableVars.has(varName)) provided.push(varName);
|
|
293
|
-
else missing.push(varName);
|
|
294
|
-
return {
|
|
295
|
-
valid: missing.length === 0,
|
|
296
|
-
missing: missing.sort(),
|
|
297
|
-
provided: provided.sort(),
|
|
298
|
-
required: [...requiredVars].sort()
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
//#endregion
|
|
302
|
-
Object.defineProperty(exports, "getKeyPath", {
|
|
303
|
-
enumerable: true,
|
|
304
|
-
get: function() {
|
|
305
|
-
return getKeyPath;
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
Object.defineProperty(exports, "maskPassword", {
|
|
309
|
-
enumerable: true,
|
|
310
|
-
get: function() {
|
|
311
|
-
return maskPassword;
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
Object.defineProperty(exports, "readStageSecrets", {
|
|
315
|
-
enumerable: true,
|
|
316
|
-
get: function() {
|
|
317
|
-
return readStageSecrets;
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
Object.defineProperty(exports, "secretsExist", {
|
|
321
|
-
enumerable: true,
|
|
322
|
-
get: function() {
|
|
323
|
-
return secretsExist;
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
Object.defineProperty(exports, "setCustomSecret", {
|
|
327
|
-
enumerable: true,
|
|
328
|
-
get: function() {
|
|
329
|
-
return setCustomSecret;
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
Object.defineProperty(exports, "storage_exports", {
|
|
333
|
-
enumerable: true,
|
|
334
|
-
get: function() {
|
|
335
|
-
return storage_exports;
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
Object.defineProperty(exports, "toEmbeddableSecrets", {
|
|
339
|
-
enumerable: true,
|
|
340
|
-
get: function() {
|
|
341
|
-
return toEmbeddableSecrets;
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
Object.defineProperty(exports, "writeStageSecrets", {
|
|
345
|
-
enumerable: true,
|
|
346
|
-
get: function() {
|
|
347
|
-
return writeStageSecrets;
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
|
|
351
|
-
//# sourceMappingURL=storage-DgypfSD6.cjs.map
|