@splitsoftware/splitio-commons 2.0.0-rc.3 → 2.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.txt +1 -0
- package/cjs/integrations/pluggable.js +2 -2
- package/cjs/logger/sdkLogger.js +2 -2
- package/cjs/readiness/sdkReadinessManager.js +2 -21
- package/cjs/sdkClient/client.js +0 -1
- package/cjs/sdkClient/clientAttributesDecoration.js +9 -9
- package/cjs/sdkClient/clientCS.js +2 -2
- package/cjs/services/splitApi.js +13 -13
- package/cjs/services/splitHttpClient.js +2 -2
- package/cjs/storages/AbstractSplitsCacheAsync.js +1 -4
- package/cjs/storages/AbstractSplitsCacheSync.js +1 -4
- package/cjs/storages/dataLoader.js +5 -6
- package/cjs/storages/findLatencyIndex.js +1 -1
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +1 -6
- package/cjs/storages/inMemory/AttributesCacheInMemory.js +10 -10
- package/cjs/storages/inMemory/EventsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/ImpressionsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/InMemoryStorage.js +1 -1
- package/cjs/storages/inMemory/InMemoryStorageCS.js +1 -1
- package/cjs/storages/inMemory/UniqueKeysCacheInMemoryCS.js +1 -1
- package/cjs/storages/inRedis/SplitsCacheInRedis.js +1 -3
- package/cjs/storages/inRedis/TelemetryCacheInRedis.js +3 -3
- package/cjs/storages/inRedis/UniqueKeysCacheInRedis.js +1 -1
- package/cjs/storages/pluggable/EventsCachePluggable.js +1 -1
- package/cjs/storages/pluggable/ImpressionsCachePluggable.js +1 -1
- package/cjs/storages/pluggable/SegmentsCachePluggable.js +1 -1
- package/cjs/storages/pluggable/SplitsCachePluggable.js +3 -3
- package/cjs/storages/pluggable/TelemetryCachePluggable.js +3 -3
- package/cjs/storages/pluggable/UniqueKeysCachePluggable.js +1 -1
- package/cjs/storages/pluggable/inMemoryWrapper.js +1 -1
- package/cjs/storages/pluggable/index.js +1 -1
- package/cjs/storages/pluggable/wrapperAdapter.js +2 -2
- package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +1 -1
- package/cjs/sync/offline/syncManagerOffline.js +1 -1
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +3 -3
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +8 -8
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +13 -13
- package/cjs/sync/streaming/AuthClient/index.js +2 -2
- package/cjs/sync/streaming/SSEClient/index.js +4 -7
- package/cjs/sync/streaming/SSEHandler/NotificationKeeper.js +1 -1
- package/cjs/sync/streaming/SSEHandler/NotificationParser.js +5 -4
- package/cjs/sync/streaming/SSEHandler/index.js +2 -2
- package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +3 -3
- package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -2
- package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +4 -4
- package/cjs/sync/streaming/parseUtils.js +13 -13
- package/cjs/sync/syncManagerOnline.js +2 -2
- package/cjs/sync/syncTask.js +4 -4
- package/cjs/trackers/eventTracker.js +2 -2
- package/cjs/trackers/impressionsTracker.js +5 -5
- package/cjs/trackers/strategy/strategyDebug.js +1 -1
- package/cjs/trackers/strategy/strategyNone.js +2 -2
- package/cjs/trackers/strategy/strategyOptimized.js +2 -2
- package/cjs/trackers/uniqueKeysTracker.js +3 -3
- package/cjs/utils/Backoff.js +0 -4
- package/cjs/utils/Semver.js +1 -1
- package/cjs/utils/base64/index.js +2 -2
- package/cjs/utils/decompress/index.js +4 -4
- package/cjs/utils/lang/binarySearch.js +2 -2
- package/cjs/utils/murmur3/murmur3_128.js +1 -1
- package/cjs/utils/murmur3/murmur3_128_x86.js +1 -1
- package/cjs/utils/murmur3/murmur3_64.js +1 -1
- package/cjs/utils/murmur3/utfx.js +10 -17
- package/cjs/utils/promise/wrapper.js +2 -2
- package/cjs/utils/settingsValidation/index.js +2 -2
- package/cjs/utils/settingsValidation/integrations/common.js +4 -4
- package/cjs/utils/settingsValidation/integrations/configurable.js +3 -3
- package/cjs/utils/settingsValidation/integrations/pluggable.js +2 -2
- package/cjs/utils/settingsValidation/logger/builtinLogger.js +1 -1
- package/cjs/utils/settingsValidation/logger/commons.js +1 -1
- package/cjs/utils/settingsValidation/logger/pluggableLogger.js +1 -1
- package/cjs/utils/settingsValidation/splitFilters.js +8 -11
- package/cjs/utils/settingsValidation/storage/storageCS.js +2 -2
- package/cjs/utils/settingsValidation/url.js +3 -3
- package/esm/integrations/pluggable.js +2 -2
- package/esm/logger/sdkLogger.js +2 -2
- package/esm/readiness/sdkReadinessManager.js +2 -21
- package/esm/sdkClient/client.js +0 -1
- package/esm/sdkClient/clientAttributesDecoration.js +9 -9
- package/esm/sdkClient/clientCS.js +2 -2
- package/esm/services/splitApi.js +13 -13
- package/esm/services/splitHttpClient.js +2 -2
- package/esm/storages/AbstractSplitsCacheAsync.js +1 -4
- package/esm/storages/AbstractSplitsCacheSync.js +1 -4
- package/esm/storages/dataLoader.js +5 -6
- package/esm/storages/findLatencyIndex.js +1 -1
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +1 -6
- package/esm/storages/inMemory/AttributesCacheInMemory.js +10 -10
- package/esm/storages/inMemory/EventsCacheInMemory.js +1 -1
- package/esm/storages/inMemory/ImpressionsCacheInMemory.js +1 -1
- package/esm/storages/inMemory/InMemoryStorage.js +1 -1
- package/esm/storages/inMemory/InMemoryStorageCS.js +1 -1
- package/esm/storages/inMemory/UniqueKeysCacheInMemoryCS.js +1 -1
- package/esm/storages/inRedis/SplitsCacheInRedis.js +1 -3
- package/esm/storages/inRedis/TelemetryCacheInRedis.js +3 -3
- package/esm/storages/inRedis/UniqueKeysCacheInRedis.js +1 -1
- package/esm/storages/pluggable/EventsCachePluggable.js +1 -1
- package/esm/storages/pluggable/ImpressionsCachePluggable.js +1 -1
- package/esm/storages/pluggable/SegmentsCachePluggable.js +1 -1
- package/esm/storages/pluggable/SplitsCachePluggable.js +3 -3
- package/esm/storages/pluggable/TelemetryCachePluggable.js +3 -3
- package/esm/storages/pluggable/UniqueKeysCachePluggable.js +1 -1
- package/esm/storages/pluggable/inMemoryWrapper.js +1 -1
- package/esm/storages/pluggable/index.js +1 -1
- package/esm/storages/pluggable/wrapperAdapter.js +2 -2
- package/esm/sync/offline/splitsParser/splitsParserFromSettings.js +1 -1
- package/esm/sync/offline/syncManagerOffline.js +1 -1
- package/esm/sync/polling/updaters/mySegmentsUpdater.js +3 -3
- package/esm/sync/polling/updaters/segmentChangesUpdater.js +8 -8
- package/esm/sync/polling/updaters/splitChangesUpdater.js +13 -13
- package/esm/sync/streaming/AuthClient/index.js +2 -2
- package/esm/sync/streaming/SSEClient/index.js +4 -7
- package/esm/sync/streaming/SSEHandler/NotificationKeeper.js +1 -1
- package/esm/sync/streaming/SSEHandler/NotificationParser.js +5 -4
- package/esm/sync/streaming/SSEHandler/index.js +2 -2
- package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +3 -3
- package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -2
- package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +4 -4
- package/esm/sync/streaming/parseUtils.js +13 -13
- package/esm/sync/syncManagerOnline.js +2 -2
- package/esm/sync/syncTask.js +4 -4
- package/esm/trackers/eventTracker.js +2 -2
- package/esm/trackers/impressionsTracker.js +5 -5
- package/esm/trackers/strategy/strategyDebug.js +1 -1
- package/esm/trackers/strategy/strategyNone.js +2 -2
- package/esm/trackers/strategy/strategyOptimized.js +2 -2
- package/esm/trackers/uniqueKeysTracker.js +3 -3
- package/esm/utils/Backoff.js +0 -4
- package/esm/utils/Semver.js +1 -1
- package/esm/utils/base64/index.js +2 -2
- package/esm/utils/decompress/index.js +4 -4
- package/esm/utils/lang/binarySearch.js +2 -2
- package/esm/utils/murmur3/murmur3_128.js +1 -1
- package/esm/utils/murmur3/murmur3_128_x86.js +1 -1
- package/esm/utils/murmur3/murmur3_64.js +1 -1
- package/esm/utils/murmur3/utfx.js +10 -17
- package/esm/utils/promise/wrapper.js +2 -2
- package/esm/utils/settingsValidation/index.js +2 -2
- package/esm/utils/settingsValidation/integrations/common.js +4 -4
- package/esm/utils/settingsValidation/integrations/configurable.js +3 -3
- package/esm/utils/settingsValidation/integrations/pluggable.js +2 -2
- package/esm/utils/settingsValidation/logger/builtinLogger.js +1 -1
- package/esm/utils/settingsValidation/logger/commons.js +1 -1
- package/esm/utils/settingsValidation/logger/pluggableLogger.js +1 -1
- package/esm/utils/settingsValidation/splitFilters.js +8 -11
- package/esm/utils/settingsValidation/storage/storageCS.js +2 -2
- package/esm/utils/settingsValidation/url.js +3 -3
- package/package.json +5 -3
- package/src/dtos/types.ts +1 -1
- package/src/evaluator/Engine.ts +1 -1
- package/src/evaluator/combiners/ifelseif.ts +1 -1
- package/src/evaluator/condition/index.ts +1 -1
- package/src/evaluator/index.ts +1 -1
- package/src/evaluator/parser/index.ts +1 -1
- package/src/evaluator/types.ts +1 -1
- package/src/evaluator/value/index.ts +1 -1
- package/src/evaluator/value/sanitize.ts +1 -1
- package/src/integrations/pluggable.ts +3 -3
- package/src/integrations/types.ts +3 -2
- package/src/listeners/browser.ts +3 -2
- package/src/logger/index.ts +6 -6
- package/src/logger/sdkLogger.ts +4 -4
- package/src/logger/types.ts +11 -13
- package/src/readiness/readinessManager.ts +5 -4
- package/src/readiness/sdkReadinessManager.ts +6 -23
- package/src/readiness/types.ts +5 -4
- package/src/sdkClient/client.ts +7 -8
- package/src/sdkClient/clientAttributesDecoration.ts +11 -11
- package/src/sdkClient/clientCS.ts +5 -5
- package/src/sdkClient/clientInputValidation.ts +3 -2
- package/src/sdkClient/identity.ts +1 -1
- package/src/sdkClient/sdkClient.ts +3 -3
- package/src/sdkClient/sdkClientMethod.ts +2 -2
- package/src/sdkClient/sdkClientMethodCS.ts +5 -5
- package/src/sdkFactory/index.ts +3 -3
- package/src/sdkFactory/types.ts +7 -6
- package/src/sdkManager/index.ts +2 -1
- package/src/services/splitApi.ts +13 -13
- package/src/services/splitHttpClient.ts +2 -2
- package/src/storages/AbstractMySegmentsCacheSync.ts +1 -1
- package/src/storages/AbstractSplitsCacheAsync.ts +1 -4
- package/src/storages/AbstractSplitsCacheSync.ts +1 -4
- package/src/storages/dataLoader.ts +7 -8
- package/src/storages/findLatencyIndex.ts +1 -1
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +1 -6
- package/src/storages/inMemory/AttributesCacheInMemory.ts +11 -11
- package/src/storages/inMemory/EventsCacheInMemory.ts +2 -2
- package/src/storages/inMemory/ImpressionsCacheInMemory.ts +5 -5
- package/src/storages/inMemory/InMemoryStorage.ts +1 -1
- package/src/storages/inMemory/InMemoryStorageCS.ts +1 -1
- package/src/storages/inMemory/UniqueKeysCacheInMemoryCS.ts +1 -1
- package/src/storages/inRedis/EventsCacheInRedis.ts +1 -1
- package/src/storages/inRedis/ImpressionsCacheInRedis.ts +2 -2
- package/src/storages/inRedis/SplitsCacheInRedis.ts +1 -3
- package/src/storages/inRedis/TelemetryCacheInRedis.ts +3 -3
- package/src/storages/inRedis/UniqueKeysCacheInRedis.ts +1 -1
- package/src/storages/pluggable/EventsCachePluggable.ts +2 -2
- package/src/storages/pluggable/ImpressionsCachePluggable.ts +3 -3
- package/src/storages/pluggable/SegmentsCachePluggable.ts +1 -1
- package/src/storages/pluggable/SplitsCachePluggable.ts +3 -3
- package/src/storages/pluggable/TelemetryCachePluggable.ts +3 -3
- package/src/storages/pluggable/UniqueKeysCachePluggable.ts +1 -1
- package/src/storages/pluggable/inMemoryWrapper.ts +1 -1
- package/src/storages/pluggable/index.ts +1 -1
- package/src/storages/pluggable/wrapperAdapter.ts +2 -2
- package/src/storages/types.ts +51 -68
- package/src/storages/utils.ts +3 -2
- package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +3 -3
- package/src/sync/offline/syncManagerOffline.ts +1 -1
- package/src/sync/polling/updaters/mySegmentsUpdater.ts +3 -3
- package/src/sync/polling/updaters/segmentChangesUpdater.ts +8 -8
- package/src/sync/polling/updaters/splitChangesUpdater.ts +13 -13
- package/src/sync/streaming/AuthClient/index.ts +2 -2
- package/src/sync/streaming/SSEClient/index.ts +4 -7
- package/src/sync/streaming/SSEHandler/NotificationKeeper.ts +1 -1
- package/src/sync/streaming/SSEHandler/NotificationParser.ts +5 -4
- package/src/sync/streaming/SSEHandler/index.ts +2 -2
- package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +3 -3
- package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +2 -2
- package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +4 -4
- package/src/sync/streaming/parseUtils.ts +13 -13
- package/src/sync/streaming/types.ts +2 -2
- package/src/sync/submitters/impressionsSubmitter.ts +2 -2
- package/src/sync/submitters/telemetrySubmitter.ts +4 -3
- package/src/sync/submitters/types.ts +1 -1
- package/src/sync/syncManagerOnline.ts +2 -2
- package/src/sync/syncTask.ts +4 -4
- package/src/trackers/eventTracker.ts +4 -3
- package/src/trackers/impressionObserver/ImpressionObserver.ts +4 -4
- package/src/trackers/impressionObserver/buildKey.ts +2 -2
- package/src/trackers/impressionObserver/impressionObserverCS.ts +2 -2
- package/src/trackers/impressionObserver/impressionObserverSS.ts +2 -2
- package/src/trackers/impressionObserver/types.ts +2 -2
- package/src/trackers/impressionsTracker.ts +8 -7
- package/src/trackers/strategy/strategyDebug.ts +3 -3
- package/src/trackers/strategy/strategyNone.ts +4 -4
- package/src/trackers/strategy/strategyOptimized.ts +5 -5
- package/src/trackers/types.ts +5 -5
- package/src/trackers/uniqueKeysTracker.ts +3 -3
- package/src/types.ts +37 -1355
- package/src/utils/Backoff.ts +0 -4
- package/src/utils/MinEventEmitter.ts +2 -3
- package/src/utils/MinEvents.ts +2 -2
- package/src/utils/Semver.ts +1 -1
- package/src/utils/base64/index.ts +2 -2
- package/src/utils/constants/index.ts +9 -10
- package/src/utils/decompress/index.ts +4 -4
- package/src/utils/inputValidation/attributes.ts +1 -1
- package/src/utils/inputValidation/eventProperties.ts +1 -1
- package/src/utils/inputValidation/key.ts +1 -1
- package/src/utils/inputValidation/preloadedData.ts +1 -2
- package/src/utils/inputValidation/trafficTypeExistence.ts +2 -2
- package/src/utils/key/index.ts +1 -1
- package/src/utils/lang/binarySearch.ts +2 -2
- package/src/utils/murmur3/murmur3_128.ts +1 -1
- package/src/utils/murmur3/murmur3_128_x86.ts +1 -1
- package/src/utils/murmur3/murmur3_64.ts +1 -1
- package/src/utils/murmur3/utfx.ts +10 -17
- package/src/utils/promise/wrapper.ts +2 -2
- package/src/utils/settingsValidation/consent.ts +2 -2
- package/src/utils/settingsValidation/impressionsMode.ts +1 -1
- package/src/utils/settingsValidation/index.ts +2 -2
- package/src/utils/settingsValidation/integrations/common.ts +4 -4
- package/src/utils/settingsValidation/integrations/configurable.ts +3 -3
- package/src/utils/settingsValidation/integrations/pluggable.ts +2 -2
- package/src/utils/settingsValidation/logger/builtinLogger.ts +3 -3
- package/src/utils/settingsValidation/logger/commons.ts +3 -3
- package/src/utils/settingsValidation/logger/pluggableLogger.ts +3 -3
- package/src/utils/settingsValidation/splitFilters.ts +9 -12
- package/src/utils/settingsValidation/storage/storageCS.ts +5 -4
- package/src/utils/settingsValidation/url.ts +3 -3
- package/types/index.d.ts +5 -5
- package/types/splitio.d.ts +1941 -0
- package/types/consent/index.d.ts +0 -2
- package/types/consent/sdkUserConsent.d.ts +0 -13
- package/types/dtos/types.d.ts +0 -209
- package/types/evaluator/Engine.d.ts +0 -15
- package/types/evaluator/combiners/and.d.ts +0 -4
- package/types/evaluator/combiners/ifelseif.d.ts +0 -3
- package/types/evaluator/condition/engineUtils.d.ts +0 -11
- package/types/evaluator/condition/index.d.ts +0 -6
- package/types/evaluator/convertions/index.d.ts +0 -2
- package/types/evaluator/index.d.ts +0 -8
- package/types/evaluator/matchers/all.d.ts +0 -1
- package/types/evaluator/matchers/between.d.ts +0 -2
- package/types/evaluator/matchers/boolean.d.ts +0 -1
- package/types/evaluator/matchers/cont_all.d.ts +0 -1
- package/types/evaluator/matchers/cont_any.d.ts +0 -1
- package/types/evaluator/matchers/cont_str.d.ts +0 -1
- package/types/evaluator/matchers/dependency.d.ts +0 -5
- package/types/evaluator/matchers/eq.d.ts +0 -1
- package/types/evaluator/matchers/eq_set.d.ts +0 -1
- package/types/evaluator/matchers/ew.d.ts +0 -1
- package/types/evaluator/matchers/gte.d.ts +0 -1
- package/types/evaluator/matchers/index.d.ts +0 -7
- package/types/evaluator/matchers/large_segment.d.ts +0 -5
- package/types/evaluator/matchers/lte.d.ts +0 -1
- package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
- package/types/evaluator/matchers/part_of.d.ts +0 -1
- package/types/evaluator/matchers/segment.d.ts +0 -5
- package/types/evaluator/matchers/semver_between.d.ts +0 -2
- package/types/evaluator/matchers/semver_eq.d.ts +0 -1
- package/types/evaluator/matchers/semver_gte.d.ts +0 -1
- package/types/evaluator/matchers/semver_inlist.d.ts +0 -1
- package/types/evaluator/matchers/semver_lte.d.ts +0 -1
- package/types/evaluator/matchers/string.d.ts +0 -1
- package/types/evaluator/matchers/sw.d.ts +0 -1
- package/types/evaluator/matchers/whitelist.d.ts +0 -1
- package/types/evaluator/matchersTransform/index.d.ts +0 -6
- package/types/evaluator/matchersTransform/segment.d.ts +0 -5
- package/types/evaluator/matchersTransform/unaryNumeric.d.ts +0 -5
- package/types/evaluator/matchersTransform/whitelist.d.ts +0 -5
- package/types/evaluator/parser/index.d.ts +0 -5
- package/types/evaluator/treatments/index.d.ts +0 -8
- package/types/evaluator/types.d.ts +0 -28
- package/types/evaluator/value/index.d.ts +0 -7
- package/types/evaluator/value/sanitize.d.ts +0 -7
- package/types/integrations/pluggable.d.ts +0 -11
- package/types/integrations/types.d.ts +0 -18
- package/types/listeners/browser.d.ts +0 -40
- package/types/listeners/node.d.ts +0 -22
- package/types/listeners/types.d.ts +0 -4
- package/types/logger/browser/DebugLogger.d.ts +0 -2
- package/types/logger/browser/ErrorLogger.d.ts +0 -2
- package/types/logger/browser/InfoLogger.d.ts +0 -2
- package/types/logger/browser/WarnLogger.d.ts +0 -2
- package/types/logger/constants.d.ts +0 -134
- package/types/logger/index.d.ts +0 -21
- package/types/logger/messages/debug.d.ts +0 -1
- package/types/logger/messages/error.d.ts +0 -1
- package/types/logger/messages/info.d.ts +0 -1
- package/types/logger/messages/warn.d.ts +0 -1
- package/types/logger/sdkLogger.d.ts +0 -8
- package/types/logger/types.d.ts +0 -17
- package/types/readiness/constants.d.ts +0 -7
- package/types/readiness/readinessManager.d.ts +0 -6
- package/types/readiness/sdkReadinessManager.d.ts +0 -10
- package/types/readiness/types.d.ts +0 -67
- package/types/sdkClient/client.d.ts +0 -6
- package/types/sdkClient/clientAttributesDecoration.d.ts +0 -55
- package/types/sdkClient/clientCS.d.ts +0 -9
- package/types/sdkClient/clientInputValidation.d.ts +0 -7
- package/types/sdkClient/identity.d.ts +0 -2
- package/types/sdkClient/sdkClient.d.ts +0 -6
- package/types/sdkClient/sdkClientMethod.d.ts +0 -6
- package/types/sdkClient/sdkClientMethodCS.d.ts +0 -7
- package/types/sdkFactory/index.d.ts +0 -6
- package/types/sdkFactory/types.d.ts +0 -85
- package/types/sdkManager/index.d.ts +0 -4
- package/types/services/decorateHeaders.d.ts +0 -2
- package/types/services/splitApi.d.ts +0 -12
- package/types/services/splitHttpClient.d.ts +0 -10
- package/types/services/types.d.ts +0 -54
- package/types/storages/AbstractMySegmentsCacheSync.d.ts +0 -39
- package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -38
- package/types/storages/AbstractSplitsCacheSync.d.ts +0 -43
- package/types/storages/KeyBuilder.d.ts +0 -22
- package/types/storages/KeyBuilderCS.d.ts +0 -20
- package/types/storages/KeyBuilderSS.d.ts +0 -20
- package/types/storages/dataLoader.d.ts +0 -10
- package/types/storages/findLatencyIndex.d.ts +0 -7
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -15
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -54
- package/types/storages/inLocalStorage/constants.d.ts +0 -2
- package/types/storages/inLocalStorage/index.d.ts +0 -8
- package/types/storages/inMemory/AttributesCacheInMemory.d.ts +0 -44
- package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
- package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -28
- package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +0 -30
- package/types/storages/inMemory/InMemoryStorage.d.ts +0 -10
- package/types/storages/inMemory/InMemoryStorageCS.d.ts +0 -10
- package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +0 -16
- package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -17
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -27
- package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -71
- package/types/storages/inMemory/UniqueKeysCacheInMemory.d.ts +0 -34
- package/types/storages/inMemory/UniqueKeysCacheInMemoryCS.d.ts +0 -35
- package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
- package/types/storages/inRedis/ImpressionCountsCacheInRedis.d.ts +0 -17
- package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -17
- package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
- package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -21
- package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -95
- package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -35
- package/types/storages/inRedis/UniqueKeysCacheInRedis.d.ts +0 -22
- package/types/storages/inRedis/constants.d.ts +0 -4
- package/types/storages/inRedis/index.d.ts +0 -10
- package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
- package/types/storages/pluggable/ImpressionCountsCachePluggable.d.ts +0 -16
- package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -34
- package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -42
- package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -98
- package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -34
- package/types/storages/pluggable/UniqueKeysCachePluggable.d.ts +0 -20
- package/types/storages/pluggable/constants.d.ts +0 -1
- package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -12
- package/types/storages/pluggable/index.d.ts +0 -9
- package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
- package/types/storages/types.d.ts +0 -407
- package/types/storages/utils.d.ts +0 -8
- package/types/sync/offline/LocalhostFromObject.d.ts +0 -1
- package/types/sync/offline/splitsParser/parseCondition.d.ts +0 -7
- package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +0 -3
- package/types/sync/offline/splitsParser/types.d.ts +0 -3
- package/types/sync/offline/syncManagerOffline.d.ts +0 -10
- package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +0 -17
- package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/types.d.ts +0 -5
- package/types/sync/polling/pollingManagerCS.d.ts +0 -7
- package/types/sync/polling/pollingManagerSS.d.ts +0 -6
- package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +0 -9
- package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +0 -9
- package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +0 -9
- package/types/sync/polling/types.d.ts +0 -33
- package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -14
- package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
- package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -41
- package/types/sync/streaming/AuthClient/index.d.ts +0 -12
- package/types/sync/streaming/AuthClient/types.d.ts +0 -17
- package/types/sync/streaming/SSEClient/index.d.ts +0 -34
- package/types/sync/streaming/SSEClient/types.d.ts +0 -11
- package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +0 -14
- package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +0 -20
- package/types/sync/streaming/SSEHandler/index.d.ts +0 -11
- package/types/sync/streaming/SSEHandler/types.d.ts +0 -72
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -9
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -9
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -14
- package/types/sync/streaming/UpdateWorkers/constants.d.ts +0 -3
- package/types/sync/streaming/UpdateWorkers/types.d.ts +0 -4
- package/types/sync/streaming/constants.d.ts +0 -34
- package/types/sync/streaming/parseUtils.d.ts +0 -34
- package/types/sync/streaming/pushManager.d.ts +0 -9
- package/types/sync/streaming/types.d.ts +0 -35
- package/types/sync/submitters/eventsSubmitter.d.ts +0 -5
- package/types/sync/submitters/impressionCountsSubmitter.d.ts +0 -10
- package/types/sync/submitters/impressionsSubmitter.d.ts +0 -11
- package/types/sync/submitters/submitter.d.ts +0 -12
- package/types/sync/submitters/submitterManager.d.ts +0 -3
- package/types/sync/submitters/telemetrySubmitter.d.ts +0 -17
- package/types/sync/submitters/types.d.ts +0 -217
- package/types/sync/submitters/uniqueKeysSubmitter.d.ts +0 -5
- package/types/sync/syncManagerOnline.d.ts +0 -13
- package/types/sync/syncTask.d.ts +0 -13
- package/types/sync/types.d.ts +0 -43
- package/types/trackers/eventTracker.d.ts +0 -10
- package/types/trackers/impressionObserver/ImpressionObserver.d.ts +0 -8
- package/types/trackers/impressionObserver/buildKey.d.ts +0 -2
- package/types/trackers/impressionObserver/impressionObserverCS.d.ts +0 -4
- package/types/trackers/impressionObserver/impressionObserverSS.d.ts +0 -4
- package/types/trackers/impressionObserver/types.d.ts +0 -4
- package/types/trackers/impressionsTracker.d.ts +0 -13
- package/types/trackers/strategy/strategyDebug.d.ts +0 -9
- package/types/trackers/strategy/strategyNone.d.ts +0 -10
- package/types/trackers/strategy/strategyOptimized.d.ts +0 -11
- package/types/trackers/telemetryTracker.d.ts +0 -3
- package/types/trackers/types.d.ts +0 -68
- package/types/trackers/uniqueKeysTracker.d.ts +0 -13
- package/types/types.d.ts +0 -1398
- package/types/utils/Backoff.d.ts +0 -25
- package/types/utils/LRUCache/LinkedList.d.ts +0 -34
- package/types/utils/LRUCache/index.d.ts +0 -15
- package/types/utils/MinEventEmitter.d.ts +0 -12
- package/types/utils/MinEvents.d.ts +0 -4
- package/types/utils/Semver.d.ts +0 -15
- package/types/utils/base64/index.d.ts +0 -30
- package/types/utils/constants/browser.d.ts +0 -1
- package/types/utils/constants/index.d.ts +0 -83
- package/types/utils/decompress/index.d.ts +0 -16
- package/types/utils/env/isLocalStorageAvailable.d.ts +0 -1
- package/types/utils/env/isNode.d.ts +0 -5
- package/types/utils/inputValidation/apiKey.d.ts +0 -7
- package/types/utils/inputValidation/attribute.d.ts +0 -2
- package/types/utils/inputValidation/attributes.d.ts +0 -4
- package/types/utils/inputValidation/event.d.ts +0 -2
- package/types/utils/inputValidation/eventProperties.d.ts +0 -6
- package/types/utils/inputValidation/eventValue.d.ts +0 -2
- package/types/utils/inputValidation/index.d.ts +0 -13
- package/types/utils/inputValidation/isOperational.d.ts +0 -4
- package/types/utils/inputValidation/key.d.ts +0 -3
- package/types/utils/inputValidation/preloadedData.d.ts +0 -3
- package/types/utils/inputValidation/split.d.ts +0 -2
- package/types/utils/inputValidation/splitExistence.d.ts +0 -7
- package/types/utils/inputValidation/splits.d.ts +0 -2
- package/types/utils/inputValidation/trafficType.d.ts +0 -2
- package/types/utils/inputValidation/trafficTypeExistence.d.ts +0 -9
- package/types/utils/jwt/index.d.ts +0 -5
- package/types/utils/jwt/types.d.ts +0 -5
- package/types/utils/key/index.d.ts +0 -8
- package/types/utils/labels/index.d.ts +0 -8
- package/types/utils/lang/binarySearch.d.ts +0 -9
- package/types/utils/lang/getFnName.d.ts +0 -4
- package/types/utils/lang/getGlobal.d.ts +0 -4
- package/types/utils/lang/index.d.ts +0 -105
- package/types/utils/lang/objectAssign.d.ts +0 -6
- package/types/utils/lang/sets.d.ts +0 -3
- package/types/utils/murmur3/common.d.ts +0 -12
- package/types/utils/murmur3/legacy.d.ts +0 -2
- package/types/utils/murmur3/murmur3.d.ts +0 -2
- package/types/utils/murmur3/murmur3_128.d.ts +0 -6
- package/types/utils/murmur3/murmur3_128_x86.d.ts +0 -7
- package/types/utils/murmur3/murmur3_64.d.ts +0 -10
- package/types/utils/murmur3/utfx.d.ts +0 -27
- package/types/utils/promise/thenable.d.ts +0 -1
- package/types/utils/promise/timeout.d.ts +0 -1
- package/types/utils/promise/wrapper.d.ts +0 -21
- package/types/utils/settingsValidation/consent.d.ts +0 -6
- package/types/utils/settingsValidation/impressionsMode.d.ts +0 -3
- package/types/utils/settingsValidation/index.d.ts +0 -50
- package/types/utils/settingsValidation/integrations/common.d.ts +0 -14
- package/types/utils/settingsValidation/integrations/configurable.d.ts +0 -13
- package/types/utils/settingsValidation/integrations/pluggable.d.ts +0 -13
- package/types/utils/settingsValidation/logger/builtinLogger.d.ts +0 -10
- package/types/utils/settingsValidation/logger/commons.d.ts +0 -9
- package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +0 -11
- package/types/utils/settingsValidation/mode.d.ts +0 -5
- package/types/utils/settingsValidation/runtime.d.ts +0 -2
- package/types/utils/settingsValidation/splitFilters.d.ts +0 -17
- package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -21
- package/types/utils/settingsValidation/types.d.ts +0 -30
- package/types/utils/settingsValidation/url.d.ts +0 -10
- package/types/utils/time/index.d.ts +0 -4
- package/types/utils/timeTracker/now/browser.d.ts +0 -1
- package/types/utils/timeTracker/now/node.d.ts +0 -1
- package/types/utils/timeTracker/timer.d.ts +0 -1
|
@@ -51,8 +51,8 @@ interface ISplitMutations {
|
|
|
51
51
|
* If there are defined filters and one feature flag doesn't match with them, its status is changed to 'ARCHIVE' to avoid storing it
|
|
52
52
|
* If there are set filter defined, names filter is ignored
|
|
53
53
|
*
|
|
54
|
-
* @param featureFlag feature flag to be evaluated
|
|
55
|
-
* @param filters splitFiltersValidation bySet | byName
|
|
54
|
+
* @param featureFlag - feature flag to be evaluated
|
|
55
|
+
* @param filters - splitFiltersValidation bySet | byName
|
|
56
56
|
*/
|
|
57
57
|
function matchFilters(featureFlag: ISplit, filters: ISplitFiltersValidation) {
|
|
58
58
|
const { bySet: setsFilter, byName: namesFilter, byPrefix: prefixFilter } = filters.groupedFilters;
|
|
@@ -100,13 +100,13 @@ export function computeSplitsMutation(entries: ISplit[], filters: ISplitFiltersV
|
|
|
100
100
|
* - updates `splitsCache`
|
|
101
101
|
* - uses `splitsEventEmitter` to emit events related to split data updates
|
|
102
102
|
*
|
|
103
|
-
* @param log Logger instance
|
|
104
|
-
* @param splitChangesFetcher Fetcher of `/splitChanges`
|
|
105
|
-
* @param splits Splits storage, with sync or async methods
|
|
106
|
-
* @param segments Segments storage, with sync or async methods
|
|
107
|
-
* @param splitsEventEmitter Optional readiness manager. Not required for synchronizer or producer mode.
|
|
108
|
-
* @param requestTimeoutBeforeReady How long the updater will wait for the request to timeout. Default 0, i.e., never timeout.
|
|
109
|
-
* @param retriesOnFailureBeforeReady How many retries on `/splitChanges` we the updater do in case of failure or timeout. Default 0, i.e., no retries.
|
|
103
|
+
* @param log - Logger instance
|
|
104
|
+
* @param splitChangesFetcher - Fetcher of `/splitChanges`
|
|
105
|
+
* @param splits - Splits storage, with sync or async methods
|
|
106
|
+
* @param segments - Segments storage, with sync or async methods
|
|
107
|
+
* @param splitsEventEmitter - Optional readiness manager. Not required for synchronizer or producer mode.
|
|
108
|
+
* @param requestTimeoutBeforeReady - How long the updater will wait for the request to timeout. Default 0, i.e., never timeout.
|
|
109
|
+
* @param retriesOnFailureBeforeReady - How many retries on `/splitChanges` we the updater do in case of failure or timeout. Default 0, i.e., no retries.
|
|
110
110
|
*/
|
|
111
111
|
export function splitChangesUpdaterFactory(
|
|
112
112
|
log: ILogger,
|
|
@@ -142,14 +142,14 @@ export function splitChangesUpdaterFactory(
|
|
|
142
142
|
* SplitChanges updater returns a promise that resolves with a `false` boolean value if it fails to fetch splits or synchronize them with the storage.
|
|
143
143
|
* Returned promise will not be rejected.
|
|
144
144
|
*
|
|
145
|
-
* @param
|
|
146
|
-
* @param
|
|
145
|
+
* @param noCache - true to revalidate data to fetch
|
|
146
|
+
* @param till - query param to bypass CDN requests
|
|
147
147
|
*/
|
|
148
148
|
return function splitChangesUpdater(noCache?: boolean, till?: number, splitUpdateNotification?: { payload: ISplit, changeNumber: number }) {
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
|
-
* @param
|
|
152
|
-
* @param
|
|
151
|
+
* @param since - current changeNumber at splitsCache
|
|
152
|
+
* @param retry - current number of retry attempts
|
|
153
153
|
*/
|
|
154
154
|
function _splitChangesUpdater(since: number, retry = 0): Promise<boolean> {
|
|
155
155
|
log.debug(SYNC_SPLITS_FETCH, [since]);
|
|
@@ -8,13 +8,13 @@ import { hash } from '../../../utils/murmur3/murmur3';
|
|
|
8
8
|
/**
|
|
9
9
|
* Factory of authentication function.
|
|
10
10
|
*
|
|
11
|
-
* @param fetchAuth `SplitAPI.fetchAuth` endpoint
|
|
11
|
+
* @param fetchAuth - `SplitAPI.fetchAuth` endpoint
|
|
12
12
|
*/
|
|
13
13
|
export function authenticateFactory(fetchAuth: IFetchAuth): IAuthenticate {
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Run authentication requests to Auth Server, and returns a promise that resolves with the decoded JTW token.
|
|
17
|
-
* @param
|
|
17
|
+
* @param userKeys - set of user Keys to track membership updates. It is undefined for server-side API.
|
|
18
18
|
*/
|
|
19
19
|
return function authenticate(userKeys?: string[]): Promise<IAuthToken> {
|
|
20
20
|
return fetchAuth(userKeys)
|
|
@@ -14,8 +14,8 @@ const CONTROL_CHANNEL_REGEX = /^control_/;
|
|
|
14
14
|
/**
|
|
15
15
|
* Build metadata headers for SSE connection.
|
|
16
16
|
*
|
|
17
|
-
* @param
|
|
18
|
-
* @returns
|
|
17
|
+
* @param settings - Validated settings.
|
|
18
|
+
* @returns Headers object
|
|
19
19
|
*/
|
|
20
20
|
function buildSSEHeaders(settings: ISettings) {
|
|
21
21
|
const headers: Record<string, string> = {
|
|
@@ -45,8 +45,8 @@ export class SSEClient implements ISSEClient {
|
|
|
45
45
|
/**
|
|
46
46
|
* SSEClient constructor.
|
|
47
47
|
*
|
|
48
|
-
* @param settings Validated settings.
|
|
49
|
-
* @param platform object containing environment-specific dependencies
|
|
48
|
+
* @param settings - Validated settings.
|
|
49
|
+
* @param platform - object containing environment-specific dependencies
|
|
50
50
|
* @throws 'EventSource API is not available.' if EventSource is not available.
|
|
51
51
|
*/
|
|
52
52
|
constructor(private settings: ISettings, { getEventSource, getOptions }: IPlatform) {
|
|
@@ -64,9 +64,6 @@ export class SSEClient implements ISSEClient {
|
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* Open the connection with a given authToken
|
|
67
|
-
*
|
|
68
|
-
* @param {IAuthTokenPushEnabled} authToken
|
|
69
|
-
* @throws {TypeError} Will throw an error if `authToken` is undefined
|
|
70
67
|
*/
|
|
71
68
|
open(authToken: IAuthTokenPushEnabled) {
|
|
72
69
|
this.close(); // it closes connection if previously opened
|
|
@@ -10,7 +10,7 @@ const STREAMING_EVENT_TYPES: StreamingEventType[] = [OCCUPANCY_PRI, OCCUPANCY_SE
|
|
|
10
10
|
/**
|
|
11
11
|
* Factory of notification keeper, which process OCCUPANCY and CONTROL notifications and emits the corresponding push events.
|
|
12
12
|
*
|
|
13
|
-
* @param pushEmitter emitter for events related to streaming support
|
|
13
|
+
* @param pushEmitter - emitter for events related to streaming support
|
|
14
14
|
*/
|
|
15
15
|
// @TODO update logic to handle OCCUPANCY for any region and rename according to new spec (e.g.: PUSH_SUBSYSTEM_UP --> PUSH_SUBSYSTEM_UP)
|
|
16
16
|
export function notificationKeeperFactory(pushEmitter: IPushEventEmitter, telemetryTracker: ITelemetryTracker) {
|
|
@@ -7,8 +7,9 @@ import { INotificationMessage, INotificationError } from './types';
|
|
|
7
7
|
* HTTP errors handled by Ably (e.g., 400 due to invalid token, 401 due to expired token, 500) have the `data` property.
|
|
8
8
|
* Other network and HTTP errors do not have this property.
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
11
|
-
* @
|
|
10
|
+
* @param error - The error event to parse
|
|
11
|
+
* @returns parsed notification error
|
|
12
|
+
* @throws SyntaxError if `error.data` is an invalid JSON string
|
|
12
13
|
*/
|
|
13
14
|
export function errorParser(error: Event): INotificationError {
|
|
14
15
|
// @ts-ignore
|
|
@@ -21,10 +22,10 @@ export function errorParser(error: Event): INotificationError {
|
|
|
21
22
|
* Parses the `data` JSON string of a given SSE message notifications.
|
|
22
23
|
* Also assigns the type OCCUPANCY, if it corresponds, so that all supported messages (e.g., SPLIT_UPDATE, CONTROL) have a type.
|
|
23
24
|
*
|
|
24
|
-
* @param message
|
|
25
|
+
* @param message - The message event to parse
|
|
25
26
|
* @returns parsed notification message or undefined if the given event data is falsy (e.g, '' or undefined).
|
|
26
27
|
* For example, the EventSource implementation of React-Native for iOS emits a message event with empty data for Ably keepalive comments.
|
|
27
|
-
* @throws
|
|
28
|
+
* @throws SyntaxError if `message.data` or `JSON.parse(message.data).data` are invalid JSON strings
|
|
28
29
|
*/
|
|
29
30
|
export function messageParser(message: MessageEvent): INotificationMessage | undefined {
|
|
30
31
|
if (!message.data) return;
|
|
@@ -12,8 +12,8 @@ import { ITelemetryTracker } from '../../../trackers/types';
|
|
|
12
12
|
/**
|
|
13
13
|
* Factory for SSEHandler, which processes SSEClient messages and emits the corresponding push events.
|
|
14
14
|
*
|
|
15
|
-
* @param log factory logger
|
|
16
|
-
* @param pushEmitter emitter for events related to streaming support
|
|
15
|
+
* @param log - factory logger
|
|
16
|
+
* @param pushEmitter - emitter for events related to streaming support
|
|
17
17
|
*/
|
|
18
18
|
export function SSEHandlerFactory(log: ILogger, pushEmitter: IPushEventEmitter, telemetryTracker: ITelemetryTracker): ISseEventHandler {
|
|
19
19
|
|
|
@@ -87,9 +87,9 @@ export function MySegmentsUpdateWorker(log: ILogger, storage: Pick<IStorageSync,
|
|
|
87
87
|
/**
|
|
88
88
|
* Invoked by NotificationProcessor on MY_(LARGE)_SEGMENTS_UPDATE notifications
|
|
89
89
|
*
|
|
90
|
-
* @param changeNumber change number of the notification
|
|
91
|
-
* @param segmentsData data for KeyList or SegmentRemoval instant updates
|
|
92
|
-
* @param delay optional time to wait for BoundedFetchRequest or BoundedFetchRequest updates
|
|
90
|
+
* @param changeNumber - change number of the notification
|
|
91
|
+
* @param segmentsData - data for KeyList or SegmentRemoval instant updates
|
|
92
|
+
* @param delay - optional time to wait for BoundedFetchRequest or BoundedFetchRequest updates
|
|
93
93
|
*/
|
|
94
94
|
put(mySegmentsData: Pick<MySegmentsData, 'type' | 'cn'>, payload?: Pick<MySegmentsData, 'added' | 'removed'>, delay?: number) {
|
|
95
95
|
const { type, cn } = mySegmentsData;
|
|
@@ -84,8 +84,8 @@ export function SegmentsUpdateWorker(log: ILogger, segmentsSyncTask: ISegmentsSy
|
|
|
84
84
|
/**
|
|
85
85
|
* Invoked by NotificationProcessor on SEGMENT_UPDATE event
|
|
86
86
|
*
|
|
87
|
-
* @param
|
|
88
|
-
* @param
|
|
87
|
+
* @param changeNumber - change number of the SEGMENT_UPDATE notification
|
|
88
|
+
* @param segmentName - segment name of the SEGMENT_UPDATE notification
|
|
89
89
|
*/
|
|
90
90
|
put({ changeNumber, segmentName }: ISegmentUpdateData) {
|
|
91
91
|
if (!segments[segmentName]) segments[segmentName] = SegmentUpdateWorker(segmentName);
|
|
@@ -69,7 +69,7 @@ export function SplitsUpdateWorker(log: ILogger, splitsCache: ISplitsCacheSync,
|
|
|
69
69
|
/**
|
|
70
70
|
* Invoked by NotificationProcessor on SPLIT_UPDATE event
|
|
71
71
|
*
|
|
72
|
-
* @param
|
|
72
|
+
* @param changeNumber - change number of the SPLIT_UPDATE notification
|
|
73
73
|
*/
|
|
74
74
|
function put({ changeNumber, pcn }: ISplitUpdateData, _payload?: ISplit) {
|
|
75
75
|
const currentChangeNumber = splitsCache.getChangeNumber();
|
|
@@ -94,9 +94,9 @@ export function SplitsUpdateWorker(log: ILogger, splitsCache: ISplitsCacheSync,
|
|
|
94
94
|
/**
|
|
95
95
|
* Invoked by NotificationProcessor on SPLIT_KILL event
|
|
96
96
|
*
|
|
97
|
-
* @param
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
97
|
+
* @param changeNumber - change number of the SPLIT_UPDATE notification
|
|
98
|
+
* @param splitName - name of split to kill
|
|
99
|
+
* @param defaultTreatment - default treatment value
|
|
100
100
|
*/
|
|
101
101
|
killSplit({ changeNumber, splitName, defaultTreatment }: ISplitKillData) {
|
|
102
102
|
if (splitsCache.killLocally(splitName, defaultTreatment, changeNumber)) {
|
|
@@ -19,9 +19,9 @@ function StringToUint8Array(myString: string) {
|
|
|
19
19
|
/**
|
|
20
20
|
* Decode and decompress 'data' with 'compression' algorithm
|
|
21
21
|
*
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @returns
|
|
22
|
+
* @param data - base64 encoded string
|
|
23
|
+
* @param compression - 1 GZIP, 2 ZLIB
|
|
24
|
+
* @returns
|
|
25
25
|
* @throws if data string cannot be decoded, decompressed or the provided compression value is invalid (not 1 or 2)
|
|
26
26
|
*/
|
|
27
27
|
function decompress(data: string, compression: Compression) {
|
|
@@ -37,10 +37,10 @@ function decompress(data: string, compression: Compression) {
|
|
|
37
37
|
/**
|
|
38
38
|
* Decode, decompress and parse the provided 'data' into a KeyList object
|
|
39
39
|
*
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @returns
|
|
40
|
+
* @param data - base64 encoded string
|
|
41
|
+
* @param compression - 1 GZIP, 2 ZLIB
|
|
42
|
+
* @param avoidPrecisionLoss - true as default, set it as false if dont need to avoid precission loss
|
|
43
|
+
* @returns keyList
|
|
44
44
|
* @throws if data string cannot be decoded, decompressed or parsed
|
|
45
45
|
*/
|
|
46
46
|
export function parseKeyList(data: string, compression: Compression, avoidPrecisionLoss = true): KeyList {
|
|
@@ -54,9 +54,9 @@ export function parseKeyList(data: string, compression: Compression, avoidPrecis
|
|
|
54
54
|
/**
|
|
55
55
|
* Decode, decompress and parse the provided 'data' into a Bitmap object
|
|
56
56
|
*
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @returns
|
|
57
|
+
* @param data - base64 encoded string
|
|
58
|
+
* @param compression - 1 GZIP, 2 ZLIB
|
|
59
|
+
* @returns Bitmap
|
|
60
60
|
* @throws if data string cannot be decoded or decompressed
|
|
61
61
|
*/
|
|
62
62
|
export function parseBitmap(data: string, compression: Compression) {
|
|
@@ -66,9 +66,9 @@ export function parseBitmap(data: string, compression: Compression) {
|
|
|
66
66
|
/**
|
|
67
67
|
* Check if the 'bitmap' bit at 'hash64hex' position is 1
|
|
68
68
|
*
|
|
69
|
-
* @param
|
|
70
|
-
* @param
|
|
71
|
-
* @returns
|
|
69
|
+
* @param bitmap - Uint8Array bitmap
|
|
70
|
+
* @param hash64hex - 16-chars string, representing a number in hexa
|
|
71
|
+
* @returns whether the provided 'hash64hex' index is set in the bitmap
|
|
72
72
|
*/
|
|
73
73
|
export function isInBitmap(bitmap: Uint8Array, hash64hex: string) {
|
|
74
74
|
// using the lowest 32 bits as index, to avoid losing precision when converting to number
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IMembershipMSUpdateData, IMembershipLSUpdateData, ISegmentUpdateData, ISplitUpdateData, ISplitKillData, INotificationData } from './SSEHandler/types';
|
|
2
2
|
import { ITask } from '../types';
|
|
3
3
|
import { IMySegmentsSyncTask } from '../polling/types';
|
|
4
|
-
import
|
|
4
|
+
import SplitIO from '../../../types/splitio';
|
|
5
5
|
import { ControlType } from './constants';
|
|
6
6
|
|
|
7
7
|
// Internal SDK events, subscribed by SyncManager and PushManager
|
|
@@ -34,7 +34,7 @@ type IParsedData<T extends IPushEvent> =
|
|
|
34
34
|
* EventEmitter used as Feedback Loop between the SyncManager and PushManager,
|
|
35
35
|
* where the latter pushes messages and the former consumes it
|
|
36
36
|
*/
|
|
37
|
-
export interface IPushEventEmitter extends IEventEmitter {
|
|
37
|
+
export interface IPushEventEmitter extends SplitIO.IEventEmitter {
|
|
38
38
|
once<T extends IPushEvent>(event: T, listener: (parsedData: IParsedData<T>) => void): this;
|
|
39
39
|
on<T extends IPushEvent>(event: T, listener: (parsedData: IParsedData<T>) => void): this;
|
|
40
40
|
emit<T extends IPushEvent>(event: T, parsedData?: IParsedData<T>): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { groupBy, forOwn } from '../../utils/lang';
|
|
2
|
-
import
|
|
2
|
+
import SplitIO from '../../../types/splitio';
|
|
3
3
|
import { submitterFactory } from './submitter';
|
|
4
4
|
import { ImpressionsPayload } from './types';
|
|
5
5
|
import { SUBMITTERS_PUSH_FULL_QUEUE } from '../../logger/constants';
|
|
@@ -10,7 +10,7 @@ const DATA_NAME = 'impressions';
|
|
|
10
10
|
/**
|
|
11
11
|
* Converts `impressions` data from cache into request payload.
|
|
12
12
|
*/
|
|
13
|
-
export function fromImpressionsCollector(sendLabels: boolean, data: ImpressionDTO[]): ImpressionsPayload {
|
|
13
|
+
export function fromImpressionsCollector(sendLabels: boolean, data: SplitIO.ImpressionDTO[]): ImpressionsPayload {
|
|
14
14
|
let groupedByFeature = groupBy(data, 'feature');
|
|
15
15
|
let dto: ImpressionsPayload = [];
|
|
16
16
|
|
|
@@ -3,7 +3,8 @@ import { submitterFactory, firstPushWindowDecorator } from './submitter';
|
|
|
3
3
|
import { TelemetryConfigStatsPayload, TelemetryConfigStats } from './types';
|
|
4
4
|
import { CONSUMER_MODE, CONSUMER_ENUM, STANDALONE_MODE, CONSUMER_PARTIAL_MODE, STANDALONE_ENUM, CONSUMER_PARTIAL_ENUM, OPTIMIZED, DEBUG, NONE, DEBUG_ENUM, OPTIMIZED_ENUM, NONE_ENUM, CONSENT_GRANTED, CONSENT_DECLINED, CONSENT_UNKNOWN } from '../../utils/constants';
|
|
5
5
|
import { SDK_READY, SDK_READY_FROM_CACHE } from '../../readiness/constants';
|
|
6
|
-
import {
|
|
6
|
+
import { ISettings } from '../../types';
|
|
7
|
+
import SplitIO from '../../../types/splitio';
|
|
7
8
|
import { base } from '../../utils/settingsValidation';
|
|
8
9
|
import { usedKeysMap } from '../../utils/inputValidation/apiKey';
|
|
9
10
|
import { timer } from '../../utils/timeTracker/timer';
|
|
@@ -27,7 +28,7 @@ const USER_CONSENT_MAP = {
|
|
|
27
28
|
[CONSENT_UNKNOWN]: 1,
|
|
28
29
|
[CONSENT_GRANTED]: 2,
|
|
29
30
|
[CONSENT_DECLINED]: 3
|
|
30
|
-
} as Record<ConsentStatus, number>;
|
|
31
|
+
} as Record<SplitIO.ConsentStatus, number>;
|
|
31
32
|
|
|
32
33
|
function getActiveFactories() {
|
|
33
34
|
return Object.keys(usedKeysMap).length;
|
|
@@ -51,7 +52,7 @@ function getTelemetryFlagSetsStats(splitFiltersValidation: ISplitFiltersValidati
|
|
|
51
52
|
return { flagSetsTotal, flagSetsIgnored };
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
export function getTelemetryConfigStats(mode: SDKMode, storageType: string): TelemetryConfigStats {
|
|
55
|
+
export function getTelemetryConfigStats(mode: SplitIO.SDKMode, storageType: string): TelemetryConfigStats {
|
|
55
56
|
return {
|
|
56
57
|
oM: OPERATION_MODE_MAP[mode], // @ts-ignore lower case of storage type
|
|
57
58
|
st: storageType.toLowerCase(),
|
|
@@ -14,9 +14,9 @@ import { ISdkFactoryContextSync } from '../sdkFactory/types';
|
|
|
14
14
|
* Online SyncManager factory.
|
|
15
15
|
* Can be used for server-side API, and client-side API with or without multiple clients.
|
|
16
16
|
*
|
|
17
|
-
* @param pollingManagerFactory allows to specialize the SyncManager for server-side or client-side API by passing
|
|
17
|
+
* @param pollingManagerFactory - allows to specialize the SyncManager for server-side or client-side API by passing
|
|
18
18
|
* `pollingManagerSSFactory` or `pollingManagerCSFactory` respectively.
|
|
19
|
-
* @param pushManagerFactory optional to build a SyncManager with or without streaming support
|
|
19
|
+
* @param pushManagerFactory - optional to build a SyncManager with or without streaming support
|
|
20
20
|
*/
|
|
21
21
|
export function syncManagerOnlineFactory(
|
|
22
22
|
pollingManagerFactory?: (params: ISdkFactoryContextSync) => IPollingManager,
|
package/src/sync/syncTask.ts
CHANGED
|
@@ -6,10 +6,10 @@ import { ISyncTask } from './types';
|
|
|
6
6
|
* Creates an object that handles the periodic execution of a given task via "start" and "stop" methods.
|
|
7
7
|
* The task can be also executed by calling the "execute" method. Multiple calls run sequentially to avoid race conditions (e.g., submitters executed on SDK destroy or full queue, while periodic execution is pending).
|
|
8
8
|
*
|
|
9
|
-
* @param log Logger instance.
|
|
10
|
-
* @param task Task to execute that returns a promise that NEVER REJECTS. Otherwise, periodic execution can result in Unhandled Promise Rejections.
|
|
11
|
-
* @param period Period in milliseconds to execute the task.
|
|
12
|
-
* @param taskName Optional task name for logging.
|
|
9
|
+
* @param log - Logger instance.
|
|
10
|
+
* @param task - Task to execute that returns a promise that NEVER REJECTS. Otherwise, periodic execution can result in Unhandled Promise Rejections.
|
|
11
|
+
* @param period - Period in milliseconds to execute the task.
|
|
12
|
+
* @param taskName - Optional task name for logging.
|
|
13
13
|
* @returns A sync task that wraps the given task.
|
|
14
14
|
*/
|
|
15
15
|
export function syncTaskFactory<Input extends any[], Output = any>(log: ILogger, task: (...args: Input) => Promise<Output>, period: number, taskName = 'task'): ISyncTask<Input, Output> {
|
|
@@ -2,7 +2,8 @@ import { objectAssign } from '../utils/lang/objectAssign';
|
|
|
2
2
|
import { thenable } from '../utils/promise/thenable';
|
|
3
3
|
import { IEventsCacheBase, ITelemetryCacheAsync, ITelemetryCacheSync } from '../storages/types';
|
|
4
4
|
import { IEventsHandler, IEventTracker } from './types';
|
|
5
|
-
import { ISettings
|
|
5
|
+
import { ISettings } from '../types';
|
|
6
|
+
import SplitIO from '../../types/splitio';
|
|
6
7
|
import { EVENTS_TRACKER_SUCCESS, ERROR_EVENTS_TRACKER } from '../logger/constants';
|
|
7
8
|
import { CONSENT_DECLINED, DROPPED, QUEUED } from '../utils/constants';
|
|
8
9
|
import { isConsumerMode } from '../utils/settingsValidation/mode';
|
|
@@ -10,8 +11,8 @@ import { isConsumerMode } from '../utils/settingsValidation/mode';
|
|
|
10
11
|
/**
|
|
11
12
|
* Event tracker stores events in cache and pass them to the integrations manager if provided.
|
|
12
13
|
*
|
|
13
|
-
* @param eventsCache cache to save events
|
|
14
|
-
* @param integrationsManager optional event handler used for integrations
|
|
14
|
+
* @param eventsCache - cache to save events
|
|
15
|
+
* @param integrationsManager - optional event handler used for integrations
|
|
15
16
|
*/
|
|
16
17
|
export function eventTrackerFactory(
|
|
17
18
|
settings: ISettings,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import SplitIO from '../../../types/splitio';
|
|
2
2
|
import { LRUCache } from '../../utils/LRUCache';
|
|
3
3
|
import { IImpressionObserver } from './types';
|
|
4
4
|
|
|
5
5
|
export class ImpressionObserver<K extends string | number = string> implements IImpressionObserver {
|
|
6
6
|
private cache: LRUCache<K, number>;
|
|
7
|
-
private hasher: (impression: ImpressionDTO) => K;
|
|
7
|
+
private hasher: (impression: SplitIO.ImpressionDTO) => K;
|
|
8
8
|
|
|
9
|
-
constructor(size: number, hasher: (impression: ImpressionDTO) => K) {
|
|
9
|
+
constructor(size: number, hasher: (impression: SplitIO.ImpressionDTO) => K) {
|
|
10
10
|
this.cache = new LRUCache(size);
|
|
11
11
|
this.hasher = hasher;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
testAndSet(impression: ImpressionDTO) {
|
|
14
|
+
testAndSet(impression: SplitIO.ImpressionDTO) {
|
|
15
15
|
const hash = this.hasher(impression);
|
|
16
16
|
const previous = this.cache.get(hash);
|
|
17
17
|
this.cache.set(hash, impression.time);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import SplitIO from '../../../types/splitio';
|
|
2
2
|
|
|
3
|
-
export function buildKey(impression: ImpressionDTO) {
|
|
3
|
+
export function buildKey(impression: SplitIO.ImpressionDTO) {
|
|
4
4
|
return `${impression.keyName}:${impression.feature}:${impression.treatment}:${impression.label}:${impression.changeNumber}`;
|
|
5
5
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ImpressionObserver } from './ImpressionObserver';
|
|
2
2
|
import { hash } from '../../utils/murmur3/murmur3';
|
|
3
3
|
import { buildKey } from './buildKey';
|
|
4
|
-
import
|
|
4
|
+
import SplitIO from '../../../types/splitio';
|
|
5
5
|
|
|
6
|
-
export function hashImpression32(impression: ImpressionDTO) {
|
|
6
|
+
export function hashImpression32(impression: SplitIO.ImpressionDTO) {
|
|
7
7
|
return hash(buildKey(impression));
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ImpressionObserver } from './ImpressionObserver';
|
|
2
2
|
import { hash128 } from '../../utils/murmur3/murmur3_128_x86';
|
|
3
3
|
import { buildKey } from './buildKey';
|
|
4
|
-
import
|
|
4
|
+
import SplitIO from '../../../types/splitio';
|
|
5
5
|
|
|
6
|
-
export function hashImpression128(impression: ImpressionDTO) {
|
|
6
|
+
export function hashImpression128(impression: SplitIO.ImpressionDTO) {
|
|
7
7
|
return hash128(buildKey(impression));
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -2,18 +2,19 @@ import { objectAssign } from '../utils/lang/objectAssign';
|
|
|
2
2
|
import { thenable } from '../utils/promise/thenable';
|
|
3
3
|
import { IImpressionsCacheBase, ITelemetryCacheSync, ITelemetryCacheAsync } from '../storages/types';
|
|
4
4
|
import { IImpressionsHandler, IImpressionsTracker, IStrategy } from './types';
|
|
5
|
-
import {
|
|
5
|
+
import { ISettings } from '../types';
|
|
6
6
|
import { IMPRESSIONS_TRACKER_SUCCESS, ERROR_IMPRESSIONS_TRACKER, ERROR_IMPRESSIONS_LISTENER } from '../logger/constants';
|
|
7
7
|
import { CONSENT_DECLINED, DEDUPED, QUEUED } from '../utils/constants';
|
|
8
|
+
import SplitIO from '../../types/splitio';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Impressions tracker stores impressions in cache and pass them to the listener and integrations manager if provided.
|
|
11
12
|
*
|
|
12
|
-
* @param impressionsCache cache to save impressions
|
|
13
|
-
* @param metadata runtime metadata (ip, hostname and version)
|
|
14
|
-
* @param impressionListener optional impression listener
|
|
15
|
-
* @param integrationsManager optional integrations manager
|
|
16
|
-
* @param strategy strategy for impressions tracking.
|
|
13
|
+
* @param impressionsCache - cache to save impressions
|
|
14
|
+
* @param metadata - runtime metadata (ip, hostname and version)
|
|
15
|
+
* @param impressionListener - optional impression listener
|
|
16
|
+
* @param integrationsManager - optional integrations manager
|
|
17
|
+
* @param strategy - strategy for impressions tracking.
|
|
17
18
|
*/
|
|
18
19
|
export function impressionsTrackerFactory(
|
|
19
20
|
settings: ISettings,
|
|
@@ -27,7 +28,7 @@ export function impressionsTrackerFactory(
|
|
|
27
28
|
const { log, impressionListener, runtime: { ip, hostname }, version } = settings;
|
|
28
29
|
|
|
29
30
|
return {
|
|
30
|
-
track(impressions: ImpressionDTO[], attributes?: SplitIO.Attributes) {
|
|
31
|
+
track(impressions: SplitIO.ImpressionDTO[], attributes?: SplitIO.Attributes) {
|
|
31
32
|
if (settings.userConsent === CONSENT_DECLINED) return;
|
|
32
33
|
|
|
33
34
|
const impressionsCount = impressions.length;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import SplitIO from '../../../types/splitio';
|
|
2
2
|
import { IImpressionObserver } from '../impressionObserver/types';
|
|
3
3
|
import { IStrategy } from '../types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Debug strategy for impressions tracker. Wraps impressions to store and adds previousTime if it corresponds
|
|
7
7
|
*
|
|
8
|
-
* @param impressionsObserver impression observer. Previous time (pt property) is included in impression instances
|
|
8
|
+
* @param impressionsObserver - impression observer. Previous time (pt property) is included in impression instances
|
|
9
9
|
* @returns IStrategyResult
|
|
10
10
|
*/
|
|
11
11
|
export function strategyDebugFactory(
|
|
@@ -13,7 +13,7 @@ export function strategyDebugFactory(
|
|
|
13
13
|
): IStrategy {
|
|
14
14
|
|
|
15
15
|
return {
|
|
16
|
-
process(impressions: ImpressionDTO[]) {
|
|
16
|
+
process(impressions: SplitIO.ImpressionDTO[]) {
|
|
17
17
|
impressions.forEach((impression) => {
|
|
18
18
|
// Adds previous time if it is enabled
|
|
19
19
|
impression.pt = impressionsObserver.testAndSet(impression);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { IImpressionCountsCacheBase } from '../../storages/types';
|
|
2
|
-
import
|
|
2
|
+
import SplitIO from '../../../types/splitio';
|
|
3
3
|
import { IStrategy, IUniqueKeysTracker } from '../types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* None strategy for impressions tracker.
|
|
7
7
|
*
|
|
8
|
-
* @param impressionsCounter cache to save impressions count. impressions will be deduped (OPTIMIZED mode)
|
|
9
|
-
* @param uniqueKeysTracker unique keys tracker in charge of tracking the unique keys per split.
|
|
8
|
+
* @param impressionsCounter - cache to save impressions count. impressions will be deduped (OPTIMIZED mode)
|
|
9
|
+
* @param uniqueKeysTracker - unique keys tracker in charge of tracking the unique keys per split.
|
|
10
10
|
* @returns IStrategyResult
|
|
11
11
|
*/
|
|
12
12
|
export function strategyNoneFactory(
|
|
@@ -15,7 +15,7 @@ export function strategyNoneFactory(
|
|
|
15
15
|
): IStrategy {
|
|
16
16
|
|
|
17
17
|
return {
|
|
18
|
-
process(impressions: ImpressionDTO[]) {
|
|
18
|
+
process(impressions: SplitIO.ImpressionDTO[]) {
|
|
19
19
|
impressions.forEach((impression) => {
|
|
20
20
|
const now = Date.now();
|
|
21
21
|
// Increments impression counter per featureName
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IImpressionCountsCacheBase } from '../../storages/types';
|
|
2
|
-
import
|
|
2
|
+
import SplitIO from '../../../types/splitio';
|
|
3
3
|
import { truncateTimeFrame } from '../../utils/time';
|
|
4
4
|
import { IImpressionObserver } from '../impressionObserver/types';
|
|
5
5
|
import { IStrategy } from '../types';
|
|
@@ -7,8 +7,8 @@ import { IStrategy } from '../types';
|
|
|
7
7
|
/**
|
|
8
8
|
* Optimized strategy for impressions tracker. Wraps impressions to store and adds previousTime if it corresponds
|
|
9
9
|
*
|
|
10
|
-
* @param impressionsObserver impression observer. previous time (pt property) is included in impression instances
|
|
11
|
-
* @param impressionsCounter cache to save impressions count. impressions will be deduped (OPTIMIZED mode)
|
|
10
|
+
* @param impressionsObserver - impression observer. previous time (pt property) is included in impression instances
|
|
11
|
+
* @param impressionsCounter - cache to save impressions count. impressions will be deduped (OPTIMIZED mode)
|
|
12
12
|
* @returns IStrategyResult
|
|
13
13
|
*/
|
|
14
14
|
export function strategyOptimizedFactory(
|
|
@@ -17,8 +17,8 @@ export function strategyOptimizedFactory(
|
|
|
17
17
|
): IStrategy {
|
|
18
18
|
|
|
19
19
|
return {
|
|
20
|
-
process(impressions: ImpressionDTO[]) {
|
|
21
|
-
const impressionsToStore: ImpressionDTO[] = [];
|
|
20
|
+
process(impressions: SplitIO.ImpressionDTO[]) {
|
|
21
|
+
const impressionsToStore: SplitIO.ImpressionDTO[] = [];
|
|
22
22
|
impressions.forEach((impression) => {
|
|
23
23
|
impression.pt = impressionsObserver.testAndSet(impression);
|
|
24
24
|
|
package/src/trackers/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import SplitIO from '../../types/splitio';
|
|
2
2
|
import { StreamingEventType, Method, OperationType, UpdatesFromSSEEnum } from '../sync/submitters/types';
|
|
3
3
|
import { IEventsCacheBase } from '../storages/types';
|
|
4
4
|
import { NetworkError } from '../services/types';
|
|
@@ -18,7 +18,7 @@ export interface IImpressionsHandler {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface IImpressionsTracker {
|
|
21
|
-
track(impressions: ImpressionDTO[], attributes?: SplitIO.Attributes): void
|
|
21
|
+
track(impressions: SplitIO.ImpressionDTO[], attributes?: SplitIO.Attributes): void
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** Telemetry tracker */
|
|
@@ -71,11 +71,11 @@ export interface IUniqueKeysTracker {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export interface IStrategyResult {
|
|
74
|
-
impressionsToStore: ImpressionDTO[],
|
|
75
|
-
impressionsToListener: ImpressionDTO[],
|
|
74
|
+
impressionsToStore: SplitIO.ImpressionDTO[],
|
|
75
|
+
impressionsToListener: SplitIO.ImpressionDTO[],
|
|
76
76
|
deduped: number
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export interface IStrategy {
|
|
80
|
-
process(impressions: ImpressionDTO[]): IStrategyResult
|
|
80
|
+
process(impressions: SplitIO.ImpressionDTO[]): IStrategyResult
|
|
81
81
|
}
|
|
@@ -14,9 +14,9 @@ const noopFilterAdapter = {
|
|
|
14
14
|
* Unique Keys Tracker will be in charge of checking if the MTK was already sent to the BE in the last period
|
|
15
15
|
* or schedule to be sent; if not it will be added in an internal cache and sent in the next post.
|
|
16
16
|
*
|
|
17
|
-
* @param log Logger instance
|
|
18
|
-
* @param uniqueKeysCache cache to save unique keys
|
|
19
|
-
* @param filterAdapter filter adapter
|
|
17
|
+
* @param log - Logger instance
|
|
18
|
+
* @param uniqueKeysCache - cache to save unique keys
|
|
19
|
+
* @param filterAdapter - filter adapter
|
|
20
20
|
*/
|
|
21
21
|
export function uniqueKeysTrackerFactory(
|
|
22
22
|
log: ILogger,
|