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