export type CreateApiRegisteredUrlForPrescriptionEventsArgs = {body: {event: 'prescription.created' | 'prescription.updated', event_time: number, timestamp: number, client_id: string, business_id: string, data: {prescription_id: string, doctor_id: string, partner_doctor_id?: string | undefined, patient_id: string, current_version?: string | undefined, previous_version?: string | undefined, prescription_url?: string | undefined, prescription_url_print?: string | undefined, partner_patient_id?: string | undefined, clinic_id: string, partner_clinic_id?: string | undefined, partner_appointment_id?: string | undefined, action: 'created' | 'updated', created_at: number, modified_at: number, partner_meta?: ({key1?: string | undefined}) | undefined}}}; export type CreateApiRegisteredUrlForPrescriptionEventsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Prescription Created Event * * POST /registered_url_for_prescription_events */ export const createApiRegisteredUrlForPrescriptionEvents = async (args: CreateApiRegisteredUrlForPrescriptionEventsArgs, options?: CreateApiRegisteredUrlForPrescriptionEventsOptions) => { 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_prescription_events${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 };