@acedatacloud/sdk 2026.807.0 → 2026.809.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 +69 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/resources/providers/index.ts +3 -0
- package/src/resources/providers/minimax.ts +66 -0
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: taskId15, ...rest } = opts;
|
|
483
483
|
return this.transport.request("POST", "/captcha/tasks", {
|
|
484
|
-
json: { task_id:
|
|
484
|
+
json: { task_id: taskId15, ...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(taskId15, pollEndpoint, transport, submitted) {
|
|
593
|
+
this.id = taskId15;
|
|
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 taskId15 = result.task_id;
|
|
672
|
+
if (!taskId15 || result.data && !shouldWait) return result;
|
|
673
|
+
const handle = new TaskHandle(taskId15, `/${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 taskId15 = result.task_id;
|
|
720
|
+
if (!taskId15 || result.data && !shouldWait) return result;
|
|
721
|
+
const handle = new TaskHandle(taskId15, `/${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 taskId15 = result.task_id;
|
|
741
|
+
if (!taskId15 || result.data && !shouldWait) return result;
|
|
742
|
+
const handle = new TaskHandle(taskId15, `/${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(taskId15, 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: taskId15, action: "retrieve" }
|
|
794
794
|
});
|
|
795
795
|
}
|
|
796
|
-
async wait(
|
|
796
|
+
async wait(taskId15, 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(taskId15, endpoint, this.transport);
|
|
800
800
|
return handle.wait({ pollInterval: opts.pollInterval, maxWait: opts.maxWait });
|
|
801
801
|
}
|
|
802
802
|
};
|
|
@@ -1799,13 +1799,49 @@ var Maestro = class {
|
|
|
1799
1799
|
}
|
|
1800
1800
|
};
|
|
1801
1801
|
|
|
1802
|
-
// src/resources/providers/
|
|
1802
|
+
// src/resources/providers/minimax.ts
|
|
1803
1803
|
function taskId8(result) {
|
|
1804
1804
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1805
1805
|
const data = result?.data;
|
|
1806
1806
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
1807
1807
|
return typeof result?.id === "string" ? result.id : "";
|
|
1808
1808
|
}
|
|
1809
|
+
var Minimax = class {
|
|
1810
|
+
constructor(transport) {
|
|
1811
|
+
this.transport = transport;
|
|
1812
|
+
}
|
|
1813
|
+
transport;
|
|
1814
|
+
/** Minimax Videos */
|
|
1815
|
+
async generate(options) {
|
|
1816
|
+
const body = {};
|
|
1817
|
+
body["model"] = options.model;
|
|
1818
|
+
body["content"] = options.content;
|
|
1819
|
+
body["resolution"] = options.resolution;
|
|
1820
|
+
body["duration"] = options.duration;
|
|
1821
|
+
if (options.ratio !== void 0) body["ratio"] = options.ratio;
|
|
1822
|
+
for (const [key, value] of Object.entries(options)) {
|
|
1823
|
+
if (!["async", "callbackUrl", "content", "duration", "maxWait", "model", "pollInterval", "ratio", "resolution", "wait"].includes(key) && value !== void 0) {
|
|
1824
|
+
body[key] = value;
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1828
|
+
body.async = options.async ?? true;
|
|
1829
|
+
const result = await this.transport.request("POST", "/minimax/videos", { json: body });
|
|
1830
|
+
const handle = new TaskHandle(taskId8(result), "/minimax/tasks", this.transport, result);
|
|
1831
|
+
if (options.wait) {
|
|
1832
|
+
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1833
|
+
}
|
|
1834
|
+
return handle;
|
|
1835
|
+
}
|
|
1836
|
+
};
|
|
1837
|
+
|
|
1838
|
+
// src/resources/providers/nano-banana.ts
|
|
1839
|
+
function taskId9(result) {
|
|
1840
|
+
if (typeof result?.task_id === "string") return result.task_id;
|
|
1841
|
+
const data = result?.data;
|
|
1842
|
+
if (data && typeof data.task_id === "string") return data.task_id;
|
|
1843
|
+
return typeof result?.id === "string" ? result.id : "";
|
|
1844
|
+
}
|
|
1809
1845
|
var NanoBanana = class {
|
|
1810
1846
|
constructor(transport) {
|
|
1811
1847
|
this.transport = transport;
|
|
@@ -1829,7 +1865,7 @@ var NanoBanana = class {
|
|
|
1829
1865
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1830
1866
|
body.async = options.async ?? true;
|
|
1831
1867
|
const result = await this.transport.request("POST", "/nano-banana/images", { json: body });
|
|
1832
|
-
const handle = new TaskHandle(
|
|
1868
|
+
const handle = new TaskHandle(taskId9(result), "/nano-banana/tasks", this.transport, result);
|
|
1833
1869
|
if (options.wait) {
|
|
1834
1870
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1835
1871
|
}
|
|
@@ -1838,7 +1874,7 @@ var NanoBanana = class {
|
|
|
1838
1874
|
};
|
|
1839
1875
|
|
|
1840
1876
|
// src/resources/providers/producer.ts
|
|
1841
|
-
function
|
|
1877
|
+
function taskId10(result) {
|
|
1842
1878
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1843
1879
|
const data = result?.data;
|
|
1844
1880
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1911,7 +1947,7 @@ var Producer = class {
|
|
|
1911
1947
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1912
1948
|
body.async = options.async ?? true;
|
|
1913
1949
|
const result = await this.transport.request("POST", "/producer/audios", { json: body });
|
|
1914
|
-
const handle = new TaskHandle(
|
|
1950
|
+
const handle = new TaskHandle(taskId10(result), "/producer/tasks", this.transport, result);
|
|
1915
1951
|
if (options.wait) {
|
|
1916
1952
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1917
1953
|
}
|
|
@@ -1932,7 +1968,7 @@ var Producer = class {
|
|
|
1932
1968
|
};
|
|
1933
1969
|
|
|
1934
1970
|
// src/resources/providers/seedance.ts
|
|
1935
|
-
function
|
|
1971
|
+
function taskId11(result) {
|
|
1936
1972
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1937
1973
|
const data = result?.data;
|
|
1938
1974
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1966,7 +2002,7 @@ var Seedance = class {
|
|
|
1966
2002
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1967
2003
|
body.async = options.async ?? true;
|
|
1968
2004
|
const result = await this.transport.request("POST", "/seedance/videos", { json: body });
|
|
1969
|
-
const handle = new TaskHandle(
|
|
2005
|
+
const handle = new TaskHandle(taskId11(result), "/seedance/tasks", this.transport, result);
|
|
1970
2006
|
if (options.wait) {
|
|
1971
2007
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1972
2008
|
}
|
|
@@ -1975,7 +2011,7 @@ var Seedance = class {
|
|
|
1975
2011
|
};
|
|
1976
2012
|
|
|
1977
2013
|
// src/resources/providers/seedream.ts
|
|
1978
|
-
function
|
|
2014
|
+
function taskId12(result) {
|
|
1979
2015
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1980
2016
|
const data = result?.data;
|
|
1981
2017
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2011,7 +2047,7 @@ var Seedream = class {
|
|
|
2011
2047
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2012
2048
|
body.async = options.async ?? true;
|
|
2013
2049
|
const result = await this.transport.request("POST", "/seedream/images", { json: body });
|
|
2014
|
-
const handle = new TaskHandle(
|
|
2050
|
+
const handle = new TaskHandle(taskId12(result), "/seedream/tasks", this.transport, result);
|
|
2015
2051
|
if (options.wait) {
|
|
2016
2052
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2017
2053
|
}
|
|
@@ -2020,7 +2056,7 @@ var Seedream = class {
|
|
|
2020
2056
|
};
|
|
2021
2057
|
|
|
2022
2058
|
// src/resources/providers/suno.ts
|
|
2023
|
-
function
|
|
2059
|
+
function taskId13(result) {
|
|
2024
2060
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2025
2061
|
const data = result?.data;
|
|
2026
2062
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2071,7 +2107,7 @@ var Suno = class {
|
|
|
2071
2107
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2072
2108
|
body.async = options.async ?? true;
|
|
2073
2109
|
const result = await this.transport.request("POST", "/suno/audios", { json: body });
|
|
2074
|
-
const handle = new TaskHandle(
|
|
2110
|
+
const handle = new TaskHandle(taskId13(result), "/suno/tasks", this.transport, result);
|
|
2075
2111
|
if (options.wait) {
|
|
2076
2112
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2077
2113
|
}
|
|
@@ -2146,7 +2182,7 @@ var Suno = class {
|
|
|
2146
2182
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2147
2183
|
body.async = options.async ?? true;
|
|
2148
2184
|
const result = await this.transport.request("POST", "/suno/vox", { json: body });
|
|
2149
|
-
const handle = new TaskHandle(
|
|
2185
|
+
const handle = new TaskHandle(taskId13(result), "/suno/tasks", this.transport, result);
|
|
2150
2186
|
if (options.wait) {
|
|
2151
2187
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2152
2188
|
}
|
|
@@ -2164,7 +2200,7 @@ var Suno = class {
|
|
|
2164
2200
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2165
2201
|
body.async = options.async ?? true;
|
|
2166
2202
|
const result = await this.transport.request("POST", "/suno/wav", { json: body });
|
|
2167
|
-
const handle = new TaskHandle(
|
|
2203
|
+
const handle = new TaskHandle(taskId13(result), "/suno/tasks", this.transport, result);
|
|
2168
2204
|
if (options.wait) {
|
|
2169
2205
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2170
2206
|
}
|
|
@@ -2182,7 +2218,7 @@ var Suno = class {
|
|
|
2182
2218
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2183
2219
|
body.async = options.async ?? true;
|
|
2184
2220
|
const result = await this.transport.request("POST", "/suno/midi", { json: body });
|
|
2185
|
-
const handle = new TaskHandle(
|
|
2221
|
+
const handle = new TaskHandle(taskId13(result), "/suno/tasks", this.transport, result);
|
|
2186
2222
|
if (options.wait) {
|
|
2187
2223
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2188
2224
|
}
|
|
@@ -2241,7 +2277,7 @@ var Suno = class {
|
|
|
2241
2277
|
};
|
|
2242
2278
|
|
|
2243
2279
|
// src/resources/providers/wan.ts
|
|
2244
|
-
function
|
|
2280
|
+
function taskId14(result) {
|
|
2245
2281
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2246
2282
|
const data = result?.data;
|
|
2247
2283
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2276,7 +2312,7 @@ var Wan = class {
|
|
|
2276
2312
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2277
2313
|
body.async = options.async ?? true;
|
|
2278
2314
|
const result = await this.transport.request("POST", "/wan/videos", { json: body });
|
|
2279
|
-
const handle = new TaskHandle(
|
|
2315
|
+
const handle = new TaskHandle(taskId14(result), "/wan/tasks", this.transport, result);
|
|
2280
2316
|
if (options.wait) {
|
|
2281
2317
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2282
2318
|
}
|
|
@@ -2295,6 +2331,7 @@ function attachProviders(client, transport) {
|
|
|
2295
2331
|
client.localization = new Localization(transport);
|
|
2296
2332
|
client.luma = new Luma(transport);
|
|
2297
2333
|
client.maestro = new Maestro(transport);
|
|
2334
|
+
client.minimax = new Minimax(transport);
|
|
2298
2335
|
client.nanobanana = new NanoBanana(transport);
|
|
2299
2336
|
client.producer = new Producer(transport);
|
|
2300
2337
|
client.seedance = new Seedance(transport);
|