export type GetApiGetorgmatchscoreArgs = {org1: string, org2: string}; export type GetApiGetorgmatchscoreOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Company name match score: compares two organization or company names and returns a 0-100 similarity score showing how likely they are to be the same entity, for example 'General Electric' vs 'GE Corp'. Use it to verify record matches, resolve entities, and review fuzzy matching results. * * GET /getorgmatchscore */ export const getApiGetorgmatchscore = async (args: GetApiGetorgmatchscoreArgs, options?: GetApiGetorgmatchscoreOptions) => { const {baseUrl = "https://api.interzoid.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.org1 != null) query.append("org1", String(args.org1)) if (args.org2 != null) query.append("org2", String(args.org2)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/getorgmatchscore${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 (await res.json()) as unknown };