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