export type CreateApiPeopledatalabsV5CompanySearchArgs = {pretty?: boolean | undefined, body: {query?: Record | undefined, sql?: string | undefined, size: number, from?: number | undefined, scroll_token?: string | undefined, titlecase?: boolean | undefined}}; export type CreateApiPeopledatalabsV5CompanySearchOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Search and filter companies using Elasticsearch or SQL queries. Find companies by industry, size, location, funding, and more. * * POST /peopledatalabs/v5/company/search */ export const createApiPeopledatalabsV5CompanySearch = async (args: CreateApiPeopledatalabsV5CompanySearchArgs, options?: CreateApiPeopledatalabsV5CompanySearchOptions) => { 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") if (args.pretty != null) query.append("pretty", String(args.pretty)) const url = `${baseUrl.replace(/\/+$/, '')}/peopledatalabs/v5/company/search${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 };