@geekmidas/cli 10.0.0-alpha.72 → 10.0.0-alpha.73
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/{OpenApiTsGenerator-BlP53kf2.cjs → EndpointGenerator-CP6sBvQV.cjs} +4 -510
- package/dist/EndpointGenerator-CP6sBvQV.cjs.map +1 -0
- package/dist/{OpenApiTsGenerator-Dv0gT2DL.mjs → EndpointGenerator-DftalLYg.mjs} +3 -509
- package/dist/EndpointGenerator-DftalLYg.mjs.map +1 -0
- package/dist/{LegacyStateStore-NSHEinQi.mjs → LegacyStateStore-DTo7z924.mjs} +2 -2
- package/dist/{LegacyStateStore-NSHEinQi.mjs.map → LegacyStateStore-DTo7z924.mjs.map} +1 -1
- package/dist/{LegacyStateStore-Dd5IwiyC.cjs → LegacyStateStore-D_78eaHM.cjs} +2 -2
- package/dist/{LegacyStateStore-Dd5IwiyC.cjs.map → LegacyStateStore-D_78eaHM.cjs.map} +1 -1
- package/dist/{LocalStateStore-DTylG4T4.cjs → LocalStateStore-BhrlQIXD.cjs} +2 -2
- package/dist/{LocalStateStore-DTylG4T4.cjs.map → LocalStateStore-BhrlQIXD.cjs.map} +1 -1
- package/dist/{LocalStateStore-DUoG2wA_.mjs → LocalStateStore-CNjgkRk4.mjs} +2 -2
- package/dist/{LocalStateStore-DUoG2wA_.mjs.map → LocalStateStore-CNjgkRk4.mjs.map} +1 -1
- package/dist/OpenApiTsGenerator-CKBCckKz.cjs +514 -0
- package/dist/OpenApiTsGenerator-CKBCckKz.cjs.map +1 -0
- package/dist/OpenApiTsGenerator-nu1r1NgB.mjs +509 -0
- package/dist/OpenApiTsGenerator-nu1r1NgB.mjs.map +1 -0
- package/dist/{S3StateStore-Dxob3PNA.mjs → S3StateStore-g2P7T_Mo.mjs} +2 -2
- package/dist/{S3StateStore-Dxob3PNA.mjs.map → S3StateStore-g2P7T_Mo.mjs.map} +1 -1
- package/dist/{S3StateStore-D7hrU-sy.cjs → S3StateStore-oCxRs6HM.cjs} +2 -2
- package/dist/{S3StateStore-D7hrU-sy.cjs.map → S3StateStore-oCxRs6HM.cjs.map} +1 -1
- package/dist/{SSMStateStore-Dvl4A8Up.mjs → SSMStateStore-CYenunmK.mjs} +2 -2
- package/dist/{SSMStateStore-Dvl4A8Up.mjs.map → SSMStateStore-CYenunmK.mjs.map} +1 -1
- package/dist/{SSMStateStore-DGIKJ4NN.cjs → SSMStateStore-DXp0m7XI.cjs} +2 -2
- package/dist/{SSMStateStore-DGIKJ4NN.cjs.map → SSMStateStore-DXp0m7XI.cjs.map} +1 -1
- package/dist/SubscriberGenerator-Bixm28fN.cjs +461 -0
- package/dist/SubscriberGenerator-Bixm28fN.cjs.map +1 -0
- package/dist/SubscriberGenerator-DZk_pKDh.mjs +432 -0
- package/dist/SubscriberGenerator-DZk_pKDh.mjs.map +1 -0
- package/dist/{add-XTLU19_E.mjs → add-BiPlBUq3.mjs} +4 -4
- package/dist/{add-XTLU19_E.mjs.map → add-BiPlBUq3.mjs.map} +1 -1
- package/dist/{add-DeC2Kyyv.cjs → add-C1ojB2Yy.cjs} +4 -4
- package/dist/{add-DeC2Kyyv.cjs.map → add-C1ojB2Yy.cjs.map} +1 -1
- package/dist/{bundler-CNTVLCCA.mjs → bundler-C2LZoLdP.mjs} +6 -6
- package/dist/bundler-C2LZoLdP.mjs.map +1 -0
- package/dist/{bundler-CEaR6Dpb.cjs → bundler-C35h0WKt.cjs} +6 -6
- package/dist/bundler-C35h0WKt.cjs.map +1 -0
- package/dist/{cli-D1arS0p1.mjs → cli-BfdfyTF6.mjs} +4 -4
- package/dist/{cli-D1arS0p1.mjs.map → cli-BfdfyTF6.mjs.map} +1 -1
- package/dist/{cli-MMgBrHx7.cjs → cli-DJVL2sL9.cjs} +4 -4
- package/dist/{cli-MMgBrHx7.cjs.map → cli-DJVL2sL9.cjs.map} +1 -1
- package/dist/{compose-T3hnnjKZ.mjs → compose-9II-0IsK.mjs} +221 -64
- package/dist/compose-9II-0IsK.mjs.map +1 -0
- package/dist/{compose-B-MME-4C.cjs → compose-CNnw8meq.cjs} +223 -66
- package/dist/compose-CNnw8meq.cjs.map +1 -0
- package/dist/{config-BN6iXvyR.d.mts → config-B8OR_TrO.d.mts} +3 -3
- package/dist/{config-BN6iXvyR.d.mts.map → config-B8OR_TrO.d.mts.map} +1 -1
- package/dist/{config-j9zBKaEG.d.cts → config-RLuR2o9A.d.cts} +3 -3
- package/dist/{config-j9zBKaEG.d.cts.map → config-RLuR2o9A.d.cts.map} +1 -1
- package/dist/config.cjs +4 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +4 -1
- package/dist/config.mjs.map +1 -1
- package/dist/{credentialSchemas-BmYxnEz_.mjs → credentialSchemas-BJqRJNK4.mjs} +2 -2
- package/dist/{credentialSchemas-BmYxnEz_.mjs.map → credentialSchemas-BJqRJNK4.mjs.map} +1 -1
- package/dist/{credentialSchemas-BcNL1N5R.cjs → credentialSchemas-DCR4Wd1W.cjs} +2 -2
- package/dist/{credentialSchemas-BcNL1N5R.cjs.map → credentialSchemas-DCR4Wd1W.cjs.map} +1 -1
- package/dist/deploy/public.cjs +7 -7
- package/dist/deploy/public.d.cts +4 -4
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +4 -4
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +7 -7
- package/dist/deploy/sniffer-routes-worker.cjs +2 -2
- package/dist/deploy/sniffer-routes-worker.mjs +2 -2
- package/dist/{deploy-CZE0m6jd.cjs → deploy-BitZLdnY.cjs} +12 -6
- package/dist/deploy-BitZLdnY.cjs.map +1 -0
- package/dist/{deploy-ClC53rc6.mjs → deploy-nmov4j0B.mjs} +12 -6
- package/dist/deploy-nmov4j0B.mjs.map +1 -0
- package/dist/{discover-Buwf1z4P.mjs → discover-BPelzeGW.mjs} +21 -2
- package/dist/discover-BPelzeGW.mjs.map +1 -0
- package/dist/{discover-B_IkPukx.d.cts → discover-CU0paUyH.d.cts} +10 -1
- package/dist/discover-CU0paUyH.d.cts.map +1 -0
- package/dist/{discover-B4VjaFJk.cjs → discover-D1It5r_h.cjs} +21 -2
- package/dist/discover-D1It5r_h.cjs.map +1 -0
- package/dist/{discover-B6yPpvRV.d.mts → discover-DFiJxwfv.d.mts} +10 -1
- package/dist/discover-DFiJxwfv.d.mts.map +1 -0
- package/dist/{dokploy-D1UwQKm3.mjs → dokploy-CZ1vZt21.mjs} +2 -2
- package/dist/{dokploy-D1UwQKm3.mjs.map → dokploy-CZ1vZt21.mjs.map} +1 -1
- package/dist/{dokploy-lwmH05zr.cjs → dokploy-Ce_VTytN.cjs} +2 -2
- package/dist/{dokploy-lwmH05zr.cjs.map → dokploy-Ce_VTytN.cjs.map} +1 -1
- package/dist/{encryption-D05sNwED.cjs → encryption-CDGRdcMr.cjs} +2 -2
- package/dist/{encryption-D05sNwED.cjs.map → encryption-CDGRdcMr.cjs.map} +1 -1
- package/dist/{encryption-DcrxWl1s.mjs → encryption-CmfPICSN.mjs} +2 -2
- package/dist/{encryption-DcrxWl1s.mjs.map → encryption-CmfPICSN.mjs.map} +1 -1
- package/dist/{engine-DmQS3XHX.mjs → engine-B37qBO5W.mjs} +117 -17
- package/dist/engine-B37qBO5W.mjs.map +1 -0
- package/dist/{engine-Cry1vwMz.cjs → engine-DL2-PW6m.cjs} +117 -17
- package/dist/engine-DL2-PW6m.cjs.map +1 -0
- package/dist/{github-BchWoiVx.cjs → github-C6qF8kHg.cjs} +2 -2
- package/dist/{github-BchWoiVx.cjs.map → github-C6qF8kHg.cjs.map} +1 -1
- package/dist/{github-CqYOP8cI.mjs → github-hjHHm7jM.mjs} +2 -2
- package/dist/{github-CqYOP8cI.mjs.map → github-hjHHm7jM.mjs.map} +1 -1
- package/dist/{index-DvoxuTqR.d.mts → index-DHyTqGG3.d.mts} +2 -2
- package/dist/{index-Bk3NY6DN.d.cts.map → index-DHyTqGG3.d.mts.map} +1 -1
- package/dist/{index-Bk3NY6DN.d.cts → index-Dg-UZ4Hm.d.cts} +2 -2
- package/dist/{index-DvoxuTqR.d.mts.map → index-Dg-UZ4Hm.d.cts.map} +1 -1
- package/dist/index.cjs +113 -468
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +107 -462
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-guck0NJK.mjs → migrate-CFFC3esE.mjs} +3 -3
- package/dist/{migrate-guck0NJK.mjs.map → migrate-CFFC3esE.mjs.map} +1 -1
- package/dist/{migrate-qKeGYq21.cjs → migrate-kA_j1TPK.cjs} +3 -3
- package/dist/{migrate-qKeGYq21.cjs.map → migrate-kA_j1TPK.cjs.map} +1 -1
- package/dist/openapi.cjs +3 -2
- package/dist/openapi.cjs.map +1 -1
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +2 -1
- package/dist/openapi.mjs.map +1 -1
- package/dist/{ready-B-7LayMF.cjs → ready-BIuMw6wH.cjs} +9 -297
- package/dist/ready-BIuMw6wH.cjs.map +1 -0
- package/dist/{ready-ULc5BTOb.mjs → ready-C0U0NYfB.mjs} +6 -288
- package/dist/ready-C0U0NYfB.mjs.map +1 -0
- package/dist/reconcile/public.cjs +1 -1
- package/dist/reconcile/public.d.cts +2 -2
- package/dist/reconcile/public.d.mts +2 -2
- package/dist/reconcile/public.mjs +1 -1
- package/dist/{resolve-BsXEXAUz.mjs → resolve-CV4eQkDa.mjs} +3 -3
- package/dist/{resolve-BsXEXAUz.mjs.map → resolve-CV4eQkDa.mjs.map} +1 -1
- package/dist/{resolve-wEjEvbJ5.cjs → resolve-E5RfY0bm.cjs} +3 -3
- package/dist/{resolve-wEjEvbJ5.cjs.map → resolve-E5RfY0bm.cjs.map} +1 -1
- package/dist/{rollback-Bk91csFg.mjs → rollback-C-V-Rf4a.mjs} +4 -4
- package/dist/{rollback-Bk91csFg.mjs.map → rollback-C-V-Rf4a.mjs.map} +1 -1
- package/dist/{rollback-DmcU-efZ.cjs → rollback-QGwomD64.cjs} +4 -4
- package/dist/{rollback-DmcU-efZ.cjs.map → rollback-QGwomD64.cjs.map} +1 -1
- package/dist/{runtime-DHJhe4QI.d.mts → runtime-CWYLIeCU.d.mts} +2 -2
- package/dist/{runtime-CYAO4iZG.d.cts.map → runtime-CWYLIeCU.d.mts.map} +1 -1
- package/dist/{runtime-CYAO4iZG.d.cts → runtime-CmuQOT6A.d.cts} +2 -2
- package/dist/{runtime-DHJhe4QI.d.mts.map → runtime-CmuQOT6A.d.cts.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/{sniffer-vAXsU_4G.mjs → sniffer-BFmdZpZ2.mjs} +6 -6
- package/dist/{sniffer-vAXsU_4G.mjs.map → sniffer-BFmdZpZ2.mjs.map} +1 -1
- package/dist/{sniffer-DpHpFZBD.cjs → sniffer-C-T7dSMN.cjs} +6 -6
- package/dist/{sniffer-DpHpFZBD.cjs.map → sniffer-C-T7dSMN.cjs.map} +1 -1
- package/dist/{state-CCuTJNRH.cjs → state-DMjFPOhf.cjs} +942 -22
- package/dist/state-DMjFPOhf.cjs.map +1 -0
- package/dist/{state-BJFherj1.mjs → state-DtS2HEfi.mjs} +877 -17
- package/dist/state-DtS2HEfi.mjs.map +1 -0
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.d.cts +2 -2
- package/dist/target/public.d.mts +2 -2
- package/dist/target/public.mjs +1 -1
- package/dist/{terminal-CFO3xWoF.cjs → terminal-BL5E0xbR.cjs} +2 -2
- package/dist/{terminal-CFO3xWoF.cjs.map → terminal-BL5E0xbR.cjs.map} +1 -1
- package/dist/{terminal-C6TBo_SA.mjs → terminal-BdvrmkaC.mjs} +2 -2
- package/dist/{terminal-C6TBo_SA.mjs.map → terminal-BdvrmkaC.mjs.map} +1 -1
- package/dist/{types-DkG5WW8l.d.mts → types-BLdCL4fB.d.mts} +17 -1
- package/dist/types-BLdCL4fB.d.mts.map +1 -0
- package/dist/{types-BD1jgA85.d.cts → types-DwCQCkC-.d.cts} +17 -1
- package/dist/types-DwCQCkC-.d.cts.map +1 -0
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +2 -2
- package/dist/workspace-C7NqCsQF.mjs.map +1 -1
- package/dist/workspace-vdrcRI-m.cjs.map +1 -1
- package/package.json +15 -15
- package/dist/OpenApiTsGenerator-BlP53kf2.cjs.map +0 -1
- package/dist/OpenApiTsGenerator-Dv0gT2DL.mjs.map +0 -1
- package/dist/bundler-CEaR6Dpb.cjs.map +0 -1
- package/dist/bundler-CNTVLCCA.mjs.map +0 -1
- package/dist/compose-B-MME-4C.cjs.map +0 -1
- package/dist/compose-T3hnnjKZ.mjs.map +0 -1
- package/dist/deploy-CZE0m6jd.cjs.map +0 -1
- package/dist/deploy-ClC53rc6.mjs.map +0 -1
- package/dist/discover-B4VjaFJk.cjs.map +0 -1
- package/dist/discover-B6yPpvRV.d.mts.map +0 -1
- package/dist/discover-B_IkPukx.d.cts.map +0 -1
- package/dist/discover-Buwf1z4P.mjs.map +0 -1
- package/dist/engine-Cry1vwMz.cjs.map +0 -1
- package/dist/engine-DmQS3XHX.mjs.map +0 -1
- package/dist/fakes-C9RiT6XG.mjs +0 -125
- package/dist/fakes-C9RiT6XG.mjs.map +0 -1
- package/dist/fakes-zW-jNAbQ.cjs +0 -148
- package/dist/fakes-zW-jNAbQ.cjs.map +0 -1
- package/dist/ready-B-7LayMF.cjs.map +0 -1
- package/dist/ready-ULc5BTOb.mjs.map +0 -1
- package/dist/state-BJFherj1.mjs.map +0 -1
- package/dist/state-CCuTJNRH.cjs.map +0 -1
- package/dist/types-BD1jgA85.d.cts.map +0 -1
- package/dist/types-DkG5WW8l.d.mts.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -3,21 +3,22 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
4
4
|
const require_run = require("./run-fVZ-rLnc.cjs");
|
|
5
5
|
const require_credentials = require("./credentials-BVs7mrtw.cjs");
|
|
6
|
-
const require_discover = require("./discover-
|
|
6
|
+
const require_discover = require("./discover-D1It5r_h.cjs");
|
|
7
7
|
const require_derive = require("./derive-DAbo49sm.cjs");
|
|
8
8
|
const require_workspace = require("./workspace-vdrcRI-m.cjs");
|
|
9
9
|
const require_config = require("./config.cjs");
|
|
10
|
-
const require_state = require("./state-
|
|
11
|
-
const
|
|
12
|
-
const require_sniffer = require("./sniffer-
|
|
10
|
+
const require_state = require("./state-DMjFPOhf.cjs");
|
|
11
|
+
const require_EndpointGenerator = require("./EndpointGenerator-CP6sBvQV.cjs");
|
|
12
|
+
const require_sniffer = require("./sniffer-C-T7dSMN.cjs");
|
|
13
13
|
const require_openapi = require("./openapi.cjs");
|
|
14
|
+
const require_SubscriberGenerator = require("./SubscriberGenerator-Bixm28fN.cjs");
|
|
14
15
|
const require_appPorts = require("./appPorts-Cu79hJF6.cjs");
|
|
15
|
-
const require_ready = require("./ready-
|
|
16
|
+
const require_ready = require("./ready-BIuMw6wH.cjs");
|
|
16
17
|
const require_emit = require("./emit-Dmc1nvdS.cjs");
|
|
17
|
-
const require_deploy = require("./deploy-
|
|
18
|
-
const require_compose = require("./compose-
|
|
19
|
-
const require_credentialSchemas = require("./credentialSchemas-
|
|
20
|
-
const require_LocalStateStore = require("./LocalStateStore-
|
|
18
|
+
const require_deploy = require("./deploy-BitZLdnY.cjs");
|
|
19
|
+
const require_compose = require("./compose-CNnw8meq.cjs");
|
|
20
|
+
const require_credentialSchemas = require("./credentialSchemas-DCR4Wd1W.cjs");
|
|
21
|
+
const require_LocalStateStore = require("./LocalStateStore-BhrlQIXD.cjs");
|
|
21
22
|
const require_utils = require("./utils-D2Nk1Nv2.cjs");
|
|
22
23
|
let node_path = require("node:path");
|
|
23
24
|
let commander = require("commander");
|
|
@@ -48,12 +49,10 @@ let http2 = require("http2");
|
|
|
48
49
|
let stream = require("stream");
|
|
49
50
|
let crypto = require("crypto");
|
|
50
51
|
crypto = require_rolldown_runtime.__toESM(crypto, 1);
|
|
51
|
-
let _geekmidas_constructs_crons = require("@geekmidas/constructs/crons");
|
|
52
52
|
let _geekmidas_constructs_functions = require("@geekmidas/constructs/functions");
|
|
53
|
-
let _geekmidas_constructs_queue = require("@geekmidas/constructs/queue");
|
|
54
53
|
let _geekmidas_constructs_topic = require("@geekmidas/constructs/topic");
|
|
55
54
|
//#region package.json
|
|
56
|
-
var version = "10.0.0-alpha.
|
|
55
|
+
var version = "10.0.0-alpha.73";
|
|
57
56
|
//#endregion
|
|
58
57
|
//#region src/prompt.ts
|
|
59
58
|
/**
|
|
@@ -136,7 +135,7 @@ const logger$8 = console;
|
|
|
136
135
|
* Validate Dokploy token by making a test API call
|
|
137
136
|
*/
|
|
138
137
|
async function validateDokployToken(endpoint, token) {
|
|
139
|
-
const { DokployApi } = await Promise.resolve().then(() => require("./sniffer-
|
|
138
|
+
const { DokployApi } = await Promise.resolve().then(() => require("./sniffer-C-T7dSMN.cjs")).then((n) => n.dokploy_api_exports);
|
|
140
139
|
return new DokployApi({
|
|
141
140
|
baseUrl: endpoint,
|
|
142
141
|
token
|
|
@@ -2042,9 +2041,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
2042
2041
|
for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
2043
2042
|
logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
2044
2043
|
if (options.migrate || options.seed) {
|
|
2045
|
-
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-
|
|
2044
|
+
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-kA_j1TPK.cjs"));
|
|
2046
2045
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
2047
|
-
} else await Promise.resolve().then(() => require("./migrate-
|
|
2046
|
+
} else await Promise.resolve().then(() => require("./migrate-kA_j1TPK.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
2048
2047
|
logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
2049
2048
|
});
|
|
2050
2049
|
const appUrls = {};
|
|
@@ -2603,244 +2602,6 @@ var DevServer = class {
|
|
|
2603
2602
|
}
|
|
2604
2603
|
};
|
|
2605
2604
|
//#endregion
|
|
2606
|
-
//#region src/generators/CronGenerator.ts
|
|
2607
|
-
var CronGenerator = class extends require_discover.ConstructGenerator {
|
|
2608
|
-
async build(context, constructs, outputDir, options) {
|
|
2609
|
-
const target = options?.target ?? "aws";
|
|
2610
|
-
const logger = console;
|
|
2611
|
-
const cronInfos = [];
|
|
2612
|
-
if (target === "server") {
|
|
2613
|
-
await this.generateServerCronsFile(outputDir, constructs);
|
|
2614
|
-
logger.log(`Generated server crons file with ${constructs.length} crons`);
|
|
2615
|
-
return cronInfos;
|
|
2616
|
-
}
|
|
2617
|
-
if (constructs.length === 0) return cronInfos;
|
|
2618
|
-
const cronsDir = (0, node_path.join)(outputDir, "crons");
|
|
2619
|
-
await (0, node_fs_promises.mkdir)(cronsDir, { recursive: true });
|
|
2620
|
-
for (const { key, construct, path } of constructs) {
|
|
2621
|
-
const handlerFile = await this.generateCronHandler(cronsDir, path.relative, key, context, construct.owner);
|
|
2622
|
-
cronInfos.push({
|
|
2623
|
-
name: key,
|
|
2624
|
-
handler: (0, node_path.relative)(options?.root ?? process.cwd(), handlerFile).replace(/\.ts$/, ".handler"),
|
|
2625
|
-
schedule: construct.schedule || "rate(1 hour)",
|
|
2626
|
-
timeout: construct.timeout,
|
|
2627
|
-
memorySize: construct.memorySize,
|
|
2628
|
-
environment: await construct.getEnvironment({ markOptional: context.markOptional }),
|
|
2629
|
-
dependencies: construct.constructs
|
|
2630
|
-
});
|
|
2631
|
-
logger.log(`Generated cron handler: ${key}`);
|
|
2632
|
-
}
|
|
2633
|
-
return cronInfos;
|
|
2634
|
-
}
|
|
2635
|
-
isConstruct(value) {
|
|
2636
|
-
return _geekmidas_constructs_crons.Cron.isCron(value);
|
|
2637
|
-
}
|
|
2638
|
-
/**
|
|
2639
|
-
* The crons file a server entry imports.
|
|
2640
|
-
*
|
|
2641
|
-
* Shaped after `generateServerSubscribersFile`: one module, every cron, a
|
|
2642
|
-
* `setupCrons` the generated entry calls beside `setupSubscribers`.
|
|
2643
|
-
*
|
|
2644
|
-
* It picks its scheduler from what the process can reach. With a Postgres it
|
|
2645
|
-
* uses pg-boss, whose schedules live in the database — so a deployment
|
|
2646
|
-
* running four replicas fires each job once, which is the thing a timer in
|
|
2647
|
-
* every process gets wrong and does not report. With no database it falls
|
|
2648
|
-
* back to timers and says plainly that it is doing so.
|
|
2649
|
-
*/
|
|
2650
|
-
async generateServerCronsFile(outputDir, crons) {
|
|
2651
|
-
await (0, node_fs_promises.mkdir)(outputDir, { recursive: true });
|
|
2652
|
-
const cronsPath = (0, node_path.join)(outputDir, "crons.ts");
|
|
2653
|
-
if (crons.length === 0) {
|
|
2654
|
-
await (0, node_fs_promises.writeFile)(cronsPath, `/**
|
|
2655
|
-
* Generated cron setup — this app declares none.
|
|
2656
|
-
*/
|
|
2657
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2658
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2659
|
-
|
|
2660
|
-
export async function setupCrons(
|
|
2661
|
-
_envParser: EnvironmentParser<any>,
|
|
2662
|
-
_logger: Logger,
|
|
2663
|
-
): Promise<void> {}
|
|
2664
|
-
|
|
2665
|
-
export async function stopCrons(): Promise<void> {}
|
|
2666
|
-
`);
|
|
2667
|
-
return cronsPath;
|
|
2668
|
-
}
|
|
2669
|
-
const importsByFile = /* @__PURE__ */ new Map();
|
|
2670
|
-
for (const { path, key } of crons) {
|
|
2671
|
-
const importPath = (0, node_path.relative)((0, node_path.dirname)(cronsPath), path.relative).replace(/\.ts$/, ".js");
|
|
2672
|
-
if (!importsByFile.has(importPath)) importsByFile.set(importPath, []);
|
|
2673
|
-
importsByFile.get(importPath)?.push(key);
|
|
2674
|
-
}
|
|
2675
|
-
const content = `/**
|
|
2676
|
-
* Generated cron setup.
|
|
2677
|
-
*
|
|
2678
|
-
* Schedules every cron this app declares, in the process that serves it.
|
|
2679
|
-
*
|
|
2680
|
-
* The schedule lives in Postgres, through pg-boss, in the database the worker
|
|
2681
|
-
* named with \`.database(db)\`. That is what makes running several replicas
|
|
2682
|
-
* safe: each job fires once, where a timer in every process fires it once per
|
|
2683
|
-
* replica and reports nothing.
|
|
2684
|
-
*
|
|
2685
|
-
* No connection string appears here. The construct that owns the database is
|
|
2686
|
-
* the only thing that knows its key, and it is resolved through service
|
|
2687
|
-
* discovery like any other dependency.
|
|
2688
|
-
*/
|
|
2689
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2690
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2691
|
-
import { runCron, scheduleInProcess, toCronExpression } from '@geekmidas/constructs/crons';
|
|
2692
|
-
import { ServiceDiscovery } from '@geekmidas/services';
|
|
2693
|
-
${Array.from(importsByFile.entries()).map(([importPath, exports]) => `import { ${exports.join(", ")} } from '${importPath}';`).join("\n")}
|
|
2694
|
-
|
|
2695
|
-
const crons = [
|
|
2696
|
-
${crons.map(({ key }) => ` { name: '${key}', cron: ${key} }`).join(",\n")}
|
|
2697
|
-
];
|
|
2698
|
-
|
|
2699
|
-
type Stoppable = { stop: () => Promise<void> | void };
|
|
2700
|
-
const running: Stoppable[] = [];
|
|
2701
|
-
|
|
2702
|
-
export async function setupCrons(
|
|
2703
|
-
envParser: EnvironmentParser<any>,
|
|
2704
|
-
logger: Logger,
|
|
2705
|
-
): Promise<void> {
|
|
2706
|
-
if (crons.length === 0) {
|
|
2707
|
-
return;
|
|
2708
|
-
}
|
|
2709
|
-
|
|
2710
|
-
const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
|
|
2711
|
-
|
|
2712
|
-
// Resolved once per cron rather than per firing: registering services on
|
|
2713
|
-
// every tick would reconnect a database every minute.
|
|
2714
|
-
const prepared = [];
|
|
2715
|
-
for (const { name, cron } of crons) {
|
|
2716
|
-
try {
|
|
2717
|
-
const schedule = toCronExpression(cron.schedule);
|
|
2718
|
-
const services = cron.services.length > 0
|
|
2719
|
-
? await serviceDiscovery.register(cron.services)
|
|
2720
|
-
: {};
|
|
2721
|
-
|
|
2722
|
-
prepared.push({ name, cron, schedule, services });
|
|
2723
|
-
} catch (error) {
|
|
2724
|
-
// An unrepresentable schedule is a build-time mistake, and failing the
|
|
2725
|
-
// process for it would take the HTTP server down with it.
|
|
2726
|
-
logger.error({ err: error, cron: name }, 'Cron has no runnable schedule, skipping');
|
|
2727
|
-
}
|
|
2728
|
-
}
|
|
2729
|
-
|
|
2730
|
-
const run = async (entry: (typeof prepared)[number]) => {
|
|
2731
|
-
try {
|
|
2732
|
-
// The cron's own function, the way its Lambda would run it — services,
|
|
2733
|
-
// the worker's database as \`db\`, its events. It used to call a
|
|
2734
|
-
// \`handler\` a Cron does not have, so every firing logged a failure.
|
|
2735
|
-
await runCron(entry.cron, serviceDiscovery);
|
|
2736
|
-
} catch (error) {
|
|
2737
|
-
logger.error({ err: error, cron: entry.name }, 'Cron failed');
|
|
2738
|
-
}
|
|
2739
|
-
};
|
|
2740
|
-
|
|
2741
|
-
// The app's one pg-boss: the events broker's, as the broker's role, in the
|
|
2742
|
-
// broker's schema. A server fires its own crons, and a process scheduling in
|
|
2743
|
-
// memory fires each job once per replica — so the schedule lives in
|
|
2744
|
-
// Postgres. It used to be a second pg-boss on the worker's database, as the
|
|
2745
|
-
// runtime role, which can neither create a schema nor use the broker's.
|
|
2746
|
-
const { url, devPid } = envParser
|
|
2747
|
-
.create((get) => ({
|
|
2748
|
-
url: get('EVENT_PUBLISHER_CONNECTION_STRING').string().optional(),
|
|
2749
|
-
// Set by \`gkm dev\` on the server it starts, and by nothing deployed.
|
|
2750
|
-
devPid: get('GKM_DEV_PID').string().optional(),
|
|
2751
|
-
}))
|
|
2752
|
-
.parse();
|
|
2753
|
-
|
|
2754
|
-
if (!url?.startsWith('pgboss://')) {
|
|
2755
|
-
// \`gkm dev\` on a target whose crons are infrastructure once deployed —
|
|
2756
|
-
// EventBridge rules on AWS — has no broker to keep a schedule in. It is one
|
|
2757
|
-
// process, so a timer fires each job once, which is all pg-boss is for
|
|
2758
|
-
// here. Only there: a deployed server firing by timer fires once per
|
|
2759
|
-
// replica, so outside dev this stays the error below.
|
|
2760
|
-
if (devPid) {
|
|
2761
|
-
for (const entry of prepared) {
|
|
2762
|
-
running.push(scheduleInProcess(entry.schedule, () => run(entry)));
|
|
2763
|
-
logger.info({ cron: entry.name, schedule: entry.schedule }, 'Cron scheduled in this process');
|
|
2764
|
-
}
|
|
2765
|
-
return;
|
|
2766
|
-
}
|
|
2767
|
-
|
|
2768
|
-
logger.error(
|
|
2769
|
-
{ crons: prepared.map(({ name }) => name) },
|
|
2770
|
-
'These crons have nowhere to keep their schedule. On a server they are ' +
|
|
2771
|
-
'scheduled through the pg-boss events broker ' +
|
|
2772
|
-
'(EVENT_PUBLISHER_CONNECTION_STRING), and ' +
|
|
2773
|
-
(url ? 'the broker configured is not pg-boss.' : 'none is configured.'),
|
|
2774
|
-
);
|
|
2775
|
-
return;
|
|
2776
|
-
}
|
|
2777
|
-
|
|
2778
|
-
// Through the registered pg-boss driver, which the entry registers for a
|
|
2779
|
-
// server whose broker is pg-boss. Naming \`@geekmidas/events/pgboss\` here
|
|
2780
|
-
// made every bundle with a cron resolve pg-boss, whatever its broker.
|
|
2781
|
-
const { EventConnectionFactory } = await import('@geekmidas/events');
|
|
2782
|
-
const connection = (await EventConnectionFactory.fromConnectionString(
|
|
2783
|
-
url,
|
|
2784
|
-
)) as import('@geekmidas/events').EventConnection & { instance?: any };
|
|
2785
|
-
const boss = connection.instance!;
|
|
2786
|
-
|
|
2787
|
-
// What this app declares now. Anything else under the prefix belonged to a
|
|
2788
|
-
// cron since renamed or deleted, and would keep firing at a handler that has
|
|
2789
|
-
// gone.
|
|
2790
|
-
//
|
|
2791
|
-
// The prefix is \`cron.\` rather than \`cron:\`: pg-boss accepts
|
|
2792
|
-
// alphanumerics, underscores, hyphens, periods and slashes in a queue name,
|
|
2793
|
-
// and rejects a colon outright.
|
|
2794
|
-
const declared = new Set(prepared.map(({ name }) => \`cron.\${name}\`));
|
|
2795
|
-
for (const existing of await boss.getSchedules()) {
|
|
2796
|
-
if (existing.name.startsWith('cron.') && !declared.has(existing.name)) {
|
|
2797
|
-
await boss.unschedule(existing.name);
|
|
2798
|
-
logger.info({ cron: existing.name }, 'Removed a schedule nothing declares');
|
|
2799
|
-
}
|
|
2800
|
-
}
|
|
2801
|
-
|
|
2802
|
-
for (const entry of prepared) {
|
|
2803
|
-
const queue = \`cron.\${entry.name}\`;
|
|
2804
|
-
await boss.createQueue(queue);
|
|
2805
|
-
// UTC, so this agrees with the schedule a deploy target would have made.
|
|
2806
|
-
await boss.schedule(queue, entry.schedule, undefined, { tz: 'UTC' });
|
|
2807
|
-
await boss.work(queue, () => run(entry));
|
|
2808
|
-
|
|
2809
|
-
logger.info({ cron: entry.name, schedule: entry.schedule }, 'Cron scheduled');
|
|
2810
|
-
}
|
|
2811
|
-
|
|
2812
|
-
running.push({ stop: () => connection.close() });
|
|
2813
|
-
logger.info({ count: prepared.length }, 'Crons scheduled');
|
|
2814
|
-
}
|
|
2815
|
-
|
|
2816
|
-
export async function stopCrons(): Promise<void> {
|
|
2817
|
-
await Promise.all(running.map((r) => r.stop()));
|
|
2818
|
-
running.length = 0;
|
|
2819
|
-
}
|
|
2820
|
-
`;
|
|
2821
|
-
await (0, node_fs_promises.writeFile)(cronsPath, content);
|
|
2822
|
-
return cronsPath;
|
|
2823
|
-
}
|
|
2824
|
-
async generateCronHandler(outputDir, sourceFile, exportName, context, owner) {
|
|
2825
|
-
const handlerFileName = `${exportName}.ts`;
|
|
2826
|
-
const handlerPath = (0, node_path.join)(outputDir, handlerFileName);
|
|
2827
|
-
const importPath = (0, node_path.relative)((0, node_path.dirname)(handlerPath), sourceFile).replace(/\.ts$/, ".js");
|
|
2828
|
-
const runtime = require_OpenApiTsGenerator.runtimeFor(context, (0, node_path.dirname)(handlerPath), owner);
|
|
2829
|
-
const content = `import { AWSScheduledFunction } from '@geekmidas/constructs/aws';
|
|
2830
|
-
import { ${exportName} } from '${importPath}';
|
|
2831
|
-
${runtime.imports}
|
|
2832
|
-
${context.storageDrivers?.imports ?? ""}
|
|
2833
|
-
${runtime.bindings}
|
|
2834
|
-
${context.storageDrivers?.setup ? `\n// The handler registers the drivers its target needs.\n${context.storageDrivers.setup}\n` : ""}
|
|
2835
|
-
const adapter = new AWSScheduledFunction(envParser, ${exportName});
|
|
2836
|
-
|
|
2837
|
-
export const handler = adapter.handler;
|
|
2838
|
-
`;
|
|
2839
|
-
await (0, node_fs_promises.writeFile)(handlerPath, content);
|
|
2840
|
-
return handlerPath;
|
|
2841
|
-
}
|
|
2842
|
-
};
|
|
2843
|
-
//#endregion
|
|
2844
2605
|
//#region src/generators/FunctionGenerator.ts
|
|
2845
2606
|
var FunctionGenerator = class extends require_discover.ConstructGenerator {
|
|
2846
2607
|
isConstruct(value) {
|
|
@@ -2871,7 +2632,7 @@ var FunctionGenerator = class extends require_discover.ConstructGenerator {
|
|
|
2871
2632
|
const handlerFileName = `${exportName}.ts`;
|
|
2872
2633
|
const handlerPath = (0, node_path.join)(outputDir, handlerFileName);
|
|
2873
2634
|
const importPath = (0, node_path.relative)((0, node_path.dirname)(handlerPath), sourceFile).replace(/\.ts$/, ".js");
|
|
2874
|
-
const runtime =
|
|
2635
|
+
const runtime = require_EndpointGenerator.runtimeFor(context, (0, node_path.dirname)(handlerPath), owner);
|
|
2875
2636
|
const content = `import { AWSLambdaFunction } from '@geekmidas/constructs/aws';
|
|
2876
2637
|
import { ${exportName} } from '${importPath}';
|
|
2877
2638
|
${runtime.imports}
|
|
@@ -2887,178 +2648,6 @@ export const handler = adapter.handler;
|
|
|
2887
2648
|
}
|
|
2888
2649
|
};
|
|
2889
2650
|
//#endregion
|
|
2890
|
-
//#region src/generators/QueueGenerator.ts
|
|
2891
|
-
/**
|
|
2892
|
-
* Generates the runtime for queue consumers (`worker.queue(…)`).
|
|
2893
|
-
*
|
|
2894
|
-
* - **server** (`gkm dev`): a single `queues.ts` exposing `setupQueues()` that
|
|
2895
|
-
* polls each queue in-process, alongside the Hono server, through the queue's
|
|
2896
|
-
* own connection string — pg-boss by default, SQS on the AWS emulator.
|
|
2897
|
-
* - **aws-lambda**: one handler file per queue wrapping `AWSLambdaQueue`, backed
|
|
2898
|
-
* by an SQS event-source mapping.
|
|
2899
|
-
*/
|
|
2900
|
-
var QueueGenerator = class extends require_discover.ConstructGenerator {
|
|
2901
|
-
isConstruct(value) {
|
|
2902
|
-
return _geekmidas_constructs_queue.Queue.isQueue(value);
|
|
2903
|
-
}
|
|
2904
|
-
async build(context, constructs, outputDir, options) {
|
|
2905
|
-
const target = options?.target ?? "aws";
|
|
2906
|
-
const logger = console;
|
|
2907
|
-
const queueInfos = [];
|
|
2908
|
-
if (target === "server") {
|
|
2909
|
-
await this.generateServerQueuesFile(outputDir, constructs);
|
|
2910
|
-
logger.log(`Generated server queues file with ${constructs.length} queues (polling mode)`);
|
|
2911
|
-
return queueInfos;
|
|
2912
|
-
}
|
|
2913
|
-
if (constructs.length === 0) return queueInfos;
|
|
2914
|
-
const queuesDir = (0, node_path.join)(outputDir, "queues");
|
|
2915
|
-
await (0, node_fs_promises.mkdir)(queuesDir, { recursive: true });
|
|
2916
|
-
for (const { key, construct, path } of constructs) {
|
|
2917
|
-
const handlerFile = await this.generateQueueHandler(queuesDir, path.relative, key, context, construct.owner);
|
|
2918
|
-
queueInfos.push({
|
|
2919
|
-
name: construct.name,
|
|
2920
|
-
handler: (0, node_path.relative)(options?.root ?? process.cwd(), handlerFile).replace(/\.ts$/, ".handler"),
|
|
2921
|
-
batchSize: construct.batchSize,
|
|
2922
|
-
fifo: construct.fifo,
|
|
2923
|
-
timeout: construct.timeout,
|
|
2924
|
-
environment: await construct.getEnvironment({ markOptional: context.markOptional }),
|
|
2925
|
-
dependencies: construct.constructs
|
|
2926
|
-
});
|
|
2927
|
-
logger.log(`Generated queue handler: ${key}`);
|
|
2928
|
-
}
|
|
2929
|
-
return queueInfos;
|
|
2930
|
-
}
|
|
2931
|
-
async generateQueueHandler(outputDir, sourceFile, exportName, context, owner) {
|
|
2932
|
-
const handlerPath = (0, node_path.join)(outputDir, `${exportName}.ts`);
|
|
2933
|
-
const importPath = (0, node_path.relative)((0, node_path.dirname)(handlerPath), sourceFile).replace(/\.ts$/, ".js");
|
|
2934
|
-
const runtime = require_OpenApiTsGenerator.runtimeFor(context, (0, node_path.dirname)(handlerPath), owner);
|
|
2935
|
-
const content = `import { AWSLambdaQueue } from '@geekmidas/constructs/aws';
|
|
2936
|
-
import { ${exportName} } from '${importPath}';
|
|
2937
|
-
${runtime.imports}
|
|
2938
|
-
${context.storageDrivers?.imports ?? ""}
|
|
2939
|
-
${runtime.bindings}
|
|
2940
|
-
${context.storageDrivers?.setup ? `\n// The handler registers the drivers its target needs.\n${context.storageDrivers.setup}\n` : ""}
|
|
2941
|
-
const adapter = new AWSLambdaQueue(envParser, ${exportName});
|
|
2942
|
-
|
|
2943
|
-
export const handler = adapter.handler;
|
|
2944
|
-
`;
|
|
2945
|
-
await (0, node_fs_promises.writeFile)(handlerPath, content);
|
|
2946
|
-
return handlerPath;
|
|
2947
|
-
}
|
|
2948
|
-
async generateServerQueuesFile(outputDir, queues) {
|
|
2949
|
-
await (0, node_fs_promises.mkdir)(outputDir, { recursive: true });
|
|
2950
|
-
const queuesPath = (0, node_path.join)(outputDir, "queues.ts");
|
|
2951
|
-
if (queues.length === 0) {
|
|
2952
|
-
await (0, node_fs_promises.writeFile)(queuesPath, `/**
|
|
2953
|
-
* Generated queues setup — this app declares none.
|
|
2954
|
-
*/
|
|
2955
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2956
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2957
|
-
|
|
2958
|
-
export async function setupQueues(
|
|
2959
|
-
_envParser: EnvironmentParser<any>,
|
|
2960
|
-
_logger: Logger,
|
|
2961
|
-
): Promise<void> {}
|
|
2962
|
-
`);
|
|
2963
|
-
return queuesPath;
|
|
2964
|
-
}
|
|
2965
|
-
const importsByFile = /* @__PURE__ */ new Map();
|
|
2966
|
-
for (const { path, key } of queues) {
|
|
2967
|
-
const importPath = (0, node_path.relative)((0, node_path.dirname)(queuesPath), path.relative).replace(/\.ts$/, ".js");
|
|
2968
|
-
if (!importsByFile.has(importPath)) importsByFile.set(importPath, []);
|
|
2969
|
-
importsByFile.get(importPath)?.push(key);
|
|
2970
|
-
}
|
|
2971
|
-
const content = `/**
|
|
2972
|
-
* Generated queue consumers setup.
|
|
2973
|
-
*
|
|
2974
|
-
* Each queue's one consumer polls its own queue, through the queue's own
|
|
2975
|
-
* connection string — the one its producers publish on. SQS cannot push, so
|
|
2976
|
-
* this is a poller on every transport: pg-boss locally by default, the SQS
|
|
2977
|
-
* queue on the AWS emulator.
|
|
2978
|
-
*
|
|
2979
|
-
* Deployed on Lambda, a queue's consumer is an SQS event source instead.
|
|
2980
|
-
*/
|
|
2981
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2982
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2983
|
-
import { EventConnectionFactory, Subscriber } from '@geekmidas/events';
|
|
2984
|
-
import type { EventConnection } from '@geekmidas/events';
|
|
2985
|
-
import { ServiceDiscovery } from '@geekmidas/services';
|
|
2986
|
-
${Array.from(importsByFile.entries()).map(([importPath, exports]) => `import { ${exports.join(", ")} } from '${importPath}';`).join("\n")}
|
|
2987
|
-
|
|
2988
|
-
const queues = [
|
|
2989
|
-
${queues.map(({ key, construct }) => ` { queue: ${key}, connectionKey: '${(0, _geekmidas_manifest.provideKey)(construct.id, "publisherConnectionString")}' },`).join("\n")}
|
|
2990
|
-
];
|
|
2991
|
-
|
|
2992
|
-
export async function setupQueues(
|
|
2993
|
-
envParser: EnvironmentParser<any>,
|
|
2994
|
-
logger: Logger,
|
|
2995
|
-
): Promise<void> {
|
|
2996
|
-
const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
|
|
2997
|
-
const connections = new Map<string, EventConnection>();
|
|
2998
|
-
|
|
2999
|
-
for (const { queue, connectionKey } of queues) {
|
|
3000
|
-
const connectionString = process.env[connectionKey];
|
|
3001
|
-
if (!connectionString) {
|
|
3002
|
-
logger.error({ queue: queue.name, connectionKey }, 'No connection string for this queue');
|
|
3003
|
-
continue;
|
|
3004
|
-
}
|
|
3005
|
-
|
|
3006
|
-
try {
|
|
3007
|
-
let connection = connections.get(connectionString);
|
|
3008
|
-
if (!connection) {
|
|
3009
|
-
connection = await EventConnectionFactory.fromConnectionString(connectionString);
|
|
3010
|
-
connections.set(connectionString, connection);
|
|
3011
|
-
}
|
|
3012
|
-
const eventSubscriber = await Subscriber.fromConnection(connection);
|
|
3013
|
-
const services = queue.services.length > 0
|
|
3014
|
-
? await serviceDiscovery.register(queue.services)
|
|
3015
|
-
: {};
|
|
3016
|
-
// The queue's database — the worker's, or its own — handed over as \`db\`.
|
|
3017
|
-
const db = queue.databaseService
|
|
3018
|
-
? (await serviceDiscovery.register([queue.databaseService]))[
|
|
3019
|
-
queue.databaseService.serviceName
|
|
3020
|
-
]
|
|
3021
|
-
: undefined;
|
|
3022
|
-
|
|
3023
|
-
// A queue's messages carry one type — its own name.
|
|
3024
|
-
await eventSubscriber.subscribe([queue.name], async (message) => {
|
|
3025
|
-
try {
|
|
3026
|
-
const validation = await queue.messageSchema['~standard'].validate(message.payload);
|
|
3027
|
-
if (validation.issues) {
|
|
3028
|
-
logger.error({ issues: validation.issues, queue: queue.name }, 'Queue message failed validation');
|
|
3029
|
-
return;
|
|
3030
|
-
}
|
|
3031
|
-
|
|
3032
|
-
await queue.handler({
|
|
3033
|
-
messages: [validation.value],
|
|
3034
|
-
services: services,
|
|
3035
|
-
logger: queue.logger,
|
|
3036
|
-
db,
|
|
3037
|
-
} as any);
|
|
3038
|
-
} catch (error) {
|
|
3039
|
-
logger.error({ err: error, queue: queue.name }, 'Failed to process queue message');
|
|
3040
|
-
// Rethrown so the transport keeps the message for a retry.
|
|
3041
|
-
throw error;
|
|
3042
|
-
}
|
|
3043
|
-
});
|
|
3044
|
-
logger.info({ queue: queue.name }, 'Queue consumer started polling');
|
|
3045
|
-
} catch (error) {
|
|
3046
|
-
logger.error({ err: error, queue: queue.name }, 'Failed to set up queue consumer');
|
|
3047
|
-
}
|
|
3048
|
-
}
|
|
3049
|
-
|
|
3050
|
-
const shutdown = () => {
|
|
3051
|
-
for (const connection of connections.values()) void connection.close();
|
|
3052
|
-
};
|
|
3053
|
-
process.once('SIGTERM', shutdown);
|
|
3054
|
-
process.once('SIGINT', shutdown);
|
|
3055
|
-
}
|
|
3056
|
-
`;
|
|
3057
|
-
await (0, node_fs_promises.writeFile)(queuesPath, content);
|
|
3058
|
-
return queuesPath;
|
|
3059
|
-
}
|
|
3060
|
-
};
|
|
3061
|
-
//#endregion
|
|
3062
2651
|
//#region src/generators/TopicGenerator.ts
|
|
3063
2652
|
/**
|
|
3064
2653
|
* Discovers topics (`new Topic(…)`) into `manifest.topics`. A topic is a
|
|
@@ -3390,7 +2979,8 @@ async function buildOneApp(input) {
|
|
|
3390
2979
|
markOptional: options.markOptional ?? false,
|
|
3391
2980
|
skipBundle: options.skipBundle ?? false,
|
|
3392
2981
|
stage: options.stage,
|
|
3393
|
-
workspaceName: workspace.name
|
|
2982
|
+
workspaceName: workspace.name,
|
|
2983
|
+
workspace
|
|
3394
2984
|
});
|
|
3395
2985
|
}
|
|
3396
2986
|
/**
|
|
@@ -3432,11 +3022,13 @@ async function buildApp(input) {
|
|
|
3432
3022
|
const { config, workspaceRoot, appRoot, target, enableOpenApi, cacheBackend, eventsBackend, production, telescope, databaseApi, hooks, bustCache = false } = input;
|
|
3433
3023
|
const constructGlobs = config.constructs;
|
|
3434
3024
|
const constructSources = {};
|
|
3025
|
+
const background = {};
|
|
3435
3026
|
const declared = constructGlobs ? await require_discover.discover({
|
|
3436
3027
|
patterns: constructGlobs,
|
|
3437
3028
|
cwd: appRoot,
|
|
3438
3029
|
bustCache,
|
|
3439
|
-
sources: constructSources
|
|
3030
|
+
sources: constructSources,
|
|
3031
|
+
background
|
|
3440
3032
|
}) : {};
|
|
3441
3033
|
const selfServing = selfServingSurface({
|
|
3442
3034
|
declared,
|
|
@@ -3450,7 +3042,7 @@ async function buildApp(input) {
|
|
|
3450
3042
|
if (production?.bundle && !input.skipBundle) {
|
|
3451
3043
|
const outputDir = (0, node_path.join)(appRoot, ".gkm", "server");
|
|
3452
3044
|
const entryPoint = await writeSurfaceServer(outputDir, production);
|
|
3453
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
3045
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-C35h0WKt.cjs"));
|
|
3454
3046
|
await bundleServer({
|
|
3455
3047
|
entryPoint,
|
|
3456
3048
|
outputDir: (0, node_path.join)(outputDir, "dist"),
|
|
@@ -3486,17 +3078,17 @@ async function buildApp(input) {
|
|
|
3486
3078
|
}),
|
|
3487
3079
|
eventsBackends,
|
|
3488
3080
|
markOptional: input.markOptional ?? false,
|
|
3489
|
-
...production && { telemetry:
|
|
3081
|
+
...production && { telemetry: require_EndpointGenerator.telemetryFor({
|
|
3490
3082
|
appRoot,
|
|
3491
3083
|
surfaceId: derived.surface?.id,
|
|
3492
3084
|
workspaceName: input.workspaceName
|
|
3493
3085
|
}) }
|
|
3494
3086
|
};
|
|
3495
|
-
const endpointGenerator = new
|
|
3087
|
+
const endpointGenerator = new require_EndpointGenerator.EndpointGenerator();
|
|
3496
3088
|
const functionGenerator = new FunctionGenerator();
|
|
3497
|
-
const cronGenerator = new CronGenerator();
|
|
3498
|
-
const subscriberGenerator = new
|
|
3499
|
-
const queueGenerator = new QueueGenerator();
|
|
3089
|
+
const cronGenerator = new require_state.CronGenerator();
|
|
3090
|
+
const subscriberGenerator = new require_SubscriberGenerator.SubscriberGenerator();
|
|
3091
|
+
const queueGenerator = new require_state.QueueGenerator();
|
|
3500
3092
|
const topicGenerator = new TopicGenerator();
|
|
3501
3093
|
const code = constructGlobs;
|
|
3502
3094
|
const [loadedEndpoints, allFunctions, allCrons, allSubscribers, allQueues, allTopics] = await Promise.all([
|
|
@@ -3531,6 +3123,19 @@ async function buildApp(input) {
|
|
|
3531
3123
|
if (left.length > 0) logger$4.log(`Serving ${derived.surface.id} only: leaving out ${left.join(", ")} — they run in a Worker's image`);
|
|
3532
3124
|
}
|
|
3533
3125
|
const result = await buildForTarget(target, buildContext, appRoot, workspaceRoot, endpointGenerator, functionGenerator, cronGenerator, subscriberGenerator, queueGenerator, topicGenerator, allEndpoints, allFunctions, allCrons, allSubscribers, allQueues, allTopics, enableOpenApi, input.skipBundle ?? false, input.stage);
|
|
3126
|
+
if (target === "server" && production?.enabled && input.workspace) {
|
|
3127
|
+
const appName = Object.entries(input.workspace.apps).find(([, app]) => (0, node_path.resolve)(input.workspace.root, app.path) === (0, node_path.resolve)(appRoot))?.[0];
|
|
3128
|
+
await buildWorkers({
|
|
3129
|
+
context: buildContext,
|
|
3130
|
+
workers: require_state.workerUnits(input.workspace, declared, background).filter((unit) => unit.app === appName),
|
|
3131
|
+
serverDir: (0, node_path.join)(appRoot, ".gkm", "server"),
|
|
3132
|
+
crons: allCrons,
|
|
3133
|
+
queues: allQueues,
|
|
3134
|
+
subscribers: allSubscribers,
|
|
3135
|
+
bundle: Boolean(production.bundle && !input.skipBundle),
|
|
3136
|
+
...input.stage ? { stage: input.stage } : {}
|
|
3137
|
+
});
|
|
3138
|
+
}
|
|
3534
3139
|
await require_openapi.generateOpenApi(allEndpoints.map(({ construct }) => construct), {
|
|
3535
3140
|
openapi: config.openapi,
|
|
3536
3141
|
root: workspaceRoot
|
|
@@ -3540,6 +3145,46 @@ async function buildApp(input) {
|
|
|
3540
3145
|
...buildContext.databaseApi ? { databaseApi: buildContext.databaseApi.path } : {}
|
|
3541
3146
|
};
|
|
3542
3147
|
}
|
|
3148
|
+
/**
|
|
3149
|
+
* Write each worker's entry — and, for an image, bundle it — from the
|
|
3150
|
+
* runnables built from that worker, and nothing built from another.
|
|
3151
|
+
*/
|
|
3152
|
+
async function buildWorkers(input) {
|
|
3153
|
+
const generator = new require_state.WorkerGenerator();
|
|
3154
|
+
for (const worker of input.workers) {
|
|
3155
|
+
const owned = (list) => list.filter(({ construct }) => construct.owner === worker.id);
|
|
3156
|
+
const crons = owned(input.crons);
|
|
3157
|
+
const queues = owned(input.queues);
|
|
3158
|
+
const subscribers = owned(input.subscribers);
|
|
3159
|
+
const entryPoint = await generator.build({
|
|
3160
|
+
context: input.context,
|
|
3161
|
+
workerId: worker.id,
|
|
3162
|
+
outputDir: require_state.workerEntryDir(input.serverDir, worker.id),
|
|
3163
|
+
crons,
|
|
3164
|
+
queues,
|
|
3165
|
+
subscribers
|
|
3166
|
+
});
|
|
3167
|
+
logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
|
|
3168
|
+
if (!input.bundle) continue;
|
|
3169
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-C35h0WKt.cjs"));
|
|
3170
|
+
const outfile = require_state.workerBundleName(worker.id);
|
|
3171
|
+
await bundleServer({
|
|
3172
|
+
entryPoint,
|
|
3173
|
+
outputDir: (0, node_path.join)(input.serverDir, "dist"),
|
|
3174
|
+
outfile,
|
|
3175
|
+
minify: input.context.production?.minify ?? false,
|
|
3176
|
+
sourcemap: false,
|
|
3177
|
+
external: input.context.production?.external ?? [],
|
|
3178
|
+
...input.stage ? { stage: input.stage } : {},
|
|
3179
|
+
constructs: [
|
|
3180
|
+
...crons,
|
|
3181
|
+
...queues,
|
|
3182
|
+
...subscribers
|
|
3183
|
+
].map((c) => c.construct)
|
|
3184
|
+
});
|
|
3185
|
+
logger$4.log(`✅ Bundle complete: .gkm/server/dist/${outfile}`);
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3543
3188
|
async function buildForTarget(target, context, appRoot, workspaceRoot, endpointGenerator, functionGenerator, cronGenerator, subscriberGenerator, queueGenerator, topicGenerator, endpoints, functions, crons, subscribers, queues, topics, enableOpenApi, skipBundle, stage) {
|
|
3544
3189
|
const outputDir = (0, node_path.join)(appRoot, ".gkm", target);
|
|
3545
3190
|
await Promise.all([...SUPERSEDED_OUTPUT.map((dir) => (0, node_path.join)(appRoot, ".gkm", dir)), ...appRoot === workspaceRoot ? [] : [(0, node_path.join)(appRoot, ".gkm", "manifest")]].map((dir) => (0, node_fs_promises.rm)(dir, {
|
|
@@ -3591,7 +3236,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
3591
3236
|
let masterKey;
|
|
3592
3237
|
if (context.production?.bundle && !skipBundle) {
|
|
3593
3238
|
logger$4.log(`\n📦 Bundling production server...`);
|
|
3594
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
3239
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-C35h0WKt.cjs"));
|
|
3595
3240
|
const allConstructs = [
|
|
3596
3241
|
...endpoints.map((e) => e.construct),
|
|
3597
3242
|
...functions.map((f) => f.construct),
|
|
@@ -5290,25 +4935,25 @@ function loadPackageJson() {
|
|
|
5290
4935
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
5291
4936
|
*/
|
|
5292
4937
|
const GEEKMIDAS_VERSIONS = {
|
|
5293
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
5294
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
5295
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
5296
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
5297
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
5298
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
5299
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
5300
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
5301
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
5302
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
5303
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
5304
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
5305
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
5306
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
5307
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
5308
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
5309
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
5310
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
5311
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
4938
|
+
"@geekmidas/audit": "~10.0.0-alpha.73",
|
|
4939
|
+
"@geekmidas/auth": "~10.0.0-alpha.73",
|
|
4940
|
+
"@geekmidas/cache": "~10.0.0-alpha.73",
|
|
4941
|
+
"@geekmidas/client": "~10.0.0-alpha.73",
|
|
4942
|
+
"@geekmidas/cloud": "~10.0.0-alpha.73",
|
|
4943
|
+
"@geekmidas/constructs": "~10.0.0-alpha.73",
|
|
4944
|
+
"@geekmidas/db": "~10.0.0-alpha.73",
|
|
4945
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.73",
|
|
4946
|
+
"@geekmidas/envkit": "~10.0.0-alpha.73",
|
|
4947
|
+
"@geekmidas/errors": "~10.0.0-alpha.73",
|
|
4948
|
+
"@geekmidas/events": "~10.0.0-alpha.73",
|
|
4949
|
+
"@geekmidas/logger": "~10.0.0-alpha.73",
|
|
4950
|
+
"@geekmidas/manifest": "~10.0.0-alpha.73",
|
|
4951
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.73",
|
|
4952
|
+
"@geekmidas/schema": "~10.0.0-alpha.73",
|
|
4953
|
+
"@geekmidas/services": "~10.0.0-alpha.73",
|
|
4954
|
+
"@geekmidas/storage": "~10.0.0-alpha.73",
|
|
4955
|
+
"@geekmidas/telescope": "~10.0.0-alpha.73",
|
|
4956
|
+
"@geekmidas/testkit": "~10.0.0-alpha.73",
|
|
5312
4957
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
5313
4958
|
};
|
|
5314
4959
|
//#endregion
|
|
@@ -11099,8 +10744,8 @@ function testDatabases(reconciled) {
|
|
|
11099
10744
|
* starts without the reference data the app needs.
|
|
11100
10745
|
*/
|
|
11101
10746
|
async function migrateTestStage(workspace, env) {
|
|
11102
|
-
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-
|
|
11103
|
-
const { discover } = await Promise.resolve().then(() => require("./discover-
|
|
10747
|
+
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-kA_j1TPK.cjs"));
|
|
10748
|
+
const { discover } = await Promise.resolve().then(() => require("./discover-D1It5r_h.cjs")).then((n) => n.discover_exports);
|
|
11104
10749
|
const sources = {};
|
|
11105
10750
|
const manifest = await discover({
|
|
11106
10751
|
patterns: require_state.constructGlobs(workspace),
|
|
@@ -11530,7 +11175,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
11530
11175
|
try {
|
|
11531
11176
|
const globalOptions = program.opts();
|
|
11532
11177
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11533
|
-
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
11178
|
+
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-kA_j1TPK.cjs"));
|
|
11534
11179
|
await migrateCommand({
|
|
11535
11180
|
...options,
|
|
11536
11181
|
...construct ? { construct } : {}
|
|
@@ -11544,7 +11189,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
11544
11189
|
try {
|
|
11545
11190
|
const globalOptions = program.opts();
|
|
11546
11191
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11547
|
-
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
11192
|
+
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-kA_j1TPK.cjs"));
|
|
11548
11193
|
await seedCommand({
|
|
11549
11194
|
...options,
|
|
11550
11195
|
...construct ? { construct } : {}
|
|
@@ -11558,7 +11203,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
11558
11203
|
try {
|
|
11559
11204
|
const globalOptions = program.opts();
|
|
11560
11205
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11561
|
-
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
11206
|
+
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-kA_j1TPK.cjs"));
|
|
11562
11207
|
await migrationCommand({
|
|
11563
11208
|
construct,
|
|
11564
11209
|
...name ? { name } : {}
|
|
@@ -11652,7 +11297,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
|
|
|
11652
11297
|
try {
|
|
11653
11298
|
const globalOptions = program.opts();
|
|
11654
11299
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11655
|
-
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-
|
|
11300
|
+
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-C1ojB2Yy.cjs"));
|
|
11656
11301
|
await secretsAddCommand(options);
|
|
11657
11302
|
} catch (error) {
|
|
11658
11303
|
console.error(formatError(error));
|
|
@@ -11663,7 +11308,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
11663
11308
|
try {
|
|
11664
11309
|
const globalOptions = program.opts();
|
|
11665
11310
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11666
|
-
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
11311
|
+
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-CDGRdcMr.cjs"));
|
|
11667
11312
|
await encryptionRotateCommand(construct, options);
|
|
11668
11313
|
} catch (error) {
|
|
11669
11314
|
console.error(formatError(error));
|
|
@@ -11674,7 +11319,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
11674
11319
|
try {
|
|
11675
11320
|
const globalOptions = program.opts();
|
|
11676
11321
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11677
|
-
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
11322
|
+
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-CDGRdcMr.cjs"));
|
|
11678
11323
|
await encryptionRetireCommand(construct, key, options);
|
|
11679
11324
|
} catch (error) {
|
|
11680
11325
|
console.error(formatError(error));
|
|
@@ -11717,7 +11362,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11717
11362
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11718
11363
|
const { loadWorkspaceConfig } = await Promise.resolve().then(() => require("./config.cjs"));
|
|
11719
11364
|
const { reconcileMissingSecrets } = await Promise.resolve().then(() => require("./reconcile-CuCQBa5-.cjs"));
|
|
11720
|
-
const { secretsStoreFor } = await Promise.resolve().then(() => require("./state-
|
|
11365
|
+
const { secretsStoreFor } = await Promise.resolve().then(() => require("./state-DMjFPOhf.cjs")).then((n) => n.store_exports);
|
|
11721
11366
|
const { workspace } = await loadWorkspaceConfig();
|
|
11722
11367
|
const stage = options.stage ?? workspace.stages.local;
|
|
11723
11368
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -11726,7 +11371,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11726
11371
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
11727
11372
|
process.exit(1);
|
|
11728
11373
|
}
|
|
11729
|
-
const { derivedContainers } = await Promise.resolve().then(() => require("./state-
|
|
11374
|
+
const { derivedContainers } = await Promise.resolve().then(() => require("./state-DMjFPOhf.cjs")).then((n) => n.workspace_exports);
|
|
11730
11375
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
11731
11376
|
if (!result) {
|
|
11732
11377
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -11741,7 +11386,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11741
11386
|
}
|
|
11742
11387
|
});
|
|
11743
11388
|
program.command("deploy").description("Deploy a stage through its target").option("--target <name>", "Deploy target: dokploy, compose, sst, or one named in deploy.targets (default: deploy.default)").option("--provider <provider>", "[DEPRECATED] Use --target instead").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").option("--tag <tag>", "Image tag (default: stage-timestamp; compose: the commit). Compose pulls a given tag").option("--skip-push", "Skip pushing image to registry").option("--skip-build", "Skip build step (use existing build)").option("--json", "Write events as JSON lines instead of progress; never prompts").option("--dry-run", "Show what would be created or reused; change, build and push nothing").option("--atomic", "If the release fails, roll back every app it released, not only the failed ones").option("--allow-dev-services <list>", "Server targets: run MinIO and/or Mailpit (minio,mailpit) for mail and buckets the stage's secrets don't configure. Not production-grade").action(async (options) => {
|
|
11744
|
-
const { deployCli } = await Promise.resolve().then(() => require("./cli-
|
|
11389
|
+
const { deployCli } = await Promise.resolve().then(() => require("./cli-DJVL2sL9.cjs"));
|
|
11745
11390
|
const globalOptions = program.opts();
|
|
11746
11391
|
const code = await deployCli({
|
|
11747
11392
|
cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11758,8 +11403,8 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
11758
11403
|
});
|
|
11759
11404
|
program.command("deploy:rollback").description("Put a stage's app back on its previous release (Dokploy): one app with --app, every app with --atomic").requiredOption("--stage <stage>", "A deployed stage").option("--app <app>", "The app to roll back").option("--atomic", "Roll back every app that has an earlier release").action(async (options) => {
|
|
11760
11405
|
try {
|
|
11761
|
-
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-
|
|
11762
|
-
const { terminalCredentials } = await Promise.resolve().then(() => require("./terminal-
|
|
11406
|
+
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-QGwomD64.cjs")).then((n) => n.rollback_exports);
|
|
11407
|
+
const { terminalCredentials } = await Promise.resolve().then(() => require("./terminal-BL5E0xbR.cjs"));
|
|
11763
11408
|
const globalOptions = program.opts();
|
|
11764
11409
|
await rollbackStage({
|
|
11765
11410
|
cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11794,7 +11439,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
11794
11439
|
try {
|
|
11795
11440
|
const globalOptions = program.opts();
|
|
11796
11441
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11797
|
-
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-
|
|
11442
|
+
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-C6qF8kHg.cjs"));
|
|
11798
11443
|
await deployGithubCommand(options);
|
|
11799
11444
|
} catch (error) {
|
|
11800
11445
|
console.error(formatError(error));
|