@splitsoftware/splitio-commons 2.5.0-rc.0 → 11.5.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.txt +893 -142
- package/CONTRIBUTORS-GUIDE.md +26 -16
- package/README.md +43 -5
- package/cjs/factory/browser.js +73 -0
- package/cjs/factory/node.js +79 -0
- package/cjs/factory/package.json +4 -0
- package/cjs/index.js +3 -16
- package/cjs/{utils/MinEvents.js → platform/EventEmitter.js} +153 -27
- package/cjs/platform/browser.js +15 -0
- package/cjs/platform/filter/bloomFilter.js +32 -0
- package/cjs/platform/getEventSource/browser.js +7 -0
- package/cjs/platform/getEventSource/eventsource.js +480 -0
- package/cjs/platform/getEventSource/node.js +25 -0
- package/cjs/platform/getEventSource/package.json +4 -0
- package/cjs/platform/getFetch/browser.js +9 -0
- package/cjs/platform/getFetch/node.js +26 -0
- package/cjs/platform/getFetch/package.json +4 -0
- package/cjs/platform/getOptions/node.js +25 -0
- package/cjs/platform/node.js +18 -0
- package/cjs/platform/package.json +4 -0
- package/cjs/settings/browser.js +21 -0
- package/cjs/settings/defaults/browser.js +21 -0
- package/cjs/settings/defaults/node.js +23 -0
- package/cjs/{listeners/types.js → settings/defaults/version.js} +2 -0
- package/cjs/settings/integrations/browser.js +9 -0
- package/cjs/settings/node.js +22 -0
- package/cjs/settings/package.json +4 -0
- package/cjs/settings/runtime/node.js +22 -0
- package/cjs/settings/storage/browser.js +35 -0
- package/cjs/settings/storage/node.js +67 -0
- package/cjs/sync/offline/LocalhostFromFile.js +8 -0
- package/cjs/sync/offline/splitsParserFromFile.js +148 -0
- package/cjs/umd.js +5 -0
- package/cjs/utils/ip.js +114 -0
- package/client/package.json +5 -0
- package/esm/factory/browser.js +69 -0
- package/esm/factory/node.js +75 -0
- package/esm/factory/package.json +4 -0
- package/esm/index.js +1 -10
- package/esm/{utils/MinEvents.js → platform/EventEmitter.js} +143 -17
- package/esm/platform/browser.js +12 -0
- package/esm/platform/filter/bloomFilter.js +28 -0
- package/esm/platform/getEventSource/browser.js +3 -0
- package/esm/platform/getEventSource/eventsource.js +480 -0
- package/esm/platform/getEventSource/node.js +19 -0
- package/esm/platform/getEventSource/package.json +4 -0
- package/esm/platform/getFetch/browser.js +4 -0
- package/esm/platform/getFetch/node.js +21 -0
- package/esm/platform/getFetch/package.json +4 -0
- package/esm/platform/getOptions/node.js +20 -0
- package/esm/platform/node.js +14 -0
- package/esm/platform/package.json +4 -0
- package/esm/settings/browser.js +17 -0
- package/esm/settings/defaults/browser.js +18 -0
- package/esm/settings/defaults/node.js +20 -0
- package/esm/settings/defaults/version.js +1 -0
- package/esm/settings/integrations/browser.js +5 -0
- package/esm/settings/node.js +18 -0
- package/esm/settings/package.json +4 -0
- package/esm/settings/runtime/node.js +17 -0
- package/esm/settings/storage/browser.js +31 -0
- package/esm/settings/storage/node.js +63 -0
- package/esm/sync/offline/LocalhostFromFile.js +5 -0
- package/esm/sync/offline/splitsParserFromFile.js +143 -0
- package/esm/umd.js +3 -0
- package/esm/utils/ip.js +109 -0
- package/package.json +99 -58
- package/server/package.json +5 -0
- package/src/factory/browser.js +85 -0
- package/src/factory/node.js +92 -0
- package/src/factory/package.json +4 -0
- package/src/index.js +1 -0
- package/src/{utils/MinEvents.ts → platform/EventEmitter.js} +164 -19
- package/src/platform/browser.js +14 -0
- package/src/platform/filter/bloomFilter.js +33 -0
- package/src/platform/getEventSource/browser.js +3 -0
- package/src/platform/getEventSource/eventsource.js +519 -0
- package/src/platform/getEventSource/node.js +20 -0
- package/src/platform/getEventSource/package.json +4 -0
- package/src/platform/getFetch/browser.js +5 -0
- package/src/platform/getFetch/node.js +24 -0
- package/src/platform/getFetch/package.json +4 -0
- package/src/platform/getOptions/node.js +23 -0
- package/src/platform/node.js +16 -0
- package/src/platform/package.json +4 -0
- package/src/settings/browser.js +20 -0
- package/src/settings/defaults/browser.js +21 -0
- package/src/settings/defaults/node.js +23 -0
- package/src/settings/defaults/version.js +1 -0
- package/src/settings/integrations/browser.js +6 -0
- package/src/settings/node.js +21 -0
- package/src/settings/package.json +4 -0
- package/src/settings/runtime/node.js +21 -0
- package/src/settings/storage/browser.js +47 -0
- package/src/settings/storage/node.js +84 -0
- package/src/sync/offline/LocalhostFromFile.js +6 -0
- package/src/sync/offline/splitsParserFromFile.js +173 -0
- package/src/umd.js +4 -0
- package/src/utils/ip.js +123 -0
- package/types/client/index.d.ts +15 -0
- package/types/index.d.ts +24 -1
- package/types/server/index.d.ts +21 -0
- package/types/splitio.d.ts +2 -2087
- package/cjs/consent/index.js +0 -10
- package/cjs/consent/sdkUserConsent.js +0 -60
- package/cjs/dtos/types.js +0 -2
- package/cjs/evaluator/Engine.js +0 -58
- package/cjs/evaluator/combiners/and.js +0 -25
- package/cjs/evaluator/combiners/ifelseif.js +0 -48
- package/cjs/evaluator/condition/engineUtils.js +0 -29
- package/cjs/evaluator/condition/index.js +0 -41
- package/cjs/evaluator/convertions/index.js +0 -11
- package/cjs/evaluator/index.js +0 -134
- package/cjs/evaluator/matchers/all.js +0 -9
- package/cjs/evaluator/matchers/between.js +0 -10
- package/cjs/evaluator/matchers/boolean.js +0 -10
- package/cjs/evaluator/matchers/cont_all.js +0 -23
- package/cjs/evaluator/matchers/cont_any.js +0 -18
- package/cjs/evaluator/matchers/cont_str.js +0 -11
- package/cjs/evaluator/matchers/dependency.js +0 -28
- package/cjs/evaluator/matchers/eq.js +0 -10
- package/cjs/evaluator/matchers/eq_set.js +0 -20
- package/cjs/evaluator/matchers/ew.js +0 -11
- package/cjs/evaluator/matchers/gte.js +0 -10
- package/cjs/evaluator/matchers/index.js +0 -66
- package/cjs/evaluator/matchers/large_segment.js +0 -10
- package/cjs/evaluator/matchers/lte.js +0 -10
- package/cjs/evaluator/matchers/matcherTypes.js +0 -46
- package/cjs/evaluator/matchers/part_of.js +0 -20
- package/cjs/evaluator/matchers/prerequisites.js +0 -22
- package/cjs/evaluator/matchers/rbsegment.js +0 -56
- package/cjs/evaluator/matchers/segment.js +0 -10
- package/cjs/evaluator/matchers/semver_between.js +0 -14
- package/cjs/evaluator/matchers/semver_eq.js +0 -13
- package/cjs/evaluator/matchers/semver_gte.js +0 -13
- package/cjs/evaluator/matchers/semver_inlist.js +0 -16
- package/cjs/evaluator/matchers/semver_lte.js +0 -13
- package/cjs/evaluator/matchers/string.js +0 -11
- package/cjs/evaluator/matchers/sw.js +0 -11
- package/cjs/evaluator/matchers/whitelist.js +0 -11
- package/cjs/evaluator/matchersTransform/index.js +0 -104
- package/cjs/evaluator/matchersTransform/segment.js +0 -12
- package/cjs/evaluator/matchersTransform/unaryNumeric.js +0 -10
- package/cjs/evaluator/matchersTransform/whitelist.js +0 -10
- package/cjs/evaluator/parser/index.js +0 -61
- package/cjs/evaluator/treatments/index.js +0 -42
- package/cjs/evaluator/types.js +0 -2
- package/cjs/evaluator/value/index.js +0 -37
- package/cjs/evaluator/value/sanitize.js +0 -94
- package/cjs/integrations/pluggable.js +0 -35
- package/cjs/integrations/types.js +0 -2
- package/cjs/listeners/browser.js +0 -121
- package/cjs/listeners/node.js +0 -68
- package/cjs/logger/browser/DebugLogger.js +0 -9
- package/cjs/logger/browser/ErrorLogger.js +0 -9
- package/cjs/logger/browser/InfoLogger.js +0 -9
- package/cjs/logger/browser/WarnLogger.js +0 -9
- package/cjs/logger/constants.js +0 -140
- package/cjs/logger/index.js +0 -100
- package/cjs/logger/messages/debug.js +0 -36
- package/cjs/logger/messages/error.js +0 -42
- package/cjs/logger/messages/info.js +0 -37
- package/cjs/logger/messages/warn.js +0 -42
- package/cjs/logger/sdkLogger.js +0 -45
- package/cjs/logger/types.js +0 -2
- package/cjs/readiness/constants.js +0 -13
- package/cjs/readiness/readinessManager.js +0 -154
- package/cjs/readiness/sdkReadinessManager.js +0 -104
- package/cjs/readiness/types.js +0 -2
- package/cjs/sdkClient/client.js +0 -183
- package/cjs/sdkClient/clientAttributesDecoration.js +0 -122
- package/cjs/sdkClient/clientCS.js +0 -30
- package/cjs/sdkClient/clientInputValidation.js +0 -147
- package/cjs/sdkClient/identity.js +0 -7
- package/cjs/sdkClient/sdkClient.js +0 -64
- package/cjs/sdkClient/sdkClientMethod.js +0 -22
- package/cjs/sdkClient/sdkClientMethodCS.js +0 -66
- package/cjs/sdkFactory/index.js +0 -108
- package/cjs/sdkFactory/types.js +0 -2
- package/cjs/sdkManager/index.js +0 -96
- package/cjs/services/decorateHeaders.js +0 -40
- package/cjs/services/splitApi.js +0 -131
- package/cjs/services/splitHttpClient.js +0 -82
- package/cjs/services/types.js +0 -2
- package/cjs/storages/AbstractMySegmentsCacheSync.js +0 -60
- package/cjs/storages/AbstractSplitsCacheAsync.js +0 -51
- package/cjs/storages/AbstractSplitsCacheSync.js +0 -75
- package/cjs/storages/KeyBuilder.js +0 -68
- package/cjs/storages/KeyBuilderCS.js +0 -65
- package/cjs/storages/KeyBuilderSS.js +0 -60
- package/cjs/storages/dataLoader.js +0 -109
- package/cjs/storages/findLatencyIndex.js +0 -18
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +0 -81
- package/cjs/storages/inLocalStorage/RBSegmentsCacheInLocal.js +0 -121
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +0 -208
- package/cjs/storages/inLocalStorage/constants.js +0 -5
- package/cjs/storages/inLocalStorage/index.js +0 -73
- package/cjs/storages/inLocalStorage/validateCache.js +0 -80
- package/cjs/storages/inMemory/AttributesCacheInMemory.js +0 -70
- package/cjs/storages/inMemory/EventsCacheInMemory.js +0 -63
- package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +0 -65
- package/cjs/storages/inMemory/ImpressionsCacheInMemory.js +0 -51
- package/cjs/storages/inMemory/InMemoryStorage.js +0 -46
- package/cjs/storages/inMemory/InMemoryStorageCS.js +0 -81
- package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +0 -46
- package/cjs/storages/inMemory/RBSegmentsCacheInMemory.js +0 -65
- package/cjs/storages/inMemory/SegmentsCacheInMemory.js +0 -61
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +0 -121
- package/cjs/storages/inMemory/TelemetryCacheInMemory.js +0 -207
- package/cjs/storages/inMemory/UniqueKeysCacheInMemory.js +0 -72
- package/cjs/storages/inMemory/UniqueKeysCacheInMemoryCS.js +0 -71
- package/cjs/storages/inRedis/EventsCacheInRedis.js +0 -60
- package/cjs/storages/inRedis/ImpressionCountsCacheInRedis.js +0 -85
- package/cjs/storages/inRedis/ImpressionsCacheInRedis.js +0 -45
- package/cjs/storages/inRedis/RBSegmentsCacheInRedis.js +0 -64
- package/cjs/storages/inRedis/RedisAdapter.js +0 -195
- package/cjs/storages/inRedis/SegmentsCacheInRedis.js +0 -57
- package/cjs/storages/inRedis/SplitsCacheInRedis.js +0 -243
- package/cjs/storages/inRedis/TelemetryCacheInRedis.js +0 -124
- package/cjs/storages/inRedis/UniqueKeysCacheInRedis.js +0 -69
- package/cjs/storages/inRedis/constants.js +0 -7
- package/cjs/storages/inRedis/index.js +0 -73
- package/cjs/storages/pluggable/EventsCachePluggable.js +0 -64
- package/cjs/storages/pluggable/ImpressionCountsCachePluggable.js +0 -81
- package/cjs/storages/pluggable/ImpressionsCachePluggable.js +0 -48
- package/cjs/storages/pluggable/RBSegmentsCachePluggable.js +0 -64
- package/cjs/storages/pluggable/SegmentsCachePluggable.js +0 -80
- package/cjs/storages/pluggable/SplitsCachePluggable.js +0 -212
- package/cjs/storages/pluggable/TelemetryCachePluggable.js +0 -141
- package/cjs/storages/pluggable/UniqueKeysCachePluggable.js +0 -62
- package/cjs/storages/pluggable/constants.js +0 -4
- package/cjs/storages/pluggable/inMemoryWrapper.js +0 -141
- package/cjs/storages/pluggable/index.js +0 -135
- package/cjs/storages/pluggable/wrapperAdapter.js +0 -53
- package/cjs/storages/types.js +0 -2
- package/cjs/storages/utils.js +0 -74
- package/cjs/sync/offline/LocalhostFromObject.js +0 -8
- package/cjs/sync/offline/splitsParser/parseCondition.js +0 -55
- package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +0 -62
- package/cjs/sync/offline/splitsParser/types.js +0 -2
- package/cjs/sync/offline/syncManagerOffline.js +0 -52
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +0 -72
- package/cjs/sync/polling/fetchers/mySegmentsFetcher.js +0 -18
- package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +0 -34
- package/cjs/sync/polling/fetchers/splitChangesFetcher.js +0 -68
- package/cjs/sync/polling/fetchers/types.js +0 -2
- package/cjs/sync/polling/pollingManagerCS.js +0 -100
- package/cjs/sync/polling/pollingManagerSS.js +0 -49
- package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +0 -13
- package/cjs/sync/polling/syncTasks/segmentsSyncTask.js +0 -13
- package/cjs/sync/polling/syncTasks/splitsSyncTask.js +0 -13
- package/cjs/sync/polling/types.js +0 -2
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +0 -81
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +0 -80
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +0 -188
- package/cjs/sync/streaming/AuthClient/index.js +0 -43
- package/cjs/sync/streaming/AuthClient/types.js +0 -2
- package/cjs/sync/streaming/SSEClient/index.js +0 -86
- package/cjs/sync/streaming/SSEClient/types.js +0 -2
- package/cjs/sync/streaming/SSEHandler/NotificationKeeper.js +0 -98
- package/cjs/sync/streaming/SSEHandler/NotificationParser.js +0 -41
- package/cjs/sync/streaming/SSEHandler/index.js +0 -97
- package/cjs/sync/streaming/SSEHandler/types.js +0 -16
- package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +0 -124
- package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +0 -92
- package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +0 -136
- package/cjs/sync/streaming/UpdateWorkers/constants.js +0 -6
- package/cjs/sync/streaming/UpdateWorkers/types.js +0 -2
- package/cjs/sync/streaming/constants.js +0 -43
- package/cjs/sync/streaming/parseUtils.js +0 -98
- package/cjs/sync/streaming/pushManager.js +0 -317
- package/cjs/sync/streaming/types.js +0 -2
- package/cjs/sync/submitters/eventsSubmitter.js +0 -28
- package/cjs/sync/submitters/impressionCountsSubmitter.js +0 -36
- package/cjs/sync/submitters/impressionsSubmitter.js +0 -54
- package/cjs/sync/submitters/submitter.js +0 -66
- package/cjs/sync/submitters/submitterManager.js +0 -46
- package/cjs/sync/submitters/telemetrySubmitter.js +0 -125
- package/cjs/sync/submitters/types.js +0 -2
- package/cjs/sync/submitters/uniqueKeysSubmitter.js +0 -27
- package/cjs/sync/syncManagerOnline.js +0 -172
- package/cjs/sync/syncTask.js +0 -84
- package/cjs/sync/types.js +0 -2
- package/cjs/trackers/eventTracker.js +0 -62
- package/cjs/trackers/impressionObserver/ImpressionObserver.js +0 -18
- package/cjs/trackers/impressionObserver/buildKey.js +0 -7
- package/cjs/trackers/impressionObserver/impressionObserverCS.js +0 -15
- package/cjs/trackers/impressionObserver/impressionObserverSS.js +0 -15
- package/cjs/trackers/impressionObserver/types.js +0 -2
- package/cjs/trackers/impressionsTracker.js +0 -78
- package/cjs/trackers/strategy/strategyDebug.js +0 -20
- package/cjs/trackers/strategy/strategyNone.js +0 -24
- package/cjs/trackers/strategy/strategyOptimized.js +0 -28
- package/cjs/trackers/telemetryTracker.js +0 -75
- package/cjs/trackers/types.js +0 -2
- package/cjs/trackers/uniqueKeysTracker.js +0 -40
- package/cjs/types.js +0 -2
- package/cjs/utils/Backoff.js +0 -41
- package/cjs/utils/LRUCache/LinkedList.js +0 -114
- package/cjs/utils/LRUCache/index.js +0 -42
- package/cjs/utils/MinEventEmitter.js +0 -100
- package/cjs/utils/Semver.js +0 -103
- package/cjs/utils/base64/index.js +0 -75
- package/cjs/utils/constants/index.js +0 -100
- package/cjs/utils/decompress/index.js +0 -427
- package/cjs/utils/env/isLocalStorageAvailable.js +0 -16
- package/cjs/utils/env/isNode.js +0 -9
- package/cjs/utils/inputValidation/apiKey.js +0 -54
- package/cjs/utils/inputValidation/attribute.js +0 -20
- package/cjs/utils/inputValidation/attributes.js +0 -25
- package/cjs/utils/inputValidation/event.js +0 -28
- package/cjs/utils/inputValidation/eventProperties.js +0 -74
- package/cjs/utils/inputValidation/eventValue.js +0 -12
- package/cjs/utils/inputValidation/index.js +0 -34
- package/cjs/utils/inputValidation/isOperational.js +0 -18
- package/cjs/utils/inputValidation/key.js +0 -51
- package/cjs/utils/inputValidation/preloadedData.js +0 -59
- package/cjs/utils/inputValidation/split.js +0 -30
- package/cjs/utils/inputValidation/splitExistence.js +0 -19
- package/cjs/utils/inputValidation/splits.js +0 -25
- package/cjs/utils/inputValidation/trafficType.js +0 -29
- package/cjs/utils/inputValidation/trafficTypeExistence.js +0 -31
- package/cjs/utils/jwt/index.js +0 -17
- package/cjs/utils/jwt/types.js +0 -2
- package/cjs/utils/key/index.js +0 -36
- package/cjs/utils/labels/index.js +0 -12
- package/cjs/utils/lang/binarySearch.js +0 -42
- package/cjs/utils/lang/getFnName.js +0 -12
- package/cjs/utils/lang/getGlobal.js +0 -18
- package/cjs/utils/lang/index.js +0 -281
- package/cjs/utils/lang/objectAssign.js +0 -20
- package/cjs/utils/lang/sets.js +0 -23
- package/cjs/utils/murmur3/common.js +0 -46
- package/cjs/utils/murmur3/legacy.js +0 -44
- package/cjs/utils/murmur3/murmur3.js +0 -62
- package/cjs/utils/murmur3/murmur3_128.js +0 -219
- package/cjs/utils/murmur3/murmur3_128_x86.js +0 -154
- package/cjs/utils/murmur3/murmur3_64.js +0 -36
- package/cjs/utils/murmur3/utfx.js +0 -108
- package/cjs/utils/promise/thenable.js +0 -8
- package/cjs/utils/promise/timeout.js +0 -20
- package/cjs/utils/promise/wrapper.js +0 -58
- package/cjs/utils/settingsValidation/consent.js +0 -16
- package/cjs/utils/settingsValidation/impressionsMode.js +0 -14
- package/cjs/utils/settingsValidation/index.js +0 -184
- package/cjs/utils/settingsValidation/integrations/common.js +0 -27
- package/cjs/utils/settingsValidation/integrations/configurable.js +0 -18
- package/cjs/utils/settingsValidation/integrations/pluggable.js +0 -15
- package/cjs/utils/settingsValidation/logger/builtinLogger.js +0 -46
- package/cjs/utils/settingsValidation/logger/commons.js +0 -28
- package/cjs/utils/settingsValidation/logger/pluggableLogger.js +0 -32
- package/cjs/utils/settingsValidation/mode.js +0 -20
- package/cjs/utils/settingsValidation/runtime.js +0 -11
- package/cjs/utils/settingsValidation/splitFilters.js +0 -188
- package/cjs/utils/settingsValidation/storage/storageCS.js +0 -49
- package/cjs/utils/settingsValidation/types.js +0 -2
- package/cjs/utils/settingsValidation/url.js +0 -31
- package/cjs/utils/time/index.js +0 -11
- package/cjs/utils/timeTracker/now/browser.js +0 -15
- package/cjs/utils/timeTracker/now/node.js +0 -9
- package/cjs/utils/timeTracker/timer.js +0 -10
- package/esm/consent/index.js +0 -6
- package/esm/consent/sdkUserConsent.js +0 -56
- package/esm/dtos/types.js +0 -1
- package/esm/evaluator/Engine.js +0 -54
- package/esm/evaluator/combiners/and.js +0 -21
- package/esm/evaluator/combiners/ifelseif.js +0 -44
- package/esm/evaluator/condition/engineUtils.js +0 -24
- package/esm/evaluator/condition/index.js +0 -37
- package/esm/evaluator/convertions/index.js +0 -6
- package/esm/evaluator/index.js +0 -128
- package/esm/evaluator/matchers/all.js +0 -5
- package/esm/evaluator/matchers/between.js +0 -6
- package/esm/evaluator/matchers/boolean.js +0 -6
- package/esm/evaluator/matchers/cont_all.js +0 -19
- package/esm/evaluator/matchers/cont_any.js +0 -14
- package/esm/evaluator/matchers/cont_str.js +0 -7
- package/esm/evaluator/matchers/dependency.js +0 -24
- package/esm/evaluator/matchers/eq.js +0 -6
- package/esm/evaluator/matchers/eq_set.js +0 -16
- package/esm/evaluator/matchers/ew.js +0 -7
- package/esm/evaluator/matchers/gte.js +0 -6
- package/esm/evaluator/matchers/index.js +0 -62
- package/esm/evaluator/matchers/large_segment.js +0 -6
- package/esm/evaluator/matchers/lte.js +0 -6
- package/esm/evaluator/matchers/matcherTypes.js +0 -42
- package/esm/evaluator/matchers/part_of.js +0 -16
- package/esm/evaluator/matchers/prerequisites.js +0 -18
- package/esm/evaluator/matchers/rbsegment.js +0 -52
- package/esm/evaluator/matchers/segment.js +0 -6
- package/esm/evaluator/matchers/semver_between.js +0 -10
- package/esm/evaluator/matchers/semver_eq.js +0 -9
- package/esm/evaluator/matchers/semver_gte.js +0 -9
- package/esm/evaluator/matchers/semver_inlist.js +0 -12
- package/esm/evaluator/matchers/semver_lte.js +0 -9
- package/esm/evaluator/matchers/string.js +0 -7
- package/esm/evaluator/matchers/sw.js +0 -7
- package/esm/evaluator/matchers/whitelist.js +0 -7
- package/esm/evaluator/matchersTransform/index.js +0 -100
- package/esm/evaluator/matchersTransform/segment.js +0 -8
- package/esm/evaluator/matchersTransform/unaryNumeric.js +0 -6
- package/esm/evaluator/matchersTransform/whitelist.js +0 -6
- package/esm/evaluator/parser/index.js +0 -57
- package/esm/evaluator/treatments/index.js +0 -39
- package/esm/evaluator/types.js +0 -1
- package/esm/evaluator/value/index.js +0 -33
- package/esm/evaluator/value/sanitize.js +0 -90
- package/esm/integrations/pluggable.js +0 -31
- package/esm/integrations/types.js +0 -1
- package/esm/listeners/browser.js +0 -118
- package/esm/listeners/node.js +0 -65
- package/esm/listeners/types.js +0 -1
- package/esm/logger/browser/DebugLogger.js +0 -5
- package/esm/logger/browser/ErrorLogger.js +0 -5
- package/esm/logger/browser/InfoLogger.js +0 -5
- package/esm/logger/browser/WarnLogger.js +0 -5
- package/esm/logger/constants.js +0 -135
- package/esm/logger/index.js +0 -95
- package/esm/logger/messages/debug.js +0 -32
- package/esm/logger/messages/error.js +0 -38
- package/esm/logger/messages/info.js +0 -33
- package/esm/logger/messages/warn.js +0 -38
- package/esm/logger/sdkLogger.js +0 -41
- package/esm/logger/types.js +0 -1
- package/esm/readiness/constants.js +0 -10
- package/esm/readiness/readinessManager.js +0 -150
- package/esm/readiness/sdkReadinessManager.js +0 -100
- package/esm/readiness/types.js +0 -1
- package/esm/sdkClient/client.js +0 -179
- package/esm/sdkClient/clientAttributesDecoration.js +0 -118
- package/esm/sdkClient/clientCS.js +0 -26
- package/esm/sdkClient/clientInputValidation.js +0 -143
- package/esm/sdkClient/identity.js +0 -3
- package/esm/sdkClient/sdkClient.js +0 -60
- package/esm/sdkClient/sdkClientMethod.js +0 -18
- package/esm/sdkClient/sdkClientMethodCS.js +0 -62
- package/esm/sdkFactory/index.js +0 -104
- package/esm/sdkFactory/types.js +0 -1
- package/esm/sdkManager/index.js +0 -92
- package/esm/services/decorateHeaders.js +0 -35
- package/esm/services/splitApi.js +0 -127
- package/esm/services/splitHttpClient.js +0 -78
- package/esm/services/types.js +0 -1
- package/esm/storages/AbstractMySegmentsCacheSync.js +0 -57
- package/esm/storages/AbstractSplitsCacheAsync.js +0 -48
- package/esm/storages/AbstractSplitsCacheSync.js +0 -70
- package/esm/storages/KeyBuilder.js +0 -63
- package/esm/storages/KeyBuilderCS.js +0 -61
- package/esm/storages/KeyBuilderSS.js +0 -57
- package/esm/storages/dataLoader.js +0 -104
- package/esm/storages/findLatencyIndex.js +0 -14
- package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +0 -78
- package/esm/storages/inLocalStorage/RBSegmentsCacheInLocal.js +0 -118
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +0 -205
- package/esm/storages/inLocalStorage/constants.js +0 -2
- package/esm/storages/inLocalStorage/index.js +0 -69
- package/esm/storages/inLocalStorage/validateCache.js +0 -76
- package/esm/storages/inMemory/AttributesCacheInMemory.js +0 -67
- package/esm/storages/inMemory/EventsCacheInMemory.js +0 -60
- package/esm/storages/inMemory/ImpressionCountsCacheInMemory.js +0 -62
- package/esm/storages/inMemory/ImpressionsCacheInMemory.js +0 -48
- package/esm/storages/inMemory/InMemoryStorage.js +0 -42
- package/esm/storages/inMemory/InMemoryStorageCS.js +0 -77
- package/esm/storages/inMemory/MySegmentsCacheInMemory.js +0 -43
- package/esm/storages/inMemory/RBSegmentsCacheInMemory.js +0 -62
- package/esm/storages/inMemory/SegmentsCacheInMemory.js +0 -58
- package/esm/storages/inMemory/SplitsCacheInMemory.js +0 -118
- package/esm/storages/inMemory/TelemetryCacheInMemory.js +0 -202
- package/esm/storages/inMemory/UniqueKeysCacheInMemory.js +0 -68
- package/esm/storages/inMemory/UniqueKeysCacheInMemoryCS.js +0 -68
- package/esm/storages/inRedis/EventsCacheInRedis.js +0 -57
- package/esm/storages/inRedis/ImpressionCountsCacheInRedis.js +0 -82
- package/esm/storages/inRedis/ImpressionsCacheInRedis.js +0 -42
- package/esm/storages/inRedis/RBSegmentsCacheInRedis.js +0 -61
- package/esm/storages/inRedis/RedisAdapter.js +0 -192
- package/esm/storages/inRedis/SegmentsCacheInRedis.js +0 -54
- package/esm/storages/inRedis/SplitsCacheInRedis.js +0 -240
- package/esm/storages/inRedis/TelemetryCacheInRedis.js +0 -121
- package/esm/storages/inRedis/UniqueKeysCacheInRedis.js +0 -66
- package/esm/storages/inRedis/constants.js +0 -4
- package/esm/storages/inRedis/index.js +0 -69
- package/esm/storages/pluggable/EventsCachePluggable.js +0 -61
- package/esm/storages/pluggable/ImpressionCountsCachePluggable.js +0 -78
- package/esm/storages/pluggable/ImpressionsCachePluggable.js +0 -45
- package/esm/storages/pluggable/RBSegmentsCachePluggable.js +0 -61
- package/esm/storages/pluggable/SegmentsCachePluggable.js +0 -77
- package/esm/storages/pluggable/SplitsCachePluggable.js +0 -209
- package/esm/storages/pluggable/TelemetryCachePluggable.js +0 -138
- package/esm/storages/pluggable/UniqueKeysCachePluggable.js +0 -59
- package/esm/storages/pluggable/constants.js +0 -1
- package/esm/storages/pluggable/inMemoryWrapper.js +0 -137
- package/esm/storages/pluggable/index.js +0 -131
- package/esm/storages/pluggable/wrapperAdapter.js +0 -49
- package/esm/storages/types.js +0 -1
- package/esm/storages/utils.js +0 -66
- package/esm/sync/offline/LocalhostFromObject.js +0 -5
- package/esm/sync/offline/splitsParser/parseCondition.js +0 -51
- package/esm/sync/offline/splitsParser/splitsParserFromSettings.js +0 -58
- package/esm/sync/offline/splitsParser/types.js +0 -1
- package/esm/sync/offline/syncManagerOffline.js +0 -48
- package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +0 -67
- package/esm/sync/polling/fetchers/mySegmentsFetcher.js +0 -14
- package/esm/sync/polling/fetchers/segmentChangesFetcher.js +0 -30
- package/esm/sync/polling/fetchers/splitChangesFetcher.js +0 -64
- package/esm/sync/polling/fetchers/types.js +0 -1
- package/esm/sync/polling/pollingManagerCS.js +0 -96
- package/esm/sync/polling/pollingManagerSS.js +0 -45
- package/esm/sync/polling/syncTasks/mySegmentsSyncTask.js +0 -9
- package/esm/sync/polling/syncTasks/segmentsSyncTask.js +0 -9
- package/esm/sync/polling/syncTasks/splitsSyncTask.js +0 -9
- package/esm/sync/polling/types.js +0 -1
- package/esm/sync/polling/updaters/mySegmentsUpdater.js +0 -77
- package/esm/sync/polling/updaters/segmentChangesUpdater.js +0 -76
- package/esm/sync/polling/updaters/splitChangesUpdater.js +0 -182
- package/esm/sync/streaming/AuthClient/index.js +0 -38
- package/esm/sync/streaming/AuthClient/types.js +0 -1
- package/esm/sync/streaming/SSEClient/index.js +0 -83
- package/esm/sync/streaming/SSEClient/types.js +0 -1
- package/esm/sync/streaming/SSEHandler/NotificationKeeper.js +0 -94
- package/esm/sync/streaming/SSEHandler/NotificationParser.js +0 -36
- package/esm/sync/streaming/SSEHandler/index.js +0 -93
- package/esm/sync/streaming/SSEHandler/types.js +0 -13
- package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +0 -120
- package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +0 -88
- package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +0 -132
- package/esm/sync/streaming/UpdateWorkers/constants.js +0 -3
- package/esm/sync/streaming/UpdateWorkers/types.js +0 -1
- package/esm/sync/streaming/constants.js +0 -40
- package/esm/sync/streaming/parseUtils.js +0 -90
- package/esm/sync/streaming/pushManager.js +0 -313
- package/esm/sync/streaming/types.js +0 -1
- package/esm/sync/submitters/eventsSubmitter.js +0 -24
- package/esm/sync/submitters/impressionCountsSubmitter.js +0 -31
- package/esm/sync/submitters/impressionsSubmitter.js +0 -49
- package/esm/sync/submitters/submitter.js +0 -61
- package/esm/sync/submitters/submitterManager.js +0 -42
- package/esm/sync/submitters/telemetrySubmitter.js +0 -119
- package/esm/sync/submitters/types.js +0 -1
- package/esm/sync/submitters/uniqueKeysSubmitter.js +0 -23
- package/esm/sync/syncManagerOnline.js +0 -168
- package/esm/sync/syncTask.js +0 -80
- package/esm/sync/types.js +0 -1
- package/esm/trackers/eventTracker.js +0 -58
- package/esm/trackers/impressionObserver/ImpressionObserver.js +0 -15
- package/esm/trackers/impressionObserver/buildKey.js +0 -3
- package/esm/trackers/impressionObserver/impressionObserverCS.js +0 -10
- package/esm/trackers/impressionObserver/impressionObserverSS.js +0 -10
- package/esm/trackers/impressionObserver/types.js +0 -1
- package/esm/trackers/impressionsTracker.js +0 -74
- package/esm/trackers/strategy/strategyDebug.js +0 -16
- package/esm/trackers/strategy/strategyNone.js +0 -20
- package/esm/trackers/strategy/strategyOptimized.js +0 -24
- package/esm/trackers/telemetryTracker.js +0 -71
- package/esm/trackers/types.js +0 -1
- package/esm/trackers/uniqueKeysTracker.js +0 -36
- package/esm/types.js +0 -1
- package/esm/utils/Backoff.js +0 -38
- package/esm/utils/LRUCache/LinkedList.js +0 -111
- package/esm/utils/LRUCache/index.js +0 -39
- package/esm/utils/MinEventEmitter.js +0 -97
- package/esm/utils/Semver.js +0 -100
- package/esm/utils/base64/index.js +0 -70
- package/esm/utils/constants/index.js +0 -96
- package/esm/utils/decompress/index.js +0 -424
- package/esm/utils/env/isLocalStorageAvailable.js +0 -12
- package/esm/utils/env/isNode.js +0 -6
- package/esm/utils/inputValidation/apiKey.js +0 -48
- package/esm/utils/inputValidation/attribute.js +0 -16
- package/esm/utils/inputValidation/attributes.js +0 -20
- package/esm/utils/inputValidation/event.js +0 -24
- package/esm/utils/inputValidation/eventProperties.js +0 -69
- package/esm/utils/inputValidation/eventValue.js +0 -8
- package/esm/utils/inputValidation/index.js +0 -14
- package/esm/utils/inputValidation/isOperational.js +0 -13
- package/esm/utils/inputValidation/key.js +0 -47
- package/esm/utils/inputValidation/preloadedData.js +0 -55
- package/esm/utils/inputValidation/split.js +0 -26
- package/esm/utils/inputValidation/splitExistence.js +0 -15
- package/esm/utils/inputValidation/splits.js +0 -21
- package/esm/utils/inputValidation/trafficType.js +0 -25
- package/esm/utils/inputValidation/trafficTypeExistence.js +0 -27
- package/esm/utils/jwt/index.js +0 -13
- package/esm/utils/jwt/types.js +0 -1
- package/esm/utils/key/index.js +0 -30
- package/esm/utils/labels/index.js +0 -9
- package/esm/utils/lang/binarySearch.js +0 -38
- package/esm/utils/lang/getFnName.js +0 -8
- package/esm/utils/lang/getGlobal.js +0 -14
- package/esm/utils/lang/index.js +0 -258
- package/esm/utils/lang/objectAssign.js +0 -17
- package/esm/utils/lang/sets.js +0 -17
- package/esm/utils/murmur3/common.js +0 -39
- package/esm/utils/murmur3/legacy.js +0 -39
- package/esm/utils/murmur3/murmur3.js +0 -57
- package/esm/utils/murmur3/murmur3_128.js +0 -215
- package/esm/utils/murmur3/murmur3_128_x86.js +0 -150
- package/esm/utils/murmur3/murmur3_64.js +0 -32
- package/esm/utils/murmur3/utfx.js +0 -102
- package/esm/utils/promise/thenable.js +0 -4
- package/esm/utils/promise/timeout.js +0 -16
- package/esm/utils/promise/wrapper.js +0 -54
- package/esm/utils/settingsValidation/consent.js +0 -12
- package/esm/utils/settingsValidation/impressionsMode.js +0 -10
- package/esm/utils/settingsValidation/index.js +0 -180
- package/esm/utils/settingsValidation/integrations/common.js +0 -23
- package/esm/utils/settingsValidation/integrations/configurable.js +0 -14
- package/esm/utils/settingsValidation/integrations/pluggable.js +0 -11
- package/esm/utils/settingsValidation/logger/builtinLogger.js +0 -42
- package/esm/utils/settingsValidation/logger/commons.js +0 -24
- package/esm/utils/settingsValidation/logger/pluggableLogger.js +0 -28
- package/esm/utils/settingsValidation/mode.js +0 -15
- package/esm/utils/settingsValidation/runtime.js +0 -7
- package/esm/utils/settingsValidation/splitFilters.js +0 -183
- package/esm/utils/settingsValidation/storage/storageCS.js +0 -44
- package/esm/utils/settingsValidation/types.js +0 -1
- package/esm/utils/settingsValidation/url.js +0 -27
- package/esm/utils/time/index.js +0 -7
- package/esm/utils/timeTracker/now/browser.js +0 -12
- package/esm/utils/timeTracker/now/node.js +0 -5
- package/esm/utils/timeTracker/timer.js +0 -6
- package/src/consent/index.ts +0 -8
- package/src/consent/sdkUserConsent.ts +0 -60
- package/src/dtos/types.ts +0 -294
- package/src/evaluator/Engine.ts +0 -73
- package/src/evaluator/combiners/and.ts +0 -29
- package/src/evaluator/combiners/ifelseif.ts +0 -56
- package/src/evaluator/condition/engineUtils.ts +0 -31
- package/src/evaluator/condition/index.ts +0 -50
- package/src/evaluator/convertions/index.ts +0 -7
- package/src/evaluator/index.ts +0 -199
- package/src/evaluator/matchers/all.ts +0 -6
- package/src/evaluator/matchers/between.ts +0 -10
- package/src/evaluator/matchers/boolean.ts +0 -8
- package/src/evaluator/matchers/cont_all.ts +0 -18
- package/src/evaluator/matchers/cont_any.ts +0 -13
- package/src/evaluator/matchers/cont_str.ts +0 -9
- package/src/evaluator/matchers/dependency.ts +0 -32
- package/src/evaluator/matchers/eq.ts +0 -8
- package/src/evaluator/matchers/eq_set.ts +0 -15
- package/src/evaluator/matchers/ew.ts +0 -9
- package/src/evaluator/matchers/gte.ts +0 -8
- package/src/evaluator/matchers/index.ts +0 -70
- package/src/evaluator/matchers/large_segment.ts +0 -11
- package/src/evaluator/matchers/lte.ts +0 -8
- package/src/evaluator/matchers/matcherTypes.ts +0 -42
- package/src/evaluator/matchers/part_of.ts +0 -15
- package/src/evaluator/matchers/prerequisites.ts +0 -24
- package/src/evaluator/matchers/rbsegment.ts +0 -74
- package/src/evaluator/matchers/segment.ts +0 -11
- package/src/evaluator/matchers/semver_between.ts +0 -15
- package/src/evaluator/matchers/semver_eq.ts +0 -13
- package/src/evaluator/matchers/semver_gte.ts +0 -13
- package/src/evaluator/matchers/semver_inlist.ts +0 -16
- package/src/evaluator/matchers/semver_lte.ts +0 -13
- package/src/evaluator/matchers/string.ts +0 -9
- package/src/evaluator/matchers/sw.ts +0 -9
- package/src/evaluator/matchers/whitelist.ts +0 -9
- package/src/evaluator/matchersTransform/index.ts +0 -118
- package/src/evaluator/matchersTransform/segment.ts +0 -10
- package/src/evaluator/matchersTransform/unaryNumeric.ts +0 -8
- package/src/evaluator/matchersTransform/whitelist.ts +0 -8
- package/src/evaluator/parser/index.ts +0 -82
- package/src/evaluator/treatments/index.ts +0 -53
- package/src/evaluator/types.ts +0 -34
- package/src/evaluator/value/index.ts +0 -37
- package/src/evaluator/value/sanitize.ts +0 -106
- package/src/index.ts +0 -14
- package/src/integrations/pluggable.ts +0 -39
- package/src/integrations/types.ts +0 -21
- package/src/listeners/browser.ts +0 -138
- package/src/listeners/node.ts +0 -81
- package/src/listeners/types.ts +0 -4
- package/src/logger/browser/DebugLogger.ts +0 -6
- package/src/logger/browser/ErrorLogger.ts +0 -6
- package/src/logger/browser/InfoLogger.ts +0 -6
- package/src/logger/browser/WarnLogger.ts +0 -6
- package/src/logger/constants.ts +0 -139
- package/src/logger/index.ts +0 -110
- package/src/logger/messages/debug.ts +0 -33
- package/src/logger/messages/error.ts +0 -39
- package/src/logger/messages/info.ts +0 -36
- package/src/logger/messages/warn.ts +0 -40
- package/src/logger/sdkLogger.ts +0 -46
- package/src/logger/types.ts +0 -21
- package/src/readiness/constants.ts +0 -12
- package/src/readiness/readinessManager.ts +0 -170
- package/src/readiness/sdkReadinessManager.ts +0 -121
- package/src/readiness/types.ts +0 -85
- package/src/sdkClient/client.ts +0 -217
- package/src/sdkClient/clientAttributesDecoration.ts +0 -139
- package/src/sdkClient/clientCS.ts +0 -34
- package/src/sdkClient/clientInputValidation.ts +0 -178
- package/src/sdkClient/identity.ts +0 -5
- package/src/sdkClient/sdkClient.ts +0 -77
- package/src/sdkClient/sdkClientMethod.ts +0 -24
- package/src/sdkClient/sdkClientMethodCS.ts +0 -85
- package/src/sdkFactory/index.ts +0 -132
- package/src/sdkFactory/types.ts +0 -119
- package/src/sdkManager/index.ts +0 -114
- package/src/services/decorateHeaders.ts +0 -37
- package/src/services/splitApi.ts +0 -148
- package/src/services/splitHttpClient.ts +0 -84
- package/src/services/types.ts +0 -86
- package/src/storages/AbstractMySegmentsCacheSync.ts +0 -94
- package/src/storages/AbstractSplitsCacheAsync.ts +0 -63
- package/src/storages/AbstractSplitsCacheSync.ts +0 -94
- package/src/storages/KeyBuilder.ts +0 -81
- package/src/storages/KeyBuilderCS.ts +0 -79
- package/src/storages/KeyBuilderSS.ts +0 -74
- package/src/storages/dataLoader.ts +0 -113
- package/src/storages/findLatencyIndex.ts +0 -16
- package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +0 -86
- package/src/storages/inLocalStorage/RBSegmentsCacheInLocal.ts +0 -140
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +0 -244
- package/src/storages/inLocalStorage/constants.ts +0 -2
- package/src/storages/inLocalStorage/index.ts +0 -83
- package/src/storages/inLocalStorage/validateCache.ts +0 -93
- package/src/storages/inMemory/AttributesCacheInMemory.ts +0 -74
- package/src/storages/inMemory/EventsCacheInMemory.ts +0 -76
- package/src/storages/inMemory/ImpressionCountsCacheInMemory.ts +0 -69
- package/src/storages/inMemory/ImpressionsCacheInMemory.ts +0 -58
- package/src/storages/inMemory/InMemoryStorage.ts +0 -50
- package/src/storages/inMemory/InMemoryStorageCS.ts +0 -92
- package/src/storages/inMemory/MySegmentsCacheInMemory.ts +0 -49
- package/src/storages/inMemory/RBSegmentsCacheInMemory.ts +0 -72
- package/src/storages/inMemory/SegmentsCacheInMemory.ts +0 -74
- package/src/storages/inMemory/SplitsCacheInMemory.ts +0 -130
- package/src/storages/inMemory/TelemetryCacheInMemory.ts +0 -263
- package/src/storages/inMemory/UniqueKeysCacheInMemory.ts +0 -79
- package/src/storages/inMemory/UniqueKeysCacheInMemoryCS.ts +0 -80
- package/src/storages/inRedis/EventsCacheInRedis.ts +0 -75
- package/src/storages/inRedis/ImpressionCountsCacheInRedis.ts +0 -95
- package/src/storages/inRedis/ImpressionsCacheInRedis.ts +0 -61
- package/src/storages/inRedis/RBSegmentsCacheInRedis.ts +0 -79
- package/src/storages/inRedis/RedisAdapter.ts +0 -209
- package/src/storages/inRedis/SegmentsCacheInRedis.ts +0 -70
- package/src/storages/inRedis/SplitsCacheInRedis.ts +0 -268
- package/src/storages/inRedis/TelemetryCacheInRedis.ts +0 -144
- package/src/storages/inRedis/UniqueKeysCacheInRedis.ts +0 -75
- package/src/storages/inRedis/constants.ts +0 -4
- package/src/storages/inRedis/index.ts +0 -85
- package/src/storages/package.json +0 -3
- package/src/storages/pluggable/EventsCachePluggable.ts +0 -79
- package/src/storages/pluggable/ImpressionCountsCachePluggable.ts +0 -92
- package/src/storages/pluggable/ImpressionsCachePluggable.ts +0 -63
- package/src/storages/pluggable/RBSegmentsCachePluggable.ts +0 -76
- package/src/storages/pluggable/SegmentsCachePluggable.ts +0 -90
- package/src/storages/pluggable/SplitsCachePluggable.ts +0 -230
- package/src/storages/pluggable/TelemetryCachePluggable.ts +0 -159
- package/src/storages/pluggable/UniqueKeysCachePluggable.ts +0 -67
- package/src/storages/pluggable/constants.ts +0 -1
- package/src/storages/pluggable/inMemoryWrapper.ts +0 -130
- package/src/storages/pluggable/index.ts +0 -152
- package/src/storages/pluggable/wrapperAdapter.ts +0 -58
- package/src/storages/types.ts +0 -522
- package/src/storages/utils.ts +0 -80
- package/src/sync/offline/LocalhostFromObject.ts +0 -6
- package/src/sync/offline/splitsParser/parseCondition.ts +0 -59
- package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +0 -72
- package/src/sync/offline/splitsParser/types.ts +0 -5
- package/src/sync/offline/syncManagerOffline.ts +0 -66
- package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +0 -98
- package/src/sync/polling/fetchers/mySegmentsFetcher.ts +0 -25
- package/src/sync/polling/fetchers/segmentChangesFetcher.ts +0 -41
- package/src/sync/polling/fetchers/splitChangesFetcher.ts +0 -85
- package/src/sync/polling/fetchers/types.ts +0 -25
- package/src/sync/polling/pollingManagerCS.ts +0 -116
- package/src/sync/polling/pollingManagerSS.ts +0 -56
- package/src/sync/polling/syncTasks/mySegmentsSyncTask.ts +0 -34
- package/src/sync/polling/syncTasks/segmentsSyncTask.ts +0 -30
- package/src/sync/polling/syncTasks/splitsSyncTask.ts +0 -35
- package/src/sync/polling/types.ts +0 -33
- package/src/sync/polling/updaters/mySegmentsUpdater.ts +0 -102
- package/src/sync/polling/updaters/segmentChangesUpdater.ts +0 -92
- package/src/sync/polling/updaters/splitChangesUpdater.ts +0 -218
- package/src/sync/streaming/AuthClient/index.ts +0 -42
- package/src/sync/streaming/AuthClient/types.ts +0 -20
- package/src/sync/streaming/SSEClient/index.ts +0 -103
- package/src/sync/streaming/SSEClient/types.ts +0 -13
- package/src/sync/streaming/SSEHandler/NotificationKeeper.ts +0 -107
- package/src/sync/streaming/SSEHandler/NotificationParser.ts +0 -40
- package/src/sync/streaming/SSEHandler/index.ts +0 -105
- package/src/sync/streaming/SSEHandler/types.ts +0 -73
- package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +0 -134
- package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +0 -99
- package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +0 -145
- package/src/sync/streaming/UpdateWorkers/constants.ts +0 -3
- package/src/sync/streaming/UpdateWorkers/types.ts +0 -4
- package/src/sync/streaming/constants.ts +0 -44
- package/src/sync/streaming/parseUtils.ts +0 -100
- package/src/sync/streaming/pushManager.ts +0 -358
- package/src/sync/streaming/types.ts +0 -51
- package/src/sync/submitters/eventsSubmitter.ts +0 -35
- package/src/sync/submitters/impressionCountsSubmitter.ts +0 -44
- package/src/sync/submitters/impressionsSubmitter.ts +0 -66
- package/src/sync/submitters/submitter.ts +0 -76
- package/src/sync/submitters/submitterManager.ts +0 -48
- package/src/sync/submitters/telemetrySubmitter.ts +0 -148
- package/src/sync/submitters/types.ts +0 -241
- package/src/sync/submitters/uniqueKeysSubmitter.ts +0 -35
- package/src/sync/syncManagerOnline.ts +0 -190
- package/src/sync/syncTask.ts +0 -83
- package/src/sync/types.ts +0 -48
- package/src/trackers/eventTracker.ts +0 -72
- package/src/trackers/impressionObserver/ImpressionObserver.ts +0 -20
- package/src/trackers/impressionObserver/buildKey.ts +0 -5
- package/src/trackers/impressionObserver/impressionObserverCS.ts +0 -14
- package/src/trackers/impressionObserver/impressionObserverSS.ts +0 -14
- package/src/trackers/impressionObserver/types.ts +0 -5
- package/src/trackers/impressionsTracker.ts +0 -87
- package/src/trackers/strategy/strategyDebug.ts +0 -23
- package/src/trackers/strategy/strategyNone.ts +0 -28
- package/src/trackers/strategy/strategyOptimized.ts +0 -35
- package/src/trackers/telemetryTracker.ts +0 -73
- package/src/trackers/types.ts +0 -86
- package/src/trackers/uniqueKeysTracker.ts +0 -50
- package/src/types.ts +0 -44
- package/src/utils/Backoff.ts +0 -51
- package/src/utils/LRUCache/LinkedList.ts +0 -130
- package/src/utils/LRUCache/index.ts +0 -43
- package/src/utils/MinEventEmitter.ts +0 -102
- package/src/utils/Semver.ts +0 -111
- package/src/utils/base64/index.ts +0 -74
- package/src/utils/constants/index.ts +0 -116
- package/src/utils/decompress/index.ts +0 -429
- package/src/utils/env/isLocalStorageAvailable.ts +0 -11
- package/src/utils/env/isNode.ts +0 -6
- package/src/utils/inputValidation/apiKey.ts +0 -52
- package/src/utils/inputValidation/attribute.ts +0 -21
- package/src/utils/inputValidation/attributes.ts +0 -26
- package/src/utils/inputValidation/event.ts +0 -24
- package/src/utils/inputValidation/eventProperties.ts +0 -78
- package/src/utils/inputValidation/eventValue.ts +0 -11
- package/src/utils/inputValidation/index.ts +0 -14
- package/src/utils/inputValidation/isOperational.ts +0 -17
- package/src/utils/inputValidation/key.ts +0 -51
- package/src/utils/inputValidation/preloadedData.ts +0 -57
- package/src/utils/inputValidation/split.ts +0 -27
- package/src/utils/inputValidation/splitExistence.ts +0 -19
- package/src/utils/inputValidation/splits.ts +0 -21
- package/src/utils/inputValidation/trafficType.ts +0 -27
- package/src/utils/inputValidation/trafficTypeExistence.ts +0 -33
- package/src/utils/jwt/index.ts +0 -16
- package/src/utils/jwt/types.ts +0 -10
- package/src/utils/key/index.ts +0 -34
- package/src/utils/labels/index.ts +0 -9
- package/src/utils/lang/binarySearch.ts +0 -41
- package/src/utils/lang/getFnName.ts +0 -8
- package/src/utils/lang/getGlobal.ts +0 -17
- package/src/utils/lang/index.ts +0 -279
- package/src/utils/lang/objectAssign.ts +0 -25
- package/src/utils/lang/sets.ts +0 -17
- package/src/utils/murmur3/common.ts +0 -54
- package/src/utils/murmur3/legacy.ts +0 -48
- package/src/utils/murmur3/murmur3.ts +0 -74
- package/src/utils/murmur3/murmur3_128.ts +0 -273
- package/src/utils/murmur3/murmur3_128_x86.ts +0 -188
- package/src/utils/murmur3/murmur3_64.ts +0 -36
- package/src/utils/murmur3/utfx.ts +0 -109
- package/src/utils/promise/thenable.ts +0 -4
- package/src/utils/promise/timeout.ts +0 -17
- package/src/utils/promise/wrapper.ts +0 -60
- package/src/utils/settingsValidation/consent.ts +0 -16
- package/src/utils/settingsValidation/impressionsMode.ts +0 -14
- package/src/utils/settingsValidation/index.ts +0 -207
- package/src/utils/settingsValidation/integrations/common.ts +0 -27
- package/src/utils/settingsValidation/integrations/configurable.ts +0 -20
- package/src/utils/settingsValidation/integrations/pluggable.ts +0 -19
- package/src/utils/settingsValidation/logger/builtinLogger.ts +0 -54
- package/src/utils/settingsValidation/logger/commons.ts +0 -24
- package/src/utils/settingsValidation/logger/pluggableLogger.ts +0 -35
- package/src/utils/settingsValidation/mode.ts +0 -17
- package/src/utils/settingsValidation/runtime.ts +0 -9
- package/src/utils/settingsValidation/splitFilters.ts +0 -197
- package/src/utils/settingsValidation/storage/storageCS.ts +0 -52
- package/src/utils/settingsValidation/types.ts +0 -27
- package/src/utils/settingsValidation/url.ts +0 -30
- package/src/utils/time/index.ts +0 -8
- package/src/utils/timeTracker/now/browser.ts +0 -12
- package/src/utils/timeTracker/now/node.ts +0 -6
- package/src/utils/timeTracker/timer.ts +0 -7
package/types/splitio.d.ts
CHANGED
|
@@ -1,2091 +1,6 @@
|
|
|
1
|
-
// Type definitions for Split Software
|
|
2
|
-
// Project: https://www.split.io/
|
|
1
|
+
// Type definitions for JavaScript and NodeJS Split Software SDK
|
|
3
2
|
|
|
4
|
-
import
|
|
5
|
-
import { RequestOptions } from 'http';
|
|
3
|
+
import '@splitsoftware/splitio-commons';
|
|
6
4
|
|
|
7
5
|
export as namespace SplitIO;
|
|
8
6
|
export = SplitIO;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Common settings properties.
|
|
12
|
-
*/
|
|
13
|
-
interface ISharedSettings {
|
|
14
|
-
/**
|
|
15
|
-
* The impression listener, which is optional. Whatever you provide here needs to comply with the SplitIO.IImpressionListener interface,
|
|
16
|
-
* which will check for the logImpression method.
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue `undefined`
|
|
19
|
-
*/
|
|
20
|
-
impressionListener?: SplitIO.IImpressionListener;
|
|
21
|
-
/**
|
|
22
|
-
* SDK synchronization settings.
|
|
23
|
-
*/
|
|
24
|
-
sync?: {
|
|
25
|
-
/**
|
|
26
|
-
* List of feature flag filters. These filters are used to fetch a subset of the feature flag definitions in your environment, in order to reduce the delay of the SDK to be ready.
|
|
27
|
-
*
|
|
28
|
-
* NOTES:
|
|
29
|
-
* - This configuration is only meaningful when the SDK is working in `"standalone"` mode.
|
|
30
|
-
* - If `bySet` filter is provided, `byName` and `byPrefix` filters are ignored.
|
|
31
|
-
* - If both `byName` and `byPrefix` filters are provided, the intersection of the two groups of feature flags is fetched.
|
|
32
|
-
*
|
|
33
|
-
* Example:
|
|
34
|
-
* ```
|
|
35
|
-
* splitFilter: [
|
|
36
|
-
* { type: 'byName', values: ['my_feature_flag_1', 'my_feature_flag_2'] }, // will fetch feature flags named 'my_feature_flag_1' and 'my_feature_flag_2'
|
|
37
|
-
* ]
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
splitFilters?: SplitIO.SplitFilter[];
|
|
41
|
-
/**
|
|
42
|
-
* Impressions Collection Mode. Option to determine how impressions are going to be sent to Split servers.
|
|
43
|
-
* Possible values are 'DEBUG', 'OPTIMIZED', and 'NONE'.
|
|
44
|
-
* - DEBUG: will send all the impressions generated (recommended only for debugging purposes).
|
|
45
|
-
* - OPTIMIZED: will send unique impressions to Split servers, avoiding a considerable amount of traffic that duplicated impressions could generate.
|
|
46
|
-
* - NONE: will send unique keys evaluated per feature to Split servers instead of full blown impressions, avoiding a considerable amount of traffic that impressions could generate.
|
|
47
|
-
*
|
|
48
|
-
* @defaultValue `'OPTIMIZED'`
|
|
49
|
-
*/
|
|
50
|
-
impressionsMode?: SplitIO.ImpressionsMode;
|
|
51
|
-
/**
|
|
52
|
-
* Custom options object for HTTP(S) requests.
|
|
53
|
-
* If provided, this object is merged with the options object passed by the SDK for EventSource and Fetch calls.
|
|
54
|
-
* This configuration has no effect in "consumer" mode, as no HTTP(S) requests are made by the SDK.
|
|
55
|
-
*/
|
|
56
|
-
requestOptions?: {
|
|
57
|
-
/**
|
|
58
|
-
* Custom function called before each request, allowing you to add or update headers in SDK HTTP requests.
|
|
59
|
-
* Some headers, such as `SplitSDKVersion`, are required by the SDK and cannot be overridden.
|
|
60
|
-
* To pass multiple headers with the same name, combine their values into a single line, separated by commas. Example: `{ 'Authorization': 'value1, value2' }`
|
|
61
|
-
* Or provide keys with different cases since headers are case-insensitive. Example: `{ 'authorization': 'value1', 'Authorization': 'value2' }`
|
|
62
|
-
*
|
|
63
|
-
* NOTE: to pass custom headers to the streaming connection in Browser, you should polyfill the `window.EventSource` object with a library that supports headers,
|
|
64
|
-
* like https://www.npmjs.com/package/event-source-polyfill, since native EventSource does not support them and they will be ignored.
|
|
65
|
-
*
|
|
66
|
-
* @defaultValue `undefined`
|
|
67
|
-
*
|
|
68
|
-
* @param context - The context for the request, which contains the `headers` property object representing the current headers in the request.
|
|
69
|
-
* @returns An object representing a set of headers to be merged with the current headers.
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```
|
|
73
|
-
* const factory = SplitFactory({
|
|
74
|
-
* ...
|
|
75
|
-
* sync: {
|
|
76
|
-
* getHeaderOverrides: (context) => {
|
|
77
|
-
* return {
|
|
78
|
-
* 'Authorization': context.headers['Authorization'] + ', other-value',
|
|
79
|
-
* 'custom-header': 'custom-value'
|
|
80
|
-
* };
|
|
81
|
-
* }
|
|
82
|
-
* }
|
|
83
|
-
* });
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
getHeaderOverrides?: (context: { headers: Record<string, string> }) => Record<string, string>;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* List of URLs that the SDK will use as base for it's synchronization functionalities, applicable only when running as standalone and partial consumer modes.
|
|
91
|
-
* Do not change these settings unless you're working an advanced use case, like connecting to the Split proxy.
|
|
92
|
-
*/
|
|
93
|
-
urls?: SplitIO.UrlSettings;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Common settings properties for SDKs with synchronous API (standalone and localhost modes).
|
|
97
|
-
*/
|
|
98
|
-
interface ISyncSharedSettings extends ISharedSettings {
|
|
99
|
-
/**
|
|
100
|
-
* The SDK mode. When using the default in-memory storage or `InLocalStorage` as storage, the only possible value is "standalone", which is the default.
|
|
101
|
-
* For "localhost" mode, use "localhost" as authorizationKey.
|
|
102
|
-
*
|
|
103
|
-
* @defaultValue `'standalone'`
|
|
104
|
-
*/
|
|
105
|
-
mode?: 'standalone';
|
|
106
|
-
/**
|
|
107
|
-
* Boolean flag to enable the streaming service as default synchronization mechanism. In the event of any issue with streaming,
|
|
108
|
-
* the SDK would fallback to the polling mechanism. If false, the SDK would poll for changes as usual without attempting to use streaming.
|
|
109
|
-
*
|
|
110
|
-
* @defaultValue `true`
|
|
111
|
-
*/
|
|
112
|
-
streamingEnabled?: boolean;
|
|
113
|
-
/**
|
|
114
|
-
* SDK synchronization settings.
|
|
115
|
-
*/
|
|
116
|
-
sync?: ISharedSettings['sync'] & {
|
|
117
|
-
/**
|
|
118
|
-
* Controls the SDK continuous synchronization flags.
|
|
119
|
-
*
|
|
120
|
-
* When `true` a running SDK will process rollout plan updates performed on the UI (default).
|
|
121
|
-
* When false it'll just fetch all data upon init.
|
|
122
|
-
*
|
|
123
|
-
* @defaultValue `true`
|
|
124
|
-
*/
|
|
125
|
-
enabled?: boolean;
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Common settings properties for SDKs with pluggable options.
|
|
130
|
-
*/
|
|
131
|
-
interface IPluggableSharedSettings {
|
|
132
|
-
/**
|
|
133
|
-
* Boolean value to indicate whether the logger should be enabled or disabled by default, or a log level string or a Logger object.
|
|
134
|
-
* Passing a logger object is required to get descriptive log messages. Otherwise most logs will print with message codes.
|
|
135
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#logging}.
|
|
136
|
-
*
|
|
137
|
-
* Examples:
|
|
138
|
-
* ```
|
|
139
|
-
* config.debug = true
|
|
140
|
-
* config.debug = 'WARN'
|
|
141
|
-
* config.debug = ErrorLogger()
|
|
142
|
-
* ```
|
|
143
|
-
*
|
|
144
|
-
* @defaultValue `false`
|
|
145
|
-
*/
|
|
146
|
-
debug?: boolean | SplitIO.LogLevel | SplitIO.ILogger;
|
|
147
|
-
/**
|
|
148
|
-
* Defines an optional list of factory functions used to instantiate SDK integrations.
|
|
149
|
-
*
|
|
150
|
-
* NOTE: at the moment there are not integrations to plug in.
|
|
151
|
-
*/
|
|
152
|
-
integrations?: SplitIO.IntegrationFactory[];
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Common settings properties for SDKs without pluggable options.
|
|
156
|
-
*/
|
|
157
|
-
interface INonPluggableSharedSettings {
|
|
158
|
-
/**
|
|
159
|
-
* Boolean value to indicate whether the logger should be enabled or disabled, or a log level string.
|
|
160
|
-
*
|
|
161
|
-
* Examples:
|
|
162
|
-
* ```
|
|
163
|
-
* config.debug = true
|
|
164
|
-
* config.debug = 'WARN'
|
|
165
|
-
* ```
|
|
166
|
-
*
|
|
167
|
-
* @defaultValue `false`
|
|
168
|
-
*/
|
|
169
|
-
debug?: boolean | SplitIO.LogLevel;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Common settings properties for SDKs with server-side API.
|
|
173
|
-
*/
|
|
174
|
-
interface IServerSideSharedSettings {
|
|
175
|
-
/**
|
|
176
|
-
* SDK Core settings for Node.js.
|
|
177
|
-
*/
|
|
178
|
-
core: {
|
|
179
|
-
/**
|
|
180
|
-
* Your SDK key.
|
|
181
|
-
*
|
|
182
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360019916211-API-keys}
|
|
183
|
-
*/
|
|
184
|
-
authorizationKey: string;
|
|
185
|
-
/**
|
|
186
|
-
* Disable labels from being sent to Split backend. Labels may contain sensitive information.
|
|
187
|
-
*
|
|
188
|
-
* @defaultValue `true`
|
|
189
|
-
*/
|
|
190
|
-
labelsEnabled?: boolean;
|
|
191
|
-
/**
|
|
192
|
-
* Disable machine IP and Name from being sent to Split backend.
|
|
193
|
-
*
|
|
194
|
-
* @defaultValue `true`
|
|
195
|
-
*/
|
|
196
|
-
IPAddressesEnabled?: boolean;
|
|
197
|
-
};
|
|
198
|
-
/**
|
|
199
|
-
* SDK Startup settings for Node.js.
|
|
200
|
-
*/
|
|
201
|
-
startup?: {
|
|
202
|
-
/**
|
|
203
|
-
* Maximum amount of time used before notify a timeout.
|
|
204
|
-
*
|
|
205
|
-
* @defaultValue `15`
|
|
206
|
-
*/
|
|
207
|
-
readyTimeout?: number;
|
|
208
|
-
/**
|
|
209
|
-
* Time to wait for a request before the SDK is ready. If this time expires, JS SDK will retry 'retriesOnFailureBeforeReady' times before notifying its failure to be 'ready'.
|
|
210
|
-
*
|
|
211
|
-
* @defaultValue `15`
|
|
212
|
-
*/
|
|
213
|
-
requestTimeoutBeforeReady?: number;
|
|
214
|
-
/**
|
|
215
|
-
* How many quick retries we will do while starting up the SDK.
|
|
216
|
-
*
|
|
217
|
-
* @defaultValue `1`
|
|
218
|
-
*/
|
|
219
|
-
retriesOnFailureBeforeReady?: number;
|
|
220
|
-
/**
|
|
221
|
-
* For SDK posts the queued events data in bulks with a given rate, but the first push window is defined separately,
|
|
222
|
-
* to better control on browsers. This number defines that window before the first events push.
|
|
223
|
-
*
|
|
224
|
-
* @defaultValue `0`
|
|
225
|
-
*/
|
|
226
|
-
eventsFirstPushWindow?: number;
|
|
227
|
-
};
|
|
228
|
-
/**
|
|
229
|
-
* SDK scheduler settings.
|
|
230
|
-
*/
|
|
231
|
-
scheduler?: {
|
|
232
|
-
/**
|
|
233
|
-
* The SDK polls Split servers for changes to feature flag definitions. This parameter controls this polling period in seconds.
|
|
234
|
-
*
|
|
235
|
-
* @defaultValue `60`
|
|
236
|
-
*/
|
|
237
|
-
featuresRefreshRate?: number;
|
|
238
|
-
/**
|
|
239
|
-
* The SDK sends information on who got what treatment at what time back to Split servers to power analytics. This parameter controls how often this data is sent to Split servers. The parameter should be in seconds.
|
|
240
|
-
*
|
|
241
|
-
* @defaultValue `300`
|
|
242
|
-
*/
|
|
243
|
-
impressionsRefreshRate?: number;
|
|
244
|
-
/**
|
|
245
|
-
* The maximum number of impression items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
|
|
246
|
-
* If you use a 0 here, the queue will have no maximum size.
|
|
247
|
-
*
|
|
248
|
-
* @defaultValue `30000`
|
|
249
|
-
*/
|
|
250
|
-
impressionsQueueSize?: number;
|
|
251
|
-
/**
|
|
252
|
-
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
253
|
-
*
|
|
254
|
-
* @defaultValue `120`
|
|
255
|
-
* @deprecated This parameter is ignored now. Use `telemetryRefreshRate` instead.
|
|
256
|
-
*/
|
|
257
|
-
metricsRefreshRate?: number;
|
|
258
|
-
/**
|
|
259
|
-
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
260
|
-
*
|
|
261
|
-
* @defaultValue `3600`
|
|
262
|
-
*/
|
|
263
|
-
telemetryRefreshRate?: number;
|
|
264
|
-
/**
|
|
265
|
-
* The SDK polls Split servers for changes to segment definitions. This parameter controls this polling period in seconds.
|
|
266
|
-
*
|
|
267
|
-
* @defaultValue `60`
|
|
268
|
-
*/
|
|
269
|
-
segmentsRefreshRate?: number;
|
|
270
|
-
/**
|
|
271
|
-
* The SDK posts the queued events data in bulks. This parameter controls the posting rate in seconds.
|
|
272
|
-
*
|
|
273
|
-
* @defaultValue `60`
|
|
274
|
-
*/
|
|
275
|
-
eventsPushRate?: number;
|
|
276
|
-
/**
|
|
277
|
-
* The maximum number of event items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
|
|
278
|
-
* If you use a 0 here, the queue will have no maximum size.
|
|
279
|
-
*
|
|
280
|
-
* @defaultValue `500`
|
|
281
|
-
*/
|
|
282
|
-
eventsQueueSize?: number;
|
|
283
|
-
/**
|
|
284
|
-
* For mocking/testing only. The SDK will refresh the features mocked data when mode is set to "localhost" by defining the key.
|
|
285
|
-
* For more information see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#localhost-mode}
|
|
286
|
-
*
|
|
287
|
-
* @defaultValue `15`
|
|
288
|
-
*/
|
|
289
|
-
offlineRefreshRate?: number;
|
|
290
|
-
/**
|
|
291
|
-
* When using streaming mode, seconds to wait before re attempting to connect for push notifications.
|
|
292
|
-
* Next attempts follow intervals in power of two: base seconds, base x 2 seconds, base x 4 seconds, ...
|
|
293
|
-
*
|
|
294
|
-
* @defaultValue `1`
|
|
295
|
-
*/
|
|
296
|
-
pushRetryBackoffBase?: number;
|
|
297
|
-
};
|
|
298
|
-
/**
|
|
299
|
-
* Mocked features file path. For testing purposes only. For using this you should specify "localhost" as authorizationKey on core settings.
|
|
300
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#localhost-mode}
|
|
301
|
-
*
|
|
302
|
-
* @defaultValue `'$HOME/.split'`
|
|
303
|
-
*/
|
|
304
|
-
features?: SplitIO.MockedFeaturesFilePath;
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Common settings properties for SDKs with client-side API.
|
|
308
|
-
*/
|
|
309
|
-
interface IClientSideSharedSettings {
|
|
310
|
-
/**
|
|
311
|
-
* SDK Core settings for client-side.
|
|
312
|
-
*/
|
|
313
|
-
core: {
|
|
314
|
-
/**
|
|
315
|
-
* Your SDK key.
|
|
316
|
-
*
|
|
317
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360019916211-API-keys}
|
|
318
|
-
*/
|
|
319
|
-
authorizationKey: string;
|
|
320
|
-
/**
|
|
321
|
-
* Customer identifier. Whatever this means to you.
|
|
322
|
-
*
|
|
323
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360019916311-Traffic-type}
|
|
324
|
-
*/
|
|
325
|
-
key: SplitIO.SplitKey;
|
|
326
|
-
/**
|
|
327
|
-
* Disable labels from being sent to Split backend. Labels may contain sensitive information.
|
|
328
|
-
*
|
|
329
|
-
* @defaultValue `true`
|
|
330
|
-
*/
|
|
331
|
-
labelsEnabled?: boolean;
|
|
332
|
-
};
|
|
333
|
-
/**
|
|
334
|
-
* User consent status. Possible values are `'GRANTED'`, which is the default, `'DECLINED'` or `'UNKNOWN'`.
|
|
335
|
-
* - `'GRANTED'`: the user grants consent for tracking events and impressions. The SDK sends them to Split cloud.
|
|
336
|
-
* - `'DECLINED'`: the user declines consent for tracking events and impressions. The SDK does not send them to Split cloud.
|
|
337
|
-
* - `'UNKNOWN'`: the user neither grants nor declines consent for tracking events and impressions. The SDK tracks them in its internal storage, and eventually either sends
|
|
338
|
-
* them or not if the consent status is updated to 'GRANTED' or 'DECLINED' respectively. The status can be updated at any time with the `UserConsent.setStatus` factory method.
|
|
339
|
-
*
|
|
340
|
-
* @defaultValue `'GRANTED'`
|
|
341
|
-
*/
|
|
342
|
-
userConsent?: SplitIO.ConsentStatus;
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Common settings properties for SDKs with client-side and synchronous API (standalone and localhost modes).
|
|
346
|
-
*/
|
|
347
|
-
interface IClientSideSyncSharedSettings extends IClientSideSharedSettings, ISyncSharedSettings {
|
|
348
|
-
/**
|
|
349
|
-
* Mocked features map. For testing purposes only. For using this you should specify "localhost" as authorizationKey on core settings.
|
|
350
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#localhost-mode}
|
|
351
|
-
*/
|
|
352
|
-
features?: SplitIO.MockedFeaturesMap;
|
|
353
|
-
/**
|
|
354
|
-
* Data to initialize the SDK storage with. If provided and valid, the SDK will be ready from cache immediately.
|
|
355
|
-
*/
|
|
356
|
-
preloadedData?: SplitIO.PreloadedData;
|
|
357
|
-
/**
|
|
358
|
-
* SDK Startup settings.
|
|
359
|
-
*/
|
|
360
|
-
startup?: {
|
|
361
|
-
/**
|
|
362
|
-
* Maximum amount of time used before notify a timeout.
|
|
363
|
-
*
|
|
364
|
-
* @defaultValue `10`
|
|
365
|
-
*/
|
|
366
|
-
readyTimeout?: number;
|
|
367
|
-
/**
|
|
368
|
-
* Time to wait for a request before the SDK is ready. If this time expires, JS SDK will retry 'retriesOnFailureBeforeReady' times before notifying its failure to be 'ready'.
|
|
369
|
-
*
|
|
370
|
-
* @defaultValue `5`
|
|
371
|
-
*/
|
|
372
|
-
requestTimeoutBeforeReady?: number;
|
|
373
|
-
/**
|
|
374
|
-
* How many quick retries we will do while starting up the SDK.
|
|
375
|
-
*
|
|
376
|
-
* @defaultValue `1`
|
|
377
|
-
*/
|
|
378
|
-
retriesOnFailureBeforeReady?: number;
|
|
379
|
-
/**
|
|
380
|
-
* For SDK posts the queued events data in bulks with a given rate, but the first push window is defined separately,
|
|
381
|
-
* to better control on browsers or mobile. This number defines that window before the first events push.
|
|
382
|
-
*
|
|
383
|
-
* @defaultValue `10`
|
|
384
|
-
*/
|
|
385
|
-
eventsFirstPushWindow?: number;
|
|
386
|
-
};
|
|
387
|
-
/**
|
|
388
|
-
* SDK scheduler settings.
|
|
389
|
-
*/
|
|
390
|
-
scheduler?: {
|
|
391
|
-
/**
|
|
392
|
-
* The SDK polls Split servers for changes to feature flag definitions. This parameter controls this polling period in seconds.
|
|
393
|
-
*
|
|
394
|
-
* @defaultValue `60`
|
|
395
|
-
*/
|
|
396
|
-
featuresRefreshRate?: number;
|
|
397
|
-
/**
|
|
398
|
-
* The SDK sends information on who got what treatment at what time back to Split servers to power analytics. This parameter controls how often this data is sent to Split servers. The parameter should be in seconds.
|
|
399
|
-
*
|
|
400
|
-
* @defaultValue `60`
|
|
401
|
-
*/
|
|
402
|
-
impressionsRefreshRate?: number;
|
|
403
|
-
/**
|
|
404
|
-
* The maximum number of impression items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
|
|
405
|
-
* If you use a 0 here, the queue will have no maximum size.
|
|
406
|
-
*
|
|
407
|
-
* @defaultValue `30000`
|
|
408
|
-
*/
|
|
409
|
-
impressionsQueueSize?: number;
|
|
410
|
-
/**
|
|
411
|
-
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
412
|
-
*
|
|
413
|
-
* @defaultValue `120`
|
|
414
|
-
* @deprecated This parameter is ignored now. Use `telemetryRefreshRate` instead.
|
|
415
|
-
*/
|
|
416
|
-
metricsRefreshRate?: number;
|
|
417
|
-
/**
|
|
418
|
-
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
419
|
-
*
|
|
420
|
-
* @defaultValue `3600`
|
|
421
|
-
*/
|
|
422
|
-
telemetryRefreshRate?: number;
|
|
423
|
-
/**
|
|
424
|
-
* The SDK polls Split servers for changes to segment definitions. This parameter controls this polling period in seconds.
|
|
425
|
-
*
|
|
426
|
-
* @defaultValue `60`
|
|
427
|
-
*/
|
|
428
|
-
segmentsRefreshRate?: number;
|
|
429
|
-
/**
|
|
430
|
-
* The SDK posts the queued events data in bulks. This parameter controls the posting rate in seconds.
|
|
431
|
-
*
|
|
432
|
-
* @defaultValue `60`
|
|
433
|
-
*/
|
|
434
|
-
eventsPushRate?: number;
|
|
435
|
-
/**
|
|
436
|
-
* The maximum number of event items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
|
|
437
|
-
* If you use a 0 here, the queue will have no maximum size.
|
|
438
|
-
*
|
|
439
|
-
* @defaultValue `500`
|
|
440
|
-
*/
|
|
441
|
-
eventsQueueSize?: number;
|
|
442
|
-
/**
|
|
443
|
-
* For mocking/testing only. The SDK will refresh the features mocked data when mode is set to "localhost" by defining the key.
|
|
444
|
-
* For more information see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#localhost-mode}
|
|
445
|
-
*
|
|
446
|
-
* @defaultValue `15`
|
|
447
|
-
*/
|
|
448
|
-
offlineRefreshRate?: number;
|
|
449
|
-
/**
|
|
450
|
-
* When using streaming mode, seconds to wait before re attempting to connect for push notifications.
|
|
451
|
-
* Next attempts follow intervals in power of two: base seconds, base x 2 seconds, base x 4 seconds, ...
|
|
452
|
-
*
|
|
453
|
-
* @defaultValue `1`
|
|
454
|
-
*/
|
|
455
|
-
pushRetryBackoffBase?: number;
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
/****** Exposed namespace ******/
|
|
460
|
-
/**
|
|
461
|
-
* Shared types and interfaces for `@splitsoftware` packages, to support integrating JavaScript SDKs with TypeScript.
|
|
462
|
-
*/
|
|
463
|
-
declare namespace SplitIO {
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* EventEmitter interface based on a subset of the Node.js EventEmitter methods.
|
|
467
|
-
*/
|
|
468
|
-
interface IEventEmitter {
|
|
469
|
-
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
470
|
-
on(event: string, listener: (...args: any[]) => void): this;
|
|
471
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
472
|
-
removeListener(event: string, listener: (...args: any[]) => void): this;
|
|
473
|
-
off(event: string, listener: (...args: any[]) => void): this;
|
|
474
|
-
removeAllListeners(event?: string): this;
|
|
475
|
-
emit(event: string, ...args: any[]): boolean;
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Node.js EventEmitter interface
|
|
479
|
-
* @see {@link https://nodejs.org/api/events.html}
|
|
480
|
-
*/
|
|
481
|
-
interface EventEmitter extends IEventEmitter {
|
|
482
|
-
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
483
|
-
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
484
|
-
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
485
|
-
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
486
|
-
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
487
|
-
removeAllListeners(event?: string | symbol): this;
|
|
488
|
-
emit(event: string | symbol, ...args: any[]): boolean;
|
|
489
|
-
setMaxListeners(n: number): this;
|
|
490
|
-
getMaxListeners(): number;
|
|
491
|
-
listeners(event: string | symbol): Function[];
|
|
492
|
-
rawListeners(event: string | symbol): Function[];
|
|
493
|
-
listenerCount(type: string | symbol): number;
|
|
494
|
-
// Added in Node.js 6...
|
|
495
|
-
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
496
|
-
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
497
|
-
eventNames(): Array<string | symbol>;
|
|
498
|
-
}
|
|
499
|
-
/**
|
|
500
|
-
* Event constants.
|
|
501
|
-
*/
|
|
502
|
-
type EventConsts = {
|
|
503
|
-
/**
|
|
504
|
-
* The ready event.
|
|
505
|
-
*/
|
|
506
|
-
SDK_READY: 'init::ready';
|
|
507
|
-
/**
|
|
508
|
-
* The ready event when fired with cached data.
|
|
509
|
-
*/
|
|
510
|
-
SDK_READY_FROM_CACHE: 'init::cache-ready';
|
|
511
|
-
/**
|
|
512
|
-
* The timeout event.
|
|
513
|
-
*/
|
|
514
|
-
SDK_READY_TIMED_OUT: 'init::timeout';
|
|
515
|
-
/**
|
|
516
|
-
* The update event.
|
|
517
|
-
*/
|
|
518
|
-
SDK_UPDATE: 'state::update';
|
|
519
|
-
};
|
|
520
|
-
/**
|
|
521
|
-
* SDK Modes.
|
|
522
|
-
*/
|
|
523
|
-
type SDKMode = 'standalone' | 'localhost' | 'consumer' | 'consumer_partial';
|
|
524
|
-
/**
|
|
525
|
-
* Storage types.
|
|
526
|
-
*/
|
|
527
|
-
type StorageType = 'MEMORY' | 'LOCALSTORAGE' | 'REDIS' | 'PLUGGABLE';
|
|
528
|
-
/**
|
|
529
|
-
* Settings interface. This is a representation of the settings the SDK expose, that's why
|
|
530
|
-
* most of it's props are readonly. Only features should be rewritten when localhost mode is active.
|
|
531
|
-
*/
|
|
532
|
-
interface ISettings {
|
|
533
|
-
readonly core: {
|
|
534
|
-
authorizationKey: string;
|
|
535
|
-
key: SplitKey;
|
|
536
|
-
labelsEnabled: boolean;
|
|
537
|
-
IPAddressesEnabled: boolean;
|
|
538
|
-
};
|
|
539
|
-
readonly mode: SDKMode;
|
|
540
|
-
readonly scheduler: {
|
|
541
|
-
featuresRefreshRate: number;
|
|
542
|
-
impressionsRefreshRate: number;
|
|
543
|
-
impressionsQueueSize: number;
|
|
544
|
-
/**
|
|
545
|
-
* @deprecated Use `telemetryRefreshRate` instead.
|
|
546
|
-
*/
|
|
547
|
-
metricsRefreshRate?: number;
|
|
548
|
-
telemetryRefreshRate: number;
|
|
549
|
-
segmentsRefreshRate: number;
|
|
550
|
-
offlineRefreshRate: number;
|
|
551
|
-
eventsPushRate: number;
|
|
552
|
-
eventsQueueSize: number;
|
|
553
|
-
pushRetryBackoffBase: number;
|
|
554
|
-
};
|
|
555
|
-
readonly startup: {
|
|
556
|
-
readyTimeout: number;
|
|
557
|
-
requestTimeoutBeforeReady: number;
|
|
558
|
-
retriesOnFailureBeforeReady: number;
|
|
559
|
-
eventsFirstPushWindow: number;
|
|
560
|
-
};
|
|
561
|
-
readonly storage: StorageSyncFactory | StorageAsyncFactory | StorageOptions;
|
|
562
|
-
readonly preloadedData?: SplitIO.PreloadedData;
|
|
563
|
-
readonly urls: {
|
|
564
|
-
events: string;
|
|
565
|
-
sdk: string;
|
|
566
|
-
auth: string;
|
|
567
|
-
streaming: string;
|
|
568
|
-
telemetry: string;
|
|
569
|
-
};
|
|
570
|
-
readonly integrations?: IntegrationFactory[];
|
|
571
|
-
readonly debug: boolean | LogLevel | ILogger;
|
|
572
|
-
readonly version: string;
|
|
573
|
-
/**
|
|
574
|
-
* Mocked features map if using in client-side, or mocked features file path string if using in server-side (Node.js).
|
|
575
|
-
*/
|
|
576
|
-
features: MockedFeaturesMap | MockedFeaturesFilePath;
|
|
577
|
-
readonly streamingEnabled: boolean;
|
|
578
|
-
readonly sync: {
|
|
579
|
-
splitFilters: SplitFilter[];
|
|
580
|
-
impressionsMode: ImpressionsMode;
|
|
581
|
-
enabled: boolean;
|
|
582
|
-
flagSpecVersion: string;
|
|
583
|
-
requestOptions?: {
|
|
584
|
-
getHeaderOverrides?: (context: { headers: Record<string, string> }) => Record<string, string>;
|
|
585
|
-
};
|
|
586
|
-
};
|
|
587
|
-
readonly runtime: {
|
|
588
|
-
ip: string | false;
|
|
589
|
-
hostname: string | false;
|
|
590
|
-
};
|
|
591
|
-
readonly impressionListener?: IImpressionListener;
|
|
592
|
-
/**
|
|
593
|
-
* User consent status if using in client-side. Undefined if using in server-side (Node.js).
|
|
594
|
-
*/
|
|
595
|
-
readonly userConsent?: ConsentStatus;
|
|
596
|
-
}
|
|
597
|
-
/**
|
|
598
|
-
* Log levels.
|
|
599
|
-
*/
|
|
600
|
-
type LogLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'NONE';
|
|
601
|
-
/**
|
|
602
|
-
* Logger API
|
|
603
|
-
*/
|
|
604
|
-
interface ILoggerAPI {
|
|
605
|
-
/**
|
|
606
|
-
* Enables SDK logging to the console.
|
|
607
|
-
*/
|
|
608
|
-
enable(): void;
|
|
609
|
-
/**
|
|
610
|
-
* Disables SDK logging.
|
|
611
|
-
*/
|
|
612
|
-
disable(): void;
|
|
613
|
-
/**
|
|
614
|
-
* Sets a log level for the SDK logs.
|
|
615
|
-
*/
|
|
616
|
-
setLogLevel(logLevel: LogLevel): void;
|
|
617
|
-
/**
|
|
618
|
-
* Log level constants. Use this to pass them to setLogLevel function.
|
|
619
|
-
*/
|
|
620
|
-
LogLevel: {
|
|
621
|
-
[level in LogLevel]: LogLevel;
|
|
622
|
-
};
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* User consent API
|
|
626
|
-
*/
|
|
627
|
-
interface IUserConsentAPI {
|
|
628
|
-
/**
|
|
629
|
-
* Sets or updates the user consent status. Possible values are `true` and `false`, which represent user consent `'GRANTED'` and `'DECLINED'` respectively.
|
|
630
|
-
* - `true ('GRANTED')`: the user has granted consent for tracking events and impressions. The SDK will send them to Split cloud.
|
|
631
|
-
* - `false ('DECLINED')`: the user has declined consent for tracking events and impressions. The SDK will not send them to Split cloud.
|
|
632
|
-
*
|
|
633
|
-
* NOTE: calling this method updates the user consent at a factory level, affecting all clients of the same factory.
|
|
634
|
-
*
|
|
635
|
-
* @param userConsent - The user consent status, true for 'GRANTED' and false for 'DECLINED'.
|
|
636
|
-
* @returns Whether the provided param is a valid value (i.e., a boolean value) or not.
|
|
637
|
-
*/
|
|
638
|
-
setStatus(userConsent: boolean): boolean;
|
|
639
|
-
/**
|
|
640
|
-
* Gets the user consent status.
|
|
641
|
-
*
|
|
642
|
-
* @returns The user consent status.
|
|
643
|
-
*/
|
|
644
|
-
getStatus(): ConsentStatus;
|
|
645
|
-
/**
|
|
646
|
-
* Consent status constants. Use this to compare with the getStatus function result.
|
|
647
|
-
*/
|
|
648
|
-
Status: {
|
|
649
|
-
[status in ConsentStatus]: ConsentStatus;
|
|
650
|
-
};
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Common API for entities that expose status handlers.
|
|
654
|
-
*/
|
|
655
|
-
interface IStatusInterface extends EventEmitter {
|
|
656
|
-
/**
|
|
657
|
-
* Constant object containing the SDK events for you to use.
|
|
658
|
-
*/
|
|
659
|
-
Event: EventConsts;
|
|
660
|
-
/**
|
|
661
|
-
* Returns a promise that resolves once the SDK has finished loading (`SDK_READY` event emitted) or rejected if the SDK has timedout (`SDK_READY_TIMED_OUT` event emitted).
|
|
662
|
-
* As it's meant to provide similar flexibility to the event approach, given that the SDK might be eventually ready after a timeout event, the `ready` method will return a resolved promise once the SDK is ready.
|
|
663
|
-
*
|
|
664
|
-
* Caveats: the method was designed to avoid an unhandled Promise rejection if the rejection case is not handled, so that `onRejected` handler is optional when using promises.
|
|
665
|
-
* However, when using async/await syntax, the rejection should be explicitly propagated like in the following example:
|
|
666
|
-
* ```
|
|
667
|
-
* try {
|
|
668
|
-
* await client.ready().catch((e) => { throw e; });
|
|
669
|
-
* // SDK is ready
|
|
670
|
-
* } catch(e) {
|
|
671
|
-
* // SDK has timedout
|
|
672
|
-
* }
|
|
673
|
-
* ```
|
|
674
|
-
*
|
|
675
|
-
* @returns A promise that resolves once the SDK is ready or rejects if the SDK has timedout.
|
|
676
|
-
*/
|
|
677
|
-
ready(): Promise<void>;
|
|
678
|
-
}
|
|
679
|
-
/**
|
|
680
|
-
* Common definitions between clients for different environments interface.
|
|
681
|
-
*/
|
|
682
|
-
interface IBasicClient extends IStatusInterface {
|
|
683
|
-
/**
|
|
684
|
-
* Destroys the client instance.
|
|
685
|
-
*
|
|
686
|
-
* In 'standalone' and 'partial consumer' modes, this method will flush any pending impressions and events.
|
|
687
|
-
* In 'standalone' mode, it also stops the synchronization of feature flag definitions with the backend.
|
|
688
|
-
* In 'consumer' and 'partial consumer' modes, this method also disconnects the SDK from the Pluggable storage.
|
|
689
|
-
*
|
|
690
|
-
* @returns A promise that resolves once the client is destroyed.
|
|
691
|
-
*/
|
|
692
|
-
destroy(): Promise<void>;
|
|
693
|
-
}
|
|
694
|
-
/**
|
|
695
|
-
* Common definitions between SDK instances for different environments interface.
|
|
696
|
-
*/
|
|
697
|
-
interface IBasicSDK {
|
|
698
|
-
/**
|
|
699
|
-
* Current settings of the SDK instance.
|
|
700
|
-
*/
|
|
701
|
-
settings: ISettings;
|
|
702
|
-
/**
|
|
703
|
-
* Logger API.
|
|
704
|
-
*/
|
|
705
|
-
Logger: ILoggerAPI;
|
|
706
|
-
/**
|
|
707
|
-
* Destroys all the clients created by this factory.
|
|
708
|
-
*
|
|
709
|
-
* @returns A promise that resolves once all clients are destroyed.
|
|
710
|
-
*/
|
|
711
|
-
destroy(): Promise<void>;
|
|
712
|
-
}
|
|
713
|
-
/**
|
|
714
|
-
* Feature flag treatment value, returned by getTreatment.
|
|
715
|
-
*/
|
|
716
|
-
type Treatment = string;
|
|
717
|
-
/**
|
|
718
|
-
* Feature flag treatment promise that resolves to actual treatment value.
|
|
719
|
-
*/
|
|
720
|
-
type AsyncTreatment = Promise<Treatment>;
|
|
721
|
-
/**
|
|
722
|
-
* An object with the treatments for a bulk of feature flags, returned by getTreatments. For example:
|
|
723
|
-
* ```
|
|
724
|
-
* {
|
|
725
|
-
* feature1: 'on',
|
|
726
|
-
* feature2: 'off'
|
|
727
|
-
* }
|
|
728
|
-
* ```
|
|
729
|
-
*/
|
|
730
|
-
type Treatments = {
|
|
731
|
-
[featureName: string]: Treatment;
|
|
732
|
-
};
|
|
733
|
-
/**
|
|
734
|
-
* Feature flag treatments promise that resolves to the actual SplitIO.Treatments object.
|
|
735
|
-
*/
|
|
736
|
-
type AsyncTreatments = Promise<Treatments>;
|
|
737
|
-
/**
|
|
738
|
-
* Feature flag evaluation result with treatment and configuration, returned by getTreatmentWithConfig.
|
|
739
|
-
*/
|
|
740
|
-
type TreatmentWithConfig = {
|
|
741
|
-
/**
|
|
742
|
-
* The treatment string.
|
|
743
|
-
*/
|
|
744
|
-
treatment: string;
|
|
745
|
-
/**
|
|
746
|
-
* The stringified version of the JSON config defined for that treatment, null if there is no config for the resulting treatment.
|
|
747
|
-
*/
|
|
748
|
-
config: string | null;
|
|
749
|
-
};
|
|
750
|
-
/**
|
|
751
|
-
* Feature flag treatment promise that resolves to actual SplitIO.TreatmentWithConfig object.
|
|
752
|
-
*/
|
|
753
|
-
type AsyncTreatmentWithConfig = Promise<TreatmentWithConfig>;
|
|
754
|
-
/**
|
|
755
|
-
* An object with the treatments with configs for a bulk of feature flags, returned by getTreatmentsWithConfig.
|
|
756
|
-
* Each existing configuration is a stringified version of the JSON you defined on the Split user interface. For example:
|
|
757
|
-
* ```
|
|
758
|
-
* {
|
|
759
|
-
* feature1: { treatment: 'on', config: null }
|
|
760
|
-
* feature2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
|
|
761
|
-
* }
|
|
762
|
-
* ```
|
|
763
|
-
*/
|
|
764
|
-
type TreatmentsWithConfig = {
|
|
765
|
-
[featureName: string]: TreatmentWithConfig;
|
|
766
|
-
};
|
|
767
|
-
/**
|
|
768
|
-
* Feature flag treatments promise that resolves to the actual SplitIO.TreatmentsWithConfig object.
|
|
769
|
-
*/
|
|
770
|
-
type AsyncTreatmentsWithConfig = Promise<TreatmentsWithConfig>;
|
|
771
|
-
/**
|
|
772
|
-
* Possible Split SDK events.
|
|
773
|
-
*/
|
|
774
|
-
type Event = 'init::timeout' | 'init::ready' | 'init::cache-ready' | 'state::update';
|
|
775
|
-
/**
|
|
776
|
-
* Attributes should be on object with values of type string, boolean, number (dates should be sent as millis since epoch) or array of strings or numbers.
|
|
777
|
-
*
|
|
778
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#attribute-syntax}
|
|
779
|
-
*/
|
|
780
|
-
type Attributes = {
|
|
781
|
-
[attributeName: string]: AttributeType;
|
|
782
|
-
};
|
|
783
|
-
/**
|
|
784
|
-
* Type of an attribute value
|
|
785
|
-
*/
|
|
786
|
-
type AttributeType = string | number | boolean | Array<string | number>;
|
|
787
|
-
/**
|
|
788
|
-
* Properties should be an object with values of type string, number, boolean or null. Size limit of ~31kb.
|
|
789
|
-
*
|
|
790
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#track}
|
|
791
|
-
*/
|
|
792
|
-
type Properties = {
|
|
793
|
-
[propertyName: string]: string | number | boolean | null;
|
|
794
|
-
};
|
|
795
|
-
/**
|
|
796
|
-
* Evaluation options object for getTreatment methods.
|
|
797
|
-
*/
|
|
798
|
-
type EvaluationOptions = {
|
|
799
|
-
/**
|
|
800
|
-
* Optional properties to append to the generated impression object sent to Split backend.
|
|
801
|
-
*/
|
|
802
|
-
properties?: Properties;
|
|
803
|
-
}
|
|
804
|
-
/**
|
|
805
|
-
* The SplitKey object format.
|
|
806
|
-
*/
|
|
807
|
-
type SplitKeyObject = {
|
|
808
|
-
matchingKey: string;
|
|
809
|
-
bucketingKey: string;
|
|
810
|
-
};
|
|
811
|
-
/**
|
|
812
|
-
* The customer identifier. Could be a SplitKeyObject or a string.
|
|
813
|
-
*/
|
|
814
|
-
type SplitKey = SplitKeyObject | string;
|
|
815
|
-
/**
|
|
816
|
-
* Path to file with mocked features (for node).
|
|
817
|
-
*/
|
|
818
|
-
type MockedFeaturesFilePath = string;
|
|
819
|
-
/**
|
|
820
|
-
* Object with mocked features mapping for client-side (e.g., Browser or React Native). We need to specify the featureName as key, and the mocked treatment as value.
|
|
821
|
-
*/
|
|
822
|
-
type MockedFeaturesMap = {
|
|
823
|
-
[featureName: string]: string | TreatmentWithConfig;
|
|
824
|
-
};
|
|
825
|
-
/**
|
|
826
|
-
* Impression DTO generated by the SDK when processing evaluations.
|
|
827
|
-
*/
|
|
828
|
-
type ImpressionDTO = {
|
|
829
|
-
/**
|
|
830
|
-
* Feature flag name.
|
|
831
|
-
*/
|
|
832
|
-
feature: string;
|
|
833
|
-
/**
|
|
834
|
-
* Key.
|
|
835
|
-
*/
|
|
836
|
-
keyName: string;
|
|
837
|
-
/**
|
|
838
|
-
* Treatment value.
|
|
839
|
-
*/
|
|
840
|
-
treatment: string;
|
|
841
|
-
/**
|
|
842
|
-
* Impression timestamp.
|
|
843
|
-
*/
|
|
844
|
-
time: number;
|
|
845
|
-
/**
|
|
846
|
-
* Bucketing Key
|
|
847
|
-
*/
|
|
848
|
-
bucketingKey?: string;
|
|
849
|
-
/**
|
|
850
|
-
* Rule label
|
|
851
|
-
*/
|
|
852
|
-
label: string;
|
|
853
|
-
/**
|
|
854
|
-
* Version of the feature flag
|
|
855
|
-
*/
|
|
856
|
-
changeNumber: number;
|
|
857
|
-
/**
|
|
858
|
-
* Previous time
|
|
859
|
-
*/
|
|
860
|
-
pt?: number;
|
|
861
|
-
/**
|
|
862
|
-
* JSON stringified version of the impression properties.
|
|
863
|
-
*/
|
|
864
|
-
properties?: string;
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Object with information about an impression. It contains the generated impression DTO as well as
|
|
868
|
-
* complementary information around where and how it was generated in that way.
|
|
869
|
-
*/
|
|
870
|
-
type ImpressionData = {
|
|
871
|
-
impression: ImpressionDTO;
|
|
872
|
-
attributes?: Attributes;
|
|
873
|
-
ip: string | false;
|
|
874
|
-
hostname: string | false;
|
|
875
|
-
sdkLanguageVersion: string;
|
|
876
|
-
};
|
|
877
|
-
/**
|
|
878
|
-
* Data corresponding to one feature flag view.
|
|
879
|
-
*/
|
|
880
|
-
type SplitView = {
|
|
881
|
-
/**
|
|
882
|
-
* The name of the feature flag.
|
|
883
|
-
*/
|
|
884
|
-
name: string;
|
|
885
|
-
/**
|
|
886
|
-
* The traffic type of the feature flag.
|
|
887
|
-
*/
|
|
888
|
-
trafficType: string;
|
|
889
|
-
/**
|
|
890
|
-
* Whether the feature flag is killed or not.
|
|
891
|
-
*/
|
|
892
|
-
killed: boolean;
|
|
893
|
-
/**
|
|
894
|
-
* The list of treatments available for the feature flag.
|
|
895
|
-
*/
|
|
896
|
-
treatments: string[];
|
|
897
|
-
/**
|
|
898
|
-
* Current change number of the feature flag.
|
|
899
|
-
*/
|
|
900
|
-
changeNumber: number;
|
|
901
|
-
/**
|
|
902
|
-
* Map of configurations per treatment.
|
|
903
|
-
* Each existing configuration is a stringified version of the JSON you defined on the Split user interface.
|
|
904
|
-
*/
|
|
905
|
-
configs: {
|
|
906
|
-
[treatmentName: string]: string;
|
|
907
|
-
};
|
|
908
|
-
/**
|
|
909
|
-
* List of sets of the feature flag.
|
|
910
|
-
*/
|
|
911
|
-
sets: string[];
|
|
912
|
-
/**
|
|
913
|
-
* The default treatment of the feature flag.
|
|
914
|
-
*/
|
|
915
|
-
defaultTreatment: string;
|
|
916
|
-
/**
|
|
917
|
-
* Whether the feature flag has impressions tracking disabled or not.
|
|
918
|
-
*/
|
|
919
|
-
impressionsDisabled: boolean;
|
|
920
|
-
/**
|
|
921
|
-
* Prerequisites for the feature flag.
|
|
922
|
-
*/
|
|
923
|
-
prerequisites: Array<{ flagName: string, treatments: string[] }>;
|
|
924
|
-
};
|
|
925
|
-
/**
|
|
926
|
-
* A promise that resolves to a feature flag view or null if the feature flag is not found.
|
|
927
|
-
*/
|
|
928
|
-
type SplitViewAsync = Promise<SplitView | null>;
|
|
929
|
-
/**
|
|
930
|
-
* An array containing the SplitIO.SplitView elements.
|
|
931
|
-
*/
|
|
932
|
-
type SplitViews = Array<SplitView>;
|
|
933
|
-
/**
|
|
934
|
-
* A promise that resolves to an SplitIO.SplitViews array.
|
|
935
|
-
*/
|
|
936
|
-
type SplitViewsAsync = Promise<SplitViews>;
|
|
937
|
-
/**
|
|
938
|
-
* An array of feature flag names.
|
|
939
|
-
*/
|
|
940
|
-
type SplitNames = Array<string>;
|
|
941
|
-
/**
|
|
942
|
-
* A promise that resolves to an array of feature flag names.
|
|
943
|
-
*/
|
|
944
|
-
type SplitNamesAsync = Promise<SplitNames>;
|
|
945
|
-
/**
|
|
946
|
-
* Storage for synchronous (standalone) SDK.
|
|
947
|
-
* Its interface details are not part of the public API.
|
|
948
|
-
*/
|
|
949
|
-
type StorageSync = any;
|
|
950
|
-
/**
|
|
951
|
-
* Storage builder for synchronous (standalone) SDK.
|
|
952
|
-
* Input parameter details are not part of the public API.
|
|
953
|
-
*/
|
|
954
|
-
type StorageSyncFactory = {
|
|
955
|
-
readonly type: StorageType;
|
|
956
|
-
(params: any): (StorageSync | undefined);
|
|
957
|
-
}
|
|
958
|
-
/**
|
|
959
|
-
* Configuration params for `InLocalStorage`
|
|
960
|
-
*/
|
|
961
|
-
type InLocalStorageOptions = {
|
|
962
|
-
/**
|
|
963
|
-
* Optional prefix to prevent any kind of data collision when having multiple factories using the same storage type.
|
|
964
|
-
*
|
|
965
|
-
* @defaultValue `'SPLITIO'`
|
|
966
|
-
*/
|
|
967
|
-
prefix?: string;
|
|
968
|
-
/**
|
|
969
|
-
* Number of days before cached data expires if it was not successfully synchronized (i.e., last SDK_READY or SDK_UPDATE event emitted). If cache expires, it is cleared on initialization.
|
|
970
|
-
*
|
|
971
|
-
* @defaultValue `10`
|
|
972
|
-
*/
|
|
973
|
-
expirationDays?: number;
|
|
974
|
-
/**
|
|
975
|
-
* Optional settings to clear the cache. If set to `true`, the SDK clears the cached data on initialization, unless the cache was cleared within the last 24 hours.
|
|
976
|
-
*
|
|
977
|
-
* @defaultValue `false`
|
|
978
|
-
*/
|
|
979
|
-
clearOnInit?: boolean;
|
|
980
|
-
}
|
|
981
|
-
/**
|
|
982
|
-
* Storage for asynchronous (consumer) SDK.
|
|
983
|
-
* Its interface details are not part of the public API.
|
|
984
|
-
*/
|
|
985
|
-
type StorageAsync = any
|
|
986
|
-
/**
|
|
987
|
-
* Storage builder for asynchronous (consumer) SDK.
|
|
988
|
-
* Input parameter details are not part of the public API.
|
|
989
|
-
*/
|
|
990
|
-
type StorageAsyncFactory = {
|
|
991
|
-
readonly type: StorageType;
|
|
992
|
-
(params: any): StorageAsync;
|
|
993
|
-
}
|
|
994
|
-
/**
|
|
995
|
-
* Configuration params for `PluggableStorage`
|
|
996
|
-
*/
|
|
997
|
-
type PluggableStorageOptions = {
|
|
998
|
-
/**
|
|
999
|
-
* Optional prefix to prevent any kind of data collision when having multiple factories using the same storage wrapper.
|
|
1000
|
-
*
|
|
1001
|
-
* @defaultValue `'SPLITIO'`
|
|
1002
|
-
*/
|
|
1003
|
-
prefix?: string;
|
|
1004
|
-
/**
|
|
1005
|
-
* Storage wrapper.
|
|
1006
|
-
*/
|
|
1007
|
-
wrapper: Object;
|
|
1008
|
-
}
|
|
1009
|
-
/**
|
|
1010
|
-
* Synchronous storage valid types for Node.js.
|
|
1011
|
-
*/
|
|
1012
|
-
type NodeSyncStorage = 'MEMORY';
|
|
1013
|
-
/**
|
|
1014
|
-
* Asynchronous storages valid types for Node.js.
|
|
1015
|
-
*/
|
|
1016
|
-
type NodeAsyncStorage = 'REDIS';
|
|
1017
|
-
/**
|
|
1018
|
-
* Storage valid types for the browser.
|
|
1019
|
-
*/
|
|
1020
|
-
type BrowserStorage = 'MEMORY' | 'LOCALSTORAGE';
|
|
1021
|
-
/**
|
|
1022
|
-
* Storage options for the SDK with no pluggable storage.
|
|
1023
|
-
*/
|
|
1024
|
-
type StorageOptions = {
|
|
1025
|
-
type: NodeSyncStorage | NodeAsyncStorage | BrowserStorage;
|
|
1026
|
-
prefix?: string;
|
|
1027
|
-
options?: Object;
|
|
1028
|
-
}
|
|
1029
|
-
/**
|
|
1030
|
-
* Defines the format of rollout plan data to preload the factory storage (cache).
|
|
1031
|
-
*/
|
|
1032
|
-
type PreloadedData = {
|
|
1033
|
-
/**
|
|
1034
|
-
* Change number of feature flags.
|
|
1035
|
-
*/
|
|
1036
|
-
since: number;
|
|
1037
|
-
/**
|
|
1038
|
-
* List of feature flags.
|
|
1039
|
-
*/
|
|
1040
|
-
flags: Object[],
|
|
1041
|
-
/**
|
|
1042
|
-
* Change number of rule-based segments.
|
|
1043
|
-
*/
|
|
1044
|
-
rbSince?: number,
|
|
1045
|
-
/**
|
|
1046
|
-
* List of rule-based segments.
|
|
1047
|
-
*/
|
|
1048
|
-
rbSegments?: Object[],
|
|
1049
|
-
/**
|
|
1050
|
-
* Optional map of user keys to their memberships.
|
|
1051
|
-
*/
|
|
1052
|
-
memberships?: {
|
|
1053
|
-
[key: string]: Object
|
|
1054
|
-
},
|
|
1055
|
-
/**
|
|
1056
|
-
* Optional map of segments to their list of keys.
|
|
1057
|
-
* This property is ignored if `memberships` is provided.
|
|
1058
|
-
*/
|
|
1059
|
-
segments?: {
|
|
1060
|
-
[segmentName: string]: string[]
|
|
1061
|
-
},
|
|
1062
|
-
}
|
|
1063
|
-
/**
|
|
1064
|
-
* Impression listener interface. This is the interface that needs to be implemented
|
|
1065
|
-
* by the element you provide to the SDK as impression listener.
|
|
1066
|
-
*
|
|
1067
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#listener}
|
|
1068
|
-
*/
|
|
1069
|
-
interface IImpressionListener {
|
|
1070
|
-
logImpression(data: ImpressionData): void;
|
|
1071
|
-
}
|
|
1072
|
-
/**
|
|
1073
|
-
* SDK integration instance.
|
|
1074
|
-
* Its interface details are not part of the public API.
|
|
1075
|
-
*/
|
|
1076
|
-
type Integration = any;
|
|
1077
|
-
/**
|
|
1078
|
-
* SDK integration factory.
|
|
1079
|
-
* By returning an integration, the SDK will queue events and impressions into it.
|
|
1080
|
-
* Input parameter details are not part of the public API.
|
|
1081
|
-
*/
|
|
1082
|
-
type IntegrationFactory = {
|
|
1083
|
-
readonly type: string;
|
|
1084
|
-
(params: any): (Integration | void);
|
|
1085
|
-
}
|
|
1086
|
-
/**
|
|
1087
|
-
* A pair of user key and it's trafficType, required for tracking valid Split events.
|
|
1088
|
-
*/
|
|
1089
|
-
type Identity = {
|
|
1090
|
-
/**
|
|
1091
|
-
* The user key.
|
|
1092
|
-
*/
|
|
1093
|
-
key: string;
|
|
1094
|
-
/**
|
|
1095
|
-
* The key traffic type.
|
|
1096
|
-
*/
|
|
1097
|
-
trafficType: string;
|
|
1098
|
-
};
|
|
1099
|
-
/**
|
|
1100
|
-
* Object with information about a Split event.
|
|
1101
|
-
*/
|
|
1102
|
-
type EventData = {
|
|
1103
|
-
eventTypeId: string;
|
|
1104
|
-
value?: number;
|
|
1105
|
-
properties?: Properties;
|
|
1106
|
-
trafficTypeName?: string;
|
|
1107
|
-
key?: string;
|
|
1108
|
-
timestamp: number;
|
|
1109
|
-
};
|
|
1110
|
-
/**
|
|
1111
|
-
* Object representing the data sent by Split (events and impressions).
|
|
1112
|
-
*/
|
|
1113
|
-
type IntegrationData = {
|
|
1114
|
-
/**
|
|
1115
|
-
* The type of Split data.
|
|
1116
|
-
*/
|
|
1117
|
-
type: 'IMPRESSION';
|
|
1118
|
-
/**
|
|
1119
|
-
* The impression data.
|
|
1120
|
-
*/
|
|
1121
|
-
payload: ImpressionData;
|
|
1122
|
-
} | {
|
|
1123
|
-
/**
|
|
1124
|
-
* The type of Split data.
|
|
1125
|
-
*/
|
|
1126
|
-
type: 'EVENT';
|
|
1127
|
-
/**
|
|
1128
|
-
* The event data.
|
|
1129
|
-
*/
|
|
1130
|
-
payload: EventData;
|
|
1131
|
-
};
|
|
1132
|
-
/**
|
|
1133
|
-
* Available URL settings for the SDKs.
|
|
1134
|
-
*/
|
|
1135
|
-
type UrlSettings = {
|
|
1136
|
-
/**
|
|
1137
|
-
* String property to override the base URL where the SDK will get rollout plan related data, like feature flags and segments definitions.
|
|
1138
|
-
*
|
|
1139
|
-
* @defaultValue `'https://sdk.split.io/api'`
|
|
1140
|
-
*/
|
|
1141
|
-
sdk?: string;
|
|
1142
|
-
/**
|
|
1143
|
-
* String property to override the base URL where the SDK will post event-related information like impressions.
|
|
1144
|
-
*
|
|
1145
|
-
* @defaultValue `'https://events.split.io/api'`
|
|
1146
|
-
*/
|
|
1147
|
-
events?: string;
|
|
1148
|
-
/**
|
|
1149
|
-
* String property to override the base URL where the SDK will get authorization tokens to be used with functionality that requires it, like streaming.
|
|
1150
|
-
*
|
|
1151
|
-
* @defaultValue `'https://auth.split.io/api'`
|
|
1152
|
-
*/
|
|
1153
|
-
auth?: string;
|
|
1154
|
-
/**
|
|
1155
|
-
* String property to override the base URL where the SDK will connect to receive streaming updates.
|
|
1156
|
-
*
|
|
1157
|
-
* @defaultValue `'https://streaming.split.io'`
|
|
1158
|
-
*/
|
|
1159
|
-
streaming?: string;
|
|
1160
|
-
/**
|
|
1161
|
-
* String property to override the base URL where the SDK will post telemetry data.
|
|
1162
|
-
*
|
|
1163
|
-
* @defaultValue `'https://telemetry.split.io/api'`
|
|
1164
|
-
*/
|
|
1165
|
-
telemetry?: string;
|
|
1166
|
-
};
|
|
1167
|
-
|
|
1168
|
-
/**
|
|
1169
|
-
* SplitFilter type.
|
|
1170
|
-
*/
|
|
1171
|
-
type SplitFilterType = 'bySet' | 'byName' | 'byPrefix';
|
|
1172
|
-
/**
|
|
1173
|
-
* Defines a feature flag filter, described by a type and list of values.
|
|
1174
|
-
*/
|
|
1175
|
-
interface SplitFilter {
|
|
1176
|
-
/**
|
|
1177
|
-
* Type of the filter.
|
|
1178
|
-
*/
|
|
1179
|
-
type: SplitFilterType;
|
|
1180
|
-
/**
|
|
1181
|
-
* List of values: flag set names for 'bySet' filter type, feature flag names for 'byName' filter type, and feature flag name prefixes for 'byPrefix' type.
|
|
1182
|
-
*/
|
|
1183
|
-
values: string[];
|
|
1184
|
-
}
|
|
1185
|
-
/**
|
|
1186
|
-
* ImpressionsMode type
|
|
1187
|
-
*/
|
|
1188
|
-
type ImpressionsMode = 'OPTIMIZED' | 'DEBUG' | 'NONE';
|
|
1189
|
-
/**
|
|
1190
|
-
* User consent status.
|
|
1191
|
-
*/
|
|
1192
|
-
type ConsentStatus = 'GRANTED' | 'DECLINED' | 'UNKNOWN';
|
|
1193
|
-
/**
|
|
1194
|
-
* Logger. Its interface details are not part of the public API. It shouldn't be used directly.
|
|
1195
|
-
*/
|
|
1196
|
-
interface ILogger {
|
|
1197
|
-
setLogLevel(logLevel: LogLevel): void;
|
|
1198
|
-
}
|
|
1199
|
-
/**
|
|
1200
|
-
* Settings interface for Browser SDK instances created with client-side API and synchronous storage (e.g., in-memory or local storage).
|
|
1201
|
-
*
|
|
1202
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#configuration}
|
|
1203
|
-
*/
|
|
1204
|
-
interface IClientSideSettings extends IClientSideSyncSharedSettings, IPluggableSharedSettings {
|
|
1205
|
-
/**
|
|
1206
|
-
* Defines the factory function to instantiate the storage. If not provided, the default in-memory storage is used.
|
|
1207
|
-
*
|
|
1208
|
-
* NOTE: Currently, there is no persistent storage option available for the React Native SDK; only `InLocalStorage` for the Browser SDK.
|
|
1209
|
-
*
|
|
1210
|
-
* Example:
|
|
1211
|
-
* ```
|
|
1212
|
-
* SplitFactory({
|
|
1213
|
-
* ...
|
|
1214
|
-
* storage: InLocalStorage()
|
|
1215
|
-
* })
|
|
1216
|
-
* ```
|
|
1217
|
-
*/
|
|
1218
|
-
storage?: StorageSyncFactory;
|
|
1219
|
-
}
|
|
1220
|
-
/**
|
|
1221
|
-
* Settings interface for React Native SDK instances, with client-side API and synchronous storage.
|
|
1222
|
-
*
|
|
1223
|
-
* @see {@link https://help.split.io/hc/en-us/articles/4406066357901-React-Native-SDK#configuration}
|
|
1224
|
-
*/
|
|
1225
|
-
interface IReactNativeSettings extends IClientSideSettings { }
|
|
1226
|
-
/**
|
|
1227
|
-
* Settings interface for Browser SDK instances created with client-side API and asynchronous storage (e.g., serverless environments with a persistent storage).
|
|
1228
|
-
* If your storage is synchronous (by default we use memory, which is sync) use SplitIO.IClientSideSettings instead.
|
|
1229
|
-
*
|
|
1230
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage}
|
|
1231
|
-
*/
|
|
1232
|
-
interface IClientSideAsyncSettings extends IClientSideSharedSettings, ISharedSettings, IPluggableSharedSettings {
|
|
1233
|
-
/**
|
|
1234
|
-
* The SDK mode. When using `PluggableStorage` as storage, the possible values are "consumer" and "consumer_partial".
|
|
1235
|
-
*
|
|
1236
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage}
|
|
1237
|
-
*/
|
|
1238
|
-
mode: 'consumer' | 'consumer_partial';
|
|
1239
|
-
/**
|
|
1240
|
-
* Defines the factory function to instantiate the storage.
|
|
1241
|
-
*
|
|
1242
|
-
* Example:
|
|
1243
|
-
* ```
|
|
1244
|
-
* SplitFactory({
|
|
1245
|
-
* ...
|
|
1246
|
-
* storage: PluggableStorage({ wrapper: SomeWrapper })
|
|
1247
|
-
* })
|
|
1248
|
-
* ```
|
|
1249
|
-
*/
|
|
1250
|
-
storage: StorageAsyncFactory;
|
|
1251
|
-
/**
|
|
1252
|
-
* SDK Startup settings.
|
|
1253
|
-
*/
|
|
1254
|
-
startup?: {
|
|
1255
|
-
/**
|
|
1256
|
-
* Maximum amount of time used before notify a timeout.
|
|
1257
|
-
*
|
|
1258
|
-
* @defaultValue `5`
|
|
1259
|
-
*/
|
|
1260
|
-
readyTimeout?: number;
|
|
1261
|
-
/**
|
|
1262
|
-
* For SDK posts the queued events data in bulks with a given rate, but the first push window is defined separately,
|
|
1263
|
-
* to better control on browsers or mobile. This number defines that window before the first events push.
|
|
1264
|
-
*
|
|
1265
|
-
* NOTE: this param is ignored in 'consumer' mode.
|
|
1266
|
-
*
|
|
1267
|
-
* @defaultValue `10`
|
|
1268
|
-
*/
|
|
1269
|
-
eventsFirstPushWindow?: number;
|
|
1270
|
-
};
|
|
1271
|
-
/**
|
|
1272
|
-
* SDK scheduler settings.
|
|
1273
|
-
*/
|
|
1274
|
-
scheduler?: {
|
|
1275
|
-
/**
|
|
1276
|
-
* The SDK sends information on who got what treatment at what time back to Split servers to power analytics. This parameter controls how often this data is sent to Split servers. The parameter should be in seconds.
|
|
1277
|
-
*
|
|
1278
|
-
* NOTE: this param is ignored in 'consumer' mode.
|
|
1279
|
-
*
|
|
1280
|
-
* @defaultValue `60`
|
|
1281
|
-
*/
|
|
1282
|
-
impressionsRefreshRate?: number;
|
|
1283
|
-
/**
|
|
1284
|
-
* The maximum number of impression items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
|
|
1285
|
-
* If you use a 0 here, the queue will have no maximum size.
|
|
1286
|
-
*
|
|
1287
|
-
* NOTE: this param is ignored in 'consumer' mode.
|
|
1288
|
-
*
|
|
1289
|
-
* @defaultValue `30000`
|
|
1290
|
-
*/
|
|
1291
|
-
impressionsQueueSize?: number;
|
|
1292
|
-
/**
|
|
1293
|
-
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
1294
|
-
*
|
|
1295
|
-
* NOTE: this param is ignored in 'consumer' mode.
|
|
1296
|
-
*
|
|
1297
|
-
* @defaultValue `3600`
|
|
1298
|
-
*/
|
|
1299
|
-
telemetryRefreshRate?: number;
|
|
1300
|
-
/**
|
|
1301
|
-
* The SDK posts the queued events data in bulks. This parameter controls the posting rate in seconds.
|
|
1302
|
-
*
|
|
1303
|
-
* NOTE: this param is ignored in 'consumer' mode.
|
|
1304
|
-
*
|
|
1305
|
-
* @defaultValue `60`
|
|
1306
|
-
*/
|
|
1307
|
-
eventsPushRate?: number;
|
|
1308
|
-
/**
|
|
1309
|
-
* The maximum number of event items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
|
|
1310
|
-
* If you use a 0 here, the queue will have no maximum size.
|
|
1311
|
-
*
|
|
1312
|
-
* NOTE: this param is ignored in 'consumer' mode.
|
|
1313
|
-
*
|
|
1314
|
-
* @defaultValue `500`
|
|
1315
|
-
*/
|
|
1316
|
-
eventsQueueSize?: number;
|
|
1317
|
-
};
|
|
1318
|
-
}
|
|
1319
|
-
/**
|
|
1320
|
-
* Settings interface for JavaScript SDK instances created on the browser, with client-side API and synchronous storage (e.g., in-memory or local storage).
|
|
1321
|
-
*
|
|
1322
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#configuration}
|
|
1323
|
-
*/
|
|
1324
|
-
interface IBrowserSettings extends IClientSideSyncSharedSettings, INonPluggableSharedSettings {
|
|
1325
|
-
/**
|
|
1326
|
-
* Defines which kind of storage we can instantiate on the browser.
|
|
1327
|
-
* Possible storage types are 'MEMORY', which is the default, and 'LOCALSTORAGE'.
|
|
1328
|
-
*/
|
|
1329
|
-
storage?: {
|
|
1330
|
-
/**
|
|
1331
|
-
* Storage type to be instantiated by the SDK.
|
|
1332
|
-
*
|
|
1333
|
-
* @defaultValue `'MEMORY'`
|
|
1334
|
-
*/
|
|
1335
|
-
type?: BrowserStorage;
|
|
1336
|
-
/**
|
|
1337
|
-
* Optional prefix to prevent any kind of data collision between SDK versions when using 'LOCALSTORAGE'.
|
|
1338
|
-
*
|
|
1339
|
-
* @defaultValue `'SPLITIO'`
|
|
1340
|
-
*/
|
|
1341
|
-
prefix?: string;
|
|
1342
|
-
/**
|
|
1343
|
-
* Optional settings for the 'LOCALSTORAGE' storage type. It specifies the number of days before cached data expires if it was not successfully synchronized (i.e., last SDK_READY or SDK_UPDATE event emitted). If cache expires, it is cleared on initialization.
|
|
1344
|
-
*
|
|
1345
|
-
* @defaultValue `10`
|
|
1346
|
-
*/
|
|
1347
|
-
expirationDays?: number;
|
|
1348
|
-
/**
|
|
1349
|
-
* Optional settings for the 'LOCALSTORAGE' storage type. If set to `true`, the SDK clears the cached data on initialization, unless the cache was cleared within the last 24 hours.
|
|
1350
|
-
*
|
|
1351
|
-
* @defaultValue `false`
|
|
1352
|
-
*/
|
|
1353
|
-
clearOnInit?: boolean;
|
|
1354
|
-
};
|
|
1355
|
-
}
|
|
1356
|
-
/**
|
|
1357
|
-
* Settings interface for JavaScript SDK instances created on Node.js, with server-side API and synchronous in-memory storage.
|
|
1358
|
-
* If your storage is asynchronous (Redis for example) use SplitIO.INodeAsyncSettings instead.
|
|
1359
|
-
*
|
|
1360
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#configuration}
|
|
1361
|
-
*/
|
|
1362
|
-
interface INodeSettings extends IServerSideSharedSettings, ISyncSharedSettings, INonPluggableSharedSettings {
|
|
1363
|
-
/**
|
|
1364
|
-
* Defines which kind of storage we can instantiate on Node.js for 'standalone' mode.
|
|
1365
|
-
* The only possible storage type is 'MEMORY', which is the default.
|
|
1366
|
-
*/
|
|
1367
|
-
storage?: {
|
|
1368
|
-
/**
|
|
1369
|
-
* Synchronous storage type to be instantiated by the SDK.
|
|
1370
|
-
*
|
|
1371
|
-
* @defaultValue `'MEMORY'`
|
|
1372
|
-
*/
|
|
1373
|
-
type?: NodeSyncStorage;
|
|
1374
|
-
/**
|
|
1375
|
-
* Optional prefix to prevent any kind of data collision between SDK versions.
|
|
1376
|
-
*
|
|
1377
|
-
* @defaultValue `'SPLITIO'`
|
|
1378
|
-
*/
|
|
1379
|
-
prefix?: string;
|
|
1380
|
-
};
|
|
1381
|
-
sync?: ISyncSharedSettings['sync'] & {
|
|
1382
|
-
/**
|
|
1383
|
-
* Custom options object for HTTP(S) requests in Node.js.
|
|
1384
|
-
* If provided, this object is merged with the options object passed by the SDK for EventSource and Node-Fetch calls.
|
|
1385
|
-
* @see {@link https://www.npmjs.com/package/node-fetch#options}
|
|
1386
|
-
*/
|
|
1387
|
-
requestOptions?: {
|
|
1388
|
-
/**
|
|
1389
|
-
* Custom function called before each request, allowing you to add or update headers in SDK HTTP requests.
|
|
1390
|
-
* Some headers, such as `SplitSDKVersion`, are required by the SDK and cannot be overridden.
|
|
1391
|
-
* To pass multiple headers with the same name, combine their values into a single line, separated by commas. Example: `{ 'Authorization': 'value1, value2' }`
|
|
1392
|
-
* Or provide keys with different cases since headers are case-insensitive. Example: `{ 'authorization': 'value1', 'Authorization': 'value2' }`
|
|
1393
|
-
*
|
|
1394
|
-
* @defaultValue `undefined`
|
|
1395
|
-
*
|
|
1396
|
-
* @param context - The context for the request, which contains the `headers` property object representing the current headers in the request.
|
|
1397
|
-
* @returns An object representing a set of headers to be merged with the current headers.
|
|
1398
|
-
*
|
|
1399
|
-
* @example
|
|
1400
|
-
* ```
|
|
1401
|
-
* const factory = SplitFactory({
|
|
1402
|
-
* ...
|
|
1403
|
-
* sync: {
|
|
1404
|
-
* getHeaderOverrides: (context) => {
|
|
1405
|
-
* return {
|
|
1406
|
-
* 'Authorization': context.headers['Authorization'] + ', other-value',
|
|
1407
|
-
* 'custom-header': 'custom-value'
|
|
1408
|
-
* };
|
|
1409
|
-
* }
|
|
1410
|
-
* }
|
|
1411
|
-
* });
|
|
1412
|
-
* ```
|
|
1413
|
-
*/
|
|
1414
|
-
getHeaderOverrides?: (context: { headers: Record<string, string> }) => Record<string, string>;
|
|
1415
|
-
/**
|
|
1416
|
-
* Custom Node.js HTTP(S) Agent used by the SDK for HTTP(S) requests.
|
|
1417
|
-
*
|
|
1418
|
-
* You can use it, for example, for certificate pinning or setting a network proxy:
|
|
1419
|
-
*
|
|
1420
|
-
* ```
|
|
1421
|
-
* const { HttpsProxyAgent } = require('https-proxy-agent');
|
|
1422
|
-
*
|
|
1423
|
-
* const proxyAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY || 'http://10.10.1.10:1080');
|
|
1424
|
-
*
|
|
1425
|
-
* const factory = SplitFactory({
|
|
1426
|
-
* ...
|
|
1427
|
-
* sync: {
|
|
1428
|
-
* requestOptions: {
|
|
1429
|
-
* agent: proxyAgent
|
|
1430
|
-
* }
|
|
1431
|
-
* }
|
|
1432
|
-
* })
|
|
1433
|
-
* ```
|
|
1434
|
-
*
|
|
1435
|
-
* @see {@link https://nodejs.org/api/https.html#class-httpsagent}
|
|
1436
|
-
*
|
|
1437
|
-
* @defaultValue `undefined`
|
|
1438
|
-
*/
|
|
1439
|
-
agent?: RequestOptions['agent'];
|
|
1440
|
-
};
|
|
1441
|
-
};
|
|
1442
|
-
}
|
|
1443
|
-
/**
|
|
1444
|
-
* Settings interface for JavaScript SDK instances created on Node.js, with asynchronous storage like Redis.
|
|
1445
|
-
* If your storage is synchronous (by default we use memory, which is sync) use SplitIO.INodeSettings instead.
|
|
1446
|
-
*
|
|
1447
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#configuration}
|
|
1448
|
-
*/
|
|
1449
|
-
interface INodeAsyncSettings extends IServerSideSharedSettings, ISharedSettings, INonPluggableSharedSettings {
|
|
1450
|
-
/**
|
|
1451
|
-
* The SDK mode. When using 'REDIS' storage type, the only possible value is "consumer", which is required.
|
|
1452
|
-
*
|
|
1453
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#state-sharing-redis-integration}
|
|
1454
|
-
*/
|
|
1455
|
-
mode: 'consumer';
|
|
1456
|
-
/**
|
|
1457
|
-
* Defines which kind of async storage we can instantiate on Node.js for 'consumer' mode.
|
|
1458
|
-
* The only possible storage type is 'REDIS'.
|
|
1459
|
-
*/
|
|
1460
|
-
storage: {
|
|
1461
|
-
/**
|
|
1462
|
-
* 'REDIS' storage type to be instantiated by the SDK.
|
|
1463
|
-
*/
|
|
1464
|
-
type: NodeAsyncStorage;
|
|
1465
|
-
/**
|
|
1466
|
-
* Options to be passed to the Redis storage. Use it with storage type: 'REDIS'.
|
|
1467
|
-
*/
|
|
1468
|
-
options?: {
|
|
1469
|
-
/**
|
|
1470
|
-
* Redis URL. If set, `host`, `port`, `db` and `pass` params will be ignored.
|
|
1471
|
-
*
|
|
1472
|
-
* Examples:
|
|
1473
|
-
* ```
|
|
1474
|
-
* url: 'localhost'
|
|
1475
|
-
* url: '127.0.0.1:6379'
|
|
1476
|
-
* url: 'redis://:authpassword@127.0.0.1:6379/0'
|
|
1477
|
-
* ```
|
|
1478
|
-
*/
|
|
1479
|
-
url?: string;
|
|
1480
|
-
/**
|
|
1481
|
-
* Redis host.
|
|
1482
|
-
*
|
|
1483
|
-
* @defaultValue `'localhost'`
|
|
1484
|
-
*/
|
|
1485
|
-
host?: string;
|
|
1486
|
-
/**
|
|
1487
|
-
* Redis port.
|
|
1488
|
-
*
|
|
1489
|
-
* @defaultValue `6379`
|
|
1490
|
-
*/
|
|
1491
|
-
port?: number;
|
|
1492
|
-
/**
|
|
1493
|
-
* Redis database to be used.
|
|
1494
|
-
*
|
|
1495
|
-
* @defaultValue `0`
|
|
1496
|
-
*/
|
|
1497
|
-
db?: number;
|
|
1498
|
-
/**
|
|
1499
|
-
* Redis password. Don't define if no password is used.
|
|
1500
|
-
*
|
|
1501
|
-
* @defaultValue `undefined`
|
|
1502
|
-
*/
|
|
1503
|
-
pass?: string;
|
|
1504
|
-
/**
|
|
1505
|
-
* The milliseconds before a timeout occurs during the initial connection to the Redis server.
|
|
1506
|
-
*
|
|
1507
|
-
* @defaultValue `10000`
|
|
1508
|
-
*/
|
|
1509
|
-
connectionTimeout?: number;
|
|
1510
|
-
/**
|
|
1511
|
-
* The milliseconds before Redis commands are timeout by the SDK.
|
|
1512
|
-
* Method calls that involve Redis commands, like `client.getTreatment` or `client.track` calls, are resolved when the commands success or timeout.
|
|
1513
|
-
*
|
|
1514
|
-
* @defaultValue `5000`
|
|
1515
|
-
*/
|
|
1516
|
-
operationTimeout?: number;
|
|
1517
|
-
/**
|
|
1518
|
-
* TLS configuration for Redis connection.
|
|
1519
|
-
* @see {@link https://www.npmjs.com/package/ioredis#tls-options }
|
|
1520
|
-
*
|
|
1521
|
-
* @defaultValue `undefined`
|
|
1522
|
-
*/
|
|
1523
|
-
tls?: RedisOptions['tls'];
|
|
1524
|
-
};
|
|
1525
|
-
/**
|
|
1526
|
-
* Optional prefix to prevent any kind of data collision between SDK versions.
|
|
1527
|
-
*
|
|
1528
|
-
* @defaultValue `'SPLITIO'`
|
|
1529
|
-
*/
|
|
1530
|
-
prefix?: string;
|
|
1531
|
-
};
|
|
1532
|
-
}
|
|
1533
|
-
/**
|
|
1534
|
-
* This represents the interface for the SDK instance with synchronous storage and client-side API,
|
|
1535
|
-
* i.e., where client instances have a bound user key.
|
|
1536
|
-
*/
|
|
1537
|
-
interface IBrowserSDK extends IBasicSDK {
|
|
1538
|
-
/**
|
|
1539
|
-
* Returns the default client instance of the SDK, associated with the key provided on settings.
|
|
1540
|
-
*
|
|
1541
|
-
* @returns The client instance.
|
|
1542
|
-
*/
|
|
1543
|
-
client(): IBrowserClient;
|
|
1544
|
-
/**
|
|
1545
|
-
* Returns a shared client of the SDK, associated with the given key.
|
|
1546
|
-
* @param key - The key for the new client instance.
|
|
1547
|
-
* @returns The client instance.
|
|
1548
|
-
*/
|
|
1549
|
-
client(key: SplitKey): IBrowserClient;
|
|
1550
|
-
/**
|
|
1551
|
-
* Returns a manager instance of the SDK to explore available information.
|
|
1552
|
-
*
|
|
1553
|
-
* @returns The manager instance.
|
|
1554
|
-
*/
|
|
1555
|
-
manager(): IManager;
|
|
1556
|
-
/**
|
|
1557
|
-
* User consent API.
|
|
1558
|
-
*/
|
|
1559
|
-
UserConsent: IUserConsentAPI;
|
|
1560
|
-
}
|
|
1561
|
-
/**
|
|
1562
|
-
* This represents the interface for the SDK instance with asynchronous storage and client-side API,
|
|
1563
|
-
* i.e., where client instances have a bound user key.
|
|
1564
|
-
*/
|
|
1565
|
-
interface IBrowserAsyncSDK extends IBasicSDK {
|
|
1566
|
-
/**
|
|
1567
|
-
* Returns the default client instance of the SDK, associated with the key provided on settings.
|
|
1568
|
-
*
|
|
1569
|
-
* @returns The asynchronous client instance.
|
|
1570
|
-
*/
|
|
1571
|
-
client(): IBrowserAsyncClient;
|
|
1572
|
-
/**
|
|
1573
|
-
* Returns a shared client of the SDK, associated with the given key.
|
|
1574
|
-
*
|
|
1575
|
-
* @param key - The key for the new client instance.
|
|
1576
|
-
* @returns The asynchronous client instance.
|
|
1577
|
-
*/
|
|
1578
|
-
client(key: SplitKey): IBrowserAsyncClient;
|
|
1579
|
-
/**
|
|
1580
|
-
* Returns a manager instance of the SDK to explore available information.
|
|
1581
|
-
*
|
|
1582
|
-
* @returns The manager instance.
|
|
1583
|
-
*/
|
|
1584
|
-
manager(): IAsyncManager;
|
|
1585
|
-
/**
|
|
1586
|
-
* User consent API.
|
|
1587
|
-
*/
|
|
1588
|
-
UserConsent: IUserConsentAPI;
|
|
1589
|
-
}
|
|
1590
|
-
/**
|
|
1591
|
-
* This represents the interface for the SDK instance for server-side with synchronous storage.
|
|
1592
|
-
*/
|
|
1593
|
-
interface ISDK extends IBasicSDK {
|
|
1594
|
-
/**
|
|
1595
|
-
* Returns the default client instance of the SDK.
|
|
1596
|
-
*
|
|
1597
|
-
* @returns The client instance.
|
|
1598
|
-
*/
|
|
1599
|
-
client(): IClient;
|
|
1600
|
-
/**
|
|
1601
|
-
* Returns a manager instance of the SDK to explore available information.
|
|
1602
|
-
*
|
|
1603
|
-
* @returns The manager instance.
|
|
1604
|
-
*/
|
|
1605
|
-
manager(): IManager;
|
|
1606
|
-
/**
|
|
1607
|
-
* Returns the current snapshot of the SDK rollout plan in cache.
|
|
1608
|
-
*
|
|
1609
|
-
* @param keys - Optional list of keys to generate the rollout plan snapshot with the memberships of the given keys, rather than the complete segments data.
|
|
1610
|
-
* @returns The current snapshot of the SDK rollout plan.
|
|
1611
|
-
*/
|
|
1612
|
-
getCache(keys?: SplitKey[]): PreloadedData,
|
|
1613
|
-
}
|
|
1614
|
-
/**
|
|
1615
|
-
* This represents the interface for the SDK instance for server-side with asynchronous storage.
|
|
1616
|
-
*/
|
|
1617
|
-
interface IAsyncSDK extends IBasicSDK {
|
|
1618
|
-
/**
|
|
1619
|
-
* Returns the default client instance of the SDK.
|
|
1620
|
-
*
|
|
1621
|
-
* @returns The asynchronous client instance.
|
|
1622
|
-
*/
|
|
1623
|
-
client(): IAsyncClient;
|
|
1624
|
-
/**
|
|
1625
|
-
* Returns a manager instance of the SDK to explore available information.
|
|
1626
|
-
*
|
|
1627
|
-
* @returns The manager instance.
|
|
1628
|
-
*/
|
|
1629
|
-
manager(): IAsyncManager;
|
|
1630
|
-
}
|
|
1631
|
-
/**
|
|
1632
|
-
* This represents the interface for the Client instance on server-side, where the user key is not bound to the instance and must be provided on each method call.
|
|
1633
|
-
* This interface is available in Node.js, or when importing the 'server' sub-package of JS SDK (e.g., `import { SplitFactory } from '@splitsoftware/splitio/server'`).
|
|
1634
|
-
*/
|
|
1635
|
-
interface IClient extends IBasicClient {
|
|
1636
|
-
/**
|
|
1637
|
-
* Returns a Treatment value, which is the treatment string for the given feature.
|
|
1638
|
-
*
|
|
1639
|
-
* @param key - The string key representing the consumer.
|
|
1640
|
-
* @param featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1641
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1642
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1643
|
-
* @returns The treatment string.
|
|
1644
|
-
*/
|
|
1645
|
-
getTreatment(key: SplitKey, featureFlagName: string, attributes?: Attributes, options?: EvaluationOptions): Treatment;
|
|
1646
|
-
/**
|
|
1647
|
-
* Returns a TreatmentWithConfig value, which is an object with both treatment and config string for the given feature.
|
|
1648
|
-
*
|
|
1649
|
-
* @param key - The string key representing the consumer.
|
|
1650
|
-
* @param featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1651
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1652
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1653
|
-
* @returns The TreatmentWithConfig object that contains the treatment string and the configuration stringified JSON (or null if there was no config for that treatment).
|
|
1654
|
-
*/
|
|
1655
|
-
getTreatmentWithConfig(key: SplitKey, featureFlagName: string, attributes?: Attributes, options?: EvaluationOptions): TreatmentWithConfig;
|
|
1656
|
-
/**
|
|
1657
|
-
* Returns a Treatments value, which is an object map with the treatments for the given features.
|
|
1658
|
-
*
|
|
1659
|
-
* @param key - The string key representing the consumer.
|
|
1660
|
-
* @param featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1661
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1662
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1663
|
-
* @returns The treatments object map.
|
|
1664
|
-
*/
|
|
1665
|
-
getTreatments(key: SplitKey, featureFlagNames: string[], attributes?: Attributes, options?: EvaluationOptions): Treatments;
|
|
1666
|
-
/**
|
|
1667
|
-
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the given features.
|
|
1668
|
-
*
|
|
1669
|
-
* @param key - The string key representing the consumer.
|
|
1670
|
-
* @param featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1671
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1672
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1673
|
-
* @returns The map with all the TreatmentWithConfig objects
|
|
1674
|
-
*/
|
|
1675
|
-
getTreatmentsWithConfig(key: SplitKey, featureFlagNames: string[], attributes?: Attributes, options?: EvaluationOptions): TreatmentsWithConfig;
|
|
1676
|
-
/**
|
|
1677
|
-
* Returns a Treatments value, which is an object map with the treatments for the feature flags related to the given flag set.
|
|
1678
|
-
*
|
|
1679
|
-
* @param key - The string key representing the consumer.
|
|
1680
|
-
* @param flagSet - The flag set name we want to get the treatments.
|
|
1681
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1682
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1683
|
-
* @returns The map with all the Treatment objects
|
|
1684
|
-
*/
|
|
1685
|
-
getTreatmentsByFlagSet(key: SplitKey, flagSet: string, attributes?: Attributes, options?: EvaluationOptions): Treatments;
|
|
1686
|
-
/**
|
|
1687
|
-
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag set.
|
|
1688
|
-
*
|
|
1689
|
-
* @param key - The string key representing the consumer.
|
|
1690
|
-
* @param flagSet - The flag set name we want to get the treatments.
|
|
1691
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1692
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1693
|
-
* @returns The map with all the TreatmentWithConfig objects
|
|
1694
|
-
*/
|
|
1695
|
-
getTreatmentsWithConfigByFlagSet(key: SplitKey, flagSet: string, attributes?: Attributes, options?: EvaluationOptions): TreatmentsWithConfig;
|
|
1696
|
-
/**
|
|
1697
|
-
* Returns a Returns a Treatments value, which is an object with both treatment and config string for to the feature flags related to the given flag sets.
|
|
1698
|
-
*
|
|
1699
|
-
* @param key - The string key representing the consumer.
|
|
1700
|
-
* @param flagSets - An array of the flag set names we want to get the treatments.
|
|
1701
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1702
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1703
|
-
* @returns The map with all the Treatment objects
|
|
1704
|
-
*/
|
|
1705
|
-
getTreatmentsByFlagSets(key: SplitKey, flagSets: string[], attributes?: Attributes, options?: EvaluationOptions): Treatments;
|
|
1706
|
-
/**
|
|
1707
|
-
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag sets.
|
|
1708
|
-
*
|
|
1709
|
-
* @param key - The string key representing the consumer.
|
|
1710
|
-
* @param flagSets - An array of the flag set names we want to get the treatments.
|
|
1711
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1712
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1713
|
-
* @returns The map with all the TreatmentWithConfig objects
|
|
1714
|
-
*/
|
|
1715
|
-
getTreatmentsWithConfigByFlagSets(key: SplitKey, flagSets: string[], attributes?: Attributes, options?: EvaluationOptions): TreatmentsWithConfig;
|
|
1716
|
-
/**
|
|
1717
|
-
* Tracks an event to be fed to the results product on Split user interface.
|
|
1718
|
-
*
|
|
1719
|
-
* @param key - The key that identifies the entity related to this event.
|
|
1720
|
-
* @param trafficType - The traffic type of the entity related to this event. See {@link https://help.split.io/hc/en-us/articles/360019916311-Traffic-type}
|
|
1721
|
-
* @param eventType - The event type corresponding to this event.
|
|
1722
|
-
* @param value - The value of this event.
|
|
1723
|
-
* @param properties - The properties of this event. Values can be string, number, boolean or null.
|
|
1724
|
-
* @returns Whether the event was added to the queue successfully or not.
|
|
1725
|
-
*/
|
|
1726
|
-
track(key: SplitKey, trafficType: string, eventType: string, value?: number, properties?: Properties): boolean;
|
|
1727
|
-
}
|
|
1728
|
-
/**
|
|
1729
|
-
* This represents the interface for the Client instance on server-side with asynchronous storage, like REDIS.
|
|
1730
|
-
* User key is not bound to the instance and must be provided on each method call, which returns a promise.
|
|
1731
|
-
* This interface is available in Node.js, or when importing the 'server' sub-package in JS SDK (e.g., `import { SplitFactory } from '@splitsoftware/splitio/server'`).
|
|
1732
|
-
*/
|
|
1733
|
-
interface IAsyncClient extends IBasicClient {
|
|
1734
|
-
/**
|
|
1735
|
-
* Returns a Treatment value, which will be (or eventually be) the treatment string for the given feature.
|
|
1736
|
-
*
|
|
1737
|
-
* @param key - The string key representing the consumer.
|
|
1738
|
-
* @param featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1739
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1740
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1741
|
-
* @returns Treatment promise that resolves to the treatment string.
|
|
1742
|
-
*/
|
|
1743
|
-
getTreatment(key: SplitKey, featureFlagName: string, attributes?: Attributes, options?: EvaluationOptions): AsyncTreatment;
|
|
1744
|
-
/**
|
|
1745
|
-
* Returns a TreatmentWithConfig value, which will be (or eventually be) an object with both treatment and config string for the given feature.
|
|
1746
|
-
*
|
|
1747
|
-
* @param key - The string key representing the consumer.
|
|
1748
|
-
* @param featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1749
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1750
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1751
|
-
* @returns TreatmentWithConfig promise that resolves to the TreatmentWithConfig object.
|
|
1752
|
-
*/
|
|
1753
|
-
getTreatmentWithConfig(key: SplitKey, featureFlagName: string, attributes?: Attributes, options?: EvaluationOptions): AsyncTreatmentWithConfig;
|
|
1754
|
-
/**
|
|
1755
|
-
* Returns a Treatments value, which will be (or eventually be) an object map with the treatments for the given features.
|
|
1756
|
-
*
|
|
1757
|
-
* @param key - The string key representing the consumer.
|
|
1758
|
-
* @param featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1759
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1760
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1761
|
-
* @returns Treatments promise that resolves to the treatments object map.
|
|
1762
|
-
*/
|
|
1763
|
-
getTreatments(key: SplitKey, featureFlagNames: string[], attributes?: Attributes, options?: EvaluationOptions): AsyncTreatments;
|
|
1764
|
-
/**
|
|
1765
|
-
* Returns a TreatmentsWithConfig value, which will be (or eventually be) an object map with the TreatmentWithConfig (an object with both treatment and config string) for the given features.
|
|
1766
|
-
*
|
|
1767
|
-
* @param key - The string key representing the consumer.
|
|
1768
|
-
* @param featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1769
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1770
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1771
|
-
* @returns TreatmentsWithConfig promise that resolves to the map of TreatmentsWithConfig objects.
|
|
1772
|
-
*/
|
|
1773
|
-
getTreatmentsWithConfig(key: SplitKey, featureFlagNames: string[], attributes?: Attributes, options?: EvaluationOptions): AsyncTreatmentsWithConfig;
|
|
1774
|
-
/**
|
|
1775
|
-
* Returns a Treatments value, which is an object map with the treatments for the feature flags related to the given flag set.
|
|
1776
|
-
*
|
|
1777
|
-
* @param key - The string key representing the consumer.
|
|
1778
|
-
* @param flagSet - The flag set name we want to get the treatments.
|
|
1779
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1780
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1781
|
-
* @returns Treatments promise that resolves to the treatments object map.
|
|
1782
|
-
*/
|
|
1783
|
-
getTreatmentsByFlagSet(key: SplitKey, flagSet: string, attributes?: Attributes, options?: EvaluationOptions): AsyncTreatments;
|
|
1784
|
-
/**
|
|
1785
|
-
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag set.
|
|
1786
|
-
*
|
|
1787
|
-
* @param key - The string key representing the consumer.
|
|
1788
|
-
* @param flagSet - The flag set name we want to get the treatments.
|
|
1789
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1790
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1791
|
-
* @returns TreatmentsWithConfig promise that resolves to the map of TreatmentsWithConfig objects.
|
|
1792
|
-
*/
|
|
1793
|
-
getTreatmentsWithConfigByFlagSet(key: SplitKey, flagSet: string, attributes?: Attributes, options?: EvaluationOptions): AsyncTreatmentsWithConfig;
|
|
1794
|
-
/**
|
|
1795
|
-
* Returns a Returns a Treatments value, which is an object with both treatment and config string for to the feature flags related to the given flag sets.
|
|
1796
|
-
*
|
|
1797
|
-
* @param key - The string key representing the consumer.
|
|
1798
|
-
* @param flagSets - An array of the flag set names we want to get the treatments.
|
|
1799
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1800
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1801
|
-
* @returns Treatments promise that resolves to the treatments object map.
|
|
1802
|
-
*/
|
|
1803
|
-
getTreatmentsByFlagSets(key: SplitKey, flagSets: string[], attributes?: Attributes, options?: EvaluationOptions): AsyncTreatments;
|
|
1804
|
-
/**
|
|
1805
|
-
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag sets.
|
|
1806
|
-
*
|
|
1807
|
-
* @param key - The string key representing the consumer.
|
|
1808
|
-
* @param flagSets - An array of the flag set names we want to get the treatments.
|
|
1809
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1810
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1811
|
-
* @returns TreatmentsWithConfig promise that resolves to the map of TreatmentsWithConfig objects.
|
|
1812
|
-
*/
|
|
1813
|
-
getTreatmentsWithConfigByFlagSets(key: SplitKey, flagSets: string[], attributes?: Attributes, options?: EvaluationOptions): AsyncTreatmentsWithConfig;
|
|
1814
|
-
/**
|
|
1815
|
-
* Tracks an event to be fed to the results product on Split user interface, and returns a promise to signal when the event was successfully queued (or not).
|
|
1816
|
-
*
|
|
1817
|
-
* @param key - The key that identifies the entity related to this event.
|
|
1818
|
-
* @param trafficType - The traffic type of the entity related to this event. See {@link https://help.split.io/hc/en-us/articles/360019916311-Traffic-type}
|
|
1819
|
-
* @param eventType - The event type corresponding to this event.
|
|
1820
|
-
* @param value - The value of this event.
|
|
1821
|
-
* @param properties - The properties of this event. Values can be string, number, boolean or null.
|
|
1822
|
-
* @returns A promise that resolves to a boolean indicating if the event was added to the queue successfully or not.
|
|
1823
|
-
*/
|
|
1824
|
-
track(key: SplitKey, trafficType: string, eventType: string, value?: number, properties?: Properties): Promise<boolean>;
|
|
1825
|
-
}
|
|
1826
|
-
interface IClientWithAttributes extends IBasicClient {
|
|
1827
|
-
/**
|
|
1828
|
-
* Add an attribute to client's in-memory attributes storage.
|
|
1829
|
-
*
|
|
1830
|
-
* @param attributeName - Attribute name
|
|
1831
|
-
* @param attributeValue - Attribute value
|
|
1832
|
-
* @returns true if the attribute was stored and false otherwise
|
|
1833
|
-
*/
|
|
1834
|
-
setAttribute(attributeName: string, attributeValue: AttributeType): boolean;
|
|
1835
|
-
/**
|
|
1836
|
-
* Returns the attribute with the given name.
|
|
1837
|
-
*
|
|
1838
|
-
* @param attributeName - Attribute name
|
|
1839
|
-
* @returns Attribute with the given name
|
|
1840
|
-
*/
|
|
1841
|
-
getAttribute(attributeName: string): AttributeType;
|
|
1842
|
-
/**
|
|
1843
|
-
* Removes from client's in-memory attributes storage the attribute with the given name.
|
|
1844
|
-
*
|
|
1845
|
-
* @param attributeName - Attribute name
|
|
1846
|
-
* @returns true if attribute was removed and false otherwise
|
|
1847
|
-
*/
|
|
1848
|
-
removeAttribute(attributeName: string): boolean;
|
|
1849
|
-
/**
|
|
1850
|
-
* Add to client's in-memory attributes storage the attributes in 'attributes'.
|
|
1851
|
-
*
|
|
1852
|
-
* @param attributes - Object with attributes to store
|
|
1853
|
-
* @returns true if attributes were stored an false otherwise
|
|
1854
|
-
*/
|
|
1855
|
-
setAttributes(attributes: Attributes): boolean;
|
|
1856
|
-
/**
|
|
1857
|
-
* Return all the attributes stored in client's in-memory attributes storage.
|
|
1858
|
-
*
|
|
1859
|
-
* @returns returns all the stored attributes
|
|
1860
|
-
*/
|
|
1861
|
-
getAttributes(): Attributes;
|
|
1862
|
-
/**
|
|
1863
|
-
* Remove all the stored attributes in the client's in-memory attribute storage.
|
|
1864
|
-
*
|
|
1865
|
-
* @returns true if all attribute were removed and false otherwise
|
|
1866
|
-
*/
|
|
1867
|
-
clearAttributes(): boolean;
|
|
1868
|
-
}
|
|
1869
|
-
/**
|
|
1870
|
-
* This represents the interface for the Client instance on client-side, where the user key is bound to the instance on creation and does not need to be provided on each method call.
|
|
1871
|
-
*/
|
|
1872
|
-
interface IBrowserClient extends IClientWithAttributes {
|
|
1873
|
-
/**
|
|
1874
|
-
* Returns a Treatment value, which is the treatment string for the given feature.
|
|
1875
|
-
*
|
|
1876
|
-
* @param featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1877
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1878
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1879
|
-
* @returns The treatment string.
|
|
1880
|
-
*/
|
|
1881
|
-
getTreatment(featureFlagName: string, attributes?: Attributes, options?: EvaluationOptions): Treatment;
|
|
1882
|
-
/**
|
|
1883
|
-
* Returns a TreatmentWithConfig value, which is an object with both treatment and config string for the given feature.
|
|
1884
|
-
*
|
|
1885
|
-
* @param featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1886
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1887
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1888
|
-
* @returns The TreatmentWithConfig object that contains the treatment string and the configuration stringified JSON (or null if there was no config for that treatment).
|
|
1889
|
-
*/
|
|
1890
|
-
getTreatmentWithConfig(featureFlagName: string, attributes?: Attributes, options?: EvaluationOptions): TreatmentWithConfig;
|
|
1891
|
-
/**
|
|
1892
|
-
* Returns a Treatments value, which is an object map with the treatments for the given features.
|
|
1893
|
-
*
|
|
1894
|
-
* @param featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1895
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1896
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1897
|
-
* @returns The treatments object map.
|
|
1898
|
-
*/
|
|
1899
|
-
getTreatments(featureFlagNames: string[], attributes?: Attributes, options?: EvaluationOptions): Treatments;
|
|
1900
|
-
/**
|
|
1901
|
-
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the given features.
|
|
1902
|
-
*
|
|
1903
|
-
* @param featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1904
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1905
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1906
|
-
* @returns The map with all the TreatmentWithConfig objects
|
|
1907
|
-
*/
|
|
1908
|
-
getTreatmentsWithConfig(featureFlagNames: string[], attributes?: Attributes, options?: EvaluationOptions): TreatmentsWithConfig;
|
|
1909
|
-
/**
|
|
1910
|
-
* Returns a Treatments value, which is an object map with the treatments for the feature flags related to the given flag set.
|
|
1911
|
-
*
|
|
1912
|
-
* @param flagSet - The flag set name we want to get the treatments.
|
|
1913
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1914
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1915
|
-
* @returns The map with all the Treatments objects
|
|
1916
|
-
*/
|
|
1917
|
-
getTreatmentsByFlagSet(flagSet: string, attributes?: Attributes, options?: EvaluationOptions): Treatments;
|
|
1918
|
-
/**
|
|
1919
|
-
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag set.
|
|
1920
|
-
*
|
|
1921
|
-
* @param flagSet - The flag set name we want to get the treatments.
|
|
1922
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1923
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1924
|
-
* @returns The map with all the TreatmentWithConfig objects
|
|
1925
|
-
*/
|
|
1926
|
-
getTreatmentsWithConfigByFlagSet(flagSet: string, attributes?: Attributes, options?: EvaluationOptions): TreatmentsWithConfig;
|
|
1927
|
-
/**
|
|
1928
|
-
* Returns a Returns a Treatments value, which is an object with both treatment and config string for to the feature flags related to the given flag sets.
|
|
1929
|
-
*
|
|
1930
|
-
* @param flagSets - An array of the flag set names we want to get the treatments.
|
|
1931
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1932
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1933
|
-
* @returns The map with all the Treatments objects
|
|
1934
|
-
*/
|
|
1935
|
-
getTreatmentsByFlagSets(flagSets: string[], attributes?: Attributes, options?: EvaluationOptions): Treatments;
|
|
1936
|
-
/**
|
|
1937
|
-
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag sets.
|
|
1938
|
-
*
|
|
1939
|
-
* @param flagSets - An array of the flag set names we want to get the treatments.
|
|
1940
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1941
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1942
|
-
* @returns The map with all the TreatmentWithConfig objects
|
|
1943
|
-
*/
|
|
1944
|
-
getTreatmentsWithConfigByFlagSets(flagSets: string[], attributes?: Attributes, options?: EvaluationOptions): TreatmentsWithConfig;
|
|
1945
|
-
/**
|
|
1946
|
-
* Tracks an event to be fed to the results product on Split user interface.
|
|
1947
|
-
*
|
|
1948
|
-
* @param trafficType - The traffic type of the entity related to this event. See {@link https://help.split.io/hc/en-us/articles/360019916311-Traffic-type}
|
|
1949
|
-
* @param eventType - The event type corresponding to this event.
|
|
1950
|
-
* @param value - The value of this event.
|
|
1951
|
-
* @param properties - The properties of this event. Values can be string, number, boolean or null.
|
|
1952
|
-
* @returns Whether the event was added to the queue successfully or not.
|
|
1953
|
-
*/
|
|
1954
|
-
track(trafficType: string, eventType: string, value?: number, properties?: Properties): boolean;
|
|
1955
|
-
}
|
|
1956
|
-
/**
|
|
1957
|
-
* This represents the interface for the Client instance with asynchronous storage for client-side SDK, where each client has associated a key.
|
|
1958
|
-
*/
|
|
1959
|
-
interface IBrowserAsyncClient extends IClientWithAttributes {
|
|
1960
|
-
/**
|
|
1961
|
-
* Returns a Treatment value, which will be (or eventually be) the treatment string for the given feature.
|
|
1962
|
-
*
|
|
1963
|
-
* @param featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1964
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1965
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1966
|
-
* @returns Treatment promise that resolves to the treatment string.
|
|
1967
|
-
*/
|
|
1968
|
-
getTreatment(featureFlagName: string, attributes?: Attributes, options?: EvaluationOptions): AsyncTreatment;
|
|
1969
|
-
/**
|
|
1970
|
-
* Returns a TreatmentWithConfig value, which will be (or eventually be) an object with both treatment and config string for the given feature.
|
|
1971
|
-
*
|
|
1972
|
-
* @param featureFlagName - The string that represents the feature flag we want to get the treatment.
|
|
1973
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1974
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1975
|
-
* @returns TreatmentWithConfig promise that resolves to the TreatmentWithConfig object.
|
|
1976
|
-
*/
|
|
1977
|
-
getTreatmentWithConfig(featureFlagName: string, attributes?: Attributes, options?: EvaluationOptions): AsyncTreatmentWithConfig;
|
|
1978
|
-
/**
|
|
1979
|
-
* Returns a Treatments value, which will be (or eventually be) an object map with the treatments for the given features.
|
|
1980
|
-
*
|
|
1981
|
-
* @param featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1982
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1983
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1984
|
-
* @returns Treatments promise that resolves to the treatments object map.
|
|
1985
|
-
*/
|
|
1986
|
-
getTreatments(featureFlagNames: string[], attributes?: Attributes, options?: EvaluationOptions): AsyncTreatments;
|
|
1987
|
-
/**
|
|
1988
|
-
* Returns a TreatmentsWithConfig value, which will be (or eventually be) an object map with the TreatmentWithConfig (an object with both treatment and config string) for the given features.
|
|
1989
|
-
*
|
|
1990
|
-
* @param featureFlagNames - An array of the feature flag names we want to get the treatments.
|
|
1991
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
1992
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
1993
|
-
* @returns TreatmentsWithConfig promise that resolves to the TreatmentsWithConfig object.
|
|
1994
|
-
*/
|
|
1995
|
-
getTreatmentsWithConfig(featureFlagNames: string[], attributes?: Attributes, options?: EvaluationOptions): AsyncTreatmentsWithConfig;
|
|
1996
|
-
/**
|
|
1997
|
-
* Returns a Treatments value, which is an object map with the treatments for the feature flags related to the given flag set.
|
|
1998
|
-
*
|
|
1999
|
-
* @param flagSet - The flag set name we want to get the treatments.
|
|
2000
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
2001
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
2002
|
-
* @returns Treatments promise that resolves to the treatments object map.
|
|
2003
|
-
*/
|
|
2004
|
-
getTreatmentsByFlagSet(flagSet: string, attributes?: Attributes, options?: EvaluationOptions): AsyncTreatments;
|
|
2005
|
-
/**
|
|
2006
|
-
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag set.
|
|
2007
|
-
*
|
|
2008
|
-
* @param flagSet - The flag set name we want to get the treatments.
|
|
2009
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
2010
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
2011
|
-
* @returns TreatmentsWithConfig promise that resolves to the TreatmentsWithConfig object.
|
|
2012
|
-
*/
|
|
2013
|
-
getTreatmentsWithConfigByFlagSet(flagSet: string, attributes?: Attributes, options?: EvaluationOptions): AsyncTreatmentsWithConfig;
|
|
2014
|
-
/**
|
|
2015
|
-
* Returns a Returns a Treatments value, which is an object with both treatment and config string for to the feature flags related to the given flag sets.
|
|
2016
|
-
*
|
|
2017
|
-
* @param flagSets - An array of the flag set names we want to get the treatments.
|
|
2018
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
2019
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
2020
|
-
* @returns Treatments promise that resolves to the treatments object map.
|
|
2021
|
-
*/
|
|
2022
|
-
getTreatmentsByFlagSets(flagSets: string[], attributes?: Attributes, options?: EvaluationOptions): AsyncTreatments;
|
|
2023
|
-
/**
|
|
2024
|
-
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag sets.
|
|
2025
|
-
*
|
|
2026
|
-
* @param flagSets - An array of the flag set names we want to get the treatments.
|
|
2027
|
-
* @param attributes - An object of type Attributes defining the attributes for the given key.
|
|
2028
|
-
* @param options - An object of type EvaluationOptions for advanced evaluation options.
|
|
2029
|
-
* @returns TreatmentsWithConfig promise that resolves to the TreatmentsWithConfig object.
|
|
2030
|
-
*/
|
|
2031
|
-
getTreatmentsWithConfigByFlagSets(flagSets: string[], attributes?: Attributes, options?: EvaluationOptions): AsyncTreatmentsWithConfig;
|
|
2032
|
-
/**
|
|
2033
|
-
* Tracks an event to be fed to the results product on Split user interface, and returns a promise to signal when the event was successfully queued (or not).
|
|
2034
|
-
*
|
|
2035
|
-
* @param trafficType - The traffic type of the entity related to this event.
|
|
2036
|
-
* @param eventType - The event type corresponding to this event.
|
|
2037
|
-
* @param value - The value of this event.
|
|
2038
|
-
* @param properties - The properties of this event. Values can be string, number, boolean or null.
|
|
2039
|
-
* @returns A promise that resolves to a boolean indicating if the event was added to the queue successfully or not.
|
|
2040
|
-
*/
|
|
2041
|
-
track(trafficType: string, eventType: string, value?: number, properties?: Properties): Promise<boolean>;
|
|
2042
|
-
}
|
|
2043
|
-
/**
|
|
2044
|
-
* Representation of a manager instance with synchronous storage of the SDK.
|
|
2045
|
-
*/
|
|
2046
|
-
interface IManager extends IStatusInterface {
|
|
2047
|
-
/**
|
|
2048
|
-
* Get the array of feature flag names.
|
|
2049
|
-
*
|
|
2050
|
-
* @returns The list of feature flag names.
|
|
2051
|
-
*/
|
|
2052
|
-
names(): SplitNames;
|
|
2053
|
-
/**
|
|
2054
|
-
* Get the array of feature flags data in SplitView format.
|
|
2055
|
-
*
|
|
2056
|
-
* @returns The list of SplitIO.SplitView.
|
|
2057
|
-
*/
|
|
2058
|
-
splits(): SplitViews;
|
|
2059
|
-
/**
|
|
2060
|
-
* Get the data of a feature flag in SplitView format.
|
|
2061
|
-
*
|
|
2062
|
-
* @param featureFlagName - The name of the feature flag we want to get info of.
|
|
2063
|
-
* @returns The SplitIO.SplitView of the given feature flag name or null if the feature flag is not found.
|
|
2064
|
-
*/
|
|
2065
|
-
split(featureFlagName: string): SplitView | null;
|
|
2066
|
-
}
|
|
2067
|
-
/**
|
|
2068
|
-
* Representation of a manager instance with asynchronous storage of the SDK.
|
|
2069
|
-
*/
|
|
2070
|
-
interface IAsyncManager extends IStatusInterface {
|
|
2071
|
-
/**
|
|
2072
|
-
* Get the array of feature flag names.
|
|
2073
|
-
*
|
|
2074
|
-
* @returns A promise that resolves to the list of feature flag names.
|
|
2075
|
-
*/
|
|
2076
|
-
names(): SplitNamesAsync;
|
|
2077
|
-
/**
|
|
2078
|
-
* Get the array of feature flags data in SplitView format.
|
|
2079
|
-
*
|
|
2080
|
-
* @returns A promise that resolves to the SplitIO.SplitView list.
|
|
2081
|
-
*/
|
|
2082
|
-
splits(): SplitViewsAsync;
|
|
2083
|
-
/**
|
|
2084
|
-
* Get the data of a feature flag in SplitView format.
|
|
2085
|
-
*
|
|
2086
|
-
* @param featureFlagName - The name of the feature flag we want to get info of.
|
|
2087
|
-
* @returns A promise that resolves to the SplitIO.SplitView value.
|
|
2088
|
-
*/
|
|
2089
|
-
split(featureFlagName: string): SplitViewAsync;
|
|
2090
|
-
}
|
|
2091
|
-
}
|