- Upgrade jsonpath-plus dependency, to fix inconsistent scalar results (#175)
- BUGFIX: Add missing
DEBUG
log for almanac.addRuntimeFact()
- BUGFIX:
DEBUG
envs works with cookies disables
- BREAKING CHANGES
- Rule conditions'
path
property is now interpreted using json-path- To continue using the old syntax (provided via selectn),
npm install selectn
as a direct dependency, andjson-rules-engine
will continue to interpret legacy paths this way. - Any path starting with
$
will be assumed to usejson-path
syntax
- To continue using the old syntax (provided via selectn),
- Rule conditions'
- Export Typescript definitions (@brianphillips)
- BREAKING CHANGES
engine.run()
now returns a hash of events and almanac:{ events: [], almanac: Almanac instance }
. Previously in v3, therun()
returned theevents
array.- For example,
const events = await engine.run()
under v3 will need to be changed toconst { events } = await engine.run()
under v4.
- For example,
- Feature:
rule.setName()
andruleResult.name
- Fix "localStorage.debug" not working in browsers
- Fix "process" not defined error in browsers lacking node.js global shims
- BREAKING CHANGES
- Previously all conditions with undefined facts would resolve false. With this change, undefined facts values are treated as
undefined
.
- Previously all conditions with undefined facts would resolve false. With this change, undefined facts values are treated as
- Greatly improved performance of
allowUndefinedfacts = true
engine option - Reduce package bundle size by ~40%
- Replace debug with vanilla console.log
- Use Array.isArray instead of instanceof to test Array parameters to address edge cases
- Fix rules cache not clearing after removeRule()
- Upgrade all dependencies to latest
- IE8 compatibility: replace Array.forEach with for loop (@knalbandianbrightgrove)
- Engine.removeFact() - removes fact from the engine (@SaschaDeWaal)
- Engine.removeRule() - removes rule from the engine (@SaschaDeWaal)
- Engine.removeOperator() - removes operator from the engine (@SaschaDeWaal)
- Performance: Constant facts now perform 18-26X better
- Performance: Removes await/async transpilation and json.stringify calls, significantly improving overall performance
- Publish dist updates for 2.0.3
- Add factResult and result to the JSON generated for Condition (@bjacobso)
- Bugfix IE8 support
- Bugfix rule result serialization
- Publishing 2.0.0
- Fix fact path object checking to work with objects that have prototypes (lodash isObjectLike instead of isPlainObject)
- Add rule results
- Document fact .path ability to parse properties containing dots
- Bump dependencies
- BREAKING CHANGES
engine.on('failure', (rule, almanac))
is nowengine.on('failure', (event, almanac, ruleResult))
engine.on(eventType, (eventParams, engine))
is nowengine.on(eventType, (eventParams, almanac, ruleResult))
- Bugfix almanac.factValue skipping interpreting condition "path" for cached facts
- Add fact comparison conditions
- Add
allowUndefinedFacts
engine option
- Bump object-hash dependency to latest
- Rule event emissions
- Rule chaining
- Use Array.indexOf instead of Array.includes for older node version compatibility
- Fact path support
- Custom operator support
- fix issue #6; runtime facts unique to each run()
- fix issue #5; dependency error babel-core/register
- api stable; releasing 1.0
- engine.run() now returns triggered events
- Completed the 'fact-dependecy' advanced example
- Updated addFact and addRule engine methods to return 'this' for easy chaining
- Completed the 'basic' example
- [BREAKING CHANGE] update engine.on('success') and engine.on('failure') to pass the current almanac instance as the second argument, rather than the engine