export type GetApiAktaProV1CompanySearchArgs = {query: string}; export type GetApiAktaProV1CompanySearchOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Free endpoint to find and resolve a company by name, website/domain or akta UUID before calling other company endpoints. The input type is detected automatically and results include candidate uuid, name, website, product_category and company_status, making this useful for entity resolution, disambiguation and name-collision handling. If several candidates match, prefer the result whose website corresponds to the intended company. Optimized for AI agents with compact, structured output for reliable routing. * * GET /akta-pro/v1/company/search */ export const getApiAktaProV1CompanySearch = async (args: GetApiAktaProV1CompanySearchArgs, options?: GetApiAktaProV1CompanySearchOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.query != null) query.append("query", String(args.query)) const url = `${baseUrl.replace(/\/+$/, '')}/akta-pro/v1/company/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 };