export type GetApiSignalbaseCompaniesArgs = {page?: number | undefined, limit?: number | undefined, search?: string | undefined, domain?: string | undefined, linkedin_url?: string | undefined, countries?: string | undefined, exclude_countries?: string | undefined, industry?: string | undefined, categories?: string | undefined, subcategories?: string | undefined, employee_count_min?: number | undefined, employee_count_max?: number | undefined, founded_year_min?: number | undefined, founded_year_max?: number | undefined, sort_by?: string | undefined, sort_order?: string | undefined, count?: boolean | undefined}; export type GetApiSignalbaseCompaniesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Browse and search companies with filtering by industry, size, location, and founding year. Pagination billing: call the first page normally and save billing.requestId from the Orthogonal /v1/run response. For later page, offset, or cursor calls on the same logical search, pass parentRequestId with unchanged non-pagination parameters. Valid continuation calls still get their own request IDs and quoted price, but are charged 0. Changing filters starts a new billable request. * * GET /signalbase/companies */ export const getApiSignalbaseCompanies = async (args: GetApiSignalbaseCompaniesArgs, options?: GetApiSignalbaseCompaniesOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.page != null) query.append("page", String(args.page)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.search != null) query.append("search", String(args.search)) if (args.domain != null) query.append("domain", String(args.domain)) if (args.linkedin_url != null) query.append("linkedin_url", String(args.linkedin_url)) if (args.countries != null) query.append("countries", String(args.countries)) if (args.exclude_countries != null) query.append("exclude_countries", String(args.exclude_countries)) if (args.industry != null) query.append("industry", String(args.industry)) if (args.categories != null) query.append("categories", String(args.categories)) if (args.subcategories != null) query.append("subcategories", String(args.subcategories)) if (args.employee_count_min != null) query.append("employee_count_min", String(args.employee_count_min)) if (args.employee_count_max != null) query.append("employee_count_max", String(args.employee_count_max)) if (args.founded_year_min != null) query.append("founded_year_min", String(args.founded_year_min)) if (args.founded_year_max != null) query.append("founded_year_max", String(args.founded_year_max)) if (args.sort_by != null) query.append("sort_by", String(args.sort_by)) if (args.sort_order != null) query.append("sort_order", String(args.sort_order)) if (args.count != null) query.append("count", String(args.count)) const url = `${baseUrl.replace(/\/+$/, '')}/signalbase/companies${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 };