export type GetApiVendorAdditionalevidenceArgs = {evidence_ids?: Array | undefined, zip?: boolean | undefined}; export type GetApiVendorAdditionalevidenceOptions = {baseUrl?: string | undefined, APIKeyInHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve (one or more) vendor additional evidence documents by id * * GET /vendor/additionalevidence */ export const getApiVendorAdditionalevidence = async (args: GetApiVendorAdditionalevidenceArgs, options?: GetApiVendorAdditionalevidenceOptions) => { const {baseUrl = "https://cyber-risk.upguard.com/api/public", fetch: fetchFn = fetch, APIKeyInHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "image/jpeg") for (const item of args.evidence_ids ?? []) query.append("evidence_ids", String(item)) if (args.zip != null) query.append("zip", String(args.zip)) if (APIKeyInHeader !== undefined) headers.set("Authorization", APIKeyInHeader) const url = `${baseUrl.replace(/\/+$/, '')}/vendor/additionalevidence${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() };