export type GetApiGetaddressmatchadvancedArgs = {address: string, zip?: string | undefined}; export type GetApiGetaddressmatchadvancedOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * US street address matching and deduplication: generates an AI-powered similarity key for a street address, so variations in abbreviations, unit numbers, and directionals ('201 Spear St Ste 1100' vs '201 Spear Street, Suite 1100') produce the same key. Group on the key to find duplicate addresses, households, and locations. An optional ZIP code improves precision. * * GET /getaddressmatchadvanced */ export const getApiGetaddressmatchadvanced = async (args: GetApiGetaddressmatchadvancedArgs, options?: GetApiGetaddressmatchadvancedOptions) => { 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.address != null) query.append("address", String(args.address)) if (args.zip != null) query.append("zip", String(args.zip)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/getaddressmatchadvanced${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 };