export type GetApiApiV1AdminAgreementRecordsIdBundleArgs = {id: string}; export type GetApiApiV1AdminAgreementRecordsIdBundleOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download a markdown forensic bundle for an AgreementRecord — the legal acceptance plus the linked evidence detail. * * GET /api/v1/admin/agreement-records/{id}/bundle */ export const getApiApiV1AdminAgreementRecordsIdBundle = async (args: GetApiApiV1AdminAgreementRecordsIdBundleArgs, options?: GetApiApiV1AdminAgreementRecordsIdBundleOptions) => { const {baseUrl = "https://core.quidkey.com", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/admin/agreement-records/${encodeURIComponent(String(args.id))}/bundle${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 };