@splitsoftware/splitio-commons 1.2.1-rc.1 → 1.2.1-rc.2
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/cjs/evaluator/Engine.js +6 -6
- package/cjs/evaluator/combiners/and.js +1 -1
- package/cjs/evaluator/combiners/ifelseif.js +2 -2
- package/cjs/evaluator/condition/engineUtils.js +2 -2
- package/cjs/evaluator/condition/index.js +4 -4
- package/cjs/evaluator/index.js +5 -5
- package/cjs/evaluator/matchers/cont_all.js +1 -1
- package/cjs/evaluator/matchers/cont_any.js +1 -1
- package/cjs/evaluator/matchers/cont_str.js +1 -1
- package/cjs/evaluator/matchers/dependency.js +1 -1
- package/cjs/evaluator/matchers/eq_set.js +1 -1
- package/cjs/evaluator/matchers/ew.js +1 -1
- package/cjs/evaluator/matchers/part_of.js +1 -1
- package/cjs/evaluator/matchers/segment.js +1 -1
- package/cjs/evaluator/matchers/sw.js +1 -1
- package/cjs/evaluator/matchers/whitelist.js +1 -1
- package/cjs/evaluator/matchersTransform/index.js +12 -12
- package/cjs/evaluator/parser/index.js +6 -6
- package/cjs/evaluator/treatments/index.js +1 -1
- package/cjs/evaluator/value/index.js +1 -1
- package/cjs/evaluator/value/sanitize.js +4 -4
- package/cjs/integrations/browser.js +3 -3
- package/cjs/integrations/ga/GaToSplit.js +14 -14
- package/cjs/integrations/ga/GoogleAnalyticsToSplit.js +1 -1
- package/cjs/integrations/ga/SplitToGa.js +1 -1
- package/cjs/listeners/browser.js +1 -1
- package/cjs/listeners/node.js +1 -1
- package/cjs/logger/constants.js +3 -1
- package/cjs/logger/index.js +2 -2
- package/cjs/logger/messages/debug.js +1 -1
- package/cjs/logger/messages/error.js +1 -1
- package/cjs/logger/messages/info.js +1 -1
- package/cjs/logger/messages/warn.js +1 -1
- package/cjs/logger/sdkLogger.js +1 -1
- package/cjs/readiness/readinessManager.js +2 -2
- package/cjs/readiness/sdkReadinessManager.js +4 -4
- package/cjs/sdkClient/client.js +9 -9
- package/cjs/sdkClient/clientAttributesDecoration.js +4 -4
- package/cjs/sdkClient/clientCS.js +2 -2
- package/cjs/sdkClient/clientInputValidation.js +14 -14
- package/cjs/sdkClient/sdkClient.js +3 -3
- package/cjs/sdkClient/sdkClientMethod.js +1 -1
- package/cjs/sdkClient/sdkClientMethodCS.js +6 -6
- package/cjs/sdkClient/sdkClientMethodCSWithTT.js +8 -8
- package/cjs/sdkFactory/index.js +8 -8
- package/cjs/sdkManager/index.js +11 -11
- package/cjs/services/splitApi.js +3 -2
- package/cjs/services/splitHttpClient.js +2 -2
- package/cjs/storages/KeyBuilder.js +2 -2
- package/cjs/storages/KeyBuilderCS.js +2 -2
- package/cjs/storages/KeyBuilderSS.js +1 -1
- package/cjs/storages/findLatencyIndex.js +1 -1
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +1 -1
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +12 -12
- package/cjs/storages/inLocalStorage/index.js +3 -3
- package/cjs/storages/inMemory/AttributesCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/LatenciesCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/SegmentsCacheInMemory.js +2 -2
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +5 -5
- package/cjs/storages/inRedis/LatenciesCacheInRedis.js +1 -1
- package/cjs/storages/inRedis/RedisAdapter.js +16 -10
- package/cjs/storages/inRedis/SegmentsCacheInRedis.js +1 -1
- package/cjs/storages/inRedis/SplitsCacheInRedis.js +3 -3
- package/cjs/storages/inRedis/index.js +1 -1
- package/cjs/storages/pluggable/SegmentsCachePluggable.js +1 -1
- package/cjs/storages/pluggable/SplitsCachePluggable.js +3 -3
- package/cjs/storages/pluggable/inMemoryWrapper.js +4 -4
- package/cjs/storages/pluggable/index.js +4 -4
- package/cjs/sync/offline/LocalhostFromFile.js +1 -1
- package/cjs/sync/offline/LocalhostFromObject.js +1 -1
- package/cjs/sync/offline/splitsParser/parseCondition.js +1 -1
- package/cjs/sync/offline/splitsParser/splitsParserFromFile.js +13 -13
- package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +3 -3
- package/cjs/sync/offline/syncManagerOffline.js +1 -1
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +2 -2
- package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
- package/cjs/sync/polling/pollingManagerCS.js +6 -6
- package/cjs/sync/polling/pollingManagerSS.js +3 -3
- package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +1 -1
- package/cjs/sync/polling/syncTasks/segmentsSyncTask.js +1 -1
- package/cjs/sync/polling/syncTasks/splitsSyncTask.js +1 -1
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +1 -1
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +2 -2
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +2 -2
- package/cjs/sync/streaming/AuthClient/index.js +3 -3
- package/cjs/sync/streaming/SSEHandler/NotificationParser.js +1 -1
- package/cjs/sync/streaming/SSEHandler/index.js +3 -3
- package/cjs/sync/streaming/mySegmentsV2utils.js +1 -1
- package/cjs/sync/streaming/pushManager.js +15 -15
- package/cjs/sync/submitters/eventsSyncTask.js +1 -1
- package/cjs/sync/submitters/impressionCountsSyncTask.js +1 -1
- package/cjs/sync/submitters/impressionsSyncTask.js +3 -3
- package/cjs/sync/submitters/metricsSyncTask.js +3 -3
- package/cjs/sync/submitters/submitterManager.js +4 -4
- package/cjs/sync/submitters/submitterSyncTask.js +1 -1
- package/cjs/sync/syncManagerOnline.js +1 -1
- package/cjs/trackers/eventTracker.js +3 -3
- package/cjs/trackers/impressionObserver/impressionObserverCS.js +1 -1
- package/cjs/trackers/impressionObserver/impressionObserverSS.js +1 -1
- package/cjs/trackers/impressionsTracker.js +3 -3
- package/cjs/utils/MinEvents.js +2 -1
- package/cjs/utils/inputValidation/apiKey.js +1 -1
- package/cjs/utils/inputValidation/attribute.js +4 -4
- package/cjs/utils/inputValidation/attributes.js +2 -2
- package/cjs/utils/inputValidation/event.js +1 -1
- package/cjs/utils/inputValidation/eventProperties.js +5 -5
- package/cjs/utils/inputValidation/eventValue.js +1 -1
- package/cjs/utils/inputValidation/key.js +6 -5
- package/cjs/utils/inputValidation/preloadedData.js +8 -8
- package/cjs/utils/inputValidation/split.js +1 -1
- package/cjs/utils/inputValidation/splits.js +2 -2
- package/cjs/utils/inputValidation/trafficType.js +1 -1
- package/cjs/utils/inputValidation/trafficTypeExistance.js +1 -1
- package/cjs/utils/jwt/index.js +1 -1
- package/cjs/utils/key/index.js +3 -3
- package/cjs/utils/lang/index.js +1 -1
- package/cjs/utils/murmur3/common.js +1 -1
- package/cjs/utils/murmur3/murmur3.js +10 -10
- package/cjs/utils/murmur3/murmur3_128.js +1 -1
- package/cjs/utils/murmur3/murmur3_128_x86.js +37 -37
- package/cjs/utils/murmur3/murmur3_64.js +1 -1
- package/cjs/utils/settingsValidation/index.js +5 -10
- package/cjs/utils/settingsValidation/integrations/configurable.js +1 -1
- package/cjs/utils/settingsValidation/integrations/pluggable.js +1 -1
- package/cjs/utils/settingsValidation/localhost/builtin.js +2 -2
- package/cjs/utils/settingsValidation/logger/builtinLogger.js +3 -3
- package/cjs/utils/settingsValidation/logger/commons.js +1 -1
- package/cjs/utils/settingsValidation/logger/pluggableLogger.js +1 -1
- package/cjs/utils/settingsValidation/runtime/browser.js +10 -0
- package/cjs/utils/settingsValidation/runtime/node.js +22 -0
- package/cjs/utils/settingsValidation/splitFilters.js +1 -1
- package/cjs/utils/settingsValidation/storage/storageCS.js +1 -1
- package/cjs/utils/timeTracker/index.js +3 -3
- package/esm/services/splitApi.js +2 -1
- package/esm/storages/inRedis/RedisAdapter.js +7 -1
- package/esm/sync/offline/splitsParser/splitsParserFromFile.js +1 -1
- package/esm/sync/polling/fetchers/segmentChangesFetcher.js +2 -2
- package/esm/utils/inputValidation/key.js +2 -1
- package/esm/utils/lang/index.js +2 -2
- package/esm/utils/settingsValidation/index.js +1 -6
- package/esm/utils/settingsValidation/runtime/browser.js +6 -0
- package/esm/utils/settingsValidation/runtime/node.js +17 -0
- package/package.json +9 -8
- package/src/logger/types.ts +4 -0
- package/src/sync/offline/splitsParser/splitsParserFromFile.ts +1 -1
- package/src/utils/settingsValidation/index.ts +1 -6
- package/src/utils/settingsValidation/runtime/browser.ts +6 -0
- package/src/utils/settingsValidation/runtime/node.ts +22 -0
- package/src/utils/settingsValidation/types.ts +6 -6
- package/types/logger/types.d.ts +4 -0
- package/types/sdkClient/clientAttributesDecoration.d.ts +1 -1
- package/types/utils/settingsValidation/runtime/browser.d.ts +4 -0
- package/types/utils/settingsValidation/runtime/node.d.ts +5 -0
- package/types/utils/settingsValidation/types.d.ts +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __spreadArray } from "tslib";
|
|
2
2
|
function greedyFetch(fetchSegmentChanges, since, segmentName, noCache) {
|
|
3
3
|
return fetchSegmentChanges(since, segmentName, noCache)
|
|
4
4
|
.then(function (resp) { return resp.json(); })
|
|
@@ -9,7 +9,7 @@ function greedyFetch(fetchSegmentChanges, since, segmentName, noCache) {
|
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
11
|
return Promise.all([json, greedyFetch(fetchSegmentChanges, till, segmentName, noCache)]).then(function (flatMe) {
|
|
12
|
-
return
|
|
12
|
+
return __spreadArray([flatMe[0]], flatMe[1], true);
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
});
|
|
@@ -35,7 +35,8 @@ export function validateKey(log, maybeKey, method) {
|
|
|
35
35
|
var bucketingKey = validateKeyValue(log, maybeKey.bucketingKey, method, 'bucketingKey');
|
|
36
36
|
if (matchingKey && bucketingKey)
|
|
37
37
|
return {
|
|
38
|
-
matchingKey: matchingKey,
|
|
38
|
+
matchingKey: matchingKey,
|
|
39
|
+
bucketingKey: bucketingKey
|
|
39
40
|
};
|
|
40
41
|
log.error(ERROR_INVALID_KEY_OBJECT, [method]);
|
|
41
42
|
return false;
|
package/esm/utils/lang/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __spreadArray } from "tslib";
|
|
2
2
|
/**
|
|
3
3
|
* Checks if the target string ends with the sub string.
|
|
4
4
|
*/
|
|
@@ -179,7 +179,7 @@ export function merge(target, source) {
|
|
|
179
179
|
});
|
|
180
180
|
if (rest && rest.length) {
|
|
181
181
|
var nextSource = rest.splice(0, 1)[0];
|
|
182
|
-
res = merge.apply(void 0,
|
|
182
|
+
res = merge.apply(void 0, __spreadArray([res, nextSource], rest, false));
|
|
183
183
|
}
|
|
184
184
|
return res;
|
|
185
185
|
}
|
|
@@ -64,10 +64,6 @@ var base = {
|
|
|
64
64
|
impressionsMode: OPTIMIZED,
|
|
65
65
|
localhostMode: undefined
|
|
66
66
|
},
|
|
67
|
-
runtime: {
|
|
68
|
-
ip: false,
|
|
69
|
-
hostname: false
|
|
70
|
-
},
|
|
71
67
|
// Logger
|
|
72
68
|
log: undefined
|
|
73
69
|
};
|
|
@@ -114,8 +110,7 @@ export function settingsValidation(config, validationParams) {
|
|
|
114
110
|
}
|
|
115
111
|
// Current ip/hostname information
|
|
116
112
|
// @ts-ignore, modify readonly prop
|
|
117
|
-
|
|
118
|
-
withDefaults.runtime = runtime(withDefaults);
|
|
113
|
+
withDefaults.runtime = runtime(withDefaults);
|
|
119
114
|
// ensure a valid list of integrations.
|
|
120
115
|
// `integrations` returns an array of valid integration items.
|
|
121
116
|
// @ts-ignore, modify readonly prop
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import osFunction from 'os';
|
|
2
|
+
import ipFunction from 'ip';
|
|
3
|
+
import { UNKNOWN, NA, CONSUMER_MODE } from '../../constants';
|
|
4
|
+
export function validateRuntime(settings) {
|
|
5
|
+
var isIPAddressesEnabled = settings.core.IPAddressesEnabled === true;
|
|
6
|
+
var isConsumerMode = settings.mode === CONSUMER_MODE;
|
|
7
|
+
// If the values are not available, default to false (for standalone) or "unknown" (for consumer mode, to be used on Redis keys)
|
|
8
|
+
var ip = ipFunction.address() || (isConsumerMode ? UNKNOWN : false);
|
|
9
|
+
var hostname = osFunction.hostname() || (isConsumerMode ? UNKNOWN : false);
|
|
10
|
+
if (!isIPAddressesEnabled) { // If IPAddresses setting is not enabled, set as false (for standalone) or "NA" (for consumer mode, to be used on Redis keys)
|
|
11
|
+
ip = hostname = isConsumerMode ? NA : false;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
ip: ip,
|
|
15
|
+
hostname: hostname
|
|
16
|
+
};
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-commons",
|
|
3
|
-
"version": "1.2.1-rc.
|
|
3
|
+
"version": "1.2.1-rc.2",
|
|
4
4
|
"description": "Split Javascript SDK common components",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"check:lint": "eslint src --ext .js,.ts",
|
|
21
21
|
"check:types": "tsc --noEmit",
|
|
22
22
|
"build": "npm run build:cjs && npm run build:esm",
|
|
23
|
-
"build:esm": "rimraf esm && tsc -m es2015 --outDir esm -d true --declarationDir types
|
|
24
|
-
"build:cjs": "rimraf cjs && tsc -m CommonJS --outDir cjs
|
|
23
|
+
"build:esm": "rimraf esm && tsc -m es2015 --outDir esm -d true --declarationDir types",
|
|
24
|
+
"build:cjs": "rimraf cjs && tsc -m CommonJS --outDir cjs",
|
|
25
25
|
"test": "jest",
|
|
26
26
|
"test:coverage": "jest --coverage",
|
|
27
|
-
"publish:rc": "npm run check && npm run
|
|
28
|
-
"publish:stable": "npm run check && npm run
|
|
27
|
+
"publish:rc": "npm run check && npm run test && npm run build && npm publish --tag rc",
|
|
28
|
+
"publish:stable": "npm run check && npm run test && npm run build && npm publish"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
@@ -44,11 +44,12 @@
|
|
|
44
44
|
"bugs": "https://github.com/splitio/javascript-commons/issues",
|
|
45
45
|
"homepage": "https://github.com/splitio/javascript-commons#readme",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"tslib": "^2.1
|
|
47
|
+
"tslib": "^2.3.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/google.analytics": "0.0.40",
|
|
51
51
|
"@types/ioredis": "^4.28.0",
|
|
52
|
+
"@types/ip": "^1.1.0",
|
|
52
53
|
"@types/jest": "^27.0.0",
|
|
53
54
|
"@types/lodash": "^4.14.162",
|
|
54
55
|
"@typescript-eslint/eslint-plugin": "^4.2.0",
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
"eslint": "^7.32.0",
|
|
59
60
|
"eslint-plugin-compat": "3.7.0",
|
|
60
61
|
"eslint-plugin-import": "^2.25.3",
|
|
61
|
-
"fetch-mock": "^9.
|
|
62
|
+
"fetch-mock": "^9.11.0",
|
|
62
63
|
"ioredis": "^4.28.0",
|
|
63
64
|
"jest": "^27.2.3",
|
|
64
65
|
"jest-localstorage-mock": "^2.4.3",
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
"redis-server": "1.2.2",
|
|
69
70
|
"rimraf": "^3.0.2",
|
|
70
71
|
"ts-jest": "^27.0.5",
|
|
71
|
-
"typescript": "
|
|
72
|
+
"typescript": "4.4.4"
|
|
72
73
|
},
|
|
73
74
|
"sideEffects": false
|
|
74
75
|
}
|
package/src/logger/types.ts
CHANGED
|
@@ -9,11 +9,15 @@ export interface ILoggerOptions {
|
|
|
9
9
|
export interface ILogger {
|
|
10
10
|
setLogLevel(logLevel: LogLevel): void
|
|
11
11
|
|
|
12
|
+
debug(msg: unknown): void
|
|
12
13
|
debug(msg: string | number, args?: any[]): void
|
|
13
14
|
|
|
15
|
+
info(msg: unknown): void
|
|
14
16
|
info(msg: string | number, args?: any[]): void
|
|
15
17
|
|
|
18
|
+
warn(msg: unknown): void
|
|
16
19
|
warn(msg: string | number, args?: any[]): void
|
|
17
20
|
|
|
21
|
+
error(msg: unknown): void
|
|
18
22
|
error(msg: string | number, args?: any[]): void
|
|
19
23
|
}
|
|
@@ -78,11 +78,6 @@ const base = {
|
|
|
78
78
|
localhostMode: undefined
|
|
79
79
|
},
|
|
80
80
|
|
|
81
|
-
runtime: {
|
|
82
|
-
ip: false,
|
|
83
|
-
hostname: false
|
|
84
|
-
},
|
|
85
|
-
|
|
86
81
|
// Logger
|
|
87
82
|
log: undefined
|
|
88
83
|
};
|
|
@@ -139,7 +134,7 @@ export function settingsValidation(config: unknown, validationParams: ISettingsV
|
|
|
139
134
|
|
|
140
135
|
// Current ip/hostname information
|
|
141
136
|
// @ts-ignore, modify readonly prop
|
|
142
|
-
|
|
137
|
+
withDefaults.runtime = runtime(withDefaults);
|
|
143
138
|
|
|
144
139
|
// ensure a valid list of integrations.
|
|
145
140
|
// `integrations` returns an array of valid integration items.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import osFunction from 'os';
|
|
2
|
+
import ipFunction from 'ip';
|
|
3
|
+
|
|
4
|
+
import { UNKNOWN, NA, CONSUMER_MODE } from '../../constants';
|
|
5
|
+
import { ISettings } from '../../../types';
|
|
6
|
+
|
|
7
|
+
export function validateRuntime(settings: ISettings) {
|
|
8
|
+
const isIPAddressesEnabled = settings.core.IPAddressesEnabled === true;
|
|
9
|
+
const isConsumerMode = settings.mode === CONSUMER_MODE;
|
|
10
|
+
|
|
11
|
+
// If the values are not available, default to false (for standalone) or "unknown" (for consumer mode, to be used on Redis keys)
|
|
12
|
+
let ip = ipFunction.address() || (isConsumerMode ? UNKNOWN : false);
|
|
13
|
+
let hostname = osFunction.hostname() || (isConsumerMode ? UNKNOWN : false);
|
|
14
|
+
|
|
15
|
+
if (!isIPAddressesEnabled) { // If IPAddresses setting is not enabled, set as false (for standalone) or "NA" (for consumer mode, to be used on Redis keys)
|
|
16
|
+
ip = hostname = isConsumerMode ? NA : false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
ip, hostname
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -6,15 +6,15 @@ import { ISettings } from '../../types';
|
|
|
6
6
|
*/
|
|
7
7
|
export interface ISettingsValidationParams {
|
|
8
8
|
/**
|
|
9
|
-
* Object of values to overwrite
|
|
10
|
-
* Version and startup properties are
|
|
9
|
+
* Object of values to overwrite base settings.
|
|
10
|
+
* Version and startup properties are required, because they are not defined in the base settings.
|
|
11
11
|
*/
|
|
12
12
|
defaults: Partial<ISettings> & { version: string } & { startup: ISettings['startup'] },
|
|
13
|
-
/** Function to
|
|
14
|
-
runtime
|
|
15
|
-
/** Storage validator */
|
|
13
|
+
/** Function to define runtime values (`settings.runtime`) */
|
|
14
|
+
runtime: (settings: ISettings) => ISettings['runtime'],
|
|
15
|
+
/** Storage validator (`settings.storage`) */
|
|
16
16
|
storage?: (settings: ISettings) => ISettings['storage'],
|
|
17
|
-
/** Integrations validator */
|
|
17
|
+
/** Integrations validator (`settings.integrations`) */
|
|
18
18
|
integrations?: (settings: ISettings) => ISettings['integrations'],
|
|
19
19
|
/** Logger validator (`settings.debug`) */
|
|
20
20
|
logger: (settings: ISettings) => ISettings['log'],
|
package/types/logger/types.d.ts
CHANGED
|
@@ -6,8 +6,12 @@ export interface ILoggerOptions {
|
|
|
6
6
|
}
|
|
7
7
|
export interface ILogger {
|
|
8
8
|
setLogLevel(logLevel: LogLevel): void;
|
|
9
|
+
debug(msg: unknown): void;
|
|
9
10
|
debug(msg: string | number, args?: any[]): void;
|
|
11
|
+
info(msg: unknown): void;
|
|
10
12
|
info(msg: string | number, args?: any[]): void;
|
|
13
|
+
warn(msg: unknown): void;
|
|
11
14
|
warn(msg: string | number, args?: any[]): void;
|
|
15
|
+
error(msg: unknown): void;
|
|
12
16
|
error(msg: string | number, args?: any[]): void;
|
|
13
17
|
}
|
|
@@ -8,7 +8,7 @@ export declare function clientAttributesDecoration<TClient extends SplitIO.IClie
|
|
|
8
8
|
getTreatmentWithConfig: (maybeKey: SplitIO.SplitKey, maybeSplit: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentWithConfig | SplitIO.AsyncTreatmentWithConfig;
|
|
9
9
|
getTreatments: (maybeKey: SplitIO.SplitKey, maybeSplits: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
|
|
10
10
|
getTreatmentsWithConfig: (maybeKey: SplitIO.SplitKey, maybeSplits: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
|
|
11
|
-
track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) =>
|
|
11
|
+
track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) => boolean | Promise<boolean>;
|
|
12
12
|
/**
|
|
13
13
|
* Add an attribute to client's in memory attributes storage
|
|
14
14
|
*
|
|
@@ -5,19 +5,19 @@ import { ISettings } from '../../types';
|
|
|
5
5
|
*/
|
|
6
6
|
export interface ISettingsValidationParams {
|
|
7
7
|
/**
|
|
8
|
-
* Object of values to overwrite
|
|
9
|
-
* Version and startup properties are
|
|
8
|
+
* Object of values to overwrite base settings.
|
|
9
|
+
* Version and startup properties are required, because they are not defined in the base settings.
|
|
10
10
|
*/
|
|
11
11
|
defaults: Partial<ISettings> & {
|
|
12
12
|
version: string;
|
|
13
13
|
} & {
|
|
14
14
|
startup: ISettings['startup'];
|
|
15
15
|
};
|
|
16
|
-
/** Function to
|
|
17
|
-
runtime
|
|
18
|
-
/** Storage validator */
|
|
16
|
+
/** Function to define runtime values (`settings.runtime`) */
|
|
17
|
+
runtime: (settings: ISettings) => ISettings['runtime'];
|
|
18
|
+
/** Storage validator (`settings.storage`) */
|
|
19
19
|
storage?: (settings: ISettings) => ISettings['storage'];
|
|
20
|
-
/** Integrations validator */
|
|
20
|
+
/** Integrations validator (`settings.integrations`) */
|
|
21
21
|
integrations?: (settings: ISettings) => ISettings['integrations'];
|
|
22
22
|
/** Logger validator (`settings.debug`) */
|
|
23
23
|
logger: (settings: ISettings) => ISettings['log'];
|