@cat-indev/catops-cli 0.0.1-alpha.6 → 0.0.1-alpha.8
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 +308 -211
- package/dist/core/messages.d.ts +63 -0
- package/dist/core/messages.js +84 -2
- package/dist/core/messages.js.map +1 -1
- package/dist/services/ansible.d.ts +7 -6
- package/dist/services/ansible.js +10 -10
- package/dist/services/ansible.js.map +1 -1
- package/dist/services/archive.d.ts +4 -4
- package/dist/services/archive.js +6 -6
- package/dist/services/archive.js.map +1 -1
- package/dist/services/argocd.d.ts +11 -8
- package/dist/services/argocd.js +14 -14
- package/dist/services/argocd.js.map +1 -1
- package/dist/services/az.d.ts +13 -8
- package/dist/services/az.js +17 -14
- package/dist/services/az.js.map +1 -1
- package/dist/services/docker.d.ts +10 -7
- package/dist/services/docker.js +12 -12
- package/dist/services/docker.js.map +1 -1
- package/dist/services/git.d.ts +9 -9
- package/dist/services/git.js +16 -16
- package/dist/services/git.js.map +1 -1
- package/dist/services/helm.d.ts +4 -4
- package/dist/services/helm.js +6 -6
- package/dist/services/helm.js.map +1 -1
- package/dist/services/kubectl.d.ts +4 -2
- package/dist/services/kubectl.js +13 -8
- package/dist/services/kubectl.js.map +1 -1
- package/dist/services/npm.d.ts +5 -5
- package/dist/services/npm.js +8 -8
- package/dist/services/npm.js.map +1 -1
- package/dist/services/oc.d.ts +12 -2
- package/dist/services/oc.js +22 -9
- package/dist/services/oc.js.map +1 -1
- package/dist/services/shell.d.ts +8 -0
- package/dist/services/shell.js +11 -0
- package/dist/services/shell.js.map +1 -1
- package/dist/services/tekton.d.ts +8 -6
- package/dist/services/tekton.js +10 -10
- package/dist/services/tekton.js.map +1 -1
- package/dist/services/terraform.d.ts +13 -8
- package/dist/services/terraform.js +14 -14
- package/dist/services/terraform.js.map +1 -1
- package/package.json +1 -1
package/dist/core/messages.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import type { Context } from "./Context";
|
|
1
2
|
import type { ErrorMessageFormatter } from "./types";
|
|
2
3
|
/**
|
|
3
4
|
* Formateador de fábrica: prueba una lista de [regex, mensaje] contra el
|
|
4
5
|
* stderr/mensaje del error y devuelve el mensaje personalizado del primer
|
|
5
6
|
* patrón que matchee, en vez del stderr crudo.
|
|
6
7
|
*
|
|
8
|
+
* Ojo: esto NO distingue por comando — un mismo patrón (ej. "500 Internal
|
|
9
|
+
* Server Error") aplica igual venga de `docker`, `kubectl` o `terraform`.
|
|
10
|
+
* Si necesitas distinguir por comando (y opcionalmente por sub-comando),
|
|
11
|
+
* usa `byRule` más abajo.
|
|
12
|
+
*
|
|
7
13
|
* Ejemplo:
|
|
8
14
|
* notifier.describeError(messages.byPattern([
|
|
9
15
|
* [/500 Internal Server Error/, "Se reportó a infraestructura: falta de espacio en el registry"],
|
|
@@ -24,3 +30,60 @@ export declare function byPattern(rules: Array<[RegExp, string]>): ErrorMessageF
|
|
|
24
30
|
* }));
|
|
25
31
|
*/
|
|
26
32
|
export declare function byCommand(map: Record<string, string>): ErrorMessageFormatter;
|
|
33
|
+
/**
|
|
34
|
+
* Una regla de `byRule`: TODAS las condiciones que definas deben cumplirse
|
|
35
|
+
* (AND) para que aplique. Omitir una condición equivale a "no filtrar por
|
|
36
|
+
* eso" (matchea cualquier valor).
|
|
37
|
+
*/
|
|
38
|
+
export interface MessageRule {
|
|
39
|
+
/**
|
|
40
|
+
* Comando exacto (o lista de comandos) que debe haber fallado, tal como
|
|
41
|
+
* lo ve `shell.exec` (el primer argumento: "docker", "kubectl", "oc",
|
|
42
|
+
* "terraform", "git", etc.). Sin esto, la regla no filtra por comando.
|
|
43
|
+
*/
|
|
44
|
+
command?: string | string[];
|
|
45
|
+
/**
|
|
46
|
+
* Sub-comando / argumento que debe estar presente, por ejemplo "push"
|
|
47
|
+
* para distinguir `docker push` de `docker build`. Puede ser un string
|
|
48
|
+
* exacto (se busca entre los args, o como substring de los args unidos)
|
|
49
|
+
* o un RegExp contra los args unidos con espacios.
|
|
50
|
+
*/
|
|
51
|
+
args?: string | RegExp;
|
|
52
|
+
/** Patrón contra el stderr/mensaje del error. Sin esto, no filtra por texto. */
|
|
53
|
+
pattern?: RegExp;
|
|
54
|
+
/** Mensaje final. Puede ser un string fijo o una función que lo arma dinámicamente. */
|
|
55
|
+
message: string | ((error: unknown, ctx: Context) => string);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Formateador de fábrica avanzado: combina comando + sub-comando/args +
|
|
59
|
+
* patrón de texto (todo opcional, en modo AND) para distinguir el MISMO
|
|
60
|
+
* error de red/HTTP según de dónde vino. Resuelve justo el caso de "un 500
|
|
61
|
+
* puede venir de docker push, de kubectl, o de terraform, y cada uno
|
|
62
|
+
* necesita su propio mensaje".
|
|
63
|
+
*
|
|
64
|
+
* Se prueban las reglas en orden; gana la primera que matchee todas sus
|
|
65
|
+
* condiciones. Una regla sin `command` ni `args` ni `pattern` matchea
|
|
66
|
+
* cualquier error (útil como catch-all al final de la lista).
|
|
67
|
+
*
|
|
68
|
+
* Ejemplo — el caso concreto de varios comandos devolviendo el mismo 500:
|
|
69
|
+
*
|
|
70
|
+
* notifier.describeError(messages.byRule([
|
|
71
|
+
* {
|
|
72
|
+
* command: "docker", args: "push", pattern: /500 Internal Server Error/,
|
|
73
|
+
* message: "Se ha reportado a infraestructura: falta de espacio en el registry"
|
|
74
|
+
* },
|
|
75
|
+
* {
|
|
76
|
+
* command: "kubectl", pattern: /500/,
|
|
77
|
+
* message: "El API server de Kubernetes devolvió 500, reintenta en unos minutos"
|
|
78
|
+
* },
|
|
79
|
+
* {
|
|
80
|
+
* command: "terraform", pattern: /500/,
|
|
81
|
+
* message: (error, ctx) => `El backend remoto de Terraform State no respondió (env: ${ctx.params.env ?? "?"})`
|
|
82
|
+
* },
|
|
83
|
+
* {
|
|
84
|
+
* pattern: /500 Internal Server Error/,
|
|
85
|
+
* message: "Error 500 no clasificado por comando, revisar logs crudos"
|
|
86
|
+
* }
|
|
87
|
+
* ]));
|
|
88
|
+
*/
|
|
89
|
+
export declare function byRule(rules: MessageRule[]): ErrorMessageFormatter;
|
package/dist/core/messages.js
CHANGED
|
@@ -2,11 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.byPattern = byPattern;
|
|
4
4
|
exports.byCommand = byCommand;
|
|
5
|
+
exports.byRule = byRule;
|
|
6
|
+
function textOf(error) {
|
|
7
|
+
const execError = error;
|
|
8
|
+
return execError?.stderr || execError?.message || String(error);
|
|
9
|
+
}
|
|
5
10
|
/**
|
|
6
11
|
* Formateador de fábrica: prueba una lista de [regex, mensaje] contra el
|
|
7
12
|
* stderr/mensaje del error y devuelve el mensaje personalizado del primer
|
|
8
13
|
* patrón que matchee, en vez del stderr crudo.
|
|
9
14
|
*
|
|
15
|
+
* Ojo: esto NO distingue por comando — un mismo patrón (ej. "500 Internal
|
|
16
|
+
* Server Error") aplica igual venga de `docker`, `kubectl` o `terraform`.
|
|
17
|
+
* Si necesitas distinguir por comando (y opcionalmente por sub-comando),
|
|
18
|
+
* usa `byRule` más abajo.
|
|
19
|
+
*
|
|
10
20
|
* Ejemplo:
|
|
11
21
|
* notifier.describeError(messages.byPattern([
|
|
12
22
|
* [/500 Internal Server Error/, "Se reportó a infraestructura: falta de espacio en el registry"],
|
|
@@ -16,8 +26,7 @@ exports.byCommand = byCommand;
|
|
|
16
26
|
*/
|
|
17
27
|
function byPattern(rules) {
|
|
18
28
|
return (error) => {
|
|
19
|
-
const
|
|
20
|
-
const text = execError?.stderr || execError?.message || String(error);
|
|
29
|
+
const text = textOf(error);
|
|
21
30
|
for (const [pattern, message] of rules) {
|
|
22
31
|
if (pattern.test(text)) {
|
|
23
32
|
return message;
|
|
@@ -45,4 +54,77 @@ function byCommand(map) {
|
|
|
45
54
|
return map[command];
|
|
46
55
|
};
|
|
47
56
|
}
|
|
57
|
+
function commandMatches(rule, command) {
|
|
58
|
+
if (!rule.command)
|
|
59
|
+
return true;
|
|
60
|
+
if (!command)
|
|
61
|
+
return false;
|
|
62
|
+
const candidates = Array.isArray(rule.command) ? rule.command : [rule.command];
|
|
63
|
+
return candidates.includes(command);
|
|
64
|
+
}
|
|
65
|
+
function argsMatch(rule, args) {
|
|
66
|
+
if (!rule.args)
|
|
67
|
+
return true;
|
|
68
|
+
if (!args || !args.length)
|
|
69
|
+
return false;
|
|
70
|
+
const joined = args.join(" ");
|
|
71
|
+
if (rule.args instanceof RegExp) {
|
|
72
|
+
return rule.args.test(joined);
|
|
73
|
+
}
|
|
74
|
+
return args.includes(rule.args) || joined.includes(rule.args);
|
|
75
|
+
}
|
|
76
|
+
function patternMatches(rule, text) {
|
|
77
|
+
if (!rule.pattern)
|
|
78
|
+
return true;
|
|
79
|
+
return rule.pattern.test(text);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Formateador de fábrica avanzado: combina comando + sub-comando/args +
|
|
83
|
+
* patrón de texto (todo opcional, en modo AND) para distinguir el MISMO
|
|
84
|
+
* error de red/HTTP según de dónde vino. Resuelve justo el caso de "un 500
|
|
85
|
+
* puede venir de docker push, de kubectl, o de terraform, y cada uno
|
|
86
|
+
* necesita su propio mensaje".
|
|
87
|
+
*
|
|
88
|
+
* Se prueban las reglas en orden; gana la primera que matchee todas sus
|
|
89
|
+
* condiciones. Una regla sin `command` ni `args` ni `pattern` matchea
|
|
90
|
+
* cualquier error (útil como catch-all al final de la lista).
|
|
91
|
+
*
|
|
92
|
+
* Ejemplo — el caso concreto de varios comandos devolviendo el mismo 500:
|
|
93
|
+
*
|
|
94
|
+
* notifier.describeError(messages.byRule([
|
|
95
|
+
* {
|
|
96
|
+
* command: "docker", args: "push", pattern: /500 Internal Server Error/,
|
|
97
|
+
* message: "Se ha reportado a infraestructura: falta de espacio en el registry"
|
|
98
|
+
* },
|
|
99
|
+
* {
|
|
100
|
+
* command: "kubectl", pattern: /500/,
|
|
101
|
+
* message: "El API server de Kubernetes devolvió 500, reintenta en unos minutos"
|
|
102
|
+
* },
|
|
103
|
+
* {
|
|
104
|
+
* command: "terraform", pattern: /500/,
|
|
105
|
+
* message: (error, ctx) => `El backend remoto de Terraform State no respondió (env: ${ctx.params.env ?? "?"})`
|
|
106
|
+
* },
|
|
107
|
+
* {
|
|
108
|
+
* pattern: /500 Internal Server Error/,
|
|
109
|
+
* message: "Error 500 no clasificado por comando, revisar logs crudos"
|
|
110
|
+
* }
|
|
111
|
+
* ]));
|
|
112
|
+
*/
|
|
113
|
+
function byRule(rules) {
|
|
114
|
+
return (error, ctx) => {
|
|
115
|
+
const execError = error;
|
|
116
|
+
const text = textOf(error);
|
|
117
|
+
for (const rule of rules) {
|
|
118
|
+
const matches = commandMatches(rule, execError?.command)
|
|
119
|
+
&& argsMatch(rule, execError?.args)
|
|
120
|
+
&& patternMatches(rule, text);
|
|
121
|
+
if (matches) {
|
|
122
|
+
return typeof rule.message === "function"
|
|
123
|
+
? rule.message(error, ctx)
|
|
124
|
+
: rule.message;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return undefined;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
48
130
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/core/messages.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/core/messages.ts"],"names":[],"mappings":";;AAgCA,8BAgBC;AAaD,8BAYC;AA6FD,wBAyBC;AArLD,SAAS,MAAM,CAAC,KAAc;IAC1B,MAAM,SAAS,GAAG,KAAsB,CAAC;IACzC,OAAO,SAAS,EAAE,MAAM,IAAI,SAAS,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,SAAS,CAAC,KAA8B;IAEpD,OAAO,CAAC,KAAc,EAAE,EAAE;QAEtB,MAAM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AnsiblePlaybookOptions {
|
|
3
3
|
inventory?: string;
|
|
4
4
|
extraVars?: Record<string, string>;
|
|
5
5
|
tags?: string;
|
|
6
|
+
exec?: ExecOptions;
|
|
6
7
|
}
|
|
7
|
-
export declare function playbook(playbookPath: string, { inventory, extraVars, tags }?: AnsiblePlaybookOptions): Promise<ExecResult>;
|
|
8
|
-
export declare function adhoc(host: string, module: string, moduleArgs?: string): Promise<ExecResult>;
|
|
9
|
-
export declare function vaultEncrypt(file: string): Promise<ExecResult>;
|
|
10
|
-
export declare function vaultDecrypt(file: string): Promise<ExecResult>;
|
|
11
|
-
export declare function galaxyInstall(requirementsFile: string): Promise<ExecResult>;
|
|
8
|
+
export declare function playbook(playbookPath: string, { inventory, extraVars, tags, exec }?: AnsiblePlaybookOptions): Promise<ExecResult>;
|
|
9
|
+
export declare function adhoc(host: string, module: string, moduleArgs?: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
10
|
+
export declare function vaultEncrypt(file: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
11
|
+
export declare function vaultDecrypt(file: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
12
|
+
export declare function galaxyInstall(requirementsFile: string, exec?: ExecOptions): Promise<ExecResult>;
|
package/dist/services/ansible.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.vaultEncrypt = vaultEncrypt;
|
|
|
6
6
|
exports.vaultDecrypt = vaultDecrypt;
|
|
7
7
|
exports.galaxyInstall = galaxyInstall;
|
|
8
8
|
const shell_1 = require("./shell");
|
|
9
|
-
function playbook(playbookPath, { inventory, extraVars = {}, tags } = {}) {
|
|
9
|
+
function playbook(playbookPath, { inventory, extraVars = {}, tags, exec } = {}) {
|
|
10
10
|
const args = ["-i", inventory || "inventory.ini", playbookPath];
|
|
11
11
|
Object.entries(extraVars).forEach(([k, v]) => {
|
|
12
12
|
args.push("--extra-vars", `${k}=${v}`);
|
|
@@ -14,22 +14,22 @@ function playbook(playbookPath, { inventory, extraVars = {}, tags } = {}) {
|
|
|
14
14
|
if (tags) {
|
|
15
15
|
args.push("--tags", tags);
|
|
16
16
|
}
|
|
17
|
-
return shell_1.shell.exec("ansible-playbook", ...args);
|
|
17
|
+
return shell_1.shell.exec("ansible-playbook", ...(0, shell_1.withExecOptions)(args, exec));
|
|
18
18
|
}
|
|
19
|
-
function adhoc(host, module, moduleArgs) {
|
|
19
|
+
function adhoc(host, module, moduleArgs, exec) {
|
|
20
20
|
const args = [host, "-m", module];
|
|
21
21
|
if (moduleArgs) {
|
|
22
22
|
args.push("-a", moduleArgs);
|
|
23
23
|
}
|
|
24
|
-
return shell_1.shell.exec("ansible", ...args);
|
|
24
|
+
return shell_1.shell.exec("ansible", ...(0, shell_1.withExecOptions)(args, exec));
|
|
25
25
|
}
|
|
26
|
-
function vaultEncrypt(file) {
|
|
27
|
-
return shell_1.shell.exec("ansible-vault", "encrypt", file);
|
|
26
|
+
function vaultEncrypt(file, exec) {
|
|
27
|
+
return shell_1.shell.exec("ansible-vault", ...(0, shell_1.withExecOptions)(["encrypt", file], exec));
|
|
28
28
|
}
|
|
29
|
-
function vaultDecrypt(file) {
|
|
30
|
-
return shell_1.shell.exec("ansible-vault", "decrypt", file);
|
|
29
|
+
function vaultDecrypt(file, exec) {
|
|
30
|
+
return shell_1.shell.exec("ansible-vault", ...(0, shell_1.withExecOptions)(["decrypt", file], exec));
|
|
31
31
|
}
|
|
32
|
-
function galaxyInstall(requirementsFile) {
|
|
33
|
-
return shell_1.shell.exec("ansible-galaxy", "install", "-r", requirementsFile);
|
|
32
|
+
function galaxyInstall(requirementsFile, exec) {
|
|
33
|
+
return shell_1.shell.exec("ansible-galaxy", ...(0, shell_1.withExecOptions)(["install", "-r", requirementsFile], exec));
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=ansible.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ansible.js","sourceRoot":"","sources":["../../src/services/ansible.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file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AE,GAAG,IAAA,uBAAe,EAAC,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,SAAgB,YAAY,CAAC,IAAY,EAAE,IAAkB;IACzD,OAAO,aAAK,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,SAAgB,aAAa,CAAC,gBAAwB,EAAE,IAAkB;IACtE,OAAO,aAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,SAAS,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACvG,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
2
|
-
export declare function zip(source: string, target: string): Promise<ExecResult>;
|
|
3
|
-
export declare function unzip(file: string, target: string): Promise<ExecResult>;
|
|
4
|
-
export declare function tar(source: string, target: string): Promise<ExecResult>;
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
|
+
export declare function zip(source: string, target: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
3
|
+
export declare function unzip(file: string, target: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
4
|
+
export declare function tar(source: string, target: string, exec?: ExecOptions): Promise<ExecResult>;
|
package/dist/services/archive.js
CHANGED
|
@@ -4,13 +4,13 @@ exports.zip = zip;
|
|
|
4
4
|
exports.unzip = unzip;
|
|
5
5
|
exports.tar = tar;
|
|
6
6
|
const shell_1 = require("./shell");
|
|
7
|
-
function zip(source, target) {
|
|
8
|
-
return shell_1.shell.exec("zip", "-r", target, source);
|
|
7
|
+
function zip(source, target, exec) {
|
|
8
|
+
return shell_1.shell.exec("zip", ...(0, shell_1.withExecOptions)(["-r", target, source], exec));
|
|
9
9
|
}
|
|
10
|
-
function unzip(file, target) {
|
|
11
|
-
return shell_1.shell.exec("unzip", file, "-d", target);
|
|
10
|
+
function unzip(file, target, exec) {
|
|
11
|
+
return shell_1.shell.exec("unzip", ...(0, shell_1.withExecOptions)([file, "-d", target], exec));
|
|
12
12
|
}
|
|
13
|
-
function tar(source, target) {
|
|
14
|
-
return shell_1.shell.exec("tar", "-czf", target, source);
|
|
13
|
+
function tar(source, target, exec) {
|
|
14
|
+
return shell_1.shell.exec("tar", ...(0, shell_1.withExecOptions)(["-czf", target, source], exec));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=archive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../src/services/archive.ts"],"names":[],"mappings":";;AAGA,kBAEC;AAED,sBAEC;AAED,kBAEC;AAbD,
|
|
1
|
+
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../src/services/archive.ts"],"names":[],"mappings":";;AAGA,kBAEC;AAED,sBAEC;AAED,kBAEC;AAbD,mCAAiD;AAGjD,SAAgB,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,IAAkB;IAClE,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,MAAc,EAAE,IAAkB;IAClE,OAAO,aAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED,SAAgB,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,IAAkB;IAClE,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
2
|
export interface ArgoLoginOptions {
|
|
3
3
|
server: string;
|
|
4
4
|
username: string;
|
|
5
5
|
password: string;
|
|
6
6
|
insecure?: boolean;
|
|
7
|
+
exec?: ExecOptions;
|
|
7
8
|
}
|
|
8
9
|
export interface ArgoSyncOptions {
|
|
9
10
|
prune?: boolean;
|
|
11
|
+
exec?: ExecOptions;
|
|
10
12
|
}
|
|
11
13
|
export interface ArgoWaitOptions {
|
|
12
14
|
timeout?: number;
|
|
15
|
+
exec?: ExecOptions;
|
|
13
16
|
}
|
|
14
|
-
export declare function login({ server, username, password, insecure }: ArgoLoginOptions): Promise<ExecResult>;
|
|
15
|
-
export declare function appSync(name: string, { prune }?: ArgoSyncOptions): Promise<ExecResult>;
|
|
16
|
-
export declare function appGet(name: string): Promise<ExecResult>;
|
|
17
|
-
export declare function appWait(name: string, { timeout }?: ArgoWaitOptions): Promise<ExecResult>;
|
|
18
|
-
export declare function appSet(name: string, params?: Record<string, string
|
|
19
|
-
export declare function appList(): Promise<ExecResult>;
|
|
20
|
-
export declare function appRollback(name: string, revisionId: string): Promise<ExecResult>;
|
|
17
|
+
export declare function login({ server, username, password, insecure, exec }: ArgoLoginOptions): Promise<ExecResult>;
|
|
18
|
+
export declare function appSync(name: string, { prune, exec }?: ArgoSyncOptions): Promise<ExecResult>;
|
|
19
|
+
export declare function appGet(name: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
20
|
+
export declare function appWait(name: string, { timeout, exec }?: ArgoWaitOptions): Promise<ExecResult>;
|
|
21
|
+
export declare function appSet(name: string, params?: Record<string, string>, exec?: ExecOptions): Promise<ExecResult>;
|
|
22
|
+
export declare function appList(exec?: ExecOptions): Promise<ExecResult>;
|
|
23
|
+
export declare function appRollback(name: string, revisionId: string, exec?: ExecOptions): Promise<ExecResult>;
|
package/dist/services/argocd.js
CHANGED
|
@@ -8,41 +8,41 @@ exports.appSet = appSet;
|
|
|
8
8
|
exports.appList = appList;
|
|
9
9
|
exports.appRollback = appRollback;
|
|
10
10
|
const shell_1 = require("./shell");
|
|
11
|
-
function login({ server, username, password, insecure = false }) {
|
|
11
|
+
function login({ server, username, password, insecure = false, exec }) {
|
|
12
12
|
const args = ["login", server, "--username", username, "--password", password];
|
|
13
13
|
if (insecure) {
|
|
14
14
|
args.push("--insecure");
|
|
15
15
|
}
|
|
16
|
-
return shell_1.shell.exec("argocd", ...args);
|
|
16
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(args, exec));
|
|
17
17
|
}
|
|
18
|
-
function appSync(name, { prune = false } = {}) {
|
|
18
|
+
function appSync(name, { prune = false, exec } = {}) {
|
|
19
19
|
const args = ["app", "sync", name];
|
|
20
20
|
if (prune) {
|
|
21
21
|
args.push("--prune");
|
|
22
22
|
}
|
|
23
|
-
return shell_1.shell.exec("argocd", ...args);
|
|
23
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(args, exec));
|
|
24
24
|
}
|
|
25
|
-
function appGet(name) {
|
|
26
|
-
return shell_1.shell.exec("argocd", "app", "get", name);
|
|
25
|
+
function appGet(name, exec) {
|
|
26
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(["app", "get", name], exec));
|
|
27
27
|
}
|
|
28
|
-
function appWait(name, { timeout } = {}) {
|
|
28
|
+
function appWait(name, { timeout, exec } = {}) {
|
|
29
29
|
const args = ["app", "wait", name];
|
|
30
30
|
if (timeout) {
|
|
31
31
|
args.push("--timeout", String(timeout));
|
|
32
32
|
}
|
|
33
|
-
return shell_1.shell.exec("argocd", ...args);
|
|
33
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(args, exec));
|
|
34
34
|
}
|
|
35
|
-
function appSet(name, params = {}) {
|
|
35
|
+
function appSet(name, params = {}, exec) {
|
|
36
36
|
const args = ["app", "set", name];
|
|
37
37
|
Object.entries(params).forEach(([k, v]) => {
|
|
38
38
|
args.push("-p", `${k}=${v}`);
|
|
39
39
|
});
|
|
40
|
-
return shell_1.shell.exec("argocd", ...args);
|
|
40
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(args, exec));
|
|
41
41
|
}
|
|
42
|
-
function appList() {
|
|
43
|
-
return shell_1.shell.exec("argocd", "app", "list");
|
|
42
|
+
function appList(exec) {
|
|
43
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(["app", "list"], exec));
|
|
44
44
|
}
|
|
45
|
-
function appRollback(name, revisionId) {
|
|
46
|
-
return shell_1.shell.exec("argocd", "app", "rollback", name, revisionId);
|
|
45
|
+
function appRollback(name, revisionId, exec) {
|
|
46
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(["app", "rollback", name, revisionId], exec));
|
|
47
47
|
}
|
|
48
48
|
//# sourceMappingURL=argocd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argocd.js","sourceRoot":"","sources":["../../src/services/argocd.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"argocd.js","sourceRoot":"","sources":["../../src/services/argocd.ts"],"names":[],"mappings":";;AAqBA,sBAUC;AAED,0BAUC;AAED,wBAEC;AAED,0BAUC;AAED,wBAUC;AAED,0BAEC;AAED,kCAEC;AA/ED,mCAAiD;AAqBjD,SAAgB,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,IAAI,EAAoB;IAE1F,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;IAE/E,IAAI,QAAQ,EAAE,CAAC;QACX,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC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AAC,CAAC;IAElC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QACtC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEhE,CAAC;AAED,SAAgB,OAAO,CAAC,IAAkB;IACtC,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,SAAgB,WAAW,CAAC,IAAY,EAAE,UAAkB,EAAE,IAAkB;IAC5E,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACjG,CAAC"}
|
package/dist/services/az.d.ts
CHANGED
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
2
|
export interface AzLoginOptions {
|
|
3
3
|
username: string;
|
|
4
4
|
password: string;
|
|
5
5
|
tenant: string;
|
|
6
|
+
exec?: ExecOptions;
|
|
6
7
|
}
|
|
7
8
|
export interface AzAcrBuildOptions {
|
|
8
9
|
registry: string;
|
|
9
10
|
image: string;
|
|
10
11
|
file?: string;
|
|
12
|
+
exec?: ExecOptions;
|
|
11
13
|
}
|
|
12
14
|
export interface AzWebappDeployOptions {
|
|
13
15
|
name: string;
|
|
14
16
|
resourceGroup: string;
|
|
15
17
|
srcPath: string;
|
|
18
|
+
exec?: ExecOptions;
|
|
16
19
|
}
|
|
17
20
|
export interface AzAksCredentialsOptions {
|
|
18
21
|
name: string;
|
|
19
22
|
resourceGroup: string;
|
|
20
23
|
overwriteExisting?: boolean;
|
|
24
|
+
exec?: ExecOptions;
|
|
21
25
|
}
|
|
22
26
|
export interface AzDeploymentGroupOptions {
|
|
23
27
|
resourceGroup: string;
|
|
24
28
|
templateFile: string;
|
|
25
29
|
parameters?: Record<string, string>;
|
|
30
|
+
exec?: ExecOptions;
|
|
26
31
|
}
|
|
27
|
-
export declare function loginServicePrincipal({ username, password, tenant }: AzLoginOptions): Promise<ExecResult>;
|
|
28
|
-
export declare function setAccount(subscription: string): Promise<ExecResult>;
|
|
29
|
-
export declare function acrBuild({ registry, image, file }: AzAcrBuildOptions): Promise<ExecResult>;
|
|
30
|
-
export declare function acrLogin(registry: string): Promise<ExecResult>;
|
|
31
|
-
export declare function webappDeploy({ name, resourceGroup, srcPath }: AzWebappDeployOptions): Promise<ExecResult>;
|
|
32
|
-
export declare function aksGetCredentials({ name, resourceGroup, overwriteExisting }: AzAksCredentialsOptions): Promise<ExecResult>;
|
|
33
|
-
export declare function deploymentGroupCreate({ resourceGroup, templateFile, parameters }: AzDeploymentGroupOptions): Promise<ExecResult>;
|
|
32
|
+
export declare function loginServicePrincipal({ username, password, tenant, exec }: AzLoginOptions): Promise<ExecResult>;
|
|
33
|
+
export declare function setAccount(subscription: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
34
|
+
export declare function acrBuild({ registry, image, file, exec }: AzAcrBuildOptions): Promise<ExecResult>;
|
|
35
|
+
export declare function acrLogin(registry: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
36
|
+
export declare function webappDeploy({ name, resourceGroup, srcPath, exec }: AzWebappDeployOptions): Promise<ExecResult>;
|
|
37
|
+
export declare function aksGetCredentials({ name, resourceGroup, overwriteExisting, exec }: AzAksCredentialsOptions): Promise<ExecResult>;
|
|
38
|
+
export declare function deploymentGroupCreate({ resourceGroup, templateFile, parameters, exec }: AzDeploymentGroupOptions): Promise<ExecResult>;
|
package/dist/services/az.js
CHANGED
|
@@ -8,22 +8,25 @@ exports.webappDeploy = webappDeploy;
|
|
|
8
8
|
exports.aksGetCredentials = aksGetCredentials;
|
|
9
9
|
exports.deploymentGroupCreate = deploymentGroupCreate;
|
|
10
10
|
const shell_1 = require("./shell");
|
|
11
|
-
function loginServicePrincipal({ username, password, tenant }) {
|
|
12
|
-
|
|
11
|
+
function loginServicePrincipal({ username, password, tenant, exec }) {
|
|
12
|
+
const args = ["login", "--service-principal", "-u", username, "-p", password, "--tenant", tenant];
|
|
13
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(args, exec));
|
|
13
14
|
}
|
|
14
|
-
function setAccount(subscription) {
|
|
15
|
-
return shell_1.shell.exec("az", "account", "set", "--subscription", subscription);
|
|
15
|
+
function setAccount(subscription, exec) {
|
|
16
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(["account", "set", "--subscription", subscription], exec));
|
|
16
17
|
}
|
|
17
|
-
function acrBuild({ registry, image, file = "." }) {
|
|
18
|
-
|
|
18
|
+
function acrBuild({ registry, image, file = ".", exec }) {
|
|
19
|
+
const args = ["acr", "build", "--registry", registry, "--image", image, file];
|
|
20
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(args, exec));
|
|
19
21
|
}
|
|
20
|
-
function acrLogin(registry) {
|
|
21
|
-
return shell_1.shell.exec("az", "acr", "login", "--name", registry);
|
|
22
|
+
function acrLogin(registry, exec) {
|
|
23
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(["acr", "login", "--name", registry], exec));
|
|
22
24
|
}
|
|
23
|
-
function webappDeploy({ name, resourceGroup, srcPath }) {
|
|
24
|
-
|
|
25
|
+
function webappDeploy({ name, resourceGroup, srcPath, exec }) {
|
|
26
|
+
const args = ["webapp", "deploy", "--name", name, "--resource-group", resourceGroup, "--src-path", srcPath];
|
|
27
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(args, exec));
|
|
25
28
|
}
|
|
26
|
-
function aksGetCredentials({ name, resourceGroup, overwriteExisting = true }) {
|
|
29
|
+
function aksGetCredentials({ name, resourceGroup, overwriteExisting = true, exec }) {
|
|
27
30
|
const args = [
|
|
28
31
|
"aks", "get-credentials",
|
|
29
32
|
"--name", name,
|
|
@@ -32,9 +35,9 @@ function aksGetCredentials({ name, resourceGroup, overwriteExisting = true }) {
|
|
|
32
35
|
if (overwriteExisting) {
|
|
33
36
|
args.push("--overwrite-existing");
|
|
34
37
|
}
|
|
35
|
-
return shell_1.shell.exec("az", ...args);
|
|
38
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(args, exec));
|
|
36
39
|
}
|
|
37
|
-
function deploymentGroupCreate({ resourceGroup, templateFile, parameters = {} }) {
|
|
40
|
+
function deploymentGroupCreate({ resourceGroup, templateFile, parameters = {}, exec }) {
|
|
38
41
|
const args = [
|
|
39
42
|
"deployment", "group", "create",
|
|
40
43
|
"--resource-group", resourceGroup,
|
|
@@ -43,6 +46,6 @@ function deploymentGroupCreate({ resourceGroup, templateFile, parameters = {} })
|
|
|
43
46
|
Object.entries(parameters).forEach(([k, v]) => {
|
|
44
47
|
args.push("--parameters", `${k}=${v}`);
|
|
45
48
|
});
|
|
46
|
-
return shell_1.shell.exec("az", ...args);
|
|
49
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(args, exec));
|
|
47
50
|
}
|
|
48
51
|
//# sourceMappingURL=az.js.map
|
package/dist/services/az.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"az.js","sourceRoot":"","sources":["../../src/services/az.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"az.js","sourceRoot":"","sources":["../../src/services/az.ts"],"names":[],"mappings":";;AAsCA,sDAMC;AAED,gCAEC;AAED,4BAMC;AAED,4BAEC;AAED,oCAMC;AAED,8CAcC;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,CAAC;AAE5D,CAAC"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
2
|
export interface DockerBuildOptions {
|
|
3
3
|
image: string;
|
|
4
4
|
context?: string;
|
|
5
5
|
dockerfile?: string;
|
|
6
6
|
buildArgs?: Record<string, string>;
|
|
7
|
+
/** retry/timeout/dryRun para esta llamada puntual. */
|
|
8
|
+
exec?: ExecOptions;
|
|
7
9
|
}
|
|
8
10
|
export interface DockerLoginOptions {
|
|
9
11
|
registry: string;
|
|
10
12
|
username: string;
|
|
11
13
|
password: string;
|
|
14
|
+
exec?: ExecOptions;
|
|
12
15
|
}
|
|
13
|
-
export declare function build({ image, context, dockerfile, buildArgs }: DockerBuildOptions): Promise<ExecResult>;
|
|
14
|
-
export declare function push(image: string): Promise<ExecResult>;
|
|
15
|
-
export declare function tag(source: string, target: string): Promise<ExecResult>;
|
|
16
|
-
export declare function login({ registry, username, password }: DockerLoginOptions): Promise<ExecResult>;
|
|
17
|
-
export declare function pull(image: string): Promise<ExecResult>;
|
|
18
|
-
export declare function rmi(image: string): Promise<ExecResult>;
|
|
16
|
+
export declare function build({ image, context, dockerfile, buildArgs, exec }: DockerBuildOptions): Promise<ExecResult>;
|
|
17
|
+
export declare function push(image: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
18
|
+
export declare function tag(source: string, target: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
19
|
+
export declare function login({ registry, username, password, exec }: DockerLoginOptions): Promise<ExecResult>;
|
|
20
|
+
export declare function pull(image: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
21
|
+
export declare function rmi(image: string, exec?: ExecOptions): Promise<ExecResult>;
|
package/dist/services/docker.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.login = login;
|
|
|
7
7
|
exports.pull = pull;
|
|
8
8
|
exports.rmi = rmi;
|
|
9
9
|
const shell_1 = require("./shell");
|
|
10
|
-
function build({ image, context = ".", dockerfile, buildArgs = {} }) {
|
|
10
|
+
function build({ image, context = ".", dockerfile, buildArgs = {}, exec }) {
|
|
11
11
|
const args = ["build", "-t", image];
|
|
12
12
|
if (dockerfile) {
|
|
13
13
|
args.push("-f", dockerfile);
|
|
@@ -16,21 +16,21 @@ function build({ image, context = ".", dockerfile, buildArgs = {} }) {
|
|
|
16
16
|
args.push("--build-arg", `${k}=${v}`);
|
|
17
17
|
});
|
|
18
18
|
args.push(context);
|
|
19
|
-
return shell_1.shell.exec("docker", ...args);
|
|
19
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(args, exec));
|
|
20
20
|
}
|
|
21
|
-
function push(image) {
|
|
22
|
-
return shell_1.shell.exec("docker", "push", image);
|
|
21
|
+
function push(image, exec) {
|
|
22
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(["push", image], exec));
|
|
23
23
|
}
|
|
24
|
-
function tag(source, target) {
|
|
25
|
-
return shell_1.shell.exec("docker", "tag", source, target);
|
|
24
|
+
function tag(source, target, exec) {
|
|
25
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(["tag", source, target], exec));
|
|
26
26
|
}
|
|
27
|
-
function login({ registry, username, password }) {
|
|
28
|
-
return shell_1.shell.exec("docker", "login", registry, "-u", username, "-p", password);
|
|
27
|
+
function login({ registry, username, password, exec }) {
|
|
28
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(["login", registry, "-u", username, "-p", password], exec));
|
|
29
29
|
}
|
|
30
|
-
function pull(image) {
|
|
31
|
-
return shell_1.shell.exec("docker", "pull", image);
|
|
30
|
+
function pull(image, exec) {
|
|
31
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(["pull", image], exec));
|
|
32
32
|
}
|
|
33
|
-
function rmi(image) {
|
|
34
|
-
return shell_1.shell.exec("docker", "rmi", image);
|
|
33
|
+
function rmi(image, exec) {
|
|
34
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(["rmi", image], exec));
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=docker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker.js","sourceRoot":"","sources":["../../src/services/docker.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"docker.js","sourceRoot":"","sources":["../../src/services/docker.ts"],"names":[],"mappings":";;AAmBA,sBAsBC;AAED,oBAEC;AAED,kBAEC;AAED,sBAEC;AAED,oBAEC;AAED,kBAEC;AA7DD,mCAAiD;AAmBjD,SAAgB,KAAK,CAAC,EAClB,KAAK,EACL,OAAO,GAAG,GAAG,EACb,UAAU,EACV,SAAS,GAAG,EAAE,EACd,IAAI,EACa;IAEjB,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAEpC,IAAI,UAAU,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QACzC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEhE,CAAC;AAED,SAAgB,IAAI,CAAC,KAAa,EAAE,IAAkB;IAClD,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,SAAg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