export type GetApiGetfullnamematchscoreArgs = {fullname1: string, fullname2: string}; export type GetApiGetfullnamematchscoreOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Person name match score: compares two individual names and returns a 0-100 similarity score, handling name order, nicknames, initials, and abbreviations (for example 'Robert Smith' vs 'Bob Smith Jr.'). Use it to confirm contact matches and resolve customer identities. * * GET /getfullnamematchscore */ export const getApiGetfullnamematchscore = async (args: GetApiGetfullnamematchscoreArgs, options?: GetApiGetfullnamematchscoreOptions) => { 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.fullname1 != null) query.append("fullname1", String(args.fullname1)) if (args.fullname2 != null) query.append("fullname2", String(args.fullname2)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/getfullnamematchscore${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 };