export type PBFileProcessorConfig = {fileUrl?: string | undefined, removeAds?: boolean | undefined, removeBackgroundMusic?: boolean | undefined, removeSilence?: boolean | undefined, normalizeAudioLevels?: boolean | undefined, aiAutoEnhance?: boolean | undefined, removeFillerWords?: boolean | undefined}; export type CreateApiPodcastBotWorkflowsProcessFileArgs = {body: PBFileProcessorConfig}; export type CreateApiPodcastBotWorkflowsProcessFileOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Process file * * POST /podcast-bot/workflows/process-file */ export const createApiPodcastBotWorkflowsProcessFile = async (args: CreateApiPodcastBotWorkflowsProcessFileArgs, options?: CreateApiPodcastBotWorkflowsProcessFileOptions) => { const {baseUrl = "https://api.zeno.fm", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/podcast-bot/workflows/process-file${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 res.blob() };