@geekmidas/cli 10.0.0-alpha.87 → 10.0.0-alpha.89

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.
Files changed (180) hide show
  1. package/dist/GoDaddyProvider--36rw8cP.mjs +387 -0
  2. package/dist/GoDaddyProvider--36rw8cP.mjs.map +1 -0
  3. package/dist/GoDaddyProvider-DnRor066.cjs +387 -0
  4. package/dist/GoDaddyProvider-DnRor066.cjs.map +1 -0
  5. package/dist/{HostingerProvider-CVc3rLPB.mjs → HostingerProvider-BI6J7oJr.mjs} +2 -2
  6. package/dist/{HostingerProvider-CVc3rLPB.mjs.map → HostingerProvider-BI6J7oJr.mjs.map} +1 -1
  7. package/dist/{HostingerProvider-BCB1QJj1.cjs → HostingerProvider-CyTpG_jy.cjs} +2 -2
  8. package/dist/{HostingerProvider-BCB1QJj1.cjs.map → HostingerProvider-CyTpG_jy.cjs.map} +1 -1
  9. package/dist/{LegacyStateStore-CWG_HVC0.cjs → LegacyStateStore-BaBoYl59.cjs} +2 -2
  10. package/dist/{LegacyStateStore-CWG_HVC0.cjs.map → LegacyStateStore-BaBoYl59.cjs.map} +1 -1
  11. package/dist/{LegacyStateStore-B0R4LlX_.mjs → LegacyStateStore-CO7bzJCU.mjs} +2 -2
  12. package/dist/{LegacyStateStore-B0R4LlX_.mjs.map → LegacyStateStore-CO7bzJCU.mjs.map} +1 -1
  13. package/dist/{LocalStateStore-CLwa2DpK.cjs → LocalStateStore-CUWh2BWU.cjs} +2 -2
  14. package/dist/{LocalStateStore-CLwa2DpK.cjs.map → LocalStateStore-CUWh2BWU.cjs.map} +1 -1
  15. package/dist/{LocalStateStore-Q4vXg2ua.mjs → LocalStateStore-C_hYDv6I.mjs} +2 -2
  16. package/dist/{LocalStateStore-Q4vXg2ua.mjs.map → LocalStateStore-C_hYDv6I.mjs.map} +1 -1
  17. package/dist/{S3StateStore-Cea9_5gF.cjs → S3StateStore-O8EYfjfG.cjs} +2 -2
  18. package/dist/{S3StateStore-Cea9_5gF.cjs.map → S3StateStore-O8EYfjfG.cjs.map} +1 -1
  19. package/dist/{S3StateStore-CksKYKRa.mjs → S3StateStore-hIm8Rrmu.mjs} +2 -2
  20. package/dist/{S3StateStore-CksKYKRa.mjs.map → S3StateStore-hIm8Rrmu.mjs.map} +1 -1
  21. package/dist/{SSMStateStore-aBOTF018.cjs → SSMStateStore-DIzbiqCz.cjs} +2 -2
  22. package/dist/{SSMStateStore-aBOTF018.cjs.map → SSMStateStore-DIzbiqCz.cjs.map} +1 -1
  23. package/dist/{SSMStateStore-BszSCAS2.mjs → SSMStateStore-IvcjTk8h.mjs} +2 -2
  24. package/dist/{SSMStateStore-BszSCAS2.mjs.map → SSMStateStore-IvcjTk8h.mjs.map} +1 -1
  25. package/dist/SubscriberGenerator-BPqQf8fB.mjs.map +1 -1
  26. package/dist/SubscriberGenerator-BVn7cQ-2.cjs.map +1 -1
  27. package/dist/{add-5MZAXybv.cjs → add-C9qX4Juc.cjs} +30 -7
  28. package/dist/add-C9qX4Juc.cjs.map +1 -0
  29. package/dist/{add-D_jNqnfZ.mjs → add-v3tCbrpE.mjs} +30 -7
  30. package/dist/add-v3tCbrpE.mjs.map +1 -0
  31. package/dist/{bundler-1REMhKps.cjs → bundler-C4NmpRTD.cjs} +5 -5
  32. package/dist/{bundler-1REMhKps.cjs.map → bundler-C4NmpRTD.cjs.map} +1 -1
  33. package/dist/{bundler-BMo-JP5s.mjs → bundler-C_fCgcVO.mjs} +5 -5
  34. package/dist/{bundler-BMo-JP5s.mjs.map → bundler-C_fCgcVO.mjs.map} +1 -1
  35. package/dist/{cli-BL8ZHsLQ.cjs → cli-C85Dut8K.cjs} +6 -5
  36. package/dist/cli-C85Dut8K.cjs.map +1 -0
  37. package/dist/{cli-7edNFwGk.mjs → cli-REdO9X5b.mjs} +7 -6
  38. package/dist/cli-REdO9X5b.mjs.map +1 -0
  39. package/dist/{compose-xw86kVYi.cjs → compose-BvrhDwJ6.cjs} +556 -30
  40. package/dist/compose-BvrhDwJ6.cjs.map +1 -0
  41. package/dist/{compose-DbJhRQlh.mjs → compose-Dn0oAgQ0.mjs} +509 -31
  42. package/dist/compose-Dn0oAgQ0.mjs.map +1 -0
  43. package/dist/{config-DrCAyoH5.d.mts → config-CdEcTrjG.d.mts} +3 -3
  44. package/dist/{config-CpjsVxru.d.cts.map → config-CdEcTrjG.d.mts.map} +1 -1
  45. package/dist/{config-CpjsVxru.d.cts → config-pST7E0CS.d.cts} +3 -3
  46. package/dist/{config-DrCAyoH5.d.mts.map → config-pST7E0CS.d.cts.map} +1 -1
  47. package/dist/config.cjs +1 -1
  48. package/dist/config.d.cts +3 -3
  49. package/dist/config.d.mts +3 -3
  50. package/dist/config.mjs +1 -1
  51. package/dist/{credentials-tr26-KML.cjs → credentials-BKfIugu2.cjs} +47 -2
  52. package/dist/credentials-BKfIugu2.cjs.map +1 -0
  53. package/dist/{credentials-BgJ5mS_d.mjs → credentials-CnVqoXMb.mjs} +30 -3
  54. package/dist/credentials-CnVqoXMb.mjs.map +1 -0
  55. package/dist/databases-BY-pEImp.cjs.map +1 -1
  56. package/dist/databases-CzszQV0N.mjs.map +1 -1
  57. package/dist/deploy/public.cjs +10 -10
  58. package/dist/deploy/public.d.cts +9 -3
  59. package/dist/deploy/public.d.cts.map +1 -1
  60. package/dist/deploy/public.d.mts +9 -3
  61. package/dist/deploy/public.d.mts.map +1 -1
  62. package/dist/deploy/public.mjs +10 -10
  63. package/dist/{deploy-BTfmXd3g.mjs → deploy-BaERRh0Q.mjs} +10 -8
  64. package/dist/deploy-BaERRh0Q.mjs.map +1 -0
  65. package/dist/{deploy-CtbZj4zN.cjs → deploy-DbBGo3a6.cjs} +10 -8
  66. package/dist/deploy-DbBGo3a6.cjs.map +1 -0
  67. package/dist/{dokploy-r69yZaIt.mjs → dokploy-CMmD_ddX.mjs} +2 -2
  68. package/dist/{dokploy-r69yZaIt.mjs.map → dokploy-CMmD_ddX.mjs.map} +1 -1
  69. package/dist/{dokploy-TGk3oPwr.cjs → dokploy-DwAaKA9B.cjs} +2 -2
  70. package/dist/{dokploy-TGk3oPwr.cjs.map → dokploy-DwAaKA9B.cjs.map} +1 -1
  71. package/dist/{encryption-C-8Tt5Hh.mjs → encryption-BQmhq9_y.mjs} +3 -3
  72. package/dist/{encryption-C-8Tt5Hh.mjs.map → encryption-BQmhq9_y.mjs.map} +1 -1
  73. package/dist/{encryption-CDn7BH5O.cjs → encryption-BrN_9_CM.cjs} +3 -3
  74. package/dist/{encryption-CDn7BH5O.cjs.map → encryption-BrN_9_CM.cjs.map} +1 -1
  75. package/dist/{engine-jAINgiOB.mjs → engine-DILocOOH.mjs} +23 -404
  76. package/dist/engine-DILocOOH.mjs.map +1 -0
  77. package/dist/{engine-Bt5k_UMq.cjs → engine-DgHoFBMw.cjs} +25 -406
  78. package/dist/engine-DgHoFBMw.cjs.map +1 -0
  79. package/dist/{github-DFhuJQlp.cjs → github-Bf7pz6AV.cjs} +3 -3
  80. package/dist/{github-DFhuJQlp.cjs.map → github-Bf7pz6AV.cjs.map} +1 -1
  81. package/dist/{github-CZHAtwPT.mjs → github-xzg99wz8.mjs} +3 -3
  82. package/dist/{github-CZHAtwPT.mjs.map → github-xzg99wz8.mjs.map} +1 -1
  83. package/dist/{index-MnUJuUlj.d.mts → index-D-F_hTDz.d.cts} +21 -4
  84. package/dist/index-D-F_hTDz.d.cts.map +1 -0
  85. package/dist/{index-elsLJTUv.d.cts → index-YFNxR5Ns.d.mts} +21 -4
  86. package/dist/index-YFNxR5Ns.d.mts.map +1 -0
  87. package/dist/index.cjs +305 -69
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.mjs +306 -71
  90. package/dist/index.mjs.map +1 -1
  91. package/dist/{local-Cq8qdgNX.cjs → local-BjxDfPvy.cjs} +2 -2
  92. package/dist/{local-Cq8qdgNX.cjs.map → local-BjxDfPvy.cjs.map} +1 -1
  93. package/dist/{local-Ciq-bTPr.mjs → local-IuoIF3CT.mjs} +2 -2
  94. package/dist/{local-Ciq-bTPr.mjs.map → local-IuoIF3CT.mjs.map} +1 -1
  95. package/dist/{migrate-B1rVlwj1.cjs → migrate-7xayVtzL.cjs} +3 -3
  96. package/dist/{migrate-B1rVlwj1.cjs.map → migrate-7xayVtzL.cjs.map} +1 -1
  97. package/dist/{migrate-ggkPVJRC.mjs → migrate-CKLJ73OO.mjs} +4 -4
  98. package/dist/{migrate-ggkPVJRC.mjs.map → migrate-CKLJ73OO.mjs.map} +1 -1
  99. package/dist/{migrate-Dn7nK6sh.mjs → migrate-CpmO5qnl.mjs} +3 -3
  100. package/dist/{migrate-Dn7nK6sh.mjs.map → migrate-CpmO5qnl.mjs.map} +1 -1
  101. package/dist/{migrate-B16qgYTn.cjs → migrate-DPF7ZF8M.cjs} +3 -3
  102. package/dist/{migrate-B16qgYTn.cjs.map → migrate-DPF7ZF8M.cjs.map} +1 -1
  103. package/dist/openapi.cjs +1 -1
  104. package/dist/openapi.d.cts +1 -1
  105. package/dist/openapi.d.mts +1 -1
  106. package/dist/openapi.mjs +1 -1
  107. package/dist/ready-BpNbORRB.cjs.map +1 -1
  108. package/dist/ready-b6vm0-W-.mjs.map +1 -1
  109. package/dist/reconcile/public.d.cts +1 -1
  110. package/dist/reconcile/public.d.mts +1 -1
  111. package/dist/{reconcile--I7V4Klj.mjs → reconcile-Dh1Jk7WE.mjs} +2 -2
  112. package/dist/{reconcile--I7V4Klj.mjs.map → reconcile-Dh1Jk7WE.mjs.map} +1 -1
  113. package/dist/{resolve-BSke45k6.mjs → resolve-Dv_weZoh.mjs} +4 -4
  114. package/dist/{resolve-BSke45k6.mjs.map → resolve-Dv_weZoh.mjs.map} +1 -1
  115. package/dist/{resolve-BXeXzpmU.cjs → resolve-dlKPFNgv.cjs} +4 -4
  116. package/dist/{resolve-BXeXzpmU.cjs.map → resolve-dlKPFNgv.cjs.map} +1 -1
  117. package/dist/{rollback-DFMiBWf0.cjs → rollback-65VVIdBM.cjs} +6 -6
  118. package/dist/{rollback-DFMiBWf0.cjs.map → rollback-65VVIdBM.cjs.map} +1 -1
  119. package/dist/{rollback-CEE6dse4.mjs → rollback-DpSU2DsD.mjs} +6 -6
  120. package/dist/{rollback-CEE6dse4.mjs.map → rollback-DpSU2DsD.mjs.map} +1 -1
  121. package/dist/{runtime-HabiNBtJ.d.mts → runtime-CN_kmqxo.d.cts} +2 -2
  122. package/dist/{runtime-D48ZKk8_.d.cts.map → runtime-CN_kmqxo.d.cts.map} +1 -1
  123. package/dist/{runtime-D48ZKk8_.d.cts → runtime-Cjvon3oj.d.mts} +2 -2
  124. package/dist/{runtime-HabiNBtJ.d.mts.map → runtime-Cjvon3oj.d.mts.map} +1 -1
  125. package/dist/{seeds-CsI0A_Ef.cjs → seeds-CN6tB-va.cjs} +646 -187
  126. package/dist/{seeds-CsI0A_Ef.cjs.map → seeds-CN6tB-va.cjs.map} +1 -1
  127. package/dist/{seeds-BYdrtZsC.mjs → seeds-perzdN81.mjs} +599 -164
  128. package/dist/seeds-perzdN81.mjs.map +1 -0
  129. package/dist/{sniffer-B0EU73bj.mjs → sniffer-BTtX3NUM.mjs} +3 -3
  130. package/dist/{sniffer-B0EU73bj.mjs.map → sniffer-BTtX3NUM.mjs.map} +1 -1
  131. package/dist/{sniffer-DJYupBeK.cjs → sniffer-IAQEpsQb.cjs} +3 -3
  132. package/dist/{sniffer-DJYupBeK.cjs.map → sniffer-IAQEpsQb.cjs.map} +1 -1
  133. package/dist/{sst-DAqUoZKG.cjs → sst-BgcOsaBi.cjs} +3 -3
  134. package/dist/{sst-DAqUoZKG.cjs.map → sst-BgcOsaBi.cjs.map} +1 -1
  135. package/dist/{sst-D1Qj4sIs.mjs → sst-CJzvyrEz.mjs} +3 -3
  136. package/dist/{sst-D1Qj4sIs.mjs.map → sst-CJzvyrEz.mjs.map} +1 -1
  137. package/dist/{stages-Brn3vcdy.cjs → stages-CUn6gvXL.cjs} +2 -2
  138. package/dist/{stages-Brn3vcdy.cjs.map → stages-CUn6gvXL.cjs.map} +1 -1
  139. package/dist/{stages-DoHHz6pS.mjs → stages-CnZRYmkI.mjs} +2 -2
  140. package/dist/{stages-DoHHz6pS.mjs.map → stages-CnZRYmkI.mjs.map} +1 -1
  141. package/dist/target/public.cjs +1 -1
  142. package/dist/target/public.d.cts +2 -2
  143. package/dist/target/public.d.mts +2 -2
  144. package/dist/target/public.mjs +1 -1
  145. package/dist/{terminal-BTbZlrFV.mjs → terminal-D8TPK7o9.mjs} +3 -3
  146. package/dist/{terminal-BTbZlrFV.mjs.map → terminal-D8TPK7o9.mjs.map} +1 -1
  147. package/dist/{terminal-COv23heb.cjs → terminal-DuapRxh6.cjs} +2 -2
  148. package/dist/{terminal-COv23heb.cjs.map → terminal-DuapRxh6.cjs.map} +1 -1
  149. package/dist/{types-0oAyFOfR.d.cts → types-NqX1Hz4P.d.cts} +210 -205
  150. package/dist/types-NqX1Hz4P.d.cts.map +1 -0
  151. package/dist/{types-BZ01tZs-.d.mts → types-ZHuZ89hv.d.mts} +210 -205
  152. package/dist/types-ZHuZ89hv.d.mts.map +1 -0
  153. package/dist/workspace/index.cjs +3 -1
  154. package/dist/workspace/index.d.cts +3 -3
  155. package/dist/workspace/index.d.mts +3 -3
  156. package/dist/workspace/index.mjs +2 -2
  157. package/dist/{workspace-D2CYLMCW.mjs → workspace-CJ0lKFq-.mjs} +231 -10
  158. package/dist/workspace-CJ0lKFq-.mjs.map +1 -0
  159. package/dist/{workspace-CT0JM3Y8.cjs → workspace-CwW3Gkru.cjs} +266 -9
  160. package/dist/workspace-CwW3Gkru.cjs.map +1 -0
  161. package/package.json +15 -15
  162. package/dist/add-5MZAXybv.cjs.map +0 -1
  163. package/dist/add-D_jNqnfZ.mjs.map +0 -1
  164. package/dist/cli-7edNFwGk.mjs.map +0 -1
  165. package/dist/cli-BL8ZHsLQ.cjs.map +0 -1
  166. package/dist/compose-DbJhRQlh.mjs.map +0 -1
  167. package/dist/compose-xw86kVYi.cjs.map +0 -1
  168. package/dist/credentials-BgJ5mS_d.mjs.map +0 -1
  169. package/dist/credentials-tr26-KML.cjs.map +0 -1
  170. package/dist/deploy-BTfmXd3g.mjs.map +0 -1
  171. package/dist/deploy-CtbZj4zN.cjs.map +0 -1
  172. package/dist/engine-Bt5k_UMq.cjs.map +0 -1
  173. package/dist/engine-jAINgiOB.mjs.map +0 -1
  174. package/dist/index-MnUJuUlj.d.mts.map +0 -1
  175. package/dist/index-elsLJTUv.d.cts.map +0 -1
  176. package/dist/seeds-BYdrtZsC.mjs.map +0 -1
  177. package/dist/types-0oAyFOfR.d.cts.map +0 -1
  178. package/dist/types-BZ01tZs-.d.mts.map +0 -1
  179. package/dist/workspace-CT0JM3Y8.cjs.map +0 -1
  180. package/dist/workspace-D2CYLMCW.mjs.map +0 -1
@@ -36,6 +36,72 @@ function assertKnownSecretsStore(store) {
36
36
  if (typeof provider === "string" && !SECRETS_STORE_PROVIDERS.includes(provider)) throw new UnknownSecretsStoreProvider(provider);
37
37
  }
38
38
  //#endregion
39
+ //#region src/compose/dnsConfig.ts
40
+ /**
41
+ * `dns['<root domain>'].records` — how a domain's hosts point at a compose
42
+ * stage's server — checked and read. Pure, and kept apart from the DNS step
43
+ * so the workspace schema checks a config with the same rules and the same
44
+ * named errors the step applies.
45
+ */
46
+ /** The stage-secret key holding the server's public IPv4 address. */
47
+ const SERVER_IPV4_KEY = "GKM_SERVER_IPV4";
48
+ /** The stage-secret key holding the server's public IPv6 address, if any. */
49
+ const SERVER_IPV6_KEY = "GKM_SERVER_IPV6";
50
+ /**
51
+ * Whether a stage secret is gkm's own — the server's address — and so never
52
+ * written into an app's or a worker's environment.
53
+ */
54
+ function isReservedStageKey(key) {
55
+ return key.startsWith("GKM_SERVER_");
56
+ }
57
+ /** A DNS hostname: dot-separated labels of letters, digits and inner '-'. */
58
+ const HOSTNAME = /^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/i;
59
+ /** Whether `value` is a DNS hostname with at least two labels. */
60
+ function isHostname(value) {
61
+ return typeof value === "string" && HOSTNAME.test(value);
62
+ }
63
+ /** A CNAME target that is not a hostname under its own domain. */
64
+ var DnsTargetInvalid = class extends Error {
65
+ domain;
66
+ target;
67
+ stage;
68
+ constructor(domain, target, stage) {
69
+ super(`dns['${domain}'].records.target${stage ? ` for '${stage}'` : ""} is ${JSON.stringify(target)}, which is not a hostname under ${domain}. Every host's CNAME points at it and gkm writes its A record, so it must be a name in the same zone — like 'server.${domain}'.`);
70
+ this.domain = domain;
71
+ this.target = target;
72
+ this.stage = stage;
73
+ this.name = "DnsTargetInvalid";
74
+ }
75
+ };
76
+ /** The CNAME target names under one domain, by the stage they are for, checked. */
77
+ function targets(records) {
78
+ const { target } = records;
79
+ if (target && typeof target === "object" && !Array.isArray(target)) return Object.entries(target);
80
+ return [[void 0, target]];
81
+ }
82
+ /**
83
+ * One domain's records mode checked.
84
+ *
85
+ * @throws {DnsTargetInvalid} for a target that is not a hostname under it
86
+ */
87
+ function checkDnsRecordsMode(domain, records) {
88
+ if (!records || typeof records !== "object") return;
89
+ const mode = records;
90
+ if (mode.mode !== "cname") return;
91
+ for (const [stage, target] of targets(mode)) {
92
+ const name = typeof target === "string" ? target.toLowerCase() : target;
93
+ if (!isHostname(name) || !name.endsWith(`.${domain.toLowerCase()}`)) throw new DnsTargetInvalid(domain, target, stage);
94
+ }
95
+ }
96
+ /**
97
+ * The CNAME target a domain's hosts point at on `stage`, or `undefined` for
98
+ * A records — including a per-stage map that names no target for it.
99
+ */
100
+ function cnameTarget(records, stage) {
101
+ if (!records || records === "a") return void 0;
102
+ return (typeof records.target === "string" ? records.target : records.target[stage])?.toLowerCase();
103
+ }
104
+ //#endregion
39
105
  //#region src/compose/proxy.ts
40
106
  /**
41
107
  * Which proxy a stage's stack is served by, and with whose certificate —
@@ -688,6 +754,33 @@ var UndeclaredStage = class extends Error {
688
754
  this.name = "UndeclaredStage";
689
755
  }
690
756
  };
757
+ /**
758
+ * A per-stage setting keyed by a stage the workspace does not deploy: a typo,
759
+ * a stage since removed, or the local stage, which none of them apply to.
760
+ */
761
+ var UnknownStageKey = class extends Error {
762
+ setting;
763
+ stage;
764
+ deployed;
765
+ local;
766
+ constructor(setting, stage, deployed, local) {
767
+ super(`${setting} names the stage '${stage}', ` + (stage === local ? `the local stage — ${setting} is read for deployed stages only. ` : "which is not one of this workspace's deployed stages. ") + `It takes ${deployed.length > 0 ? deployed.map((s) => `'${s}'`).join(", ") : "no stage: stages.deployed is empty"} — the stages in stages.deployed.`);
768
+ this.setting = setting;
769
+ this.stage = stage;
770
+ this.deployed = deployed;
771
+ this.local = local;
772
+ this.name = "UnknownStageKey";
773
+ }
774
+ };
775
+ /**
776
+ * The first key of a per-stage map that is not a deployed stage.
777
+ *
778
+ * @throws {UnknownStageKey}
779
+ */
780
+ function assertDeployedStageKeys(setting, map, stages) {
781
+ if (!map || !stages?.deployed) return;
782
+ for (const key of Object.keys(map)) if (!stages.deployed.includes(key)) throw new UnknownStageKey(setting, key, stages.deployed, stages.local);
783
+ }
691
784
  //#endregion
692
785
  //#region src/workspace/schema.ts
693
786
  /** Routes are a glob, or a list of them. */
@@ -894,10 +987,22 @@ require_schemas.object({
894
987
  unchanged: require_schemas.boolean()
895
988
  });
896
989
  /**
990
+ * How a domain's hosts point at a compose stage's server: an A (and AAAA)
991
+ * record each (`'a'`, the default), or one A record for `target` and a CNAME
992
+ * to it for every other host but the apex. `target` is one name, or one per
993
+ * stage; it must be under the domain.
994
+ */
995
+ const DnsRecordsModeSchema = require_schemas.union([require_schemas.literal("a"), require_schemas.object({
996
+ mode: require_schemas.literal("cname"),
997
+ target: require_schemas.union([require_schemas.string(), require_schemas.record(require_schemas.string(), require_schemas.string())])
998
+ }).strict()]);
999
+ /**
897
1000
  * Hostinger DNS provider config (without domain - domain is the record key).
898
1001
  */
899
1002
  const HostingerDnsProviderSchema = require_schemas.object({
900
1003
  provider: require_schemas.literal("hostinger"),
1004
+ /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1005
+ records: DnsRecordsModeSchema.optional(),
901
1006
  /** TTL in seconds (default: 300) */
902
1007
  ttl: require_schemas.number().int().positive().optional()
903
1008
  });
@@ -906,6 +1011,8 @@ const HostingerDnsProviderSchema = require_schemas.object({
906
1011
  */
907
1012
  const Route53DnsProviderSchema = require_schemas.object({
908
1013
  provider: require_schemas.literal("route53"),
1014
+ /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1015
+ records: DnsRecordsModeSchema.optional(),
909
1016
  /** AWS region (optional - uses AWS_REGION env var if not provided) */
910
1017
  region: AwsRegionSchema.optional(),
911
1018
  /** AWS profile name (optional - uses default credential chain if not provided) */
@@ -916,23 +1023,45 @@ const Route53DnsProviderSchema = require_schemas.object({
916
1023
  ttl: require_schemas.number().int().positive().optional()
917
1024
  });
918
1025
  /**
1026
+ * GoDaddy DNS provider config (without domain - domain is the record key).
1027
+ *
1028
+ * Credentials: `GODADDY_API_TOKEN` (a Personal Access Token scoped to
1029
+ * `domains.dns:update`), else `gkm login --provider godaddy`. GoDaddy refuses
1030
+ * a TTL under 600 seconds.
1031
+ */
1032
+ const GoDaddyDnsProviderSchema = require_schemas.object({
1033
+ provider: require_schemas.literal("godaddy"),
1034
+ /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1035
+ records: DnsRecordsModeSchema.optional(),
1036
+ /** TTL in seconds (default and minimum: 600) */
1037
+ ttl: require_schemas.number().int().min(600, "GoDaddy's minimum TTL is 600 seconds").optional()
1038
+ });
1039
+ /**
919
1040
  * Cloudflare DNS provider config (placeholder for future).
920
1041
  */
921
1042
  const CloudflareDnsProviderSchema = require_schemas.object({
922
1043
  provider: require_schemas.literal("cloudflare"),
1044
+ /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1045
+ records: DnsRecordsModeSchema.optional(),
923
1046
  /** TTL in seconds (default: 300) */
924
1047
  ttl: require_schemas.number().int().positive().optional()
925
1048
  });
926
1049
  /**
927
1050
  * Manual DNS configuration (user handles DNS themselves).
928
1051
  */
929
- const ManualDnsProviderSchema = require_schemas.object({ provider: require_schemas.literal("manual") });
1052
+ const ManualDnsProviderSchema = require_schemas.object({
1053
+ provider: require_schemas.literal("manual"),
1054
+ /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1055
+ records: DnsRecordsModeSchema.optional()
1056
+ });
930
1057
  /**
931
1058
  * Custom DNS provider config (user-provided implementation).
932
1059
  */
933
1060
  const CustomDnsProviderSchema = require_schemas.object({
934
1061
  /** Custom DnsProvider implementation */
935
1062
  provider: require_schemas.custom((val) => typeof val === "object" && val !== null && typeof val.name === "string" && typeof val.getRecords === "function" && typeof val.upsertRecords === "function", { message: "Custom DNS provider must implement name, getRecords(), and upsertRecords() methods" }),
1063
+ /** How the hosts point at a compose stage's server — see {@link DnsRecordsModeSchema}. */
1064
+ records: DnsRecordsModeSchema.optional(),
936
1065
  /** TTL in seconds (default: 300) */
937
1066
  ttl: require_schemas.number().int().positive().optional()
938
1067
  });
@@ -942,6 +1071,7 @@ const CustomDnsProviderSchema = require_schemas.object({
942
1071
  const BuiltInDnsProviderSchema = require_schemas.discriminatedUnion("provider", [
943
1072
  HostingerDnsProviderSchema,
944
1073
  Route53DnsProviderSchema,
1074
+ GoDaddyDnsProviderSchema,
945
1075
  CloudflareDnsProviderSchema,
946
1076
  ManualDnsProviderSchema
947
1077
  ]);
@@ -964,6 +1094,7 @@ const DnsProviderSchema = require_schemas.union([BuiltInDnsProviderSchema, Custo
964
1094
  * Supported providers:
965
1095
  * - 'hostinger': Use Hostinger DNS API
966
1096
  * - 'route53': Use AWS Route53
1097
+ * - 'godaddy': Use GoDaddy's v1 DNS API
967
1098
  * - 'cloudflare': Use Cloudflare DNS API (future)
968
1099
  * - 'manual': Don't create records, just print required records
969
1100
  * - Custom: Provide a DnsProvider implementation
@@ -971,20 +1102,19 @@ const DnsProviderSchema = require_schemas.union([BuiltInDnsProviderSchema, Custo
971
1102
  const DnsConfigSchema = require_schemas.record(require_schemas.string(), DnsProviderSchema);
972
1103
  const HostingerDnsConfigSchema = HostingerDnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
973
1104
  const Route53DnsConfigSchema = Route53DnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
1105
+ const GoDaddyDnsConfigSchema = GoDaddyDnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
974
1106
  const CloudflareDnsConfigSchema = CloudflareDnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
975
1107
  const ManualDnsConfigSchema = ManualDnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
976
1108
  const CustomDnsConfigSchema = CustomDnsProviderSchema.extend({ domain: require_schemas.string().min(1, "Domain is required") });
977
1109
  const BuiltInDnsConfigSchema = require_schemas.discriminatedUnion("provider", [
978
1110
  HostingerDnsConfigSchema,
979
1111
  Route53DnsConfigSchema,
1112
+ GoDaddyDnsConfigSchema,
980
1113
  CloudflareDnsConfigSchema,
981
1114
  ManualDnsConfigSchema
982
1115
  ]);
983
1116
  const LegacyDnsConfigSchema = require_schemas.union([BuiltInDnsConfigSchema, CustomDnsConfigSchema]);
984
- /**
985
- * Combined DNS config that supports both new multi-domain and legacy single-domain formats.
986
- */
987
- const DnsConfigWithLegacySchema = require_schemas.union([DnsConfigSchema, LegacyDnsConfigSchema]);
1117
+ require_schemas.union([DnsConfigSchema, LegacyDnsConfigSchema]);
988
1118
  /**
989
1119
  * Backups configuration schema.
990
1120
  *
@@ -1074,15 +1204,12 @@ const DeployConfigSchema = require_schemas.object({
1074
1204
  }).optional(),
1075
1205
  /** Whose deploy this is, on a target shared with other workspaces. */
1076
1206
  namespace: require_schemas.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "deploy.namespace must be lowercase letters and digits with single '-' between them").optional(),
1077
- /** Each deployed stage's base domain (stage name -> domain). */
1078
- domains: require_schemas.record(require_schemas.string(), require_schemas.string()).optional(),
1079
1207
  /** Where every target pushes and pulls the apps' images. */
1080
1208
  registry: require_schemas.string().min(1).optional(),
1081
1209
  dokploy: DokployWorkspaceConfigSchema.optional(),
1082
1210
  compose: ComposeWorkspaceConfigSchema.optional(),
1083
1211
  telemetry: TelemetryConfigSchema.optional(),
1084
1212
  objects: ObjectsConfigSchema.optional(),
1085
- dns: DnsConfigWithLegacySchema.optional(),
1086
1213
  backups: BackupsConfigSchema.optional()
1087
1214
  });
1088
1215
  /**
@@ -1275,6 +1402,10 @@ const WorkspaceConfigSchema = require_schemas.object({
1275
1402
  */
1276
1403
  apps: require_schemas.record(require_schemas.string(), AppConfigSchema).optional(),
1277
1404
  shared: SharedConfigSchema.optional(),
1405
+ /** Each deployed stage's base domain (stage name -> domain). */
1406
+ domains: require_schemas.record(require_schemas.string(), require_schemas.string()).optional(),
1407
+ /** Each root domain's DNS provider, and how its hosts are pointed. */
1408
+ dns: DnsConfigSchema.optional(),
1278
1409
  deploy: DeployConfigSchema.optional(),
1279
1410
  stages: StagesConfigSchema,
1280
1411
  secrets: SecretsConfigSchema.optional(),
@@ -1340,6 +1471,59 @@ const WorkspaceConfigSchema = require_schemas.object({
1340
1471
  path: ["deploy", "compose"]
1341
1472
  });
1342
1473
  }
1474
+ const perStage = [
1475
+ [
1476
+ "domains",
1477
+ ["domains"],
1478
+ data.domains
1479
+ ],
1480
+ [
1481
+ "deploy.objects",
1482
+ ["deploy", "objects"],
1483
+ data.deploy?.objects
1484
+ ],
1485
+ [
1486
+ "deploy.telemetry",
1487
+ ["deploy", "telemetry"],
1488
+ data.deploy?.telemetry
1489
+ ],
1490
+ ...Object.entries(data.dns ?? {}).map(([domain, entry]) => {
1491
+ const records = entry.records;
1492
+ const target = records && typeof records === "object" ? records.target : void 0;
1493
+ return [
1494
+ `dns['${domain}'].records.target`,
1495
+ [
1496
+ "dns",
1497
+ domain,
1498
+ "records",
1499
+ "target"
1500
+ ],
1501
+ target && typeof target === "object" ? target : void 0
1502
+ ];
1503
+ })
1504
+ ];
1505
+ for (const [setting, path, map] of perStage) try {
1506
+ assertDeployedStageKeys(setting, map, data.stages);
1507
+ } catch (error) {
1508
+ ctx.addIssue({
1509
+ code: "custom",
1510
+ message: error instanceof Error ? error.message : String(error),
1511
+ path
1512
+ });
1513
+ }
1514
+ for (const [domain, entry] of Object.entries(data.dns ?? {})) try {
1515
+ checkDnsRecordsMode(domain, entry.records);
1516
+ } catch (error) {
1517
+ ctx.addIssue({
1518
+ code: "custom",
1519
+ message: error instanceof Error ? error.message : String(error),
1520
+ path: [
1521
+ "dns",
1522
+ domain,
1523
+ "records"
1524
+ ]
1525
+ });
1526
+ }
1343
1527
  if (data.state?.provider === "ssm" && !data.name) ctx.addIssue({
1344
1528
  code: "custom",
1345
1529
  message: "Workspace name is required when using SSM state provider. Add \"name\" to your gkm.config.ts.",
@@ -1401,6 +1585,8 @@ const WORKSPACE_KEYS = /* @__PURE__ */ new Set([
1401
1585
  "constructs",
1402
1586
  "apps",
1403
1587
  "shared",
1588
+ "domains",
1589
+ "dns",
1404
1590
  "deploy",
1405
1591
  "stages",
1406
1592
  "secrets",
@@ -1534,6 +1720,8 @@ function normalizeWorkspace(config, cwd) {
1534
1720
  root: cwd,
1535
1721
  ...config.constructs ? { constructs: config.constructs } : {},
1536
1722
  apps: normalizedApps,
1723
+ ...config.domains ? { domains: config.domains } : {},
1724
+ ...config.dns ? { dns: config.dns } : {},
1537
1725
  deploy: config.deploy ?? { default: "dokploy" },
1538
1726
  shared: config.shared ?? { packages: ["packages/*"] },
1539
1727
  stages: validateStages(config.stages),
@@ -1579,6 +1767,8 @@ function wrapSingleAppAsWorkspace(config, cwd) {
1579
1767
  runtime: config.runtime,
1580
1768
  env: config.env
1581
1769
  } },
1770
+ ...config.domains ? { domains: config.domains } : {},
1771
+ ...config.dns ? { dns: config.dns } : {},
1582
1772
  deploy: {
1583
1773
  default: "dokploy",
1584
1774
  ...config.deploy
@@ -1609,10 +1799,41 @@ var DokployRegistryMoved = class extends Error {
1609
1799
  this.name = "DokployRegistryMoved";
1610
1800
  }
1611
1801
  };
1802
+ /**
1803
+ * `deploy.domains`, which became `domains` at the root of the config: a stage's
1804
+ * domain is a fact about the product every target and every command reads,
1805
+ * not a deploy setting.
1806
+ */
1807
+ var DomainsMoved = class extends Error {
1808
+ domains;
1809
+ constructor(domains) {
1810
+ super(`deploy.domains is now domains, at the root of gkm.config.ts. Move it out of deploy: defineWorkspace({ …, domains: ${JSON.stringify(domains)}, deploy: { … } }).`);
1811
+ this.domains = domains;
1812
+ this.name = "DomainsMoved";
1813
+ }
1814
+ };
1815
+ /**
1816
+ * `deploy.dns`, which became `dns` at the root of the config, keyed by root
1817
+ * domain.
1818
+ */
1819
+ var DnsMoved = class extends Error {
1820
+ dns;
1821
+ constructor(dns) {
1822
+ const legacy = dns && typeof dns === "object" && "domain" in dns && "provider" in dns;
1823
+ const { domain, ...rest } = legacy ? dns : {};
1824
+ super(`deploy.dns is now dns, at the root of gkm.config.ts, keyed by root domain. Move it out of deploy: defineWorkspace({ …, dns: ${JSON.stringify(legacy ? { [String(domain)]: rest } : dns)}, deploy: { … } }).`);
1825
+ this.dns = dns;
1826
+ this.name = "DnsMoved";
1827
+ }
1828
+ };
1612
1829
  /** Refuse a deploy key that has moved, naming where it lives now. */
1613
1830
  function assertNoMovedDeployKeys(deploy) {
1614
1831
  const dokploy = deploy?.dokploy;
1615
1832
  if (dokploy && typeof dokploy === "object" && "registry" in dokploy) throw new DokployRegistryMoved(dokploy.registry);
1833
+ if (deploy && typeof deploy === "object") {
1834
+ if ("domains" in deploy) throw new DomainsMoved(deploy.domains);
1835
+ if ("dns" in deploy) throw new DnsMoved(deploy.dns);
1836
+ }
1616
1837
  }
1617
1838
  function processConfig(config, cwd) {
1618
1839
  assertNoMovedDeployKeys(config.deploy);
@@ -1782,12 +2003,24 @@ Object.defineProperty(exports, "ComposeTlsFileMissing", {
1782
2003
  return ComposeTlsFileMissing;
1783
2004
  }
1784
2005
  });
2006
+ Object.defineProperty(exports, "DnsMoved", {
2007
+ enumerable: true,
2008
+ get: function() {
2009
+ return DnsMoved;
2010
+ }
2011
+ });
1785
2012
  Object.defineProperty(exports, "DokployRegistryMoved", {
1786
2013
  enumerable: true,
1787
2014
  get: function() {
1788
2015
  return DokployRegistryMoved;
1789
2016
  }
1790
2017
  });
2018
+ Object.defineProperty(exports, "DomainsMoved", {
2019
+ enumerable: true,
2020
+ get: function() {
2021
+ return DomainsMoved;
2022
+ }
2023
+ });
1791
2024
  Object.defineProperty(exports, "IamUserNotOwned", {
1792
2025
  enumerable: true,
1793
2026
  get: function() {
@@ -1860,6 +2093,18 @@ Object.defineProperty(exports, "SECRETS_STORE_PROVIDERS", {
1860
2093
  return SECRETS_STORE_PROVIDERS;
1861
2094
  }
1862
2095
  });
2096
+ Object.defineProperty(exports, "SERVER_IPV4_KEY", {
2097
+ enumerable: true,
2098
+ get: function() {
2099
+ return SERVER_IPV4_KEY;
2100
+ }
2101
+ });
2102
+ Object.defineProperty(exports, "SERVER_IPV6_KEY", {
2103
+ enumerable: true,
2104
+ get: function() {
2105
+ return SERVER_IPV6_KEY;
2106
+ }
2107
+ });
1863
2108
  Object.defineProperty(exports, "SUPPORTED_DEPLOY_TARGETS", {
1864
2109
  enumerable: true,
1865
2110
  get: function() {
@@ -1932,6 +2177,12 @@ Object.defineProperty(exports, "checkS3Config", {
1932
2177
  return checkS3Config;
1933
2178
  }
1934
2179
  });
2180
+ Object.defineProperty(exports, "cnameTarget", {
2181
+ enumerable: true,
2182
+ get: function() {
2183
+ return cnameTarget;
2184
+ }
2185
+ });
1935
2186
  Object.defineProperty(exports, "constructPatterns", {
1936
2187
  enumerable: true,
1937
2188
  get: function() {
@@ -1998,6 +2249,12 @@ Object.defineProperty(exports, "isPhase2DeployTarget", {
1998
2249
  return isPhase2DeployTarget;
1999
2250
  }
2000
2251
  });
2252
+ Object.defineProperty(exports, "isReservedStageKey", {
2253
+ enumerable: true,
2254
+ get: function() {
2255
+ return isReservedStageKey;
2256
+ }
2257
+ });
2001
2258
  Object.defineProperty(exports, "isWorkspaceConfig", {
2002
2259
  enumerable: true,
2003
2260
  get: function() {
@@ -2095,4 +2352,4 @@ Object.defineProperty(exports, "wrapSingleAppAsWorkspace", {
2095
2352
  }
2096
2353
  });
2097
2354
 
2098
- //# sourceMappingURL=workspace-CT0JM3Y8.cjs.map
2355
+ //# sourceMappingURL=workspace-CwW3Gkru.cjs.map