@o3r/rules-engine 11.6.0-prerelease.4 → 11.6.0-prerelease.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +21 -47
  2. package/builders/rules-engine-extractor/helpers/index.js.map +1 -0
  3. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.d.ts +1 -10
  4. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.d.ts.map +1 -1
  5. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.interfaces.d.ts +1 -2
  6. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.interfaces.d.ts.map +1 -1
  7. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.interfaces.js.map +1 -0
  8. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.js +27 -36
  9. package/builders/rules-engine-extractor/helpers/rules-engine.extractor.js.map +1 -0
  10. package/builders/rules-engine-extractor/index.d.ts.map +1 -1
  11. package/builders/rules-engine-extractor/index.js +15 -20
  12. package/builders/rules-engine-extractor/index.js.map +1 -0
  13. package/builders/rules-engine-extractor/schema.d.ts.map +1 -1
  14. package/builders/rules-engine-extractor/schema.js.map +1 -0
  15. package/components/rules-engine/index.d.ts +1 -1
  16. package/components/rules-engine/index.d.ts.map +1 -1
  17. package/components/rules-engine/rule-actions/rule-actions-pres.component.d.ts.map +1 -1
  18. package/components/rules-engine/rule-condition/rule-condition-pres.component.d.ts.map +1 -1
  19. package/components/rules-engine/rule-key-value/rule-key-value-pres.component.d.ts.map +1 -1
  20. package/components/rules-engine/rule-tree/rule-tree-pres.component.d.ts.map +1 -1
  21. package/components/rules-engine/ruleset-history/ruleset-history-pres.component.d.ts.map +1 -1
  22. package/components/rules-engine/ruleset-history/ruleset-history-pres.module.d.ts.map +1 -1
  23. package/components/rules-engine/shared/fallback-to.pipe.d.ts.map +1 -1
  24. package/components/rules-engine/shared/index.d.ts +1 -1
  25. package/components/rules-engine/shared/index.d.ts.map +1 -1
  26. package/components/rules-engine/shared/json-or-string.pipe.d.ts.map +1 -1
  27. package/components/rules-engine/shared/ruleset-history.helper.d.ts.map +1 -1
  28. package/devkit/rules-engine-devkit.interface.d.ts.map +1 -1
  29. package/devkit/rules-engine-devtools.console.service.d.ts.map +1 -1
  30. package/devkit/rules-engine-devtools.message.service.d.ts +3 -6
  31. package/devkit/rules-engine-devtools.message.service.d.ts.map +1 -1
  32. package/devkit/rules-engine-devtools.module.d.ts.map +1 -1
  33. package/devkit/rules-engine-devtools.service.d.ts +2 -2
  34. package/devkit/rules-engine-devtools.service.d.ts.map +1 -1
  35. package/devkit/rules-engine-devtools.token.d.ts +1 -1
  36. package/devkit/rules-engine-devtools.token.d.ts.map +1 -1
  37. package/engine/debug/engine.debug.d.ts +0 -2
  38. package/engine/debug/engine.debug.d.ts.map +1 -1
  39. package/engine/debug/helpers.d.ts.map +1 -1
  40. package/engine/engine.d.ts +1 -4
  41. package/engine/engine.d.ts.map +1 -1
  42. package/engine/engine.interface.d.ts.map +1 -1
  43. package/engine/fact/fact.interfaces.d.ts.map +1 -1
  44. package/engine/helpers/filter-ruleset-event.operator.d.ts.map +1 -1
  45. package/engine/operator/operator.helpers.d.ts +1 -3
  46. package/engine/operator/operator.helpers.d.ts.map +1 -1
  47. package/engine/operator/operator.interface.d.ts.map +1 -1
  48. package/engine/operator/operators/array-based.operators.d.ts +1 -1
  49. package/engine/operator/operators/array-based.operators.d.ts.map +1 -1
  50. package/engine/operator/operators/basic.operators.d.ts +1 -1
  51. package/engine/operator/operators/basic.operators.d.ts.map +1 -1
  52. package/engine/operator/operators/date-based.operators.d.ts.map +1 -1
  53. package/engine/operator/operators/index.d.ts +2 -2
  54. package/engine/operator/operators/index.d.ts.map +1 -1
  55. package/engine/operator/operators/number-based.operators.d.ts.map +1 -1
  56. package/engine/ruleset-executor.d.ts +7 -2
  57. package/engine/ruleset-executor.d.ts.map +1 -1
  58. package/engine/structure.d.ts.map +1 -1
  59. package/esm2022/components/rules-engine/index.mjs +2 -2
  60. package/esm2022/components/rules-engine/rule-actions/rule-actions-pres.component.mjs +5 -5
  61. package/esm2022/components/rules-engine/rule-condition/rule-condition-pres.component.mjs +6 -7
  62. package/esm2022/components/rules-engine/rule-key-value/rule-key-value-pres.component.mjs +8 -8
  63. package/esm2022/components/rules-engine/rule-tree/rule-tree-pres.component.mjs +5 -5
  64. package/esm2022/components/rules-engine/ruleset-history/ruleset-history-pres.component.mjs +9 -9
  65. package/esm2022/components/rules-engine/ruleset-history/ruleset-history-pres.module.mjs +13 -13
  66. package/esm2022/components/rules-engine/shared/fallback-to.pipe.mjs +9 -9
  67. package/esm2022/components/rules-engine/shared/index.mjs +2 -2
  68. package/esm2022/components/rules-engine/shared/json-or-string.pipe.mjs +5 -5
  69. package/esm2022/components/rules-engine/shared/ruleset-history.helper.mjs +5 -5
  70. package/esm2022/devkit/index.mjs +1 -1
  71. package/esm2022/devkit/rules-engine-devkit.interface.mjs +4 -4
  72. package/esm2022/devkit/rules-engine-devtools.console.service.mjs +8 -10
  73. package/esm2022/devkit/rules-engine-devtools.message.service.mjs +23 -23
  74. package/esm2022/devkit/rules-engine-devtools.module.mjs +11 -11
  75. package/esm2022/devkit/rules-engine-devtools.service.mjs +19 -19
  76. package/esm2022/devkit/rules-engine-devtools.token.mjs +2 -2
  77. package/esm2022/engine/debug/engine.debug.mjs +16 -18
  78. package/esm2022/engine/debug/helpers.mjs +11 -11
  79. package/esm2022/engine/engine.interface.mjs +1 -1
  80. package/esm2022/engine/engine.mjs +12 -15
  81. package/esm2022/engine/fact/fact.interfaces.mjs +1 -1
  82. package/esm2022/engine/helpers/filter-ruleset-event.operator.mjs +6 -6
  83. package/esm2022/engine/operator/operator.helpers.mjs +15 -17
  84. package/esm2022/engine/operator/operator.interface.mjs +1 -1
  85. package/esm2022/engine/operator/operators/array-based.operators.mjs +11 -11
  86. package/esm2022/engine/operator/operators/basic.operators.mjs +8 -8
  87. package/esm2022/engine/operator/operators/date-based.operators.mjs +3 -3
  88. package/esm2022/engine/operator/operators/index.mjs +6 -6
  89. package/esm2022/engine/operator/operators/number-based.operators.mjs +2 -2
  90. package/esm2022/engine/rule/index.mjs +1 -1
  91. package/esm2022/engine/rule/rule.helpers.mjs +1 -1
  92. package/esm2022/engine/ruleset-executor.mjs +27 -23
  93. package/esm2022/engine/structure.mjs +1 -1
  94. package/esm2022/fact/fact.abstract-service.mjs +1 -1
  95. package/esm2022/fact/reserved.facts.mjs +1 -1
  96. package/esm2022/fixtures/jasmine/rules-engine.runner.service.fixture.jasmine.mjs +1 -1
  97. package/esm2022/fixtures/jest/rules-engine.runner.service.fixture.jest.mjs +1 -1
  98. package/esm2022/inner-facts/current-time/current-time-fact.service.mjs +8 -8
  99. package/esm2022/inner-facts/current-time/current-time.facts.mjs +1 -1
  100. package/esm2022/inner-facts/current-time/index.mjs +2 -2
  101. package/esm2022/interfaces/action.interfaces.mjs +1 -1
  102. package/esm2022/interfaces/index.mjs +1 -1
  103. package/esm2022/public_api.mjs +1 -2
  104. package/esm2022/services/index.mjs +2 -2
  105. package/esm2022/services/rules-engine.token.mjs +2 -2
  106. package/esm2022/services/runner/rules-engine.runner.module.mjs +11 -11
  107. package/esm2022/services/runner/rules-engine.runner.service.mjs +38 -25
  108. package/esm2022/stores/rulesets/rulesets.actions.mjs +3 -3
  109. package/esm2022/stores/rulesets/rulesets.effect.mjs +10 -10
  110. package/esm2022/stores/rulesets/rulesets.module.mjs +11 -11
  111. package/esm2022/stores/rulesets/rulesets.reducer.mjs +4 -4
  112. package/esm2022/stores/rulesets/rulesets.selectors.mjs +10 -10
  113. package/esm2022/stores/rulesets/rulesets.state.mjs +1 -1
  114. package/esm2022/stores/rulesets/rulesets.sync.mjs +3 -3
  115. package/fact/fact.abstract-service.d.ts.map +1 -1
  116. package/fact/reserved.facts.d.ts.map +1 -1
  117. package/facts/current-time/current-time.facts.d.ts +11 -0
  118. package/facts/current-time/current-time.facts.d.ts.map +1 -0
  119. package/facts/current-time/index.d.ts +2 -0
  120. package/facts/current-time/index.d.ts.map +1 -0
  121. package/facts/index.d.ts +2 -0
  122. package/facts/index.d.ts.map +1 -0
  123. package/fesm2022/o3r-rules-engine-fixtures-jasmine.mjs.map +1 -1
  124. package/fesm2022/o3r-rules-engine-fixtures-jest.mjs.map +1 -1
  125. package/fesm2022/o3r-rules-engine.mjs +334 -328
  126. package/fesm2022/o3r-rules-engine.mjs.map +1 -1
  127. package/fixtures/jasmine/rules-engine.runner.service.fixture.jasmine.d.ts.map +1 -1
  128. package/fixtures/jest/rules-engine.runner.service.fixture.jest.d.ts.map +1 -1
  129. package/fixtures/jest/rules-engine.runner.service.fixture.jest.js.map +1 -1
  130. package/inner-facts/current-time/current-time-fact.service.d.ts +1 -1
  131. package/inner-facts/current-time/current-time-fact.service.d.ts.map +1 -1
  132. package/inner-facts/current-time/current-time.facts.d.ts.map +1 -1
  133. package/inner-facts/current-time/index.d.ts +1 -1
  134. package/inner-facts/current-time/index.d.ts.map +1 -1
  135. package/interfaces/action.interfaces.d.ts.map +1 -1
  136. package/migration.json +5 -0
  137. package/package.json +18 -18
  138. package/public_api.d.ts +0 -1
  139. package/public_api.d.ts.map +1 -1
  140. package/schemas/rulesets.schema.json +20 -0
  141. package/schematics/cms-adapter/index.d.ts.map +1 -1
  142. package/schematics/cms-adapter/index.js +1 -3
  143. package/schematics/cms-adapter/index.js.map +1 -0
  144. package/schematics/facts-service/index.d.ts.map +1 -1
  145. package/schematics/facts-service/index.js +2 -2
  146. package/schematics/facts-service/index.js.map +1 -0
  147. package/schematics/facts-service/schema.d.ts.map +1 -1
  148. package/schematics/facts-service/schema.js.map +1 -0
  149. package/schematics/ng-add/helpers/devtools-registration.d.ts +0 -2
  150. package/schematics/ng-add/helpers/devtools-registration.d.ts.map +1 -1
  151. package/schematics/ng-add/helpers/devtools-registration.js +2 -4
  152. package/schematics/ng-add/helpers/devtools-registration.js.map +1 -0
  153. package/schematics/ng-add/index.d.ts.map +1 -1
  154. package/schematics/ng-add/index.js +8 -11
  155. package/schematics/ng-add/index.js.map +1 -0
  156. package/schematics/ng-add/schema.d.ts.map +1 -1
  157. package/schematics/ng-add/schema.js.map +1 -0
  158. package/schematics/ng-update/index.d.ts +5 -1
  159. package/schematics/ng-update/index.d.ts.map +1 -1
  160. package/schematics/ng-update/index.js +17 -5
  161. package/schematics/ng-update/index.js.map +1 -0
  162. package/schematics/ng-update/v10.0/action-module-split.d.ts.map +1 -1
  163. package/schematics/ng-update/v10.0/action-module-split.js +0 -2
  164. package/schematics/ng-update/v10.0/action-module-split.js.map +1 -0
  165. package/schematics/ng-update/v11.6/use-register-action-handlers.d.ts +7 -0
  166. package/schematics/ng-update/v11.6/use-register-action-handlers.d.ts.map +1 -0
  167. package/schematics/ng-update/v11.6/use-register-action-handlers.js +20 -0
  168. package/schematics/operator/index.d.ts.map +1 -1
  169. package/schematics/operator/index.js +2 -2
  170. package/schematics/operator/index.js.map +1 -0
  171. package/schematics/operator/schema.d.ts.map +1 -1
  172. package/schematics/operator/schema.js.map +1 -0
  173. package/schematics/rules-engine-to-component/index.d.ts.map +1 -1
  174. package/schematics/rules-engine-to-component/index.js.map +1 -0
  175. package/schematics/rules-engine-to-component/schema.d.ts.map +1 -1
  176. package/schematics/rules-engine-to-component/schema.js.map +1 -0
  177. package/services/index.d.ts +1 -1
  178. package/services/index.d.ts.map +1 -1
  179. package/services/rules-engine.token.d.ts +1 -1
  180. package/services/rules-engine.token.d.ts.map +1 -1
  181. package/services/runner/rules-engine.runner.module.d.ts.map +1 -1
  182. package/services/runner/rules-engine.runner.service.d.ts +21 -12
  183. package/services/runner/rules-engine.runner.service.d.ts.map +1 -1
  184. package/stores/rulesets/rulesets.actions.d.ts.map +1 -1
  185. package/stores/rulesets/rulesets.effect.d.ts +1 -1
  186. package/stores/rulesets/rulesets.effect.d.ts.map +1 -1
  187. package/stores/rulesets/rulesets.module.d.ts.map +1 -1
  188. package/stores/rulesets/rulesets.reducer.d.ts.map +1 -1
  189. package/stores/rulesets/rulesets.selectors.d.ts.map +1 -1
  190. package/stores/rulesets/rulesets.state.d.ts.map +1 -1
  191. package/stores/rulesets/rulesets.sync.d.ts.map +1 -1
package/README.md CHANGED
@@ -9,28 +9,8 @@ This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/ot
9
9
 
10
10
  ## Description
11
11
 
12
- [![Stable Version](https://img.shields.io/npm/v/@o3r/rules-engine?style=for-the-badge)](https://www.npmjs.com/package/@o3r/rules-engine)
13
- [![Bundle Size](https://img.shields.io/bundlephobia/min/@o3r/rules-engine?color=green&style=for-the-badge)](https://www.npmjs.com/package/@o3r/rules-engine)
14
-
15
- This module provides a rules engine that can run on your user's browser to customize the ([translations](https://www.npmjs.com/package/@o3r/localization),
16
- [//]: # (Should we target placeholder or the component npmjs, and we add a section on the placeholder there?)
17
- [placeholders](https://github.com/AmadeusITGroup/otter/blob/main/docs/components/PLACEHOLDERS.md) and [configurations](https://www.npmjs.com/package/@o3r/configuration)) of your application at runtime.
18
-
19
- The rules engine interprets a list of [actions](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/README.md#action) to execute based on the evaluation of [Rulesets](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/README.md#ruleset)
20
- and their conditions. Conditions are logical expressions relying on [operators](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/README.md#operator) and variables we call
21
- [facts](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/README.md#fact).
22
-
23
- You can store your list of Rulesets on a static JSON file.
24
-
25
- This mechanism allows you to bring UI personalization based on runtime events without the need of a backend service.
26
- This can be useful if you want to drive dynamic behavior.
27
-
28
- For example, you could consider leveraging this feature to display assets based on the current season or for some special events, or to drive
29
- A/B testing on your components.
30
-
31
- You will find more information on the concepts behind the rules engine in its [dedicated documentation](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/README.md).
32
- For a demonstration of the rules engine capabilities, you can refer to the [live example](https://amadeusitgroup.github.io/otter/#/rules-engine)
33
- in the Otter showcase.
12
+ This module provides a rule engine that can be executed on your Otter application to customize your application (translations,
13
+ placeholders and configs) based on a json file generated by your CMS.
34
14
 
35
15
  ## How to install
36
16
 
@@ -38,33 +18,35 @@ in the Otter showcase.
38
18
  ng add @o3r/rules-engine
39
19
  ```
40
20
 
41
- > [!WARNING]
42
- > This module requires [@o3r/core](https://www.npmjs.com/package/@o3r/core) to be installed.
21
+ > **Warning**: this module requires [@o3r/core](https://www.npmjs.com/package/@o3r/core) to be installed.
43
22
 
44
23
  ## How to use
45
24
 
46
- The package exposes the ``RulesEngineRunnerService`` that can drive all the Otter customization-based services
47
- in order to personalize the user experience.
48
- On its own, the service will do nothing and will need __action handlers__ to register with the list of supported actions
49
- and their implementation.
50
-
51
- Not only this allows for a better extensibility of the service, but it also keeps the number of imported module to the
52
- bare minimum for a lighter application.
25
+ To facilitate the understanding of the usage of the rule engines, the documentation has been split in several sessions:
53
26
 
54
- Find more information on the [Otter rules engine documentation](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/how-to-use/README.md).
27
+ - [integration](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/how-to-use/integration.md)
28
+ - [cms-json-imports](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/how-to-use/cms-json-imports.md)
29
+ - [create-custom-fact](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/how-to-use/create-custom-fact.md)
30
+ - [debug-panel](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/how-to-use/debug-panel.md)
31
+ - [debug](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/how-to-use/debug.md)
32
+ - [dedicated-component-ruleset](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/how-to-use/dedicated-component-ruleset.md)
33
+ - [performance-metrics](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/how-to-use/performance-metrics.md)
34
+ - [placeholders](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/how-to-use/placeholders.md)
55
35
 
56
36
  ## Examples
57
37
 
58
38
  Several examples of the rules engine usage are available on the following links:
59
39
 
60
- - [Basic rule](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/examples/basic-rule.md)
61
- - [Rule with complex fact](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/examples/complex-fact.md)
62
- - [Rule with Nested Conditions](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/examples/nested-conditions.md)
63
- - [Rule using runtime facts](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/examples/runtime-facts.md)
40
+ - [basic-rule](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/examples/basic-rule.md)
41
+ - [complex-fact](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/examples/complex-fact.md)
42
+ - [custom-operator](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/examples/custom-operator.md)
43
+ - [nested-conditions](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/examples/nested-conditions.md)
44
+ - [readme](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/examples/readme.md)
45
+ - [runtime-facts](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/examples/runtime-facts.md)
64
46
 
65
47
  ## Generators
66
48
 
67
- Otter framework provides a set of code generators based on [Angular schematics](https://angular.io/guide/schematics).
49
+ Otter framework provides a set of code generators based on [angular schematics](https://angular.io/guide/schematics).
68
50
 
69
51
  | Schematics | Description | How to use |
70
52
  |---------------------------|---------------------------------------------------------------|----------------------------------|
@@ -73,14 +55,6 @@ Otter framework provides a set of code generators based on [Angular schematics](
73
55
  | facts-service | Generate a facts service | `ng g facts-service` |
74
56
  | operators | Generate an operator | `ng g operator` |
75
57
 
76
- ## Debug
77
- A whole section of the [Otter Chrome Devtool extension](https://chromewebstore.google.com/detail/otter-devtools/aejabgendbpckkdnjaphhlifbhepmbne) is dedicated to the debug of the rules engine with
78
- a visual representation of your Rulesets and a history of the run, conditions met and actions applied.
79
-
80
- Find more information on the tool in the [Otter Chrome Devtool extension documentation](https://github.com/AmadeusITGroup/otter/blob/main/docs/dev-tools/chrome-devtools.md)
81
- and its [dedicated section in the rules engine documentation](https://github.com/AmadeusITGroup/otter/blob/main/docs/rules-engine/how-to-use/chrome-extension.md).
82
-
83
- ## External links
58
+ ## Details
84
59
 
85
- More details regarding the way the rules engine is working can be found in the [documentation](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/).<br>
86
- A live example is available in the [Otter Showcase Application](https://amadeusitgroup.github.io/otter/#/rules-engine) with reference to its code source.
60
+ More details regarding the way the rules engine is working can be found in the [documentation](https://github.com/AmadeusITGroup/otter/tree/main/docs/rules-engine/).
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../builders/rules-engine-extractor/helpers/index.ts"],"names":[],"mappings":";;;AAAA,mEAAyC;AACzC,8EAAoD"}
@@ -14,7 +14,7 @@ export declare class RulesEngineExtractor {
14
14
  /** Interface of an action definition */
15
15
  static readonly OPERATOR_ACTIONS_INTERFACE = "RulesEngineAction";
16
16
  /** Reserved fact names that will be filtered out of metadata */
17
- static readonly RESERVED_FACT_NAMES: Readonly<string[]>;
17
+ static readonly RESERVED_FACT_NAMES: string[];
18
18
  /** TSConfig to parse the code */
19
19
  private readonly tsconfig;
20
20
  /** Instance of the comment parser */
@@ -22,7 +22,6 @@ export declare class RulesEngineExtractor {
22
22
  constructor(tsconfigPath: string, basePath: string, logger: LoggerApi);
23
23
  /**
24
24
  * Extract type definition of a type reference into schema file
25
- *
26
25
  * @param type Name of the type to extract
27
26
  * @param sourceFile path to the code source file
28
27
  */
@@ -30,14 +29,12 @@ export declare class RulesEngineExtractor {
30
29
  /**
31
30
  * Extract the type node used to generate the type metadata.
32
31
  * In the case of an array, it will look for the child node with the relevant information
33
- *
34
32
  * @param typeNode
35
33
  * @private
36
34
  */
37
35
  private extractTypeNode;
38
36
  /**
39
37
  * Return the list of types matching the type node. If the type is not supported, it will be replaced with an unknown entry
40
- *
41
38
  * @param type
42
39
  * @param source
43
40
  * @private
@@ -48,7 +45,6 @@ export declare class RulesEngineExtractor {
48
45
  * If it is an array, it will be -1
49
46
  * If it is an unknown type (or any), it will return 0
50
47
  * If it is any other type of object it will return 1
51
- *
52
48
  * @param type
53
49
  * @private
54
50
  */
@@ -57,7 +53,6 @@ export declare class RulesEngineExtractor {
57
53
  * Construct a metadata object that will describe the operator hand type as a list of types and a nbValue describing
58
54
  * the structure of the operand
59
55
  * nbValue reflects whether the operand support a single object (1), an array (-1), both (0) or a n-tuple (n)
60
- *
61
56
  * @param type
62
57
  * @param source
63
58
  * @param nbValue
@@ -66,7 +61,6 @@ export declare class RulesEngineExtractor {
66
61
  private extractComplexTypeData;
67
62
  /**
68
63
  * Extract facts from source code
69
- *
70
64
  * @param sourceFile path to the code source file
71
65
  * @param schemaFolderFullPath full path to the schema folder
72
66
  * @param schemaFolderRelativePath path to the schema folder from the metadata file
@@ -74,19 +68,16 @@ export declare class RulesEngineExtractor {
74
68
  extractFacts(sourceFile: string, schemaFolderFullPath: string, schemaFolderRelativePath: string): Promise<MetadataFact[]>;
75
69
  /**
76
70
  * Check if typescript type node is a native type or a list of native element
77
- *
78
71
  * @param type
79
72
  */
80
73
  isNativeType(type: ts.TypeNode): boolean;
81
74
  /**
82
75
  * Extract operators from source code
83
- *
84
76
  * @param sourceFile path to the code source file
85
77
  */
86
78
  extractOperators(sourceFile: string): MetadataOperator[];
87
79
  /**
88
80
  * Not used for the moment, kept for later updates
89
- *
90
81
  * @param sourceFile
91
82
  */
92
83
  extractActions(sourceFile: string): Action[];
@@ -1 +1 @@
1
- {"version":3,"file":"rules-engine.extractor.d.ts","sourceRoot":"","sources":["../../../../builders/rules-engine-extractor/helpers/rules-engine.extractor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AASjE,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC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c,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE;CAkDpD"}
@@ -49,11 +49,10 @@ export interface MetadataOperand {
49
49
  types: (MetadataOperatorSupportedTypes | 'unknown')[];
50
50
  /**
51
51
  * List of items supported by the operand
52
- *
53
52
  * @description
54
53
  * -1 for an array with undefined number of items
55
54
  * 1 for an non-array item
56
- **/
55
+ */
57
56
  nbValues: number;
58
57
  }
59
58
  /** Operator as specified in metadata */
@@ -1 +1 @@
1
- {"version":3,"file":"rules-engine.extractor.interfaces.d.ts","sourceRoot":"","sources":["../../../../builders/rules-engine-extractor/helpers/rules-engine.extractor.interfaces.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/F,yBAAyB;AACzB,UAAU,gBAAgB;IACxB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB;IACvB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,iCAAiC;AACjC,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,kBAAkB;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,2CAA2C;IAC3C,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,mCAAmC;AACnC,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,kBAAkB;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,kCAAkC;AAClC,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,kBAAkB;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,qBAAqB;IAErB,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAkB,SAAQ,gB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BAAwB,EAAE,8BAA8B,EAA4C,CAAC;AAElH,0CAA0C;AAC1C,eAAO,MAAM,iBAAiB,EAAE,8BAA8B,EAAsD,CAAC;AAErH,+CAA+C;AAC/C,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,KAAK,EAAE,CAAC,8BAA8B,GAAG,SAAS,CAAC,EAAE,CAAC;IACtD;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,WAAW,EAAE,eAAe,CAAC;IAC7B,sCAAsC;IACtC,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,6DAA6D;IAC7D,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAED,sCAAsC;AACtC,MAAM,WAAW,MAAM;IACrB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules-engine.extractor.interfaces.js","sourceRoot":"","sources":["../../../../builders/rules-engine-extractor/helpers/rules-engine.extractor.interfaces.ts"],"names":[],"mappings":";;;AAgDA,4GAA4G;AAC/F,QAAA,wBAAwB,GAAqC,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAElH,0CAA0C;AAC7B,QAAA,iBAAiB,GAAqC,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC"}
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RulesEngineExtractor = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const node_fs_1 = require("node:fs");
6
+ const path = tslib_1.__importStar(require("node:path"));
5
7
  const core_1 = require("@angular-devkit/core");
6
8
  const extractors_1 = require("@o3r/extractors");
7
9
  const schematics_1 = require("@o3r/schematics");
8
- const node_fs_1 = require("node:fs");
9
10
  const globby_1 = tslib_1.__importDefault(require("globby"));
10
- const path = tslib_1.__importStar(require("node:path"));
11
11
  const rxjs_1 = require("rxjs");
12
12
  const operators_1 = require("rxjs/operators");
13
13
  const ts = tslib_1.__importStar(require("typescript"));
@@ -30,21 +30,21 @@ class RulesEngineExtractor {
30
30
  this.logger = logger;
31
31
  /** Instance of the comment parser */
32
32
  this.commentParser = new extractors_1.ConfigDocParser();
33
- const { config } = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
33
+ const { config } = ts.readConfigFile(tsconfigPath, (p) => ts.sys.readFile(p));
34
34
  this.tsconfig = config;
35
35
  }
36
36
  /**
37
37
  * Extract type definition of a type reference into schema file
38
- *
39
38
  * @param type Name of the type to extract
40
39
  * @param sourceFile path to the code source file
41
40
  */
42
41
  async extractTypeRef(type, sourceFile) {
43
- const internalLibFiles = this.tsconfig.extraOptions?.otterSubModuleRefs?.length > 0 ?
44
- await (0, rxjs_1.lastValueFrom)((0, rxjs_1.zip)(...(this.tsconfig.extraOptions?.otterSubModuleRefs).map((value) => (0, globby_1.default)(value))).pipe((0, operators_1.map)((globFiles) => globFiles.reduce((acc, files) => [
42
+ const internalLibFiles = this.tsconfig.extraOptions?.otterSubModuleRefs?.length > 0
43
+ ? await (0, rxjs_1.lastValueFrom)((0, rxjs_1.zip)(...(this.tsconfig.extraOptions?.otterSubModuleRefs).map((value) => (0, globby_1.default)(value))).pipe((0, operators_1.map)((globFiles) => globFiles.reduce((acc, files) => [
45
44
  ...acc,
46
- ...files.map(f => path.resolve(f))
47
- ], [])))) : [];
45
+ ...files.map((f) => path.resolve(f))
46
+ ], []))))
47
+ : [];
48
48
  internalLibFiles.push(sourceFile);
49
49
  const program = tjs.getProgramFromFiles(internalLibFiles, this.tsconfig.compilerOptions, this.basePath);
50
50
  const settings = {
@@ -64,18 +64,16 @@ class RulesEngineExtractor {
64
64
  /**
65
65
  * Extract the type node used to generate the type metadata.
66
66
  * In the case of an array, it will look for the child node with the relevant information
67
- *
68
67
  * @param typeNode
69
68
  * @private
70
69
  */
71
70
  extractTypeNode(typeNode) {
72
- return ts.isArrayTypeNode(typeNode) ?
73
- (ts.isParenthesizedTypeNode(typeNode.elementType) ? typeNode.elementType.type : typeNode.elementType) :
74
- typeNode;
71
+ return ts.isArrayTypeNode(typeNode)
72
+ ? (ts.isParenthesizedTypeNode(typeNode.elementType) ? typeNode.elementType.type : typeNode.elementType)
73
+ : typeNode;
75
74
  }
76
75
  /**
77
76
  * Return the list of types matching the type node. If the type is not supported, it will be replaced with an unknown entry
78
- *
79
77
  * @param type
80
78
  * @param source
81
79
  * @private
@@ -103,7 +101,6 @@ class RulesEngineExtractor {
103
101
  * If it is an array, it will be -1
104
102
  * If it is an unknown type (or any), it will return 0
105
103
  * If it is any other type of object it will return 1
106
- *
107
104
  * @param type
108
105
  * @private
109
106
  */
@@ -120,7 +117,6 @@ class RulesEngineExtractor {
120
117
  * Construct a metadata object that will describe the operator hand type as a list of types and a nbValue describing
121
118
  * the structure of the operand
122
119
  * nbValue reflects whether the operand support a single object (1), an array (-1), both (0) or a n-tuple (n)
123
- *
124
120
  * @param type
125
121
  * @param source
126
122
  * @param nbValue
@@ -151,7 +147,6 @@ class RulesEngineExtractor {
151
147
  }
152
148
  /**
153
149
  * Extract facts from source code
154
- *
155
150
  * @param sourceFile path to the code source file
156
151
  * @param schemaFolderFullPath full path to the schema folder
157
152
  * @param schemaFolderRelativePath path to the schema folder from the metadata file
@@ -163,10 +158,10 @@ class RulesEngineExtractor {
163
158
  source?.forEachChild((node) => {
164
159
  if (ts.isInterfaceDeclaration(node) && node.heritageClauses?.some((clause) => clause.types.some((type) => type.getText(source) === RulesEngineExtractor.FACT_DEFINITIONS_INTERFACE))) {
165
160
  facts.push(...node.members
166
- .filter(ts.isPropertySignature)
161
+ .filter((memberNode) => ts.isPropertySignature(memberNode))
167
162
  .filter((prop) => {
168
163
  const name = prop.name.getText(source);
169
- if (RulesEngineExtractor.RESERVED_FACT_NAMES.indexOf(name) > -1) {
164
+ if (RulesEngineExtractor.RESERVED_FACT_NAMES.includes(name)) {
170
165
  this.logger.error(`Fact named "${name}" found in ${sourceFile} has a reserved name and will be ignored by the extractor, please consider renaming it.`);
171
166
  return false;
172
167
  }
@@ -175,14 +170,13 @@ class RulesEngineExtractor {
175
170
  .map(async (prop) => {
176
171
  const name = prop.name.getText(source);
177
172
  const description = this.commentParser.parseConfigDocFromNode(source, prop)?.description;
178
- // eslint-disable-next-line max-len
179
- if (!prop.type || !this.isNativeType(prop.type) && !ts.isTypeReferenceNode(prop.type) && !ts.isUnionTypeNode(prop.type)) {
173
+ if (!prop.type || (!this.isNativeType(prop.type) && !ts.isTypeReferenceNode(prop.type) && !ts.isUnionTypeNode(prop.type))) {
180
174
  throw new schematics_1.O3rCliError(`The fact ${name} has an unsupported type "${prop.type?.getText(source) || 'unknown'}" in ${sourceFile}`);
181
175
  }
182
176
  let mainType = prop.type;
183
177
  if (ts.isUnionTypeNode(mainType)) {
184
- const mainTypes = mainType.types.filter((t) => t.kind !== ts.SyntaxKind.NullKeyword && t.kind !== ts.SyntaxKind.UndefinedKeyword &&
185
- !(ts.isLiteralTypeNode(t) && (t.literal.kind === ts.SyntaxKind.NullKeyword || t.literal.kind === ts.SyntaxKind.UndefinedKeyword)));
178
+ const mainTypes = mainType.types.filter((t) => t.kind !== ts.SyntaxKind.NullKeyword && t.kind !== ts.SyntaxKind.UndefinedKeyword
179
+ && !(ts.isLiteralTypeNode(t) && (t.literal.kind === ts.SyntaxKind.NullKeyword || t.literal.kind === ts.SyntaxKind.UndefinedKeyword)));
186
180
  if (mainTypes.length !== 1) {
187
181
  throw new schematics_1.O3rCliError(`The fact ${name} has an unsupported union-type "${prop.type?.getText(source) || 'unknown'}" in ${sourceFile}`);
188
182
  }
@@ -207,7 +201,7 @@ class RulesEngineExtractor {
207
201
  await node_fs_1.promises.writeFile(path.resolve(schemaFolderFullPath, schemaFile), JSON.stringify(schema, null, 2));
208
202
  fact = {
209
203
  ...fact,
210
- schemaFile: path.join(schemaFolderRelativePath, schemaFile).replace(/[\\]/g, '/')
204
+ schemaFile: path.join(schemaFolderRelativePath, schemaFile).replace(/\\/g, '/')
211
205
  };
212
206
  }
213
207
  else if (schema.type === 'array') {
@@ -221,7 +215,7 @@ class RulesEngineExtractor {
221
215
  fact = {
222
216
  ...fact,
223
217
  type: 'string',
224
- // eslint-disable-next-line @typescript-eslint/no-base-to-string
218
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- convert non-null values to string
225
219
  enum: schema.enum?.filter((value) => !!value).map((v) => v.toString())
226
220
  };
227
221
  }
@@ -251,15 +245,13 @@ class RulesEngineExtractor {
251
245
  }
252
246
  /**
253
247
  * Check if typescript type node is a native type or a list of native element
254
- *
255
248
  * @param type
256
249
  */
257
250
  isNativeType(type) {
258
- return [ts.SyntaxKind.BooleanKeyword, ts.SyntaxKind.NumberKeyword, ts.SyntaxKind.StringKeyword].some((typeKind) => typeKind === type.kind || ts.isArrayTypeNode(type) && type.elementType.kind === typeKind);
251
+ return [ts.SyntaxKind.BooleanKeyword, ts.SyntaxKind.NumberKeyword, ts.SyntaxKind.StringKeyword].some((typeKind) => typeKind === type.kind || (ts.isArrayTypeNode(type) && type.elementType.kind === typeKind));
259
252
  }
260
253
  /**
261
254
  * Extract operators from source code
262
- *
263
255
  * @param sourceFile path to the code source file
264
256
  */
265
257
  extractOperators(sourceFile) {
@@ -269,7 +261,7 @@ class RulesEngineExtractor {
269
261
  source?.forEachChild((node) => {
270
262
  if (ts.isVariableStatement(node)) {
271
263
  const operatorDeclarations = node.declarationList.declarations.filter((declaration) => !!declaration.type && ts.isTypeReferenceNode(declaration.type) && RulesEngineExtractor.OPERATOR_DEFINITIONS_INTERFACES.includes(declaration.type.typeName.getText(source)));
272
- if (!operatorDeclarations.length) {
264
+ if (operatorDeclarations.length === 0) {
273
265
  return;
274
266
  }
275
267
  operatorDeclarations.forEach((declaration) => {
@@ -311,7 +303,7 @@ class RulesEngineExtractor {
311
303
  const typeData = this.extractComplexTypeData(typeNode, source, operandObject.nbValues);
312
304
  operandObject.nbValues = typeData.nbValue;
313
305
  operandObject.types = typeData.types;
314
- if (operandObject.types.some((type) => type !== 'unknown' && rules_engine_extractor_interfaces_1.allSupportedTypes.indexOf(type) === -1)) {
306
+ if (operandObject.types.some((type) => type !== 'unknown' && !rules_engine_extractor_interfaces_1.allSupportedTypes.includes(type))) {
315
307
  this.logger.warn(`Operator ${operator.id} has an unsupported type in operand ${operand}: "${operandObject.types.join(', ')}"`);
316
308
  operandObject.types = ['unknown'];
317
309
  }
@@ -325,7 +317,6 @@ class RulesEngineExtractor {
325
317
  }
326
318
  /**
327
319
  * Not used for the moment, kept for later updates
328
- *
329
320
  * @param sourceFile
330
321
  */
331
322
  extractActions(sourceFile) {
@@ -333,17 +324,17 @@ class RulesEngineExtractor {
333
324
  const source = program.getSourceFile(sourceFile);
334
325
  const actions = [];
335
326
  source?.forEachChild((node) => {
336
- if (ts.isClassDeclaration(node) &&
337
- node.heritageClauses?.some((nodeHeritage) => nodeHeritage.types.some((tNode) => tNode.expression.getText(source) === RulesEngineExtractor.OPERATOR_ACTIONS_INTERFACE))) {
327
+ if (ts.isClassDeclaration(node)
328
+ && node.heritageClauses?.some((nodeHeritage) => nodeHeritage.types.some((tNode) => tNode.expression.getText(source) === RulesEngineExtractor.OPERATOR_ACTIONS_INTERFACE))) {
338
329
  let parameters;
339
330
  node.heritageClauses.forEach((nodeHeritage) => {
340
331
  nodeHeritage.types
341
332
  .forEach((tNode) => {
342
333
  if (tNode.expression.getText(source) === RulesEngineExtractor.OPERATOR_ACTIONS_INTERFACE && tNode.typeArguments) {
343
334
  tNode.typeArguments
344
- .filter(ts.isTypeLiteralNode)
335
+ .filter((argNode) => ts.isTypeLiteralNode(argNode))
345
336
  .forEach((argNode) => argNode.members
346
- .filter(ts.isPropertySignature)
337
+ .filter((memberNode) => ts.isPropertySignature(memberNode))
347
338
  .forEach((memberNode) => {
348
339
  if (memberNode.name && memberNode.type) {
349
340
  parameters ||= {};
@@ -354,9 +345,9 @@ class RulesEngineExtractor {
354
345
  });
355
346
  });
356
347
  const type = node.members
357
- .filter(ts.isPropertyDeclaration)
348
+ .filter((methodNode) => ts.isPropertyDeclaration(methodNode))
358
349
  .find((methodNode) => methodNode.name.getText(source) === 'name')
359
- ?.initializer?.getText(source).replace(/^['"](.*)['"]$/, '$1');
350
+ ?.initializer?.getText(source).replace(/^["'](.*)["']$/, '$1');
360
351
  if (!type) {
361
352
  this.logger.error(`No type found for ${node.name?.getText(source) || 'unknown class'} in ${sourceFile}. It will be skipped.`);
362
353
  return;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules-engine.extractor.js","sourceRoot":"","sources":["../../../../builders/rules-engine-extractor/helpers/rules-engine.extractor.ts"],"names":[],"mappings":";;;;AAAA,qCAEiB;AACjB,wDAAkC;AAClC,+CAE8B;AAI9B,gDAEyB;AACzB,gDAEyB;AACzB,4DAA4B;AAI5B,+BAGc;AACd,8CAEwB;AACxB,uDAAiC;AACjC,oEAA8C;AAC9C,2FAY6C;AAE7C;;GAEG;AACH,MAAa,oBAAoB;IAC/B,qCAAqC;aACd,+BAA0B,GAAG,iBAAiB,AAApB,CAAqB;IACtE,0CAA0C;aACnB,oCAA+B,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,AAAhC,CAAiC;IACvF,wCAAwC;aACjB,+BAA0B,GAAG,mBAAmB,AAAtB,CAAuB;IACxE,gEAAgE;aACzC,wBAAmB,GAAsB,CAAC,aAAa,CAAC,AAArC,CAAsC;IAQhF,YAAY,YAAoB,EAAmB,QAAgB,EA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EAAE;iBACxF,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC;;AA9XH,oDA+XC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../builders/rules-engine-extractor/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAE7D,cAAc,UAAU,CAAC;;AAIzB,wBAsGI"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../builders/rules-engine-extractor/index.ts"],"names":[],"mappings":"AAwBA,OAAO,EACL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,cAAc,UAAU,CAAC;;AAIzB,wBAmGI"}
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const node_fs_1 = require("node:fs");
5
+ const node_path_1 = require("node:path");
4
6
  const architect_1 = require("@angular-devkit/architect");
5
7
  const extractors_1 = require("@o3r/extractors");
6
- const node_fs_1 = require("node:fs");
7
8
  const globby_1 = tslib_1.__importDefault(require("globby"));
8
- const node_path_1 = require("node:path");
9
9
  const helpers_1 = require("./helpers");
10
10
  tslib_1.__exportStar(require("./schema"), exports);
11
11
  const SCHEMA_FOLDER = 'fact-schemas';
@@ -18,11 +18,11 @@ exports.default = (0, architect_1.createBuilder)((0, extractors_1.createBuilderW
18
18
  const extractor = new helpers_1.RulesEngineExtractor((0, node_path_1.resolve)(context.currentDirectory, options.tsConfig), context.currentDirectory, context.logger);
19
19
  const metadataFiles = options.libraries.map((library) => (0, extractors_1.getLibraryCmsMetadata)(library, context.currentDirectory));
20
20
  const rulesEngineFactsMetadataFiles = metadataFiles
21
- .filter(metadataFile => options.ignoreFactsFromLibraries.indexOf(metadataFile.libraryName) === -1 && !!metadataFile.rulesEngineFactsFilePath)
22
- .map(metadataFile => metadataFile.rulesEngineFactsFilePath)
21
+ .filter((metadataFile) => !options.ignoreFactsFromLibraries.includes(metadataFile.libraryName) && !!metadataFile.rulesEngineFactsFilePath)
22
+ .map((metadataFile) => metadataFile.rulesEngineFactsFilePath)
23
23
  .filter((rulesEngineFactsFilePath) => !!rulesEngineFactsFilePath);
24
24
  const rulesEngineOperatorsMetadataFiles = metadataFiles
25
- .map(metadataFile => metadataFile.rulesEngineOperatorsFilePath)
25
+ .map((metadataFile) => metadataFile.rulesEngineOperatorsFilePath)
26
26
  .filter((rulesEngineOperatorsFilePath) => !!rulesEngineOperatorsFilePath);
27
27
  const rulesEngineFactsMetadataFileWithContent = {};
28
28
  for (const file of rulesEngineFactsMetadataFiles) {
@@ -54,15 +54,12 @@ exports.default = (0, architect_1.createBuilder)((0, extractors_1.createBuilderW
54
54
  try {
55
55
  await node_fs_1.promises.mkdir(schemaFolder, { recursive: true });
56
56
  }
57
- catch {
58
- }
57
+ catch { }
59
58
  // copy schema files from the libraries
60
59
  await Promise.all(Object.entries(rulesEngineFactsMetadataFileWithContent)
61
- .reduce((acc, [metadataFilePath, factsFile]) => acc.concat([
62
- ...(factsFile.facts || [])
63
- .filter((fact) => fact.type === 'object' && !!fact.schemaFile)
64
- .map(({ schemaFile }) => ({ fullPath: (0, node_path_1.resolve)((0, node_path_1.dirname)(metadataFilePath), schemaFile), relativePath: schemaFile }))
65
- ]), [])
60
+ .reduce((acc, [metadataFilePath, factsFile]) => acc.concat((factsFile.facts || [])
61
+ .filter((fact) => fact.type === 'object' && !!fact.schemaFile)
62
+ .map(({ schemaFile }) => ({ fullPath: (0, node_path_1.resolve)((0, node_path_1.dirname)(metadataFilePath), schemaFile), relativePath: schemaFile }))), [])
66
63
  .map(({ fullPath, relativePath }) => node_fs_1.promises.copyFile(fullPath, (0, node_path_1.resolve)(basePath, relativePath))));
67
64
  /** Facts from the current project */
68
65
  const newFactList = (await Promise.all((await Promise.all(options.factFilePatterns.map((pattern) => (0, globby_1.default)(pattern, { cwd: context.currentDirectory }))))
@@ -70,15 +67,13 @@ exports.default = (0, architect_1.createBuilder)((0, extractors_1.createBuilderW
70
67
  .map((file, idx, arr) => {
71
68
  context.reportProgress(idx, arr.length, `Parsing fact from ${file}`);
72
69
  return extractor.extractFacts((0, node_path_1.resolve)(context.currentDirectory, file), schemaFolder, `./${SCHEMA_FOLDER}`);
73
- }))).reduce((acc, factList) => [...acc, ...factList], []);
70
+ }))).flat();
74
71
  /** Operators from the current project */
75
- const newOperatorList = (await Promise.all(options.operatorFilePatterns.map((pattern) => (0, globby_1.default)(pattern, { cwd: context.currentDirectory }))))
76
- .reduce((acc, fileList) => ([...acc, ...fileList]), [])
77
- .map((file, idx, arr) => {
72
+ const newOperatorList = (await Promise.all(options.operatorFilePatterns.map((pattern) => (0, globby_1.default)(pattern, { cwd: context.currentDirectory })))).flat()
73
+ .flatMap((file, idx, arr) => {
78
74
  context.reportProgress(idx, arr.length, `Parsing operator from ${file}`);
79
75
  return extractor.extractOperators((0, node_path_1.resolve)(context.currentDirectory, file));
80
- })
81
- .reduce((acc, operatorList) => [...acc, ...operatorList], []);
76
+ });
82
77
  try {
83
78
  await node_fs_1.promises.mkdir((0, node_path_1.dirname)(outputFactsFile), { recursive: true });
84
79
  }
@@ -88,13 +83,13 @@ exports.default = (0, architect_1.createBuilder)((0, extractors_1.createBuilderW
88
83
  }
89
84
  catch { }
90
85
  await node_fs_1.promises.writeFile(outputFactsFile, JSON.stringify({
91
- 'facts': [
86
+ facts: [
92
87
  ...librariesFacts,
93
88
  ...newFactList
94
89
  ]
95
90
  }, null, 2));
96
91
  await node_fs_1.promises.writeFile(outputOperatorsFile, JSON.stringify({
97
- 'operators': [
92
+ operators: [
98
93
  ...librariesOperators,
99
94
  ...newOperatorList
100
95
  ]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../builders/rules-engine-extractor/index.ts"],"names":[],"mappings":";;;AAAA,qCAGiB;AACjB,yCAGmB;AACnB,yDAGmC;AACnC,gD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C;IAEjC,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAE3B,gFAAgF;IAChF,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAE/B,6DAA6D;IAC7D,wBAAwB,EAAE,MAAM,EAAE,CAAC;CACpC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../builders/rules-engine-extractor/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACX,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,iCAAkC,SAAQ,UAAU;IAEnE,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IAEjB,iCAAiC;IACjC,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB,0EAA0E;IAC1E,oBAAoB,EAAE,MAAM,CAAC;IAE7B,iFAAiF;IACjF,wBAAwB,EAAE,MAAM,CAAC;IAEjC,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAE3B,gFAAgF;IAChF,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAE/B,6DAA6D;IAC7D,wBAAwB,EAAE,MAAM,EAAE,CAAC;CACpC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../builders/rules-engine-extractor/schema.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- export * from './ruleset-history/ruleset-history-pres.module';
2
1
  export * from './ruleset-history/ruleset-history-pres.component';
2
+ export * from './ruleset-history/ruleset-history-pres.module';
3
3
  export * from './shared/index';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/rules-engine/index.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC;AAC9D,cAAc,kDAAkD,CAAC;AACjE,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/rules-engine/index.ts"],"names":[],"mappings":"AAAA,cAAc,kDAAkD,CAAC;AACjE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rule-actions-pres.component.d.ts","sourceRoot":"","sources":["../../../../src/components/rules-engine/rule-actions/rule-actions-pres.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;;AAEvD,qBAOa,wBAAwB;IAEnC;;OAEG;IAEI,OAAO,EAAE,QAAQ,EAAE,CAAM;IAEhC;;;OAGG;IAEI,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAM;IAElD;;OAEG;IAEI,cAAc,EAAE,MAAM,EAAE,CAAM;yCAnB1B,wBAAwB;2CAAxB,wBAAwB;CAoBpC"}
1
+ {"version":3,"file":"rule-actions-pres.component.d.ts","sourceRoot":"","sources":["../../../../src/components/rules-engine/rule-actions/rule-actions-pres.component.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,QAAQ,EACR,KAAK,EACN,MAAM,iBAAiB,CAAC;;AAEzB,qBAOa,wBAAwB;IACnC;;OAEG;IAEI,OAAO,EAAE,QAAQ,EAAE,CAAM;IAEhC;;;OAGG;IAEI,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAM;IAElD;;OAEG;IAEI,cAAc,EAAE,MAAM,EAAE,CAAM;yCAlB1B,wBAAwB;2CAAxB,wBAAwB;CAmBpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rule-condition-pres.component.d.ts","sourceRoot":"","sources":["../../../../src/components/rules-engine/rule-condition/rule-condition-pres.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;;AAEzB,qBAOa,0BAA0B;IAErC,OAAO,CAAC,UAAU,CAAC,CAAoB;IAEvC;;;OAGG;IACI,GAAG,SAAe;IAEzB;;;OAGG;IACI,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B;;OAEG;IACH,IACW,SAAS,CAAC,SAAS,EAAE,iBAAiB,GAAG,SAAS,EAI5D;IAED,IAAW,SAAS,IAAI,iBAAiB,GAAG,SAAS,CAEpD;IAED,OAAO,CAAC,cAAc;yCA9BX,0BAA0B;2CAA1B,0BAA0B;CAmCtC"}
1
+ {"version":3,"file":"rule-condition-pres.component.d.ts","sourceRoot":"","sources":["../../../../src/components/rules-engine/rule-condition/rule-condition-pres.component.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAIV,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;;AAEzB,qBAOa,0BAA0B;IACrC,OAAO,CAAC,UAAU,CAAC,CAAoB;IAEvC;;;OAGG;IACI,GAAG,SAAe;IAEzB;;;OAGG;IACI,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B;;OAEG;IACH,IACW,SAAS,CAAC,SAAS,EAAE,iBAAiB,GAAG,SAAS,EAI5D;IAED,IAAW,SAAS,IAAI,iBAAiB,GAAG,SAAS,CAEpD;IAED,OAAO,CAAC,cAAc;yCA7BX,0BAA0B;2CAA1B,0BAA0B;CAiCtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rule-key-value-pres.component.d.ts","sourceRoot":"","sources":["../../../../src/components/rules-engine/rule-key-value/rule-key-value-pres.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,SAAS,EAAE,aAAa,EAAoB,MAAM,eAAe,CAAC;;AAcrH,qBAOa,yBAA0B,YAAW,SAAS;IAEzD;;OAEG;IAEI,GAAG,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IAEI,KAAK,EAAG,MAAM,CAAC;IAEtB;;OAEG;IAEI,QAAQ,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IAEI,IAAI,EAAE,OAAO,GAAG,YAAY,CAAW;IAEvC,6BAA6B,UAAQ;IACrC,mCAAmC,UAAS;IAC5C,oBAAoB,UAAS;IAE7B,gCAAgC,UAAQ;IACxC,sCAAsC,UAAS;IAC/C,uBAAuB,UAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAuB;IACpD,iBAAiB,qCAEtB;IAEF,OAAO,CAAC,2BAA2B;IAI5B,WAAW,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAC,EAAE,aAAa;IAWtC,eAAe,CAAC,OAAO,EAAE,MAAM;yCAxDjC,yBAAyB;2CAAzB,yBAAyB;CA4DrC"}
1
+ {"version":3,"file":"rule-key-value-pres.component.d.ts","sourceRoot":"","sources":["../../../../src/components/rules-engine/rule-key-value/rule-key-value-pres.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EACT,aAAa,EAEd,MAAM,eAAe,CAAC;;AAqBvB,qBAOa,yBAA0B,YAAW,SAAS;IACzD;;OAEG;IAEI,GAAG,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IAEI,KAAK,EAAG,MAAM,CAAC;IAEtB;;OAEG;IAEI,QAAQ,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IAEI,IAAI,EAAE,OAAO,GAAG,YAAY,CAAW;IAEvC,6BAA6B,UAAQ;IACrC,mCAAmC,UAAS;IAC5C,oBAAoB,UAAS;IAE7B,gCAAgC,UAAQ;IACxC,sCAAsC,UAAS;IAC/C,uBAAuB,UAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAuB;IACpD,iBAAiB,qCAEtB;IAEF,OAAO,CAAC,2BAA2B;IAI5B,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,aAAa;IAWxC,eAAe,CAAC,OAAO,EAAE,MAAM;yCAvDjC,yBAAyB;2CAAzB,yBAAyB;CA2DrC"}