@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 @@ import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
|
|
|
3
3
|
import { i as run$1, s as gkmHome } from "./run-BJLIerMM.mjs";
|
|
4
4
|
import { B as LOGS_PORT, H as provisioningOf, R as stageSampleRate, U as stageProvider, _ as PUBLIC_ENV_PREFIXES, a as allConstructGlobs, ct as UnknownSecretsStoreProvider, ft as SERVER_IPV4_KEY, ht as isReservedStageKey, j as TEST_STAGE, pt as SERVER_IPV6_KEY, ut as s3SecretsLocation, v as getPublicEnvPrefix, z as telemetryEnv } from "./workspace-D1QbNd55.mjs";
|
|
5
5
|
import { t as appKey } from "./derive-B4vDpzgP.mjs";
|
|
6
|
-
import { a as
|
|
6
|
+
import { a as readFakes, c as DEFAULT_STORAGE, i as readCredentialFakes, l as holdsEveryCache, o as DEFAULT_CACHE, s as DEFAULT_EVENTS$1, t as SubscriberGenerator } from "./SubscriberGenerator-y3pncae_.mjs";
|
|
7
7
|
import { n as deployIdentity } from "./identity-CBXr4wNi.mjs";
|
|
8
|
-
import { a as startTelemetryCode, n as runtimeFor, s as writeTelemetryModule, u as telemetryArgs } from "./EndpointGenerator-
|
|
9
|
-
import { d as ConstructGenerator, f as output, i as discover } from "./discover-
|
|
8
|
+
import { a as startTelemetryCode, n as runtimeFor, s as writeTelemetryModule, u as telemetryArgs } from "./EndpointGenerator-CP_z_E3e.mjs";
|
|
9
|
+
import { d as ConstructGenerator, f as output, i as discover } from "./discover-C5roJuc9.mjs";
|
|
10
10
|
import { ConfigNotFound, NotInAnApp, loadWorkspaceAppInfo, loadWorkspaceConfig } from "./config.mjs";
|
|
11
|
-
import { c as runtimeOf } from "./resolve-
|
|
11
|
+
import { c as runtimeOf } from "./resolve-CJwadE_F.mjs";
|
|
12
12
|
import { basename, dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
|
|
13
13
|
import { constants, existsSync, readFileSync } from "node:fs";
|
|
14
14
|
import { appendFile, chmod, copyFile, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
@@ -26,7 +26,7 @@ import { config } from "dotenv";
|
|
|
26
26
|
import { promisify } from "node:util";
|
|
27
27
|
import { Cron } from "@geekmidas/constructs/crons";
|
|
28
28
|
import { Queue } from "@geekmidas/constructs/queue";
|
|
29
|
-
import { CreateBucketCommand, GetBucketPolicyCommand, HeadBucketCommand, ListBucketsCommand, PutBucketPolicyCommand, S3Client } from "@aws-sdk/client-s3";
|
|
29
|
+
import { CreateBucketCommand, DeleteBucketLifecycleCommand, GetBucketLifecycleConfigurationCommand, GetBucketPolicyCommand, HeadBucketCommand, ListBucketsCommand, PutBucketLifecycleConfigurationCommand, PutBucketPolicyCommand, S3Client } from "@aws-sdk/client-s3";
|
|
30
30
|
import { CreateTopicCommand, GetTopicAttributesCommand, SNSClient } from "@aws-sdk/client-sns";
|
|
31
31
|
import { CreateQueueCommand, GetQueueUrlCommand, SQSClient } from "@aws-sdk/client-sqs";
|
|
32
32
|
import { Client } from "pg";
|
|
@@ -1025,6 +1025,7 @@ function planFor(manifest, stage, order, options = {}) {
|
|
|
1025
1025
|
...declaration.scheme ? { scheme: declaration.scheme } : {}
|
|
1026
1026
|
} : {},
|
|
1027
1027
|
...declaration.kind === "file-server" && declaration.open?.length ? { open: declaration.open } : {},
|
|
1028
|
+
...declaration.kind === "objects" && declaration.expire ? { expire: declaration.expire } : {},
|
|
1028
1029
|
...(declaration.kind === "rest-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
|
|
1029
1030
|
...fake ? { fake: {
|
|
1030
1031
|
key: fake.key,
|
|
@@ -2227,24 +2228,74 @@ async function withLock(lock, body) {
|
|
|
2227
2228
|
}
|
|
2228
2229
|
}
|
|
2229
2230
|
//#endregion
|
|
2230
|
-
//#region src/
|
|
2231
|
+
//#region src/providers/s3/lifecycle.ts
|
|
2231
2232
|
/**
|
|
2232
|
-
*
|
|
2233
|
+
* A bucket's lifecycle, as the constructs declare it: one expiry rule per
|
|
2234
|
+
* prefix, merged into whatever else the bucket's lifecycle already holds.
|
|
2233
2235
|
*
|
|
2234
|
-
*
|
|
2235
|
-
*
|
|
2236
|
-
*
|
|
2236
|
+
* S3 — and MinIO, which speaks the same API — keeps one lifecycle document
|
|
2237
|
+
* per bucket, and a write replaces all of it. So gkm owns only the rules it
|
|
2238
|
+
* names (`gkm-…`): every other rule is read and put back as it was, a rule of
|
|
2239
|
+
* gkm's that is no longer declared is dropped, and nothing is written when
|
|
2240
|
+
* gkm's rules already say what the manifest does.
|
|
2237
2241
|
*
|
|
2238
|
-
*
|
|
2239
|
-
*
|
|
2240
|
-
|
|
2242
|
+
* Shared by the `s3` provider and the MinIO a local or compose stack runs,
|
|
2243
|
+
* so a prefix expires the same way on both.
|
|
2244
|
+
*/
|
|
2245
|
+
/** The id every rule gkm writes starts with — and the only ones it touches. */
|
|
2246
|
+
const GKM_RULE_PREFIX = "gkm-";
|
|
2247
|
+
/**
|
|
2248
|
+
* The rule id for one prefix: readable, and unique however the prefix is
|
|
2249
|
+
* spelled — `a/b` and `a-b` read alike once sanitised, so a short hash of the
|
|
2250
|
+
* prefix itself follows.
|
|
2251
|
+
*/
|
|
2252
|
+
function expireRuleId(prefix) {
|
|
2253
|
+
const readable = prefix.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 200);
|
|
2254
|
+
const hash = createHash("sha256").update(prefix).digest("hex").slice(0, 8);
|
|
2255
|
+
return `${GKM_RULE_PREFIX}expire-${readable ? `${readable}-` : ""}${hash}`;
|
|
2256
|
+
}
|
|
2257
|
+
/** The rules a bucket's expiry asks for, in a stable order. */
|
|
2258
|
+
function expireRules(expire) {
|
|
2259
|
+
return Object.entries(expire ?? {}).map(([prefix, days]) => ({
|
|
2260
|
+
ID: expireRuleId(prefix),
|
|
2261
|
+
Status: "Enabled",
|
|
2262
|
+
Filter: { Prefix: prefix },
|
|
2263
|
+
Expiration: { Days: days }
|
|
2264
|
+
})).sort((a, b) => a.ID.localeCompare(b.ID));
|
|
2265
|
+
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Merge the declared expiry into the bucket's current rules.
|
|
2241
2268
|
*
|
|
2242
|
-
*
|
|
2243
|
-
* gives: the same DDL has to run in-process locally and from a provisioner in a
|
|
2244
|
-
* VPC, and one implementation is what stops "works locally, fails deployed".
|
|
2245
|
-
* When the role DDL lands in `@geekmidas/db` this delegates to it rather than
|
|
2246
|
-
* growing its own.
|
|
2269
|
+
* @param current the bucket's rules, or nothing when it has no lifecycle
|
|
2247
2270
|
*/
|
|
2271
|
+
function mergeLifecycle(current, expire) {
|
|
2272
|
+
const wanted = expireRules(expire);
|
|
2273
|
+
const rules = current ?? [];
|
|
2274
|
+
const others = rules.filter((r) => !r.ID?.startsWith(GKM_RULE_PREFIX));
|
|
2275
|
+
const ours = rules.filter((r) => r.ID?.startsWith(GKM_RULE_PREFIX));
|
|
2276
|
+
return {
|
|
2277
|
+
changed: canonical(ours) !== canonical(wanted) || new Set(ours.map((r) => r.ID)).size !== ours.length,
|
|
2278
|
+
rules: [...others, ...wanted],
|
|
2279
|
+
describe: describeExpiry(expire)
|
|
2280
|
+
};
|
|
2281
|
+
}
|
|
2282
|
+
/** `expire quotes/ after 30 days, tmp/ after 1 day` — or what removing says. */
|
|
2283
|
+
function describeExpiry(expire) {
|
|
2284
|
+
const entries = Object.entries(expire ?? {}).sort(([a], [b]) => a.localeCompare(b));
|
|
2285
|
+
if (entries.length === 0) return "remove expiry rules";
|
|
2286
|
+
return `expire ${entries.map(([prefix, days]) => `${prefix} after ${days} day${days === 1 ? "" : "s"}`).join(", ")}`;
|
|
2287
|
+
}
|
|
2288
|
+
/** gkm's rules as the fields it sets, order-free. */
|
|
2289
|
+
function canonical(rules) {
|
|
2290
|
+
return JSON.stringify(rules.map((r) => ({
|
|
2291
|
+
id: r.ID,
|
|
2292
|
+
status: r.Status,
|
|
2293
|
+
prefix: r.Filter?.Prefix ?? r.Prefix ?? "",
|
|
2294
|
+
days: r.Expiration?.Days ?? null
|
|
2295
|
+
})).sort((a, b) => (a.id ?? "").localeCompare(b.id ?? "")));
|
|
2296
|
+
}
|
|
2297
|
+
//#endregion
|
|
2298
|
+
//#region src/reconcile/provision.ts
|
|
2248
2299
|
/**
|
|
2249
2300
|
* The Postgres work a plan implies.
|
|
2250
2301
|
*
|
|
@@ -2430,6 +2481,20 @@ function bucketPolicies(plan) {
|
|
|
2430
2481
|
})).sort((a, b) => a.bucket.localeCompare(b.bucket));
|
|
2431
2482
|
}
|
|
2432
2483
|
/**
|
|
2484
|
+
* What each bucket keeps, and for how long: the buckets that declare an
|
|
2485
|
+
* expiry, by their stage-scoped name.
|
|
2486
|
+
*
|
|
2487
|
+
* Every bucket in the plan, not only those that declare one, is what a
|
|
2488
|
+
* removed expiry needs — its rules are dropped from a bucket that no longer
|
|
2489
|
+
* asks for them — so a bucket with none is listed with an empty expiry.
|
|
2490
|
+
*/
|
|
2491
|
+
function bucketLifecycles(plan) {
|
|
2492
|
+
return plan.resources.filter((r) => r.kind === "objects" && r.provisions).map((r) => ({
|
|
2493
|
+
bucket: r.name,
|
|
2494
|
+
expire: r.expire ?? {}
|
|
2495
|
+
})).sort((a, b) => a.bucket.localeCompare(b.bucket));
|
|
2496
|
+
}
|
|
2497
|
+
/**
|
|
2433
2498
|
* One bucket's open paths as an S3 bucket policy.
|
|
2434
2499
|
*
|
|
2435
2500
|
* Anonymous `s3:GetObject` on the named prefixes and nothing else — which is
|
|
@@ -2517,6 +2582,34 @@ async function databasesExist(client, names) {
|
|
|
2517
2582
|
}
|
|
2518
2583
|
}
|
|
2519
2584
|
/**
|
|
2585
|
+
* Apply each bucket's expiry, beside whatever other rules it has, skipping
|
|
2586
|
+
* those already correct — the same merge the `s3` provider makes deployed.
|
|
2587
|
+
*/
|
|
2588
|
+
async function applyLifecycles(client, lifecycles) {
|
|
2589
|
+
const applied = [];
|
|
2590
|
+
for (const { bucket, expire } of lifecycles) {
|
|
2591
|
+
const merge = mergeLifecycle(await client.lifecycle(bucket), expire);
|
|
2592
|
+
const id = `${bucket}:lifecycle`;
|
|
2593
|
+
const describe = `${merge.describe} on ${bucket}`;
|
|
2594
|
+
if (!merge.changed && Object.keys(expire).length === 0) continue;
|
|
2595
|
+
if (!merge.changed) {
|
|
2596
|
+
applied.push({
|
|
2597
|
+
id,
|
|
2598
|
+
describe,
|
|
2599
|
+
created: false
|
|
2600
|
+
});
|
|
2601
|
+
continue;
|
|
2602
|
+
}
|
|
2603
|
+
await client.setLifecycle(bucket, merge.rules);
|
|
2604
|
+
applied.push({
|
|
2605
|
+
id,
|
|
2606
|
+
describe,
|
|
2607
|
+
created: true
|
|
2608
|
+
});
|
|
2609
|
+
}
|
|
2610
|
+
return applied;
|
|
2611
|
+
}
|
|
2612
|
+
/**
|
|
2520
2613
|
* Apply each served bucket's open-path policy, skipping those already correct.
|
|
2521
2614
|
*
|
|
2522
2615
|
* Compared as parsed JSON rather than as text: the same policy re-serialised
|
|
@@ -4551,6 +4644,24 @@ function bucketClient(port, credentials) {
|
|
|
4551
4644
|
Bucket: bucket,
|
|
4552
4645
|
Policy: policy
|
|
4553
4646
|
}));
|
|
4647
|
+
},
|
|
4648
|
+
async lifecycle(bucket) {
|
|
4649
|
+
try {
|
|
4650
|
+
return (await s3.send(new GetBucketLifecycleConfigurationCommand({ Bucket: bucket }))).Rules;
|
|
4651
|
+
} catch (error) {
|
|
4652
|
+
if (error.name === "NoSuchLifecycleConfiguration") return;
|
|
4653
|
+
throw error;
|
|
4654
|
+
}
|
|
4655
|
+
},
|
|
4656
|
+
async setLifecycle(bucket, rules) {
|
|
4657
|
+
if (rules.length === 0) {
|
|
4658
|
+
await s3.send(new DeleteBucketLifecycleCommand({ Bucket: bucket }));
|
|
4659
|
+
return;
|
|
4660
|
+
}
|
|
4661
|
+
await s3.send(new PutBucketLifecycleConfigurationCommand({
|
|
4662
|
+
Bucket: bucket,
|
|
4663
|
+
LifecycleConfiguration: { Rules: rules }
|
|
4664
|
+
}));
|
|
4554
4665
|
}
|
|
4555
4666
|
};
|
|
4556
4667
|
}
|
|
@@ -5490,10 +5601,12 @@ async function create(plan, ports, credentials, sql, buckets, emulatorCarriers,
|
|
|
5490
5601
|
const minioPort = ports[primaryPortKey("minio")];
|
|
5491
5602
|
const names = bucketNames(plan);
|
|
5492
5603
|
const policies = bucketPolicies(plan);
|
|
5604
|
+
const lifecycles = bucketLifecycles(plan);
|
|
5493
5605
|
if (minioPort !== void 0 && (names.length > 0 || policies.length > 0)) {
|
|
5494
5606
|
const client = buckets(minioPort, credentials.minio);
|
|
5495
5607
|
if (names.length > 0) applied.push(...await applyBuckets(client, names));
|
|
5496
5608
|
if (policies.length > 0) applied.push(...await applyPolicies(client, policies));
|
|
5609
|
+
if (lifecycles.length > 0) applied.push(...await applyLifecycles(client, lifecycles));
|
|
5497
5610
|
}
|
|
5498
5611
|
const emulatorPort = ports[primaryPortKey("localstack")];
|
|
5499
5612
|
const carriers = carrierNames(plan);
|
|
@@ -7383,7 +7496,7 @@ async function createDnsProvider(options) {
|
|
|
7383
7496
|
});
|
|
7384
7497
|
}
|
|
7385
7498
|
if (provider === "godaddy") {
|
|
7386
|
-
const { GoDaddyProvider } = await import("./GoDaddyProvider-
|
|
7499
|
+
const { GoDaddyProvider } = await import("./GoDaddyProvider-B4JKSuX-.mjs");
|
|
7387
7500
|
return new GoDaddyProvider(options.godaddy ?? {});
|
|
7388
7501
|
}
|
|
7389
7502
|
if (provider === "cloudflare") throw new DnsProviderNotImplemented("cloudflare");
|
|
@@ -8232,6 +8345,6 @@ function reportPlannedSeeds(planned, log) {
|
|
|
8232
8345
|
for (const { folder, seeds } of planned) log(`🌱 ${folder}: would run ${seeds.length} (${seeds.join(", ")})`);
|
|
8233
8346
|
}
|
|
8234
8347
|
//#endregion
|
|
8235
|
-
export { devServicesUsed as $,
|
|
8348
|
+
export { devServicesUsed as $, withLogsPassword as $n, isUnder as $t, assertStageProvidersEnabled as A, TELEMETRY_CONTAINER as An, isPortAvailable as At, workerDockerfileOf as B, hostFor as Bn, maskPassword as Bt, setApplicationId as C, STACK_CACHE as Cn, cacheBackendFor as Ct, DnsRecordsUnreadable as D, withRedisPassword as Dn, createCredentialsPreload as Dt, setPostgresBackupId as E, stackRedis as En, storageBackendFor as Et, DockerPushFailed as F, scopeTelemetryEnv as Fn, isRemoteStore as Ft, CronGenerator as G, portsOf as Gn, imageLayout as Gt, workerBundleName as H, describeServices as Hn, toEmbeddableSecrets as Ht, appDockerfile as I, surfaceClientTraced as In, secretsStoreFor as It, DEV_SERVICES as J, LOCAL_LOGS_EMAIL as Jn, detectPackageManager as Jt, validateImageRef as K, postgresImage as Kn, TURBO_VERSION as Kt, dockerCommand as L, telemetryOf as Ln, storeFromConfig as Lt, stageProviderNotes as M, resourceName as Mn, loadPortState as Mt, PROVIDER_KINDS as N, appTelemetry as Nn, loadSecretsForApp as Nt, createDnsProvider as O, envFor as On, createEntryWrapper as Ot, DockerBuildFailed as P, isTelemetryKey as Pn, prepareEntryCredentials as Pt, assertDevServicesFlag as Q, stackLogs as Qn, publicBuildValues as Qt, ensureDockerignore as R, usesTelemetry as Rn, store_exports as Rt, recordRollback as S, REDIS_SERVICE as Sn, composeFor as St, setGeneratedSecret as T, runsRedis as Tn, providerOf as Tt, workerEntryDir as U, fakeKey as Un, withCustomSecret as Ut, WorkerGenerator as V, DEFAULT_IMAGES as Vn, storage_exports as Vt, QueueGenerator as W, portKeys as Wn, composeBuildPaths as Wt, ExternalServicesNotConfigured as X, logsAccess as Xn, imageBuildCredentials as Xt, DevServicesNeedServerTarget as Y, LOGS_SERVICE as Yn, findBuildRoot as Yt, STORAGE_KEY_PAIR as Z, logsService as Zn, isImageBuild as Zt, createComposeState as _, getKeyPath as _n, LEGACY_LOCAL_LOGIN as _t, dnsResources as a, bucketLifecycles as an, appEnvKeys as at, getGeneratedSecret as b, readKey as bn, pgClient as bt, describeActor as c, postgresStatements as cn, workerEnvKeys as ct, extractSubdomain as d, LOCAL_RABBITMQ_USER as dn, constructGlobs as dt, workerUnits as en, NoDomainForStage as er, externalServices as et, findRootDomain as f, loadLocalCredentials as fn, derivedContainers as ft, asDokployState as g, FileSecretsStore as gn, forgetState as gt, verifyDnsRecords as h, readLocalCredentials as hn, LOCAL_CA_PATH as ht, dnsRecordResource as i, applyPostgres as in, suppliedOnly as it, provisionCommand as j, planFor as jn, loadEnvFiles as jt, StageProviderDisabled as k, localRolePassword as kn, findAvailablePort as kt, isCi as l, quoteIdentifier as ln, FAKE_ENV as lt, orchestrateDns as m, postgresSuperuser as mn, workspace_exports as mt, reportDatabaseRuns as n, applyLifecycles as nn, resolveHost as nr, requiredStageKeys as nt, recordDnsChanges as o, bucketPolicies as on, dockerfileOf as ot, normalizeDnsConfig as p, postgresRoleSlug as pn, reconcileWorkspace as pt, AllowDevServicesTakesNoValue as q, primaryPortKey as qn, WORKER_PORT as qt, reportPlannedSeeds as r, applyPolicies as rn, stageServiceDeclarations as rt, currentActor as s, postgresDatabaseNames as sn, networkEnv as st, DeploySeedsFailed as t, applyBuckets as tn, isMainFrontendApp as tr, reportDevServices as tt, DeployJournal as u, mergeLifecycle as un, backendsOf as ut, createEmptyState as v, keystoreProject as vn, ensurePostgresLogin as vt, setBackupState as w, redisService as wn, eventsBackendFor as wt, recordRelease as x, withGeneratedSecrets as xn, CLUSTER_DATABASE as xt, getBackupState as y, projectKey as yn, bucketClient as yt, workerDockerfile as z, EMULATOR_ACCESS_KEY_ID as zn, initStageSecrets as zt };
|
|
8236
8349
|
|
|
8237
|
-
//# sourceMappingURL=seeds-
|
|
8350
|
+
//# sourceMappingURL=seeds-BBnvSEgG.mjs.map
|