export type GetApiAttachmentsAttachmentIdImageUpscaleArgs = {attachmentId: number}; export type GetApiAttachmentsAttachmentIdImageUpscaleOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Get the upscaled Image * * GET /attachments/{attachmentId}/image-upscale */ export const getApiAttachmentsAttachmentIdImageUpscale = async (args: GetApiAttachmentsAttachmentIdImageUpscaleArgs, options: GetApiAttachmentsAttachmentIdImageUpscaleOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "image/*") const url = `${baseUrl.replace(/\/+$/, '')}/attachments/${encodeURIComponent(String(args.attachmentId))}/image-upscale${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() };