export type CreateApiIcypeasApiUrlSearchProfileArgs = {body: {firstname: string, lastname: string, companyOrDomain?: string | undefined, jobTitle?: string | undefined}}; export type CreateApiIcypeasApiUrlSearchProfileOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Find a person's LinkedIn profile URL by name and optionally company/domain and job title. Synchronous response with status FOUND or NOT_FOUND. * * POST /icypeas/api/url-search/profile */ export const createApiIcypeasApiUrlSearchProfile = async (args: CreateApiIcypeasApiUrlSearchProfileArgs, options?: CreateApiIcypeasApiUrlSearchProfileOptions) => { 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(/\/+$/, '')}/icypeas/api/url-search/profile${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 };