This NPM package exposes functionality to
- Run rule (sets) programmatically
- Run rule sets from CLI
- Run tests from CLI
A rule set is a JSON file that adheres to this JSON Schema.
The NPM package exposes two functions: runRule
and runRuleSet
.
Both take a second parameter of the following form:
{
payload: <DCC payload>,
external: {
valueSets: <value sets>,
// any other parameters, such as "validationClock"
}
}
The run-rule-set
script placed in NPM's .bin
takes 4 parameters, which are paths to JSON files containing (in this order):
- the rule set
- the value sets
- the DCC payload
- the external parameters but not containing the value sets
The test-rule-set
script placed in NPM's .bin
takes 3 named parameters of the form --<name>=<value>
, which are paths to the following:
rule-set
: a path to a JSON file containing the rule setvalue-sets
: a path to a JSON file containing the value setstests
: a path to a directory containing the tests