1.4.6 • Published 1 year ago

@elevate_security/customer-data-validators v1.4.6

Weekly downloads
457
License
ISC
Repository
github
Last release
1 year 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

1 year ago

1.4.5

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.3.90

2 years ago

1.3.91

2 years ago

1.3.88

2 years ago

1.3.86

3 years ago

1.3.87

3 years ago

1.3.85

3 years ago

1.3.82

3 years ago

1.3.83

3 years ago

1.3.81

3 years ago

1.3.84

3 years ago

1.3.69

3 years ago

1.3.71

3 years ago

1.3.72

3 years ago

1.3.70

3 years ago

1.3.75

3 years ago

1.3.76

3 years ago

1.3.73

3 years ago

1.3.74

3 years ago

1.3.79

3 years ago

1.3.77

3 years ago

1.3.78

3 years ago

1.3.80

3 years ago

1.3.68

3 years ago

1.3.58

4 years ago

1.3.60

4 years ago

1.3.64

4 years ago

1.3.65

4 years ago

1.3.62

4 years ago

1.3.63

4 years ago

1.3.66

4 years ago

1.3.67

4 years ago

1.3.57

4 years ago

1.3.56

4 years ago

1.3.55

4 years ago

1.3.53

4 years ago

1.3.54

4 years ago

1.3.50

4 years ago

1.3.51

4 years ago

1.3.52

4 years ago

1.3.47

4 years ago

1.3.48

4 years ago

1.3.49

4 years ago

1.3.46

4 years ago

1.3.44

4 years ago

1.3.45

4 years ago

1.3.43

4 years ago

1.3.42

4 years ago

1.3.31

4 years ago

1.3.32

4 years ago

1.3.30

4 years ago

1.3.35

4 years ago

1.3.36

4 years ago

1.3.33

4 years ago

1.3.34

4 years ago

1.3.39

4 years ago

1.3.37

4 years ago

1.3.38

4 years ago

1.3.40

4 years ago

1.3.41

4 years ago

1.3.28

4 years ago

1.3.29

4 years ago

1.3.26

4 years ago

1.3.27

4 years ago

1.3.25

4 years ago

1.3.24

4 years ago

1.3.22

4 years ago

1.3.23

4 years ago

1.3.19

4 years ago

1.3.20

4 years ago

1.3.21

4 years ago

1.3.17

4 years ago

1.3.18

4 years ago

1.3.16

4 years ago

1.3.14

4 years ago

1.3.15

4 years ago

1.3.13

4 years ago

1.3.12

4 years ago

1.3.11

4 years ago

1.3.10

4 years ago

1.3.9

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.2.1

4 years ago

1.1.2

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.1.1

4 years ago

1.0.60

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.54

5 years ago

1.0.53

5 years ago

1.0.52

5 years ago

1.0.51

5 years ago

1.0.50

5 years ago

1.0.49

5 years ago

1.0.48

5 years ago

1.0.47

5 years ago

1.0.46

5 years ago

1.0.45

5 years ago

1.0.44

5 years ago

1.0.43

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.19

5 years ago

1.0.20

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.0

5 years ago

1.0.0-alpha1

5 years ago

1.0.0-alpha

5 years ago

0.2.17

5 years ago

0.2.16

5 years ago

0.2.14

5 years ago

0.2.13

5 years ago

0.2.12

5 years ago

0.2.11

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.7

5 years ago

0.2.8

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.8

5 years ago

0.1.9

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago