@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,4 +1,147 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@geekmidas/edge";
|
|
2
|
+
import { ComposeProxy } from "@geekmidas/edge/routes";
|
|
3
|
+
import { ConstructManifest, Declaration } from "@geekmidas/manifest";
|
|
4
|
+
//#region src/errors.d.ts
|
|
5
|
+
declare class GkmError extends Error {}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/sandbox/sandbox.d.ts
|
|
8
|
+
/** Where a command's output goes. */
|
|
9
|
+
type SandboxOutput = 'capture' | 'inherit' | 'stderr' | 'ignore';
|
|
10
|
+
interface SandboxExecOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Where the command runs: the project root or a directory below it, as an
|
|
13
|
+
* absolute path or relative to the root. Anywhere else is refused with
|
|
14
|
+
* {@link SandboxCwdEscape}.
|
|
15
|
+
*/
|
|
16
|
+
cwd: string;
|
|
17
|
+
/**
|
|
18
|
+
* The command's whole environment. Nothing of the host's is added to it:
|
|
19
|
+
* start from {@link Sandbox.env} and add what the step needs.
|
|
20
|
+
*/
|
|
21
|
+
env: Readonly<Record<string, string>>;
|
|
22
|
+
/**
|
|
23
|
+
* How long the command may run before it is killed. Required: a step that
|
|
24
|
+
* waits forever — a sniffed entry that opens a server, a build stuck on a
|
|
25
|
+
* prompt — would otherwise hold the deploy, and its lock, forever.
|
|
26
|
+
*/
|
|
27
|
+
timeoutMs: number;
|
|
28
|
+
/**
|
|
29
|
+
* Files the command can read, by name. Mounted in a directory of their own
|
|
30
|
+
* — named by `GKM_SECRETS_DIR` in the command's environment — and removed
|
|
31
|
+
* when it exits. Never set as variables, which every child inherits, a
|
|
32
|
+
* crash report prints and `/proc/<pid>/environ` shows.
|
|
33
|
+
*/
|
|
34
|
+
secrets?: Readonly<Record<string, string>>;
|
|
35
|
+
/**
|
|
36
|
+
* `capture` (the default) returns stdout and stderr in the result;
|
|
37
|
+
* `inherit` gives the command the host's terminal; `stderr` sends both
|
|
38
|
+
* streams to the host's stderr; `ignore` discards them.
|
|
39
|
+
*/
|
|
40
|
+
output?: SandboxOutput;
|
|
41
|
+
/** Kills the command when aborted; `exec` rejects with the signal's reason. */
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
}
|
|
44
|
+
/** How a command ended. A non-zero exit is a result, not an error. */
|
|
45
|
+
interface SandboxResult {
|
|
46
|
+
exitCode: number | null;
|
|
47
|
+
signal: string | null;
|
|
48
|
+
/** What it wrote to stdout, when its output was captured. */
|
|
49
|
+
stdout: string;
|
|
50
|
+
/** What it wrote to stderr, when its output was captured. */
|
|
51
|
+
stderr: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Runs a command against the project, and nothing else of the host's.
|
|
55
|
+
*
|
|
56
|
+
* `exec` resolves with the result however the command exited. It rejects
|
|
57
|
+
* with {@link CommandTimedOut} once the timeout passes — after the command is
|
|
58
|
+
* gone — with {@link SandboxCwdEscape} for a directory outside the project,
|
|
59
|
+
* with the signal's reason when aborted, and with the spawn error when the
|
|
60
|
+
* program cannot be started.
|
|
61
|
+
*/
|
|
62
|
+
interface Sandbox {
|
|
63
|
+
/** The project: the directory every command runs at or below. */
|
|
64
|
+
readonly root: string;
|
|
65
|
+
/**
|
|
66
|
+
* Whether the code it runs is kept from the host: its files, its
|
|
67
|
+
* processes, its memory.
|
|
68
|
+
*
|
|
69
|
+
* An isolating sandbox shares nothing but what crosses `exec`, so a config
|
|
70
|
+
* reaches the deploy as data — a live object in it (a custom state store,
|
|
71
|
+
* an inline target) cannot cross, and is refused with
|
|
72
|
+
* `ConfigObjectNotSerializable`. A non-isolating one, like
|
|
73
|
+
* {@link LocalSandbox}, runs on the host as the host's user; a project
|
|
74
|
+
* whose config holds live objects is then loaded in-process as before,
|
|
75
|
+
* because a project trusted to run there is trusted to do that.
|
|
76
|
+
*/
|
|
77
|
+
readonly isolating: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The environment a command starts from: what any program needs to run
|
|
80
|
+
* here — `PATH`, `HOME`, the locale — and no credential.
|
|
81
|
+
*/
|
|
82
|
+
readonly env: Readonly<Record<string, string>>;
|
|
83
|
+
exec(command: string, args: readonly string[], options: SandboxExecOptions): Promise<SandboxResult>;
|
|
84
|
+
}
|
|
85
|
+
/** The variable naming the directory a command's secrets are mounted in. */
|
|
86
|
+
declare const SECRETS_DIR_ENV = "GKM_SECRETS_DIR";
|
|
87
|
+
/** A command was asked to run outside the project. */
|
|
88
|
+
declare class SandboxCwdEscape extends GkmError {
|
|
89
|
+
readonly cwd: string;
|
|
90
|
+
readonly root: string;
|
|
91
|
+
constructor(cwd: string, root: string);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* `cwd` as an absolute directory inside `root`, or {@link SandboxCwdEscape}.
|
|
95
|
+
*
|
|
96
|
+
* Symlinks are resolved on both sides first, so a link inside the project
|
|
97
|
+
* that points out of it is an escape, and a project reached through a link
|
|
98
|
+
* (`/tmp` on macOS) is still itself. For a sandbox of a host's own to call
|
|
99
|
+
* before it runs anything.
|
|
100
|
+
*/
|
|
101
|
+
declare function confineCwd(root: string, cwd: string): string;
|
|
102
|
+
/** A secret's file name: one path segment, so it cannot be written elsewhere. */
|
|
103
|
+
declare class SecretNameInvalid extends GkmError {
|
|
104
|
+
readonly secretName: string;
|
|
105
|
+
constructor(secretName: string);
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/deploy/identity.d.ts
|
|
109
|
+
interface DeployIdentity {
|
|
110
|
+
/**
|
|
111
|
+
* Whose deploy this is — an organisation, a team, a repository. Two
|
|
112
|
+
* workspaces with the same name are told apart by it. Defaults to the
|
|
113
|
+
* kebab-cased workspace name; set `deploy.namespace` to choose one.
|
|
114
|
+
*/
|
|
115
|
+
readonly namespace: string;
|
|
116
|
+
/** The workspace name as the target spells it: lowercase, `[a-z0-9-]`. */
|
|
117
|
+
readonly project: string;
|
|
118
|
+
readonly stage: string;
|
|
119
|
+
/**
|
|
120
|
+
* `<namespace>/<project>`: what a Dokploy project is claimed by.
|
|
121
|
+
*
|
|
122
|
+
* The stage is not part of it because one Dokploy project holds every stage
|
|
123
|
+
* of a workspace, each as an environment — the key has to be the same from
|
|
124
|
+
* every stage that deploys into it.
|
|
125
|
+
*/
|
|
126
|
+
readonly key: string;
|
|
127
|
+
/**
|
|
128
|
+
* The prefix every name on the target carries: the project alone in the
|
|
129
|
+
* default namespace, `<namespace>-<project>` in any other.
|
|
130
|
+
*
|
|
131
|
+
* The default adds nothing so that a workspace that never set a namespace
|
|
132
|
+
* keeps the names it was already deployed under — a Postgres is found by
|
|
133
|
+
* its name, and a new name would be a new, empty database.
|
|
134
|
+
*/
|
|
135
|
+
readonly scope: string;
|
|
136
|
+
}
|
|
137
|
+
/** What an identity is derived from: a workspace's name and namespace. */
|
|
138
|
+
interface IdentitySource {
|
|
139
|
+
name: string;
|
|
140
|
+
deploy?: {
|
|
141
|
+
namespace?: string;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
declare function deployIdentity(workspace: IdentitySource, stage: string): DeployIdentity;
|
|
2
145
|
//#endregion
|
|
3
146
|
//#region src/secrets/types.d.ts
|
|
4
147
|
/** Credentials for a specific service */
|
|
@@ -9,8 +152,6 @@ interface ServiceCredentials {
|
|
|
9
152
|
password: string;
|
|
10
153
|
/** Database name (for postgres) */
|
|
11
154
|
database?: string;
|
|
12
|
-
/** Virtual host (for rabbitmq) */
|
|
13
|
-
vhost?: string;
|
|
14
155
|
/** Bucket name (for minio) */
|
|
15
156
|
bucket?: string;
|
|
16
157
|
/** Access key ID (for localstack) */
|
|
@@ -26,45 +167,91 @@ interface StageSecrets {
|
|
|
26
167
|
createdAt: string;
|
|
27
168
|
/** ISO timestamp when secrets were last updated */
|
|
28
169
|
updatedAt: string;
|
|
29
|
-
/** Event backend type (if events are enabled) */
|
|
30
|
-
eventsBackend?: EventsBackend;
|
|
31
170
|
/** Service-specific credentials */
|
|
32
171
|
services: {
|
|
33
172
|
postgres?: ServiceCredentials;
|
|
34
173
|
redis?: ServiceCredentials;
|
|
35
|
-
rabbitmq?: ServiceCredentials;
|
|
36
174
|
minio?: ServiceCredentials;
|
|
37
175
|
mailpit?: ServiceCredentials;
|
|
38
176
|
localstack?: ServiceCredentials;
|
|
39
|
-
pgboss?: ServiceCredentials;
|
|
40
177
|
};
|
|
41
178
|
/** Generated connection URLs */
|
|
42
179
|
urls: {
|
|
43
180
|
DATABASE_URL?: string;
|
|
44
181
|
REDIS_URL?: string;
|
|
45
|
-
RABBITMQ_URL?: string;
|
|
46
182
|
STORAGE_ENDPOINT?: string;
|
|
47
183
|
SMTP_HOST?: string;
|
|
48
184
|
SMTP_PORT?: string;
|
|
49
|
-
EVENT_PUBLISHER_CONNECTION_STRING?: string;
|
|
50
|
-
EVENT_SUBSCRIBER_CONNECTION_STRING?: string;
|
|
51
185
|
};
|
|
52
|
-
/**
|
|
186
|
+
/**
|
|
187
|
+
* Values injected by key: those set with `gkm secrets:set` — a third
|
|
188
|
+
* party's credentials — and those generated once for the stage, such as an
|
|
189
|
+
* auth server's signing secret.
|
|
190
|
+
*/
|
|
53
191
|
custom: Record<string, string>;
|
|
192
|
+
/**
|
|
193
|
+
* Random, generated once per stage: what every password a deploy derives
|
|
194
|
+
* is salted with. Without it a derived password is a function of the
|
|
195
|
+
* project and stage names, which anyone reading the repo has.
|
|
196
|
+
*/
|
|
197
|
+
seed?: string;
|
|
54
198
|
}
|
|
55
199
|
//#endregion
|
|
56
200
|
//#region src/secrets/store.d.ts
|
|
57
201
|
interface SecretsStore {
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
202
|
+
/**
|
|
203
|
+
* Which kind of store this is — `'file'`, `'s3'`, `'ssm'`,
|
|
204
|
+
* `'secrets-manager'`, or a custom one's.
|
|
205
|
+
*/
|
|
206
|
+
readonly name: string;
|
|
207
|
+
/** The stage's secrets, or null when it has none here. */
|
|
208
|
+
read(stage: string): Promise<StageSecrets | null>;
|
|
209
|
+
/** Replace the stage's secrets. */
|
|
210
|
+
write(stage: string, secrets: StageSecrets): Promise<void>;
|
|
211
|
+
/**
|
|
212
|
+
* Delete the stage's secrets, every kept version of them included — what
|
|
213
|
+
* `gkm compose --destroy --secrets` does. Optional for a custom store; one
|
|
214
|
+
* without it cannot have its stage's secrets destroyed by gkm.
|
|
215
|
+
*/
|
|
216
|
+
delete?(stage: string): Promise<void>;
|
|
62
217
|
}
|
|
63
218
|
/** Secrets in SSM Parameter Store, in the account of the active credentials. */
|
|
64
219
|
interface SsmSecretsStoreConfig {
|
|
65
220
|
provider: 'ssm';
|
|
66
221
|
region: string;
|
|
67
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Secrets in AWS Secrets Manager, in the account of the active credentials:
|
|
225
|
+
* one secret per stage, `gkm/<project>/<stage>/secrets`. Up to 64 KB where
|
|
226
|
+
* SSM holds 8 KB, at a monthly price per secret.
|
|
227
|
+
*/
|
|
228
|
+
interface SecretsManagerSecretsStoreConfig {
|
|
229
|
+
provider: 'secrets-manager';
|
|
230
|
+
region: string;
|
|
231
|
+
/**
|
|
232
|
+
* The KMS key (id, ARN or alias) a stage's secret is created with. Unset,
|
|
233
|
+
* it is the account's AWS-managed `aws/secretsmanager` key.
|
|
234
|
+
*/
|
|
235
|
+
kmsKeyId?: string;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Secrets in S3, one object per stage —
|
|
239
|
+
* `<prefix>/<project>/<stage>/secrets.json` — in the project bucket beside the
|
|
240
|
+
* deploy state and backups, or in a bucket that exists. Encrypted with SSE-S3,
|
|
241
|
+
* every past document kept by the bucket's versioning, and no size limit.
|
|
242
|
+
*/
|
|
243
|
+
interface S3SecretsStoreConfig {
|
|
244
|
+
provider: 's3';
|
|
245
|
+
/**
|
|
246
|
+
* A bucket that already exists. Omitted, the project bucket —
|
|
247
|
+
* `gkm-<project>-<account id>`, created by the first write.
|
|
248
|
+
*/
|
|
249
|
+
bucket?: string;
|
|
250
|
+
/** The bucket's region. Omitted, the deploy state's, when it is in S3. */
|
|
251
|
+
region?: string;
|
|
252
|
+
/** Key prefix inside the bucket. Omitted, the S3 state's, else `gkm`. */
|
|
253
|
+
prefix?: string;
|
|
254
|
+
}
|
|
68
255
|
/** Any other backend: an object implementing {@link SecretsStore}. */
|
|
69
256
|
interface CustomSecretsStoreConfig {
|
|
70
257
|
provider: SecretsStore;
|
|
@@ -73,18 +260,39 @@ interface CustomSecretsStoreConfig {
|
|
|
73
260
|
* `secrets.store` in gkm.config.ts.
|
|
74
261
|
*
|
|
75
262
|
* `'file'` — the default — keeps each stage's secrets in the encrypted
|
|
76
|
-
* `.gkm/secrets/<stage>.json
|
|
77
|
-
*
|
|
263
|
+
* `.gkm/secrets/<stage>.json`, its key in the CLI's home (`GKM_HOME`, else
|
|
264
|
+
* `~/.gkm`). It cannot serve a
|
|
265
|
+
* deploy from CI while `.gkm/` is gitignored; `s3`, `ssm`, `secrets-manager`
|
|
266
|
+
* or a custom store can.
|
|
78
267
|
*/
|
|
79
|
-
type SecretsStoreConfig = 'file' | SsmSecretsStoreConfig | CustomSecretsStoreConfig;
|
|
268
|
+
type SecretsStoreConfig = 'file' | S3SecretsStoreConfig | SsmSecretsStoreConfig | SecretsManagerSecretsStoreConfig | CustomSecretsStoreConfig;
|
|
80
269
|
//#endregion
|
|
81
|
-
//#region src/deploy/
|
|
270
|
+
//#region src/deploy/actor.d.ts
|
|
82
271
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
272
|
+
* Who wrote a stage's deploy state: a GitHub Actions run, or a person at a
|
|
273
|
+
* machine. Recorded on every state write (`updatedBy`), on every resource
|
|
274
|
+
* record and on every release (`releasedBy`), so "who put this here" has an
|
|
275
|
+
* answer that does not depend on anyone's memory.
|
|
87
276
|
*/
|
|
277
|
+
/** A GitHub Actions run: the account that triggered it and the run's page. */
|
|
278
|
+
interface GithubActor {
|
|
279
|
+
kind: 'github';
|
|
280
|
+
/** `GITHUB_ACTOR` — the account that triggered the run. */
|
|
281
|
+
actor: string;
|
|
282
|
+
/** `<server>/<repository>/actions/runs/<run id>` */
|
|
283
|
+
run: string;
|
|
284
|
+
/** `GITHUB_WORKFLOW` — the workflow's name. */
|
|
285
|
+
workflow?: string;
|
|
286
|
+
}
|
|
287
|
+
/** A person at a machine. */
|
|
288
|
+
interface LocalActor {
|
|
289
|
+
kind: 'local';
|
|
290
|
+
user: string;
|
|
291
|
+
host: string;
|
|
292
|
+
}
|
|
293
|
+
type Actor = GithubActor | LocalActor;
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/deploy/state.d.ts
|
|
88
296
|
/**
|
|
89
297
|
* Per-app database credentials
|
|
90
298
|
*/
|
|
@@ -139,12 +347,30 @@ interface BackupState {
|
|
|
139
347
|
/** Timestamp when backup was configured */
|
|
140
348
|
createdAt: string;
|
|
141
349
|
}
|
|
350
|
+
/** What every target's state for a stage holds. */
|
|
351
|
+
interface StageStateCore {
|
|
352
|
+
stage: string;
|
|
353
|
+
lastDeployedAt: string;
|
|
354
|
+
/**
|
|
355
|
+
* The deploy identity's key (`<namespace>/<project>`) that last deployed
|
|
356
|
+
* this stage — what the project's ownership marker says.
|
|
357
|
+
*/
|
|
358
|
+
identity?: string;
|
|
359
|
+
/**
|
|
360
|
+
* Each app's releases, keyed by app name: what runs now, what ran before
|
|
361
|
+
* it — which `gkm deploy:rollback` restores — and the history behind both.
|
|
362
|
+
*/
|
|
363
|
+
releases?: Record<string, AppReleases>;
|
|
364
|
+
}
|
|
365
|
+
/** A compose stage's state: the core, and nothing Dokploy-specific. */
|
|
366
|
+
interface ComposeStageState extends StageStateCore {
|
|
367
|
+
provider: 'compose';
|
|
368
|
+
}
|
|
142
369
|
/**
|
|
143
370
|
* State for a single stage deployment
|
|
144
371
|
*/
|
|
145
|
-
interface DokployStageState {
|
|
372
|
+
interface DokployStageState extends StageStateCore {
|
|
146
373
|
provider: 'dokploy';
|
|
147
|
-
stage: string;
|
|
148
374
|
/** Dokploy project ID - created on first deploy */
|
|
149
375
|
projectId: string;
|
|
150
376
|
environmentId: string;
|
|
@@ -163,7 +389,169 @@ interface DokployStageState {
|
|
|
163
389
|
dnsRecords?: Record<string, CreatedDnsRecord>;
|
|
164
390
|
/** Backup destination state */
|
|
165
391
|
backups?: BackupState;
|
|
166
|
-
|
|
392
|
+
/**
|
|
393
|
+
* The Dokploy registry the stage's images are pulled through. Kept per
|
|
394
|
+
* stage rather than once per machine, so a stage keeps the registry it was
|
|
395
|
+
* deployed with whoever deploys it next.
|
|
396
|
+
*/
|
|
397
|
+
registryId?: string;
|
|
398
|
+
}
|
|
399
|
+
/** A stage's state, whichever target wrote it. */
|
|
400
|
+
type StageState = DokployStageState | ComposeStageState;
|
|
401
|
+
/** An image a stage runs: the ref it was pushed as, and what it resolved to. */
|
|
402
|
+
interface DeployedImage {
|
|
403
|
+
ref: string;
|
|
404
|
+
/**
|
|
405
|
+
* The tag it was released under — a site's carries its stage
|
|
406
|
+
* (`v1.4.0-production`). Recorded by targets that pull a release by tag.
|
|
407
|
+
*/
|
|
408
|
+
tag?: string;
|
|
409
|
+
/** The registry's digest, `sha256:…` — absent if it could not be read. */
|
|
410
|
+
digest?: string;
|
|
411
|
+
}
|
|
412
|
+
/** An image that went live, and when. */
|
|
413
|
+
interface ReleasedImage extends DeployedImage {
|
|
414
|
+
/** The image tag the deploy released under. */
|
|
415
|
+
tag?: string;
|
|
416
|
+
releasedAt: string;
|
|
417
|
+
/** Who released it — absent on a release recorded before it was kept. */
|
|
418
|
+
releasedBy?: Actor;
|
|
419
|
+
/** Set when a rollback replaced it: it is never rolled back *to*. */
|
|
420
|
+
rolledBack?: true;
|
|
421
|
+
}
|
|
422
|
+
/** An app's releases: what runs, what ran before it, and what ran before that. */
|
|
423
|
+
interface AppReleases {
|
|
424
|
+
current: ReleasedImage;
|
|
425
|
+
/** What a rollback restores; absent until a second release. */
|
|
426
|
+
previous?: ReleasedImage;
|
|
427
|
+
/** Every release, newest first, at most {@link RELEASE_HISTORY} of them. */
|
|
428
|
+
history: ReleasedImage[];
|
|
429
|
+
}
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region src/deploy/StateStore.d.ts
|
|
432
|
+
/** Opaque: a file hash, an SSM parameter version or an S3 ETag. */
|
|
433
|
+
type StateVersion = string;
|
|
434
|
+
/**
|
|
435
|
+
* `pending` is written before the call that creates the resource, `ready`
|
|
436
|
+
* once the target has returned its id. A run that finds a `pending` record
|
|
437
|
+
* knows a previous run may have created the resource and should look for it
|
|
438
|
+
* before creating another.
|
|
439
|
+
*/
|
|
440
|
+
type ResourceStatus = 'pending' | 'ready';
|
|
441
|
+
interface ResourceRecord {
|
|
442
|
+
/** Unique within the stage, `<type>:<name>` — e.g. `application:api`. */
|
|
443
|
+
key: string;
|
|
444
|
+
/** What kind of resource it is — e.g. `application`, `postgres`. */
|
|
445
|
+
type: string;
|
|
446
|
+
/** The id the target gave it. Absent while `pending`. */
|
|
447
|
+
id?: string;
|
|
448
|
+
status: ResourceStatus;
|
|
449
|
+
/** Whatever the target needs to adopt the resource on a later run. */
|
|
450
|
+
data?: Record<string, unknown>;
|
|
451
|
+
updatedAt: string;
|
|
452
|
+
/** Who wrote the record — absent on one written before it was kept. */
|
|
453
|
+
updatedBy?: Actor;
|
|
454
|
+
}
|
|
455
|
+
/** A resource as a caller hands it to `putResource`; the store stamps it. */
|
|
456
|
+
type ResourceInput = Omit<ResourceRecord, 'updatedAt' | 'updatedBy'>;
|
|
457
|
+
/** One write of a stage's state: which, when, by whom, doing what. */
|
|
458
|
+
interface HistoryEntry {
|
|
459
|
+
serial: number;
|
|
460
|
+
at: string;
|
|
461
|
+
by: Actor;
|
|
462
|
+
/** The lock's operation — `deploy`, `rollback`, `setup`, `state:push` … */
|
|
463
|
+
operation: string;
|
|
464
|
+
}
|
|
465
|
+
interface StoredStageState {
|
|
466
|
+
state: StageState;
|
|
467
|
+
resources: Record<string, ResourceRecord>;
|
|
468
|
+
/** The latest writes, newest first. */
|
|
469
|
+
history: HistoryEntry[];
|
|
470
|
+
/** Pass back as `expectedVersion` to write on top of exactly this read. */
|
|
471
|
+
version: StateVersion;
|
|
472
|
+
}
|
|
473
|
+
interface WriteOptions {
|
|
474
|
+
/**
|
|
475
|
+
* The version this write is based on — `null` to create state that must
|
|
476
|
+
* not exist yet.
|
|
477
|
+
*/
|
|
478
|
+
expectedVersion: StateVersion | null;
|
|
479
|
+
}
|
|
480
|
+
interface ResourceWriteOptions {
|
|
481
|
+
/**
|
|
482
|
+
* Omitted, the record is applied on top of whatever is stored now (still
|
|
483
|
+
* conditionally, so a concurrent write raises rather than being lost).
|
|
484
|
+
*/
|
|
485
|
+
expectedVersion?: StateVersion;
|
|
486
|
+
}
|
|
487
|
+
interface LockHolder {
|
|
488
|
+
/** Unique per acquisition, so a release never removes someone else's lock. */
|
|
489
|
+
id: string;
|
|
490
|
+
owner: string;
|
|
491
|
+
host: string;
|
|
492
|
+
pid: number;
|
|
493
|
+
acquiredAt: string;
|
|
494
|
+
/** What the holder is doing, e.g. `deploy`. */
|
|
495
|
+
operation?: string;
|
|
496
|
+
}
|
|
497
|
+
interface LockOptions {
|
|
498
|
+
operation?: string;
|
|
499
|
+
}
|
|
500
|
+
interface StateLock {
|
|
501
|
+
readonly stage: string;
|
|
502
|
+
readonly holder: LockHolder;
|
|
503
|
+
/** Removes the lock if it is still this one; safe to call twice. */
|
|
504
|
+
release(): Promise<void>;
|
|
505
|
+
}
|
|
506
|
+
interface StateStore {
|
|
507
|
+
/** Takes the stage's lock, or raises `StateLocked` naming its holder. */
|
|
508
|
+
lock(stage: string, options?: LockOptions): Promise<StateLock>;
|
|
509
|
+
/**
|
|
510
|
+
* Removes the stage's lock whoever holds it, for a run that crashed with
|
|
511
|
+
* it held. Returns the holder it removed, or `null` if there was none.
|
|
512
|
+
*/
|
|
513
|
+
forceUnlock(stage: string): Promise<LockHolder | null>;
|
|
514
|
+
read(stage: string): Promise<StoredStageState | null>;
|
|
515
|
+
/** Replaces the stage's state, keeping its resource records. */
|
|
516
|
+
write(stage: string, state: StageState, options: WriteOptions): Promise<StateVersion>;
|
|
517
|
+
putResource(stage: string, record: ResourceInput, options?: ResourceWriteOptions): Promise<StateVersion>;
|
|
518
|
+
deleteResource(stage: string, key: string, options?: ResourceWriteOptions): Promise<StateVersion>;
|
|
519
|
+
/**
|
|
520
|
+
* How big the stage's document is as this store would write it, against
|
|
521
|
+
* the most it can hold — for a store with a limit (SSM). `null` when the
|
|
522
|
+
* stage has no state yet.
|
|
523
|
+
*/
|
|
524
|
+
capacity?(stage: string): Promise<StateCapacity | null>;
|
|
525
|
+
}
|
|
526
|
+
/** A stored document's size against the store's limit, in bytes. */
|
|
527
|
+
interface StateCapacity {
|
|
528
|
+
bytes: number;
|
|
529
|
+
limit: number;
|
|
530
|
+
location: string;
|
|
531
|
+
/** The store's AWS region, for the message that suggests S3. */
|
|
532
|
+
region?: string;
|
|
533
|
+
}
|
|
534
|
+
declare class StateLocked extends GkmError {
|
|
535
|
+
readonly stage: string;
|
|
536
|
+
readonly holder: LockHolder | null;
|
|
537
|
+
readonly location: string;
|
|
538
|
+
constructor(stage: string, holder: LockHolder | null, location: string);
|
|
539
|
+
}
|
|
540
|
+
declare class StateVersionConflict extends GkmError {
|
|
541
|
+
readonly stage: string;
|
|
542
|
+
readonly expectedVersion: StateVersion | null;
|
|
543
|
+
readonly actualVersion: StateVersion | null;
|
|
544
|
+
constructor(stage: string, expectedVersion: StateVersion | null, actualVersion: StateVersion | null);
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* A deploy, setup or rollback of a stage in CI, with the stage's state kept on
|
|
548
|
+
* the runner — which is discarded when the job ends.
|
|
549
|
+
*/
|
|
550
|
+
declare class LocalStateInCi extends GkmError {
|
|
551
|
+
readonly stage: string;
|
|
552
|
+
readonly operation: string;
|
|
553
|
+
readonly region: string;
|
|
554
|
+
constructor(stage: string, operation: string, region: string);
|
|
167
555
|
}
|
|
168
556
|
//#endregion
|
|
169
557
|
//#region src/deploy/StateProvider.d.ts
|
|
@@ -181,14 +569,14 @@ interface StateProvider {
|
|
|
181
569
|
* @param stage - The deployment stage (e.g., 'development', 'production')
|
|
182
570
|
* @returns The state object or null if not found
|
|
183
571
|
*/
|
|
184
|
-
read(stage: string): Promise<
|
|
572
|
+
read(stage: string): Promise<StageState | null>;
|
|
185
573
|
/**
|
|
186
574
|
* Write deployment state for a stage.
|
|
187
575
|
*
|
|
188
576
|
* @param stage - The deployment stage
|
|
189
577
|
* @param state - The state object to persist
|
|
190
578
|
*/
|
|
191
|
-
write(stage: string, state:
|
|
579
|
+
write(stage: string, state: StageState): Promise<void>;
|
|
192
580
|
}
|
|
193
581
|
/**
|
|
194
582
|
* Valid AWS regions.
|
|
@@ -210,17 +598,929 @@ interface SSMStateConfig {
|
|
|
210
598
|
/** AWS profile name (optional - uses default credential chain if not provided) */
|
|
211
599
|
profile?: string;
|
|
212
600
|
}
|
|
601
|
+
/**
|
|
602
|
+
* S3 state config: one object per stage, written with conditional puts
|
|
603
|
+
* (`If-Match` / `If-None-Match`), and a lock object beside it.
|
|
604
|
+
*
|
|
605
|
+
* Keys: `<prefix>/<workspace name>/<stage>/state.json` and `lock.json`.
|
|
606
|
+
*/
|
|
607
|
+
interface S3StateConfig {
|
|
608
|
+
provider: 's3';
|
|
609
|
+
/**
|
|
610
|
+
* Bucket the state lives in; it must already exist. Omitted, the project
|
|
611
|
+
* bucket — `gkm-<project>-<account id>`, created by the first deploy.
|
|
612
|
+
*/
|
|
613
|
+
bucket?: string;
|
|
614
|
+
/** AWS region of the bucket */
|
|
615
|
+
region: AwsRegion;
|
|
616
|
+
/** Key prefix inside the bucket (default: `gkm`) */
|
|
617
|
+
prefix?: string;
|
|
618
|
+
/** AWS profile name (optional - uses default credential chain if not provided) */
|
|
619
|
+
profile?: string;
|
|
620
|
+
}
|
|
213
621
|
/**
|
|
214
622
|
* Custom state provider config.
|
|
215
623
|
*/
|
|
216
624
|
interface CustomStateConfig {
|
|
217
|
-
/**
|
|
218
|
-
|
|
625
|
+
/**
|
|
626
|
+
* Custom implementation. A `StateStore` is used as is; a `StateProvider`
|
|
627
|
+
* still works, but cannot lock — deploy warns `StateStoreWithoutLocking`.
|
|
628
|
+
*/
|
|
629
|
+
provider: StateProvider | StateStore;
|
|
219
630
|
}
|
|
220
631
|
/**
|
|
221
632
|
* State configuration types.
|
|
222
633
|
*/
|
|
223
|
-
type StateConfig = LocalStateConfig | SSMStateConfig | CustomStateConfig;
|
|
634
|
+
type StateConfig = LocalStateConfig | SSMStateConfig | S3StateConfig | CustomStateConfig;
|
|
635
|
+
//#endregion
|
|
636
|
+
//#region src/reconcile/discover.d.ts
|
|
637
|
+
/** The construct face discovery needs: an id, and the ability to declare. */
|
|
638
|
+
interface Declarable {
|
|
639
|
+
id: string;
|
|
640
|
+
declare(): Declaration[];
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Whether a module export is a construct.
|
|
644
|
+
*
|
|
645
|
+
* Deliberately loose about what else it carries — a construct that also has a
|
|
646
|
+
* `service` is still a construct, and requiring one would exclude the kinds that
|
|
647
|
+
* own no address.
|
|
648
|
+
*/
|
|
649
|
+
declare function isDeclarable(value: unknown): value is Declarable;
|
|
650
|
+
interface DiscoverOptions {
|
|
651
|
+
/** The glob(s) to search. One pattern, not one per kind. */
|
|
652
|
+
patterns: string | readonly string[];
|
|
653
|
+
cwd?: string;
|
|
654
|
+
/**
|
|
655
|
+
* Re-import changed modules, for the dev watcher.
|
|
656
|
+
*
|
|
657
|
+
* A single glob makes discovery more central, not less: a new construct file
|
|
658
|
+
* has to be picked up on `add`, not only on `change`.
|
|
659
|
+
*/
|
|
660
|
+
bustCache?: boolean;
|
|
661
|
+
/**
|
|
662
|
+
* Filled in with where each construct was found, when provided.
|
|
663
|
+
*
|
|
664
|
+
* Discovery is the only thing that knows: it globbed the files and imported
|
|
665
|
+
* them. Everything downstream that needs to *write* an import — the build,
|
|
666
|
+
* generating a server entry that reads a surface's logger — would otherwise
|
|
667
|
+
* have to be told the path in config, which is the string this removes.
|
|
668
|
+
*
|
|
669
|
+
* An out-parameter rather than a second return value so that every existing
|
|
670
|
+
* caller, which wants the manifest and nothing else, is unchanged.
|
|
671
|
+
*/
|
|
672
|
+
sources?: Record<string, ConstructSource>;
|
|
673
|
+
/**
|
|
674
|
+
* Filled in, when provided, with the files each worker's background work is
|
|
675
|
+
* declared in — its crons, queue consumers and topic subscribers — keyed by
|
|
676
|
+
* the worker.
|
|
677
|
+
*
|
|
678
|
+
* What says which app's build carries a worker's entry: the one whose
|
|
679
|
+
* directory holds its work. A worker declares no path of its own.
|
|
680
|
+
*/
|
|
681
|
+
background?: Record<string, string[]>;
|
|
682
|
+
/**
|
|
683
|
+
* Filled in, when provided, with the files that export something built
|
|
684
|
+
* from each surface — an endpoint, a WebSocket route — keyed by the
|
|
685
|
+
* surface. What a surface that serves itself imports its routes from.
|
|
686
|
+
*/
|
|
687
|
+
served?: Record<string, string[]>;
|
|
688
|
+
/**
|
|
689
|
+
* Filled in, when provided, with each worker's subscribers — by the export
|
|
690
|
+
* a push route is named after, and the key its deliveries come from: its
|
|
691
|
+
* topic's, or its bucket's events — keyed by the worker.
|
|
692
|
+
*
|
|
693
|
+
* What says which worker SNS pushes to, and on which paths: a build bound
|
|
694
|
+
* for a server records no subscriber in the manifest, because none has a
|
|
695
|
+
* handler of its own there.
|
|
696
|
+
*/
|
|
697
|
+
subscribers?: Record<string, BoundSubscriber[]>;
|
|
698
|
+
/**
|
|
699
|
+
* Import the construct modules in this sandbox rather than in this
|
|
700
|
+
* process. Defaults to the run's own (`withSandbox`), so a deploy's every
|
|
701
|
+
* discovery — the engine's included — happens there; with neither, they
|
|
702
|
+
* are imported here, as before.
|
|
703
|
+
*/
|
|
704
|
+
sandbox?: Sandbox;
|
|
705
|
+
}
|
|
706
|
+
/** A worker's subscriber — to a topic or to a bucket — as discovery found it. */
|
|
707
|
+
interface BoundSubscriber {
|
|
708
|
+
/** Its export — what its push route is named after. */
|
|
709
|
+
name: string;
|
|
710
|
+
/**
|
|
711
|
+
* The env key its deliveries come from: its topic's publisher connection
|
|
712
|
+
* string, or its bucket's events connection string. An `sns://` value is
|
|
713
|
+
* what makes SNS push to it.
|
|
714
|
+
*/
|
|
715
|
+
connectionKey: string;
|
|
716
|
+
/**
|
|
717
|
+
* The event types a topic subscriber names — its SNS subscription's filter
|
|
718
|
+
* on the `type` attribute the topic's publisher sets. Absent for a
|
|
719
|
+
* bucket's subscriber: S3 sets no such attribute, and the subscriber's own
|
|
720
|
+
* filter decides.
|
|
721
|
+
*/
|
|
722
|
+
events?: readonly string[];
|
|
723
|
+
}
|
|
724
|
+
/** Importing a construct module, or declaring one, threw in the sandbox. */
|
|
725
|
+
declare class ConstructDiscoveryFailed extends Error {
|
|
726
|
+
readonly errorName: string;
|
|
727
|
+
readonly detail: string;
|
|
728
|
+
constructor(errorName: string, detail: string);
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* The constructs' declarations hold something that is not data, and the
|
|
732
|
+
* sandbox they were discovered in hands the deploy nothing but data.
|
|
733
|
+
*/
|
|
734
|
+
declare class ConstructsNotSerializable extends Error {
|
|
735
|
+
readonly paths: readonly string[];
|
|
736
|
+
constructor(paths: readonly string[]);
|
|
737
|
+
}
|
|
738
|
+
/** Where a construct was declared, and under what name. */
|
|
739
|
+
interface ConstructSource {
|
|
740
|
+
/** Absolute path to the module that exported it. */
|
|
741
|
+
file: string;
|
|
742
|
+
/** The name it was exported as — what an import statement has to say. */
|
|
743
|
+
exportName: string;
|
|
744
|
+
/**
|
|
745
|
+
* The exported construct itself.
|
|
746
|
+
*
|
|
747
|
+
* What a declaration cannot say — whether it serves itself — the object can
|
|
748
|
+
* be asked, and discovery already imported it.
|
|
749
|
+
*/
|
|
750
|
+
construct: unknown;
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Build the construct manifest for a project.
|
|
754
|
+
*
|
|
755
|
+
* Runs the manifest's own validation before returning, so an app is wrong here
|
|
756
|
+
* — where the error names a file — rather than at deploy.
|
|
757
|
+
*
|
|
758
|
+
* @throws {DuplicateConstruct} when two exports claim one id.
|
|
759
|
+
*/
|
|
760
|
+
declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
|
|
761
|
+
//#endregion
|
|
762
|
+
//#region src/providers/types.d.ts
|
|
763
|
+
/** The manifest kinds a stage can name a provider for. */
|
|
764
|
+
declare const PROVIDER_KINDS: readonly ['objects', 'inbox', 'email'];
|
|
765
|
+
type ProviderKind = (typeof PROVIDER_KINDS)[number];
|
|
766
|
+
//#endregion
|
|
767
|
+
//#region src/providers/ses/config.d.ts
|
|
768
|
+
/** `inbox: { provider: 'ses' }` — each inbox received by SES in the stage's account. */
|
|
769
|
+
interface SesInboxConfig {
|
|
770
|
+
provider: 'ses';
|
|
771
|
+
/**
|
|
772
|
+
* Where mail is received, and the inbox's bucket and topic live. Defaults
|
|
773
|
+
* to the secrets store's region, then `AWS_REGION` — and must be one SES
|
|
774
|
+
* receives mail in.
|
|
775
|
+
*/
|
|
776
|
+
region?: string;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* `email: { provider: 'ses' }` — each mail construct sends through SES's SMTP
|
|
780
|
+
* interface in the stage's account.
|
|
781
|
+
*/
|
|
782
|
+
interface SesEmailConfig {
|
|
783
|
+
provider: 'ses';
|
|
784
|
+
/**
|
|
785
|
+
* Where mail is sent from: the identity, and the SMTP endpoint the URL
|
|
786
|
+
* names. Defaults to the secrets store's region, then `AWS_REGION`.
|
|
787
|
+
*/
|
|
788
|
+
region?: string;
|
|
789
|
+
/**
|
|
790
|
+
* The address mail is sent from — what `<ID>_FROM` holds. Its domain is
|
|
791
|
+
* the SES identity the deploy verifies. Defaults to `noreply@` the
|
|
792
|
+
* stage's domain.
|
|
793
|
+
*/
|
|
794
|
+
from?: string;
|
|
795
|
+
}
|
|
796
|
+
//#endregion
|
|
797
|
+
//#region src/deploy/credentials.d.ts
|
|
798
|
+
/**
|
|
799
|
+
* What each kind of credential is asked for with, and what it is.
|
|
800
|
+
*
|
|
801
|
+
* A target that needs a kind the CLI does not know declares it by augmenting
|
|
802
|
+
* this interface, and lists it in its `credentials`:
|
|
803
|
+
*
|
|
804
|
+
* ```ts
|
|
805
|
+
* declare module '@geekmidas/cli/target' {
|
|
806
|
+
* interface CredentialKinds {
|
|
807
|
+
* fly: { request: { org: string }; value: { token: string } };
|
|
808
|
+
* }
|
|
809
|
+
* }
|
|
810
|
+
* ```
|
|
811
|
+
*/
|
|
812
|
+
interface CredentialKinds {
|
|
813
|
+
/** The Dokploy API a stage deploys through. */
|
|
814
|
+
dokploy: {
|
|
815
|
+
/** `deploy.dokploy.endpoint`, when the config names one. */
|
|
816
|
+
request: {
|
|
817
|
+
endpoint?: string;
|
|
818
|
+
};
|
|
819
|
+
value: {
|
|
820
|
+
endpoint: string;
|
|
821
|
+
token: string;
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
/**
|
|
825
|
+
* A container registry login, for Dokploy to pull with. Asked for only when
|
|
826
|
+
* Dokploy has no registry for `deploy.registry` and one has to be
|
|
827
|
+
* created.
|
|
828
|
+
*/
|
|
829
|
+
registry: {
|
|
830
|
+
/** `deploy.registry`. */
|
|
831
|
+
request: {
|
|
832
|
+
url: string;
|
|
833
|
+
};
|
|
834
|
+
value: {
|
|
835
|
+
username: string;
|
|
836
|
+
password: string;
|
|
837
|
+
};
|
|
838
|
+
};
|
|
839
|
+
/**
|
|
840
|
+
* The AWS account a stage deploys to, for the SST target's `sst deploy`.
|
|
841
|
+
* Handed to that one command's environment and to nothing else.
|
|
842
|
+
*/
|
|
843
|
+
aws: {
|
|
844
|
+
/** The stage, for a provider that keeps one account per stage. */
|
|
845
|
+
request: {
|
|
846
|
+
stage: string;
|
|
847
|
+
};
|
|
848
|
+
value: AwsCredential;
|
|
849
|
+
};
|
|
850
|
+
/**
|
|
851
|
+
* A GoDaddy Personal Access Token, for a `dns` domain whose provider is
|
|
852
|
+
* `godaddy`. Read on the machine that writes the records — never the
|
|
853
|
+
* server's.
|
|
854
|
+
*/
|
|
855
|
+
godaddy: {
|
|
856
|
+
request: Record<never, never>;
|
|
857
|
+
value: GoDaddyCredential;
|
|
858
|
+
};
|
|
859
|
+
/**
|
|
860
|
+
* A Hostinger API token, for a `dns` domain whose provider is
|
|
861
|
+
* `hostinger`. Like GoDaddy's, read where the records are written.
|
|
862
|
+
*/
|
|
863
|
+
hostinger: {
|
|
864
|
+
request: Record<never, never>;
|
|
865
|
+
value: HostingerCredential;
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
/** A Hostinger API token, from hpanel.hostinger.com/profile/api. */
|
|
869
|
+
interface HostingerCredential {
|
|
870
|
+
token: string;
|
|
871
|
+
}
|
|
872
|
+
/** A GoDaddy Personal Access Token, sent as `Authorization: Bearer <token>`. */
|
|
873
|
+
interface GoDaddyCredential {
|
|
874
|
+
token: string;
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* Who to act as on AWS: a named profile, or keys.
|
|
878
|
+
*
|
|
879
|
+
* Never both. Given both, every AWS SDK takes the keys and ignores the
|
|
880
|
+
* profile, so `--profile prod` with staging's keys still exported would deploy
|
|
881
|
+
* production's stack into staging's account — the reason `secretsStoreFor`
|
|
882
|
+
* resolves a named profile on its own, and why this cannot express the mix.
|
|
883
|
+
*/
|
|
884
|
+
type AwsCredential = {
|
|
885
|
+
/** A profile in `~/.aws/config` — keys, SSO, an assumed role. */
|
|
886
|
+
profile: string;
|
|
887
|
+
region?: string;
|
|
888
|
+
} | {
|
|
889
|
+
accessKeyId: string;
|
|
890
|
+
secretAccessKey: string;
|
|
891
|
+
/** Present for temporary keys: an assumed role, GitHub's OIDC. */
|
|
892
|
+
sessionToken?: string;
|
|
893
|
+
region?: string;
|
|
894
|
+
};
|
|
895
|
+
type CredentialKind = keyof CredentialKinds;
|
|
896
|
+
/** What a deploy asks a provider for. */
|
|
897
|
+
type CredentialRequest<K extends CredentialKind = CredentialKind> = { [P in K]: {
|
|
898
|
+
kind: P;
|
|
899
|
+
} & CredentialKinds[P]['request']; }[K];
|
|
900
|
+
/** What a provider answers with. */
|
|
901
|
+
type Credential<K extends CredentialKind> = CredentialKinds[K]['value'];
|
|
902
|
+
interface CredentialProvider {
|
|
903
|
+
/**
|
|
904
|
+
* The credential `request` asks for, or `undefined` when this provider has
|
|
905
|
+
* none — the deploy then raises {@link MissingCredential}.
|
|
906
|
+
*/
|
|
907
|
+
get<K extends CredentialKind>(request: CredentialRequest<K>, options?: {
|
|
908
|
+
signal?: AbortSignal;
|
|
909
|
+
}): Promise<Credential<K> | undefined>;
|
|
910
|
+
}
|
|
911
|
+
/** A deploy needed a credential, and its provider had none. */
|
|
912
|
+
declare class MissingCredential extends GkmError {
|
|
913
|
+
readonly kind: CredentialKind;
|
|
914
|
+
/** What it was for: the Dokploy endpoint or the registry URL. */
|
|
915
|
+
readonly target: string | undefined;
|
|
916
|
+
/** How to supply it. */
|
|
917
|
+
readonly howToProvide: string;
|
|
918
|
+
constructor(kind: CredentialKind,
|
|
919
|
+
/** What it was for: the Dokploy endpoint or the registry URL. */
|
|
920
|
+
target: string | undefined,
|
|
921
|
+
/** How to supply it. */
|
|
922
|
+
howToProvide?: string);
|
|
923
|
+
}
|
|
924
|
+
/** Whatever was asked for, from the first provider that has it. */
|
|
925
|
+
declare function chainCredentials(...providers: CredentialProvider[]): CredentialProvider;
|
|
926
|
+
interface StoredCredentialsOptions {
|
|
927
|
+
/** Where to read the variables from. Defaults to `process.env`. */
|
|
928
|
+
env?: NodeJS.ProcessEnv;
|
|
929
|
+
/**
|
|
930
|
+
* The CLI's home, whose `credentials.json` holds stored logins. Defaults
|
|
931
|
+
* to `GKM_HOME`, else `~/.gkm`.
|
|
932
|
+
*/
|
|
933
|
+
home?: string;
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Credentials from the environment, then from what `gkm login` stored. What
|
|
937
|
+
* `deploy()` uses when it is handed no provider.
|
|
938
|
+
*
|
|
939
|
+
* - Dokploy: `DOKPLOY_API_TOKEN` / `DOKPLOY_ENDPOINT`, each falling back to
|
|
940
|
+
* the stored login, and the endpoint finally to `deploy.dokploy.endpoint`.
|
|
941
|
+
* Each half is read on its own: a token is a secret and belongs in the
|
|
942
|
+
* environment, an endpoint is configuration and belongs in the config.
|
|
943
|
+
* - Registry: `DOCKER_REGISTRY_USERNAME` / `DOCKER_REGISTRY_PASSWORD`.
|
|
944
|
+
* - AWS: `AWS_PROFILE` when it is set, and then nothing else; otherwise
|
|
945
|
+
* `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` / `AWS_SESSION_TOKEN`. The
|
|
946
|
+
* profile winning is `secretsStoreFor`'s rule: a profile is a choice of
|
|
947
|
+
* account someone made, exported keys may be left over from another.
|
|
948
|
+
* Read here, by name, and handed only to the command that deploys — the
|
|
949
|
+
* sandbox every other step runs in passes no `AWS_*` on.
|
|
950
|
+
*/
|
|
951
|
+
declare function storedCredentials(options?: StoredCredentialsOptions): CredentialProvider;
|
|
952
|
+
//#endregion
|
|
953
|
+
//#region src/deploy/types.d.ts
|
|
954
|
+
/** Result for a single app deployment in workspace mode */
|
|
955
|
+
interface AppDeployResult {
|
|
956
|
+
/** App name */
|
|
957
|
+
appName: string;
|
|
958
|
+
/** App type */
|
|
959
|
+
type: 'backend' | 'web' | 'mobile';
|
|
960
|
+
/** Whether deployment succeeded */
|
|
961
|
+
success: boolean;
|
|
962
|
+
/** Dokploy application ID */
|
|
963
|
+
applicationId?: string;
|
|
964
|
+
/** Docker image reference */
|
|
965
|
+
imageRef?: string;
|
|
966
|
+
/** The registry's digest for the image, `sha256:…`, once pushed */
|
|
967
|
+
digest?: string;
|
|
968
|
+
/** Deployment URL */
|
|
969
|
+
url?: string;
|
|
970
|
+
/** Error message if failed */
|
|
971
|
+
error?: string;
|
|
972
|
+
}
|
|
973
|
+
/** Result from workspace deployment */
|
|
974
|
+
interface WorkspaceDeployResult {
|
|
975
|
+
/** Results for each app */
|
|
976
|
+
apps: AppDeployResult[];
|
|
977
|
+
/** Dokploy project ID */
|
|
978
|
+
projectId: string;
|
|
979
|
+
/** Total number of successful deployments */
|
|
980
|
+
successCount: number;
|
|
981
|
+
/** Total number of failed deployments */
|
|
982
|
+
failedCount: number;
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* What a deploy did — or, for a dry run, would do. Plain JSON, so it can be
|
|
986
|
+
* written out as is (`gkm deploy --json` ends with it).
|
|
987
|
+
*/
|
|
988
|
+
interface DeployResult extends WorkspaceDeployResult {
|
|
989
|
+
stage: string;
|
|
990
|
+
/** `<namespace>/<project>`. */
|
|
991
|
+
identity: string;
|
|
992
|
+
/** The image tag every app was built with. */
|
|
993
|
+
tag: string;
|
|
994
|
+
/** Whether this was a dry run: nothing was created, built or pushed. */
|
|
995
|
+
dryRun: boolean;
|
|
996
|
+
/** Dokploy's environment for the stage; empty when a dry run would create it. */
|
|
997
|
+
environmentId: string;
|
|
998
|
+
/** Apps left out, and why — a mobile app, another deploy target. */
|
|
999
|
+
skipped: {
|
|
1000
|
+
app: string;
|
|
1001
|
+
reason: string;
|
|
1002
|
+
}[];
|
|
1003
|
+
/** Each deployed app's public URL. */
|
|
1004
|
+
urls: Record<string, string>;
|
|
1005
|
+
/**
|
|
1006
|
+
* Every resource the run touched, in order: what it applied, or for a dry
|
|
1007
|
+
* run, what it would.
|
|
1008
|
+
*/
|
|
1009
|
+
changes: ResourceChange[];
|
|
1010
|
+
}
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region src/deploy/events.d.ts
|
|
1013
|
+
/**
|
|
1014
|
+
* The stretch of a deploy an event belongs to.
|
|
1015
|
+
*
|
|
1016
|
+
* - `validate`: the config, the target, the stage, the apps, the lock, the
|
|
1017
|
+
* stage's secrets and what each app reads from its environment
|
|
1018
|
+
* - `plan`: a dry run's lookups — what would be created and what reused
|
|
1019
|
+
* - `provision`: what the apps run on — for Dokploy the project, environment
|
|
1020
|
+
* and registry — and the declared constructs
|
|
1021
|
+
* - `build`: each app's artifact, built without changing anything live
|
|
1022
|
+
* - `release`: the artifacts put live. Dokploy applies the stage's
|
|
1023
|
+
* migrations and runs its seeds, then builds and pushes each image here, beside its
|
|
1024
|
+
* application, because a site's build args are resolved per app — and
|
|
1025
|
+
* checks each backend before any site is released
|
|
1026
|
+
* - `verify`: what was released answers — for Dokploy, each site's DNS
|
|
1027
|
+
* records and health
|
|
1028
|
+
* - `rollback`: the previous release restored, after `release` or `verify`
|
|
1029
|
+
* failed, on a target that can
|
|
1030
|
+
*/
|
|
1031
|
+
type DeployPhase = 'validate' | 'plan' | 'provision' | 'build' | 'release' | 'verify' | 'rollback';
|
|
1032
|
+
/** An error, as an event carries it. */
|
|
1033
|
+
interface DeployEventError {
|
|
1034
|
+
/** The error's class name — `MissingCredential`, `StateLocked`. */
|
|
1035
|
+
name: string;
|
|
1036
|
+
message: string;
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* How a resource came to be used:
|
|
1040
|
+
* - `recorded`: the id the stage's state holds still resolves
|
|
1041
|
+
* - `resumed`: a run that died after creating it is picked up
|
|
1042
|
+
* - `found`: it existed and was looked up
|
|
1043
|
+
* - `created`: this run created it
|
|
1044
|
+
*/
|
|
1045
|
+
type ResourceVia = 'recorded' | 'resumed' | 'found' | 'created';
|
|
1046
|
+
/** One resource a deploy touches, planned or applied. */
|
|
1047
|
+
interface ResourceChange {
|
|
1048
|
+
/** `<type>:<name>`, unique within the stage — `application:api`. */
|
|
1049
|
+
key: string;
|
|
1050
|
+
/** `project`, `environment`, `registry`, `application`, `domain`, `image`, or a construct's kind. */
|
|
1051
|
+
resourceType: string;
|
|
1052
|
+
/**
|
|
1053
|
+
* For a plan: whether the run would create it, reuse what exists, or
|
|
1054
|
+
* ensure it (look it up, and create it if missing). For an applied change:
|
|
1055
|
+
* what was done.
|
|
1056
|
+
*/
|
|
1057
|
+
action: 'create' | 'reuse' | 'ensure' | 'build';
|
|
1058
|
+
/** The target's id, once there is one. */
|
|
1059
|
+
id?: string;
|
|
1060
|
+
}
|
|
1061
|
+
type DeployEvent = {
|
|
1062
|
+
type: 'deploy.started';
|
|
1063
|
+
stage: string;
|
|
1064
|
+
/** The target the run deploys through, by the name it was given. */
|
|
1065
|
+
target: string;
|
|
1066
|
+
/** `<namespace>/<project>`. */
|
|
1067
|
+
identity: string;
|
|
1068
|
+
tag: string;
|
|
1069
|
+
/** The apps this run deploys, in order. */
|
|
1070
|
+
apps: string[];
|
|
1071
|
+
dryRun: boolean;
|
|
1072
|
+
} | {
|
|
1073
|
+
type: 'phase.started';
|
|
1074
|
+
phase: DeployPhase;
|
|
1075
|
+
} | {
|
|
1076
|
+
type: 'phase.finished';
|
|
1077
|
+
phase: DeployPhase;
|
|
1078
|
+
} |
|
|
1079
|
+
/** A phase threw; `deploy.failed` follows (after a rollback, if any). */
|
|
1080
|
+
{
|
|
1081
|
+
type: 'phase.failed';
|
|
1082
|
+
phase: DeployPhase;
|
|
1083
|
+
error: DeployEventError;
|
|
1084
|
+
} |
|
|
1085
|
+
/**
|
|
1086
|
+
* A progress line, exactly as `gkm deploy` prints it — leading newline and
|
|
1087
|
+
* indentation included, so a terminal renderer prints `message` as is.
|
|
1088
|
+
*/
|
|
1089
|
+
{
|
|
1090
|
+
type: 'log';
|
|
1091
|
+
level: 'info' | 'warn' | 'error';
|
|
1092
|
+
message: string;
|
|
1093
|
+
} | {
|
|
1094
|
+
type: 'app.skipped';
|
|
1095
|
+
app: string;
|
|
1096
|
+
reason: string;
|
|
1097
|
+
} | ({
|
|
1098
|
+
type: 'resource.planned';
|
|
1099
|
+
} & ResourceChange) | ({
|
|
1100
|
+
type: 'resource.applied';
|
|
1101
|
+
via: ResourceVia;
|
|
1102
|
+
} & ResourceChange & {
|
|
1103
|
+
id: string;
|
|
1104
|
+
}) | {
|
|
1105
|
+
type: 'artifact.built';
|
|
1106
|
+
app: string;
|
|
1107
|
+
imageRef: string;
|
|
1108
|
+
/** The registry's digest, `sha256:…`, once pushed. */
|
|
1109
|
+
digest?: string;
|
|
1110
|
+
} | {
|
|
1111
|
+
type: 'app.deployed';
|
|
1112
|
+
app: string;
|
|
1113
|
+
applicationId: string;
|
|
1114
|
+
imageRef: string;
|
|
1115
|
+
url: string;
|
|
1116
|
+
} | {
|
|
1117
|
+
type: 'app.failed';
|
|
1118
|
+
app: string;
|
|
1119
|
+
error: DeployEventError;
|
|
1120
|
+
} |
|
|
1121
|
+
/** One check of whether a released app answers. */
|
|
1122
|
+
{
|
|
1123
|
+
type: 'health.checked';
|
|
1124
|
+
app: string;
|
|
1125
|
+
/** What was asked: a URL, or the target's own status check. */
|
|
1126
|
+
url: string;
|
|
1127
|
+
healthy: boolean;
|
|
1128
|
+
/** The HTTP status, when the check was a request. */
|
|
1129
|
+
status?: number;
|
|
1130
|
+
/** 1 for the first check of the app in this run. */
|
|
1131
|
+
attempt: number;
|
|
1132
|
+
} |
|
|
1133
|
+
/**
|
|
1134
|
+
* A deployed stage runs a dev service — `--allow-dev-services` — in place
|
|
1135
|
+
* of real mail or object storage: Mailpit delivers no mail, MinIO keeps
|
|
1136
|
+
* every object on one container's disk. A warning, every run.
|
|
1137
|
+
*/
|
|
1138
|
+
{
|
|
1139
|
+
type: 'dev-service.used';
|
|
1140
|
+
service: 'minio' | 'mailpit';
|
|
1141
|
+
stage: string;
|
|
1142
|
+
/** The constructs it stands in for. */
|
|
1143
|
+
constructs: string[];
|
|
1144
|
+
} |
|
|
1145
|
+
/**
|
|
1146
|
+
* The stack's log UI (`deploy.compose.logs`) is up and answering: where
|
|
1147
|
+
* it is and how it is reached — through an SSH tunnel to a loopback
|
|
1148
|
+
* port, or publicly on a host that allows only some addresses.
|
|
1149
|
+
*/
|
|
1150
|
+
{
|
|
1151
|
+
type: 'logs.ready';
|
|
1152
|
+
service: 'openobserve';
|
|
1153
|
+
access: 'tunnel' | 'public';
|
|
1154
|
+
/** Where a browser opens it: the tunnel's end, or its public host. */
|
|
1155
|
+
url: string;
|
|
1156
|
+
/** The loopback port it is published on, for a tunnel. */
|
|
1157
|
+
port?: number;
|
|
1158
|
+
/** The addresses a public host answers. */
|
|
1159
|
+
allow?: string[];
|
|
1160
|
+
email: string;
|
|
1161
|
+
} |
|
|
1162
|
+
/**
|
|
1163
|
+
* One construct's migrations applied by the deploy, before any app
|
|
1164
|
+
* started. Only for a construct that had one to apply.
|
|
1165
|
+
*/
|
|
1166
|
+
{
|
|
1167
|
+
type: 'migration.applied';
|
|
1168
|
+
/** The construct, by id: `Database`. */
|
|
1169
|
+
construct: string;
|
|
1170
|
+
/** Its folder: `db/database/migrations`. */
|
|
1171
|
+
folder: string;
|
|
1172
|
+
/** The migrations applied, in order. */
|
|
1173
|
+
applied: string[];
|
|
1174
|
+
} |
|
|
1175
|
+
/**
|
|
1176
|
+
* One construct's seeds run by the deploy — after its migrations, before
|
|
1177
|
+
* any app started, every one of them on every deploy. Only for a
|
|
1178
|
+
* construct that has seeds.
|
|
1179
|
+
*/
|
|
1180
|
+
{
|
|
1181
|
+
type: 'seed.ran';
|
|
1182
|
+
/** The construct, by id: `Database`. */
|
|
1183
|
+
construct: string;
|
|
1184
|
+
/** Its folder: `db/database/seeds`. */
|
|
1185
|
+
folder: string;
|
|
1186
|
+
/** The seeds run, in order. */
|
|
1187
|
+
seeded: string[];
|
|
1188
|
+
} | {
|
|
1189
|
+
type: 'deploy.finished';
|
|
1190
|
+
result: DeployResult;
|
|
1191
|
+
} | {
|
|
1192
|
+
type: 'deploy.failed';
|
|
1193
|
+
error: DeployEventError;
|
|
1194
|
+
};
|
|
1195
|
+
/** Every `type` a deploy event can have. */
|
|
1196
|
+
type DeployEventType = DeployEvent['type'];
|
|
1197
|
+
//#endregion
|
|
1198
|
+
//#region src/target/types.d.ts
|
|
1199
|
+
/**
|
|
1200
|
+
* Which family of defaults a target's deploys belong to.
|
|
1201
|
+
*
|
|
1202
|
+
* - `server`: the target runs containers the project controls, so a cache can
|
|
1203
|
+
* live in the database and events go through pg-boss.
|
|
1204
|
+
* - `aws`: the target runs on managed AWS services, so the defaults are
|
|
1205
|
+
* Upstash, S3 and SNS/SQS.
|
|
1206
|
+
*
|
|
1207
|
+
* `gkm dev` and `gkm build` choose backends by it, which is why a target from
|
|
1208
|
+
* a package declares it in its `package.json` too: they read it without
|
|
1209
|
+
* importing the target.
|
|
1210
|
+
*/
|
|
1211
|
+
type DeployRuntime = 'server' | 'aws';
|
|
1212
|
+
/** What a target can do, beyond the phases every target has. */
|
|
1213
|
+
interface DeployTargetCapabilities {
|
|
1214
|
+
/**
|
|
1215
|
+
* Whether `rollback` restores the previous release. When it does, a failed
|
|
1216
|
+
* `release` or `verify` is rolled back before the deploy reports failure.
|
|
1217
|
+
*/
|
|
1218
|
+
rollback: boolean;
|
|
1219
|
+
/**
|
|
1220
|
+
* Who applies database migrations: the target, as part of `release`, or
|
|
1221
|
+
* the app itself when it starts.
|
|
1222
|
+
*/
|
|
1223
|
+
migrations: 'target' | 'app';
|
|
1224
|
+
/**
|
|
1225
|
+
* Whether the target builds container images — and so needs Docker where
|
|
1226
|
+
* the deploy runs, and a registry to push to.
|
|
1227
|
+
*/
|
|
1228
|
+
images: boolean;
|
|
1229
|
+
/**
|
|
1230
|
+
* Whether it can also run the project's local stage — `gkm deploy --stage
|
|
1231
|
+
* <local>`. Only a target that runs on this machine can: a stack started
|
|
1232
|
+
* here is the local stage's, while one on a server is shared, and the local
|
|
1233
|
+
* stage's secrets are a developer's. Absent, a deploy refuses the local
|
|
1234
|
+
* stage with `UndeclaredStage`.
|
|
1235
|
+
*/
|
|
1236
|
+
localStage?: boolean;
|
|
1237
|
+
/**
|
|
1238
|
+
* Whether it runs telemetry's self-hosted provider — OpenObserve beside
|
|
1239
|
+
* the apps — for a stage whose `deploy.telemetry` asks for it, or names
|
|
1240
|
+
* nothing. Absent, a stage that uses a `Telemetry` construct names a
|
|
1241
|
+
* provider of its own (`otlp`) or opts out with `false`.
|
|
1242
|
+
*/
|
|
1243
|
+
selfHostedTelemetry?: boolean;
|
|
1244
|
+
}
|
|
1245
|
+
/** A failed validation of a target's options, issue by issue. */
|
|
1246
|
+
interface TargetOptionsIssue {
|
|
1247
|
+
readonly message: string;
|
|
1248
|
+
readonly path?: ReadonlyArray<PropertyKey | {
|
|
1249
|
+
readonly key: PropertyKey;
|
|
1250
|
+
}>;
|
|
1251
|
+
}
|
|
1252
|
+
type TargetOptionsResult<Output> = {
|
|
1253
|
+
readonly value: Output;
|
|
1254
|
+
readonly issues?: undefined;
|
|
1255
|
+
} | {
|
|
1256
|
+
readonly issues: ReadonlyArray<TargetOptionsIssue>;
|
|
1257
|
+
};
|
|
1258
|
+
/**
|
|
1259
|
+
* The schema a target's options are validated with: any Standard Schema —
|
|
1260
|
+
* a Zod, Valibot or ArkType schema is one.
|
|
1261
|
+
*
|
|
1262
|
+
* The interface is the Standard Schema spec's own, copied as the spec asks,
|
|
1263
|
+
* so a target's types do not depend on a package the CLI does not ship.
|
|
1264
|
+
*/
|
|
1265
|
+
interface TargetOptionsSchema<Output = unknown> {
|
|
1266
|
+
readonly '~standard': {
|
|
1267
|
+
readonly version: 1;
|
|
1268
|
+
readonly vendor: string;
|
|
1269
|
+
readonly validate: (value: unknown) => TargetOptionsResult<Output> | Promise<TargetOptionsResult<Output>>;
|
|
1270
|
+
readonly types?: {
|
|
1271
|
+
readonly input: unknown;
|
|
1272
|
+
readonly output: Output;
|
|
1273
|
+
} | undefined;
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* The stage's secrets, as a target reads and writes them.
|
|
1278
|
+
*
|
|
1279
|
+
* Every secret value read through here is masked: a progress line that
|
|
1280
|
+
* would print one prints `***` instead, in the terminal and in the events.
|
|
1281
|
+
*/
|
|
1282
|
+
interface DeploySecrets {
|
|
1283
|
+
/** Which kind of store holds them — `'file'`, `'s3'`, `'ssm'`, `'secrets-manager'`, or
|
|
1284
|
+
* a custom one's. */
|
|
1285
|
+
readonly store: string;
|
|
1286
|
+
/** The stage's secrets, or null when it has none yet. */
|
|
1287
|
+
read(): Promise<StageSecrets | null>;
|
|
1288
|
+
/** Replace the stage's secrets. */
|
|
1289
|
+
write(secrets: StageSecrets): Promise<void>;
|
|
1290
|
+
/** Mask `value` in everything this run prints or emits from now on. */
|
|
1291
|
+
mask(value: string): void;
|
|
1292
|
+
}
|
|
1293
|
+
/** Where a target's progress lines go: `log` events of the run. */
|
|
1294
|
+
interface DeployTargetLogger {
|
|
1295
|
+
info(message: string): void;
|
|
1296
|
+
warn(message: string): void;
|
|
1297
|
+
error(message: string): void;
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* The events a target reports. The run's own — `deploy.*` and `phase.*` —
|
|
1301
|
+
* are the CLI's, which emits them around each phase it calls.
|
|
1302
|
+
*/
|
|
1303
|
+
type TargetEvent = Exclude<DeployEvent, {
|
|
1304
|
+
type: 'deploy.started' | 'deploy.finished' | 'deploy.failed' | 'phase.started' | 'phase.finished' | 'phase.failed';
|
|
1305
|
+
}>;
|
|
1306
|
+
/** Everything a phase is handed. The same object for every phase of a run. */
|
|
1307
|
+
interface DeployPhaseContext<Options = undefined> {
|
|
1308
|
+
/** The name the target was resolved by — `deploy.default`, `--target`. */
|
|
1309
|
+
readonly target: string;
|
|
1310
|
+
/**
|
|
1311
|
+
* The workspace root. Never `process.cwd()`: a host deploys projects
|
|
1312
|
+
* that are not where it runs.
|
|
1313
|
+
*/
|
|
1314
|
+
readonly cwd: string;
|
|
1315
|
+
readonly stage: string;
|
|
1316
|
+
/** The image tag, or whatever version label the target releases under. */
|
|
1317
|
+
readonly tag: string;
|
|
1318
|
+
/**
|
|
1319
|
+
* Whether `tag` was asked for (`--tag`) rather than made up for this run
|
|
1320
|
+
* — by the target's own `tag()`, else `<stage>-<timestamp>`. A target that
|
|
1321
|
+
* releases what CI already pushed when given one tells the two apart here.
|
|
1322
|
+
*/
|
|
1323
|
+
readonly tagGiven: boolean;
|
|
1324
|
+
/**
|
|
1325
|
+
* The apps this target deploys, in dependency order: those asked for that
|
|
1326
|
+
* deploy here. Apps that deploy elsewhere are already in `skipped`.
|
|
1327
|
+
*/
|
|
1328
|
+
readonly apps: readonly string[];
|
|
1329
|
+
/** The apps the run leaves out, and why. */
|
|
1330
|
+
readonly skipped: readonly {
|
|
1331
|
+
app: string;
|
|
1332
|
+
reason: string;
|
|
1333
|
+
}[];
|
|
1334
|
+
/** Who the deploy is, for naming and claiming what it creates. */
|
|
1335
|
+
readonly identity: DeployIdentity;
|
|
1336
|
+
/** The workspace, with its apps derived from the manifest. */
|
|
1337
|
+
readonly workspace: NormalizedWorkspace;
|
|
1338
|
+
/** What the workspace declares. */
|
|
1339
|
+
readonly manifest: ConstructManifest;
|
|
1340
|
+
/**
|
|
1341
|
+
* Where each Worker's crons, queues and subscribers are declared, from the
|
|
1342
|
+
* same discovery: which workers have work to run, and which app each is
|
|
1343
|
+
* built from (`workerUnits`).
|
|
1344
|
+
*/
|
|
1345
|
+
readonly background?: Readonly<Record<string, readonly string[]>>;
|
|
1346
|
+
/**
|
|
1347
|
+
* Each Worker's subscribers, from the same discovery — by export, and the
|
|
1348
|
+
* key its deliveries come from: which of them SNS pushes to.
|
|
1349
|
+
*/
|
|
1350
|
+
readonly subscribers?: Readonly<Record<string, readonly BoundSubscriber[]>>;
|
|
1351
|
+
/**
|
|
1352
|
+
* The DNS records the stage's providers asked for on this run, as
|
|
1353
|
+
* `dns-record` keys — set once they have run. A record a provider asked
|
|
1354
|
+
* for on an earlier deploy and not on this one is stale, and pruned with
|
|
1355
|
+
* the stack's. Unset when the providers did not run: then none of theirs
|
|
1356
|
+
* is pruned.
|
|
1357
|
+
*/
|
|
1358
|
+
providerDns?: readonly string[];
|
|
1359
|
+
/** The target's options, as its `options` schema parsed them. */
|
|
1360
|
+
readonly options: Options;
|
|
1361
|
+
/**
|
|
1362
|
+
* Look everything up and report what would happen — as `resource.planned`
|
|
1363
|
+
* events — without changing anything. Only `validate` and `plan` run.
|
|
1364
|
+
*/
|
|
1365
|
+
readonly dryRun: boolean;
|
|
1366
|
+
/**
|
|
1367
|
+
* When `release` or `verify` fails, roll back every app the run released
|
|
1368
|
+
* rather than only those that failed — for apps that must move together,
|
|
1369
|
+
* an API and the site built against it. Only a target that can roll back
|
|
1370
|
+
* reads it.
|
|
1371
|
+
*/
|
|
1372
|
+
readonly atomic: boolean;
|
|
1373
|
+
/**
|
|
1374
|
+
* `--allow-dev-services`: a deployed stage runs the dev service for every
|
|
1375
|
+
* bucket and mail it does not account for — no key in its secrets, no
|
|
1376
|
+
* provider backing the kind. Off by default: a deployed stage's mail and
|
|
1377
|
+
* buckets come from its secrets or its providers, and a server target
|
|
1378
|
+
* refuses one that lacks them. The local stage ignores it — it always
|
|
1379
|
+
* runs both.
|
|
1380
|
+
*/
|
|
1381
|
+
readonly allowDevServices: boolean;
|
|
1382
|
+
/**
|
|
1383
|
+
* `--skip-dns`: a server target neither writes its public hosts' DNS
|
|
1384
|
+
* records nor checks that they point at the stage's server — for a CDN or
|
|
1385
|
+
* proxy in front of it, or records written by another step.
|
|
1386
|
+
*/
|
|
1387
|
+
readonly skipDns?: boolean;
|
|
1388
|
+
/** Where every credential comes from. Nothing prompts. */
|
|
1389
|
+
readonly credentials: CredentialProvider;
|
|
1390
|
+
/**
|
|
1391
|
+
* The stage's deploy state. A real run holds the stage's lock for every
|
|
1392
|
+
* phase; a dry run holds none and must write nothing.
|
|
1393
|
+
*/
|
|
1394
|
+
readonly state: StateStore;
|
|
1395
|
+
readonly secrets: DeploySecrets;
|
|
1396
|
+
readonly logger: DeployTargetLogger;
|
|
1397
|
+
/** Fires when the run is stopped; every phase stops what it is doing. */
|
|
1398
|
+
readonly signal: AbortSignal;
|
|
1399
|
+
/**
|
|
1400
|
+
* Where the output of what a phase spawns goes: the host's terminal, its
|
|
1401
|
+
* stderr (so stdout carries only events), or nowhere.
|
|
1402
|
+
*/
|
|
1403
|
+
readonly childOutput: 'inherit' | 'stderr' | 'ignore';
|
|
1404
|
+
/** Report progress. */
|
|
1405
|
+
emit(event: TargetEvent): void;
|
|
1406
|
+
/** Leave an app out of this run, with the reason a person will read. */
|
|
1407
|
+
skip(app: string, reason: string): void;
|
|
1408
|
+
/**
|
|
1409
|
+
* What a resource is called on the target: scoped by the stage and the
|
|
1410
|
+
* identity exactly as the constructs are — `name('api')` is
|
|
1411
|
+
* `production-shop-api`. Two workspaces, or two stages, never share one.
|
|
1412
|
+
*/
|
|
1413
|
+
name(resource: string): string;
|
|
1414
|
+
}
|
|
1415
|
+
/** Why `rollback` was called: the phase that failed, and its error. */
|
|
1416
|
+
interface DeployFailure {
|
|
1417
|
+
readonly phase: 'release' | 'verify';
|
|
1418
|
+
readonly error: unknown;
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* A deploy target.
|
|
1422
|
+
*
|
|
1423
|
+
* The CLI calls the phases in order — `validate`, then `plan` for a dry run,
|
|
1424
|
+
* or `provision → build → release → verify` for a real one — emitting
|
|
1425
|
+
* `phase.started`/`phase.finished` around each. Every phase must be safe to
|
|
1426
|
+
* run again: a deploy stopped part way is finished by deploying again, so a
|
|
1427
|
+
* phase finds what an earlier run made (through `state`) before making it.
|
|
1428
|
+
*
|
|
1429
|
+
* `Run` is whatever the target carries from one phase to the next within a
|
|
1430
|
+
* run — `validate` makes it, every later phase is handed it.
|
|
1431
|
+
*
|
|
1432
|
+
* ```ts
|
|
1433
|
+
* import { defineTarget } from '@geekmidas/cli/target';
|
|
1434
|
+
* import { z } from 'zod';
|
|
1435
|
+
*
|
|
1436
|
+
* export default defineTarget({
|
|
1437
|
+
* name: 'fly',
|
|
1438
|
+
* runtime: 'server',
|
|
1439
|
+
* capabilities: { rollback: true, migrations: 'target', images: true },
|
|
1440
|
+
* options: z.object({ org: z.string(), region: z.string().default('ams') }),
|
|
1441
|
+
* async validate(ctx) {
|
|
1442
|
+
* return { org: ctx.options.org, region: ctx.options.region };
|
|
1443
|
+
* },
|
|
1444
|
+
* async plan(ctx, run) { … },
|
|
1445
|
+
* async release(ctx, run) { … },
|
|
1446
|
+
* async rollback(ctx, run, failure) { … },
|
|
1447
|
+
* result(ctx, run) { … },
|
|
1448
|
+
* });
|
|
1449
|
+
* ```
|
|
1450
|
+
*/
|
|
1451
|
+
interface DeployTarget<Options = undefined, Run = unknown> {
|
|
1452
|
+
/** The target's own name, for messages. Config refers to it by its key. */
|
|
1453
|
+
readonly name: string;
|
|
1454
|
+
readonly runtime: DeployRuntime;
|
|
1455
|
+
readonly capabilities: DeployTargetCapabilities;
|
|
1456
|
+
/**
|
|
1457
|
+
* What `deploy.targets` may pass it — `[package, options]` — validated
|
|
1458
|
+
* before any phase runs. Without one, the target takes no options.
|
|
1459
|
+
*/
|
|
1460
|
+
readonly options?: TargetOptionsSchema<Options>;
|
|
1461
|
+
/**
|
|
1462
|
+
* The kinds of credential it asks the run's `CredentialProvider` for, so a
|
|
1463
|
+
* host or `gkm login` can collect them up front.
|
|
1464
|
+
*/
|
|
1465
|
+
readonly credentials?: readonly CredentialKind[];
|
|
1466
|
+
/**
|
|
1467
|
+
* The tag a run releases under when none is asked for. Without one it is
|
|
1468
|
+
* `<stage>-<timestamp>`; a target that builds from the checkout can name
|
|
1469
|
+
* its images after the commit instead.
|
|
1470
|
+
*/
|
|
1471
|
+
tag?(where: {
|
|
1472
|
+
readonly cwd: string;
|
|
1473
|
+
readonly stage: string;
|
|
1474
|
+
}): Promise<string>;
|
|
1475
|
+
/**
|
|
1476
|
+
* What the run is — the apps, the images, what each runs with — checked
|
|
1477
|
+
* before anything changes. A build-only run calls it too, so it checks
|
|
1478
|
+
* what building needs; what only a deploy needs is `ready`'s.
|
|
1479
|
+
*/
|
|
1480
|
+
validate(ctx: DeployPhaseContext<Options>): Promise<Run>;
|
|
1481
|
+
/**
|
|
1482
|
+
* What only this target checks before a deploy changes anything — compose's
|
|
1483
|
+
* server address and its hosts' DNS. Run after `validate` and the stage's
|
|
1484
|
+
* own readiness check (every key it needs, after its providers wrote
|
|
1485
|
+
* theirs), on a deploy and its dry run. A build-only run never calls it:
|
|
1486
|
+
* an image needs none of it.
|
|
1487
|
+
*/
|
|
1488
|
+
ready?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
|
|
1489
|
+
/** A dry run: emit `resource.planned` for what a real run would do. */
|
|
1490
|
+
plan(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
|
|
1491
|
+
/** Create or find what the apps run on, and what they declare. */
|
|
1492
|
+
provision?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
|
|
1493
|
+
/** Build each app's artifact (`artifact.built`), changing nothing live. */
|
|
1494
|
+
build?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
|
|
1495
|
+
/** Put the built artifacts live (`app.deployed`). */
|
|
1496
|
+
release(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
|
|
1497
|
+
/** Check what was released answers (`health.checked`). */
|
|
1498
|
+
verify?(ctx: DeployPhaseContext<Options>, run: Run): Promise<void>;
|
|
1499
|
+
/**
|
|
1500
|
+
* Restore the previous release, after `release` or `verify` failed. Called
|
|
1501
|
+
* only when `capabilities.rollback` is true.
|
|
1502
|
+
*/
|
|
1503
|
+
rollback?(ctx: DeployPhaseContext<Options>, run: Run, failure: DeployFailure): Promise<void>;
|
|
1504
|
+
/** What the run did, once its last phase has finished. */
|
|
1505
|
+
result(ctx: DeployPhaseContext<Options>, run: Run): DeployResult | Promise<DeployResult>;
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* A target of any options and run state — what the CLI holds once a target
|
|
1509
|
+
* is resolved, its types left behind in the config that named it. The phases
|
|
1510
|
+
* are methods, so their parameters are compared bivariantly and every
|
|
1511
|
+
* `DeployTarget<O, R>` is one.
|
|
1512
|
+
*/
|
|
1513
|
+
type AnyDeployTarget = DeployTarget<unknown, unknown>;
|
|
1514
|
+
/** A target's options type, from the target. */
|
|
1515
|
+
type TargetOptions<T> = T extends DeployTarget<infer O, infer _Run> ? O : never;
|
|
1516
|
+
/**
|
|
1517
|
+
* One `deploy.targets` entry:
|
|
1518
|
+
*
|
|
1519
|
+
* - `'@acme/gkm-target'` — a package, its default export the target
|
|
1520
|
+
* - a target object, from `defineTarget` or a package's factory
|
|
1521
|
+
* - `['@acme/gkm-target', { region: 'ams' }]` — either, with options
|
|
1522
|
+
*/
|
|
1523
|
+
type DeployTargetEntry = string | AnyDeployTarget | readonly [string | AnyDeployTarget, unknown];
|
|
224
1524
|
declare namespace json_schema_d_exports {
|
|
225
1525
|
export { ArraySchema, BaseSchema, BooleanSchema, IntegerSchema, JSONSchema, NullSchema, NumberSchema, ObjectSchema, Schema$1 as Schema, SchemaType, StringSchema, _JSONSchema };
|
|
226
1526
|
}
|
|
@@ -4612,17 +5912,18 @@ declare const FrameworkSchema: ZodUnion<readonly [ZodEnum<{
|
|
|
4612
5912
|
*/
|
|
4613
5913
|
type Framework = output$1<typeof FrameworkSchema>;
|
|
4614
5914
|
/**
|
|
4615
|
-
*
|
|
5915
|
+
* The built-in targets a config may name, both deployed by `gkm deploy`:
|
|
5916
|
+
* `dokploy`, and `sst`, which runs `sst deploy` on the manifest `gkm build`
|
|
5917
|
+
* writes.
|
|
4616
5918
|
*/
|
|
4617
|
-
declare const SUPPORTED_DEPLOY_TARGETS:
|
|
5919
|
+
declare const SUPPORTED_DEPLOY_TARGETS: string[];
|
|
5920
|
+
/** Built-in names reserved for targets that do not exist yet. */
|
|
5921
|
+
declare const PHASE_2_DEPLOY_TARGETS: string[];
|
|
4618
5922
|
/**
|
|
4619
|
-
*
|
|
5923
|
+
* Whether a config may name `target`: a usable built-in, or one of its own
|
|
5924
|
+
* `deploy.targets`.
|
|
4620
5925
|
*/
|
|
4621
|
-
declare
|
|
4622
|
-
/**
|
|
4623
|
-
* Check if a deploy target is supported.
|
|
4624
|
-
*/
|
|
4625
|
-
declare function isDeployTargetSupported(target: string): boolean;
|
|
5926
|
+
declare function isDeployTargetSupported(target: string, targets?: Record<string, unknown>): boolean;
|
|
4626
5927
|
/**
|
|
4627
5928
|
* Check if a deploy target is planned for Phase 2.
|
|
4628
5929
|
*/
|
|
@@ -4632,13 +5933,21 @@ declare function isPhase2DeployTarget(target: string): boolean;
|
|
|
4632
5933
|
*/
|
|
4633
5934
|
declare function getDeployTargetError(target: string, appName?: string): string;
|
|
4634
5935
|
/**
|
|
4635
|
-
*
|
|
5936
|
+
* Single DNS provider config (for one domain).
|
|
4636
5937
|
*/
|
|
4637
|
-
declare const
|
|
5938
|
+
declare const DnsProviderSchema: ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
|
|
4638
5939
|
provider: ZodLiteral<"hostinger">;
|
|
5940
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
5941
|
+
mode: ZodLiteral<"cname">;
|
|
5942
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
5943
|
+
}, $strict>]>>;
|
|
4639
5944
|
ttl: ZodOptional<ZodNumber>;
|
|
4640
5945
|
}, $strip>, ZodObject<{
|
|
4641
5946
|
provider: ZodLiteral<"route53">;
|
|
5947
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
5948
|
+
mode: ZodLiteral<"cname">;
|
|
5949
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
5950
|
+
}, $strict>]>>;
|
|
4642
5951
|
region: ZodOptional<ZodEnum<{
|
|
4643
5952
|
"af-south-1": "af-south-1";
|
|
4644
5953
|
"ap-east-1": "ap-east-1";
|
|
@@ -4672,67 +5981,25 @@ declare const DnsConfigWithLegacySchema: ZodUnion<readonly [ZodRecord<ZodString,
|
|
|
4672
5981
|
hostedZoneId: ZodOptional<ZodString>;
|
|
4673
5982
|
ttl: ZodOptional<ZodNumber>;
|
|
4674
5983
|
}, $strip>, ZodObject<{
|
|
4675
|
-
provider: ZodLiteral<"
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
}, $
|
|
4680
|
-
provider: ZodCustom<{
|
|
4681
|
-
name: string;
|
|
4682
|
-
getRecords: Function;
|
|
4683
|
-
upsertRecords: Function;
|
|
4684
|
-
}, {
|
|
4685
|
-
name: string;
|
|
4686
|
-
getRecords: Function;
|
|
4687
|
-
upsertRecords: Function;
|
|
4688
|
-
}>;
|
|
4689
|
-
ttl: ZodOptional<ZodNumber>;
|
|
4690
|
-
}, $strip>]>>, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
|
|
4691
|
-
provider: ZodLiteral<"hostinger">;
|
|
4692
|
-
ttl: ZodOptional<ZodNumber>;
|
|
4693
|
-
domain: ZodString;
|
|
4694
|
-
}, $strip>, ZodObject<{
|
|
4695
|
-
provider: ZodLiteral<"route53">;
|
|
4696
|
-
region: ZodOptional<ZodEnum<{
|
|
4697
|
-
"af-south-1": "af-south-1";
|
|
4698
|
-
"ap-east-1": "ap-east-1";
|
|
4699
|
-
"ap-northeast-1": "ap-northeast-1";
|
|
4700
|
-
"ap-northeast-2": "ap-northeast-2";
|
|
4701
|
-
"ap-northeast-3": "ap-northeast-3";
|
|
4702
|
-
"ap-south-1": "ap-south-1";
|
|
4703
|
-
"ap-south-2": "ap-south-2";
|
|
4704
|
-
"ap-southeast-1": "ap-southeast-1";
|
|
4705
|
-
"ap-southeast-2": "ap-southeast-2";
|
|
4706
|
-
"ap-southeast-3": "ap-southeast-3";
|
|
4707
|
-
"ap-southeast-4": "ap-southeast-4";
|
|
4708
|
-
"ca-central-1": "ca-central-1";
|
|
4709
|
-
"eu-central-1": "eu-central-1";
|
|
4710
|
-
"eu-central-2": "eu-central-2";
|
|
4711
|
-
"eu-north-1": "eu-north-1";
|
|
4712
|
-
"eu-south-1": "eu-south-1";
|
|
4713
|
-
"eu-south-2": "eu-south-2";
|
|
4714
|
-
"eu-west-1": "eu-west-1";
|
|
4715
|
-
"eu-west-2": "eu-west-2";
|
|
4716
|
-
"eu-west-3": "eu-west-3";
|
|
4717
|
-
"me-central-1": "me-central-1";
|
|
4718
|
-
"me-south-1": "me-south-1";
|
|
4719
|
-
"sa-east-1": "sa-east-1";
|
|
4720
|
-
"us-east-1": "us-east-1";
|
|
4721
|
-
"us-east-2": "us-east-2";
|
|
4722
|
-
"us-west-1": "us-west-1";
|
|
4723
|
-
"us-west-2": "us-west-2";
|
|
4724
|
-
}>>;
|
|
4725
|
-
profile: ZodOptional<ZodString>;
|
|
4726
|
-
hostedZoneId: ZodOptional<ZodString>;
|
|
5984
|
+
provider: ZodLiteral<"godaddy">;
|
|
5985
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
5986
|
+
mode: ZodLiteral<"cname">;
|
|
5987
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
5988
|
+
}, $strict>]>>;
|
|
4727
5989
|
ttl: ZodOptional<ZodNumber>;
|
|
4728
|
-
domain: ZodString;
|
|
4729
5990
|
}, $strip>, ZodObject<{
|
|
4730
5991
|
provider: ZodLiteral<"cloudflare">;
|
|
5992
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
5993
|
+
mode: ZodLiteral<"cname">;
|
|
5994
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
5995
|
+
}, $strict>]>>;
|
|
4731
5996
|
ttl: ZodOptional<ZodNumber>;
|
|
4732
|
-
domain: ZodString;
|
|
4733
5997
|
}, $strip>, ZodObject<{
|
|
4734
5998
|
provider: ZodLiteral<"manual">;
|
|
4735
|
-
|
|
5999
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
6000
|
+
mode: ZodLiteral<"cname">;
|
|
6001
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
6002
|
+
}, $strict>]>>;
|
|
4736
6003
|
}, $strip>], "provider">, ZodObject<{
|
|
4737
6004
|
provider: ZodCustom<{
|
|
4738
6005
|
name: string;
|
|
@@ -4743,17 +6010,20 @@ declare const DnsConfigWithLegacySchema: ZodUnion<readonly [ZodRecord<ZodString,
|
|
|
4743
6010
|
getRecords: Function;
|
|
4744
6011
|
upsertRecords: Function;
|
|
4745
6012
|
}>;
|
|
6013
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
6014
|
+
mode: ZodLiteral<"cname">;
|
|
6015
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
6016
|
+
}, $strict>]>>;
|
|
4746
6017
|
ttl: ZodOptional<ZodNumber>;
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
type DnsConfig = output$1<typeof DnsConfigWithLegacySchema>;
|
|
6018
|
+
}, $strip>]>;
|
|
6019
|
+
type DnsProvider = output$1<typeof DnsProviderSchema>;
|
|
4750
6020
|
/**
|
|
4751
6021
|
* Backups configuration schema.
|
|
4752
6022
|
*
|
|
4753
6023
|
* Configures automatic backup destinations for database services.
|
|
4754
6024
|
* On first deploy, creates S3 bucket with unique name and IAM credentials.
|
|
4755
6025
|
*/
|
|
4756
|
-
declare const
|
|
6026
|
+
declare const DokployBackupsConfigSchema: ZodObject<{
|
|
4757
6027
|
type: ZodLiteral<"s3">;
|
|
4758
6028
|
profile: ZodOptional<ZodString>;
|
|
4759
6029
|
region: ZodEnum<{
|
|
@@ -4788,16 +6058,13 @@ declare const BackupsConfigSchema: ZodObject<{
|
|
|
4788
6058
|
schedule: ZodOptional<ZodString>;
|
|
4789
6059
|
retention: ZodOptional<ZodNumber>;
|
|
4790
6060
|
}, $strip>;
|
|
4791
|
-
type
|
|
6061
|
+
type DokployBackupsConfig = output$1<typeof DokployBackupsConfigSchema>;
|
|
4792
6062
|
/**
|
|
4793
6063
|
* Workspace configuration schema.
|
|
4794
6064
|
*/
|
|
4795
6065
|
declare const WorkspaceConfigSchema: ZodObject<{
|
|
4796
6066
|
name: ZodOptional<ZodString>;
|
|
4797
|
-
constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString
|
|
4798
|
-
paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
|
|
4799
|
-
partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
|
|
4800
|
-
}, $strip>]>>;
|
|
6067
|
+
constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
4801
6068
|
apps: ZodOptional<ZodRecord<ZodString, ZodObject<{
|
|
4802
6069
|
type: ZodDefault<ZodOptional<ZodEnum<{
|
|
4803
6070
|
backend: "backend";
|
|
@@ -4807,39 +6074,14 @@ declare const WorkspaceConfigSchema: ZodObject<{
|
|
|
4807
6074
|
path: ZodString;
|
|
4808
6075
|
port: ZodNumber;
|
|
4809
6076
|
dependencies: ZodOptional<ZodArray<ZodString>>;
|
|
4810
|
-
deploy: ZodOptional<
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
}, $strip>]>>;
|
|
4819
|
-
routes: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
|
|
4820
|
-
paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
|
|
4821
|
-
partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
|
|
4822
|
-
}, $strip>]>>;
|
|
4823
|
-
functions: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
|
|
4824
|
-
paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
|
|
4825
|
-
partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
|
|
4826
|
-
}, $strip>]>>;
|
|
4827
|
-
crons: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
|
|
4828
|
-
paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
|
|
4829
|
-
partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
|
|
4830
|
-
}, $strip>]>>;
|
|
4831
|
-
queues: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
|
|
4832
|
-
paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
|
|
4833
|
-
partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
|
|
4834
|
-
}, $strip>]>>;
|
|
4835
|
-
topics: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
|
|
4836
|
-
paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
|
|
4837
|
-
partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
|
|
4838
|
-
}, $strip>]>>;
|
|
4839
|
-
subscribers: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>, ZodObject<{
|
|
4840
|
-
paths: ZodUnion<readonly [ZodString, ZodArray<ZodString>]>;
|
|
4841
|
-
partition: ZodCustom<(filepath: string) => string, (filepath: string) => string>;
|
|
4842
|
-
}, $strip>]>>;
|
|
6077
|
+
deploy: ZodOptional<ZodString>;
|
|
6078
|
+
constructs: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
6079
|
+
routes: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
6080
|
+
functions: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
6081
|
+
crons: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
6082
|
+
queues: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
6083
|
+
topics: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
6084
|
+
subscribers: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
4843
6085
|
envParser: ZodOptional<ZodString>;
|
|
4844
6086
|
logger: ZodOptional<ZodString>;
|
|
4845
6087
|
hooks: ZodOptional<ZodObject<{
|
|
@@ -4854,11 +6096,6 @@ declare const WorkspaceConfigSchema: ZodObject<{
|
|
|
4854
6096
|
maxEntries: ZodOptional<ZodNumber>;
|
|
4855
6097
|
websocket: ZodOptional<ZodBoolean>;
|
|
4856
6098
|
}, $strip>]>>;
|
|
4857
|
-
studio: ZodOptional<ZodUnion<readonly [ZodString, ZodBoolean, ZodObject<{
|
|
4858
|
-
enabled: ZodOptional<ZodBoolean>;
|
|
4859
|
-
path: ZodOptional<ZodString>;
|
|
4860
|
-
schema: ZodOptional<ZodString>;
|
|
4861
|
-
}, $strip>]>>;
|
|
4862
6099
|
openapi: ZodOptional<ZodUnion<readonly [ZodBoolean, ZodObject<{
|
|
4863
6100
|
enabled: ZodOptional<ZodBoolean>;
|
|
4864
6101
|
title: ZodOptional<ZodString>;
|
|
@@ -4898,78 +6135,189 @@ declare const WorkspaceConfigSchema: ZodObject<{
|
|
|
4898
6135
|
}>>;
|
|
4899
6136
|
}, $strip>>;
|
|
4900
6137
|
}, $strip>>;
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
6138
|
+
domains: ZodOptional<ZodRecord<ZodString, ZodString>>;
|
|
6139
|
+
protectedSubdomains: ZodOptional<ZodArray<ZodString>>;
|
|
6140
|
+
dns: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
|
|
6141
|
+
provider: ZodLiteral<"hostinger">;
|
|
6142
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
6143
|
+
mode: ZodLiteral<"cname">;
|
|
6144
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
6145
|
+
}, $strict>]>>;
|
|
6146
|
+
ttl: ZodOptional<ZodNumber>;
|
|
6147
|
+
}, $strip>, ZodObject<{
|
|
6148
|
+
provider: ZodLiteral<"route53">;
|
|
6149
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
6150
|
+
mode: ZodLiteral<"cname">;
|
|
6151
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
6152
|
+
}, $strict>]>>;
|
|
6153
|
+
region: ZodOptional<ZodEnum<{
|
|
6154
|
+
"af-south-1": "af-south-1";
|
|
6155
|
+
"ap-east-1": "ap-east-1";
|
|
6156
|
+
"ap-northeast-1": "ap-northeast-1";
|
|
6157
|
+
"ap-northeast-2": "ap-northeast-2";
|
|
6158
|
+
"ap-northeast-3": "ap-northeast-3";
|
|
6159
|
+
"ap-south-1": "ap-south-1";
|
|
6160
|
+
"ap-south-2": "ap-south-2";
|
|
6161
|
+
"ap-southeast-1": "ap-southeast-1";
|
|
6162
|
+
"ap-southeast-2": "ap-southeast-2";
|
|
6163
|
+
"ap-southeast-3": "ap-southeast-3";
|
|
6164
|
+
"ap-southeast-4": "ap-southeast-4";
|
|
6165
|
+
"ca-central-1": "ca-central-1";
|
|
6166
|
+
"eu-central-1": "eu-central-1";
|
|
6167
|
+
"eu-central-2": "eu-central-2";
|
|
6168
|
+
"eu-north-1": "eu-north-1";
|
|
6169
|
+
"eu-south-1": "eu-south-1";
|
|
6170
|
+
"eu-south-2": "eu-south-2";
|
|
6171
|
+
"eu-west-1": "eu-west-1";
|
|
6172
|
+
"eu-west-2": "eu-west-2";
|
|
6173
|
+
"eu-west-3": "eu-west-3";
|
|
6174
|
+
"me-central-1": "me-central-1";
|
|
6175
|
+
"me-south-1": "me-south-1";
|
|
6176
|
+
"sa-east-1": "sa-east-1";
|
|
6177
|
+
"us-east-1": "us-east-1";
|
|
6178
|
+
"us-east-2": "us-east-2";
|
|
6179
|
+
"us-west-1": "us-west-1";
|
|
6180
|
+
"us-west-2": "us-west-2";
|
|
4906
6181
|
}>>;
|
|
6182
|
+
profile: ZodOptional<ZodString>;
|
|
6183
|
+
hostedZoneId: ZodOptional<ZodString>;
|
|
6184
|
+
ttl: ZodOptional<ZodNumber>;
|
|
6185
|
+
}, $strip>, ZodObject<{
|
|
6186
|
+
provider: ZodLiteral<"godaddy">;
|
|
6187
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
6188
|
+
mode: ZodLiteral<"cname">;
|
|
6189
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
6190
|
+
}, $strict>]>>;
|
|
6191
|
+
ttl: ZodOptional<ZodNumber>;
|
|
6192
|
+
}, $strip>, ZodObject<{
|
|
6193
|
+
provider: ZodLiteral<"cloudflare">;
|
|
6194
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
6195
|
+
mode: ZodLiteral<"cname">;
|
|
6196
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
6197
|
+
}, $strict>]>>;
|
|
6198
|
+
ttl: ZodOptional<ZodNumber>;
|
|
6199
|
+
}, $strip>, ZodObject<{
|
|
6200
|
+
provider: ZodLiteral<"manual">;
|
|
6201
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
6202
|
+
mode: ZodLiteral<"cname">;
|
|
6203
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
6204
|
+
}, $strict>]>>;
|
|
6205
|
+
}, $strip>], "provider">, ZodObject<{
|
|
6206
|
+
provider: ZodCustom<{
|
|
6207
|
+
name: string;
|
|
6208
|
+
getRecords: Function;
|
|
6209
|
+
upsertRecords: Function;
|
|
6210
|
+
}, {
|
|
6211
|
+
name: string;
|
|
6212
|
+
getRecords: Function;
|
|
6213
|
+
upsertRecords: Function;
|
|
6214
|
+
}>;
|
|
6215
|
+
records: ZodOptional<ZodUnion<readonly [ZodLiteral<"a">, ZodObject<{
|
|
6216
|
+
mode: ZodLiteral<"cname">;
|
|
6217
|
+
target: ZodUnion<readonly [ZodString, ZodRecord<ZodString, ZodString>]>;
|
|
6218
|
+
}, $strict>]>>;
|
|
6219
|
+
ttl: ZodOptional<ZodNumber>;
|
|
6220
|
+
}, $strip>]>>>;
|
|
6221
|
+
deploy: ZodOptional<ZodObject<{
|
|
6222
|
+
default: ZodOptional<ZodString>;
|
|
6223
|
+
targets: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodCustom<unknown, unknown>, ZodTuple<[ZodUnion<readonly [ZodString, ZodCustom<unknown, unknown>]>, ZodUnknown], null>]>>>;
|
|
6224
|
+
namespace: ZodOptional<ZodString>;
|
|
6225
|
+
registry: ZodOptional<ZodString>;
|
|
4907
6226
|
dokploy: ZodOptional<ZodObject<{
|
|
4908
6227
|
endpoint: ZodOptional<ZodURL>;
|
|
4909
6228
|
endpoints: ZodOptional<ZodRecord<ZodString, ZodURL>>;
|
|
4910
|
-
registry: ZodOptional<ZodString>;
|
|
4911
6229
|
registryId: ZodOptional<ZodString>;
|
|
4912
|
-
|
|
6230
|
+
backups: ZodOptional<ZodLazy<ZodObject<{
|
|
6231
|
+
type: ZodLiteral<"s3">;
|
|
6232
|
+
profile: ZodOptional<ZodString>;
|
|
6233
|
+
region: ZodEnum<{
|
|
6234
|
+
"af-south-1": "af-south-1";
|
|
6235
|
+
"ap-east-1": "ap-east-1";
|
|
6236
|
+
"ap-northeast-1": "ap-northeast-1";
|
|
6237
|
+
"ap-northeast-2": "ap-northeast-2";
|
|
6238
|
+
"ap-northeast-3": "ap-northeast-3";
|
|
6239
|
+
"ap-south-1": "ap-south-1";
|
|
6240
|
+
"ap-south-2": "ap-south-2";
|
|
6241
|
+
"ap-southeast-1": "ap-southeast-1";
|
|
6242
|
+
"ap-southeast-2": "ap-southeast-2";
|
|
6243
|
+
"ap-southeast-3": "ap-southeast-3";
|
|
6244
|
+
"ap-southeast-4": "ap-southeast-4";
|
|
6245
|
+
"ca-central-1": "ca-central-1";
|
|
6246
|
+
"eu-central-1": "eu-central-1";
|
|
6247
|
+
"eu-central-2": "eu-central-2";
|
|
6248
|
+
"eu-north-1": "eu-north-1";
|
|
6249
|
+
"eu-south-1": "eu-south-1";
|
|
6250
|
+
"eu-south-2": "eu-south-2";
|
|
6251
|
+
"eu-west-1": "eu-west-1";
|
|
6252
|
+
"eu-west-2": "eu-west-2";
|
|
6253
|
+
"eu-west-3": "eu-west-3";
|
|
6254
|
+
"me-central-1": "me-central-1";
|
|
6255
|
+
"me-south-1": "me-south-1";
|
|
6256
|
+
"sa-east-1": "sa-east-1";
|
|
6257
|
+
"us-east-1": "us-east-1";
|
|
6258
|
+
"us-east-2": "us-east-2";
|
|
6259
|
+
"us-west-1": "us-west-1";
|
|
6260
|
+
"us-west-2": "us-west-2";
|
|
6261
|
+
}>;
|
|
6262
|
+
schedule: ZodOptional<ZodString>;
|
|
6263
|
+
retention: ZodOptional<ZodNumber>;
|
|
6264
|
+
}, $strip>>>;
|
|
6265
|
+
verify: ZodOptional<ZodObject<{
|
|
6266
|
+
deploymentTimeoutMs: ZodOptional<ZodNumber>;
|
|
6267
|
+
healthCheckPath: ZodOptional<ZodString>;
|
|
6268
|
+
healthyAfter: ZodOptional<ZodNumber>;
|
|
6269
|
+
intervalMs: ZodOptional<ZodNumber>;
|
|
6270
|
+
healthTimeoutMs: ZodOptional<ZodNumber>;
|
|
6271
|
+
}, $strip>>;
|
|
4913
6272
|
}, $strip>>;
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
name: string;
|
|
4963
|
-
getRecords: Function;
|
|
4964
|
-
upsertRecords: Function;
|
|
4965
|
-
}>;
|
|
4966
|
-
ttl: ZodOptional<ZodNumber>;
|
|
4967
|
-
}, $strip>]>>, ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{
|
|
4968
|
-
provider: ZodLiteral<"hostinger">;
|
|
4969
|
-
ttl: ZodOptional<ZodNumber>;
|
|
4970
|
-
domain: ZodString;
|
|
4971
|
-
}, $strip>, ZodObject<{
|
|
4972
|
-
provider: ZodLiteral<"route53">;
|
|
6273
|
+
compose: ZodOptional<ZodObject<{
|
|
6274
|
+
proxy: ZodOptional<ZodUnion<readonly [ZodEnum<{
|
|
6275
|
+
caddy: "caddy";
|
|
6276
|
+
traefik: "traefik";
|
|
6277
|
+
}>, ZodRecord<ZodString, ZodEnum<{
|
|
6278
|
+
caddy: "caddy";
|
|
6279
|
+
traefik: "traefik";
|
|
6280
|
+
}>>]>>;
|
|
6281
|
+
tls: ZodOptional<ZodRecord<ZodString, ZodObject<{
|
|
6282
|
+
certFile: ZodString;
|
|
6283
|
+
keyFile: ZodString;
|
|
6284
|
+
caFile: ZodOptional<ZodString>;
|
|
6285
|
+
}, $strict>>>;
|
|
6286
|
+
server: ZodOptional<ZodRecord<ZodString, ZodObject<{
|
|
6287
|
+
user: ZodString;
|
|
6288
|
+
host: ZodOptional<ZodString>;
|
|
6289
|
+
port: ZodOptional<ZodNumber>;
|
|
6290
|
+
}, $strict>>>;
|
|
6291
|
+
}, $strict>>;
|
|
6292
|
+
telemetry: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodLiteral<false>, ZodLiteral<"self-hosted">, ZodObject<{
|
|
6293
|
+
provider: ZodLiteral<"self-hosted">;
|
|
6294
|
+
port: ZodOptional<ZodNumber>;
|
|
6295
|
+
retentionDays: ZodOptional<ZodNumber>;
|
|
6296
|
+
public: ZodOptional<ZodObject<{
|
|
6297
|
+
allow: ZodArray<ZodString>;
|
|
6298
|
+
}, $strip>>;
|
|
6299
|
+
sampleRate: ZodOptional<ZodNumber>;
|
|
6300
|
+
}, $strict>, ZodObject<{
|
|
6301
|
+
provider: ZodLiteral<"otlp">;
|
|
6302
|
+
endpoint: ZodString;
|
|
6303
|
+
headers: ZodOptional<ZodRecord<ZodString, ZodString>>;
|
|
6304
|
+
sampleRate: ZodOptional<ZodNumber>;
|
|
6305
|
+
}, $strict>]>>>;
|
|
6306
|
+
objects: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
|
|
6307
|
+
inbox: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
|
|
6308
|
+
email: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
|
|
6309
|
+
backups: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
|
|
6310
|
+
}, $strip>>;
|
|
6311
|
+
stages: ZodObject<{
|
|
6312
|
+
local: ZodString;
|
|
6313
|
+
deployed: ZodArray<ZodString>;
|
|
6314
|
+
protected: ZodOptional<ZodArray<ZodString>>;
|
|
6315
|
+
}, $strip>;
|
|
6316
|
+
secrets: ZodOptional<ZodObject<{
|
|
6317
|
+
enabled: ZodOptional<ZodBoolean>;
|
|
6318
|
+
store: ZodOptional<ZodUnion<readonly [ZodLiteral<"file">, ZodObject<{
|
|
6319
|
+
provider: ZodLiteral<"s3">;
|
|
6320
|
+
bucket: ZodOptional<ZodString>;
|
|
4973
6321
|
region: ZodOptional<ZodEnum<{
|
|
4974
6322
|
"af-south-1": "af-south-1";
|
|
4975
6323
|
"ap-east-1": "ap-east-1";
|
|
@@ -4999,33 +6347,9 @@ declare const WorkspaceConfigSchema: ZodObject<{
|
|
|
4999
6347
|
"us-west-1": "us-west-1";
|
|
5000
6348
|
"us-west-2": "us-west-2";
|
|
5001
6349
|
}>>;
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
domain: ZodString;
|
|
5006
|
-
}, $strip>, ZodObject<{
|
|
5007
|
-
provider: ZodLiteral<"cloudflare">;
|
|
5008
|
-
ttl: ZodOptional<ZodNumber>;
|
|
5009
|
-
domain: ZodString;
|
|
5010
|
-
}, $strip>, ZodObject<{
|
|
5011
|
-
provider: ZodLiteral<"manual">;
|
|
5012
|
-
domain: ZodString;
|
|
5013
|
-
}, $strip>], "provider">, ZodObject<{
|
|
5014
|
-
provider: ZodCustom<{
|
|
5015
|
-
name: string;
|
|
5016
|
-
getRecords: Function;
|
|
5017
|
-
upsertRecords: Function;
|
|
5018
|
-
}, {
|
|
5019
|
-
name: string;
|
|
5020
|
-
getRecords: Function;
|
|
5021
|
-
upsertRecords: Function;
|
|
5022
|
-
}>;
|
|
5023
|
-
ttl: ZodOptional<ZodNumber>;
|
|
5024
|
-
domain: ZodString;
|
|
5025
|
-
}, $strip>]>]>>;
|
|
5026
|
-
backups: ZodOptional<ZodObject<{
|
|
5027
|
-
type: ZodLiteral<"s3">;
|
|
5028
|
-
profile: ZodOptional<ZodString>;
|
|
6350
|
+
prefix: ZodOptional<ZodString>;
|
|
6351
|
+
}, $strict>, ZodObject<{
|
|
6352
|
+
provider: ZodLiteral<"ssm">;
|
|
5029
6353
|
region: ZodEnum<{
|
|
5030
6354
|
"af-south-1": "af-south-1";
|
|
5031
6355
|
"ap-east-1": "ap-east-1";
|
|
@@ -5055,19 +6379,8 @@ declare const WorkspaceConfigSchema: ZodObject<{
|
|
|
5055
6379
|
"us-west-1": "us-west-1";
|
|
5056
6380
|
"us-west-2": "us-west-2";
|
|
5057
6381
|
}>;
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
}, $strip>>;
|
|
5061
|
-
}, $strip>>;
|
|
5062
|
-
stages: ZodObject<{
|
|
5063
|
-
local: ZodString;
|
|
5064
|
-
deployed: ZodArray<ZodString>;
|
|
5065
|
-
protected: ZodOptional<ZodArray<ZodString>>;
|
|
5066
|
-
}, $strip>;
|
|
5067
|
-
secrets: ZodOptional<ZodObject<{
|
|
5068
|
-
enabled: ZodOptional<ZodBoolean>;
|
|
5069
|
-
store: ZodOptional<ZodUnion<readonly [ZodLiteral<"file">, ZodObject<{
|
|
5070
|
-
provider: ZodLiteral<"ssm">;
|
|
6382
|
+
}, $strict>, ZodObject<{
|
|
6383
|
+
provider: ZodLiteral<"secrets-manager">;
|
|
5071
6384
|
region: ZodEnum<{
|
|
5072
6385
|
"af-south-1": "af-south-1";
|
|
5073
6386
|
"ap-east-1": "ap-east-1";
|
|
@@ -5097,13 +6410,16 @@ declare const WorkspaceConfigSchema: ZodObject<{
|
|
|
5097
6410
|
"us-west-1": "us-west-1";
|
|
5098
6411
|
"us-west-2": "us-west-2";
|
|
5099
6412
|
}>;
|
|
6413
|
+
kmsKeyId: ZodOptional<ZodString>;
|
|
5100
6414
|
}, $strict>, ZodObject<{
|
|
5101
6415
|
provider: ZodCustom<{
|
|
5102
|
-
|
|
5103
|
-
|
|
6416
|
+
name: string;
|
|
6417
|
+
read: Function;
|
|
6418
|
+
write: Function;
|
|
5104
6419
|
}, {
|
|
5105
|
-
|
|
5106
|
-
|
|
6420
|
+
name: string;
|
|
6421
|
+
read: Function;
|
|
6422
|
+
write: Function;
|
|
5107
6423
|
}>;
|
|
5108
6424
|
}, $strip>]>>;
|
|
5109
6425
|
algorithm: ZodOptional<ZodString>;
|
|
@@ -5146,6 +6462,40 @@ declare const WorkspaceConfigSchema: ZodObject<{
|
|
|
5146
6462
|
"us-west-2": "us-west-2";
|
|
5147
6463
|
}>;
|
|
5148
6464
|
profile: ZodOptional<ZodString>;
|
|
6465
|
+
}, $strip>, ZodObject<{
|
|
6466
|
+
provider: ZodLiteral<"s3">;
|
|
6467
|
+
bucket: ZodOptional<ZodString>;
|
|
6468
|
+
region: ZodEnum<{
|
|
6469
|
+
"af-south-1": "af-south-1";
|
|
6470
|
+
"ap-east-1": "ap-east-1";
|
|
6471
|
+
"ap-northeast-1": "ap-northeast-1";
|
|
6472
|
+
"ap-northeast-2": "ap-northeast-2";
|
|
6473
|
+
"ap-northeast-3": "ap-northeast-3";
|
|
6474
|
+
"ap-south-1": "ap-south-1";
|
|
6475
|
+
"ap-south-2": "ap-south-2";
|
|
6476
|
+
"ap-southeast-1": "ap-southeast-1";
|
|
6477
|
+
"ap-southeast-2": "ap-southeast-2";
|
|
6478
|
+
"ap-southeast-3": "ap-southeast-3";
|
|
6479
|
+
"ap-southeast-4": "ap-southeast-4";
|
|
6480
|
+
"ca-central-1": "ca-central-1";
|
|
6481
|
+
"eu-central-1": "eu-central-1";
|
|
6482
|
+
"eu-central-2": "eu-central-2";
|
|
6483
|
+
"eu-north-1": "eu-north-1";
|
|
6484
|
+
"eu-south-1": "eu-south-1";
|
|
6485
|
+
"eu-south-2": "eu-south-2";
|
|
6486
|
+
"eu-west-1": "eu-west-1";
|
|
6487
|
+
"eu-west-2": "eu-west-2";
|
|
6488
|
+
"eu-west-3": "eu-west-3";
|
|
6489
|
+
"me-central-1": "me-central-1";
|
|
6490
|
+
"me-south-1": "me-south-1";
|
|
6491
|
+
"sa-east-1": "sa-east-1";
|
|
6492
|
+
"us-east-1": "us-east-1";
|
|
6493
|
+
"us-east-2": "us-east-2";
|
|
6494
|
+
"us-west-1": "us-west-1";
|
|
6495
|
+
"us-west-2": "us-west-2";
|
|
6496
|
+
}>;
|
|
6497
|
+
prefix: ZodOptional<ZodString>;
|
|
6498
|
+
profile: ZodOptional<ZodString>;
|
|
5149
6499
|
}, $strip>], "provider">, ZodObject<{
|
|
5150
6500
|
provider: ZodCustom<{
|
|
5151
6501
|
read: Function;
|
|
@@ -5155,6 +6505,13 @@ declare const WorkspaceConfigSchema: ZodObject<{
|
|
|
5155
6505
|
write: Function;
|
|
5156
6506
|
}>;
|
|
5157
6507
|
}, $strip>]>>;
|
|
6508
|
+
test: ZodOptional<ZodObject<{
|
|
6509
|
+
factories: ZodOptional<ZodString>;
|
|
6510
|
+
}, $strict>>;
|
|
6511
|
+
dev: ZodOptional<ZodObject<{
|
|
6512
|
+
allowedOrigins: ZodOptional<ZodArray<ZodURL>>;
|
|
6513
|
+
discoveryPort: ZodOptional<ZodNumber>;
|
|
6514
|
+
}, $strict>>;
|
|
5158
6515
|
}, $strict>;
|
|
5159
6516
|
/**
|
|
5160
6517
|
* Validate workspace configuration.
|
|
@@ -5176,42 +6533,59 @@ declare function formatValidationErrors(error: ZodError): string;
|
|
|
5176
6533
|
//#endregion
|
|
5177
6534
|
//#region src/workspace/types.d.ts
|
|
5178
6535
|
/**
|
|
5179
|
-
*
|
|
5180
|
-
*
|
|
5181
|
-
* Specifies where the app will be deployed.
|
|
6536
|
+
* Where a stage — or one app — deploys, by target name: a built-in
|
|
6537
|
+
* (`dokploy`, `sst`) or a key of `deploy.targets`.
|
|
5182
6538
|
*
|
|
5183
6539
|
* @example
|
|
5184
6540
|
* ```ts
|
|
5185
|
-
* // Currently supported
|
|
5186
6541
|
* deploy: 'dokploy'
|
|
5187
|
-
*
|
|
5188
|
-
* // Future support (not yet implemented)
|
|
5189
|
-
* deploy: 'vercel'
|
|
5190
|
-
* deploy: 'cloudflare'
|
|
6542
|
+
* deploy: 'acme' // deploy: { targets: { acme: '@acme/gkm-target' } }
|
|
5191
6543
|
* ```
|
|
5192
6544
|
*/
|
|
5193
|
-
type
|
|
6545
|
+
type DeployTargetName = 'dokploy' | 'compose' | 'sst' | (string & {});
|
|
6546
|
+
/**
|
|
6547
|
+
* A per-stage map, typed from the workspace's deployed stages: a key that is
|
|
6548
|
+
* not one is a type error. Untyped (`string`) stages accept any key, which the
|
|
6549
|
+
* schema then checks at load.
|
|
6550
|
+
*/
|
|
6551
|
+
type StageMap<S extends string, V> = string extends S ? Record<string, V> : Partial<Record<S, V>>;
|
|
6552
|
+
/**
|
|
6553
|
+
* `domains: { <stage>: '<domain>' }` at the root of `defineWorkspace`, typed from
|
|
6554
|
+
* the deployed stages.
|
|
6555
|
+
*/
|
|
6556
|
+
type DomainsInput<S extends string = string> = StageMap<S, string>;
|
|
6557
|
+
/** How one root domain's hosts point at a compose stage's server. */
|
|
6558
|
+
type DnsRecordsModeInput<S extends string = string> = 'a' | {
|
|
6559
|
+
mode: 'cname';
|
|
6560
|
+
target: string | StageMap<S, string>;
|
|
6561
|
+
};
|
|
6562
|
+
/** One root domain's DNS provider, its records mode typed from the stages. */
|
|
6563
|
+
type DnsDomainInput<S extends string = string> = DnsProvider extends (infer P) ? P extends unknown ? Omit<P, 'records'> & {
|
|
6564
|
+
records?: DnsRecordsModeInput<S>;
|
|
6565
|
+
} : never : never;
|
|
6566
|
+
/** `dns: { '<root domain>': { provider, … } }` at the root of `defineWorkspace`. */
|
|
6567
|
+
type DnsInput<S extends string = string> = Record<string, DnsDomainInput<S>>;
|
|
6568
|
+
/** Each root domain's DNS provider — `dns` at the root of the config. */
|
|
6569
|
+
type WorkspaceDnsConfig = Record<string, DnsProvider>;
|
|
5194
6570
|
/**
|
|
5195
|
-
*
|
|
6571
|
+
* Each deployed stage's base domain — `domains` at the root of the config.
|
|
5196
6572
|
*
|
|
5197
|
-
*
|
|
5198
|
-
*
|
|
6573
|
+
* A fact about the deployment rather than the platform, so every target reads
|
|
6574
|
+
* it. The root site answers on the base domain; every other surface on
|
|
6575
|
+
* `{subdomain}.{domain}`, where the subdomain is the construct's own
|
|
6576
|
+
* `subdomain`, or its id kebab-cased.
|
|
5199
6577
|
*
|
|
5200
6578
|
* @example
|
|
5201
6579
|
* ```ts
|
|
5202
|
-
* domains: {
|
|
5203
|
-
* development: 'dev.myapp.com',
|
|
5204
|
-
* staging: 'staging.myapp.com',
|
|
5205
|
-
* production: 'myapp.com',
|
|
5206
|
-
* }
|
|
6580
|
+
* domains: { production: 'myapp.com', staging: 'staging.myapp.com' },
|
|
5207
6581
|
*
|
|
5208
|
-
* //
|
|
5209
|
-
* // -
|
|
5210
|
-
* // -
|
|
5211
|
-
* // -
|
|
6582
|
+
* // production:
|
|
6583
|
+
* // - new StaticSite('Web', { root: true }) → myapp.com
|
|
6584
|
+
* // - new RestApi('Api', { subdomain: 'api' }) → api.myapp.com
|
|
6585
|
+
* // - new RestApi('Webhooks', { … }) → webhooks.myapp.com
|
|
5212
6586
|
* ```
|
|
5213
6587
|
*/
|
|
5214
|
-
type
|
|
6588
|
+
type DomainsConfig = Record<string, string>;
|
|
5215
6589
|
/**
|
|
5216
6590
|
* Per-app domain override configuration.
|
|
5217
6591
|
*
|
|
@@ -5243,9 +6617,9 @@ type AppDomainConfig = string | Record<string, string>;
|
|
|
5243
6617
|
* ```ts
|
|
5244
6618
|
* deploy: {
|
|
5245
6619
|
* default: 'dokploy',
|
|
6620
|
+
* registry: 'ghcr.io/myorg',
|
|
5246
6621
|
* dokploy: {
|
|
5247
6622
|
* endpoint: 'https://dokploy.myserver.com',
|
|
5248
|
-
* registry: 'ghcr.io/myorg',
|
|
5249
6623
|
* },
|
|
5250
6624
|
* }
|
|
5251
6625
|
* ```
|
|
@@ -5254,12 +6628,12 @@ type AppDomainConfig = string | Record<string, string>;
|
|
|
5254
6628
|
* ```ts
|
|
5255
6629
|
* deploy: {
|
|
5256
6630
|
* default: 'dokploy',
|
|
6631
|
+
* registry: 'ghcr.io/myorg',
|
|
5257
6632
|
* dokploy: {
|
|
5258
6633
|
* endpoints: {
|
|
5259
6634
|
* development: 'https://dev-dokploy.myserver.com',
|
|
5260
6635
|
* production: 'https://dokploy.myserver.com',
|
|
5261
6636
|
* },
|
|
5262
|
-
* registry: 'ghcr.io/myorg',
|
|
5263
6637
|
* },
|
|
5264
6638
|
* }
|
|
5265
6639
|
* ```
|
|
@@ -5269,16 +6643,286 @@ interface DokployWorkspaceConfig {
|
|
|
5269
6643
|
endpoint?: string;
|
|
5270
6644
|
/** Per-stage Dokploy API endpoints (overrides endpoint) */
|
|
5271
6645
|
endpoints?: Record<string, string>;
|
|
5272
|
-
/** Container registry for Docker images (e.g., 'ghcr.io/myorg') */
|
|
5273
|
-
registry?: string;
|
|
5274
6646
|
/** Registry ID in Dokploy (auto-configured) */
|
|
5275
6647
|
registryId?: string;
|
|
6648
|
+
/** Dokploy's own backup schedule for the stage's Postgres, to an S3 destination. */
|
|
6649
|
+
backups?: DokployBackupsConfig;
|
|
6650
|
+
/** How a release is waited for and checked before it counts as live. */
|
|
6651
|
+
verify?: DokployVerifyConfig;
|
|
6652
|
+
}
|
|
6653
|
+
/**
|
|
6654
|
+
* How a Dokploy release is waited for and checked.
|
|
6655
|
+
*
|
|
6656
|
+
* A release counts once Dokploy's deployment has finished and the app has
|
|
6657
|
+
* answered its health route `healthyAfter` times in a row. One that does not
|
|
6658
|
+
* is rolled back.
|
|
6659
|
+
*/
|
|
6660
|
+
interface DokployVerifyConfig {
|
|
6661
|
+
/** How long Dokploy may take to finish a deployment. Default 10 minutes. */
|
|
6662
|
+
deploymentTimeoutMs?: number;
|
|
6663
|
+
/**
|
|
6664
|
+
* The path each backend is checked on, under its domain. Default
|
|
6665
|
+
* `/health`, which every production server build serves. A site is
|
|
6666
|
+
* checked at `/`.
|
|
6667
|
+
*/
|
|
6668
|
+
healthCheckPath?: string;
|
|
6669
|
+
/** Consecutive 2xx answers that make an app healthy. Default 3. */
|
|
6670
|
+
healthyAfter?: number;
|
|
6671
|
+
/** Between health checks, and the first wait between polls. Default 2s. */
|
|
6672
|
+
intervalMs?: number;
|
|
6673
|
+
/** How long an app may take to become healthy. Default 5 minutes. */
|
|
6674
|
+
healthTimeoutMs?: number;
|
|
6675
|
+
}
|
|
6676
|
+
/**
|
|
6677
|
+
* The `compose` target's own settings — `deploy.compose`. Read by `gkm
|
|
6678
|
+
* compose` and `gkm deploy --target compose` only; the Dokploy target never
|
|
6679
|
+
* consults it.
|
|
6680
|
+
*
|
|
6681
|
+
* @example
|
|
6682
|
+
* ```ts
|
|
6683
|
+
* deploy: { compose: { proxy: 'traefik' } }
|
|
6684
|
+
* ```
|
|
6685
|
+
*/
|
|
6686
|
+
interface ComposeWorkspaceConfig<S extends string = string> {
|
|
6687
|
+
/**
|
|
6688
|
+
* What serves a stage's stack: `'caddy'` (the default) — the stack's own
|
|
6689
|
+
* Caddy on 80/443 — or `'traefik'`, the machine's shared Traefik edge,
|
|
6690
|
+
* which every stack registers its routes with.
|
|
6691
|
+
*
|
|
6692
|
+
* One value applies to every deployed stage; the local stage stays on
|
|
6693
|
+
* Caddy then. A map sets each stage it names, the local stage included,
|
|
6694
|
+
* so the local stack runs behind a Traefik edge on this machine — the
|
|
6695
|
+
* path the deployed stages take — only when the map names it.
|
|
6696
|
+
*
|
|
6697
|
+
* ```ts
|
|
6698
|
+
* proxy: 'traefik' // every deployed stage; local stays on Caddy
|
|
6699
|
+
* proxy: { development: 'traefik', production: 'traefik' }
|
|
6700
|
+
* ```
|
|
6701
|
+
*/
|
|
6702
|
+
proxy?: ComposeProxy | StageMap<S, ComposeProxy>;
|
|
6703
|
+
/**
|
|
6704
|
+
* A stage's own certificate, by stage: a PEM certificate (with its chain)
|
|
6705
|
+
* and its key, relative to the workspace root or absolute. Either proxy
|
|
6706
|
+
* serves it, on any stage. Without one, a deployed stage's comes from
|
|
6707
|
+
* Let's Encrypt and the local stage's from gkm's local CA (`gkm trust`).
|
|
6708
|
+
*
|
|
6709
|
+
* ```ts
|
|
6710
|
+
* tls: { production: { certFile: 'certs/origin.pem', keyFile: 'certs/origin.key' } }
|
|
6711
|
+
* tls: {
|
|
6712
|
+
* development: {
|
|
6713
|
+
* certFile: 'certs/dev.pem',
|
|
6714
|
+
* keyFile: 'certs/dev-key.pem',
|
|
6715
|
+
* caFile: 'certs/rootCA.pem',
|
|
6716
|
+
* },
|
|
6717
|
+
* }
|
|
6718
|
+
* ```
|
|
6719
|
+
*/
|
|
6720
|
+
tls?: StageMap<S, ComposeTlsConfig>;
|
|
6721
|
+
/**
|
|
6722
|
+
* Each deployed stage's server: the SSH login gkm drives its Docker
|
|
6723
|
+
* engine with (`DOCKER_HOST=ssh://user@host`). gkm runs where the deploy
|
|
6724
|
+
* starts — a CI runner, a laptop — and never on the server, which holds
|
|
6725
|
+
* Docker and this login and no cloud credentials. The host defaults to
|
|
6726
|
+
* the stage's `GKM_SERVER_IPV4` secret. Every deployed stage needs one;
|
|
6727
|
+
* the local stage runs on this machine's Docker.
|
|
6728
|
+
*
|
|
6729
|
+
* ```ts
|
|
6730
|
+
* server: { production: { user: 'deploy' } }
|
|
6731
|
+
* server: { staging: { user: 'deploy', host: 'staging.example.com', port: 2222 } }
|
|
6732
|
+
* ```
|
|
6733
|
+
*/
|
|
6734
|
+
server?: StageMap<S, ComposeServerConfig>;
|
|
6735
|
+
}
|
|
6736
|
+
/** A deployed stage's server — `deploy.compose.server.<stage>`. */
|
|
6737
|
+
interface ComposeServerConfig {
|
|
6738
|
+
/** The SSH user, in the server's `docker` group. */
|
|
6739
|
+
user: string;
|
|
6740
|
+
/** The host to SSH to. Default: the stage's `GKM_SERVER_IPV4` secret. */
|
|
6741
|
+
host?: string;
|
|
6742
|
+
/** The SSH port. Default 22. */
|
|
6743
|
+
port?: number;
|
|
6744
|
+
}
|
|
6745
|
+
/** A stage's own certificate — `deploy.compose.tls.<stage>`. */
|
|
6746
|
+
interface ComposeTlsConfig {
|
|
6747
|
+
certFile: string;
|
|
6748
|
+
keyFile: string;
|
|
6749
|
+
/**
|
|
6750
|
+
* The root the certificate chains to, PEM, when no public CA issued it —
|
|
6751
|
+
* an mkcert root, a company CA. gkm's check after a start trusts it; on
|
|
6752
|
+
* the local stage the stack's containers are handed it too
|
|
6753
|
+
* (`NODE_EXTRA_CA_CERTS`). Without it, the check trusts what Node does by
|
|
6754
|
+
* default: its bundled roots, and `NODE_EXTRA_CA_CERTS` where it is set.
|
|
6755
|
+
*/
|
|
6756
|
+
caFile?: string;
|
|
6757
|
+
}
|
|
6758
|
+
/**
|
|
6759
|
+
* Where one stage's telemetry goes, and how much of it — `deploy.telemetry`,
|
|
6760
|
+
* by stage.
|
|
6761
|
+
*
|
|
6762
|
+
* What is emitted is the application's (the `Telemetry` construct); where it
|
|
6763
|
+
* goes is this. A server target runs the self-hosted provider when a stage
|
|
6764
|
+
* names nothing; AWS has none, so a deployed AWS stage that uses telemetry
|
|
6765
|
+
* names a provider. `false` sends nothing. The local stage ignores this: `gkm
|
|
6766
|
+
* dev` and `gkm compose` on it always run OpenObserve, at 100%.
|
|
6767
|
+
*
|
|
6768
|
+
* @example
|
|
6769
|
+
* ```ts
|
|
6770
|
+
* telemetry: {
|
|
6771
|
+
* staging: 'self-hosted',
|
|
6772
|
+
* production: { provider: 'self-hosted', retentionDays: 14, sampleRate: 0.1 },
|
|
6773
|
+
* preview: { provider: 'otlp', endpoint: 'https://otlp.example.com', sampleRate: 0.5 },
|
|
6774
|
+
* scratch: false,
|
|
6775
|
+
* }
|
|
6776
|
+
* ```
|
|
6777
|
+
*/
|
|
6778
|
+
type StageTelemetryConfig = 'self-hosted' | SelfHostedTelemetryConfig | OtlpTelemetryConfig | false;
|
|
6779
|
+
/**
|
|
6780
|
+
* What backs one deployed stage's buckets — `deploy.objects`, by stage.
|
|
6781
|
+
*
|
|
6782
|
+
* - `'external'` (the default) — the stage's secrets hold each bucket's URL,
|
|
6783
|
+
* set by you: S3, R2, any S3-compatible store.
|
|
6784
|
+
* - `{ provider: 's3' }` — every deploy of the stage creates (or repairs)
|
|
6785
|
+
* each bucket, its IAM user and key in the stage's AWS account, and writes
|
|
6786
|
+
* the bucket's URL into the stage's secrets, before its checks.
|
|
6787
|
+
* - `false` — the stage has no object storage; a bucket on it is refused.
|
|
6788
|
+
*
|
|
6789
|
+
* The local stage ignores this: `gkm dev` runs MinIO for every bucket.
|
|
6790
|
+
*
|
|
6791
|
+
* @example
|
|
6792
|
+
* ```ts
|
|
6793
|
+
* objects: {
|
|
6794
|
+
* production: { provider: 's3', region: 'eu-west-1', versioning: true },
|
|
6795
|
+
* staging: 'external',
|
|
6796
|
+
* }
|
|
6797
|
+
* ```
|
|
6798
|
+
*/
|
|
6799
|
+
type StageObjectsConfig = 'external' | S3ObjectsConfig | false;
|
|
6800
|
+
/**
|
|
6801
|
+
* What receives one deployed stage's inboxes — `deploy.inbox`, by stage:
|
|
6802
|
+
*
|
|
6803
|
+
* - `{ provider: 'ses' }` — the deploy creates each inbox in the stage's AWS
|
|
6804
|
+
* account: its own bucket and topic, the domain's SES identity and MX
|
|
6805
|
+
* records, and a receipt rule in the region's active rule set.
|
|
6806
|
+
* - `'external'` — the default: the stage's secrets hold each inbox's keys.
|
|
6807
|
+
* - `false` — the stage receives no mail; an inbox on it is refused.
|
|
6808
|
+
*
|
|
6809
|
+
* Every local stage receives through Mailpit, whatever this says.
|
|
6810
|
+
*
|
|
6811
|
+
* @example
|
|
6812
|
+
* ```ts
|
|
6813
|
+
* inbox: { production: { provider: 'ses', region: 'eu-west-1' } }
|
|
6814
|
+
* ```
|
|
6815
|
+
*/
|
|
6816
|
+
type StageInboxConfig = 'external' | SesInboxConfig | false;
|
|
6817
|
+
/**
|
|
6818
|
+
* What sends one deployed stage's mail — `deploy.email`, by stage:
|
|
6819
|
+
*
|
|
6820
|
+
* - `{ provider: 'ses' }` — the deploy creates what each `Email` construct
|
|
6821
|
+
* sends with in the stage's AWS account: the sender's domain as an SES
|
|
6822
|
+
* identity (its DKIM records through `dns`), an IAM user allowed only to
|
|
6823
|
+
* send as it, and its key — written as `<ID>_URL`, an `smtp://` URL with
|
|
6824
|
+
* the SMTP password derived from the key — and `<ID>_FROM`. A `<ID>_URL`
|
|
6825
|
+
* the stage's secrets already hold wins, and nothing is created for it.
|
|
6826
|
+
* - `'external'` — the default: the stage's secrets hold each construct's
|
|
6827
|
+
* `<ID>_URL` and `<ID>_FROM`, set by you.
|
|
6828
|
+
* - `false` — the stage sends no mail; an `Email` on it is refused.
|
|
6829
|
+
*
|
|
6830
|
+
* Every local stage sends to Mailpit, whatever this says.
|
|
6831
|
+
*
|
|
6832
|
+
* @example
|
|
6833
|
+
* ```ts
|
|
6834
|
+
* email: {
|
|
6835
|
+
* production: { provider: 'ses', region: 'eu-west-1' },
|
|
6836
|
+
* staging: 'external',
|
|
6837
|
+
* }
|
|
6838
|
+
* ```
|
|
6839
|
+
*/
|
|
6840
|
+
type StageEmailConfig = 'external' | SesEmailConfig | false;
|
|
6841
|
+
/**
|
|
6842
|
+
* One deployed compose stage's backups — `deploy.backups`, by stage.
|
|
6843
|
+
*
|
|
6844
|
+
* A stage that runs Postgres is backed up whether it names one or not: every
|
|
6845
|
+
* day at 02:00 UTC, each backup kept 30 days, in the project bucket. An
|
|
6846
|
+
* entry changes when (`every`, or a five-field UTC `cron`, at most hourly)
|
|
6847
|
+
* and for how long (`keep`); `false` takes none, and deletes nothing.
|
|
6848
|
+
*
|
|
6849
|
+
* @example
|
|
6850
|
+
* ```ts
|
|
6851
|
+
* backups: {
|
|
6852
|
+
* production: { every: '6h', keep: '30d' },
|
|
6853
|
+
* staging: { cron: '30 3 * * *', keep: '7d' },
|
|
6854
|
+
* preview: false,
|
|
6855
|
+
* }
|
|
6856
|
+
* ```
|
|
6857
|
+
*/
|
|
6858
|
+
type StageBackupsConfig = false | {
|
|
6859
|
+
/** `'6h'`, `'1d'` — counted from 02:00 UTC. At least `'1h'`. */
|
|
6860
|
+
every?: string;
|
|
6861
|
+
/** Five fields, in UTC: `'0 *\/6 * * *'`. */
|
|
6862
|
+
cron?: string;
|
|
6863
|
+
/** How long a backup is kept: `'30d'`. */
|
|
6864
|
+
keep?: string;
|
|
6865
|
+
};
|
|
6866
|
+
/** `objects: { provider: 's3' }` — a bucket per construct in the stage's account. */
|
|
6867
|
+
interface S3ObjectsConfig {
|
|
6868
|
+
provider: 's3';
|
|
6869
|
+
/**
|
|
6870
|
+
* Where the buckets are created. Defaults to the secrets store's region,
|
|
6871
|
+
* then `AWS_REGION`.
|
|
6872
|
+
*/
|
|
6873
|
+
region?: string;
|
|
6874
|
+
/** Keep previous versions of every object. Defaults to the construct's own `versioned`. */
|
|
6875
|
+
versioning?: boolean;
|
|
6876
|
+
/**
|
|
6877
|
+
* Serve each file server through a CDN on `<fileserver>.<domain>`: a
|
|
6878
|
+
* CloudFront distribution reading the bucket, its certificate and its DNS
|
|
6879
|
+
* records, all created by the deploy. On by default, which needs the
|
|
6880
|
+
* stage to have a domain; `false` serves from the bucket's own endpoint.
|
|
6881
|
+
*/
|
|
6882
|
+
cdn?: boolean;
|
|
6883
|
+
}
|
|
6884
|
+
/** Shared by every provider. */
|
|
6885
|
+
interface TelemetryProviderConfig {
|
|
6886
|
+
/**
|
|
6887
|
+
* The fraction of traces kept, decided where a trace starts and followed
|
|
6888
|
+
* by every service it reaches (`parentbased_traceidratio`). Logs are not
|
|
6889
|
+
* sampled. 0 to 1; default 1.
|
|
6890
|
+
*/
|
|
6891
|
+
sampleRate?: number;
|
|
6892
|
+
}
|
|
6893
|
+
/**
|
|
6894
|
+
* The target runs the collector and its UI: OpenObserve, in a compose stack,
|
|
6895
|
+
* reached through an SSH tunnel by default.
|
|
6896
|
+
*/
|
|
6897
|
+
interface SelfHostedTelemetryConfig extends TelemetryProviderConfig {
|
|
6898
|
+
provider: 'self-hosted';
|
|
6899
|
+
/**
|
|
6900
|
+
* The port it is published on, on 127.0.0.1 only — reached from another
|
|
6901
|
+
* machine through an SSH tunnel. Default 5080.
|
|
6902
|
+
*/
|
|
6903
|
+
port?: number;
|
|
6904
|
+
/**
|
|
6905
|
+
* How many days of data it keeps (OpenObserve's
|
|
6906
|
+
* `ZO_COMPACT_DATA_RETENTION_DAYS`). At least 3; default 30.
|
|
6907
|
+
*/
|
|
6908
|
+
retentionDays?: number;
|
|
5276
6909
|
/**
|
|
5277
|
-
*
|
|
5278
|
-
*
|
|
5279
|
-
*
|
|
6910
|
+
* Serve it on the `Telemetry` construct's label under the stage's domain —
|
|
6911
|
+
* `telemetry.<stage domain>` by default — through the stack's proxy, to these
|
|
6912
|
+
* addresses only (IPs or CIDRs), instead of on a loopback port. Every
|
|
6913
|
+
* other address is answered 403.
|
|
5280
6914
|
*/
|
|
5281
|
-
|
|
6915
|
+
public?: {
|
|
6916
|
+
allow: string[];
|
|
6917
|
+
};
|
|
6918
|
+
}
|
|
6919
|
+
/** Any OTLP/HTTP endpoint — a collector, a vendor's ingest. */
|
|
6920
|
+
interface OtlpTelemetryConfig extends TelemetryProviderConfig {
|
|
6921
|
+
provider: 'otlp';
|
|
6922
|
+
/** The OTLP/HTTP base URL; `/v1/traces` and `/v1/logs` are added to it. */
|
|
6923
|
+
endpoint: string;
|
|
6924
|
+
/** Headers sent with every export — `{ 'x-team': 'shop' }`. */
|
|
6925
|
+
headers?: Record<string, string>;
|
|
5282
6926
|
}
|
|
5283
6927
|
/**
|
|
5284
6928
|
* Deployment configuration for the workspace.
|
|
@@ -5290,37 +6934,84 @@ interface DokployWorkspaceConfig {
|
|
|
5290
6934
|
* default: 'dokploy',
|
|
5291
6935
|
* }
|
|
5292
6936
|
*
|
|
5293
|
-
* // Full configuration with
|
|
6937
|
+
* // Full configuration with backups (domains and dns are at the root)
|
|
5294
6938
|
* deploy: {
|
|
5295
6939
|
* default: 'dokploy',
|
|
6940
|
+
* registry: 'ghcr.io/myorg',
|
|
5296
6941
|
* dokploy: {
|
|
5297
6942
|
* endpoint: 'https://dokploy.myserver.com',
|
|
5298
6943
|
* projectId: 'proj_abc123',
|
|
5299
|
-
*
|
|
5300
|
-
* domains: {
|
|
5301
|
-
* production: 'myapp.com',
|
|
5302
|
-
* },
|
|
5303
|
-
* },
|
|
5304
|
-
* dns: {
|
|
5305
|
-
* provider: 'hostinger',
|
|
5306
|
-
* domain: 'myapp.com',
|
|
5307
|
-
* },
|
|
5308
|
-
* backups: {
|
|
5309
|
-
* type: 's3',
|
|
5310
|
-
* region: 'us-east-1',
|
|
6944
|
+
* backups: { type: 's3', region: 'us-east-1' },
|
|
5311
6945
|
* },
|
|
5312
6946
|
* }
|
|
5313
6947
|
* ```
|
|
5314
6948
|
*/
|
|
5315
|
-
interface DeployConfig {
|
|
6949
|
+
interface DeployConfig<S extends string = string> {
|
|
5316
6950
|
/** Default deploy target for all apps (default: 'dokploy') */
|
|
5317
|
-
default?:
|
|
6951
|
+
default?: DeployTargetName;
|
|
6952
|
+
/**
|
|
6953
|
+
* Targets that do not ship with the CLI, by the name `default` (or an
|
|
6954
|
+
* app's `deploy`) uses: a package whose default export is the target, a
|
|
6955
|
+
* target object, or either with its options.
|
|
6956
|
+
*
|
|
6957
|
+
* ```ts
|
|
6958
|
+
* targets: {
|
|
6959
|
+
* acme: '@acme/gkm-target',
|
|
6960
|
+
* fly: ['@acme/gkm-fly', { org: 'acme' }],
|
|
6961
|
+
* local: defineTarget({ … }),
|
|
6962
|
+
* }
|
|
6963
|
+
* ```
|
|
6964
|
+
*
|
|
6965
|
+
* A package is never guessed from a name: it is installed and listed here.
|
|
6966
|
+
* A built-in's name cannot be taken.
|
|
6967
|
+
*/
|
|
6968
|
+
targets?: Record<string, DeployTargetEntry>;
|
|
6969
|
+
/**
|
|
6970
|
+
* Whose deploy this is, on a target shared with other workspaces — an
|
|
6971
|
+
* organisation or a team, lowercase `[a-z0-9-]`. Two workspaces with the
|
|
6972
|
+
* same name deploying to one Dokploy are kept apart by it: it is in the
|
|
6973
|
+
* project's ownership marker, the image path
|
|
6974
|
+
* (`<registry>/<namespace>/<project>-<app>`) and every resource name.
|
|
6975
|
+
*
|
|
6976
|
+
* Defaults to the kebab-cased workspace name, which adds nothing to the
|
|
6977
|
+
* names a workspace was already deployed under.
|
|
6978
|
+
*/
|
|
6979
|
+
namespace?: string;
|
|
6980
|
+
/**
|
|
6981
|
+
* The container registry the apps' images are pushed to and pulled from,
|
|
6982
|
+
* whatever the target — `ghcr.io/myorg`. An image is
|
|
6983
|
+
* `<registry>/<namespace>/<project>-<app>:<tag>`.
|
|
6984
|
+
*/
|
|
6985
|
+
registry?: string;
|
|
5318
6986
|
/** Dokploy-specific configuration */
|
|
5319
6987
|
dokploy?: DokployWorkspaceConfig;
|
|
5320
|
-
/**
|
|
5321
|
-
|
|
5322
|
-
/**
|
|
5323
|
-
|
|
6988
|
+
/** What the `compose` target runs beside the apps — see {@link ComposeWorkspaceConfig}. */
|
|
6989
|
+
compose?: ComposeWorkspaceConfig<S>;
|
|
6990
|
+
/**
|
|
6991
|
+
* Where each deployed stage's telemetry goes — see
|
|
6992
|
+
* {@link StageTelemetryConfig}.
|
|
6993
|
+
*/
|
|
6994
|
+
telemetry?: StageMap<S, StageTelemetryConfig>;
|
|
6995
|
+
/**
|
|
6996
|
+
* What backs each deployed stage's buckets — the `objects` kind that
|
|
6997
|
+
* `ObjectStorage` and `FileServer` produce. See {@link StageObjectsConfig}.
|
|
6998
|
+
*/
|
|
6999
|
+
objects?: StageMap<S, StageObjectsConfig>;
|
|
7000
|
+
/**
|
|
7001
|
+
* What receives each deployed stage's inboxes — the `inbox` kind `Inbox`
|
|
7002
|
+
* produces. See {@link StageInboxConfig}.
|
|
7003
|
+
*/
|
|
7004
|
+
inbox?: StageMap<S, StageInboxConfig>;
|
|
7005
|
+
/**
|
|
7006
|
+
* What sends each deployed stage's mail — the `email` kind `Email`
|
|
7007
|
+
* produces. See {@link StageEmailConfig}.
|
|
7008
|
+
*/
|
|
7009
|
+
email?: StageMap<S, StageEmailConfig>;
|
|
7010
|
+
/**
|
|
7011
|
+
* When each deployed compose stage's databases are backed up, and how
|
|
7012
|
+
* long a backup is kept — see {@link StageBackupsConfig}.
|
|
7013
|
+
*/
|
|
7014
|
+
backups?: StageMap<S, StageBackupsConfig>;
|
|
5324
7015
|
}
|
|
5325
7016
|
/**
|
|
5326
7017
|
* Models package configuration for shared schemas.
|
|
@@ -5406,7 +7097,7 @@ interface StagesConfig {
|
|
|
5406
7097
|
*
|
|
5407
7098
|
* Configures how secrets are encrypted for deployment.
|
|
5408
7099
|
* Secrets are stored encrypted in `.gkm/secrets/{stage}.json`
|
|
5409
|
-
* with keys stored separately in `~/.gkm/{project}/{stage}.key`.
|
|
7100
|
+
* with keys stored separately in `~/.gkm/keys/{namespace}/{project}/{stage}.key`.
|
|
5410
7101
|
*
|
|
5411
7102
|
* @example
|
|
5412
7103
|
* ```ts
|
|
@@ -5423,8 +7114,13 @@ interface SecretsConfig {
|
|
|
5423
7114
|
/**
|
|
5424
7115
|
* Where deployed stages' secrets live, so a deploy can reach them from
|
|
5425
7116
|
* anywhere: `'file'` (default — the encrypted `.gkm/secrets/<stage>.json`,
|
|
5426
|
-
* which cannot serve CI while `.gkm/` is gitignored), `{ provider: '
|
|
5427
|
-
* region }` (each stage's secrets in
|
|
7117
|
+
* which cannot serve CI while `.gkm/` is gitignored), `{ provider: 's3',
|
|
7118
|
+
* region?, bucket?, prefix? }` (each stage's secrets in one object in the
|
|
7119
|
+
* project bucket beside the deploy state, SSE-S3 and versioned, no size
|
|
7120
|
+
* limit; region and prefix default to an S3 `state`'s), `{ provider: 'ssm',
|
|
7121
|
+
* region }` (each stage's secrets in an SSM parameter in its own AWS
|
|
7122
|
+
* account, up to 8 KB), `{ provider: 'secrets-manager', region, kmsKeyId? }`
|
|
7123
|
+
* (a Secrets Manager secret in its own account, up to 64 KB), or any object
|
|
5428
7124
|
* implementing `SecretsStore`. The local stage always uses the file.
|
|
5429
7125
|
*/
|
|
5430
7126
|
store?: SecretsStoreConfig;
|
|
@@ -5494,7 +7190,7 @@ interface AppConfigBase {
|
|
|
5494
7190
|
* Overrides `deploy.default` for this specific app.
|
|
5495
7191
|
* @example 'dokploy', 'vercel'
|
|
5496
7192
|
*/
|
|
5497
|
-
deploy?:
|
|
7193
|
+
deploy?: DeployTargetName;
|
|
5498
7194
|
/**
|
|
5499
7195
|
* Constructs glob pattern — one glob, every kind.
|
|
5500
7196
|
*
|
|
@@ -5545,23 +7241,16 @@ interface AppConfigBase {
|
|
|
5545
7241
|
* @example './src/config/logger'
|
|
5546
7242
|
*/
|
|
5547
7243
|
logger?: string;
|
|
5548
|
-
/** Provider configuration (AWS, Docker, etc.) */
|
|
5549
|
-
providers?: ProvidersConfig;
|
|
5550
7244
|
/**
|
|
5551
7245
|
* Server lifecycle hooks.
|
|
5552
7246
|
* @example { beforeSetup: './src/hooks/setup.ts' }
|
|
5553
7247
|
*/
|
|
5554
7248
|
hooks?: HooksConfig;
|
|
5555
7249
|
/**
|
|
5556
|
-
* Telescope
|
|
7250
|
+
* Telescope request recording configuration.
|
|
5557
7251
|
* @example true, './src/config/telescope', { enabled: true, path: '/__telescope' }
|
|
5558
7252
|
*/
|
|
5559
7253
|
telescope?: string | boolean | TelescopeConfig;
|
|
5560
|
-
/**
|
|
5561
|
-
* Studio admin panel configuration.
|
|
5562
|
-
* @example true, './src/config/studio'
|
|
5563
|
-
*/
|
|
5564
|
-
studio?: string | boolean | StudioConfig;
|
|
5565
7254
|
/**
|
|
5566
7255
|
* OpenAPI documentation configuration.
|
|
5567
7256
|
* @example true, { output: './src/openapi.ts' }
|
|
@@ -5735,7 +7424,7 @@ type ConstrainedApps<TApps extends AppsRecord> = { [K in keyof TApps]: Omit<TApp
|
|
|
5735
7424
|
* });
|
|
5736
7425
|
* ```
|
|
5737
7426
|
*/
|
|
5738
|
-
type WorkspaceInput<TApps extends AppsRecord> = {
|
|
7427
|
+
type WorkspaceInput<TApps extends AppsRecord, TDeployed extends string = string> = {
|
|
5739
7428
|
/**
|
|
5740
7429
|
* Where the workspace's own constructs live, relative to its root.
|
|
5741
7430
|
*
|
|
@@ -5755,15 +7444,80 @@ type WorkspaceInput<TApps extends AppsRecord> = {
|
|
|
5755
7444
|
apps?: ConstrainedApps<TApps>;
|
|
5756
7445
|
/** Shared packages configuration */
|
|
5757
7446
|
shared?: SharedConfig;
|
|
7447
|
+
/**
|
|
7448
|
+
* Each deployed stage's base domain — see {@link DomainsConfig}. A key that
|
|
7449
|
+
* is not a deployed stage is a type error.
|
|
7450
|
+
*/
|
|
7451
|
+
domains?: DomainsInput<NoInfer<TDeployed>>;
|
|
7452
|
+
/**
|
|
7453
|
+
* Subdomains a wildcard site's tenants may never take, beyond every app's
|
|
7454
|
+
* own (which are derived from the constructs and never listed here): the
|
|
7455
|
+
* names no construct declares — `www`, `mail`, `status`, `docs`.
|
|
7456
|
+
*
|
|
7457
|
+
* Listing an app's own subdomain is refused at load: the construct
|
|
7458
|
+
* already protects it.
|
|
7459
|
+
*/
|
|
7460
|
+
protectedSubdomains?: readonly string[];
|
|
7461
|
+
/**
|
|
7462
|
+
* Each root domain's DNS provider, and how its hosts are pointed at a
|
|
7463
|
+
* compose stage's server (`records`).
|
|
7464
|
+
*/
|
|
7465
|
+
dns?: DnsInput<NoInfer<TDeployed>>;
|
|
5758
7466
|
/** Deployment configuration */
|
|
5759
|
-
deploy?: DeployConfig
|
|
5760
|
-
/**
|
|
5761
|
-
|
|
7467
|
+
deploy?: DeployConfig<NoInfer<TDeployed>>;
|
|
7468
|
+
/**
|
|
7469
|
+
* The project's stages: which one is local, which deploy. The deployed
|
|
7470
|
+
* stages type every per-stage map — `domains`, `deploy.objects`,
|
|
7471
|
+
* `deploy.telemetry`, `deploy.compose.proxy`/`tls`.
|
|
7472
|
+
*/
|
|
7473
|
+
stages: StagesInput<TDeployed>;
|
|
5762
7474
|
/** Encrypted secrets configuration */
|
|
5763
7475
|
secrets?: SecretsConfig;
|
|
5764
7476
|
/** State provider configuration (local filesystem by default, or SSM for team collaboration) */
|
|
5765
7477
|
state?: StateConfig;
|
|
7478
|
+
/** How `gkm dev` is reached: the discovery endpoint's port and origins */
|
|
7479
|
+
dev?: DevConfig;
|
|
5766
7480
|
};
|
|
7481
|
+
/** `stages`, as `defineWorkspace` infers it: each deployed stage literally. */
|
|
7482
|
+
interface StagesInput<TDeployed extends string = string> {
|
|
7483
|
+
local: string;
|
|
7484
|
+
deployed: readonly TDeployed[];
|
|
7485
|
+
protected?: readonly NoInfer<TDeployed>[];
|
|
7486
|
+
}
|
|
7487
|
+
/**
|
|
7488
|
+
* How `gkm dev` is reached from outside the apps it runs.
|
|
7489
|
+
*/
|
|
7490
|
+
interface DevConfig {
|
|
7491
|
+
/**
|
|
7492
|
+
* Browser origins allowed to read the discovery endpoint — and this
|
|
7493
|
+
* workspace in it — e.g. `['https://console.example.com']`.
|
|
7494
|
+
*
|
|
7495
|
+
* Empty by default: any page the developer visits can send requests to a
|
|
7496
|
+
* loopback port, so none is answered unless it is listed here. A request
|
|
7497
|
+
* with no `Origin` (curl, a local process) still needs the session token.
|
|
7498
|
+
*/
|
|
7499
|
+
allowedOrigins?: string[];
|
|
7500
|
+
/**
|
|
7501
|
+
* The loopback port the discovery endpoint listens on. Defaults to 4983;
|
|
7502
|
+
* `GKM_DISCOVERY_PORT` overrides it.
|
|
7503
|
+
*/
|
|
7504
|
+
discoveryPort?: number;
|
|
7505
|
+
}
|
|
7506
|
+
/**
|
|
7507
|
+
* How `gkm test` builds what a feature test is handed.
|
|
7508
|
+
*/
|
|
7509
|
+
interface TestConfig {
|
|
7510
|
+
/**
|
|
7511
|
+
* The folder of test factories, relative to the root.
|
|
7512
|
+
*
|
|
7513
|
+
* Defaults to `test/factories`. A factory belongs to a database, not to an
|
|
7514
|
+
* app, so each file is named after one — `database.ts` for `Database`,
|
|
7515
|
+
* `auth-database.ts` for `AuthDatabase` — and exports `createFactory(db)`.
|
|
7516
|
+
* Every app's harness builds them on each test's transactions, and a test is
|
|
7517
|
+
* handed them as `factories`, keyed by service name.
|
|
7518
|
+
*/
|
|
7519
|
+
factories?: string;
|
|
7520
|
+
}
|
|
5767
7521
|
/**
|
|
5768
7522
|
* Extract app names from apps record.
|
|
5769
7523
|
*/
|
|
@@ -5784,10 +7538,15 @@ type InferredWorkspaceConfig<TApps extends AppsRecord> = {
|
|
|
5784
7538
|
dependencies?: InferAppNames<TApps>[];
|
|
5785
7539
|
}; };
|
|
5786
7540
|
shared?: SharedConfig;
|
|
7541
|
+
domains?: DomainsConfig;
|
|
7542
|
+
protectedSubdomains?: readonly string[];
|
|
7543
|
+
dns?: WorkspaceDnsConfig;
|
|
5787
7544
|
deploy?: DeployConfig;
|
|
5788
7545
|
stages: StagesConfig;
|
|
5789
7546
|
secrets?: SecretsConfig;
|
|
5790
7547
|
state?: StateConfig;
|
|
7548
|
+
test?: TestConfig;
|
|
7549
|
+
dev?: DevConfig;
|
|
5791
7550
|
};
|
|
5792
7551
|
/**
|
|
5793
7552
|
* Workspace configuration for multi-app monorepos.
|
|
@@ -5834,17 +7593,20 @@ type InferredWorkspaceConfig<TApps extends AppsRecord> = {
|
|
|
5834
7593
|
* },
|
|
5835
7594
|
* },
|
|
5836
7595
|
*
|
|
7596
|
+
* // Each deployed stage's base domain, and who hosts its DNS
|
|
7597
|
+
* domains: {
|
|
7598
|
+
* production: 'myapp.com',
|
|
7599
|
+
* staging: 'staging.myapp.com',
|
|
7600
|
+
* },
|
|
7601
|
+
* dns: { 'myapp.com': { provider: 'godaddy' } },
|
|
7602
|
+
*
|
|
5837
7603
|
* // Deployment configuration
|
|
5838
7604
|
* deploy: {
|
|
5839
7605
|
* default: 'dokploy',
|
|
7606
|
+
* registry: 'ghcr.io/myorg',
|
|
5840
7607
|
* dokploy: {
|
|
5841
7608
|
* endpoint: 'https://dokploy.myserver.com',
|
|
5842
7609
|
* projectId: 'proj_abc123',
|
|
5843
|
-
* registry: 'ghcr.io/myorg',
|
|
5844
|
-
* domains: {
|
|
5845
|
-
* production: 'myapp.com',
|
|
5846
|
-
* staging: 'staging.myapp.com',
|
|
5847
|
-
* },
|
|
5848
7610
|
* },
|
|
5849
7611
|
* },
|
|
5850
7612
|
*
|
|
@@ -5872,6 +7634,12 @@ interface WorkspaceConfig {
|
|
|
5872
7634
|
apps?: Record<string, AppConfig>;
|
|
5873
7635
|
/** Shared packages configuration */
|
|
5874
7636
|
shared?: SharedConfig;
|
|
7637
|
+
/** Each deployed stage's base domain — see {@link DomainsConfig}. */
|
|
7638
|
+
domains?: DomainsConfig;
|
|
7639
|
+
/** Subdomains no tenant may take — see `WorkspaceInput`. */
|
|
7640
|
+
protectedSubdomains?: readonly string[];
|
|
7641
|
+
/** Each root domain's DNS provider — see {@link WorkspaceDnsConfig}. */
|
|
7642
|
+
dns?: WorkspaceDnsConfig;
|
|
5875
7643
|
/** Default deployment configuration */
|
|
5876
7644
|
deploy?: DeployConfig;
|
|
5877
7645
|
/** The project's stages: which one is local, which deploy */
|
|
@@ -5880,6 +7648,10 @@ interface WorkspaceConfig {
|
|
|
5880
7648
|
secrets?: SecretsConfig;
|
|
5881
7649
|
/** State provider configuration (local filesystem by default, or SSM for team collaboration) */
|
|
5882
7650
|
state?: StateConfig;
|
|
7651
|
+
/** What `gkm test` hands a feature test: where the factories are. */
|
|
7652
|
+
test?: TestConfig;
|
|
7653
|
+
/** How `gkm dev` is reached: the discovery endpoint's port and origins. */
|
|
7654
|
+
dev?: DevConfig;
|
|
5883
7655
|
}
|
|
5884
7656
|
/**
|
|
5885
7657
|
* Normalized app configuration with resolved defaults.
|
|
@@ -5896,6 +7668,11 @@ interface NormalizedAppConfig extends Omit<AppConfigBase, 'type'> {
|
|
|
5896
7668
|
* and that is `domain`.
|
|
5897
7669
|
*/
|
|
5898
7670
|
root?: boolean;
|
|
7671
|
+
/**
|
|
7672
|
+
* The label this app answers on under a stage's domain, carried from its
|
|
7673
|
+
* declaration — `api` for `api.myapp.com`. Absent, the app's own name.
|
|
7674
|
+
*/
|
|
7675
|
+
subdomain?: string;
|
|
5899
7676
|
/** App type (always defined after normalization) */
|
|
5900
7677
|
type: 'backend' | 'web' | 'mobile';
|
|
5901
7678
|
/** Path to the app */
|
|
@@ -5905,7 +7682,7 @@ interface NormalizedAppConfig extends Omit<AppConfigBase, 'type'> {
|
|
|
5905
7682
|
/** Resolved dependencies array (empty array if none) */
|
|
5906
7683
|
dependencies: string[];
|
|
5907
7684
|
/** Resolved deploy target (app.deploy > deploy.default > 'dokploy') */
|
|
5908
|
-
resolvedDeployTarget:
|
|
7685
|
+
resolvedDeployTarget: DeployTargetName;
|
|
5909
7686
|
/** Entry file path for non-gkm apps */
|
|
5910
7687
|
entry?: string;
|
|
5911
7688
|
/** Framework for the app */
|
|
@@ -5935,6 +7712,12 @@ interface NormalizedWorkspace {
|
|
|
5935
7712
|
constructs?: Routes;
|
|
5936
7713
|
/** Normalized app configurations */
|
|
5937
7714
|
apps: Record<string, NormalizedAppConfig>;
|
|
7715
|
+
/** Each deployed stage's base domain */
|
|
7716
|
+
domains?: DomainsConfig;
|
|
7717
|
+
/** Subdomains no tenant may take, beyond every app's own */
|
|
7718
|
+
protectedSubdomains?: readonly string[];
|
|
7719
|
+
/** Each root domain's DNS provider */
|
|
7720
|
+
dns?: WorkspaceDnsConfig;
|
|
5938
7721
|
/** Deploy configuration (empty object if not specified) */
|
|
5939
7722
|
deploy: DeployConfig;
|
|
5940
7723
|
/** Shared packages configuration (empty object if not specified) */
|
|
@@ -5945,6 +7728,10 @@ interface NormalizedWorkspace {
|
|
|
5945
7728
|
secrets: SecretsConfig;
|
|
5946
7729
|
/** State provider configuration (undefined = local filesystem) */
|
|
5947
7730
|
state?: StateConfig;
|
|
7731
|
+
/** What `gkm test` hands a feature test (empty object if not specified) */
|
|
7732
|
+
test: TestConfig;
|
|
7733
|
+
/** How `gkm dev` is reached, when configured */
|
|
7734
|
+
dev?: DevConfig;
|
|
5948
7735
|
}
|
|
5949
7736
|
/**
|
|
5950
7737
|
* Result of loading and processing a configuration.
|
|
@@ -5964,6 +7751,11 @@ interface LoadedConfig {
|
|
|
5964
7751
|
* two chances to disagree. Absent when the workspace declares no constructs.
|
|
5965
7752
|
*/
|
|
5966
7753
|
manifest?: ConstructManifest;
|
|
7754
|
+
/**
|
|
7755
|
+
* The files each Worker's crons, queues and subscribers are declared in,
|
|
7756
|
+
* read in the same discovery — what says which app a worker is built from.
|
|
7757
|
+
*/
|
|
7758
|
+
background?: Record<string, string[]>;
|
|
5967
7759
|
}
|
|
5968
7760
|
/**
|
|
5969
7761
|
* Type guard to check if a config is a WorkspaceConfig.
|
|
@@ -5980,53 +7772,7 @@ interface LoadedConfig {
|
|
|
5980
7772
|
declare function isWorkspaceConfig(config: GkmConfig | WorkspaceConfig): config is WorkspaceConfig;
|
|
5981
7773
|
//#endregion
|
|
5982
7774
|
//#region src/types.d.ts
|
|
5983
|
-
|
|
5984
|
-
paths: string | string[];
|
|
5985
|
-
partition: (filepath: string) => string;
|
|
5986
|
-
}
|
|
5987
|
-
type Routes = string | string[] | PartitionedRoutes;
|
|
5988
|
-
interface ProviderConfig {
|
|
5989
|
-
enabled?: boolean;
|
|
5990
|
-
outputDir?: string;
|
|
5991
|
-
}
|
|
5992
|
-
interface AWSApiGatewayConfig extends ProviderConfig {}
|
|
5993
|
-
interface AWSLambdaConfig extends ProviderConfig {}
|
|
5994
|
-
interface ProductionConfig {
|
|
5995
|
-
/** Enable production mode (default: false) */
|
|
5996
|
-
enabled?: boolean;
|
|
5997
|
-
/** Bundle server into single file (default: true) */
|
|
5998
|
-
bundle?: boolean;
|
|
5999
|
-
/** Minify bundled output (default: true) */
|
|
6000
|
-
minify?: boolean;
|
|
6001
|
-
/** Health check endpoint path (default: '/health') */
|
|
6002
|
-
healthCheck?: string;
|
|
6003
|
-
/** Enable graceful shutdown handling (default: true) */
|
|
6004
|
-
gracefulShutdown?: boolean;
|
|
6005
|
-
/** Packages to exclude from bundling (default: []) */
|
|
6006
|
-
external?: string[];
|
|
6007
|
-
/** Include subscribers in production build (default: 'exclude' for serverless) */
|
|
6008
|
-
subscribers?: 'include' | 'exclude';
|
|
6009
|
-
/** Include OpenAPI spec in production (default: false) */
|
|
6010
|
-
openapi?: boolean;
|
|
6011
|
-
/**
|
|
6012
|
-
* Enable build-time optimized handler generation (default: true)
|
|
6013
|
-
* Generates specialized handlers based on endpoint tier:
|
|
6014
|
-
* - minimal: Near-raw-Hono performance for simple endpoints
|
|
6015
|
-
* - standard: Optimized handlers for auth/services
|
|
6016
|
-
* - full: Uses HonoEndpoint.addRoutes for complex endpoints
|
|
6017
|
-
*/
|
|
6018
|
-
optimizedHandlers?: boolean;
|
|
6019
|
-
}
|
|
6020
|
-
/**
|
|
6021
|
-
* Supported event backend types.
|
|
6022
|
-
*
|
|
6023
|
-
* - `pgboss`: Reuses PostgreSQL with a dedicated user/schema. Auto-enables db service.
|
|
6024
|
-
* - `sns`: Adds LocalStack container with SNS+SQS services.
|
|
6025
|
-
* - `rabbitmq`: Adds RabbitMQ container.
|
|
6026
|
-
*
|
|
6027
|
-
* All backends generate EVENT_PUBLISHER_CONNECTION_STRING and EVENT_SUBSCRIBER_CONNECTION_STRING.
|
|
6028
|
-
*/
|
|
6029
|
-
type EventsBackend = 'pgboss' | 'sns' | 'rabbitmq';
|
|
7775
|
+
type Routes = string | string[];
|
|
6030
7776
|
/**
|
|
6031
7777
|
* Where a declared cache actually lives.
|
|
6032
7778
|
*
|
|
@@ -6043,8 +7789,12 @@ type EventsBackend = 'pgboss' | 'sns' | 'rabbitmq';
|
|
|
6043
7789
|
* - `db` — a table in the database the app already declared. No infrastructure
|
|
6044
7790
|
* at all, and the same relationship pg-boss has to Postgres: it creates its
|
|
6045
7791
|
* own table on first use and needs a declared database to live in.
|
|
7792
|
+
* - `redis` — a Redis the stack runs beside the apps, on its network. It holds
|
|
7793
|
+
* *every* declared cache, one declared from a database included, so the
|
|
7794
|
+
* cache never competes with the database for its connections. Only the
|
|
7795
|
+
* compose target selects it today (`gkm compose`).
|
|
6046
7796
|
*/
|
|
6047
|
-
type CacheBackend = 'upstash' | 'elasticache' | 'db';
|
|
7797
|
+
type CacheBackend = 'upstash' | 'elasticache' | 'db' | 'redis';
|
|
6048
7798
|
/**
|
|
6049
7799
|
* Who delivers a declared app's mail.
|
|
6050
7800
|
*
|
|
@@ -6071,17 +7821,11 @@ interface DockerConfig {
|
|
|
6071
7821
|
registry?: string;
|
|
6072
7822
|
/** Docker image name (default: derived from package.json name) */
|
|
6073
7823
|
imageName?: string;
|
|
6074
|
-
/** Base Docker image (default: 'node:22-alpine') */
|
|
7824
|
+
/** Base Docker image (default: 'node:22.23.4-alpine', a Node security release) */
|
|
6075
7825
|
baseImage?: string;
|
|
6076
7826
|
/** Container port (default: 3000) */
|
|
6077
7827
|
port?: number;
|
|
6078
7828
|
}
|
|
6079
|
-
interface ServerConfig extends ProviderConfig {
|
|
6080
|
-
enableOpenApi?: boolean;
|
|
6081
|
-
port?: number;
|
|
6082
|
-
/** Production build configuration */
|
|
6083
|
-
production?: ProductionConfig;
|
|
6084
|
-
}
|
|
6085
7829
|
type Runtime = 'node' | 'bun';
|
|
6086
7830
|
interface TelescopeConfig {
|
|
6087
7831
|
/** Enable/disable telescope (default: true in development) */
|
|
@@ -6099,14 +7843,6 @@ interface TelescopeConfig {
|
|
|
6099
7843
|
/** Enable WebSocket for real-time updates (default: true, requires @hono/node-ws for Node.js) */
|
|
6100
7844
|
websocket?: boolean;
|
|
6101
7845
|
}
|
|
6102
|
-
interface StudioConfig {
|
|
6103
|
-
/** Enable/disable studio (default: true in development) */
|
|
6104
|
-
enabled?: boolean;
|
|
6105
|
-
/** Path prefix for studio UI (default: /__studio) */
|
|
6106
|
-
path?: string;
|
|
6107
|
-
/** Schema to introspect (default: 'public') */
|
|
6108
|
-
schema?: string;
|
|
6109
|
-
}
|
|
6110
7846
|
interface OpenApiConfig {
|
|
6111
7847
|
/** Enable OpenAPI generation (default: true) */
|
|
6112
7848
|
enabled?: boolean;
|
|
@@ -6144,34 +7880,6 @@ interface HooksConfig {
|
|
|
6144
7880
|
*/
|
|
6145
7881
|
server?: string;
|
|
6146
7882
|
}
|
|
6147
|
-
/** Dokploy deployment configuration */
|
|
6148
|
-
interface DokployProviderConfig {
|
|
6149
|
-
/** Dokploy API endpoint (e.g., 'https://dokploy.example.com') */
|
|
6150
|
-
endpoint: string;
|
|
6151
|
-
/** Project ID in Dokploy */
|
|
6152
|
-
projectId: string;
|
|
6153
|
-
/** Application ID in Dokploy */
|
|
6154
|
-
applicationId: string;
|
|
6155
|
-
/** Container registry (overrides docker.registry if set) */
|
|
6156
|
-
registry?: string;
|
|
6157
|
-
/** Registry ID in Dokploy (recommended for private registries) */
|
|
6158
|
-
registryId?: string;
|
|
6159
|
-
}
|
|
6160
|
-
interface ProvidersConfig {
|
|
6161
|
-
aws?: {
|
|
6162
|
-
apiGateway?: {
|
|
6163
|
-
v1?: boolean | AWSApiGatewayConfig;
|
|
6164
|
-
v2?: boolean | AWSApiGatewayConfig;
|
|
6165
|
-
};
|
|
6166
|
-
lambda?: {
|
|
6167
|
-
functions?: boolean | AWSLambdaConfig;
|
|
6168
|
-
crons?: boolean | AWSLambdaConfig;
|
|
6169
|
-
};
|
|
6170
|
-
};
|
|
6171
|
-
server?: boolean | ServerConfig;
|
|
6172
|
-
/** Dokploy deployment configuration */
|
|
6173
|
-
dokploy?: boolean | DokployProviderConfig;
|
|
6174
|
-
}
|
|
6175
7883
|
interface GkmConfig {
|
|
6176
7884
|
/**
|
|
6177
7885
|
* What this app is called, and therefore how everything it declares is named.
|
|
@@ -6195,6 +7903,10 @@ interface GkmConfig {
|
|
|
6195
7903
|
stages: StagesConfig;
|
|
6196
7904
|
/** Encrypted secrets, and where deployed stages' secrets are stored */
|
|
6197
7905
|
secrets?: SecretsConfig;
|
|
7906
|
+
/** What `gkm test` hands a feature test: where the factories are. */
|
|
7907
|
+
test?: TestConfig;
|
|
7908
|
+
/** How `gkm dev` is reached: the discovery endpoint's port and origins. */
|
|
7909
|
+
dev?: DevConfig;
|
|
6198
7910
|
/**
|
|
6199
7911
|
* Constructs glob pattern — one glob, every kind.
|
|
6200
7912
|
*
|
|
@@ -6206,7 +7918,6 @@ interface GkmConfig {
|
|
|
6206
7918
|
* @example './src/**\/*.ts'
|
|
6207
7919
|
*/
|
|
6208
7920
|
constructs: Routes;
|
|
6209
|
-
providers?: ProvidersConfig;
|
|
6210
7921
|
/**
|
|
6211
7922
|
* Server lifecycle hooks for customizing the Hono app.
|
|
6212
7923
|
* Allows adding custom routes, middleware, error handlers, etc.
|
|
@@ -6225,16 +7936,6 @@ interface GkmConfig {
|
|
|
6225
7936
|
* - A TelescopeConfig object for inline configuration
|
|
6226
7937
|
*/
|
|
6227
7938
|
telescope?: string | boolean | TelescopeConfig;
|
|
6228
|
-
/**
|
|
6229
|
-
* Studio configuration for database browsing.
|
|
6230
|
-
* Can be:
|
|
6231
|
-
* - A string path to a module that exports a Studio instance (recommended)
|
|
6232
|
-
* - A boolean to enable/disable with defaults
|
|
6233
|
-
* - A StudioConfig object for inline configuration
|
|
6234
|
-
*
|
|
6235
|
-
* Requires a database connection configured via services.
|
|
6236
|
-
*/
|
|
6237
|
-
studio?: string | boolean | StudioConfig;
|
|
6238
7939
|
/**
|
|
6239
7940
|
* OpenAPI generation configuration.
|
|
6240
7941
|
* Can be:
|
|
@@ -6297,7 +7998,11 @@ interface GkmConfig {
|
|
|
6297
7998
|
* a rename rather than a rewrite.
|
|
6298
7999
|
*/
|
|
6299
8000
|
deploy?: DeployConfig;
|
|
8001
|
+
/** Each deployed stage's base domain — the same field a workspace has. */
|
|
8002
|
+
domains?: DomainsConfig;
|
|
8003
|
+
/** Each root domain's DNS provider — the same field a workspace has. */
|
|
8004
|
+
dns?: WorkspaceDnsConfig;
|
|
6300
8005
|
}
|
|
6301
8006
|
//#endregion
|
|
6302
|
-
export {
|
|
6303
|
-
//# sourceMappingURL=types-
|
|
8007
|
+
export { TargetOptions as $, BackendFramework as A, ReleasedImage as At, isPhase2DeployTarget as B, SandboxExecOptions as Bt, SecretsConfig as C, DiscoverOptions as Ct, WorkspaceConfig as D, StateLocked as Dt, StageTelemetryConfig as E, LocalStateInCi as Et, SUPPORTED_DEPLOY_TARGETS as F, DeployIdentity as Ft, DeployPhaseContext as G, GkmError as Gt, validateWorkspaceConfig as H, SandboxResult as Ht, WorkspaceConfigSchema as I, deployIdentity as It, DeployTarget as J, DeployRuntime as K, formatValidationErrors as L, SECRETS_DIR_ENV as Lt, FrontendFramework as M, GithubActor as Mt, MobileFramework as N, LocalActor as Nt, WorkspaceInput as O, StateStore as Ot, PHASE_2_DEPLOY_TARGETS as P, StageSecrets as Pt, TargetEvent as Q, getDeployTargetError as R, Sandbox as Rt, OtlpTelemetryConfig as S, ConstructsNotSerializable as St, SharedConfig as T, isDeclarable as Tt, AnyDeployTarget as U, SecretNameInvalid as Ut, safeValidateWorkspaceConfig as V, SandboxOutput as Vt, DeployFailure as W, confineCwd as Wt, DeployTargetEntry as X, DeployTargetCapabilities as Y, DeployTargetLogger as Z, InferredWorkspaceConfig as _, StoredCredentialsOptions as _t, Routes as a, DeployPhase as at, NormalizedAppConfig as b, ProviderKind as bt, AppInput as c, AppDeployResult as ct, ConstrainedApps as d, Credential as dt, TargetOptionsIssue as et, DeployConfig as f, CredentialKind as ft, InferAppNames as g, MissingCredential as gt, DokployWorkspaceConfig as h, CredentialRequest as ht, OpenApiConfig as i, DeployEventType as it, Framework as j, Actor as jt, isWorkspaceConfig as k, StateVersionConflict as kt, AppsRecord as l, DeployResult as lt, DevConfig as m, CredentialProvider as mt, EmailBackend as n, DeployEvent as nt, AppConfig as o, ResourceChange as ot, DeployTargetName as p, CredentialKinds as pt, DeploySecrets as q, GkmConfig as r, DeployEventError as rt, AppConfigInput as s, ResourceVia as st, CacheBackend as t, TargetOptionsSchema as tt, ComposeWorkspaceConfig as u, AwsCredential as ut, LoadedConfig as v, chainCredentials as vt, SelfHostedTelemetryConfig as w, discover as wt, NormalizedWorkspace as x, ConstructDiscoveryFailed as xt, ModelsConfig as y, storedCredentials as yt, isDeployTargetSupported as z, SandboxCwdEscape as zt };
|
|
8008
|
+
//# sourceMappingURL=types-wLlwkSib.d.mts.map
|