@acedatacloud/sdk 2026.817.0 → 2026.905.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 +96 -49
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/resources/providers/fish.ts +8 -7
- package/src/resources/providers/index.ts +3 -0
- package/src/resources/providers/qwen-image.ts +86 -0
- package/src/resources/providers/seedream.ts +34 -34
- package/src/resources/providers/wan.ts +43 -31
package/dist/index.mjs
CHANGED
|
@@ -479,9 +479,9 @@ var Tasks = class {
|
|
|
479
479
|
}
|
|
480
480
|
transport;
|
|
481
481
|
retrieve(opts) {
|
|
482
|
-
const { taskId:
|
|
482
|
+
const { taskId: taskId17, ...rest } = opts;
|
|
483
483
|
return this.transport.request("POST", "/captcha/tasks", {
|
|
484
|
-
json: { task_id:
|
|
484
|
+
json: { task_id: taskId17, ...rest }
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
487
|
};
|
|
@@ -589,8 +589,8 @@ var TaskHandle = class {
|
|
|
589
589
|
pollEndpoint;
|
|
590
590
|
transport;
|
|
591
591
|
_result = null;
|
|
592
|
-
constructor(
|
|
593
|
-
this.id =
|
|
592
|
+
constructor(taskId17, pollEndpoint, transport, submitted) {
|
|
593
|
+
this.id = taskId17;
|
|
594
594
|
this.pollEndpoint = pollEndpoint;
|
|
595
595
|
this.transport = transport;
|
|
596
596
|
if (submitted && artifactUrls({ response: submitted }).length > 0) {
|
|
@@ -668,9 +668,9 @@ var Images = class {
|
|
|
668
668
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
669
669
|
const endpoint = `/${provider}/images`;
|
|
670
670
|
const result = await this.transport.request("POST", endpoint, { json: body });
|
|
671
|
-
const
|
|
672
|
-
if (!
|
|
673
|
-
const handle = new TaskHandle(
|
|
671
|
+
const taskId17 = result.task_id;
|
|
672
|
+
if (!taskId17 || result.data && !shouldWait) return result;
|
|
673
|
+
const handle = new TaskHandle(taskId17, `/${provider}/tasks`, this.transport);
|
|
674
674
|
if (shouldWait) return handle.wait({ pollInterval, maxWait });
|
|
675
675
|
return handle;
|
|
676
676
|
}
|
|
@@ -716,9 +716,9 @@ var Audio = class {
|
|
|
716
716
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
717
717
|
result = await this.transport.request("POST", `/${provider}/audios`, { json: body });
|
|
718
718
|
}
|
|
719
|
-
const
|
|
720
|
-
if (!
|
|
721
|
-
const handle = new TaskHandle(
|
|
719
|
+
const taskId17 = result.task_id;
|
|
720
|
+
if (!taskId17 || result.data && !shouldWait) return result;
|
|
721
|
+
const handle = new TaskHandle(taskId17, `/${provider}/tasks`, this.transport);
|
|
722
722
|
if (shouldWait) return handle.wait({ pollInterval, maxWait });
|
|
723
723
|
return handle;
|
|
724
724
|
}
|
|
@@ -737,9 +737,9 @@ var Video = class {
|
|
|
737
737
|
if (imageUrl !== void 0) body.image_url = imageUrl;
|
|
738
738
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
739
739
|
const result = await this.transport.request("POST", `/${provider}/videos`, { json: body });
|
|
740
|
-
const
|
|
741
|
-
if (!
|
|
742
|
-
const handle = new TaskHandle(
|
|
740
|
+
const taskId17 = result.task_id;
|
|
741
|
+
if (!taskId17 || result.data && !shouldWait) return result;
|
|
742
|
+
const handle = new TaskHandle(taskId17, `/${provider}/tasks`, this.transport);
|
|
743
743
|
if (shouldWait) return handle.wait({ pollInterval, maxWait });
|
|
744
744
|
return handle;
|
|
745
745
|
}
|
|
@@ -786,17 +786,17 @@ var Tasks2 = class {
|
|
|
786
786
|
this.transport = transport;
|
|
787
787
|
}
|
|
788
788
|
transport;
|
|
789
|
-
async get(
|
|
789
|
+
async get(taskId17, opts = {}) {
|
|
790
790
|
const service = opts.service ?? "suno";
|
|
791
791
|
const endpoint = SERVICE_TASK_ENDPOINTS[service] ?? `/${service}/tasks`;
|
|
792
792
|
return this.transport.request("POST", endpoint, {
|
|
793
|
-
json: { id:
|
|
793
|
+
json: { id: taskId17, action: "retrieve" }
|
|
794
794
|
});
|
|
795
795
|
}
|
|
796
|
-
async wait(
|
|
796
|
+
async wait(taskId17, opts = {}) {
|
|
797
797
|
const service = opts.service ?? "suno";
|
|
798
798
|
const endpoint = SERVICE_TASK_ENDPOINTS[service] ?? `/${service}/tasks`;
|
|
799
|
-
const handle = new TaskHandle(
|
|
799
|
+
const handle = new TaskHandle(taskId17, endpoint, this.transport);
|
|
800
800
|
return handle.wait({ pollInterval: opts.pollInterval, maxWait: opts.maxWait });
|
|
801
801
|
}
|
|
802
802
|
};
|
|
@@ -1544,13 +1544,13 @@ var Fish = class {
|
|
|
1544
1544
|
if (options.minChunkLength !== void 0) body["min_chunk_length"] = options.minChunkLength;
|
|
1545
1545
|
if (options.repetitionPenalty !== void 0) body["repetition_penalty"] = options.repetitionPenalty;
|
|
1546
1546
|
for (const [key, value] of Object.entries(options)) {
|
|
1547
|
-
if (!["async", "callbackUrl", "chunkLength", "format", "latency", "maxNewTokens", "maxWait", "minChunkLength", "mp3Bitrate", "normalize", "opusBitrate", "pollInterval", "prosody", "referenceId", "references", "repetitionPenalty", "sampleRate", "temperature", "text", "topP", "wait"].includes(key) && value !== void 0) {
|
|
1547
|
+
if (!["async", "callbackUrl", "chunkLength", "format", "latency", "maxNewTokens", "maxWait", "minChunkLength", "model", "mp3Bitrate", "normalize", "opusBitrate", "pollInterval", "prosody", "referenceId", "references", "repetitionPenalty", "sampleRate", "temperature", "text", "topP", "wait"].includes(key) && value !== void 0) {
|
|
1548
1548
|
body[key] = value;
|
|
1549
1549
|
}
|
|
1550
1550
|
}
|
|
1551
1551
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1552
1552
|
body.async = options.async ?? true;
|
|
1553
|
-
const result = await this.transport.request("POST", "/fish/tts", { json: body });
|
|
1553
|
+
const result = await this.transport.request("POST", "/fish/tts", { json: body, headers: options.model !== void 0 ? { "model": options.model } : {} });
|
|
1554
1554
|
const handle = new TaskHandle(taskId3(result), "/fish/tasks", this.transport, result);
|
|
1555
1555
|
if (options.wait) {
|
|
1556
1556
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
@@ -1968,13 +1968,55 @@ var Producer = class {
|
|
|
1968
1968
|
}
|
|
1969
1969
|
};
|
|
1970
1970
|
|
|
1971
|
-
// src/resources/providers/
|
|
1971
|
+
// src/resources/providers/qwen-image.ts
|
|
1972
1972
|
function taskId12(result) {
|
|
1973
1973
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1974
1974
|
const data = result?.data;
|
|
1975
1975
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
1976
1976
|
return typeof result?.id === "string" ? result.id : "";
|
|
1977
1977
|
}
|
|
1978
|
+
var QwenImage = class {
|
|
1979
|
+
constructor(transport) {
|
|
1980
|
+
this.transport = transport;
|
|
1981
|
+
}
|
|
1982
|
+
transport;
|
|
1983
|
+
/** Call /qwen-image/images. */
|
|
1984
|
+
async generate(options) {
|
|
1985
|
+
const body = {};
|
|
1986
|
+
body["model"] = options.model;
|
|
1987
|
+
body["prompt"] = options.prompt;
|
|
1988
|
+
if (options.imageUrls !== void 0) body["image_urls"] = options.imageUrls;
|
|
1989
|
+
body["n"] = options.n ?? 1;
|
|
1990
|
+
if (options.size !== void 0) body["size"] = options.size;
|
|
1991
|
+
body["prompt_extend"] = options.promptExtend ?? true;
|
|
1992
|
+
body["prompt_extend_mode"] = options.promptExtendMode ?? "direct";
|
|
1993
|
+
body["enable_thinking"] = options.enableThinking ?? true;
|
|
1994
|
+
if (options.negativePrompt !== void 0) body["negative_prompt"] = options.negativePrompt;
|
|
1995
|
+
if (options.seed !== void 0) body["seed"] = options.seed;
|
|
1996
|
+
body["watermark"] = options.watermark ?? false;
|
|
1997
|
+
for (const [key, value] of Object.entries(options)) {
|
|
1998
|
+
if (!["async", "callbackUrl", "enableThinking", "imageUrls", "maxWait", "model", "n", "negativePrompt", "pollInterval", "prompt", "promptExtend", "promptExtendMode", "seed", "size", "wait", "watermark"].includes(key) && value !== void 0) {
|
|
1999
|
+
body[key] = value;
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2003
|
+
body.async = options.async ?? true;
|
|
2004
|
+
const result = await this.transport.request("POST", "/qwen-image/images", { json: body });
|
|
2005
|
+
const handle = new TaskHandle(taskId12(result), "/qwen-image/tasks", this.transport, result);
|
|
2006
|
+
if (options.wait) {
|
|
2007
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2008
|
+
}
|
|
2009
|
+
return handle;
|
|
2010
|
+
}
|
|
2011
|
+
};
|
|
2012
|
+
|
|
2013
|
+
// src/resources/providers/seedance.ts
|
|
2014
|
+
function taskId13(result) {
|
|
2015
|
+
if (typeof result?.task_id === "string") return result.task_id;
|
|
2016
|
+
const data = result?.data;
|
|
2017
|
+
if (data && typeof data.task_id === "string") return data.task_id;
|
|
2018
|
+
return typeof result?.id === "string" ? result.id : "";
|
|
2019
|
+
}
|
|
1978
2020
|
var Seedance = class {
|
|
1979
2021
|
constructor(transport) {
|
|
1980
2022
|
this.transport = transport;
|
|
@@ -2006,7 +2048,7 @@ var Seedance = class {
|
|
|
2006
2048
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2007
2049
|
body.async = options.async ?? true;
|
|
2008
2050
|
const result = await this.transport.request("POST", "/seedance/videos", { json: body });
|
|
2009
|
-
const handle = new TaskHandle(
|
|
2051
|
+
const handle = new TaskHandle(taskId13(result), "/seedance/tasks", this.transport, result);
|
|
2010
2052
|
if (options.wait) {
|
|
2011
2053
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2012
2054
|
}
|
|
@@ -2015,7 +2057,7 @@ var Seedance = class {
|
|
|
2015
2057
|
};
|
|
2016
2058
|
|
|
2017
2059
|
// src/resources/providers/seedream.ts
|
|
2018
|
-
function
|
|
2060
|
+
function taskId14(result) {
|
|
2019
2061
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2020
2062
|
const data = result?.data;
|
|
2021
2063
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2026,32 +2068,32 @@ var Seedream = class {
|
|
|
2026
2068
|
this.transport = transport;
|
|
2027
2069
|
}
|
|
2028
2070
|
transport;
|
|
2029
|
-
/**
|
|
2071
|
+
/** Call /seedream/images. */
|
|
2030
2072
|
async generate(options) {
|
|
2031
2073
|
const body = {};
|
|
2032
2074
|
body["model"] = options.model;
|
|
2033
|
-
body["prompt"] = options.prompt;
|
|
2034
|
-
if (options.seed !== void 0) body["seed"] = options.seed;
|
|
2035
|
-
if (options.size !== void 0) body["size"] = options.size;
|
|
2075
|
+
if (options.prompt !== void 0) body["prompt"] = options.prompt;
|
|
2036
2076
|
if (options.image !== void 0) body["image"] = options.image;
|
|
2037
|
-
if (options.
|
|
2077
|
+
if (options.size !== void 0) body["size"] = options.size;
|
|
2078
|
+
if (options.sequentialImageGeneration !== void 0) body["sequential_image_generation"] = options.sequentialImageGeneration;
|
|
2079
|
+
if (options.sequentialImageGenerationOptions !== void 0) body["sequential_image_generation_options"] = options.sequentialImageGenerationOptions;
|
|
2038
2080
|
if (options.stream !== void 0) body["stream"] = options.stream;
|
|
2081
|
+
if (options.responseFormat !== void 0) body["response_format"] = options.responseFormat;
|
|
2039
2082
|
if (options.watermark !== void 0) body["watermark"] = options.watermark;
|
|
2040
2083
|
if (options.outputFormat !== void 0) body["output_format"] = options.outputFormat;
|
|
2041
|
-
if (options.
|
|
2042
|
-
if (options.responseFormat !== void 0) body["response_format"] = options.responseFormat;
|
|
2084
|
+
if (options.tools !== void 0) body["tools"] = options.tools;
|
|
2043
2085
|
if (options.optimizePromptOptions !== void 0) body["optimize_prompt_options"] = options.optimizePromptOptions;
|
|
2044
|
-
if (options.
|
|
2045
|
-
if (options.
|
|
2086
|
+
if (options.layerDecomposition !== void 0) body["layer_decomposition"] = options.layerDecomposition;
|
|
2087
|
+
if (options.background !== void 0) body["background"] = options.background;
|
|
2046
2088
|
for (const [key, value] of Object.entries(options)) {
|
|
2047
|
-
if (!["async", "
|
|
2089
|
+
if (!["async", "background", "callbackUrl", "image", "layerDecomposition", "maxWait", "model", "optimizePromptOptions", "outputFormat", "pollInterval", "prompt", "responseFormat", "sequentialImageGeneration", "sequentialImageGenerationOptions", "size", "stream", "tools", "wait", "watermark"].includes(key) && value !== void 0) {
|
|
2048
2090
|
body[key] = value;
|
|
2049
2091
|
}
|
|
2050
2092
|
}
|
|
2051
2093
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2052
2094
|
body.async = options.async ?? true;
|
|
2053
2095
|
const result = await this.transport.request("POST", "/seedream/images", { json: body });
|
|
2054
|
-
const handle = new TaskHandle(
|
|
2096
|
+
const handle = new TaskHandle(taskId14(result), "/seedream/tasks", this.transport, result);
|
|
2055
2097
|
if (options.wait) {
|
|
2056
2098
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2057
2099
|
}
|
|
@@ -2060,7 +2102,7 @@ var Seedream = class {
|
|
|
2060
2102
|
};
|
|
2061
2103
|
|
|
2062
2104
|
// src/resources/providers/suno.ts
|
|
2063
|
-
function
|
|
2105
|
+
function taskId15(result) {
|
|
2064
2106
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2065
2107
|
const data = result?.data;
|
|
2066
2108
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2111,7 +2153,7 @@ var Suno = class {
|
|
|
2111
2153
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2112
2154
|
body.async = options.async ?? true;
|
|
2113
2155
|
const result = await this.transport.request("POST", "/suno/audios", { json: body });
|
|
2114
|
-
const handle = new TaskHandle(
|
|
2156
|
+
const handle = new TaskHandle(taskId15(result), "/suno/tasks", this.transport, result);
|
|
2115
2157
|
if (options.wait) {
|
|
2116
2158
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2117
2159
|
}
|
|
@@ -2186,7 +2228,7 @@ var Suno = class {
|
|
|
2186
2228
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2187
2229
|
body.async = options.async ?? true;
|
|
2188
2230
|
const result = await this.transport.request("POST", "/suno/vox", { json: body });
|
|
2189
|
-
const handle = new TaskHandle(
|
|
2231
|
+
const handle = new TaskHandle(taskId15(result), "/suno/tasks", this.transport, result);
|
|
2190
2232
|
if (options.wait) {
|
|
2191
2233
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2192
2234
|
}
|
|
@@ -2204,7 +2246,7 @@ var Suno = class {
|
|
|
2204
2246
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2205
2247
|
body.async = options.async ?? true;
|
|
2206
2248
|
const result = await this.transport.request("POST", "/suno/wav", { json: body });
|
|
2207
|
-
const handle = new TaskHandle(
|
|
2249
|
+
const handle = new TaskHandle(taskId15(result), "/suno/tasks", this.transport, result);
|
|
2208
2250
|
if (options.wait) {
|
|
2209
2251
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2210
2252
|
}
|
|
@@ -2222,7 +2264,7 @@ var Suno = class {
|
|
|
2222
2264
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2223
2265
|
body.async = options.async ?? true;
|
|
2224
2266
|
const result = await this.transport.request("POST", "/suno/midi", { json: body });
|
|
2225
|
-
const handle = new TaskHandle(
|
|
2267
|
+
const handle = new TaskHandle(taskId15(result), "/suno/tasks", this.transport, result);
|
|
2226
2268
|
if (options.wait) {
|
|
2227
2269
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2228
2270
|
}
|
|
@@ -2281,7 +2323,7 @@ var Suno = class {
|
|
|
2281
2323
|
};
|
|
2282
2324
|
|
|
2283
2325
|
// src/resources/providers/wan.ts
|
|
2284
|
-
function
|
|
2326
|
+
function taskId16(result) {
|
|
2285
2327
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2286
2328
|
const data = result?.data;
|
|
2287
2329
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2296,27 +2338,31 @@ var Wan = class {
|
|
|
2296
2338
|
async generate(options) {
|
|
2297
2339
|
const body = {};
|
|
2298
2340
|
body["model"] = options.model;
|
|
2299
|
-
body["action"] = options.action;
|
|
2300
|
-
body["prompt"] = options.prompt;
|
|
2301
|
-
if (options.size !== void 0) body["size"] = options.size;
|
|
2302
2341
|
body["audio"] = options.audio ?? false;
|
|
2303
|
-
if (options.duration !== void 0) body["duration"] = options.duration;
|
|
2304
|
-
if (options.audioUrl !== void 0) body["audio_url"] = options.audioUrl;
|
|
2305
|
-
if (options.imageUrl !== void 0) body["image_url"] = options.imageUrl;
|
|
2306
|
-
if (options.shotType !== void 0) body["shot_type"] = options.shotType;
|
|
2307
|
-
if (options.resolution !== void 0) body["resolution"] = options.resolution;
|
|
2308
2342
|
body["prompt_extend"] = options.promptExtend ?? false;
|
|
2343
|
+
body["action"] = options.action ?? "text2video";
|
|
2344
|
+
if (options.resolution !== void 0) body["resolution"] = options.resolution;
|
|
2345
|
+
if (options.shotType !== void 0) body["shot_type"] = options.shotType;
|
|
2346
|
+
if (options.duration !== void 0) body["duration"] = options.duration;
|
|
2347
|
+
if (options.prompt !== void 0) body["prompt"] = options.prompt;
|
|
2309
2348
|
if (options.negativePrompt !== void 0) body["negative_prompt"] = options.negativePrompt;
|
|
2349
|
+
if (options.size !== void 0) body["size"] = options.size;
|
|
2350
|
+
if (options.audioUrl !== void 0) body["audio_url"] = options.audioUrl;
|
|
2310
2351
|
if (options.referenceVideoUrls !== void 0) body["reference_video_urls"] = options.referenceVideoUrls;
|
|
2352
|
+
if (options.imageUrl !== void 0) body["image_url"] = options.imageUrl;
|
|
2353
|
+
if (options.media !== void 0) body["media"] = options.media;
|
|
2354
|
+
if (options.ratio !== void 0) body["ratio"] = options.ratio;
|
|
2355
|
+
if (options.seed !== void 0) body["seed"] = options.seed;
|
|
2356
|
+
body["watermark"] = options.watermark ?? false;
|
|
2311
2357
|
for (const [key, value] of Object.entries(options)) {
|
|
2312
|
-
if (!["action", "async", "audio", "audioUrl", "callbackUrl", "duration", "imageUrl", "maxWait", "model", "negativePrompt", "pollInterval", "prompt", "promptExtend", "referenceVideoUrls", "resolution", "shotType", "size", "wait"].includes(key) && value !== void 0) {
|
|
2358
|
+
if (!["action", "async", "audio", "audioUrl", "callbackUrl", "duration", "imageUrl", "maxWait", "media", "model", "negativePrompt", "pollInterval", "prompt", "promptExtend", "ratio", "referenceVideoUrls", "resolution", "seed", "shotType", "size", "wait", "watermark"].includes(key) && value !== void 0) {
|
|
2313
2359
|
body[key] = value;
|
|
2314
2360
|
}
|
|
2315
2361
|
}
|
|
2316
2362
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2317
2363
|
body.async = options.async ?? true;
|
|
2318
2364
|
const result = await this.transport.request("POST", "/wan/videos", { json: body });
|
|
2319
|
-
const handle = new TaskHandle(
|
|
2365
|
+
const handle = new TaskHandle(taskId16(result), "/wan/tasks", this.transport, result);
|
|
2320
2366
|
if (options.wait) {
|
|
2321
2367
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2322
2368
|
}
|
|
@@ -2338,6 +2384,7 @@ function attachProviders(client, transport) {
|
|
|
2338
2384
|
client.minimax = new Minimax(transport);
|
|
2339
2385
|
client.nanobanana = new NanoBanana(transport);
|
|
2340
2386
|
client.producer = new Producer(transport);
|
|
2387
|
+
client.qwenimage = new QwenImage(transport);
|
|
2341
2388
|
client.seedance = new Seedance(transport);
|
|
2342
2389
|
client.seedream = new Seedream(transport);
|
|
2343
2390
|
client.suno = new Suno(transport);
|