@easysociable/cli 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/easysociable.js
CHANGED
|
@@ -34588,7 +34588,7 @@ init_src2();
|
|
|
34588
34588
|
import { cp, readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2, chmod, copyFile, rm } from "fs/promises";
|
|
34589
34589
|
import { existsSync as existsSync4, readFileSync as readFileSync3, statSync as statSync2 } from "fs";
|
|
34590
34590
|
import { homedir as homedir3 } from "os";
|
|
34591
|
-
import { join as join5, resolve as resolve4 } from "path";
|
|
34591
|
+
import { basename as basename2, join as join5, resolve as resolve4 } from "path";
|
|
34592
34592
|
import { Command } from "commander";
|
|
34593
34593
|
|
|
34594
34594
|
// src/runtime/mcp-hosts.ts
|
|
@@ -36114,7 +36114,15 @@ Waiting for approval\u2026
|
|
|
36114
36114
|
jsonOption(themes.command("set-default").requiredOption("--profile-id <profileId>").requiredOption("--theme-id <themeId>")).action(withClient(async (client, opts) => client.requestJson("POST", `/v1/profiles/${opts.profileId}/default-theme`, { themeId: opts.themeId })));
|
|
36115
36115
|
const images = program.command("images").description("Manage account image assets");
|
|
36116
36116
|
addCrudCommands(images, "images", { list: "/v1/images", get: "/v1/images/:id", create: "/v1/images/imports", update: "/v1/images/:id", archive: "/v1/images/:id/archive", restore: "/v1/images/:id/restore", delete: "/v1/images/:id" });
|
|
36117
|
-
jsonOption(images.command("upload").
|
|
36117
|
+
jsonOption(images.command("upload").option("--path <files...>", "Image files (PNG/JPEG/WebP), uploaded in parallel").option("--file <path>", "JSON body { file: dataUrl, filename }")).action(withClient(async (client, opts) => {
|
|
36118
|
+
if (!opts.path)
|
|
36119
|
+
return client.requestJson("POST", "/v1/images/imports", JSON.parse(await readFile2(String(opts.file), "utf8")));
|
|
36120
|
+
const results = await Promise.allSettled(opts.path.map(async (path) => client.requestJson("POST", "/v1/images/imports", { file: `data:${mimeTypeFor(path)};base64,${(await readFile2(path)).toString("base64")}`, filename: basename2(path) })));
|
|
36121
|
+
const data = results.map((r, i) => r.status === "fulfilled" ? { path: opts.path[i], asset: r.value.data?.asset } : { path: opts.path[i], error: r.reason instanceof Error ? r.reason.message : String(r.reason) });
|
|
36122
|
+
if (data.some((d) => "error" in d))
|
|
36123
|
+
process.exitCode = 1;
|
|
36124
|
+
return { ok: !process.exitCode, data };
|
|
36125
|
+
}));
|
|
36118
36126
|
jsonOption(images.command("import-url").requiredOption("--url <url>").option("--name <name>")).action(withClient(async (client, opts) => client.requestJson("POST", "/v1/images/imports", { sourceUrl: String(opts.url), ...opts.name ? { name: String(opts.name) } : {} })));
|
|
36119
36127
|
jsonOption(images.command("search").requiredOption("--q <query>")).action(withClient(async (client, opts) => client.requestJson("GET", `/v1/images?q=${encodeURIComponent(String(opts.q))}`)));
|
|
36120
36128
|
jsonOption(images.command("attest").requiredOption("--id <id>")).action(withClient(async (client, opts) => client.requestJson("POST", `/v1/images/${opts.id}/attest`, { accepted: true })));
|
|
@@ -36284,7 +36292,7 @@ async function runV1Cli(argv = process.argv) {
|
|
|
36284
36292
|
const program = buildV1Cli();
|
|
36285
36293
|
try {
|
|
36286
36294
|
await program.parseAsync(argv);
|
|
36287
|
-
return 0;
|
|
36295
|
+
return Number(process.exitCode ?? 0);
|
|
36288
36296
|
} catch (error62) {
|
|
36289
36297
|
process.stderr.write(`${error62 instanceof Error ? error62.message : String(error62)}
|
|
36290
36298
|
`);
|