Socket
Socket
Sign inDemoInstall

@eckidevs/dow-sdk

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @eckidevs/dow-sdk

A module to interface with the Dow Jones Screening and Monitoring API in a type-safe way


Version published
Weekly downloads
1
decreased by-94.74%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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});

// List all cases / associations
const cases = await sdk.listCases();
const associations = await sdk.listAssociations();

// Create a new case
const newCase = await sdk.addCase({
  data: {
    type: 'risk-entity-screening-cases',
    attributes: {
      case_name: 'Some Name for your Case',
      options: {
        search_type: 'NEAR',
        // See docs for more types
        filter_content_category: ['SL', 'WL', 'PEP'],
      },
    },
  },
});

// Create a new association
const association = await sdk.addAssociation({
  data: {
    type: 'risk-entity-screening-associations',
    attributes: {
      record_type: 'PERSON', // or ENTITY or UNKNOWN
      names: [
        {
          single_string_name: 'John Doe III',
          name_type: 'PRIMARY',
        },
      ],
    },
  },
});

// Correlate an association to a case
await sdk.addExistingAssociationsToCase({
  case_id: newCase.data.id,
  data: [association.data],
});

// Get matches for entire case
const caseMatches = await sdk.getMatches({
  case_id: newCase.data.id,
});

// Get matches for specific association
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; // Always the association id
  const hasAlerts = associationMatch.attributes.has_alerts; // If there are still matches with an OPEN status

  if (!associationMatch.attributes?.matches?.length) continue; // 'empty results';

  for (const match of associationMatch.attributes.matches) {
    console.log(match.match_name); // The person / entity name
    console.log(match.current_state.state); // The person / entity state (OPEN, CLEARED etc.)

    // Update the status of a match
    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', // CONFIRMED etc.
        },
      },
    });
  }
}

Please consult the documentation for more

Link to Documentation

Contribute

To install dependencies:

npm install

To build

npm run build

To test

npm test

FAQs

Last updated on 10 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc