@o3r/rules-engine 10.0.0-next.9 → 11.0.0-next.0
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.
- package/README.md +16 -17
- package/builders/rules-engine-extractor/helpers/rules-engine.extractor.d.ts +1 -1
- package/builders/rules-engine-extractor/helpers/rules-engine.extractor.d.ts.map +1 -1
- package/builders/rules-engine-extractor/helpers/rules-engine.extractor.interfaces.d.ts +2 -0
- package/builders/rules-engine-extractor/helpers/rules-engine.extractor.interfaces.d.ts.map +1 -1
- package/builders/rules-engine-extractor/helpers/rules-engine.extractor.js +10 -2
- package/builders/rules-engine-extractor/helpers/rules-engine.extractor.js.map +1 -1
- package/builders/rules-engine-extractor/index.js.map +1 -1
- package/builders/rules-engine-extractor/schema.json +1 -1
- package/components/rules-engine/rule-condition/rule-condition-pres.component.d.ts +2 -2
- package/components/rules-engine/rule-condition/rule-condition-pres.component.d.ts.map +1 -1
- package/components/rules-engine/rule-key-value/rule-key-value-pres.component.d.ts +1 -1
- package/components/rules-engine/rule-key-value/rule-key-value-pres.component.d.ts.map +1 -1
- package/components/rules-engine/ruleset-history/ruleset-history-pres.component.d.ts +1 -3
- package/components/rules-engine/ruleset-history/ruleset-history-pres.component.d.ts.map +1 -1
- package/components/rules-engine/shared/ruleset-history.helper.d.ts +0 -2
- package/components/rules-engine/shared/ruleset-history.helper.d.ts.map +1 -1
- package/devkit/rules-engine-devtools.console.service.d.ts +0 -7
- package/devkit/rules-engine-devtools.console.service.d.ts.map +1 -1
- package/devkit/rules-engine-devtools.message.service.d.ts +4 -6
- package/devkit/rules-engine-devtools.message.service.d.ts.map +1 -1
- package/devkit/rules-engine-devtools.module.d.ts +0 -1
- package/devkit/rules-engine-devtools.module.d.ts.map +1 -1
- package/devkit/rules-engine-devtools.service.d.ts +3 -10
- package/devkit/rules-engine-devtools.service.d.ts.map +1 -1
- package/engine/debug/engine.debug.d.ts +4 -12
- package/engine/debug/engine.debug.d.ts.map +1 -1
- package/engine/debug/helpers.d.ts +2 -4
- package/engine/debug/helpers.d.ts.map +1 -1
- package/engine/engine.d.ts +4 -13
- package/engine/engine.d.ts.map +1 -1
- package/engine/engine.interface.d.ts +2 -6
- package/engine/engine.interface.d.ts.map +1 -1
- package/engine/fact/fact.interfaces.d.ts +2 -0
- package/engine/fact/fact.interfaces.d.ts.map +1 -1
- package/engine/helpers/filter-ruleset-event.operator.d.ts +0 -1
- package/engine/helpers/filter-ruleset-event.operator.d.ts.map +1 -1
- package/engine/operator/operator.helpers.d.ts +10 -9
- package/engine/operator/operator.helpers.d.ts.map +1 -1
- package/engine/operator/operator.interface.d.ts +4 -1
- package/engine/operator/operator.interface.d.ts.map +1 -1
- package/engine/operator/operators/array-based.operators.d.ts +0 -23
- package/engine/operator/operators/array-based.operators.d.ts.map +1 -1
- package/engine/operator/operators/basic.operators.d.ts +5 -8
- package/engine/operator/operators/basic.operators.d.ts.map +1 -1
- package/engine/operator/operators/date-based.operators.d.ts +13 -6
- package/engine/operator/operators/date-based.operators.d.ts.map +1 -1
- package/engine/operator/operators/index.d.ts +1 -1
- package/engine/operator/operators/index.d.ts.map +1 -1
- package/engine/operator/operators/number-based.operators.d.ts +0 -4
- package/engine/operator/operators/number-based.operators.d.ts.map +1 -1
- package/engine/rule/rule.helpers.d.ts +0 -7
- package/engine/rule/rule.helpers.d.ts.map +1 -1
- package/engine/ruleset-executor.d.ts +15 -13
- package/engine/ruleset-executor.d.ts.map +1 -1
- package/engine/structure.d.ts +9 -5
- package/engine/structure.d.ts.map +1 -1
- package/esm2022/components/rules-engine/rule-actions/rule-actions-pres.component.mjs +4 -4
- package/esm2022/components/rules-engine/rule-condition/rule-condition-pres.component.mjs +8 -13
- package/esm2022/components/rules-engine/rule-key-value/rule-key-value-pres.component.mjs +5 -5
- package/esm2022/components/rules-engine/rule-tree/rule-tree-pres.component.mjs +5 -5
- package/esm2022/components/rules-engine/ruleset-history/ruleset-history-pres.component.mjs +6 -8
- package/esm2022/components/rules-engine/ruleset-history/ruleset-history-pres.module.mjs +4 -4
- package/esm2022/components/rules-engine/shared/fallback-to.pipe.mjs +3 -3
- package/esm2022/components/rules-engine/shared/ruleset-history.helper.mjs +1 -3
- package/esm2022/devkit/rules-engine-devtools.console.service.mjs +6 -13
- package/esm2022/devkit/rules-engine-devtools.message.service.mjs +6 -8
- package/esm2022/devkit/rules-engine-devtools.module.mjs +5 -6
- package/esm2022/devkit/rules-engine-devtools.service.mjs +7 -14
- package/esm2022/engine/debug/engine.debug.mjs +2 -10
- package/esm2022/engine/debug/helpers.mjs +1 -4
- package/esm2022/engine/engine.interface.mjs +1 -1
- package/esm2022/engine/engine.mjs +1 -9
- package/esm2022/engine/fact/fact.interfaces.mjs +1 -1
- package/esm2022/engine/helpers/filter-ruleset-event.operator.mjs +1 -2
- package/esm2022/engine/operator/index.mjs +1 -1
- package/esm2022/engine/operator/operator.helpers.mjs +33 -13
- package/esm2022/engine/operator/operator.interface.mjs +1 -1
- package/esm2022/engine/operator/operators/array-based.operators.mjs +6 -29
- package/esm2022/engine/operator/operators/basic.operators.mjs +16 -11
- package/esm2022/engine/operator/operators/date-based.operators.mjs +48 -8
- package/esm2022/engine/operator/operators/number-based.operators.mjs +1 -5
- package/esm2022/engine/rule/rule.helpers.mjs +1 -8
- package/esm2022/engine/ruleset-executor.mjs +58 -32
- package/esm2022/engine/structure.mjs +1 -1
- package/esm2022/fact/fact.abstract-service.mjs +1 -1
- package/esm2022/facts/current-time/current-time.facts.mjs +2 -0
- package/esm2022/facts/current-time/index.mjs +2 -0
- package/esm2022/facts/index.mjs +2 -0
- package/esm2022/fixtures/jasmine/index.mjs +2 -2
- package/esm2022/fixtures/jasmine/rules-engine.runner.service.fixture.jasmine.mjs +14 -0
- package/esm2022/fixtures/jest/index.mjs +2 -2
- package/esm2022/fixtures/jest/rules-engine.runner.service.fixture.jest.mjs +14 -0
- package/esm2022/interfaces/action.interfaces.mjs +1 -1
- package/esm2022/public_api.mjs +2 -1
- package/esm2022/services/index.mjs +2 -3
- package/esm2022/services/rules-engine.token.mjs +2 -1
- package/esm2022/services/runner/index.mjs +3 -0
- package/esm2022/services/runner/rules-engine.runner.module.mjs +37 -0
- package/esm2022/services/runner/rules-engine.runner.service.mjs +119 -0
- package/esm2022/stores/rulesets/rulesets.effect.mjs +4 -4
- package/esm2022/stores/rulesets/rulesets.module.mjs +4 -4
- package/esm2022/stores/rulesets/rulesets.selectors.mjs +3 -4
- package/fact/fact.abstract-service.d.ts +3 -3
- package/fact/fact.abstract-service.d.ts.map +1 -1
- package/facts/current-time/current-time.facts.d.ts +11 -0
- package/facts/current-time/current-time.facts.d.ts.map +1 -0
- package/facts/current-time/index.d.ts +2 -0
- package/facts/current-time/index.d.ts.map +1 -0
- package/facts/index.d.ts +2 -0
- package/facts/index.d.ts.map +1 -0
- package/fesm2022/o3r-rules-engine-fixtures-jasmine.mjs +3 -6
- package/fesm2022/o3r-rules-engine-fixtures-jasmine.mjs.map +1 -1
- package/fesm2022/o3r-rules-engine-fixtures-jest.mjs +3 -6
- package/fesm2022/o3r-rules-engine-fixtures-jest.mjs.map +1 -1
- package/fesm2022/o3r-rules-engine.mjs +264 -560
- package/fesm2022/o3r-rules-engine.mjs.map +1 -1
- package/fixtures/jasmine/index.d.ts +1 -1
- package/fixtures/jasmine/index.d.ts.map +1 -1
- package/fixtures/jasmine/rules-engine.runner.service.fixture.jasmine.d.ts +14 -0
- package/fixtures/jasmine/rules-engine.runner.service.fixture.jasmine.d.ts.map +1 -0
- package/fixtures/jest/index.d.ts +1 -1
- package/fixtures/jest/index.d.ts.map +1 -1
- package/fixtures/jest/index.js +1 -1
- package/fixtures/jest/index.js.map +1 -1
- package/fixtures/jest/rules-engine.runner.service.fixture.jest.d.ts +14 -0
- package/fixtures/jest/rules-engine.runner.service.fixture.jest.d.ts.map +1 -0
- package/fixtures/jest/{rules-engine.service.fixture.jest.js → rules-engine.runner.service.fixture.jest.js} +3 -6
- package/fixtures/jest/rules-engine.runner.service.fixture.jest.js.map +1 -0
- package/interfaces/action.interfaces.d.ts +5 -0
- package/interfaces/action.interfaces.d.ts.map +1 -1
- package/migration.json +10 -0
- package/package.json +57 -46
- package/public_api.d.ts +1 -0
- package/public_api.d.ts.map +1 -1
- package/rules.facts.metadata.json +7 -1
- package/rules.operators.metadata.json +61 -0
- package/schemas/rulesets.schema.json +6 -110
- package/schematics/cms-adapter/index.d.ts +0 -1
- package/schematics/cms-adapter/index.d.ts.map +1 -1
- package/schematics/cms-adapter/index.js +5 -9
- package/schematics/cms-adapter/index.js.map +1 -1
- package/schematics/facts-service/schema.json +1 -1
- package/schematics/ng-add/helpers/devtools-registration.d.ts +11 -0
- package/schematics/ng-add/helpers/devtools-registration.d.ts.map +1 -0
- package/schematics/ng-add/helpers/devtools-registration.js +36 -0
- package/schematics/ng-add/helpers/devtools-registration.js.map +1 -0
- package/schematics/ng-add/index.d.ts +1 -0
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +8 -4
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/schema.json +1 -1
- package/schematics/ng-update/index.d.ts +6 -0
- package/schematics/ng-update/index.d.ts.map +1 -0
- package/schematics/ng-update/index.js +22 -0
- package/schematics/ng-update/index.js.map +1 -0
- package/schematics/ng-update/v10.0/action-module-split.d.ts +6 -0
- package/schematics/ng-update/v10.0/action-module-split.d.ts.map +1 -0
- package/schematics/ng-update/v10.0/action-module-split.js +21 -0
- package/schematics/ng-update/v10.0/action-module-split.js.map +1 -0
- package/schematics/operator/schema.json +1 -1
- package/schematics/rules-engine-to-component/index.d.ts +0 -1
- package/schematics/rules-engine-to-component/index.d.ts.map +1 -1
- package/schematics/rules-engine-to-component/index.js +7 -8
- package/schematics/rules-engine-to-component/index.js.map +1 -1
- package/schematics/rules-engine-to-component/schema.json +1 -1
- package/services/index.d.ts +1 -2
- package/services/index.d.ts.map +1 -1
- package/services/rules-engine.token.d.ts +1 -0
- package/services/rules-engine.token.d.ts.map +1 -1
- package/services/runner/index.d.ts +3 -0
- package/services/runner/index.d.ts.map +1 -0
- package/services/runner/rules-engine.runner.module.d.ts +13 -0
- package/services/runner/rules-engine.runner.module.d.ts.map +1 -0
- package/services/runner/rules-engine.runner.service.d.ts +60 -0
- package/services/runner/rules-engine.runner.service.d.ts.map +1 -0
- package/stores/rulesets/rulesets.selectors.d.ts.map +1 -1
- package/builders/package.json +0 -3
- package/esm2022/fixtures/jasmine/rules-engine.service.fixture.jasmine.mjs +0 -17
- package/esm2022/fixtures/jest/rules-engine.service.fixture.jest.mjs +0 -17
- package/esm2022/services/rules-engine.effect.mjs +0 -162
- package/esm2022/services/rules-engine.module.mjs +0 -50
- package/esm2022/services/rules-engine.service.mjs +0 -272
- package/fixtures/jasmine/rules-engine.service.fixture.jasmine.d.ts +0 -17
- package/fixtures/jasmine/rules-engine.service.fixture.jasmine.d.ts.map +0 -1
- package/fixtures/jest/rules-engine.service.fixture.jest.d.ts +0 -18
- package/fixtures/jest/rules-engine.service.fixture.jest.d.ts.map +0 -1
- package/fixtures/jest/rules-engine.service.fixture.jest.js.map +0 -1
- package/schematics/package.json +0 -3
- package/services/rules-engine.effect.d.ts +0 -53
- package/services/rules-engine.effect.d.ts.map +0 -1
- package/services/rules-engine.module.d.ts +0 -16
- package/services/rules-engine.module.d.ts.map +0 -1
- package/services/rules-engine.service.d.ts +0 -90
- package/services/rules-engine.service.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.debug.d.ts","sourceRoot":"","sources":["../../../src/engine/debug/engine.debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,MAAM,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAwB,UAAU,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"engine.debug.d.ts","sourceRoot":"","sources":["../../../src/engine/debug/engine.debug.ts"],"names":[],"mapp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EAAE,OAAO;;;;;;IAiBlB;;;OAGG;IACI,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE;IAU/C;;;;OAIG;IACI,oBAAoB,CAAC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,mBAAmB,CAAC,EAAE,MAAM,EAAE;IAc/G;;;OAGG;IACI,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE;IAK9C;;;;;;;;;;OAUG;IACI,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EACxE,iBAAiB,EAAE,MAAM,EAAE,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACtG,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,EAAE,eAAe,EAAE,cAAc,EAAE;IAMtG;;;;;;;;;OASG;IACI,6BAA6B,CAClC,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAE,MAAM,EAAE,EAC3B,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACxC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,EACjE,eAAe,EAAE,cAAc,EAAE;IAMnC;;;OAGG;IACU,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE;kBACxB,MAAM;eAAS,GAAG;;CAS7C"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EvaluationReason,
|
|
1
|
+
import { EvaluationReason, RuleEvaluation, RuleEvaluationOutput } from '../engine.interface';
|
|
2
|
+
import type { Facts } from '../fact';
|
|
2
3
|
import { ActionBlock, Rule } from '../structure';
|
|
3
4
|
/**
|
|
4
5
|
* Function to retrive from 2 sequential executions only the triggers which activated the last ruleset execution
|
|
5
|
-
*
|
|
6
6
|
* @param currRes Current ruleset execution object
|
|
7
7
|
* @param prevRes Previous ruleset execution object
|
|
8
8
|
* @returns The triggers list which activates the last ruleset execution
|
|
@@ -10,7 +10,6 @@ import { ActionBlock, Rule } from '../structure';
|
|
|
10
10
|
export declare function retrieveRulesetTriggers(currRes: RuleEvaluationOutput[], prevRes: RuleEvaluationOutput[] | undefined): Record<string, Record<string, EvaluationReason>>;
|
|
11
11
|
/**
|
|
12
12
|
* Flag as cached the rules evaluations which are from previous ruleset executions
|
|
13
|
-
*
|
|
14
13
|
* @param rulesEvaluations all rules evaluations list
|
|
15
14
|
* @param triggers Ruleset triggers object
|
|
16
15
|
* @returns Rules evaluation list with flagged rules evaluation from previous ruleset executions
|
|
@@ -20,7 +19,6 @@ export declare function flagCachedRules(rulesEvaluations: RuleEvaluation[], trig
|
|
|
20
19
|
})[];
|
|
21
20
|
/**
|
|
22
21
|
* Create the debug rule evaluation object
|
|
23
|
-
*
|
|
24
22
|
* @param rule
|
|
25
23
|
* @param rulesetName
|
|
26
24
|
* @param outputActions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/engine/debug/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/engine/debug/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,GAAG,SAAS,oDAsCnH;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,GAAG,CAAC,cAAc,GAAG;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAC,CAAC,EAAE,CASvK;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,WAAW,EAAE,GAAG,SAAS,EACxC,WAAW,EAAE,GAAG,EAChB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACxC,UAAU,EAAE,GAAG,EAAE,GAAG,SAAS,EAC7B,aAAa,EAAE,GAAG,EAAE,GAAG,SAAS,kBA8BjC"}
|
package/engine/engine.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import type { Logger } from '@o3r/logger';
|
|
1
2
|
import { Observable } from 'rxjs';
|
|
2
3
|
import { EngineDebugger } from './debug/engine.debug';
|
|
3
|
-
import {
|
|
4
|
-
import { Fact } from './fact/index';
|
|
4
|
+
import { RulesEngineOptions } from './engine.interface';
|
|
5
|
+
import type { Fact, Facts } from './fact/index';
|
|
5
6
|
import { Operator, UnaryOperator } from './operator/index';
|
|
6
7
|
import { ActionBlock, Ruleset } from './structure';
|
|
7
|
-
import type { Logger } from '@o3r/logger';
|
|
8
8
|
/** Rules engine */
|
|
9
9
|
export declare class RulesEngine {
|
|
10
10
|
/** Map of registered fact stream, this map is mutated by the ruleset executors */
|
|
11
|
-
private factMap;
|
|
11
|
+
private readonly factMap;
|
|
12
12
|
/** Subject containing the rulesets and the results stream*/
|
|
13
13
|
private readonly rulesetMapSubject;
|
|
14
14
|
/** Map of available operators */
|
|
@@ -25,7 +25,6 @@ export declare class RulesEngine {
|
|
|
25
25
|
readonly rulesEngineInstanceName: string;
|
|
26
26
|
/**
|
|
27
27
|
* Performance reporter to use for performance measurements.
|
|
28
|
-
*
|
|
29
28
|
* @default window.performance on browser only, undefined on node
|
|
30
29
|
*/
|
|
31
30
|
readonly performance: import("./engine.interface").CrossPlatformPerformance | undefined;
|
|
@@ -39,27 +38,23 @@ export declare class RulesEngine {
|
|
|
39
38
|
get debugMode(): boolean;
|
|
40
39
|
/**
|
|
41
40
|
* Rules engine
|
|
42
|
-
*
|
|
43
41
|
* @param options rules engine options
|
|
44
42
|
* @param logger
|
|
45
43
|
*/
|
|
46
44
|
constructor(options?: RulesEngineOptions);
|
|
47
45
|
/**
|
|
48
46
|
* Attach debug events to actions stream if debug engine is activated
|
|
49
|
-
*
|
|
50
47
|
* @param actionsStream
|
|
51
48
|
*/
|
|
52
49
|
private handleActionsStreamOutput;
|
|
53
50
|
/**
|
|
54
51
|
* Create the actions stream event based on provided active rulesets ids; Handle debug too
|
|
55
|
-
*
|
|
56
52
|
* @param ruleSets
|
|
57
53
|
*/
|
|
58
54
|
private prepareActionsStream;
|
|
59
55
|
/**
|
|
60
56
|
* Create or retrieve a fact stream
|
|
61
57
|
* The fact stream created will be registered in the engine
|
|
62
|
-
*
|
|
63
58
|
* @param id ID of the fact to retrieve
|
|
64
59
|
* @param factValue$ Value stream for the fact
|
|
65
60
|
*/
|
|
@@ -67,26 +62,22 @@ export declare class RulesEngine {
|
|
|
67
62
|
/**
|
|
68
63
|
* Retrieve the promise of the latest value of a fact.
|
|
69
64
|
* Return undefined if the fact is not defined.
|
|
70
|
-
*
|
|
71
65
|
* @param id ID of the fact to retrieve
|
|
72
66
|
*/
|
|
73
67
|
retrieveFactValue<T = unknown>(id: string): Promise<T | undefined> | undefined;
|
|
74
68
|
/**
|
|
75
69
|
* Update or insert fact in rules engine
|
|
76
|
-
*
|
|
77
70
|
* @param facts fact list to add / update
|
|
78
71
|
*/
|
|
79
72
|
upsertFacts<T = unknown>(facts: Fact<T> | Fact<T>[]): void;
|
|
80
73
|
/**
|
|
81
74
|
* Update or insert rule in rules engine
|
|
82
|
-
*
|
|
83
75
|
* @param rules rule list to add / update
|
|
84
76
|
* @param rulesets
|
|
85
77
|
*/
|
|
86
78
|
upsertRulesets(rulesets: Ruleset[]): void;
|
|
87
79
|
/**
|
|
88
80
|
* Update or insert operator in rules engine
|
|
89
|
-
*
|
|
90
81
|
* @param operators operator list to add / update
|
|
91
82
|
*/
|
|
92
83
|
upsertOperators(operators: (Operator | UnaryOperator)[]): void;
|
package/engine/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/engine/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,UAAU,EAAM,MAAM,MAAM,CAAC;AAE9E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAc,
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/engine/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAA0C,UAAU,EAAM,MAAM,MAAM,CAAC;AAE9E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAc,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAgB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEnD,mBAAmB;AACnB,qBAAa,WAAW;IAEtB,kFAAkF;IAClF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;IAE/D,4DAA4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA4D;IAE9F,iCAAiC;IAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,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AM,EAAE,GAAG,SAAS,CAAC,KAAK,UAAU,CAAC,CAAC,EAAE,CAAC;IAQjI,6CAA6C;IACtC,uBAAuB;CAI/B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Logger } from '@o3r/core';
|
|
2
2
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
3
|
import type { EngineDebugger } from './debug/engine.debug';
|
|
4
|
-
import { Fact } from './fact';
|
|
5
|
-
import { Operator } from './operator';
|
|
4
|
+
import type { Fact, Facts } from './fact';
|
|
5
|
+
import type { Operator } from './operator';
|
|
6
6
|
import { ActionBlock, Rule, Ruleset } from './structure';
|
|
7
7
|
/** Performance object supporting NodeJs Performance and Web Performance reporting */
|
|
8
8
|
export type CrossPlatformPerformance = {
|
|
@@ -18,8 +18,6 @@ export interface FactObject<T> {
|
|
|
18
18
|
/** Stream of the fact value */
|
|
19
19
|
value$: Observable<T | undefined>;
|
|
20
20
|
}
|
|
21
|
-
/** Represents all the supported facts types TOCHECK utils.Date vs Date */
|
|
22
|
-
export type Facts = string | number | boolean | null | Date | Record<string, unknown> | unknown[];
|
|
23
21
|
/** Rule Engine constructor options */
|
|
24
22
|
export interface RulesEngineOptions {
|
|
25
23
|
/** List of facts */
|
|
@@ -41,13 +39,11 @@ export interface RulesEngineOptions {
|
|
|
41
39
|
debugger?: EngineDebugger;
|
|
42
40
|
/**
|
|
43
41
|
* Instance of the performance reporter to use for performance measurements.
|
|
44
|
-
*
|
|
45
42
|
* @default window.performance on browser only, undefined on node
|
|
46
43
|
*/
|
|
47
44
|
performance?: CrossPlatformPerformance;
|
|
48
45
|
/**
|
|
49
46
|
* Name of the rules engine instance
|
|
50
|
-
*
|
|
51
47
|
* @default RulesEngine
|
|
52
48
|
*/
|
|
53
49
|
rulesEngineInstanceName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.interface.d.ts","sourceRoot":"","sources":["../../src/engine/engine.interface.ts"],"names":[],"mappings":"AAAA,O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,4EAA4E;AAC5E,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,iBAAiB;IACjB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,+BAA+B;IAC/B,iBAAiB,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CACnD;AAED,2DAA2D;AAC3D,MAAM,MAAM,UAAU,GAAG,qBAAqB,GAAG,0BAA0B,GAAG,mBAAmB,GAAG,eAAe,GAAG,iBAAiB,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
/** Represents all the supported facts types TOCHECK utils.Date vs Date */
|
|
3
|
+
export type Facts = string | number | boolean | null | Date | Record<string, unknown> | unknown[];
|
|
2
4
|
/** Fact basic value type */
|
|
3
5
|
export type FactBasicValues = number | boolean | string | string[] | boolean[] | number[] | undefined;
|
|
4
6
|
/** Map of fact name / type pairs */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fact.interfaces.d.ts","sourceRoot":"","sources":["../../../src/engine/fact/fact.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,4BAA4B;AAC5B,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,EAAG,GAAG,SAAS,CAAC;AAEvG,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAED,oCAAoC;AACpC,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAElE,mBAAmB;AACnB,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,eAAe,IAAI;KAC9C,CAAC,IAAI,MAAM,CAAC,GAA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CAC3D,CAAC;AAEF,uBAAuB;AACvB,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;AAErE,kBAAkB;AAClB,MAAM,WAAW,IAAI,CAAC,CAAC,GAAG,OAAO;IAC/B,cAAc;IACd,EAAE,EAAE,MAAM,CAAC;IAEX,oCAAoC;IACpC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC5B"}
|
|
@@ -2,7 +2,6 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { RulesetExecutor } from '../ruleset-executor';
|
|
3
3
|
/**
|
|
4
4
|
* Filter the actions outputted by the rules engine, based on active rulesets
|
|
5
|
-
*
|
|
6
5
|
* @param restrictiveRuleSets list of rules sets to get the event stream for
|
|
7
6
|
*/
|
|
8
7
|
export declare function filterRulesetsEventStream(restrictiveRuleSets?: string[]): (source$: Observable<Record<string, RulesetExecutor>>) => Observable<import("@o3r/rules-engine").ActionBlock[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-ruleset-event.operator.d.ts","sourceRoot":"","sources":["../../../src/engine/helpers/filter-ruleset-event.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"filter-ruleset-event.operator.d.ts","sourceRoot":"","sources":["../../../src/engine/helpers/filter-ruleset-event.operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,aACrD,WAAW,OAAO,MAAM,EAAE,eAAe,CAAC,CAAC,2DAe7D"}
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
import { DateInput, Operator, SupportedSimpleTypes } from './operator.interface';
|
|
2
|
+
import type { Facts } from '../fact';
|
|
2
3
|
/**
|
|
3
4
|
* Execute Operator
|
|
4
|
-
*
|
|
5
5
|
* @param lhs Left hand side
|
|
6
6
|
* @param rhs Right hand side
|
|
7
7
|
* @param operator Operator to compare values
|
|
8
|
+
* @param operatorFacts Facts that operator can depend on
|
|
8
9
|
*/
|
|
9
|
-
export declare function executeOperator<L = unknown, R = unknown>(lhs: L, rhs: R, operator: Operator<L, R>): boolean;
|
|
10
|
+
export declare function executeOperator<L = unknown, R = unknown>(lhs: L, rhs: R, operator: Operator<L, R>, operatorFacts?: Record<string, Facts | undefined>): boolean;
|
|
10
11
|
/**
|
|
11
12
|
* Validate a number operand
|
|
12
|
-
*
|
|
13
13
|
* @param operand value of one of the operands
|
|
14
14
|
*/
|
|
15
15
|
export declare function numberValidator(operand: unknown): operand is number | string;
|
|
16
16
|
/**
|
|
17
17
|
* Validate an operand is a range of numbers
|
|
18
|
-
*
|
|
19
18
|
* @param operatorInput value of one of the operands
|
|
20
19
|
*/
|
|
21
20
|
export declare function isRangeNumber(operatorInput: unknown): operatorInput is [number | string, number | string];
|
|
22
21
|
/**
|
|
23
22
|
* Verifies if the parameter is a valid date for the operator (getTime function available returning a number)
|
|
24
|
-
*
|
|
25
23
|
* @param operatorInput
|
|
26
24
|
*/
|
|
27
25
|
export declare const isValidDate: (operatorInput: any) => operatorInput is Date;
|
|
28
26
|
/**
|
|
29
27
|
* Verifies if the parameter is a valid input for Date constructor (new Date returns a valid date)
|
|
30
|
-
*
|
|
31
28
|
* @param operatorInput
|
|
32
29
|
*/
|
|
33
30
|
export declare const isValidDateInput: (operatorInput: any) => operatorInput is DateInput;
|
|
34
31
|
/**
|
|
35
32
|
* Verifies if the parameter is a valid date range
|
|
36
|
-
*
|
|
37
33
|
* @param operatorInput
|
|
38
34
|
*/
|
|
39
35
|
export declare const isValidDateRange: (operatorInput: any) => operatorInput is [DateInput, DateInput];
|
|
40
36
|
/**
|
|
41
37
|
* Validate that a value is a supported simple type
|
|
42
|
-
*
|
|
43
38
|
* @param value value to validate
|
|
44
39
|
*/
|
|
45
40
|
export declare function isSupportedSimpleTypes(value: unknown): value is SupportedSimpleTypes;
|
|
46
41
|
/**
|
|
47
42
|
* Validate that a value is a string
|
|
48
|
-
*
|
|
49
43
|
* @param value
|
|
50
44
|
*/
|
|
51
45
|
export declare function isString(value: unknown): value is string;
|
|
46
|
+
/**
|
|
47
|
+
* Parse input to return RegExp
|
|
48
|
+
* @param value value to test whether pattern exists (can be string or array of strings)
|
|
49
|
+
* @param inputString regexp pattern
|
|
50
|
+
* @param inputRegExp
|
|
51
|
+
*/
|
|
52
|
+
export declare function parseRegExp(inputRegExp: string): RegExp;
|
|
52
53
|
//# sourceMappingURL=operator.helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.helpers.d.ts","sourceRoot":"","sources":["../../../src/engine/operator/operator.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"operator.helpers.d.ts","sourceRoot":"","sources":["../../../src/engine/operator/operator.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAC/E,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAEnC;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,SAAS,CAAC,WAsBpJ;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,MAAM,GAAG,MAAM,CAG5E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,aAAa,EAAE,OAAO,GAAG,aAAa,IAAI,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAMzG;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,kBAAmB,GAAG,0BAM7C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,kBAAmB,GAAG,+BAElD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,kBAAmB,GAAG,4CAMlD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAEpF;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,UAQ9C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Facts } from '../fact/fact.interfaces';
|
|
1
2
|
/**
|
|
2
3
|
* Rule Engine operator
|
|
3
4
|
*/
|
|
@@ -11,7 +12,9 @@ export interface Operator<LeftExposed = unknown, RightExposed = unknown, LeftSup
|
|
|
11
12
|
/** Right Hand Value validator function */
|
|
12
13
|
validateRhs?: unknown extends RightSupported ? (operand: unknown) => boolean : (operand: unknown) => operand is RightSupported;
|
|
13
14
|
/** Evaluate the values */
|
|
14
|
-
evaluator: (lhs: LeftSupported, rhs: RightSupported) => boolean;
|
|
15
|
+
evaluator: (lhs: LeftSupported, rhs: RightSupported, operatorFactValues?: Record<string, Facts>) => boolean;
|
|
16
|
+
/** List of facts names that the operator can depend on */
|
|
17
|
+
factImplicitDependencies?: string[];
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
20
|
* Rule Engine unary operator
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.interface.d.ts","sourceRoot":"","sources":["../../../src/engine/operator/operator.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,QAAQ,CAAC,WAAW,GAAG,OAAO,EAAE,YAAY,GAAG,OAAO,EAAE,aAAa,GAAG,WAAW,EAAE,cAAc,GAAG,YAAY;IACjI,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,SAAS,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,IAAI,aAAa,CAAC;IAC7H,0CAA0C;IAC1C,WAAW,CAAC,EAAE,OAAO,SAAS,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,IAAI,cAAc,CAAC;IAC/H,0BAA0B;IAC1B,SAAS,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"operator.interface.d.ts","sourceRoot":"","sources":["../../../src/engine/operator/operator.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,QAAQ,CAAC,WAAW,GAAG,OAAO,EAAE,YAAY,GAAG,OAAO,EAAE,aAAa,GAAG,WAAW,EAAE,cAAc,GAAG,YAAY;IACjI,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,SAAS,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,IAAI,aAAa,CAAC;IAC7H,0CAA0C;IAC1C,WAAW,CAAC,EAAE,OAAO,SAAS,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,IAAI,cAAc,CAAC;IAC/H,0BAA0B;IAC1B,SAAS,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,cAAc,EAAE,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,OAAO,CAAC;IAC5G,0DAA0D;IAC1D,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO;IACxC,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,IAAI,CAAC,CAAC;IACrG,0BAA0B;IAC1B,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -1,139 +1,116 @@
|
|
|
1
1
|
import { Operator, SupportedSimpleTypes } from '../operator.interface';
|
|
2
2
|
/**
|
|
3
3
|
* Check if any of the variable's value is equal to a specific value
|
|
4
|
-
*
|
|
5
4
|
* @title contains
|
|
6
5
|
*/
|
|
7
6
|
export declare const arrayContains: Operator<SupportedSimpleTypes[], SupportedSimpleTypes>;
|
|
8
7
|
/**
|
|
9
8
|
* Check if the specified text value is included in the text variable
|
|
10
|
-
*
|
|
11
9
|
* @title contains
|
|
12
10
|
*/
|
|
13
11
|
export declare const stringContains: Operator<string, string>;
|
|
14
12
|
/**
|
|
15
13
|
* Check if every value of the variable is different from a specific value
|
|
16
|
-
*
|
|
17
14
|
* @title does not contain
|
|
18
15
|
*/
|
|
19
16
|
export declare const notArrayContains: Operator<SupportedSimpleTypes[], SupportedSimpleTypes>;
|
|
20
17
|
/**
|
|
21
18
|
* Check if the specified text value is not included in the text variable
|
|
22
|
-
*
|
|
23
19
|
* @title does not contain
|
|
24
20
|
*/
|
|
25
21
|
export declare const notStringContains: Operator<string, string>;
|
|
26
22
|
/**
|
|
27
23
|
* Check if every value of the variable equals a specific value
|
|
28
|
-
*
|
|
29
24
|
* @title all equal to
|
|
30
25
|
*/
|
|
31
26
|
export declare const allEqual: Operator<SupportedSimpleTypes[], SupportedSimpleTypes>;
|
|
32
27
|
/**
|
|
33
28
|
* Check if every numerical value of the variable is greater than a specific value
|
|
34
|
-
*
|
|
35
29
|
* @title all >
|
|
36
30
|
*/
|
|
37
31
|
export declare const allGreater: Operator<SupportedSimpleTypes[], number | string>;
|
|
38
32
|
/**
|
|
39
33
|
* Check if every value of the variable is in a specific list
|
|
40
|
-
*
|
|
41
34
|
* @title all in
|
|
42
35
|
*/
|
|
43
36
|
export declare const allIn: Operator<SupportedSimpleTypes[], SupportedSimpleTypes[]>;
|
|
44
37
|
/**
|
|
45
38
|
* Check if every value of the variable is not in a specific list
|
|
46
|
-
*
|
|
47
39
|
* @title none in
|
|
48
40
|
*/
|
|
49
41
|
export declare const allNotIn: Operator<SupportedSimpleTypes[], SupportedSimpleTypes[]>;
|
|
50
42
|
/**
|
|
51
43
|
* Check if every numerical value of the variable is lower than a specific value
|
|
52
|
-
*
|
|
53
44
|
* @title all <
|
|
54
45
|
*/
|
|
55
46
|
export declare const allLower: Operator<number[], number | string>;
|
|
56
47
|
/**
|
|
57
48
|
* Check if every string value of the variable matches a specific pattern
|
|
58
|
-
*
|
|
59
49
|
* @title all match
|
|
60
50
|
*/
|
|
61
51
|
export declare const allMatch: Operator<string[], string>;
|
|
62
52
|
/**
|
|
63
53
|
* Check if every value of the variable is included in a specified range
|
|
64
|
-
*
|
|
65
54
|
* @title all between
|
|
66
55
|
*/
|
|
67
56
|
export declare const allRangeNumber: Operator<number[], [number | string, number | string]>;
|
|
68
57
|
/**
|
|
69
58
|
* Check if at least one of the values of the variable equals a specific value
|
|
70
|
-
*
|
|
71
59
|
* @title one equal to
|
|
72
60
|
*/
|
|
73
61
|
export declare const oneEquals: Operator<SupportedSimpleTypes[], SupportedSimpleTypes>;
|
|
74
62
|
/**
|
|
75
63
|
* Check if one of the values of the variable is greater than a specific value
|
|
76
|
-
*
|
|
77
64
|
* @title one >
|
|
78
65
|
*/
|
|
79
66
|
export declare const oneGreater: Operator<number[], number | string>;
|
|
80
67
|
/**
|
|
81
68
|
* Check if at least one of the values of the variable is equal to one in a specified list
|
|
82
|
-
*
|
|
83
69
|
* @title one in
|
|
84
70
|
*/
|
|
85
71
|
export declare const oneIn: Operator<SupportedSimpleTypes[], SupportedSimpleTypes[]>;
|
|
86
72
|
/**
|
|
87
73
|
* Check if one of the values of the variable is lower than a specific value
|
|
88
|
-
*
|
|
89
74
|
* @title one <
|
|
90
75
|
*/
|
|
91
76
|
export declare const oneLower: Operator<number[], number | string>;
|
|
92
77
|
/**
|
|
93
78
|
* Check if one of the values of the variable matches a specific pattern
|
|
94
|
-
*
|
|
95
79
|
* @title one matches
|
|
96
80
|
*/
|
|
97
81
|
export declare const oneMatches: Operator<string[], string>;
|
|
98
82
|
/**
|
|
99
83
|
* Check if one of the values of the variable is included in a specified range
|
|
100
|
-
*
|
|
101
84
|
* @title one between
|
|
102
85
|
*/
|
|
103
86
|
export declare const oneRangeNumber: Operator<number[], [number | string, number | string]>;
|
|
104
87
|
/**
|
|
105
88
|
* Check if the number of values of the variable is equal to a specific value
|
|
106
|
-
*
|
|
107
89
|
* @title number of =
|
|
108
90
|
*/
|
|
109
91
|
export declare const lengthEquals: Operator<any[], number | string>;
|
|
110
92
|
/**
|
|
111
93
|
* Check if the number of values of the variable is different from a specific value
|
|
112
|
-
*
|
|
113
94
|
* @title number of ≠
|
|
114
95
|
*/
|
|
115
96
|
export declare const lengthNotEquals: Operator<any[], number | string>;
|
|
116
97
|
/**
|
|
117
98
|
* Check if the number of values of the variable is lower or equal to a specific value
|
|
118
|
-
*
|
|
119
99
|
* @title number of ≤
|
|
120
100
|
*/
|
|
121
101
|
export declare const lengthLessThanOrEquals: Operator<any[], number | string>;
|
|
122
102
|
/**
|
|
123
103
|
* Check if the number of values of the variable is lower than a specific value
|
|
124
|
-
*
|
|
125
104
|
* @title number of <
|
|
126
105
|
*/
|
|
127
106
|
export declare const lengthLessThan: Operator<any[], number | string>;
|
|
128
107
|
/**
|
|
129
108
|
* Check if the number of values of the variable is greater or equal to a specific value
|
|
130
|
-
*
|
|
131
109
|
* @title number of ≥
|
|
132
110
|
*/
|
|
133
111
|
export declare const lengthGreaterThanOrEquals: Operator<any[], number | string>;
|
|
134
112
|
/**
|
|
135
113
|
* Check if the number of values of the variable is greater than a specific value
|
|
136
|
-
*
|
|
137
114
|
* @title number of >
|
|
138
115
|
*/
|
|
139
116
|
export declare const lengthGreaterThan: Operator<any[], number | string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-based.operators.d.ts","sourceRoot":"","sources":["../../../../src/engine/operator/operators/array-based.operators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEvE
|
|
1
|
+
{"version":3,"file":"array-based.operators.d.ts","sourceRoot":"","sources":["../../../../src/engine/operator/operators/array-based.operators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEvE;;;G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AmB,+mBAwB/B,CAAC"}
|
|
@@ -1,52 +1,49 @@
|
|
|
1
1
|
import { Operator, SupportedSimpleTypes, UnaryOperator } from '../operator.interface';
|
|
2
2
|
/**
|
|
3
3
|
* Check if a variable is equal to a specific value
|
|
4
|
-
*
|
|
5
4
|
* @title is equal to
|
|
6
5
|
*/
|
|
7
6
|
export declare const equals: Operator;
|
|
8
7
|
/**
|
|
9
8
|
* Check if a variable is different from a specific value
|
|
10
|
-
*
|
|
11
9
|
* @title is not equal to
|
|
12
10
|
*/
|
|
13
11
|
export declare const notEquals: Operator;
|
|
14
12
|
/**
|
|
15
13
|
* Check if the variable's value is included in a specified list
|
|
16
|
-
*
|
|
17
14
|
* @title is in
|
|
18
15
|
*/
|
|
19
16
|
export declare const inArray: Operator<SupportedSimpleTypes, SupportedSimpleTypes[]>;
|
|
20
17
|
/**
|
|
21
18
|
* Check if the variable's value is not included in the value list
|
|
22
|
-
*
|
|
23
19
|
* @title is not in
|
|
24
20
|
*/
|
|
25
21
|
export declare const notInArray: Operator<SupportedSimpleTypes, SupportedSimpleTypes[]>;
|
|
26
22
|
/**
|
|
27
23
|
* Check if the text variable is part of the specified value
|
|
28
|
-
*
|
|
29
24
|
* @title within
|
|
30
25
|
*/
|
|
31
26
|
export declare const inString: Operator<string, string>;
|
|
32
27
|
/**
|
|
33
28
|
* Check if the text variable is not part of the specified value
|
|
34
|
-
*
|
|
35
29
|
* @title not within
|
|
36
30
|
*/
|
|
37
31
|
export declare const notInString: Operator<string, string>;
|
|
38
32
|
/**
|
|
39
33
|
* Check if the variable and its value are defined
|
|
40
|
-
*
|
|
41
34
|
* @title is defined
|
|
42
35
|
*/
|
|
43
36
|
export declare const isDefined: UnaryOperator<any>;
|
|
44
37
|
/**
|
|
45
38
|
* Check if the variable and its value are undefined
|
|
46
|
-
*
|
|
47
39
|
* @title is not defined
|
|
48
40
|
*/
|
|
49
41
|
export declare const isUndefined: UnaryOperator<any>;
|
|
42
|
+
/**
|
|
43
|
+
* Check if the text variable matches the specified RegExp pattern
|
|
44
|
+
* @title matches the pattern
|
|
45
|
+
*/
|
|
46
|
+
export declare const matchesPattern: Operator<string, string>;
|
|
50
47
|
/** List of all default basic operators */
|
|
51
48
|
export declare const basicOperators: (Operator<string, string, string, string> | Operator<unknown, unknown, unknown, unknown> | Operator<SupportedSimpleTypes, SupportedSimpleTypes[], SupportedSimpleTypes, SupportedSimpleTypes[]> | UnaryOperator<any>)[];
|
|
52
49
|
//# sourceMappingURL=basic.operators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic.operators.d.ts","sourceRoot":"","sources":["../../../../src/engine/operator/operators/basic.operators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtF
|
|
1
|
+
{"version":3,"file":"basic.operators.d.ts","sourceRoot":"","sources":["../../../../src/engine/operator/operators/basic.operators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,QAIpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,QAIvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,CAK1E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,CAK7E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAK7C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAKhD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,aAAa,CAAC,GAAG,CAGxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,GAAG,CAG1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAQnD,CAAC;AAEF,0CAA0C;AAC1C,eAAO,MAAM,cAAc,yNAE1B,CAAC"}
|
|
@@ -1,33 +1,40 @@
|
|
|
1
1
|
import { DateInput, Operator } from '../operator.interface';
|
|
2
2
|
/**
|
|
3
3
|
* Check if a date variable is in a specified date range
|
|
4
|
-
*
|
|
5
4
|
* @title is between
|
|
6
5
|
*/
|
|
7
6
|
export declare const inRangeDate: Operator<Date, [DateInput, DateInput], DateInput>;
|
|
7
|
+
/**
|
|
8
|
+
* Check if the value of the variable is in the next x minutes
|
|
9
|
+
* @title is in next minutes
|
|
10
|
+
* @returns false for dates before `now` and for dates after `now` + `nextMinutes`, true for dates between `now` and `now` + `nextMinutes`
|
|
11
|
+
*/
|
|
12
|
+
export declare const dateInNextMinutes: Operator<Date, string | number, DateInput>;
|
|
13
|
+
/**
|
|
14
|
+
* Check if the value of the variable is not in the next x minutes
|
|
15
|
+
* @title is not in next minutes
|
|
16
|
+
* @returns false for dates before `now` and for dates between `now` and `now` + `nextMinutes`, true for dates after `now` + `nextMinutes`
|
|
17
|
+
*/
|
|
18
|
+
export declare const dateNotInNextMinutes: Operator<Date, string | number, DateInput>;
|
|
8
19
|
/**
|
|
9
20
|
* Check if a date variable is prior than a specified date
|
|
10
|
-
*
|
|
11
21
|
* @title is before
|
|
12
22
|
*/
|
|
13
23
|
export declare const dateBefore: Operator<Date, DateInput, DateInput>;
|
|
14
24
|
/**
|
|
15
25
|
* Check if a date variable is posterior than a specified date
|
|
16
|
-
*
|
|
17
26
|
* @title is after
|
|
18
27
|
*/
|
|
19
28
|
export declare const dateAfter: Operator<Date, DateInput, DateInput>;
|
|
20
29
|
/**
|
|
21
30
|
* Check if a date variable is the same as a specified date
|
|
22
|
-
*
|
|
23
31
|
* @title is equal to
|
|
24
32
|
*/
|
|
25
33
|
export declare const dateEquals: Operator<Date, DateInput, DateInput>;
|
|
26
34
|
/**
|
|
27
35
|
* Check if a date variable is different from a specified date
|
|
28
|
-
*
|
|
29
36
|
* @title is not equal
|
|
30
37
|
*/
|
|
31
38
|
export declare const dateNotEquals: Operator<Date, DateInput, DateInput>;
|
|
32
|
-
export declare const dateBasedOperators: (Operator<Date, [DateInput, DateInput], DateInput, [DateInput, DateInput]> | Operator<Date, DateInput, DateInput, DateInput>)[];
|
|
39
|
+
export declare const dateBasedOperators: (Operator<Date, [DateInput, DateInput], DateInput, [DateInput, DateInput]> | Operator<Date, string | number, DateInput, string | number> | Operator<Date, DateInput, DateInput, DateInput>)[];
|
|
33
40
|
//# sourceMappingURL=date-based.operators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-based.operators.d.ts","sourceRoot":"","sources":["../../../../src/engine/operator/operators/date-based.operators.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"date-based.operators.d.ts","sourceRoot":"","sources":["../../../../src/engine/operator/operators/date-based.operators.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,SAAS,CAQzE,CAAC;AAGF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,CAexE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,CAkB3E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAS3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAS1D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAS3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAS9D,CAAC;AAEF,eAAO,MAAM,kBAAkB,+LAE9B,CAAC"}
|
|
@@ -2,5 +2,5 @@ export * from './array-based.operators';
|
|
|
2
2
|
export * from './basic.operators';
|
|
3
3
|
export * from './number-based.operators';
|
|
4
4
|
export * from './date-based.operators';
|
|
5
|
-
export declare const operatorList: (import("@o3r/rules-engine").Operator<import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes, import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes> | import("@o3r/rules-engine").Operator<string, string, string, string> | import("@o3r/rules-engine").Operator<import("@o3r/rules-engine").SupportedSimpleTypes[], string | number, import("@o3r/rules-engine").SupportedSimpleTypes[], string | number> | import("@o3r/rules-engine").Operator<import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes[]> | import("@o3r/rules-engine").Operator<number[], string | number, number[], string | number> | import("@o3r/rules-engine").Operator<string[], string, string[], string> | import("@o3r/rules-engine").Operator<number[], [string | number, string | number], number[], [string | number, string | number]> | import("@o3r/rules-engine").Operator<any[], string | number, any[], string | number> | import("@o3r/rules-engine").Operator<unknown, unknown, unknown, unknown> | import("@o3r/rules-engine").Operator<import("@o3r/rules-engine").SupportedSimpleTypes, import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes, import("@o3r/rules-engine").SupportedSimpleTypes[]> | import("@o3r/rules-engine").UnaryOperator<any> | import("@o3r/rules-engine").Operator<number, string | number, string | number, string | number> | import("@o3r/rules-engine").Operator<Date, [import("@o3r/rules-engine").DateInput, import("@o3r/rules-engine").DateInput], import("@o3r/rules-engine").DateInput, [import("@o3r/rules-engine").DateInput, import("@o3r/rules-engine").DateInput]> | import("@o3r/rules-engine").Operator<Date, import("@o3r/rules-engine").DateInput, import("@o3r/rules-engine").DateInput, import("@o3r/rules-engine").DateInput>)[];
|
|
5
|
+
export declare const operatorList: (import("@o3r/rules-engine").Operator<import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes, import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes> | import("@o3r/rules-engine").Operator<string, string, string, string> | import("@o3r/rules-engine").Operator<import("@o3r/rules-engine").SupportedSimpleTypes[], string | number, import("@o3r/rules-engine").SupportedSimpleTypes[], string | number> | import("@o3r/rules-engine").Operator<import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes[]> | import("@o3r/rules-engine").Operator<number[], string | number, number[], string | number> | import("@o3r/rules-engine").Operator<string[], string, string[], string> | import("@o3r/rules-engine").Operator<number[], [string | number, string | number], number[], [string | number, string | number]> | import("@o3r/rules-engine").Operator<any[], string | number, any[], string | number> | import("@o3r/rules-engine").Operator<unknown, unknown, unknown, unknown> | import("@o3r/rules-engine").Operator<import("@o3r/rules-engine").SupportedSimpleTypes, import("@o3r/rules-engine").SupportedSimpleTypes[], import("@o3r/rules-engine").SupportedSimpleTypes, import("@o3r/rules-engine").SupportedSimpleTypes[]> | import("@o3r/rules-engine").UnaryOperator<any> | import("@o3r/rules-engine").Operator<number, string | number, string | number, string | number> | import("@o3r/rules-engine").Operator<Date, [import("@o3r/rules-engine").DateInput, import("@o3r/rules-engine").DateInput], import("@o3r/rules-engine").DateInput, [import("@o3r/rules-engine").DateInput, import("@o3r/rules-engine").DateInput]> | import("@o3r/rules-engine").Operator<Date, string | number, import("@o3r/rules-engine").DateInput, string | number> | import("@o3r/rules-engine").Operator<Date, import("@o3r/rules-engine").DateInput, import("@o3r/rules-engine").DateInput, import("@o3r/rules-engine").DateInput>)[];
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/engine/operator/operators/index.ts"],"names":[],"mappings":"AAKA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AAEvC,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/engine/operator/operators/index.ts"],"names":[],"mappings":"AAKA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AAEvC,eAAO,MAAM,YAAY,okEAA8F,CAAC"}
|