export type Colors = {accent?: string | undefined, background?: string | undefined, text?: string | undefined, barGradientFrom?: string | undefined, barGradientTo?: string | undefined}; export type Text = {episodeLabel?: string | undefined, title?: string | undefined, subtitle?: string | undefined, caption?: string | undefined}; export type Assets = {primaryLogo?: string | undefined, secondaryLogo?: string | undefined, hostPhoto?: string | undefined}; export type Captions = {show?: boolean | undefined, synced?: boolean | undefined, embedded_srt_file?: boolean | undefined}; export type PBVideoConfig = {style?: ('waveformBars' | 'equalizer' | 'radialPulse' | 'hostSplit' | 'hostCentered' | 'podcastCardDotted') | undefined, font?: ('inter' | 'oswald' | 'bebasNeue' | 'montserrat' | 'anton' | 'poppins') | undefined, showEqualizer?: boolean | undefined, fps?: number | undefined, colors?: Colors | undefined, text?: Text | undefined, assets?: Assets | undefined, captions?: Captions | undefined, aspect_ratios?: (Array<'16:9' | '9:16' | '1:1' | '4:5'>) | undefined}; export type CreateApiPodcastBotPodcastsPodcastKeyEpisodesEpisodeKeyCreateVideoArgs = {podcastKey: string, episodeKey: string, body: PBVideoConfig}; export type CreateApiPodcastBotPodcastsPodcastKeyEpisodesEpisodeKeyCreateVideoOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create a video (CREATE_VIDEO job) for an episode. Uses the given video config, or the stored one if the body is omitted. * * POST /podcast-bot/podcasts/{podcastKey}/episodes/{episodeKey}/createVideo */ export const createApiPodcastBotPodcastsPodcastKeyEpisodesEpisodeKeyCreateVideo = async (args: CreateApiPodcastBotPodcastsPodcastKeyEpisodesEpisodeKeyCreateVideoArgs, options?: CreateApiPodcastBotPodcastsPodcastKeyEpisodesEpisodeKeyCreateVideoOptions) => { 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))}/episodes/${encodeURIComponent(String(args.episodeKey))}/createVideo${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() };