npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dj-screening-sdk

v1.0.0-beta.8

Published

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

Downloads

127

Readme

dow-sdk

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

Quick example

import {DowJonesSDK} from 'dj-screening-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