@splitsoftware/splitio-commons 1.13.2-rc.5 → 1.13.2-rc.7
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 +2 -0
- package/cjs/evaluator/Engine.js +5 -6
- package/cjs/evaluator/combiners/ifelseif.js +2 -3
- 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 +1 -3
- package/cjs/evaluator/matchers/index.js +1 -1
- package/cjs/evaluator/matchers/lte.js +1 -3
- package/cjs/evaluator/matchers/part_of.js +1 -3
- package/cjs/evaluator/matchers/segment.js +1 -6
- package/cjs/evaluator/matchers/semver_between.js +1 -3
- package/cjs/evaluator/matchers/semver_eq.js +1 -3
- package/cjs/evaluator/matchers/semver_gte.js +1 -3
- package/cjs/evaluator/matchers/semver_inlist.js +4 -6
- package/cjs/evaluator/matchers/semver_lte.js +1 -3
- package/cjs/evaluator/matchers/string.js +1 -3
- package/cjs/evaluator/matchers/sw.js +1 -3
- package/cjs/evaluator/matchers/whitelist.js +3 -4
- package/cjs/evaluator/matchersTransform/index.js +6 -8
- package/cjs/evaluator/matchersTransform/whitelist.js +2 -3
- package/cjs/evaluator/parser/index.js +13 -14
- package/cjs/logger/constants.js +4 -24
- package/cjs/logger/index.js +8 -1
- package/cjs/logger/messages/debug.js +5 -25
- package/cjs/logger/messages/warn.js +1 -1
- package/cjs/services/splitApi.js +5 -5
- package/cjs/storages/KeyBuilder.js +3 -2
- package/cjs/utils/constants/index.js +2 -1
- package/esm/evaluator/Engine.js +5 -5
- package/esm/evaluator/combiners/ifelseif.js +2 -2
- 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 +1 -3
- package/esm/evaluator/matchers/index.js +1 -1
- package/esm/evaluator/matchers/lte.js +1 -3
- package/esm/evaluator/matchers/part_of.js +1 -3
- package/esm/evaluator/matchers/segment.js +1 -6
- package/esm/evaluator/matchers/semver_between.js +1 -3
- package/esm/evaluator/matchers/semver_eq.js +1 -3
- package/esm/evaluator/matchers/semver_gte.js +1 -3
- package/esm/evaluator/matchers/semver_inlist.js +5 -7
- package/esm/evaluator/matchers/semver_lte.js +1 -3
- package/esm/evaluator/matchers/string.js +1 -3
- package/esm/evaluator/matchers/sw.js +1 -3
- package/esm/evaluator/matchers/whitelist.js +4 -5
- package/esm/evaluator/matchersTransform/index.js +6 -8
- package/esm/evaluator/matchersTransform/whitelist.js +2 -3
- package/esm/evaluator/parser/index.js +14 -15
- package/esm/logger/constants.js +1 -21
- package/esm/logger/index.js +9 -2
- package/esm/logger/messages/debug.js +5 -25
- package/esm/logger/messages/warn.js +1 -1
- package/esm/services/splitApi.js +6 -6
- package/esm/storages/KeyBuilder.js +3 -2
- package/esm/utils/constants/index.js +1 -0
- package/package.json +1 -1
- package/src/evaluator/Engine.ts +5 -6
- package/src/evaluator/combiners/ifelseif.ts +2 -2
- 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 +2 -6
- package/src/evaluator/matchers/index.ts +1 -1
- package/src/evaluator/matchers/lte.ts +2 -6
- package/src/evaluator/matchers/part_of.ts +1 -5
- package/src/evaluator/matchers/segment.ts +1 -8
- package/src/evaluator/matchers/semver_between.ts +1 -5
- package/src/evaluator/matchers/semver_eq.ts +1 -5
- package/src/evaluator/matchers/semver_gte.ts +1 -5
- package/src/evaluator/matchers/semver_inlist.ts +5 -9
- package/src/evaluator/matchers/semver_lte.ts +1 -5
- package/src/evaluator/matchers/string.ts +1 -6
- package/src/evaluator/matchers/sw.ts +2 -6
- package/src/evaluator/matchers/whitelist.ts +5 -7
- package/src/evaluator/matchersTransform/index.ts +5 -8
- package/src/evaluator/matchersTransform/whitelist.ts +2 -3
- package/src/evaluator/parser/index.ts +12 -8
- package/src/evaluator/types.ts +2 -2
- package/src/logger/constants.ts +1 -21
- package/src/logger/index.ts +8 -2
- package/src/logger/messages/debug.ts +5 -25
- package/src/logger/messages/warn.ts +1 -1
- package/src/services/splitApi.ts +5 -6
- package/src/storages/KeyBuilder.ts +3 -2
- package/src/utils/constants/index.ts +2 -0
- 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/semver_between.d.ts +1 -2
- package/types/evaluator/matchers/semver_eq.d.ts +1 -2
- package/types/evaluator/matchers/semver_gte.d.ts +1 -2
- package/types/evaluator/matchers/semver_inlist.d.ts +1 -3
- package/types/evaluator/matchers/semver_lte.d.ts +1 -2
- 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/whitelist.d.ts +2 -2
- package/types/evaluator/types.d.ts +2 -2
- package/types/logger/constants.d.ts +1 -21
- package/types/storages/KeyBuilder.d.ts +1 -1
- package/types/utils/constants/index.d.ts +1 -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,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
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { IBetweenStringMatcherData } from '../../dtos/types';
|
|
2
|
-
import { ENGINE_MATCHER_BETWEEN_SEMVER } from '../../logger/constants';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
2
|
import { Semver } from '../../utils/Semver';
|
|
5
3
|
|
|
6
|
-
export function betweenSemverMatcherContext(
|
|
4
|
+
export function betweenSemverMatcherContext(ruleAttr: IBetweenStringMatcherData) {
|
|
7
5
|
const startSemver = new Semver(ruleAttr.start);
|
|
8
6
|
const endSemver = new Semver(ruleAttr.end);
|
|
9
7
|
|
|
@@ -12,8 +10,6 @@ export function betweenSemverMatcherContext(log: ILogger, ruleAttr: IBetweenStri
|
|
|
12
10
|
|
|
13
11
|
const isBetween = startSemver.compare(runtimeSemver) <= 0 && endSemver.compare(runtimeSemver) >= 0;
|
|
14
12
|
|
|
15
|
-
log.debug(ENGINE_MATCHER_BETWEEN_SEMVER, [runtimeAttr, ruleAttr.start, ruleAttr.end, isBetween]);
|
|
16
|
-
|
|
17
13
|
return isBetween;
|
|
18
14
|
};
|
|
19
15
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ENGINE_MATCHER_EQUAL_SEMVER } from '../../logger/constants';
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
1
|
import { Semver } from '../../utils/Semver';
|
|
4
2
|
|
|
5
|
-
export function equalToSemverMatcherContext(
|
|
3
|
+
export function equalToSemverMatcherContext(ruleAttr: string) {
|
|
6
4
|
const ruleSemver = new Semver(ruleAttr);
|
|
7
5
|
|
|
8
6
|
return function equalToSemverMatcher(runtimeAttr: string): boolean {
|
|
@@ -10,8 +8,6 @@ export function equalToSemverMatcherContext(log: ILogger, ruleAttr: string) {
|
|
|
10
8
|
|
|
11
9
|
const isEqual = ruleSemver.version === runtimeSemver.version;
|
|
12
10
|
|
|
13
|
-
log.debug(ENGINE_MATCHER_EQUAL_SEMVER, [runtimeAttr, ruleAttr, isEqual]);
|
|
14
|
-
|
|
15
11
|
return isEqual;
|
|
16
12
|
};
|
|
17
13
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ENGINE_MATCHER_GREATER_SEMVER } from '../../logger/constants';
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
1
|
import { Semver } from '../../utils/Semver';
|
|
4
2
|
|
|
5
|
-
export function greaterThanEqualToSemverMatcherContext(
|
|
3
|
+
export function greaterThanEqualToSemverMatcherContext(ruleAttr: string) {
|
|
6
4
|
const ruleSemver = new Semver(ruleAttr);
|
|
7
5
|
|
|
8
6
|
return function greaterThanEqualToSemverMatcher(runtimeAttr: string): boolean {
|
|
@@ -10,8 +8,6 @@ export function greaterThanEqualToSemverMatcherContext(log: ILogger, ruleAttr: s
|
|
|
10
8
|
|
|
11
9
|
const isGreaterThanEqual = runtimeSemver.compare(ruleSemver) >= 0;
|
|
12
10
|
|
|
13
|
-
log.debug(ENGINE_MATCHER_GREATER_SEMVER, [runtimeAttr, ruleAttr, isGreaterThanEqual]);
|
|
14
|
-
|
|
15
11
|
return isGreaterThanEqual;
|
|
16
12
|
};
|
|
17
13
|
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
1
|
+
import { _Set } from '../../utils/lang/sets';
|
|
3
2
|
import { Semver } from '../../utils/Semver';
|
|
4
|
-
import { ENGINE_MATCHER_IN_LIST_SEMVER } from '../../logger/constants';
|
|
5
3
|
|
|
6
|
-
export function inListSemverMatcherContext(
|
|
7
|
-
// @TODO
|
|
8
|
-
if (!ruleAttr || ruleAttr.
|
|
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');
|
|
9
7
|
|
|
10
|
-
const listOfSemvers = new _Set(
|
|
8
|
+
const listOfSemvers = new _Set(ruleAttr.map((version) => new Semver(version).version));
|
|
11
9
|
|
|
12
10
|
return function inListSemverMatcher(runtimeAttr: string): boolean {
|
|
13
11
|
const runtimeSemver = new Semver(runtimeAttr).version;
|
|
14
12
|
|
|
15
13
|
const isInList = listOfSemvers.has(runtimeSemver);
|
|
16
14
|
|
|
17
|
-
log.debug(ENGINE_MATCHER_IN_LIST_SEMVER, [runtimeAttr, setToArray(ruleAttr).join(','), isInList]);
|
|
18
|
-
|
|
19
15
|
return isInList;
|
|
20
16
|
};
|
|
21
17
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ENGINE_MATCHER_LESS_SEMVER } from '../../logger/constants';
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
1
|
import { Semver } from '../../utils/Semver';
|
|
4
2
|
|
|
5
|
-
export function lessThanEqualToSemverMatcherContext(
|
|
3
|
+
export function lessThanEqualToSemverMatcherContext(ruleAttr: string) {
|
|
6
4
|
const ruleSemver = new Semver(ruleAttr);
|
|
7
5
|
|
|
8
6
|
return function lessThanEqualToSemverMatcher(runtimeAttr: string): boolean {
|
|
@@ -10,8 +8,6 @@ export function lessThanEqualToSemverMatcherContext(log: ILogger, ruleAttr: stri
|
|
|
10
8
|
|
|
11
9
|
const isLessThanEqual = runtimeSemver.compare(ruleSemver) <= 0;
|
|
12
10
|
|
|
13
|
-
log.debug(ENGINE_MATCHER_LESS_SEMVER, [runtimeAttr, ruleAttr, isLessThanEqual]);
|
|
14
|
-
|
|
15
11
|
return isLessThanEqual;
|
|
16
12
|
};
|
|
17
13
|
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
|
-
|
|
4
|
-
export function stringMatcherContext(log: ILogger, ruleAttr: string) {
|
|
1
|
+
export function stringMatcherContext(ruleAttr: string) {
|
|
5
2
|
const regex = new RegExp(ruleAttr);
|
|
6
3
|
|
|
7
4
|
return function stringMatcher(runtimeAttr: string): boolean {
|
|
8
5
|
const regexMatches = regex.test(runtimeAttr);
|
|
9
6
|
|
|
10
|
-
log.debug(ENGINE_MATCHER_STRING, [runtimeAttr, ruleAttr, regexMatches ? 'yes' : 'no']);
|
|
11
|
-
|
|
12
7
|
return regexMatches;
|
|
13
8
|
};
|
|
14
9
|
}
|
|
@@ -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,7 +2,6 @@ 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
7
|
import { IBetweenMatcherData, IInSegmentMatcherData, ISplitMatcher, IUnaryNumericMatcherData } from '../../dtos/types';
|
|
@@ -36,11 +35,6 @@ export function matchersTransform(matchers: ISplitMatcher[]): IMatcherDto[] {
|
|
|
36
35
|
|
|
37
36
|
if (type === matcherTypes.IN_SEGMENT) {
|
|
38
37
|
value = segmentTransform(userDefinedSegmentMatcherData as IInSegmentMatcherData);
|
|
39
|
-
} else if (
|
|
40
|
-
type === matcherTypes.WHITELIST ||
|
|
41
|
-
type === matcherTypes.IN_LIST_SEMVER
|
|
42
|
-
) {
|
|
43
|
-
value = whitelistTransform(whitelistMatcherData);
|
|
44
38
|
} else if (type === matcherTypes.EQUAL_TO) {
|
|
45
39
|
value = numericTransform(unaryNumericMatcherData as IUnaryNumericMatcherData);
|
|
46
40
|
dataType = matcherDataTypes.NUMBER;
|
|
@@ -75,14 +69,16 @@ export function matchersTransform(matchers: ISplitMatcher[]): IMatcherDto[] {
|
|
|
75
69
|
type === matcherTypes.CONTAINS_ALL_OF_SET ||
|
|
76
70
|
type === matcherTypes.PART_OF_SET
|
|
77
71
|
) {
|
|
78
|
-
value =
|
|
72
|
+
value = whitelistTransform(whitelistMatcherData);
|
|
79
73
|
dataType = matcherDataTypes.SET;
|
|
80
74
|
} else if (
|
|
75
|
+
type === matcherTypes.WHITELIST ||
|
|
76
|
+
type === matcherTypes.IN_LIST_SEMVER ||
|
|
81
77
|
type === matcherTypes.STARTS_WITH ||
|
|
82
78
|
type === matcherTypes.ENDS_WITH ||
|
|
83
79
|
type === matcherTypes.CONTAINS_STRING
|
|
84
80
|
) {
|
|
85
|
-
value =
|
|
81
|
+
value = whitelistTransform(whitelistMatcherData);
|
|
86
82
|
} else if (type === matcherTypes.IN_SPLIT_TREATMENT) {
|
|
87
83
|
value = dependencyMatcherData;
|
|
88
84
|
dataType = matcherDataTypes.NOT_SPECIFIED;
|
|
@@ -102,6 +98,7 @@ export function matchersTransform(matchers: ISplitMatcher[]): IMatcherDto[] {
|
|
|
102
98
|
attribute, // attribute over we should do the matching, undefined means 'use the key'
|
|
103
99
|
negate, // should we negate the result?
|
|
104
100
|
type, // which kind of matcher we should evaluate
|
|
101
|
+
name: matcherType,// name of the matcher for logging purposes
|
|
105
102
|
value, // metadata used for the matching
|
|
106
103
|
dataType // runtime input data type
|
|
107
104
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ISplitMatcher } from '../../dtos/types';
|
|
2
|
-
import { _Set } from '../../utils/lang/sets';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
|
-
* Extract whitelist
|
|
4
|
+
* Extract whitelist array.
|
|
6
5
|
*/
|
|
7
6
|
export function whitelistTransform(whitelistObject: ISplitMatcher['whitelistMatcherData']) {
|
|
8
|
-
return
|
|
7
|
+
return whitelistObject && whitelistObject.whitelist;
|
|
9
8
|
}
|
|
@@ -11,7 +11,7 @@ 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 } from '../../logger/constants';
|
|
14
|
+
import { ENGINE_MATCHER_ERROR, ENGINE_MATCHER_RESULT } from '../../logger/constants';
|
|
15
15
|
|
|
16
16
|
export function parser(log: ILogger, conditions: ISplitCondition[], storage: IStorageSync | IStorageAsync): IEvaluator {
|
|
17
17
|
let predicates = [];
|
|
@@ -28,12 +28,12 @@ export function parser(log: ILogger, conditions: ISplitCondition[], storage: ISt
|
|
|
28
28
|
const matchers = matchersTransform(matcherGroup.matchers);
|
|
29
29
|
|
|
30
30
|
// create a set of pure functions from the matcher's dto
|
|
31
|
-
const expressions = matchers.map((matcherDto: IMatcherDto
|
|
31
|
+
const expressions = matchers.map((matcherDto: IMatcherDto) => {
|
|
32
32
|
let matcher: ReturnType<typeof matcherFactory>;
|
|
33
33
|
try {
|
|
34
34
|
matcher = matcherFactory(log, matcherDto, storage);
|
|
35
35
|
} catch (error) {
|
|
36
|
-
log.error(ENGINE_MATCHER_ERROR, [
|
|
36
|
+
log.error(ENGINE_MATCHER_ERROR, [matcherDto.name, error]);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// Evaluator function.
|
|
@@ -45,14 +45,18 @@ export function parser(log: ILogger, conditions: ISplitCondition[], storage: ISt
|
|
|
45
45
|
try {
|
|
46
46
|
result = matcher(value, splitEvaluator);
|
|
47
47
|
} catch (error) {
|
|
48
|
-
log.error(ENGINE_MATCHER_ERROR, [
|
|
48
|
+
log.error(ENGINE_MATCHER_ERROR, [matcherDto.name, error]);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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);
|
|
56
60
|
};
|
|
57
61
|
});
|
|
58
62
|
|
package/src/evaluator/types.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
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,24 +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_STARTS_WITH = 21;
|
|
29
|
-
export const ENGINE_MATCHER_WHITELIST = 22;
|
|
30
14
|
export const ENGINE_VALUE = 23;
|
|
31
15
|
export const ENGINE_SANITIZE = 24;
|
|
32
16
|
export const CLEANUP_REGISTERING = 25;
|
|
@@ -44,11 +28,7 @@ export const SYNC_TASK_START = 36;
|
|
|
44
28
|
export const SYNC_TASK_EXECUTE = 37;
|
|
45
29
|
export const SYNC_TASK_STOP = 38;
|
|
46
30
|
export const SETTINGS_SPLITS_FILTER = 39;
|
|
47
|
-
export const
|
|
48
|
-
export const ENGINE_MATCHER_GREATER_SEMVER = 41;
|
|
49
|
-
export const ENGINE_MATCHER_LESS_SEMVER = 42;
|
|
50
|
-
export const ENGINE_MATCHER_BETWEEN_SEMVER = 43;
|
|
51
|
-
export const ENGINE_MATCHER_IN_LIST_SEMVER = 44;
|
|
31
|
+
export const ENGINE_MATCHER_RESULT = 40;
|
|
52
32
|
|
|
53
33
|
export const CLIENT_READY_FROM_CACHE = 100;
|
|
54
34
|
export const CLIENT_READY = 101;
|
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,31 +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_STARTS_WITH, c.LOG_PREFIX_ENGINE_MATCHER + '[startsWithMatcher] %s starts with %s? %s'],
|
|
27
|
-
[c.ENGINE_MATCHER_WHITELIST, c.LOG_PREFIX_ENGINE_MATCHER + '[whitelistMatcher] evaluated %s in [%s] => %s'],
|
|
28
|
-
[c.ENGINE_VALUE, c.LOG_PREFIX_ENGINE_VALUE + 'Extracted attribute [%s], [%s] will be used for matching.'],
|
|
29
|
-
[c.ENGINE_SANITIZE, c.LOG_PREFIX_ENGINE + ':sanitize: Attempted to sanitize [%s] which should be of type [%s]. Sanitized and processed value => [%s]'],
|
|
30
|
-
[c.ENGINE_MATCHER_EQUAL_SEMVER, c.LOG_PREFIX_ENGINE_MATCHER + '[equalToSemverMatcher] is %s equal to %s? %s'],
|
|
31
|
-
[c.ENGINE_MATCHER_GREATER_SEMVER, c.LOG_PREFIX_ENGINE_MATCHER + '[greaterThanEqualSemverMatcher] is %s greater than %s? %s'],
|
|
32
|
-
[c.ENGINE_MATCHER_LESS_SEMVER, c.LOG_PREFIX_ENGINE_MATCHER + '[lessThanEqualSemverMatcher] is %s less than %s? %s'],
|
|
33
|
-
[c.ENGINE_MATCHER_BETWEEN_SEMVER, c.LOG_PREFIX_ENGINE_MATCHER + '[betweenSemverMatcher] is %s between %s and %s? %s'],
|
|
34
|
-
[c.ENGINE_MATCHER_IN_LIST_SEMVER, c.LOG_PREFIX_ENGINE_MATCHER + '[inListSemverMatcher] is %s in list [%s]? %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'],
|
|
35
15
|
// SDK
|
|
36
16
|
[c.CLEANUP_REGISTERING, c.LOG_PREFIX_CLEANUP + 'Registering cleanup handler %s'],
|
|
37
17
|
[c.CLEANUP_DEREGISTERING, c.LOG_PREFIX_CLEANUP + 'Deregistering cleanup handler %s'],
|
|
@@ -4,7 +4,7 @@ import { codesError } from './error';
|
|
|
4
4
|
export const codesWarn: [number, string][] = codesError.concat([
|
|
5
5
|
// evaluator
|
|
6
6
|
[c.ENGINE_VALUE_INVALID, c.LOG_PREFIX_ENGINE_VALUE + 'Value %s doesn\'t match with expected type.'],
|
|
7
|
-
[c.ENGINE_VALUE_NO_ATTRIBUTES, c.LOG_PREFIX_ENGINE_VALUE + 'Defined attribute
|
|
7
|
+
[c.ENGINE_VALUE_NO_ATTRIBUTES, c.LOG_PREFIX_ENGINE_VALUE + 'Defined attribute `%s`. No attributes received.'],
|
|
8
8
|
// synchronizer
|
|
9
9
|
[c.SYNC_MYSEGMENTS_FETCH_RETRY, c.LOG_PREFIX_SYNC_MYSEGMENTS + 'Retrying download of segments #%s. Reason: %s'],
|
|
10
10
|
[c.SYNC_SPLITS_FETCH_FAILS, c.LOG_PREFIX_SYNC_SPLITS + 'Error while doing fetch of feature flags. %s'],
|
package/src/services/splitApi.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { splitHttpClientFactory } from './splitHttpClient';
|
|
|
4
4
|
import { ISplitApi } from './types';
|
|
5
5
|
import { objectAssign } from '../utils/lang/objectAssign';
|
|
6
6
|
import { ITelemetryTracker } from '../trackers/types';
|
|
7
|
-
import { SPLITS, IMPRESSIONS, IMPRESSIONS_COUNT, EVENTS, TELEMETRY, TOKEN, SEGMENT, MY_SEGMENT } from '../utils/constants';
|
|
7
|
+
import { SPLITS, IMPRESSIONS, IMPRESSIONS_COUNT, EVENTS, TELEMETRY, TOKEN, SEGMENT, MY_SEGMENT, FLAGS_SPEC } from '../utils/constants';
|
|
8
8
|
import { ERROR_TOO_MANY_SETS } from '../logger/constants';
|
|
9
9
|
|
|
10
10
|
const noCacheHeaderOptions = { headers: { 'Cache-Control': 'no-cache' } };
|
|
@@ -44,17 +44,16 @@ export function splitApiFactory(
|
|
|
44
44
|
},
|
|
45
45
|
|
|
46
46
|
fetchAuth(userMatchingKeys?: string[]) {
|
|
47
|
-
let url = `${urls.auth}/v2/auth`;
|
|
48
|
-
if (userMatchingKeys) { //
|
|
47
|
+
let url = `${urls.auth}/v2/auth?s=${FLAGS_SPEC}`;
|
|
48
|
+
if (userMatchingKeys) { // `userMatchingKeys` is undefined in server-side
|
|
49
49
|
const queryParams = userMatchingKeys.map(userKeyToQueryParam).join('&');
|
|
50
|
-
if (queryParams)
|
|
51
|
-
url += '?' + queryParams;
|
|
50
|
+
if (queryParams) url += '&' + queryParams;
|
|
52
51
|
}
|
|
53
52
|
return splitHttpClient(url, undefined, telemetryTracker.trackHttp(TOKEN));
|
|
54
53
|
},
|
|
55
54
|
|
|
56
55
|
fetchSplitChanges(since: number, noCache?: boolean, till?: number) {
|
|
57
|
-
const url = `${urls.sdk}/splitChanges?since=${since}${till ? '&till=' + till : ''}${filterQueryString || ''}`;
|
|
56
|
+
const url = `${urls.sdk}/splitChanges?s=${FLAGS_SPEC}&since=${since}${till ? '&till=' + till : ''}${filterQueryString || ''}`;
|
|
58
57
|
return splitHttpClient(url, noCache ? noCacheHeaderOptions : undefined, telemetryTracker.trackHttp(SPLITS))
|
|
59
58
|
.catch((err) => {
|
|
60
59
|
if (err.statusCode === 414) settings.log.error(ERROR_TOO_MANY_SETS);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ISettings } from '../types';
|
|
2
|
+
import { FLAGS_SPEC } from '../utils/constants';
|
|
2
3
|
import { startsWith } from '../utils/lang';
|
|
3
4
|
import { hash } from '../utils/murmur3/murmur3';
|
|
4
5
|
|
|
@@ -81,9 +82,9 @@ export class KeyBuilder {
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
/**
|
|
84
|
-
* Generates a murmur32 hash based on the authorization key
|
|
85
|
+
* Generates a murmur32 hash based on the authorization key, the feature flags filter query, and version of SplitChanges API.
|
|
85
86
|
* The hash is in hexadecimal format (8 characters max, 32 bits).
|
|
86
87
|
*/
|
|
87
88
|
export function getStorageHash(settings: ISettings) {
|
|
88
|
-
return hash(`${settings.core.authorizationKey}::${settings.sync.__splitFiltersValidation.queryString}`).toString(16);
|
|
89
|
+
return hash(`${settings.core.authorizationKey}::${settings.sync.__splitFiltersValidation.queryString}::${FLAGS_SPEC}`).toString(16);
|
|
89
90
|
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function allMatcherContext(log: ILogger): (runtimeAttr: string) => boolean;
|
|
1
|
+
export declare function allMatcherContext(): (runtimeAttr: string) => boolean;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { IBetweenMatcherData } from '../../dtos/types';
|
|
2
|
-
|
|
3
|
-
export declare function betweenMatcherContext(log: ILogger, ruleVO: IBetweenMatcherData): (runtimeAttr: number) => boolean;
|
|
2
|
+
export declare function betweenMatcherContext(ruleVO: IBetweenMatcherData): (runtimeAttr: number) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function booleanMatcherContext(log: ILogger, ruleAttr: boolean): (runtimeAttr: boolean) => boolean;
|
|
1
|
+
export declare function booleanMatcherContext(ruleAttr: boolean): (runtimeAttr: boolean) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function containsAllSetMatcherContext(log: ILogger, ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
1
|
+
export declare function containsAllSetMatcherContext(ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function containsAnySetMatcherContext(log: ILogger, ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
1
|
+
export declare function containsAnySetMatcherContext(ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function containsStringMatcherContext(log: ILogger, ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
1
|
+
export declare function containsStringMatcherContext(ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
@@ -2,4 +2,4 @@ import { IDependencyMatcherData, MaybeThenable } from '../../dtos/types';
|
|
|
2
2
|
import { IStorageAsync, IStorageSync } from '../../storages/types';
|
|
3
3
|
import { ILogger } from '../../logger/types';
|
|
4
4
|
import { IDependencyMatcherValue, ISplitEvaluator } from '../types';
|
|
5
|
-
export declare function dependencyMatcherContext(
|
|
5
|
+
export declare function dependencyMatcherContext({ split, treatments }: IDependencyMatcherData, storage: IStorageSync | IStorageAsync, log: ILogger): ({ key, attributes }: IDependencyMatcherValue, splitEvaluator: ISplitEvaluator) => MaybeThenable<boolean>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function equalToMatcherContext(log: ILogger, ruleAttr: number): (runtimeAttr: number) => boolean;
|
|
1
|
+
export declare function equalToMatcherContext(ruleAttr: number): (runtimeAttr: number) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function equalToSetMatcherContext(log: ILogger, ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
1
|
+
export declare function equalToSetMatcherContext(ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function endsWithMatcherContext(log: ILogger, ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
1
|
+
export declare function endsWithMatcherContext(ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function greaterThanEqualMatcherContext(log: ILogger, ruleAttr: number): (runtimeAttr: number) => boolean;
|
|
1
|
+
export declare function greaterThanEqualMatcherContext(ruleAttr: number): (runtimeAttr: number) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function lessThanEqualMatcherContext(log: ILogger, ruleAttr: number): (runtimeAttr: number) => boolean;
|
|
1
|
+
export declare function lessThanEqualMatcherContext(ruleAttr: number): (runtimeAttr: number) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function partOfSetMatcherContext(log: ILogger, ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
1
|
+
export declare function partOfSetMatcherContext(ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { MaybeThenable } from '../../dtos/types';
|
|
2
2
|
import { ISegmentsCacheBase } from '../../storages/types';
|
|
3
|
-
|
|
4
|
-
export declare function segmentMatcherContext(log: ILogger, segmentName: string, storage: {
|
|
3
|
+
export declare function segmentMatcherContext(segmentName: string, storage: {
|
|
5
4
|
segments: ISegmentsCacheBase;
|
|
6
5
|
}): (key: string) => MaybeThenable<boolean>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { IBetweenStringMatcherData } from '../../dtos/types';
|
|
2
|
-
|
|
3
|
-
export declare function betweenSemverMatcherContext(log: ILogger, ruleAttr: IBetweenStringMatcherData): (runtimeAttr: string) => boolean;
|
|
2
|
+
export declare function betweenSemverMatcherContext(ruleAttr: IBetweenStringMatcherData): (runtimeAttr: string) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function equalToSemverMatcherContext(log: ILogger, ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
1
|
+
export declare function equalToSemverMatcherContext(ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function greaterThanEqualToSemverMatcherContext(log: ILogger, ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
1
|
+
export declare function greaterThanEqualToSemverMatcherContext(ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
|
-
export declare function inListSemverMatcherContext(log: ILogger, ruleAttr: ISet<string>): (runtimeAttr: string) => boolean;
|
|
1
|
+
export declare function inListSemverMatcherContext(ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function lessThanEqualToSemverMatcherContext(log: ILogger, ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
1
|
+
export declare function lessThanEqualToSemverMatcherContext(ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function stringMatcherContext(log: ILogger, ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
1
|
+
export declare function stringMatcherContext(ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function startsWithMatcherContext(log: ILogger, ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
1
|
+
export declare function startsWithMatcherContext(ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
|
-
export declare function whitelistMatcherContext(log: ILogger, ruleAttr: ISet<string>): (runtimeAttr: string) => boolean;
|
|
1
|
+
export declare function whitelistMatcherContext(ruleAttr: string[]): (runtimeAttr: string) => boolean;
|