UNPKG

@tsavo/creatify-api-ts

Version:

TypeScript client for the Creatify AI API

1 lines 78 kB
{"version":3,"sources":["../src/utils/index.ts","../src/types/index.ts","../src/index.ts","../src/utils/video-creator.ts","../src/utils/audio-processor.ts","../src/utils/batch-processor.ts"],"names":["utils_exports","__export","AudioProcessor","BatchProcessor","VideoCreator","types_exports","Creatify","options","AvatarApi","apiClientFactory","UrlToVideoApi","TextToSpeechApi","AiEditingApi","CustomTemplatesApi","DyoaApi","AiShortsApi","AiScriptsApi","MusicsApi","WorkspaceApi","LipsyncV2Api","apiIdOrOptions","apiKey","clientFactory","avatars","avatar","voices","voice","name","normalizedName","pollInterval","maxPollingAttempts","aspectRatio","avatarId","voiceId","lipsyncResponse","lipsyncResult","attempts","resolve","error","conversations","backgroundUrl","videoInputs","conversation","multiAvatarResponse","result","script","accentId","waitForCompletion","params","id","maxAttempts","DEFAULT_BATCH_OPTIONS","_clientFactory","tasks","opts","activeTasks","taskIndex","queue","currentIndex","taskPromise","taskResult","lastError","retryCount","retryDelay","p","avatarTasks","task","textToSpeechTasks","aiEditingTasks","aiShortsTasks","aiScriptsTasks","lipsyncV2Tasks"],"mappings":";AAAA,IAAAA,EAAA,GAAAC,CAAAA,CAAAD,EAAA,CAAAE,cAAAA,CAAAA,IAAAA,CAAAA,CAAA,mBAAAC,CAAA,CAAA,YAAA,CAAA,IAAAC,ICAAC,IAAAA,CAAAA,CAAA,GCqBaC,IAAAA,CAAAA,CAAN,KAAe,CAIZ,OAAA,CAKD,OAKA,UAKA,CAAA,YAAA,CAKA,UAKA,eAKA,CAAA,IAAA,CAKA,SAKA,SAKA,CAAA,MAAA,CAKA,UAKA,SAMP,CAAA,WAAA,CAAYC,EAAmC,CAC7C,IAAA,CAAK,QAAUA,CACf,CAAA,IAAA,CAAK,OAAS,IAAIC,CAAAA,CAAUD,EAASE,CAAgB,CAAA,CACrD,KAAK,UAAa,CAAA,IAAIC,CAAcH,CAAAA,CAAAA,CAASE,CAAgB,CAC7D,CAA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,YAAA,CAAab,EAAO9C,CAAO,CACzC,CAQA,MAAM,oBAAA,CACJ8D,EAOA9D,CAAkC,CAAA,GAClC,CACA,IAAM8C,EAAQgB,CAAc,CAAA,GAAA,CAAIH,GACvB,SACE,IAAA,CAAK,IAAI,QAAS,CAAA,wBAAA,CAAyB,CAChD,MAAQA,CAAAA,CAAAA,CAAK,OACb,YAAcA,CAAAA,CAAAA,CAAK,YACnB,eAAiBA,CAAAA,CAAAA,CAAK,cACtB,CAAA,eAAA,CAAiBA,EAAK,cACtB,CAAA,QAAA,CAAUA,EAAK,QACjB,CAAC,CAEJ,CAED,CAAA,OAAO,KAAK,YAAab,CAAAA,CAAAA,CAAO9C,CAAO,CACzC,CAQA,MAAM,qBACJ+D,CAAAA,CAAAA,CAOA/D,EAAkC,EAAC,CACnC,CACA,IAAM8C,CAAAA,CAAQiB,EAAe,GAAIJ,CAAAA,CAAAA,EACxB,SACE,IAAK,CAAA,GAAA,CAAI,UAAU,wBAAyB,CAAA,CACjD,OAAQA,CAAK,CAAA,MAAA,CACb,gBAAiBA,CAAK,CAAA,cAAA,CACtB,gBAAiBA,CAAK,CAAA,cAAA,CACtB,SAAUA,CAAK,CAAA,QAAA,CACf,cAAeA,CAAK,CAAA,YACtB,CAAC,CAEJ,CAAA,CAED,OAAO,IAAK,CAAA,YAAA,CAAab,EAAO9C,CAAO,CACzC,CAQA,MAAM,qBAAA,CACJgE,EACAhE,CAAkC,CAAA,GAClC,CACA,IAAM8C,EAAQkB,CAAe,CAAA,GAAA,CAAIL,GACxB,SACE,IAAA,CAAK,IAAI,SAAU,CAAA,yBAAA,CAA0B,CAClD,YAAcA,CAAAA,CAAAA,CAAK,YACnB,YAAcA,CAAAA,CAAAA,CAAK,WACrB,CAAC,CAEJ,EAED,OAAO,IAAA,CAAK,aAAab,CAAO9C,CAAAA,CAAO,CACzC,CACF","file":"chunk-U6MYYBUL.mjs","sourcesContent":["import { VideoCreator } from './video-creator';\nimport { AudioProcessor } from './audio-processor';\nimport { BatchProcessor, BatchProcessingOptions, BatchResult } from './batch-processor';\n\nexport { VideoCreator, AudioProcessor, BatchProcessor, BatchProcessingOptions, BatchResult };\n","/**\n * Configuration options for the Creatify API client\n */\nexport interface CreatifyApiOptions {\n /**\n * The API ID from your Creatify account\n */\n apiId: string;\n\n /**\n * The API key from your Creatify account\n */\n apiKey: string;\n\n /**\n * Base URL for the Creatify API (optional, defaults to https://api.creatify.ai)\n */\n baseUrl?: string;\n\n /**\n * Request timeout in milliseconds (optional, defaults to 30000)\n */\n timeout?: number;\n}\n\n/**\n * Base response interface for all API responses\n */\nexport interface ApiResponse {\n /**\n * Whether the request was successful\n */\n success: boolean;\n\n /**\n * Error message if the request failed\n */\n error?: string;\n}\n\n/**\n * Standard pagination parameters\n */\nexport interface PaginationParams {\n /**\n * Page number (starts from 1)\n */\n page?: number;\n\n /**\n * Number of items per page\n */\n limit?: number;\n}\n\n/**\n * Common aspect ratio options for video generation\n * Note: API accepts both colon format ('16:9') and 'x' format ('16x9')\n */\nexport type AspectRatio =\n | '1:1'\n | '16:9'\n | '9:16'\n | '4:3'\n | '3:4'\n | '1x1'\n | '16x9'\n | '9x16'\n | '4x3'\n | '3x4';\n\n/**\n * Common status values for tasks\n */\nexport type TaskStatus =\n | 'pending'\n | 'in_queue'\n | 'running'\n | 'processing'\n | 'failed'\n | 'done'\n | 'error';\n\n/* eslint-disable @typescript-eslint/no-namespace */\nexport namespace Avatar {\n /**\n * Avatar information as returned by the /api/personas/ endpoint\n * @see https://creatify.mintlify.app/api-reference/personas/get-apipersonas\n */\n export interface AvatarInfo {\n /**\n * Unique identifier for the avatar\n */\n id: string;\n\n /**\n * Alias for id - used in MultiAvatarLipsyncParams and other API interactions\n */\n avatar_id?: string;\n\n /**\n * Display name for the avatar\n */\n name?: string;\n\n /**\n * Creation timestamp\n */\n created_at: string;\n\n /**\n * Last update timestamp\n */\n updated_at: string;\n\n /**\n * Gender of the avatar (m = male, f = female, nb = non binary)\n */\n gender: 'm' | 'f' | 'nb';\n\n /**\n * Age range of the avatar (child, teen, adult, senior)\n */\n age_range: 'child' | 'teen' | 'adult' | 'senior';\n\n /**\n * Location type (outdoor, fantasy, indoor, other)\n */\n location: 'outdoor' | 'fantasy' | 'indoor' | 'other';\n\n /**\n * Style (selfie, presenter, other)\n */\n style: 'selfie' | 'presenter' | 'other';\n\n /**\n * Name of the creator\n */\n creator_name: string;\n\n /**\n * Video scene description\n */\n video_scene: string;\n\n /**\n * Keywords associated with the avatar\n */\n keywords: string;\n\n /**\n * Preview image URL for 16:9 aspect ratio\n */\n preview_image_16_9: string;\n\n /**\n * Preview image URL for 1:1 aspect ratio\n */\n preview_image_1_1: string;\n\n /**\n * Preview image URL for 9:16 aspect ratio\n */\n preview_image_9_16: string;\n\n /**\n * Preview video URL for 16:9 aspect ratio\n */\n preview_video_16_9: string;\n\n /**\n * Preview video URL for 1:1 aspect ratio\n */\n preview_video_1_1: string;\n\n /**\n * Preview video URL for 9:16 aspect ratio\n */\n preview_video_9_16: string;\n\n /**\n * Landscape preview video URL (legacy)\n */\n landscape_preview_video: string;\n\n /**\n * Squared preview video URL (legacy)\n */\n squared_preview_video: string;\n\n /**\n * Whether the avatar is active\n */\n is_active: boolean;\n\n /**\n * Processing status\n */\n process_status: string;\n\n /**\n * Reason for failure if any\n */\n failed_reason: string;\n\n /**\n * Avatar type\n */\n type: string;\n }\n\n /**\n * Accent information within a voice\n */\n export interface AccentInfo {\n /**\n * Unique identifier for the accent\n */\n id: string;\n\n /**\n * Name of the accent\n */\n name: string;\n\n /**\n * Preview URL for the accent\n */\n preview_url?: string;\n }\n\n /**\n * Voice information as returned by the /api/voices/ endpoint\n */\n export interface VoiceInfo {\n /**\n * Unique identifier for the voice\n * Note: May be provided as voice_id or id depending on API version\n */\n voice_id: string;\n\n /**\n * Alternative identifier field\n */\n id?: string;\n\n /**\n * Name of the voice\n */\n name: string;\n\n /**\n * Language of the voice (e.g., \"en\", \"fr\")\n */\n language?: string;\n\n /**\n * Gender of the voice (e.g., \"male\", \"female\")\n */\n gender?: string;\n\n /**\n * Array of accents available for this voice\n */\n accents?: AccentInfo[];\n\n /**\n * Preview URL for the voice (may be available directly or through accents)\n */\n preview_url?: string;\n }\n\n /**\n * Parameters for creating a lipsync video\n * @see https://creatify.mintlify.app/api-reference/lipsyncs/post-apilipsyncs\n */\n export interface LipsyncParams {\n /**\n * Text to be spoken by the avatar\n */\n text: string;\n\n /**\n * Avatar ID to use for the video\n */\n creator: string;\n\n /**\n * Aspect ratio of the generated video\n * Available options: \"1:1\", \"16:9\", \"9:16\"\n */\n aspect_ratio?: AspectRatio;\n\n /**\n * Voice ID to use (optional)\n * If not provided, the system will use a default voice\n */\n voice_id?: string;\n\n /**\n * Background image URL (optional)\n * If provided, this image will be used as the background\n */\n background_url?: string;\n\n /**\n * Background color (optional)\n * CSS color value like \"#FF0000\" or \"rgb(255,0,0)\"\n */\n background_color?: string;\n\n /**\n * Output in transparent format (optional)\n * If true, the output video will have transparent background (for compositing)\n */\n transparent?: boolean;\n\n /**\n * Webhook URL to be called when the video is ready (optional)\n * The system will POST to this URL when processing is complete\n */\n webhook_url?: string;\n\n /**\n * Custom metadata for tracking (optional)\n * This data will be returned in webhook calls\n */\n metadata?: Record<string, unknown>;\n }\n\n /**\n * Response when creating a lipsync task\n */\n export interface LipsyncResponse extends ApiResponse {\n /**\n * ID of the created lipsync task\n */\n id: string;\n\n /**\n * Status of the lipsync task\n * API may return: 'pending', 'in_queue', 'running', 'failed', 'done', 'error'\n */\n status: 'pending' | 'in_queue' | 'running' | 'processing' | 'failed' | 'done' | 'error';\n }\n\n /**\n * Response when getting a lipsync task\n */\n export interface LipsyncResultResponse extends LipsyncResponse {\n /**\n * Output URL of the generated video (only available when status is 'done')\n */\n output?: string;\n\n /**\n * Error message if the task failed\n */\n error_message?: string;\n\n /**\n * Created timestamp\n */\n created_at: string;\n\n /**\n * Updated timestamp\n */\n updated_at: string;\n\n /**\n * Video thumbnail URL\n */\n video_thumbnail?: string;\n\n /**\n * Number of credits used for this video\n */\n credits_used?: number;\n\n /**\n * Progress indication (e.g., percentage)\n */\n progress?: string;\n\n /**\n * Media job ID\n */\n media_job?: string;\n\n /**\n * Whether the lipsync task is hidden\n */\n is_hidden?: boolean;\n }\n\n /**\n * Parameters for creating a multi-avatar lipsync video\n */\n export interface MultiAvatarLipsyncParams {\n /**\n * Array of video input configurations\n */\n video_inputs: {\n /**\n * Character configuration\n */\n character: {\n /**\n * Type of character (always \"avatar\" for now)\n */\n type: 'avatar';\n\n /**\n * Avatar ID to use\n */\n avatar_id: string;\n\n /**\n * Avatar style (e.g., \"normal\")\n */\n avatar_style: string;\n\n /**\n * Position offset of the avatar\n */\n offset?: {\n x: number;\n y: number;\n };\n };\n\n /**\n * Voice configuration\n */\n voice: {\n /**\n * Type of voice input (always \"text\" for now)\n */\n type: 'text';\n\n /**\n * Text to be spoken\n */\n input_text: string;\n\n /**\n * Voice ID to use\n */\n voice_id: string;\n };\n\n /**\n * Background configuration\n */\n background: {\n /**\n * Type of background (always \"image\" for now)\n */\n type: 'image';\n\n /**\n * URL of the background image\n */\n url: string;\n };\n\n /**\n * Caption settings\n */\n caption_setting?: {\n /**\n * Style of the caption\n */\n style: string;\n\n /**\n * Position offset of the caption\n */\n offset?: {\n x: number;\n y: number;\n };\n };\n }[];\n\n /**\n * Aspect ratio of the generated video\n */\n aspect_ratio: AspectRatio;\n\n /**\n * Webhook URL to be called when the video is ready (optional)\n */\n webhook_url?: string;\n }\n}\n\n/**\n * URL-to-Video API types\n * @see https://creatify.mintlify.app/api-reference/link-to-video\n */\nexport namespace UrlToVideo {\n /**\n * Parameters for creating a link\n * @see https://creatify.mintlify.app/api-reference/link-to-video\n */\n export interface LinkParams {\n /**\n * URL to extract content from\n */\n url: string;\n }\n\n /**\n * Response when creating a link\n */\n export interface LinkResponse {\n /**\n * Unique identifier for the link\n */\n id: string;\n\n /**\n * Original URL\n */\n url: string;\n\n /**\n * Link data object\n */\n link: LinkData;\n }\n\n /**\n * Parameters for creating a link with custom parameters\n */\n export interface CustomLinkParams {\n /**\n * Title of the content\n */\n title: string;\n\n /**\n * Description of the content\n */\n description: string;\n\n /**\n * URLs of images to use in the video\n */\n image_urls: string[];\n\n /**\n * URLs of videos to use (optional)\n */\n video_urls?: string[];\n\n /**\n * Customer reviews (optional)\n */\n reviews?: Array<{\n rating: number;\n text: string;\n author?: string;\n date?: string;\n }>;\n\n /**\n * URL of the logo (optional)\n */\n logo_url?: string;\n }\n\n /**\n * Link data returned by the API\n * @see https://creatify.mintlify.app/api-reference/link-to-video\n */\n export interface LinkData {\n /**\n * Unique identifier for the link\n */\n id: string;\n\n /**\n * Original URL\n */\n url: string;\n\n /**\n * Title extracted from the URL\n */\n title: string;\n\n /**\n * Description extracted from the URL\n */\n description: string;\n\n /**\n * URLs of images extracted from the URL\n */\n image_urls: string[];\n\n /**\n * URLs of videos extracted from the URL\n */\n video_urls: string[];\n\n /**\n * Reviews extracted from the URL (if any)\n */\n reviews?: Array<{\n rating: number;\n text: string;\n author?: string;\n date?: string;\n }>;\n\n /**\n * URL of the logo extracted from the URL\n */\n logo_url?: string;\n }\n\n /**\n * Parameters for creating a video from a link\n * @see https://creatify.mintlify.app/api-reference/link_to_videos/post-apilink_to_videos\n */\n export interface VideoFromLinkParams {\n /**\n * ID of the link to create a video from\n */\n link: string;\n\n /**\n * Optional name for the video\n */\n name?: string;\n\n /**\n * Target platform for the video (e.g., \"Tiktok\", \"Instagram\")\n */\n target_platform?: string;\n\n /**\n * Target audience description\n */\n target_audience?: string;\n\n /**\n * Language code for the video (e.g., \"en\", \"es\", \"fr\", \"de\", \"ar\")\n */\n language?: string;\n\n /**\n * Length of the video in seconds (default: 15)\n */\n video_length?: number;\n\n /**\n * Aspect ratio of the video (e.g., \"16x9\", \"9x16\", \"1x1\")\n */\n aspect_ratio?: string;\n\n /**\n * Script style to use for generating the video script\n */\n script_style?: string;\n\n /**\n * Visual style to use for generating the video\n */\n visual_style?: string;\n\n /**\n * Override the avatar with a specific avatar ID\n */\n override_avatar?: string;\n\n /**\n * Override the voice with a specific voice ID\n */\n override_voice?: string;\n\n /**\n * Override the auto-generated script with a custom script\n */\n override_script?: string;\n\n /**\n * URL to a background music track\n */\n background_music_url?: string;\n\n /**\n * Volume level for background music (0.0 - 1.0)\n */\n background_music_volume?: number;\n\n /**\n * Volume level for voiceover (0.0 - 1.0)\n */\n voiceover_volume?: number;\n\n /**\n * Webhook URL to be called when the video is ready\n */\n webhook_url?: string;\n\n /**\n * Disable background music if true\n */\n no_background_music?: boolean;\n\n /**\n * Disable captions if true\n */\n no_caption?: boolean;\n\n /**\n * Disable emotional expressions if true\n */\n no_emotion?: boolean;\n\n /**\n * Disable call-to-action if true\n */\n no_cta?: boolean;\n\n /**\n * Disable stock b-roll footage if true\n */\n no_stock_broll?: boolean;\n\n /**\n * Caption style (e.g., \"normal-black\")\n */\n caption_style?: string;\n\n /**\n * Caption horizontal offset\n */\n caption_offset_x?: string | number;\n\n /**\n * Caption vertical offset\n */\n caption_offset_y?: string | number;\n\n /**\n * Detailed caption settings\n */\n caption_setting?: {\n /**\n * Caption style\n */\n style?: string;\n\n /**\n * Caption position offset\n */\n offset?: {\n x: number;\n y: number;\n };\n\n /**\n * Font family\n */\n font_family?: string;\n\n /**\n * Font size\n */\n font_size?: number;\n\n /**\n * Font style\n */\n font_style?: string;\n\n /**\n * Background color\n */\n background_color?: string;\n\n /**\n * Text color\n */\n text_color?: string;\n\n /**\n * Highlight text color\n */\n highlight_text_color?: string;\n\n /**\n * Maximum width\n */\n max_width?: number;\n\n /**\n * Line height\n */\n line_height?: number;\n\n /**\n * Text shadow\n */\n text_shadow?: string;\n\n /**\n * Hide captions if true\n */\n hidden?: boolean;\n };\n }\n\n /**\n * Response when creating a video from a link\n * @see https://creatify.mintlify.app/api-reference/link_to_videos/post-apilink_to_videos\n */\n export interface VideoResponse {\n /**\n * ID of the created video task\n */\n id: string;\n\n /**\n * Status of the video task\n * API may return: 'pending', 'in_queue', 'running', 'failed', 'done', 'error'\n */\n status: 'pending' | 'in_queue' | 'running' | 'failed' | 'done' | 'error';\n\n /**\n * Link ID used to create the video\n */\n link: string;\n\n /**\n * Media job ID\n */\n media_job: string;\n\n /**\n * Reason for failure if the task failed\n */\n failed_reason?: string;\n\n /**\n * Other parameters match the input parameters\n */\n [key: string]: unknown;\n }\n\n /**\n * Response when getting a video result\n * @see https://creatify.mintlify.app/api-reference/link_to_videos/get-apilink_to_videos-\n */\n export interface VideoResultResponse extends VideoResponse {\n /**\n * URL of the generated video (only available when status is 'done')\n * Note: API may return this as either 'video_output' or 'output'\n */\n video_output?: string;\n\n /**\n * URL of the generated video (alternative field name)\n */\n output?: string;\n\n /**\n * URL of the video thumbnail\n */\n video_thumbnail?: string;\n\n /**\n * Number of credits used for this video\n */\n credits_used?: number;\n\n /**\n * Progress indication (e.g., percentage)\n */\n progress?: string;\n\n /**\n * Created timestamp\n */\n created_at?: string;\n\n /**\n * Updated timestamp\n */\n updated_at?: string;\n }\n}\n\n/**\n * Text to Speech API types\n * @see https://creatify.mintlify.app/api-reference/text-to-speech\n */\nexport namespace TextToSpeech {\n /**\n * Voice information\n */\n export interface Voice {\n /**\n * Unique identifier for the voice\n */\n id?: string;\n\n /**\n * Alternative identifier field\n */\n voice_id?: string;\n\n /**\n * Display name of the voice\n */\n name: string;\n\n /**\n * Language code (e.g., 'en-US')\n */\n language_code?: string;\n\n /**\n * Language of the voice (e.g., \"en\", \"fr\")\n */\n language?: string;\n\n /**\n * Gender of the voice ('male' or 'female')\n */\n gender?: string;\n\n /**\n * Sample audio URL\n */\n sample_url?: string;\n\n /**\n * Array of accents available for this voice\n */\n accents?: Avatar.AccentInfo[];\n }\n /**\n * Parameters for creating a text-to-speech task\n * @see https://creatify.mintlify.app/api-reference/text-to-speech/post-text-to-speech\n */\n export interface TextToSpeechParams {\n /**\n * Text script to be converted to speech\n */\n script: string;\n\n /**\n * Accent/voice ID to use for the speech\n * You can get the accent id by calling the Get voices endpoint\n */\n accent: string;\n\n /**\n * Webhook URL to be called when the audio is ready (optional)\n * The system will POST to this URL when processing is complete\n */\n webhook_url?: string;\n }\n\n /**\n * Response when creating a text-to-speech task\n */\n export interface TextToSpeechResponse {\n /**\n * ID of the created text-to-speech task\n */\n id: string;\n\n /**\n * Status of the text-to-speech task\n * API may return: 'pending', 'in_queue', 'running', 'failed', 'done', 'error'\n */\n status: 'pending' | 'in_queue' | 'running' | 'failed' | 'done' | 'error';\n\n /**\n * The script that was submitted\n */\n script: string;\n\n /**\n * The accent/voice ID that was used\n */\n accent: string;\n\n /**\n * The webhook URL that was provided (if any)\n */\n webhook_url?: string;\n\n /**\n * Media job ID\n */\n media_job?: string;\n\n /**\n * Whether the TTS task is hidden\n */\n is_hidden?: boolean;\n\n /**\n * Reason for failure if the task failed\n */\n failed_reason?: string;\n }\n\n /**\n * Response when getting a text-to-speech task\n * @see https://creatify.mintlify.app/api-reference/text-to-speech/get-text-to-speech-\n */\n export interface TextToSpeechResultResponse extends TextToSpeechResponse {\n /**\n * Output URL of the generated audio (only available when status is 'done')\n */\n output?: string;\n\n /**\n * Created timestamp\n */\n created_at: string;\n\n /**\n * Updated timestamp\n */\n updated_at: string;\n }\n}\n\n/**\n * AI Editing API types\n */\nexport namespace AiEditing {\n /**\n * Editing styles available for AI editing\n */\n export type EditingStyle = 'film' | 'commercial' | 'music' | 'tutorial' | 'vlog' | 'social';\n\n /**\n * Parameters for creating an AI editing task\n */\n export interface AiEditingParams {\n /**\n * URL of the video to be edited\n */\n video_url: string;\n\n /**\n * Editing style to apply\n */\n editing_style: EditingStyle;\n\n /**\n * Webhook URL to be called when the edited video is ready (optional)\n */\n webhook_url?: string;\n }\n\n /**\n * Response when creating an AI editing task\n */\n export interface AiEditingResponse extends ApiResponse {\n /**\n * ID of the created AI editing task\n */\n id: string;\n\n /**\n * Status of the AI editing task\n */\n status: 'pending' | 'processing' | 'done' | 'error';\n }\n\n /**\n * Response when getting an AI editing task\n */\n export interface AiEditingResultResponse extends AiEditingResponse {\n /**\n * Output URL of the edited video (only available when status is 'done')\n */\n output?: string;\n\n /**\n * Error message if the task failed\n */\n error_message?: string;\n\n /**\n * Created timestamp\n */\n created_at: string;\n\n /**\n * Updated timestamp\n */\n updated_at: string;\n }\n}\n\n/**\n * Custom Templates API types\n */\nexport namespace CustomTemplates {\n /**\n * Parameters for creating a video using a custom template\n */\n export interface CustomTemplateParams {\n /**\n * Visual style/template name to use\n */\n visual_style: string;\n\n /**\n * Custom data to populate the template\n */\n data: Record<string, unknown>;\n\n /**\n * Webhook URL to be called when the video is ready (optional)\n */\n webhook_url?: string;\n }\n\n /**\n * Response when creating a custom template video\n */\n export interface CustomTemplateResponse extends ApiResponse {\n /**\n * ID of the created custom template task\n */\n id: string;\n\n /**\n * Status of the custom template task\n */\n status: 'pending' | 'processing' | 'done' | 'error';\n }\n\n /**\n * Response when getting a custom template task\n */\n export interface CustomTemplateResultResponse extends CustomTemplateResponse {\n /**\n * Output URL of the generated video (only available when status is 'done')\n */\n output?: string;\n\n /**\n * Error message if the task failed\n */\n error_message?: string;\n\n /**\n * Created timestamp\n */\n created_at: string;\n\n /**\n * Updated timestamp\n */\n updated_at: string;\n }\n}\n\n/**\n * AI Shorts API types\n * @see https://creatify.mintlify.app/api-reference/ai-shorts\n */\nexport namespace AiShorts {\n /**\n * Parameters for creating an AI Shorts task\n * @see https://creatify.mintlify.app/api-reference/ai-shorts/post-ai-shorts\n */\n export interface AiShortsParams {\n /**\n * Text prompt for the AI Shorts video\n */\n prompt: string;\n\n /**\n * Aspect ratio of the generated video\n */\n aspect_ratio: AspectRatio;\n\n /**\n * Target platform for the video (e.g., \"Tiktok\", \"Instagram\")\n */\n target_platform?: string;\n\n /**\n * Target audience description\n */\n target_audience?: string;\n\n /**\n * Language code for the video (e.g., \"en\", \"es\", \"fr\", \"de\", \"ar\")\n */\n language?: string;\n\n /**\n * Length of the video in seconds\n */\n video_length?: number;\n\n /**\n * Visual style to use for generating the video\n */\n visual_style?: string;\n\n /**\n * Webhook URL to be called when the video is ready (optional)\n */\n webhook_url?: string;\n }\n\n /**\n * Response when creating an AI Shorts task\n */\n export interface AiShortsResponse extends ApiResponse {\n /**\n * ID of the created AI Shorts task\n */\n id: string;\n\n /**\n * Status of the AI Shorts task\n */\n status: TaskStatus;\n }\n\n /**\n * Response when getting an AI Shorts task\n */\n export interface AiShortsResultResponse extends AiShortsResponse {\n /**\n * Output URL of the generated video (only available when status is 'done')\n */\n output?: string;\n\n /**\n * Error message if the task failed\n */\n error_message?: string;\n\n /**\n * Created timestamp\n */\n created_at: string;\n\n /**\n * Updated timestamp\n */\n updated_at: string;\n\n /**\n * Video thumbnail URL\n */\n video_thumbnail?: string;\n\n /**\n * Number of credits used for this video\n */\n credits_used?: number;\n\n /**\n * Progress indication (e.g., percentage)\n */\n progress?: string;\n }\n\n /**\n * Parameters for generating a preview of AI Shorts\n */\n export interface AiShortsPreviewParams {\n /**\n * ID of the AI Shorts task\n */\n id: string;\n }\n\n /**\n * Parameters for rendering an AI Shorts video\n */\n export interface AiShortsRenderParams {\n /**\n * ID of the AI Shorts task\n */\n id: string;\n }\n}\n\n/**\n * AI Scripts API types\n * @see https://creatify.mintlify.app/api-reference/ai-scripts\n */\nexport namespace AiScripts {\n /**\n * Parameters for generating AI Scripts\n * @see https://creatify.mintlify.app/api-reference/ai-scripts/post-ai-scripts\n */\n export interface AiScriptsParams {\n /**\n * Text prompt for the AI Script\n */\n prompt: string;\n\n /**\n * Target platform for the script (e.g., \"Tiktok\", \"Instagram\")\n */\n target_platform?: string;\n\n /**\n * Target audience description\n */\n target_audience?: string;\n\n /**\n * Language code for the script (e.g., \"en\", \"es\", \"fr\", \"de\", \"ar\")\n */\n language?: string;\n\n /**\n * Length of the script in seconds\n */\n script_length?: number;\n\n /**\n * Script style to use\n */\n script_style?: string;\n\n /**\n * Webhook URL to be called when the script is ready (optional)\n */\n webhook_url?: string;\n }\n\n /**\n * Response when creating an AI Scripts task\n */\n export interface AiScriptsResponse extends ApiResponse {\n /**\n * ID of the created AI Scripts task\n */\n id: string;\n\n /**\n * Status of the AI Scripts task\n */\n status: TaskStatus;\n }\n\n /**\n * Response when getting an AI Scripts task\n */\n export interface AiScriptsResultResponse extends AiScriptsResponse {\n /**\n * Generated script content (only available when status is 'done')\n */\n script?: string;\n\n /**\n * Error message if the task failed\n */\n error_message?: string;\n\n /**\n * Created timestamp\n */\n created_at: string;\n\n /**\n * Updated timestamp\n */\n updated_at: string;\n }\n}\n\n/**\n * Musics API types\n * @see https://creatify.mintlify.app/api-reference/musics\n */\nexport namespace Musics {\n /**\n * Music category information\n * @see https://creatify.mintlify.app/api-reference/musics/get-api-music-categories\n */\n export interface MusicCategory {\n /**\n * Name of the music category\n */\n name: string;\n }\n\n /**\n * Music track information\n * @see https://creatify.mintlify.app/api-reference/musics/get-api-musics\n */\n export interface MusicTrack {\n /**\n * ID of the music track\n */\n id: string;\n\n /**\n * Name of the music track\n */\n name: string;\n\n /**\n * URL to the music track\n */\n url: string;\n\n /**\n * Category of the music track\n */\n category: string;\n\n /**\n * Duration of the music track in seconds\n */\n duration?: number;\n }\n}\n\n/**\n * Workspace API types\n * @see https://creatify.mintlify.app/api-reference/workspace\n */\nexport namespace Workspace {\n /**\n * Response for remaining credits\n * @see https://creatify.mintlify.app/api-reference/workspace/get-remainingcredits\n */\n export interface RemainingCreditsResponse {\n /**\n * Number of remaining credits\n */\n remaining_credits: number;\n }\n}\n\n/**\n * Lipsync v2 API types\n * @see https://creatify.mintlify.app/api-reference/lipsyncs_v2\n */\nexport namespace LipsyncV2 {\n /**\n * Parameters for creating a lipsync v2 task\n * @see https://creatify.mintlify.app/api-reference/lipsyncs_v2/post-apilipsyncs\n */\n export interface LipsyncV2Params {\n /**\n * Array of video input configurations\n */\n video_inputs: {\n /**\n * Character configuration\n */\n character: {\n /**\n * Type of character (always \"avatar\" for now)\n */\n type: 'avatar';\n\n /**\n * Avatar ID to use\n */\n avatar_id: string;\n\n /**\n * Avatar style (e.g., \"normal\")\n */\n avatar_style: string;\n\n /**\n * Position offset of the avatar\n */\n offset?: {\n x: number;\n y: number;\n };\n };\n\n /**\n * Voice configuration\n */\n voice: {\n /**\n * Type of voice input (always \"text\" for now)\n */\n type: 'text';\n\n /**\n * Text to be spoken\n */\n input_text: string;\n\n /**\n * Voice ID to use\n */\n voice_id: string;\n };\n\n /**\n * Background configuration\n */\n background: {\n /**\n * Type of background (always \"image\" for now)\n */\n type: 'image';\n\n /**\n * URL of the background image\n */\n url: string;\n };\n\n /**\n * Caption settings\n */\n caption_setting?: {\n /**\n * Style of the caption\n */\n style: string;\n\n /**\n * Position offset of the caption\n */\n offset?: {\n x: number;\n y: number;\n };\n };\n }[];\n\n /**\n * Aspect ratio of the generated video\n */\n aspect_ratio: AspectRatio;\n\n /**\n * Webhook URL to be called when the video is ready (optional)\n */\n webhook_url?: string;\n }\n\n /**\n * Response when creating a lipsync v2 task\n */\n export interface LipsyncV2Response extends ApiResponse {\n /**\n * ID of the created lipsync v2 task\n */\n id: string;\n\n /**\n * Status of the lipsync v2 task\n */\n status: TaskStatus;\n }\n\n /**\n * Response when getting a lipsync v2 task\n */\n export interface LipsyncV2ResultResponse extends LipsyncV2Response {\n /**\n * Output URL of the generated video (only available when status is 'done')\n */\n output?: string;\n\n /**\n * Error message if the task failed\n */\n error_message?: string;\n\n /**\n * Created timestamp\n */\n created_at: string;\n\n /**\n * Updated timestamp\n */\n updated_at: string;\n\n /**\n * Video thumbnail URL\n */\n video_thumbnail?: string;\n\n /**\n * Number of credits used for this video\n */\n credits_used?: number;\n\n /**\n * Progress indication (e.g., percentage)\n */\n progress?: string;\n }\n\n /**\n * Parameters for generating a preview of lipsync v2\n */\n export interface LipsyncV2PreviewParams {\n /**\n * ID of the lipsync v2 task\n */\n id: string;\n }\n\n /**\n * Parameters for rendering a lipsync v2 task\n */\n export interface LipsyncV2RenderParams {\n /**\n * ID of the lipsync v2 task\n */\n id: string;\n }\n}\n\nexport namespace DYOA {\n /**\n * Age group options for DYOA\n */\n export type AgeGroup = 'young_adult' | 'adult' | 'middle_aged' | 'senior';\n\n /**\n * Gender options for DYOA\n */\n export type Gender = 'm' | 'f' | 'other';\n\n /**\n * Status options for DYOA\n */\n export type DyoaStatus =\n | 'initializing'\n | 'draft'\n | 'pending'\n | 'approved'\n | 'rejected'\n | 'done'\n | 'error';\n\n /**\n * Status options for DYOA review\n */\n export type DyoaReviewStatus = 'pending' | 'approved' | 'rejected';\n\n /**\n * Photo information for DYOA\n */\n export interface DyoaPhoto {\n /**\n * Unique identifier for the photo\n */\n id: string;\n\n /**\n * URL to the photo image\n */\n image: string;\n\n /**\n * Creation timestamp\n */\n created_at: string;\n }\n\n /**\n * Review information for DYOA\n */\n export interface DyoaReview {\n /**\n * Unique identifier for the review\n */\n id: string;\n\n /**\n * Status of the review\n */\n status: DyoaReviewStatus;\n\n /**\n * Comment from the reviewer (optional)\n */\n comment: string | null;\n\n /**\n * Photo being reviewed\n */\n photo: DyoaPhoto;\n\n /**\n * Avatar creator ID (only available after approval)\n */\n creator: string | null;\n\n /**\n * Social link for the avatar (optional)\n */\n social_link: string | null;\n }\n\n /**\n * Parameters for creating a DYOA\n */\n export interface DyoaParams {\n /**\n * Name for the avatar\n */\n name: string;\n\n /**\n * Age group of the avatar\n */\n age_group: AgeGroup;\n\n /**\n * Gender of the avatar\n */\n gender: Gender;\n\n /**\n * Detailed description of the avatar's appearance\n */\n more_details: string;\n\n /**\n * Description of the avatar's outfit\n */\n outfit_description: string;\n\n /**\n * Description of the avatar's background\n */\n background_description: string;\n }\n\n /**\n * Parameters for submitting a DYOA for review\n */\n export interface DyoaSubmitParams {\n /**\n * ID of the chosen photo to use for the avatar\n */\n chosen_photo_id: string;\n }\n\n /**\n * Response containing DYOA information\n */\n export interface DyoaResponse {\n /**\n * Unique identifier for the DYOA\n */\n id: string;\n\n /**\n * User ID of the creator\n */\n user: number;\n\n /**\n * Workspace ID\n */\n workspace: string;\n\n /**\n * Name of the avatar\n */\n name: string;\n\n /**\n * Age group of the avatar\n */\n age_group: AgeGroup;\n\n /**\n * Gender of the avatar\n */\n gender: Gender;\n\n /**\n * Detailed description of the avatar's appearance\n */\n more_details: string;\n\n /**\n * Description of the avatar's outfit\n */\n outfit_description: string;\n\n /**\n * Description of the avatar's background\n */\n background_description: string;\n\n /**\n * Array of generated photos\n */\n photos: DyoaPhoto[];\n\n /**\n * Array of reviews\n */\n reviews: DyoaReview[];\n\n /**\n * Status of the DYOA\n */\n status: DyoaStatus;\n\n /**\n * Creation timestamp\n */\n created_at: string;\n\n /**\n * Last update timestamp\n */\n updated_at: string;\n }\n}\n","import { CreatifyApiClient } from './client';\nimport { apiClientFactory } from './client-factory';\nimport {\n AvatarApi,\n UrlToVideoApi,\n TextToSpeechApi,\n AiEditingApi,\n CustomTemplatesApi,\n DyoaApi,\n AiShortsApi,\n AiScriptsApi,\n MusicsApi,\n WorkspaceApi,\n LipsyncV2Api,\n} from './api';\nimport * as Types from './types';\nimport * as utils from './utils';\n\n/**\n * Main Creatify API client with all API modules\n */\nexport class Creatify {\n /**\n * Client options\n */\n private options: Types.CreatifyApiOptions;\n\n /**\n * Avatar API module\n */\n public avat