@splitsoftware/splitio-commons 1.13.2-rc.0 → 1.13.2-rc.10
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/CHANGES.txt +4 -3
- package/cjs/evaluator/Engine.js +5 -6
- package/cjs/evaluator/combiners/ifelseif.js +3 -4
- package/cjs/evaluator/condition/index.js +2 -3
- package/cjs/evaluator/index.js +4 -5
- package/cjs/evaluator/matchers/all.js +1 -3
- package/cjs/evaluator/matchers/between.js +1 -3
- package/cjs/evaluator/matchers/boolean.js +1 -3
- package/cjs/evaluator/matchers/cont_all.js +1 -3
- package/cjs/evaluator/matchers/cont_any.js +1 -3
- package/cjs/evaluator/matchers/cont_str.js +1 -3
- package/cjs/evaluator/matchers/dependency.js +1 -1
- package/cjs/evaluator/matchers/eq.js +1 -3
- package/cjs/evaluator/matchers/eq_set.js +1 -3
- package/cjs/evaluator/matchers/ew.js +1 -3
- package/cjs/evaluator/matchers/gte.js +3 -5
- package/cjs/evaluator/matchers/index.js +12 -2
- package/cjs/evaluator/matchers/lte.js +3 -5
- package/cjs/evaluator/matchers/matcherTypes.js +6 -1
- package/cjs/evaluator/matchers/part_of.js +1 -3
- package/cjs/evaluator/matchers/segment.js +1 -6
- package/cjs/evaluator/matchers/semver_between.js +14 -0
- package/cjs/evaluator/matchers/semver_eq.js +13 -0
- package/cjs/evaluator/matchers/semver_gte.js +13 -0
- package/cjs/evaluator/matchers/semver_inlist.js +17 -0
- package/cjs/evaluator/matchers/semver_lte.js +13 -0
- package/cjs/evaluator/matchers/string.js +3 -12
- package/cjs/evaluator/matchers/sw.js +1 -3
- package/cjs/evaluator/matchers/whitelist.js +3 -4
- package/cjs/evaluator/matchersTransform/index.js +21 -16
- package/cjs/evaluator/matchersTransform/whitelist.js +2 -3
- package/cjs/evaluator/parser/index.js +24 -9
- package/cjs/logger/constants.js +5 -20
- package/cjs/logger/index.js +8 -1
- package/cjs/logger/messages/debug.js +5 -21
- package/cjs/logger/messages/error.js +2 -1
- package/cjs/logger/messages/warn.js +1 -1
- package/cjs/sdkClient/sdkClient.js +1 -6
- package/cjs/services/splitApi.js +5 -5
- package/cjs/storages/KeyBuilder.js +2 -1
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +1 -1
- package/cjs/storages/pluggable/index.js +1 -1
- package/cjs/utils/Semver.js +103 -0
- package/cjs/utils/constants/index.js +2 -1
- package/cjs/utils/labels/index.js +1 -1
- package/cjs/utils/settingsValidation/index.js +1 -1
- package/cjs/utils/settingsValidation/logger/pluggableLogger.js +1 -1
- package/esm/evaluator/Engine.js +5 -5
- package/esm/evaluator/combiners/ifelseif.js +3 -3
- package/esm/evaluator/condition/index.js +2 -2
- package/esm/evaluator/index.js +4 -4
- package/esm/evaluator/matchers/all.js +1 -3
- package/esm/evaluator/matchers/between.js +1 -3
- package/esm/evaluator/matchers/boolean.js +1 -3
- package/esm/evaluator/matchers/cont_all.js +1 -3
- package/esm/evaluator/matchers/cont_any.js +1 -3
- package/esm/evaluator/matchers/cont_str.js +1 -3
- package/esm/evaluator/matchers/dependency.js +1 -1
- package/esm/evaluator/matchers/eq.js +1 -3
- package/esm/evaluator/matchers/eq_set.js +1 -3
- package/esm/evaluator/matchers/ew.js +1 -3
- package/esm/evaluator/matchers/gte.js +3 -5
- package/esm/evaluator/matchers/index.js +12 -2
- package/esm/evaluator/matchers/lte.js +3 -5
- package/esm/evaluator/matchers/matcherTypes.js +6 -1
- package/esm/evaluator/matchers/part_of.js +1 -3
- package/esm/evaluator/matchers/segment.js +1 -6
- package/esm/evaluator/matchers/semver_between.js +10 -0
- package/esm/evaluator/matchers/semver_eq.js +9 -0
- package/esm/evaluator/matchers/semver_gte.js +9 -0
- package/esm/evaluator/matchers/semver_inlist.js +13 -0
- package/esm/evaluator/matchers/semver_lte.js +9 -0
- package/esm/evaluator/matchers/string.js +3 -12
- package/esm/evaluator/matchers/sw.js +1 -3
- package/esm/evaluator/matchers/whitelist.js +4 -5
- package/esm/evaluator/matchersTransform/index.js +21 -16
- package/esm/evaluator/matchersTransform/whitelist.js +2 -3
- package/esm/evaluator/parser/index.js +24 -9
- package/esm/logger/constants.js +2 -17
- package/esm/logger/index.js +9 -2
- package/esm/logger/messages/debug.js +5 -21
- package/esm/logger/messages/error.js +2 -1
- package/esm/logger/messages/warn.js +1 -1
- package/esm/sdkClient/sdkClient.js +1 -6
- package/esm/services/splitApi.js +6 -6
- package/esm/storages/KeyBuilder.js +2 -1
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +1 -1
- package/esm/storages/pluggable/index.js +1 -1
- package/esm/utils/Semver.js +100 -0
- package/esm/utils/constants/index.js +1 -0
- package/esm/utils/labels/index.js +1 -1
- package/esm/utils/settingsValidation/index.js +1 -1
- package/esm/utils/settingsValidation/logger/pluggableLogger.js +1 -1
- package/package.json +1 -2
- package/src/dtos/types.ts +34 -1
- package/src/evaluator/Engine.ts +5 -6
- package/src/evaluator/combiners/ifelseif.ts +3 -3
- package/src/evaluator/condition/index.ts +2 -2
- package/src/evaluator/index.ts +4 -4
- package/src/evaluator/matchers/all.ts +1 -5
- package/src/evaluator/matchers/between.ts +3 -7
- package/src/evaluator/matchers/boolean.ts +2 -6
- package/src/evaluator/matchers/cont_all.ts +1 -5
- package/src/evaluator/matchers/cont_any.ts +1 -5
- package/src/evaluator/matchers/cont_str.ts +2 -6
- package/src/evaluator/matchers/dependency.ts +1 -1
- package/src/evaluator/matchers/eq.ts +2 -6
- package/src/evaluator/matchers/eq_set.ts +1 -5
- package/src/evaluator/matchers/ew.ts +2 -6
- package/src/evaluator/matchers/gte.ts +3 -7
- package/src/evaluator/matchers/index.ts +29 -19
- package/src/evaluator/matchers/lte.ts +3 -7
- package/src/evaluator/matchers/matcherTypes.ts +6 -1
- package/src/evaluator/matchers/part_of.ts +1 -5
- package/src/evaluator/matchers/segment.ts +1 -8
- package/src/evaluator/matchers/semver_between.ts +15 -0
- package/src/evaluator/matchers/semver_eq.ts +13 -0
- package/src/evaluator/matchers/semver_gte.ts +13 -0
- package/src/evaluator/matchers/semver_inlist.ts +17 -0
- package/src/evaluator/matchers/semver_lte.ts +13 -0
- package/src/evaluator/matchers/string.ts +3 -16
- package/src/evaluator/matchers/sw.ts +2 -6
- package/src/evaluator/matchers/whitelist.ts +5 -7
- package/src/evaluator/matchersTransform/index.ts +31 -23
- package/src/evaluator/matchersTransform/whitelist.ts +4 -5
- package/src/evaluator/parser/index.ts +25 -10
- package/src/evaluator/types.ts +3 -3
- package/src/logger/constants.ts +2 -17
- package/src/logger/index.ts +8 -2
- package/src/logger/messages/debug.ts +5 -21
- package/src/logger/messages/error.ts +2 -1
- package/src/logger/messages/warn.ts +1 -1
- package/src/sdkClient/sdkClient.ts +1 -8
- package/src/services/splitApi.ts +5 -6
- package/src/storages/KeyBuilder.ts +2 -1
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +1 -1
- package/src/storages/pluggable/index.ts +1 -1
- package/src/types.ts +3 -3
- package/src/utils/Semver.ts +111 -0
- package/src/utils/constants/index.ts +2 -0
- package/src/utils/labels/index.ts +1 -1
- package/src/utils/settingsValidation/index.ts +1 -1
- package/src/utils/settingsValidation/logger/pluggableLogger.ts +1 -1
- package/types/dtos/types.d.ts +26 -1
- package/types/evaluator/matchers/all.d.ts +1 -2
- package/types/evaluator/matchers/between.d.ts +1 -2
- package/types/evaluator/matchers/boolean.d.ts +1 -2
- package/types/evaluator/matchers/cont_all.d.ts +1 -2
- package/types/evaluator/matchers/cont_any.d.ts +1 -2
- package/types/evaluator/matchers/cont_str.d.ts +1 -2
- package/types/evaluator/matchers/dependency.d.ts +1 -1
- package/types/evaluator/matchers/eq.d.ts +1 -2
- package/types/evaluator/matchers/eq_set.d.ts +1 -2
- package/types/evaluator/matchers/ew.d.ts +1 -2
- package/types/evaluator/matchers/gte.d.ts +1 -2
- package/types/evaluator/matchers/lte.d.ts +1 -2
- package/types/evaluator/matchers/part_of.d.ts +1 -2
- package/types/evaluator/matchers/segment.d.ts +1 -2
- package/types/evaluator/matchers/sember_inlist.d.ts +3 -0
- package/types/evaluator/matchers/semver_between.d.ts +2 -0
- package/types/evaluator/matchers/semver_eq.d.ts +1 -0
- package/types/evaluator/matchers/semver_gte.d.ts +1 -0
- package/types/evaluator/matchers/semver_inlist.d.ts +1 -0
- package/types/evaluator/matchers/semver_lte.d.ts +1 -0
- package/types/evaluator/matchers/string.d.ts +1 -2
- package/types/evaluator/matchers/sw.d.ts +1 -2
- package/types/evaluator/matchers/whitelist.d.ts +1 -3
- package/types/evaluator/matchersTransform/set.d.ts +2 -2
- package/types/evaluator/matchersTransform/string.d.ts +7 -0
- package/types/evaluator/matchersTransform/whitelist.d.ts +3 -3
- package/types/evaluator/types.d.ts +3 -3
- package/types/logger/constants.d.ts +2 -17
- package/types/types.d.ts +3 -3
- package/types/utils/constants/index.d.ts +1 -0
- package/types/utils/labels/index.d.ts +1 -1
- package/types/utils/semVer.d.ts +15 -0
- package/types/utils/settingsValidation/logger/globalLogLevel.d.ts +8 -0
- package/cjs/evaluator/matchersTransform/set.js +0 -10
- package/esm/evaluator/matchersTransform/set.js +0 -6
- package/src/evaluator/matchersTransform/set.ts +0 -8
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { ENGINE_MATCHER_ENDS_WITH } from '../../logger/constants';
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
1
|
import { endsWith } from '../../utils/lang';
|
|
4
2
|
|
|
5
|
-
export function endsWithMatcherContext(
|
|
3
|
+
export function endsWithMatcherContext(ruleAttr: string[]) {
|
|
6
4
|
return function endsWithMatcher(runtimeAttr: string): boolean {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
log.debug(ENGINE_MATCHER_ENDS_WITH, [runtimeAttr, ruleAttr, strEndsWith]);
|
|
5
|
+
const strEndsWith = ruleAttr.some(e => endsWith(runtimeAttr, e));
|
|
10
6
|
|
|
11
7
|
return strEndsWith;
|
|
12
8
|
};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
1
|
+
export function greaterThanEqualMatcherContext(ruleAttr: number) {
|
|
3
2
|
|
|
4
|
-
export function greaterThanEqualMatcherContext(log: ILogger, ruleAttr: number) /*: Function */ {
|
|
5
3
|
return function greaterThanEqualMatcher(runtimeAttr: number): boolean {
|
|
6
|
-
|
|
4
|
+
const isGreaterThanEqual = runtimeAttr >= ruleAttr;
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return isGreaterEqualThan;
|
|
6
|
+
return isGreaterThanEqual;
|
|
11
7
|
};
|
|
12
8
|
}
|
|
@@ -15,29 +15,39 @@ import { containsStringMatcherContext } from './cont_str';
|
|
|
15
15
|
import { dependencyMatcherContext } from './dependency';
|
|
16
16
|
import { booleanMatcherContext } from './boolean';
|
|
17
17
|
import { stringMatcherContext } from './string';
|
|
18
|
+
import { equalToSemverMatcherContext } from './semver_eq';
|
|
19
|
+
import { greaterThanEqualToSemverMatcherContext } from './semver_gte';
|
|
20
|
+
import { lessThanEqualToSemverMatcherContext } from './semver_lte';
|
|
21
|
+
import { betweenSemverMatcherContext } from './semver_between';
|
|
22
|
+
import { inListSemverMatcherContext } from './semver_inlist';
|
|
18
23
|
import { IStorageAsync, IStorageSync } from '../../storages/types';
|
|
19
24
|
import { IMatcher, IMatcherDto } from '../types';
|
|
20
25
|
import { ILogger } from '../../logger/types';
|
|
21
26
|
|
|
22
27
|
const matchers = [
|
|
23
|
-
undefined, // UNDEFINED: 0
|
|
24
|
-
allMatcherContext, // ALL_KEYS: 1
|
|
25
|
-
segmentMatcherContext, // IN_SEGMENT: 2
|
|
26
|
-
whitelistMatcherContext, // WHITELIST: 3
|
|
27
|
-
equalToMatcherContext, // EQUAL_TO: 4
|
|
28
|
-
greaterThanEqualMatcherContext, // GREATER_THAN_OR_EQUAL_TO: 5
|
|
29
|
-
lessThanEqualMatcherContext, // LESS_THAN_OR_EQUAL_TO: 6
|
|
30
|
-
betweenMatcherContext, // BETWEEN: 7
|
|
31
|
-
equalToSetMatcherContext, // EQUAL_TO_SET: 8
|
|
32
|
-
containsAnySetMatcherContext, // CONTAINS_ANY_OF_SET: 9
|
|
33
|
-
containsAllSetMatcherContext, // CONTAINS_ALL_OF_SET: 10
|
|
34
|
-
partOfSetMatcherContext, // PART_OF_SET: 11
|
|
35
|
-
endsWithMatcherContext, // ENDS_WITH: 12
|
|
36
|
-
startsWithMatcherContext, // STARTS_WITH: 13
|
|
37
|
-
containsStringMatcherContext, // CONTAINS_STRING: 14
|
|
38
|
-
dependencyMatcherContext, // IN_SPLIT_TREATMENT: 15
|
|
39
|
-
booleanMatcherContext, // EQUAL_TO_BOOLEAN: 16
|
|
40
|
-
stringMatcherContext // MATCHES_STRING: 17
|
|
28
|
+
undefined, // UNDEFINED: 0
|
|
29
|
+
allMatcherContext, // ALL_KEYS: 1
|
|
30
|
+
segmentMatcherContext, // IN_SEGMENT: 2
|
|
31
|
+
whitelistMatcherContext, // WHITELIST: 3
|
|
32
|
+
equalToMatcherContext, // EQUAL_TO: 4
|
|
33
|
+
greaterThanEqualMatcherContext, // GREATER_THAN_OR_EQUAL_TO: 5
|
|
34
|
+
lessThanEqualMatcherContext, // LESS_THAN_OR_EQUAL_TO: 6
|
|
35
|
+
betweenMatcherContext, // BETWEEN: 7
|
|
36
|
+
equalToSetMatcherContext, // EQUAL_TO_SET: 8
|
|
37
|
+
containsAnySetMatcherContext, // CONTAINS_ANY_OF_SET: 9
|
|
38
|
+
containsAllSetMatcherContext, // CONTAINS_ALL_OF_SET: 10
|
|
39
|
+
partOfSetMatcherContext, // PART_OF_SET: 11
|
|
40
|
+
endsWithMatcherContext, // ENDS_WITH: 12
|
|
41
|
+
startsWithMatcherContext, // STARTS_WITH: 13
|
|
42
|
+
containsStringMatcherContext, // CONTAINS_STRING: 14
|
|
43
|
+
dependencyMatcherContext, // IN_SPLIT_TREATMENT: 15
|
|
44
|
+
booleanMatcherContext, // EQUAL_TO_BOOLEAN: 16
|
|
45
|
+
stringMatcherContext, // MATCHES_STRING: 17
|
|
46
|
+
equalToSemverMatcherContext, // EQUAL_TO_SEMVER: 18
|
|
47
|
+
greaterThanEqualToSemverMatcherContext, // GREATER_THAN_OR_EQUAL_TO_SEMVER: 19
|
|
48
|
+
lessThanEqualToSemverMatcherContext, // LESS_THAN_OR_EQUAL_TO_SEMVER: 20
|
|
49
|
+
betweenSemverMatcherContext, // BETWEEN_SEMVER: 21
|
|
50
|
+
inListSemverMatcherContext, // IN_LIST_SEMVER: 22
|
|
41
51
|
];
|
|
42
52
|
|
|
43
53
|
/**
|
|
@@ -51,6 +61,6 @@ export function matcherFactory(log: ILogger, matcherDto: IMatcherDto, storage?:
|
|
|
51
61
|
|
|
52
62
|
let matcherFn;
|
|
53
63
|
// @ts-ignore
|
|
54
|
-
if (matchers[type]) matcherFn = matchers[type](
|
|
64
|
+
if (matchers[type]) matcherFn = matchers[type](value, storage, log); // There is no index-out-of-bound exception in JavaScript
|
|
55
65
|
return matcherFn;
|
|
56
66
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
1
|
+
export function lessThanEqualMatcherContext(ruleAttr: number) {
|
|
3
2
|
|
|
4
|
-
export function lessThanEqualMatcherContext(log: ILogger, ruleAttr: number) /*: function */ {
|
|
5
3
|
return function lessThanEqualMatcher(runtimeAttr: number): boolean {
|
|
6
|
-
|
|
4
|
+
const isLessThanEqual = runtimeAttr <= ruleAttr;
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return isLessEqualThan;
|
|
6
|
+
return isLessThanEqual;
|
|
11
7
|
};
|
|
12
8
|
}
|
|
@@ -16,7 +16,12 @@ export const matcherTypes: Record<string, number> = {
|
|
|
16
16
|
CONTAINS_STRING: 14,
|
|
17
17
|
IN_SPLIT_TREATMENT: 15,
|
|
18
18
|
EQUAL_TO_BOOLEAN: 16,
|
|
19
|
-
MATCHES_STRING: 17
|
|
19
|
+
MATCHES_STRING: 17,
|
|
20
|
+
EQUAL_TO_SEMVER: 18,
|
|
21
|
+
GREATER_THAN_OR_EQUAL_TO_SEMVER: 19,
|
|
22
|
+
LESS_THAN_OR_EQUAL_TO_SEMVER: 20,
|
|
23
|
+
BETWEEN_SEMVER: 21,
|
|
24
|
+
IN_LIST_SEMVER: 22,
|
|
20
25
|
};
|
|
21
26
|
|
|
22
27
|
export const matcherDataTypes = {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { findIndex } from '../../utils/lang';
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
|
-
import { ENGINE_MATCHER_PART_OF } from '../../logger/constants';
|
|
4
2
|
|
|
5
|
-
export function partOfSetMatcherContext(
|
|
3
|
+
export function partOfSetMatcherContext(ruleAttr: string[]) {
|
|
6
4
|
return function partOfMatcher(runtimeAttr: string[]): boolean {
|
|
7
5
|
// To be part of the length should be minor or equal.
|
|
8
6
|
let isPartOf = runtimeAttr.length <= ruleAttr.length;
|
|
@@ -12,8 +10,6 @@ export function partOfSetMatcherContext(log: ILogger, ruleAttr: string[]) /*: Fu
|
|
|
12
10
|
if (findIndex(ruleAttr, e => e === runtimeAttr[i]) < 0) isPartOf = false;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
log.debug(ENGINE_MATCHER_PART_OF, [runtimeAttr, ruleAttr, isPartOf]);
|
|
16
|
-
|
|
17
13
|
return isPartOf;
|
|
18
14
|
};
|
|
19
15
|
}
|
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
import { MaybeThenable } from '../../dtos/types';
|
|
2
2
|
import { ISegmentsCacheBase } from '../../storages/types';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
3
|
import { thenable } from '../../utils/promise/thenable';
|
|
5
|
-
import { ENGINE_MATCHER_SEGMENT } from '../../logger/constants';
|
|
6
4
|
|
|
7
|
-
export function segmentMatcherContext(
|
|
5
|
+
export function segmentMatcherContext(segmentName: string, storage: { segments: ISegmentsCacheBase }) {
|
|
8
6
|
|
|
9
7
|
return function segmentMatcher(key: string): MaybeThenable<boolean> {
|
|
10
8
|
const isInSegment = storage.segments.isInSegment(segmentName, key);
|
|
11
9
|
|
|
12
10
|
if (thenable(isInSegment)) {
|
|
13
11
|
isInSegment.then(result => {
|
|
14
|
-
log.debug(ENGINE_MATCHER_SEGMENT, [segmentName, key, isInSegment]);
|
|
15
|
-
|
|
16
12
|
return result;
|
|
17
13
|
});
|
|
18
|
-
} else {
|
|
19
|
-
log.debug(ENGINE_MATCHER_SEGMENT, [segmentName, key, isInSegment]);
|
|
20
14
|
}
|
|
21
15
|
|
|
22
16
|
return isInSegment;
|
|
23
17
|
};
|
|
24
|
-
|
|
25
18
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IBetweenStringMatcherData } from '../../dtos/types';
|
|
2
|
+
import { Semver } from '../../utils/Semver';
|
|
3
|
+
|
|
4
|
+
export function betweenSemverMatcherContext(ruleAttr: IBetweenStringMatcherData) {
|
|
5
|
+
const startSemver = new Semver(ruleAttr.start);
|
|
6
|
+
const endSemver = new Semver(ruleAttr.end);
|
|
7
|
+
|
|
8
|
+
return function betweenSemverMatcher(runtimeAttr: string): boolean {
|
|
9
|
+
const runtimeSemver = new Semver(runtimeAttr);
|
|
10
|
+
|
|
11
|
+
const isBetween = startSemver.compare(runtimeSemver) <= 0 && endSemver.compare(runtimeSemver) >= 0;
|
|
12
|
+
|
|
13
|
+
return isBetween;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Semver } from '../../utils/Semver';
|
|
2
|
+
|
|
3
|
+
export function equalToSemverMatcherContext(ruleAttr: string) {
|
|
4
|
+
const ruleSemver = new Semver(ruleAttr);
|
|
5
|
+
|
|
6
|
+
return function equalToSemverMatcher(runtimeAttr: string): boolean {
|
|
7
|
+
const runtimeSemver = new Semver(runtimeAttr);
|
|
8
|
+
|
|
9
|
+
const isEqual = ruleSemver.version === runtimeSemver.version;
|
|
10
|
+
|
|
11
|
+
return isEqual;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Semver } from '../../utils/Semver';
|
|
2
|
+
|
|
3
|
+
export function greaterThanEqualToSemverMatcherContext(ruleAttr: string) {
|
|
4
|
+
const ruleSemver = new Semver(ruleAttr);
|
|
5
|
+
|
|
6
|
+
return function greaterThanEqualToSemverMatcher(runtimeAttr: string): boolean {
|
|
7
|
+
const runtimeSemver = new Semver(runtimeAttr);
|
|
8
|
+
|
|
9
|
+
const isGreaterThanEqual = runtimeSemver.compare(ruleSemver) >= 0;
|
|
10
|
+
|
|
11
|
+
return isGreaterThanEqual;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { _Set } from '../../utils/lang/sets';
|
|
2
|
+
import { Semver } from '../../utils/Semver';
|
|
3
|
+
|
|
4
|
+
export function inListSemverMatcherContext(ruleAttr: string[]) {
|
|
5
|
+
// @TODO ruleAttr validation should be done at the `parser` or `matchersTransform` level to reuse for all matchers
|
|
6
|
+
if (!ruleAttr || ruleAttr.length === 0) throw new Error('whitelistMatcherData is required for IN_LIST_SEMVER matcher type');
|
|
7
|
+
|
|
8
|
+
const listOfSemvers = new _Set(ruleAttr.map((version) => new Semver(version).version));
|
|
9
|
+
|
|
10
|
+
return function inListSemverMatcher(runtimeAttr: string): boolean {
|
|
11
|
+
const runtimeSemver = new Semver(runtimeAttr).version;
|
|
12
|
+
|
|
13
|
+
const isInList = listOfSemvers.has(runtimeSemver);
|
|
14
|
+
|
|
15
|
+
return isInList;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Semver } from '../../utils/Semver';
|
|
2
|
+
|
|
3
|
+
export function lessThanEqualToSemverMatcherContext(ruleAttr: string) {
|
|
4
|
+
const ruleSemver = new Semver(ruleAttr);
|
|
5
|
+
|
|
6
|
+
return function lessThanEqualToSemverMatcher(runtimeAttr: string): boolean {
|
|
7
|
+
const runtimeSemver = new Semver(runtimeAttr);
|
|
8
|
+
|
|
9
|
+
const isLessThanEqual = runtimeSemver.compare(ruleSemver) <= 0;
|
|
10
|
+
|
|
11
|
+
return isLessThanEqual;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export function stringMatcherContext(ruleAttr: string) {
|
|
2
|
+
const regex = new RegExp(ruleAttr);
|
|
3
3
|
|
|
4
|
-
export function stringMatcherContext(log: ILogger, ruleAttr: string) /*: Function */ {
|
|
5
4
|
return function stringMatcher(runtimeAttr: string): boolean {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
try {
|
|
9
|
-
re = new RegExp(ruleAttr);
|
|
10
|
-
} catch (e) {
|
|
11
|
-
log.debug(ENGINE_MATCHER_STRING_INVALID, [ruleAttr]);
|
|
12
|
-
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let regexMatches = re.test(runtimeAttr);
|
|
17
|
-
|
|
18
|
-
log.debug(ENGINE_MATCHER_STRING, [runtimeAttr, ruleAttr, regexMatches ? 'yes' : 'no']);
|
|
5
|
+
const regexMatches = regex.test(runtimeAttr);
|
|
19
6
|
|
|
20
7
|
return regexMatches;
|
|
21
8
|
};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { ENGINE_MATCHER_STARTS_WITH } from '../../logger/constants';
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
1
|
import { startsWith } from '../../utils/lang';
|
|
4
2
|
|
|
5
|
-
export function startsWithMatcherContext(
|
|
3
|
+
export function startsWithMatcherContext(ruleAttr: string[]) {
|
|
6
4
|
return function startsWithMatcher(runtimeAttr: string): boolean {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
log.debug(ENGINE_MATCHER_STARTS_WITH, [runtimeAttr, ruleAttr, matches]);
|
|
5
|
+
const matches = ruleAttr.some(e => startsWith(runtimeAttr, e));
|
|
10
6
|
|
|
11
7
|
return matches;
|
|
12
8
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
|
-
import { ENGINE_MATCHER_WHITELIST } from '../../logger/constants';
|
|
1
|
+
import { _Set } from '../../utils/lang/sets';
|
|
4
2
|
|
|
5
|
-
export function whitelistMatcherContext(
|
|
6
|
-
|
|
7
|
-
let isInWhitelist = ruleAttr.has(runtimeAttr);
|
|
3
|
+
export function whitelistMatcherContext(ruleAttr: string[]) {
|
|
4
|
+
const whitelistSet = new _Set(ruleAttr);
|
|
8
5
|
|
|
9
|
-
|
|
6
|
+
return function whitelistMatcher(runtimeAttr: string): boolean {
|
|
7
|
+
const isInWhitelist = whitelistSet.has(runtimeAttr);
|
|
10
8
|
|
|
11
9
|
return isInWhitelist;
|
|
12
10
|
};
|
|
@@ -2,10 +2,9 @@ import { findIndex } from '../../utils/lang';
|
|
|
2
2
|
import { matcherTypes, matcherTypesMapper, matcherDataTypes } from '../matchers/matcherTypes';
|
|
3
3
|
import { segmentTransform } from './segment';
|
|
4
4
|
import { whitelistTransform } from './whitelist';
|
|
5
|
-
import { setTransform } from './set';
|
|
6
5
|
import { numericTransform } from './unaryNumeric';
|
|
7
6
|
import { zeroSinceHH, zeroSinceSS } from '../convertions';
|
|
8
|
-
import { IBetweenMatcherData, IInSegmentMatcherData, ISplitMatcher, IUnaryNumericMatcherData
|
|
7
|
+
import { IBetweenMatcherData, IInSegmentMatcherData, ISplitMatcher, IUnaryNumericMatcherData } from '../../dtos/types';
|
|
9
8
|
import { IMatcherDto } from '../types';
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -15,16 +14,17 @@ export function matchersTransform(matchers: ISplitMatcher[]): IMatcherDto[] {
|
|
|
15
14
|
|
|
16
15
|
let parsedMatchers = matchers.map(matcher => {
|
|
17
16
|
let {
|
|
18
|
-
matcherType
|
|
19
|
-
negate
|
|
20
|
-
keySelector
|
|
21
|
-
userDefinedSegmentMatcherData
|
|
22
|
-
whitelistMatcherData
|
|
23
|
-
unaryNumericMatcherData
|
|
24
|
-
betweenMatcherData
|
|
25
|
-
dependencyMatcherData
|
|
17
|
+
matcherType,
|
|
18
|
+
negate,
|
|
19
|
+
keySelector,
|
|
20
|
+
userDefinedSegmentMatcherData,
|
|
21
|
+
whitelistMatcherData, /* whitelistObject, provided by 'WHITELIST', 'IN_LIST_SEMVER', set and string matchers */
|
|
22
|
+
unaryNumericMatcherData,
|
|
23
|
+
betweenMatcherData,
|
|
24
|
+
dependencyMatcherData,
|
|
26
25
|
booleanMatcherData,
|
|
27
|
-
stringMatcherData
|
|
26
|
+
stringMatcherData,
|
|
27
|
+
betweenStringMatcherData
|
|
28
28
|
} = matcher;
|
|
29
29
|
|
|
30
30
|
let attribute = keySelector && keySelector.attribute;
|
|
@@ -34,28 +34,26 @@ export function matchersTransform(matchers: ISplitMatcher[]): IMatcherDto[] {
|
|
|
34
34
|
let value = undefined;
|
|
35
35
|
|
|
36
36
|
if (type === matcherTypes.IN_SEGMENT) {
|
|
37
|
-
value = segmentTransform(
|
|
38
|
-
} else if (type === matcherTypes.WHITELIST) {
|
|
39
|
-
value = whitelistTransform(whitelistObject as IWhitelistMatcherData);
|
|
37
|
+
value = segmentTransform(userDefinedSegmentMatcherData as IInSegmentMatcherData);
|
|
40
38
|
} else if (type === matcherTypes.EQUAL_TO) {
|
|
41
|
-
value = numericTransform(
|
|
39
|
+
value = numericTransform(unaryNumericMatcherData as IUnaryNumericMatcherData);
|
|
42
40
|
dataType = matcherDataTypes.NUMBER;
|
|
43
41
|
|
|
44
|
-
if ((
|
|
42
|
+
if ((unaryNumericMatcherData as IUnaryNumericMatcherData).dataType === 'DATETIME') {
|
|
45
43
|
value = zeroSinceHH(value);
|
|
46
44
|
dataType = matcherDataTypes.DATETIME;
|
|
47
45
|
}
|
|
48
46
|
} else if (type === matcherTypes.GREATER_THAN_OR_EQUAL_TO ||
|
|
49
47
|
type === matcherTypes.LESS_THAN_OR_EQUAL_TO) {
|
|
50
|
-
value = numericTransform(
|
|
48
|
+
value = numericTransform(unaryNumericMatcherData as IUnaryNumericMatcherData);
|
|
51
49
|
dataType = matcherDataTypes.NUMBER;
|
|
52
50
|
|
|
53
|
-
if ((
|
|
51
|
+
if ((unaryNumericMatcherData as IUnaryNumericMatcherData).dataType === 'DATETIME') {
|
|
54
52
|
value = zeroSinceSS(value);
|
|
55
53
|
dataType = matcherDataTypes.DATETIME;
|
|
56
54
|
}
|
|
57
55
|
} else if (type === matcherTypes.BETWEEN) {
|
|
58
|
-
value =
|
|
56
|
+
value = betweenMatcherData as IBetweenMatcherData;
|
|
59
57
|
dataType = matcherDataTypes.NUMBER;
|
|
60
58
|
|
|
61
59
|
if (value.dataType === 'DATETIME') {
|
|
@@ -63,27 +61,36 @@ export function matchersTransform(matchers: ISplitMatcher[]): IMatcherDto[] {
|
|
|
63
61
|
value.end = zeroSinceSS(value.end);
|
|
64
62
|
dataType = matcherDataTypes.DATETIME;
|
|
65
63
|
}
|
|
64
|
+
} else if (type === matcherTypes.BETWEEN_SEMVER) {
|
|
65
|
+
value = betweenStringMatcherData;
|
|
66
66
|
} else if (
|
|
67
67
|
type === matcherTypes.EQUAL_TO_SET ||
|
|
68
68
|
type === matcherTypes.CONTAINS_ANY_OF_SET ||
|
|
69
69
|
type === matcherTypes.CONTAINS_ALL_OF_SET ||
|
|
70
70
|
type === matcherTypes.PART_OF_SET
|
|
71
71
|
) {
|
|
72
|
-
value =
|
|
72
|
+
value = whitelistTransform(whitelistMatcherData);
|
|
73
73
|
dataType = matcherDataTypes.SET;
|
|
74
74
|
} else if (
|
|
75
|
+
type === matcherTypes.WHITELIST ||
|
|
76
|
+
type === matcherTypes.IN_LIST_SEMVER ||
|
|
75
77
|
type === matcherTypes.STARTS_WITH ||
|
|
76
78
|
type === matcherTypes.ENDS_WITH ||
|
|
77
79
|
type === matcherTypes.CONTAINS_STRING
|
|
78
80
|
) {
|
|
79
|
-
value =
|
|
81
|
+
value = whitelistTransform(whitelistMatcherData);
|
|
80
82
|
} else if (type === matcherTypes.IN_SPLIT_TREATMENT) {
|
|
81
|
-
value =
|
|
83
|
+
value = dependencyMatcherData;
|
|
82
84
|
dataType = matcherDataTypes.NOT_SPECIFIED;
|
|
83
85
|
} else if (type === matcherTypes.EQUAL_TO_BOOLEAN) {
|
|
84
86
|
dataType = matcherDataTypes.BOOLEAN;
|
|
85
87
|
value = booleanMatcherData;
|
|
86
|
-
} else if (
|
|
88
|
+
} else if (
|
|
89
|
+
type === matcherTypes.MATCHES_STRING ||
|
|
90
|
+
type === matcherTypes.EQUAL_TO_SEMVER ||
|
|
91
|
+
type === matcherTypes.GREATER_THAN_OR_EQUAL_TO_SEMVER ||
|
|
92
|
+
type === matcherTypes.LESS_THAN_OR_EQUAL_TO_SEMVER
|
|
93
|
+
) {
|
|
87
94
|
value = stringMatcherData;
|
|
88
95
|
}
|
|
89
96
|
|
|
@@ -91,6 +98,7 @@ export function matchersTransform(matchers: ISplitMatcher[]): IMatcherDto[] {
|
|
|
91
98
|
attribute, // attribute over we should do the matching, undefined means 'use the key'
|
|
92
99
|
negate, // should we negate the result?
|
|
93
100
|
type, // which kind of matcher we should evaluate
|
|
101
|
+
name: matcherType,// name of the matcher for logging purposes
|
|
94
102
|
value, // metadata used for the matching
|
|
95
103
|
dataType // runtime input data type
|
|
96
104
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _Set } from '../../utils/lang/sets';
|
|
1
|
+
import { ISplitMatcher } from '../../dtos/types';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
|
-
* Extract whitelist
|
|
4
|
+
* Extract whitelist array.
|
|
6
5
|
*/
|
|
7
|
-
export function whitelistTransform(whitelistObject:
|
|
8
|
-
return
|
|
6
|
+
export function whitelistTransform(whitelistObject: ISplitMatcher['whitelistMatcherData']) {
|
|
7
|
+
return whitelistObject && whitelistObject.whitelist;
|
|
9
8
|
}
|
|
@@ -7,10 +7,11 @@ import { ifElseIfCombinerContext } from '../combiners/ifelseif';
|
|
|
7
7
|
import { andCombinerContext } from '../combiners/and';
|
|
8
8
|
import { thenable } from '../../utils/promise/thenable';
|
|
9
9
|
import { IEvaluator, IMatcherDto, ISplitEvaluator } from '../types';
|
|
10
|
-
import { ISplitCondition } from '../../dtos/types';
|
|
10
|
+
import { ISplitCondition, MaybeThenable } from '../../dtos/types';
|
|
11
11
|
import { IStorageAsync, IStorageSync } from '../../storages/types';
|
|
12
12
|
import { SplitIO } from '../../types';
|
|
13
13
|
import { ILogger } from '../../logger/types';
|
|
14
|
+
import { ENGINE_MATCHER_ERROR, ENGINE_MATCHER_RESULT } from '../../logger/constants';
|
|
14
15
|
|
|
15
16
|
export function parser(log: ILogger, conditions: ISplitCondition[], storage: IStorageSync | IStorageAsync): IEvaluator {
|
|
16
17
|
let predicates = [];
|
|
@@ -28,24 +29,38 @@ export function parser(log: ILogger, conditions: ISplitCondition[], storage: ISt
|
|
|
28
29
|
|
|
29
30
|
// create a set of pure functions from the matcher's dto
|
|
30
31
|
const expressions = matchers.map((matcherDto: IMatcherDto) => {
|
|
31
|
-
|
|
32
|
+
let matcher: ReturnType<typeof matcherFactory>;
|
|
33
|
+
try {
|
|
34
|
+
matcher = matcherFactory(log, matcherDto, storage);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
log.error(ENGINE_MATCHER_ERROR, [matcherDto.name, error]);
|
|
37
|
+
}
|
|
32
38
|
|
|
33
39
|
// Evaluator function.
|
|
34
40
|
return (key: string, attributes: SplitIO.Attributes | undefined, splitEvaluator: ISplitEvaluator) => {
|
|
35
41
|
const value = sanitizeValue(log, key, matcherDto, attributes);
|
|
36
|
-
|
|
42
|
+
let result: MaybeThenable<boolean> = false;
|
|
37
43
|
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
if (value !== undefined && matcher) {
|
|
45
|
+
try {
|
|
46
|
+
result = matcher(value, splitEvaluator);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
log.error(ENGINE_MATCHER_ERROR, [matcherDto.name, error]);
|
|
49
|
+
}
|
|
41
50
|
}
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
|
|
52
|
+
function handleResult(result: boolean) {
|
|
53
|
+
log.debug(ENGINE_MATCHER_RESULT, [matcherDto.name, result, matcherDto.value, value]); // @ts-ignore
|
|
54
|
+
return Boolean(result ^ matcherDto.negate);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return thenable(result) ?
|
|
58
|
+
result.then(handleResult) :
|
|
59
|
+
handleResult(result);
|
|
44
60
|
};
|
|
45
61
|
});
|
|
46
62
|
|
|
47
|
-
// if matcher's factory can't
|
|
48
|
-
// will be empty
|
|
63
|
+
// if matcher's factory can't instantiate the matchers, the expressions array will be empty
|
|
49
64
|
if (expressions.length === 0) {
|
|
50
65
|
// reset any data collected during parsing
|
|
51
66
|
predicates = [];
|
package/src/evaluator/types.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IBetweenMatcherData, IDependencyMatcherData, MaybeThenable } from '../dtos/types';
|
|
1
|
+
import { IBetweenMatcherData, IBetweenStringMatcherData, IDependencyMatcherData, MaybeThenable } from '../dtos/types';
|
|
2
2
|
import { IStorageAsync, IStorageSync } from '../storages/types';
|
|
3
|
-
import { ISet } from '../utils/lang/sets';
|
|
4
3
|
import { SplitIO } from '../types';
|
|
5
4
|
import { ILogger } from '../logger/types';
|
|
6
5
|
|
|
@@ -11,7 +10,8 @@ export interface IDependencyMatcherValue {
|
|
|
11
10
|
|
|
12
11
|
export interface IMatcherDto {
|
|
13
12
|
type: number
|
|
14
|
-
|
|
13
|
+
name: string
|
|
14
|
+
value?: string | number | boolean | string[] | IDependencyMatcherData | IBetweenMatcherData | IBetweenStringMatcherData | null
|
|
15
15
|
|
|
16
16
|
attribute: string | null
|
|
17
17
|
negate: boolean
|
package/src/logger/constants.ts
CHANGED
|
@@ -9,25 +9,8 @@ export const ENGINE_COMBINER_AND = 0;
|
|
|
9
9
|
export const ENGINE_COMBINER_IFELSEIF = 1;
|
|
10
10
|
export const ENGINE_COMBINER_IFELSEIF_NO_TREATMENT = 2;
|
|
11
11
|
export const ENGINE_BUCKET = 3;
|
|
12
|
-
export const ENGINE_MATCHER_ALL = 4;
|
|
13
|
-
export const ENGINE_MATCHER_BETWEEN = 5;
|
|
14
|
-
export const ENGINE_MATCHER_BOOLEAN = 6;
|
|
15
|
-
export const ENGINE_MATCHER_CONTAINS_ALL = 7;
|
|
16
|
-
export const ENGINE_MATCHER_CONTAINS_ANY = 8;
|
|
17
|
-
export const ENGINE_MATCHER_CONTAINS_STRING = 9;
|
|
18
12
|
export const ENGINE_MATCHER_DEPENDENCY = 10;
|
|
19
13
|
export const ENGINE_MATCHER_DEPENDENCY_PRE = 11;
|
|
20
|
-
export const ENGINE_MATCHER_EQUAL = 12;
|
|
21
|
-
export const ENGINE_MATCHER_EQUAL_TO_SET = 13;
|
|
22
|
-
export const ENGINE_MATCHER_ENDS_WITH = 14;
|
|
23
|
-
export const ENGINE_MATCHER_GREATER = 15;
|
|
24
|
-
export const ENGINE_MATCHER_LESS = 16;
|
|
25
|
-
export const ENGINE_MATCHER_PART_OF = 17;
|
|
26
|
-
export const ENGINE_MATCHER_SEGMENT = 18;
|
|
27
|
-
export const ENGINE_MATCHER_STRING = 19;
|
|
28
|
-
export const ENGINE_MATCHER_STRING_INVALID = 20;
|
|
29
|
-
export const ENGINE_MATCHER_STARTS_WITH = 21;
|
|
30
|
-
export const ENGINE_MATCHER_WHITELIST = 22;
|
|
31
14
|
export const ENGINE_VALUE = 23;
|
|
32
15
|
export const ENGINE_SANITIZE = 24;
|
|
33
16
|
export const CLEANUP_REGISTERING = 25;
|
|
@@ -45,6 +28,7 @@ export const SYNC_TASK_START = 36;
|
|
|
45
28
|
export const SYNC_TASK_EXECUTE = 37;
|
|
46
29
|
export const SYNC_TASK_STOP = 38;
|
|
47
30
|
export const SETTINGS_SPLITS_FILTER = 39;
|
|
31
|
+
export const ENGINE_MATCHER_RESULT = 40;
|
|
48
32
|
|
|
49
33
|
export const CLIENT_READY_FROM_CACHE = 100;
|
|
50
34
|
export const CLIENT_READY = 101;
|
|
@@ -131,6 +115,7 @@ export const ERROR_NOT_BOOLEAN = 325;
|
|
|
131
115
|
export const ERROR_MIN_CONFIG_PARAM = 326;
|
|
132
116
|
export const ERROR_TOO_MANY_SETS = 327;
|
|
133
117
|
export const ERROR_SETS_FILTER_EXCLUSIVE = 328;
|
|
118
|
+
export const ENGINE_MATCHER_ERROR = 329;
|
|
134
119
|
|
|
135
120
|
// Log prefixes (a.k.a. tags or categories)
|
|
136
121
|
export const LOG_PREFIX_SETTINGS = 'settings';
|
package/src/logger/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { objectAssign } from '../utils/lang/objectAssign';
|
|
2
2
|
import { ILoggerOptions, ILogger } from './types';
|
|
3
|
-
import { find } from '../utils/lang';
|
|
3
|
+
import { find, isObject } from '../utils/lang';
|
|
4
4
|
import { LogLevel } from '../types';
|
|
5
5
|
import { IMap, _Map } from '../utils/lang/maps';
|
|
6
6
|
|
|
@@ -28,7 +28,13 @@ export function isLogLevelString(str: string): str is LogLevel {
|
|
|
28
28
|
export function _sprintf(format: string = '', args: any[] = []): string {
|
|
29
29
|
let i = 0;
|
|
30
30
|
return format.replace(/%s/g, function () {
|
|
31
|
-
|
|
31
|
+
let arg = args[i++];
|
|
32
|
+
if (isObject(arg) || Array.isArray(arg)) {
|
|
33
|
+
try {
|
|
34
|
+
arg = JSON.stringify(arg);
|
|
35
|
+
} catch (e) { /* empty */ }
|
|
36
|
+
}
|
|
37
|
+
return arg;
|
|
32
38
|
});
|
|
33
39
|
}
|
|
34
40
|
|
|
@@ -7,27 +7,11 @@ export const codesDebug: [number, string][] = codesInfo.concat([
|
|
|
7
7
|
[c.ENGINE_COMBINER_IFELSEIF, c.LOG_PREFIX_ENGINE_COMBINER + 'Treatment found: %s'],
|
|
8
8
|
[c.ENGINE_COMBINER_IFELSEIF_NO_TREATMENT, c.LOG_PREFIX_ENGINE_COMBINER + 'All predicates evaluated, no treatment found.'],
|
|
9
9
|
[c.ENGINE_BUCKET, c.LOG_PREFIX_ENGINE + ': using algo "murmur" bucket %s for key %s using seed %s - treatment %s'],
|
|
10
|
-
[c.
|
|
11
|
-
[c.
|
|
12
|
-
[c.
|
|
13
|
-
[c.
|
|
14
|
-
[c.
|
|
15
|
-
[c.ENGINE_MATCHER_CONTAINS_STRING, c.LOG_PREFIX_ENGINE_MATCHER + '[containsStringMatcher] %s contains %s? %s'],
|
|
16
|
-
[c.ENGINE_MATCHER_DEPENDENCY, c.LOG_PREFIX_ENGINE_MATCHER + '[dependencyMatcher] parent feature flag "%s" evaluated to "%s" with label "%s". %s evaluated treatment is part of [%s] ? %s.'],
|
|
17
|
-
[c.ENGINE_MATCHER_DEPENDENCY_PRE, c.LOG_PREFIX_ENGINE_MATCHER + '[dependencyMatcher] will evaluate parent feature flag: "%s" with key: %s %s'],
|
|
18
|
-
[c.ENGINE_MATCHER_EQUAL, c.LOG_PREFIX_ENGINE_MATCHER + '[equalToMatcher] is %s equal to %s? %s'],
|
|
19
|
-
[c.ENGINE_MATCHER_EQUAL_TO_SET, c.LOG_PREFIX_ENGINE_MATCHER + '[equalToSetMatcher] is %s equal to set %s? %s'],
|
|
20
|
-
[c.ENGINE_MATCHER_ENDS_WITH, c.LOG_PREFIX_ENGINE_MATCHER + '[endsWithMatcher] %s ends with %s? %s'],
|
|
21
|
-
[c.ENGINE_MATCHER_GREATER, c.LOG_PREFIX_ENGINE_MATCHER + '[greaterThanEqualMatcher] is %s greater than %s? %s'],
|
|
22
|
-
[c.ENGINE_MATCHER_LESS, c.LOG_PREFIX_ENGINE_MATCHER + '[lessThanEqualMatcher] is %s less than %s? %s'],
|
|
23
|
-
[c.ENGINE_MATCHER_PART_OF, c.LOG_PREFIX_ENGINE_MATCHER + '[partOfMatcher] %s is part of %s? %s'],
|
|
24
|
-
[c.ENGINE_MATCHER_SEGMENT, c.LOG_PREFIX_ENGINE_MATCHER + '[segmentMatcher] evaluated %s / %s => %s'],
|
|
25
|
-
[c.ENGINE_MATCHER_STRING, c.LOG_PREFIX_ENGINE_MATCHER + '[stringMatcher] does %s matches with %s? %s'],
|
|
26
|
-
[c.ENGINE_MATCHER_STRING_INVALID, c.LOG_PREFIX_ENGINE_MATCHER + '[stringMatcher] %s is an invalid regex'],
|
|
27
|
-
[c.ENGINE_MATCHER_STARTS_WITH, c.LOG_PREFIX_ENGINE_MATCHER + '[startsWithMatcher] %s starts with %s? %s'],
|
|
28
|
-
[c.ENGINE_MATCHER_WHITELIST, c.LOG_PREFIX_ENGINE_MATCHER + '[whitelistMatcher] evaluated %s in [%s] => %s'],
|
|
29
|
-
[c.ENGINE_VALUE, c.LOG_PREFIX_ENGINE_VALUE + 'Extracted attribute [%s], [%s] will be used for matching.'],
|
|
30
|
-
[c.ENGINE_SANITIZE, c.LOG_PREFIX_ENGINE + ':sanitize: Attempted to sanitize [%s] which should be of type [%s]. Sanitized and processed value => [%s]'],
|
|
10
|
+
[c.ENGINE_MATCHER_DEPENDENCY, c.LOG_PREFIX_ENGINE_MATCHER + '[IN_SPLIT_TREATMENT] parent feature flag "%s" evaluated to "%s" with label "%s". %s evaluated treatment is part of %s ? %s.'],
|
|
11
|
+
[c.ENGINE_MATCHER_DEPENDENCY_PRE, c.LOG_PREFIX_ENGINE_MATCHER + '[IN_SPLIT_TREATMENT] will evaluate parent feature flag: "%s" with key: %s %s'],
|
|
12
|
+
[c.ENGINE_VALUE, c.LOG_PREFIX_ENGINE_VALUE + 'Extracted attribute `%s`. %s will be used for matching.'],
|
|
13
|
+
[c.ENGINE_SANITIZE, c.LOG_PREFIX_ENGINE + ':sanitize: Attempted to sanitize %s which should be of type %s. Sanitized and processed value => %s'],
|
|
14
|
+
[c.ENGINE_MATCHER_RESULT, c.LOG_PREFIX_ENGINE_MATCHER + '[%s] Result: %s. Rule value: %s. Evaluation value: %s'],
|
|
31
15
|
// SDK
|
|
32
16
|
[c.CLEANUP_REGISTERING, c.LOG_PREFIX_CLEANUP + 'Registering cleanup handler %s'],
|
|
33
17
|
[c.CLEANUP_DEREGISTERING, c.LOG_PREFIX_CLEANUP + 'Deregistering cleanup handler %s'],
|