export type GetApiExtructAiV1CompaniesSearchArgs = {q: string, filters?: string | undefined, offset?: number | undefined, limit?: number | undefined}; export type GetApiExtructAiV1CompaniesSearchOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * [Deprecated] Search for companies using natural language queries with Extruct AI. Use filters (JSON string) to narrow results by size, country, city, and founded year range. Prefer POST variant. * * GET /extruct-ai/v1/companies/search */ export const getApiExtructAiV1CompaniesSearch = async (args: GetApiExtructAiV1CompaniesSearchArgs, options?: GetApiExtructAiV1CompaniesSearchOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.q != null) query.append("q", String(args.q)) if (args.filters != null) query.append("filters", String(args.filters)) if (args.offset != null) query.append("offset", String(args.offset)) if (args.limit != null) query.append("limit", String(args.limit)) const url = `${baseUrl.replace(/\/+$/, '')}/extruct-ai/v1/companies/search${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 };