@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.js
CHANGED
|
@@ -527,9 +527,9 @@ var Tasks = class {
|
|
|
527
527
|
}
|
|
528
528
|
transport;
|
|
529
529
|
retrieve(opts) {
|
|
530
|
-
const { taskId:
|
|
530
|
+
const { taskId: taskId17, ...rest } = opts;
|
|
531
531
|
return this.transport.request("POST", "/captcha/tasks", {
|
|
532
|
-
json: { task_id:
|
|
532
|
+
json: { task_id: taskId17, ...rest }
|
|
533
533
|
});
|
|
534
534
|
}
|
|
535
535
|
};
|
|
@@ -637,8 +637,8 @@ var TaskHandle = class {
|
|
|
637
637
|
pollEndpoint;
|
|
638
638
|
transport;
|
|
639
639
|
_result = null;
|
|
640
|
-
constructor(
|
|
641
|
-
this.id =
|
|
640
|
+
constructor(taskId17, pollEndpoint, transport, submitted) {
|
|
641
|
+
this.id = taskId17;
|
|
642
642
|
this.pollEndpoint = pollEndpoint;
|
|
643
643
|
this.transport = transport;
|
|
644
644
|
if (submitted && artifactUrls({ response: submitted }).length > 0) {
|
|
@@ -716,9 +716,9 @@ var Images = class {
|
|
|
716
716
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
717
717
|
const endpoint = `/${provider}/images`;
|
|
718
718
|
const result = await this.transport.request("POST", endpoint, { json: body });
|
|
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
|
}
|
|
@@ -764,9 +764,9 @@ var Audio = class {
|
|
|
764
764
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
765
765
|
result = await this.transport.request("POST", `/${provider}/audios`, { json: body });
|
|
766
766
|
}
|
|
767
|
-
const
|
|
768
|
-
if (!
|
|
769
|
-
const handle = new TaskHandle(
|
|
767
|
+
const taskId17 = result.task_id;
|
|
768
|
+
if (!taskId17 || result.data && !shouldWait) return result;
|
|
769
|
+
const handle = new TaskHandle(taskId17, `/${provider}/tasks`, this.transport);
|
|
770
770
|
if (shouldWait) return handle.wait({ pollInterval, maxWait });
|
|
771
771
|
return handle;
|
|
772
772
|
}
|
|
@@ -785,9 +785,9 @@ var Video = class {
|
|
|
785
785
|
if (imageUrl !== void 0) body.image_url = imageUrl;
|
|
786
786
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
787
787
|
const result = await this.transport.request("POST", `/${provider}/videos`, { json: body });
|
|
788
|
-
const
|
|
789
|
-
if (!
|
|
790
|
-
const handle = new TaskHandle(
|
|
788
|
+
const taskId17 = result.task_id;
|
|
789
|
+
if (!taskId17 || result.data && !shouldWait) return result;
|
|
790
|
+
const handle = new TaskHandle(taskId17, `/${provider}/tasks`, this.transport);
|
|
791
791
|
if (shouldWait) return handle.wait({ pollInterval, maxWait });
|
|
792
792
|
return handle;
|
|
793
793
|
}
|
|
@@ -834,17 +834,17 @@ var Tasks2 = class {
|
|
|
834
834
|
this.transport = transport;
|
|
835
835
|
}
|
|
836
836
|
transport;
|
|
837
|
-
async get(
|
|
837
|
+
async get(taskId17, opts = {}) {
|
|
838
838
|
const service = opts.service ?? "suno";
|
|
839
839
|
const endpoint = SERVICE_TASK_ENDPOINTS[service] ?? `/${service}/tasks`;
|
|
840
840
|
return this.transport.request("POST", endpoint, {
|
|
841
|
-
json: { id:
|
|
841
|
+
json: { id: taskId17, action: "retrieve" }
|
|
842
842
|
});
|
|
843
843
|
}
|
|
844
|
-
async wait(
|
|
844
|
+
async wait(taskId17, opts = {}) {
|
|
845
845
|
const service = opts.service ?? "suno";
|
|
846
846
|
const endpoint = SERVICE_TASK_ENDPOINTS[service] ?? `/${service}/tasks`;
|
|
847
|
-
const handle = new TaskHandle(
|
|
847
|
+
const handle = new TaskHandle(taskId17, endpoint, this.transport);
|
|
848
848
|
return handle.wait({ pollInterval: opts.pollInterval, maxWait: opts.maxWait });
|
|
849
849
|
}
|
|
850
850
|
};
|
|
@@ -1592,13 +1592,13 @@ var Fish = class {
|
|
|
1592
1592
|
if (options.minChunkLength !== void 0) body["min_chunk_length"] = options.minChunkLength;
|
|
1593
1593
|
if (options.repetitionPenalty !== void 0) body["repetition_penalty"] = options.repetitionPenalty;
|
|
1594
1594
|
for (const [key, value] of Object.entries(options)) {
|
|
1595
|
-
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) {
|
|
1595
|
+
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) {
|
|
1596
1596
|
body[key] = value;
|
|
1597
1597
|
}
|
|
1598
1598
|
}
|
|
1599
1599
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1600
1600
|
body.async = options.async ?? true;
|
|
1601
|
-
const result = await this.transport.request("POST", "/fish/tts", { json: body });
|
|
1601
|
+
const result = await this.transport.request("POST", "/fish/tts", { json: body, headers: options.model !== void 0 ? { "model": options.model } : {} });
|
|
1602
1602
|
const handle = new TaskHandle(taskId3(result), "/fish/tasks", this.transport, result);
|
|
1603
1603
|
if (options.wait) {
|
|
1604
1604
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
@@ -2016,13 +2016,55 @@ var Producer = class {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
};
|
|
2018
2018
|
|
|
2019
|
-
// src/resources/providers/
|
|
2019
|
+
// src/resources/providers/qwen-image.ts
|
|
2020
2020
|
function taskId12(result) {
|
|
2021
2021
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2022
2022
|
const data = result?.data;
|
|
2023
2023
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
2024
2024
|
return typeof result?.id === "string" ? result.id : "";
|
|
2025
2025
|
}
|
|
2026
|
+
var QwenImage = class {
|
|
2027
|
+
constructor(transport) {
|
|
2028
|
+
this.transport = transport;
|
|
2029
|
+
}
|
|
2030
|
+
transport;
|
|
2031
|
+
/** Call /qwen-image/images. */
|
|
2032
|
+
async generate(options) {
|
|
2033
|
+
const body = {};
|
|
2034
|
+
body["model"] = options.model;
|
|
2035
|
+
body["prompt"] = options.prompt;
|
|
2036
|
+
if (options.imageUrls !== void 0) body["image_urls"] = options.imageUrls;
|
|
2037
|
+
body["n"] = options.n ?? 1;
|
|
2038
|
+
if (options.size !== void 0) body["size"] = options.size;
|
|
2039
|
+
body["prompt_extend"] = options.promptExtend ?? true;
|
|
2040
|
+
body["prompt_extend_mode"] = options.promptExtendMode ?? "direct";
|
|
2041
|
+
body["enable_thinking"] = options.enableThinking ?? true;
|
|
2042
|
+
if (options.negativePrompt !== void 0) body["negative_prompt"] = options.negativePrompt;
|
|
2043
|
+
if (options.seed !== void 0) body["seed"] = options.seed;
|
|
2044
|
+
body["watermark"] = options.watermark ?? false;
|
|
2045
|
+
for (const [key, value] of Object.entries(options)) {
|
|
2046
|
+
if (!["async", "callbackUrl", "enableThinking", "imageUrls", "maxWait", "model", "n", "negativePrompt", "pollInterval", "prompt", "promptExtend", "promptExtendMode", "seed", "size", "wait", "watermark"].includes(key) && value !== void 0) {
|
|
2047
|
+
body[key] = value;
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2051
|
+
body.async = options.async ?? true;
|
|
2052
|
+
const result = await this.transport.request("POST", "/qwen-image/images", { json: body });
|
|
2053
|
+
const handle = new TaskHandle(taskId12(result), "/qwen-image/tasks", this.transport, result);
|
|
2054
|
+
if (options.wait) {
|
|
2055
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2056
|
+
}
|
|
2057
|
+
return handle;
|
|
2058
|
+
}
|
|
2059
|
+
};
|
|
2060
|
+
|
|
2061
|
+
// src/resources/providers/seedance.ts
|
|
2062
|
+
function taskId13(result) {
|
|
2063
|
+
if (typeof result?.task_id === "string") return result.task_id;
|
|
2064
|
+
const data = result?.data;
|
|
2065
|
+
if (data && typeof data.task_id === "string") return data.task_id;
|
|
2066
|
+
return typeof result?.id === "string" ? result.id : "";
|
|
2067
|
+
}
|
|
2026
2068
|
var Seedance = class {
|
|
2027
2069
|
constructor(transport) {
|
|
2028
2070
|
this.transport = transport;
|
|
@@ -2054,7 +2096,7 @@ var Seedance = class {
|
|
|
2054
2096
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2055
2097
|
body.async = options.async ?? true;
|
|
2056
2098
|
const result = await this.transport.request("POST", "/seedance/videos", { json: body });
|
|
2057
|
-
const handle = new TaskHandle(
|
|
2099
|
+
const handle = new TaskHandle(taskId13(result), "/seedance/tasks", this.transport, result);
|
|
2058
2100
|
if (options.wait) {
|
|
2059
2101
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2060
2102
|
}
|
|
@@ -2063,7 +2105,7 @@ var Seedance = class {
|
|
|
2063
2105
|
};
|
|
2064
2106
|
|
|
2065
2107
|
// src/resources/providers/seedream.ts
|
|
2066
|
-
function
|
|
2108
|
+
function taskId14(result) {
|
|
2067
2109
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2068
2110
|
const data = result?.data;
|
|
2069
2111
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2074,32 +2116,32 @@ var Seedream = class {
|
|
|
2074
2116
|
this.transport = transport;
|
|
2075
2117
|
}
|
|
2076
2118
|
transport;
|
|
2077
|
-
/**
|
|
2119
|
+
/** Call /seedream/images. */
|
|
2078
2120
|
async generate(options) {
|
|
2079
2121
|
const body = {};
|
|
2080
2122
|
body["model"] = options.model;
|
|
2081
|
-
body["prompt"] = options.prompt;
|
|
2082
|
-
if (options.seed !== void 0) body["seed"] = options.seed;
|
|
2083
|
-
if (options.size !== void 0) body["size"] = options.size;
|
|
2123
|
+
if (options.prompt !== void 0) body["prompt"] = options.prompt;
|
|
2084
2124
|
if (options.image !== void 0) body["image"] = options.image;
|
|
2085
|
-
if (options.
|
|
2125
|
+
if (options.size !== void 0) body["size"] = options.size;
|
|
2126
|
+
if (options.sequentialImageGeneration !== void 0) body["sequential_image_generation"] = options.sequentialImageGeneration;
|
|
2127
|
+
if (options.sequentialImageGenerationOptions !== void 0) body["sequential_image_generation_options"] = options.sequentialImageGenerationOptions;
|
|
2086
2128
|
if (options.stream !== void 0) body["stream"] = options.stream;
|
|
2129
|
+
if (options.responseFormat !== void 0) body["response_format"] = options.responseFormat;
|
|
2087
2130
|
if (options.watermark !== void 0) body["watermark"] = options.watermark;
|
|
2088
2131
|
if (options.outputFormat !== void 0) body["output_format"] = options.outputFormat;
|
|
2089
|
-
if (options.
|
|
2090
|
-
if (options.responseFormat !== void 0) body["response_format"] = options.responseFormat;
|
|
2132
|
+
if (options.tools !== void 0) body["tools"] = options.tools;
|
|
2091
2133
|
if (options.optimizePromptOptions !== void 0) body["optimize_prompt_options"] = options.optimizePromptOptions;
|
|
2092
|
-
if (options.
|
|
2093
|
-
if (options.
|
|
2134
|
+
if (options.layerDecomposition !== void 0) body["layer_decomposition"] = options.layerDecomposition;
|
|
2135
|
+
if (options.background !== void 0) body["background"] = options.background;
|
|
2094
2136
|
for (const [key, value] of Object.entries(options)) {
|
|
2095
|
-
if (!["async", "
|
|
2137
|
+
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) {
|
|
2096
2138
|
body[key] = value;
|
|
2097
2139
|
}
|
|
2098
2140
|
}
|
|
2099
2141
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2100
2142
|
body.async = options.async ?? true;
|
|
2101
2143
|
const result = await this.transport.request("POST", "/seedream/images", { json: body });
|
|
2102
|
-
const handle = new TaskHandle(
|
|
2144
|
+
const handle = new TaskHandle(taskId14(result), "/seedream/tasks", this.transport, result);
|
|
2103
2145
|
if (options.wait) {
|
|
2104
2146
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2105
2147
|
}
|
|
@@ -2108,7 +2150,7 @@ var Seedream = class {
|
|
|
2108
2150
|
};
|
|
2109
2151
|
|
|
2110
2152
|
// src/resources/providers/suno.ts
|
|
2111
|
-
function
|
|
2153
|
+
function taskId15(result) {
|
|
2112
2154
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2113
2155
|
const data = result?.data;
|
|
2114
2156
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2159,7 +2201,7 @@ var Suno = class {
|
|
|
2159
2201
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2160
2202
|
body.async = options.async ?? true;
|
|
2161
2203
|
const result = await this.transport.request("POST", "/suno/audios", { json: body });
|
|
2162
|
-
const handle = new TaskHandle(
|
|
2204
|
+
const handle = new TaskHandle(taskId15(result), "/suno/tasks", this.transport, result);
|
|
2163
2205
|
if (options.wait) {
|
|
2164
2206
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2165
2207
|
}
|
|
@@ -2234,7 +2276,7 @@ var Suno = class {
|
|
|
2234
2276
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2235
2277
|
body.async = options.async ?? true;
|
|
2236
2278
|
const result = await this.transport.request("POST", "/suno/vox", { json: body });
|
|
2237
|
-
const handle = new TaskHandle(
|
|
2279
|
+
const handle = new TaskHandle(taskId15(result), "/suno/tasks", this.transport, result);
|
|
2238
2280
|
if (options.wait) {
|
|
2239
2281
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2240
2282
|
}
|
|
@@ -2252,7 +2294,7 @@ var Suno = class {
|
|
|
2252
2294
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2253
2295
|
body.async = options.async ?? true;
|
|
2254
2296
|
const result = await this.transport.request("POST", "/suno/wav", { json: body });
|
|
2255
|
-
const handle = new TaskHandle(
|
|
2297
|
+
const handle = new TaskHandle(taskId15(result), "/suno/tasks", this.transport, result);
|
|
2256
2298
|
if (options.wait) {
|
|
2257
2299
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2258
2300
|
}
|
|
@@ -2270,7 +2312,7 @@ var Suno = class {
|
|
|
2270
2312
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2271
2313
|
body.async = options.async ?? true;
|
|
2272
2314
|
const result = await this.transport.request("POST", "/suno/midi", { json: body });
|
|
2273
|
-
const handle = new TaskHandle(
|
|
2315
|
+
const handle = new TaskHandle(taskId15(result), "/suno/tasks", this.transport, result);
|
|
2274
2316
|
if (options.wait) {
|
|
2275
2317
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2276
2318
|
}
|
|
@@ -2329,7 +2371,7 @@ var Suno = class {
|
|
|
2329
2371
|
};
|
|
2330
2372
|
|
|
2331
2373
|
// src/resources/providers/wan.ts
|
|
2332
|
-
function
|
|
2374
|
+
function taskId16(result) {
|
|
2333
2375
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2334
2376
|
const data = result?.data;
|
|
2335
2377
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2344,27 +2386,31 @@ var Wan = class {
|
|
|
2344
2386
|
async generate(options) {
|
|
2345
2387
|
const body = {};
|
|
2346
2388
|
body["model"] = options.model;
|
|
2347
|
-
body["action"] = options.action;
|
|
2348
|
-
body["prompt"] = options.prompt;
|
|
2349
|
-
if (options.size !== void 0) body["size"] = options.size;
|
|
2350
2389
|
body["audio"] = options.audio ?? false;
|
|
2351
|
-
if (options.duration !== void 0) body["duration"] = options.duration;
|
|
2352
|
-
if (options.audioUrl !== void 0) body["audio_url"] = options.audioUrl;
|
|
2353
|
-
if (options.imageUrl !== void 0) body["image_url"] = options.imageUrl;
|
|
2354
|
-
if (options.shotType !== void 0) body["shot_type"] = options.shotType;
|
|
2355
|
-
if (options.resolution !== void 0) body["resolution"] = options.resolution;
|
|
2356
2390
|
body["prompt_extend"] = options.promptExtend ?? false;
|
|
2391
|
+
body["action"] = options.action ?? "text2video";
|
|
2392
|
+
if (options.resolution !== void 0) body["resolution"] = options.resolution;
|
|
2393
|
+
if (options.shotType !== void 0) body["shot_type"] = options.shotType;
|
|
2394
|
+
if (options.duration !== void 0) body["duration"] = options.duration;
|
|
2395
|
+
if (options.prompt !== void 0) body["prompt"] = options.prompt;
|
|
2357
2396
|
if (options.negativePrompt !== void 0) body["negative_prompt"] = options.negativePrompt;
|
|
2397
|
+
if (options.size !== void 0) body["size"] = options.size;
|
|
2398
|
+
if (options.audioUrl !== void 0) body["audio_url"] = options.audioUrl;
|
|
2358
2399
|
if (options.referenceVideoUrls !== void 0) body["reference_video_urls"] = options.referenceVideoUrls;
|
|
2400
|
+
if (options.imageUrl !== void 0) body["image_url"] = options.imageUrl;
|
|
2401
|
+
if (options.media !== void 0) body["media"] = options.media;
|
|
2402
|
+
if (options.ratio !== void 0) body["ratio"] = options.ratio;
|
|
2403
|
+
if (options.seed !== void 0) body["seed"] = options.seed;
|
|
2404
|
+
body["watermark"] = options.watermark ?? false;
|
|
2359
2405
|
for (const [key, value] of Object.entries(options)) {
|
|
2360
|
-
if (!["action", "async", "audio", "audioUrl", "callbackUrl", "duration", "imageUrl", "maxWait", "model", "negativePrompt", "pollInterval", "prompt", "promptExtend", "referenceVideoUrls", "resolution", "shotType", "size", "wait"].includes(key) && value !== void 0) {
|
|
2406
|
+
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) {
|
|
2361
2407
|
body[key] = value;
|
|
2362
2408
|
}
|
|
2363
2409
|
}
|
|
2364
2410
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2365
2411
|
body.async = options.async ?? true;
|
|
2366
2412
|
const result = await this.transport.request("POST", "/wan/videos", { json: body });
|
|
2367
|
-
const handle = new TaskHandle(
|
|
2413
|
+
const handle = new TaskHandle(taskId16(result), "/wan/tasks", this.transport, result);
|
|
2368
2414
|
if (options.wait) {
|
|
2369
2415
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2370
2416
|
}
|
|
@@ -2386,6 +2432,7 @@ function attachProviders(client, transport) {
|
|
|
2386
2432
|
client.minimax = new Minimax(transport);
|
|
2387
2433
|
client.nanobanana = new NanoBanana(transport);
|
|
2388
2434
|
client.producer = new Producer(transport);
|
|
2435
|
+
client.qwenimage = new QwenImage(transport);
|
|
2389
2436
|
client.seedance = new Seedance(transport);
|
|
2390
2437
|
client.seedream = new Seedream(transport);
|
|
2391
2438
|
client.suno = new Suno(transport);
|