@splitsoftware/splitio-commons 1.0.1-rc.4 → 1.1.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.txt +13 -3
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/cjs/evaluator/Engine.js +6 -5
- package/cjs/evaluator/combiners/and.js +4 -4
- package/cjs/evaluator/combiners/ifelseif.js +4 -3
- package/cjs/evaluator/condition/index.js +4 -3
- package/cjs/evaluator/index.js +10 -11
- package/cjs/evaluator/matchers/all.js +2 -1
- package/cjs/evaluator/matchers/between.js +2 -1
- package/cjs/evaluator/matchers/boolean.js +2 -1
- package/cjs/evaluator/matchers/cont_all.js +3 -2
- package/cjs/evaluator/matchers/cont_any.js +3 -2
- package/cjs/evaluator/matchers/cont_str.js +2 -1
- package/cjs/evaluator/matchers/dependency.js +4 -4
- package/cjs/evaluator/matchers/eq.js +2 -1
- package/cjs/evaluator/matchers/eq_set.js +2 -1
- package/cjs/evaluator/matchers/ew.js +2 -1
- package/cjs/evaluator/matchers/gte.js +2 -1
- package/cjs/evaluator/matchers/index.js +36 -36
- package/cjs/evaluator/matchers/lte.js +2 -1
- package/cjs/evaluator/matchers/part_of.js +3 -2
- package/cjs/evaluator/matchers/segment.js +5 -5
- package/cjs/evaluator/matchers/string.js +2 -1
- package/cjs/evaluator/matchers/sw.js +2 -1
- package/cjs/evaluator/matchers/whitelist.js +2 -1
- package/cjs/evaluator/matchersTransform/index.js +12 -12
- package/cjs/evaluator/matchersTransform/segment.js +3 -2
- package/cjs/evaluator/matchersTransform/set.js +3 -2
- package/cjs/evaluator/matchersTransform/unaryNumeric.js +3 -2
- package/cjs/evaluator/matchersTransform/whitelist.js +3 -2
- package/cjs/evaluator/parser/index.js +16 -16
- package/cjs/evaluator/treatments/index.js +2 -1
- package/cjs/evaluator/value/index.js +5 -5
- package/cjs/evaluator/value/sanitize.js +2 -1
- package/cjs/integrations/browser.js +4 -4
- package/cjs/integrations/ga/GaToSplit.js +3 -4
- package/cjs/integrations/pluggable.js +3 -2
- package/cjs/listeners/browser.js +4 -4
- package/cjs/listeners/node.js +4 -4
- package/cjs/logger/index.js +2 -3
- package/cjs/logger/messages/info.js +1 -1
- package/cjs/logger/messages/warn.js +2 -2
- package/cjs/readiness/readinessManager.js +3 -4
- package/cjs/readiness/sdkReadinessManager.js +7 -7
- package/cjs/sdkClient/client.js +5 -5
- package/cjs/sdkClient/clientAttributesDecoration.js +108 -0
- package/cjs/sdkClient/clientCS.js +12 -10
- package/cjs/sdkClient/clientInputValidation.js +5 -5
- package/cjs/sdkClient/sdkClient.js +5 -6
- package/cjs/sdkClient/sdkClientMethodCS.js +4 -5
- package/cjs/sdkClient/sdkClientMethodCSWithTT.js +4 -5
- package/cjs/sdkFactory/index.js +9 -10
- package/cjs/sdkManager/index.js +6 -7
- package/cjs/services/splitApi.js +2 -3
- package/cjs/services/splitHttpClient.js +3 -4
- package/cjs/storages/AbstractSegmentsCacheSync.js +2 -1
- package/cjs/storages/AbstractSplitsCacheAsync.js +2 -1
- package/cjs/storages/AbstractSplitsCacheSync.js +2 -2
- package/cjs/storages/KeyBuilder.js +2 -2
- package/cjs/storages/KeyBuilderCS.js +4 -3
- package/cjs/storages/KeyBuilderSS.js +4 -3
- package/cjs/storages/findLatencyIndex.js +2 -1
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +4 -3
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +4 -3
- package/cjs/storages/inLocalStorage/index.js +20 -21
- package/cjs/storages/inMemory/AttributesCacheInMemory.js +70 -0
- package/cjs/storages/inMemory/CountsCacheInMemory.js +2 -1
- package/cjs/storages/inMemory/EventsCacheInMemory.js +2 -1
- package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +2 -1
- package/cjs/storages/inMemory/ImpressionsCacheInMemory.js +2 -1
- package/cjs/storages/inMemory/InMemoryStorage.js +10 -11
- package/cjs/storages/inMemory/InMemoryStorageCS.js +12 -13
- package/cjs/storages/inMemory/LatenciesCacheInMemory.js +4 -4
- package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +4 -3
- package/cjs/storages/inMemory/SegmentsCacheInMemory.js +4 -3
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +4 -3
- package/cjs/storages/inRedis/CountsCacheInRedis.js +2 -1
- package/cjs/storages/inRedis/EventsCacheInRedis.js +2 -1
- package/cjs/storages/inRedis/ImpressionsCacheInRedis.js +2 -1
- package/cjs/storages/inRedis/LatenciesCacheInRedis.js +4 -4
- package/cjs/storages/inRedis/RedisAdapter.js +6 -5
- package/cjs/storages/inRedis/SegmentsCacheInRedis.js +2 -1
- package/cjs/storages/inRedis/SplitsCacheInRedis.js +4 -3
- package/cjs/storages/inRedis/index.js +16 -17
- package/cjs/storages/pluggable/SplitsCachePluggable.js +2 -2
- package/cjs/storages/pluggable/index.js +8 -8
- package/cjs/sync/offline/splitsParser/parseCondition.js +2 -1
- package/cjs/sync/offline/splitsParser/splitsParserFromFile.js +3 -3
- package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +2 -3
- package/cjs/sync/offline/syncManagerOffline.js +3 -4
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +4 -5
- package/cjs/sync/polling/fetchers/mySegmentsFetcher.js +2 -1
- package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +2 -1
- package/cjs/sync/polling/fetchers/splitChangesFetcher.js +2 -1
- package/cjs/sync/polling/pollingManagerCS.js +6 -6
- package/cjs/sync/polling/pollingManagerSS.js +8 -8
- package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +5 -5
- package/cjs/sync/polling/syncTasks/segmentsSyncTask.js +5 -5
- package/cjs/sync/polling/syncTasks/splitsSyncTask.js +5 -5
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +2 -3
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +2 -3
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +8 -6
- package/cjs/sync/streaming/AuthClient/index.js +2 -3
- package/cjs/sync/streaming/SSEClient/index.js +2 -1
- package/cjs/sync/streaming/SSEHandler/NotificationKeeper.js +2 -1
- package/cjs/sync/streaming/SSEHandler/index.js +4 -4
- package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +4 -4
- package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +4 -4
- package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +4 -4
- package/cjs/sync/streaming/pushManager.js +18 -17
- package/cjs/sync/submitters/submitterSyncTask.js +2 -3
- package/cjs/sync/syncTask.js +2 -1
- package/cjs/trackers/eventTracker.js +7 -7
- package/cjs/trackers/impressionObserver/ImpressionObserver.js +4 -4
- package/cjs/trackers/impressionObserver/impressionObserverCS.js +2 -3
- package/cjs/trackers/impressionObserver/impressionObserverSS.js +2 -3
- package/cjs/trackers/impressionsTracker.js +6 -6
- package/cjs/utils/Backoff.js +2 -1
- package/cjs/utils/LRUCache/index.js +2 -1
- package/cjs/utils/MinEventEmitter.js +2 -1
- package/cjs/utils/MinEvents.js +13 -15
- package/cjs/utils/inputValidation/attribute.js +20 -0
- package/cjs/utils/inputValidation/attributes.js +13 -1
- package/cjs/utils/inputValidation/trafficTypeExistance.js +2 -3
- package/cjs/utils/lang/binarySearch.js +2 -1
- package/cjs/utils/lang/objectAssign.js +85 -0
- package/cjs/utils/promise/thenable.js +5 -1
- package/cjs/utils/promise/timeout.js +2 -1
- package/cjs/utils/promise/wrapper.js +2 -1
- package/cjs/utils/settingsValidation/impressionsMode.js +2 -1
- package/cjs/utils/settingsValidation/index.js +5 -6
- package/cjs/utils/settingsValidation/mode.js +2 -1
- package/cjs/utils/timeTracker/index.js +7 -8
- package/cjs/utils/timeTracker/now/browser.js +2 -2
- package/cjs/utils/timeTracker/now/node.js +2 -1
- package/cjs/utils/timeTracker/timer.js +3 -2
- package/esm/evaluator/Engine.js +3 -3
- package/esm/evaluator/combiners/and.js +2 -2
- package/esm/evaluator/combiners/ifelseif.js +2 -2
- package/esm/evaluator/condition/index.js +2 -2
- package/esm/evaluator/index.js +5 -6
- package/esm/evaluator/matchers/all.js +1 -1
- package/esm/evaluator/matchers/between.js +1 -1
- package/esm/evaluator/matchers/boolean.js +1 -1
- package/esm/evaluator/matchers/cont_all.js +1 -1
- package/esm/evaluator/matchers/cont_any.js +1 -1
- package/esm/evaluator/matchers/cont_str.js +1 -1
- package/esm/evaluator/matchers/dependency.js +2 -2
- package/esm/evaluator/matchers/eq.js +1 -1
- package/esm/evaluator/matchers/eq_set.js +1 -1
- package/esm/evaluator/matchers/ew.js +1 -1
- package/esm/evaluator/matchers/gte.js +1 -1
- package/esm/evaluator/matchers/index.js +35 -35
- package/esm/evaluator/matchers/lte.js +1 -1
- package/esm/evaluator/matchers/part_of.js +1 -1
- package/esm/evaluator/matchers/segment.js +2 -2
- package/esm/evaluator/matchers/string.js +1 -1
- package/esm/evaluator/matchers/sw.js +1 -1
- package/esm/evaluator/matchers/whitelist.js +1 -1
- package/esm/evaluator/matchersTransform/index.js +5 -5
- package/esm/evaluator/matchersTransform/segment.js +1 -1
- package/esm/evaluator/matchersTransform/set.js +1 -1
- package/esm/evaluator/matchersTransform/unaryNumeric.js +1 -1
- package/esm/evaluator/matchersTransform/whitelist.js +1 -1
- package/esm/evaluator/parser/index.js +11 -11
- package/esm/evaluator/treatments/index.js +1 -1
- package/esm/evaluator/value/index.js +3 -3
- package/esm/evaluator/value/sanitize.js +1 -1
- package/esm/integrations/browser.js +2 -2
- package/esm/integrations/ga/GaToSplit.js +1 -1
- package/esm/integrations/pluggable.js +1 -1
- package/esm/listeners/browser.js +2 -2
- package/esm/listeners/node.js +2 -2
- package/esm/logger/index.js +1 -1
- package/esm/logger/messages/info.js +1 -1
- package/esm/logger/messages/warn.js +2 -2
- package/esm/readiness/readinessManager.js +1 -1
- package/esm/readiness/sdkReadinessManager.js +3 -3
- package/esm/sdkClient/client.js +2 -2
- package/esm/sdkClient/clientAttributesDecoration.js +104 -0
- package/esm/sdkClient/clientCS.js +10 -8
- package/esm/sdkClient/clientInputValidation.js +2 -2
- package/esm/sdkClient/sdkClient.js +3 -3
- package/esm/sdkClient/sdkClientMethodCS.js +4 -4
- package/esm/sdkClient/sdkClientMethodCSWithTT.js +4 -4
- package/esm/sdkFactory/index.js +6 -6
- package/esm/sdkManager/index.js +2 -2
- package/esm/services/splitApi.js +1 -1
- package/esm/services/splitHttpClient.js +1 -1
- package/esm/storages/AbstractSegmentsCacheSync.js +1 -1
- package/esm/storages/AbstractSplitsCacheAsync.js +1 -1
- package/esm/storages/AbstractSplitsCacheSync.js +1 -1
- package/esm/storages/KeyBuilder.js +1 -1
- package/esm/storages/KeyBuilderCS.js +2 -2
- package/esm/storages/KeyBuilderSS.js +2 -2
- package/esm/storages/findLatencyIndex.js +1 -1
- package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +2 -2
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +2 -2
- package/esm/storages/inLocalStorage/index.js +8 -8
- package/esm/storages/inMemory/AttributesCacheInMemory.js +67 -0
- package/esm/storages/inMemory/CountsCacheInMemory.js +1 -1
- package/esm/storages/inMemory/EventsCacheInMemory.js +1 -1
- package/esm/storages/inMemory/ImpressionCountsCacheInMemory.js +1 -1
- package/esm/storages/inMemory/ImpressionsCacheInMemory.js +1 -1
- package/esm/storages/inMemory/InMemoryStorage.js +5 -5
- package/esm/storages/inMemory/InMemoryStorageCS.js +5 -5
- package/esm/storages/inMemory/LatenciesCacheInMemory.js +2 -2
- package/esm/storages/inMemory/MySegmentsCacheInMemory.js +2 -2
- package/esm/storages/inMemory/SegmentsCacheInMemory.js +2 -2
- package/esm/storages/inMemory/SplitsCacheInMemory.js +2 -2
- package/esm/storages/inRedis/CountsCacheInRedis.js +1 -1
- package/esm/storages/inRedis/EventsCacheInRedis.js +1 -1
- package/esm/storages/inRedis/ImpressionsCacheInRedis.js +1 -1
- package/esm/storages/inRedis/LatenciesCacheInRedis.js +2 -2
- package/esm/storages/inRedis/RedisAdapter.js +3 -3
- package/esm/storages/inRedis/SegmentsCacheInRedis.js +1 -1
- package/esm/storages/inRedis/SplitsCacheInRedis.js +2 -2
- package/esm/storages/inRedis/index.js +8 -8
- package/esm/storages/pluggable/SplitsCachePluggable.js +1 -1
- package/esm/storages/pluggable/index.js +4 -4
- package/esm/sync/offline/splitsParser/parseCondition.js +1 -1
- package/esm/sync/offline/splitsParser/splitsParserFromFile.js +1 -1
- package/esm/sync/offline/splitsParser/splitsParserFromSettings.js +1 -1
- package/esm/sync/offline/syncManagerOffline.js +2 -2
- package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +2 -2
- package/esm/sync/polling/fetchers/mySegmentsFetcher.js +1 -1
- package/esm/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
- package/esm/sync/polling/fetchers/splitChangesFetcher.js +1 -1
- package/esm/sync/polling/pollingManagerCS.js +3 -3
- package/esm/sync/polling/pollingManagerSS.js +4 -4
- package/esm/sync/polling/syncTasks/mySegmentsSyncTask.js +3 -3
- package/esm/sync/polling/syncTasks/segmentsSyncTask.js +3 -3
- package/esm/sync/polling/syncTasks/splitsSyncTask.js +3 -3
- package/esm/sync/polling/updaters/mySegmentsUpdater.js +1 -1
- package/esm/sync/polling/updaters/segmentChangesUpdater.js +1 -1
- package/esm/sync/polling/updaters/splitChangesUpdater.js +7 -4
- package/esm/sync/streaming/AuthClient/index.js +1 -1
- package/esm/sync/streaming/SSEClient/index.js +1 -1
- package/esm/sync/streaming/SSEHandler/NotificationKeeper.js +1 -1
- package/esm/sync/streaming/SSEHandler/index.js +2 -2
- package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +2 -2
- package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -2
- package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +2 -2
- package/esm/sync/streaming/pushManager.js +10 -9
- package/esm/sync/submitters/submitterSyncTask.js +1 -1
- package/esm/sync/syncTask.js +1 -1
- package/esm/trackers/eventTracker.js +3 -3
- package/esm/trackers/impressionObserver/ImpressionObserver.js +2 -2
- package/esm/trackers/impressionObserver/impressionObserverCS.js +1 -1
- package/esm/trackers/impressionObserver/impressionObserverSS.js +1 -1
- package/esm/trackers/impressionsTracker.js +3 -3
- package/esm/utils/Backoff.js +1 -1
- package/esm/utils/LRUCache/index.js +1 -1
- package/esm/utils/MinEventEmitter.js +1 -1
- package/esm/utils/MinEvents.js +2 -5
- package/esm/utils/inputValidation/attribute.js +16 -0
- package/esm/utils/inputValidation/attributes.js +11 -0
- package/esm/utils/inputValidation/trafficTypeExistance.js +1 -1
- package/esm/utils/lang/binarySearch.js +1 -1
- package/esm/utils/lang/objectAssign.js +82 -0
- package/esm/utils/promise/thenable.js +3 -1
- package/esm/utils/promise/timeout.js +1 -1
- package/esm/utils/promise/wrapper.js +1 -1
- package/esm/utils/settingsValidation/impressionsMode.js +1 -1
- package/esm/utils/settingsValidation/index.js +3 -3
- package/esm/utils/settingsValidation/mode.js +1 -1
- package/esm/utils/timeTracker/index.js +4 -5
- package/esm/utils/timeTracker/now/browser.js +1 -2
- package/esm/utils/timeTracker/now/node.js +1 -1
- package/esm/utils/timeTracker/timer.js +1 -1
- package/package.json +2 -3
- package/src/evaluator/Engine.ts +3 -3
- package/src/evaluator/combiners/and.ts +2 -2
- package/src/evaluator/combiners/ifelseif.ts +2 -2
- package/src/evaluator/condition/index.ts +2 -2
- package/src/evaluator/index.ts +5 -6
- package/src/evaluator/matchers/all.ts +1 -1
- package/src/evaluator/matchers/between.ts +1 -1
- package/src/evaluator/matchers/boolean.ts +1 -1
- package/src/evaluator/matchers/cont_all.ts +1 -1
- package/src/evaluator/matchers/cont_any.ts +1 -1
- package/src/evaluator/matchers/cont_str.ts +1 -1
- package/src/evaluator/matchers/dependency.ts +2 -2
- package/src/evaluator/matchers/eq.ts +1 -1
- package/src/evaluator/matchers/eq_set.ts +1 -1
- package/src/evaluator/matchers/ew.ts +1 -1
- package/src/evaluator/matchers/gte.ts +1 -1
- package/src/evaluator/matchers/index.ts +35 -35
- package/src/evaluator/matchers/lte.ts +1 -1
- package/src/evaluator/matchers/part_of.ts +1 -1
- package/src/evaluator/matchers/segment.ts +2 -2
- package/src/evaluator/matchers/string.ts +1 -1
- package/src/evaluator/matchers/sw.ts +1 -1
- package/src/evaluator/matchers/whitelist.ts +1 -1
- package/src/evaluator/matchersTransform/index.ts +5 -5
- package/src/evaluator/matchersTransform/segment.ts +1 -1
- package/src/evaluator/matchersTransform/set.ts +1 -1
- package/src/evaluator/matchersTransform/unaryNumeric.ts +1 -1
- package/src/evaluator/matchersTransform/whitelist.ts +1 -1
- package/src/evaluator/parser/index.ts +12 -12
- package/src/evaluator/treatments/index.ts +1 -1
- package/src/evaluator/value/index.ts +3 -3
- package/src/evaluator/value/sanitize.ts +1 -1
- package/src/integrations/browser.ts +2 -2
- package/src/integrations/ga/GaToSplit.ts +1 -1
- package/src/integrations/pluggable.ts +1 -1
- package/src/listeners/browser.ts +2 -2
- package/src/listeners/node.ts +2 -2
- package/src/logger/index.ts +1 -1
- package/src/logger/messages/info.ts +1 -1
- package/src/logger/messages/warn.ts +2 -2
- package/src/readiness/readinessManager.ts +2 -2
- package/src/readiness/sdkReadinessManager.ts +3 -3
- package/src/sdkClient/client.ts +2 -2
- package/src/sdkClient/clientAttributesDecoration.ts +122 -0
- package/src/sdkClient/clientCS.ts +13 -8
- package/src/sdkClient/clientInputValidation.ts +2 -2
- package/src/sdkClient/sdkClient.ts +3 -3
- package/src/sdkClient/sdkClientMethodCS.ts +4 -2
- package/src/sdkClient/sdkClientMethodCSWithTT.ts +4 -2
- package/src/sdkFactory/index.ts +6 -6
- package/src/sdkManager/index.ts +2 -2
- package/src/services/splitApi.ts +1 -1
- package/src/services/splitHttpClient.ts +1 -1
- package/src/storages/AbstractSegmentsCacheSync.ts +1 -1
- package/src/storages/AbstractSplitsCacheAsync.ts +1 -1
- package/src/storages/AbstractSplitsCacheSync.ts +1 -1
- package/src/storages/KeyBuilder.ts +1 -1
- package/src/storages/KeyBuilderCS.ts +2 -2
- package/src/storages/KeyBuilderSS.ts +2 -2
- package/src/storages/findLatencyIndex.ts +1 -1
- package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +3 -3
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +3 -3
- package/src/storages/inLocalStorage/index.ts +8 -8
- package/src/storages/inMemory/AttributesCacheInMemory.ts +73 -0
- package/src/storages/inMemory/CountsCacheInMemory.ts +1 -1
- package/src/storages/inMemory/EventsCacheInMemory.ts +1 -1
- package/src/storages/inMemory/ImpressionCountsCacheInMemory.ts +1 -1
- package/src/storages/inMemory/ImpressionsCacheInMemory.ts +1 -1
- package/src/storages/inMemory/InMemoryStorage.ts +5 -5
- package/src/storages/inMemory/InMemoryStorageCS.ts +5 -5
- package/src/storages/inMemory/LatenciesCacheInMemory.ts +2 -2
- package/src/storages/inMemory/MySegmentsCacheInMemory.ts +2 -2
- package/src/storages/inMemory/SegmentsCacheInMemory.ts +2 -2
- package/src/storages/inMemory/SplitsCacheInMemory.ts +2 -2
- package/src/storages/inRedis/CountsCacheInRedis.ts +2 -2
- package/src/storages/inRedis/EventsCacheInRedis.ts +1 -1
- package/src/storages/inRedis/ImpressionsCacheInRedis.ts +1 -1
- package/src/storages/inRedis/LatenciesCacheInRedis.ts +3 -3
- package/src/storages/inRedis/RedisAdapter.ts +3 -3
- package/src/storages/inRedis/SegmentsCacheInRedis.ts +2 -2
- package/src/storages/inRedis/SplitsCacheInRedis.ts +3 -3
- package/src/storages/inRedis/index.ts +8 -8
- package/src/storages/pluggable/SegmentsCachePluggable.ts +1 -1
- package/src/storages/pluggable/SplitsCachePluggable.ts +2 -2
- package/src/storages/pluggable/index.ts +4 -4
- package/src/storages/types.ts +2 -2
- package/src/sync/offline/splitsParser/parseCondition.ts +1 -1
- package/src/sync/offline/splitsParser/splitsParserFromFile.ts +1 -1
- package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +1 -1
- package/src/sync/offline/syncManagerOffline.ts +2 -2
- package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +2 -2
- package/src/sync/polling/fetchers/mySegmentsFetcher.ts +1 -1
- package/src/sync/polling/fetchers/segmentChangesFetcher.ts +1 -1
- package/src/sync/polling/fetchers/splitChangesFetcher.ts +1 -1
- package/src/sync/polling/pollingManagerCS.ts +3 -3
- package/src/sync/polling/pollingManagerSS.ts +4 -4
- package/src/sync/polling/syncTasks/mySegmentsSyncTask.ts +3 -3
- package/src/sync/polling/syncTasks/segmentsSyncTask.ts +3 -3
- package/src/sync/polling/syncTasks/splitsSyncTask.ts +3 -3
- package/src/sync/polling/updaters/mySegmentsUpdater.ts +1 -1
- package/src/sync/polling/updaters/segmentChangesUpdater.ts +1 -1
- package/src/sync/polling/updaters/splitChangesUpdater.ts +6 -3
- package/src/sync/streaming/AuthClient/index.ts +1 -1
- package/src/sync/streaming/SSEClient/index.ts +1 -1
- package/src/sync/streaming/SSEHandler/NotificationKeeper.ts +1 -1
- package/src/sync/streaming/SSEHandler/index.ts +2 -2
- package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +2 -2
- package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +2 -2
- package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +2 -2
- package/src/sync/streaming/UpdateWorkers/types.ts +1 -1
- package/src/sync/streaming/pushManager.ts +10 -9
- package/src/sync/submitters/submitterSyncTask.ts +1 -1
- package/src/sync/syncTask.ts +1 -1
- package/src/trackers/eventTracker.ts +3 -3
- package/src/trackers/impressionObserver/ImpressionObserver.ts +2 -2
- package/src/trackers/impressionObserver/impressionObserverCS.ts +1 -1
- package/src/trackers/impressionObserver/impressionObserverSS.ts +1 -1
- package/src/trackers/impressionsTracker.ts +3 -3
- package/src/types.ts +39 -0
- package/src/utils/Backoff.ts +1 -1
- package/src/utils/LRUCache/index.ts +1 -1
- package/src/utils/MinEventEmitter.ts +1 -1
- package/src/utils/MinEvents.ts +2 -7
- package/src/utils/inputValidation/attribute.ts +21 -0
- package/src/utils/inputValidation/attributes.ts +14 -0
- package/src/utils/inputValidation/trafficTypeExistance.ts +1 -1
- package/src/utils/lang/binarySearch.ts +1 -1
- package/src/utils/lang/objectAssign.ts +104 -0
- package/src/utils/promise/thenable.ts +3 -1
- package/src/utils/promise/timeout.ts +1 -1
- package/src/utils/promise/wrapper.ts +1 -1
- package/src/utils/settingsValidation/impressionsMode.ts +1 -1
- package/src/utils/settingsValidation/index.ts +3 -3
- package/src/utils/settingsValidation/mode.ts +1 -1
- package/src/utils/timeTracker/index.ts +4 -6
- package/src/utils/timeTracker/now/browser.ts +1 -3
- package/src/utils/timeTracker/now/node.ts +1 -1
- package/src/utils/timeTracker/timer.ts +1 -1
- package/types/evaluator/Engine.d.ts +1 -1
- package/types/evaluator/combiners/and.d.ts +1 -1
- package/types/evaluator/combiners/ifelseif.d.ts +1 -1
- package/types/evaluator/condition/index.d.ts +1 -1
- package/types/evaluator/matchers/all.d.ts +1 -1
- package/types/evaluator/matchers/between.d.ts +1 -1
- package/types/evaluator/matchers/boolean.d.ts +1 -1
- package/types/evaluator/matchers/cont_all.d.ts +1 -1
- package/types/evaluator/matchers/cont_any.d.ts +1 -1
- package/types/evaluator/matchers/cont_str.d.ts +1 -1
- package/types/evaluator/matchers/dependency.d.ts +1 -1
- package/types/evaluator/matchers/eq.d.ts +1 -1
- package/types/evaluator/matchers/eq_set.d.ts +1 -1
- package/types/evaluator/matchers/ew.d.ts +1 -1
- package/types/evaluator/matchers/gte.d.ts +1 -1
- package/types/evaluator/matchers/index.d.ts +1 -1
- package/types/evaluator/matchers/lte.d.ts +1 -1
- package/types/evaluator/matchers/part_of.d.ts +1 -1
- package/types/evaluator/matchers/segment.d.ts +1 -1
- package/types/evaluator/matchers/string.d.ts +1 -1
- package/types/evaluator/matchers/sw.d.ts +1 -1
- package/types/evaluator/matchers/whitelist.d.ts +1 -1
- package/types/evaluator/matchersTransform/index.d.ts +1 -1
- package/types/evaluator/matchersTransform/segment.d.ts +1 -1
- package/types/evaluator/matchersTransform/set.d.ts +1 -1
- package/types/evaluator/matchersTransform/unaryNumeric.d.ts +1 -1
- package/types/evaluator/matchersTransform/whitelist.d.ts +1 -1
- package/types/evaluator/parser/index.d.ts +1 -1
- package/types/evaluator/treatments/index.d.ts +1 -1
- package/types/evaluator/value/index.d.ts +1 -1
- package/types/evaluator/value/sanitize.d.ts +1 -1
- package/types/integrations/browser.d.ts +1 -1
- package/types/integrations/pluggable.d.ts +1 -1
- package/types/listeners/browser.d.ts +1 -1
- package/types/listeners/node.d.ts +1 -1
- package/types/logger/browser/{debugLogger.d.ts → DebugLogger.d.ts} +0 -0
- package/types/logger/browser/{errorLogger.d.ts → ErrorLogger.d.ts} +0 -0
- package/types/logger/browser/{infoLogger.d.ts → InfoLogger.d.ts} +0 -0
- package/types/logger/browser/{warnLogger.d.ts → WarnLogger.d.ts} +0 -0
- package/types/readiness/sdkReadinessManager.d.ts +1 -1
- package/types/sdkClient/client.d.ts +1 -1
- package/types/sdkClient/clientAttributesDecoration.d.ts +51 -0
- package/types/sdkClient/clientCS.d.ts +2 -1
- package/types/sdkClient/clientInputValidation.d.ts +1 -1
- package/types/storages/AbstractSegmentsCacheSync.d.ts +1 -1
- package/types/storages/AbstractSplitsCacheAsync.d.ts +1 -1
- package/types/storages/AbstractSplitsCacheSync.d.ts +1 -1
- package/types/storages/KeyBuilder.d.ts +1 -1
- package/types/storages/KeyBuilderCS.d.ts +2 -2
- package/types/storages/KeyBuilderSS.d.ts +2 -2
- package/types/storages/findLatencyIndex.d.ts +1 -1
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +3 -3
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +3 -3
- package/types/storages/inMemory/AttributesCacheInMemory.d.ts +43 -0
- package/types/storages/inMemory/CountsCacheInMemory.d.ts +1 -1
- package/types/storages/inMemory/EventsCacheInMemory.d.ts +1 -1
- package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +1 -1
- package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +1 -1
- package/types/storages/inMemory/LatenciesCacheInMemory.d.ts +1 -1
- package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +2 -2
- package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +2 -2
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +2 -2
- package/types/storages/inRedis/CountsCacheInRedis.d.ts +2 -2
- package/types/storages/inRedis/EventsCacheInRedis.d.ts +1 -1
- package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +1 -1
- package/types/storages/inRedis/LatenciesCacheInRedis.d.ts +2 -2
- package/types/storages/inRedis/RedisAdapter.d.ts +1 -1
- package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +2 -2
- package/types/storages/inRedis/SplitsCacheInRedis.d.ts +3 -3
- package/types/storages/pluggable/SegmentsCachePluggable.d.ts +1 -1
- package/types/storages/pluggable/SplitsCachePluggable.d.ts +2 -2
- package/types/storages/types.d.ts +2 -2
- package/types/sync/offline/splitsParser/parseCondition.d.ts +1 -1
- package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +1 -1
- package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +1 -1
- package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +1 -1
- package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +1 -1
- package/types/sync/polling/pollingManagerCS.d.ts +1 -1
- package/types/sync/polling/pollingManagerSS.d.ts +1 -1
- package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +1 -1
- package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +1 -1
- package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +1 -1
- package/types/sync/streaming/SSEClient/index.d.ts +1 -1
- package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +1 -1
- package/types/sync/streaming/SSEHandler/index.d.ts +1 -1
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +2 -2
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +2 -2
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +2 -2
- package/types/sync/streaming/UpdateWorkers/types.d.ts +1 -1
- package/types/sync/streaming/pushManager.d.ts +1 -1
- package/types/sync/syncTask.d.ts +1 -1
- package/types/trackers/eventTracker.d.ts +1 -1
- package/types/trackers/impressionObserver/ImpressionObserver.d.ts +1 -1
- package/types/trackers/impressionObserver/impressionObserverCS.d.ts +1 -1
- package/types/trackers/impressionObserver/impressionObserverSS.d.ts +1 -1
- package/types/trackers/impressionsTracker.d.ts +1 -1
- package/types/types.d.ts +39 -0
- package/types/utils/Backoff.d.ts +1 -1
- package/types/utils/LRUCache/index.d.ts +1 -1
- package/types/utils/MinEventEmitter.d.ts +1 -1
- package/types/utils/MinEvents.d.ts +3 -2
- package/types/utils/inputValidation/attribute.d.ts +2 -0
- package/types/utils/inputValidation/attributes.d.ts +1 -0
- package/types/utils/lang/binarySearch.d.ts +1 -1
- package/types/utils/lang/objectAssign.d.ts +3 -0
- package/types/utils/promise/thenable.d.ts +1 -2
- package/types/utils/promise/timeout.d.ts +1 -1
- package/types/utils/promise/wrapper.d.ts +1 -1
- package/types/utils/settingsValidation/impressionsMode.d.ts +1 -1
- package/types/utils/settingsValidation/mode.d.ts +1 -1
- package/types/utils/timeTracker/index.d.ts +2 -2
- package/types/utils/timeTracker/now/browser.d.ts +1 -2
- package/types/utils/timeTracker/now/node.d.ts +1 -1
- package/types/utils/timeTracker/timer.d.ts +1 -1
- package/src/logger/.DS_Store +0 -0
- package/types/integrations/ga/GaToSplitPlugin.d.ts +0 -3
- package/types/integrations/ga/SplitToGaPlugin.d.ts +0 -4
- package/types/logger/codes.d.ts +0 -2
- package/types/logger/codesConstants.d.ts +0 -117
- package/types/logger/codesConstantsBrowser.d.ts +0 -2
- package/types/logger/codesConstantsNode.d.ts +0 -14
- package/types/logger/codesDebug.d.ts +0 -1
- package/types/logger/codesDebugBrowser.d.ts +0 -1
- package/types/logger/codesDebugNode.d.ts +0 -1
- package/types/logger/codesError.d.ts +0 -1
- package/types/logger/codesErrorNode.d.ts +0 -1
- package/types/logger/codesInfo.d.ts +0 -1
- package/types/logger/codesWarn.d.ts +0 -1
- package/types/logger/codesWarnNode.d.ts +0 -1
- package/types/logger/debugLogger.d.ts +0 -2
- package/types/logger/errorLogger.d.ts +0 -2
- package/types/logger/infoLogger.d.ts +0 -2
- package/types/logger/messages/debugBrowser.d.ts +0 -1
- package/types/logger/messages/debugNode.d.ts +0 -1
- package/types/logger/messages/errorNode.d.ts +0 -1
- package/types/logger/messages/warnNode.d.ts +0 -1
- package/types/logger/noopLogger.d.ts +0 -2
- package/types/logger/warnLogger.d.ts +0 -2
- package/types/sdkManager/sdkManagerMethod.d.ts +0 -6
- package/types/storages/getRegisteredSegments.d.ts +0 -10
- package/types/sync/polling/syncTasks/splitsSyncTask.copy.d.ts +0 -35
- package/types/sync/polling/syncTasks/splitsSyncTask.morelikeoriginal.d.ts +0 -35
- package/types/sync/streaming/AuthClient/indexV1.d.ts +0 -12
- package/types/sync/streaming/AuthClient/indexV2.d.ts +0 -8
- package/types/sync/streaming/pushManagerCS.d.ts +0 -12
- package/types/sync/streaming/pushManagerNoUsers.d.ts +0 -13
- package/types/sync/streaming/pushManagerSS.d.ts +0 -11
- package/types/sync/syncManagerFromFile.d.ts +0 -2
- package/types/sync/syncManagerFromObject.d.ts +0 -2
- package/types/sync/syncManagerOffline.d.ts +0 -9
- package/types/utils/lang/errors.d.ts +0 -10
- package/types/utils/murmur3/commons.d.ts +0 -12
- package/types/utils/settingsValidation/buildMetadata.d.ts +0 -3
- package/types/utils/settingsValidation/localhost/index.d.ts +0 -9
- package/types/utils/settingsValidation/logger.d.ts +0 -11
|
@@ -6,4 +6,4 @@ import { ISettings } from '../../../types';
|
|
|
6
6
|
/**
|
|
7
7
|
* Creates a sync task that periodically executes a `segmentChangesUpdater` task
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare function segmentsSyncTaskFactory(fetchSegmentChanges: IFetchSegmentChanges, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings): ISegmentsSyncTask;
|
|
@@ -6,4 +6,4 @@ import { ISettings } from '../../../types';
|
|
|
6
6
|
/**
|
|
7
7
|
* Creates a sync task that periodically executes a `splitChangesUpdater` task
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare function splitsSyncTaskFactory(fetchSplitChanges: IFetchSplitChanges, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings): ISplitsSyncTask;
|
|
@@ -5,7 +5,7 @@ import { ISSEClient, ISseEventHandler } from './types';
|
|
|
5
5
|
/**
|
|
6
6
|
* Handles streaming connections with EventSource API
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare class SSEClient implements ISSEClient {
|
|
9
9
|
eventSource?: IEventSourceConstructor;
|
|
10
10
|
streamingUrl: string;
|
|
11
11
|
connection?: InstanceType<IEventSourceConstructor>;
|
|
@@ -5,7 +5,7 @@ import { IPushEventEmitter } from '../types';
|
|
|
5
5
|
*
|
|
6
6
|
* @param pushEmitter emitter for events related to streaming support
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare function notificationKeeperFactory(pushEmitter: IPushEventEmitter): {
|
|
9
9
|
handleOpen(): void;
|
|
10
10
|
isStreamingUp(): boolean;
|
|
11
11
|
handleOccupancyEvent(publishers: number, channel: string, timestamp: number): void;
|
|
@@ -7,4 +7,4 @@ import { ILogger } from '../../../logger/types';
|
|
|
7
7
|
* @param log factory logger
|
|
8
8
|
* @param pushEmitter emitter for events related to streaming support
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export declare function SSEHandlerFactory(log: ILogger, pushEmitter: IPushEventEmitter): ISseEventHandler;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ISegmentsSyncTask } from '../../polling/types';
|
|
2
|
-
import Backoff from '../../../utils/Backoff';
|
|
2
|
+
import { Backoff } from '../../../utils/Backoff';
|
|
3
3
|
import { IUpdateWorker } from './types';
|
|
4
4
|
import { SegmentsData } from '../SSEHandler/types';
|
|
5
5
|
/**
|
|
6
6
|
* MySegmentsUpdateWorker class
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare class MySegmentsUpdateWorker implements IUpdateWorker {
|
|
9
9
|
private readonly mySegmentsSyncTask;
|
|
10
10
|
private maxChangeNumber;
|
|
11
11
|
private handleNewEvent;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ISegmentsCacheSync } from '../../../storages/types';
|
|
2
|
-
import Backoff from '../../../utils/Backoff';
|
|
2
|
+
import { Backoff } from '../../../utils/Backoff';
|
|
3
3
|
import { ISegmentsSyncTask } from '../../polling/types';
|
|
4
4
|
import { ISegmentUpdateData } from '../SSEHandler/types';
|
|
5
5
|
import { IUpdateWorker } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* SegmentUpdateWorker class
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare class SegmentsUpdateWorker implements IUpdateWorker {
|
|
10
10
|
private readonly segmentsCache;
|
|
11
11
|
private readonly segmentsSyncTask;
|
|
12
12
|
private readonly maxChangeNumbers;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ISplitsEventEmitter } from '../../../readiness/types';
|
|
2
2
|
import { ISplitsCacheSync } from '../../../storages/types';
|
|
3
|
-
import Backoff from '../../../utils/Backoff';
|
|
3
|
+
import { Backoff } from '../../../utils/Backoff';
|
|
4
4
|
import { ISegmentsSyncTask, ISplitsSyncTask } from '../../polling/types';
|
|
5
5
|
import { ISplitKillData, ISplitUpdateData } from '../SSEHandler/types';
|
|
6
6
|
import { IUpdateWorker } from './types';
|
|
7
7
|
/**
|
|
8
8
|
* SplitsUpdateWorker class
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export declare class SplitsUpdateWorker implements IUpdateWorker {
|
|
11
11
|
private readonly splitsCache;
|
|
12
12
|
private readonly splitsSyncTask;
|
|
13
13
|
private readonly splitsEventEmitter;
|
|
@@ -10,4 +10,4 @@ import { IPlatform } from '../../sdkFactory/types';
|
|
|
10
10
|
* - for server-side if key is not provided in settings.
|
|
11
11
|
* - for client-side, with support for multiple clients, if key is provided in settings
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare function pushManagerFactory(pollingManager: IPollingManager, storage: IStorageSync, readiness: IReadinessManager, fetchAuth: IFetchAuth, platform: IPlatform, settings: ISettings): IPushManagerCS | undefined;
|
package/types/sync/syncTask.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ import { ISyncTask } from './types';
|
|
|
11
11
|
* @param taskName Optional task name for logging.
|
|
12
12
|
* @returns A sync task that wraps the given task.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export declare function syncTaskFactory<Input extends any[], Output = any>(log: ILogger, task: (...args: Input) => Promise<Output>, period: number, taskName?: string): ISyncTask<Input, Output>;
|
|
@@ -7,4 +7,4 @@ import { ILogger } from '../logger/types';
|
|
|
7
7
|
* @param eventsCache cache to save events
|
|
8
8
|
* @param integrationsManager optional event handler used for integrations
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export declare function eventTrackerFactory(log: ILogger, eventsCache: IEventsCacheBase, integrationsManager?: IEventsHandler): IEventTracker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ImpressionDTO } from '../../types';
|
|
2
2
|
import { IImpressionObserver } from './types';
|
|
3
|
-
export
|
|
3
|
+
export declare class ImpressionObserver<K extends string | number = string> implements IImpressionObserver {
|
|
4
4
|
private cache;
|
|
5
5
|
private hasher;
|
|
6
6
|
constructor(size: number, hasher: (impression: ImpressionDTO) => K);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ImpressionObserver from './ImpressionObserver';
|
|
1
|
+
import { ImpressionObserver } from './ImpressionObserver';
|
|
2
2
|
import { ImpressionDTO } from '../../types';
|
|
3
3
|
export declare function hashImpression32(impression: ImpressionDTO): number;
|
|
4
4
|
export declare function impressionObserverCSFactory(): ImpressionObserver<number>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ImpressionObserver from './ImpressionObserver';
|
|
1
|
+
import { ImpressionObserver } from './ImpressionObserver';
|
|
2
2
|
import { ImpressionDTO } from '../../types';
|
|
3
3
|
export declare function hashImpression128(impression: ImpressionDTO): string;
|
|
4
4
|
export declare function impressionObserverSSFactory(): ImpressionObserver<string>;
|
|
@@ -13,4 +13,4 @@ import { ILogger } from '../logger/types';
|
|
|
13
13
|
* @param observer optional impression observer. If provided, previous time (pt property) is included in impression instances
|
|
14
14
|
* @param countsCache optional cache to save impressions count. If provided, impressions will be deduped (OPTIMIZED mode)
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export declare function impressionsTrackerFactory(log: ILogger, impressionsCache: IImpressionsCacheBase, { runtime: { ip, hostname }, version }: Pick<ISettings, 'version' | 'runtime'>, impressionListener?: SplitIO.IImpressionListener, integrationsManager?: IImpressionsHandler, observer?: IImpressionObserver, countsCache?: IImpressionCountsCacheSync): IImpressionsTracker;
|
package/types/types.d.ts
CHANGED
|
@@ -1108,6 +1108,45 @@ export declare namespace SplitIO {
|
|
|
1108
1108
|
* @returns {boolean} Whether the event was added to the queue succesfully or not.
|
|
1109
1109
|
*/
|
|
1110
1110
|
track(...args: [trafficType: string, eventType: string, value?: number, properties?: Properties] | [eventType: string, value?: number, properties?: Properties]): boolean;
|
|
1111
|
+
/**
|
|
1112
|
+
* Add an attribute to client's in memory attributes storage
|
|
1113
|
+
* @function setAttribute
|
|
1114
|
+
* @param {string} attributeName Attrinute name
|
|
1115
|
+
* @param {string, number, boolean, list} attributeValue Attribute value
|
|
1116
|
+
* @returns {boolean} true if the attribute was stored and false otherways
|
|
1117
|
+
*/
|
|
1118
|
+
setAttribute(attributeName: string, attributeValue: Object): boolean;
|
|
1119
|
+
/**
|
|
1120
|
+
* Returns the attribute with the given key
|
|
1121
|
+
* @function getAttribute
|
|
1122
|
+
* @param {string} attributeName Attribute name
|
|
1123
|
+
* @returns {Object} Attribute with the given key
|
|
1124
|
+
*/
|
|
1125
|
+
getAttribute(attributeName: string): Object;
|
|
1126
|
+
/**
|
|
1127
|
+
* Add to client's in memory attributes storage the attributes in 'attributes'
|
|
1128
|
+
* @function setAttributes
|
|
1129
|
+
* @param {Object} attributes Object with attributes to store
|
|
1130
|
+
* @returns true if attributes were stored an false otherways
|
|
1131
|
+
*/
|
|
1132
|
+
setAttributes(attributes: Record<string, Object>): boolean;
|
|
1133
|
+
/**
|
|
1134
|
+
* Return all the attributes stored in client's in memory attributes storage
|
|
1135
|
+
* @function getAttributes
|
|
1136
|
+
* @returns {Object} returns all the stored attributes
|
|
1137
|
+
*/
|
|
1138
|
+
getAttributes(): Record<string, Object>;
|
|
1139
|
+
/**
|
|
1140
|
+
* Removes from client's in memory attributes storage the attribute with the given key
|
|
1141
|
+
* @function removeAttribute
|
|
1142
|
+
* @param {string} attributeName
|
|
1143
|
+
* @returns {boolean} true if attribute was removed and false otherways
|
|
1144
|
+
*/
|
|
1145
|
+
removeAttribute(attributeName: string): boolean;
|
|
1146
|
+
/**
|
|
1147
|
+
* Remove all the stored attributes in the client's in memory attribute storage
|
|
1148
|
+
*/
|
|
1149
|
+
clearAttributes(): boolean;
|
|
1111
1150
|
}
|
|
1112
1151
|
/**
|
|
1113
1152
|
* Representation of a manager instance with synchronous storage of the SDK.
|
package/types/utils/Backoff.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IEventEmitter } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export declare class EventEmitter implements IEventEmitter {
|
|
3
3
|
private listeners;
|
|
4
4
|
private registerListener;
|
|
5
5
|
addListener(type: string, listener: (...args: any[]) => void): this;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { SplitIO } from '../../types';
|
|
2
2
|
import { ILogger } from '../../logger/types';
|
|
3
3
|
export declare function validateAttributes(log: ILogger, maybeAttrs: any, method: string): SplitIO.Attributes | undefined | false;
|
|
4
|
+
export declare function validateAttributesDeep(log: ILogger, maybeAttributes: Record<string, Object>, method: string): boolean;
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* @returns integer number between 0 and `items.length`. This value is the index of the search value,
|
|
7
7
|
* if it is contained in the array, or the index at which the value should be inserted to keep the array ordered.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare function binarySearch(items: number[], value: number): number;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare type ObjectAssign = (<T, U>(target: T, source: U) => T & U) & (<T, U, V>(target: T, source1: U, source2: V) => T & U & V) & (<T, U, V, W>(target: T, source1: U, source2: V, source3: W) => T & U & V & W) & (<T, U, V, W, Q>(target: T, source1: U, source2: V, source3: W, source4: Q) => T & U & V & W & Q) & (<T, U, V, W, Q, R>(target: T, source1: U, source2: V, source3: W, source4: Q, source5: R) => T & U & V & W & Q & R) & ((target: any, ...sources: any[]) => any);
|
|
2
|
+
export declare const objectAssign: ObjectAssign;
|
|
3
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare
|
|
2
|
-
export default _default;
|
|
1
|
+
export declare function thenable(o: any): o is Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function timeout<T>(ms: number, promise: Promise<T>): Promise<T>;
|
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
* @returns a promise that doesn't need to be handled for rejection (except when using async/await syntax) and
|
|
17
17
|
* includes a method named `hasOnFulfilled` that returns true if the promise has attached an onFulfilled handler.
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export declare function promiseWrapper<T>(customPromise: Promise<T>, defaultOnRejected: (_: any) => any): Promise<T> & {
|
|
20
20
|
hasOnFulfilled: () => boolean;
|
|
21
21
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ILogger } from '../../logger/types';
|
|
2
2
|
import { SplitIO } from '../../types';
|
|
3
|
-
export
|
|
3
|
+
export declare function validImpressionsMode(log: ILogger, impressionsMode: string): SplitIO.ImpressionsMode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function mode(key: string, mode: string): string;
|
|
@@ -11,7 +11,7 @@ interface MetricsCollector {
|
|
|
11
11
|
getTreatmentsWithConfig(ms: number): void;
|
|
12
12
|
[method: string]: (ms: number) => void;
|
|
13
13
|
}
|
|
14
|
-
declare const TrackerAPI: {
|
|
14
|
+
export declare const TrackerAPI: {
|
|
15
15
|
/**
|
|
16
16
|
* "Private" method, used to attach count/countException and stop callbacks to a promise.
|
|
17
17
|
*
|
|
@@ -67,4 +67,4 @@ declare const TrackerAPI: {
|
|
|
67
67
|
SPLITS_FETCH: string;
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
-
export
|
|
70
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare const now: () => number;
|
|
2
|
-
export default now;
|
|
1
|
+
export declare const now: () => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function now(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function timer(now?: () => number): () => number;
|
package/src/logger/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IIntegrationFactoryParams } from '../types';
|
|
2
|
-
import SplitToGa from './SplitToGa';
|
|
3
|
-
import { SplitToGoogleAnalyticsOptions } from './types';
|
|
4
|
-
export declare function SplitToGoogleAnalytics(options?: SplitToGoogleAnalyticsOptions): (params: IIntegrationFactoryParams) => SplitToGa;
|
package/types/logger/codes.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
export declare const DEBUG_0 = 0;
|
|
2
|
-
export declare const DEBUG_1 = 1;
|
|
3
|
-
export declare const DEBUG_2 = 2;
|
|
4
|
-
export declare const DEBUG_3 = 3;
|
|
5
|
-
export declare const DEBUG_4 = 4;
|
|
6
|
-
export declare const DEBUG_5 = 5;
|
|
7
|
-
export declare const DEBUG_6 = 6;
|
|
8
|
-
export declare const DEBUG_7 = 7;
|
|
9
|
-
export declare const DEBUG_8 = 8;
|
|
10
|
-
export declare const DEBUG_9 = 9;
|
|
11
|
-
export declare const DEBUG_10 = 10;
|
|
12
|
-
export declare const DEBUG_11 = 11;
|
|
13
|
-
export declare const DEBUG_12 = 12;
|
|
14
|
-
export declare const DEBUG_13 = 13;
|
|
15
|
-
export declare const DEBUG_14 = 14;
|
|
16
|
-
export declare const DEBUG_15 = 15;
|
|
17
|
-
export declare const DEBUG_16 = 16;
|
|
18
|
-
export declare const DEBUG_17 = 17;
|
|
19
|
-
export declare const DEBUG_18 = 18;
|
|
20
|
-
export declare const DEBUG_19 = 19;
|
|
21
|
-
export declare const DEBUG_20 = 20;
|
|
22
|
-
export declare const DEBUG_21 = 21;
|
|
23
|
-
export declare const DEBUG_22 = 22;
|
|
24
|
-
export declare const DEBUG_23 = 23;
|
|
25
|
-
export declare const DEBUG_24 = 24;
|
|
26
|
-
export declare const DEBUG_25 = 25;
|
|
27
|
-
export declare const DEBUG_31 = 31;
|
|
28
|
-
export declare const DEBUG_32 = 32;
|
|
29
|
-
export declare const DEBUG_33 = 33;
|
|
30
|
-
export declare const DEBUG_36 = 36;
|
|
31
|
-
export declare const DEBUG_42 = 42;
|
|
32
|
-
export declare const DEBUG_43 = 43;
|
|
33
|
-
export declare const DEBUG_44 = 44;
|
|
34
|
-
export declare const DEBUG_45 = 45;
|
|
35
|
-
export declare const DEBUG_46 = 46;
|
|
36
|
-
export declare const DEBUG_47 = 47;
|
|
37
|
-
export declare const DEBUG_48 = 48;
|
|
38
|
-
export declare const DEBUG_49 = 49;
|
|
39
|
-
export declare const DEBUG_50 = 50;
|
|
40
|
-
export declare const DEBUG_51 = 51;
|
|
41
|
-
export declare const INFO_0 = 100;
|
|
42
|
-
export declare const INFO_1 = 101;
|
|
43
|
-
export declare const INFO_2 = 102;
|
|
44
|
-
export declare const INFO_3 = 103;
|
|
45
|
-
export declare const INFO_4 = 104;
|
|
46
|
-
export declare const INFO_5 = 105;
|
|
47
|
-
export declare const INFO_6 = 106;
|
|
48
|
-
export declare const INFO_7 = 107;
|
|
49
|
-
export declare const INFO_8 = 108;
|
|
50
|
-
export declare const INFO_9 = 109;
|
|
51
|
-
export declare const INFO_10 = 110;
|
|
52
|
-
export declare const INFO_11 = 111;
|
|
53
|
-
export declare const INFO_12 = 112;
|
|
54
|
-
export declare const INFO_13 = 113;
|
|
55
|
-
export declare const INFO_14 = 114;
|
|
56
|
-
export declare const INFO_15 = 115;
|
|
57
|
-
export declare const INFO_16 = 116;
|
|
58
|
-
export declare const INFO_17 = 117;
|
|
59
|
-
export declare const INFO_18 = 118;
|
|
60
|
-
export declare const INFO_19 = 119;
|
|
61
|
-
export declare const INFO_20 = 120;
|
|
62
|
-
export declare const INFO_21 = 121;
|
|
63
|
-
export declare const WARN_0 = 200;
|
|
64
|
-
export declare const WARN_1 = 201;
|
|
65
|
-
export declare const WARN_2 = 202;
|
|
66
|
-
export declare const WARN_4 = 204;
|
|
67
|
-
export declare const WARN_5 = 205;
|
|
68
|
-
export declare const WARN_6 = 206;
|
|
69
|
-
export declare const WARN_7 = 207;
|
|
70
|
-
export declare const WARN_8 = 208;
|
|
71
|
-
export declare const WARN_9 = 209;
|
|
72
|
-
export declare const WARN_10 = 210;
|
|
73
|
-
export declare const WARN_11 = 211;
|
|
74
|
-
export declare const WARN_12 = 212;
|
|
75
|
-
export declare const WARN_13 = 213;
|
|
76
|
-
export declare const WARN_14 = 214;
|
|
77
|
-
export declare const WARN_15 = 215;
|
|
78
|
-
export declare const WARN_17 = 217;
|
|
79
|
-
export declare const WARN_18 = 218;
|
|
80
|
-
export declare const WARN_19 = 219;
|
|
81
|
-
export declare const WARN_20 = 220;
|
|
82
|
-
export declare const WARN_21 = 221;
|
|
83
|
-
export declare const WARN_22 = 222;
|
|
84
|
-
export declare const WARN_23 = 223;
|
|
85
|
-
export declare const WARN_24 = 224;
|
|
86
|
-
export declare const WARN_25 = 225;
|
|
87
|
-
export declare const ERROR_0 = 300;
|
|
88
|
-
export declare const ERROR_2 = 302;
|
|
89
|
-
export declare const ERROR_3 = 303;
|
|
90
|
-
export declare const ERROR_4 = 304;
|
|
91
|
-
export declare const ERROR_5 = 305;
|
|
92
|
-
export declare const ERROR_7 = 307;
|
|
93
|
-
export declare const ERROR_9 = 309;
|
|
94
|
-
export declare const ERROR_10 = 310;
|
|
95
|
-
export declare const ERROR_11 = 311;
|
|
96
|
-
export declare const ERROR_12 = 312;
|
|
97
|
-
export declare const ERROR_13 = 313;
|
|
98
|
-
export declare const ERROR_14 = 314;
|
|
99
|
-
export declare const ERROR_15 = 315;
|
|
100
|
-
export declare const ERROR_16 = 316;
|
|
101
|
-
export declare const ERROR_17 = 317;
|
|
102
|
-
export declare const ERROR_18 = 318;
|
|
103
|
-
export declare const ERROR_19 = 319;
|
|
104
|
-
export declare const ERROR_20 = 320;
|
|
105
|
-
export declare const ERROR_21 = 321;
|
|
106
|
-
export declare const ERROR_22 = 322;
|
|
107
|
-
export declare const ERROR_23 = 323;
|
|
108
|
-
export declare const ERROR_24 = 324;
|
|
109
|
-
export declare const ERROR_25 = 325;
|
|
110
|
-
export declare const ERROR_26 = 326;
|
|
111
|
-
export declare const ERROR_32 = 332;
|
|
112
|
-
export declare const ERROR_33 = 333;
|
|
113
|
-
export declare const ERROR_34 = 334;
|
|
114
|
-
export declare const ERROR_35 = 335;
|
|
115
|
-
export declare const ERROR_36 = 336;
|
|
116
|
-
export declare const ERROR_37 = 337;
|
|
117
|
-
export declare const ERROR_38 = 338;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const DEBUG_28 = 28;
|
|
2
|
-
export declare const DEBUG_29 = 29;
|
|
3
|
-
export declare const DEBUG_30 = 30;
|
|
4
|
-
export declare const ERROR_1 = 301;
|
|
5
|
-
export declare const DEBUG_39 = 39;
|
|
6
|
-
export declare const DEBUG_40 = 40;
|
|
7
|
-
export declare const DEBUG_41 = 41;
|
|
8
|
-
export declare const ERROR_8 = 308;
|
|
9
|
-
export declare const DEBUG_34 = 34;
|
|
10
|
-
export declare const DEBUG_35 = 35;
|
|
11
|
-
export declare const ERROR_6 = 306;
|
|
12
|
-
export declare const WARN_3 = 203;
|
|
13
|
-
export declare const DEBUG_37 = 37;
|
|
14
|
-
export declare const DEBUG_38 = 38;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebug: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugBrowser: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesError: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesErrorNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesInfo: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesWarn: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesWarnNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugBrowser: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesErrorNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesWarnNode: [number, string][];
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ISdkClientFactoryParams } from '../sdkClient/types';
|
|
2
|
-
import { SplitIO } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Factory of client method for server-side SDKs (ISDK and IAsyncSDK)
|
|
5
|
-
*/
|
|
6
|
-
export declare function sdkManagerMethodFactory(params: ISdkClientFactoryParams): () => SplitIO.IManager | SplitIO.IAsyncManager;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ISplit } from '../dtos/types';
|
|
2
|
-
/**
|
|
3
|
-
* Collect segments from a raw split definition.
|
|
4
|
-
* Exported for testing purposes.
|
|
5
|
-
*/
|
|
6
|
-
export declare function _parseSegments({ conditions }: ISplit): import("../utils/lang/sets").ISet<string>;
|
|
7
|
-
/**
|
|
8
|
-
* Computes the set of segments used by splits.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getRegisteredSegments(splitDefs: string[]): string[];
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ISet } from '../../../utils/lang/sets';
|
|
2
|
-
import { ISegmentsCacheSync, ISplitsCacheSync, IStorageSync } from '../../../storages/types';
|
|
3
|
-
import { ISplitChangesFetcher } from '../fetchers/types';
|
|
4
|
-
import { ISplit } from '../../../dtos/types';
|
|
5
|
-
import { IReadinessManager, ISplitsEventEmitter } from '../../../readiness/types';
|
|
6
|
-
import { ISplitsSyncTask } from '../types';
|
|
7
|
-
import { IFetchSplitChanges } from '../../../services/types';
|
|
8
|
-
import { ISettings } from '../../../types';
|
|
9
|
-
declare type ISplitChangesUpdater = (noCache?: boolean) => Promise<boolean>;
|
|
10
|
-
/**
|
|
11
|
-
* Collect segments from a raw split definition.
|
|
12
|
-
* Exported for testing purposes.
|
|
13
|
-
*/
|
|
14
|
-
export declare function parseSegments({ conditions }: ISplit): ISet<string>;
|
|
15
|
-
interface ISplitMutations {
|
|
16
|
-
added: [string, string][];
|
|
17
|
-
removed: string[];
|
|
18
|
-
segments: string[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Given the list of splits from /splitChanges endpoint, it returns the mutations,
|
|
22
|
-
* i.e., an object with added splits, removed splits and used segments.
|
|
23
|
-
* Exported for testing purposes.
|
|
24
|
-
*/
|
|
25
|
-
export declare function computeSplitsMutation(entries: ISplit[]): ISplitMutations;
|
|
26
|
-
/**
|
|
27
|
-
* factory of SplitChanges updater (a.k.a, SplitsSyncTask), a task that:
|
|
28
|
-
* - fetches split changes using `splitChangesFetcher`
|
|
29
|
-
* - updates `splitsCache`
|
|
30
|
-
* - uses `splitsEventEmitter` to emit events related to split data updates
|
|
31
|
-
* Exported for testing purposes.
|
|
32
|
-
*/
|
|
33
|
-
export declare function splitChangesUpdaterFactory(splitChangesFetcher: ISplitChangesFetcher, splitsCache: ISplitsCacheSync, segmentsCache: ISegmentsCacheSync, splitsEventEmitter: ISplitsEventEmitter, requestTimeoutBeforeReady: number, retriesOnFailureBeforeReady: number): ISplitChangesUpdater;
|
|
34
|
-
export default function splitsSyncTaskFactory(fetchSplitChanges: IFetchSplitChanges, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings): ISplitsSyncTask;
|
|
35
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ISet } from '../../../utils/lang/sets';
|
|
2
|
-
import { ISegmentsCacheSync, ISplitsCacheSync, IStorageSync } from '../../../storages/types';
|
|
3
|
-
import { ISplitChangesFetcher } from '../fetchers/types';
|
|
4
|
-
import { ISplit } from '../../../dtos/types';
|
|
5
|
-
import { IReadinessManager, ISplitsEventEmitter } from '../../../readiness/types';
|
|
6
|
-
import { ISplitsSyncTask } from '../types';
|
|
7
|
-
import { IFetchSplitChanges } from '../../../services/types';
|
|
8
|
-
import { ISettings } from '../../../types';
|
|
9
|
-
declare type ISplitChangesUpdater = (noCache?: boolean) => Promise<boolean>;
|
|
10
|
-
/**
|
|
11
|
-
* Collect segments from a raw split definition.
|
|
12
|
-
* Exported for testing purposes.
|
|
13
|
-
*/
|
|
14
|
-
export declare function parseSegments({ conditions }: ISplit): ISet<string>;
|
|
15
|
-
interface ISplitMutations {
|
|
16
|
-
added: [string, string][];
|
|
17
|
-
removed: string[];
|
|
18
|
-
segments: string[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Given the list of splits from /splitChanges endpoint, it returns the mutations,
|
|
22
|
-
* i.e., an object with added splits, removed splits and used segments.
|
|
23
|
-
* Exported for testing purposes.
|
|
24
|
-
*/
|
|
25
|
-
export declare function computeSplitsMutation(entries: ISplit[]): ISplitMutations;
|
|
26
|
-
/**
|
|
27
|
-
* factory of SplitChanges updater (a.k.a, SplitsSyncTask), a task that:
|
|
28
|
-
* - fetches split changes using `splitChangesFetcher`
|
|
29
|
-
* - updates `splitsCache`
|
|
30
|
-
* - uses `splitsEventEmitter` to emit events related to split data updates
|
|
31
|
-
* Exported for testing purposes.
|
|
32
|
-
*/
|
|
33
|
-
export declare function splitChangesUpdaterFactory(splitChangesFetcher: ISplitChangesFetcher, splitsCache: ISplitsCacheSync, segmentsCache: ISegmentsCacheSync, splitsEventEmitter: ISplitsEventEmitter, requestTimeoutBeforeReady: number, retriesOnFailureBeforeReady: number): ISplitChangesUpdater;
|
|
34
|
-
export default function splitsSyncTaskFactory(fetchSplitChanges: IFetchSplitChanges, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings): ISplitsSyncTask;
|
|
35
|
-
export {};
|