export type GetApiPublicV1SitesUpsertDryRunDryRunIdArgs = {dryRunId: string}; export type GetApiPublicV1SitesUpsertDryRunDryRunIdOptions = {baseUrl?: string | undefined, TokenAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download the dry-run results report. * * GET /public/v1/sites-upsert/dry-run/{dryRunId} */ export const getApiPublicV1SitesUpsertDryRunDryRunId = async (args: GetApiPublicV1SitesUpsertDryRunDryRunIdArgs, options?: GetApiPublicV1SitesUpsertDryRunDryRunIdOptions) => { const {baseUrl = "https://api.prewave.com", fetch: fetchFn = fetch, TokenAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") if (TokenAuthentication !== undefined) headers.set("X-Auth-Token", TokenAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/sites-upsert/dry-run/${encodeURIComponent(String(args.dryRunId))}${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() };