UNPKG

@tsavo/creatify-api-ts

Version:

TypeScript client for the Creatify AI API

113 lines (109 loc) 3.58 kB
import { AxiosRequestConfig } from 'axios'; import { I as ICreatifyApiClient, C as CreatifyApiOptions } from './client-factory-BpS2ubWp.mjs'; export { b as CreatifyApiClientFactory, i as Types, a as apiClientFactory } from './client-factory-BpS2ubWp.mjs'; import { AvatarApi, UrlToVideoApi, TextToSpeechApi, AiEditingApi, CustomTemplatesApi, DyoaApi, AiShortsApi, AiScriptsApi, MusicsApi, WorkspaceApi, LipsyncV2Api } from './api/index.mjs'; export { i as utils } from './index-Cj2gN03s.mjs'; /** * Base API client for Creatify API */ declare class CreatifyApiClient implements ICreatifyApiClient { private client; private apiId; private apiKey; /** * Create a new Creatify API client * @param options Configuration options for the API client */ constructor(options: CreatifyApiOptions); /** * Make a GET request to the API * @param endpoint API endpoint to call * @param params Query parameters * @param config Additional axios config * @returns Promise resolving to the response data */ get<T = unknown>(endpoint: string, params?: Record<string, unknown>, config?: AxiosRequestConfig): Promise<T>; /** * Make a POST request to the API * @param endpoint API endpoint to call * @param data Request body data * @param config Additional axios config * @returns Promise resolving to the response data */ post<T = unknown, D = unknown>(endpoint: string, data?: D, config?: AxiosRequestConfig): Promise<T>; /** * Make a PUT request to the API * @param endpoint API endpoint to call * @param data Request body data * @param config Additional axios config * @returns Promise resolving to the response data */ put<T = unknown, D = unknown>(endpoint: string, data?: D, config?: AxiosRequestConfig): Promise<T>; /** * Make a DELETE request to the API * @param endpoint API endpoint to call * @param params Query parameters * @param config Additional axios config * @returns Promise resolving to the response data */ delete<T = unknown>(endpoint: string, params?: Record<string, unknown>, config?: AxiosRequestConfig): Promise<T>; } /** * Main Creatify API client with all API modules */ declare class Creatify { /** * Client options */ private options; /** * Avatar API module */ avatar: AvatarApi; /** * URL-to-Video API module */ urlToVideo: UrlToVideoApi; /** * Text-to-Speech API module */ textToSpeech: TextToSpeechApi; /** * AI Editing API module */ aiEditing: AiEditingApi; /** * Custom Templates API module */ customTemplates: CustomTemplatesApi; /** * DYOA (Design Your Own Avatar) API module */ dyoa: DyoaApi; /** * AI Shorts API module */ aiShorts: AiShortsApi; /** * AI Scripts API module */ aiScripts: AiScriptsApi; /** * Musics API module */ musics: MusicsApi; /** * Workspace API module */ workspace: WorkspaceApi; /** * Lipsync v2 API module */ lipsyncV2: LipsyncV2Api; /** * Create a new Creatify API client with all available API modules * @param options Configuration options for the API client */ constructor(options: CreatifyApiOptions); } export { AiEditingApi, AiScriptsApi, AiShortsApi, AvatarApi, Creatify, CreatifyApiClient, CustomTemplatesApi, DyoaApi, LipsyncV2Api, MusicsApi, TextToSpeechApi, UrlToVideoApi, WorkspaceApi };