Skip to content

Commit

Permalink
v1.2.4 - Algorithm values
Browse files Browse the repository at this point in the history
- Set AddressMatch default algorithm to `ai-medium-narrow`.
- Set CompanyMatch default algorithm to `ai-medium`
- Add `algorithm` to `DelimitedFileMatchKeyReportRequest`
  • Loading branch information
dvause committed Aug 14, 2024
1 parent a1956b7 commit 6438308
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@interzoid/data-matching",
"version": "1.2.2",
"version": "1.2.4",
"author": "Interzoid, Inc. <[email protected]> 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": [
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/api/AddressMatchKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
1 change: 1 addition & 0 deletions src/api/CloudDatabaseMatchKeyReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/api/CompanyNameMatchKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/api/DelimitedFileMatchKeyReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/api/InterzoidApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion src/interfaces/AddressMatchKeyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
3 changes: 3 additions & 0 deletions src/interfaces/CloudWorkloadRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ 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;
source: Source;
connection: string;
table: string;
column: string;
algorithm?: string;
reference?: string;
newTable?: string; //required if process is CREATE_TABLE
json?: boolean;
Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/CompanyNameMatchKeyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
1 change: 1 addition & 0 deletions src/interfaces/DelimitedFileMatchKeyReportRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface DelimitedFileMatchKeyReportRequest extends InterzoidRequest {
category: Category;
csvUrl: string;
matchColumn: number;
algorithm?: string;
referenceColumn?: number;
responseFormat?: 'json' | 'html' | 'text';
}
3 changes: 2 additions & 1 deletion tests/api/DelimitedFileMatchKeyReport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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'.`,
);
});

Expand Down

0 comments on commit 6438308

Please sign in to comment.