export type GetApiImagesMediaInfoThemeNameArgs = {theme: string, name: string}; export type GetApiImagesMediaInfoThemeNameOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get media info image. * * GET /Images/MediaInfo/{theme}/{name} */ export const getApiImagesMediaInfoThemeName = async (args: GetApiImagesMediaInfoThemeNameArgs, options?: GetApiImagesMediaInfoThemeNameOptions) => { const {baseUrl = "http://localhost", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "image/*") const url = `${baseUrl.replace(/\/+$/, '')}/Images/MediaInfo/${encodeURIComponent(String(args.theme))}/${encodeURIComponent(String(args.name))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };