export type GetApiContactoutV1LinkedinEnrichArgs = {profile: string, profile_only?: boolean | undefined}; export type GetApiContactoutV1LinkedinEnrichOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get full profile details (email, phone, work history, education, skills) from a LinkedIn profile URL. * * GET /contactout/v1/linkedin/enrich */ export const getApiContactoutV1LinkedinEnrich = async (args: GetApiContactoutV1LinkedinEnrichArgs, options?: GetApiContactoutV1LinkedinEnrichOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.profile != null) query.append("profile", String(args.profile)) if (args.profile_only != null) query.append("profile_only", String(args.profile_only)) const url = `${baseUrl.replace(/\/+$/, '')}/contactout/v1/linkedin/enrich${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 undefined };