{"version":3,"sources":["../src/client.ts","../src/client-factory.ts","../src/api/avatar.ts","../src/api/url-to-video.ts","../src/api/text-to-speech.ts","../src/api/ai-editing.ts","../src/api/custom-templates.ts","../src/api/dyoa.ts","../src/api/ai-shorts.ts","../src/api/ai-scripts.ts","../src/api/musics.ts","../src/api/workspace.ts","../src/api/lipsync-v2.ts"],"names":["CreatifyApiClient","options","axios","response","error","status","data","endpoint","params","config","CreatifyApiClientFactory","apiClientFactory","AvatarApi","clientFactory","filters","avatars","avatar","page","limit","voices","voice","id","results","pollInterval","maxAttempts","attempts","result","resolve","UrlToVideoApi","TextToSpeechApi","AiEditingApi","CustomTemplatesApi","DyoaApi","createParams","photoIndex","photoGenPollInterval","photoGenMaxAttempts","reviewPollInterval","reviewMaxAttempts","dyoaWithPhotos","safePhotoIndex","chosenPhoto","dyoaSubmitted","AiShortsApi","AiScriptsApi","MusicsApi","categories","category","tracks","WorkspaceApi","LipsyncV2Api"],"mappings":";AAAA,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,EAAA,EAOaA,IAAAA,CAAAA,CAAN,KAAsD,CACnD,MAAA,CACA,KACA,CAAA,MAAA,CAMR,WAAYC,CAAAA,CAAAA,CAA6B,CACvC,IAAA,CAAK,MAAQA,CAAQ,CAAA,KAAA,CACrB,IAAK,CAAA,MAAA,CAASA,CAAQ,CAAA,MAAA,CAGtB,IAAK,CAAA,MAAA,CAASC,EAAM,MAAO,CAAA,CACzB,OAASD,CAAAA,CAAAA,CAAQ,OAAW,EAAA,yBAAA,CAC5B,OAASA,CAAAA,CAAAA,CAAQ,SAAW,GAC5B,CAAA,OAAA,CAAS,CACP,cAAA,CAAgB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AAA,CAAS,MAAM,IAAK,CAAA,YAAA,CAAavB,CAAS,CAAA,EAAE,CAC5CsB,CAAAA,CAAAA,EAAAA,CAIF,GAAIA,CAAAA,EAAYD,GAAeE,CAAO,CAAA,MAAA,GAAW,MAAUA,EAAAA,CAAAA,CAAO,SAAW,OAAS,CAAA,CACpF,IAAMtB,CAAAA,CAAQ,IAAI,KAChB,CAAA,CAAA,gBAAA,EAAmBD,CAAS,CAAA,EAAE,CAChC,2CAAA,CAAA,CAAA,CAEA,OAAO,CACL,GAAIA,CAAS,CAAA,EAAA,CACb,MAAQ,CAAA,OAAA,CACR,aAAeC,CAAAA,CAAAA,YAAiB,KAAQA,CAAAA,CAAAA,CAAM,QAAU,eACxD,CAAA,OAAA,CAAS,CACT,CAAA,CAAA,UAAA,CAAYsB,CAAO,CAAA,UAAA,EAAc,IAAI,IAAA,GAAO,WAAY,EAAA,CACxD,UAAY,CAAA,IAAI,MAAO,CAAA,WAAA,EACzB,CACF,CAEA,OAAOA,CACT,CAAStB,MAAAA,CAAAA,CAAO,CAEd,OAAA,OAAA,CAAQ,KAAM,CAAA,qCAAA,CAAuCA,CAAK,CACnD,CAAA,CACL,EAAI,CAAA,OAAA,CACJ,MAAQ,CAAA,OAAA,CACR,aAAeA,CAAAA,CAAAA,YAAiB,MAAQA,CAAM,CAAA,OAAA,CAAU,eACxD,CAAA,OAAA,CAAS,KACT,CAAA,UAAA,CAAY,IAAI,IAAA,GAAO,WAAY,EAAA,CACnC,UAAY,CAAA,IAAI,MAAO,CAAA,WAAA,EACzB,CACF,CACF,CACF","file":"chunk-6Z5X5CX6.mjs","sourcesContent":["import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';\nimport { CreatifyApiOptions } from './types';\nimport { ICreatifyApiClient } from './types/api-client';\n\n/**\n * Base API client for Creatify API\n */\nexport class CreatifyApiClient implements ICreatifyApiClient {\n  private client: AxiosInstance;\n  private apiId: string;\n  private apiKey: string;\n\n  /**\n   * Create a new Creatify API client\n   * @param options Configuration options for the API client\n   */\n  constructor(options: CreatifyApiOptions) {\n    this.apiId = options.apiId;\n    this.apiKey = options.apiKey;\n\n    // Create axios instance with default configuration\n    this.client = axios.create({\n      baseURL: options.baseUrl || 'https://api.creatify.ai',\n      timeout: options.timeout || 30000,\n      headers: {\n        'Content-Type': 'application/json',\n        'X-API-ID': this.apiId,\n        'X-API-KEY': this.apiKey,\n      },\n    });\n\n    // Add response interceptor for error handling\n    this.client.interceptors.response.use(\n      response => response,\n      error => {\n        // Transform error object to a more user-friendly format\n        if (error.response) {\n          // Server responded with a status code outside of 2xx range\n          const { status, data } = error.response;\n          return Promise.reject({\n            status,\n            message: data.message || 'An error occurred with the API request',\n            data: data,\n          });\n        } else if (error.request) {\n          // Request was made but no response was received\n          return Promise.reject({\n            message: 'No response received from the API server',\n            request: error.request,\n          });\n        } else {\n          // Something else happened while setting up the request\n          return Promise.reject({\n            message: error.message || 'An error occurred while setting up the request',\n          });\n        }\n      }\n    );\n  }\n\n  /**\n   * Make a GET request to the API\n   * @param endpoint API endpoint to call\n   * @param params Query parameters\n   * @param config Additional axios config\n   * @returns Promise resolving to the response data\n   */\n  public async get<T = unknown>(\n    endpoint: string,\n    params?: Record<string, unknown>,\n    config?: AxiosRequestConfig\n  ): Promise<T> {\n    const response = await this.client.get<T>(endpoint, {\n      params,\n      ...config,\n    });\n    return response.data;\n  }\n\n  /**\n   * Make a POST request to the API\n   * @param endpoint API endpoint to call\n   * @param data Request body data\n   * @param config Additional axios config\n   * @returns Promise resolving to the response data\n   */\n  public async post<T = unknown, D = unknown>(\n    endpoint: string,\n    data?: D,\n    config?: AxiosRequestConfig\n  ): Promise<T> {\n    const response = await this.client.post<T>(endpoint, data, config);\n    return response.data;\n  }\n\n  /**\n   * Make a PUT request to the API\n   * @param endpoint API endpoint to call\n   * @param data Request body data\n   * @param config Additional axios config\n   * @returns Promise resolving to the response data\n   */\n  public async put<T = unknown, D = unknown>(\n    endpoint: string,\n    data?: D,\n    config?: AxiosRequestConfig\n  ): Promise<T> {\n    const response = await this.client.put<T>(endpoint, data, config);\n    return response.data;\n  }\n\n  /**\n   * Make a DELETE request to the API\n   * @param endpoint API endpoint to call\n   * @param params Query parameters\n   * @param config Additional axios config\n   * @returns Promise resolving to the response data\n   */\n  public async delete<T = unknown>(\n    endpoint: string,\n    params?: Record<string, unknown>,\n    config?: AxiosRequestConfig\n  ): Promise<T> {\n    const response = await this.client.delete<T>(endpoint, {\n      params,\n      ...config,\n    });\n    return response.data;\n  }\n}\n","import { CreatifyApiClient } from './client';\nimport { CreatifyApiOptions } from './types';\nimport { ICreatifyApiClient, ICreatifyApiClientFactory } from './types/api-client';\n\n/**\n * Factory for creating Creatify API clients\n */\nexport class CreatifyApiClientFactory implements ICreatifyApiClientFactory {\n  /**\n   * Create a new API client instance\n   * @param options Configuration options\n   * @returns API client instance\n   */\n  createClient(options: CreatifyApiOptions): ICreatifyApiClient {\n    return new CreatifyApiClient(options);\n  }\n}\n\n// Default factory instance for convenient import\nexport const apiClientFactory = new CreatifyApiClientFactory();\n","import { CreatifyApiOptions } from '../types';\nimport { Avatar } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify AI Avatar API\n * @see https://creatify.mintlify.app/api-reference/lipsync\n */\nexport class AvatarApi {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new AvatarApi instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n  /**\n   * Get a list of all available avatars\n   * @returns Promise resolving to an array of avatar information\n   * @see https://creatify.mintlify.app/api-reference/personas/get-apipersonas\n   */\n  async getAvatars(filters?: {\n    age_range?: 'child' | 'teen' | 'adult' | 'senior';\n    gender?: 'm' | 'f' | 'nb';\n    location?: 'outdoor' | 'fantasy' | 'indoor' | 'other';\n    style?: 'selfie' | 'presenter' | 'other';\n  }): Promise<Avatar.AvatarInfo[]> {\n    try {\n      const avatars = await this.client.get<Avatar.AvatarInfo[]>('/api/personas/', filters);\n\n      // Ensure avatars is an array\n      if (!Array.isArray(avatars)) {\n        return [];\n      }\n\n      // Add avatar_id property for backward compatibility and explicitly add a name property\n      return avatars.map(avatar => ({\n        ...avatar,\n        avatar_id: avatar.id,\n        // Force the name property to be 'Avatar ID' if it's missing, empty or undefined\n        name: avatar.name && avatar.name.trim() ? avatar.name : `Avatar ${avatar.id}`,\n      }));\n    } catch (error) {\n      console.error('Error fetching avatars:', error);\n      return [];\n    }\n  }\n\n  /**\n   * Get a list of available avatars with pagination\n   * @param page Page number (starts from 1)\n   * @param limit Number of items per page\n   * @param filters Optional filtering parameters\n   * @returns Promise resolving to paginated avatar information\n   * @see https://creatify.mintlify.app/api-reference/personas/get-apipersonas-paginated\n   */\n  async getAvatarsPaginated(\n    page: number = 1,\n    limit: number = 20,\n    filters?: {\n      age_range?: 'child' | 'teen' | 'adult' | 'senior';\n      gender?: 'm' | 'f' | 'nb';\n      location?: 'outdoor' | 'fantasy' | 'indoor' | 'other';\n      style?: 'selfie' | 'presenter' | 'other';\n    }\n  ): Promise<{\n    count: number;\n    next: string | null;\n    previous: string | null;\n    results: Avatar.AvatarInfo[];\n  }> {\n    return this.client.get('/api/personas-paginated/', {\n      page,\n      limit,\n      ...filters,\n    });\n  }\n\n  /**\n   * Get a list of all available voices\n   * @returns Promise resolving to an array of voice information\n   * @see https://creatify.mintlify.app/api-reference/voices/get-apivoices\n   */\n  async getVoices(): Promise<Avatar.VoiceInfo[]> {\n    try {\n      const voices = await this.client.get<Avatar.VoiceInfo[]>('/api/voices/');\n\n      // Ensure voices is an array\n      if (!Array.isArray(voices)) {\n        return [];\n      }\n\n      // Process voice data to handle different API response formats\n      return voices.map(voice => {\n        // Create a normalized version of each voice with consistent properties\n        const normalizedVoice: Avatar.VoiceInfo = {\n          // Ensure ID is available in a consistent field\n          id: voice.id || voice.voice_id || '',\n          voice_id: voice.voice_id || voice.id || '',\n          name: voice.name || 'Unnamed Voice',\n          language: voice.language || '',\n          gender: voice.gender || '',\n          accents: voice.accents || [],\n\n          // Extract preview URL from the first accent if not directly available\n          preview_url:\n            voice.preview_url ||\n            (voice.accents && voice.accents.length > 0 && voice.accents[0].preview_url) ||\n            '',\n        };\n\n        return normalizedVoice;\n      });\n    } catch (error) {\n      console.error('Error fetching voices:', error);\n      return [];\n    }\n  }\n\n  /**\n   * Create a lipsync video with an AI avatar speaking the provided text\n   * @param params Parameters for the lipsync video generation\n   * @returns Promise resolving to the lipsync task response\n   * @see https://creatify.mintlify.app/api-reference/lipsync\n   */\n  async createLipsync(params: Avatar.LipsyncParams): Promise<Avatar.LipsyncResponse> {\n    try {\n      return await this.client.post<Avatar.LipsyncResponse>('/api/lipsyncs/', params);\n    } catch (error) {\n      console.error('Error creating lipsync:', error);\n      throw error;\n    }\n  }\n\n  /**\n   * Get the status and result of a lipsync task\n   * @param id ID of the lipsync task\n   * @returns Promise resolving to the lipsync task status and result\n   * @see https://creatify.mintlify.app/api-reference/lipsync\n   */\n  async getLipsync(id: string): Promise<Avatar.LipsyncResultResponse> {\n    try {\n      return await this.client.get<Avatar.LipsyncResultResponse>(`/api/lipsyncs/${id}/`);\n    } catch (error) {\n      console.error(`Error fetching lipsync result for ID ${id}:`, error);\n      // Return a default response to prevent crashes\n      return {\n        id,\n        status: 'error',\n        error_message:\n          error instanceof Error ? error.message : 'An error occurred with the API request',\n      } as Avatar.LipsyncResultResponse;\n    }\n  }\n\n  /**\n   * Get all lipsync tasks\n   * @returns Promise resolving to an array of lipsync tasks\n   * @see https://creatify.mintlify.app/api-reference/lipsync\n   */\n  async getLipsyncs(): Promise<Avatar.LipsyncResultResponse[]> {\n    try {\n      const results = await this.client.get<Avatar.LipsyncResultResponse[]>('/api/lipsyncs/');\n      return Array.isArray(results) ? results : [];\n    } catch (error) {\n      console.error('Error fetching lipsync tasks:', error);\n      return [];\n    }\n  }\n\n  /**\n   * Create a multi-avatar lipsync video with multiple AI avatars speaking\n   * @param params Parameters for the multi-avatar lipsync video generation\n   * @returns Promise resolving to the lipsync task response\n   * @see https://creatify.mintlify.app/api-reference/lipsync-multi-avatar\n   */\n  async createMultiAvatarLipsync(\n    params: Avatar.MultiAvatarLipsyncParams\n  ): Promise<Avatar.LipsyncResponse> {\n    try {\n      return await this.client.post<Avatar.LipsyncResponse>('/api/lipsyncs/multi_avatar/', params);\n    } catch (error) {\n      console.error('Error creating multi-avatar lipsync:', error);\n      throw error;\n    }\n  }\n\n  /**\n   * Create a lipsync video and wait for it to complete\n   * @param params Parameters for the lipsync video generation\n   * @param pollInterval How often to check status in ms (default 2000)\n   * @param maxAttempts Maximum number of polling attempts (default 30)\n   * @returns Promise resolving to the completed lipsync task\n   */\n  async createAndWaitForLipsync(\n    params: Avatar.LipsyncParams,\n    pollInterval: number = 2000,\n    maxAttempts: number = 30\n  ): Promise<Avatar.LipsyncResultResponse> {\n    // Create the lipsync task\n    const response = await this.createLipsync(params);\n\n    // Poll for completion\n    let attempts = 0;\n    let result = await this.getLipsync(response.id);\n\n    while (attempts < maxAttempts && result.status !== 'done' && result.status !== 'error') {\n      // Wait for the specified interval\n      await new Promise(resolve => setTimeout(resolve, pollInterval));\n\n      // Check the status again\n      result = await this.getLipsync(response.id);\n      attempts++;\n    }\n\n    // Check if we reached max attempts without completion\n    if (attempts >= maxAttempts && result.status !== 'done' && result.status !== 'error') {\n      throw new Error(`Lipsync task ${response.id} did not complete within the timeout period`);\n    }\n\n    return result;\n  }\n}\n","import { CreatifyApiOptions } from '../types';\nimport { UrlToVideo } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify URL-to-Video API\n * @see https://creatify.mintlify.app/api-reference/link-to-video\n */\nexport class UrlToVideoApi {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new UrlToVideoApi instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n  /**\n   * Create a link from a URL\n   * @param params Parameters containing the URL\n   * @returns Promise resolving to the link response\n   * @see https://creatify.mintlify.app/api-reference/links/post-apilinks\n   */\n  async createLink(params: UrlToVideo.LinkParams): Promise<UrlToVideo.LinkResponse> {\n    return this.client.post<UrlToVideo.LinkResponse>('/api/links/', params);\n  }\n\n  /**\n   * Create a link with custom parameters\n   * @param params Custom link parameters\n   * @returns Promise resolving to the link response\n   * @see https://creatify.mintlify.app/api-reference/links/post-apilink_with_params\n   */\n  async createLinkWithParams(\n    params: UrlToVideo.CustomLinkParams\n  ): Promise<UrlToVideo.LinkResponse> {\n    return this.client.post<UrlToVideo.LinkResponse>('/api/links/link_with_params/', params);\n  }\n\n  /**\n   * Update an existing link\n   * @param id ID of the link to update\n   * @param params New link parameters\n   * @returns Promise resolving to the updated link data\n   * @see https://creatify.mintlify.app/api-reference/links/put-apilinks-\n   */\n  async updateLink(\n    id: string,\n    params: Partial<UrlToVideo.CustomLinkParams> & { url?: string }\n  ): Promise<UrlToVideo.LinkData> {\n    return this.client.put<UrlToVideo.LinkData>(`/api/links/${id}/`, params);\n  }\n\n  /**\n   * Get an existing link by ID\n   * @param id ID of the link to get\n   * @returns Promise resolving to the link data\n   * @see https://creatify.mintlify.app/api-reference/links/get-apilinks-\n   */\n  async getLink(id: string): Promise<UrlToVideo.LinkData> {\n    return this.client.get<UrlToVideo.LinkData>(`/api/links/${id}/`);\n  }\n\n  /**\n   * Get all existing links\n   * @param page Page number (starts from 1)\n   * @param limit Number of items per page\n   * @returns Promise resolving to an array of link data\n   * @see https://creatify.mintlify.app/api-reference/links/get-apilinks\n   */\n  async getLinks(page?: number, limit?: number): Promise<UrlToVideo.LinkData[]> {\n    return this.client.get<UrlToVideo.LinkData[]>('/api/links/', { page, limit });\n  }\n\n  /**\n   * Get paginated list of links\n   * @param page Page number (starts from 1)\n   * @param limit Number of items per page\n   * @returns Promise resolving to paginated link data\n   * @see https://creatify.mintlify.app/api-reference/links/get-apilinks-paginated\n   */\n  async getLinksPaginated(\n    page: number = 1,\n    limit: number = 20\n  ): Promise<{\n    count: number;\n    next: string | null;\n    previous: string | null;\n    results: UrlToVideo.LinkData[];\n  }> {\n    return this.client.get('/api/links/paginated/', { page, limit });\n  }\n\n  /**\n   * Create a video from a link\n   * @param params Parameters for video generation\n   * @returns Promise resolving to the video response\n   * @see https://creatify.mintlify.app/api-reference/link-to-video\n   */\n  async createVideoFromLink(\n    params: UrlToVideo.VideoFromLinkParams\n  ): Promise<UrlToVideo.VideoResponse> {\n    return this.client.post<UrlToVideo.VideoResponse>('/api/link_to_videos/', params);\n  }\n\n  /**\n   * Get the status and result of a video generation task\n   * @param id ID of the video task\n   * @returns Promise resolving to the video status and result\n   * @see https://creatify.mintlify.app/api-reference/link-to-video\n   */\n  async getVideo(id: string): Promise<UrlToVideo.VideoResultResponse> {\n    return this.client.get<UrlToVideo.VideoResultResponse>(`/api/link_to_videos/${id}/`);\n  }\n\n  /**\n   * Get all video generation tasks\n   * @returns Promise resolving to an array of video tasks\n   * @see https://creatify.mintlify.app/api-reference/link-to-video\n   */\n  async getVideos(): Promise<UrlToVideo.VideoResultResponse[]> {\n    return this.client.get<UrlToVideo.VideoResultResponse[]>('/api/link_to_videos/');\n  }\n}\n","import { CreatifyApiOptions } from '../types';\nimport { TextToSpeech } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify Text-to-Speech API\n * @see https://creatify.mintlify.app/api-reference/text-to-speech\n */\nexport class TextToSpeechApi {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new TextToSpeechApi instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n  /**\n   * Create a text-to-speech task to convert text into an audio file\n   * @param params Parameters for the text-to-speech generation\n   * @returns Promise resolving to the text-to-speech task response\n   * @see https://creatify.mintlify.app/api-reference/text-to-speech/post-text-to-speech\n   */\n  async createTextToSpeech(\n    params: TextToSpeech.TextToSpeechParams\n  ): Promise<TextToSpeech.TextToSpeechResponse> {\n    return this.client.post<TextToSpeech.TextToSpeechResponse>('/api/text_to_speech/', params);\n  }\n\n  /**\n   * Get the status and result of a text-to-speech task\n   * @param id ID of the text-to-speech task\n   * @returns Promise resolving to the text-to-speech task status and result\n   * @see https://creatify.mintlify.app/api-reference/text-to-speech/get-text-to-speech-\n   */\n  async getTextToSpeech(id: string): Promise<TextToSpeech.TextToSpeechResultResponse> {\n    return this.client.get<TextToSpeech.TextToSpeechResultResponse>(`/api/text_to_speech/${id}/`);\n  }\n\n  /**\n   * Get all text-to-speech tasks\n   * @param page Page number (starts from 1)\n   * @param limit Number of items per page\n   * @returns Promise resolving to an array of text-to-speech tasks\n   * @see https://creatify.mintlify.app/api-reference/text-to-speech/get-text-to-speech\n   */\n  async getTextToSpeechList(\n    page?: number,\n    limit?: number\n  ): Promise<TextToSpeech.TextToSpeechResultResponse[]> {\n    return this.client.get<TextToSpeech.TextToSpeechResultResponse[]>('/api/text_to_speech/', {\n      page,\n      limit,\n    });\n  }\n\n  /**\n   * Get paginated list of text-to-speech tasks\n   * @param page Page number (starts from 1)\n   * @param limit Number of items per page\n   * @returns Promise resolving to paginated text-to-speech data\n   * @see https://creatify.mintlify.app/api-reference/text-to-speech/get-text-to-speech\n   */\n  async getTextToSpeechPaginated(\n    page: number = 1,\n    limit: number = 20\n  ): Promise<{\n    count: number;\n    next: string | null;\n    previous: string | null;\n    results: TextToSpeech.TextToSpeechResultResponse[];\n  }> {\n    return this.client.get('/api/text_to_speech/paginated/', { page, limit });\n  }\n\n  /**\n   * Helper method to create a text-to-speech and wait for completion\n   * @param params Parameters for the text-to-speech generation\n   * @param pollInterval Interval in milliseconds to check for completion (default: 5000)\n   * @param maxAttempts Maximum number of polling attempts (default: 60, about 5 minutes)\n   * @returns Promise resolving to the final text-to-speech result\n   */\n  async createAndWaitForTextToSpeech(\n    params: TextToSpeech.TextToSpeechParams,\n    pollInterval = 5000,\n    maxAttempts = 60\n  ): Promise<TextToSpeech.TextToSpeechResultResponse> {\n    // Create the text-to-speech task\n    const response = await this.createTextToSpeech(params);\n\n    // Poll for completion\n    let attempts = 0;\n    let result = await this.getTextToSpeech(response.id);\n\n    while (attempts < maxAttempts && result.status !== 'done' && result.status !== 'error') {\n      // Wait for the specified interval\n      await new Promise(resolve => setTimeout(resolve, pollInterval));\n\n      // Check the status again\n      result = await this.getTextToSpeech(response.id);\n      attempts++;\n    }\n\n    // Check if we reached max attempts without completion\n    if (attempts >= maxAttempts && result.status !== 'done' && result.status !== 'error') {\n      throw new Error(\n        `Text-to-speech task ${response.id} did not complete within the timeout period`\n      );\n    }\n\n    return result;\n  }\n}\n","import { CreatifyApiOptions } from '../types';\nimport { AiEditing } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify AI Editing API\n * @see https://creatify.mintlify.app/api-reference/ai-editing\n */\nexport class AiEditingApi {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new AiEditingApi instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n  /**\n   * Create an AI editing task to edit a video with AI\n   * @param params Parameters for the AI editing task\n   * @returns Promise resolving to the AI editing task response\n   * @see https://creatify.mintlify.app/api-reference/ai-editing\n   */\n  async createAiEditing(params: AiEditing.AiEditingParams): Promise<AiEditing.AiEditingResponse> {\n    return this.client.post<AiEditing.AiEditingResponse>('/api/ai_editing/', params);\n  }\n\n  /**\n   * Get the status and result of an AI editing task\n   * @param id ID of the AI editing task\n   * @returns Promise resolving to the AI editing task status and result\n   * @see https://creatify.mintlify.app/api-reference/ai-editing\n   */\n  async getAiEditing(id: string): Promise<AiEditing.AiEditingResultResponse> {\n    return this.client.get<AiEditing.AiEditingResultResponse>(`/api/ai_editing/${id}/`);\n  }\n\n  /**\n   * Get all AI editing tasks\n   * @returns Promise resolving to an array of AI editing tasks\n   * @see https://creatify.mintlify.app/api-reference/ai-editing\n   */\n  async getAiEditingList(): Promise<AiEditing.AiEditingResultResponse[]> {\n    return this.client.get<AiEditing.AiEditingResultResponse[]>('/api/ai_editing/');\n  }\n\n  /**\n   * Helper method to create an AI editing task and wait for completion\n   * @param params Parameters for the AI editing task\n   * @param pollInterval Interval in milliseconds to check for completion (default: 5000)\n   * @param maxAttempts Maximum number of polling attempts (default: 120, about 10 minutes)\n   * @returns Promise resolving to the final AI editing result\n   */\n  async createAndWaitForAiEditing(\n    params: AiEditing.AiEditingParams,\n    pollInterval = 5000,\n    maxAttempts = 120\n  ): Promise<AiEditing.AiEditingResultResponse> {\n    // Create the AI editing task\n    const response = await this.createAiEditing(params);\n\n    // Poll for completion\n    let attempts = 0;\n    let result = await this.getAiEditing(response.id);\n\n    while (attempts < maxAttempts && result.status !== 'done' && result.status !== 'error') {\n      // Wait for the specified interval\n      await new Promise(resolve => setTimeout(resolve, pollInterval));\n\n      // Check the status again\n      result = await this.getAiEditing(response.id);\n      attempts++;\n    }\n\n    // Check if we reached max attempts without completion\n    if (attempts >= maxAttempts && result.status !== 'done' && result.status !== 'error') {\n      throw new Error(`AI editing task ${response.id} did not complete within the timeout period`);\n    }\n\n    return result;\n  }\n}\n","import { CreatifyApiOptions } from '../types';\nimport { CustomTemplates } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify Custom Templates API\n * @see https://creatify.mintlify.app/api-reference/custom-templates\n */\nexport class CustomTemplatesApi {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new CustomTemplatesApi instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n  /**\n   * Create a video using a custom template\n   * @param params Parameters for the custom template video generation\n   * @returns Promise resolving to the custom template task response\n   * @see https://creatify.mintlify.app/api-reference/custom-templates\n   */\n  async createCustomTemplate(\n    params: CustomTemplates.CustomTemplateParams\n  ): Promise<CustomTemplates.CustomTemplateResponse> {\n    return this.client.post<CustomTemplates.CustomTemplateResponse>(\n      '/api/custom_templates/',\n      params\n    );\n  }\n\n  /**\n   * Get the status and result of a custom template task\n   * @param id ID of the custom template task\n   * @returns Promise resolving to the custom template task status and result\n   * @see https://creatify.mintlify.app/api-reference/custom-templates\n   */\n  async getCustomTemplate(id: string): Promise<CustomTemplates.CustomTemplateResultResponse> {\n    return this.client.get<CustomTemplates.CustomTemplateResultResponse>(\n      `/api/custom_templates/${id}/`\n    );\n  }\n\n  /**\n   * Get all custom template tasks\n   * @returns Promise resolving to an array of custom template tasks\n   * @see https://creatify.mintlify.app/api-reference/custom-templates\n   */\n  async getCustomTemplateList(): Promise<CustomTemplates.CustomTemplateResultResponse[]> {\n    return this.client.get<CustomTemplates.CustomTemplateResultResponse[]>(\n      '/api/custom_templates/'\n    );\n  }\n\n  /**\n   * Helper method to create a custom template video and wait for completion\n   * @param params Parameters for the custom template video generation\n   * @param pollInterval Interval in milliseconds to check for completion (default: 5000)\n   * @param maxAttempts Maximum number of polling attempts (default: 120, about 10 minutes)\n   * @returns Promise resolving to the final custom template result\n   */\n  async createAndWaitForCustomTemplate(\n    params: CustomTemplates.CustomTemplateParams,\n    pollInterval = 5000,\n    maxAttempts = 120\n  ): Promise<CustomTemplates.CustomTemplateResultResponse> {\n    // Create the custom template task\n    const response = await this.createCustomTemplate(params);\n\n    // Poll for completion\n    let attempts = 0;\n    let result = await this.getCustomTemplate(response.id);\n\n    while (attempts < maxAttempts && result.status !== 'done' && result.status !== 'error') {\n      // Wait for the specified interval\n      await new Promise(resolve => setTimeout(resolve, pollInterval));\n\n      // Check the status again\n      result = await this.getCustomTemplate(response.id);\n      attempts++;\n    }\n\n    // Check if we reached max attempts without completion\n    if (attempts >= maxAttempts && result.status !== 'done' && result.status !== 'error') {\n      throw new Error(\n        `Custom template task ${response.id} did not complete within the timeout period`\n      );\n    }\n\n    return result;\n  }\n}\n","import { CreatifyApiOptions } from '../types';\nimport { DYOA } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify DYOA (Design Your Own Avatar) API\n * @see https://creatify.mintlify.app/api-reference/introduction\n */\nexport class DyoaApi {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new DyoaApi instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n  /**\n   * Create a DYOA with avatar details\n   * @param params Parameters for the DYOA creation\n   * @returns Promise resolving to the DYOA response\n   * @see https://creatify.mintlify.app/api-reference/introduction\n   */\n  async createDyoa(params: DYOA.DyoaParams): Promise<DYOA.DyoaResponse> {\n    return this.client.post<DYOA.DyoaResponse>('/api/dyoa/', params);\n  }\n\n  /**\n   * Get a DYOA by ID\n   * @param id ID of the DYOA\n   * @returns Promise resolving to the DYOA details\n   * @see https://creatify.mintlify.app/api-reference/introduction\n   */\n  async getDyoa(id: string): Promise<DYOA.DyoaResponse> {\n    return this.client.get<DYOA.DyoaResponse>(`/api/dyoa/${id}/`);\n  }\n\n  /**\n   * Get all DYOAs\n   * @returns Promise resolving to an array of DYOAs\n   * @see https://creatify.mintlify.app/api-reference/introduction\n   */\n  async getDyoaList(): Promise<DYOA.DyoaResponse[]> {\n    return this.client.get<DYOA.DyoaResponse[]>('/api/dyoa/');\n  }\n\n  /**\n   * Submit a DYOA for review with the chosen photo\n   * @param id ID of the DYOA\n   * @param params Parameters for the DYOA submission\n   * @returns Promise resolving to the updated DYOA details\n   * @see https://creatify.mintlify.app/api-reference/introduction\n   */\n  async submitDyoaForReview(id: string, params: DYOA.DyoaSubmitParams): Promise<DYOA.DyoaResponse> {\n    return this.client.post<DYOA.DyoaResponse>(`/api/dyoa/${id}/submit_for_review/`, params);\n  }\n\n  /**\n   * Delete a DYOA\n   * @param id ID of the DYOA to delete\n   * @returns Promise resolving to the deletion response\n   * @see https://creatify.mintlify.app/api-reference/introduction\n   */\n  async deleteDyoa(id: string): Promise<void> {\n    return this.client.delete<void>(`/api/dyoa/${id}/`);\n  }\n\n  /**\n   * Helper method to create a DYOA and wait for photos to be generated\n   * @param params Parameters for the DYOA creation\n   * @param pollInterval Interval in milliseconds to check for photo generation (default: 10000)\n   * @param maxAttempts Maximum number of polling attempts (default: 30, about 5 minutes)\n   * @returns Promise resolving to the DYOA with generated photos\n   */\n  async createAndWaitForDyoaPhotos(\n    params: DYOA.DyoaParams,\n    pollInterval = 10000,\n    maxAttempts = 30\n  ): Promise<DYOA.DyoaResponse> {\n    // Create the DYOA\n    const response = await this.createDyoa(params);\n\n    // Poll for photo generation\n    let attempts = 0;\n    let result = await this.getDyoa(response.id);\n\n    while (\n      attempts < maxAttempts &&\n      (result.status === 'initializing' || result.photos.length === 0)\n    ) {\n      // Wait for the specified interval\n      await new Promise(resolve => setTimeout(resolve, pollInterval));\n\n      // Check the status again\n      result = await this.getDyoa(response.id);\n      attempts++;\n    }\n\n    // Check if we reached max attempts without photos being generated\n    if (attempts >= maxAttempts && result.photos.length === 0) {\n      throw new Error(`DYOA ${response.id} photos were not generated within the timeout period`);\n    }\n\n    return result;\n  }\n\n  /**\n   * Helper method to create a DYOA, wait for photos, submit for review and wait for approval\n   * @param createParams Parameters for the DYOA creation\n   * @param photoIndex Index of the photo to choose (defaults to 0, the first photo)\n   * @param photoGenPollInterval Interval in ms to check for photo generation (default: 10000)\n   * @param photoGenMaxAttempts Maximum polling attempts for photos (default: 30)\n   * @param reviewPollInterval Interval in ms to check for review completion (default: 60000)\n   * @param reviewMaxAttempts Maximum polling attempts for review (default: 60, about 1 hour)\n   * @returns Promise resolving to the approved DYOA\n   */\n  async createSubmitAndWaitForDyoa(\n    createParams: DYOA.DyoaParams,\n    photoIndex = 0,\n    photoGenPollInterval = 10000,\n    photoGenMaxAttempts = 30,\n    reviewPollInterval = 60000,\n    reviewMaxAttempts = 60\n  ): Promise<DYOA.DyoaResponse> {\n    // Create and wait for photos\n    const dyoaWithPhotos = await this.createAndWaitForDyoaPhotos(\n      createParams,\n      photoGenPollInterval,\n      photoGenMaxAttempts\n    );\n\n    // Ensure we have photos\n    if (dyoaWithPhotos.photos.length === 0) {\n      throw new Error('No photos were generated for the DYOA');\n    }\n\n    // Choose the photo (default to the first one if index is out of bounds)\n    const safePhotoIndex = Math.min(photoIndex, dyoaWithPhotos.photos.length - 1);\n    const chosenPhoto = dyoaWithPhotos.photos[safePhotoIndex];\n\n    // Submit for review\n    const dyoaSubmitted = await this.submitDyoaForReview(dyoaWithPhotos.id, {\n      chosen_photo_id: chosenPhoto.id,\n    });\n\n    // Poll for review completion\n    let attempts = 0;\n    let result = await this.getDyoa(dyoaSubmitted.id);\n\n    while (attempts < reviewMaxAttempts && result.status === 'pending') {\n      // Wait for the specified interval\n      await new Promise(resolve => setTimeout(resolve, reviewPollInterval));\n\n      // Check the status again\n      result = await this.getDyoa(dyoaSubmitted.id);\n      attempts++;\n    }\n\n    // Check if we reached max attempts without review completion\n    if (attempts >= reviewMaxAttempts && result.status === 'pending') {\n      throw new Error(`DYOA ${dyoaSubmitted.id} review did not complete within the timeout period`);\n    }\n\n    return result;\n  }\n}\n","import { CreatifyApiOptions } from '../types';\nimport { AiShorts } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify AI Shorts API\n * @see https://creatify.mintlify.app/api-reference/ai-shorts\n */\nexport class AiShortsApi {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new AiShortsApi instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n\n  /**\n   * Create an AI Shorts task to generate a video from a text prompt\n   * @param params Parameters for the AI Shorts task\n   * @returns Promise resolving to the AI Shorts task response\n   * @see https://creatify.mintlify.app/api-reference/ai-shorts/post-ai-shorts\n   */\n  async createAiShorts(params: AiShorts.AiShortsParams): Promise<AiShorts.AiShortsResponse> {\n    return this.client.post<AiShorts.AiShortsResponse>('/api/ai_shorts/', params);\n  }\n\n  /**\n   * Get the status and result of an AI Shorts task\n   * @param id ID of the AI Shorts task\n   * @returns Promise resolving to the AI Shorts task status and result\n   * @see https://creatify.mintlify.app/api-reference/ai-shorts/get-ai-shorts-\n   */\n  async getAiShorts(id: string): Promise<AiShorts.AiShortsResultResponse> {\n    try {\n      return await this.client.get<AiShorts.AiShortsResultResponse>(`/api/ai_shorts/${id}/`);\n    } catch (error) {\n      console.error(`Error fetching AI Shorts result for ID ${id}:`, error);\n      // Return a default response to prevent crashes\n      return {\n        id,\n        status: 'error',\n        error_message:\n          error instanceof Error ? error.message : 'An error occurred with the API request',\n        success: false,\n        created_at: new Date().toISOString(),\n        updated_at: new Date().toISOString(),\n      } as AiShorts.AiShortsResultResponse;\n    }\n  }\n\n  /**\n   * Get all AI Shorts tasks\n   * @returns Promise resolving to an array of AI Shorts tasks\n   * @see https://creatify.mintlify.app/api-reference/ai-shorts/get-ai-shorts\n   */\n  async getAiShortsList(): Promise<AiShorts.AiShortsResultResponse[]> {\n    try {\n      const results = await this.client.get<AiShorts.AiShortsResultResponse[]>('/api/ai_shorts/');\n      return Array.isArray(results) ? results : [];\n    } catch (error) {\n      console.error('Error fetching AI Shorts tasks:', error);\n      return [];\n    }\n  }\n\n  /**\n   * Generate a preview of an AI Shorts video\n   * @param id ID of the AI Shorts task\n   * @returns Promise resolving to the AI Shorts task response\n   * @see https://creatify.mintlify.app/api-reference/ai-shorts/post-ai-shorts-preview\n   */\n  async generateAiShortsPreview(id: string): Promise<AiShorts.AiShortsResponse> {\n    return this.client.post<AiShorts.AiShortsResponse>(`/api/ai_shorts/${id}/preview/`, {});\n  }\n\n  /**\n   * Render an AI Shorts video\n   * @param id ID of the AI Shorts task\n   * @returns Promise resolving to the AI Shorts task response\n   * @see https://creatify.mintlify.app/api-reference/ai-shorts/post-ai-shorts-render\n   */\n  async renderAiShorts(id: string): Promise<AiShorts.AiShortsResponse> {\n    return this.client.post<AiShorts.AiShortsResponse>(`/api/ai_shorts/${id}/render/`, {});\n  }\n\n  /**\n   * Create an AI Shorts video and wait for it to complete\n   * @param params Parameters for the AI Shorts video generation\n   * @param pollInterval How often to check status in ms (default 2000)\n   * @param maxAttempts Maximum number of polling attempts (default 30)\n   * @returns Promise resolving to the completed AI Shorts task\n   */\n  async createAndWaitForAiShorts(\n    params: AiShorts.AiShortsParams,\n    pollInterval: number = 2000,\n    maxAttempts: number = 30\n  ): Promise<AiShorts.AiShortsResultResponse> {\n    try {\n      // Create the AI Shorts task\n      const response = await this.createAiShorts(params);\n\n      // Poll for completion\n      let attempts = 0;\n      let result = await this.getAiShorts(response.id);\n\n      while (attempts < maxAttempts && result.status !== 'done' && result.status !== 'error') {\n        // Wait for the specified interval\n        await new Promise(resolve => setTimeout(resolve, pollInterval));\n\n        // Check the status again\n        result = await this.getAiShorts(response.id);\n        attempts++;\n      }\n\n      // Check if we reached max attempts without completion\n      if (attempts >= maxAttempts && result.status !== 'done' && result.status !== 'error') {\n        const error = new Error(\n          `AI Shorts task ${response.id} did not complete within the timeout period`\n        );\n        // Create a result with error status\n        return {\n          id: response.id,\n          status: 'error',\n          error_message: error.message,\n          success: false,\n          created_at: result.created_at || new Date().toISOString(),\n          updated_at: new Date().toISOString(),\n        };\n      }\n\n      return result;\n    } catch (error) {\n      // Handle any unexpected errors\n      console.error('Error in createAndWaitForAiShorts:', error);\n      return {\n        id: 'error',\n        status: 'error',\n        error_message: error instanceof Error ? error.message : 'Unknown error',\n        success: false,\n        created_at: new Date().toISOString(),\n        updated_at: new Date().toISOString(),\n      };\n    }\n  }\n}\n","import { CreatifyApiOptions } from '../types';\nimport { AiScripts } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify AI Scripts API\n * @see https://creatify.mintlify.app/api-reference/ai-scripts\n */\nexport class AiScriptsApi {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new AiScriptsApi instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n\n  /**\n   * Generate an AI Script from a text prompt\n   * @param params Parameters for the AI Script generation\n   * @returns Promise resolving to the AI Script task response\n   * @see https://creatify.mintlify.app/api-reference/ai-scripts/post-ai-scripts\n   */\n  async createAiScript(params: AiScripts.AiScriptsParams): Promise<AiScripts.AiScriptsResponse> {\n    return this.client.post<AiScripts.AiScriptsResponse>('/api/ai_scripts/', params);\n  }\n\n  /**\n   * Get the status and result of an AI Script task\n   * @param id ID of the AI Script task\n   * @returns Promise resolving to the AI Script task status and result\n   * @see https://creatify.mintlify.app/api-reference/ai-scripts/get-ai-scripts-\n   */\n  async getAiScript(id: string): Promise<AiScripts.AiScriptsResultResponse> {\n    try {\n      return await this.client.get<AiScripts.AiScriptsResultResponse>(`/api/ai_scripts/${id}/`);\n    } catch (error) {\n      console.error(`Error fetching AI Script result for ID ${id}:`, error);\n      // Return a default response to prevent crashes\n      return {\n        id,\n        status: 'error',\n        error_message:\n          error instanceof Error ? error.message : 'An error occurred with the API request',\n        success: false,\n        created_at: new Date().toISOString(),\n        updated_at: new Date().toISOString(),\n      } as AiScripts.AiScriptsResultResponse;\n    }\n  }\n\n  /**\n   * Get all AI Script tasks\n   * @returns Promise resolving to an array of AI Script tasks\n   * @see https://creatify.mintlify.app/api-reference/ai-scripts/get-ai-scripts\n   */\n  async getAiScriptsList(): Promise<AiScripts.AiScriptsResultResponse[]> {\n    try {\n      const results =\n        await this.client.get<AiScripts.AiScriptsResultResponse[]>('/api/ai_scripts/');\n      return Array.isArray(results) ? results : [];\n    } catch (error) {\n      console.error('Error fetching AI Script tasks:', error);\n      return [];\n    }\n  }\n\n  /**\n   * Create an AI Script and wait for it to complete\n   * @param params Parameters for the AI Script generation\n   * @param pollInterval How often to check status in ms (default 2000)\n   * @param maxAttempts Maximum number of polling attempts (default 30)\n   * @returns Promise resolving to the completed AI Script task\n   */\n  async createAndWaitForAiScript(\n    params: AiScripts.AiScriptsParams,\n    pollInterval: number = 2000,\n    maxAttempts: number = 30\n  ): Promise<AiScripts.AiScriptsResultResponse> {\n    try {\n      // Create the AI Script task\n      const response = await this.createAiScript(params);\n\n      // Poll for completion\n      let attempts = 0;\n      let result = await this.getAiScript(response.id);\n\n      while (attempts < maxAttempts && result.status !== 'done' && result.status !== 'error') {\n        // Wait for the specified interval\n        await new Promise(resolve => setTimeout(resolve, pollInterval));\n\n        // Check the status again\n        result = await this.getAiScript(response.id);\n        attempts++;\n      }\n\n      // Check if we reached max attempts without completion\n      if (attempts >= maxAttempts && result.status !== 'done' && result.status !== 'error') {\n        const error = new Error(\n          `AI Script task ${response.id} did not complete within the timeout period`\n        );\n        // Create a result with error status\n        return {\n          id: response.id,\n          status: 'error',\n          error_message: error.message,\n          success: false,\n          created_at: result.created_at || new Date().toISOString(),\n          updated_at: new Date().toISOString(),\n        };\n      }\n\n      return result;\n    } catch (error) {\n      // Handle any unexpected errors\n      console.error('Error in createAndWaitForAiScript:', error);\n      return {\n        id: 'error',\n        status: 'error',\n        error_message: error instanceof Error ? error.message : 'Unknown error',\n        success: false,\n        created_at: new Date().toISOString(),\n        updated_at: new Date().toISOString(),\n      };\n    }\n  }\n}\n","import { CreatifyApiOptions } from '../types';\nimport { Musics } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify Musics API\n * @see https://creatify.mintlify.app/api-reference/musics\n */\nexport class MusicsApi {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new MusicsApi instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n\n  /**\n   * Get a list of all available music categories\n   * @returns Promise resolving to an array of music categories\n   * @see https://creatify.mintlify.app/api-reference/musics/get-api-music-categories\n   */\n  async getMusicCategories(): Promise<Musics.MusicCategory[]> {\n    try {\n      const categories = await this.client.get<Musics.MusicCategory[]>('/api/music_categories/');\n\n      // Ensure categories is an array\n      if (!Array.isArray(categories)) {\n        return [];\n      }\n\n      return categories;\n    } catch (error) {\n      console.error('Error fetching music categories:', error);\n      return [];\n    }\n  }\n\n  /**\n   * Get a list of all available music tracks\n   * @param category Optional category to filter by\n   * @returns Promise resolving to an array of music tracks\n   * @see https://creatify.mintlify.app/api-reference/musics/get-api-musics\n   */\n  async getMusics(category?: string): Promise<Musics.MusicTrack[]> {\n    try {\n      const params = category ? { category } : undefined;\n      const tracks = await this.client.get<Musics.MusicTrack[]>('/api/musics/', params);\n\n      // Ensure tracks is an array\n      if (!Array.isArray(tracks)) {\n        return [];\n      }\n\n      return tracks;\n    } catch (error) {\n      console.error('Error fetching music tracks:', error);\n      return [];\n    }\n  }\n}\n","import { CreatifyApiOptions } from '../types';\nimport { Workspace } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify Workspace API\n * @see https://creatify.mintlify.app/api-reference/workspace\n */\nexport class WorkspaceApi {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new WorkspaceApi instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n\n  /**\n   * Get the remaining credits for the current workspace\n   * @returns Promise resolving to the remaining credits\n   * @see https://creatify.mintlify.app/api-reference/workspace/get-remainingcredits\n   */\n  async getRemainingCredits(): Promise<Workspace.RemainingCreditsResponse> {\n    try {\n      return await this.client.get<Workspace.RemainingCreditsResponse>('/api/remaining_credits/');\n    } catch (error) {\n      console.error('Error fetching remaining credits:', error);\n      // Return a default response to prevent crashes\n      return {\n        remaining_credits: 0,\n      };\n    }\n  }\n}\n","import { CreatifyApiOptions } from '../types';\nimport { LipsyncV2 } from '../types';\nimport { ICreatifyApiClient } from '../types/api-client';\nimport { apiClientFactory } from '../client-factory';\n\n/**\n * Client for interacting with the Creatify Lipsync v2 API\n * @see https://creatify.mintlify.app/api-reference/lipsyncs_v2\n */\nexport class LipsyncV2Api {\n  private client: ICreatifyApiClient;\n\n  /**\n   * Create a new LipsyncV2Api instance\n   * @param options API client options\n   * @param clientFactory Optional factory for creating API clients (useful for testing)\n   */\n  constructor(options: CreatifyApiOptions, clientFactory = apiClientFactory) {\n    this.client = clientFactory.createClient(options);\n  }\n\n  /**\n   * Create a lipsync v2 video with multiple AI avatars speaking\n   * @param params Parameters for the lipsync v2 video generation\n   * @returns Promise resolving to the lipsync v2 task response\n   * @see https://creatify.mintlify.app/api-reference/lipsyncs_v2/post-apilipsyncs\n   */\n  async createLipsyncV2(params: LipsyncV2.LipsyncV2Params): Promise<LipsyncV2.LipsyncV2Response> {\n    try {\n      return await this.client.post<LipsyncV2.LipsyncV2Response>('/api/lipsyncs_v2/', params);\n    } catch (error) {\n      console.error('Error creating lipsync v2:', error);\n      throw error;\n    }\n  }\n\n  /**\n   * Get the status and result of a lipsync v2 task\n   * @param id ID of the lipsync v2 task\n   * @returns Promise resolving to the lipsync v2 task status and result\n   * @see https://creatify.mintlify.app/api-reference/lipsyncs_v2/get-apilipsyncs-\n   */\n  async getLipsyncV2(id: string): Promise<LipsyncV2.LipsyncV2ResultResponse> {\n    try {\n      return await this.client.get<LipsyncV2.LipsyncV2ResultResponse>(`/api/lipsyncs_v2/${id}/`);\n    } catch (error) {\n      console.error(`Error fetching lipsync v2 result for ID ${id}:`, error);\n      // Return a default response to prevent crashes\n      return {\n        id,\n        status: 'error',\n        error_message:\n          error instanceof Error ? error.message : 'An error occurred with the API request',\n        success: false,\n        created_at: new Date().toISOString(),\n        updated_at: new Date().toISOString(),\n      } as LipsyncV2.LipsyncV2ResultResponse;\n    }\n  }\n\n  /**\n   * Get all lipsync v2 tasks\n   * @returns Promise resolving to an array of lipsync v2 tasks\n   * @see https://creatify.mintlify.app/api-reference/lipsyncs_v2/get-apilipsyncs\n   */\n  async getLipsyncsV2(): Promise<LipsyncV2.LipsyncV2ResultResponse[]> {\n    try {\n      const results =\n        await this.client.get<LipsyncV2.LipsyncV2ResultResponse[]>('/api/lipsyncs_v2/');\n      return Array.isArray(results) ? results : [];\n    } catch (error) {\n      console.error('Error fetching lipsync v2 tasks:', error);\n      return [];\n    }\n  }\n\n  /**\n   * Generate a preview of a lipsync v2 video\n   * @param id ID of the lipsync v2 task\n   * @returns Promise resolving to the lipsync v2 task response\n   * @see https://creatify.mintlify.app/api-reference/lipsyncs_v2/post-apilipsyncs-preview\n   */\n  async generateLipsyncV2Preview(id: string): Promise<LipsyncV2.LipsyncV2Response> {\n    return this.client.post<LipsyncV2.LipsyncV2Response>(`/api/lipsyncs_v2/${id}/preview/`, {});\n  }\n\n  /**\n   * Render a lipsync v2 video\n   * @param id ID of the lipsync v2 task\n   * @returns Promise resolving to the lipsync v2 task response\n   * @see https://creatify.mintlify.app/api-reference/lipsyncs_v2/post-apilipsyncs-render\n   */\n  async renderLipsyncV2(id: string): Promise<LipsyncV2.LipsyncV2Response> {\n    return this.client.post<LipsyncV2.LipsyncV2Response>(`/api/lipsyncs_v2/${id}/render/`, {});\n  }\n\n  /**\n   * Create a lipsync v2 video and wait for it to complete\n   * @param params Parameters for the lipsync v2 video generation\n   * @param pollInterval How often to check status in ms (default 2000)\n   * @param maxAttempts Maximum number of polling attempts (default 30)\n   * @returns Promise resolving to the completed lipsync v2 task\n   */\n  async createAndWaitForLipsyncV2(\n    params: LipsyncV2.LipsyncV2Params,\n    pollInterval: number = 2000,\n    maxAttempts: number = 30\n  ): Promise<LipsyncV2.LipsyncV2ResultResponse> {\n    try {\n      // Create the lipsync v2 task\n      const response = await this.createLipsyncV2(params);\n\n      // Poll for completion\n      let attempts = 0;\n      let result = await this.getLipsyncV2(response.id);\n\n      while (attempts < maxAttempts && result.status !== 'done' && result.status !== 'error') {\n        // Wait for the specified interval\n        await new Promise(resolve => setTimeout(resolve, pollInterval));\n\n        // Check the status again\n        result = await this.getLipsyncV2(response.id);\n        attempts++;\n      }\n\n      // Check if we reached max attempts without completion\n      if (attempts >= maxAttempts && result.status !== 'done' && result.status !== 'error') {\n        const error = new Error(\n          `Lipsync v2 task ${response.id} did not complete within the timeout period`\n        );\n        // Create a result with error status\n        return {\n          id: response.id,\n          status: 'error',\n          error_message: error instanceof Error ? error.message : 'Unknown error',\n          success: false,\n          created_at: result.created_at || new Date().toISOString(),\n          updated_at: new Date().toISOString(),\n        };\n      }\n\n      return result;\n    } catch (error) {\n      // Handle any unexpected errors\n      console.error('Error in createAndWaitForLipsyncV2:', error);\n      return {\n        id: 'error',\n        status: 'error',\n        error_message: error instanceof Error ? error.message : 'Unknown error',\n        success: false,\n        created_at: new Date().toISOString(),\n        updated_at: new Date().toISOString(),\n      };\n    }\n  }\n}\n"]}