export type CreateApiFiberV1CompanyCountArgs = {body: {searchParams: Record, companyExclusionListIDs?: Array | undefined}}; export type CreateApiFiberV1CompanyCountOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get count of companies matching search filters. Use to estimate result sizes before running a full search. * * POST /fiber/v1/company-count */ export const createApiFiberV1CompanyCount = async (args: CreateApiFiberV1CompanyCountArgs, options?: CreateApiFiberV1CompanyCountOptions) => { 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(/\/+$/, '')}/fiber/v1/company-count${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 };