UNPKG

6.58 kBMarkdownView Raw
1#### 6.0.1 / 2021-03-09
2 * Updates Typescript types to include `failureEvents` in EngineResult.
3
4#### 6.0.0 / 2020-12-22
5 * BREAKING CHANGES
6 * To continue using [selectn](https://github.com/wilmoore/selectn.js) syntax for condition `path`s, use the new `pathResolver` feature. Read more [here](./docs/rules.md#condition-helpers-custom-path-resolver). Add the following to the engine constructor:
7 ```js
8 const pathResolver = (object, path) => {
9 return selectn(path)(object)
10 }
11 const engine = new Engine(rules, { pathResolver })
12 ```
13 (fixes #205)
14 * Engine and Rule events `on('success')`, `on('failure')`, and Rule callbacks `onSuccess` and `onFailure` now honor returned promises; any event handler that returns a promise will be waited upon to resolve before engine execution continues. (fixes #235)
15 * Private `rule.event` property renamed. Use `rule.getEvent()` to avoid breaking changes in the future.
16 * The `success-events` fact used to store successful events has been converted to an internal data structure and will no longer appear in the almanac's facts. (fixes #187)
17 * NEW FEATURES
18 * Engine constructor now accepts a `pathResolver` option for resolving condition `path` properties. Read more [here](./docs/rules.md#condition-helpers-custom-path-resolver). (fixes #210)
19 * Engine.run() now returns three additional data structures:
20 * `failureEvents`, an array of all failed rules events. (fixes #192)
21 * `results`, an array of RuleResults for each successful rule (fixes #216)
22 * `failureResults`, an array of RuleResults for each failed rule
23
24
25#### 5.3.0 / 2020-12-02
26 * Allow facts to have a value of `undefined`
27
28#### 5.2.0 / 2020-11-31
29 * No changes; published to correct an accidental publish of untagged alpha
30
31#### 5.0.4 / 2020-09-26
32 * Upgrade dependencies to latest
33
34#### 5.0.3 / 2020-01-26
35 * Upgrade jsonpath-plus dependency, to fix inconsistent scalar results (#175)
36
37#### 5.0.2 / 2020-01-18
38* BUGFIX: Add missing `DEBUG` log for almanac.addRuntimeFact()
39
40#### 5.0.1 / 2020-01-18
41* BUGFIX: `DEBUG` envs works with cookies disables
42
43#### 5.0.0 / 2019-11-29
44 * BREAKING CHANGES
45 * Rule conditions' `path` property is now interpreted using [json-path](https://goessner.net/articles/JsonPath/)
46 * To continue using the old syntax (provided via [selectn](https://github.com/wilmoore/selectn.js)), `npm install selectn` as a direct dependency, and `json-rules-engine` will continue to interpret legacy paths this way.
47 * Any path starting with `$` will be assumed to use `json-path` syntax
48
49#### 4.1.0 / 2019-09-27
50 * Export Typescript definitions (@brianphillips)
51
52#### 4.0.0 / 2019-08-22
53 * BREAKING CHANGES
54 * `engine.run()` now returns a hash of events and almanac: `{ events: [], almanac: Almanac instance }`. Previously in v3, the `run()` returned the `events` array.
55 * For example, `const events = await engine.run()` under v3 will need to be changed to `const { events } = await engine.run()` under v4.
56
57#### 3.1.0 / 2019-07-19
58 * Feature: `rule.setName()` and `ruleResult.name`
59
60#### 3.0.3 / 2019-07-15
61 * Fix "localStorage.debug" not working in browsers
62
63#### 3.0.2 / 2019-05-23
64 * Fix "process" not defined error in browsers lacking node.js global shims
65
66#### 3.0.0 / 2019-05-17
67 * BREAKING CHANGES
68 * Previously all conditions with undefined facts would resolve false. With this change, undefined facts values are treated as `undefined`.
69 * Greatly improved performance of `allowUndefinedfacts = true` engine option
70 * Reduce package bundle size by ~40%
71
72#### 2.3.5 / 2019-04-26
73 * Replace debug with vanilla console.log
74
75#### 2.3.4 / 2019-04-26
76 * Use Array.isArray instead of instanceof to test Array parameters to address edge cases
77
78#### 2.3.3 / 2019-04-23
79 * Fix rules cache not clearing after removeRule()
80
81#### 2.3.2 / 2018-12-28
82 * Upgrade all dependencies to latest
83
84#### 2.3.1 / 2018-12-03
85 * IE8 compatibility: replace Array.forEach with for loop (@knalbandianbrightgrove)
86
87#### 2.3.0 / 2018-05-03
88 * Engine.removeFact() - removes fact from the engine (@SaschaDeWaal)
89 * Engine.removeRule() - removes rule from the engine (@SaschaDeWaal)
90 * Engine.removeOperator() - removes operator from the engine (@SaschaDeWaal)
91
92#### 2.2.0 / 2018-04-19
93 * Performance: Constant facts now perform 18-26X better
94 * Performance: Removes await/async transpilation and json.stringify calls, significantly improving overall performance
95
96#### 2.1.0 / 2018-02-19
97 * Publish dist updates for 2.0.3
98
99#### 2.0.3 / 2018-01-29
100 * Add factResult and result to the JSON generated for Condition (@bjacobso)
101
102#### 2.0.2 / 2017-07-24
103 * Bugfix IE8 support
104
105#### 2.0.1 / 2017-07-05
106 * Bugfix rule result serialization
107
108#### 2.0.0 / 2017-04-21
109 * Publishing 2.0.0
110
111#### 2.0.0-beta2 / 2017-04-10
112 * Fix fact path object checking to work with objects that have prototypes (lodash isObjectLike instead of isPlainObject)
113
114#### 2.0.0-beta1 / 2017-04-09
115 * Add rule results
116 * Document fact .path ability to parse properties containing dots
117 * Bump dependencies
118 * BREAKING CHANGES
119 * `engine.on('failure', (rule, almanac))` is now `engine.on('failure', (event, almanac, ruleResult))`
120 * `engine.on(eventType, (eventParams, engine))` is now `engine.on(eventType, (eventParams, almanac, ruleResult))`
121
122#### 1.5.1 / 2017-03-19
123 * Bugfix almanac.factValue skipping interpreting condition "path" for cached facts
124
125#### 1.5.0 / 2017-03-12
126 * Add fact comparison conditions
127
128#### 1.4.0 / 2017-01-23
129 * Add `allowUndefinedFacts` engine option
130
131#### 1.3.1 / 2017-01-16
132 * Bump object-hash dependency to latest
133
134#### 1.3.0 / 2016-10-24
135 * Rule event emissions
136 * Rule chaining
137
138#### 1.2.1 / 2016-10-22
139 * Use Array.indexOf instead of Array.includes for older node version compatibility
140
141#### 1.2.0 / 2016-09-13
142 * Fact path support
143
144#### 1.1.0 / 2016-09-11
145 * Custom operator support
146
147#### 1.0.4 / 2016-06-18
148 * fix issue #6; runtime facts unique to each run()
149
150#### 1.0.3 / 2016-06-15
151 * fix issue #5; dependency error babel-core/register
152
153#### 1.0.0 / 2016-05-01
154 * api stable; releasing 1.0
155 * engine.run() now returns triggered events
156
157#### 1.0.0-beta10 / 2016-04-16
158 * Completed the 'fact-dependecy' advanced example
159 * Updated addFact and addRule engine methods to return 'this' for easy chaining
160
161#### 1.0.0-beta9 / 2016-04-11
162 * Completed the 'basic' example
163 * [BREAKING CHANGE] update engine.on('success') and engine.on('failure') to pass the current almanac instance as the second argument, rather than the engine