@acedatacloud/sdk 2026.810.0 → 2026.814.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 +62 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -58
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/resources/providers/maestro.ts +43 -41
- package/src/resources/providers/seedance.ts +32 -23
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: taskId16, ...rest } = opts;
|
|
483
483
|
return this.transport.request("POST", "/captcha/tasks", {
|
|
484
|
-
json: { task_id:
|
|
484
|
+
json: { task_id: taskId16, ...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(taskId16, pollEndpoint, transport, submitted) {
|
|
593
|
+
this.id = taskId16;
|
|
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 taskId16 = result.task_id;
|
|
672
|
+
if (!taskId16 || result.data && !shouldWait) return result;
|
|
673
|
+
const handle = new TaskHandle(taskId16, `/${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 taskId16 = result.task_id;
|
|
720
|
+
if (!taskId16 || result.data && !shouldWait) return result;
|
|
721
|
+
const handle = new TaskHandle(taskId16, `/${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 taskId16 = result.task_id;
|
|
741
|
+
if (!taskId16 || result.data && !shouldWait) return result;
|
|
742
|
+
const handle = new TaskHandle(taskId16, `/${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(taskId16, 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: taskId16, action: "retrieve" }
|
|
794
794
|
});
|
|
795
795
|
}
|
|
796
|
-
async wait(
|
|
796
|
+
async wait(taskId16, 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(taskId16, endpoint, this.transport);
|
|
800
800
|
return handle.wait({ pollInterval: opts.pollInterval, maxWait: opts.maxWait });
|
|
801
801
|
}
|
|
802
802
|
};
|
|
@@ -1759,48 +1759,49 @@ var Luma = class {
|
|
|
1759
1759
|
};
|
|
1760
1760
|
|
|
1761
1761
|
// src/resources/providers/maestro.ts
|
|
1762
|
+
function taskId8(result) {
|
|
1763
|
+
if (typeof result?.task_id === "string") return result.task_id;
|
|
1764
|
+
const data = result?.data;
|
|
1765
|
+
if (data && typeof data.task_id === "string") return data.task_id;
|
|
1766
|
+
return typeof result?.id === "string" ? result.id : "";
|
|
1767
|
+
}
|
|
1762
1768
|
var Maestro = class {
|
|
1763
1769
|
constructor(transport) {
|
|
1764
1770
|
this.transport = transport;
|
|
1765
1771
|
}
|
|
1766
1772
|
transport;
|
|
1767
|
-
/**
|
|
1773
|
+
/** Call /maestro/videos. */
|
|
1768
1774
|
async generate(options) {
|
|
1769
1775
|
const body = {};
|
|
1770
1776
|
body["prompt"] = options.prompt;
|
|
1771
|
-
body["langs"] = options.langs ?? ["zh-cn"];
|
|
1772
|
-
body["style"] = options.style ?? "auto";
|
|
1773
|
-
body["voice"] = options.voice ?? "auto";
|
|
1774
1777
|
body["action"] = options.action ?? "generate";
|
|
1778
|
+
if (options.refTaskId !== void 0) body["ref_task_id"] = options.refTaskId;
|
|
1779
|
+
if (options.fileUrls !== void 0) body["file_urls"] = options.fileUrls;
|
|
1780
|
+
body["langs"] = options.langs ?? ["zh-cn"];
|
|
1775
1781
|
body["aspect"] = options.aspect ?? "9:16";
|
|
1776
|
-
body["quality"] = options.quality ?? "standard";
|
|
1777
1782
|
body["duration"] = options.duration ?? 30;
|
|
1783
|
+
body["quality"] = options.quality ?? "standard";
|
|
1778
1784
|
body["scenario"] = options.scenario ?? "auto";
|
|
1779
|
-
|
|
1780
|
-
|
|
1785
|
+
body["style"] = options.style ?? "auto";
|
|
1786
|
+
body["voice"] = options.voice ?? "auto";
|
|
1781
1787
|
for (const [key, value] of Object.entries(options)) {
|
|
1782
1788
|
if (!["action", "aspect", "async", "callbackUrl", "duration", "fileUrls", "langs", "maxWait", "pollInterval", "prompt", "quality", "refTaskId", "scenario", "style", "voice", "wait"].includes(key) && value !== void 0) {
|
|
1783
1789
|
body[key] = value;
|
|
1784
1790
|
}
|
|
1785
1791
|
}
|
|
1786
1792
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
for (const [key, value] of Object.entries(options)) {
|
|
1793
|
-
if (!["async", "callbackUrl", "maxWait", "pollInterval", "wait"].includes(key) && value !== void 0) {
|
|
1794
|
-
body[key] = value;
|
|
1795
|
-
}
|
|
1793
|
+
body.async = options.async ?? true;
|
|
1794
|
+
const result = await this.transport.request("POST", "/maestro/videos", { json: body });
|
|
1795
|
+
const handle = new TaskHandle(taskId8(result), "/maestro/tasks", this.transport, result);
|
|
1796
|
+
if (options.wait) {
|
|
1797
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1796
1798
|
}
|
|
1797
|
-
|
|
1798
|
-
return await this.transport.request("POST", "/maestro/estimates", { json: body });
|
|
1799
|
+
return handle;
|
|
1799
1800
|
}
|
|
1800
1801
|
};
|
|
1801
1802
|
|
|
1802
1803
|
// src/resources/providers/minimax.ts
|
|
1803
|
-
function
|
|
1804
|
+
function taskId9(result) {
|
|
1804
1805
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1805
1806
|
const data = result?.data;
|
|
1806
1807
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1827,7 +1828,7 @@ var Minimax = class {
|
|
|
1827
1828
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1828
1829
|
body.async = options.async ?? true;
|
|
1829
1830
|
const result = await this.transport.request("POST", "/minimax/videos", { json: body });
|
|
1830
|
-
const handle = new TaskHandle(
|
|
1831
|
+
const handle = new TaskHandle(taskId9(result), "/minimax/tasks", this.transport, result);
|
|
1831
1832
|
if (options.wait) {
|
|
1832
1833
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1833
1834
|
}
|
|
@@ -1836,7 +1837,7 @@ var Minimax = class {
|
|
|
1836
1837
|
};
|
|
1837
1838
|
|
|
1838
1839
|
// src/resources/providers/nano-banana.ts
|
|
1839
|
-
function
|
|
1840
|
+
function taskId10(result) {
|
|
1840
1841
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1841
1842
|
const data = result?.data;
|
|
1842
1843
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1865,7 +1866,7 @@ var NanoBanana = class {
|
|
|
1865
1866
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1866
1867
|
body.async = options.async ?? true;
|
|
1867
1868
|
const result = await this.transport.request("POST", "/nano-banana/images", { json: body });
|
|
1868
|
-
const handle = new TaskHandle(
|
|
1869
|
+
const handle = new TaskHandle(taskId10(result), "/nano-banana/tasks", this.transport, result);
|
|
1869
1870
|
if (options.wait) {
|
|
1870
1871
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1871
1872
|
}
|
|
@@ -1874,7 +1875,7 @@ var NanoBanana = class {
|
|
|
1874
1875
|
};
|
|
1875
1876
|
|
|
1876
1877
|
// src/resources/providers/producer.ts
|
|
1877
|
-
function
|
|
1878
|
+
function taskId11(result) {
|
|
1878
1879
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1879
1880
|
const data = result?.data;
|
|
1880
1881
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1947,7 +1948,7 @@ var Producer = class {
|
|
|
1947
1948
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1948
1949
|
body.async = options.async ?? true;
|
|
1949
1950
|
const result = await this.transport.request("POST", "/producer/audios", { json: body });
|
|
1950
|
-
const handle = new TaskHandle(
|
|
1951
|
+
const handle = new TaskHandle(taskId11(result), "/producer/tasks", this.transport, result);
|
|
1951
1952
|
if (options.wait) {
|
|
1952
1953
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1953
1954
|
}
|
|
@@ -1968,7 +1969,7 @@ var Producer = class {
|
|
|
1968
1969
|
};
|
|
1969
1970
|
|
|
1970
1971
|
// src/resources/providers/seedance.ts
|
|
1971
|
-
function
|
|
1972
|
+
function taskId12(result) {
|
|
1972
1973
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1973
1974
|
const data = result?.data;
|
|
1974
1975
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1979,30 +1980,33 @@ var Seedance = class {
|
|
|
1979
1980
|
this.transport = transport;
|
|
1980
1981
|
}
|
|
1981
1982
|
transport;
|
|
1982
|
-
/**
|
|
1983
|
+
/** Call /seedance/videos. */
|
|
1983
1984
|
async generate(options) {
|
|
1984
1985
|
const body = {};
|
|
1985
1986
|
body["model"] = options.model;
|
|
1986
1987
|
body["content"] = options.content;
|
|
1987
|
-
if (options.
|
|
1988
|
+
if (options.resolution !== void 0) body["resolution"] = options.resolution;
|
|
1988
1989
|
body["ratio"] = options.ratio ?? "16:9";
|
|
1989
|
-
if (options.frames !== void 0) body["frames"] = options.frames;
|
|
1990
1990
|
if (options.duration !== void 0) body["duration"] = options.duration;
|
|
1991
|
-
if (options.
|
|
1992
|
-
if (options.
|
|
1991
|
+
if (options.frames !== void 0) body["frames"] = options.frames;
|
|
1992
|
+
if (options.seed !== void 0) body["seed"] = options.seed;
|
|
1993
1993
|
if (options.camerafixed !== void 0) body["camerafixed"] = options.camerafixed;
|
|
1994
|
+
if (options.watermark !== void 0) body["watermark"] = options.watermark;
|
|
1994
1995
|
body["generate_audio"] = options.generateAudio ?? false;
|
|
1995
1996
|
body["return_last_frame"] = options.returnLastFrame ?? false;
|
|
1996
1997
|
body["execution_expires_after"] = options.executionExpiresAfter ?? 172800;
|
|
1998
|
+
if (options.omniReferenceTaskType !== void 0) body["omni_reference_task_type"] = options.omniReferenceTaskType;
|
|
1999
|
+
if (options.outputFormat !== void 0) body["output_format"] = options.outputFormat;
|
|
2000
|
+
if (options.tools !== void 0) body["tools"] = options.tools;
|
|
1997
2001
|
for (const [key, value] of Object.entries(options)) {
|
|
1998
|
-
if (!["async", "callbackUrl", "camerafixed", "content", "duration", "executionExpiresAfter", "frames", "generateAudio", "maxWait", "model", "pollInterval", "ratio", "resolution", "returnLastFrame", "seed", "wait", "watermark"].includes(key) && value !== void 0) {
|
|
2002
|
+
if (!["async", "callbackUrl", "camerafixed", "content", "duration", "executionExpiresAfter", "frames", "generateAudio", "maxWait", "model", "omniReferenceTaskType", "outputFormat", "pollInterval", "ratio", "resolution", "returnLastFrame", "seed", "tools", "wait", "watermark"].includes(key) && value !== void 0) {
|
|
1999
2003
|
body[key] = value;
|
|
2000
2004
|
}
|
|
2001
2005
|
}
|
|
2002
2006
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2003
2007
|
body.async = options.async ?? true;
|
|
2004
2008
|
const result = await this.transport.request("POST", "/seedance/videos", { json: body });
|
|
2005
|
-
const handle = new TaskHandle(
|
|
2009
|
+
const handle = new TaskHandle(taskId12(result), "/seedance/tasks", this.transport, result);
|
|
2006
2010
|
if (options.wait) {
|
|
2007
2011
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2008
2012
|
}
|
|
@@ -2011,7 +2015,7 @@ var Seedance = class {
|
|
|
2011
2015
|
};
|
|
2012
2016
|
|
|
2013
2017
|
// src/resources/providers/seedream.ts
|
|
2014
|
-
function
|
|
2018
|
+
function taskId13(result) {
|
|
2015
2019
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2016
2020
|
const data = result?.data;
|
|
2017
2021
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2047,7 +2051,7 @@ var Seedream = class {
|
|
|
2047
2051
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2048
2052
|
body.async = options.async ?? true;
|
|
2049
2053
|
const result = await this.transport.request("POST", "/seedream/images", { json: body });
|
|
2050
|
-
const handle = new TaskHandle(
|
|
2054
|
+
const handle = new TaskHandle(taskId13(result), "/seedream/tasks", this.transport, result);
|
|
2051
2055
|
if (options.wait) {
|
|
2052
2056
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2053
2057
|
}
|
|
@@ -2056,7 +2060,7 @@ var Seedream = class {
|
|
|
2056
2060
|
};
|
|
2057
2061
|
|
|
2058
2062
|
// src/resources/providers/suno.ts
|
|
2059
|
-
function
|
|
2063
|
+
function taskId14(result) {
|
|
2060
2064
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2061
2065
|
const data = result?.data;
|
|
2062
2066
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2107,7 +2111,7 @@ var Suno = class {
|
|
|
2107
2111
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2108
2112
|
body.async = options.async ?? true;
|
|
2109
2113
|
const result = await this.transport.request("POST", "/suno/audios", { json: body });
|
|
2110
|
-
const handle = new TaskHandle(
|
|
2114
|
+
const handle = new TaskHandle(taskId14(result), "/suno/tasks", this.transport, result);
|
|
2111
2115
|
if (options.wait) {
|
|
2112
2116
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2113
2117
|
}
|
|
@@ -2182,7 +2186,7 @@ var Suno = class {
|
|
|
2182
2186
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2183
2187
|
body.async = options.async ?? true;
|
|
2184
2188
|
const result = await this.transport.request("POST", "/suno/vox", { json: body });
|
|
2185
|
-
const handle = new TaskHandle(
|
|
2189
|
+
const handle = new TaskHandle(taskId14(result), "/suno/tasks", this.transport, result);
|
|
2186
2190
|
if (options.wait) {
|
|
2187
2191
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2188
2192
|
}
|
|
@@ -2200,7 +2204,7 @@ var Suno = class {
|
|
|
2200
2204
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2201
2205
|
body.async = options.async ?? true;
|
|
2202
2206
|
const result = await this.transport.request("POST", "/suno/wav", { json: body });
|
|
2203
|
-
const handle = new TaskHandle(
|
|
2207
|
+
const handle = new TaskHandle(taskId14(result), "/suno/tasks", this.transport, result);
|
|
2204
2208
|
if (options.wait) {
|
|
2205
2209
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2206
2210
|
}
|
|
@@ -2218,7 +2222,7 @@ var Suno = class {
|
|
|
2218
2222
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2219
2223
|
body.async = options.async ?? true;
|
|
2220
2224
|
const result = await this.transport.request("POST", "/suno/midi", { json: body });
|
|
2221
|
-
const handle = new TaskHandle(
|
|
2225
|
+
const handle = new TaskHandle(taskId14(result), "/suno/tasks", this.transport, result);
|
|
2222
2226
|
if (options.wait) {
|
|
2223
2227
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2224
2228
|
}
|
|
@@ -2277,7 +2281,7 @@ var Suno = class {
|
|
|
2277
2281
|
};
|
|
2278
2282
|
|
|
2279
2283
|
// src/resources/providers/wan.ts
|
|
2280
|
-
function
|
|
2284
|
+
function taskId15(result) {
|
|
2281
2285
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2282
2286
|
const data = result?.data;
|
|
2283
2287
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2312,7 +2316,7 @@ var Wan = class {
|
|
|
2312
2316
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2313
2317
|
body.async = options.async ?? true;
|
|
2314
2318
|
const result = await this.transport.request("POST", "/wan/videos", { json: body });
|
|
2315
|
-
const handle = new TaskHandle(
|
|
2319
|
+
const handle = new TaskHandle(taskId15(result), "/wan/tasks", this.transport, result);
|
|
2316
2320
|
if (options.wait) {
|
|
2317
2321
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2318
2322
|
}
|