@geekmidas/cli 10.0.0-alpha.85 → 10.0.0-alpha.86

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 (175) hide show
  1. package/dist/{HostingerProvider-dxkwynSs.cjs → HostingerProvider-BCB1QJj1.cjs} +2 -2
  2. package/dist/{HostingerProvider-dxkwynSs.cjs.map → HostingerProvider-BCB1QJj1.cjs.map} +1 -1
  3. package/dist/{HostingerProvider-D85ayzTi.mjs → HostingerProvider-CVc3rLPB.mjs} +2 -2
  4. package/dist/{HostingerProvider-D85ayzTi.mjs.map → HostingerProvider-CVc3rLPB.mjs.map} +1 -1
  5. package/dist/{LegacyStateStore-CJ2o18nT.mjs → LegacyStateStore-B0R4LlX_.mjs} +2 -2
  6. package/dist/{LegacyStateStore-CJ2o18nT.mjs.map → LegacyStateStore-B0R4LlX_.mjs.map} +1 -1
  7. package/dist/{LegacyStateStore-xGxPwP-m.cjs → LegacyStateStore-CWG_HVC0.cjs} +7 -7
  8. package/dist/{LegacyStateStore-xGxPwP-m.cjs.map → LegacyStateStore-CWG_HVC0.cjs.map} +1 -1
  9. package/dist/{LocalStateStore-CkjFD-4b.cjs → LocalStateStore-CLwa2DpK.cjs} +8 -8
  10. package/dist/{LocalStateStore-CkjFD-4b.cjs.map → LocalStateStore-CLwa2DpK.cjs.map} +1 -1
  11. package/dist/{LocalStateStore-ByVjUIvS.mjs → LocalStateStore-Q4vXg2ua.mjs} +2 -2
  12. package/dist/{LocalStateStore-ByVjUIvS.mjs.map → LocalStateStore-Q4vXg2ua.mjs.map} +1 -1
  13. package/dist/{S3StateStore-iqMezbES.cjs → S3StateStore-Cea9_5gF.cjs} +5 -5
  14. package/dist/{S3StateStore-iqMezbES.cjs.map → S3StateStore-Cea9_5gF.cjs.map} +1 -1
  15. package/dist/{S3StateStore-kpFlGVLE.mjs → S3StateStore-CksKYKRa.mjs} +2 -2
  16. package/dist/{S3StateStore-kpFlGVLE.mjs.map → S3StateStore-CksKYKRa.mjs.map} +1 -1
  17. package/dist/{SSMStateStore-Bkz5ztfo.mjs → SSMStateStore-BszSCAS2.mjs} +2 -2
  18. package/dist/{SSMStateStore-Bkz5ztfo.mjs.map → SSMStateStore-BszSCAS2.mjs.map} +1 -1
  19. package/dist/{SSMStateStore-Z2OMVCtq.cjs → SSMStateStore-aBOTF018.cjs} +9 -9
  20. package/dist/{SSMStateStore-Z2OMVCtq.cjs.map → SSMStateStore-aBOTF018.cjs.map} +1 -1
  21. package/dist/{add-CM7RLj89.cjs → add-5MZAXybv.cjs} +8 -5
  22. package/dist/add-5MZAXybv.cjs.map +1 -0
  23. package/dist/{add-jpX7M8RB.mjs → add-D_jNqnfZ.mjs} +8 -5
  24. package/dist/add-D_jNqnfZ.mjs.map +1 -0
  25. package/dist/{bundler-lEBH8ENP.cjs → bundler-1REMhKps.cjs} +5 -5
  26. package/dist/{bundler-lEBH8ENP.cjs.map → bundler-1REMhKps.cjs.map} +1 -1
  27. package/dist/{bundler-CaAKsbcN.mjs → bundler-BMo-JP5s.mjs} +5 -5
  28. package/dist/{bundler-CaAKsbcN.mjs.map → bundler-BMo-JP5s.mjs.map} +1 -1
  29. package/dist/{cli-BV3jzbk0.mjs → cli-7edNFwGk.mjs} +5 -13
  30. package/dist/cli-7edNFwGk.mjs.map +1 -0
  31. package/dist/{cli-DQCBcNlN.cjs → cli-BL8ZHsLQ.cjs} +5 -13
  32. package/dist/cli-BL8ZHsLQ.cjs.map +1 -0
  33. package/dist/{compose-CQK6StuE.mjs → compose-DbJhRQlh.mjs} +24 -11
  34. package/dist/compose-DbJhRQlh.mjs.map +1 -0
  35. package/dist/{compose-CSR0yEJm.cjs → compose-xw86kVYi.cjs} +34 -21
  36. package/dist/compose-xw86kVYi.cjs.map +1 -0
  37. package/dist/{config-BzIfP8a-.d.cts → config-CpjsVxru.d.cts} +3 -3
  38. package/dist/{config-BzIfP8a-.d.cts.map → config-CpjsVxru.d.cts.map} +1 -1
  39. package/dist/{config-DhdzmndX.d.mts → config-DrCAyoH5.d.mts} +3 -3
  40. package/dist/{config-DhdzmndX.d.mts.map → config-DrCAyoH5.d.mts.map} +1 -1
  41. package/dist/config.cjs +1 -1
  42. package/dist/config.d.cts +3 -3
  43. package/dist/config.d.mts +3 -3
  44. package/dist/config.mjs +1 -1
  45. package/dist/{credentials-pAtB70k3.mjs → credentials-BgJ5mS_d.mjs} +91 -181
  46. package/dist/credentials-BgJ5mS_d.mjs.map +1 -0
  47. package/dist/{credentials-BVs7mrtw.cjs → credentials-tr26-KML.cjs} +122 -188
  48. package/dist/credentials-tr26-KML.cjs.map +1 -0
  49. package/dist/deploy/public.cjs +24 -20
  50. package/dist/deploy/public.cjs.map +1 -1
  51. package/dist/deploy/public.d.cts +95 -13
  52. package/dist/deploy/public.d.cts.map +1 -1
  53. package/dist/deploy/public.d.mts +95 -13
  54. package/dist/deploy/public.d.mts.map +1 -1
  55. package/dist/deploy/public.mjs +11 -10
  56. package/dist/deploy/public.mjs.map +1 -1
  57. package/dist/{deploy-BuU117CA.mjs → deploy-BTfmXd3g.mjs} +9 -9
  58. package/dist/deploy-BTfmXd3g.mjs.map +1 -0
  59. package/dist/{deploy-Bw2Mm3x3.cjs → deploy-CtbZj4zN.cjs} +13 -13
  60. package/dist/deploy-CtbZj4zN.cjs.map +1 -0
  61. package/dist/{dokploy-C81J1MVK.cjs → dokploy-TGk3oPwr.cjs} +2 -2
  62. package/dist/{dokploy-C81J1MVK.cjs.map → dokploy-TGk3oPwr.cjs.map} +1 -1
  63. package/dist/{dokploy-DWALWk7u.mjs → dokploy-r69yZaIt.mjs} +2 -2
  64. package/dist/{dokploy-DWALWk7u.mjs.map → dokploy-r69yZaIt.mjs.map} +1 -1
  65. package/dist/{encryption-DpAum8W7.mjs → encryption-C-8Tt5Hh.mjs} +3 -3
  66. package/dist/{encryption-DpAum8W7.mjs.map → encryption-C-8Tt5Hh.mjs.map} +1 -1
  67. package/dist/{encryption-B8h8Tna0.cjs → encryption-CDn7BH5O.cjs} +3 -3
  68. package/dist/{encryption-B8h8Tna0.cjs.map → encryption-CDn7BH5O.cjs.map} +1 -1
  69. package/dist/{engine-B01fjhLt.cjs → engine-Bt5k_UMq.cjs} +33 -23
  70. package/dist/engine-Bt5k_UMq.cjs.map +1 -0
  71. package/dist/{engine-BXCtEhSH.mjs → engine-jAINgiOB.mjs} +28 -18
  72. package/dist/engine-jAINgiOB.mjs.map +1 -0
  73. package/dist/{github-8B68qrLs.mjs → github-CZHAtwPT.mjs} +3 -3
  74. package/dist/{github-8B68qrLs.mjs.map → github-CZHAtwPT.mjs.map} +1 -1
  75. package/dist/{github-Cis9tYur.cjs → github-DFhuJQlp.cjs} +3 -3
  76. package/dist/{github-Cis9tYur.cjs.map → github-DFhuJQlp.cjs.map} +1 -1
  77. package/dist/{index-f77HdqN5.d.mts → index-MnUJuUlj.d.mts} +2 -2
  78. package/dist/{index-D1ODeM9s.d.cts.map → index-MnUJuUlj.d.mts.map} +1 -1
  79. package/dist/{index-D1ODeM9s.d.cts → index-elsLJTUv.d.cts} +2 -2
  80. package/dist/{index-f77HdqN5.d.mts.map → index-elsLJTUv.d.cts.map} +1 -1
  81. package/dist/index.cjs +105 -67
  82. package/dist/index.cjs.map +1 -1
  83. package/dist/index.mjs +99 -61
  84. package/dist/index.mjs.map +1 -1
  85. package/dist/local-Ciq-bTPr.mjs +224 -0
  86. package/dist/local-Ciq-bTPr.mjs.map +1 -0
  87. package/dist/local-Cq8qdgNX.cjs +241 -0
  88. package/dist/local-Cq8qdgNX.cjs.map +1 -0
  89. package/dist/{migrate-CPWn7A51.cjs → migrate-B16qgYTn.cjs} +3 -3
  90. package/dist/{migrate-CPWn7A51.cjs.map → migrate-B16qgYTn.cjs.map} +1 -1
  91. package/dist/{migrate-BBCp5blp.cjs → migrate-B1rVlwj1.cjs} +3 -3
  92. package/dist/{migrate-BBCp5blp.cjs.map → migrate-B1rVlwj1.cjs.map} +1 -1
  93. package/dist/{migrate-sDq7NApJ.mjs → migrate-Dn7nK6sh.mjs} +3 -3
  94. package/dist/{migrate-sDq7NApJ.mjs.map → migrate-Dn7nK6sh.mjs.map} +1 -1
  95. package/dist/{migrate-BeTWLSeC.mjs → migrate-ggkPVJRC.mjs} +3 -3
  96. package/dist/{migrate-BeTWLSeC.mjs.map → migrate-ggkPVJRC.mjs.map} +1 -1
  97. package/dist/openapi.cjs +1 -1
  98. package/dist/openapi.d.cts +1 -1
  99. package/dist/openapi.d.mts +1 -1
  100. package/dist/openapi.mjs +1 -1
  101. package/dist/reconcile/public.d.cts +1 -1
  102. package/dist/reconcile/public.d.mts +1 -1
  103. package/dist/{resolve-CXbwJ_iu.mjs → resolve-BSke45k6.mjs} +4 -4
  104. package/dist/{resolve-CXbwJ_iu.mjs.map → resolve-BSke45k6.mjs.map} +1 -1
  105. package/dist/{resolve-CztIqBOI.cjs → resolve-BXeXzpmU.cjs} +4 -4
  106. package/dist/{resolve-CztIqBOI.cjs.map → resolve-BXeXzpmU.cjs.map} +1 -1
  107. package/dist/{rollback-ByyFE5lV.mjs → rollback-CEE6dse4.mjs} +6 -6
  108. package/dist/{rollback-ByyFE5lV.mjs.map → rollback-CEE6dse4.mjs.map} +1 -1
  109. package/dist/{rollback-CyIJ4xGJ.cjs → rollback-DFMiBWf0.cjs} +8 -8
  110. package/dist/{rollback-CyIJ4xGJ.cjs.map → rollback-DFMiBWf0.cjs.map} +1 -1
  111. package/dist/{runtime-CNu2C2hB.d.mts → runtime-D48ZKk8_.d.cts} +2 -2
  112. package/dist/{runtime-CNu2C2hB.d.mts.map → runtime-D48ZKk8_.d.cts.map} +1 -1
  113. package/dist/{runtime-DMLgL26v.d.cts → runtime-HabiNBtJ.d.mts} +2 -2
  114. package/dist/{runtime-DMLgL26v.d.cts.map → runtime-HabiNBtJ.d.mts.map} +1 -1
  115. package/dist/{seeds-9C5CkDon.mjs → seeds-BYdrtZsC.mjs} +1525 -53
  116. package/dist/seeds-BYdrtZsC.mjs.map +1 -0
  117. package/dist/{seeds-B_Beuv0o.cjs → seeds-CsI0A_Ef.cjs} +1628 -65
  118. package/dist/seeds-CsI0A_Ef.cjs.map +1 -0
  119. package/dist/{sniffer-DgBkaLAu.mjs → sniffer-B0EU73bj.mjs} +5 -360
  120. package/dist/sniffer-B0EU73bj.mjs.map +1 -0
  121. package/dist/{sniffer-3fA0iExx.cjs → sniffer-DJYupBeK.cjs} +4 -413
  122. package/dist/sniffer-DJYupBeK.cjs.map +1 -0
  123. package/dist/{sst-DRi3H5TB.mjs → sst-D1Qj4sIs.mjs} +3 -3
  124. package/dist/{sst-DRi3H5TB.mjs.map → sst-D1Qj4sIs.mjs.map} +1 -1
  125. package/dist/{sst-hBrKouBy.cjs → sst-DAqUoZKG.cjs} +5 -5
  126. package/dist/{sst-hBrKouBy.cjs.map → sst-DAqUoZKG.cjs.map} +1 -1
  127. package/dist/{stages-CS1sjcRb.cjs → stages-Brn3vcdy.cjs} +2 -2
  128. package/dist/{stages-CS1sjcRb.cjs.map → stages-Brn3vcdy.cjs.map} +1 -1
  129. package/dist/{stages-CSXt7N2b.mjs → stages-DoHHz6pS.mjs} +2 -2
  130. package/dist/{stages-CSXt7N2b.mjs.map → stages-DoHHz6pS.mjs.map} +1 -1
  131. package/dist/target/public.cjs +1 -1
  132. package/dist/target/public.d.cts +2 -2
  133. package/dist/target/public.d.mts +2 -2
  134. package/dist/target/public.mjs +1 -1
  135. package/dist/{terminal-BdvrmkaC.mjs → terminal-BTbZlrFV.mjs} +2 -2
  136. package/dist/{terminal-BdvrmkaC.mjs.map → terminal-BTbZlrFV.mjs.map} +1 -1
  137. package/dist/{terminal-BL5E0xbR.cjs → terminal-COv23heb.cjs} +2 -2
  138. package/dist/{terminal-BL5E0xbR.cjs.map → terminal-COv23heb.cjs.map} +1 -1
  139. package/dist/{types-BZn-8ssD.d.mts → types-0oAyFOfR.d.cts} +48 -49
  140. package/dist/types-0oAyFOfR.d.cts.map +1 -0
  141. package/dist/{types-DiZj6hqp.d.cts → types-BZ01tZs-.d.mts} +47 -50
  142. package/dist/types-BZ01tZs-.d.mts.map +1 -0
  143. package/dist/workspace/index.cjs +1 -1
  144. package/dist/workspace/index.d.cts +2 -2
  145. package/dist/workspace/index.d.mts +2 -2
  146. package/dist/workspace/index.mjs +1 -1
  147. package/dist/{workspace-Bic_R3tz.cjs → workspace-CT0JM3Y8.cjs} +333 -1
  148. package/dist/workspace-CT0JM3Y8.cjs.map +1 -0
  149. package/dist/{workspace-Drz4jsvy.mjs → workspace-D2CYLMCW.mjs} +250 -2
  150. package/dist/workspace-D2CYLMCW.mjs.map +1 -0
  151. package/package.json +15 -15
  152. package/dist/add-CM7RLj89.cjs.map +0 -1
  153. package/dist/add-jpX7M8RB.mjs.map +0 -1
  154. package/dist/cli-BV3jzbk0.mjs.map +0 -1
  155. package/dist/cli-DQCBcNlN.cjs.map +0 -1
  156. package/dist/compose-CQK6StuE.mjs.map +0 -1
  157. package/dist/compose-CSR0yEJm.cjs.map +0 -1
  158. package/dist/credentials-BVs7mrtw.cjs.map +0 -1
  159. package/dist/credentials-pAtB70k3.mjs.map +0 -1
  160. package/dist/deploy-BuU117CA.mjs.map +0 -1
  161. package/dist/deploy-Bw2Mm3x3.cjs.map +0 -1
  162. package/dist/engine-B01fjhLt.cjs.map +0 -1
  163. package/dist/engine-BXCtEhSH.mjs.map +0 -1
  164. package/dist/run-BJLIerMM.mjs +0 -133
  165. package/dist/run-BJLIerMM.mjs.map +0 -1
  166. package/dist/run-fVZ-rLnc.cjs +0 -174
  167. package/dist/run-fVZ-rLnc.cjs.map +0 -1
  168. package/dist/seeds-9C5CkDon.mjs.map +0 -1
  169. package/dist/seeds-B_Beuv0o.cjs.map +0 -1
  170. package/dist/sniffer-3fA0iExx.cjs.map +0 -1
  171. package/dist/sniffer-DgBkaLAu.mjs.map +0 -1
  172. package/dist/types-BZn-8ssD.d.mts.map +0 -1
  173. package/dist/types-DiZj6hqp.d.cts.map +0 -1
  174. package/dist/workspace-Bic_R3tz.cjs.map +0 -1
  175. package/dist/workspace-Drz4jsvy.mjs.map +0 -1
@@ -117,6 +117,237 @@ function checkComposeStages(config, stages) {
117
117
  }
118
118
  }
119
119
  //#endregion
120
+ //#region src/providers/s3/errors.ts
121
+ /** What the `s3` provider refuses, and how each is put right. */
122
+ /** An `objects` entry for `s3` with a field it does not take or cannot use. */
123
+ var S3ProviderConfigInvalid = class extends Error {
124
+ stage;
125
+ field;
126
+ value;
127
+ expected;
128
+ constructor(stage, field, value, expected) {
129
+ super(`deploy.objects.${stage}.${field} is ${JSON.stringify(value)}; ${expected}.`);
130
+ this.stage = stage;
131
+ this.field = field;
132
+ this.value = value;
133
+ this.expected = expected;
134
+ this.name = "S3ProviderConfigInvalid";
135
+ }
136
+ };
137
+ /** No region anywhere to create the stage's buckets in. */
138
+ var S3RegionRequired = class extends Error {
139
+ stage;
140
+ constructor(stage) {
141
+ super(`The s3 provider has no region for the stage '${stage}'. Name one in gkm.config.ts: deploy: { objects: { ${stage}: { provider: 's3', region: 'eu-west-1' } } } — or set AWS_REGION.`);
142
+ this.stage = stage;
143
+ this.name = "S3RegionRequired";
144
+ }
145
+ };
146
+ /** The good name and every suffixed one are taken by other accounts. */
147
+ var BucketNameUnavailable = class extends Error {
148
+ id;
149
+ tried;
150
+ constructor(id, tried) {
151
+ super(`Every name tried for the bucket '${id}' is taken by another AWS account: ${tried.join(", ")}. Set deploy.namespace in gkm.config.ts to something more particular to you, and run the provision again.`);
152
+ this.id = id;
153
+ this.tried = tried;
154
+ this.name = "BucketNameUnavailable";
155
+ }
156
+ };
157
+ /** A bucket in this account carries another project's tag. */
158
+ var BucketOwnedByAnotherProject = class extends Error {
159
+ bucket;
160
+ owner;
161
+ project;
162
+ constructor(bucket, owner, project) {
163
+ super(`The bucket '${bucket}' is in this account and tagged gkm:project=${owner}, not ${project}: another project's. gkm never adopts it. Set deploy.namespace in gkm.config.ts so this project names its buckets differently.`);
164
+ this.bucket = bucket;
165
+ this.owner = owner;
166
+ this.project = project;
167
+ this.name = "BucketOwnedByAnotherProject";
168
+ }
169
+ };
170
+ /** The bucket the stage's state names exists, and this account cannot reach it. */
171
+ var RecordedBucketUnreachable = class extends Error {
172
+ id;
173
+ bucket;
174
+ constructor(id, bucket) {
175
+ super(`The stage's state records '${bucket}' as the bucket for '${id}', and this account cannot reach it — it is in another account, or the credentials are not the stage account's. Run with the account that created it (--profile).`);
176
+ this.id = id;
177
+ this.bucket = bucket;
178
+ this.name = "RecordedBucketUnreachable";
179
+ }
180
+ };
181
+ /** An IAM user by gkm's name exists, and gkm did not create it for this stage. */
182
+ var IamUserNotOwned = class extends Error {
183
+ user;
184
+ project;
185
+ stage;
186
+ constructor(user, project, stage) {
187
+ super(`The IAM user '${user}' exists and is not tagged gkm:project=${project}, gkm:stage=${stage}, so gkm leaves it alone. Rename or delete it, or set deploy.namespace in gkm.config.ts so gkm names its users differently.`);
188
+ this.user = user;
189
+ this.project = project;
190
+ this.stage = stage;
191
+ this.name = "IamUserNotOwned";
192
+ }
193
+ };
194
+ /** The user already has the two access keys IAM allows. */
195
+ var AccessKeyLimit = class extends Error {
196
+ user;
197
+ keys;
198
+ constructor(user, keys) {
199
+ super(`The IAM user '${user}' already has two access keys (${keys.join(", ")}), the most IAM allows, and gkm needs to issue one. Delete the one the stage does not use (aws iam delete-access-key --user-name ${user} --access-key-id …), then run the provision again.`);
200
+ this.user = user;
201
+ this.keys = keys;
202
+ this.name = "AccessKeyLimit";
203
+ }
204
+ };
205
+ /** `--rotate-keys` while the last rotation's old key is still active. */
206
+ var RotationInProgress = class extends Error {
207
+ id;
208
+ previous;
209
+ stage;
210
+ constructor(id, previous, stage) {
211
+ super(`The bucket '${id}' is mid-rotation: its old key ${previous} is still active. Deploy '${stage}', then run gkm setup --stage ${stage} — or pass --retire-old-keys to delete it now — before rotating again.`);
212
+ this.id = id;
213
+ this.previous = previous;
214
+ this.stage = stage;
215
+ this.name = "RotationInProgress";
216
+ }
217
+ };
218
+ /** The stage's secrets point the bucket's key at a bucket gkm did not provision. */
219
+ var BucketKeySetElsewhere = class extends Error {
220
+ key;
221
+ bucket;
222
+ found;
223
+ stage;
224
+ constructor(key, bucket, found, stage) {
225
+ super(`${key} in the stage '${stage}' points at the bucket '${found}', and the s3 provider manages '${bucket}' for it. Remove the key (gkm secrets:unset ${key} --stage ${stage}) to have the provider write its own, or set deploy.objects.${stage} to 'external' to keep yours.`);
226
+ this.key = key;
227
+ this.bucket = bucket;
228
+ this.found = found;
229
+ this.stage = stage;
230
+ this.name = "BucketKeySetElsewhere";
231
+ }
232
+ };
233
+ /** `verify()`: a provisioned bucket the stage's key cannot reach. */
234
+ var ProvisionedBucketUnreachable = class extends Error {
235
+ id;
236
+ bucket;
237
+ stage;
238
+ reason;
239
+ constructor(id, bucket, stage, reason) {
240
+ super(`The bucket '${bucket}' (${id}) cannot be reached with the key in the stage '${stage}''s secrets: ${reason}. Run gkm setup --stage ${stage} with the stage account's credentials to create or repair it, then deploy again.`);
241
+ this.id = id;
242
+ this.bucket = bucket;
243
+ this.stage = stage;
244
+ this.reason = reason;
245
+ this.name = "ProvisionedBucketUnreachable";
246
+ }
247
+ };
248
+ //#endregion
249
+ //#region src/providers/s3/config.ts
250
+ const FIELDS = [
251
+ "provider",
252
+ "region",
253
+ "versioning"
254
+ ];
255
+ /** An AWS region code: `eu-west-1`, `us-gov-west-1`, `ap-southeast-4`. */
256
+ const REGION = /^[a-z]{2}(-[a-z]+)+-\d+$/;
257
+ function checkS3Config(stage, config) {
258
+ const entry = config;
259
+ for (const field of Object.keys(entry)) if (!FIELDS.includes(field)) throw new S3ProviderConfigInvalid(stage, field, entry[field], `the s3 provider takes ${FIELDS.slice(1).join(" and ")} only`);
260
+ if (entry.region !== void 0) {
261
+ if (typeof entry.region !== "string" || !REGION.test(entry.region)) throw new S3ProviderConfigInvalid(stage, "region", entry.region, "set it to an AWS region code, like 'eu-west-1'");
262
+ }
263
+ if (entry.versioning !== void 0 && typeof entry.versioning !== "boolean") throw new S3ProviderConfigInvalid(stage, "versioning", entry.versioning, "set it to true to keep previous versions of every object, or leave it out");
264
+ return entry;
265
+ }
266
+ /** How the s3 provider's provisioning credentials are supplied. */
267
+ const S3_PROVISIONING = {
268
+ env: [
269
+ "AWS_PROFILE",
270
+ "AWS_ACCESS_KEY_ID",
271
+ "AWS_SECRET_ACCESS_KEY",
272
+ "AWS_SESSION_TOKEN"
273
+ ],
274
+ describe: "the stage's AWS account — --profile <name>, AWS_PROFILE, or AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY (in CI, what aws-actions/configure-aws-credentials exports)"
275
+ };
276
+ //#endregion
277
+ //#region src/providers/config.ts
278
+ /**
279
+ * `deploy.<kind>.<stage>`, read: what backs one kind of construct on a stage.
280
+ *
281
+ * Kept free of the providers themselves — of the AWS SDK and the graph — so
282
+ * the workspace schema can check an entry with the words a deploy would use,
283
+ * the way `checkStageTelemetry` does for `deploy.telemetry`.
284
+ */
285
+ /** Each provider's config check, by kind and name. */
286
+ const CHECKS = { objects: { s3: checkS3Config } };
287
+ /** How each provider's provisioning credentials are supplied, by kind and name. */
288
+ const PROVISIONING = { objects: { s3: S3_PROVISIONING } };
289
+ /** How `name`'s provisioning credentials are supplied, for messages. */
290
+ function provisioningOf(kind, name) {
291
+ return Object.hasOwn(PROVISIONING[kind], name) ? PROVISIONING[kind][name] : void 0;
292
+ }
293
+ /** The `provider:` names a kind accepts. */
294
+ function providerNamesOf(kind) {
295
+ return Object.keys(CHECKS[kind]).sort();
296
+ }
297
+ /** What `deploy.<kind>.<stage>` may be, for messages. */
298
+ function accepted(kind) {
299
+ return [
300
+ "'external'",
301
+ ...providerNamesOf(kind).map((name) => `{ provider: '${name}' }`),
302
+ "false"
303
+ ].join(", ");
304
+ }
305
+ /** An entry that names no provider gkm has, or is not an entry at all. */
306
+ var UnknownStageProvider = class extends Error {
307
+ kind;
308
+ stage;
309
+ value;
310
+ constructor(kind, stage, value) {
311
+ super(`deploy.${kind}.${stage} is ${JSON.stringify(value)}, which is not a provider gkm has for ${kind}. It takes ${accepted(kind)}.`);
312
+ this.kind = kind;
313
+ this.stage = stage;
314
+ this.value = value;
315
+ this.name = "UnknownStageProvider";
316
+ }
317
+ };
318
+ /**
319
+ * One stage's entry checked: `'external'`, `false`, or a provider's object
320
+ * that its own check accepts.
321
+ *
322
+ * @throws {UnknownStageProvider} for anything else — `'minio'` included
323
+ */
324
+ function checkStageProvider(kind, stage, value) {
325
+ if (value === "external" || value === false) return value;
326
+ if (value && typeof value === "object" && !Array.isArray(value)) {
327
+ const name = value.provider;
328
+ const check = typeof name === "string" && Object.hasOwn(CHECKS[kind], name) ? CHECKS[kind][name] : void 0;
329
+ if (check) return check(stage, value);
330
+ }
331
+ throw new UnknownStageProvider(kind, stage, value);
332
+ }
333
+ /**
334
+ * What backs `kind` on `stage`: the local stage is always `external` here —
335
+ * `gkm dev` runs its own — and a deployed stage that names nothing is too.
336
+ */
337
+ function stageProvider(workspace, kind, stage) {
338
+ if (stage === workspace.stages?.local) return { mode: "external" };
339
+ const value = workspace.deploy?.[kind]?.[stage];
340
+ if (value === void 0) return { mode: "external" };
341
+ const entry = checkStageProvider(kind, stage, value);
342
+ if (entry === "external") return { mode: "external" };
343
+ if (entry === false) return { mode: "none" };
344
+ return {
345
+ mode: "provider",
346
+ name: entry.provider,
347
+ config: entry
348
+ };
349
+ }
350
+ //#endregion
120
351
  //#region src/compose/logsConfig.ts
121
352
  /**
122
353
  * The self-hosted telemetry provider's options, read: how the stack's
@@ -814,6 +1045,22 @@ const TelemetryConfigSchema = require_schemas.record(require_schemas.string(), r
814
1045
  }
815
1046
  });
816
1047
  /**
1048
+ * `deploy.objects` — what backs each deployed stage's buckets. The rules are
1049
+ * `checkStageProvider`'s, so the schema and a provision run refuse the same
1050
+ * entries with the same words.
1051
+ */
1052
+ const ObjectsConfigSchema = require_schemas.record(require_schemas.string(), require_schemas.unknown()).superRefine((entries, ctx) => {
1053
+ for (const [stage, value] of Object.entries(entries)) try {
1054
+ checkStageProvider("objects", stage, value);
1055
+ } catch (error) {
1056
+ ctx.addIssue({
1057
+ code: "custom",
1058
+ message: error instanceof Error ? error.message : String(error),
1059
+ path: [stage]
1060
+ });
1061
+ }
1062
+ });
1063
+ /**
817
1064
  * Deploy configuration schema.
818
1065
  */
819
1066
  const DeployConfigSchema = require_schemas.object({
@@ -834,6 +1081,7 @@ const DeployConfigSchema = require_schemas.object({
834
1081
  dokploy: DokployWorkspaceConfigSchema.optional(),
835
1082
  compose: ComposeWorkspaceConfigSchema.optional(),
836
1083
  telemetry: TelemetryConfigSchema.optional(),
1084
+ objects: ObjectsConfigSchema.optional(),
837
1085
  dns: DnsConfigWithLegacySchema.optional(),
838
1086
  backups: BackupsConfigSchema.optional()
839
1087
  });
@@ -1504,6 +1752,30 @@ function getEndpointForStage(dokployConfig, stage) {
1504
1752
  return dokployConfig.endpoint;
1505
1753
  }
1506
1754
  //#endregion
1755
+ Object.defineProperty(exports, "AccessKeyLimit", {
1756
+ enumerable: true,
1757
+ get: function() {
1758
+ return AccessKeyLimit;
1759
+ }
1760
+ });
1761
+ Object.defineProperty(exports, "BucketKeySetElsewhere", {
1762
+ enumerable: true,
1763
+ get: function() {
1764
+ return BucketKeySetElsewhere;
1765
+ }
1766
+ });
1767
+ Object.defineProperty(exports, "BucketNameUnavailable", {
1768
+ enumerable: true,
1769
+ get: function() {
1770
+ return BucketNameUnavailable;
1771
+ }
1772
+ });
1773
+ Object.defineProperty(exports, "BucketOwnedByAnotherProject", {
1774
+ enumerable: true,
1775
+ get: function() {
1776
+ return BucketOwnedByAnotherProject;
1777
+ }
1778
+ });
1507
1779
  Object.defineProperty(exports, "ComposeTlsFileMissing", {
1508
1780
  enumerable: true,
1509
1781
  get: function() {
@@ -1516,6 +1788,12 @@ Object.defineProperty(exports, "DokployRegistryMoved", {
1516
1788
  return DokployRegistryMoved;
1517
1789
  }
1518
1790
  });
1791
+ Object.defineProperty(exports, "IamUserNotOwned", {
1792
+ enumerable: true,
1793
+ get: function() {
1794
+ return IamUserNotOwned;
1795
+ }
1796
+ });
1519
1797
  Object.defineProperty(exports, "InvalidStages", {
1520
1798
  enumerable: true,
1521
1799
  get: function() {
@@ -1546,6 +1824,36 @@ Object.defineProperty(exports, "PUBLIC_ENV_PREFIXES", {
1546
1824
  return PUBLIC_ENV_PREFIXES;
1547
1825
  }
1548
1826
  });
1827
+ Object.defineProperty(exports, "ProvisionedBucketUnreachable", {
1828
+ enumerable: true,
1829
+ get: function() {
1830
+ return ProvisionedBucketUnreachable;
1831
+ }
1832
+ });
1833
+ Object.defineProperty(exports, "RecordedBucketUnreachable", {
1834
+ enumerable: true,
1835
+ get: function() {
1836
+ return RecordedBucketUnreachable;
1837
+ }
1838
+ });
1839
+ Object.defineProperty(exports, "RotationInProgress", {
1840
+ enumerable: true,
1841
+ get: function() {
1842
+ return RotationInProgress;
1843
+ }
1844
+ });
1845
+ Object.defineProperty(exports, "S3RegionRequired", {
1846
+ enumerable: true,
1847
+ get: function() {
1848
+ return S3RegionRequired;
1849
+ }
1850
+ });
1851
+ Object.defineProperty(exports, "S3_PROVISIONING", {
1852
+ enumerable: true,
1853
+ get: function() {
1854
+ return S3_PROVISIONING;
1855
+ }
1856
+ });
1549
1857
  Object.defineProperty(exports, "SECRETS_STORE_PROVIDERS", {
1550
1858
  enumerable: true,
1551
1859
  get: function() {
@@ -1576,6 +1884,12 @@ Object.defineProperty(exports, "UnknownSecretsStoreProvider", {
1576
1884
  return UnknownSecretsStoreProvider;
1577
1885
  }
1578
1886
  });
1887
+ Object.defineProperty(exports, "UnknownStageProvider", {
1888
+ enumerable: true,
1889
+ get: function() {
1890
+ return UnknownStageProvider;
1891
+ }
1892
+ });
1579
1893
  Object.defineProperty(exports, "WorkspaceConfigSchema", {
1580
1894
  enumerable: true,
1581
1895
  get: function() {
@@ -1612,6 +1926,12 @@ Object.defineProperty(exports, "certificateFor", {
1612
1926
  return certificateFor;
1613
1927
  }
1614
1928
  });
1929
+ Object.defineProperty(exports, "checkS3Config", {
1930
+ enumerable: true,
1931
+ get: function() {
1932
+ return checkS3Config;
1933
+ }
1934
+ });
1615
1935
  Object.defineProperty(exports, "constructPatterns", {
1616
1936
  enumerable: true,
1617
1937
  get: function() {
@@ -1702,6 +2022,12 @@ Object.defineProperty(exports, "processConfig", {
1702
2022
  return processConfig;
1703
2023
  }
1704
2024
  });
2025
+ Object.defineProperty(exports, "provisioningOf", {
2026
+ enumerable: true,
2027
+ get: function() {
2028
+ return provisioningOf;
2029
+ }
2030
+ });
1705
2031
  Object.defineProperty(exports, "proxyFor", {
1706
2032
  enumerable: true,
1707
2033
  get: function() {
@@ -1726,6 +2052,12 @@ Object.defineProperty(exports, "stageProblems", {
1726
2052
  return stageProblems;
1727
2053
  }
1728
2054
  });
2055
+ Object.defineProperty(exports, "stageProvider", {
2056
+ enumerable: true,
2057
+ get: function() {
2058
+ return stageProvider;
2059
+ }
2060
+ });
1729
2061
  Object.defineProperty(exports, "stageSampleRate", {
1730
2062
  enumerable: true,
1731
2063
  get: function() {
@@ -1763,4 +2095,4 @@ Object.defineProperty(exports, "wrapSingleAppAsWorkspace", {
1763
2095
  }
1764
2096
  });
1765
2097
 
1766
- //# sourceMappingURL=workspace-Bic_R3tz.cjs.map
2098
+ //# sourceMappingURL=workspace-CT0JM3Y8.cjs.map