rampway 0.2.1
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/README.md +183 -0
- package/build/src/cli.d.ts +3 -0
- package/build/src/cli.d.ts.map +1 -0
- package/build/src/cli.js +104 -0
- package/build/src/cli.js.map +1 -0
- package/build/src/commands/context.d.ts +12 -0
- package/build/src/commands/context.d.ts.map +1 -0
- package/build/src/commands/context.js +16 -0
- package/build/src/commands/context.js.map +1 -0
- package/build/src/commands/deploy.d.ts +6 -0
- package/build/src/commands/deploy.d.ts.map +1 -0
- package/build/src/commands/deploy.js +14 -0
- package/build/src/commands/deploy.js.map +1 -0
- package/build/src/commands/doctor.d.ts +14 -0
- package/build/src/commands/doctor.d.ts.map +1 -0
- package/build/src/commands/doctor.js +54 -0
- package/build/src/commands/doctor.js.map +1 -0
- package/build/src/commands/init.d.ts +8 -0
- package/build/src/commands/init.d.ts.map +1 -0
- package/build/src/commands/init.js +42 -0
- package/build/src/commands/init.js.map +1 -0
- package/build/src/commands/plan.d.ts +6 -0
- package/build/src/commands/plan.d.ts.map +1 -0
- package/build/src/commands/plan.js +24 -0
- package/build/src/commands/plan.js.map +1 -0
- package/build/src/commands/releases.d.ts +27 -0
- package/build/src/commands/releases.d.ts.map +1 -0
- package/build/src/commands/releases.js +91 -0
- package/build/src/commands/releases.js.map +1 -0
- package/build/src/commands/rollback.d.ts +6 -0
- package/build/src/commands/rollback.d.ts.map +1 -0
- package/build/src/commands/rollback.js +12 -0
- package/build/src/commands/rollback.js.map +1 -0
- package/build/src/commands/rollbridge.d.ts +21 -0
- package/build/src/commands/rollbridge.d.ts.map +1 -0
- package/build/src/commands/rollbridge.js +69 -0
- package/build/src/commands/rollbridge.js.map +1 -0
- package/build/src/commands/validate.d.ts +6 -0
- package/build/src/commands/validate.d.ts.map +1 -0
- package/build/src/commands/validate.js +12 -0
- package/build/src/commands/validate.js.map +1 -0
- package/build/src/config/load-config.d.ts +10 -0
- package/build/src/config/load-config.d.ts.map +1 -0
- package/build/src/config/load-config.js +71 -0
- package/build/src/config/load-config.js.map +1 -0
- package/build/src/config/validate-config.d.ts +7 -0
- package/build/src/config/validate-config.d.ts.map +1 -0
- package/build/src/config/validate-config.js +117 -0
- package/build/src/config/validate-config.js.map +1 -0
- package/build/src/core/deploy-runner.d.ts +46 -0
- package/build/src/core/deploy-runner.d.ts.map +1 -0
- package/build/src/core/deploy-runner.js +221 -0
- package/build/src/core/deploy-runner.js.map +1 -0
- package/build/src/core/expo-web-artifacts.d.ts +10 -0
- package/build/src/core/expo-web-artifacts.d.ts.map +1 -0
- package/build/src/core/expo-web-artifacts.js +16 -0
- package/build/src/core/expo-web-artifacts.js.map +1 -0
- package/build/src/core/git-source.d.ts +22 -0
- package/build/src/core/git-source.d.ts.map +1 -0
- package/build/src/core/git-source.js +63 -0
- package/build/src/core/git-source.js.map +1 -0
- package/build/src/core/health-checks.d.ts +8 -0
- package/build/src/core/health-checks.d.ts.map +1 -0
- package/build/src/core/health-checks.js +19 -0
- package/build/src/core/health-checks.js.map +1 -0
- package/build/src/core/hooks.d.ts +12 -0
- package/build/src/core/hooks.d.ts.map +1 -0
- package/build/src/core/hooks.js +26 -0
- package/build/src/core/hooks.js.map +1 -0
- package/build/src/core/locks.d.ts +16 -0
- package/build/src/core/locks.d.ts.map +1 -0
- package/build/src/core/locks.js +32 -0
- package/build/src/core/locks.js.map +1 -0
- package/build/src/core/node-package-tasks.d.ts +26 -0
- package/build/src/core/node-package-tasks.d.ts.map +1 -0
- package/build/src/core/node-package-tasks.js +143 -0
- package/build/src/core/node-package-tasks.js.map +1 -0
- package/build/src/core/path-change-gate.d.ts +15 -0
- package/build/src/core/path-change-gate.d.ts.map +1 -0
- package/build/src/core/path-change-gate.js +95 -0
- package/build/src/core/path-change-gate.js.map +1 -0
- package/build/src/core/paths.d.ts +7 -0
- package/build/src/core/paths.d.ts.map +1 -0
- package/build/src/core/paths.js +20 -0
- package/build/src/core/paths.js.map +1 -0
- package/build/src/core/redaction.d.ts +22 -0
- package/build/src/core/redaction.d.ts.map +1 -0
- package/build/src/core/redaction.js +39 -0
- package/build/src/core/redaction.js.map +1 -0
- package/build/src/core/release-id.d.ts +6 -0
- package/build/src/core/release-id.d.ts.map +1 -0
- package/build/src/core/release-id.js +20 -0
- package/build/src/core/release-id.js.map +1 -0
- package/build/src/core/release-manager.d.ts +49 -0
- package/build/src/core/release-manager.d.ts.map +1 -0
- package/build/src/core/release-manager.js +115 -0
- package/build/src/core/release-manager.js.map +1 -0
- package/build/src/core/task-runner.d.ts +38 -0
- package/build/src/core/task-runner.d.ts.map +1 -0
- package/build/src/core/task-runner.js +102 -0
- package/build/src/core/task-runner.js.map +1 -0
- package/build/src/core/velocious-migrate.d.ts +11 -0
- package/build/src/core/velocious-migrate.d.ts.map +1 -0
- package/build/src/core/velocious-migrate.js +20 -0
- package/build/src/core/velocious-migrate.js.map +1 -0
- package/build/src/runtimes/index.d.ts +56 -0
- package/build/src/runtimes/index.d.ts.map +1 -0
- package/build/src/runtimes/index.js +132 -0
- package/build/src/runtimes/index.js.map +1 -0
- package/build/src/runtimes/none-runtime.d.ts +22 -0
- package/build/src/runtimes/none-runtime.d.ts.map +1 -0
- package/build/src/runtimes/none-runtime.js +23 -0
- package/build/src/runtimes/none-runtime.js.map +1 -0
- package/build/src/runtimes/rollbridge-runtime.d.ts +137 -0
- package/build/src/runtimes/rollbridge-runtime.d.ts.map +1 -0
- package/build/src/runtimes/rollbridge-runtime.js +224 -0
- package/build/src/runtimes/rollbridge-runtime.js.map +1 -0
- package/build/src/tasks.d.ts +5 -0
- package/build/src/tasks.d.ts.map +1 -0
- package/build/src/tasks.js +5 -0
- package/build/src/tasks.js.map +1 -0
- package/build/src/test-helpers.d.ts +25 -0
- package/build/src/test-helpers.d.ts.map +1 -0
- package/build/src/test-helpers.js +40 -0
- package/build/src/test-helpers.js.map +1 -0
- package/build/src/transports/local-transport.d.ts +67 -0
- package/build/src/transports/local-transport.d.ts.map +1 -0
- package/build/src/transports/local-transport.js +121 -0
- package/build/src/transports/local-transport.js.map +1 -0
- package/build/src/transports/ssh-transport.d.ts +189 -0
- package/build/src/transports/ssh-transport.d.ts.map +1 -0
- package/build/src/transports/ssh-transport.js +369 -0
- package/build/src/transports/ssh-transport.js.map +1 -0
- package/build/src/types.d.ts +290 -0
- package/build/src/types.d.ts.map +1 -0
- package/build/src/types.js +8 -0
- package/build/src/types.js.map +1 -0
- package/docs/config-reference.md +264 -0
- package/docs/migration-from-capistrano.md +167 -0
- package/docs/roadmap.md +27 -0
- package/examples/local/rampway.config.mjs +20 -0
- package/examples/monorepo/rampway.config.mjs +73 -0
- package/package.json +92 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { redactText } from "./redaction.js";
|
|
2
|
+
import { pathsChanged } from "./path-change-gate.js";
|
|
3
|
+
/**
|
|
4
|
+
* @param {import('#types').StageConfig} stage
|
|
5
|
+
* @returns {import('#types').TaskEntry[]}
|
|
6
|
+
*/
|
|
7
|
+
export function taskCommands(stage) {
|
|
8
|
+
const commands = [];
|
|
9
|
+
for (const [name, entries] of Object.entries(stage.tasks)) {
|
|
10
|
+
commands.push(...commandsForEntries(name, entries));
|
|
11
|
+
}
|
|
12
|
+
return commands;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @param {import('#types').Transport} transport
|
|
16
|
+
* @param {import('#types').StageConfig} stage
|
|
17
|
+
* @param {string} releasePath
|
|
18
|
+
* @param {{previousReleasePath?: string|null}} [opts]
|
|
19
|
+
* @returns {Promise<import('#types').TaskResult[]>}
|
|
20
|
+
*/
|
|
21
|
+
export async function runTasks(transport, stage, releasePath, { previousReleasePath } = {}) {
|
|
22
|
+
const results = [];
|
|
23
|
+
for (const task of taskCommands(stage)) {
|
|
24
|
+
results.push(await runTask(transport, task, releasePath, { previousReleasePath }));
|
|
25
|
+
}
|
|
26
|
+
return results;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @param {string} name
|
|
30
|
+
* @param {string|import('#types').TaskEntry|Array<string|import('#types').TaskEntry>} entries
|
|
31
|
+
* @returns {import('#types').TaskEntry[]}
|
|
32
|
+
*/
|
|
33
|
+
export function commandsForEntries(name, entries) {
|
|
34
|
+
const commands = [];
|
|
35
|
+
const list = Array.isArray(entries) ? entries : [entries];
|
|
36
|
+
for (const entry of list) {
|
|
37
|
+
commands.push(normalizeTask(name, entry));
|
|
38
|
+
}
|
|
39
|
+
return commands;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @param {string} name
|
|
43
|
+
* @param {string|import('#types').TaskEntry} entry
|
|
44
|
+
* @returns {import('#types').TaskEntry}
|
|
45
|
+
*/
|
|
46
|
+
export function normalizeTask(name, entry) {
|
|
47
|
+
if (typeof entry === "string")
|
|
48
|
+
return { name, command: entry };
|
|
49
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry))
|
|
50
|
+
throw new Error(`Task '${name}' must be a string, object, or array of task entries.`);
|
|
51
|
+
if (typeof entry.command !== "string" || entry.command.length === 0)
|
|
52
|
+
throw new Error(`Task '${name}' is missing command.`);
|
|
53
|
+
return { name, ...entry };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @param {import('#types').Transport} transport
|
|
57
|
+
* @param {import('#types').TaskEntry} task
|
|
58
|
+
* @param {string} cwd
|
|
59
|
+
* @param {{previousReleasePath?: string|null}} [opts]
|
|
60
|
+
* @returns {Promise<import('#types').TaskResult>}
|
|
61
|
+
*/
|
|
62
|
+
export async function runTask(transport, task, cwd, { previousReleasePath } = {}) {
|
|
63
|
+
if (task.onlyIfChanged && previousReleasePath) {
|
|
64
|
+
const changed = await pathsChanged(transport, previousReleasePath, cwd, task.onlyIfChanged);
|
|
65
|
+
if (!changed)
|
|
66
|
+
return taskResult(task, task.optional === true, "skipped", undefined, "no paths changed");
|
|
67
|
+
}
|
|
68
|
+
const taskCwd = task.cwd ? `${cwd}/${task.cwd}` : cwd;
|
|
69
|
+
const optional = task.optional === true;
|
|
70
|
+
try {
|
|
71
|
+
await transport.run(task.command, { cwd: taskCwd, env: task.env ?? {} });
|
|
72
|
+
return taskResult(task, optional, "passed", undefined);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
if (optional) {
|
|
76
|
+
const err = /** @type {Error} */ (error);
|
|
77
|
+
console.warn(`Optional task '${task.name}' failed: ${err.message}`);
|
|
78
|
+
return taskResult(task, optional, "failed", err);
|
|
79
|
+
}
|
|
80
|
+
const err = /** @type {Error} */ (error);
|
|
81
|
+
throw new Error(`Task '${task.name}' failed while running ${redactText(task.command)}: ${err.message}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @param {import('#types').TaskEntry} task
|
|
86
|
+
* @param {boolean} optional
|
|
87
|
+
* @param {"passed"|"failed"|"skipped"} status
|
|
88
|
+
* @param {Error} [error]
|
|
89
|
+
* @param {string} [skipReason]
|
|
90
|
+
* @returns {import('#types').TaskResult}
|
|
91
|
+
*/
|
|
92
|
+
function taskResult(task, optional, status, error, skipReason) {
|
|
93
|
+
return {
|
|
94
|
+
name: task.name ?? "",
|
|
95
|
+
command: task.command,
|
|
96
|
+
optional,
|
|
97
|
+
status,
|
|
98
|
+
...(error ? { error: /** @type {Error} */ (error).message } : {}),
|
|
99
|
+
...(skipReason ? { skipReason } : {})
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=task-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-runner.js","sourceRoot":"","sources":["../../../src/core/task-runner.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAA;AAElD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAK;IAChC,MAAM,QAAQ,GAAG,EAAE,CAAA;IACnB,KAAK,MAAM,CAAC,IAAI,E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A;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,oBAAoB,CAAC,CAAC,KAAK,CAAC,CAAA;YACxC,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,aAAa,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;YACnE,OAAO,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;QAClD,CAAC;QACD,MAAM,GAAG,GAAG,oBAAoB,CAAC,CAAC,KAAK,CAAC,CAAA;QACxC,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,IAAI,0BAA0B,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;IACzG,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU;IAC3D,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;QACrB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,QAAQ;QACR,MAAM;QACN,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAC,UAAU,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACpC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {{cwd?: string, env?: Record<string, string>, optional?: boolean, command?: string}} [options]
|
|
3
|
+
* @returns {import('#types').TaskEntry}
|
|
4
|
+
*/
|
|
5
|
+
export function velociousMigrate(options?: {
|
|
6
|
+
cwd?: string;
|
|
7
|
+
env?: Record<string, string>;
|
|
8
|
+
optional?: boolean;
|
|
9
|
+
command?: string;
|
|
10
|
+
}): import("#types").TaskEntry;
|
|
11
|
+
//# sourceMappingURL=velocious-migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"velocious-migrate.d.ts","sourceRoot":"","sources":["../../../src/core/velocious-migrate.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,2CAHW;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,GAChF,OAAO,QAAQ,EAAE,SAAS,CAgBtC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {{cwd?: string, env?: Record<string, string>, optional?: boolean, command?: string}} [options]
|
|
3
|
+
* @returns {import('#types').TaskEntry}
|
|
4
|
+
*/
|
|
5
|
+
export function velociousMigrate(options = {}) {
|
|
6
|
+
if (options.cwd !== undefined && (typeof options.cwd !== "string" || options.cwd.length === 0)) {
|
|
7
|
+
throw new Error("cwd must be a non-empty string");
|
|
8
|
+
}
|
|
9
|
+
if (options.command !== undefined && (typeof options.command !== "string" || options.command.length === 0)) {
|
|
10
|
+
throw new Error("command must be a non-empty string");
|
|
11
|
+
}
|
|
12
|
+
const command = options.command || "npx velocious db:migrate";
|
|
13
|
+
return {
|
|
14
|
+
command,
|
|
15
|
+
...(options.cwd ? { cwd: options.cwd } : {}),
|
|
16
|
+
...(options.env ? { env: options.env } : {}),
|
|
17
|
+
...(options.optional === true ? { optional: true } : {})
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=velocious-migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"velocious-migrate.js","sourceRoot":"","sources":["../../../src/core/velocious-migrate.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAO,GAAG,EAAE;IAC3C,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,IAAI,CAAC,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;QAC/F,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;IACnD,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;QAC3G,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;IACvD,CAAC;IACD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,0BAA0B,CAAA;IAC7D,OAAO;QACL,OAAO;QACP,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,GAAG,CAAC,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACvD,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {Array<Function|[string, import('#types').RegistryFactory]>} [entries]
|
|
3
|
+
* @returns {{register: Function, runtimeFor: Function, typeNames: Function}}
|
|
4
|
+
*/
|
|
5
|
+
export function createRuntimeRegistry(entries?: Array<Function | [string, import("#types").RegistryFactory]>): {
|
|
6
|
+
register: Function;
|
|
7
|
+
runtimeFor: Function;
|
|
8
|
+
typeNames: Function;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @param {string|Function} runtimeType
|
|
12
|
+
* @param {import('#types').RegistryFactory} [factory]
|
|
13
|
+
*/
|
|
14
|
+
export function registerRuntime(runtimeType: string | Function, factory?: import("#types").RegistryFactory): void;
|
|
15
|
+
/**
|
|
16
|
+
* @param {import('#types').StageConfig} stage
|
|
17
|
+
* @returns {import('#types').RuntimeAdapter}
|
|
18
|
+
*/
|
|
19
|
+
export function runtimeFor(stage: import("#types").StageConfig): import("#types").RuntimeAdapter;
|
|
20
|
+
/**
|
|
21
|
+
* @returns {string[]}
|
|
22
|
+
*/
|
|
23
|
+
export function runtimeTypeNames(): string[];
|
|
24
|
+
export class BaseRuntime {
|
|
25
|
+
/**
|
|
26
|
+
* @param {Partial<import('#types').RuntimeConfig>} [config]
|
|
27
|
+
*/
|
|
28
|
+
constructor(config?: Partial<import("#types").RuntimeConfig>);
|
|
29
|
+
/** @type {import('#types').RuntimeConfig} */
|
|
30
|
+
config: import("#types").RuntimeConfig;
|
|
31
|
+
/** @returns {string} */
|
|
32
|
+
get type(): string;
|
|
33
|
+
/**
|
|
34
|
+
* @returns {string[]}
|
|
35
|
+
*/
|
|
36
|
+
plan(): string[];
|
|
37
|
+
/**
|
|
38
|
+
* @returns {Promise<{status: string}>}
|
|
39
|
+
*/
|
|
40
|
+
deploy(): Promise<{
|
|
41
|
+
status: string;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* @returns {Promise<{type: string, status: string}>}
|
|
45
|
+
*/
|
|
46
|
+
status(): Promise<{
|
|
47
|
+
type: string;
|
|
48
|
+
status: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
export const defaultRuntimeRegistry: {
|
|
52
|
+
register: Function;
|
|
53
|
+
runtimeFor: Function;
|
|
54
|
+
typeNames: Function;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtimes/index.js"],"names":[],"mappings":"AAuCA;;;GAGG;AACH,gDAHW,KAAK,CAAC,WAAS,CAAC,MAAM,EAAE,OAAO,QAAQ,EAAE,eAAe,CAAC,CAAC,GACxD;IAAC,QAAQ,WAAW;IAAC,UAAU,WAAW;IAAC,SAAS,WAAU;CAAC,CAmC3E;AAED;;;GAGG;AACH,6CAHW,MAAM,WAAS,YACf,OAAO,QAAQ,EAAE,eAAe,QAI1C;AAED;;;GAGG;AACH,kCAHW,OAAO,QAAQ,EAAE,WAAW,GAC1B,OAAO,QAAQ,EAAE,cAAc,CAI3C;AAED;;GAEG;AACH,oCAFa,MAAM,EAAE,CAIpB;AAhGD;IACE;;OAEG;IACH,qBAFW,OAAO,CAAC,OAAO,QAAQ,EAAE,aAAa,CAAC,EAKjD;IAFC,6CAA6C;IAC7C,QADW,OAAO,QAAQ,EAAE,aAAa,CAC8C;IAGzF,wBAAwB;IACxB,YADc,MAAM,CAGnB;IAED;;OAEG;IACH,QAFa,MAAM,EAAE,CAIpB;IAED;;OAEG;IACH,UAFa,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAIrC;IAED;;OAEG;IACH,UAFa,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAInD;CACF;AAiGD;;;;EAA6F"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { NoneRuntime } from "./none-runtime.js";
|
|
2
|
+
import { RollbridgeRuntime } from "./rollbridge-runtime.js";
|
|
3
|
+
export class BaseRuntime {
|
|
4
|
+
/**
|
|
5
|
+
* @param {Partial<import('#types').RuntimeConfig>} [config]
|
|
6
|
+
*/
|
|
7
|
+
constructor(config = {}) {
|
|
8
|
+
/** @type {import('#types').RuntimeConfig} */
|
|
9
|
+
this.config = /** @type {import('#types').RuntimeConfig} */ ({ type: "none", ...config });
|
|
10
|
+
}
|
|
11
|
+
/** @returns {string} */
|
|
12
|
+
get type() {
|
|
13
|
+
return this.config.type ?? ( /** @type {{type?: string}} */(this.constructor)).type ?? "unknown";
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @returns {string[]}
|
|
17
|
+
*/
|
|
18
|
+
plan() {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @returns {Promise<{status: string}>}
|
|
23
|
+
*/
|
|
24
|
+
async deploy() {
|
|
25
|
+
return { status: "skipped" };
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @returns {Promise<{type: string, status: string}>}
|
|
29
|
+
*/
|
|
30
|
+
async status() {
|
|
31
|
+
return { type: this.type, status: "not-managed" };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @param {Array<Function|[string, import('#types').RegistryFactory]>} [entries]
|
|
36
|
+
* @returns {{register: Function, runtimeFor: Function, typeNames: Function}}
|
|
37
|
+
*/
|
|
38
|
+
export function createRuntimeRegistry(entries = []) {
|
|
39
|
+
/** @type {Map<string, import('#types').RegistryFactory>} */
|
|
40
|
+
const factories = new Map();
|
|
41
|
+
const registry = {
|
|
42
|
+
/**
|
|
43
|
+
* @param {string|Function} runtimeType
|
|
44
|
+
* @param {import('#types').RegistryFactory} [factory]
|
|
45
|
+
* @returns {typeof registry}
|
|
46
|
+
*/
|
|
47
|
+
register(runtimeType, factory) {
|
|
48
|
+
const [type, runtimeFactory] = runtimeFactoryFor(runtimeType, factory);
|
|
49
|
+
factories.set(type, runtimeFactory);
|
|
50
|
+
return registry;
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* @param {import('#types').StageConfig} stage
|
|
54
|
+
* @returns {import('#types').RuntimeAdapter}
|
|
55
|
+
*/
|
|
56
|
+
runtimeFor(stage) {
|
|
57
|
+
return runtimeForStage(stage, factories);
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* @returns {string[]}
|
|
61
|
+
*/
|
|
62
|
+
typeNames() {
|
|
63
|
+
return [...factories.keys()].sort();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
for (const entry of entries) {
|
|
67
|
+
if (Array.isArray(entry))
|
|
68
|
+
registry.register(entry[0], entry[1]);
|
|
69
|
+
else
|
|
70
|
+
registry.register(entry);
|
|
71
|
+
}
|
|
72
|
+
return registry;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @param {string|Function} runtimeType
|
|
76
|
+
* @param {import('#types').RegistryFactory} [factory]
|
|
77
|
+
*/
|
|
78
|
+
export function registerRuntime(runtimeType, factory) {
|
|
79
|
+
defaultRuntimeRegistry.register(runtimeType, factory);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @param {import('#types').StageConfig} stage
|
|
83
|
+
* @returns {import('#types').RuntimeAdapter}
|
|
84
|
+
*/
|
|
85
|
+
export function runtimeFor(stage) {
|
|
86
|
+
return defaultRuntimeRegistry.runtimeFor(stage);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @returns {string[]}
|
|
90
|
+
*/
|
|
91
|
+
export function runtimeTypeNames() {
|
|
92
|
+
return defaultRuntimeRegistry.typeNames();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @param {string|Function} runtimeType
|
|
96
|
+
* @param {import('#types').RegistryFactory} [factory]
|
|
97
|
+
* @returns {[string, import('#types').RegistryFactory]}
|
|
98
|
+
*/
|
|
99
|
+
function runtimeFactoryFor(runtimeType, factory) {
|
|
100
|
+
if (typeof runtimeType === "function" && factory === undefined) {
|
|
101
|
+
const Type = /** @type {{type: string, new (config: import('#types').RuntimeConfig): import('#types').RuntimeAdapter}} */ (runtimeType);
|
|
102
|
+
const type = Type.type;
|
|
103
|
+
if (!type)
|
|
104
|
+
throw new Error("Runtime adapter classes must define static type");
|
|
105
|
+
return [type, config => new Type(config)];
|
|
106
|
+
}
|
|
107
|
+
if (typeof runtimeType !== "string" || !runtimeType)
|
|
108
|
+
throw new Error("Runtime adapter type must be a non-empty string");
|
|
109
|
+
if (typeof factory !== "function")
|
|
110
|
+
throw new Error(`Runtime '${runtimeType}' factory must be a function`);
|
|
111
|
+
return [runtimeType, factory];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @param {import('#types').StageConfig} stage
|
|
115
|
+
* @param {Map<string, import('#types').RegistryFactory>} factories
|
|
116
|
+
* @returns {import('#types').RuntimeAdapter}
|
|
117
|
+
*/
|
|
118
|
+
function runtimeForStage(stage, factories) {
|
|
119
|
+
const config = stage.runtime ?? { type: "none" };
|
|
120
|
+
const type = config.type ?? "none";
|
|
121
|
+
const factory = factories.get(type);
|
|
122
|
+
if (!factory)
|
|
123
|
+
throw new Error(`Unknown runtime '${type}'. Available runtimes: ${[...factories.keys()].sort().join(", ")}`);
|
|
124
|
+
const runtime = factory(config);
|
|
125
|
+
if (typeof runtime.deploy !== "function")
|
|
126
|
+
throw new Error(`Runtime '${type}' must implement deploy()`);
|
|
127
|
+
if (typeof runtime.plan !== "function")
|
|
128
|
+
runtime.plan = () => [];
|
|
129
|
+
return runtime;
|
|
130
|
+
}
|
|
131
|
+
export const defaultRuntimeRegistry = createRuntimeRegistry([NoneRuntime, RollbridgeRuntime]);
|
|
132
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtimes/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAA;AAEzD,MAAM,OAAO,WAAW;IACtB;;OAEG;IACH,YAAY,MAAM,GAAG,EAAE;QACrB,6CAA6C;QAC7C,IAAI,CAA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ACzG,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;AAC/B,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,KAAK,EAAE,SAAS;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,IAAI,EAAC,IAAI,EAAE,MAAM,EAAC,CAAA;IAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAA;IAClC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACnC,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,0BAA0B,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC1H,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAC/B,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,2BAA2B,CAAC,CAAA;IACtG,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,EAAE,CAAA;IAC/D,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class NoneRuntime {
|
|
2
|
+
/** @type {"none"} */
|
|
3
|
+
static type: "none";
|
|
4
|
+
/**
|
|
5
|
+
* @returns {string[]}
|
|
6
|
+
*/
|
|
7
|
+
plan(): string[];
|
|
8
|
+
/**
|
|
9
|
+
* @returns {Promise<{status: string}>}
|
|
10
|
+
*/
|
|
11
|
+
deploy(): Promise<{
|
|
12
|
+
status: string;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* @returns {Promise<{type: string, status: string}>}
|
|
16
|
+
*/
|
|
17
|
+
status(): Promise<{
|
|
18
|
+
type: string;
|
|
19
|
+
status: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=none-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"none-runtime.d.ts","sourceRoot":"","sources":["../../../src/runtimes/none-runtime.js"],"names":[],"mappings":"AAAA;IACE,qBAAqB;IACrB,aADW,MAAM,CACG;IAEpB;;OAEG;IACH,QAFa,MAAM,EAAE,CAIpB;IAED;;OAEG;IACH,UAFa,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAIrC;IAED;;OAEG;IACH,UAFa,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAInD;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export class NoneRuntime {
|
|
2
|
+
/** @type {"none"} */
|
|
3
|
+
static type = "none";
|
|
4
|
+
/**
|
|
5
|
+
* @returns {string[]}
|
|
6
|
+
*/
|
|
7
|
+
plan() {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @returns {Promise<{status: string}>}
|
|
12
|
+
*/
|
|
13
|
+
async deploy() {
|
|
14
|
+
return { status: "skipped" };
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @returns {Promise<{type: string, status: string}>}
|
|
18
|
+
*/
|
|
19
|
+
async status() {
|
|
20
|
+
return { type: "none", status: "not-managed" };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=none-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"none-runtime.js","sourceRoot":"","sources":["../../../src/runtimes/none-runtime.js"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAW;IACtB,qBAAqB;IACrB,MAAM,CAAC,IAAI,GAAG,MAAM,CAAA;IAEpB;;OAEG;IACH,IAAI;QACF,OAAO,EAAE,CAAA;IACX,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,OAAO,EAAC,MAAM,EAAE,SAAS,EAAC,CAAA;IAC5B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,OAAO,EAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAC,CAAA;IAC9C,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export class RollbridgeRuntime {
|
|
2
|
+
/** @type {"rollbridge"} */
|
|
3
|
+
static type: "rollbridge";
|
|
4
|
+
/**
|
|
5
|
+
* @param {Partial<import('#types').RollbridgeRuntimeConfig>} [config]
|
|
6
|
+
*/
|
|
7
|
+
constructor(config?: Partial<import("#types").RollbridgeRuntimeConfig>);
|
|
8
|
+
/** @type {import('#types').RollbridgeRuntimeConfig} */
|
|
9
|
+
config: import("#types").RollbridgeRuntimeConfig;
|
|
10
|
+
/**
|
|
11
|
+
* @returns {string[]}
|
|
12
|
+
*/
|
|
13
|
+
plan(): string[];
|
|
14
|
+
/**
|
|
15
|
+
* @param {{releasePath: string, releaseId: string, revision: string}} opts
|
|
16
|
+
* @returns {string}
|
|
17
|
+
*/
|
|
18
|
+
deployCommand({ releasePath, releaseId, revision }: {
|
|
19
|
+
releasePath: string;
|
|
20
|
+
releaseId: string;
|
|
21
|
+
revision: string;
|
|
22
|
+
}): string;
|
|
23
|
+
/**
|
|
24
|
+
* @returns {string}
|
|
25
|
+
*/
|
|
26
|
+
validateCommand(): string;
|
|
27
|
+
/**
|
|
28
|
+
* @returns {string}
|
|
29
|
+
*/
|
|
30
|
+
statusCommand(): string;
|
|
31
|
+
/**
|
|
32
|
+
* @returns {string}
|
|
33
|
+
*/
|
|
34
|
+
logsCommand(): string;
|
|
35
|
+
/**
|
|
36
|
+
* @param {{force?: boolean}} [opts]
|
|
37
|
+
* @returns {string}
|
|
38
|
+
*/
|
|
39
|
+
recoverCommand({ force }?: {
|
|
40
|
+
force?: boolean;
|
|
41
|
+
}): string;
|
|
42
|
+
/**
|
|
43
|
+
* @returns {string}
|
|
44
|
+
*/
|
|
45
|
+
shutdownCommand(): string;
|
|
46
|
+
/**
|
|
47
|
+
* @returns {string}
|
|
48
|
+
*/
|
|
49
|
+
versionCommand(): string;
|
|
50
|
+
/**
|
|
51
|
+
* @returns {string}
|
|
52
|
+
*/
|
|
53
|
+
terminateStuckDaemonCommand(): string;
|
|
54
|
+
/**
|
|
55
|
+
* @param {string} subcommand
|
|
56
|
+
* @param {string[]} [args]
|
|
57
|
+
* @returns {string}
|
|
58
|
+
*/
|
|
59
|
+
rollbridgeCommand(subcommand: string, args?: string[]): string;
|
|
60
|
+
/**
|
|
61
|
+
* @param {import('#types').Transport} transport
|
|
62
|
+
* @param {{releasePath: string, releaseId: string, revision: string, currentPath?: string}} opts
|
|
63
|
+
* @returns {Promise<{status: string}>}
|
|
64
|
+
*/
|
|
65
|
+
deploy(transport: import("#types").Transport, { releasePath, releaseId, revision, currentPath }: {
|
|
66
|
+
releasePath: string;
|
|
67
|
+
releaseId: string;
|
|
68
|
+
revision: string;
|
|
69
|
+
currentPath?: string;
|
|
70
|
+
}): Promise<{
|
|
71
|
+
status: string;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* @param {import('#types').Transport} transport
|
|
75
|
+
* @param {{releasePath: string}} opts
|
|
76
|
+
* @returns {Promise<import('#types').SpawnResult>}
|
|
77
|
+
*/
|
|
78
|
+
healthCheck(transport: import("#types").Transport, { releasePath }: {
|
|
79
|
+
releasePath: string;
|
|
80
|
+
}): Promise<import("#types").SpawnResult>;
|
|
81
|
+
/**
|
|
82
|
+
* @param {import('#types').Transport} transport
|
|
83
|
+
* @param {{releasePath: string, currentPath?: string}} opts
|
|
84
|
+
* @returns {Promise<string|undefined>}
|
|
85
|
+
*/
|
|
86
|
+
prepareVersionChange(transport: import("#types").Transport, { releasePath, currentPath }: {
|
|
87
|
+
releasePath: string;
|
|
88
|
+
currentPath?: string;
|
|
89
|
+
}): Promise<string | undefined>;
|
|
90
|
+
/**
|
|
91
|
+
* @param {import('#types').Transport} transport
|
|
92
|
+
* @returns {Promise<string|undefined>}
|
|
93
|
+
*/
|
|
94
|
+
deployedVersion(transport: import("#types").Transport): Promise<string | undefined>;
|
|
95
|
+
/**
|
|
96
|
+
* @param {import('#types').Transport} transport
|
|
97
|
+
* @param {{currentPath: string}} opts
|
|
98
|
+
* @returns {Promise<void>}
|
|
99
|
+
*/
|
|
100
|
+
shutdownChangedVersion(transport: import("#types").Transport, { currentPath }: {
|
|
101
|
+
currentPath: string;
|
|
102
|
+
}): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* @param {import('#types').Transport} transport
|
|
105
|
+
* @param {{releasePath: string}} opts
|
|
106
|
+
* @returns {Promise<import('#types').SpawnResult>}
|
|
107
|
+
*/
|
|
108
|
+
validate(transport: import("#types").Transport, { releasePath }: {
|
|
109
|
+
releasePath: string;
|
|
110
|
+
}): Promise<import("#types").SpawnResult>;
|
|
111
|
+
/**
|
|
112
|
+
* @param {import('#types').Transport} transport
|
|
113
|
+
* @param {{releasePath: string}} opts
|
|
114
|
+
* @returns {Promise<import('#types').SpawnResult>}
|
|
115
|
+
*/
|
|
116
|
+
status(transport: import("#types").Transport, { releasePath }: {
|
|
117
|
+
releasePath: string;
|
|
118
|
+
}): Promise<import("#types").SpawnResult>;
|
|
119
|
+
/**
|
|
120
|
+
* @param {import('#types').Transport} transport
|
|
121
|
+
* @param {{releasePath: string}} opts
|
|
122
|
+
* @returns {Promise<import('#types').SpawnResult>}
|
|
123
|
+
*/
|
|
124
|
+
logs(transport: import("#types").Transport, { releasePath }: {
|
|
125
|
+
releasePath: string;
|
|
126
|
+
}): Promise<import("#types").SpawnResult>;
|
|
127
|
+
/**
|
|
128
|
+
* @param {import('#types').Transport} transport
|
|
129
|
+
* @param {{releasePath: string, force?: boolean}} opts
|
|
130
|
+
* @returns {Promise<import('#types').SpawnResult>}
|
|
131
|
+
*/
|
|
132
|
+
recover(transport: import("#types").Transport, { releasePath, force }: {
|
|
133
|
+
releasePath: string;
|
|
134
|
+
force?: boolean;
|
|
135
|
+
}): Promise<import("#types").SpawnResult>;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=rollbridge-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollbridge-runtime.d.ts","sourceRoot":"","sources":["../../../src/runtimes/rollbridge-runtime.js"],"names":[],"mappings":"AAEA;IACE,2BAA2B;IAC3B,aADW,YAAY,CACG;IAE1B;;OAEG;IACH,qBAFW,OAAO,CAAC,OAAO,QAAQ,EAAE,uBAAuB,CAAC,EAU3D;IAPC,uDAAuD;IACvD,QADW,OAAO,QAAQ,EAAE,uBAAuB,CAMlD;IAGH;;OAEG;IACH,QAFa,MAAM,EAAE,CAQpB;IAED;;;OAGG;IACH,oDAHW;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,GACxD,MAAM,CAalB;IAED;;OAEG;IACH,mBAFa,MAAM,CAIlB;IAED;;OAEG;IACH,iBAFa,MAAM,CAIlB;IAED;;OAEG;IACH,eAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,2BAHW;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAC,GACf,MAAM,CAMlB;IAED;;OAEG;IACH,mBAFa,MAAM,CAIlB;IAED;;OAEG;IACH,kBAFa,MAAM,CAIlB;IAED;;OAEG;IACH,+BAFa,MAAM,CAUlB;IAED;;;;OAIG;IACH,8BAJW,MAAM,SACN,MAAM,EAAE,GACN,MAAM,CAQlB;IAED;;;;OAIG;IACH,kBAJW,OAAO,QAAQ,EAAE,SAAS,qDAC1B;QAAC,WAAW,EAAE,MAAM,CAAC;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