dow-sdk
A module to interface with the Dow Jones Screening and Monitoring API in a type-safe way
Quick example
import {DowJonesSDK} from '@eckidevs/dow-sdk';
const {id_token} = await DowJonesSDK.getAuthNToken({
client_id: 'your-client-id',
username: 'your-username',
password: 'your-password',
device: 'your-device-id',
});
const {access_token} = await DowJonesSDK.getAuthZToken({
client_id: 'your-client-id',
id_token,
});
const sdk = new DowJonesSDK({accessToken: access_token});
const cases = await sdk.listCases();
const associations = await sdk.listAssociations();
const newCase = await sdk.addCase({
data: {
type: 'risk-entity-screening-cases',
attributes: {
case_name: 'Some Name for your Case',
options: {
search_type: 'NEAR',
filter_content_category: ['SL', 'WL', 'PEP'],
},
},
},
});
const association = await sdk.addAssociation({
data: {
type: 'risk-entity-screening-associations',
attributes: {
record_type: 'PERSON',
names: [
{
single_string_name: 'John Doe III',
name_type: 'PRIMARY',
},
],
},
},
});
await sdk.addExistingAssociationsToCase({
case_id: newCase.data.id,
data: [association.data],
});
const caseMatches = await sdk.getMatches({
case_id: newCase.data.id,
});
const associationMatches = await sdk.getMatches({
case_id: newCase.data.id,
associationId: association.data.id,
});
if (!associationMatches?.data?.length) {
console.log('no matches');
process.exit(0);
}
for (const associationMatch of associationMatches.data) {
const associationId = associationMatch.id;
const hasAlerts = associationMatch.attributes.has_alerts;
if (!associationMatch.attributes?.matches?.length) continue;
for (const match of associationMatch.attributes.matches) {
console.log(match.match_name);
console.log(match.current_state.state);
await sdk.addMatchFeedback({
case_id: newCase.data.id,
match_id: match.match_id,
data: {
type: 'risk-entity-screening-matches',
attributes: {
comment: 'This is not a match',
current_state: 'PERMANENTLY_CLEARED',
},
},
});
}
}
Please consult the documentation for more
Link to Documentation
Contribute
To install dependencies:
npm install
To build
npm run build
To test
npm test