UNPKG

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