1.4.6 • Published 2 months ago

@elevate_security/customer-data-validators v1.4.6

Weekly downloads
457
License
ISC
Repository
github
Last release
2 months ago

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 git@github.com: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)

1.4.6

2 months ago

1.4.5

9 months ago

1.4.4

9 months ago

1.4.3

9 months ago

1.4.2

10 months ago

1.4.1

10 months ago

1.3.90

10 months ago

1.3.91

10 months ago

1.3.88

1 year ago

1.3.86

1 year ago

1.3.87

1 year ago

1.3.85

1 year ago

1.3.82

2 years ago

1.3.83

2 years ago

1.3.81

2 years ago

1.3.84

2 years ago

1.3.69

2 years ago

1.3.71

2 years ago

1.3.72

2 years ago

1.3.70

2 years ago

1.3.75

2 years ago

1.3.76

2 years ago

1.3.73

2 years ago

1.3.74

2 years ago

1.3.79

2 years ago

1.3.77

2 years ago

1.3.78

2 years ago

1.3.80

2 years ago

1.3.68

2 years ago

1.3.58

3 years ago

1.3.60

3 years ago

1.3.64

3 years ago

1.3.65

3 years ago

1.3.62

3 years ago

1.3.63

3 years ago

1.3.66

2 years ago

1.3.67

2 years ago

1.3.57

3 years ago

1.3.56

3 years ago

1.3.55

3 years ago

1.3.53

3 years ago

1.3.54

3 years ago

1.3.50

3 years ago

1.3.51

3 years ago

1.3.52

3 years ago

1.3.47

3 years ago

1.3.48

3 years ago

1.3.49

3 years ago

1.3.46

3 years ago

1.3.44

3 years ago

1.3.45

3 years ago

1.3.43

3 years ago

1.3.42

3 years ago

1.3.31

3 years ago

1.3.32

3 years ago

1.3.30

3 years ago

1.3.35

3 years ago

1.3.36

3 years ago

1.3.33

3 years ago

1.3.34

3 years ago

1.3.39

3 years ago

1.3.37

3 years ago

1.3.38

3 years ago

1.3.40

3 years ago

1.3.41

3 years ago

1.3.28

3 years ago

1.3.29

3 years ago

1.3.26

3 years ago

1.3.27

3 years ago

1.3.25

3 years ago

1.3.24

3 years ago

1.3.22

3 years ago

1.3.23

3 years ago

1.3.19

3 years ago

1.3.20

3 years ago

1.3.21

3 years ago

1.3.17

3 years ago

1.3.18

3 years ago

1.3.16

3 years ago

1.3.14

3 years ago

1.3.15

3 years ago

1.3.13

3 years ago

1.3.12

3 years ago

1.3.11

3 years ago

1.3.10

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.2.1

3 years ago

1.1.2

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.1.1

3 years ago

1.0.60

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.54

3 years ago

1.0.53

3 years ago

1.0.52

3 years ago

1.0.51

3 years ago

1.0.50

3 years ago

1.0.49

3 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.45

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.19

4 years ago

1.0.20

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago

1.0.0-alpha1

4 years ago

1.0.0-alpha

4 years ago

0.2.17

4 years ago

0.2.16

4 years ago

0.2.14

4 years ago

0.2.13

4 years ago

0.2.12

4 years ago

0.2.11

4 years ago

0.2.10

4 years ago

0.2.9

4 years ago

0.2.7

4 years ago

0.2.8

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.8

4 years ago

0.1.9

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.1.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago