Fix review issues: lyrics polling, validation, undici fetch, retry, timeout, throttle, payload helper
This commit is contained in:
Vendored
+10
-2
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Suno API HTTP client with rate limiting and polling helpers.
|
||||
* Suno API HTTP client with rate limiting, proxy support, retries and polling helpers.
|
||||
*
|
||||
* Rate limit: 20 requests per 10 seconds (sunoapi.org).
|
||||
* Proxy support via SUNO_HTTP_PROXY / HTTPS_PROXY / HTTP_PROXY env vars.
|
||||
@@ -28,13 +28,19 @@ export interface SunoTrack {
|
||||
createTime?: string;
|
||||
duration?: number;
|
||||
}
|
||||
export interface SunoLyricsVariant {
|
||||
text?: string;
|
||||
title?: string;
|
||||
status?: string;
|
||||
errorMessage?: string;
|
||||
}
|
||||
export interface SunoTaskData {
|
||||
taskId: string;
|
||||
parentMusicId?: string;
|
||||
param?: string;
|
||||
response?: {
|
||||
taskId?: string;
|
||||
data?: SunoTrack[];
|
||||
data?: SunoTrack[] | SunoLyricsVariant[];
|
||||
sunoData?: SunoTrack[];
|
||||
};
|
||||
status: string;
|
||||
@@ -49,6 +55,8 @@ export declare class SunoClient {
|
||||
private readonly maxRequests;
|
||||
private readonly windowMs;
|
||||
private readonly proxyAgent?;
|
||||
private readonly requestTimeoutMs;
|
||||
private readonly maxRetries;
|
||||
private requestTimestamps;
|
||||
constructor(apiKey: string);
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user