export type GetApiCompaniesCompanyIdReportsCategorizedBankStatementReportIdExcelOptions = {baseUrl?: string | undefined, authHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download categorized bank statement Excel * * GET /companies/{companyId}/reports/categorizedBankStatement/{reportId}/excel */ export const getApiCompaniesCompanyIdReportsCategorizedBankStatementReportIdExcel = async (options?: GetApiCompaniesCompanyIdReportsCategorizedBankStatementReportIdExcelOptions) => { const {baseUrl = "https://api.codat.io", fetch: fetchFn = fetch, authHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (authHeader !== undefined) headers.set("Authorization", authHeader) const url = `${baseUrl.replace(/\/+$/, '')}/companies/${encodeURIComponent(String(args.companyId))}/reports/categorizedBankStatement/${encodeURIComponent(String(args.reportId))}/excel${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() };