export type GetApiApiV1RelationshipsIdArtifactsArgs = {id: number}; export type GetApiApiV1RelationshipsIdArtifactsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download active artifacts for a relationship as a zip * * GET /api/v1/relationships/{id}/artifacts */ export const getApiApiV1RelationshipsIdArtifacts = async (args: GetApiApiV1RelationshipsIdArtifactsArgs, options?: GetApiApiV1RelationshipsIdArtifactsOptions) => { const {baseUrl = "https://app.visotrust.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/zip") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/relationships/${encodeURIComponent(String(args.id))}/artifacts${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() };