export type CreateApiRegisteredUrlForConsentFormArgs = {body: {event: 'mcert.created' | 'mcert.updated', event_time: number, timestamp: number, client_id: string, business_id: string, data: {docid: string, id: string, owner: string, patientid: string, sendurlpdf: string, url: string, type: string}}}; export type CreateApiRegisteredUrlForConsentFormOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Consent Form Events * * POST /registered_url_for_consent_form */ export const createApiRegisteredUrlForConsentForm = async (args: CreateApiRegisteredUrlForConsentFormArgs, options?: CreateApiRegisteredUrlForConsentFormOptions) => { const {baseUrl = "https://api.eka.care", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/registered_url_for_consent_form${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };