@geekmidas/cli 10.0.0-alpha.118 → 10.0.0-alpha.119
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/dist/{EndpointGenerator-BwbYTMtB.cjs → EndpointGenerator-BDa6pPgE.cjs} +2 -2
- package/dist/{EndpointGenerator-BwbYTMtB.cjs.map → EndpointGenerator-BDa6pPgE.cjs.map} +1 -1
- package/dist/{EndpointGenerator-CvLX8bpx.mjs → EndpointGenerator-CP_z_E3e.mjs} +2 -2
- package/dist/{EndpointGenerator-CvLX8bpx.mjs.map → EndpointGenerator-CP_z_E3e.mjs.map} +1 -1
- package/dist/{GoDaddyProvider-CcjbFkLt.mjs → GoDaddyProvider-B4JKSuX-.mjs} +2 -2
- package/dist/{GoDaddyProvider-CcjbFkLt.mjs.map → GoDaddyProvider-B4JKSuX-.mjs.map} +1 -1
- package/dist/{GoDaddyProvider-B6SPHBCU.cjs → GoDaddyProvider-DMLcXGTd.cjs} +2 -2
- package/dist/{GoDaddyProvider-B6SPHBCU.cjs.map → GoDaddyProvider-DMLcXGTd.cjs.map} +1 -1
- package/dist/{LegacyStateStore-2l5jw_VI.cjs → LegacyStateStore-88Etk3M3.cjs} +3 -3
- package/dist/{LegacyStateStore-2l5jw_VI.cjs.map → LegacyStateStore-88Etk3M3.cjs.map} +1 -1
- package/dist/{LegacyStateStore-D-D6r_JT.mjs → LegacyStateStore-ByNEjBbh.mjs} +3 -3
- package/dist/{LegacyStateStore-D-D6r_JT.mjs.map → LegacyStateStore-ByNEjBbh.mjs.map} +1 -1
- package/dist/{LocalStateStore-DIAY7j1O.mjs → LocalStateStore-BoHhG3tu.mjs} +2 -2
- package/dist/{LocalStateStore-DIAY7j1O.mjs.map → LocalStateStore-BoHhG3tu.mjs.map} +1 -1
- package/dist/{LocalStateStore-Dg3rvwwe.cjs → LocalStateStore-D1I3DJu2.cjs} +2 -2
- package/dist/{LocalStateStore-Dg3rvwwe.cjs.map → LocalStateStore-D1I3DJu2.cjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-DXXFXSbO.mjs → OpenApiTsGenerator-CsrukCE-.mjs} +2 -2
- package/dist/{OpenApiTsGenerator-DXXFXSbO.mjs.map → OpenApiTsGenerator-CsrukCE-.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-BD6ZOQ51.cjs → OpenApiTsGenerator-FNhY7Ssz.cjs} +2 -2
- package/dist/{OpenApiTsGenerator-BD6ZOQ51.cjs.map → OpenApiTsGenerator-FNhY7Ssz.cjs.map} +1 -1
- package/dist/{S3StateStore-BKi1eamw.mjs → S3StateStore-BE1Fl_cm.mjs} +2 -2
- package/dist/{S3StateStore-BKi1eamw.mjs.map → S3StateStore-BE1Fl_cm.mjs.map} +1 -1
- package/dist/{S3StateStore-BdcgQNhO.cjs → S3StateStore-DTLmfO3U.cjs} +2 -2
- package/dist/{S3StateStore-BdcgQNhO.cjs.map → S3StateStore-DTLmfO3U.cjs.map} +1 -1
- package/dist/{SSMStateStore-CS-pAKT9.cjs → SSMStateStore-BaKk8zeI.cjs} +2 -2
- package/dist/{SSMStateStore-CS-pAKT9.cjs.map → SSMStateStore-BaKk8zeI.cjs.map} +1 -1
- package/dist/{SSMStateStore-DHgaNW75.mjs → SSMStateStore-kEogq4Wx.mjs} +2 -2
- package/dist/{SSMStateStore-DHgaNW75.mjs.map → SSMStateStore-kEogq4Wx.mjs.map} +1 -1
- package/dist/{SubscriberGenerator-CeH7wbYt.cjs → SubscriberGenerator-C8CPxrCK.cjs} +25 -4
- package/dist/SubscriberGenerator-C8CPxrCK.cjs.map +1 -0
- package/dist/{SubscriberGenerator-DHnIYwUU.mjs → SubscriberGenerator-y3pncae_.mjs} +20 -5
- package/dist/SubscriberGenerator-y3pncae_.mjs.map +1 -0
- package/dist/{add-BcZXHa3Z.mjs → add-BZr_o-Xm.mjs} +5 -5
- package/dist/{add-BcZXHa3Z.mjs.map → add-BZr_o-Xm.mjs.map} +1 -1
- package/dist/{add-6VPdRbRT.cjs → add-C8mRgq2x.cjs} +5 -5
- package/dist/{add-6VPdRbRT.cjs.map → add-C8mRgq2x.cjs.map} +1 -1
- package/dist/{bundler-jjWtQ882.cjs → bundler-7-pO7L0X.cjs} +5 -5
- package/dist/{bundler-jjWtQ882.cjs.map → bundler-7-pO7L0X.cjs.map} +1 -1
- package/dist/{bundler-Ciim6amq.mjs → bundler-USaMrVEO.mjs} +5 -5
- package/dist/{bundler-Ciim6amq.mjs.map → bundler-USaMrVEO.mjs.map} +1 -1
- package/dist/{cli-CQ2ij0Mi.cjs → cli-Bdf7CdQB.cjs} +3 -3
- package/dist/{cli-CQ2ij0Mi.cjs.map → cli-Bdf7CdQB.cjs.map} +1 -1
- package/dist/{cli-BkxlWYfI.mjs → cli-DWRYbsA2.mjs} +3 -3
- package/dist/{cli-BkxlWYfI.mjs.map → cli-DWRYbsA2.mjs.map} +1 -1
- package/dist/{compose-qLTNYJAY.mjs → compose-DAPoyiny.mjs} +101 -19
- package/dist/compose-DAPoyiny.mjs.map +1 -0
- package/dist/{compose-JOasAHcd.cjs → compose-tZLAZZp6.cjs} +101 -19
- package/dist/compose-tZLAZZp6.cjs.map +1 -0
- package/dist/config.cjs +1 -1
- package/dist/config.mjs +1 -1
- package/dist/{credentialSchemas-D_VUCDUh.cjs → credentialSchemas-B67WJOOm.cjs} +2 -2
- package/dist/{credentialSchemas-D_VUCDUh.cjs.map → credentialSchemas-B67WJOOm.cjs.map} +1 -1
- package/dist/{credentialSchemas-Cf5Pf8VE.mjs → credentialSchemas-DDOLRCLF.mjs} +2 -2
- package/dist/{credentialSchemas-Cf5Pf8VE.mjs.map → credentialSchemas-DDOLRCLF.mjs.map} +1 -1
- package/dist/deploy/public.cjs +7 -7
- package/dist/deploy/public.d.cts +2 -1
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +2 -1
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +7 -7
- package/dist/{deploy-_g-2dX38.mjs → deploy-CyQ36GSx.mjs} +20 -9
- package/dist/deploy-CyQ36GSx.mjs.map +1 -0
- package/dist/{deploy-D-liNXfx.cjs → deploy-rwfdH_Uw.cjs} +20 -9
- package/dist/deploy-rwfdH_Uw.cjs.map +1 -0
- package/dist/{discover-Ca8U75dl.mjs → discover-C5roJuc9.mjs} +25 -2
- package/dist/discover-C5roJuc9.mjs.map +1 -0
- package/dist/{discover-CvTtV5ZD.d.cts → discover-CSW_BMWa.d.cts} +18 -1
- package/dist/discover-CSW_BMWa.d.cts.map +1 -0
- package/dist/{discover-Bsr7HjqJ.cjs → discover-DozUKs8f.cjs} +25 -2
- package/dist/discover-DozUKs8f.cjs.map +1 -0
- package/dist/{discover-W2kab9Lc.d.mts → discover-xtT7fgWg.d.mts} +18 -1
- package/dist/discover-xtT7fgWg.d.mts.map +1 -0
- package/dist/{dns-DGq4xkJT.mjs → dns-BHveRzd8.mjs} +2 -2
- package/dist/{dns-DGq4xkJT.mjs.map → dns-BHveRzd8.mjs.map} +1 -1
- package/dist/{dns-DfQKqAyt.cjs → dns-CJ3izGTo.cjs} +2 -2
- package/dist/{dns-DfQKqAyt.cjs.map → dns-CJ3izGTo.cjs.map} +1 -1
- package/dist/{dokploy-ClIPZaPH.mjs → dokploy-BaaNWN-B.mjs} +2 -2
- package/dist/{dokploy-ClIPZaPH.mjs.map → dokploy-BaaNWN-B.mjs.map} +1 -1
- package/dist/{dokploy-D17I2BCE.cjs → dokploy-BmlMt2Rb.cjs} +2 -2
- package/dist/{dokploy-D17I2BCE.cjs.map → dokploy-BmlMt2Rb.cjs.map} +1 -1
- package/dist/{drivers-3klmg9Sk.mjs → drivers-BjGDYfnC.mjs} +2 -2
- package/dist/{drivers-3klmg9Sk.mjs.map → drivers-BjGDYfnC.mjs.map} +1 -1
- package/dist/{drivers-CoqD5zYP.cjs → drivers-DbjiYpW6.cjs} +2 -2
- package/dist/{drivers-CoqD5zYP.cjs.map → drivers-DbjiYpW6.cjs.map} +1 -1
- package/dist/{eas-DJXhARYb.mjs → eas-CKS1YxT3.mjs} +2 -2
- package/dist/{eas-DJXhARYb.mjs.map → eas-CKS1YxT3.mjs.map} +1 -1
- package/dist/{eas-b95MCG14.cjs → eas-ClEvznV9.cjs} +2 -2
- package/dist/{eas-b95MCG14.cjs.map → eas-ClEvznV9.cjs.map} +1 -1
- package/dist/{encryption-C_NRQ9cY.cjs → encryption-CpydNX0B.cjs} +2 -2
- package/dist/{encryption-C_NRQ9cY.cjs.map → encryption-CpydNX0B.cjs.map} +1 -1
- package/dist/{encryption-CldvLtip.mjs → encryption-DxKJLlYn.mjs} +2 -2
- package/dist/{encryption-CldvLtip.mjs.map → encryption-DxKJLlYn.mjs.map} +1 -1
- package/dist/{engine-CKfdvEVt.cjs → engine-C9qO5k6r.cjs} +4 -4
- package/dist/{engine-CKfdvEVt.cjs.map → engine-C9qO5k6r.cjs.map} +1 -1
- package/dist/{engine-BBnTj8OD.mjs → engine-tmvpAPHz.mjs} +4 -4
- package/dist/{engine-BBnTj8OD.mjs.map → engine-tmvpAPHz.mjs.map} +1 -1
- package/dist/{github-D5Ck3srU.cjs → github-BdVRMNzc.cjs} +8 -6
- package/dist/github-BdVRMNzc.cjs.map +1 -0
- package/dist/{github-BMPci2wg.mjs → github-vA9jAJjI.mjs} +8 -6
- package/dist/github-vA9jAJjI.mjs.map +1 -0
- package/dist/{googlePlay-C-GBRDMp.cjs → googlePlay-BafFoF13.cjs} +3 -3
- package/dist/{googlePlay-C-GBRDMp.cjs.map → googlePlay-BafFoF13.cjs.map} +1 -1
- package/dist/{googlePlay-fw0VWly7.mjs → googlePlay-Kr2etW2y.mjs} +3 -3
- package/dist/{googlePlay-fw0VWly7.mjs.map → googlePlay-Kr2etW2y.mjs.map} +1 -1
- package/dist/index.cjs +59 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +59 -59
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-WyWhSivN.mjs → migrate-4EdfUpjQ.mjs} +3 -3
- package/dist/{migrate-WyWhSivN.mjs.map → migrate-4EdfUpjQ.mjs.map} +1 -1
- package/dist/{migrate-rke2Qvj2.cjs → migrate-BMGpVvFg.cjs} +3 -3
- package/dist/{migrate-rke2Qvj2.cjs.map → migrate-BMGpVvFg.cjs.map} +1 -1
- package/dist/{migrate-1bHqjfIe.mjs → migrate-C_IaJz8A.mjs} +2 -2
- package/dist/{migrate-1bHqjfIe.mjs.map → migrate-C_IaJz8A.mjs.map} +1 -1
- package/dist/{migrate-BndHuwqw.cjs → migrate-DeIkRsXm.cjs} +2 -2
- package/dist/{migrate-BndHuwqw.cjs.map → migrate-DeIkRsXm.cjs.map} +1 -1
- package/dist/openapi.cjs +2 -2
- package/dist/openapi.mjs +2 -2
- package/dist/{publish-BBG4zx8E.mjs → publish-AdbhYxX6.mjs} +2 -2
- package/dist/{publish-BBG4zx8E.mjs.map → publish-AdbhYxX6.mjs.map} +1 -1
- package/dist/{publish-B22IhdS9.cjs → publish-BWVQ9PZy.cjs} +2 -2
- package/dist/{publish-B22IhdS9.cjs.map → publish-BWVQ9PZy.cjs.map} +1 -1
- package/dist/{ready-gc9IFByS.cjs → ready-BFFP838V.cjs} +6 -6
- package/dist/{ready-gc9IFByS.cjs.map → ready-BFFP838V.cjs.map} +1 -1
- package/dist/{ready-4hEoQ_cr.mjs → ready-BOfogqzr.mjs} +6 -6
- package/dist/{ready-4hEoQ_cr.mjs.map → ready-BOfogqzr.mjs.map} +1 -1
- package/dist/reconcile/public.cjs +1 -1
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/reconcile/public.mjs +1 -1
- package/dist/{resolve-CC6ndodR.mjs → resolve-CJwadE_F.mjs} +3 -3
- package/dist/{resolve-CC6ndodR.mjs.map → resolve-CJwadE_F.mjs.map} +1 -1
- package/dist/{resolve-isFTuJp4.cjs → resolve-Dtrp53jt.cjs} +3 -3
- package/dist/{resolve-isFTuJp4.cjs.map → resolve-Dtrp53jt.cjs.map} +1 -1
- package/dist/{rollback-DaEmEC2Y.mjs → rollback-Cx89OK9S.mjs} +4 -4
- package/dist/{rollback-DaEmEC2Y.mjs.map → rollback-Cx89OK9S.mjs.map} +1 -1
- package/dist/{rollback-Lj9bQvHq.cjs → rollback-DAKtcSCy.cjs} +4 -4
- package/dist/{rollback-Lj9bQvHq.cjs.map → rollback-DAKtcSCy.cjs.map} +1 -1
- package/dist/sandbox/credentials-worker.cjs +2 -2
- package/dist/sandbox/credentials-worker.mjs +2 -2
- package/dist/sandbox/discover-worker.cjs +6 -3
- package/dist/sandbox/discover-worker.cjs.map +1 -1
- package/dist/sandbox/discover-worker.mjs +6 -3
- package/dist/sandbox/discover-worker.mjs.map +1 -1
- package/dist/sandbox/migrate-worker.cjs +1 -1
- package/dist/sandbox/migrate-worker.mjs +1 -1
- package/dist/{seeds-CYzoBDg2.mjs → seeds-BBnvSEgG.mjs} +134 -21
- package/dist/seeds-BBnvSEgG.mjs.map +1 -0
- package/dist/{seeds-CF9Nx6_g.cjs → seeds-CPFoexOv.cjs} +150 -19
- package/dist/seeds-CPFoexOv.cjs.map +1 -0
- package/dist/{serverSetup-CbuJK4zg.cjs → serverSetup-BHoXbPit.cjs} +5 -5
- package/dist/{serverSetup-CbuJK4zg.cjs.map → serverSetup-BHoXbPit.cjs.map} +1 -1
- package/dist/{serverSetup-0h1Vh5un.mjs → serverSetup-BoD9Vp4B.mjs} +5 -5
- package/dist/{serverSetup-0h1Vh5un.mjs.map → serverSetup-BoD9Vp4B.mjs.map} +1 -1
- package/dist/{sniffer-CRJHtBaK.mjs → sniffer-DDUAlVqp.mjs} +7 -7
- package/dist/{sniffer-CRJHtBaK.mjs.map → sniffer-DDUAlVqp.mjs.map} +1 -1
- package/dist/{sniffer-Dz3Va1Jo.cjs → sniffer-DIVpELrO.cjs} +7 -7
- package/dist/{sniffer-Dz3Va1Jo.cjs.map → sniffer-DIVpELrO.cjs.map} +1 -1
- package/dist/{stage-CIo8s2WT.mjs → stage-D9R5j5Xa.mjs} +5 -5
- package/dist/{stage-CIo8s2WT.mjs.map → stage-D9R5j5Xa.mjs.map} +1 -1
- package/dist/{stage-y9qFelxT.cjs → stage-ElqMbLNH.cjs} +5 -5
- package/dist/{stage-y9qFelxT.cjs.map → stage-ElqMbLNH.cjs.map} +1 -1
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.mjs +1 -1
- package/dist/{terminal-CybB-cjk.mjs → terminal-CW_dWeTe.mjs} +2 -2
- package/dist/{terminal-CybB-cjk.mjs.map → terminal-CW_dWeTe.mjs.map} +1 -1
- package/dist/{terminal-D_NRPW4W.cjs → terminal-DJlqcW_U.cjs} +2 -2
- package/dist/{terminal-D_NRPW4W.cjs.map → terminal-DJlqcW_U.cjs.map} +1 -1
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/package.json +15 -15
- package/dist/SubscriberGenerator-CeH7wbYt.cjs.map +0 -1
- package/dist/SubscriberGenerator-DHnIYwUU.mjs.map +0 -1
- package/dist/compose-JOasAHcd.cjs.map +0 -1
- package/dist/compose-qLTNYJAY.mjs.map +0 -1
- package/dist/deploy-D-liNXfx.cjs.map +0 -1
- package/dist/deploy-_g-2dX38.mjs.map +0 -1
- package/dist/discover-Bsr7HjqJ.cjs.map +0 -1
- package/dist/discover-Ca8U75dl.mjs.map +0 -1
- package/dist/discover-CvTtV5ZD.d.cts.map +0 -1
- package/dist/discover-W2kab9Lc.d.mts.map +0 -1
- package/dist/github-BMPci2wg.mjs.map +0 -1
- package/dist/github-D5Ck3srU.cjs.map +0 -1
- package/dist/seeds-CF9Nx6_g.cjs.map +0 -1
- package/dist/seeds-CYzoBDg2.mjs.map +0 -1
|
@@ -3,12 +3,12 @@ const require_errors = require("./errors-DMC4Umsb.cjs");
|
|
|
3
3
|
const require_run = require("./run-fVZ-rLnc.cjs");
|
|
4
4
|
const require_workspace = require("./workspace-BwqQnool.cjs");
|
|
5
5
|
const require_derive = require("./derive-DAbo49sm.cjs");
|
|
6
|
-
const require_SubscriberGenerator = require("./SubscriberGenerator-
|
|
6
|
+
const require_SubscriberGenerator = require("./SubscriberGenerator-C8CPxrCK.cjs");
|
|
7
7
|
const require_identity = require("./identity-CbLfgQNT.cjs");
|
|
8
|
-
const require_EndpointGenerator = require("./EndpointGenerator-
|
|
9
|
-
const require_discover = require("./discover-
|
|
8
|
+
const require_EndpointGenerator = require("./EndpointGenerator-BDa6pPgE.cjs");
|
|
9
|
+
const require_discover = require("./discover-DozUKs8f.cjs");
|
|
10
10
|
const require_config = require("./config.cjs");
|
|
11
|
-
const require_resolve = require("./resolve-
|
|
11
|
+
const require_resolve = require("./resolve-Dtrp53jt.cjs");
|
|
12
12
|
let node_path = require("node:path");
|
|
13
13
|
let node_fs = require("node:fs");
|
|
14
14
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -1027,6 +1027,7 @@ function planFor(manifest, stage, order, options = {}) {
|
|
|
1027
1027
|
...declaration.scheme ? { scheme: declaration.scheme } : {}
|
|
1028
1028
|
} : {},
|
|
1029
1029
|
...declaration.kind === "file-server" && declaration.open?.length ? { open: declaration.open } : {},
|
|
1030
|
+
...declaration.kind === "objects" && declaration.expire ? { expire: declaration.expire } : {},
|
|
1030
1031
|
...(declaration.kind === "rest-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
|
|
1031
1032
|
...fake ? { fake: {
|
|
1032
1033
|
key: fake.key,
|
|
@@ -2229,24 +2230,74 @@ async function withLock(lock, body) {
|
|
|
2229
2230
|
}
|
|
2230
2231
|
}
|
|
2231
2232
|
//#endregion
|
|
2232
|
-
//#region src/
|
|
2233
|
+
//#region src/providers/s3/lifecycle.ts
|
|
2233
2234
|
/**
|
|
2234
|
-
*
|
|
2235
|
+
* A bucket's lifecycle, as the constructs declare it: one expiry rule per
|
|
2236
|
+
* prefix, merged into whatever else the bucket's lifecycle already holds.
|
|
2235
2237
|
*
|
|
2236
|
-
*
|
|
2237
|
-
*
|
|
2238
|
-
*
|
|
2238
|
+
* S3 — and MinIO, which speaks the same API — keeps one lifecycle document
|
|
2239
|
+
* per bucket, and a write replaces all of it. So gkm owns only the rules it
|
|
2240
|
+
* names (`gkm-…`): every other rule is read and put back as it was, a rule of
|
|
2241
|
+
* gkm's that is no longer declared is dropped, and nothing is written when
|
|
2242
|
+
* gkm's rules already say what the manifest does.
|
|
2239
2243
|
*
|
|
2240
|
-
*
|
|
2241
|
-
*
|
|
2242
|
-
|
|
2244
|
+
* Shared by the `s3` provider and the MinIO a local or compose stack runs,
|
|
2245
|
+
* so a prefix expires the same way on both.
|
|
2246
|
+
*/
|
|
2247
|
+
/** The id every rule gkm writes starts with — and the only ones it touches. */
|
|
2248
|
+
const GKM_RULE_PREFIX = "gkm-";
|
|
2249
|
+
/**
|
|
2250
|
+
* The rule id for one prefix: readable, and unique however the prefix is
|
|
2251
|
+
* spelled — `a/b` and `a-b` read alike once sanitised, so a short hash of the
|
|
2252
|
+
* prefix itself follows.
|
|
2253
|
+
*/
|
|
2254
|
+
function expireRuleId(prefix) {
|
|
2255
|
+
const readable = prefix.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 200);
|
|
2256
|
+
const hash = (0, node_crypto.createHash)("sha256").update(prefix).digest("hex").slice(0, 8);
|
|
2257
|
+
return `${GKM_RULE_PREFIX}expire-${readable ? `${readable}-` : ""}${hash}`;
|
|
2258
|
+
}
|
|
2259
|
+
/** The rules a bucket's expiry asks for, in a stable order. */
|
|
2260
|
+
function expireRules(expire) {
|
|
2261
|
+
return Object.entries(expire ?? {}).map(([prefix, days]) => ({
|
|
2262
|
+
ID: expireRuleId(prefix),
|
|
2263
|
+
Status: "Enabled",
|
|
2264
|
+
Filter: { Prefix: prefix },
|
|
2265
|
+
Expiration: { Days: days }
|
|
2266
|
+
})).sort((a, b) => a.ID.localeCompare(b.ID));
|
|
2267
|
+
}
|
|
2268
|
+
/**
|
|
2269
|
+
* Merge the declared expiry into the bucket's current rules.
|
|
2243
2270
|
*
|
|
2244
|
-
*
|
|
2245
|
-
* gives: the same DDL has to run in-process locally and from a provisioner in a
|
|
2246
|
-
* VPC, and one implementation is what stops "works locally, fails deployed".
|
|
2247
|
-
* When the role DDL lands in `@geekmidas/db` this delegates to it rather than
|
|
2248
|
-
* growing its own.
|
|
2271
|
+
* @param current the bucket's rules, or nothing when it has no lifecycle
|
|
2249
2272
|
*/
|
|
2273
|
+
function mergeLifecycle(current, expire) {
|
|
2274
|
+
const wanted = expireRules(expire);
|
|
2275
|
+
const rules = current ?? [];
|
|
2276
|
+
const others = rules.filter((r) => !r.ID?.startsWith(GKM_RULE_PREFIX));
|
|
2277
|
+
const ours = rules.filter((r) => r.ID?.startsWith(GKM_RULE_PREFIX));
|
|
2278
|
+
return {
|
|
2279
|
+
changed: canonical(ours) !== canonical(wanted) || new Set(ours.map((r) => r.ID)).size !== ours.length,
|
|
2280
|
+
rules: [...others, ...wanted],
|
|
2281
|
+
describe: describeExpiry(expire)
|
|
2282
|
+
};
|
|
2283
|
+
}
|
|
2284
|
+
/** `expire quotes/ after 30 days, tmp/ after 1 day` — or what removing says. */
|
|
2285
|
+
function describeExpiry(expire) {
|
|
2286
|
+
const entries = Object.entries(expire ?? {}).sort(([a], [b]) => a.localeCompare(b));
|
|
2287
|
+
if (entries.length === 0) return "remove expiry rules";
|
|
2288
|
+
return `expire ${entries.map(([prefix, days]) => `${prefix} after ${days} day${days === 1 ? "" : "s"}`).join(", ")}`;
|
|
2289
|
+
}
|
|
2290
|
+
/** gkm's rules as the fields it sets, order-free. */
|
|
2291
|
+
function canonical(rules) {
|
|
2292
|
+
return JSON.stringify(rules.map((r) => ({
|
|
2293
|
+
id: r.ID,
|
|
2294
|
+
status: r.Status,
|
|
2295
|
+
prefix: r.Filter?.Prefix ?? r.Prefix ?? "",
|
|
2296
|
+
days: r.Expiration?.Days ?? null
|
|
2297
|
+
})).sort((a, b) => (a.id ?? "").localeCompare(b.id ?? "")));
|
|
2298
|
+
}
|
|
2299
|
+
//#endregion
|
|
2300
|
+
//#region src/reconcile/provision.ts
|
|
2250
2301
|
/**
|
|
2251
2302
|
* The Postgres work a plan implies.
|
|
2252
2303
|
*
|
|
@@ -2432,6 +2483,20 @@ function bucketPolicies(plan) {
|
|
|
2432
2483
|
})).sort((a, b) => a.bucket.localeCompare(b.bucket));
|
|
2433
2484
|
}
|
|
2434
2485
|
/**
|
|
2486
|
+
* What each bucket keeps, and for how long: the buckets that declare an
|
|
2487
|
+
* expiry, by their stage-scoped name.
|
|
2488
|
+
*
|
|
2489
|
+
* Every bucket in the plan, not only those that declare one, is what a
|
|
2490
|
+
* removed expiry needs — its rules are dropped from a bucket that no longer
|
|
2491
|
+
* asks for them — so a bucket with none is listed with an empty expiry.
|
|
2492
|
+
*/
|
|
2493
|
+
function bucketLifecycles(plan) {
|
|
2494
|
+
return plan.resources.filter((r) => r.kind === "objects" && r.provisions).map((r) => ({
|
|
2495
|
+
bucket: r.name,
|
|
2496
|
+
expire: r.expire ?? {}
|
|
2497
|
+
})).sort((a, b) => a.bucket.localeCompare(b.bucket));
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2435
2500
|
* One bucket's open paths as an S3 bucket policy.
|
|
2436
2501
|
*
|
|
2437
2502
|
* Anonymous `s3:GetObject` on the named prefixes and nothing else — which is
|
|
@@ -2519,6 +2584,34 @@ async function databasesExist(client, names) {
|
|
|
2519
2584
|
}
|
|
2520
2585
|
}
|
|
2521
2586
|
/**
|
|
2587
|
+
* Apply each bucket's expiry, beside whatever other rules it has, skipping
|
|
2588
|
+
* those already correct — the same merge the `s3` provider makes deployed.
|
|
2589
|
+
*/
|
|
2590
|
+
async function applyLifecycles(client, lifecycles) {
|
|
2591
|
+
const applied = [];
|
|
2592
|
+
for (const { bucket, expire } of lifecycles) {
|
|
2593
|
+
const merge = mergeLifecycle(await client.lifecycle(bucket), expire);
|
|
2594
|
+
const id = `${bucket}:lifecycle`;
|
|
2595
|
+
const describe = `${merge.describe} on ${bucket}`;
|
|
2596
|
+
if (!merge.changed && Object.keys(expire).length === 0) continue;
|
|
2597
|
+
if (!merge.changed) {
|
|
2598
|
+
applied.push({
|
|
2599
|
+
id,
|
|
2600
|
+
describe,
|
|
2601
|
+
created: false
|
|
2602
|
+
});
|
|
2603
|
+
continue;
|
|
2604
|
+
}
|
|
2605
|
+
await client.setLifecycle(bucket, merge.rules);
|
|
2606
|
+
applied.push({
|
|
2607
|
+
id,
|
|
2608
|
+
describe,
|
|
2609
|
+
created: true
|
|
2610
|
+
});
|
|
2611
|
+
}
|
|
2612
|
+
return applied;
|
|
2613
|
+
}
|
|
2614
|
+
/**
|
|
2522
2615
|
* Apply each served bucket's open-path policy, skipping those already correct.
|
|
2523
2616
|
*
|
|
2524
2617
|
* Compared as parsed JSON rather than as text: the same policy re-serialised
|
|
@@ -4553,6 +4646,24 @@ function bucketClient(port, credentials) {
|
|
|
4553
4646
|
Bucket: bucket,
|
|
4554
4647
|
Policy: policy
|
|
4555
4648
|
}));
|
|
4649
|
+
},
|
|
4650
|
+
async lifecycle(bucket) {
|
|
4651
|
+
try {
|
|
4652
|
+
return (await s3.send(new _aws_sdk_client_s3.GetBucketLifecycleConfigurationCommand({ Bucket: bucket }))).Rules;
|
|
4653
|
+
} catch (error) {
|
|
4654
|
+
if (error.name === "NoSuchLifecycleConfiguration") return;
|
|
4655
|
+
throw error;
|
|
4656
|
+
}
|
|
4657
|
+
},
|
|
4658
|
+
async setLifecycle(bucket, rules) {
|
|
4659
|
+
if (rules.length === 0) {
|
|
4660
|
+
await s3.send(new _aws_sdk_client_s3.DeleteBucketLifecycleCommand({ Bucket: bucket }));
|
|
4661
|
+
return;
|
|
4662
|
+
}
|
|
4663
|
+
await s3.send(new _aws_sdk_client_s3.PutBucketLifecycleConfigurationCommand({
|
|
4664
|
+
Bucket: bucket,
|
|
4665
|
+
LifecycleConfiguration: { Rules: rules }
|
|
4666
|
+
}));
|
|
4556
4667
|
}
|
|
4557
4668
|
};
|
|
4558
4669
|
}
|
|
@@ -5492,10 +5603,12 @@ async function create(plan, ports, credentials, sql, buckets, emulatorCarriers,
|
|
|
5492
5603
|
const minioPort = ports[primaryPortKey("minio")];
|
|
5493
5604
|
const names = bucketNames(plan);
|
|
5494
5605
|
const policies = bucketPolicies(plan);
|
|
5606
|
+
const lifecycles = bucketLifecycles(plan);
|
|
5495
5607
|
if (minioPort !== void 0 && (names.length > 0 || policies.length > 0)) {
|
|
5496
5608
|
const client = buckets(minioPort, credentials.minio);
|
|
5497
5609
|
if (names.length > 0) applied.push(...await applyBuckets(client, names));
|
|
5498
5610
|
if (policies.length > 0) applied.push(...await applyPolicies(client, policies));
|
|
5611
|
+
if (lifecycles.length > 0) applied.push(...await applyLifecycles(client, lifecycles));
|
|
5499
5612
|
}
|
|
5500
5613
|
const emulatorPort = ports[primaryPortKey("localstack")];
|
|
5501
5614
|
const carriers = carrierNames(plan);
|
|
@@ -7385,7 +7498,7 @@ async function createDnsProvider(options) {
|
|
|
7385
7498
|
});
|
|
7386
7499
|
}
|
|
7387
7500
|
if (provider === "godaddy") {
|
|
7388
|
-
const { GoDaddyProvider } = await Promise.resolve().then(() => require("./GoDaddyProvider-
|
|
7501
|
+
const { GoDaddyProvider } = await Promise.resolve().then(() => require("./GoDaddyProvider-DMLcXGTd.cjs"));
|
|
7389
7502
|
return new GoDaddyProvider(options.godaddy ?? {});
|
|
7390
7503
|
}
|
|
7391
7504
|
if (provider === "cloudflare") throw new DnsProviderNotImplemented("cloudflare");
|
|
@@ -8456,6 +8569,12 @@ Object.defineProperty(exports, "applyBuckets", {
|
|
|
8456
8569
|
return applyBuckets;
|
|
8457
8570
|
}
|
|
8458
8571
|
});
|
|
8572
|
+
Object.defineProperty(exports, "applyLifecycles", {
|
|
8573
|
+
enumerable: true,
|
|
8574
|
+
get: function() {
|
|
8575
|
+
return applyLifecycles;
|
|
8576
|
+
}
|
|
8577
|
+
});
|
|
8459
8578
|
Object.defineProperty(exports, "applyPolicies", {
|
|
8460
8579
|
enumerable: true,
|
|
8461
8580
|
get: function() {
|
|
@@ -8498,6 +8617,12 @@ Object.defineProperty(exports, "bucketClient", {
|
|
|
8498
8617
|
return bucketClient;
|
|
8499
8618
|
}
|
|
8500
8619
|
});
|
|
8620
|
+
Object.defineProperty(exports, "bucketLifecycles", {
|
|
8621
|
+
enumerable: true,
|
|
8622
|
+
get: function() {
|
|
8623
|
+
return bucketLifecycles;
|
|
8624
|
+
}
|
|
8625
|
+
});
|
|
8501
8626
|
Object.defineProperty(exports, "bucketPolicies", {
|
|
8502
8627
|
enumerable: true,
|
|
8503
8628
|
get: function() {
|
|
@@ -8822,6 +8947,12 @@ Object.defineProperty(exports, "maskPassword", {
|
|
|
8822
8947
|
return maskPassword;
|
|
8823
8948
|
}
|
|
8824
8949
|
});
|
|
8950
|
+
Object.defineProperty(exports, "mergeLifecycle", {
|
|
8951
|
+
enumerable: true,
|
|
8952
|
+
get: function() {
|
|
8953
|
+
return mergeLifecycle;
|
|
8954
|
+
}
|
|
8955
|
+
});
|
|
8825
8956
|
Object.defineProperty(exports, "networkEnv", {
|
|
8826
8957
|
enumerable: true,
|
|
8827
8958
|
get: function() {
|
|
@@ -9213,4 +9344,4 @@ Object.defineProperty(exports, "workspace_exports", {
|
|
|
9213
9344
|
}
|
|
9214
9345
|
});
|
|
9215
9346
|
|
|
9216
|
-
//# sourceMappingURL=seeds-
|
|
9347
|
+
//# sourceMappingURL=seeds-CPFoexOv.cjs.map
|