import { apiClient } from '../client' export interface ExtractionInfo { id: number url: string status: 'pending' | 'processing' | 'completed' | 'failed' title?: string service?: string service_id?: string sound_id?: number user_id: number error?: string created_at: string updated_at: string } export interface CreateExtractionResponse { message: string extraction: ExtractionInfo } export interface GetExtractionsResponse { extractions: ExtractionInfo[] } export class ExtractionsService { /** * Create a new extraction job */ async createExtraction(url: string): Promise { const response = await apiClient.post( `/api/v1/extractions/?url=${encodeURIComponent(url)}`, ) return response } /** * Get extraction by ID */ async getExtraction(extractionId: number): Promise { const response = await apiClient.get( `/api/v1/extractions/${extractionId}`, ) return response } /** * Get user's extractions */ async getUserExtractions(): Promise { const response = await apiClient.get( '/api/v1/extractions/', ) return response.extractions } } export const extractionsService = new ExtractionsService()