export type GetApiGetproductmatchArgs = {product: string}; export type GetApiGetproductmatchOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Product name matching: generates an AI-powered similarity key for a product name or description, so variations in naming, model numbers, and wording produce the same key. Use it to match the same product across catalogs, marketplaces, and supplier feeds, deduplicate SKUs, and compare prices. * * GET /getproductmatch */ export const getApiGetproductmatch = async (args: GetApiGetproductmatchArgs, options?: GetApiGetproductmatchOptions) => { 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.product != null) query.append("product", String(args.product)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/getproductmatch${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 };