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

@elevate_security/customer-data-validators

v1.4.6

Published

[![npm version](https://badge.fury.io/js/%40elevate_security%2Fcustomer-data-validators.svg)](https://badge.fury.io/js/%40elevate_security%2Fcustomer-data-validators) [![CircleCI](https://circleci.com/gh/ElevateSecurity/customer-data-validators.svg?style

Downloads

272

Readme

customer-data-validators

npm version CircleCI

Validation Scripts for Elevate Security Customer HR/Behaviors Dataset Formats.

Latest Integration Type definitions: type-config.yml (public link). spec.html (HTML version)

Prerequisite

  • [ ] Install NodeJS (with npm)

Usage

The CLI is self-documented, just execute and it will output the available commands. Example, to check the src/tests/test_files/2019-10-30-00_58_46.csv file with people/v1 integration type:

./dist/es-cdv-cli.nodejs.js check src/tests/test_files/2019-10-30-00_58_46.csv people/v1  # return code = 3 because there are invalid lines and no valid lines
./dist/es-cdv-cli.nodejs.js check src/tests/test_files/valid.csv people/v1 # return code = 0 because file is valid
echo $? # will see 0

Return codes of the CLI

  • 0: file contains valid rows, and no invalid rows (so, only valid or empty rows)
  • 1: invalid command
  • 2: no valid rows or invalid input file format
  • 4: some invalid rows
  • 6=2+4: some empty rows and some invalid rows
  • 8: unexpected failure

As a CLI:

By cloning the source code

git clone [email protected]:ElevateSecurity/customer-data-validators.git
cd customer-data-validators
npm install
./dist/es-cdv-cli.nodejs.js -h # for help
./dist/es-cdv-cli.nodejs.js check src/tests/test_files/2019-10-30-00_58_46.csv people/v1 # running the command

If you prefer to install a specific version of the package and run it as a binary

npm install @elevate_security/customer-data-validators
npm link
customer-data-validator -h

If you don't want to install the package up-front and just want to execute the command as a one-off:

npx --package @elevate_security/customer-data-validators  customer-data-validator -h

If npx is not installed: npm install -g npx

In a browser application

We're importing the library as an external script, to always get the latest available patch/minor version of the pinned major version (here below, version 1.x.y). This avoids rebuilding the UI everytime a new version of the validators is published.

<script src="https://unpkg.com/@elevate_security/customer-data-validators@^1"></script>

Then the library is available as esCustomerDataValidator in the global object, you can use it like this:

const {CustomerDataValidator} = window.esCustomerDataValidator;
const results = await CustomerDataValidator(fileContent, 'people/v1')

Development

Edit the schema

Update the type-config.yml. Then run npm run convert to update the type-config.json.

Update js files

To rebuild the package, run npm run build:prod

Tests

For cli and functional tests:

npm run test

And for UI tests, run:

npm run test:ui

Publishing the library to NPM

This happens automatically when merging a feature PR to the master branch. After the CirclecI Job finishes on the master branch, CircleCI will create a PR to bump the version number. Make sure you merge this "Bump version" PR promptly to avoid version conflicts.

Public type-config.yml

Since some other projects like the scoring platform need to access the type definitions, CircleCI pushes the distribution files built from this repo to a public S3 bucket es-use1prod-assets (see .circleci/config.yml. Files are accessible from https://docs.elevatesecurity.com/__apps/customer-data-validators/master/config/type-config.yml (master can be replaced by any branch name from this repository and config/type-config.yml can be replaced by any file from the dist folder)