@doufunao123/asset-gateway 0.7.0 → 0.8.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/dist/index.js +41 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -70,7 +70,7 @@ function normalizeError(error2) {
|
|
|
70
70
|
|
|
71
71
|
// src/meta.ts
|
|
72
72
|
var CLI_NAME = "asset-gateway";
|
|
73
|
-
var CLI_VERSION = "0.
|
|
73
|
+
var CLI_VERSION = "0.8.0";
|
|
74
74
|
var CLI_DESCRIPTION = "Universal asset generation gateway CLI";
|
|
75
75
|
var DEFAULT_GATEWAY_URL = "https://assets.xiaomao.chat";
|
|
76
76
|
|
|
@@ -991,6 +991,46 @@ function createProcess3dCommand() {
|
|
|
991
991
|
}
|
|
992
992
|
})
|
|
993
993
|
);
|
|
994
|
+
command.addCommand(
|
|
995
|
+
new Command6("refine").description("Refine a draft model to higher quality").requiredOption("--task-id <id>", "Tripo task ID").option("--output-dir <dir>", "Directory to save output", ".").action(async function(options) {
|
|
996
|
+
try {
|
|
997
|
+
const ctx = createContext(this);
|
|
998
|
+
const data = await ctx.client.post("/api/process3d", {
|
|
999
|
+
task_id: options.taskId,
|
|
1000
|
+
operation: "refine",
|
|
1001
|
+
params: {}
|
|
1002
|
+
});
|
|
1003
|
+
const localPath = await saveProcess3dOutput(data, "refine", options.outputDir);
|
|
1004
|
+
if (localPath) data.local_path = localPath;
|
|
1005
|
+
printSuccess("process3d.refine", data, ctx);
|
|
1006
|
+
} catch (error2) {
|
|
1007
|
+
printError("process3d.refine", error2);
|
|
1008
|
+
}
|
|
1009
|
+
})
|
|
1010
|
+
);
|
|
1011
|
+
command.addCommand(
|
|
1012
|
+
new Command6("import").description("Import an external 3D model for post-processing").option("--file-url <url>", "URL of the 3D model to import").option("--file-path <path>", "Local path of the 3D model to import").option("--output-dir <dir>", "Directory to save output", ".").action(async function(options) {
|
|
1013
|
+
try {
|
|
1014
|
+
const ctx = createContext(this);
|
|
1015
|
+
const params = {};
|
|
1016
|
+
if (options.fileUrl) params.file_url = options.fileUrl;
|
|
1017
|
+
if (options.filePath) params.file_path = options.filePath;
|
|
1018
|
+
if (!params.file_url && !params.file_path) {
|
|
1019
|
+
throw new Error("Either --file-url or --file-path is required");
|
|
1020
|
+
}
|
|
1021
|
+
const data = await ctx.client.post("/api/process3d", {
|
|
1022
|
+
task_id: "",
|
|
1023
|
+
operation: "import",
|
|
1024
|
+
params
|
|
1025
|
+
});
|
|
1026
|
+
const localPath = await saveProcess3dOutput(data, "import", options.outputDir);
|
|
1027
|
+
if (localPath) data.local_path = localPath;
|
|
1028
|
+
printSuccess("process3d.import", data, ctx);
|
|
1029
|
+
} catch (error2) {
|
|
1030
|
+
printError("process3d.import", error2);
|
|
1031
|
+
}
|
|
1032
|
+
})
|
|
1033
|
+
);
|
|
994
1034
|
return command;
|
|
995
1035
|
}
|
|
996
1036
|
|