@acedatacloud/sdk 2026.814.0 → 2026.824.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 +102 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +102 -55
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/resources/providers/digitalhuman.ts +1 -1
- package/src/resources/providers/fish.ts +2 -2
- package/src/resources/providers/flux.ts +3 -3
- package/src/resources/providers/hailuo.ts +1 -1
- package/src/resources/providers/happyhorse.ts +3 -3
- package/src/resources/providers/index.ts +3 -0
- package/src/resources/providers/luma.ts +3 -3
- package/src/resources/providers/minimax.ts +11 -9
- package/src/resources/providers/nano-banana.ts +1 -1
- package/src/resources/providers/qwen-image.ts +86 -0
- package/src/resources/providers/seedance.ts +1 -1
- package/src/resources/providers/seedream.ts +1 -1
- package/src/resources/providers/suno.ts +5 -5
- 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
|
};
|
|
@@ -1478,7 +1478,7 @@ var Digitalhuman = class {
|
|
|
1478
1478
|
async generate(options) {
|
|
1479
1479
|
const body = {};
|
|
1480
1480
|
body["video_url"] = options.videoUrl;
|
|
1481
|
-
body["text"] = options.text
|
|
1481
|
+
if (options.text !== void 0) body["text"] = options.text;
|
|
1482
1482
|
body["speed"] = options.speed ?? 1;
|
|
1483
1483
|
body["steps"] = options.steps ?? 40;
|
|
1484
1484
|
body["engine"] = options.engine ?? "latentsync";
|
|
@@ -1587,7 +1587,7 @@ var Fish = class {
|
|
|
1587
1587
|
if (options.temperature !== void 0) body["temperature"] = options.temperature;
|
|
1588
1588
|
if (options.chunkLength !== void 0) body["chunk_length"] = options.chunkLength;
|
|
1589
1589
|
if (options.opusBitrate !== void 0) body["opus_bitrate"] = options.opusBitrate;
|
|
1590
|
-
body["reference_id"] = options.referenceId
|
|
1590
|
+
if (options.referenceId !== void 0) body["reference_id"] = options.referenceId;
|
|
1591
1591
|
if (options.maxNewTokens !== void 0) body["max_new_tokens"] = options.maxNewTokens;
|
|
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;
|
|
@@ -1642,9 +1642,9 @@ var Flux = class {
|
|
|
1642
1642
|
/** Flux AI image generation API, generates 1 image per request. */
|
|
1643
1643
|
async generate(options) {
|
|
1644
1644
|
const body = {};
|
|
1645
|
+
body["size"] = options.size;
|
|
1645
1646
|
body["action"] = options.action;
|
|
1646
1647
|
body["prompt"] = options.prompt;
|
|
1647
|
-
body["size"] = options.size ?? "1024x1024";
|
|
1648
1648
|
if (options.count !== void 0) body["count"] = options.count;
|
|
1649
1649
|
if (options.model !== void 0) body["model"] = options.model;
|
|
1650
1650
|
if (options.imageUrl !== void 0) body["image_url"] = options.imageUrl;
|
|
@@ -1681,7 +1681,7 @@ var Hailuo = class {
|
|
|
1681
1681
|
const body = {};
|
|
1682
1682
|
body["action"] = options.action;
|
|
1683
1683
|
if (options.model !== void 0) body["model"] = options.model;
|
|
1684
|
-
body["prompt"] = options.prompt
|
|
1684
|
+
if (options.prompt !== void 0) body["prompt"] = options.prompt;
|
|
1685
1685
|
if (options.firstImageUrl !== void 0) body["first_image_url"] = options.firstImageUrl;
|
|
1686
1686
|
for (const [key, value] of Object.entries(options)) {
|
|
1687
1687
|
if (!["action", "async", "callbackUrl", "firstImageUrl", "maxWait", "model", "pollInterval", "prompt", "wait"].includes(key) && value !== void 0) {
|
|
@@ -1718,10 +1718,10 @@ var Happyhorse = class {
|
|
|
1718
1718
|
body["model"] = options.model ?? "happyhorse-1.1-t2v";
|
|
1719
1719
|
body["ratio"] = options.ratio ?? "16:9";
|
|
1720
1720
|
body["action"] = options.action ?? "generate";
|
|
1721
|
-
body["prompt"] = options.prompt
|
|
1721
|
+
if (options.prompt !== void 0) body["prompt"] = options.prompt;
|
|
1722
1722
|
body["duration"] = options.duration ?? 5;
|
|
1723
|
-
body["image_url"] = options.imageUrl
|
|
1724
|
-
body["video_url"] = options.videoUrl
|
|
1723
|
+
if (options.imageUrl !== void 0) body["image_url"] = options.imageUrl;
|
|
1724
|
+
if (options.videoUrl !== void 0) body["video_url"] = options.videoUrl;
|
|
1725
1725
|
body["watermark"] = options.watermark ?? false;
|
|
1726
1726
|
if (options.imageUrls !== void 0) body["image_urls"] = options.imageUrls;
|
|
1727
1727
|
body["resolution"] = options.resolution ?? "1080P";
|
|
@@ -1782,14 +1782,14 @@ var Luma = class {
|
|
|
1782
1782
|
const body = {};
|
|
1783
1783
|
body["loop"] = options.loop ?? false;
|
|
1784
1784
|
body["action"] = options.action ?? "generate";
|
|
1785
|
-
body["prompt"] = options.prompt
|
|
1785
|
+
if (options.prompt !== void 0) body["prompt"] = options.prompt;
|
|
1786
1786
|
body["timeout"] = options.timeout ?? 300;
|
|
1787
1787
|
if (options.videoId !== void 0) body["video_id"] = options.videoId;
|
|
1788
1788
|
if (options.videoUrl !== void 0) body["video_url"] = options.videoUrl;
|
|
1789
1789
|
body["enhancement"] = options.enhancement ?? true;
|
|
1790
1790
|
if (options.aspectRatio !== void 0) body["aspect_ratio"] = options.aspectRatio;
|
|
1791
|
-
body["end_image_url"] = options.endImageUrl
|
|
1792
|
-
body["start_image_url"] = options.startImageUrl
|
|
1791
|
+
if (options.endImageUrl !== void 0) body["end_image_url"] = options.endImageUrl;
|
|
1792
|
+
if (options.startImageUrl !== void 0) body["start_image_url"] = options.startImageUrl;
|
|
1793
1793
|
for (const [key, value] of Object.entries(options)) {
|
|
1794
1794
|
if (!["action", "aspectRatio", "async", "callbackUrl", "endImageUrl", "enhancement", "loop", "maxWait", "pollInterval", "prompt", "startImageUrl", "timeout", "videoId", "videoUrl", "wait"].includes(key) && value !== void 0) {
|
|
1795
1795
|
body[key] = value;
|
|
@@ -1860,13 +1860,13 @@ var Minimax = class {
|
|
|
1860
1860
|
this.transport = transport;
|
|
1861
1861
|
}
|
|
1862
1862
|
transport;
|
|
1863
|
-
/**
|
|
1863
|
+
/** Call /minimax/videos. */
|
|
1864
1864
|
async generate(options) {
|
|
1865
1865
|
const body = {};
|
|
1866
1866
|
body["model"] = options.model;
|
|
1867
1867
|
body["content"] = options.content;
|
|
1868
|
-
body["resolution"] = options.resolution;
|
|
1869
1868
|
body["duration"] = options.duration;
|
|
1869
|
+
body["resolution"] = options.resolution;
|
|
1870
1870
|
if (options.ratio !== void 0) body["ratio"] = options.ratio;
|
|
1871
1871
|
for (const [key, value] of Object.entries(options)) {
|
|
1872
1872
|
if (!["async", "callbackUrl", "content", "duration", "maxWait", "model", "pollInterval", "ratio", "resolution", "wait"].includes(key) && value !== void 0) {
|
|
@@ -1905,7 +1905,7 @@ var NanoBanana = class {
|
|
|
1905
1905
|
if (options.model !== void 0) body["model"] = options.model;
|
|
1906
1906
|
if (options.imageUrls !== void 0) body["image_urls"] = options.imageUrls;
|
|
1907
1907
|
if (options.resolution !== void 0) body["resolution"] = options.resolution;
|
|
1908
|
-
body["aspect_ratio"] = options.aspectRatio
|
|
1908
|
+
if (options.aspectRatio !== void 0) body["aspect_ratio"] = options.aspectRatio;
|
|
1909
1909
|
for (const [key, value] of Object.entries(options)) {
|
|
1910
1910
|
if (!["action", "aspectRatio", "async", "callbackUrl", "count", "imageUrls", "maxWait", "model", "pollInterval", "prompt", "resolution", "wait"].includes(key) && value !== void 0) {
|
|
1911
1911
|
body[key] = value;
|
|
@@ -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;
|
|
@@ -2099,7 +2141,7 @@ var Seedream = class {
|
|
|
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;
|
|
@@ -2123,16 +2165,16 @@ var Suno = class {
|
|
|
2123
2165
|
async generate(options = {}) {
|
|
2124
2166
|
const body = {};
|
|
2125
2167
|
if (options.lyric !== void 0) body["lyric"] = options.lyric;
|
|
2126
|
-
body["model"] = options.model
|
|
2168
|
+
if (options.model !== void 0) body["model"] = options.model;
|
|
2127
2169
|
if (options.style !== void 0) body["style"] = options.style;
|
|
2128
2170
|
if (options.title !== void 0) body["title"] = options.title;
|
|
2129
|
-
body["action"] = options.action
|
|
2171
|
+
if (options.action !== void 0) body["action"] = options.action;
|
|
2130
2172
|
if (options.custom !== void 0) body["custom"] = options.custom;
|
|
2131
|
-
body["prompt"] = options.prompt
|
|
2173
|
+
if (options.prompt !== void 0) body["prompt"] = options.prompt;
|
|
2132
2174
|
if (options.audioId !== void 0) body["audio_id"] = options.audioId;
|
|
2133
2175
|
if (options.duration !== void 0) body["duration"] = options.duration;
|
|
2134
2176
|
if (options.weirdness !== void 0) body["weirdness"] = options.weirdness;
|
|
2135
|
-
body["audio_urls"] = options.audioUrls
|
|
2177
|
+
if (options.audioUrls !== void 0) body["audio_urls"] = options.audioUrls;
|
|
2136
2178
|
if (options.personaId !== void 0) body["persona_id"] = options.personaId;
|
|
2137
2179
|
if (options.continueAt !== void 0) body["continue_at"] = options.continueAt;
|
|
2138
2180
|
if (options.samplesEnd !== void 0) body["samples_end"] = options.samplesEnd;
|
|
@@ -2152,14 +2194,14 @@ var Suno = class {
|
|
|
2152
2194
|
if (options.underpaintingStart !== void 0) body["underpainting_start"] = options.underpaintingStart;
|
|
2153
2195
|
if (options.replaceSectionStart !== void 0) body["replace_section_start"] = options.replaceSectionStart;
|
|
2154
2196
|
for (const [key, value] of Object.entries(options)) {
|
|
2155
|
-
if (!["action", "async", "audioId", "audioUrls", "audioWeight", "callbackUrl", "continueAt", "custom", "duration", "instrumental", "lyric", "lyricPrompt", "mashupAudioIds", "maxWait", "model", "overpaintingEnd", "overpaintingStart", "personaId", "pollInterval", "prompt", "replaceSectionEnd", "replaceSectionStart", "samplesEnd", "samplesStart", "style", "styleInfluence", "
|
|
2197
|
+
if (!["action", "async", "audioId", "audioUrls", "audioWeight", "callbackUrl", "continueAt", "custom", "duration", "instrumental", "lyric", "lyricPrompt", "mashupAudioIds", "maxWait", "model", "negativeTags", "overpaintingEnd", "overpaintingStart", "personaId", "pollInterval", "prompt", "replaceSectionEnd", "replaceSectionStart", "samplesEnd", "samplesStart", "style", "styleInfluence", "title", "underpaintingEnd", "underpaintingStart", "variationCategory", "vocalGender", "wait", "weirdness"].includes(key) && value !== void 0) {
|
|
2156
2198
|
body[key] = value;
|
|
2157
2199
|
}
|
|
2158
2200
|
}
|
|
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;
|
|
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;
|
|
2351
2394
|
if (options.duration !== void 0) body["duration"] = options.duration;
|
|
2395
|
+
if (options.prompt !== void 0) body["prompt"] = options.prompt;
|
|
2396
|
+
if (options.negativePrompt !== void 0) body["negative_prompt"] = options.negativePrompt;
|
|
2397
|
+
if (options.size !== void 0) body["size"] = options.size;
|
|
2352
2398
|
if (options.audioUrl !== void 0) body["audio_url"] = options.audioUrl;
|
|
2353
|
-
body["image_url"] = options.imageUrl ?? "https://cdn.acedata.cloud/r9vsv9.png";
|
|
2354
|
-
if (options.shotType !== void 0) body["shot_type"] = options.shotType;
|
|
2355
|
-
if (options.resolution !== void 0) body["resolution"] = options.resolution;
|
|
2356
|
-
body["prompt_extend"] = options.promptExtend ?? false;
|
|
2357
|
-
body["negative_prompt"] = options.negativePrompt ?? "Astronauts shuttle from space to volcano";
|
|
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);
|