export type GetApiTimeClockBreadcrumbsV1ReportFileIdDownloadArgs = {fileId: string}; export type GetApiTimeClockBreadcrumbsV1ReportFileIdDownloadOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download breadcrumbs report * * GET /time-clock/breadcrumbs/v1/report/{fileId}/download * * Also accepts auth: OAuth2 */ export const getApiTimeClockBreadcrumbsV1ReportFileIdDownload = async (args: GetApiTimeClockBreadcrumbsV1ReportFileIdDownloadArgs, options?: GetApiTimeClockBreadcrumbsV1ReportFileIdDownloadOptions) => { const {baseUrl = "https://api.connecteam.com", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKeyHeader !== undefined) headers.set("X-API-KEY", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/time-clock/breadcrumbs/v1/report/${encodeURIComponent(String(args.fileId))}/download${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 };