export type CreateApiV1LabsTaskSubtitleTaskIdArgs = {task_id: string, body: {max_characters_per_line?: number | undefined, max_lines_per_cue?: number | undefined, max_seconds_per_cue?: number | undefined}}; export type CreateApiV1LabsTaskSubtitleTaskIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Export Subtitle * * POST /v1/labs/task/subtitle/{task_id} */ export const createApiV1LabsTaskSubtitleTaskId = async (args: CreateApiV1LabsTaskSubtitleTaskIdArgs, options?: CreateApiV1LabsTaskSubtitleTaskIdOptions) => { const {baseUrl = "https://genaipro.io/api", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/labs/task/subtitle/${encodeURIComponent(String(args.task_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };