@acedatacloud/sdk 2026.804.0 → 2026.807.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 +64 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -7
- 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/suno.ts +3 -3
- package/src/resources/tasks.ts +1 -0
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Transport, TransportOptions } from './runtime/transport';
|
|
|
4
4
|
import type { PaymentHandler } from './runtime/payment';
|
|
5
5
|
import { AiChat } from './resources/aichat';
|
|
6
6
|
import { Chat } from './resources/chat';
|
|
7
|
+
import { Captcha } from './resources/captcha';
|
|
7
8
|
import { Images } from './resources/images';
|
|
8
9
|
import { Audio } from './resources/audio';
|
|
9
10
|
import { Video } from './resources/video';
|
|
@@ -38,6 +39,7 @@ export interface AceDataCloudOptions {
|
|
|
38
39
|
export class AceDataCloud {
|
|
39
40
|
readonly aichat: AiChat;
|
|
40
41
|
readonly chat: Chat;
|
|
42
|
+
readonly captcha: Captcha;
|
|
41
43
|
readonly images: Images;
|
|
42
44
|
readonly audio: Audio;
|
|
43
45
|
readonly video: Video;
|
|
@@ -68,6 +70,7 @@ export class AceDataCloud {
|
|
|
68
70
|
|
|
69
71
|
this.aichat = new AiChat(this.transport);
|
|
70
72
|
this.chat = new Chat(this.transport);
|
|
73
|
+
this.captcha = new Captcha(this.transport);
|
|
71
74
|
this.images = new Images(this.transport);
|
|
72
75
|
this.audio = new Audio(this.transport);
|
|
73
76
|
this.video = new Video(this.transport);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** Captcha resources (`/captcha/*`). */
|
|
2
|
+
|
|
3
|
+
import { Transport } from '../runtime/transport';
|
|
4
|
+
|
|
5
|
+
class Recognition {
|
|
6
|
+
constructor(private transport: Transport) {}
|
|
7
|
+
|
|
8
|
+
hcaptcha(opts: {
|
|
9
|
+
queries?: string[];
|
|
10
|
+
question?: string;
|
|
11
|
+
async?: boolean;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
} = {}): Promise<Record<string, unknown>> {
|
|
14
|
+
const { queries, question, ...rest } = opts;
|
|
15
|
+
const body: Record<string, unknown> = { ...rest };
|
|
16
|
+
if (queries !== undefined) body.queries = queries;
|
|
17
|
+
if (question !== undefined) body.question = question;
|
|
18
|
+
return this.transport.request('POST', '/captcha/recognition/hcaptcha', { json: body });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
class Token {
|
|
23
|
+
constructor(private transport: Transport) {}
|
|
24
|
+
|
|
25
|
+
hcaptcha(opts: {
|
|
26
|
+
websiteKey: string;
|
|
27
|
+
websiteUrl: string;
|
|
28
|
+
rqdata?: string;
|
|
29
|
+
proxy?: string;
|
|
30
|
+
async?: boolean;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}): Promise<Record<string, unknown>> {
|
|
33
|
+
const { websiteKey, websiteUrl, rqdata, proxy, ...rest } = opts;
|
|
34
|
+
const body: Record<string, unknown> = {
|
|
35
|
+
website_key: websiteKey,
|
|
36
|
+
website_url: websiteUrl,
|
|
37
|
+
...rest,
|
|
38
|
+
};
|
|
39
|
+
if (rqdata !== undefined) body.rqdata = rqdata;
|
|
40
|
+
if (proxy !== undefined) body.proxy = proxy;
|
|
41
|
+
return this.transport.request('POST', '/captcha/token/hcaptcha', { json: body });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
class Tasks {
|
|
46
|
+
constructor(private transport: Transport) {}
|
|
47
|
+
|
|
48
|
+
retrieve(opts: { taskId: string; [key: string]: unknown }): Promise<Record<string, unknown>> {
|
|
49
|
+
const { taskId, ...rest } = opts;
|
|
50
|
+
return this.transport.request('POST', '/captcha/tasks', {
|
|
51
|
+
json: { task_id: taskId, ...rest },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class Captcha {
|
|
57
|
+
readonly recognition: Recognition;
|
|
58
|
+
readonly token: Token;
|
|
59
|
+
readonly tasks: Tasks;
|
|
60
|
+
|
|
61
|
+
constructor(transport: Transport) {
|
|
62
|
+
this.recognition = new Recognition(transport);
|
|
63
|
+
this.token = new Token(transport);
|
|
64
|
+
this.tasks = new Tasks(transport);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -56,7 +56,7 @@ export interface SunoGenerateOptions {
|
|
|
56
56
|
/** Add a default start time for the uploaded audio sample, with a default value of 0. */
|
|
57
57
|
samplesStart?: number;
|
|
58
58
|
/** Styles of description that are not desired in music generation. */
|
|
59
|
-
|
|
59
|
+
negativeTags?: string;
|
|
60
60
|
/** The "Style Influence" advanced parameter in the Suno official custom mode has a value range of 0 to 1, with higher values being closer to the selected style. It is only effective in custom mode. */
|
|
61
61
|
styleInfluence?: number;
|
|
62
62
|
/** Audio ID list for mixing and mashup. This field is required when `action` is `mashup`. */
|
|
@@ -240,7 +240,7 @@ export class Suno {
|
|
|
240
240
|
if (options.lyricPrompt !== undefined) body["lyric_prompt"] = options.lyricPrompt;
|
|
241
241
|
if (options.vocalGender !== undefined) body["vocal_gender"] = options.vocalGender;
|
|
242
242
|
if (options.samplesStart !== undefined) body["samples_start"] = options.samplesStart;
|
|
243
|
-
if (options.
|
|
243
|
+
if (options.negativeTags !== undefined) body["negative_tags"] = options.negativeTags;
|
|
244
244
|
if (options.styleInfluence !== undefined) body["style_influence"] = options.styleInfluence;
|
|
245
245
|
if (options.mashupAudioIds !== undefined) body["mashup_audio_ids"] = options.mashupAudioIds;
|
|
246
246
|
if (options.overpaintingEnd !== undefined) body["overpainting_end"] = options.overpaintingEnd;
|
|
@@ -251,7 +251,7 @@ export class Suno {
|
|
|
251
251
|
if (options.underpaintingStart !== undefined) body["underpainting_start"] = options.underpaintingStart;
|
|
252
252
|
if (options.replaceSectionStart !== undefined) body["replace_section_start"] = options.replaceSectionStart;
|
|
253
253
|
for (const [key, value] of Object.entries(options)) {
|
|
254
|
-
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", "
|
|
254
|
+
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", "negativeTags", "title", "underpaintingEnd", "underpaintingStart", "variationCategory", "vocalGender", "wait", "weirdness"].includes(key) && value !== undefined) {
|
|
255
255
|
body[key] = value;
|
|
256
256
|
}
|
|
257
257
|
}
|