export type GetApiMfV1ReportReportDownloadReportIdArgs = {reportId: number}; export type GetApiMfV1ReportReportDownloadReportIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download report by report id * * GET /mf/v1/report/reportDownload/{reportId} */ export const getApiMfV1ReportReportDownloadReportId = async (args: GetApiMfV1ReportReportDownloadReportIdArgs, options?: GetApiMfV1ReportReportDownloadReportIdOptions) => { const {baseUrl = "http://gateway.mlss.mf", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") const url = `${baseUrl.replace(/\/+$/, '')}/mf/v1/report/reportDownload/${encodeURIComponent(String(args.reportId))}${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() };