@splitsoftware/splitio-commons 2.0.0-rc.2 → 2.0.0-rc.4
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 +1 -3
- package/cjs/logger/constants.js +1 -2
- package/cjs/logger/messages/error.js +0 -1
- package/cjs/sdkFactory/index.js +1 -3
- package/cjs/storages/dataLoader.js +37 -99
- package/cjs/storages/inMemory/InMemoryStorageCS.js +4 -16
- package/cjs/sync/offline/LocalhostFromObject.js +3 -8
- package/cjs/utils/settingsValidation/index.js +1 -4
- package/esm/logger/constants.js +0 -1
- package/esm/logger/messages/error.js +0 -1
- package/esm/sdkFactory/index.js +2 -4
- package/esm/storages/dataLoader.js +35 -96
- package/esm/storages/inMemory/InMemoryStorageCS.js +4 -16
- package/esm/sync/offline/LocalhostFromObject.js +2 -6
- package/esm/utils/settingsValidation/index.js +1 -4
- package/package.json +3 -2
- package/src/logger/constants.ts +0 -1
- package/src/logger/messages/error.ts +0 -1
- package/src/sdkFactory/index.ts +3 -6
- package/src/storages/dataLoader.ts +38 -97
- package/src/storages/inMemory/InMemoryStorageCS.ts +4 -19
- package/src/storages/types.ts +2 -4
- package/src/sync/offline/LocalhostFromObject.ts +2 -8
- package/src/types.ts +14 -26
- package/src/utils/settingsValidation/index.ts +1 -4
- package/src/utils/settingsValidation/types.ts +0 -2
- package/types/index.d.ts +5 -5
- package/types/splitio.d.ts +2293 -0
- package/cjs/utils/settingsValidation/localhost/builtin.js +0 -18
- package/cjs/utils/settingsValidation/localhost/pluggable.js +0 -22
- package/esm/utils/settingsValidation/localhost/builtin.js +0 -14
- package/esm/utils/settingsValidation/localhost/pluggable.js +0 -18
- package/src/utils/settingsValidation/localhost/builtin.ts +0 -16
- package/src/utils/settingsValidation/localhost/pluggable.ts +0 -22
- package/types/consent/index.d.ts +0 -2
- package/types/consent/sdkUserConsent.d.ts +0 -13
- package/types/dtos/types.d.ts +0 -209
- package/types/evaluator/Engine.d.ts +0 -15
- package/types/evaluator/combiners/and.d.ts +0 -4
- package/types/evaluator/combiners/ifelseif.d.ts +0 -3
- package/types/evaluator/condition/engineUtils.d.ts +0 -11
- package/types/evaluator/condition/index.d.ts +0 -6
- package/types/evaluator/convertions/index.d.ts +0 -2
- package/types/evaluator/index.d.ts +0 -8
- package/types/evaluator/matchers/all.d.ts +0 -1
- package/types/evaluator/matchers/between.d.ts +0 -2
- package/types/evaluator/matchers/boolean.d.ts +0 -1
- package/types/evaluator/matchers/cont_all.d.ts +0 -1
- package/types/evaluator/matchers/cont_any.d.ts +0 -1
- package/types/evaluator/matchers/cont_str.d.ts +0 -1
- package/types/evaluator/matchers/dependency.d.ts +0 -5
- package/types/evaluator/matchers/eq.d.ts +0 -1
- package/types/evaluator/matchers/eq_set.d.ts +0 -1
- package/types/evaluator/matchers/ew.d.ts +0 -1
- package/types/evaluator/matchers/gte.d.ts +0 -1
- package/types/evaluator/matchers/index.d.ts +0 -7
- package/types/evaluator/matchers/large_segment.d.ts +0 -5
- package/types/evaluator/matchers/lte.d.ts +0 -1
- package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
- package/types/evaluator/matchers/part_of.d.ts +0 -1
- package/types/evaluator/matchers/segment.d.ts +0 -5
- package/types/evaluator/matchers/sember_inlist.d.ts +0 -3
- package/types/evaluator/matchers/semver_between.d.ts +0 -2
- package/types/evaluator/matchers/semver_eq.d.ts +0 -1
- package/types/evaluator/matchers/semver_gte.d.ts +0 -1
- package/types/evaluator/matchers/semver_inlist.d.ts +0 -1
- package/types/evaluator/matchers/semver_lte.d.ts +0 -1
- package/types/evaluator/matchers/string.d.ts +0 -1
- package/types/evaluator/matchers/sw.d.ts +0 -1
- package/types/evaluator/matchers/whitelist.d.ts +0 -1
- package/types/evaluator/matchersTransform/index.d.ts +0 -6
- package/types/evaluator/matchersTransform/segment.d.ts +0 -5
- package/types/evaluator/matchersTransform/set.d.ts +0 -5
- package/types/evaluator/matchersTransform/string.d.ts +0 -7
- package/types/evaluator/matchersTransform/unaryNumeric.d.ts +0 -5
- package/types/evaluator/matchersTransform/whitelist.d.ts +0 -5
- package/types/evaluator/parser/index.d.ts +0 -5
- package/types/evaluator/treatments/index.d.ts +0 -8
- package/types/evaluator/types.d.ts +0 -28
- package/types/evaluator/value/index.d.ts +0 -7
- package/types/evaluator/value/sanitize.d.ts +0 -7
- package/types/integrations/browser.d.ts +0 -12
- package/types/integrations/ga/GaToSplit.d.ts +0 -40
- package/types/integrations/ga/GoogleAnalyticsToSplit.d.ts +0 -3
- package/types/integrations/ga/SplitToGa.d.ts +0 -34
- package/types/integrations/ga/SplitToGoogleAnalytics.d.ts +0 -3
- package/types/integrations/ga/types.d.ts +0 -148
- package/types/integrations/pluggable.d.ts +0 -11
- package/types/integrations/types.d.ts +0 -18
- package/types/listeners/browser.d.ts +0 -40
- package/types/listeners/node.d.ts +0 -22
- package/types/listeners/types.d.ts +0 -4
- package/types/logger/browser/DebugLogger.d.ts +0 -2
- package/types/logger/browser/ErrorLogger.d.ts +0 -2
- package/types/logger/browser/InfoLogger.d.ts +0 -2
- package/types/logger/browser/WarnLogger.d.ts +0 -2
- package/types/logger/constants.d.ts +0 -135
- package/types/logger/index.d.ts +0 -21
- package/types/logger/messages/debug.d.ts +0 -1
- package/types/logger/messages/error.d.ts +0 -1
- package/types/logger/messages/info.d.ts +0 -1
- package/types/logger/messages/warn.d.ts +0 -1
- package/types/logger/sdkLogger.d.ts +0 -8
- package/types/logger/types.d.ts +0 -17
- package/types/readiness/constants.d.ts +0 -7
- package/types/readiness/readinessManager.d.ts +0 -6
- package/types/readiness/sdkReadinessManager.d.ts +0 -10
- package/types/readiness/types.d.ts +0 -67
- package/types/sdkClient/client.d.ts +0 -6
- package/types/sdkClient/clientAttributesDecoration.d.ts +0 -55
- package/types/sdkClient/clientCS.d.ts +0 -9
- package/types/sdkClient/clientInputValidation.d.ts +0 -7
- package/types/sdkClient/identity.d.ts +0 -2
- package/types/sdkClient/sdkClient.d.ts +0 -6
- package/types/sdkClient/sdkClientMethod.d.ts +0 -6
- package/types/sdkClient/sdkClientMethodCS.d.ts +0 -7
- package/types/sdkClient/sdkClientMethodCSWithTT.d.ts +0 -8
- package/types/sdkFactory/index.d.ts +0 -6
- package/types/sdkFactory/types.d.ts +0 -85
- package/types/sdkManager/index.d.ts +0 -4
- package/types/services/decorateHeaders.d.ts +0 -2
- package/types/services/splitApi.d.ts +0 -12
- package/types/services/splitHttpClient.d.ts +0 -10
- package/types/services/types.d.ts +0 -54
- package/types/storages/AbstractMySegmentsCacheSync.d.ts +0 -39
- package/types/storages/AbstractSegmentsCacheSync.d.ts +0 -54
- package/types/storages/AbstractSplitsCache.d.ts +0 -46
- package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -38
- package/types/storages/AbstractSplitsCacheSync.d.ts +0 -43
- package/types/storages/KeyBuilder.d.ts +0 -22
- package/types/storages/KeyBuilderCS.d.ts +0 -20
- package/types/storages/KeyBuilderSS.d.ts +0 -20
- package/types/storages/dataLoader.d.ts +0 -21
- package/types/storages/findLatencyIndex.d.ts +0 -7
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -15
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -54
- package/types/storages/inLocalStorage/constants.d.ts +0 -2
- package/types/storages/inLocalStorage/index.d.ts +0 -8
- package/types/storages/inMemory/AttributesCacheInMemory.d.ts +0 -44
- package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
- package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -28
- package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +0 -30
- package/types/storages/inMemory/InMemoryStorage.d.ts +0 -10
- package/types/storages/inMemory/InMemoryStorageCS.d.ts +0 -10
- package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +0 -16
- package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -17
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -27
- package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -71
- package/types/storages/inMemory/UniqueKeysCacheInMemory.d.ts +0 -34
- package/types/storages/inMemory/UniqueKeysCacheInMemoryCS.d.ts +0 -35
- package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
- package/types/storages/inRedis/ImpressionCountsCacheInRedis.d.ts +0 -17
- package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -17
- package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
- package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -21
- package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -95
- package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -35
- package/types/storages/inRedis/UniqueKeysCacheInRedis.d.ts +0 -22
- package/types/storages/inRedis/constants.d.ts +0 -4
- package/types/storages/inRedis/index.d.ts +0 -10
- package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
- package/types/storages/pluggable/ImpressionCountsCachePluggable.d.ts +0 -16
- package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -34
- package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -42
- package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -98
- package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -34
- package/types/storages/pluggable/UniqueKeysCachePluggable.d.ts +0 -20
- package/types/storages/pluggable/constants.d.ts +0 -1
- package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -12
- package/types/storages/pluggable/index.d.ts +0 -9
- package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
- package/types/storages/types.d.ts +0 -410
- package/types/storages/utils.d.ts +0 -8
- package/types/sync/offline/LocalhostFromObject.d.ts +0 -2
- package/types/sync/offline/splitsParser/parseCondition.d.ts +0 -7
- package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +0 -3
- package/types/sync/offline/splitsParser/types.d.ts +0 -3
- package/types/sync/offline/syncManagerOffline.d.ts +0 -10
- package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +0 -17
- package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/types.d.ts +0 -5
- package/types/sync/polling/pollingManagerCS.d.ts +0 -7
- package/types/sync/polling/pollingManagerSS.d.ts +0 -6
- package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +0 -9
- package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +0 -9
- package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +0 -9
- package/types/sync/polling/types.d.ts +0 -33
- package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -14
- package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
- package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -41
- package/types/sync/streaming/AuthClient/index.d.ts +0 -12
- package/types/sync/streaming/AuthClient/types.d.ts +0 -17
- package/types/sync/streaming/SSEClient/index.d.ts +0 -34
- package/types/sync/streaming/SSEClient/types.d.ts +0 -11
- package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +0 -14
- package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +0 -20
- package/types/sync/streaming/SSEHandler/index.d.ts +0 -11
- package/types/sync/streaming/SSEHandler/types.d.ts +0 -72
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -9
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -9
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -14
- package/types/sync/streaming/UpdateWorkers/constants.d.ts +0 -3
- package/types/sync/streaming/UpdateWorkers/types.d.ts +0 -4
- package/types/sync/streaming/constants.d.ts +0 -34
- package/types/sync/streaming/mySegmentsV2utils.d.ts +0 -27
- package/types/sync/streaming/parseUtils.d.ts +0 -34
- package/types/sync/streaming/pushManager.d.ts +0 -9
- package/types/sync/streaming/pushManagerCS_Spec1_3.d.ts +0 -9
- package/types/sync/streaming/pushManager_Spec1_3.d.ts +0 -9
- package/types/sync/streaming/types.d.ts +0 -35
- package/types/sync/submitters/eventsSubmitter.d.ts +0 -5
- package/types/sync/submitters/impressionCountsSubmitter.d.ts +0 -10
- package/types/sync/submitters/impressionsSubmitter.d.ts +0 -11
- package/types/sync/submitters/submitter.d.ts +0 -12
- package/types/sync/submitters/submitterManager.d.ts +0 -3
- package/types/sync/submitters/telemetrySubmitter.d.ts +0 -17
- package/types/sync/submitters/types.d.ts +0 -217
- package/types/sync/submitters/uniqueKeysSubmitter.d.ts +0 -5
- package/types/sync/syncManagerOnline.d.ts +0 -13
- package/types/sync/syncTask.d.ts +0 -13
- package/types/sync/types.d.ts +0 -43
- package/types/trackers/eventTracker.d.ts +0 -10
- package/types/trackers/impressionObserver/ImpressionObserver.d.ts +0 -8
- package/types/trackers/impressionObserver/buildKey.d.ts +0 -2
- package/types/trackers/impressionObserver/impressionObserverCS.d.ts +0 -4
- package/types/trackers/impressionObserver/impressionObserverSS.d.ts +0 -4
- package/types/trackers/impressionObserver/types.d.ts +0 -4
- package/types/trackers/impressionObserver/utils.d.ts +0 -5
- package/types/trackers/impressionsTracker.d.ts +0 -13
- package/types/trackers/strategy/strategyDebug.d.ts +0 -9
- package/types/trackers/strategy/strategyNone.d.ts +0 -10
- package/types/trackers/strategy/strategyOptimized.d.ts +0 -11
- package/types/trackers/telemetryTracker.d.ts +0 -3
- package/types/trackers/types.d.ts +0 -68
- package/types/trackers/uniqueKeysTracker.d.ts +0 -13
- package/types/types.d.ts +0 -1408
- package/types/utils/Backoff.d.ts +0 -25
- package/types/utils/LRUCache/LinkedList.d.ts +0 -34
- package/types/utils/LRUCache/index.d.ts +0 -15
- package/types/utils/MinEventEmitter.d.ts +0 -12
- package/types/utils/MinEvents.d.ts +0 -4
- package/types/utils/base64/index.d.ts +0 -30
- package/types/utils/constants/browser.d.ts +0 -1
- package/types/utils/constants/index.d.ts +0 -83
- package/types/utils/decompress/index.d.ts +0 -16
- package/types/utils/env/isLocalStorageAvailable.d.ts +0 -1
- package/types/utils/env/isNode.d.ts +0 -5
- package/types/utils/inputValidation/apiKey.d.ts +0 -7
- package/types/utils/inputValidation/attribute.d.ts +0 -2
- package/types/utils/inputValidation/attributes.d.ts +0 -4
- package/types/utils/inputValidation/event.d.ts +0 -2
- package/types/utils/inputValidation/eventProperties.d.ts +0 -6
- package/types/utils/inputValidation/eventValue.d.ts +0 -2
- package/types/utils/inputValidation/index.d.ts +0 -13
- package/types/utils/inputValidation/isOperational.d.ts +0 -4
- package/types/utils/inputValidation/key.d.ts +0 -3
- package/types/utils/inputValidation/preloadedData.d.ts +0 -3
- package/types/utils/inputValidation/sdkKey.d.ts +0 -7
- package/types/utils/inputValidation/split.d.ts +0 -2
- package/types/utils/inputValidation/splitExistance.d.ts +0 -7
- package/types/utils/inputValidation/splitExistence.d.ts +0 -7
- package/types/utils/inputValidation/splits.d.ts +0 -2
- package/types/utils/inputValidation/trafficType.d.ts +0 -2
- package/types/utils/inputValidation/trafficTypeExistance.d.ts +0 -9
- package/types/utils/inputValidation/trafficTypeExistence.d.ts +0 -9
- package/types/utils/jwt/index.d.ts +0 -5
- package/types/utils/jwt/types.d.ts +0 -5
- package/types/utils/key/index.d.ts +0 -8
- package/types/utils/labels/index.d.ts +0 -8
- package/types/utils/lang/binarySearch.d.ts +0 -9
- package/types/utils/lang/getFnName.d.ts +0 -4
- package/types/utils/lang/getGlobal.d.ts +0 -4
- package/types/utils/lang/index.d.ts +0 -105
- package/types/utils/lang/maps.d.ts +0 -59
- package/types/utils/lang/objectAssign.d.ts +0 -6
- package/types/utils/lang/sets.d.ts +0 -3
- package/types/utils/murmur3/common.d.ts +0 -12
- package/types/utils/murmur3/legacy.d.ts +0 -2
- package/types/utils/murmur3/murmur3.d.ts +0 -2
- package/types/utils/murmur3/murmur3_128.d.ts +0 -6
- package/types/utils/murmur3/murmur3_128_x86.d.ts +0 -7
- package/types/utils/murmur3/murmur3_64.d.ts +0 -10
- package/types/utils/murmur3/utfx.d.ts +0 -27
- package/types/utils/promise/thenable.d.ts +0 -1
- package/types/utils/promise/timeout.d.ts +0 -1
- package/types/utils/promise/wrapper.d.ts +0 -21
- package/types/utils/redis/RedisMock.d.ts +0 -4
- package/types/utils/semVer.d.ts +0 -15
- package/types/utils/settingsValidation/consent.d.ts +0 -6
- package/types/utils/settingsValidation/impressionsMode.d.ts +0 -3
- package/types/utils/settingsValidation/index.d.ts +0 -51
- package/types/utils/settingsValidation/integrations/common.d.ts +0 -14
- package/types/utils/settingsValidation/integrations/configurable.d.ts +0 -13
- package/types/utils/settingsValidation/integrations/pluggable.d.ts +0 -13
- package/types/utils/settingsValidation/localhost/builtin.d.ts +0 -16
- package/types/utils/settingsValidation/localhost/pluggable.d.ts +0 -16
- package/types/utils/settingsValidation/logger/builtinLogger.d.ts +0 -10
- package/types/utils/settingsValidation/logger/commons.d.ts +0 -9
- package/types/utils/settingsValidation/logger/globalLogLevel.d.ts +0 -8
- package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +0 -11
- package/types/utils/settingsValidation/mode.d.ts +0 -5
- package/types/utils/settingsValidation/runtime.d.ts +0 -2
- package/types/utils/settingsValidation/splitFilters.d.ts +0 -17
- package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -21
- package/types/utils/settingsValidation/types.d.ts +0 -32
- package/types/utils/settingsValidation/url.d.ts +0 -10
- package/types/utils/time/index.d.ts +0 -4
- package/types/utils/timeTracker/now/browser.d.ts +0 -1
- package/types/utils/timeTracker/now/node.d.ts +0 -1
- package/types/utils/timeTracker/timer.d.ts +0 -1
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateLocalhostWithDefault = void 0;
|
|
4
|
-
var LocalhostFromObject_1 = require("../../../sync/offline/LocalhostFromObject");
|
|
5
|
-
var pluggable_1 = require("./pluggable");
|
|
6
|
-
/**
|
|
7
|
-
* This function validates `settings.sync.localhostMode` object
|
|
8
|
-
*
|
|
9
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
10
|
-
*
|
|
11
|
-
* @returns {Object} provided localhost mode module at `settings.sync.localhostMode` if valid, or a default LocalhostFromObject instance if not provided or invalid
|
|
12
|
-
*/
|
|
13
|
-
function validateLocalhostWithDefault(settings) {
|
|
14
|
-
if (!settings.sync.localhostMode)
|
|
15
|
-
return (0, LocalhostFromObject_1.LocalhostFromObject)();
|
|
16
|
-
return (0, pluggable_1.validateLocalhost)(settings) || (0, LocalhostFromObject_1.LocalhostFromObject)();
|
|
17
|
-
}
|
|
18
|
-
exports.validateLocalhostWithDefault = validateLocalhostWithDefault;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateLocalhost = void 0;
|
|
4
|
-
var constants_1 = require("../../../logger/constants");
|
|
5
|
-
var constants_2 = require("../../constants");
|
|
6
|
-
/**
|
|
7
|
-
* This function validates `settings.sync.localhostMode` object
|
|
8
|
-
*
|
|
9
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
10
|
-
*
|
|
11
|
-
* @returns {Object | undefined} provided localhost mode module at `settings.sync.localhostMode`, or undefined if it is not provided or invalid
|
|
12
|
-
*/
|
|
13
|
-
function validateLocalhost(settings) {
|
|
14
|
-
var localhostMode = settings.sync.localhostMode;
|
|
15
|
-
// localhostMode.type is used for internal validation. Not considered part of the public API, and might be updated eventually.
|
|
16
|
-
if (settings.mode === constants_2.LOCALHOST_MODE && (typeof localhostMode !== 'function' || localhostMode.type !== 'LocalhostFromObject')) {
|
|
17
|
-
settings.log.error(constants_1.ERROR_LOCALHOST_MODULE_REQUIRED);
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
return localhostMode;
|
|
21
|
-
}
|
|
22
|
-
exports.validateLocalhost = validateLocalhost;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { LocalhostFromObject } from '../../../sync/offline/LocalhostFromObject';
|
|
2
|
-
import { validateLocalhost } from './pluggable';
|
|
3
|
-
/**
|
|
4
|
-
* This function validates `settings.sync.localhostMode` object
|
|
5
|
-
*
|
|
6
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
7
|
-
*
|
|
8
|
-
* @returns {Object} provided localhost mode module at `settings.sync.localhostMode` if valid, or a default LocalhostFromObject instance if not provided or invalid
|
|
9
|
-
*/
|
|
10
|
-
export function validateLocalhostWithDefault(settings) {
|
|
11
|
-
if (!settings.sync.localhostMode)
|
|
12
|
-
return LocalhostFromObject();
|
|
13
|
-
return validateLocalhost(settings) || LocalhostFromObject();
|
|
14
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ERROR_LOCALHOST_MODULE_REQUIRED } from '../../../logger/constants';
|
|
2
|
-
import { LOCALHOST_MODE } from '../../constants';
|
|
3
|
-
/**
|
|
4
|
-
* This function validates `settings.sync.localhostMode` object
|
|
5
|
-
*
|
|
6
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
7
|
-
*
|
|
8
|
-
* @returns {Object | undefined} provided localhost mode module at `settings.sync.localhostMode`, or undefined if it is not provided or invalid
|
|
9
|
-
*/
|
|
10
|
-
export function validateLocalhost(settings) {
|
|
11
|
-
var localhostMode = settings.sync.localhostMode;
|
|
12
|
-
// localhostMode.type is used for internal validation. Not considered part of the public API, and might be updated eventually.
|
|
13
|
-
if (settings.mode === LOCALHOST_MODE && (typeof localhostMode !== 'function' || localhostMode.type !== 'LocalhostFromObject')) {
|
|
14
|
-
settings.log.error(ERROR_LOCALHOST_MODULE_REQUIRED);
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
return localhostMode;
|
|
18
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../../logger/types';
|
|
2
|
-
import { SDKMode, } from '../../../types';
|
|
3
|
-
import { LocalhostFromObject } from '../../../sync/offline/LocalhostFromObject';
|
|
4
|
-
import { validateLocalhost } from './pluggable';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This function validates `settings.sync.localhostMode` object
|
|
8
|
-
*
|
|
9
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
10
|
-
*
|
|
11
|
-
* @returns {Object} provided localhost mode module at `settings.sync.localhostMode` if valid, or a default LocalhostFromObject instance if not provided or invalid
|
|
12
|
-
*/
|
|
13
|
-
export function validateLocalhostWithDefault(settings: { log: ILogger, sync: { localhostMode?: any }, mode: SDKMode }) {
|
|
14
|
-
if (!settings.sync.localhostMode) return LocalhostFromObject();
|
|
15
|
-
return validateLocalhost(settings) || LocalhostFromObject();
|
|
16
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ERROR_LOCALHOST_MODULE_REQUIRED } from '../../../logger/constants';
|
|
2
|
-
import { ILogger } from '../../../logger/types';
|
|
3
|
-
import { SDKMode, } from '../../../types';
|
|
4
|
-
import { LOCALHOST_MODE } from '../../constants';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This function validates `settings.sync.localhostMode` object
|
|
8
|
-
*
|
|
9
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
10
|
-
*
|
|
11
|
-
* @returns {Object | undefined} provided localhost mode module at `settings.sync.localhostMode`, or undefined if it is not provided or invalid
|
|
12
|
-
*/
|
|
13
|
-
export function validateLocalhost(settings: { log: ILogger, sync: { localhostMode?: any}, mode: SDKMode }) {
|
|
14
|
-
const localhostMode = settings.sync.localhostMode;
|
|
15
|
-
|
|
16
|
-
// localhostMode.type is used for internal validation. Not considered part of the public API, and might be updated eventually.
|
|
17
|
-
if (settings.mode === LOCALHOST_MODE && (typeof localhostMode !== 'function' || localhostMode.type !== 'LocalhostFromObject')) {
|
|
18
|
-
settings.log.error(ERROR_LOCALHOST_MODULE_REQUIRED);
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
return localhostMode;
|
|
22
|
-
}
|
package/types/consent/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
2
|
-
/**
|
|
3
|
-
* The public user consent API exposed via SplitFactory, used to control if the SDK tracks and sends impressions and events or not.
|
|
4
|
-
*/
|
|
5
|
-
export declare function createUserConsentAPI(params: ISdkFactoryContext): {
|
|
6
|
-
setStatus(consent: unknown): boolean;
|
|
7
|
-
getStatus(): import("../types").ConsentStatus | undefined;
|
|
8
|
-
Status: {
|
|
9
|
-
GRANTED: string;
|
|
10
|
-
DECLINED: string;
|
|
11
|
-
UNKNOWN: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
package/types/dtos/types.d.ts
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../types';
|
|
2
|
-
export declare type MaybeThenable<T> = T | Promise<T>;
|
|
3
|
-
/** Split Matchers */
|
|
4
|
-
export declare type IMatcherDataType = null | 'DATETIME' | 'NUMBER';
|
|
5
|
-
export interface IUnaryNumericMatcherData {
|
|
6
|
-
dataType: IMatcherDataType;
|
|
7
|
-
value: number;
|
|
8
|
-
}
|
|
9
|
-
export interface IBetweenMatcherData {
|
|
10
|
-
dataType: IMatcherDataType;
|
|
11
|
-
start: number;
|
|
12
|
-
end: number;
|
|
13
|
-
}
|
|
14
|
-
export interface IBetweenStringMatcherData {
|
|
15
|
-
start: string;
|
|
16
|
-
end: string;
|
|
17
|
-
}
|
|
18
|
-
export interface IWhitelistMatcherData {
|
|
19
|
-
whitelist: string[];
|
|
20
|
-
}
|
|
21
|
-
export interface IInSegmentMatcherData {
|
|
22
|
-
segmentName: string;
|
|
23
|
-
}
|
|
24
|
-
export interface IInLargeSegmentMatcherData {
|
|
25
|
-
largeSegmentName: string;
|
|
26
|
-
}
|
|
27
|
-
export interface IDependencyMatcherData {
|
|
28
|
-
split: string;
|
|
29
|
-
treatments: string[];
|
|
30
|
-
}
|
|
31
|
-
interface ISplitMatcherBase {
|
|
32
|
-
matcherType: string;
|
|
33
|
-
negate: boolean;
|
|
34
|
-
keySelector: null | {
|
|
35
|
-
trafficType: string;
|
|
36
|
-
attribute: string | null;
|
|
37
|
-
};
|
|
38
|
-
userDefinedSegmentMatcherData?: null | IInSegmentMatcherData;
|
|
39
|
-
userDefinedLargeSegmentMatcherData?: null | IInLargeSegmentMatcherData;
|
|
40
|
-
whitelistMatcherData?: null | IWhitelistMatcherData;
|
|
41
|
-
unaryNumericMatcherData?: null | IUnaryNumericMatcherData;
|
|
42
|
-
betweenMatcherData?: null | IBetweenMatcherData;
|
|
43
|
-
dependencyMatcherData?: null | IDependencyMatcherData;
|
|
44
|
-
booleanMatcherData?: null | boolean;
|
|
45
|
-
stringMatcherData?: null | string;
|
|
46
|
-
betweenStringMatcherData?: null | IBetweenStringMatcherData;
|
|
47
|
-
}
|
|
48
|
-
interface IAllKeysMatcher extends ISplitMatcherBase {
|
|
49
|
-
matcherType: 'ALL_KEYS';
|
|
50
|
-
}
|
|
51
|
-
interface IInSegmentMatcher extends ISplitMatcherBase {
|
|
52
|
-
matcherType: 'IN_SEGMENT';
|
|
53
|
-
userDefinedSegmentMatcherData: IInSegmentMatcherData;
|
|
54
|
-
}
|
|
55
|
-
interface IInLargeSegmentMatcher extends ISplitMatcherBase {
|
|
56
|
-
matcherType: 'IN_LARGE_SEGMENT';
|
|
57
|
-
userDefinedLargeSegmentMatcherData: IInLargeSegmentMatcherData;
|
|
58
|
-
}
|
|
59
|
-
interface IWhitelistMatcher extends ISplitMatcherBase {
|
|
60
|
-
matcherType: 'WHITELIST';
|
|
61
|
-
whitelistMatcherData: IWhitelistMatcherData;
|
|
62
|
-
}
|
|
63
|
-
interface IEqualToMatcher extends ISplitMatcherBase {
|
|
64
|
-
matcherType: 'EQUAL_TO';
|
|
65
|
-
unaryNumericMatcherData: IUnaryNumericMatcherData;
|
|
66
|
-
}
|
|
67
|
-
interface IGreaterThanOrEqualToMatcher extends ISplitMatcherBase {
|
|
68
|
-
matcherType: 'GREATER_THAN_OR_EQUAL_TO';
|
|
69
|
-
unaryNumericMatcherData: IUnaryNumericMatcherData;
|
|
70
|
-
}
|
|
71
|
-
interface ILessThanOrEqualToMatcher extends ISplitMatcherBase {
|
|
72
|
-
matcherType: 'LESS_THAN_OR_EQUAL_TO';
|
|
73
|
-
unaryNumericMatcherData: IUnaryNumericMatcherData;
|
|
74
|
-
}
|
|
75
|
-
interface IBetweenMatcher extends ISplitMatcherBase {
|
|
76
|
-
matcherType: 'BETWEEN';
|
|
77
|
-
betweenMatcherData: IBetweenMatcherData;
|
|
78
|
-
}
|
|
79
|
-
interface IEqualToSetMatcher extends ISplitMatcherBase {
|
|
80
|
-
matcherType: 'EQUAL_TO_SET';
|
|
81
|
-
whitelistMatcherData: IWhitelistMatcherData;
|
|
82
|
-
}
|
|
83
|
-
interface IContainsAnyOfSetMatcher extends ISplitMatcherBase {
|
|
84
|
-
matcherType: 'CONTAINS_ANY_OF_SET';
|
|
85
|
-
whitelistMatcherData: IWhitelistMatcherData;
|
|
86
|
-
}
|
|
87
|
-
interface IContainsAllOfSetMatcher extends ISplitMatcherBase {
|
|
88
|
-
matcherType: 'CONTAINS_ALL_OF_SET';
|
|
89
|
-
whitelistMatcherData: IWhitelistMatcherData;
|
|
90
|
-
}
|
|
91
|
-
interface IPartOfSetMatcher extends ISplitMatcherBase {
|
|
92
|
-
matcherType: 'PART_OF_SET';
|
|
93
|
-
whitelistMatcherData: IWhitelistMatcherData;
|
|
94
|
-
}
|
|
95
|
-
interface IStartsWithMatcher extends ISplitMatcherBase {
|
|
96
|
-
matcherType: 'STARTS_WITH';
|
|
97
|
-
whitelistMatcherData: IWhitelistMatcherData;
|
|
98
|
-
}
|
|
99
|
-
interface IEndsWithMatcher extends ISplitMatcherBase {
|
|
100
|
-
matcherType: 'ENDS_WITH';
|
|
101
|
-
whitelistMatcherData: IWhitelistMatcherData;
|
|
102
|
-
}
|
|
103
|
-
interface IContainsStringMatcher extends ISplitMatcherBase {
|
|
104
|
-
matcherType: 'CONTAINS_STRING';
|
|
105
|
-
whitelistMatcherData: IWhitelistMatcherData;
|
|
106
|
-
}
|
|
107
|
-
interface IInSplitTreatmentMatcher extends ISplitMatcherBase {
|
|
108
|
-
matcherType: 'IN_SPLIT_TREATMENT';
|
|
109
|
-
dependencyMatcherData: IDependencyMatcherData;
|
|
110
|
-
}
|
|
111
|
-
interface IEqualToBooleanMatcher extends ISplitMatcherBase {
|
|
112
|
-
matcherType: 'EQUAL_TO_BOOLEAN';
|
|
113
|
-
booleanMatcherData: boolean;
|
|
114
|
-
}
|
|
115
|
-
interface IMatchesStringMatcher extends ISplitMatcherBase {
|
|
116
|
-
matcherType: 'MATCHES_STRING';
|
|
117
|
-
stringMatcherData: string;
|
|
118
|
-
}
|
|
119
|
-
interface IEqualToSemverMatcher extends ISplitMatcherBase {
|
|
120
|
-
matcherType: 'EQUAL_TO_SEMVER';
|
|
121
|
-
stringMatcherData: string;
|
|
122
|
-
}
|
|
123
|
-
interface IGreaterThanOrEqualToSemverMatcher extends ISplitMatcherBase {
|
|
124
|
-
matcherType: 'GREATER_THAN_OR_EQUAL_TO_SEMVER';
|
|
125
|
-
stringMatcherData: string;
|
|
126
|
-
}
|
|
127
|
-
interface ILessThanOrEqualToSemverMatcher extends ISplitMatcherBase {
|
|
128
|
-
matcherType: 'LESS_THAN_OR_EQUAL_TO_SEMVER';
|
|
129
|
-
stringMatcherData: string;
|
|
130
|
-
}
|
|
131
|
-
interface IBetweenSemverMatcher extends ISplitMatcherBase {
|
|
132
|
-
matcherType: 'BETWEEN_SEMVER';
|
|
133
|
-
betweenStringMatcherData: IBetweenStringMatcherData;
|
|
134
|
-
}
|
|
135
|
-
interface IInListSemverMatcher extends ISplitMatcherBase {
|
|
136
|
-
matcherType: 'IN_LIST_SEMVER';
|
|
137
|
-
whitelistMatcherData: IWhitelistMatcherData;
|
|
138
|
-
}
|
|
139
|
-
export declare type ISplitMatcher = IAllKeysMatcher | IInSegmentMatcher | IWhitelistMatcher | IEqualToMatcher | IGreaterThanOrEqualToMatcher | ILessThanOrEqualToMatcher | IBetweenMatcher | IEqualToSetMatcher | IContainsAnyOfSetMatcher | IContainsAllOfSetMatcher | IPartOfSetMatcher | IStartsWithMatcher | IEndsWithMatcher | IContainsStringMatcher | IInSplitTreatmentMatcher | IEqualToBooleanMatcher | IMatchesStringMatcher | IEqualToSemverMatcher | IGreaterThanOrEqualToSemverMatcher | ILessThanOrEqualToSemverMatcher | IBetweenSemverMatcher | IInListSemverMatcher | IInLargeSegmentMatcher;
|
|
140
|
-
/** Split object */
|
|
141
|
-
export interface ISplitPartition {
|
|
142
|
-
treatment: string;
|
|
143
|
-
size: number;
|
|
144
|
-
}
|
|
145
|
-
export interface ISplitCondition {
|
|
146
|
-
matcherGroup: {
|
|
147
|
-
combiner: 'AND';
|
|
148
|
-
matchers: ISplitMatcher[];
|
|
149
|
-
};
|
|
150
|
-
partitions: ISplitPartition[];
|
|
151
|
-
label: string;
|
|
152
|
-
conditionType: 'ROLLOUT' | 'WHITELIST';
|
|
153
|
-
}
|
|
154
|
-
export interface ISplit {
|
|
155
|
-
name: string;
|
|
156
|
-
changeNumber: number;
|
|
157
|
-
killed: boolean;
|
|
158
|
-
defaultTreatment: string;
|
|
159
|
-
trafficTypeName: string;
|
|
160
|
-
conditions: ISplitCondition[];
|
|
161
|
-
status: 'ACTIVE' | 'ARCHIVED';
|
|
162
|
-
seed: number;
|
|
163
|
-
trafficAllocation?: number;
|
|
164
|
-
trafficAllocationSeed?: number;
|
|
165
|
-
configurations?: {
|
|
166
|
-
[treatmentName: string]: string;
|
|
167
|
-
};
|
|
168
|
-
sets?: string[];
|
|
169
|
-
}
|
|
170
|
-
export declare type ISplitPartial = Pick<ISplit, 'conditions' | 'configurations' | 'trafficTypeName'>;
|
|
171
|
-
/** Interface of the parsed JSON response of `/splitChanges` */
|
|
172
|
-
export interface ISplitChangesResponse {
|
|
173
|
-
till: number;
|
|
174
|
-
splits: ISplit[];
|
|
175
|
-
}
|
|
176
|
-
/** Interface of the parsed JSON response of `/segmentChanges/{segmentName}` */
|
|
177
|
-
export interface ISegmentChangesResponse {
|
|
178
|
-
name: string;
|
|
179
|
-
added: string[];
|
|
180
|
-
removed: string[];
|
|
181
|
-
since: number;
|
|
182
|
-
till: number;
|
|
183
|
-
}
|
|
184
|
-
export interface IMySegmentsResponse {
|
|
185
|
-
cn?: number;
|
|
186
|
-
k?: {
|
|
187
|
-
n: string;
|
|
188
|
-
}[];
|
|
189
|
-
}
|
|
190
|
-
/** Interface of the parsed JSON response of `/memberships/{userKey}` */
|
|
191
|
-
export interface IMembershipsResponse {
|
|
192
|
-
ms?: IMySegmentsResponse;
|
|
193
|
-
ls?: IMySegmentsResponse;
|
|
194
|
-
}
|
|
195
|
-
/** Metadata internal type for storages */
|
|
196
|
-
export interface IMetadata {
|
|
197
|
-
/** SDK version */
|
|
198
|
-
s: string;
|
|
199
|
-
/** host IP */
|
|
200
|
-
i: string;
|
|
201
|
-
/** host name */
|
|
202
|
-
n: string;
|
|
203
|
-
}
|
|
204
|
-
export declare type ISplitFiltersValidation = {
|
|
205
|
-
queryString: string | null;
|
|
206
|
-
groupedFilters: Record<SplitIO.SplitFilterType, string[]>;
|
|
207
|
-
validFilters: SplitIO.SplitFilter[];
|
|
208
|
-
};
|
|
209
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ISplit, MaybeThenable } from '../dtos/types';
|
|
2
|
-
import { SplitIO } from '../types';
|
|
3
|
-
import { IStorageAsync, IStorageSync } from '../storages/types';
|
|
4
|
-
import { IEvaluationResult, IEvaluator, ISplitEvaluator } from './types';
|
|
5
|
-
import { ILogger } from '../logger/types';
|
|
6
|
-
export declare class Engine {
|
|
7
|
-
private baseInfo;
|
|
8
|
-
private evaluator;
|
|
9
|
-
constructor(baseInfo: ISplit, evaluator: IEvaluator);
|
|
10
|
-
static parse(log: ILogger, splitFlatStructure: ISplit, storage: IStorageSync | IStorageAsync): Engine;
|
|
11
|
-
getKey(): string;
|
|
12
|
-
getTreatment(key: SplitIO.SplitKey, attributes: SplitIO.Attributes | undefined, splitEvaluator: ISplitEvaluator): MaybeThenable<IEvaluationResult>;
|
|
13
|
-
isGarbage(): boolean;
|
|
14
|
-
getChangeNumber(): number;
|
|
15
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../logger/types';
|
|
2
|
-
/**
|
|
3
|
-
* Get the treatment name given a key, a seed, and the percentage of each treatment.
|
|
4
|
-
*/
|
|
5
|
-
export declare function getTreatment(log: ILogger, key: string, seed: number, treatments: {
|
|
6
|
-
getTreatmentFor: (x: number) => string;
|
|
7
|
-
}): string;
|
|
8
|
-
/**
|
|
9
|
-
* Evaluates the traffic allocation to see if we should apply rollout conditions or not.
|
|
10
|
-
*/
|
|
11
|
-
export declare function shouldApplyRollout(trafficAllocation: number, key: string, trafficAllocationSeed: number): boolean;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { MaybeThenable } from '../../dtos/types';
|
|
2
|
-
import { IEvaluator } from '../types';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
|
-
export declare function conditionContext(log: ILogger, matcherEvaluator: (...args: any) => MaybeThenable<boolean>, treatments: {
|
|
5
|
-
getTreatmentFor: (x: number) => string;
|
|
6
|
-
}, label: string, conditionType: 'ROLLOUT' | 'WHITELIST'): IEvaluator;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MaybeThenable } from '../dtos/types';
|
|
2
|
-
import { IStorageAsync, IStorageSync } from '../storages/types';
|
|
3
|
-
import { IEvaluationResult } from './types';
|
|
4
|
-
import { SplitIO } from '../types';
|
|
5
|
-
import { ILogger } from '../logger/types';
|
|
6
|
-
export declare function evaluateFeature(log: ILogger, key: SplitIO.SplitKey, splitName: string, attributes: SplitIO.Attributes | undefined, storage: IStorageSync | IStorageAsync): MaybeThenable<IEvaluationResult>;
|
|
7
|
-
export declare function evaluateFeatures(log: ILogger, key: SplitIO.SplitKey, splitNames: string[], attributes: SplitIO.Attributes | undefined, storage: IStorageSync | IStorageAsync): MaybeThenable<Record<string, IEvaluationResult>>;
|
|
8
|
-
export declare function evaluateFeaturesByFlagSets(log: ILogger, key: SplitIO.SplitKey, flagSets: string[], attributes: SplitIO.Attributes | undefined, storage: IStorageSync | IStorageAsync, method: string): MaybeThenable<Record<string, IEvaluationResult>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function allMatcherContext(): (runtimeAttr: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function booleanMatcherContext(ruleAttr: boolean): (runtimeAttr: boolean) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function containsAllSetMatcherContext(ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function containsAnySetMatcherContext(ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function containsStringMatcherContext(ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IDependencyMatcherData, MaybeThenable } from '../../dtos/types';
|
|
2
|
-
import { IStorageAsync, IStorageSync } from '../../storages/types';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
|
-
import { IDependencyMatcherValue, ISplitEvaluator } from '../types';
|
|
5
|
-
export declare function dependencyMatcherContext({ split, treatments }: IDependencyMatcherData, storage: IStorageSync | IStorageAsync, log: ILogger): ({ key, attributes }: IDependencyMatcherValue, splitEvaluator: ISplitEvaluator) => MaybeThenable<boolean>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function equalToMatcherContext(ruleAttr: number): (runtimeAttr: number) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function equalToSetMatcherContext(ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function endsWithMatcherContext(ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function greaterThanEqualMatcherContext(ruleAttr: number): (runtimeAttr: number) => boolean;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IStorageAsync, IStorageSync } from '../../storages/types';
|
|
2
|
-
import { IMatcher, IMatcherDto } from '../types';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
|
-
/**
|
|
5
|
-
* Matcher factory.
|
|
6
|
-
*/
|
|
7
|
-
export declare function matcherFactory(log: ILogger, matcherDto: IMatcherDto, storage?: IStorageSync | IStorageAsync): IMatcher | undefined;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { MaybeThenable } from '../../dtos/types';
|
|
2
|
-
import { ISegmentsCacheBase } from '../../storages/types';
|
|
3
|
-
export declare function largeSegmentMatcherContext(largeSegmentName: string, storage: {
|
|
4
|
-
largeSegments?: ISegmentsCacheBase;
|
|
5
|
-
}): (key: string) => MaybeThenable<boolean>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function lessThanEqualMatcherContext(ruleAttr: number): (runtimeAttr: number) => boolean;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const matcherTypes: Record<string, number>;
|
|
2
|
-
export declare const matcherDataTypes: {
|
|
3
|
-
BOOLEAN: string;
|
|
4
|
-
STRING: string;
|
|
5
|
-
NUMBER: string;
|
|
6
|
-
SET: string;
|
|
7
|
-
DATETIME: string;
|
|
8
|
-
NOT_SPECIFIED: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function matcherTypesMapper(matcherType: string): number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function partOfSetMatcherContext(ruleAttr: string[]): (runtimeAttr: string[]) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function equalToSemverMatcherContext(ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function greaterThanEqualToSemverMatcherContext(ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function inListSemverMatcherContext(ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function lessThanEqualToSemverMatcherContext(ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function stringMatcherContext(ruleAttr: string): (runtimeAttr: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function startsWithMatcherContext(ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function whitelistMatcherContext(ruleAttr: string[]): (runtimeAttr: string) => boolean;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IEvaluator } from '../types';
|
|
2
|
-
import { ISplitCondition } from '../../dtos/types';
|
|
3
|
-
import { IStorageAsync, IStorageSync } from '../../storages/types';
|
|
4
|
-
import { ILogger } from '../../logger/types';
|
|
5
|
-
export declare function parser(log: ILogger, conditions: ISplitCondition[], storage: IStorageSync | IStorageAsync): IEvaluator;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ISplitPartition } from '../../dtos/types';
|
|
2
|
-
export declare class Treatments {
|
|
3
|
-
private _ranges;
|
|
4
|
-
private _treatments;
|
|
5
|
-
constructor(ranges: number[], treatments: string[]);
|
|
6
|
-
static parse(data: ISplitPartition[]): Treatments;
|
|
7
|
-
getTreatmentFor(x: number): string;
|
|
8
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IBetweenMatcherData, IBetweenStringMatcherData, IDependencyMatcherData, MaybeThenable } from '../dtos/types';
|
|
2
|
-
import { IStorageAsync, IStorageSync } from '../storages/types';
|
|
3
|
-
import { SplitIO } from '../types';
|
|
4
|
-
import { ILogger } from '../logger/types';
|
|
5
|
-
export interface IDependencyMatcherValue {
|
|
6
|
-
key: SplitIO.SplitKey;
|
|
7
|
-
attributes?: SplitIO.Attributes;
|
|
8
|
-
}
|
|
9
|
-
export interface IMatcherDto {
|
|
10
|
-
type: number;
|
|
11
|
-
name: string;
|
|
12
|
-
value?: string | number | boolean | string[] | IDependencyMatcherData | IBetweenMatcherData | IBetweenStringMatcherData | null;
|
|
13
|
-
attribute: string | null;
|
|
14
|
-
negate: boolean;
|
|
15
|
-
dataType: string;
|
|
16
|
-
}
|
|
17
|
-
export interface IEvaluation {
|
|
18
|
-
treatment?: string;
|
|
19
|
-
label: string;
|
|
20
|
-
changeNumber?: number;
|
|
21
|
-
config?: string | null;
|
|
22
|
-
}
|
|
23
|
-
export declare type IEvaluationResult = IEvaluation & {
|
|
24
|
-
treatment: string;
|
|
25
|
-
};
|
|
26
|
-
export declare type ISplitEvaluator = (log: ILogger, key: SplitIO.SplitKey, splitName: string, attributes: SplitIO.Attributes | undefined, storage: IStorageSync | IStorageAsync) => MaybeThenable<IEvaluation>;
|
|
27
|
-
export declare type IEvaluator = (key: SplitIO.SplitKey, seed: number, trafficAllocation?: number, trafficAllocationSeed?: number, attributes?: SplitIO.Attributes, splitEvaluator?: ISplitEvaluator) => MaybeThenable<IEvaluation | undefined>;
|
|
28
|
-
export declare type IMatcher = (...args: any) => MaybeThenable<boolean>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../../types';
|
|
2
|
-
import { IMatcherDto } from '../types';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
|
-
/**
|
|
5
|
-
* Defines value to be matched (key / attribute).
|
|
6
|
-
*/
|
|
7
|
-
export declare function sanitizeValue(log: ILogger, key: string, matcherDto: IMatcherDto, attributes?: SplitIO.Attributes): string | number | boolean | (string | number)[] | import("../types").IDependencyMatcherValue | undefined;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../../types';
|
|
2
|
-
import { IDependencyMatcherValue } from '../types';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
|
-
/**
|
|
5
|
-
* Sanitize matcher value
|
|
6
|
-
*/
|
|
7
|
-
export declare function sanitize(log: ILogger, matcherTypeID: number, value: string | number | boolean | Array<string | number> | undefined, dataType: string, attributes?: SplitIO.Attributes): string | number | boolean | (string | number)[] | IDependencyMatcherValue | undefined;
|