@acedatacloud/sdk 2026.805.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.d.mts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +129 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +129 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +3 -0
- package/src/resources/captcha.ts +66 -0
- package/src/resources/providers/index.ts +3 -0
- package/src/resources/providers/minimax.ts +66 -0
- package/src/resources/tasks.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -442,6 +442,60 @@ var Chat = class {
|
|
|
442
442
|
}
|
|
443
443
|
};
|
|
444
444
|
|
|
445
|
+
// src/resources/captcha.ts
|
|
446
|
+
var Recognition = class {
|
|
447
|
+
constructor(transport) {
|
|
448
|
+
this.transport = transport;
|
|
449
|
+
}
|
|
450
|
+
transport;
|
|
451
|
+
hcaptcha(opts = {}) {
|
|
452
|
+
const { queries, question, ...rest } = opts;
|
|
453
|
+
const body = { ...rest };
|
|
454
|
+
if (queries !== void 0) body.queries = queries;
|
|
455
|
+
if (question !== void 0) body.question = question;
|
|
456
|
+
return this.transport.request("POST", "/captcha/recognition/hcaptcha", { json: body });
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
var Token = class {
|
|
460
|
+
constructor(transport) {
|
|
461
|
+
this.transport = transport;
|
|
462
|
+
}
|
|
463
|
+
transport;
|
|
464
|
+
hcaptcha(opts) {
|
|
465
|
+
const { websiteKey, websiteUrl, rqdata, proxy, ...rest } = opts;
|
|
466
|
+
const body = {
|
|
467
|
+
website_key: websiteKey,
|
|
468
|
+
website_url: websiteUrl,
|
|
469
|
+
...rest
|
|
470
|
+
};
|
|
471
|
+
if (rqdata !== void 0) body.rqdata = rqdata;
|
|
472
|
+
if (proxy !== void 0) body.proxy = proxy;
|
|
473
|
+
return this.transport.request("POST", "/captcha/token/hcaptcha", { json: body });
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
var Tasks = class {
|
|
477
|
+
constructor(transport) {
|
|
478
|
+
this.transport = transport;
|
|
479
|
+
}
|
|
480
|
+
transport;
|
|
481
|
+
retrieve(opts) {
|
|
482
|
+
const { taskId: taskId15, ...rest } = opts;
|
|
483
|
+
return this.transport.request("POST", "/captcha/tasks", {
|
|
484
|
+
json: { task_id: taskId15, ...rest }
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
var Captcha = class {
|
|
489
|
+
recognition;
|
|
490
|
+
token;
|
|
491
|
+
tasks;
|
|
492
|
+
constructor(transport) {
|
|
493
|
+
this.recognition = new Recognition(transport);
|
|
494
|
+
this.token = new Token(transport);
|
|
495
|
+
this.tasks = new Tasks(transport);
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
|
|
445
499
|
// src/runtime/tasks.ts
|
|
446
500
|
var DONE = /* @__PURE__ */ new Set(["succeed", "succeeded", "success", "completed", "complete", "finished"]);
|
|
447
501
|
var FAILED = /* @__PURE__ */ new Set(["failed", "failure", "error", "cancelled", "canceled", "rejected"]);
|
|
@@ -535,8 +589,8 @@ var TaskHandle = class {
|
|
|
535
589
|
pollEndpoint;
|
|
536
590
|
transport;
|
|
537
591
|
_result = null;
|
|
538
|
-
constructor(
|
|
539
|
-
this.id =
|
|
592
|
+
constructor(taskId15, pollEndpoint, transport, submitted) {
|
|
593
|
+
this.id = taskId15;
|
|
540
594
|
this.pollEndpoint = pollEndpoint;
|
|
541
595
|
this.transport = transport;
|
|
542
596
|
if (submitted && artifactUrls({ response: submitted }).length > 0) {
|
|
@@ -614,9 +668,9 @@ var Images = class {
|
|
|
614
668
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
615
669
|
const endpoint = `/${provider}/images`;
|
|
616
670
|
const result = await this.transport.request("POST", endpoint, { json: body });
|
|
617
|
-
const
|
|
618
|
-
if (!
|
|
619
|
-
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);
|
|
620
674
|
if (shouldWait) return handle.wait({ pollInterval, maxWait });
|
|
621
675
|
return handle;
|
|
622
676
|
}
|
|
@@ -662,9 +716,9 @@ var Audio = class {
|
|
|
662
716
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
663
717
|
result = await this.transport.request("POST", `/${provider}/audios`, { json: body });
|
|
664
718
|
}
|
|
665
|
-
const
|
|
666
|
-
if (!
|
|
667
|
-
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);
|
|
668
722
|
if (shouldWait) return handle.wait({ pollInterval, maxWait });
|
|
669
723
|
return handle;
|
|
670
724
|
}
|
|
@@ -683,9 +737,9 @@ var Video = class {
|
|
|
683
737
|
if (imageUrl !== void 0) body.image_url = imageUrl;
|
|
684
738
|
if (callbackUrl !== void 0) body.callback_url = callbackUrl;
|
|
685
739
|
const result = await this.transport.request("POST", `/${provider}/videos`, { json: body });
|
|
686
|
-
const
|
|
687
|
-
if (!
|
|
688
|
-
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);
|
|
689
743
|
if (shouldWait) return handle.wait({ pollInterval, maxWait });
|
|
690
744
|
return handle;
|
|
691
745
|
}
|
|
@@ -724,24 +778,25 @@ var SERVICE_TASK_ENDPOINTS = {
|
|
|
724
778
|
wan: "/wan/tasks",
|
|
725
779
|
pika: "/pika/tasks",
|
|
726
780
|
pixverse: "/pixverse/tasks",
|
|
727
|
-
webextrator: "/webextrator/tasks"
|
|
781
|
+
webextrator: "/webextrator/tasks",
|
|
782
|
+
captcha: "/captcha/tasks"
|
|
728
783
|
};
|
|
729
|
-
var
|
|
784
|
+
var Tasks2 = class {
|
|
730
785
|
constructor(transport) {
|
|
731
786
|
this.transport = transport;
|
|
732
787
|
}
|
|
733
788
|
transport;
|
|
734
|
-
async get(
|
|
789
|
+
async get(taskId15, opts = {}) {
|
|
735
790
|
const service = opts.service ?? "suno";
|
|
736
791
|
const endpoint = SERVICE_TASK_ENDPOINTS[service] ?? `/${service}/tasks`;
|
|
737
792
|
return this.transport.request("POST", endpoint, {
|
|
738
|
-
json: { id:
|
|
793
|
+
json: { id: taskId15, action: "retrieve" }
|
|
739
794
|
});
|
|
740
795
|
}
|
|
741
|
-
async wait(
|
|
796
|
+
async wait(taskId15, opts = {}) {
|
|
742
797
|
const service = opts.service ?? "suno";
|
|
743
798
|
const endpoint = SERVICE_TASK_ENDPOINTS[service] ?? `/${service}/tasks`;
|
|
744
|
-
const handle = new TaskHandle(
|
|
799
|
+
const handle = new TaskHandle(taskId15, endpoint, this.transport);
|
|
745
800
|
return handle.wait({ pollInterval: opts.pollInterval, maxWait: opts.maxWait });
|
|
746
801
|
}
|
|
747
802
|
};
|
|
@@ -929,7 +984,7 @@ var Embeddings = class {
|
|
|
929
984
|
return this.transport.request("POST", "/openai/embeddings", { json: body });
|
|
930
985
|
}
|
|
931
986
|
};
|
|
932
|
-
var
|
|
987
|
+
var Tasks3 = class {
|
|
933
988
|
constructor(transport) {
|
|
934
989
|
this.transport = transport;
|
|
935
990
|
}
|
|
@@ -967,7 +1022,7 @@ var OpenAI = class {
|
|
|
967
1022
|
this.responses = new Responses(transport);
|
|
968
1023
|
this.images = new Images2(transport);
|
|
969
1024
|
this.embeddings = new Embeddings(transport);
|
|
970
|
-
this.tasks = new
|
|
1025
|
+
this.tasks = new Tasks3(transport);
|
|
971
1026
|
}
|
|
972
1027
|
};
|
|
973
1028
|
|
|
@@ -1744,13 +1799,49 @@ var Maestro = class {
|
|
|
1744
1799
|
}
|
|
1745
1800
|
};
|
|
1746
1801
|
|
|
1747
|
-
// src/resources/providers/
|
|
1802
|
+
// src/resources/providers/minimax.ts
|
|
1748
1803
|
function taskId8(result) {
|
|
1749
1804
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1750
1805
|
const data = result?.data;
|
|
1751
1806
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
1752
1807
|
return typeof result?.id === "string" ? result.id : "";
|
|
1753
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
|
+
}
|
|
1754
1845
|
var NanoBanana = class {
|
|
1755
1846
|
constructor(transport) {
|
|
1756
1847
|
this.transport = transport;
|
|
@@ -1774,7 +1865,7 @@ var NanoBanana = class {
|
|
|
1774
1865
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1775
1866
|
body.async = options.async ?? true;
|
|
1776
1867
|
const result = await this.transport.request("POST", "/nano-banana/images", { json: body });
|
|
1777
|
-
const handle = new TaskHandle(
|
|
1868
|
+
const handle = new TaskHandle(taskId9(result), "/nano-banana/tasks", this.transport, result);
|
|
1778
1869
|
if (options.wait) {
|
|
1779
1870
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1780
1871
|
}
|
|
@@ -1783,7 +1874,7 @@ var NanoBanana = class {
|
|
|
1783
1874
|
};
|
|
1784
1875
|
|
|
1785
1876
|
// src/resources/providers/producer.ts
|
|
1786
|
-
function
|
|
1877
|
+
function taskId10(result) {
|
|
1787
1878
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1788
1879
|
const data = result?.data;
|
|
1789
1880
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1856,7 +1947,7 @@ var Producer = class {
|
|
|
1856
1947
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1857
1948
|
body.async = options.async ?? true;
|
|
1858
1949
|
const result = await this.transport.request("POST", "/producer/audios", { json: body });
|
|
1859
|
-
const handle = new TaskHandle(
|
|
1950
|
+
const handle = new TaskHandle(taskId10(result), "/producer/tasks", this.transport, result);
|
|
1860
1951
|
if (options.wait) {
|
|
1861
1952
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1862
1953
|
}
|
|
@@ -1877,7 +1968,7 @@ var Producer = class {
|
|
|
1877
1968
|
};
|
|
1878
1969
|
|
|
1879
1970
|
// src/resources/providers/seedance.ts
|
|
1880
|
-
function
|
|
1971
|
+
function taskId11(result) {
|
|
1881
1972
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1882
1973
|
const data = result?.data;
|
|
1883
1974
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1911,7 +2002,7 @@ var Seedance = class {
|
|
|
1911
2002
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1912
2003
|
body.async = options.async ?? true;
|
|
1913
2004
|
const result = await this.transport.request("POST", "/seedance/videos", { json: body });
|
|
1914
|
-
const handle = new TaskHandle(
|
|
2005
|
+
const handle = new TaskHandle(taskId11(result), "/seedance/tasks", this.transport, result);
|
|
1915
2006
|
if (options.wait) {
|
|
1916
2007
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1917
2008
|
}
|
|
@@ -1920,7 +2011,7 @@ var Seedance = class {
|
|
|
1920
2011
|
};
|
|
1921
2012
|
|
|
1922
2013
|
// src/resources/providers/seedream.ts
|
|
1923
|
-
function
|
|
2014
|
+
function taskId12(result) {
|
|
1924
2015
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1925
2016
|
const data = result?.data;
|
|
1926
2017
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -1956,7 +2047,7 @@ var Seedream = class {
|
|
|
1956
2047
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
1957
2048
|
body.async = options.async ?? true;
|
|
1958
2049
|
const result = await this.transport.request("POST", "/seedream/images", { json: body });
|
|
1959
|
-
const handle = new TaskHandle(
|
|
2050
|
+
const handle = new TaskHandle(taskId12(result), "/seedream/tasks", this.transport, result);
|
|
1960
2051
|
if (options.wait) {
|
|
1961
2052
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
1962
2053
|
}
|
|
@@ -1965,7 +2056,7 @@ var Seedream = class {
|
|
|
1965
2056
|
};
|
|
1966
2057
|
|
|
1967
2058
|
// src/resources/providers/suno.ts
|
|
1968
|
-
function
|
|
2059
|
+
function taskId13(result) {
|
|
1969
2060
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
1970
2061
|
const data = result?.data;
|
|
1971
2062
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2016,7 +2107,7 @@ var Suno = class {
|
|
|
2016
2107
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2017
2108
|
body.async = options.async ?? true;
|
|
2018
2109
|
const result = await this.transport.request("POST", "/suno/audios", { json: body });
|
|
2019
|
-
const handle = new TaskHandle(
|
|
2110
|
+
const handle = new TaskHandle(taskId13(result), "/suno/tasks", this.transport, result);
|
|
2020
2111
|
if (options.wait) {
|
|
2021
2112
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2022
2113
|
}
|
|
@@ -2091,7 +2182,7 @@ var Suno = class {
|
|
|
2091
2182
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2092
2183
|
body.async = options.async ?? true;
|
|
2093
2184
|
const result = await this.transport.request("POST", "/suno/vox", { json: body });
|
|
2094
|
-
const handle = new TaskHandle(
|
|
2185
|
+
const handle = new TaskHandle(taskId13(result), "/suno/tasks", this.transport, result);
|
|
2095
2186
|
if (options.wait) {
|
|
2096
2187
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2097
2188
|
}
|
|
@@ -2109,7 +2200,7 @@ var Suno = class {
|
|
|
2109
2200
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2110
2201
|
body.async = options.async ?? true;
|
|
2111
2202
|
const result = await this.transport.request("POST", "/suno/wav", { json: body });
|
|
2112
|
-
const handle = new TaskHandle(
|
|
2203
|
+
const handle = new TaskHandle(taskId13(result), "/suno/tasks", this.transport, result);
|
|
2113
2204
|
if (options.wait) {
|
|
2114
2205
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2115
2206
|
}
|
|
@@ -2127,7 +2218,7 @@ var Suno = class {
|
|
|
2127
2218
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2128
2219
|
body.async = options.async ?? true;
|
|
2129
2220
|
const result = await this.transport.request("POST", "/suno/midi", { json: body });
|
|
2130
|
-
const handle = new TaskHandle(
|
|
2221
|
+
const handle = new TaskHandle(taskId13(result), "/suno/tasks", this.transport, result);
|
|
2131
2222
|
if (options.wait) {
|
|
2132
2223
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2133
2224
|
}
|
|
@@ -2186,7 +2277,7 @@ var Suno = class {
|
|
|
2186
2277
|
};
|
|
2187
2278
|
|
|
2188
2279
|
// src/resources/providers/wan.ts
|
|
2189
|
-
function
|
|
2280
|
+
function taskId14(result) {
|
|
2190
2281
|
if (typeof result?.task_id === "string") return result.task_id;
|
|
2191
2282
|
const data = result?.data;
|
|
2192
2283
|
if (data && typeof data.task_id === "string") return data.task_id;
|
|
@@ -2221,7 +2312,7 @@ var Wan = class {
|
|
|
2221
2312
|
if (options.callbackUrl !== void 0) body.callback_url = options.callbackUrl;
|
|
2222
2313
|
body.async = options.async ?? true;
|
|
2223
2314
|
const result = await this.transport.request("POST", "/wan/videos", { json: body });
|
|
2224
|
-
const handle = new TaskHandle(
|
|
2315
|
+
const handle = new TaskHandle(taskId14(result), "/wan/tasks", this.transport, result);
|
|
2225
2316
|
if (options.wait) {
|
|
2226
2317
|
await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
|
|
2227
2318
|
}
|
|
@@ -2240,6 +2331,7 @@ function attachProviders(client, transport) {
|
|
|
2240
2331
|
client.localization = new Localization(transport);
|
|
2241
2332
|
client.luma = new Luma(transport);
|
|
2242
2333
|
client.maestro = new Maestro(transport);
|
|
2334
|
+
client.minimax = new Minimax(transport);
|
|
2243
2335
|
client.nanobanana = new NanoBanana(transport);
|
|
2244
2336
|
client.producer = new Producer(transport);
|
|
2245
2337
|
client.seedance = new Seedance(transport);
|
|
@@ -2252,6 +2344,7 @@ function attachProviders(client, transport) {
|
|
|
2252
2344
|
var AceDataCloud = class {
|
|
2253
2345
|
aichat;
|
|
2254
2346
|
chat;
|
|
2347
|
+
captcha;
|
|
2255
2348
|
images;
|
|
2256
2349
|
audio;
|
|
2257
2350
|
video;
|
|
@@ -2279,11 +2372,12 @@ var AceDataCloud = class {
|
|
|
2279
2372
|
});
|
|
2280
2373
|
this.aichat = new AiChat(this.transport);
|
|
2281
2374
|
this.chat = new Chat(this.transport);
|
|
2375
|
+
this.captcha = new Captcha(this.transport);
|
|
2282
2376
|
this.images = new Images(this.transport);
|
|
2283
2377
|
this.audio = new Audio(this.transport);
|
|
2284
2378
|
this.video = new Video(this.transport);
|
|
2285
2379
|
this.search = new Search(this.transport);
|
|
2286
|
-
this.tasks = new
|
|
2380
|
+
this.tasks = new Tasks2(this.transport);
|
|
2287
2381
|
this.files = new Files(this.transport);
|
|
2288
2382
|
this.platform = new Platform(this.transport);
|
|
2289
2383
|
this.openai = new OpenAI(this.transport);
|