export type PBPodcast = {key?: string | undefined, title: string, coverArtUrl?: string | undefined, summary?: string | undefined, description: string, author?: string | undefined, ownerName: string, ownerEmail: string, categories: Array, language: string, link?: string | undefined, explicit?: boolean | undefined, rssFeed?: string | undefined, interviewPodcastKey?: string | undefined}; export type UpdateApiPodcastBotPodcastsPodcastKeyArgs = {podcastKey: string, body: PBPodcast}; export type UpdateApiPodcastBotPodcastsPodcastKeyOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update podcast info * * PUT /podcast-bot/podcasts/{podcastKey} */ export const updateApiPodcastBotPodcastsPodcastKey = async (args: UpdateApiPodcastBotPodcastsPodcastKeyArgs, options?: UpdateApiPodcastBotPodcastsPodcastKeyOptions) => { 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/podcasts/${encodeURIComponent(String(args.podcastKey))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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() };