diff --git a/README.md b/README.md index 34fcc0e..37ada7f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Interzoid Data Matching Node.js SDK -**Version: 1.1.1** +**Version: 1.2.4** This is a Node.js SDK for Interzoid's Generative-AI powered data matching, data quality, data cleansing, and data normalization for organization and individual name data. Functions include the generation of similarity keys (also called match keys) for identifying and matching inconsistent name data, as well as comparing and scoring data for matching purposes. diff --git a/package.json b/package.json index 95225ed..4049e53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@interzoid/data-matching", - "version": "1.2.2", + "version": "1.2.4", "author": "Interzoid, Inc. https://interzoid.com", "description": "Interzoid SDK for Typescript, Generative-AI powered data matching, data quality, and data normalization for organization and individual name data", "keywords": [ @@ -12,7 +12,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/interzoid/sdk-nodejs" + "url": "https://github.com/interzoid/sdk-nodejs.git" }, "homepage": "https://github.com/interzoid/sdk-nodejs#readme", "license": "MIT", diff --git a/src/api/AddressMatchKey.ts b/src/api/AddressMatchKey.ts index 3a5ce8a..f0069cb 100644 --- a/src/api/AddressMatchKey.ts +++ b/src/api/AddressMatchKey.ts @@ -20,7 +20,7 @@ export async function getAddressMatchKey( throw new Error('Invalid request. "apiKey" and "address" are required.'); } - const algorithm = request.algorithm || 'narrow'; + const algorithm = request.algorithm || 'ai-medium-narrow'; const resource = 'getaddressmatchadvanced'; const resp = await InterzoidApi.doApiGetRequest(resource, request.apiKey, { diff --git a/src/api/CloudDatabaseMatchKeyReport.ts b/src/api/CloudDatabaseMatchKeyReport.ts index dec4b2c..aa6d763 100644 --- a/src/api/CloudDatabaseMatchKeyReport.ts +++ b/src/api/CloudDatabaseMatchKeyReport.ts @@ -26,6 +26,7 @@ export async function getCloudDatabaseMatchKeyReport( source: request.source, connection: request.connection, category: request.category, + algorithm: request.algorithm, column: request.column, reference: request.reference, json: request.json, diff --git a/src/api/CompanyNameMatchKey.ts b/src/api/CompanyNameMatchKey.ts index a84ec04..ea3fdeb 100644 --- a/src/api/CompanyNameMatchKey.ts +++ b/src/api/CompanyNameMatchKey.ts @@ -22,7 +22,7 @@ export async function getCompanyNameMatchKey( } const resource = 'getcompanymatchadvanced'; - const algorithm = request.algorithm || 'wide'; + const algorithm = request.algorithm || 'ai-medium'; const resp = await InterzoidApi.doApiGetRequest(resource, request.apiKey, { company: request.company, diff --git a/src/api/DelimitedFileMatchKeyReport.ts b/src/api/DelimitedFileMatchKeyReport.ts index d25165b..412e741 100644 --- a/src/api/DelimitedFileMatchKeyReport.ts +++ b/src/api/DelimitedFileMatchKeyReport.ts @@ -26,6 +26,7 @@ export async function getDelimitedFileMatchKeyReport( connection: request.csvUrl, category: request.category, column: request.matchColumn, + algorithm: request.algorithm, reference: request.referenceColumn, json: request.responseFormat === 'json', html: request.responseFormat === 'html', diff --git a/src/api/InterzoidApi.ts b/src/api/InterzoidApi.ts index a6015be..1f854b3 100644 --- a/src/api/InterzoidApi.ts +++ b/src/api/InterzoidApi.ts @@ -35,7 +35,7 @@ export class InterzoidApi { const config: AxiosRequestConfig = { params: params, headers: { - 'x-client': 'axios/data-matching-npm/1.0.0', + 'x-client': 'axios/data-matching-npm/1.2.4', }, paramsSerializer: (params: object) => { return qs.stringify(params); diff --git a/src/interfaces/AddressMatchKeyRequest.ts b/src/interfaces/AddressMatchKeyRequest.ts index 15a5177..18b6d70 100644 --- a/src/interfaces/AddressMatchKeyRequest.ts +++ b/src/interfaces/AddressMatchKeyRequest.ts @@ -9,5 +9,11 @@ import { InterzoidRequest } from './InterzoidRequest'; */ export interface AddressMatchKeyRequest extends InterzoidRequest { address: string; - algorithm?: 'wide' | 'narrow'; + algorithm?: + | 'narrow' + | 'wide' + | 'ai-plus-narrow' + | 'ai-plus-wide' + | 'ai-medium-narrow' + | 'ai-medium-wide'; } diff --git a/src/interfaces/CloudWorkloadRequest.ts b/src/interfaces/CloudWorkloadRequest.ts index 4622b95..ebc389f 100644 --- a/src/interfaces/CloudWorkloadRequest.ts +++ b/src/interfaces/CloudWorkloadRequest.ts @@ -13,11 +13,13 @@ import { Category } from './Category'; * @property {string} connection - Connection string to access database, or in the case of a CSV or TSV file, use the full URL of the location of the file. * @property {string} table - Table name to access the source data. Use "CSV" or "TSV" for delimited text files. * @property {string} column - Column name within the table to access the source data. This is a number for CSV or TSV files, starting with number 1 from the left side of the file. + * @property {string} algorithm - The matching algorithm to use. Valid values are specific to the request. * @property {string} [reference] - An additional column from the source table to display in the output results, such as a primary key. * @property {string} [newTable] - The name of the new table if the output results are written to a new table. Required if process is CREATE_TABLE. * @property {boolean} [json] - If true, the output will be in JSON format. * @property {boolean} [html] - Set to 'true' to pad line breaks into the output results for better readability ina browser when run from the address bar. */ + export interface CloudWorkloadRequest extends InterzoidRequest { process: Process; category: Category; @@ -25,6 +27,7 @@ export interface CloudWorkloadRequest extends InterzoidRequest { connection: string; table: string; column: string; + algorithm?: string; reference?: string; newTable?: string; //required if process is CREATE_TABLE json?: boolean; diff --git a/src/interfaces/CompanyNameMatchKeyRequest.ts b/src/interfaces/CompanyNameMatchKeyRequest.ts index 32a1053..6a7255d 100644 --- a/src/interfaces/CompanyNameMatchKeyRequest.ts +++ b/src/interfaces/CompanyNameMatchKeyRequest.ts @@ -7,7 +7,8 @@ import { InterzoidRequest } from './InterzoidRequest'; * @property {string} company - Company name to match * @property {string} [algorithm] - Algorithm to use for matching */ + export interface CompanyNameMatchKeyRequest extends InterzoidRequest { company: string; - algorithm?: 'wide' | 'medium' | 'narrow'; + algorithm?: 'ai-plus' | 'ai-medium' | 'wide' | 'medium' | 'narrow'; } diff --git a/src/interfaces/DelimitedFileMatchKeyReportRequest.ts b/src/interfaces/DelimitedFileMatchKeyReportRequest.ts index 0ccc622..7ced9a3 100644 --- a/src/interfaces/DelimitedFileMatchKeyReportRequest.ts +++ b/src/interfaces/DelimitedFileMatchKeyReportRequest.ts @@ -19,6 +19,7 @@ export interface DelimitedFileMatchKeyReportRequest extends InterzoidRequest { category: Category; csvUrl: string; matchColumn: number; + algorithm?: string; referenceColumn?: number; responseFormat?: 'json' | 'html' | 'text'; } diff --git a/tests/api/DelimitedFileMatchKeyReport.test.ts b/tests/api/DelimitedFileMatchKeyReport.test.ts index 32cdaa6..e51f5af 100644 --- a/tests/api/DelimitedFileMatchKeyReport.test.ts +++ b/tests/api/DelimitedFileMatchKeyReport.test.ts @@ -18,6 +18,7 @@ describe('getCsvMatchKeyReport', () => { category: Category.COMPANY, source: Source.CSV, process: Process.MATCH_REPORT, + algorithm: 'ai-medium', csvUrl: 'https://dl.interzoid.com/csv/companies.csv', matchColumn: 1, apiKey: 'test-api-key', @@ -73,7 +74,7 @@ describe('getCsvMatchKeyReport', () => { responseFormat: 'json', }; await expect(getDelimitedFileMatchKeyReport(request)).rejects.toThrow( - `Invalid 'source'. It must be either 'CSV' or 'TSV'.`, + `Invalid 'source'. It must be 'CSV', 'TSV', 'Excel, or 'Parquet'.`, ); });