@splitsoftware/splitio-commons 2.0.0-rc.2 → 2.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.txt +1 -3
- package/cjs/logger/constants.js +1 -2
- package/cjs/logger/messages/error.js +0 -1
- package/cjs/sdkFactory/index.js +1 -3
- package/cjs/storages/dataLoader.js +37 -99
- package/cjs/storages/inMemory/InMemoryStorageCS.js +4 -16
- package/cjs/sync/offline/LocalhostFromObject.js +3 -8
- package/cjs/utils/settingsValidation/index.js +1 -4
- package/esm/logger/constants.js +0 -1
- package/esm/logger/messages/error.js +0 -1
- package/esm/sdkFactory/index.js +2 -4
- package/esm/storages/dataLoader.js +35 -96
- package/esm/storages/inMemory/InMemoryStorageCS.js +4 -16
- package/esm/sync/offline/LocalhostFromObject.js +2 -6
- package/esm/utils/settingsValidation/index.js +1 -4
- package/package.json +3 -2
- package/src/logger/constants.ts +0 -1
- package/src/logger/messages/error.ts +0 -1
- package/src/sdkFactory/index.ts +3 -6
- package/src/storages/dataLoader.ts +38 -97
- package/src/storages/inMemory/InMemoryStorageCS.ts +4 -19
- package/src/storages/types.ts +2 -4
- package/src/sync/offline/LocalhostFromObject.ts +2 -8
- package/src/types.ts +14 -26
- package/src/utils/settingsValidation/index.ts +1 -4
- package/src/utils/settingsValidation/types.ts +0 -2
- package/types/index.d.ts +5 -5
- package/types/splitio.d.ts +2293 -0
- package/cjs/utils/settingsValidation/localhost/builtin.js +0 -18
- package/cjs/utils/settingsValidation/localhost/pluggable.js +0 -22
- package/esm/utils/settingsValidation/localhost/builtin.js +0 -14
- package/esm/utils/settingsValidation/localhost/pluggable.js +0 -18
- package/src/utils/settingsValidation/localhost/builtin.ts +0 -16
- package/src/utils/settingsValidation/localhost/pluggable.ts +0 -22
- package/types/consent/index.d.ts +0 -2
- package/types/consent/sdkUserConsent.d.ts +0 -13
- package/types/dtos/types.d.ts +0 -209
- package/types/evaluator/Engine.d.ts +0 -15
- package/types/evaluator/combiners/and.d.ts +0 -4
- package/types/evaluator/combiners/ifelseif.d.ts +0 -3
- package/types/evaluator/condition/engineUtils.d.ts +0 -11
- package/types/evaluator/condition/index.d.ts +0 -6
- package/types/evaluator/convertions/index.d.ts +0 -2
- package/types/evaluator/index.d.ts +0 -8
- package/types/evaluator/matchers/all.d.ts +0 -1
- package/types/evaluator/matchers/between.d.ts +0 -2
- package/types/evaluator/matchers/boolean.d.ts +0 -1
- package/types/evaluator/matchers/cont_all.d.ts +0 -1
- package/types/evaluator/matchers/cont_any.d.ts +0 -1
- package/types/evaluator/matchers/cont_str.d.ts +0 -1
- package/types/evaluator/matchers/dependency.d.ts +0 -5
- package/types/evaluator/matchers/eq.d.ts +0 -1
- package/types/evaluator/matchers/eq_set.d.ts +0 -1
- package/types/evaluator/matchers/ew.d.ts +0 -1
- package/types/evaluator/matchers/gte.d.ts +0 -1
- package/types/evaluator/matchers/index.d.ts +0 -7
- package/types/evaluator/matchers/large_segment.d.ts +0 -5
- package/types/evaluator/matchers/lte.d.ts +0 -1
- package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
- package/types/evaluator/matchers/part_of.d.ts +0 -1
- package/types/evaluator/matchers/segment.d.ts +0 -5
- package/types/evaluator/matchers/sember_inlist.d.ts +0 -3
- package/types/evaluator/matchers/semver_between.d.ts +0 -2
- package/types/evaluator/matchers/semver_eq.d.ts +0 -1
- package/types/evaluator/matchers/semver_gte.d.ts +0 -1
- package/types/evaluator/matchers/semver_inlist.d.ts +0 -1
- package/types/evaluator/matchers/semver_lte.d.ts +0 -1
- package/types/evaluator/matchers/string.d.ts +0 -1
- package/types/evaluator/matchers/sw.d.ts +0 -1
- package/types/evaluator/matchers/whitelist.d.ts +0 -1
- package/types/evaluator/matchersTransform/index.d.ts +0 -6
- package/types/evaluator/matchersTransform/segment.d.ts +0 -5
- package/types/evaluator/matchersTransform/set.d.ts +0 -5
- package/types/evaluator/matchersTransform/string.d.ts +0 -7
- package/types/evaluator/matchersTransform/unaryNumeric.d.ts +0 -5
- package/types/evaluator/matchersTransform/whitelist.d.ts +0 -5
- package/types/evaluator/parser/index.d.ts +0 -5
- package/types/evaluator/treatments/index.d.ts +0 -8
- package/types/evaluator/types.d.ts +0 -28
- package/types/evaluator/value/index.d.ts +0 -7
- package/types/evaluator/value/sanitize.d.ts +0 -7
- package/types/integrations/browser.d.ts +0 -12
- package/types/integrations/ga/GaToSplit.d.ts +0 -40
- package/types/integrations/ga/GoogleAnalyticsToSplit.d.ts +0 -3
- package/types/integrations/ga/SplitToGa.d.ts +0 -34
- package/types/integrations/ga/SplitToGoogleAnalytics.d.ts +0 -3
- package/types/integrations/ga/types.d.ts +0 -148
- package/types/integrations/pluggable.d.ts +0 -11
- package/types/integrations/types.d.ts +0 -18
- package/types/listeners/browser.d.ts +0 -40
- package/types/listeners/node.d.ts +0 -22
- package/types/listeners/types.d.ts +0 -4
- package/types/logger/browser/DebugLogger.d.ts +0 -2
- package/types/logger/browser/ErrorLogger.d.ts +0 -2
- package/types/logger/browser/InfoLogger.d.ts +0 -2
- package/types/logger/browser/WarnLogger.d.ts +0 -2
- package/types/logger/constants.d.ts +0 -135
- package/types/logger/index.d.ts +0 -21
- package/types/logger/messages/debug.d.ts +0 -1
- package/types/logger/messages/error.d.ts +0 -1
- package/types/logger/messages/info.d.ts +0 -1
- package/types/logger/messages/warn.d.ts +0 -1
- package/types/logger/sdkLogger.d.ts +0 -8
- package/types/logger/types.d.ts +0 -17
- package/types/readiness/constants.d.ts +0 -7
- package/types/readiness/readinessManager.d.ts +0 -6
- package/types/readiness/sdkReadinessManager.d.ts +0 -10
- package/types/readiness/types.d.ts +0 -67
- package/types/sdkClient/client.d.ts +0 -6
- package/types/sdkClient/clientAttributesDecoration.d.ts +0 -55
- package/types/sdkClient/clientCS.d.ts +0 -9
- package/types/sdkClient/clientInputValidation.d.ts +0 -7
- package/types/sdkClient/identity.d.ts +0 -2
- package/types/sdkClient/sdkClient.d.ts +0 -6
- package/types/sdkClient/sdkClientMethod.d.ts +0 -6
- package/types/sdkClient/sdkClientMethodCS.d.ts +0 -7
- package/types/sdkClient/sdkClientMethodCSWithTT.d.ts +0 -8
- package/types/sdkFactory/index.d.ts +0 -6
- package/types/sdkFactory/types.d.ts +0 -85
- package/types/sdkManager/index.d.ts +0 -4
- package/types/services/decorateHeaders.d.ts +0 -2
- package/types/services/splitApi.d.ts +0 -12
- package/types/services/splitHttpClient.d.ts +0 -10
- package/types/services/types.d.ts +0 -54
- package/types/storages/AbstractMySegmentsCacheSync.d.ts +0 -39
- package/types/storages/AbstractSegmentsCacheSync.d.ts +0 -54
- package/types/storages/AbstractSplitsCache.d.ts +0 -46
- package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -38
- package/types/storages/AbstractSplitsCacheSync.d.ts +0 -43
- package/types/storages/KeyBuilder.d.ts +0 -22
- package/types/storages/KeyBuilderCS.d.ts +0 -20
- package/types/storages/KeyBuilderSS.d.ts +0 -20
- package/types/storages/dataLoader.d.ts +0 -21
- package/types/storages/findLatencyIndex.d.ts +0 -7
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -15
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -54
- package/types/storages/inLocalStorage/constants.d.ts +0 -2
- package/types/storages/inLocalStorage/index.d.ts +0 -8
- package/types/storages/inMemory/AttributesCacheInMemory.d.ts +0 -44
- package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
- package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -28
- package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +0 -30
- package/types/storages/inMemory/InMemoryStorage.d.ts +0 -10
- package/types/storages/inMemory/InMemoryStorageCS.d.ts +0 -10
- package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +0 -16
- package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -17
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -27
- package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -71
- package/types/storages/inMemory/UniqueKeysCacheInMemory.d.ts +0 -34
- package/types/storages/inMemory/UniqueKeysCacheInMemoryCS.d.ts +0 -35
- package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
- package/types/storages/inRedis/ImpressionCountsCacheInRedis.d.ts +0 -17
- package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -17
- package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
- package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -21
- package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -95
- package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -35
- package/types/storages/inRedis/UniqueKeysCacheInRedis.d.ts +0 -22
- package/types/storages/inRedis/constants.d.ts +0 -4
- package/types/storages/inRedis/index.d.ts +0 -10
- package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
- package/types/storages/pluggable/ImpressionCountsCachePluggable.d.ts +0 -16
- package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -34
- package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -42
- package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -98
- package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -34
- package/types/storages/pluggable/UniqueKeysCachePluggable.d.ts +0 -20
- package/types/storages/pluggable/constants.d.ts +0 -1
- package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -12
- package/types/storages/pluggable/index.d.ts +0 -9
- package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
- package/types/storages/types.d.ts +0 -410
- package/types/storages/utils.d.ts +0 -8
- package/types/sync/offline/LocalhostFromObject.d.ts +0 -2
- package/types/sync/offline/splitsParser/parseCondition.d.ts +0 -7
- package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +0 -3
- package/types/sync/offline/splitsParser/types.d.ts +0 -3
- package/types/sync/offline/syncManagerOffline.d.ts +0 -10
- package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +0 -17
- package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/types.d.ts +0 -5
- package/types/sync/polling/pollingManagerCS.d.ts +0 -7
- package/types/sync/polling/pollingManagerSS.d.ts +0 -6
- package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +0 -9
- package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +0 -9
- package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +0 -9
- package/types/sync/polling/types.d.ts +0 -33
- package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -14
- package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
- package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -41
- package/types/sync/streaming/AuthClient/index.d.ts +0 -12
- package/types/sync/streaming/AuthClient/types.d.ts +0 -17
- package/types/sync/streaming/SSEClient/index.d.ts +0 -34
- package/types/sync/streaming/SSEClient/types.d.ts +0 -11
- package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +0 -14
- package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +0 -20
- package/types/sync/streaming/SSEHandler/index.d.ts +0 -11
- package/types/sync/streaming/SSEHandler/types.d.ts +0 -72
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -9
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -9
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -14
- package/types/sync/streaming/UpdateWorkers/constants.d.ts +0 -3
- package/types/sync/streaming/UpdateWorkers/types.d.ts +0 -4
- package/types/sync/streaming/constants.d.ts +0 -34
- package/types/sync/streaming/mySegmentsV2utils.d.ts +0 -27
- package/types/sync/streaming/parseUtils.d.ts +0 -34
- package/types/sync/streaming/pushManager.d.ts +0 -9
- package/types/sync/streaming/pushManagerCS_Spec1_3.d.ts +0 -9
- package/types/sync/streaming/pushManager_Spec1_3.d.ts +0 -9
- package/types/sync/streaming/types.d.ts +0 -35
- package/types/sync/submitters/eventsSubmitter.d.ts +0 -5
- package/types/sync/submitters/impressionCountsSubmitter.d.ts +0 -10
- package/types/sync/submitters/impressionsSubmitter.d.ts +0 -11
- package/types/sync/submitters/submitter.d.ts +0 -12
- package/types/sync/submitters/submitterManager.d.ts +0 -3
- package/types/sync/submitters/telemetrySubmitter.d.ts +0 -17
- package/types/sync/submitters/types.d.ts +0 -217
- package/types/sync/submitters/uniqueKeysSubmitter.d.ts +0 -5
- package/types/sync/syncManagerOnline.d.ts +0 -13
- package/types/sync/syncTask.d.ts +0 -13
- package/types/sync/types.d.ts +0 -43
- package/types/trackers/eventTracker.d.ts +0 -10
- package/types/trackers/impressionObserver/ImpressionObserver.d.ts +0 -8
- package/types/trackers/impressionObserver/buildKey.d.ts +0 -2
- package/types/trackers/impressionObserver/impressionObserverCS.d.ts +0 -4
- package/types/trackers/impressionObserver/impressionObserverSS.d.ts +0 -4
- package/types/trackers/impressionObserver/types.d.ts +0 -4
- package/types/trackers/impressionObserver/utils.d.ts +0 -5
- package/types/trackers/impressionsTracker.d.ts +0 -13
- package/types/trackers/strategy/strategyDebug.d.ts +0 -9
- package/types/trackers/strategy/strategyNone.d.ts +0 -10
- package/types/trackers/strategy/strategyOptimized.d.ts +0 -11
- package/types/trackers/telemetryTracker.d.ts +0 -3
- package/types/trackers/types.d.ts +0 -68
- package/types/trackers/uniqueKeysTracker.d.ts +0 -13
- package/types/types.d.ts +0 -1408
- package/types/utils/Backoff.d.ts +0 -25
- package/types/utils/LRUCache/LinkedList.d.ts +0 -34
- package/types/utils/LRUCache/index.d.ts +0 -15
- package/types/utils/MinEventEmitter.d.ts +0 -12
- package/types/utils/MinEvents.d.ts +0 -4
- package/types/utils/base64/index.d.ts +0 -30
- package/types/utils/constants/browser.d.ts +0 -1
- package/types/utils/constants/index.d.ts +0 -83
- package/types/utils/decompress/index.d.ts +0 -16
- package/types/utils/env/isLocalStorageAvailable.d.ts +0 -1
- package/types/utils/env/isNode.d.ts +0 -5
- package/types/utils/inputValidation/apiKey.d.ts +0 -7
- package/types/utils/inputValidation/attribute.d.ts +0 -2
- package/types/utils/inputValidation/attributes.d.ts +0 -4
- package/types/utils/inputValidation/event.d.ts +0 -2
- package/types/utils/inputValidation/eventProperties.d.ts +0 -6
- package/types/utils/inputValidation/eventValue.d.ts +0 -2
- package/types/utils/inputValidation/index.d.ts +0 -13
- package/types/utils/inputValidation/isOperational.d.ts +0 -4
- package/types/utils/inputValidation/key.d.ts +0 -3
- package/types/utils/inputValidation/preloadedData.d.ts +0 -3
- package/types/utils/inputValidation/sdkKey.d.ts +0 -7
- package/types/utils/inputValidation/split.d.ts +0 -2
- package/types/utils/inputValidation/splitExistance.d.ts +0 -7
- package/types/utils/inputValidation/splitExistence.d.ts +0 -7
- package/types/utils/inputValidation/splits.d.ts +0 -2
- package/types/utils/inputValidation/trafficType.d.ts +0 -2
- package/types/utils/inputValidation/trafficTypeExistance.d.ts +0 -9
- package/types/utils/inputValidation/trafficTypeExistence.d.ts +0 -9
- package/types/utils/jwt/index.d.ts +0 -5
- package/types/utils/jwt/types.d.ts +0 -5
- package/types/utils/key/index.d.ts +0 -8
- package/types/utils/labels/index.d.ts +0 -8
- package/types/utils/lang/binarySearch.d.ts +0 -9
- package/types/utils/lang/getFnName.d.ts +0 -4
- package/types/utils/lang/getGlobal.d.ts +0 -4
- package/types/utils/lang/index.d.ts +0 -105
- package/types/utils/lang/maps.d.ts +0 -59
- package/types/utils/lang/objectAssign.d.ts +0 -6
- package/types/utils/lang/sets.d.ts +0 -3
- package/types/utils/murmur3/common.d.ts +0 -12
- package/types/utils/murmur3/legacy.d.ts +0 -2
- package/types/utils/murmur3/murmur3.d.ts +0 -2
- package/types/utils/murmur3/murmur3_128.d.ts +0 -6
- package/types/utils/murmur3/murmur3_128_x86.d.ts +0 -7
- package/types/utils/murmur3/murmur3_64.d.ts +0 -10
- package/types/utils/murmur3/utfx.d.ts +0 -27
- package/types/utils/promise/thenable.d.ts +0 -1
- package/types/utils/promise/timeout.d.ts +0 -1
- package/types/utils/promise/wrapper.d.ts +0 -21
- package/types/utils/redis/RedisMock.d.ts +0 -4
- package/types/utils/semVer.d.ts +0 -15
- package/types/utils/settingsValidation/consent.d.ts +0 -6
- package/types/utils/settingsValidation/impressionsMode.d.ts +0 -3
- package/types/utils/settingsValidation/index.d.ts +0 -51
- package/types/utils/settingsValidation/integrations/common.d.ts +0 -14
- package/types/utils/settingsValidation/integrations/configurable.d.ts +0 -13
- package/types/utils/settingsValidation/integrations/pluggable.d.ts +0 -13
- package/types/utils/settingsValidation/localhost/builtin.d.ts +0 -16
- package/types/utils/settingsValidation/localhost/pluggable.d.ts +0 -16
- package/types/utils/settingsValidation/logger/builtinLogger.d.ts +0 -10
- package/types/utils/settingsValidation/logger/commons.d.ts +0 -9
- package/types/utils/settingsValidation/logger/globalLogLevel.d.ts +0 -8
- package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +0 -11
- package/types/utils/settingsValidation/mode.d.ts +0 -5
- package/types/utils/settingsValidation/runtime.d.ts +0 -2
- package/types/utils/settingsValidation/splitFilters.d.ts +0 -17
- package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -21
- package/types/utils/settingsValidation/types.d.ts +0 -32
- package/types/utils/settingsValidation/url.d.ts +0 -10
- package/types/utils/time/index.d.ts +0 -4
- package/types/utils/timeTracker/now/browser.d.ts +0 -1
- package/types/utils/timeTracker/now/node.d.ts +0 -1
- package/types/utils/timeTracker/timer.d.ts +0 -1
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { KeyBuilder } from './KeyBuilder';
|
|
2
|
-
import { IMetadata } from '../dtos/types';
|
|
3
|
-
import { Method } from '../sync/submitters/types';
|
|
4
|
-
export declare const METHOD_NAMES: Record<Method, string>;
|
|
5
|
-
export declare class KeyBuilderSS extends KeyBuilder {
|
|
6
|
-
readonly latencyPrefix: string;
|
|
7
|
-
readonly exceptionPrefix: string;
|
|
8
|
-
readonly initPrefix: string;
|
|
9
|
-
private readonly versionablePrefix;
|
|
10
|
-
constructor(prefix: string, metadata: IMetadata);
|
|
11
|
-
buildRegisteredSegmentsKey(): string;
|
|
12
|
-
buildImpressionsKey(): string;
|
|
13
|
-
buildImpressionsCountKey(): string;
|
|
14
|
-
buildUniqueKeysKey(): string;
|
|
15
|
-
buildEventsKey(): string;
|
|
16
|
-
searchPatternForSplitKeys(): string;
|
|
17
|
-
buildLatencyKey(method: Method, bucket: number): string;
|
|
18
|
-
buildExceptionKey(method: Method): string;
|
|
19
|
-
buildInitKey(): string;
|
|
20
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../types';
|
|
2
|
-
import { ISegmentsCacheSync, ISplitsCacheSync, IStorageSync } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Storage-agnostic adaptation of `loadDataIntoLocalStorage` function
|
|
5
|
-
* (https://github.com/godaddy/split-javascript-data-loader/blob/master/src/load-data.js)
|
|
6
|
-
*
|
|
7
|
-
* @param preloadedData validated data following the format proposed in https://github.com/godaddy/split-javascript-data-loader and extended with a `mySegmentsData` property.
|
|
8
|
-
* @param storage object containing `splits` and `segments` cache (client-side variant)
|
|
9
|
-
* @param userKey user key (matching key) of the provided MySegmentsCache
|
|
10
|
-
*
|
|
11
|
-
* @TODO extend to load largeSegments
|
|
12
|
-
* @TODO extend to load data on shared mySegments storages. Be specific when emitting SDK_READY_FROM_CACHE on shared clients. Maybe the serializer should provide the `useSegments` flag.
|
|
13
|
-
* @TODO add logs, and input validation in this module, in favor of size reduction.
|
|
14
|
-
* @TODO unit tests
|
|
15
|
-
*/
|
|
16
|
-
export declare function loadData(preloadedData: SplitIO.PreloadedData, storage: {
|
|
17
|
-
splits?: ISplitsCacheSync;
|
|
18
|
-
segments: ISegmentsCacheSync;
|
|
19
|
-
largeSegments?: ISegmentsCacheSync;
|
|
20
|
-
}, matchingKey?: string): void;
|
|
21
|
-
export declare function getSnapshot(storage: IStorageSync, userKeys?: SplitIO.SplitKey[]): SplitIO.PreloadedData;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../logger/types';
|
|
2
|
-
import { AbstractMySegmentsCacheSync } from '../AbstractMySegmentsCacheSync';
|
|
3
|
-
import type { MySegmentsKeyBuilder } from '../KeyBuilderCS';
|
|
4
|
-
export declare class MySegmentsCacheInLocal extends AbstractMySegmentsCacheSync {
|
|
5
|
-
private readonly keys;
|
|
6
|
-
private readonly log;
|
|
7
|
-
constructor(log: ILogger, keys: MySegmentsKeyBuilder);
|
|
8
|
-
protected addSegment(name: string): boolean;
|
|
9
|
-
protected removeSegment(name: string): boolean;
|
|
10
|
-
isInSegment(name: string): boolean;
|
|
11
|
-
getRegisteredSegments(): string[];
|
|
12
|
-
getKeysCount(): number;
|
|
13
|
-
protected setChangeNumber(changeNumber?: number): void;
|
|
14
|
-
getChangeNumber(): number;
|
|
15
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { ISplit } from '../../dtos/types';
|
|
2
|
-
import { AbstractSplitsCacheSync } from '../AbstractSplitsCacheSync';
|
|
3
|
-
import { KeyBuilderCS } from '../KeyBuilderCS';
|
|
4
|
-
import { ISettings } from '../../types';
|
|
5
|
-
/**
|
|
6
|
-
* ISplitsCacheSync implementation that stores split definitions in browser LocalStorage.
|
|
7
|
-
*/
|
|
8
|
-
export declare class SplitsCacheInLocal extends AbstractSplitsCacheSync {
|
|
9
|
-
private readonly keys;
|
|
10
|
-
private readonly log;
|
|
11
|
-
private readonly storageHash;
|
|
12
|
-
private readonly flagSetsFilter;
|
|
13
|
-
private hasSync?;
|
|
14
|
-
private updateNewFilter?;
|
|
15
|
-
/**
|
|
16
|
-
* @param {KeyBuilderCS} keys
|
|
17
|
-
* @param {number | undefined} expirationTimestamp
|
|
18
|
-
* @param {ISplitFiltersValidation} splitFiltersValidation
|
|
19
|
-
*/
|
|
20
|
-
constructor(settings: ISettings, keys: KeyBuilderCS, expirationTimestamp?: number);
|
|
21
|
-
private _decrementCount;
|
|
22
|
-
private _decrementCounts;
|
|
23
|
-
private _incrementCounts;
|
|
24
|
-
/**
|
|
25
|
-
* Removes all splits cache related data from localStorage (splits, counters, changeNumber and lastUpdated).
|
|
26
|
-
* We cannot simply call `localStorage.clear()` since that implies removing user items from the storage.
|
|
27
|
-
*/
|
|
28
|
-
clear(): void;
|
|
29
|
-
addSplit(name: string, split: ISplit): boolean;
|
|
30
|
-
removeSplit(name: string): boolean;
|
|
31
|
-
getSplit(name: string): any;
|
|
32
|
-
setChangeNumber(changeNumber: number): boolean;
|
|
33
|
-
getChangeNumber(): number;
|
|
34
|
-
getSplitNames(): string[];
|
|
35
|
-
trafficTypeExists(trafficType: string): boolean;
|
|
36
|
-
usesSegments(): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Check if the splits information is already stored in browser LocalStorage.
|
|
39
|
-
* In this function we could add more code to check if the data is valid.
|
|
40
|
-
* @override
|
|
41
|
-
*/
|
|
42
|
-
checkCache(): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Clean Splits cache if its `lastUpdated` timestamp is older than the given `expirationTimestamp`,
|
|
45
|
-
*
|
|
46
|
-
* @param {number | undefined} expirationTimestamp if the value is not a number, data will not be cleaned
|
|
47
|
-
*/
|
|
48
|
-
private _checkExpiration;
|
|
49
|
-
private _checkFilterQuery;
|
|
50
|
-
getNamesByFlagSets(flagSets: string[]): Set<string>[];
|
|
51
|
-
private addToFlagSets;
|
|
52
|
-
private removeFromFlagSets;
|
|
53
|
-
private removeNames;
|
|
54
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IStorageSyncFactory } from '../types';
|
|
2
|
-
export interface InLocalStorageOptions {
|
|
3
|
-
prefix?: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* InLocal storage factory for standalone client-side SplitFactory
|
|
7
|
-
*/
|
|
8
|
-
export declare function InLocalStorage(options?: InLocalStorageOptions): IStorageSyncFactory;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../../types';
|
|
2
|
-
export declare class AttributesCacheInMemory {
|
|
3
|
-
private attributesCache;
|
|
4
|
-
/**
|
|
5
|
-
* Create or update the value for the given attribute
|
|
6
|
-
*
|
|
7
|
-
* @param {string} attributeName attribute name
|
|
8
|
-
* @param {Object} attributeValue attribute value
|
|
9
|
-
* @returns {boolean} the attribute was stored
|
|
10
|
-
*/
|
|
11
|
-
setAttribute(attributeName: string, attributeValue: SplitIO.AttributeType): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Retrieves the value of a given attribute
|
|
14
|
-
*
|
|
15
|
-
* @param {string} attributeName attribute name
|
|
16
|
-
* @returns {Object?} stored attribute value
|
|
17
|
-
*/
|
|
18
|
-
getAttribute(attributeName: string): SplitIO.AttributeType;
|
|
19
|
-
/**
|
|
20
|
-
* Create or update all the given attributes
|
|
21
|
-
*
|
|
22
|
-
* @param {[string, Object]} attributes attributes to create or update
|
|
23
|
-
* @returns {boolean} attributes were stored
|
|
24
|
-
*/
|
|
25
|
-
setAttributes(attributes: Record<string, Object>): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Retrieve the full attributes map
|
|
28
|
-
*
|
|
29
|
-
* @returns {Map<string, Object>} stored attributes
|
|
30
|
-
*/
|
|
31
|
-
getAll(): Record<string, SplitIO.AttributeType>;
|
|
32
|
-
/**
|
|
33
|
-
* Removes a given attribute from the map
|
|
34
|
-
*
|
|
35
|
-
* @param {string} attributeName attribute to remove
|
|
36
|
-
* @returns {boolean} attribute removed
|
|
37
|
-
*/
|
|
38
|
-
removeAttribute(attributeName: string): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Clears all attributes stored in the SDK
|
|
41
|
-
*
|
|
42
|
-
*/
|
|
43
|
-
clear(): boolean;
|
|
44
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../../types';
|
|
2
|
-
import { IEventsCacheSync } from '../types';
|
|
3
|
-
export declare class EventsCacheInMemory implements IEventsCacheSync {
|
|
4
|
-
private onFullQueue?;
|
|
5
|
-
private readonly maxQueue;
|
|
6
|
-
private queue;
|
|
7
|
-
private queueByteSize;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param eventsQueueSize number of queued events to call onFullQueueCb.
|
|
11
|
-
* Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
|
|
12
|
-
*/
|
|
13
|
-
constructor(eventsQueueSize?: number);
|
|
14
|
-
setOnFullQueueCb(cb: () => void): void;
|
|
15
|
-
/**
|
|
16
|
-
* Add a new event object at the end of the queue.
|
|
17
|
-
*/
|
|
18
|
-
track(data: SplitIO.EventData, size?: number): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Clear the data stored on the cache.
|
|
21
|
-
*/
|
|
22
|
-
clear(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Pop the collected data, used as payload for posting.
|
|
25
|
-
*/
|
|
26
|
-
pop(toMerge?: SplitIO.EventData[]): SplitIO.EventData[];
|
|
27
|
-
/**
|
|
28
|
-
* Check if the cache is empty.
|
|
29
|
-
*/
|
|
30
|
-
isEmpty(): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Check if the cache queue is full and we need to flush it.
|
|
33
|
-
*/
|
|
34
|
-
private _checkForFlush;
|
|
35
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IImpressionCountsCacheSync } from '../types';
|
|
2
|
-
export declare class ImpressionCountsCacheInMemory implements IImpressionCountsCacheSync {
|
|
3
|
-
protected cache: Record<string, number>;
|
|
4
|
-
private readonly maxStorage;
|
|
5
|
-
protected onFullQueue?: () => void;
|
|
6
|
-
private cacheSize;
|
|
7
|
-
constructor(impressionCountsCacheSize?: number);
|
|
8
|
-
/**
|
|
9
|
-
* Builds key to be stored in the cache with the featureName and the timeFrame truncated.
|
|
10
|
-
*/
|
|
11
|
-
private _makeKey;
|
|
12
|
-
/**
|
|
13
|
-
* Increments the quantity of impressions with the passed featureName and timeFrame.
|
|
14
|
-
*/
|
|
15
|
-
track(featureName: string, timeFrame: number, amount: number): void;
|
|
16
|
-
/**
|
|
17
|
-
* Pop the collected data, used as payload for posting.
|
|
18
|
-
*/
|
|
19
|
-
pop(toMerge?: Record<string, number>): Record<string, number>;
|
|
20
|
-
/**
|
|
21
|
-
* Clear the data stored on the cache.
|
|
22
|
-
*/
|
|
23
|
-
clear(): void;
|
|
24
|
-
/**
|
|
25
|
-
* Check if the cache is empty.
|
|
26
|
-
*/
|
|
27
|
-
isEmpty(): boolean;
|
|
28
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { IImpressionsCacheSync } from '../types';
|
|
2
|
-
import { ImpressionDTO } from '../../types';
|
|
3
|
-
export declare class ImpressionsCacheInMemory implements IImpressionsCacheSync {
|
|
4
|
-
private onFullQueue?;
|
|
5
|
-
private readonly maxQueue;
|
|
6
|
-
private queue;
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param impressionsQueueSize number of queued impressions to call onFullQueueCb.
|
|
10
|
-
* Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
|
|
11
|
-
*/
|
|
12
|
-
constructor(impressionsQueueSize?: number);
|
|
13
|
-
setOnFullQueueCb(cb: () => void): void;
|
|
14
|
-
/**
|
|
15
|
-
* Store impressions in sequential order
|
|
16
|
-
*/
|
|
17
|
-
track(data: ImpressionDTO[]): void;
|
|
18
|
-
/**
|
|
19
|
-
* Clear the data stored on the cache.
|
|
20
|
-
*/
|
|
21
|
-
clear(): void;
|
|
22
|
-
/**
|
|
23
|
-
* Pop the collected data, used as payload for posting.
|
|
24
|
-
*/
|
|
25
|
-
pop(toMerge?: ImpressionDTO[]): ImpressionDTO[];
|
|
26
|
-
/**
|
|
27
|
-
* Check if the cache is empty.
|
|
28
|
-
*/
|
|
29
|
-
isEmpty(): boolean;
|
|
30
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IStorageFactoryParams, IStorageSync } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* InMemory storage factory for standalone server-side SplitFactory
|
|
4
|
-
*
|
|
5
|
-
* @param params parameters required by EventsCacheSync
|
|
6
|
-
*/
|
|
7
|
-
export declare function InMemoryStorageFactory(params: IStorageFactoryParams): IStorageSync;
|
|
8
|
-
export declare namespace InMemoryStorageFactory {
|
|
9
|
-
var type: import("../types").StorageType;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IStorageSync, IStorageFactoryParams } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* InMemory storage factory for standalone client-side SplitFactory
|
|
4
|
-
*
|
|
5
|
-
* @param params parameters required by EventsCacheSync
|
|
6
|
-
*/
|
|
7
|
-
export declare function InMemoryStorageCSFactory(params: IStorageFactoryParams): IStorageSync;
|
|
8
|
-
export declare namespace InMemoryStorageCSFactory {
|
|
9
|
-
var type: import("../types").StorageType;
|
|
10
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AbstractMySegmentsCacheSync } from '../AbstractMySegmentsCacheSync';
|
|
2
|
-
/**
|
|
3
|
-
* Default MySegmentsCacheInMemory implementation that stores MySegments in memory.
|
|
4
|
-
* Supported by all JS runtimes.
|
|
5
|
-
*/
|
|
6
|
-
export declare class MySegmentsCacheInMemory extends AbstractMySegmentsCacheSync {
|
|
7
|
-
private segmentCache;
|
|
8
|
-
private cn?;
|
|
9
|
-
protected addSegment(name: string): boolean;
|
|
10
|
-
protected removeSegment(name: string): boolean;
|
|
11
|
-
isInSegment(name: string): boolean;
|
|
12
|
-
protected setChangeNumber(changeNumber?: number): void;
|
|
13
|
-
getChangeNumber(): number;
|
|
14
|
-
getRegisteredSegments(): string[];
|
|
15
|
-
getKeysCount(): number;
|
|
16
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ISegmentsCacheSync } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Default ISplitsCacheSync implementation for server-side that stores segments definitions in memory.
|
|
4
|
-
*/
|
|
5
|
-
export declare class SegmentsCacheInMemory implements ISegmentsCacheSync {
|
|
6
|
-
private segmentCache;
|
|
7
|
-
private segmentChangeNumber;
|
|
8
|
-
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): boolean;
|
|
9
|
-
isInSegment(name: string, key: string): boolean;
|
|
10
|
-
clear(): void;
|
|
11
|
-
private _registerSegment;
|
|
12
|
-
registerSegments(names: string[]): boolean;
|
|
13
|
-
getRegisteredSegments(): string[];
|
|
14
|
-
getKeysCount(): number;
|
|
15
|
-
getChangeNumber(name: string): number;
|
|
16
|
-
resetSegments(): boolean;
|
|
17
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ISplit, ISplitFiltersValidation } from '../../dtos/types';
|
|
2
|
-
import { AbstractSplitsCacheSync } from '../AbstractSplitsCacheSync';
|
|
3
|
-
/**
|
|
4
|
-
* Default ISplitsCacheSync implementation that stores split definitions in memory.
|
|
5
|
-
*/
|
|
6
|
-
export declare class SplitsCacheInMemory extends AbstractSplitsCacheSync {
|
|
7
|
-
private flagSetsFilter;
|
|
8
|
-
private splitsCache;
|
|
9
|
-
private ttCache;
|
|
10
|
-
private changeNumber;
|
|
11
|
-
private segmentsCount;
|
|
12
|
-
private flagSetsCache;
|
|
13
|
-
constructor(splitFiltersValidation?: ISplitFiltersValidation);
|
|
14
|
-
clear(): void;
|
|
15
|
-
addSplit(name: string, split: ISplit): boolean;
|
|
16
|
-
removeSplit(name: string): boolean;
|
|
17
|
-
getSplit(name: string): ISplit | null;
|
|
18
|
-
setChangeNumber(changeNumber: number): boolean;
|
|
19
|
-
getChangeNumber(): number;
|
|
20
|
-
getSplitNames(): string[];
|
|
21
|
-
trafficTypeExists(trafficType: string): boolean;
|
|
22
|
-
usesSegments(): boolean;
|
|
23
|
-
getNamesByFlagSets(flagSets: string[]): Set<string>[];
|
|
24
|
-
private addToFlagSets;
|
|
25
|
-
private removeFromFlagSets;
|
|
26
|
-
private removeNames;
|
|
27
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { ImpressionDataType, EventDataType, StreamingEvent, Method, OperationType, TelemetryUsageStatsPayload, UpdatesFromSSEEnum, UpdatesFromSSE } from '../../sync/submitters/types';
|
|
2
|
-
import { ISegmentsCacheSync, ISplitsCacheSync, IStorageFactoryParams, ITelemetryCacheSync } from '../types';
|
|
3
|
-
export declare const MAX_LATENCY_BUCKET_COUNT = 23;
|
|
4
|
-
export declare function newBuckets(): number[];
|
|
5
|
-
/**
|
|
6
|
-
* Record telemetry if mode is not localhost.
|
|
7
|
-
* All factory instances track telemetry on server-side, and 0.1% on client-side.
|
|
8
|
-
*/
|
|
9
|
-
export declare function shouldRecordTelemetry({ settings }: IStorageFactoryParams): boolean;
|
|
10
|
-
export declare class TelemetryCacheInMemory implements ITelemetryCacheSync {
|
|
11
|
-
private splits?;
|
|
12
|
-
private segments?;
|
|
13
|
-
private largeSegments?;
|
|
14
|
-
constructor(splits?: ISplitsCacheSync | undefined, segments?: ISegmentsCacheSync | undefined, largeSegments?: ISegmentsCacheSync | undefined);
|
|
15
|
-
private e;
|
|
16
|
-
isEmpty(): boolean;
|
|
17
|
-
clear(): void;
|
|
18
|
-
pop(): TelemetryUsageStatsPayload;
|
|
19
|
-
/** Config stats */
|
|
20
|
-
private timeUntilReady?;
|
|
21
|
-
getTimeUntilReady(): number | undefined;
|
|
22
|
-
recordTimeUntilReady(ms: number): void;
|
|
23
|
-
private timeUntilReadyFromCache?;
|
|
24
|
-
getTimeUntilReadyFromCache(): number | undefined;
|
|
25
|
-
recordTimeUntilReadyFromCache(ms: number): void;
|
|
26
|
-
private notReadyUsage;
|
|
27
|
-
getNonReadyUsage(): number;
|
|
28
|
-
recordNonReadyUsage(): void;
|
|
29
|
-
/** Usage stats */
|
|
30
|
-
private impressionStats;
|
|
31
|
-
getImpressionStats(type: ImpressionDataType): number;
|
|
32
|
-
recordImpressionStats(type: ImpressionDataType, count: number): void;
|
|
33
|
-
private eventStats;
|
|
34
|
-
getEventStats(type: EventDataType): number;
|
|
35
|
-
recordEventStats(type: EventDataType, count: number): void;
|
|
36
|
-
private lastSync;
|
|
37
|
-
getLastSynchronization(): Partial<Record<OperationType, number | undefined>>;
|
|
38
|
-
recordSuccessfulSync(resource: OperationType, timeMs: number): void;
|
|
39
|
-
private httpErrors;
|
|
40
|
-
popHttpErrors(): Partial<Record<OperationType, {
|
|
41
|
-
[statusCode: string]: number;
|
|
42
|
-
}>>;
|
|
43
|
-
recordHttpError(resource: OperationType, status: number): void;
|
|
44
|
-
private httpLatencies;
|
|
45
|
-
popHttpLatencies(): Partial<Record<OperationType, number[]>>;
|
|
46
|
-
recordHttpLatency(resource: OperationType, latencyMs: number): void;
|
|
47
|
-
private authRejections;
|
|
48
|
-
popAuthRejections(): number;
|
|
49
|
-
recordAuthRejections(): void;
|
|
50
|
-
private tokenRefreshes;
|
|
51
|
-
popTokenRefreshes(): number;
|
|
52
|
-
recordTokenRefreshes(): void;
|
|
53
|
-
private streamingEvents;
|
|
54
|
-
popStreamingEvents(): StreamingEvent[];
|
|
55
|
-
recordStreamingEvents(streamingEvent: StreamingEvent): void;
|
|
56
|
-
private tags;
|
|
57
|
-
popTags(): string[];
|
|
58
|
-
addTag(tag: string): void;
|
|
59
|
-
private sessionLength?;
|
|
60
|
-
getSessionLength(): number | undefined;
|
|
61
|
-
recordSessionLength(ms: number): void;
|
|
62
|
-
private exceptions;
|
|
63
|
-
popExceptions(): Partial<Record<Method, number>>;
|
|
64
|
-
recordException(method: Method): void;
|
|
65
|
-
private latencies;
|
|
66
|
-
popLatencies(): Partial<Record<Method, number[]>>;
|
|
67
|
-
recordLatency(method: Method, latencyMs: number): void;
|
|
68
|
-
private updatesFromSSE;
|
|
69
|
-
popUpdatesFromSSE(): UpdatesFromSSE;
|
|
70
|
-
recordUpdatesFromSSE(type: UpdatesFromSSEEnum): void;
|
|
71
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { IUniqueKeysCacheBase } from '../types';
|
|
2
|
-
import { UniqueKeysPayloadSs } from '../../sync/submitters/types';
|
|
3
|
-
/**
|
|
4
|
-
* Converts `uniqueKeys` data from cache into request payload for SS.
|
|
5
|
-
*/
|
|
6
|
-
export declare function fromUniqueKeysCollector(uniqueKeys: {
|
|
7
|
-
[featureName: string]: Set<string>;
|
|
8
|
-
}): UniqueKeysPayloadSs;
|
|
9
|
-
export declare class UniqueKeysCacheInMemory implements IUniqueKeysCacheBase {
|
|
10
|
-
protected onFullQueue?: () => void;
|
|
11
|
-
private readonly maxStorage;
|
|
12
|
-
private uniqueTrackerSize;
|
|
13
|
-
protected uniqueKeysTracker: {
|
|
14
|
-
[featureName: string]: Set<string>;
|
|
15
|
-
};
|
|
16
|
-
constructor(uniqueKeysQueueSize?: number);
|
|
17
|
-
setOnFullQueueCb(cb: () => void): void;
|
|
18
|
-
/**
|
|
19
|
-
* Store unique keys per feature.
|
|
20
|
-
*/
|
|
21
|
-
track(userKey: string, featureName: string): void;
|
|
22
|
-
/**
|
|
23
|
-
* Clear the data stored on the cache.
|
|
24
|
-
*/
|
|
25
|
-
clear(): void;
|
|
26
|
-
/**
|
|
27
|
-
* Pop the collected data, used as payload for posting.
|
|
28
|
-
*/
|
|
29
|
-
pop(): UniqueKeysPayloadSs;
|
|
30
|
-
/**
|
|
31
|
-
* Check if the cache is empty.
|
|
32
|
-
*/
|
|
33
|
-
isEmpty(): boolean;
|
|
34
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { IUniqueKeysCacheBase } from '../types';
|
|
2
|
-
import { UniqueKeysPayloadCs } from '../../sync/submitters/types';
|
|
3
|
-
export declare class UniqueKeysCacheInMemoryCS implements IUniqueKeysCacheBase {
|
|
4
|
-
private onFullQueue?;
|
|
5
|
-
private readonly maxStorage;
|
|
6
|
-
private uniqueTrackerSize;
|
|
7
|
-
private uniqueKeysTracker;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param impressionsQueueSize number of queued impressions to call onFullQueueCb.
|
|
11
|
-
* Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
|
|
12
|
-
*/
|
|
13
|
-
constructor(uniqueKeysQueueSize?: number);
|
|
14
|
-
setOnFullQueueCb(cb: () => void): void;
|
|
15
|
-
/**
|
|
16
|
-
* Store unique keys per feature.
|
|
17
|
-
*/
|
|
18
|
-
track(userKey: string, featureName: string): void;
|
|
19
|
-
/**
|
|
20
|
-
* Clear the data stored on the cache.
|
|
21
|
-
*/
|
|
22
|
-
clear(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Pop the collected data, used as payload for posting.
|
|
25
|
-
*/
|
|
26
|
-
pop(): UniqueKeysPayloadCs;
|
|
27
|
-
/**
|
|
28
|
-
* Check if the cache is empty.
|
|
29
|
-
*/
|
|
30
|
-
isEmpty(): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Converts `uniqueKeys` data from cache into request payload.
|
|
33
|
-
*/
|
|
34
|
-
private fromUniqueKeysCollector;
|
|
35
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { IEventsCacheAsync } from '../types';
|
|
2
|
-
import { IMetadata } from '../../dtos/types';
|
|
3
|
-
import { SplitIO } from '../../types';
|
|
4
|
-
import { ILogger } from '../../logger/types';
|
|
5
|
-
import { StoredEventWithMetadata } from '../../sync/submitters/types';
|
|
6
|
-
import type { RedisAdapter } from './RedisAdapter';
|
|
7
|
-
export declare class EventsCacheInRedis implements IEventsCacheAsync {
|
|
8
|
-
private readonly log;
|
|
9
|
-
private readonly key;
|
|
10
|
-
private readonly redis;
|
|
11
|
-
private readonly metadata;
|
|
12
|
-
constructor(log: ILogger, key: string, redis: RedisAdapter, metadata: IMetadata);
|
|
13
|
-
/**
|
|
14
|
-
* Add a new event object into the queue.
|
|
15
|
-
* Unlike `impressions::track`, result promise is never rejected.
|
|
16
|
-
*/
|
|
17
|
-
track(eventData: SplitIO.EventData): Promise<boolean>;
|
|
18
|
-
/**
|
|
19
|
-
* Generates the JSON as we'll store it on Redis.
|
|
20
|
-
*/
|
|
21
|
-
private _toJSON;
|
|
22
|
-
count(): Promise<number>;
|
|
23
|
-
drop(count?: number): Promise<any>;
|
|
24
|
-
/**
|
|
25
|
-
* Pop the given number of events from the storage.
|
|
26
|
-
* The returned promise rejects if the redis operation fails.
|
|
27
|
-
*
|
|
28
|
-
* NOTE: this method doesn't take into account MAX_EVENT_SIZE or MAX_QUEUE_BYTE_SIZE limits.
|
|
29
|
-
* It is the submitter responsability to handle that.
|
|
30
|
-
*/
|
|
31
|
-
popNWithMetadata(count: number): Promise<StoredEventWithMetadata[]>;
|
|
32
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="ioredis" />
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
|
-
import { ImpressionCountsPayload } from '../../sync/submitters/types';
|
|
4
|
-
import { ImpressionCountsCacheInMemory } from '../inMemory/ImpressionCountsCacheInMemory';
|
|
5
|
-
import type { RedisAdapter } from './RedisAdapter';
|
|
6
|
-
export declare class ImpressionCountsCacheInRedis extends ImpressionCountsCacheInMemory {
|
|
7
|
-
private readonly log;
|
|
8
|
-
private readonly key;
|
|
9
|
-
private readonly redis;
|
|
10
|
-
private readonly refreshRate;
|
|
11
|
-
private intervalId;
|
|
12
|
-
constructor(log: ILogger, key: string, redis: RedisAdapter, impressionCountsCacheSize?: number, refreshRate?: number);
|
|
13
|
-
private postImpressionCountsInRedis;
|
|
14
|
-
start(): void;
|
|
15
|
-
stop(): Promise<boolean | import("ioredis").BooleanResponse | undefined>;
|
|
16
|
-
getImpressionsCount(): Promise<ImpressionCountsPayload | undefined>;
|
|
17
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IImpressionsCacheAsync } from '../types';
|
|
2
|
-
import { IMetadata } from '../../dtos/types';
|
|
3
|
-
import { ImpressionDTO } from '../../types';
|
|
4
|
-
import { StoredImpressionWithMetadata } from '../../sync/submitters/types';
|
|
5
|
-
import { ILogger } from '../../logger/types';
|
|
6
|
-
import type { RedisAdapter } from './RedisAdapter';
|
|
7
|
-
export declare class ImpressionsCacheInRedis implements IImpressionsCacheAsync {
|
|
8
|
-
private readonly log;
|
|
9
|
-
private readonly key;
|
|
10
|
-
private readonly redis;
|
|
11
|
-
private readonly metadata;
|
|
12
|
-
constructor(log: ILogger, key: string, redis: RedisAdapter, metadata: IMetadata);
|
|
13
|
-
track(impressions: ImpressionDTO[]): Promise<void>;
|
|
14
|
-
count(): Promise<number>;
|
|
15
|
-
drop(count?: number): Promise<any>;
|
|
16
|
-
popNWithMetadata(count: number): Promise<StoredImpressionWithMetadata[]>;
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import ioredis from 'ioredis';
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
|
-
/**
|
|
4
|
-
* Redis adapter on top of the library of choice (written with ioredis) for some extra control.
|
|
5
|
-
*/
|
|
6
|
-
export declare class RedisAdapter extends ioredis {
|
|
7
|
-
private readonly log;
|
|
8
|
-
private _options;
|
|
9
|
-
private _notReadyCommandsQueue?;
|
|
10
|
-
private _runningCommands;
|
|
11
|
-
constructor(log: ILogger, storageSettings?: Record<string, any>);
|
|
12
|
-
_listenToEvents(): void;
|
|
13
|
-
_setTimeoutWrappers(): void;
|
|
14
|
-
_setDisconnectWrapper(): void;
|
|
15
|
-
/**
|
|
16
|
-
* Receives the options and returns an array of parameters for the ioredis constructor.
|
|
17
|
-
* Keeping both redis setup options for backwards compatibility.
|
|
18
|
-
*/
|
|
19
|
-
static _defineLibrarySettings(options: Record<string, any>): any[];
|
|
20
|
-
/**
|
|
21
|
-
* Parses the options into what we care about.
|
|
22
|
-
*/
|
|
23
|
-
static _defineOptions({ connectionTimeout, operationTimeout, url, host, port, db, pass, tls }: Record<string, any>): object;
|
|
24
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../logger/types';
|
|
2
|
-
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
3
|
-
import { ISegmentsCacheAsync } from '../types';
|
|
4
|
-
import type { RedisAdapter } from './RedisAdapter';
|
|
5
|
-
export declare class SegmentsCacheInRedis implements ISegmentsCacheAsync {
|
|
6
|
-
private readonly log;
|
|
7
|
-
private readonly redis;
|
|
8
|
-
private readonly keys;
|
|
9
|
-
constructor(log: ILogger, keys: KeyBuilderSS, redis: RedisAdapter);
|
|
10
|
-
/**
|
|
11
|
-
* Update the given segment `name` with the lists of `addedKeys`, `removedKeys` and `changeNumber`.
|
|
12
|
-
* The returned promise is resolved if the operation success, with `true` if the segment was updated (i.e., some key was added or removed),
|
|
13
|
-
* or rejected if it fails (e.g., Redis operation fails).
|
|
14
|
-
*/
|
|
15
|
-
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): Promise<boolean>;
|
|
16
|
-
isInSegment(name: string, key: string): Promise<boolean>;
|
|
17
|
-
getChangeNumber(name: string): Promise<number>;
|
|
18
|
-
registerSegments(segments: string[]): Promise<boolean>;
|
|
19
|
-
getRegisteredSegments(): Promise<string[]>;
|
|
20
|
-
clear(): Promise<void>;
|
|
21
|
-
}
|