export type GenericReportSchema = {date_range?: string | undefined, date_key?: string | undefined, start_date?: string | undefined, end_date?: string | undefined, report_keys?: Array | undefined}; export type CreateApiApiV1ReportsTaxSummaryReportArgs = {'X-Requested-With': string, body: GenericReportSchema}; export type CreateApiApiV1ReportsTaxSummaryReportOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Tax summary report * * POST /api/v1/reports/tax_summary_report */ export const createApiApiV1ReportsTaxSummaryReport = async (args: CreateApiApiV1ReportsTaxSummaryReportArgs, options?: CreateApiApiV1ReportsTaxSummaryReportOptions) => { const {baseUrl = "https://demo.invoiceninja.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-Requested-With'] != null) headers.set("X-Requested-With", String(args['X-Requested-With'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/reports/tax_summary_report${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };