@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,67 +0,0 @@
|
|
|
1
|
-
import { IEventEmitter, IStatusInterface } from '../types';
|
|
2
|
-
/** Splits data emitter */
|
|
3
|
-
declare type SDK_SPLITS_ARRIVED = 'state::splits-arrived';
|
|
4
|
-
declare type SDK_SPLITS_CACHE_LOADED = 'state::splits-cache-loaded';
|
|
5
|
-
declare type ISplitsEvent = SDK_SPLITS_ARRIVED | SDK_SPLITS_CACHE_LOADED;
|
|
6
|
-
export interface ISplitsEventEmitter extends IEventEmitter {
|
|
7
|
-
emit(event: ISplitsEvent, ...args: any[]): boolean;
|
|
8
|
-
on(event: ISplitsEvent, listener: (...args: any[]) => void): this;
|
|
9
|
-
once(event: ISplitsEvent, listener: (...args: any[]) => void): this;
|
|
10
|
-
splitsArrived: boolean;
|
|
11
|
-
splitsCacheLoaded: boolean;
|
|
12
|
-
initialized: boolean;
|
|
13
|
-
initCallbacks: (() => void)[];
|
|
14
|
-
}
|
|
15
|
-
/** Segments data emitter */
|
|
16
|
-
declare type SDK_SEGMENTS_ARRIVED = 'state::segments-arrived';
|
|
17
|
-
declare type ISegmentsEvent = SDK_SEGMENTS_ARRIVED;
|
|
18
|
-
export interface ISegmentsEventEmitter extends IEventEmitter {
|
|
19
|
-
emit(event: ISegmentsEvent, ...args: any[]): boolean;
|
|
20
|
-
on(event: ISegmentsEvent, listener: (...args: any[]) => void): this;
|
|
21
|
-
once(event: ISegmentsEvent, listener: (...args: any[]) => void): this;
|
|
22
|
-
segmentsArrived: boolean;
|
|
23
|
-
}
|
|
24
|
-
/** Readiness emitter */
|
|
25
|
-
export declare type SDK_READY_TIMED_OUT = 'init::timeout';
|
|
26
|
-
export declare type SDK_READY = 'init::ready';
|
|
27
|
-
export declare type SDK_READY_FROM_CACHE = 'init::cache-ready';
|
|
28
|
-
export declare type SDK_UPDATE = 'state::update';
|
|
29
|
-
export declare type SDK_DESTROY = 'state::destroy';
|
|
30
|
-
export declare type IReadinessEvent = SDK_READY_TIMED_OUT | SDK_READY | SDK_READY_FROM_CACHE | SDK_UPDATE | SDK_DESTROY;
|
|
31
|
-
export interface IReadinessEventEmitter extends IEventEmitter {
|
|
32
|
-
emit(event: IReadinessEvent, ...args: any[]): boolean;
|
|
33
|
-
}
|
|
34
|
-
/** Readiness manager */
|
|
35
|
-
export interface IReadinessManager {
|
|
36
|
-
/** Event emitters */
|
|
37
|
-
splits: ISplitsEventEmitter;
|
|
38
|
-
segments: ISegmentsEventEmitter;
|
|
39
|
-
gate: IReadinessEventEmitter;
|
|
40
|
-
/** Readiness status */
|
|
41
|
-
isReady(): boolean;
|
|
42
|
-
isReadyFromCache(): boolean;
|
|
43
|
-
isTimedout(): boolean;
|
|
44
|
-
hasTimedout(): boolean;
|
|
45
|
-
isDestroyed(): boolean;
|
|
46
|
-
isOperational(): boolean;
|
|
47
|
-
lastUpdate(): number;
|
|
48
|
-
timeout(): void;
|
|
49
|
-
setDestroyed(): void;
|
|
50
|
-
destroy(): void;
|
|
51
|
-
init(): void;
|
|
52
|
-
/** for client-side */
|
|
53
|
-
shared(): IReadinessManager;
|
|
54
|
-
}
|
|
55
|
-
/** SDK readiness manager */
|
|
56
|
-
export interface ISdkReadinessManager {
|
|
57
|
-
readinessManager: IReadinessManager;
|
|
58
|
-
sdkStatus: IStatusInterface;
|
|
59
|
-
/**
|
|
60
|
-
* Increment internalReadyCbCount, an offset value of SDK_READY listeners that are added/removed internally
|
|
61
|
-
* by the SDK. It is required to properly log the warning 'No listeners for SDK Readiness detected'
|
|
62
|
-
*/
|
|
63
|
-
incInternalReadyCbCount(): void;
|
|
64
|
-
/** for client-side */
|
|
65
|
-
shared(): ISdkReadinessManager;
|
|
66
|
-
}
|
|
67
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../types';
|
|
2
|
-
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
3
|
-
/**
|
|
4
|
-
* Creator of base client with getTreatments and track methods.
|
|
5
|
-
*/
|
|
6
|
-
export declare function clientFactory(params: ISdkFactoryContext): SplitIO.IClient | SplitIO.IAsyncClient;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../types';
|
|
2
|
-
import { ILogger } from '../logger/types';
|
|
3
|
-
/**
|
|
4
|
-
* Add in memory attributes storage methods and combine them with any attribute received from the getTreatment/s call
|
|
5
|
-
*/
|
|
6
|
-
export declare function clientAttributesDecoration<TClient extends SplitIO.IClient | SplitIO.IAsyncClient>(log: ILogger, client: TClient): TClient & {
|
|
7
|
-
getTreatment: (maybeKey: SplitIO.SplitKey, maybeFeatureFlagName: string, maybeAttributes?: SplitIO.Attributes | undefined) => string | SplitIO.AsyncTreatment;
|
|
8
|
-
getTreatmentWithConfig: (maybeKey: SplitIO.SplitKey, maybeFeatureFlagName: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentWithConfig | SplitIO.AsyncTreatmentWithConfig;
|
|
9
|
-
getTreatments: (maybeKey: SplitIO.SplitKey, maybeFeatureFlagNames: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
|
|
10
|
-
getTreatmentsWithConfig: (maybeKey: SplitIO.SplitKey, maybeFeatureFlagNames: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
|
|
11
|
-
getTreatmentsByFlagSets: (maybeKey: SplitIO.SplitKey, maybeFlagSets: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
|
|
12
|
-
getTreatmentsWithConfigByFlagSets: (maybeKey: SplitIO.SplitKey, maybeFlagSets: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
|
|
13
|
-
getTreatmentsByFlagSet: (maybeKey: SplitIO.SplitKey, maybeFlagSet: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
|
|
14
|
-
getTreatmentsWithConfigByFlagSet: (maybeKey: SplitIO.SplitKey, maybeFlagSet: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
|
|
15
|
-
track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) => boolean | Promise<boolean>;
|
|
16
|
-
/**
|
|
17
|
-
* Add an attribute to client's in memory attributes storage
|
|
18
|
-
*
|
|
19
|
-
* @param {string} attributeName Attrinute name
|
|
20
|
-
* @param {string, number, boolean, list} attributeValue Attribute value
|
|
21
|
-
* @returns {boolean} true if the attribute was stored and false otherways
|
|
22
|
-
*/
|
|
23
|
-
setAttribute(attributeName: string, attributeValue: SplitIO.AttributeType): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Returns the attribute with the given name
|
|
26
|
-
*
|
|
27
|
-
* @param {string} attributeName Attribute name
|
|
28
|
-
* @returns {Object} Attribute with the given name
|
|
29
|
-
*/
|
|
30
|
-
getAttribute(attributeName: string): SplitIO.AttributeType;
|
|
31
|
-
/**
|
|
32
|
-
* Add to client's in memory attributes storage the attributes in 'attributes'
|
|
33
|
-
*
|
|
34
|
-
* @param {Object} attributes Object with attributes to store
|
|
35
|
-
* @returns true if attributes were stored an false otherways
|
|
36
|
-
*/
|
|
37
|
-
setAttributes(attributes: Record<string, Object>): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Return all the attributes stored in client's in memory attributes storage
|
|
40
|
-
*
|
|
41
|
-
* @returns {Object} returns all the stored attributes
|
|
42
|
-
*/
|
|
43
|
-
getAttributes(): Record<string, SplitIO.AttributeType>;
|
|
44
|
-
/**
|
|
45
|
-
* Removes from client's in memory attributes storage the attribute with the given name
|
|
46
|
-
*
|
|
47
|
-
* @param {string} attributeName
|
|
48
|
-
* @returns {boolean} true if attribute was removed and false otherways
|
|
49
|
-
*/
|
|
50
|
-
removeAttribute(attributeName: string): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Remove all the stored attributes in the client's in memory attribute storage
|
|
53
|
-
*/
|
|
54
|
-
clearAttributes(): boolean;
|
|
55
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../logger/types';
|
|
2
|
-
import { SplitIO } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Decorator that binds a key to client methods
|
|
5
|
-
*
|
|
6
|
-
* @param client sync client instance
|
|
7
|
-
* @param key validated split key
|
|
8
|
-
*/
|
|
9
|
-
export declare function clientCSDecorator(log: ILogger, client: SplitIO.IClient, key: SplitIO.SplitKey): SplitIO.ICsClient;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IReadinessManager } from '../readiness/types';
|
|
2
|
-
import { ISettings, SplitIO } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Decorator that validates the input before actually executing the client methods.
|
|
5
|
-
* We should "guard" the client here, while not polluting the "real" implementation of those methods.
|
|
6
|
-
*/
|
|
7
|
-
export declare function clientInputValidationDecorator<TClient extends SplitIO.IClient | SplitIO.IAsyncClient>(settings: ISettings, client: TClient, readinessManager: IReadinessManager): TClient;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../types';
|
|
2
|
-
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
3
|
-
/**
|
|
4
|
-
* Creates an Sdk client, i.e., a base client with status and destroy interface
|
|
5
|
-
*/
|
|
6
|
-
export declare function sdkClientFactory(params: ISdkFactoryContext, isSharedClient?: boolean): SplitIO.IClient | SplitIO.IAsyncClient;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../types';
|
|
2
|
-
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
3
|
-
/**
|
|
4
|
-
* Factory of client method for server-side SDKs
|
|
5
|
-
*/
|
|
6
|
-
export declare function sdkClientMethodFactory(params: ISdkFactoryContext): () => SplitIO.IClient | SplitIO.IAsyncClient;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../types';
|
|
2
|
-
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
3
|
-
/**
|
|
4
|
-
* Factory of client method for the client-side API variant where TT is ignored.
|
|
5
|
-
* Therefore, clients don't have a bound TT for the track method.
|
|
6
|
-
*/
|
|
7
|
-
export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitIO.SplitKey) => SplitIO.ICsClient;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SplitIO } from '../types';
|
|
2
|
-
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
3
|
-
/**
|
|
4
|
-
* Factory of client method for the client-side (browser) variant of the Isomorphic JS SDK,
|
|
5
|
-
* where clients can have a bound TT for the track method, which is provided via the settings
|
|
6
|
-
* (default client) or the client method (shared clients).
|
|
7
|
-
*/
|
|
8
|
-
export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitIO.SplitKey, trafficType?: string) => SplitIO.ICsClient;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { IIntegrationManager, IIntegrationFactoryParams } from '../integrations/types';
|
|
2
|
-
import { ISignalListener } from '../listeners/types';
|
|
3
|
-
import { IReadinessManager, ISdkReadinessManager } from '../readiness/types';
|
|
4
|
-
import type { sdkManagerFactory } from '../sdkManager';
|
|
5
|
-
import type { splitApiFactory } from '../services/splitApi';
|
|
6
|
-
import { IFetch, ISplitApi, IEventSourceConstructor } from '../services/types';
|
|
7
|
-
import { IStorageAsync, IStorageSync, IStorageFactoryParams } from '../storages/types';
|
|
8
|
-
import { ISyncManager } from '../sync/types';
|
|
9
|
-
import { IImpressionObserver } from '../trackers/impressionObserver/types';
|
|
10
|
-
import { IImpressionsTracker, IEventTracker, ITelemetryTracker, IFilterAdapter, IUniqueKeysTracker } from '../trackers/types';
|
|
11
|
-
import { SplitIO, ISettings, IEventEmitter, IBasicClient } from '../types';
|
|
12
|
-
/**
|
|
13
|
-
* Environment related dependencies.
|
|
14
|
-
*/
|
|
15
|
-
export interface IPlatform {
|
|
16
|
-
/**
|
|
17
|
-
* If provided, it is used to retrieve the Fetch API for HTTP requests. Otherwise, the global fetch is used.
|
|
18
|
-
*/
|
|
19
|
-
getFetch?: (settings: ISettings) => (IFetch | undefined);
|
|
20
|
-
/**
|
|
21
|
-
* If provided, it is used to pass additional options to fetch and eventsource calls.
|
|
22
|
-
*/
|
|
23
|
-
getOptions?: (settings: ISettings) => object;
|
|
24
|
-
/**
|
|
25
|
-
* If provided, it is used to retrieve the EventSource constructor for streaming support.
|
|
26
|
-
*/
|
|
27
|
-
getEventSource?: (settings: ISettings) => (IEventSourceConstructor | undefined);
|
|
28
|
-
/**
|
|
29
|
-
* EventEmitter constructor, like NodeJS.EventEmitter or a polyfill.
|
|
30
|
-
*/
|
|
31
|
-
EventEmitter: new () => IEventEmitter;
|
|
32
|
-
/**
|
|
33
|
-
* Function used to track latencies for telemetry.
|
|
34
|
-
*/
|
|
35
|
-
now?: () => number;
|
|
36
|
-
}
|
|
37
|
-
export interface ISdkFactoryContext {
|
|
38
|
-
platform: IPlatform;
|
|
39
|
-
sdkReadinessManager: ISdkReadinessManager;
|
|
40
|
-
readiness: IReadinessManager;
|
|
41
|
-
settings: ISettings;
|
|
42
|
-
impressionsTracker: IImpressionsTracker;
|
|
43
|
-
eventTracker: IEventTracker;
|
|
44
|
-
telemetryTracker: ITelemetryTracker;
|
|
45
|
-
storage: IStorageSync | IStorageAsync;
|
|
46
|
-
uniqueKeysTracker?: IUniqueKeysTracker;
|
|
47
|
-
signalListener?: ISignalListener;
|
|
48
|
-
splitApi?: ISplitApi;
|
|
49
|
-
syncManager?: ISyncManager;
|
|
50
|
-
clients: Record<string, IBasicClient>;
|
|
51
|
-
}
|
|
52
|
-
export interface ISdkFactoryContextSync extends ISdkFactoryContext {
|
|
53
|
-
storage: IStorageSync;
|
|
54
|
-
splitApi: ISplitApi;
|
|
55
|
-
syncManager: ISyncManager;
|
|
56
|
-
}
|
|
57
|
-
export interface ISdkFactoryContextAsync extends ISdkFactoryContext {
|
|
58
|
-
storage: IStorageAsync;
|
|
59
|
-
splitApi: undefined;
|
|
60
|
-
syncManager: undefined;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Object parameter with the modules required to create an SDK factory instance
|
|
64
|
-
*/
|
|
65
|
-
export interface ISdkFactoryParams {
|
|
66
|
-
lazyInit?: boolean;
|
|
67
|
-
settings: ISettings;
|
|
68
|
-
platform: IPlatform;
|
|
69
|
-
storageFactory: (params: IStorageFactoryParams) => IStorageSync | IStorageAsync;
|
|
70
|
-
splitApiFactory?: typeof splitApiFactory;
|
|
71
|
-
syncManagerFactory?: (params: ISdkFactoryContextSync) => ISyncManager;
|
|
72
|
-
sdkManagerFactory: typeof sdkManagerFactory;
|
|
73
|
-
sdkClientMethodFactory: (params: ISdkFactoryContext) => ({
|
|
74
|
-
(): SplitIO.ICsClient;
|
|
75
|
-
(key: SplitIO.SplitKey): SplitIO.ICsClient;
|
|
76
|
-
} | (() => SplitIO.IClient) | (() => SplitIO.IAsyncClient));
|
|
77
|
-
impressionsObserverFactory: () => IImpressionObserver;
|
|
78
|
-
filterAdapterFactory?: () => IFilterAdapter;
|
|
79
|
-
SignalListener?: new (syncManager: ISyncManager | undefined, // Used by NodeSignalListener to flush data, and by BrowserSignalListener to close streaming connection.
|
|
80
|
-
settings: ISettings, // Used by BrowserSignalListener
|
|
81
|
-
storage: IStorageSync | IStorageAsync, // Used by BrowserSignalListener
|
|
82
|
-
serviceApi: ISplitApi | undefined) => ISignalListener;
|
|
83
|
-
integrationsManagerFactory?: (params: IIntegrationFactoryParams) => IIntegrationManager | undefined;
|
|
84
|
-
extraProps?: (params: ISdkFactoryContext) => object;
|
|
85
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ISplitsCacheAsync, ISplitsCacheSync } from '../storages/types';
|
|
2
|
-
import { ISdkReadinessManager } from '../readiness/types';
|
|
3
|
-
import { ISettings, SplitIO } from '../types';
|
|
4
|
-
export declare function sdkManagerFactory<TSplitCache extends ISplitsCacheSync | ISplitsCacheAsync>(settings: Pick<ISettings, 'log' | 'mode'>, splits: TSplitCache, { readinessManager, sdkStatus }: ISdkReadinessManager): TSplitCache extends ISplitsCacheAsync ? SplitIO.IAsyncManager : SplitIO.IManager;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IPlatform } from '../sdkFactory/types';
|
|
2
|
-
import { ISettings } from '../types';
|
|
3
|
-
import { ISplitApi } from './types';
|
|
4
|
-
import { ITelemetryTracker } from '../trackers/types';
|
|
5
|
-
/**
|
|
6
|
-
* Factory of SplitApi objects, which group the collection of Split HTTP endpoints used by the SDK
|
|
7
|
-
*
|
|
8
|
-
* @param settings validated settings object
|
|
9
|
-
* @param platform object containing environment-specific dependencies
|
|
10
|
-
* @param telemetryTracker telemetry tracker
|
|
11
|
-
*/
|
|
12
|
-
export declare function splitApiFactory(settings: ISettings, platform: Pick<IPlatform, 'getOptions' | 'getFetch'>, telemetryTracker: ITelemetryTracker): ISplitApi;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ISplitHttpClient } from './types';
|
|
2
|
-
import { ISettings } from '../types';
|
|
3
|
-
import { IPlatform } from '../sdkFactory/types';
|
|
4
|
-
/**
|
|
5
|
-
* Factory of Split HTTP clients, which are HTTP clients with predefined headers for Split endpoints.
|
|
6
|
-
*
|
|
7
|
-
* @param settings SDK settings, used to access authorizationKey, logger instance and metadata (SDK version, ip and hostname) to set additional headers
|
|
8
|
-
* @param platform object containing environment-specific dependencies
|
|
9
|
-
*/
|
|
10
|
-
export declare function splitHttpClientFactory(settings: ISettings, { getOptions, getFetch }: Pick<IPlatform, 'getOptions' | 'getFetch'>): ISplitHttpClient;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export declare type IRequestOptions = {
|
|
2
|
-
method?: string;
|
|
3
|
-
headers?: Record<string, string>;
|
|
4
|
-
body?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare type IResponse = {
|
|
7
|
-
ok: boolean;
|
|
8
|
-
status: number;
|
|
9
|
-
json: () => Promise<any>;
|
|
10
|
-
text: () => Promise<string>;
|
|
11
|
-
};
|
|
12
|
-
export declare type NetworkError = Error & {
|
|
13
|
-
statusCode?: number;
|
|
14
|
-
};
|
|
15
|
-
export declare type IFetch = (url: string, options?: IRequestOptions) => Promise<IResponse>;
|
|
16
|
-
export declare type IHealthCheckAPI = () => Promise<boolean>;
|
|
17
|
-
export declare type ISplitHttpClient = (url: string, options?: IRequestOptions, latencyTracker?: (error?: NetworkError) => void, logErrorsAsInfo?: boolean) => Promise<IResponse>;
|
|
18
|
-
export declare type IFetchAuth = (userKeys?: string[]) => Promise<IResponse>;
|
|
19
|
-
export declare type IFetchSplitChanges = (since: number, noCache?: boolean, till?: number) => Promise<IResponse>;
|
|
20
|
-
export declare type IFetchSegmentChanges = (since: number, segmentName: string, noCache?: boolean, till?: number) => Promise<IResponse>;
|
|
21
|
-
export declare type IFetchMemberships = (userMatchingKey: string, noCache?: boolean, till?: number) => Promise<IResponse>;
|
|
22
|
-
export declare type IPostEventsBulk = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
23
|
-
export declare type IPostUniqueKeysBulkCs = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
24
|
-
export declare type IPostUniqueKeysBulkSs = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
25
|
-
export declare type IPostTestImpressionsBulk = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
26
|
-
export declare type IPostTestImpressionsCount = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
27
|
-
export declare type IPostMetricsConfig = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
28
|
-
export declare type IPostMetricsUsage = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
|
|
29
|
-
export interface ISplitApi {
|
|
30
|
-
getSdkAPIHealthCheck: IHealthCheckAPI;
|
|
31
|
-
getEventsAPIHealthCheck: IHealthCheckAPI;
|
|
32
|
-
fetchAuth: IFetchAuth;
|
|
33
|
-
fetchSplitChanges: IFetchSplitChanges;
|
|
34
|
-
fetchSegmentChanges: IFetchSegmentChanges;
|
|
35
|
-
fetchMemberships: IFetchMemberships;
|
|
36
|
-
postEventsBulk: IPostEventsBulk;
|
|
37
|
-
postUniqueKeysBulkCs: IPostUniqueKeysBulkCs;
|
|
38
|
-
postUniqueKeysBulkSs: IPostUniqueKeysBulkSs;
|
|
39
|
-
postTestImpressionsBulk: IPostTestImpressionsBulk;
|
|
40
|
-
postTestImpressionsCount: IPostTestImpressionsCount;
|
|
41
|
-
postMetricsConfig: IPostMetricsConfig;
|
|
42
|
-
postMetricsUsage: IPostMetricsUsage;
|
|
43
|
-
}
|
|
44
|
-
interface EventSourceEventMap {
|
|
45
|
-
'error': Event;
|
|
46
|
-
'message': MessageEvent;
|
|
47
|
-
'open': Event;
|
|
48
|
-
}
|
|
49
|
-
interface IEventSource {
|
|
50
|
-
addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: IEventSource, ev: EventSourceEventMap[K]) => any): void;
|
|
51
|
-
close(): void;
|
|
52
|
-
}
|
|
53
|
-
export declare type IEventSourceConstructor = new (url: string, eventSourceInitDict?: any) => IEventSource;
|
|
54
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { IMySegmentsResponse } from '../dtos/types';
|
|
2
|
-
import { MySegmentsData } from '../sync/polling/types';
|
|
3
|
-
import { ISegmentsCacheSync } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* This class provides a skeletal implementation of the ISegmentsCacheSync interface
|
|
6
|
-
* to minimize the effort required to implement this interface.
|
|
7
|
-
*/
|
|
8
|
-
export declare abstract class AbstractMySegmentsCacheSync implements ISegmentsCacheSync {
|
|
9
|
-
protected abstract addSegment(name: string): boolean;
|
|
10
|
-
protected abstract removeSegment(name: string): boolean;
|
|
11
|
-
protected abstract setChangeNumber(changeNumber?: number): boolean | void;
|
|
12
|
-
/**
|
|
13
|
-
* For server-side synchronizer: check if `key` is in `name` segment.
|
|
14
|
-
* For client-side synchronizer: check if `name` segment is in the cache. `key` is undefined.
|
|
15
|
-
*/
|
|
16
|
-
abstract isInSegment(name: string, key?: string): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* clear the cache.
|
|
19
|
-
*/
|
|
20
|
-
clear(): void;
|
|
21
|
-
registerSegments(): boolean;
|
|
22
|
-
update(): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* For server-side synchronizer: get the list of segments to fetch changes.
|
|
25
|
-
* Also used for the `seC` (segment count) telemetry stat.
|
|
26
|
-
*/
|
|
27
|
-
abstract getRegisteredSegments(): string[];
|
|
28
|
-
/**
|
|
29
|
-
* Only used for the `skC`(segment keys count) telemetry stat: 1 for client-side, and total count of keys in server-side.
|
|
30
|
-
* @TODO for client-side it should be the number of clients, but it requires a refactor of MySegments caches to simplify the code.
|
|
31
|
-
*/
|
|
32
|
-
abstract getKeysCount(): number;
|
|
33
|
-
abstract getChangeNumber(name: string): number;
|
|
34
|
-
/**
|
|
35
|
-
* For server-side synchronizer: the method is not used.
|
|
36
|
-
* For client-side synchronizer: it resets or updates the cache.
|
|
37
|
-
*/
|
|
38
|
-
resetSegments(segmentsData: MySegmentsData | IMySegmentsResponse): boolean;
|
|
39
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { IMySegmentsResponse } from '../dtos/types';
|
|
2
|
-
import { MySegmentsData } from '../sync/polling/types';
|
|
3
|
-
import { ISegmentsCacheSync } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* This class provides a skeletal implementation of the ISegmentsCacheSync interface
|
|
6
|
-
* to minimize the effort required to implement this interface.
|
|
7
|
-
*/
|
|
8
|
-
export declare abstract class AbstractSegmentsCacheSync implements ISegmentsCacheSync {
|
|
9
|
-
/**
|
|
10
|
-
* For server-side synchronizer: add `segmentKeys` list of keys to `name` segment.
|
|
11
|
-
* For client-side synchronizer: add `name` segment to the cache. `segmentKeys` is undefined.
|
|
12
|
-
*/
|
|
13
|
-
abstract addToSegment(name: string, segmentKeys?: string[]): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* For server-side synchronizer: remove `segmentKeys` list of keys from `name` segment.
|
|
16
|
-
* For client-side synchronizer: remove `name` segment from the cache. `segmentKeys` is undefined.
|
|
17
|
-
*/
|
|
18
|
-
abstract removeFromSegment(name: string, segmentKeys?: string[]): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* For server-side synchronizer: check if `key` is in `name` segment.
|
|
21
|
-
* For client-side synchronizer: check if `name` segment is in the cache. `key` is undefined.
|
|
22
|
-
*/
|
|
23
|
-
abstract isInSegment(name: string, key?: string): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* clear the cache.
|
|
26
|
-
*/
|
|
27
|
-
clear(): void;
|
|
28
|
-
/**
|
|
29
|
-
* For server-side synchronizer: add the given list of segments to the cache, with an empty list of keys. The segments that already exist are not modified.
|
|
30
|
-
* For client-side synchronizer: the method is not used.
|
|
31
|
-
*/
|
|
32
|
-
registerSegments(names: string[]): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* For server-side synchronizer: get the list of segments to fetch changes.
|
|
35
|
-
* Also used for the `seC` (segment count) telemetry stat.
|
|
36
|
-
*/
|
|
37
|
-
abstract getRegisteredSegments(): string[];
|
|
38
|
-
/**
|
|
39
|
-
* Only used for the `skC`(segment keys count) telemetry stat: 1 for client-side, and total count of keys in server-side.
|
|
40
|
-
* @TODO for client-side it should be the number of clients, but it requires a refactor of MySegments caches to simplify the code.
|
|
41
|
-
*/
|
|
42
|
-
abstract getKeysCount(): number;
|
|
43
|
-
/**
|
|
44
|
-
* For server-side synchronizer: change number of `name` segment.
|
|
45
|
-
* For client-side synchronizer: change number of mySegments.
|
|
46
|
-
*/
|
|
47
|
-
abstract setChangeNumber(name?: string, changeNumber?: number): boolean | void;
|
|
48
|
-
abstract getChangeNumber(name: string): number;
|
|
49
|
-
/**
|
|
50
|
-
* For server-side synchronizer: the method is not used.
|
|
51
|
-
* For client-side synchronizer: it resets or updates the cache.
|
|
52
|
-
*/
|
|
53
|
-
resetSegments(segmentsData: MySegmentsData | IMySegmentsResponse): boolean;
|
|
54
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ISplit, MaybeThenable } from '../dtos/types';
|
|
2
|
-
/**
|
|
3
|
-
* This class provides a skeletal implementation of the ISplitsCacheAsync interface
|
|
4
|
-
* to minimize the effort required to implement this interface.
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class AbstractSplitsCache {
|
|
7
|
-
/**
|
|
8
|
-
* Check if the splits information is already stored in cache. This data can be preloaded.
|
|
9
|
-
* It is used as condition to emit SDK_SPLITS_CACHE_LOADED, and then SDK_READY_FROM_CACHE.
|
|
10
|
-
*/
|
|
11
|
-
checkCache(): boolean;
|
|
12
|
-
protected abstract addSplit(name: string, split: ISplit): MaybeThenable<boolean>;
|
|
13
|
-
/**
|
|
14
|
-
* Add a list of splits.
|
|
15
|
-
* The returned promise is resolved when the operation success or rejected if it fails (e.g., wrapper operation fails).
|
|
16
|
-
*/
|
|
17
|
-
protected addSplits(entries: [string, ISplit][]): Promise<boolean[]>;
|
|
18
|
-
protected abstract removeSplit(name: string): MaybeThenable<boolean>;
|
|
19
|
-
/**
|
|
20
|
-
* Remove a list of splits.
|
|
21
|
-
* The returned promise is resolved when the operation success, with a boolean array indicating if the splits existed or not.
|
|
22
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
23
|
-
*/
|
|
24
|
-
protected removeSplits(names: string[]): Promise<boolean[]>;
|
|
25
|
-
protected abstract setChangeNumber(changeNumber: number): MaybeThenable<boolean | void>;
|
|
26
|
-
/**
|
|
27
|
-
* Updates the cache with the provided changeNumber, feature flags to add and feature flags to remove.
|
|
28
|
-
*
|
|
29
|
-
* @returns {Promise<boolean>} a promise that resolved once the operation is performed successfully. The fulfillment value is `true` if at least one feature flag was added, modified or removed; or `false` if there was no change.
|
|
30
|
-
* The promise will reject if some storage operation rejects.
|
|
31
|
-
*/
|
|
32
|
-
update(changeNumber: number, toAdd: [string, ISplit][], toRemove?: string[]): Promise<boolean>;
|
|
33
|
-
abstract getSplit(name: string): MaybeThenable<ISplit | null>;
|
|
34
|
-
/**
|
|
35
|
-
* Kill `name` split and set `defaultTreatment` and `changeNumber`.
|
|
36
|
-
* Used for SPLIT_KILL push notifications.
|
|
37
|
-
*
|
|
38
|
-
* @param {string} name
|
|
39
|
-
* @param {string} defaultTreatment
|
|
40
|
-
* @param {number} changeNumber
|
|
41
|
-
* @returns {Promise} a promise that is resolved once the split kill operation is performed. The fulfillment value is a boolean: `true` if the operation successed updating the split or `false` if no split is updated,
|
|
42
|
-
* for instance, if the `changeNumber` is old, or if the split is not found (e.g., `/splitchanges` hasn't been fetched yet), or if the storage fails to apply the update.
|
|
43
|
-
* The promise will never be rejected.
|
|
44
|
-
*/
|
|
45
|
-
killLocally(name: string, defaultTreatment: string, changeNumber: number): Promise<boolean>;
|
|
46
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ISplitsCacheAsync } from './types';
|
|
2
|
-
import { ISplit } from '../dtos/types';
|
|
3
|
-
/**
|
|
4
|
-
* This class provides a skeletal implementation of the ISplitsCacheAsync interface
|
|
5
|
-
* to minimize the effort required to implement this interface.
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class AbstractSplitsCacheAsync implements ISplitsCacheAsync {
|
|
8
|
-
abstract addSplit(name: string, split: ISplit): Promise<boolean>;
|
|
9
|
-
abstract addSplits(entries: [string, ISplit][]): Promise<boolean[] | void>;
|
|
10
|
-
abstract removeSplits(names: string[]): Promise<boolean[] | void>;
|
|
11
|
-
abstract getSplit(name: string): Promise<ISplit | null>;
|
|
12
|
-
abstract getSplits(names: string[]): Promise<Record<string, ISplit | null>>;
|
|
13
|
-
abstract setChangeNumber(changeNumber: number): Promise<boolean | void>;
|
|
14
|
-
abstract getChangeNumber(): Promise<number>;
|
|
15
|
-
abstract getAll(): Promise<ISplit[]>;
|
|
16
|
-
abstract getSplitNames(): Promise<string[]>;
|
|
17
|
-
abstract getNamesByFlagSets(flagSets: string[]): Promise<Set<string>[]>;
|
|
18
|
-
abstract trafficTypeExists(trafficType: string): Promise<boolean>;
|
|
19
|
-
abstract clear(): Promise<boolean | void>;
|
|
20
|
-
usesSegments(): Promise<boolean>;
|
|
21
|
-
/**
|
|
22
|
-
* Check if the splits information is already stored in cache.
|
|
23
|
-
* Noop, just keeping the interface. This is used by client-side implementations only.
|
|
24
|
-
*/
|
|
25
|
-
checkCache(): Promise<boolean>;
|
|
26
|
-
/**
|
|
27
|
-
* Kill `name` split and set `defaultTreatment` and `changeNumber`.
|
|
28
|
-
* Used for SPLIT_KILL push notifications.
|
|
29
|
-
*
|
|
30
|
-
* @param {string} name
|
|
31
|
-
* @param {string} defaultTreatment
|
|
32
|
-
* @param {number} changeNumber
|
|
33
|
-
* @returns {Promise} a promise that is resolved once the split kill operation is performed. The fulfillment value is a boolean: `true` if the operation successed updating the split or `false` if no split is updated,
|
|
34
|
-
* for instance, if the `changeNumber` is old, or if the split is not found (e.g., `/splitchanges` hasn't been fetched yet), or if the storage fails to apply the update.
|
|
35
|
-
* The promise will never be rejected.
|
|
36
|
-
*/
|
|
37
|
-
killLocally(name: string, defaultTreatment: string, changeNumber: number): Promise<boolean>;
|
|
38
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ISplitsCacheSync } from './types';
|
|
2
|
-
import { ISplit } from '../dtos/types';
|
|
3
|
-
/**
|
|
4
|
-
* This class provides a skeletal implementation of the ISplitsCacheSync interface
|
|
5
|
-
* to minimize the effort required to implement this interface.
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class AbstractSplitsCacheSync implements ISplitsCacheSync {
|
|
8
|
-
abstract addSplit(name: string, split: ISplit): boolean;
|
|
9
|
-
addSplits(entries: [string, ISplit][]): boolean[];
|
|
10
|
-
abstract removeSplit(name: string): boolean;
|
|
11
|
-
removeSplits(names: string[]): boolean[];
|
|
12
|
-
abstract getSplit(name: string): ISplit | null;
|
|
13
|
-
getSplits(names: string[]): Record<string, ISplit | null>;
|
|
14
|
-
abstract setChangeNumber(changeNumber: number): boolean | void;
|
|
15
|
-
abstract getChangeNumber(): number;
|
|
16
|
-
getAll(): ISplit[];
|
|
17
|
-
abstract getSplitNames(): string[];
|
|
18
|
-
abstract trafficTypeExists(trafficType: string): boolean;
|
|
19
|
-
abstract usesSegments(): boolean;
|
|
20
|
-
abstract clear(): void;
|
|
21
|
-
/**
|
|
22
|
-
* Check if the splits information is already stored in cache. This data can be preloaded.
|
|
23
|
-
* It is used as condition to emit SDK_SPLITS_CACHE_LOADED, and then SDK_READY_FROM_CACHE.
|
|
24
|
-
*/
|
|
25
|
-
checkCache(): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Kill `name` split and set `defaultTreatment` and `changeNumber`.
|
|
28
|
-
* Used for SPLIT_KILL push notifications.
|
|
29
|
-
*
|
|
30
|
-
* @param {string} name
|
|
31
|
-
* @param {string} defaultTreatment
|
|
32
|
-
* @param {number} changeNumber
|
|
33
|
-
* @returns {boolean} `true` if the operation successed updating the split, or `false` if no split is updated,
|
|
34
|
-
* for instance, if the `changeNumber` is old, or if the split is not found (e.g., `/splitchanges` hasn't been fetched yet), or if the storage fails to apply the update.
|
|
35
|
-
*/
|
|
36
|
-
killLocally(name: string, defaultTreatment: string, changeNumber: number): boolean;
|
|
37
|
-
abstract getNamesByFlagSets(flagSets: string[]): Set<string>[];
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Given a parsed split, it returns a boolean flagging if its conditions use segments matchers (rules & whitelists).
|
|
41
|
-
* This util is intended to simplify the implementation of `splitsCache::usesSegments` method
|
|
42
|
-
*/
|
|
43
|
-
export declare function usesSegments(split: ISplit): boolean;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ISettings } from '../types';
|
|
2
|
-
export declare function validatePrefix(prefix: unknown): string;
|
|
3
|
-
export declare class KeyBuilder {
|
|
4
|
-
readonly prefix: string;
|
|
5
|
-
constructor(prefix?: string);
|
|
6
|
-
buildTrafficTypeKey(trafficType: string): string;
|
|
7
|
-
buildFlagSetKey(flagSet: string): string;
|
|
8
|
-
buildSplitKey(splitName: string): string;
|
|
9
|
-
buildSplitsTillKey(): string;
|
|
10
|
-
isSplitKey(key: string): boolean;
|
|
11
|
-
buildSplitKeyPrefix(): string;
|
|
12
|
-
buildSplitsWithSegmentCountKey(): string;
|
|
13
|
-
buildSegmentNameKey(segmentName: string): string;
|
|
14
|
-
buildSegmentTillKey(segmentName: string): string;
|
|
15
|
-
extractKey(builtKey: string): string;
|
|
16
|
-
buildHashKey(): string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Generates a murmur32 hash based on the authorization key, the feature flags filter query, and version of SplitChanges API.
|
|
20
|
-
* The hash is in hexadecimal format (8 characters max, 32 bits).
|
|
21
|
-
*/
|
|
22
|
-
export declare function getStorageHash(settings: ISettings): string;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { KeyBuilder } from './KeyBuilder';
|
|
2
|
-
export interface MySegmentsKeyBuilder {
|
|
3
|
-
buildSegmentNameKey(segmentName: string): string;
|
|
4
|
-
extractSegmentName(builtSegmentKeyName: string): string | undefined;
|
|
5
|
-
buildTillKey(): string;
|
|
6
|
-
}
|
|
7
|
-
export declare class KeyBuilderCS extends KeyBuilder implements MySegmentsKeyBuilder {
|
|
8
|
-
protected readonly regexSplitsCacheKey: RegExp;
|
|
9
|
-
protected readonly matchingKey: string;
|
|
10
|
-
constructor(prefix: string, matchingKey: string);
|
|
11
|
-
/**
|
|
12
|
-
* @override
|
|
13
|
-
*/
|
|
14
|
-
buildSegmentNameKey(segmentName: string): string;
|
|
15
|
-
extractSegmentName(builtSegmentKeyName: string): string | undefined;
|
|
16
|
-
buildLastUpdatedKey(): string;
|
|
17
|
-
isSplitsCacheKey(key: string): boolean;
|
|
18
|
-
buildTillKey(): string;
|
|
19
|
-
}
|
|
20
|
-
export declare function myLargeSegmentsKeyBuilder(prefix: string, matchingKey: string): MySegmentsKeyBuilder;
|