export type GetApiCompanyEnrichCompaniesWorkforceArgs = {id?: string | undefined, domain?: string | undefined}; export type GetApiCompanyEnrichCompaniesWorkforceOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get workforce insights for a company. Returns observed employee count, employee range bucket, and headcounts broken down by department. * * GET /company-enrich/companies/workforce */ export const getApiCompanyEnrichCompaniesWorkforce = async (args: GetApiCompanyEnrichCompaniesWorkforceArgs, options?: GetApiCompanyEnrichCompaniesWorkforceOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) if (args.domain != null) query.append("domain", String(args.domain)) const url = `${baseUrl.replace(/\/+$/, '')}/company-enrich/companies/workforce${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 };