export type GetApiExportThermalPrintBelegeBelegUuidArgs = {belegUuid: string, qr?: boolean | undefined, width?: number | undefined, dialect?: ('escpos' | 'escposlite' | 'star' | 'text') | undefined, encoding?: ('raw' | 'base64') | undefined}; export type GetApiExportThermalPrintBelegeBelegUuidOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /export/thermal-print/belege/{belegUuid} */ export const getApiExportThermalPrintBelegeBelegUuid = async (args: GetApiExportThermalPrintBelegeBelegUuidArgs, options: GetApiExportThermalPrintBelegeBelegUuidOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.qr != null) query.append("qr", String(args.qr)) if (args.width != null) query.append("width", String(args.width)) if (args.dialect != null) query.append("dialect", String(args.dialect)) if (args.encoding != null) query.append("encoding", String(args.encoding)) const url = `${baseUrl.replace(/\/+$/, '')}/export/thermal-print/belege/${encodeURIComponent(String(args.belegUuid))}${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 undefined };