@runapi.ai/suno 0.2.4 → 0.2.7

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.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/client.ts
2
- import { createHttpClient } from "@runapi.ai/core";
2
+ import { BaseClient } from "@runapi.ai/core";
3
3
 
4
4
  // src/resources/text-to-music.ts
5
5
  import { compactParams } from "@runapi.ai/core";
@@ -10,6 +10,12 @@ var TextToMusic = class {
10
10
  this.http = http;
11
11
  }
12
12
  http;
13
+ /**
14
+ * Create a text to music task and wait until complete.
15
+ * @param params Text to music parameters.
16
+ * @param options Per-request and polling overrides.
17
+ * @returns The completed text to music response.
18
+ */
13
19
  async run(params, options) {
14
20
  const { id } = await this.create(params, options);
15
21
  const response = await pollUntilComplete(() => this.get(id, options), {
@@ -18,12 +24,24 @@ var TextToMusic = class {
18
24
  });
19
25
  return response;
20
26
  }
27
+ /**
28
+ * Create a text to music task; returns immediately with a task id.
29
+ * @param params Text to music parameters.
30
+ * @param options Per-request overrides.
31
+ * @returns The task creation result.
32
+ */
21
33
  async create(params, options) {
22
34
  return this.http.request("POST", ENDPOINT, {
23
35
  body: compactParams(params),
24
36
  ...options
25
37
  });
26
38
  }
39
+ /**
40
+ * Fetch the current status of a text to music task.
41
+ * @param id The task id.
42
+ * @param options Per-request overrides.
43
+ * @returns The current text to music task status.
44
+ */
27
45
  async get(id, options) {
28
46
  return this.http.request("GET", `${ENDPOINT}/${id}`, {
29
47
  ...options
@@ -40,6 +58,12 @@ var ExtendMusic = class {
40
58
  this.http = http;
41
59
  }
42
60
  http;
61
+ /**
62
+ * Create an extend music task and wait until complete.
63
+ * @param params Extend music parameters.
64
+ * @param options Per-request and polling overrides.
65
+ * @returns The completed extend music response.
66
+ */
43
67
  async run(params, options) {
44
68
  const { id } = await this.create(params, options);
45
69
  const response = await pollUntilComplete2(() => this.get(id, options), {
@@ -48,12 +72,24 @@ var ExtendMusic = class {
48
72
  });
49
73
  return response;
50
74
  }
75
+ /**
76
+ * Create an extend music task; returns immediately with a task id.
77
+ * @param params Extend music parameters.
78
+ * @param options Per-request overrides.
79
+ * @returns The task creation result.
80
+ */
51
81
  async create(params, options) {
52
82
  return this.http.request("POST", ENDPOINT2, {
53
83
  body: compactParams2(params),
54
84
  ...options
55
85
  });
56
86
  }
87
+ /**
88
+ * Fetch the current status of an extend music task.
89
+ * @param id The task id.
90
+ * @param options Per-request overrides.
91
+ * @returns The current extend music task status.
92
+ */
57
93
  async get(id, options) {
58
94
  return this.http.request("GET", `${ENDPOINT2}/${id}`, {
59
95
  ...options
@@ -70,6 +106,12 @@ var GenerateArtwork = class {
70
106
  this.http = http;
71
107
  }
72
108
  http;
109
+ /**
110
+ * Create a generate artwork task and wait until complete.
111
+ * @param params Generate artwork parameters.
112
+ * @param options Per-request and polling overrides.
113
+ * @returns The completed generate artwork response.
114
+ */
73
115
  async run(params, options) {
74
116
  const { id } = await this.create(params, options);
75
117
  const response = await pollUntilComplete3(() => this.get(id, options), {
@@ -78,12 +120,24 @@ var GenerateArtwork = class {
78
120
  });
79
121
  return response;
80
122
  }
123
+ /**
124
+ * Create a generate artwork task; returns immediately with a task id.
125
+ * @param params Generate artwork parameters.
126
+ * @param options Per-request overrides.
127
+ * @returns The task creation result.
128
+ */
81
129
  async create(params, options) {
82
130
  return this.http.request("POST", ENDPOINT3, {
83
131
  body: compactParams3(params),
84
132
  ...options
85
133
  });
86
134
  }
135
+ /**
136
+ * Fetch the current status of a generate artwork task.
137
+ * @param id The task id.
138
+ * @param options Per-request overrides.
139
+ * @returns The current generate artwork task status.
140
+ */
87
141
  async get(id, options) {
88
142
  return this.http.request("GET", `${ENDPOINT3}/${id}`, {
89
143
  ...options
@@ -100,6 +154,12 @@ var CoverAudio = class {
100
154
  this.http = http;
101
155
  }
102
156
  http;
157
+ /**
158
+ * Create a cover audio task and wait until complete.
159
+ * @param params Cover audio parameters.
160
+ * @param options Per-request and polling overrides.
161
+ * @returns The completed cover audio response.
162
+ */
103
163
  async run(params, options) {
104
164
  const { id } = await this.create(params, options);
105
165
  const response = await pollUntilComplete4(() => this.get(id, options), {
@@ -108,12 +168,24 @@ var CoverAudio = class {
108
168
  });
109
169
  return response;
110
170
  }
171
+ /**
172
+ * Create a cover audio task; returns immediately with a task id.
173
+ * @param params Cover audio parameters.
174
+ * @param options Per-request overrides.
175
+ * @returns The task creation result.
176
+ */
111
177
  async create(params, options) {
112
178
  return this.http.request("POST", ENDPOINT4, {
113
179
  body: compactParams4(params),
114
180
  ...options
115
181
  });
116
182
  }
183
+ /**
184
+ * Fetch the current status of a cover audio task.
185
+ * @param id The task id.
186
+ * @param options Per-request overrides.
187
+ * @returns The current cover audio task status.
188
+ */
117
189
  async get(id, options) {
118
190
  return this.http.request("GET", `${ENDPOINT4}/${id}`, {
119
191
  ...options
@@ -130,6 +202,12 @@ var AddInstrumental = class {
130
202
  this.http = http;
131
203
  }
132
204
  http;
205
+ /**
206
+ * Create an add instrumental task and wait until complete.
207
+ * @param params Add instrumental parameters.
208
+ * @param options Per-request and polling overrides.
209
+ * @returns The completed add instrumental response.
210
+ */
133
211
  async run(params, options) {
134
212
  const { id } = await this.create(params, options);
135
213
  const response = await pollUntilComplete5(() => this.get(id, options), {
@@ -138,12 +216,24 @@ var AddInstrumental = class {
138
216
  });
139
217
  return response;
140
218
  }
219
+ /**
220
+ * Create an add instrumental task; returns immediately with a task id.
221
+ * @param params Add instrumental parameters.
222
+ * @param options Per-request overrides.
223
+ * @returns The task creation result.
224
+ */
141
225
  async create(params, options) {
142
226
  return this.http.request("POST", ENDPOINT5, {
143
227
  body: compactParams5(params),
144
228
  ...options
145
229
  });
146
230
  }
231
+ /**
232
+ * Fetch the current status of an add instrumental task.
233
+ * @param id The task id.
234
+ * @param options Per-request overrides.
235
+ * @returns The current add instrumental task status.
236
+ */
147
237
  async get(id, options) {
148
238
  return this.http.request("GET", `${ENDPOINT5}/${id}`, {
149
239
  ...options
@@ -160,6 +250,12 @@ var AddVocals = class {
160
250
  this.http = http;
161
251
  }
162
252
  http;
253
+ /**
254
+ * Create an add vocals task and wait until complete.
255
+ * @param params Add vocals parameters.
256
+ * @param options Per-request and polling overrides.
257
+ * @returns The completed add vocals response.
258
+ */
163
259
  async run(params, options) {
164
260
  const { id } = await this.create(params, options);
165
261
  const response = await pollUntilComplete6(() => this.get(id, options), {
@@ -168,12 +264,24 @@ var AddVocals = class {
168
264
  });
169
265
  return response;
170
266
  }
267
+ /**
268
+ * Create an add vocals task; returns immediately with a task id.
269
+ * @param params Add vocals parameters.
270
+ * @param options Per-request overrides.
271
+ * @returns The task creation result.
272
+ */
171
273
  async create(params, options) {
172
274
  return this.http.request("POST", ENDPOINT6, {
173
275
  body: compactParams6(params),
174
276
  ...options
175
277
  });
176
278
  }
279
+ /**
280
+ * Fetch the current status of an add vocals task.
281
+ * @param id The task id.
282
+ * @param options Per-request overrides.
283
+ * @returns The current add vocals task status.
284
+ */
177
285
  async get(id, options) {
178
286
  return this.http.request("GET", `${ENDPOINT6}/${id}`, {
179
287
  ...options
@@ -190,6 +298,12 @@ var SeparateAudioStems = class {
190
298
  this.http = http;
191
299
  }
192
300
  http;
301
+ /**
302
+ * Create a separate audio stems task and wait until complete.
303
+ * @param params Separate audio stems parameters.
304
+ * @param options Per-request and polling overrides.
305
+ * @returns The completed separate audio stems response.
306
+ */
193
307
  async run(params, options) {
194
308
  const { id } = await this.create(params, options);
195
309
  const response = await pollUntilComplete7(() => this.get(id, options), {
@@ -198,12 +312,24 @@ var SeparateAudioStems = class {
198
312
  });
199
313
  return response;
200
314
  }
315
+ /**
316
+ * Create a separate audio stems task; returns immediately with a task id.
317
+ * @param params Separate audio stems parameters.
318
+ * @param options Per-request overrides.
319
+ * @returns The task creation result.
320
+ */
201
321
  async create(params, options) {
202
322
  return this.http.request("POST", ENDPOINT7, {
203
323
  body: compactParams7(params),
204
324
  ...options
205
325
  });
206
326
  }
327
+ /**
328
+ * Fetch the current status of a separate audio stems task.
329
+ * @param id The task id.
330
+ * @param options Per-request overrides.
331
+ * @returns The current separate audio stems task status.
332
+ */
207
333
  async get(id, options) {
208
334
  return this.http.request("GET", `${ENDPOINT7}/${id}`, {
209
335
  ...options
@@ -220,6 +346,12 @@ var GenerateMidi = class {
220
346
  this.http = http;
221
347
  }
222
348
  http;
349
+ /**
350
+ * Create a generate midi task and wait until complete.
351
+ * @param params Generate midi parameters.
352
+ * @param options Per-request and polling overrides.
353
+ * @returns The completed generate midi response.
354
+ */
223
355
  async run(params, options) {
224
356
  const { id } = await this.create(params, options);
225
357
  const response = await pollUntilComplete8(() => this.get(id, options), {
@@ -228,12 +360,24 @@ var GenerateMidi = class {
228
360
  });
229
361
  return response;
230
362
  }
363
+ /**
364
+ * Create a generate midi task; returns immediately with a task id.
365
+ * @param params Generate midi parameters.
366
+ * @param options Per-request overrides.
367
+ * @returns The task creation result.
368
+ */
231
369
  async create(params, options) {
232
370
  return this.http.request("POST", ENDPOINT8, {
233
371
  body: compactParams8(params),
234
372
  ...options
235
373
  });
236
374
  }
375
+ /**
376
+ * Fetch the current status of a generate midi task.
377
+ * @param id The task id.
378
+ * @param options Per-request overrides.
379
+ * @returns The current generate midi task status.
380
+ */
237
381
  async get(id, options) {
238
382
  return this.http.request("GET", `${ENDPOINT8}/${id}`, {
239
383
  ...options
@@ -250,6 +394,12 @@ var ConvertAudio = class {
250
394
  this.http = http;
251
395
  }
252
396
  http;
397
+ /**
398
+ * Create a convert audio task and wait until complete.
399
+ * @param params Convert audio parameters.
400
+ * @param options Per-request and polling overrides.
401
+ * @returns The completed convert audio response.
402
+ */
253
403
  async run(params, options) {
254
404
  const { id } = await this.create(params, options);
255
405
  const response = await pollUntilComplete9(() => this.get(id, options), {
@@ -258,12 +408,24 @@ var ConvertAudio = class {
258
408
  });
259
409
  return response;
260
410
  }
411
+ /**
412
+ * Create a convert audio task; returns immediately with a task id.
413
+ * @param params Convert audio parameters.
414
+ * @param options Per-request overrides.
415
+ * @returns The task creation result.
416
+ */
261
417
  async create(params, options) {
262
418
  return this.http.request("POST", ENDPOINT9, {
263
419
  body: compactParams9(params),
264
420
  ...options
265
421
  });
266
422
  }
423
+ /**
424
+ * Fetch the current status of a convert audio task.
425
+ * @param id The task id.
426
+ * @param options Per-request overrides.
427
+ * @returns The current convert audio task status.
428
+ */
267
429
  async get(id, options) {
268
430
  return this.http.request("GET", `${ENDPOINT9}/${id}`, {
269
431
  ...options
@@ -280,6 +442,12 @@ var VisualizeMusic = class {
280
442
  this.http = http;
281
443
  }
282
444
  http;
445
+ /**
446
+ * Create a visualize music task and wait until complete.
447
+ * @param params Visualize music parameters.
448
+ * @param options Per-request and polling overrides.
449
+ * @returns The completed visualize music response.
450
+ */
283
451
  async run(params, options) {
284
452
  const { id } = await this.create(params, options);
285
453
  const response = await pollUntilComplete10(() => this.get(id, options), {
@@ -288,12 +456,24 @@ var VisualizeMusic = class {
288
456
  });
289
457
  return response;
290
458
  }
459
+ /**
460
+ * Create a visualize music task; returns immediately with a task id.
461
+ * @param params Visualize music parameters.
462
+ * @param options Per-request overrides.
463
+ * @returns The task creation result.
464
+ */
291
465
  async create(params, options) {
292
466
  return this.http.request("POST", ENDPOINT10, {
293
467
  body: compactParams10(params),
294
468
  ...options
295
469
  });
296
470
  }
471
+ /**
472
+ * Fetch the current status of a visualize music task.
473
+ * @param id The task id.
474
+ * @param options Per-request overrides.
475
+ * @returns The current visualize music task status.
476
+ */
297
477
  async get(id, options) {
298
478
  return this.http.request("GET", `${ENDPOINT10}/${id}`, {
299
479
  ...options
@@ -310,6 +490,12 @@ var GenerateLyrics = class {
310
490
  this.http = http;
311
491
  }
312
492
  http;
493
+ /**
494
+ * Create a generate lyrics task and wait until complete.
495
+ * @param params Generate lyrics parameters.
496
+ * @param options Per-request and polling overrides.
497
+ * @returns The completed generate lyrics response.
498
+ */
313
499
  async run(params, options) {
314
500
  const { id } = await this.create(params, options);
315
501
  const response = await pollUntilComplete11(() => this.get(id, options), {
@@ -318,12 +504,24 @@ var GenerateLyrics = class {
318
504
  });
319
505
  return response;
320
506
  }
507
+ /**
508
+ * Create a generate lyrics task; returns immediately with a task id.
509
+ * @param params Generate lyrics parameters.
510
+ * @param options Per-request overrides.
511
+ * @returns The task creation result.
512
+ */
321
513
  async create(params, options) {
322
514
  return this.http.request("POST", ENDPOINT11, {
323
515
  body: compactParams11(params),
324
516
  ...options
325
517
  });
326
518
  }
519
+ /**
520
+ * Fetch the current status of a generate lyrics task.
521
+ * @param id The task id.
522
+ * @param options Per-request overrides.
523
+ * @returns The current generate lyrics task status.
524
+ */
327
525
  async get(id, options) {
328
526
  return this.http.request("GET", `${ENDPOINT11}/${id}`, {
329
527
  ...options
@@ -339,6 +537,12 @@ var GetTimestampedLyrics = class {
339
537
  this.http = http;
340
538
  }
341
539
  http;
540
+ /**
541
+ * Run get timestamped lyrics (synchronous).
542
+ * @param params Get timestamped lyrics parameters.
543
+ * @param options Per-request overrides.
544
+ * @returns The get timestamped lyrics response.
545
+ */
342
546
  async run(params, options) {
343
547
  return this.http.request("POST", ENDPOINT12, {
344
548
  body: compactParams12(params),
@@ -356,6 +560,12 @@ var ReplaceSection = class {
356
560
  this.http = http;
357
561
  }
358
562
  http;
563
+ /**
564
+ * Create a replace section task and wait until complete.
565
+ * @param params Replace section parameters.
566
+ * @param options Per-request and polling overrides.
567
+ * @returns The completed replace section response.
568
+ */
359
569
  async run(params, options) {
360
570
  const { id } = await this.create(params, options);
361
571
  const response = await pollUntilComplete12(() => this.get(id, options), {
@@ -364,12 +574,24 @@ var ReplaceSection = class {
364
574
  });
365
575
  return response;
366
576
  }
577
+ /**
578
+ * Create a replace section task; returns immediately with a task id.
579
+ * @param params Replace section parameters.
580
+ * @param options Per-request overrides.
581
+ * @returns The task creation result.
582
+ */
367
583
  async create(params, options) {
368
584
  return this.http.request("POST", ENDPOINT13, {
369
585
  body: compactParams13(params),
370
586
  ...options
371
587
  });
372
588
  }
589
+ /**
590
+ * Fetch the current status of a replace section task.
591
+ * @param id The task id.
592
+ * @param options Per-request overrides.
593
+ * @returns The current replace section task status.
594
+ */
373
595
  async get(id, options) {
374
596
  return this.http.request("GET", `${ENDPOINT13}/${id}`, {
375
597
  ...options
@@ -386,6 +608,12 @@ var CreateMashup = class {
386
608
  this.http = http;
387
609
  }
388
610
  http;
611
+ /**
612
+ * Create a create mashup task and wait until complete.
613
+ * @param params Create mashup parameters.
614
+ * @param options Per-request and polling overrides.
615
+ * @returns The completed create mashup response.
616
+ */
389
617
  async run(params, options) {
390
618
  const { id } = await this.create(params, options);
391
619
  const response = await pollUntilComplete13(() => this.get(id, options), {
@@ -394,12 +622,24 @@ var CreateMashup = class {
394
622
  });
395
623
  return response;
396
624
  }
625
+ /**
626
+ * Create a create mashup task; returns immediately with a task id.
627
+ * @param params Create mashup parameters.
628
+ * @param options Per-request overrides.
629
+ * @returns The task creation result.
630
+ */
397
631
  async create(params, options) {
398
632
  return this.http.request("POST", ENDPOINT14, {
399
633
  body: compactParams14(params),
400
634
  ...options
401
635
  });
402
636
  }
637
+ /**
638
+ * Fetch the current status of a create mashup task.
639
+ * @param id The task id.
640
+ * @param options Per-request overrides.
641
+ * @returns The current create mashup task status.
642
+ */
403
643
  async get(id, options) {
404
644
  return this.http.request("GET", `${ENDPOINT14}/${id}`, {
405
645
  ...options
@@ -416,6 +656,12 @@ var TextToSound = class {
416
656
  this.http = http;
417
657
  }
418
658
  http;
659
+ /**
660
+ * Create a text to sound task and wait until complete.
661
+ * @param params Text to sound parameters.
662
+ * @param options Per-request and polling overrides.
663
+ * @returns The completed text to sound response.
664
+ */
419
665
  async run(params, options) {
420
666
  const { id } = await this.create(params, options);
421
667
  const response = await pollUntilComplete14(() => this.get(id, options), {
@@ -424,12 +670,24 @@ var TextToSound = class {
424
670
  });
425
671
  return response;
426
672
  }
673
+ /**
674
+ * Create a text to sound task; returns immediately with a task id.
675
+ * @param params Text to sound parameters.
676
+ * @param options Per-request overrides.
677
+ * @returns The task creation result.
678
+ */
427
679
  async create(params, options) {
428
680
  return this.http.request("POST", ENDPOINT15, {
429
681
  body: compactParams15(params),
430
682
  ...options
431
683
  });
432
684
  }
685
+ /**
686
+ * Fetch the current status of a text to sound task.
687
+ * @param id The task id.
688
+ * @param options Per-request overrides.
689
+ * @returns The current text to sound task status.
690
+ */
433
691
  async get(id, options) {
434
692
  return this.http.request("GET", `${ENDPOINT15}/${id}`, {
435
693
  ...options
@@ -445,6 +703,12 @@ var GeneratePersona = class {
445
703
  this.http = http;
446
704
  }
447
705
  http;
706
+ /**
707
+ * Run generate persona (synchronous).
708
+ * @param params Generate persona parameters.
709
+ * @param options Per-request overrides.
710
+ * @returns The generate persona response.
711
+ */
448
712
  async run(params, options) {
449
713
  return this.http.request("POST", ENDPOINT16, {
450
714
  body: compactParams16(params),
@@ -461,6 +725,12 @@ var BoostStyle = class {
461
725
  this.http = http;
462
726
  }
463
727
  http;
728
+ /**
729
+ * Run boost style (synchronous).
730
+ * @param params Boost style parameters.
731
+ * @param options Per-request overrides.
732
+ * @returns The boost style response.
733
+ */
464
734
  async run(params, options) {
465
735
  return this.http.request("POST", ENDPOINT17, {
466
736
  body: compactParams17(params),
@@ -469,44 +739,239 @@ var BoostStyle = class {
469
739
  }
470
740
  };
471
741
 
742
+ // src/resources/voice-to-validation-phrase.ts
743
+ import { compactParams as compactParams18 } from "@runapi.ai/core";
744
+ import { pollUntilComplete as pollUntilComplete15 } from "@runapi.ai/core/internal";
745
+ var ENDPOINT18 = "/api/v1/suno/voice_to_validation_phrase";
746
+ var VoiceToValidationPhrase = class {
747
+ constructor(http) {
748
+ this.http = http;
749
+ }
750
+ http;
751
+ /**
752
+ * Create a voice to validation phrase task and wait until complete.
753
+ * @param params Voice to validation phrase parameters.
754
+ * @param options Per-request and polling overrides.
755
+ * @returns The completed voice to validation phrase response.
756
+ */
757
+ async run(params, options) {
758
+ const { id } = await this.create(params, options);
759
+ const response = await pollUntilComplete15(() => this.get(id, options), {
760
+ maxWaitMs: options?.maxWaitMs,
761
+ pollIntervalMs: options?.pollIntervalMs
762
+ });
763
+ return response;
764
+ }
765
+ /**
766
+ * Create a voice to validation phrase task; returns immediately with a task id.
767
+ * @param params Voice to validation phrase parameters.
768
+ * @param options Per-request overrides.
769
+ * @returns The task creation result.
770
+ */
771
+ async create(params, options) {
772
+ return this.http.request("POST", ENDPOINT18, {
773
+ body: compactParams18(params),
774
+ ...options
775
+ });
776
+ }
777
+ /**
778
+ * Fetch the current status of a voice to validation phrase task.
779
+ * @param id The task id.
780
+ * @param options Per-request overrides.
781
+ * @returns The current voice to validation phrase task status.
782
+ */
783
+ async get(id, options) {
784
+ return this.http.request("GET", `${ENDPOINT18}/${id}`, {
785
+ ...options
786
+ });
787
+ }
788
+ };
789
+
790
+ // src/resources/regenerate-validation-phrase.ts
791
+ import { compactParams as compactParams19 } from "@runapi.ai/core";
792
+ import { pollUntilComplete as pollUntilComplete16 } from "@runapi.ai/core/internal";
793
+ var ENDPOINT19 = "/api/v1/suno/regenerate_validation_phrase";
794
+ var RegenerateValidationPhrase = class {
795
+ constructor(http) {
796
+ this.http = http;
797
+ }
798
+ http;
799
+ /**
800
+ * Create a regenerate validation phrase task and wait until complete.
801
+ * @param params Regenerate validation phrase parameters.
802
+ * @param options Per-request and polling overrides.
803
+ * @returns The completed regenerate validation phrase response.
804
+ */
805
+ async run(params, options) {
806
+ const { id } = await this.create(params, options);
807
+ const response = await pollUntilComplete16(() => this.get(id, options), {
808
+ maxWaitMs: options?.maxWaitMs,
809
+ pollIntervalMs: options?.pollIntervalMs
810
+ });
811
+ return response;
812
+ }
813
+ /**
814
+ * Create a regenerate validation phrase task; returns immediately with a task id.
815
+ * @param params Regenerate validation phrase parameters.
816
+ * @param options Per-request overrides.
817
+ * @returns The task creation result.
818
+ */
819
+ async create(params, options) {
820
+ return this.http.request("POST", ENDPOINT19, {
821
+ body: compactParams19(params),
822
+ ...options
823
+ });
824
+ }
825
+ /**
826
+ * Fetch the current status of a regenerate validation phrase task.
827
+ * @param id The task id.
828
+ * @param options Per-request overrides.
829
+ * @returns The current regenerate validation phrase task status.
830
+ */
831
+ async get(id, options) {
832
+ return this.http.request("GET", `${ENDPOINT19}/${id}`, {
833
+ ...options
834
+ });
835
+ }
836
+ };
837
+
838
+ // src/resources/generate-voice.ts
839
+ import { compactParams as compactParams20 } from "@runapi.ai/core";
840
+ import { pollUntilComplete as pollUntilComplete17 } from "@runapi.ai/core/internal";
841
+ var ENDPOINT20 = "/api/v1/suno/generate_voice";
842
+ var GenerateVoice = class {
843
+ constructor(http) {
844
+ this.http = http;
845
+ }
846
+ http;
847
+ /**
848
+ * Create a generate voice task and wait until complete.
849
+ * @param params Generate voice parameters.
850
+ * @param options Per-request and polling overrides.
851
+ * @returns The completed generate voice response.
852
+ */
853
+ async run(params, options) {
854
+ const { id } = await this.create(params, options);
855
+ const response = await pollUntilComplete17(() => this.get(id, options), {
856
+ maxWaitMs: options?.maxWaitMs,
857
+ pollIntervalMs: options?.pollIntervalMs
858
+ });
859
+ return response;
860
+ }
861
+ /**
862
+ * Create a generate voice task; returns immediately with a task id.
863
+ * @param params Generate voice parameters.
864
+ * @param options Per-request overrides.
865
+ * @returns The task creation result.
866
+ */
867
+ async create(params, options) {
868
+ return this.http.request("POST", ENDPOINT20, {
869
+ body: compactParams20(params),
870
+ ...options
871
+ });
872
+ }
873
+ /**
874
+ * Fetch the current status of a generate voice task.
875
+ * @param id The task id.
876
+ * @param options Per-request overrides.
877
+ * @returns The current generate voice task status.
878
+ */
879
+ async get(id, options) {
880
+ return this.http.request("GET", `${ENDPOINT20}/${id}`, {
881
+ ...options
882
+ });
883
+ }
884
+ };
885
+
886
+ // src/resources/check-voice.ts
887
+ import { compactParams as compactParams21 } from "@runapi.ai/core";
888
+ var ENDPOINT21 = "/api/v1/suno/check_voice";
889
+ var CheckVoice = class {
890
+ constructor(http) {
891
+ this.http = http;
892
+ }
893
+ http;
894
+ /**
895
+ * Run check voice (synchronous).
896
+ * @param params Check voice parameters.
897
+ * @param options Per-request overrides.
898
+ * @returns The check voice response.
899
+ */
900
+ async run(params, options) {
901
+ return this.http.request("POST", ENDPOINT21, {
902
+ body: compactParams21(params),
903
+ ...options
904
+ });
905
+ }
906
+ };
907
+
472
908
  // src/client.ts
473
- var SunoClient = class {
909
+ var SunoClient = class extends BaseClient {
910
+ /** Generates songs from a text prompt with configurable vocal mode, style, and persona. */
474
911
  textToMusic;
912
+ /** Continues an existing track from a specified timestamp, inheriting or overriding its settings. */
475
913
  extendMusic;
914
+ /** Creates cover artwork for an existing music task. */
476
915
  generateArtwork;
916
+ /** Re-records vocals over an uploaded audio file with a new style or voice. */
477
917
  coverAudio;
918
+ /** Generates and adds an instrumental backing track to uploaded audio. */
478
919
  addInstrumental;
920
+ /** Generates and adds vocals to an uploaded instrumental track. */
479
921
  addVocals;
922
+ /** Splits a track into individual instrument stems (vocals, drums, bass, guitar, etc.). */
480
923
  separateAudioStems;
924
+ /** Extracts per-instrument MIDI note data from a generated track. */
481
925
  generateMidi;
926
+ /** Converts a generated track to WAV format. */
482
927
  convertAudio;
928
+ /** Generates a music visualization video from an existing track. */
483
929
  visualizeMusic;
930
+ /** Produces AI-generated lyrics from a text prompt. */
484
931
  generateLyrics;
932
+ /** Retrieves word-level timing alignment for a track. Synchronous (run only). */
485
933
  getTimestampedLyrics;
934
+ /** Re-generates a time range within an existing track with new lyrics and style. */
486
935
  replaceSection;
936
+ /** Blends two audio tracks into a single new composition. */
487
937
  createMashup;
938
+ /** Generates sound effects (not music) from a text description with optional looping and BPM control. */
488
939
  textToSound;
940
+ /** Creates a reusable style or voice persona from a track's vocals. Synchronous (run only). */
489
941
  generatePersona;
942
+ /** Generates style/genre tags from a text description for use in style fields. Synchronous (run only). */
490
943
  boostStyle;
944
+ /** Step 1 of voice cloning: extracts a validation phrase from a voice recording. */
945
+ voiceToValidationPhrase;
946
+ /** Step 2 (optional) of voice cloning: requests a new, easier validation phrase. */
947
+ regenerateValidationPhrase;
948
+ /** Step 3 of voice cloning: trains a custom voice from the user's recording of the validation phrase. */
949
+ generateVoice;
950
+ /** Step 4 of voice cloning: checks whether a custom voice is ready for use. Synchronous (run only). */
951
+ checkVoice;
491
952
  constructor(options = {}) {
492
- const http = createHttpClient(options);
493
- this.textToMusic = new TextToMusic(http);
494
- this.extendMusic = new ExtendMusic(http);
495
- this.generateArtwork = new GenerateArtwork(http);
496
- this.coverAudio = new CoverAudio(http);
497
- this.addInstrumental = new AddInstrumental(http);
498
- this.addVocals = new AddVocals(http);
499
- this.separateAudioStems = new SeparateAudioStems(http);
500
- this.generateMidi = new GenerateMidi(http);
501
- this.convertAudio = new ConvertAudio(http);
502
- this.visualizeMusic = new VisualizeMusic(http);
503
- this.generateLyrics = new GenerateLyrics(http);
504
- this.getTimestampedLyrics = new GetTimestampedLyrics(http);
505
- this.replaceSection = new ReplaceSection(http);
506
- this.createMashup = new CreateMashup(http);
507
- this.textToSound = new TextToSound(http);
508
- this.generatePersona = new GeneratePersona(http);
509
- this.boostStyle = new BoostStyle(http);
953
+ super(options);
954
+ this.textToMusic = new TextToMusic(this.http);
955
+ this.extendMusic = new ExtendMusic(this.http);
956
+ this.generateArtwork = new GenerateArtwork(this.http);
957
+ this.coverAudio = new CoverAudio(this.http);
958
+ this.addInstrumental = new AddInstrumental(this.http);
959
+ this.addVocals = new AddVocals(this.http);
960
+ this.separateAudioStems = new SeparateAudioStems(this.http);
961
+ this.generateMidi = new GenerateMidi(this.http);
962
+ this.convertAudio = new ConvertAudio(this.http);
963
+ this.visualizeMusic = new VisualizeMusic(this.http);
964
+ this.generateLyrics = new GenerateLyrics(this.http);
965
+ this.getTimestampedLyrics = new GetTimestampedLyrics(this.http);
966
+ this.replaceSection = new ReplaceSection(this.http);
967
+ this.createMashup = new CreateMashup(this.http);
968
+ this.textToSound = new TextToSound(this.http);
969
+ this.generatePersona = new GeneratePersona(this.http);
970
+ this.boostStyle = new BoostStyle(this.http);
971
+ this.voiceToValidationPhrase = new VoiceToValidationPhrase(this.http);
972
+ this.regenerateValidationPhrase = new RegenerateValidationPhrase(this.http);
973
+ this.generateVoice = new GenerateVoice(this.http);
974
+ this.checkVoice = new CheckVoice(this.http);
510
975
  }
511
976
  };
512
977