export type GetApiCompanyEnrichmentV2Args = {domain: string}; export type GetApiCompanyEnrichmentV2Options = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get detailed company information from a domain including name, logo, headcount, location, industry, and more. * * GET /company-enrichment/v2 */ export const getApiCompanyEnrichmentV2 = async (args: GetApiCompanyEnrichmentV2Args, options?: GetApiCompanyEnrichmentV2Options) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.domain != null) query.append("domain", String(args.domain)) const url = `${baseUrl.replace(/\/+$/, '')}/company-enrichment/v2${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 };