@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.js
CHANGED
|
@@ -527,9 +527,9 @@ var Tasks = class {
|
|
|
527
527
|
}
|
|
528
528
|
transport;
|
|
529
529
|
retrieve(opts) {
|
|
530
|
-
const { taskId:
|
|
530
|
+
const { taskId: taskId16, ...rest } = opts;
|
|
531
531
|
return this.transport.request("POST", "/captcha/tasks", {
|
|
532
|
-
json: { task_id:
|
|
532
|
+
json: { task_id: taskId16, ...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(taskId16, pollEndpoint, transport, submitted) {
|
|
641
|
+
this.id = taskId16;
|
|
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 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
|
}
|
|
@@ -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 taskId16 = result.task_id;
|
|
768
|
+
if (!taskId16 || result.data && !shouldWait) return result;
|
|
769
|
+
const handle = new TaskHandle(taskId16, `/${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 taskId16 = result.task_id;
|
|
789
|
+
if (!taskId16 || result.data && !shouldWait) return result;
|
|
790
|
+
const handle = new TaskHandle(taskId16, `/${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(taskId16, 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: taskId16, action: "retrieve" }
|
|
842
842
|
});
|
|
843
843
|
}
|
|
844
|
-
async wait(
|
|
844
|
+
async wait(taskId16, 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(taskId16, endpoint, this.transport);
|
|
848
848
|
return handle.wait({ pollInterval: opts.pollInterval, maxWait: opts.maxWait });
|
|
849
849
|
}
|
|
850
850
|
};
|
|
@@ -1807,48 +1807,49 @@ var Luma = class {
|
|
|
1807
1807
|
};
|
|
1808
1808
|
|
|
1809
1809
|
// src/resources/providers/maestro.ts
|
|
1810
|
+
function taskId8(result) {
|
|
1811
|
+
if (typeof result?.task_id === "string") return result.task_id;
|
|
1812
|
+
const data = result?.data;
|
|
1813
|
+
if (data && typeof data.task_id === "string") return data.task_id;
|
|
1814
|
+
return typeof result?.id === "string" ? result.id : "";
|
|
1815
|
+
}
|
|
1810
1816
|
var Maestro = class {
|
|
1811
1817
|
constructor(transport) {
|
|
1812
1818
|
this.transport = transport;
|
|
1813
1819
|
}
|
|
1814
1820
|
transport;
|
|
1815
|
-
/**
|
|
1821
|
+
/** Call /maestro/videos. */
|
|
1816
1822
|
async generate(options) {
|
|
1817
1823
|
const body = {};
|
|
1818
1824
|
body["prompt"] = options.prompt;
|
|
1819
|
-
body["langs"] = options.langs ?? ["zh-cn"];
|
|
1820
|
-
body["style"] = options.style ?? "auto";
|
|
1821
|
-
body["voice"] = options.voice ?? "auto";
|
|
1822
1825
|
body["action"] = options.action ?? "generate";
|
|
1826
|
+
if (options.refTaskId !== void 0) body["ref_task_id"] = options.refTaskId;
|
|
1827
|
+
if (options.fileUrls !== void 0) body["file_urls"] = options.fileUrls;
|
|
1828
|
+
body["langs"] = options.langs ?? ["zh-cn"];
|
|
1823
1829
|
body["aspect"] = options.aspect ?? "9:16";
|
|
1824
|
-
body["quality"] = options.quality ?? "standard";
|
|
1825
1830
|
body["duration"] = options.duration ?? 30;
|
|
1831
|
+
body["quality"] = options.quality ?? "standard";
|
|
1826
1832
|
body["scenario"] = options.scenario ?? "auto";
|
|
1827
|
-
|
|
1828
|
-
|
|
1833
|
+
body["style"] = options.style ?? "auto";
|
|
1834
|
+
body["voice"] = options.voice ?? "auto";
|
|
1829
1835
|
for (const [key, value] of Object.entries(options)) {
|
|
1830
1836
|
if (!["action", "aspect", "async", "callbackUrl", "duration", "fileUrls", "langs", "maxWait", "pollInterval", "prompt", "quality", "refTaskId", "scenario", "style", "voice", "wait"].includes(key) && value !== void 0) {
|
|
1831
1837
|
body[key] = value;
|
|
1832
1838
|
}
|
|
1833
1839
|
}
|
|
1834
1840
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
for (const [key, value] of Object.entries(options)) {
|
|
1841
|
-
if (!["async", "callbackUrl", "maxWait", "pollInterval", "wait"].includes(key) && value !== void 0) {
|
|
1842
|
-
body[key] = value;
|
|
1843
|
-
}
|
|
1841
|
+
body.async = options.async ?? true;
|
|
1842
|
+
const result = await this.transport.request("POST", "/maestro/videos", { json: body });
|
|
1843
|
+
const handle = new TaskHandle(taskId8(result), "/maestro/tasks", this.transport, result);
|
|
1844
|
+
if (options.wait) {
|
|
1845
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1844
1846
|
}
|
|
1845
|
-
|
|
1846
|
-
return await this.transport.request("POST", "/maestro/estimates", { json: body });
|
|
1847
|
+
return handle;
|
|
1847
1848
|
}
|
|
1848
1849
|
};
|
|
1849
1850
|
|
|
1850
1851
|
// src/resources/providers/minimax.ts
|
|
1851
|
-
function
|
|
1852
|
+
function taskId9(result) {
|
|
1852
1853
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1853
1854
|
const data = result?.data;
|
|
1854
1855
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1875,7 +1876,7 @@ var Minimax = class {
|
|
|
1875
1876
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1876
1877
|
body.async = options.async ?? true;
|
|
1877
1878
|
const result = await this.transport.request("POST", "/minimax/videos", { json: body });
|
|
1878
|
-
const handle = new TaskHandle(
|
|
1879
|
+
const handle = new TaskHandle(taskId9(result), "/minimax/tasks", this.transport, result);
|
|
1879
1880
|
if (options.wait) {
|
|
1880
1881
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1881
1882
|
}
|
|
@@ -1884,7 +1885,7 @@ var Minimax = class {
|
|
|
1884
1885
|
};
|
|
1885
1886
|
|
|
1886
1887
|
// src/resources/providers/nano-banana.ts
|
|
1887
|
-
function
|
|
1888
|
+
function taskId10(result) {
|
|
1888
1889
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1889
1890
|
const data = result?.data;
|
|
1890
1891
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1913,7 +1914,7 @@ var NanoBanana = class {
|
|
|
1913
1914
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1914
1915
|
body.async = options.async ?? true;
|
|
1915
1916
|
const result = await this.transport.request("POST", "/nano-banana/images", { json: body });
|
|
1916
|
-
const handle = new TaskHandle(
|
|
1917
|
+
const handle = new TaskHandle(taskId10(result), "/nano-banana/tasks", this.transport, result);
|
|
1917
1918
|
if (options.wait) {
|
|
1918
1919
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1919
1920
|
}
|
|
@@ -1922,7 +1923,7 @@ var NanoBanana = class {
|
|
|
1922
1923
|
};
|
|
1923
1924
|
|
|
1924
1925
|
// src/resources/providers/producer.ts
|
|
1925
|
-
function
|
|
1926
|
+
function taskId11(result) {
|
|
1926
1927
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1927
1928
|
const data = result?.data;
|
|
1928
1929
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1995,7 +1996,7 @@ var Producer = class {
|
|
|
1995
1996
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1996
1997
|
body.async = options.async ?? true;
|
|
1997
1998
|
const result = await this.transport.request("POST", "/producer/audios", { json: body });
|
|
1998
|
-
const handle = new TaskHandle(
|
|
1999
|
+
const handle = new TaskHandle(taskId11(result), "/producer/tasks", this.transport, result);
|
|
1999
2000
|
if (options.wait) {
|
|
2000
2001
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2001
2002
|
}
|
|
@@ -2016,7 +2017,7 @@ var Producer = class {
|
|
|
2016
2017
|
};
|
|
2017
2018
|
|
|
2018
2019
|
// src/resources/providers/seedance.ts
|
|
2019
|
-
function
|
|
2020
|
+
function taskId12(result) {
|
|
2020
2021
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2021
2022
|
const data = result?.data;
|
|
2022
2023
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2027,30 +2028,33 @@ var Seedance = class {
|
|
|
2027
2028
|
this.transport = transport;
|
|
2028
2029
|
}
|
|
2029
2030
|
transport;
|
|
2030
|
-
/**
|
|
2031
|
+
/** Call /seedance/videos. */
|
|
2031
2032
|
async generate(options) {
|
|
2032
2033
|
const body = {};
|
|
2033
2034
|
body["model"] = options.model;
|
|
2034
2035
|
body["content"] = options.content;
|
|
2035
|
-
if (options.
|
|
2036
|
+
if (options.resolution !== void 0) body["resolution"] = options.resolution;
|
|
2036
2037
|
body["ratio"] = options.ratio ?? "16:9";
|
|
2037
|
-
if (options.frames !== void 0) body["frames"] = options.frames;
|
|
2038
2038
|
if (options.duration !== void 0) body["duration"] = options.duration;
|
|
2039
|
-
if (options.
|
|
2040
|
-
if (options.
|
|
2039
|
+
if (options.frames !== void 0) body["frames"] = options.frames;
|
|
2040
|
+
if (options.seed !== void 0) body["seed"] = options.seed;
|
|
2041
2041
|
if (options.camerafixed !== void 0) body["camerafixed"] = options.camerafixed;
|
|
2042
|
+
if (options.watermark !== void 0) body["watermark"] = options.watermark;
|
|
2042
2043
|
body["generate_audio"] = options.generateAudio ?? false;
|
|
2043
2044
|
body["return_last_frame"] = options.returnLastFrame ?? false;
|
|
2044
2045
|
body["execution_expires_after"] = options.executionExpiresAfter ?? 172800;
|
|
2046
|
+
if (options.omniReferenceTaskType !== void 0) body["omni_reference_task_type"] = options.omniReferenceTaskType;
|
|
2047
|
+
if (options.outputFormat !== void 0) body["output_format"] = options.outputFormat;
|
|
2048
|
+
if (options.tools !== void 0) body["tools"] = options.tools;
|
|
2045
2049
|
for (const [key, value] of Object.entries(options)) {
|
|
2046
|
-
if (!["async", "callbackUrl", "camerafixed", "content", "duration", "executionExpiresAfter", "frames", "generateAudio", "maxWait", "model", "pollInterval", "ratio", "resolution", "returnLastFrame", "seed", "wait", "watermark"].includes(key) && value !== void 0) {
|
|
2050
|
+
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) {
|
|
2047
2051
|
body[key] = value;
|
|
2048
2052
|
}
|
|
2049
2053
|
}
|
|
2050
2054
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2051
2055
|
body.async = options.async ?? true;
|
|
2052
2056
|
const result = await this.transport.request("POST", "/seedance/videos", { json: body });
|
|
2053
|
-
const handle = new TaskHandle(
|
|
2057
|
+
const handle = new TaskHandle(taskId12(result), "/seedance/tasks", this.transport, result);
|
|
2054
2058
|
if (options.wait) {
|
|
2055
2059
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2056
2060
|
}
|
|
@@ -2059,7 +2063,7 @@ var Seedance = class {
|
|
|
2059
2063
|
};
|
|
2060
2064
|
|
|
2061
2065
|
// src/resources/providers/seedream.ts
|
|
2062
|
-
function
|
|
2066
|
+
function taskId13(result) {
|
|
2063
2067
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2064
2068
|
const data = result?.data;
|
|
2065
2069
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2095,7 +2099,7 @@ var Seedream = class {
|
|
|
2095
2099
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2096
2100
|
body.async = options.async ?? true;
|
|
2097
2101
|
const result = await this.transport.request("POST", "/seedream/images", { json: body });
|
|
2098
|
-
const handle = new TaskHandle(
|
|
2102
|
+
const handle = new TaskHandle(taskId13(result), "/seedream/tasks", this.transport, result);
|
|
2099
2103
|
if (options.wait) {
|
|
2100
2104
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2101
2105
|
}
|
|
@@ -2104,7 +2108,7 @@ var Seedream = class {
|
|
|
2104
2108
|
};
|
|
2105
2109
|
|
|
2106
2110
|
// src/resources/providers/suno.ts
|
|
2107
|
-
function
|
|
2111
|
+
function taskId14(result) {
|
|
2108
2112
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2109
2113
|
const data = result?.data;
|
|
2110
2114
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2155,7 +2159,7 @@ var Suno = class {
|
|
|
2155
2159
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2156
2160
|
body.async = options.async ?? true;
|
|
2157
2161
|
const result = await this.transport.request("POST", "/suno/audios", { json: body });
|
|
2158
|
-
const handle = new TaskHandle(
|
|
2162
|
+
const handle = new TaskHandle(taskId14(result), "/suno/tasks", this.transport, result);
|
|
2159
2163
|
if (options.wait) {
|
|
2160
2164
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2161
2165
|
}
|
|
@@ -2230,7 +2234,7 @@ var Suno = class {
|
|
|
2230
2234
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2231
2235
|
body.async = options.async ?? true;
|
|
2232
2236
|
const result = await this.transport.request("POST", "/suno/vox", { json: body });
|
|
2233
|
-
const handle = new TaskHandle(
|
|
2237
|
+
const handle = new TaskHandle(taskId14(result), "/suno/tasks", this.transport, result);
|
|
2234
2238
|
if (options.wait) {
|
|
2235
2239
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2236
2240
|
}
|
|
@@ -2248,7 +2252,7 @@ var Suno = class {
|
|
|
2248
2252
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2249
2253
|
body.async = options.async ?? true;
|
|
2250
2254
|
const result = await this.transport.request("POST", "/suno/wav", { json: body });
|
|
2251
|
-
const handle = new TaskHandle(
|
|
2255
|
+
const handle = new TaskHandle(taskId14(result), "/suno/tasks", this.transport, result);
|
|
2252
2256
|
if (options.wait) {
|
|
2253
2257
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2254
2258
|
}
|
|
@@ -2266,7 +2270,7 @@ var Suno = class {
|
|
|
2266
2270
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2267
2271
|
body.async = options.async ?? true;
|
|
2268
2272
|
const result = await this.transport.request("POST", "/suno/midi", { json: body });
|
|
2269
|
-
const handle = new TaskHandle(
|
|
2273
|
+
const handle = new TaskHandle(taskId14(result), "/suno/tasks", this.transport, result);
|
|
2270
2274
|
if (options.wait) {
|
|
2271
2275
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2272
2276
|
}
|
|
@@ -2325,7 +2329,7 @@ var Suno = class {
|
|
|
2325
2329
|
};
|
|
2326
2330
|
|
|
2327
2331
|
// src/resources/providers/wan.ts
|
|
2328
|
-
function
|
|
2332
|
+
function taskId15(result) {
|
|
2329
2333
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2330
2334
|
const data = result?.data;
|
|
2331
2335
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2360,7 +2364,7 @@ var Wan = class {
|
|
|
2360
2364
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2361
2365
|
body.async = options.async ?? true;
|
|
2362
2366
|
const result = await this.transport.request("POST", "/wan/videos", { json: body });
|
|
2363
|
-
const handle = new TaskHandle(
|
|
2367
|
+
const handle = new TaskHandle(taskId15(result), "/wan/tasks", this.transport, result);
|
|
2364
2368
|
if (options.wait) {
|
|
2365
2369
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2366
2370
|
}
|