export type GetApiPublicApiSubscriptionsExportXlsxOptions = {baseUrl?: string | undefined, OAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Exporta a lista de assinaturas no formato XLSX. * * GET /public_api/subscriptions/export/xlsx/ */ export const getApiPublicApiSubscriptionsExportXlsx = async (options?: GetApiPublicApiSubscriptionsExportXlsxOptions) => { const {baseUrl = "https://api.cakto.com.br", fetch: fetchFn = fetch, OAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") if (OAuthToken !== undefined) headers.set('authorization', `Bearer ${OAuthToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/public_api/subscriptions/export/xlsx/${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() };