export type GetApiContactsContactIdArgs = {contact_id: number}; export type GetApiContactsContactIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get contact details * * GET /contacts/{contact_id} */ export const getApiContactsContactId = async (args: GetApiContactsContactIdArgs, options?: GetApiContactsContactIdOptions) => { const {baseUrl = "https://api.salesflare.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/contacts/${encodeURIComponent(String(args.contact_id))}${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() };