audiopod-sdk
Version:
AudioPod SDK for Node.js and React - Professional Audio Processing powered by AI
88 lines (86 loc) • 2.76 kB
TypeScript
/**
* AudioPod Client
* Main client class for the AudioPod API
*/
import { AudioPodConfig, Job, UploadProgress } from '../types';
import { VoiceService } from '../services/VoiceService';
import { MusicService } from '../services/MusicService';
import { TranscriptionService } from '../services/TranscriptionService';
import { TranslationService } from '../services/TranslationService';
import { CreditService } from '../services/CreditService';
import { SpeakerService } from '../services/SpeakerService';
import { DenoiserService } from '../services/DenoiserService';
import { StemExtractionService } from '../services/StemExtractionService';
export declare class AudioPodClient {
private readonly httpClient;
private readonly config;
readonly voice: VoiceService;
readonly music: MusicService;
readonly transcription: TranscriptionService;
readonly translation: TranslationService;
readonly credits: CreditService;
readonly speaker: SpeakerService;
readonly denoiser: DenoiserService;
readonly stemExtraction: StemExtractionService;
constructor(config: AudioPodConfig);
private createHttpClient;
private handleApiError;
/**
* Make a GET request to the API
*/
get<T = any>(endpoint: string, params?: Record<string, any>): Promise<T>;
/**
* Make a POST request to the API
*/
post<T = any>(endpoint: string, data?: any, config?: any): Promise<T>;
/**
* Make a PUT request to the API
*/
put<T = any>(endpoint: string, data?: any): Promise<T>;
/**
* Make a DELETE request to the API
*/
delete<T = any>(endpoint: string): Promise<T>;
/**
* Upload a file to the API
*/
uploadFile<T = any>(endpoint: string, fileData: File | Blob, formData?: Record<string, any>, onProgress?: (progress: UploadProgress) => void): Promise<T>;
/**
* Wait for a job to complete
*/
waitForJobCompletion<T = any>(jobId: number, timeout?: number, // 5 minutes
pollInterval?: number, // 5 seconds
onProgress?: (job: Job) => void): Promise<T>;
/**
* Get job status
*/
getJobStatus(jobId: number): Promise<Job>;
/**
* Cancel a job
*/
cancelJob(jobId: number): Promise<void>;
/**
* Check API health
*/
checkHealth(): Promise<{
status: string;
timestamp: string;
}>;
/**
* Get current user information
*/
getUserInfo(): Promise<any>;
/**
* Get API configuration
*/
getConfig(): Readonly<Required<AudioPodConfig>>;
/**
* Update API key
*/
updateApiKey(apiKey: string): void;
/**
* Set debug mode
*/
setDebug(enabled: boolean): void;
}
//# sourceMappingURL=AudioPodClient.d.ts.map