@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import SplitIO from '../../../types/splitio';
|
|
2
2
|
import { IEventsCacheSync } from '../types';
|
|
3
3
|
|
|
4
4
|
const MAX_QUEUE_BYTE_SIZE = 5 * 1024 * 1024; // 5M
|
|
@@ -12,7 +12,7 @@ export class EventsCacheInMemory implements IEventsCacheSync {
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
15
|
-
* @param eventsQueueSize number of queued events to call onFullQueueCb.
|
|
15
|
+
* @param eventsQueueSize - number of queued events to call onFullQueueCb.
|
|
16
16
|
* Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
|
|
17
17
|
*/
|
|
18
18
|
constructor(eventsQueueSize: number = 0) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { IImpressionsCacheSync } from '../types';
|
|
2
|
-
import
|
|
2
|
+
import SplitIO from '../../../types/splitio';
|
|
3
3
|
|
|
4
4
|
export class ImpressionsCacheInMemory implements IImpressionsCacheSync {
|
|
5
5
|
|
|
6
6
|
private onFullQueue?: () => void;
|
|
7
7
|
private readonly maxQueue: number;
|
|
8
|
-
private queue: ImpressionDTO[];
|
|
8
|
+
private queue: SplitIO.ImpressionDTO[];
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
12
|
-
* @param impressionsQueueSize number of queued impressions to call onFullQueueCb.
|
|
12
|
+
* @param impressionsQueueSize - number of queued impressions to call onFullQueueCb.
|
|
13
13
|
* Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
|
|
14
14
|
*/
|
|
15
15
|
constructor(impressionsQueueSize: number = 0) {
|
|
@@ -24,7 +24,7 @@ export class ImpressionsCacheInMemory implements IImpressionsCacheSync {
|
|
|
24
24
|
/**
|
|
25
25
|
* Store impressions in sequential order
|
|
26
26
|
*/
|
|
27
|
-
track(data: ImpressionDTO[]) {
|
|
27
|
+
track(data: SplitIO.ImpressionDTO[]) {
|
|
28
28
|
this.queue.push(...data);
|
|
29
29
|
|
|
30
30
|
// Check if the cache queue is full and we need to flush it.
|
|
@@ -43,7 +43,7 @@ export class ImpressionsCacheInMemory implements IImpressionsCacheSync {
|
|
|
43
43
|
/**
|
|
44
44
|
* Pop the collected data, used as payload for posting.
|
|
45
45
|
*/
|
|
46
|
-
pop(toMerge?: ImpressionDTO[]) {
|
|
46
|
+
pop(toMerge?: SplitIO.ImpressionDTO[]) {
|
|
47
47
|
const data = this.queue;
|
|
48
48
|
this.clear();
|
|
49
49
|
return toMerge ? toMerge.concat(data) : data;
|
|
@@ -11,7 +11,7 @@ import { UniqueKeysCacheInMemory } from './UniqueKeysCacheInMemory';
|
|
|
11
11
|
/**
|
|
12
12
|
* InMemory storage factory for standalone server-side SplitFactory
|
|
13
13
|
*
|
|
14
|
-
* @param params parameters required by EventsCacheSync
|
|
14
|
+
* @param params - parameters required by EventsCacheSync
|
|
15
15
|
*/
|
|
16
16
|
export function InMemoryStorageFactory(params: IStorageFactoryParams): IStorageSync {
|
|
17
17
|
const { settings: { scheduler: { impressionsQueueSize, eventsQueueSize, }, sync: { impressionsMode, __splitFiltersValidation } } } = params;
|
|
@@ -11,7 +11,7 @@ import { UniqueKeysCacheInMemoryCS } from './UniqueKeysCacheInMemoryCS';
|
|
|
11
11
|
/**
|
|
12
12
|
* InMemory storage factory for standalone client-side SplitFactory
|
|
13
13
|
*
|
|
14
|
-
* @param params parameters required by EventsCacheSync
|
|
14
|
+
* @param params - parameters required by EventsCacheSync
|
|
15
15
|
*/
|
|
16
16
|
export function InMemoryStorageCSFactory(params: IStorageFactoryParams): IStorageSync {
|
|
17
17
|
const { settings: { scheduler: { impressionsQueueSize, eventsQueueSize, }, sync: { impressionsMode, __splitFiltersValidation } } } = params;
|
|
@@ -12,7 +12,7 @@ export class UniqueKeysCacheInMemoryCS implements IUniqueKeysCacheBase {
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
15
|
-
* @param impressionsQueueSize number of queued impressions to call onFullQueueCb.
|
|
15
|
+
* @param impressionsQueueSize - number of queued impressions to call onFullQueueCb.
|
|
16
16
|
* Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
|
|
17
17
|
*/
|
|
18
18
|
constructor(uniqueKeysQueueSize = DEFAULT_CACHE_SIZE) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IEventsCacheAsync } from '../types';
|
|
2
2
|
import { IMetadata } from '../../dtos/types';
|
|
3
|
-
import
|
|
3
|
+
import SplitIO from '../../../types/splitio';
|
|
4
4
|
import { ILogger } from '../../logger/types';
|
|
5
5
|
import { LOG_PREFIX } from './constants';
|
|
6
6
|
import { StoredEventWithMetadata } from '../../sync/submitters/types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IImpressionsCacheAsync } from '../types';
|
|
2
2
|
import { IMetadata } from '../../dtos/types';
|
|
3
|
-
import
|
|
3
|
+
import SplitIO from '../../../types/splitio';
|
|
4
4
|
import { StoredImpressionWithMetadata } from '../../sync/submitters/types';
|
|
5
5
|
import { ILogger } from '../../logger/types';
|
|
6
6
|
import { impressionsToJSON } from '../utils';
|
|
@@ -22,7 +22,7 @@ export class ImpressionsCacheInRedis implements IImpressionsCacheAsync {
|
|
|
22
22
|
this.metadata = metadata;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
track(impressions: ImpressionDTO[]): Promise<void> { // @ts-ignore
|
|
25
|
+
track(impressions: SplitIO.ImpressionDTO[]): Promise<void> { // @ts-ignore
|
|
26
26
|
return this.redis.rpush(
|
|
27
27
|
this.key,
|
|
28
28
|
impressionsToJSON(impressions, this.metadata),
|
|
@@ -186,10 +186,8 @@ export class SplitsCacheInRedis extends AbstractSplitsCacheAsync {
|
|
|
186
186
|
* Get list of all split definitions.
|
|
187
187
|
* The returned promise is resolved with the list of split definitions,
|
|
188
188
|
* or rejected if redis operation fails.
|
|
189
|
-
*
|
|
190
|
-
* @TODO we need to benchmark which is the maximun number of commands we could
|
|
191
|
-
* pipeline without kill redis performance.
|
|
192
189
|
*/
|
|
190
|
+
// @TODO we need to benchmark which is the maximun number of commands we could pipeline without kill redis performance.
|
|
193
191
|
getAll(): Promise<ISplit[]> {
|
|
194
192
|
return this.redis.keys(this.keys.searchPatternForSplitKeys())
|
|
195
193
|
.then((listOfKeys) => this.redis.pipeline(listOfKeys.map(k => ['get', k])).exec())
|
|
@@ -14,9 +14,9 @@ export class TelemetryCacheInRedis implements ITelemetryCacheAsync {
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Create a Telemetry cache that uses Redis as storage.
|
|
17
|
-
* @param log Logger instance.
|
|
18
|
-
* @param keys Key builder.
|
|
19
|
-
* @param redis Redis client.
|
|
17
|
+
* @param log - Logger instance.
|
|
18
|
+
* @param keys - Key builder.
|
|
19
|
+
* @param redis - Redis client.
|
|
20
20
|
*/
|
|
21
21
|
constructor(private readonly log: ILogger, private readonly keys: KeyBuilderSS, private readonly redis: RedisAdapter) { }
|
|
22
22
|
|
|
@@ -63,7 +63,7 @@ export class UniqueKeysCacheInRedis extends UniqueKeysCacheInMemory implements I
|
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Async consumer API, used by synchronizer.
|
|
66
|
-
* @param count number of items to pop from the queue. If not provided or equal 0, all items will be popped.
|
|
66
|
+
* @param count - number of items to pop from the queue. If not provided or equal 0, all items will be popped.
|
|
67
67
|
*/
|
|
68
68
|
popNRaw(count = 0): Promise<UniqueKeysItemSs[]> {
|
|
69
69
|
return this.redis.lrange(this.key, 0, count - 1).then(uniqueKeyItems => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IPluggableStorageWrapper, IEventsCacheAsync } from '../types';
|
|
2
2
|
import { IMetadata } from '../../dtos/types';
|
|
3
|
-
import
|
|
3
|
+
import SplitIO from '../../../types/splitio';
|
|
4
4
|
import { ILogger } from '../../logger/types';
|
|
5
5
|
import { LOG_PREFIX } from './constants';
|
|
6
6
|
import { StoredEventWithMetadata } from '../../sync/submitters/types';
|
|
@@ -21,7 +21,7 @@ export class EventsCachePluggable implements IEventsCacheAsync {
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Push given event to the storage.
|
|
24
|
-
* @param eventData Event item to push.
|
|
24
|
+
* @param eventData - Event item to push.
|
|
25
25
|
* @returns A promise that is resolved with a boolean value indicating if the push operation succeeded or failed.
|
|
26
26
|
* Unlike `impressions::track`, The promise will never be rejected.
|
|
27
27
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IPluggableStorageWrapper, IImpressionsCacheAsync } from '../types';
|
|
2
2
|
import { IMetadata } from '../../dtos/types';
|
|
3
|
-
import
|
|
3
|
+
import SplitIO from '../../../types/splitio';
|
|
4
4
|
import { StoredImpressionWithMetadata } from '../../sync/submitters/types';
|
|
5
5
|
import { ILogger } from '../../logger/types';
|
|
6
6
|
import { impressionsToJSON } from '../utils';
|
|
@@ -21,11 +21,11 @@ export class ImpressionsCachePluggable implements IImpressionsCacheAsync {
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Push given impressions to the storage.
|
|
24
|
-
* @param impressions List of impresions to push.
|
|
24
|
+
* @param impressions - List of impresions to push.
|
|
25
25
|
* @returns A promise that is resolved if the push operation succeeded
|
|
26
26
|
* or rejected if the wrapper operation fails.
|
|
27
27
|
*/
|
|
28
|
-
track(impressions: ImpressionDTO[]): Promise<void> {
|
|
28
|
+
track(impressions: SplitIO.ImpressionDTO[]): Promise<void> {
|
|
29
29
|
return this.wrapper.pushItems(
|
|
30
30
|
this.key,
|
|
31
31
|
impressionsToJSON(impressions, this.metadata)
|
|
@@ -83,7 +83,7 @@ export class SegmentsCachePluggable implements ISegmentsCacheAsync {
|
|
|
83
83
|
return this.wrapper.getItems(this.keys.buildRegisteredSegmentsKey());
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
// @TODO implement if required by DataLoader or Producer mode
|
|
87
87
|
clear(): Promise<boolean> {
|
|
88
88
|
return Promise.resolve(true);
|
|
89
89
|
}
|
|
@@ -19,9 +19,9 @@ export class SplitsCachePluggable extends AbstractSplitsCacheAsync {
|
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Create a SplitsCache that uses a storage wrapper.
|
|
22
|
-
* @param log Logger instance.
|
|
23
|
-
* @param keys Key builder.
|
|
24
|
-
* @param wrapper Adapted wrapper storage.
|
|
22
|
+
* @param log - Logger instance.
|
|
23
|
+
* @param keys - Key builder.
|
|
24
|
+
* @param wrapper - Adapted wrapper storage.
|
|
25
25
|
*/
|
|
26
26
|
constructor(log: ILogger, keys: KeyBuilder, wrapper: IPluggableStorageWrapper, splitFiltersValidation?: ISplitFiltersValidation) {
|
|
27
27
|
super();
|
|
@@ -13,9 +13,9 @@ export class TelemetryCachePluggable implements ITelemetryCacheAsync {
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Create a Telemetry cache that uses a storage wrapper.
|
|
16
|
-
* @param log Logger instance.
|
|
17
|
-
* @param keys Key builder.
|
|
18
|
-
* @param wrapper Adapted wrapper storage.
|
|
16
|
+
* @param log - Logger instance.
|
|
17
|
+
* @param keys - Key builder.
|
|
18
|
+
* @param wrapper - Adapted wrapper storage.
|
|
19
19
|
*/
|
|
20
20
|
constructor(private readonly log: ILogger, private readonly keys: KeyBuilderSS, private readonly wrapper: IPluggableStorageWrapper) { }
|
|
21
21
|
|
|
@@ -56,7 +56,7 @@ export class UniqueKeysCachePluggable extends UniqueKeysCacheInMemory implements
|
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Async consumer API, used by synchronizer.
|
|
59
|
-
* @param count number of items to pop from the queue. If not provided or equal 0, all items will be popped.
|
|
59
|
+
* @param count - number of items to pop from the queue. If not provided or equal 0, all items will be popped.
|
|
60
60
|
*/
|
|
61
61
|
popNRaw(count = 0): Promise<UniqueKeysItemSs[]> {
|
|
62
62
|
return Promise.resolve(count || this.wrapper.getItemsCount(this.key))
|
|
@@ -7,7 +7,7 @@ import { setToArray } from '../../utils/lang/sets';
|
|
|
7
7
|
* The `_cache` property is the object were items are stored.
|
|
8
8
|
* Intended for testing purposes.
|
|
9
9
|
*
|
|
10
|
-
* @param connDelay delay in millis for `connect` resolve. If not provided, `connect` resolves immediately.
|
|
10
|
+
* @param connDelay - delay in millis for `connect` resolve. If not provided, `connect` resolves immediately.
|
|
11
11
|
*/
|
|
12
12
|
export function inMemoryWrapperFactory(connDelay?: number): IPluggableStorageWrapper & { _cache: Record<string, string | string[] | Set<string>>, _setConnDelay(connDelay: number): void } {
|
|
13
13
|
|
|
@@ -32,7 +32,7 @@ export interface PluggableStorageOptions {
|
|
|
32
32
|
/**
|
|
33
33
|
* Validate pluggable storage factory options.
|
|
34
34
|
*
|
|
35
|
-
* @param options user options
|
|
35
|
+
* @param options - user options
|
|
36
36
|
* @throws Will throw an error if the options are invalid. Example: wrapper is not provided or doesn't have some methods.
|
|
37
37
|
*/
|
|
38
38
|
function validatePluggableStorageOptions(options: any) {
|
|
@@ -26,8 +26,8 @@ export const METHODS_TO_PROMISE_WRAP: string[] = [
|
|
|
26
26
|
* Adapter of the Pluggable Storage Wrapper.
|
|
27
27
|
* Used to handle exceptions as rejected promises, in order to simplify the error handling on storages.
|
|
28
28
|
*
|
|
29
|
-
* @param log logger instance
|
|
30
|
-
* @param wrapper storage wrapper to adapt
|
|
29
|
+
* @param log - logger instance
|
|
30
|
+
* @param wrapper - storage wrapper to adapt
|
|
31
31
|
* @returns an adapted version of the given storage wrapper
|
|
32
32
|
*/
|
|
33
33
|
export function wrapperAdapter(log: ILogger, wrapper: IPluggableStorageWrapper): IPluggableStorageWrapper {
|
package/src/storages/types.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import SplitIO from '../../types/splitio';
|
|
1
2
|
import { MaybeThenable, ISplit, IMySegmentsResponse } from '../dtos/types';
|
|
2
3
|
import { MySegmentsData } from '../sync/polling/types';
|
|
3
4
|
import { EventDataType, HttpErrors, HttpLatencies, ImpressionDataType, LastSync, Method, MethodExceptions, MethodLatencies, MultiMethodExceptions, MultiMethodLatencies, MultiConfigs, OperationType, StoredEventWithMetadata, StoredImpressionWithMetadata, StreamingEvent, UniqueKeysPayloadCs, UniqueKeysPayloadSs, TelemetryUsageStatsPayload, UpdatesFromSSEEnum } from '../sync/submitters/types';
|
|
4
|
-
import {
|
|
5
|
+
import { ISettings } from '../types';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Interface of a pluggable storage wrapper.
|
|
@@ -13,56 +14,50 @@ export interface IPluggableStorageWrapper {
|
|
|
13
14
|
/**
|
|
14
15
|
* Get the value of given `key`.
|
|
15
16
|
*
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
18
|
-
* @returns {Promise<string | null>} A promise that resolves with the element value associated with the specified `key`,
|
|
17
|
+
* @param key - Item to retrieve
|
|
18
|
+
* @returns A promise that resolves with the element value associated with the specified `key`,
|
|
19
19
|
* or null if the key does not exist. The promise rejects if the operation fails.
|
|
20
20
|
*/
|
|
21
21
|
get: (key: string) => Promise<string | null>
|
|
22
22
|
/**
|
|
23
23
|
* Add or update an item with a specified `key` and `value`.
|
|
24
24
|
*
|
|
25
|
-
* @
|
|
26
|
-
* @param
|
|
27
|
-
* @
|
|
28
|
-
* @returns {Promise<void>} A promise that resolves if the operation success, whether the key was added or updated.
|
|
25
|
+
* @param key - Item to update
|
|
26
|
+
* @param value - Value to set
|
|
27
|
+
* @returns A promise that resolves if the operation success, whether the key was added or updated.
|
|
29
28
|
* The promise rejects if the operation fails.
|
|
30
29
|
*/
|
|
31
30
|
set: (key: string, value: string) => Promise<boolean | void>
|
|
32
31
|
/**
|
|
33
32
|
* Add or update an item with a specified `key` and `value`.
|
|
34
33
|
*
|
|
35
|
-
* @
|
|
36
|
-
* @param
|
|
37
|
-
* @
|
|
38
|
-
* @returns {Promise<string | null>} A promise that resolves with the previous value associated to the given `key`, or null if not set.
|
|
34
|
+
* @param key - Item to update
|
|
35
|
+
* @param value - Value to set
|
|
36
|
+
* @returns A promise that resolves with the previous value associated to the given `key`, or null if not set.
|
|
39
37
|
* The promise rejects if the operation fails.
|
|
40
38
|
*/
|
|
41
39
|
getAndSet: (key: string, value: string) => Promise<string | null>
|
|
42
40
|
/**
|
|
43
41
|
* Removes the specified item by `key`.
|
|
44
42
|
*
|
|
45
|
-
* @
|
|
46
|
-
* @
|
|
47
|
-
* @returns {Promise<boolean>} A promise that resolves if the operation success, whether the key existed and was removed (resolves with true) or it didn't exist (resolves with false).
|
|
43
|
+
* @param key - Item to delete
|
|
44
|
+
* @returns A promise that resolves if the operation success, whether the key existed and was removed (resolves with true) or it didn't exist (resolves with false).
|
|
48
45
|
* The promise rejects if the operation fails, for example, if there is a connection error.
|
|
49
46
|
*/
|
|
50
47
|
del: (key: string) => Promise<boolean>
|
|
51
48
|
/**
|
|
52
49
|
* Returns all keys matching the given prefix.
|
|
53
50
|
*
|
|
54
|
-
* @
|
|
55
|
-
* @
|
|
56
|
-
* @returns {Promise<string[]>} A promise that resolves with the list of keys that match the given `prefix`.
|
|
51
|
+
* @param prefix - String prefix to match
|
|
52
|
+
* @returns A promise that resolves with the list of keys that match the given `prefix`.
|
|
57
53
|
* The promise rejects if the operation fails.
|
|
58
54
|
*/
|
|
59
55
|
getKeysByPrefix: (prefix: string) => Promise<string[]>
|
|
60
56
|
/**
|
|
61
57
|
* Returns the values of all given `keys`.
|
|
62
58
|
*
|
|
63
|
-
* @
|
|
64
|
-
* @
|
|
65
|
-
* @returns {Promise<(string | null)[]>} A promise that resolves with the list of items associated with the specified list of `keys`.
|
|
59
|
+
* @param keys - List of keys to retrieve
|
|
60
|
+
* @returns A promise that resolves with the list of items associated with the specified list of `keys`.
|
|
66
61
|
* For every key that does not hold a string value or does not exist, null is returned. The promise rejects if the operation fails.
|
|
67
62
|
*/
|
|
68
63
|
getMany: (keys: string[]) => Promise<(string | null)[]>
|
|
@@ -72,20 +67,18 @@ export interface IPluggableStorageWrapper {
|
|
|
72
67
|
/**
|
|
73
68
|
* Increments the number stored at `key` by `increment`, or set it to `increment` if the value doesn't exist.
|
|
74
69
|
*
|
|
75
|
-
* @
|
|
76
|
-
* @param
|
|
77
|
-
* @
|
|
78
|
-
* @returns {Promise<number>} A promise that resolves with the value of key after the increment. The promise rejects if the operation fails,
|
|
70
|
+
* @param key - Key to increment
|
|
71
|
+
* @param increment - Value to increment by. Defaults to 1.
|
|
72
|
+
* @returns A promise that resolves with the value of key after the increment. The promise rejects if the operation fails,
|
|
79
73
|
* for example, if there is a connection error or the key contains a string that can not be represented as integer.
|
|
80
74
|
*/
|
|
81
75
|
incr: (key: string, increment?: number) => Promise<number>
|
|
82
76
|
/**
|
|
83
77
|
* Decrements the number stored at `key` by `decrement`, or set it to minus `decrement` if the value doesn't exist.
|
|
84
78
|
*
|
|
85
|
-
* @
|
|
86
|
-
* @param
|
|
87
|
-
* @
|
|
88
|
-
* @returns {Promise<number>} A promise that resolves with the value of key after the decrement. The promise rejects if the operation fails,
|
|
79
|
+
* @param key - Key to decrement
|
|
80
|
+
* @param decrement - Value to decrement by. Defaults to 1.
|
|
81
|
+
* @returns A promise that resolves with the value of key after the decrement. The promise rejects if the operation fails,
|
|
89
82
|
* for example, if there is a connection error or the key contains a string that can not be represented as integer.
|
|
90
83
|
*/
|
|
91
84
|
decr: (key: string, decrement?: number) => Promise<number>
|
|
@@ -95,29 +88,26 @@ export interface IPluggableStorageWrapper {
|
|
|
95
88
|
/**
|
|
96
89
|
* Inserts given items at the tail of `key` list. If `key` does not exist, an empty list is created before pushing the items.
|
|
97
90
|
*
|
|
98
|
-
* @
|
|
99
|
-
* @param
|
|
100
|
-
* @
|
|
101
|
-
* @returns {Promise<void>} A promise that resolves if the operation success.
|
|
91
|
+
* @param key - List key
|
|
92
|
+
* @param items - List of items to push
|
|
93
|
+
* @returns A promise that resolves if the operation success.
|
|
102
94
|
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a list.
|
|
103
95
|
*/
|
|
104
96
|
pushItems: (key: string, items: string[]) => Promise<void>
|
|
105
97
|
/**
|
|
106
98
|
* Removes and returns the first `count` items from a list. If `key` does not exist, an empty list is items is returned.
|
|
107
99
|
*
|
|
108
|
-
* @
|
|
109
|
-
* @param
|
|
110
|
-
* @
|
|
111
|
-
* @returns {Promise<string[]>} A promise that resolves with the list of removed items from the list, or an empty array when key does not exist.
|
|
100
|
+
* @param key - List key
|
|
101
|
+
* @param count - Number of items to pop
|
|
102
|
+
* @returns A promise that resolves with the list of removed items from the list, or an empty array when key does not exist.
|
|
112
103
|
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a list.
|
|
113
104
|
*/
|
|
114
105
|
popItems: (key: string, count: number) => Promise<string[]>
|
|
115
106
|
/**
|
|
116
107
|
* Returns the count of items in a list, or 0 if `key` does not exist.
|
|
117
108
|
*
|
|
118
|
-
* @
|
|
119
|
-
* @
|
|
120
|
-
* @returns {Promise<number>} A promise that resolves with the number of items at the `key` list, or 0 when `key` does not exist.
|
|
109
|
+
* @param key - List key
|
|
110
|
+
* @returns A promise that resolves with the number of items at the `key` list, or 0 when `key` does not exist.
|
|
121
111
|
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a list.
|
|
122
112
|
*/
|
|
123
113
|
getItemsCount: (key: string) => Promise<number>
|
|
@@ -127,10 +117,9 @@ export interface IPluggableStorageWrapper {
|
|
|
127
117
|
/**
|
|
128
118
|
* Returns if item is a member of a set.
|
|
129
119
|
*
|
|
130
|
-
* @
|
|
131
|
-
* @param
|
|
132
|
-
* @
|
|
133
|
-
* @returns {Promise<boolean>} A promise that resolves with true boolean value if `item` is a member of the set stored at `key`,
|
|
120
|
+
* @param key - Set key
|
|
121
|
+
* @param item - Item value
|
|
122
|
+
* @returns A promise that resolves with true boolean value if `item` is a member of the set stored at `key`,
|
|
134
123
|
* or false if it is not a member or `key` set does not exist. The promise rejects if the operation fails, for example,
|
|
135
124
|
* if there is a connection error or the key holds a value that is not a set.
|
|
136
125
|
*/
|
|
@@ -139,29 +128,26 @@ export interface IPluggableStorageWrapper {
|
|
|
139
128
|
* Add the specified `items` to the set stored at `key`. Those items that are already part of the set are ignored.
|
|
140
129
|
* If key does not exist, an empty set is created before adding the items.
|
|
141
130
|
*
|
|
142
|
-
* @
|
|
143
|
-
* @param
|
|
144
|
-
* @
|
|
145
|
-
* @returns {Promise<boolean | void>} A promise that resolves if the operation success.
|
|
131
|
+
* @param key - Set key
|
|
132
|
+
* @param items - Items to add
|
|
133
|
+
* @returns A promise that resolves if the operation success.
|
|
146
134
|
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a set.
|
|
147
135
|
*/
|
|
148
136
|
addItems: (key: string, items: string[]) => Promise<boolean | void>
|
|
149
137
|
/**
|
|
150
138
|
* Remove the specified `items` from the set stored at `key`. Those items that are not part of the set are ignored.
|
|
151
139
|
*
|
|
152
|
-
* @
|
|
153
|
-
* @param
|
|
154
|
-
* @
|
|
155
|
-
* @returns {Promise<boolean | void>} A promise that resolves if the operation success. If key does not exist, the promise also resolves.
|
|
140
|
+
* @param key - Set key
|
|
141
|
+
* @param items - Items to remove
|
|
142
|
+
* @returns A promise that resolves if the operation success. If key does not exist, the promise also resolves.
|
|
156
143
|
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a set.
|
|
157
144
|
*/
|
|
158
145
|
removeItems: (key: string, items: string[]) => Promise<boolean | void>
|
|
159
146
|
/**
|
|
160
147
|
* Returns all the items of the `key` set.
|
|
161
148
|
*
|
|
162
|
-
* @
|
|
163
|
-
* @
|
|
164
|
-
* @returns {Promise<string[]>} A promise that resolves with the list of items. If key does not exist, the result is an empty list.
|
|
149
|
+
* @param key - Set key
|
|
150
|
+
* @returns A promise that resolves with the list of items. If key does not exist, the result is an empty list.
|
|
165
151
|
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a set.
|
|
166
152
|
*/
|
|
167
153
|
getItems: (key: string) => Promise<string[]>
|
|
@@ -173,8 +159,7 @@ export interface IPluggableStorageWrapper {
|
|
|
173
159
|
* It is meant for storages that requires to be connected to some database or server. Otherwise it can just return a resolved promise.
|
|
174
160
|
* Note: will be called once on SplitFactory instantiation and once per each shared client instantiation.
|
|
175
161
|
*
|
|
176
|
-
* @
|
|
177
|
-
* @returns {Promise<void>} A promise that resolves when the wrapper successfully connect to the underlying storage.
|
|
162
|
+
* @returns A promise that resolves when the wrapper successfully connect to the underlying storage.
|
|
178
163
|
* The promise rejects with the corresponding error if the wrapper fails to connect.
|
|
179
164
|
*/
|
|
180
165
|
connect: () => Promise<void>
|
|
@@ -183,8 +168,7 @@ export interface IPluggableStorageWrapper {
|
|
|
183
168
|
* It is meant for storages that requires to be closed, in order to release resources. Otherwise it can just return a resolved promise.
|
|
184
169
|
* Note: will be called once on SplitFactory main client destroy.
|
|
185
170
|
*
|
|
186
|
-
* @
|
|
187
|
-
* @returns {Promise<void>} A promise that resolves when the operation ends.
|
|
171
|
+
* @returns A promise that resolves when the operation ends.
|
|
188
172
|
* The promise never rejects.
|
|
189
173
|
*/
|
|
190
174
|
disconnect: () => Promise<void>
|
|
@@ -283,7 +267,7 @@ export interface ISegmentsCacheAsync extends ISegmentsCacheBase {
|
|
|
283
267
|
|
|
284
268
|
export interface IImpressionsCacheBase {
|
|
285
269
|
// Used by impressions tracker, in DEBUG and OPTIMIZED impression modes, to push impressions into the storage.
|
|
286
|
-
track(data: ImpressionDTO[]): MaybeThenable<void>
|
|
270
|
+
track(data: SplitIO.ImpressionDTO[]): MaybeThenable<void>
|
|
287
271
|
}
|
|
288
272
|
|
|
289
273
|
export interface IEventsCacheBase {
|
|
@@ -314,8 +298,8 @@ export interface IRecorderCacheSync<T> {
|
|
|
314
298
|
pop(toMerge?: T): T
|
|
315
299
|
}
|
|
316
300
|
|
|
317
|
-
export interface IImpressionsCacheSync extends IImpressionsCacheBase, IRecorderCacheSync<ImpressionDTO[]> {
|
|
318
|
-
track(data: ImpressionDTO[]): void
|
|
301
|
+
export interface IImpressionsCacheSync extends IImpressionsCacheBase, IRecorderCacheSync<SplitIO.ImpressionDTO[]> {
|
|
302
|
+
track(data: SplitIO.ImpressionDTO[]): void
|
|
319
303
|
/* Registers callback for full queue */
|
|
320
304
|
setOnFullQueueCb(cb: () => void): void
|
|
321
305
|
}
|
|
@@ -348,7 +332,7 @@ export interface IRecorderCacheAsync<T> {
|
|
|
348
332
|
export interface IImpressionsCacheAsync extends IImpressionsCacheBase, IRecorderCacheAsync<StoredImpressionWithMetadata[]> {
|
|
349
333
|
// Consumer API method, used by impressions tracker (in standalone and consumer modes) to push data into.
|
|
350
334
|
// The result promise can reject.
|
|
351
|
-
track(data: ImpressionDTO[]): Promise<void>
|
|
335
|
+
track(data: SplitIO.ImpressionDTO[]): Promise<void>
|
|
352
336
|
}
|
|
353
337
|
|
|
354
338
|
export interface IEventsCacheAsync extends IEventsCacheBase, IRecorderCacheAsync<StoredEventWithMetadata[]> {
|
|
@@ -499,14 +483,13 @@ export interface IStorageFactoryParams {
|
|
|
499
483
|
onReadyCb: (error?: any) => void,
|
|
500
484
|
}
|
|
501
485
|
|
|
502
|
-
export type StorageType = 'MEMORY' | 'LOCALSTORAGE' | 'REDIS' | 'PLUGGABLE';
|
|
503
486
|
|
|
504
|
-
export type IStorageSyncFactory = {
|
|
505
|
-
readonly type: StorageType,
|
|
487
|
+
export type IStorageSyncFactory = SplitIO.StorageSyncFactory & {
|
|
488
|
+
readonly type: SplitIO.StorageType,
|
|
506
489
|
(params: IStorageFactoryParams): IStorageSync
|
|
507
490
|
}
|
|
508
491
|
|
|
509
|
-
export type IStorageAsyncFactory = {
|
|
510
|
-
type: StorageType,
|
|
492
|
+
export type IStorageAsyncFactory = SplitIO.StorageAsyncFactory & {
|
|
493
|
+
readonly type: SplitIO.StorageType,
|
|
511
494
|
(params: IStorageFactoryParams): IStorageAsync
|
|
512
495
|
}
|
package/src/storages/utils.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { IMetadata } from '../dtos/types';
|
|
4
4
|
import { Method, StoredImpressionWithMetadata } from '../sync/submitters/types';
|
|
5
|
-
import {
|
|
5
|
+
import { ISettings } from '../types';
|
|
6
|
+
import SplitIO from '../../types/splitio';
|
|
6
7
|
import { UNKNOWN } from '../utils/constants';
|
|
7
8
|
import { MAX_LATENCY_BUCKET_COUNT } from './inMemory/TelemetryCacheInMemory';
|
|
8
9
|
import { METHOD_NAMES } from './KeyBuilderSS';
|
|
@@ -16,7 +17,7 @@ export function metadataBuilder(settings: Pick<ISettings, 'version' | 'runtime'>
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
// Converts impressions to be stored in Redis or pluggable storage.
|
|
19
|
-
export function impressionsToJSON(impressions: ImpressionDTO[], metadata: IMetadata): string[] {
|
|
20
|
+
export function impressionsToJSON(impressions: SplitIO.ImpressionDTO[], metadata: IMetadata): string[] {
|
|
20
21
|
return impressions.map(impression => {
|
|
21
22
|
const impressionWithMetadata: StoredImpressionWithMetadata = {
|
|
22
23
|
m: metadata,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ISplitPartial } from '../../../dtos/types';
|
|
2
|
-
import
|
|
2
|
+
import SplitIO from '../../../../types/splitio';
|
|
3
3
|
import { isObject, forOwn, merge } from '../../../utils/lang';
|
|
4
4
|
import { parseCondition } from './parseCondition';
|
|
5
5
|
|
|
@@ -39,9 +39,9 @@ export function splitsParserFromSettingsFactory() {
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
|
-
* @param settings validated object with mocked features mapping.
|
|
42
|
+
* @param settings - validated object with mocked features mapping.
|
|
43
43
|
*/
|
|
44
|
-
return function splitsParserFromSettings(settings: Pick<ISettings, 'features'>): false | Record<string, ISplitPartial> {
|
|
44
|
+
return function splitsParserFromSettings(settings: Pick<SplitIO.ISettings, 'features'>): false | Record<string, ISplitPartial> {
|
|
45
45
|
const features = settings.features as SplitIO.MockedFeaturesMap || {};
|
|
46
46
|
|
|
47
47
|
if (!mockUpdated(features)) return false;
|
|
@@ -14,7 +14,7 @@ function flush() {
|
|
|
14
14
|
* Offline SyncManager factory.
|
|
15
15
|
* Can be used for server-side API, and client-side API with or without multiple clients.
|
|
16
16
|
*
|
|
17
|
-
* @param splitsParser e.g., `splitsParserFromFile`, `splitsParserFromSettings`.
|
|
17
|
+
* @param splitsParser - e.g., `splitsParserFromFile`, `splitsParserFromSettings`.
|
|
18
18
|
*/
|
|
19
19
|
export function syncManagerOfflineFactory(
|
|
20
20
|
splitsParserFactory: () => ISplitsParser
|
|
@@ -87,12 +87,12 @@ export function mySegmentsUpdaterFactory(
|
|
|
87
87
|
* MySegments updater returns a promise that resolves with a `false` boolean value if it fails to fetch mySegments or synchronize them with the storage.
|
|
88
88
|
* Returned promise will not be rejected.
|
|
89
89
|
*
|
|
90
|
-
* @param
|
|
90
|
+
* @param segmentsData - it can be:
|
|
91
91
|
* (1) the list of mySegments names to sync in the storage,
|
|
92
92
|
* (2) an object with a segment name and action (true: add, or false: delete) to update the storage,
|
|
93
93
|
* (3) or `undefined`, for which the updater will fetch mySegments in order to sync the storage.
|
|
94
|
-
* @param
|
|
95
|
-
* @param
|
|
94
|
+
* @param noCache - true to revalidate data to fetch
|
|
95
|
+
* @param till - query param to bypass CDN requests
|
|
96
96
|
*/
|
|
97
97
|
return function mySegmentsUpdater(segmentsData?: MySegmentsData, noCache?: boolean, till?: number) {
|
|
98
98
|
return _mySegmentsUpdater(0, segmentsData, noCache, till);
|
|
@@ -13,10 +13,10 @@ type ISegmentChangesUpdater = (fetchOnlyNew?: boolean, segmentName?: string, noC
|
|
|
13
13
|
* - updates `segmentsCache`
|
|
14
14
|
* - uses `segmentsEventEmitter` to emit events related to segments data updates
|
|
15
15
|
*
|
|
16
|
-
* @param log logger instance
|
|
17
|
-
* @param segmentChangesFetcher fetcher of `/segmentChanges`
|
|
18
|
-
* @param segments segments storage, with sync or async methods
|
|
19
|
-
* @param readiness optional readiness manager. Not required for synchronizer or producer mode.
|
|
16
|
+
* @param log - logger instance
|
|
17
|
+
* @param segmentChangesFetcher - fetcher of `/segmentChanges`
|
|
18
|
+
* @param segments - segments storage, with sync or async methods
|
|
19
|
+
* @param readiness - optional readiness manager. Not required for synchronizer or producer mode.
|
|
20
20
|
*/
|
|
21
21
|
export function segmentChangesUpdaterFactory(
|
|
22
22
|
log: ILogger,
|
|
@@ -50,11 +50,11 @@ export function segmentChangesUpdaterFactory(
|
|
|
50
50
|
* Thus, a false result doesn't imply that SDK_SEGMENTS_ARRIVED was not emitted.
|
|
51
51
|
* Returned promise will not be rejected.
|
|
52
52
|
*
|
|
53
|
-
* @param
|
|
53
|
+
* @param fetchOnlyNew - if true, only fetch the segments that not exists, i.e., which `changeNumber` is equal to -1.
|
|
54
54
|
* This param is used by SplitUpdateWorker on server-side SDK, to fetch new registered segments on SPLIT_UPDATE notifications.
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
55
|
+
* @param segmentName - segment name to fetch. By passing `undefined` it fetches the list of segments registered at the storage
|
|
56
|
+
* @param noCache - true to revalidate data to fetch on a SEGMENT_UPDATE notifications.
|
|
57
|
+
* @param till - till target for the provided segmentName, for CDN bypass.
|
|
58
58
|
*/
|
|
59
59
|
return function segmentChangesUpdater(fetchOnlyNew?: boolean, segmentName?: string, noCache?: boolean, till?: number) {
|
|
60
60
|
log.debug(`${LOG_PREFIX_SYNC_SEGMENTS}Started segments update`);
|