@tarileo/avileo-catalog-cli 0.1.0
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 +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +375 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @tarileo/avileo-catalog-cli
|
|
2
|
+
|
|
3
|
+
The Avileo tenant-agent command line interface for a registered `tienda` catalog.
|
|
4
|
+
|
|
5
|
+
Inject `AVILEO_AGENT_API_KEY` through the host secret manager, then use structured
|
|
6
|
+
JSON output for automation:
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npx --yes @tarileo/avileo-catalog-cli@0.1.0 business show --json
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Use `--from <json-file>` for structured mutation input. Direct mutations validate
|
|
13
|
+
locally by default; pass `--apply` only after reviewing the result. The optional
|
|
14
|
+
`AVILEO_AGENT_BASE_URL` environment variable is for development and test targets.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/program.ts
|
|
4
|
+
import { Command, CommanderError } from "commander";
|
|
5
|
+
|
|
6
|
+
// src/config.ts
|
|
7
|
+
import { createAvileoAgent } from "@tarileo/avileo-sdk/agent";
|
|
8
|
+
function createClientFromEnvironment({
|
|
9
|
+
env = process.env,
|
|
10
|
+
clientFactory = createAvileoAgent
|
|
11
|
+
} = {}) {
|
|
12
|
+
const apiKey = env.AVILEO_AGENT_API_KEY?.trim();
|
|
13
|
+
if (!apiKey) {
|
|
14
|
+
throw new CliConfigurationError("AVILEO_AGENT_API_KEY es obligatorio");
|
|
15
|
+
}
|
|
16
|
+
const baseUrl = env.AVILEO_AGENT_BASE_URL?.trim();
|
|
17
|
+
return clientFactory({ apiKey, ...baseUrl ? { baseUrl } : {} });
|
|
18
|
+
}
|
|
19
|
+
var CliConfigurationError = class extends Error {
|
|
20
|
+
code = "CLI_CONFIGURATION_ERROR";
|
|
21
|
+
constructor(message) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = "CliConfigurationError";
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// src/output.ts
|
|
28
|
+
var CliProtocolError = class extends Error {
|
|
29
|
+
code;
|
|
30
|
+
details;
|
|
31
|
+
constructor(code, message, details) {
|
|
32
|
+
super(message);
|
|
33
|
+
this.name = "CliProtocolError";
|
|
34
|
+
this.code = code;
|
|
35
|
+
this.details = details;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
function emitSuccess(data) {
|
|
39
|
+
process.stdout.write(`${JSON.stringify({ version: 1, ok: true, data: redact(data) })}
|
|
40
|
+
`);
|
|
41
|
+
}
|
|
42
|
+
function emitFailure(failure) {
|
|
43
|
+
const error = redact({
|
|
44
|
+
code: failure.code,
|
|
45
|
+
message: failure.message,
|
|
46
|
+
...failure.requestId ? { requestId: failure.requestId } : {},
|
|
47
|
+
...failure.retryable === void 0 ? {} : { retryable: failure.retryable },
|
|
48
|
+
...failure.details === void 0 ? {} : { details: failure.details }
|
|
49
|
+
});
|
|
50
|
+
process.stderr.write(`${JSON.stringify({ version: 1, ok: false, error })}
|
|
51
|
+
`);
|
|
52
|
+
}
|
|
53
|
+
function exitCodeFor(error) {
|
|
54
|
+
const candidate = error;
|
|
55
|
+
if (candidate.retryable) return 2;
|
|
56
|
+
if (candidate.status === 409 || /CONFLICT|IDEMPOTENCY|VERSION/.test(candidate.code ?? "")) return 4;
|
|
57
|
+
if (candidate.status === 401 || candidate.status === 403 || candidate.status === 422 || /AUTH|PERMISSION|VALIDATION|UNSUPPORTED|QUOTA|POLICY/.test(candidate.code ?? "")) {
|
|
58
|
+
return 3;
|
|
59
|
+
}
|
|
60
|
+
return 1;
|
|
61
|
+
}
|
|
62
|
+
function toFailure(error) {
|
|
63
|
+
const candidate = error;
|
|
64
|
+
return {
|
|
65
|
+
code: typeof candidate?.code === "string" ? candidate.code : "CLI_ERROR",
|
|
66
|
+
message: typeof candidate?.message === "string" ? candidate.message : "Error inesperado",
|
|
67
|
+
...typeof candidate?.requestId === "string" ? { requestId: candidate.requestId } : {},
|
|
68
|
+
...typeof candidate?.retryable === "boolean" ? { retryable: candidate.retryable } : {},
|
|
69
|
+
...candidate?.details === void 0 ? {} : { details: candidate.details }
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function redact(value) {
|
|
73
|
+
if (Array.isArray(value)) return value.map(redact);
|
|
74
|
+
if (value && typeof value === "object") {
|
|
75
|
+
return Object.fromEntries(
|
|
76
|
+
Object.entries(value).map(([key, item]) => [
|
|
77
|
+
key,
|
|
78
|
+
/(?:api.?key|authorization|secret|token|password)/i.test(key) ? "[REDACTED]" : redact(item)
|
|
79
|
+
])
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// src/commands/business.ts
|
|
86
|
+
function registerBusinessCommands(root, getClient) {
|
|
87
|
+
const business = root.command("business").description("Consulta el negocio vinculado a la clave agente");
|
|
88
|
+
business.command("show").description("Muestra las capacidades seguras del negocio").action(async () => {
|
|
89
|
+
emitSuccess(await getClient().business.get());
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// src/commands/catalog.ts
|
|
94
|
+
import { basename } from "path";
|
|
95
|
+
import { readFile, stat } from "fs/promises";
|
|
96
|
+
function requireId(value, name) {
|
|
97
|
+
if (!value.trim()) throw new CliProtocolError("CLI_VALIDATION_ERROR", `${name} es obligatorio`);
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
async function readMutationInput(path) {
|
|
101
|
+
let parsed;
|
|
102
|
+
try {
|
|
103
|
+
parsed = JSON.parse(await readFile(path, "utf8"));
|
|
104
|
+
} catch {
|
|
105
|
+
throw new CliProtocolError("CLI_INPUT_ERROR", "No se pudo leer un objeto JSON desde --from");
|
|
106
|
+
}
|
|
107
|
+
if (!parsed || Array.isArray(parsed) || typeof parsed !== "object") {
|
|
108
|
+
throw new CliProtocolError("CLI_VALIDATION_ERROR", "--from debe contener un objeto JSON");
|
|
109
|
+
}
|
|
110
|
+
return normalizeInput(parsed);
|
|
111
|
+
}
|
|
112
|
+
function normalizeInput(value) {
|
|
113
|
+
const forbidden = {
|
|
114
|
+
businessId: true,
|
|
115
|
+
idempotencyKey: true,
|
|
116
|
+
apiKey: true,
|
|
117
|
+
agentKey: true,
|
|
118
|
+
authorization: true
|
|
119
|
+
};
|
|
120
|
+
const visit = (item) => {
|
|
121
|
+
if (Array.isArray(item)) return item.map(visit);
|
|
122
|
+
if (!item || typeof item !== "object") return item;
|
|
123
|
+
return Object.fromEntries(
|
|
124
|
+
Object.entries(item).map(([key, nested]) => {
|
|
125
|
+
if (forbidden[key] || /(?:api.?key|agent.?key|authorization|secret|token|password|idempotency)/i.test(key)) {
|
|
126
|
+
throw new CliProtocolError("CLI_VALIDATION_ERROR", `El campo ${key} no est\xE1 permitido`);
|
|
127
|
+
}
|
|
128
|
+
return [key, visit(nested)];
|
|
129
|
+
})
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
return visit(value);
|
|
133
|
+
}
|
|
134
|
+
function withMutationOptions(command, includeFrom = true) {
|
|
135
|
+
if (includeFrom) command.requiredOption("--from <json-file>", "Objeto JSON estructurado");
|
|
136
|
+
return command.option("--apply", "Ejecuta la mutaci\xF3n despu\xE9s de validarla localmente");
|
|
137
|
+
}
|
|
138
|
+
function wantsApply(command) {
|
|
139
|
+
return Boolean(command.optsWithGlobals().apply);
|
|
140
|
+
}
|
|
141
|
+
function localResult(input, current) {
|
|
142
|
+
if (current === void 0) return { validated: "local", input };
|
|
143
|
+
const source = current;
|
|
144
|
+
const changes = Object.fromEntries(
|
|
145
|
+
Object.entries(input).map(([key, after]) => [key, { before: source[key], after }])
|
|
146
|
+
);
|
|
147
|
+
return { validated: "local", current, changes };
|
|
148
|
+
}
|
|
149
|
+
function addListOptions(command) {
|
|
150
|
+
return command.option("--search <text>").option("--category-id <id>").option("--active <true|false>", "Filtra por estado activo", parseBoolean).option("--limit <number>", "M\xE1ximo de resultados", parseInteger).option("--offset <number>", "Desplazamiento", parseInteger);
|
|
151
|
+
}
|
|
152
|
+
function parseInteger(value) {
|
|
153
|
+
const result = Number(value);
|
|
154
|
+
if (!Number.isInteger(result) || result < 0) throw new CliProtocolError("CLI_VALIDATION_ERROR", "Se esperaba un entero no negativo");
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
function parseBoolean(value) {
|
|
158
|
+
if (value === "true") return true;
|
|
159
|
+
if (value === "false") return false;
|
|
160
|
+
throw new CliProtocolError("CLI_VALIDATION_ERROR", "Se esperaba true o false");
|
|
161
|
+
}
|
|
162
|
+
async function applyOrPreview(command, input, run, current) {
|
|
163
|
+
if (wantsApply(command)) {
|
|
164
|
+
emitSuccess(await run());
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
emitSuccess(localResult(input, current ? await current() : void 0));
|
|
168
|
+
}
|
|
169
|
+
function registerCatalogCommands(root, getClient) {
|
|
170
|
+
const catalog = root.command("catalog").description("Gestiona recursos de cat\xE1logo de Avileo");
|
|
171
|
+
registerProductCommands(catalog, getClient);
|
|
172
|
+
registerVariantCommands(catalog, getClient);
|
|
173
|
+
registerCategoryCommands(catalog, getClient);
|
|
174
|
+
registerTagCommands(catalog, getClient);
|
|
175
|
+
registerAssetCommands(catalog, getClient);
|
|
176
|
+
registerInventoryCommands(catalog, getClient);
|
|
177
|
+
registerImportCommands(catalog, getClient);
|
|
178
|
+
}
|
|
179
|
+
function registerProductCommands(catalog, getClient) {
|
|
180
|
+
const product = catalog.command("product");
|
|
181
|
+
addListOptions(product.command("list")).action(async (options) => {
|
|
182
|
+
const { active: isActive, categoryId, ...filters } = options;
|
|
183
|
+
emitSuccess(await getClient().products.list({ ...filters, ...categoryId ? { categoryId } : {}, ...isActive === void 0 ? {} : { isActive } }));
|
|
184
|
+
});
|
|
185
|
+
product.command("get <productId>").action(async (productId) => emitSuccess(await getClient().products.get(requireId(productId, "productId"))));
|
|
186
|
+
withMutationOptions(product.command("create")).action(async (options, command) => {
|
|
187
|
+
const input = await readMutationInput(options.from);
|
|
188
|
+
await applyOrPreview(command, input, () => getClient().products.create(input));
|
|
189
|
+
});
|
|
190
|
+
withMutationOptions(product.command("update <productId>")).action(async (productId, options, command) => {
|
|
191
|
+
const id = requireId(productId, "productId");
|
|
192
|
+
const input = await readMutationInput(options.from);
|
|
193
|
+
await applyOrPreview(command, input, () => getClient().products.update(id, input), () => getClient().products.get(id));
|
|
194
|
+
});
|
|
195
|
+
withMutationOptions(product.command("deactivate <productId>"), false).action(async (productId, _options, command) => {
|
|
196
|
+
const id = requireId(productId, "productId");
|
|
197
|
+
const input = { isActive: false };
|
|
198
|
+
await applyOrPreview(command, input, () => getClient().products.deactivate(id), () => getClient().products.get(id));
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function registerVariantCommands(catalog, getClient) {
|
|
202
|
+
const variant = catalog.command("variant");
|
|
203
|
+
variant.command("list <productId>").action(async (productId) => emitSuccess(await getClient().variants.list(requireId(productId, "productId"))));
|
|
204
|
+
variant.command("get <variantId>").action(async (variantId) => emitSuccess(await getClient().variants.get(requireId(variantId, "variantId"))));
|
|
205
|
+
withMutationOptions(variant.command("create <productId>")).action(async (productId, options, command) => {
|
|
206
|
+
const input = await readMutationInput(options.from);
|
|
207
|
+
await applyOrPreview(command, input, () => getClient().variants.create(requireId(productId, "productId"), input));
|
|
208
|
+
});
|
|
209
|
+
withMutationOptions(variant.command("update <variantId>")).action(async (variantId, options, command) => {
|
|
210
|
+
const id = requireId(variantId, "variantId");
|
|
211
|
+
const input = await readMutationInput(options.from);
|
|
212
|
+
await applyOrPreview(command, input, () => getClient().variants.update(id, input), () => getClient().variants.get(id));
|
|
213
|
+
});
|
|
214
|
+
withMutationOptions(variant.command("deactivate <variantId>"), false).action(async (variantId, _options, command) => {
|
|
215
|
+
const id = requireId(variantId, "variantId");
|
|
216
|
+
const input = { isActive: false };
|
|
217
|
+
await applyOrPreview(command, input, () => getClient().variants.deactivate(id), () => getClient().variants.get(id));
|
|
218
|
+
});
|
|
219
|
+
withMutationOptions(variant.command("reorder <productId>")).action(async (productId, options, command) => {
|
|
220
|
+
const id = requireId(productId, "productId");
|
|
221
|
+
const input = await readMutationInput(options.from);
|
|
222
|
+
await applyOrPreview(command, input, () => getClient().variants.reorder(id, input), () => getClient().variants.list(id));
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function registerCategoryCommands(catalog, getClient) {
|
|
226
|
+
const category = catalog.command("category");
|
|
227
|
+
category.command("list").action(async () => emitSuccess(await getClient().categories.list()));
|
|
228
|
+
category.command("get <categoryId>").action(async (categoryId) => emitSuccess(await getClient().categories.get(requireId(categoryId, "categoryId"))));
|
|
229
|
+
withMutationOptions(category.command("create")).action(async (options, command) => {
|
|
230
|
+
const input = await readMutationInput(options.from);
|
|
231
|
+
await applyOrPreview(command, input, () => getClient().categories.create(input));
|
|
232
|
+
});
|
|
233
|
+
withMutationOptions(category.command("update <categoryId>")).action(async (categoryId, options, command) => {
|
|
234
|
+
const id = requireId(categoryId, "categoryId");
|
|
235
|
+
const input = await readMutationInput(options.from);
|
|
236
|
+
await applyOrPreview(command, input, () => getClient().categories.update(id, input), () => getClient().categories.get(id));
|
|
237
|
+
});
|
|
238
|
+
withMutationOptions(category.command("delete <categoryId>"), false).action(async (categoryId, _options, command) => {
|
|
239
|
+
const id = requireId(categoryId, "categoryId");
|
|
240
|
+
await applyOrPreview(command, { delete: true }, () => getClient().categories.delete(id), () => getClient().categories.get(id));
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
function registerTagCommands(catalog, getClient) {
|
|
244
|
+
const tag = catalog.command("tag");
|
|
245
|
+
tag.command("list").action(async () => emitSuccess(await getClient().tags.list()));
|
|
246
|
+
tag.command("get <tagId>").action(async (tagId) => emitSuccess(await getClient().tags.get(requireId(tagId, "tagId"))));
|
|
247
|
+
withMutationOptions(tag.command("create")).action(async (options, command) => {
|
|
248
|
+
const input = await readMutationInput(options.from);
|
|
249
|
+
await applyOrPreview(command, input, () => getClient().tags.create(input));
|
|
250
|
+
});
|
|
251
|
+
withMutationOptions(tag.command("update <tagId>")).action(async (tagId, options, command) => {
|
|
252
|
+
const id = requireId(tagId, "tagId");
|
|
253
|
+
const input = await readMutationInput(options.from);
|
|
254
|
+
await applyOrPreview(command, input, () => getClient().tags.update(id, input), () => getClient().tags.get(id));
|
|
255
|
+
});
|
|
256
|
+
withMutationOptions(tag.command("delete <tagId>"), false).action(async (tagId, _options, command) => {
|
|
257
|
+
const id = requireId(tagId, "tagId");
|
|
258
|
+
await applyOrPreview(command, { delete: true }, () => getClient().tags.delete(id), () => getClient().tags.get(id));
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function registerAssetCommands(catalog, getClient) {
|
|
262
|
+
const asset = catalog.command("asset");
|
|
263
|
+
asset.command("list").option("--search <text>").option("--limit <number>", "M\xE1ximo de resultados", parseInteger).option("--offset <number>", "Desplazamiento", parseInteger).action(async (options) => emitSuccess(await getClient().assets.list(options)));
|
|
264
|
+
asset.command("get <assetId>").action(async (assetId) => emitSuccess(await getClient().assets.get(requireId(assetId, "assetId"))));
|
|
265
|
+
asset.command("upload").requiredOption("--file <path>", "Archivo local").option("--apply", "Sube el archivo").action(async (options, command) => {
|
|
266
|
+
const filePath = options.file;
|
|
267
|
+
const fileStat = await stat(filePath);
|
|
268
|
+
if (!fileStat.isFile()) throw new CliProtocolError("CLI_VALIDATION_ERROR", "--file debe apuntar a un archivo");
|
|
269
|
+
if (!wantsApply(command)) {
|
|
270
|
+
emitSuccess({ validated: "local", file: basename(filePath), sizeBytes: fileStat.size });
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const file = new File([await readFile(filePath)], basename(filePath));
|
|
274
|
+
emitSuccess(await getClient().assets.upload(file));
|
|
275
|
+
});
|
|
276
|
+
withMutationOptions(asset.command("import-url")).action(async (options, command) => {
|
|
277
|
+
const input = await readMutationInput(options.from);
|
|
278
|
+
await applyOrPreview(command, input, () => getClient().assets.importFromUrl(input));
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
function registerInventoryCommands(catalog, getClient) {
|
|
282
|
+
const inventory = catalog.command("inventory");
|
|
283
|
+
inventory.command("get <variantId>").action(async (variantId) => emitSuccess(await getClient().inventory.get(requireId(variantId, "variantId"))));
|
|
284
|
+
inventory.command("movements <variantId>").option("--reason <reason>").option("--limit <number>", "M\xE1ximo de resultados", parseInteger).option("--offset <number>", "Desplazamiento", parseInteger).action(async (variantId, options) => emitSuccess(await getClient().inventory.listMovements(requireId(variantId, "variantId"), options)));
|
|
285
|
+
withMutationOptions(inventory.command("adjust <variantId>")).action(async (variantId, options, command) => {
|
|
286
|
+
const id = requireId(variantId, "variantId");
|
|
287
|
+
const input = await readMutationInput(options.from);
|
|
288
|
+
await applyOrPreview(command, input, () => getClient().inventory.adjust(id, input), () => getClient().inventory.get(id));
|
|
289
|
+
});
|
|
290
|
+
withMutationOptions(inventory.command("set <variantId>")).action(async (variantId, options, command) => {
|
|
291
|
+
const id = requireId(variantId, "variantId");
|
|
292
|
+
const input = await readMutationInput(options.from);
|
|
293
|
+
await applyOrPreview(command, input, () => getClient().inventory.set(id, input), () => getClient().inventory.get(id));
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
async function resolveLocalFileSources(value, client) {
|
|
297
|
+
if (Array.isArray(value)) return Promise.all(value.map((item) => resolveLocalFileSources(item, client)));
|
|
298
|
+
if (!value || typeof value !== "object") return value;
|
|
299
|
+
const source = value;
|
|
300
|
+
if (source.kind === "file") {
|
|
301
|
+
if (typeof source.path !== "string" || Object.keys(source).length !== 2) {
|
|
302
|
+
throw new CliProtocolError(
|
|
303
|
+
"CLI_VALIDATION_ERROR",
|
|
304
|
+
'Una imagen local debe tener exactamente kind: "file" y path'
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
const fileStat = await stat(source.path);
|
|
308
|
+
if (!fileStat.isFile()) {
|
|
309
|
+
throw new CliProtocolError("CLI_VALIDATION_ERROR", "La ruta de imagen local debe apuntar a un archivo");
|
|
310
|
+
}
|
|
311
|
+
const asset = await client.assets.upload(
|
|
312
|
+
new File([await readFile(source.path)], basename(source.path))
|
|
313
|
+
);
|
|
314
|
+
return { kind: "asset", assetId: asset.id };
|
|
315
|
+
}
|
|
316
|
+
return Object.fromEntries(
|
|
317
|
+
await Promise.all(
|
|
318
|
+
Object.entries(source).map(async ([key, nested]) => [
|
|
319
|
+
key,
|
|
320
|
+
await resolveLocalFileSources(nested, client)
|
|
321
|
+
])
|
|
322
|
+
)
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
function registerImportCommands(catalog, getClient) {
|
|
326
|
+
const imports = catalog.command("import");
|
|
327
|
+
imports.command("preview").requiredOption("--from <json-file>", "Lista estructurada para vista previa").action(async (options) => {
|
|
328
|
+
const input = await readMutationInput(options.from);
|
|
329
|
+
const normalizedInput = await resolveLocalFileSources(input, getClient());
|
|
330
|
+
emitSuccess(await getClient().imports.preview(normalizedInput));
|
|
331
|
+
});
|
|
332
|
+
imports.command("apply <importId>").option("--apply", "Encola la importaci\xF3n aprobada").action(async (importId, _options, command) => {
|
|
333
|
+
const id = requireId(importId, "importId");
|
|
334
|
+
if (!wantsApply(command)) {
|
|
335
|
+
emitSuccess({ validated: "local", importId: id, action: "apply" });
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
emitSuccess(await getClient().imports.apply(id));
|
|
339
|
+
});
|
|
340
|
+
imports.command("status <importId>").action(async (importId) => emitSuccess(await getClient().imports.get(requireId(importId, "importId"))));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// src/program.ts
|
|
344
|
+
function createProgram(options = {}) {
|
|
345
|
+
const program = new Command();
|
|
346
|
+
let client;
|
|
347
|
+
const getClient = options.getClient ?? (() => {
|
|
348
|
+
client ??= createClientFromEnvironment({ env: options.env, clientFactory: options.clientFactory });
|
|
349
|
+
return client;
|
|
350
|
+
});
|
|
351
|
+
program.name("avileo").description("CLI seguro para el cat\xE1logo de un negocio Avileo").option("--json", "Emite la envoltura JSON versionada para automatizaci\xF3n");
|
|
352
|
+
program.configureOutput({ writeErr: () => void 0 });
|
|
353
|
+
program.exitOverride((error) => {
|
|
354
|
+
if (error.code === "commander.helpDisplayed") return;
|
|
355
|
+
throw new CliProtocolError("CLI_USAGE_ERROR", error.message);
|
|
356
|
+
});
|
|
357
|
+
registerBusinessCommands(program, getClient);
|
|
358
|
+
registerCatalogCommands(program, getClient);
|
|
359
|
+
const parseAsync = program.parseAsync.bind(program);
|
|
360
|
+
program.parseAsync = (async (...args) => {
|
|
361
|
+
try {
|
|
362
|
+
return await parseAsync(...args);
|
|
363
|
+
} catch (error) {
|
|
364
|
+
if (error instanceof CommanderError && error.code === "commander.helpDisplayed") return program;
|
|
365
|
+
emitFailure(toFailure(error));
|
|
366
|
+
process.exitCode = exitCodeFor(error);
|
|
367
|
+
return program;
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
return program;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// src/index.ts
|
|
374
|
+
createProgram().parseAsync(process.argv);
|
|
375
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/program.ts","../src/config.ts","../src/output.ts","../src/commands/business.ts","../src/commands/catalog.ts","../src/index.ts"],"sourcesContent":["import { Command, CommanderError } from 'commander';\nimport type { AvileoAgentClient } from '@tarileo/avileo-sdk/agent';\nimport { createClientFromEnvironment, type AgentClientFactory } from './config';\nimport { registerBusinessCommands } from './commands/business';\nimport { registerCatalogCommands } from './commands/catalog';\nimport { CliProtocolError, emitFailure, exitCodeFor, toFailure } from './output';\n\nexport interface CreateProgramOptions {\n env?: NodeJS.ProcessEnv;\n clientFactory?: AgentClientFactory;\n getClient?: () => AvileoAgentClient;\n}\n\nexport function createProgram(options: CreateProgramOptions = {}): Command {\n const program = new Command();\n let client: AvileoAgentClient | undefined;\n const getClient = options.getClient ?? (() => {\n client ??= createClientFromEnvironment({ env: options.env, clientFactory: options.clientFactory });\n return client;\n });\n\n program\n .name('avileo')\n .description('CLI seguro para el catálogo de un negocio Avileo')\n .option('--json', 'Emite la envoltura JSON versionada para automatización');\n\n // Commander diagnostics would otherwise violate the one-envelope stderr contract.\n program.configureOutput({ writeErr: () => undefined });\n program.exitOverride((error) => {\n if (error.code === 'commander.helpDisplayed') return;\n throw new CliProtocolError('CLI_USAGE_ERROR', error.message);\n });\n\n registerBusinessCommands(program, getClient);\n registerCatalogCommands(program, getClient);\n\n const parseAsync = program.parseAsync.bind(program);\n program.parseAsync = (async (...args: Parameters<Command['parseAsync']>) => {\n try {\n return await parseAsync(...args);\n } catch (error) {\n if (error instanceof CommanderError && error.code === 'commander.helpDisplayed') return program;\n emitFailure(toFailure(error));\n process.exitCode = exitCodeFor(error);\n return program;\n }\n }) as Command['parseAsync'];\n\n return program;\n}\n","import { createAvileoAgent, type AvileoAgentClient } from '@tarileo/avileo-sdk/agent';\n\nexport type AgentClientFactory = (config: {\n apiKey: string;\n baseUrl?: string;\n}) => AvileoAgentClient;\n\nexport interface CliConfigDependencies {\n env?: NodeJS.ProcessEnv;\n clientFactory?: AgentClientFactory;\n}\n\nexport function createClientFromEnvironment({\n env = process.env,\n clientFactory = createAvileoAgent,\n}: CliConfigDependencies = {}): AvileoAgentClient {\n const apiKey = env.AVILEO_AGENT_API_KEY?.trim();\n if (!apiKey) {\n throw new CliConfigurationError('AVILEO_AGENT_API_KEY es obligatorio');\n }\n\n const baseUrl = env.AVILEO_AGENT_BASE_URL?.trim();\n return clientFactory({ apiKey, ...(baseUrl ? { baseUrl } : {}) });\n}\n\nexport class CliConfigurationError extends Error {\n readonly code = 'CLI_CONFIGURATION_ERROR';\n\n constructor(message: string) {\n super(message);\n this.name = 'CliConfigurationError';\n }\n}\n","export interface CliFailure {\n code: string;\n message: string;\n requestId?: string;\n retryable?: boolean;\n details?: unknown;\n}\n\nexport class CliProtocolError extends Error {\n readonly code: string;\n readonly details?: unknown;\n\n constructor(code: string, message: string, details?: unknown) {\n super(message);\n this.name = 'CliProtocolError';\n this.code = code;\n this.details = details;\n }\n}\n\nexport function emitSuccess(data: unknown): void {\n process.stdout.write(`${JSON.stringify({ version: 1, ok: true, data: redact(data) })}\\n`);\n}\n\nexport function emitFailure(failure: CliFailure): void {\n const error = redact({\n code: failure.code,\n message: failure.message,\n ...(failure.requestId ? { requestId: failure.requestId } : {}),\n ...(failure.retryable === undefined ? {} : { retryable: failure.retryable }),\n ...(failure.details === undefined ? {} : { details: failure.details }),\n }) as CliFailure;\n process.stderr.write(`${JSON.stringify({ version: 1, ok: false, error })}\\n`);\n}\n\nexport function exitCodeFor(error: unknown): number {\n const candidate = error as { code?: string; status?: number; retryable?: boolean };\n if (candidate.retryable) return 2;\n if (candidate.status === 409 || /CONFLICT|IDEMPOTENCY|VERSION/.test(candidate.code ?? '')) return 4;\n if (\n candidate.status === 401 ||\n candidate.status === 403 ||\n candidate.status === 422 ||\n /AUTH|PERMISSION|VALIDATION|UNSUPPORTED|QUOTA|POLICY/.test(candidate.code ?? '')\n ) {\n return 3;\n }\n return 1;\n}\n\nexport function toFailure(error: unknown): CliFailure {\n const candidate = error as {\n code?: unknown;\n message?: unknown;\n requestId?: unknown;\n retryable?: unknown;\n details?: unknown;\n };\n return {\n code: typeof candidate?.code === 'string' ? candidate.code : 'CLI_ERROR',\n message: typeof candidate?.message === 'string' ? candidate.message : 'Error inesperado',\n ...(typeof candidate?.requestId === 'string' ? { requestId: candidate.requestId } : {}),\n ...(typeof candidate?.retryable === 'boolean' ? { retryable: candidate.retryable } : {}),\n ...(candidate?.details === undefined ? {} : { details: candidate.details }),\n };\n}\n\nfunction redact(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(redact);\n if (value && typeof value === 'object') {\n return Object.fromEntries(\n Object.entries(value as Record<string, unknown>).map(([key, item]) => [\n key,\n /(?:api.?key|authorization|secret|token|password)/i.test(key) ? '[REDACTED]' : redact(item),\n ]),\n );\n }\n return value;\n}\n","import type { Command } from 'commander';\nimport type { AvileoAgentClient } from '@tarileo/avileo-sdk/agent';\nimport { emitSuccess } from '../output';\n\nexport function registerBusinessCommands(root: Command, getClient: () => AvileoAgentClient): void {\n const business = root.command('business').description('Consulta el negocio vinculado a la clave agente');\n business\n .command('show')\n .description('Muestra las capacidades seguras del negocio')\n .action(async () => {\n emitSuccess(await getClient().business.get());\n });\n}\n","import { basename } from 'node:path';\nimport { readFile, stat } from 'node:fs/promises';\nimport type { Command } from 'commander';\nimport type { AvileoAgentClient } from '@tarileo/avileo-sdk/agent';\nimport { CliProtocolError, emitSuccess } from '../output';\n\ntype JsonObject = Record<string, unknown>;\ntype ClientFactory = () => AvileoAgentClient;\n\nfunction requireId(value: string, name: string): string {\n if (!value.trim()) throw new CliProtocolError('CLI_VALIDATION_ERROR', `${name} es obligatorio`);\n return value;\n}\n\nasync function readMutationInput(path: string): Promise<JsonObject> {\n let parsed: unknown;\n try {\n parsed = JSON.parse(await readFile(path, 'utf8'));\n } catch {\n throw new CliProtocolError('CLI_INPUT_ERROR', 'No se pudo leer un objeto JSON desde --from');\n }\n if (!parsed || Array.isArray(parsed) || typeof parsed !== 'object') {\n throw new CliProtocolError('CLI_VALIDATION_ERROR', '--from debe contener un objeto JSON');\n }\n return normalizeInput(parsed as JsonObject);\n}\n\nfunction normalizeInput(value: JsonObject): JsonObject {\n const forbidden: Record<string, true> = {\n businessId: true,\n idempotencyKey: true,\n apiKey: true,\n agentKey: true,\n authorization: true,\n };\n const visit = (item: unknown): unknown => {\n if (Array.isArray(item)) return item.map(visit);\n if (!item || typeof item !== 'object') return item;\n return Object.fromEntries(\n Object.entries(item as JsonObject).map(([key, nested]) => {\n if (\n forbidden[key] ||\n /(?:api.?key|agent.?key|authorization|secret|token|password|idempotency)/i.test(key)\n ) {\n throw new CliProtocolError('CLI_VALIDATION_ERROR', `El campo ${key} no está permitido`);\n }\n return [key, visit(nested)];\n }),\n );\n };\n return visit(value) as JsonObject;\n}\n\nfunction withMutationOptions(command: Command, includeFrom = true): Command {\n if (includeFrom) command.requiredOption('--from <json-file>', 'Objeto JSON estructurado');\n return command.option('--apply', 'Ejecuta la mutación después de validarla localmente');\n}\n\nfunction wantsApply(command: Command): boolean {\n return Boolean(command.optsWithGlobals().apply);\n}\n\nfunction localResult(input: JsonObject, current?: unknown): JsonObject {\n if (current === undefined) return { validated: 'local', input };\n const source = current as Record<string, unknown>;\n const changes = Object.fromEntries(\n Object.entries(input).map(([key, after]) => [key, { before: source[key], after }]),\n );\n return { validated: 'local', current, changes };\n}\n\nfunction addListOptions(command: Command): Command {\n return command\n .option('--search <text>')\n .option('--category-id <id>')\n .option('--active <true|false>', 'Filtra por estado activo', parseBoolean)\n .option('--limit <number>', 'Máximo de resultados', parseInteger)\n .option('--offset <number>', 'Desplazamiento', parseInteger);\n}\n\nfunction parseInteger(value: string): number {\n const result = Number(value);\n if (!Number.isInteger(result) || result < 0) throw new CliProtocolError('CLI_VALIDATION_ERROR', 'Se esperaba un entero no negativo');\n return result;\n}\n\nfunction parseBoolean(value: string): boolean {\n if (value === 'true') return true;\n if (value === 'false') return false;\n throw new CliProtocolError('CLI_VALIDATION_ERROR', 'Se esperaba true o false');\n}\n\nasync function applyOrPreview(\n command: Command,\n input: JsonObject,\n run: () => Promise<unknown>,\n current?: () => Promise<unknown>,\n): Promise<void> {\n if (wantsApply(command)) {\n emitSuccess(await run());\n return;\n }\n emitSuccess(localResult(input, current ? await current() : undefined));\n}\n\nexport function registerCatalogCommands(root: Command, getClient: ClientFactory): void {\n const catalog = root.command('catalog').description('Gestiona recursos de catálogo de Avileo');\n registerProductCommands(catalog, getClient);\n registerVariantCommands(catalog, getClient);\n registerCategoryCommands(catalog, getClient);\n registerTagCommands(catalog, getClient);\n registerAssetCommands(catalog, getClient);\n registerInventoryCommands(catalog, getClient);\n registerImportCommands(catalog, getClient);\n}\n\nfunction registerProductCommands(catalog: Command, getClient: ClientFactory): void {\n const product = catalog.command('product');\n addListOptions(product.command('list')).action(async (options) => {\n const { active: isActive, categoryId, ...filters } = options as JsonObject & { active?: boolean; categoryId?: string };\n emitSuccess(await getClient().products.list({ ...filters, ...(categoryId ? { categoryId } : {}), ...(isActive === undefined ? {} : { isActive }) }));\n });\n product.command('get <productId>').action(async (productId) => emitSuccess(await getClient().products.get(requireId(productId, 'productId'))));\n withMutationOptions(product.command('create')).action(async (options, command) => {\n const input = await readMutationInput(options.from);\n await applyOrPreview(command, input, () => getClient().products.create(input as never));\n });\n withMutationOptions(product.command('update <productId>')).action(async (productId, options, command) => {\n const id = requireId(productId, 'productId'); const input = await readMutationInput(options.from);\n await applyOrPreview(command, input, () => getClient().products.update(id, input as never), () => getClient().products.get(id));\n });\n withMutationOptions(product.command('deactivate <productId>'), false).action(async (productId, _options, command) => {\n const id = requireId(productId, 'productId'); const input = { isActive: false };\n await applyOrPreview(command, input, () => getClient().products.deactivate(id), () => getClient().products.get(id));\n });\n}\n\nfunction registerVariantCommands(catalog: Command, getClient: ClientFactory): void {\n const variant = catalog.command('variant');\n variant.command('list <productId>').action(async (productId) => emitSuccess(await getClient().variants.list(requireId(productId, 'productId'))));\n variant.command('get <variantId>').action(async (variantId) => emitSuccess(await getClient().variants.get(requireId(variantId, 'variantId'))));\n withMutationOptions(variant.command('create <productId>')).action(async (productId, options, command) => {\n const input = await readMutationInput(options.from);\n await applyOrPreview(command, input, () => getClient().variants.create(requireId(productId, 'productId'), input as never));\n });\n withMutationOptions(variant.command('update <variantId>')).action(async (variantId, options, command) => {\n const id = requireId(variantId, 'variantId'); const input = await readMutationInput(options.from);\n await applyOrPreview(command, input, () => getClient().variants.update(id, input as never), () => getClient().variants.get(id));\n });\n withMutationOptions(variant.command('deactivate <variantId>'), false).action(async (variantId, _options, command) => {\n const id = requireId(variantId, 'variantId'); const input = { isActive: false };\n await applyOrPreview(command, input, () => getClient().variants.deactivate(id), () => getClient().variants.get(id));\n });\n withMutationOptions(variant.command('reorder <productId>')).action(async (productId, options, command) => {\n const id = requireId(productId, 'productId'); const input = await readMutationInput(options.from);\n await applyOrPreview(command, input, () => getClient().variants.reorder(id, input as never), () => getClient().variants.list(id));\n });\n}\n\nfunction registerCategoryCommands(catalog: Command, getClient: ClientFactory): void {\n const category = catalog.command('category');\n category.command('list').action(async () => emitSuccess(await getClient().categories.list()));\n category.command('get <categoryId>').action(async (categoryId) => emitSuccess(await getClient().categories.get(requireId(categoryId, 'categoryId'))));\n withMutationOptions(category.command('create')).action(async (options, command) => { const input = await readMutationInput(options.from); await applyOrPreview(command, input, () => getClient().categories.create(input as never)); });\n withMutationOptions(category.command('update <categoryId>')).action(async (categoryId, options, command) => { const id = requireId(categoryId, 'categoryId'); const input = await readMutationInput(options.from); await applyOrPreview(command, input, () => getClient().categories.update(id, input as never), () => getClient().categories.get(id)); });\n withMutationOptions(category.command('delete <categoryId>'), false).action(async (categoryId, _options, command) => { const id = requireId(categoryId, 'categoryId'); await applyOrPreview(command, { delete: true }, () => getClient().categories.delete(id), () => getClient().categories.get(id)); });\n}\n\nfunction registerTagCommands(catalog: Command, getClient: ClientFactory): void {\n const tag = catalog.command('tag');\n tag.command('list').action(async () => emitSuccess(await getClient().tags.list()));\n tag.command('get <tagId>').action(async (tagId) => emitSuccess(await getClient().tags.get(requireId(tagId, 'tagId'))));\n withMutationOptions(tag.command('create')).action(async (options, command) => { const input = await readMutationInput(options.from); await applyOrPreview(command, input, () => getClient().tags.create(input as never)); });\n withMutationOptions(tag.command('update <tagId>')).action(async (tagId, options, command) => { const id = requireId(tagId, 'tagId'); const input = await readMutationInput(options.from); await applyOrPreview(command, input, () => getClient().tags.update(id, input as never), () => getClient().tags.get(id)); });\n withMutationOptions(tag.command('delete <tagId>'), false).action(async (tagId, _options, command) => { const id = requireId(tagId, 'tagId'); await applyOrPreview(command, { delete: true }, () => getClient().tags.delete(id), () => getClient().tags.get(id)); });\n}\n\nfunction registerAssetCommands(catalog: Command, getClient: ClientFactory): void {\n const asset = catalog.command('asset');\n asset.command('list').option('--search <text>').option('--limit <number>', 'Máximo de resultados', parseInteger).option('--offset <number>', 'Desplazamiento', parseInteger).action(async (options) => emitSuccess(await getClient().assets.list(options)));\n asset.command('get <assetId>').action(async (assetId) => emitSuccess(await getClient().assets.get(requireId(assetId, 'assetId'))));\n asset.command('upload').requiredOption('--file <path>', 'Archivo local').option('--apply', 'Sube el archivo').action(async (options, command) => {\n const filePath = options.file as string; const fileStat = await stat(filePath); if (!fileStat.isFile()) throw new CliProtocolError('CLI_VALIDATION_ERROR', '--file debe apuntar a un archivo');\n if (!wantsApply(command)) { emitSuccess({ validated: 'local', file: basename(filePath), sizeBytes: fileStat.size }); return; }\n const file = new File([await readFile(filePath)], basename(filePath)); emitSuccess(await getClient().assets.upload(file));\n });\n withMutationOptions(asset.command('import-url')).action(async (options, command) => { const input = await readMutationInput(options.from); await applyOrPreview(command, input, () => getClient().assets.importFromUrl(input as never)); });\n}\n\nfunction registerInventoryCommands(catalog: Command, getClient: ClientFactory): void {\n const inventory = catalog.command('inventory');\n inventory.command('get <variantId>').action(async (variantId) => emitSuccess(await getClient().inventory.get(requireId(variantId, 'variantId'))));\n inventory.command('movements <variantId>').option('--reason <reason>').option('--limit <number>', 'Máximo de resultados', parseInteger).option('--offset <number>', 'Desplazamiento', parseInteger).action(async (variantId, options) => emitSuccess(await getClient().inventory.listMovements(requireId(variantId, 'variantId'), options)));\n withMutationOptions(inventory.command('adjust <variantId>')).action(async (variantId, options, command) => { const id = requireId(variantId, 'variantId'); const input = await readMutationInput(options.from); await applyOrPreview(command, input, () => getClient().inventory.adjust(id, input as never), () => getClient().inventory.get(id)); });\n withMutationOptions(inventory.command('set <variantId>')).action(async (variantId, options, command) => { const id = requireId(variantId, 'variantId'); const input = await readMutationInput(options.from); await applyOrPreview(command, input, () => getClient().inventory.set(id, input as never), () => getClient().inventory.get(id)); });\n}\n\nasync function resolveLocalFileSources(value: unknown, client: AvileoAgentClient): Promise<unknown> {\n if (Array.isArray(value)) return Promise.all(value.map((item) => resolveLocalFileSources(item, client)));\n if (!value || typeof value !== 'object') return value;\n\n const source = value as JsonObject;\n if (source.kind === 'file') {\n if (typeof source.path !== 'string' || Object.keys(source).length !== 2) {\n throw new CliProtocolError(\n 'CLI_VALIDATION_ERROR',\n 'Una imagen local debe tener exactamente kind: \"file\" y path',\n );\n }\n const fileStat = await stat(source.path);\n if (!fileStat.isFile()) {\n throw new CliProtocolError('CLI_VALIDATION_ERROR', 'La ruta de imagen local debe apuntar a un archivo');\n }\n const asset = await client.assets.upload(\n new File([await readFile(source.path)], basename(source.path)),\n );\n return { kind: 'asset', assetId: asset.id };\n }\n\n return Object.fromEntries(\n await Promise.all(\n Object.entries(source).map(async ([key, nested]) => [\n key,\n await resolveLocalFileSources(nested, client),\n ]),\n ),\n );\n}\n\nfunction registerImportCommands(catalog: Command, getClient: ClientFactory): void {\n const imports = catalog.command('import');\n imports.command('preview').requiredOption('--from <json-file>', 'Lista estructurada para vista previa').action(async (options) => {\n const input = await readMutationInput(options.from);\n const normalizedInput = await resolveLocalFileSources(input, getClient()) as JsonObject;\n emitSuccess(await getClient().imports.preview(normalizedInput as never));\n });\n imports.command('apply <importId>').option('--apply', 'Encola la importación aprobada').action(async (importId, _options, command) => {\n const id = requireId(importId, 'importId');\n if (!wantsApply(command)) { emitSuccess({ validated: 'local', importId: id, action: 'apply' }); return; }\n emitSuccess(await getClient().imports.apply(id));\n });\n imports.command('status <importId>').action(async (importId) => emitSuccess(await getClient().imports.get(requireId(importId, 'importId'))));\n}\n","#!/usr/bin/env node\nimport { createProgram } from './program';\n\ncreateProgram().parseAsync(process.argv);\n"],"mappings":";;;AAAA,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C;AAC5B,cAAQ,WAAW,YAAY,KAAK;AACpC,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;;;AK9CA,cAAc,EAAE,WAAW,QAAQ,IAAI;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tarileo/avileo-catalog-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Safe command-line client for Avileo tenant catalog agents",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/leobar37/elena.git",
|
|
9
|
+
"directory": "apps/avileo/agent-cli"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"bin": {
|
|
13
|
+
"avileo": "dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"package.json"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsup",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"test": "vitest run"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=20"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@tarileo/avileo-sdk": "workspace:*",
|
|
33
|
+
"commander": "^12.1.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^20.10.0",
|
|
37
|
+
"tsup": "^8.5.1",
|
|
38
|
+
"typescript": "^5",
|
|
39
|
+
"vitest": "^3.2.4"
|
|
40
|
+
},
|
|
41
|
+
"main": "index.js",
|
|
42
|
+
"keywords": [],
|
|
43
|
+
"author": "",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/leobar37/elena/issues"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/leobar37/elena#readme"
|
|
48
|
+
}
|