export type CreateApiBytemineContactsEnrichArgs = {body: {email?: string | undefined, phone?: string | undefined, linkedin?: string | undefined, firstName?: string | undefined, lastName?: string | undefined, companyName?: string | undefined, companyDomain?: string | undefined, hasWorkEmail?: boolean | undefined, hasPhone?: boolean | undefined, hasDirectDial?: boolean | undefined}}; export type CreateApiBytemineContactsEnrichOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enrich a single contact by email, phone, LinkedIn, Facebook, or name+company. Returns full profile with work email, phone, job title, company info. 1 credit per match. * * POST /bytemine/contacts/enrich */ export const createApiBytemineContactsEnrich = async (args: CreateApiBytemineContactsEnrichArgs, options?: CreateApiBytemineContactsEnrichOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/bytemine/contacts/enrich${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 };