@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.js CHANGED
@@ -20,23 +20,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- AuthenticationError: () => import_core19.AuthenticationError,
24
- InsufficientCreditsError: () => import_core19.InsufficientCreditsError,
25
- NetworkError: () => import_core19.NetworkError,
26
- NotFoundError: () => import_core19.NotFoundError,
27
- RateLimitError: () => import_core19.RateLimitError,
28
- RunApiError: () => import_core19.RunApiError,
29
- ServiceUnavailableError: () => import_core19.ServiceUnavailableError,
23
+ AuthenticationError: () => import_core23.AuthenticationError,
24
+ InsufficientCreditsError: () => import_core23.InsufficientCreditsError,
25
+ NetworkError: () => import_core23.NetworkError,
26
+ NotFoundError: () => import_core23.NotFoundError,
27
+ RateLimitError: () => import_core23.RateLimitError,
28
+ RunApiError: () => import_core23.RunApiError,
29
+ ServiceUnavailableError: () => import_core23.ServiceUnavailableError,
30
30
  SunoClient: () => SunoClient,
31
- TaskFailedError: () => import_core19.TaskFailedError,
32
- TaskTimeoutError: () => import_core19.TaskTimeoutError,
33
- TimeoutError: () => import_core19.TimeoutError,
34
- ValidationError: () => import_core19.ValidationError
31
+ TaskFailedError: () => import_core23.TaskFailedError,
32
+ TaskTimeoutError: () => import_core23.TaskTimeoutError,
33
+ TimeoutError: () => import_core23.TimeoutError,
34
+ ValidationError: () => import_core23.ValidationError
35
35
  });
36
36
  module.exports = __toCommonJS(index_exports);
37
37
 
38
38
  // src/client.ts
39
- var import_core18 = require("@runapi.ai/core");
39
+ var import_core22 = require("@runapi.ai/core");
40
40
 
41
41
  // src/resources/text-to-music.ts
42
42
  var import_core = require("@runapi.ai/core");
@@ -47,6 +47,12 @@ var TextToMusic = class {
47
47
  this.http = http;
48
48
  }
49
49
  http;
50
+ /**
51
+ * Create a text to music task and wait until complete.
52
+ * @param params Text to music parameters.
53
+ * @param options Per-request and polling overrides.
54
+ * @returns The completed text to music response.
55
+ */
50
56
  async run(params, options) {
51
57
  const { id } = await this.create(params, options);
52
58
  const response = await (0, import_internal.pollUntilComplete)(() => this.get(id, options), {
@@ -55,12 +61,24 @@ var TextToMusic = class {
55
61
  });
56
62
  return response;
57
63
  }
64
+ /**
65
+ * Create a text to music task; returns immediately with a task id.
66
+ * @param params Text to music parameters.
67
+ * @param options Per-request overrides.
68
+ * @returns The task creation result.
69
+ */
58
70
  async create(params, options) {
59
71
  return this.http.request("POST", ENDPOINT, {
60
72
  body: (0, import_core.compactParams)(params),
61
73
  ...options
62
74
  });
63
75
  }
76
+ /**
77
+ * Fetch the current status of a text to music task.
78
+ * @param id The task id.
79
+ * @param options Per-request overrides.
80
+ * @returns The current text to music task status.
81
+ */
64
82
  async get(id, options) {
65
83
  return this.http.request("GET", `${ENDPOINT}/${id}`, {
66
84
  ...options
@@ -77,6 +95,12 @@ var ExtendMusic = class {
77
95
  this.http = http;
78
96
  }
79
97
  http;
98
+ /**
99
+ * Create an extend music task and wait until complete.
100
+ * @param params Extend music parameters.
101
+ * @param options Per-request and polling overrides.
102
+ * @returns The completed extend music response.
103
+ */
80
104
  async run(params, options) {
81
105
  const { id } = await this.create(params, options);
82
106
  const response = await (0, import_internal2.pollUntilComplete)(() => this.get(id, options), {
@@ -85,12 +109,24 @@ var ExtendMusic = class {
85
109
  });
86
110
  return response;
87
111
  }
112
+ /**
113
+ * Create an extend music task; returns immediately with a task id.
114
+ * @param params Extend music parameters.
115
+ * @param options Per-request overrides.
116
+ * @returns The task creation result.
117
+ */
88
118
  async create(params, options) {
89
119
  return this.http.request("POST", ENDPOINT2, {
90
120
  body: (0, import_core2.compactParams)(params),
91
121
  ...options
92
122
  });
93
123
  }
124
+ /**
125
+ * Fetch the current status of an extend music task.
126
+ * @param id The task id.
127
+ * @param options Per-request overrides.
128
+ * @returns The current extend music task status.
129
+ */
94
130
  async get(id, options) {
95
131
  return this.http.request("GET", `${ENDPOINT2}/${id}`, {
96
132
  ...options
@@ -107,6 +143,12 @@ var GenerateArtwork = class {
107
143
  this.http = http;
108
144
  }
109
145
  http;
146
+ /**
147
+ * Create a generate artwork task and wait until complete.
148
+ * @param params Generate artwork parameters.
149
+ * @param options Per-request and polling overrides.
150
+ * @returns The completed generate artwork response.
151
+ */
110
152
  async run(params, options) {
111
153
  const { id } = await this.create(params, options);
112
154
  const response = await (0, import_internal3.pollUntilComplete)(() => this.get(id, options), {
@@ -115,12 +157,24 @@ var GenerateArtwork = class {
115
157
  });
116
158
  return response;
117
159
  }
160
+ /**
161
+ * Create a generate artwork task; returns immediately with a task id.
162
+ * @param params Generate artwork parameters.
163
+ * @param options Per-request overrides.
164
+ * @returns The task creation result.
165
+ */
118
166
  async create(params, options) {
119
167
  return this.http.request("POST", ENDPOINT3, {
120
168
  body: (0, import_core3.compactParams)(params),
121
169
  ...options
122
170
  });
123
171
  }
172
+ /**
173
+ * Fetch the current status of a generate artwork task.
174
+ * @param id The task id.
175
+ * @param options Per-request overrides.
176
+ * @returns The current generate artwork task status.
177
+ */
124
178
  async get(id, options) {
125
179
  return this.http.request("GET", `${ENDPOINT3}/${id}`, {
126
180
  ...options
@@ -137,6 +191,12 @@ var CoverAudio = class {
137
191
  this.http = http;
138
192
  }
139
193
  http;
194
+ /**
195
+ * Create a cover audio task and wait until complete.
196
+ * @param params Cover audio parameters.
197
+ * @param options Per-request and polling overrides.
198
+ * @returns The completed cover audio response.
199
+ */
140
200
  async run(params, options) {
141
201
  const { id } = await this.create(params, options);
142
202
  const response = await (0, import_internal4.pollUntilComplete)(() => this.get(id, options), {
@@ -145,12 +205,24 @@ var CoverAudio = class {
145
205
  });
146
206
  return response;
147
207
  }
208
+ /**
209
+ * Create a cover audio task; returns immediately with a task id.
210
+ * @param params Cover audio parameters.
211
+ * @param options Per-request overrides.
212
+ * @returns The task creation result.
213
+ */
148
214
  async create(params, options) {
149
215
  return this.http.request("POST", ENDPOINT4, {
150
216
  body: (0, import_core4.compactParams)(params),
151
217
  ...options
152
218
  });
153
219
  }
220
+ /**
221
+ * Fetch the current status of a cover audio task.
222
+ * @param id The task id.
223
+ * @param options Per-request overrides.
224
+ * @returns The current cover audio task status.
225
+ */
154
226
  async get(id, options) {
155
227
  return this.http.request("GET", `${ENDPOINT4}/${id}`, {
156
228
  ...options
@@ -167,6 +239,12 @@ var AddInstrumental = class {
167
239
  this.http = http;
168
240
  }
169
241
  http;
242
+ /**
243
+ * Create an add instrumental task and wait until complete.
244
+ * @param params Add instrumental parameters.
245
+ * @param options Per-request and polling overrides.
246
+ * @returns The completed add instrumental response.
247
+ */
170
248
  async run(params, options) {
171
249
  const { id } = await this.create(params, options);
172
250
  const response = await (0, import_internal5.pollUntilComplete)(() => this.get(id, options), {
@@ -175,12 +253,24 @@ var AddInstrumental = class {
175
253
  });
176
254
  return response;
177
255
  }
256
+ /**
257
+ * Create an add instrumental task; returns immediately with a task id.
258
+ * @param params Add instrumental parameters.
259
+ * @param options Per-request overrides.
260
+ * @returns The task creation result.
261
+ */
178
262
  async create(params, options) {
179
263
  return this.http.request("POST", ENDPOINT5, {
180
264
  body: (0, import_core5.compactParams)(params),
181
265
  ...options
182
266
  });
183
267
  }
268
+ /**
269
+ * Fetch the current status of an add instrumental task.
270
+ * @param id The task id.
271
+ * @param options Per-request overrides.
272
+ * @returns The current add instrumental task status.
273
+ */
184
274
  async get(id, options) {
185
275
  return this.http.request("GET", `${ENDPOINT5}/${id}`, {
186
276
  ...options
@@ -197,6 +287,12 @@ var AddVocals = class {
197
287
  this.http = http;
198
288
  }
199
289
  http;
290
+ /**
291
+ * Create an add vocals task and wait until complete.
292
+ * @param params Add vocals parameters.
293
+ * @param options Per-request and polling overrides.
294
+ * @returns The completed add vocals response.
295
+ */
200
296
  async run(params, options) {
201
297
  const { id } = await this.create(params, options);
202
298
  const response = await (0, import_internal6.pollUntilComplete)(() => this.get(id, options), {
@@ -205,12 +301,24 @@ var AddVocals = class {
205
301
  });
206
302
  return response;
207
303
  }
304
+ /**
305
+ * Create an add vocals task; returns immediately with a task id.
306
+ * @param params Add vocals parameters.
307
+ * @param options Per-request overrides.
308
+ * @returns The task creation result.
309
+ */
208
310
  async create(params, options) {
209
311
  return this.http.request("POST", ENDPOINT6, {
210
312
  body: (0, import_core6.compactParams)(params),
211
313
  ...options
212
314
  });
213
315
  }
316
+ /**
317
+ * Fetch the current status of an add vocals task.
318
+ * @param id The task id.
319
+ * @param options Per-request overrides.
320
+ * @returns The current add vocals task status.
321
+ */
214
322
  async get(id, options) {
215
323
  return this.http.request("GET", `${ENDPOINT6}/${id}`, {
216
324
  ...options
@@ -227,6 +335,12 @@ var SeparateAudioStems = class {
227
335
  this.http = http;
228
336
  }
229
337
  http;
338
+ /**
339
+ * Create a separate audio stems task and wait until complete.
340
+ * @param params Separate audio stems parameters.
341
+ * @param options Per-request and polling overrides.
342
+ * @returns The completed separate audio stems response.
343
+ */
230
344
  async run(params, options) {
231
345
  const { id } = await this.create(params, options);
232
346
  const response = await (0, import_internal7.pollUntilComplete)(() => this.get(id, options), {
@@ -235,12 +349,24 @@ var SeparateAudioStems = class {
235
349
  });
236
350
  return response;
237
351
  }
352
+ /**
353
+ * Create a separate audio stems task; returns immediately with a task id.
354
+ * @param params Separate audio stems parameters.
355
+ * @param options Per-request overrides.
356
+ * @returns The task creation result.
357
+ */
238
358
  async create(params, options) {
239
359
  return this.http.request("POST", ENDPOINT7, {
240
360
  body: (0, import_core7.compactParams)(params),
241
361
  ...options
242
362
  });
243
363
  }
364
+ /**
365
+ * Fetch the current status of a separate audio stems task.
366
+ * @param id The task id.
367
+ * @param options Per-request overrides.
368
+ * @returns The current separate audio stems task status.
369
+ */
244
370
  async get(id, options) {
245
371
  return this.http.request("GET", `${ENDPOINT7}/${id}`, {
246
372
  ...options
@@ -257,6 +383,12 @@ var GenerateMidi = class {
257
383
  this.http = http;
258
384
  }
259
385
  http;
386
+ /**
387
+ * Create a generate midi task and wait until complete.
388
+ * @param params Generate midi parameters.
389
+ * @param options Per-request and polling overrides.
390
+ * @returns The completed generate midi response.
391
+ */
260
392
  async run(params, options) {
261
393
  const { id } = await this.create(params, options);
262
394
  const response = await (0, import_internal8.pollUntilComplete)(() => this.get(id, options), {
@@ -265,12 +397,24 @@ var GenerateMidi = class {
265
397
  });
266
398
  return response;
267
399
  }
400
+ /**
401
+ * Create a generate midi task; returns immediately with a task id.
402
+ * @param params Generate midi parameters.
403
+ * @param options Per-request overrides.
404
+ * @returns The task creation result.
405
+ */
268
406
  async create(params, options) {
269
407
  return this.http.request("POST", ENDPOINT8, {
270
408
  body: (0, import_core8.compactParams)(params),
271
409
  ...options
272
410
  });
273
411
  }
412
+ /**
413
+ * Fetch the current status of a generate midi task.
414
+ * @param id The task id.
415
+ * @param options Per-request overrides.
416
+ * @returns The current generate midi task status.
417
+ */
274
418
  async get(id, options) {
275
419
  return this.http.request("GET", `${ENDPOINT8}/${id}`, {
276
420
  ...options
@@ -287,6 +431,12 @@ var ConvertAudio = class {
287
431
  this.http = http;
288
432
  }
289
433
  http;
434
+ /**
435
+ * Create a convert audio task and wait until complete.
436
+ * @param params Convert audio parameters.
437
+ * @param options Per-request and polling overrides.
438
+ * @returns The completed convert audio response.
439
+ */
290
440
  async run(params, options) {
291
441
  const { id } = await this.create(params, options);
292
442
  const response = await (0, import_internal9.pollUntilComplete)(() => this.get(id, options), {
@@ -295,12 +445,24 @@ var ConvertAudio = class {
295
445
  });
296
446
  return response;
297
447
  }
448
+ /**
449
+ * Create a convert audio task; returns immediately with a task id.
450
+ * @param params Convert audio parameters.
451
+ * @param options Per-request overrides.
452
+ * @returns The task creation result.
453
+ */
298
454
  async create(params, options) {
299
455
  return this.http.request("POST", ENDPOINT9, {
300
456
  body: (0, import_core9.compactParams)(params),
301
457
  ...options
302
458
  });
303
459
  }
460
+ /**
461
+ * Fetch the current status of a convert audio task.
462
+ * @param id The task id.
463
+ * @param options Per-request overrides.
464
+ * @returns The current convert audio task status.
465
+ */
304
466
  async get(id, options) {
305
467
  return this.http.request("GET", `${ENDPOINT9}/${id}`, {
306
468
  ...options
@@ -317,6 +479,12 @@ var VisualizeMusic = class {
317
479
  this.http = http;
318
480
  }
319
481
  http;
482
+ /**
483
+ * Create a visualize music task and wait until complete.
484
+ * @param params Visualize music parameters.
485
+ * @param options Per-request and polling overrides.
486
+ * @returns The completed visualize music response.
487
+ */
320
488
  async run(params, options) {
321
489
  const { id } = await this.create(params, options);
322
490
  const response = await (0, import_internal10.pollUntilComplete)(() => this.get(id, options), {
@@ -325,12 +493,24 @@ var VisualizeMusic = class {
325
493
  });
326
494
  return response;
327
495
  }
496
+ /**
497
+ * Create a visualize music task; returns immediately with a task id.
498
+ * @param params Visualize music parameters.
499
+ * @param options Per-request overrides.
500
+ * @returns The task creation result.
501
+ */
328
502
  async create(params, options) {
329
503
  return this.http.request("POST", ENDPOINT10, {
330
504
  body: (0, import_core10.compactParams)(params),
331
505
  ...options
332
506
  });
333
507
  }
508
+ /**
509
+ * Fetch the current status of a visualize music task.
510
+ * @param id The task id.
511
+ * @param options Per-request overrides.
512
+ * @returns The current visualize music task status.
513
+ */
334
514
  async get(id, options) {
335
515
  return this.http.request("GET", `${ENDPOINT10}/${id}`, {
336
516
  ...options
@@ -347,6 +527,12 @@ var GenerateLyrics = class {
347
527
  this.http = http;
348
528
  }
349
529
  http;
530
+ /**
531
+ * Create a generate lyrics task and wait until complete.
532
+ * @param params Generate lyrics parameters.
533
+ * @param options Per-request and polling overrides.
534
+ * @returns The completed generate lyrics response.
535
+ */
350
536
  async run(params, options) {
351
537
  const { id } = await this.create(params, options);
352
538
  const response = await (0, import_internal11.pollUntilComplete)(() => this.get(id, options), {
@@ -355,12 +541,24 @@ var GenerateLyrics = class {
355
541
  });
356
542
  return response;
357
543
  }
544
+ /**
545
+ * Create a generate lyrics task; returns immediately with a task id.
546
+ * @param params Generate lyrics parameters.
547
+ * @param options Per-request overrides.
548
+ * @returns The task creation result.
549
+ */
358
550
  async create(params, options) {
359
551
  return this.http.request("POST", ENDPOINT11, {
360
552
  body: (0, import_core11.compactParams)(params),
361
553
  ...options
362
554
  });
363
555
  }
556
+ /**
557
+ * Fetch the current status of a generate lyrics task.
558
+ * @param id The task id.
559
+ * @param options Per-request overrides.
560
+ * @returns The current generate lyrics task status.
561
+ */
364
562
  async get(id, options) {
365
563
  return this.http.request("GET", `${ENDPOINT11}/${id}`, {
366
564
  ...options
@@ -376,6 +574,12 @@ var GetTimestampedLyrics = class {
376
574
  this.http = http;
377
575
  }
378
576
  http;
577
+ /**
578
+ * Run get timestamped lyrics (synchronous).
579
+ * @param params Get timestamped lyrics parameters.
580
+ * @param options Per-request overrides.
581
+ * @returns The get timestamped lyrics response.
582
+ */
379
583
  async run(params, options) {
380
584
  return this.http.request("POST", ENDPOINT12, {
381
585
  body: (0, import_core12.compactParams)(params),
@@ -393,6 +597,12 @@ var ReplaceSection = class {
393
597
  this.http = http;
394
598
  }
395
599
  http;
600
+ /**
601
+ * Create a replace section task and wait until complete.
602
+ * @param params Replace section parameters.
603
+ * @param options Per-request and polling overrides.
604
+ * @returns The completed replace section response.
605
+ */
396
606
  async run(params, options) {
397
607
  const { id } = await this.create(params, options);
398
608
  const response = await (0, import_internal12.pollUntilComplete)(() => this.get(id, options), {
@@ -401,12 +611,24 @@ var ReplaceSection = class {
401
611
  });
402
612
  return response;
403
613
  }
614
+ /**
615
+ * Create a replace section task; returns immediately with a task id.
616
+ * @param params Replace section parameters.
617
+ * @param options Per-request overrides.
618
+ * @returns The task creation result.
619
+ */
404
620
  async create(params, options) {
405
621
  return this.http.request("POST", ENDPOINT13, {
406
622
  body: (0, import_core13.compactParams)(params),
407
623
  ...options
408
624
  });
409
625
  }
626
+ /**
627
+ * Fetch the current status of a replace section task.
628
+ * @param id The task id.
629
+ * @param options Per-request overrides.
630
+ * @returns The current replace section task status.
631
+ */
410
632
  async get(id, options) {
411
633
  return this.http.request("GET", `${ENDPOINT13}/${id}`, {
412
634
  ...options
@@ -423,6 +645,12 @@ var CreateMashup = class {
423
645
  this.http = http;
424
646
  }
425
647
  http;
648
+ /**
649
+ * Create a create mashup task and wait until complete.
650
+ * @param params Create mashup parameters.
651
+ * @param options Per-request and polling overrides.
652
+ * @returns The completed create mashup response.
653
+ */
426
654
  async run(params, options) {
427
655
  const { id } = await this.create(params, options);
428
656
  const response = await (0, import_internal13.pollUntilComplete)(() => this.get(id, options), {
@@ -431,12 +659,24 @@ var CreateMashup = class {
431
659
  });
432
660
  return response;
433
661
  }
662
+ /**
663
+ * Create a create mashup task; returns immediately with a task id.
664
+ * @param params Create mashup parameters.
665
+ * @param options Per-request overrides.
666
+ * @returns The task creation result.
667
+ */
434
668
  async create(params, options) {
435
669
  return this.http.request("POST", ENDPOINT14, {
436
670
  body: (0, import_core14.compactParams)(params),
437
671
  ...options
438
672
  });
439
673
  }
674
+ /**
675
+ * Fetch the current status of a create mashup task.
676
+ * @param id The task id.
677
+ * @param options Per-request overrides.
678
+ * @returns The current create mashup task status.
679
+ */
440
680
  async get(id, options) {
441
681
  return this.http.request("GET", `${ENDPOINT14}/${id}`, {
442
682
  ...options
@@ -453,6 +693,12 @@ var TextToSound = class {
453
693
  this.http = http;
454
694
  }
455
695
  http;
696
+ /**
697
+ * Create a text to sound task and wait until complete.
698
+ * @param params Text to sound parameters.
699
+ * @param options Per-request and polling overrides.
700
+ * @returns The completed text to sound response.
701
+ */
456
702
  async run(params, options) {
457
703
  const { id } = await this.create(params, options);
458
704
  const response = await (0, import_internal14.pollUntilComplete)(() => this.get(id, options), {
@@ -461,12 +707,24 @@ var TextToSound = class {
461
707
  });
462
708
  return response;
463
709
  }
710
+ /**
711
+ * Create a text to sound task; returns immediately with a task id.
712
+ * @param params Text to sound parameters.
713
+ * @param options Per-request overrides.
714
+ * @returns The task creation result.
715
+ */
464
716
  async create(params, options) {
465
717
  return this.http.request("POST", ENDPOINT15, {
466
718
  body: (0, import_core15.compactParams)(params),
467
719
  ...options
468
720
  });
469
721
  }
722
+ /**
723
+ * Fetch the current status of a text to sound task.
724
+ * @param id The task id.
725
+ * @param options Per-request overrides.
726
+ * @returns The current text to sound task status.
727
+ */
470
728
  async get(id, options) {
471
729
  return this.http.request("GET", `${ENDPOINT15}/${id}`, {
472
730
  ...options
@@ -482,6 +740,12 @@ var GeneratePersona = class {
482
740
  this.http = http;
483
741
  }
484
742
  http;
743
+ /**
744
+ * Run generate persona (synchronous).
745
+ * @param params Generate persona parameters.
746
+ * @param options Per-request overrides.
747
+ * @returns The generate persona response.
748
+ */
485
749
  async run(params, options) {
486
750
  return this.http.request("POST", ENDPOINT16, {
487
751
  body: (0, import_core16.compactParams)(params),
@@ -498,6 +762,12 @@ var BoostStyle = class {
498
762
  this.http = http;
499
763
  }
500
764
  http;
765
+ /**
766
+ * Run boost style (synchronous).
767
+ * @param params Boost style parameters.
768
+ * @param options Per-request overrides.
769
+ * @returns The boost style response.
770
+ */
501
771
  async run(params, options) {
502
772
  return this.http.request("POST", ENDPOINT17, {
503
773
  body: (0, import_core17.compactParams)(params),
@@ -506,49 +776,244 @@ var BoostStyle = class {
506
776
  }
507
777
  };
508
778
 
779
+ // src/resources/voice-to-validation-phrase.ts
780
+ var import_core18 = require("@runapi.ai/core");
781
+ var import_internal15 = require("@runapi.ai/core/internal");
782
+ var ENDPOINT18 = "/api/v1/suno/voice_to_validation_phrase";
783
+ var VoiceToValidationPhrase = class {
784
+ constructor(http) {
785
+ this.http = http;
786
+ }
787
+ http;
788
+ /**
789
+ * Create a voice to validation phrase task and wait until complete.
790
+ * @param params Voice to validation phrase parameters.
791
+ * @param options Per-request and polling overrides.
792
+ * @returns The completed voice to validation phrase response.
793
+ */
794
+ async run(params, options) {
795
+ const { id } = await this.create(params, options);
796
+ const response = await (0, import_internal15.pollUntilComplete)(() => this.get(id, options), {
797
+ maxWaitMs: options?.maxWaitMs,
798
+ pollIntervalMs: options?.pollIntervalMs
799
+ });
800
+ return response;
801
+ }
802
+ /**
803
+ * Create a voice to validation phrase task; returns immediately with a task id.
804
+ * @param params Voice to validation phrase parameters.
805
+ * @param options Per-request overrides.
806
+ * @returns The task creation result.
807
+ */
808
+ async create(params, options) {
809
+ return this.http.request("POST", ENDPOINT18, {
810
+ body: (0, import_core18.compactParams)(params),
811
+ ...options
812
+ });
813
+ }
814
+ /**
815
+ * Fetch the current status of a voice to validation phrase task.
816
+ * @param id The task id.
817
+ * @param options Per-request overrides.
818
+ * @returns The current voice to validation phrase task status.
819
+ */
820
+ async get(id, options) {
821
+ return this.http.request("GET", `${ENDPOINT18}/${id}`, {
822
+ ...options
823
+ });
824
+ }
825
+ };
826
+
827
+ // src/resources/regenerate-validation-phrase.ts
828
+ var import_core19 = require("@runapi.ai/core");
829
+ var import_internal16 = require("@runapi.ai/core/internal");
830
+ var ENDPOINT19 = "/api/v1/suno/regenerate_validation_phrase";
831
+ var RegenerateValidationPhrase = class {
832
+ constructor(http) {
833
+ this.http = http;
834
+ }
835
+ http;
836
+ /**
837
+ * Create a regenerate validation phrase task and wait until complete.
838
+ * @param params Regenerate validation phrase parameters.
839
+ * @param options Per-request and polling overrides.
840
+ * @returns The completed regenerate validation phrase response.
841
+ */
842
+ async run(params, options) {
843
+ const { id } = await this.create(params, options);
844
+ const response = await (0, import_internal16.pollUntilComplete)(() => this.get(id, options), {
845
+ maxWaitMs: options?.maxWaitMs,
846
+ pollIntervalMs: options?.pollIntervalMs
847
+ });
848
+ return response;
849
+ }
850
+ /**
851
+ * Create a regenerate validation phrase task; returns immediately with a task id.
852
+ * @param params Regenerate validation phrase parameters.
853
+ * @param options Per-request overrides.
854
+ * @returns The task creation result.
855
+ */
856
+ async create(params, options) {
857
+ return this.http.request("POST", ENDPOINT19, {
858
+ body: (0, import_core19.compactParams)(params),
859
+ ...options
860
+ });
861
+ }
862
+ /**
863
+ * Fetch the current status of a regenerate validation phrase task.
864
+ * @param id The task id.
865
+ * @param options Per-request overrides.
866
+ * @returns The current regenerate validation phrase task status.
867
+ */
868
+ async get(id, options) {
869
+ return this.http.request("GET", `${ENDPOINT19}/${id}`, {
870
+ ...options
871
+ });
872
+ }
873
+ };
874
+
875
+ // src/resources/generate-voice.ts
876
+ var import_core20 = require("@runapi.ai/core");
877
+ var import_internal17 = require("@runapi.ai/core/internal");
878
+ var ENDPOINT20 = "/api/v1/suno/generate_voice";
879
+ var GenerateVoice = class {
880
+ constructor(http) {
881
+ this.http = http;
882
+ }
883
+ http;
884
+ /**
885
+ * Create a generate voice task and wait until complete.
886
+ * @param params Generate voice parameters.
887
+ * @param options Per-request and polling overrides.
888
+ * @returns The completed generate voice response.
889
+ */
890
+ async run(params, options) {
891
+ const { id } = await this.create(params, options);
892
+ const response = await (0, import_internal17.pollUntilComplete)(() => this.get(id, options), {
893
+ maxWaitMs: options?.maxWaitMs,
894
+ pollIntervalMs: options?.pollIntervalMs
895
+ });
896
+ return response;
897
+ }
898
+ /**
899
+ * Create a generate voice task; returns immediately with a task id.
900
+ * @param params Generate voice parameters.
901
+ * @param options Per-request overrides.
902
+ * @returns The task creation result.
903
+ */
904
+ async create(params, options) {
905
+ return this.http.request("POST", ENDPOINT20, {
906
+ body: (0, import_core20.compactParams)(params),
907
+ ...options
908
+ });
909
+ }
910
+ /**
911
+ * Fetch the current status of a generate voice task.
912
+ * @param id The task id.
913
+ * @param options Per-request overrides.
914
+ * @returns The current generate voice task status.
915
+ */
916
+ async get(id, options) {
917
+ return this.http.request("GET", `${ENDPOINT20}/${id}`, {
918
+ ...options
919
+ });
920
+ }
921
+ };
922
+
923
+ // src/resources/check-voice.ts
924
+ var import_core21 = require("@runapi.ai/core");
925
+ var ENDPOINT21 = "/api/v1/suno/check_voice";
926
+ var CheckVoice = class {
927
+ constructor(http) {
928
+ this.http = http;
929
+ }
930
+ http;
931
+ /**
932
+ * Run check voice (synchronous).
933
+ * @param params Check voice parameters.
934
+ * @param options Per-request overrides.
935
+ * @returns The check voice response.
936
+ */
937
+ async run(params, options) {
938
+ return this.http.request("POST", ENDPOINT21, {
939
+ body: (0, import_core21.compactParams)(params),
940
+ ...options
941
+ });
942
+ }
943
+ };
944
+
509
945
  // src/client.ts
510
- var SunoClient = class {
946
+ var SunoClient = class extends import_core22.BaseClient {
947
+ /** Generates songs from a text prompt with configurable vocal mode, style, and persona. */
511
948
  textToMusic;
949
+ /** Continues an existing track from a specified timestamp, inheriting or overriding its settings. */
512
950
  extendMusic;
951
+ /** Creates cover artwork for an existing music task. */
513
952
  generateArtwork;
953
+ /** Re-records vocals over an uploaded audio file with a new style or voice. */
514
954
  coverAudio;
955
+ /** Generates and adds an instrumental backing track to uploaded audio. */
515
956
  addInstrumental;
957
+ /** Generates and adds vocals to an uploaded instrumental track. */
516
958
  addVocals;
959
+ /** Splits a track into individual instrument stems (vocals, drums, bass, guitar, etc.). */
517
960
  separateAudioStems;
961
+ /** Extracts per-instrument MIDI note data from a generated track. */
518
962
  generateMidi;
963
+ /** Converts a generated track to WAV format. */
519
964
  convertAudio;
965
+ /** Generates a music visualization video from an existing track. */
520
966
  visualizeMusic;
967
+ /** Produces AI-generated lyrics from a text prompt. */
521
968
  generateLyrics;
969
+ /** Retrieves word-level timing alignment for a track. Synchronous (run only). */
522
970
  getTimestampedLyrics;
971
+ /** Re-generates a time range within an existing track with new lyrics and style. */
523
972
  replaceSection;
973
+ /** Blends two audio tracks into a single new composition. */
524
974
  createMashup;
975
+ /** Generates sound effects (not music) from a text description with optional looping and BPM control. */
525
976
  textToSound;
977
+ /** Creates a reusable style or voice persona from a track's vocals. Synchronous (run only). */
526
978
  generatePersona;
979
+ /** Generates style/genre tags from a text description for use in style fields. Synchronous (run only). */
527
980
  boostStyle;
981
+ /** Step 1 of voice cloning: extracts a validation phrase from a voice recording. */
982
+ voiceToValidationPhrase;
983
+ /** Step 2 (optional) of voice cloning: requests a new, easier validation phrase. */
984
+ regenerateValidationPhrase;
985
+ /** Step 3 of voice cloning: trains a custom voice from the user's recording of the validation phrase. */
986
+ generateVoice;
987
+ /** Step 4 of voice cloning: checks whether a custom voice is ready for use. Synchronous (run only). */
988
+ checkVoice;
528
989
  constructor(options = {}) {
529
- const http = (0, import_core18.createHttpClient)(options);
530
- this.textToMusic = new TextToMusic(http);
531
- this.extendMusic = new ExtendMusic(http);
532
- this.generateArtwork = new GenerateArtwork(http);
533
- this.coverAudio = new CoverAudio(http);
534
- this.addInstrumental = new AddInstrumental(http);
535
- this.addVocals = new AddVocals(http);
536
- this.separateAudioStems = new SeparateAudioStems(http);
537
- this.generateMidi = new GenerateMidi(http);
538
- this.convertAudio = new ConvertAudio(http);
539
- this.visualizeMusic = new VisualizeMusic(http);
540
- this.generateLyrics = new GenerateLyrics(http);
541
- this.getTimestampedLyrics = new GetTimestampedLyrics(http);
542
- this.replaceSection = new ReplaceSection(http);
543
- this.createMashup = new CreateMashup(http);
544
- this.textToSound = new TextToSound(http);
545
- this.generatePersona = new GeneratePersona(http);
546
- this.boostStyle = new BoostStyle(http);
990
+ super(options);
991
+ this.textToMusic = new TextToMusic(this.http);
992
+ this.extendMusic = new ExtendMusic(this.http);
993
+ this.generateArtwork = new GenerateArtwork(this.http);
994
+ this.coverAudio = new CoverAudio(this.http);
995
+ this.addInstrumental = new AddInstrumental(this.http);
996
+ this.addVocals = new AddVocals(this.http);
997
+ this.separateAudioStems = new SeparateAudioStems(this.http);
998
+ this.generateMidi = new GenerateMidi(this.http);
999
+ this.convertAudio = new ConvertAudio(this.http);
1000
+ this.visualizeMusic = new VisualizeMusic(this.http);
1001
+ this.generateLyrics = new GenerateLyrics(this.http);
1002
+ this.getTimestampedLyrics = new GetTimestampedLyrics(this.http);
1003
+ this.replaceSection = new ReplaceSection(this.http);
1004
+ this.createMashup = new CreateMashup(this.http);
1005
+ this.textToSound = new TextToSound(this.http);
1006
+ this.generatePersona = new GeneratePersona(this.http);
1007
+ this.boostStyle = new BoostStyle(this.http);
1008
+ this.voiceToValidationPhrase = new VoiceToValidationPhrase(this.http);
1009
+ this.regenerateValidationPhrase = new RegenerateValidationPhrase(this.http);
1010
+ this.generateVoice = new GenerateVoice(this.http);
1011
+ this.checkVoice = new CheckVoice(this.http);
547
1012
  }
548
1013
  };
549
1014
 
550
1015
  // src/index.ts
551
- var import_core19 = require("@runapi.ai/core");
1016
+ var import_core23 = require("@runapi.ai/core");
552
1017
  // Annotate the CommonJS export names for ESM import in node:
553
1018
  0 && (module.exports = {
554
1019
  AuthenticationError,