@splitsoftware/splitio-commons 2.0.0-rc.3 → 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/package.json +3 -2
- package/types/index.d.ts +5 -5
- package/types/splitio.d.ts +2293 -0
- package/types/consent/index.d.ts +0 -2
- package/types/consent/sdkUserConsent.d.ts +0 -13
- package/types/dtos/types.d.ts +0 -209
- package/types/evaluator/Engine.d.ts +0 -15
- package/types/evaluator/combiners/and.d.ts +0 -4
- package/types/evaluator/combiners/ifelseif.d.ts +0 -3
- package/types/evaluator/condition/engineUtils.d.ts +0 -11
- package/types/evaluator/condition/index.d.ts +0 -6
- package/types/evaluator/convertions/index.d.ts +0 -2
- package/types/evaluator/index.d.ts +0 -8
- package/types/evaluator/matchers/all.d.ts +0 -1
- package/types/evaluator/matchers/between.d.ts +0 -2
- package/types/evaluator/matchers/boolean.d.ts +0 -1
- package/types/evaluator/matchers/cont_all.d.ts +0 -1
- package/types/evaluator/matchers/cont_any.d.ts +0 -1
- package/types/evaluator/matchers/cont_str.d.ts +0 -1
- package/types/evaluator/matchers/dependency.d.ts +0 -5
- package/types/evaluator/matchers/eq.d.ts +0 -1
- package/types/evaluator/matchers/eq_set.d.ts +0 -1
- package/types/evaluator/matchers/ew.d.ts +0 -1
- package/types/evaluator/matchers/gte.d.ts +0 -1
- package/types/evaluator/matchers/index.d.ts +0 -7
- package/types/evaluator/matchers/large_segment.d.ts +0 -5
- package/types/evaluator/matchers/lte.d.ts +0 -1
- package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
- package/types/evaluator/matchers/part_of.d.ts +0 -1
- package/types/evaluator/matchers/segment.d.ts +0 -5
- package/types/evaluator/matchers/semver_between.d.ts +0 -2
- package/types/evaluator/matchers/semver_eq.d.ts +0 -1
- package/types/evaluator/matchers/semver_gte.d.ts +0 -1
- package/types/evaluator/matchers/semver_inlist.d.ts +0 -1
- package/types/evaluator/matchers/semver_lte.d.ts +0 -1
- package/types/evaluator/matchers/string.d.ts +0 -1
- package/types/evaluator/matchers/sw.d.ts +0 -1
- package/types/evaluator/matchers/whitelist.d.ts +0 -1
- package/types/evaluator/matchersTransform/index.d.ts +0 -6
- package/types/evaluator/matchersTransform/segment.d.ts +0 -5
- package/types/evaluator/matchersTransform/unaryNumeric.d.ts +0 -5
- package/types/evaluator/matchersTransform/whitelist.d.ts +0 -5
- package/types/evaluator/parser/index.d.ts +0 -5
- package/types/evaluator/treatments/index.d.ts +0 -8
- package/types/evaluator/types.d.ts +0 -28
- package/types/evaluator/value/index.d.ts +0 -7
- package/types/evaluator/value/sanitize.d.ts +0 -7
- package/types/integrations/pluggable.d.ts +0 -11
- package/types/integrations/types.d.ts +0 -18
- package/types/listeners/browser.d.ts +0 -40
- package/types/listeners/node.d.ts +0 -22
- package/types/listeners/types.d.ts +0 -4
- package/types/logger/browser/DebugLogger.d.ts +0 -2
- package/types/logger/browser/ErrorLogger.d.ts +0 -2
- package/types/logger/browser/InfoLogger.d.ts +0 -2
- package/types/logger/browser/WarnLogger.d.ts +0 -2
- package/types/logger/constants.d.ts +0 -134
- package/types/logger/index.d.ts +0 -21
- package/types/logger/messages/debug.d.ts +0 -1
- package/types/logger/messages/error.d.ts +0 -1
- package/types/logger/messages/info.d.ts +0 -1
- package/types/logger/messages/warn.d.ts +0 -1
- package/types/logger/sdkLogger.d.ts +0 -8
- package/types/logger/types.d.ts +0 -17
- package/types/readiness/constants.d.ts +0 -7
- package/types/readiness/readinessManager.d.ts +0 -6
- package/types/readiness/sdkReadinessManager.d.ts +0 -10
- package/types/readiness/types.d.ts +0 -67
- package/types/sdkClient/client.d.ts +0 -6
- package/types/sdkClient/clientAttributesDecoration.d.ts +0 -55
- package/types/sdkClient/clientCS.d.ts +0 -9
- package/types/sdkClient/clientInputValidation.d.ts +0 -7
- package/types/sdkClient/identity.d.ts +0 -2
- package/types/sdkClient/sdkClient.d.ts +0 -6
- package/types/sdkClient/sdkClientMethod.d.ts +0 -6
- package/types/sdkClient/sdkClientMethodCS.d.ts +0 -7
- package/types/sdkFactory/index.d.ts +0 -6
- package/types/sdkFactory/types.d.ts +0 -85
- package/types/sdkManager/index.d.ts +0 -4
- package/types/services/decorateHeaders.d.ts +0 -2
- package/types/services/splitApi.d.ts +0 -12
- package/types/services/splitHttpClient.d.ts +0 -10
- package/types/services/types.d.ts +0 -54
- package/types/storages/AbstractMySegmentsCacheSync.d.ts +0 -39
- package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -38
- package/types/storages/AbstractSplitsCacheSync.d.ts +0 -43
- package/types/storages/KeyBuilder.d.ts +0 -22
- package/types/storages/KeyBuilderCS.d.ts +0 -20
- package/types/storages/KeyBuilderSS.d.ts +0 -20
- package/types/storages/dataLoader.d.ts +0 -10
- package/types/storages/findLatencyIndex.d.ts +0 -7
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -15
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -54
- package/types/storages/inLocalStorage/constants.d.ts +0 -2
- package/types/storages/inLocalStorage/index.d.ts +0 -8
- package/types/storages/inMemory/AttributesCacheInMemory.d.ts +0 -44
- package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
- package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -28
- package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +0 -30
- package/types/storages/inMemory/InMemoryStorage.d.ts +0 -10
- package/types/storages/inMemory/InMemoryStorageCS.d.ts +0 -10
- package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +0 -16
- package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -17
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -27
- package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -71
- package/types/storages/inMemory/UniqueKeysCacheInMemory.d.ts +0 -34
- package/types/storages/inMemory/UniqueKeysCacheInMemoryCS.d.ts +0 -35
- package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
- package/types/storages/inRedis/ImpressionCountsCacheInRedis.d.ts +0 -17
- package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -17
- package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
- package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -21
- package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -95
- package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -35
- package/types/storages/inRedis/UniqueKeysCacheInRedis.d.ts +0 -22
- package/types/storages/inRedis/constants.d.ts +0 -4
- package/types/storages/inRedis/index.d.ts +0 -10
- package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
- package/types/storages/pluggable/ImpressionCountsCachePluggable.d.ts +0 -16
- package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -34
- package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -42
- package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -98
- package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -34
- package/types/storages/pluggable/UniqueKeysCachePluggable.d.ts +0 -20
- package/types/storages/pluggable/constants.d.ts +0 -1
- package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -12
- package/types/storages/pluggable/index.d.ts +0 -9
- package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
- package/types/storages/types.d.ts +0 -407
- package/types/storages/utils.d.ts +0 -8
- package/types/sync/offline/LocalhostFromObject.d.ts +0 -1
- package/types/sync/offline/splitsParser/parseCondition.d.ts +0 -7
- package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +0 -3
- package/types/sync/offline/splitsParser/types.d.ts +0 -3
- package/types/sync/offline/syncManagerOffline.d.ts +0 -10
- package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +0 -17
- package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/types.d.ts +0 -5
- package/types/sync/polling/pollingManagerCS.d.ts +0 -7
- package/types/sync/polling/pollingManagerSS.d.ts +0 -6
- package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +0 -9
- package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +0 -9
- package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +0 -9
- package/types/sync/polling/types.d.ts +0 -33
- package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -14
- package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
- package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -41
- package/types/sync/streaming/AuthClient/index.d.ts +0 -12
- package/types/sync/streaming/AuthClient/types.d.ts +0 -17
- package/types/sync/streaming/SSEClient/index.d.ts +0 -34
- package/types/sync/streaming/SSEClient/types.d.ts +0 -11
- package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +0 -14
- package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +0 -20
- package/types/sync/streaming/SSEHandler/index.d.ts +0 -11
- package/types/sync/streaming/SSEHandler/types.d.ts +0 -72
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -9
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -9
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -14
- package/types/sync/streaming/UpdateWorkers/constants.d.ts +0 -3
- package/types/sync/streaming/UpdateWorkers/types.d.ts +0 -4
- package/types/sync/streaming/constants.d.ts +0 -34
- package/types/sync/streaming/parseUtils.d.ts +0 -34
- package/types/sync/streaming/pushManager.d.ts +0 -9
- package/types/sync/streaming/types.d.ts +0 -35
- package/types/sync/submitters/eventsSubmitter.d.ts +0 -5
- package/types/sync/submitters/impressionCountsSubmitter.d.ts +0 -10
- package/types/sync/submitters/impressionsSubmitter.d.ts +0 -11
- package/types/sync/submitters/submitter.d.ts +0 -12
- package/types/sync/submitters/submitterManager.d.ts +0 -3
- package/types/sync/submitters/telemetrySubmitter.d.ts +0 -17
- package/types/sync/submitters/types.d.ts +0 -217
- package/types/sync/submitters/uniqueKeysSubmitter.d.ts +0 -5
- package/types/sync/syncManagerOnline.d.ts +0 -13
- package/types/sync/syncTask.d.ts +0 -13
- package/types/sync/types.d.ts +0 -43
- package/types/trackers/eventTracker.d.ts +0 -10
- package/types/trackers/impressionObserver/ImpressionObserver.d.ts +0 -8
- package/types/trackers/impressionObserver/buildKey.d.ts +0 -2
- package/types/trackers/impressionObserver/impressionObserverCS.d.ts +0 -4
- package/types/trackers/impressionObserver/impressionObserverSS.d.ts +0 -4
- package/types/trackers/impressionObserver/types.d.ts +0 -4
- package/types/trackers/impressionsTracker.d.ts +0 -13
- package/types/trackers/strategy/strategyDebug.d.ts +0 -9
- package/types/trackers/strategy/strategyNone.d.ts +0 -10
- package/types/trackers/strategy/strategyOptimized.d.ts +0 -11
- package/types/trackers/telemetryTracker.d.ts +0 -3
- package/types/trackers/types.d.ts +0 -68
- package/types/trackers/uniqueKeysTracker.d.ts +0 -13
- package/types/types.d.ts +0 -1398
- package/types/utils/Backoff.d.ts +0 -25
- package/types/utils/LRUCache/LinkedList.d.ts +0 -34
- package/types/utils/LRUCache/index.d.ts +0 -15
- package/types/utils/MinEventEmitter.d.ts +0 -12
- package/types/utils/MinEvents.d.ts +0 -4
- package/types/utils/Semver.d.ts +0 -15
- package/types/utils/base64/index.d.ts +0 -30
- package/types/utils/constants/browser.d.ts +0 -1
- package/types/utils/constants/index.d.ts +0 -83
- package/types/utils/decompress/index.d.ts +0 -16
- package/types/utils/env/isLocalStorageAvailable.d.ts +0 -1
- package/types/utils/env/isNode.d.ts +0 -5
- package/types/utils/inputValidation/apiKey.d.ts +0 -7
- package/types/utils/inputValidation/attribute.d.ts +0 -2
- package/types/utils/inputValidation/attributes.d.ts +0 -4
- package/types/utils/inputValidation/event.d.ts +0 -2
- package/types/utils/inputValidation/eventProperties.d.ts +0 -6
- package/types/utils/inputValidation/eventValue.d.ts +0 -2
- package/types/utils/inputValidation/index.d.ts +0 -13
- package/types/utils/inputValidation/isOperational.d.ts +0 -4
- package/types/utils/inputValidation/key.d.ts +0 -3
- package/types/utils/inputValidation/preloadedData.d.ts +0 -3
- package/types/utils/inputValidation/split.d.ts +0 -2
- package/types/utils/inputValidation/splitExistence.d.ts +0 -7
- package/types/utils/inputValidation/splits.d.ts +0 -2
- package/types/utils/inputValidation/trafficType.d.ts +0 -2
- package/types/utils/inputValidation/trafficTypeExistence.d.ts +0 -9
- package/types/utils/jwt/index.d.ts +0 -5
- package/types/utils/jwt/types.d.ts +0 -5
- package/types/utils/key/index.d.ts +0 -8
- package/types/utils/labels/index.d.ts +0 -8
- package/types/utils/lang/binarySearch.d.ts +0 -9
- package/types/utils/lang/getFnName.d.ts +0 -4
- package/types/utils/lang/getGlobal.d.ts +0 -4
- package/types/utils/lang/index.d.ts +0 -105
- package/types/utils/lang/objectAssign.d.ts +0 -6
- package/types/utils/lang/sets.d.ts +0 -3
- package/types/utils/murmur3/common.d.ts +0 -12
- package/types/utils/murmur3/legacy.d.ts +0 -2
- package/types/utils/murmur3/murmur3.d.ts +0 -2
- package/types/utils/murmur3/murmur3_128.d.ts +0 -6
- package/types/utils/murmur3/murmur3_128_x86.d.ts +0 -7
- package/types/utils/murmur3/murmur3_64.d.ts +0 -10
- package/types/utils/murmur3/utfx.d.ts +0 -27
- package/types/utils/promise/thenable.d.ts +0 -1
- package/types/utils/promise/timeout.d.ts +0 -1
- package/types/utils/promise/wrapper.d.ts +0 -21
- package/types/utils/settingsValidation/consent.d.ts +0 -6
- package/types/utils/settingsValidation/impressionsMode.d.ts +0 -3
- package/types/utils/settingsValidation/index.d.ts +0 -50
- package/types/utils/settingsValidation/integrations/common.d.ts +0 -14
- package/types/utils/settingsValidation/integrations/configurable.d.ts +0 -13
- package/types/utils/settingsValidation/integrations/pluggable.d.ts +0 -13
- package/types/utils/settingsValidation/logger/builtinLogger.d.ts +0 -10
- package/types/utils/settingsValidation/logger/commons.d.ts +0 -9
- package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +0 -11
- package/types/utils/settingsValidation/mode.d.ts +0 -5
- package/types/utils/settingsValidation/runtime.d.ts +0 -2
- package/types/utils/settingsValidation/splitFilters.d.ts +0 -17
- package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -21
- package/types/utils/settingsValidation/types.d.ts +0 -30
- package/types/utils/settingsValidation/url.d.ts +0 -10
- package/types/utils/time/index.d.ts +0 -4
- package/types/utils/timeTracker/now/browser.d.ts +0 -1
- package/types/utils/timeTracker/now/node.d.ts +0 -1
- package/types/utils/timeTracker/timer.d.ts +0 -1
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
import { MaybeThenable, ISplit, IMySegmentsResponse } from '../dtos/types';
|
|
2
|
-
import { MySegmentsData } from '../sync/polling/types';
|
|
3
|
-
import { EventDataType, HttpErrors, HttpLatencies, ImpressionDataType, LastSync, Method, MethodExceptions, MethodLatencies, MultiMethodExceptions, MultiMethodLatencies, MultiConfigs, OperationType, StoredEventWithMetadata, StoredImpressionWithMetadata, StreamingEvent, UniqueKeysPayloadCs, UniqueKeysPayloadSs, TelemetryUsageStatsPayload, UpdatesFromSSEEnum } from '../sync/submitters/types';
|
|
4
|
-
import { SplitIO, ImpressionDTO, ISettings } from '../types';
|
|
5
|
-
/**
|
|
6
|
-
* Interface of a pluggable storage wrapper.
|
|
7
|
-
*/
|
|
8
|
-
export interface IPluggableStorageWrapper {
|
|
9
|
-
/** Key-Value operations */
|
|
10
|
-
/**
|
|
11
|
-
* Get the value of given `key`.
|
|
12
|
-
*
|
|
13
|
-
* @function get
|
|
14
|
-
* @param {string} key Item to retrieve
|
|
15
|
-
* @returns {Promise<string | null>} A promise that resolves with the element value associated with the specified `key`,
|
|
16
|
-
* or null if the key does not exist. The promise rejects if the operation fails.
|
|
17
|
-
*/
|
|
18
|
-
get: (key: string) => Promise<string | null>;
|
|
19
|
-
/**
|
|
20
|
-
* Add or update an item with a specified `key` and `value`.
|
|
21
|
-
*
|
|
22
|
-
* @function set
|
|
23
|
-
* @param {string} key Item to update
|
|
24
|
-
* @param {string} value Value to set
|
|
25
|
-
* @returns {Promise<void>} A promise that resolves if the operation success, whether the key was added or updated.
|
|
26
|
-
* The promise rejects if the operation fails.
|
|
27
|
-
*/
|
|
28
|
-
set: (key: string, value: string) => Promise<boolean | void>;
|
|
29
|
-
/**
|
|
30
|
-
* Add or update an item with a specified `key` and `value`.
|
|
31
|
-
*
|
|
32
|
-
* @function getAndSet
|
|
33
|
-
* @param {string} key Item to update
|
|
34
|
-
* @param {string} value Value to set
|
|
35
|
-
* @returns {Promise<string | null>} A promise that resolves with the previous value associated to the given `key`, or null if not set.
|
|
36
|
-
* The promise rejects if the operation fails.
|
|
37
|
-
*/
|
|
38
|
-
getAndSet: (key: string, value: string) => Promise<string | null>;
|
|
39
|
-
/**
|
|
40
|
-
* Removes the specified item by `key`.
|
|
41
|
-
*
|
|
42
|
-
* @function del
|
|
43
|
-
* @param {string} key Item to delete
|
|
44
|
-
* @returns {Promise<boolean>} A promise that resolves if the operation success, whether the key existed and was removed (resolves with true) or it didn't exist (resolves with false).
|
|
45
|
-
* The promise rejects if the operation fails, for example, if there is a connection error.
|
|
46
|
-
*/
|
|
47
|
-
del: (key: string) => Promise<boolean>;
|
|
48
|
-
/**
|
|
49
|
-
* Returns all keys matching the given prefix.
|
|
50
|
-
*
|
|
51
|
-
* @function getKeysByPrefix
|
|
52
|
-
* @param {string} prefix String prefix to match
|
|
53
|
-
* @returns {Promise<string[]>} A promise that resolves with the list of keys that match the given `prefix`.
|
|
54
|
-
* The promise rejects if the operation fails.
|
|
55
|
-
*/
|
|
56
|
-
getKeysByPrefix: (prefix: string) => Promise<string[]>;
|
|
57
|
-
/**
|
|
58
|
-
* Returns the values of all given `keys`.
|
|
59
|
-
*
|
|
60
|
-
* @function getMany
|
|
61
|
-
* @param {string[]} keys List of keys to retrieve
|
|
62
|
-
* @returns {Promise<(string | null)[]>} A promise that resolves with the list of items associated with the specified list of `keys`.
|
|
63
|
-
* For every key that does not hold a string value or does not exist, null is returned. The promise rejects if the operation fails.
|
|
64
|
-
*/
|
|
65
|
-
getMany: (keys: string[]) => Promise<(string | null)[]>;
|
|
66
|
-
/** Integer operations */
|
|
67
|
-
/**
|
|
68
|
-
* Increments the number stored at `key` by `increment`, or set it to `increment` if the value doesn't exist.
|
|
69
|
-
*
|
|
70
|
-
* @function incr
|
|
71
|
-
* @param {string} key Key to increment
|
|
72
|
-
* @param {number} increment Value to increment by. Defaults to 1.
|
|
73
|
-
* @returns {Promise<number>} A promise that resolves with the value of key after the increment. The promise rejects if the operation fails,
|
|
74
|
-
* for example, if there is a connection error or the key contains a string that can not be represented as integer.
|
|
75
|
-
*/
|
|
76
|
-
incr: (key: string, increment?: number) => Promise<number>;
|
|
77
|
-
/**
|
|
78
|
-
* Decrements the number stored at `key` by `decrement`, or set it to minus `decrement` if the value doesn't exist.
|
|
79
|
-
*
|
|
80
|
-
* @function decr
|
|
81
|
-
* @param {string} key Key to decrement
|
|
82
|
-
* @param {number} decrement Value to decrement by. Defaults to 1.
|
|
83
|
-
* @returns {Promise<number>} A promise that resolves with the value of key after the decrement. The promise rejects if the operation fails,
|
|
84
|
-
* for example, if there is a connection error or the key contains a string that can not be represented as integer.
|
|
85
|
-
*/
|
|
86
|
-
decr: (key: string, decrement?: number) => Promise<number>;
|
|
87
|
-
/** Queue operations */
|
|
88
|
-
/**
|
|
89
|
-
* Inserts given items at the tail of `key` list. If `key` does not exist, an empty list is created before pushing the items.
|
|
90
|
-
*
|
|
91
|
-
* @function pushItems
|
|
92
|
-
* @param {string} key List key
|
|
93
|
-
* @param {string[]} items List of items to push
|
|
94
|
-
* @returns {Promise<void>} A promise that resolves if the operation success.
|
|
95
|
-
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a list.
|
|
96
|
-
*/
|
|
97
|
-
pushItems: (key: string, items: string[]) => Promise<void>;
|
|
98
|
-
/**
|
|
99
|
-
* Removes and returns the first `count` items from a list. If `key` does not exist, an empty list is items is returned.
|
|
100
|
-
*
|
|
101
|
-
* @function popItems
|
|
102
|
-
* @param {string} key List key
|
|
103
|
-
* @param {number} count Number of items to pop
|
|
104
|
-
* @returns {Promise<string[]>} A promise that resolves with the list of removed items from the list, or an empty array when key does not exist.
|
|
105
|
-
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a list.
|
|
106
|
-
*/
|
|
107
|
-
popItems: (key: string, count: number) => Promise<string[]>;
|
|
108
|
-
/**
|
|
109
|
-
* Returns the count of items in a list, or 0 if `key` does not exist.
|
|
110
|
-
*
|
|
111
|
-
* @function getItemsCount
|
|
112
|
-
* @param {string} key List key
|
|
113
|
-
* @returns {Promise<number>} A promise that resolves with the number of items at the `key` list, or 0 when `key` does not exist.
|
|
114
|
-
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a list.
|
|
115
|
-
*/
|
|
116
|
-
getItemsCount: (key: string) => Promise<number>;
|
|
117
|
-
/** Set operations */
|
|
118
|
-
/**
|
|
119
|
-
* Returns if item is a member of a set.
|
|
120
|
-
*
|
|
121
|
-
* @function itemContains
|
|
122
|
-
* @param {string} key Set key
|
|
123
|
-
* @param {string} item Item value
|
|
124
|
-
* @returns {Promise<boolean>} A promise that resolves with true boolean value if `item` is a member of the set stored at `key`,
|
|
125
|
-
* or false if it is not a member or `key` set does not exist. The promise rejects if the operation fails, for example,
|
|
126
|
-
* if there is a connection error or the key holds a value that is not a set.
|
|
127
|
-
*/
|
|
128
|
-
itemContains: (key: string, item: string) => Promise<boolean>;
|
|
129
|
-
/**
|
|
130
|
-
* Add the specified `items` to the set stored at `key`. Those items that are already part of the set are ignored.
|
|
131
|
-
* If key does not exist, an empty set is created before adding the items.
|
|
132
|
-
*
|
|
133
|
-
* @function addItems
|
|
134
|
-
* @param {string} key Set key
|
|
135
|
-
* @param {string} items Items to add
|
|
136
|
-
* @returns {Promise<boolean | void>} A promise that resolves if the operation success.
|
|
137
|
-
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a set.
|
|
138
|
-
*/
|
|
139
|
-
addItems: (key: string, items: string[]) => Promise<boolean | void>;
|
|
140
|
-
/**
|
|
141
|
-
* Remove the specified `items` from the set stored at `key`. Those items that are not part of the set are ignored.
|
|
142
|
-
*
|
|
143
|
-
* @function removeItems
|
|
144
|
-
* @param {string} key Set key
|
|
145
|
-
* @param {string} items Items to remove
|
|
146
|
-
* @returns {Promise<boolean | void>} A promise that resolves if the operation success. If key does not exist, the promise also resolves.
|
|
147
|
-
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a set.
|
|
148
|
-
*/
|
|
149
|
-
removeItems: (key: string, items: string[]) => Promise<boolean | void>;
|
|
150
|
-
/**
|
|
151
|
-
* Returns all the items of the `key` set.
|
|
152
|
-
*
|
|
153
|
-
* @function getItems
|
|
154
|
-
* @param {string} key Set key
|
|
155
|
-
* @returns {Promise<string[]>} A promise that resolves with the list of items. If key does not exist, the result is an empty list.
|
|
156
|
-
* The promise rejects if the operation fails, for example, if there is a connection error or the key holds a value that is not a set.
|
|
157
|
-
*/
|
|
158
|
-
getItems: (key: string) => Promise<string[]>;
|
|
159
|
-
/** Control operations */
|
|
160
|
-
/**
|
|
161
|
-
* Connects to the underlying storage.
|
|
162
|
-
* It is meant for storages that requires to be connected to some database or server. Otherwise it can just return a resolved promise.
|
|
163
|
-
* Note: will be called once on SplitFactory instantiation and once per each shared client instantiation.
|
|
164
|
-
*
|
|
165
|
-
* @function connect
|
|
166
|
-
* @returns {Promise<void>} A promise that resolves when the wrapper successfully connect to the underlying storage.
|
|
167
|
-
* The promise rejects with the corresponding error if the wrapper fails to connect.
|
|
168
|
-
*/
|
|
169
|
-
connect: () => Promise<void>;
|
|
170
|
-
/**
|
|
171
|
-
* Disconnects from the underlying storage.
|
|
172
|
-
* It is meant for storages that requires to be closed, in order to release resources. Otherwise it can just return a resolved promise.
|
|
173
|
-
* Note: will be called once on SplitFactory main client destroy.
|
|
174
|
-
*
|
|
175
|
-
* @function disconnect
|
|
176
|
-
* @returns {Promise<void>} A promise that resolves when the operation ends.
|
|
177
|
-
* The promise never rejects.
|
|
178
|
-
*/
|
|
179
|
-
disconnect: () => Promise<void>;
|
|
180
|
-
}
|
|
181
|
-
/** Splits cache */
|
|
182
|
-
export interface ISplitsCacheBase {
|
|
183
|
-
addSplits(entries: [string, ISplit][]): MaybeThenable<boolean[] | void>;
|
|
184
|
-
removeSplits(names: string[]): MaybeThenable<boolean[] | void>;
|
|
185
|
-
getSplit(name: string): MaybeThenable<ISplit | null>;
|
|
186
|
-
getSplits(names: string[]): MaybeThenable<Record<string, ISplit | null>>;
|
|
187
|
-
setChangeNumber(changeNumber: number): MaybeThenable<boolean | void>;
|
|
188
|
-
getChangeNumber(): MaybeThenable<number>;
|
|
189
|
-
getAll(): MaybeThenable<ISplit[]>;
|
|
190
|
-
getSplitNames(): MaybeThenable<string[]>;
|
|
191
|
-
trafficTypeExists(trafficType: string): MaybeThenable<boolean>;
|
|
192
|
-
usesSegments(): MaybeThenable<boolean>;
|
|
193
|
-
clear(): MaybeThenable<boolean | void>;
|
|
194
|
-
checkCache(): MaybeThenable<boolean>;
|
|
195
|
-
killLocally(name: string, defaultTreatment: string, changeNumber: number): MaybeThenable<boolean>;
|
|
196
|
-
getNamesByFlagSets(flagSets: string[]): MaybeThenable<Set<string>[]>;
|
|
197
|
-
}
|
|
198
|
-
export interface ISplitsCacheSync extends ISplitsCacheBase {
|
|
199
|
-
addSplits(entries: [string, ISplit][]): boolean[];
|
|
200
|
-
removeSplits(names: string[]): boolean[];
|
|
201
|
-
getSplit(name: string): ISplit | null;
|
|
202
|
-
getSplits(names: string[]): Record<string, ISplit | null>;
|
|
203
|
-
setChangeNumber(changeNumber: number): boolean | void;
|
|
204
|
-
getChangeNumber(): number;
|
|
205
|
-
getAll(): ISplit[];
|
|
206
|
-
getSplitNames(): string[];
|
|
207
|
-
trafficTypeExists(trafficType: string): boolean;
|
|
208
|
-
usesSegments(): boolean;
|
|
209
|
-
clear(): void;
|
|
210
|
-
checkCache(): boolean;
|
|
211
|
-
killLocally(name: string, defaultTreatment: string, changeNumber: number): boolean;
|
|
212
|
-
getNamesByFlagSets(flagSets: string[]): Set<string>[];
|
|
213
|
-
}
|
|
214
|
-
export interface ISplitsCacheAsync extends ISplitsCacheBase {
|
|
215
|
-
addSplits(entries: [string, ISplit][]): Promise<boolean[] | void>;
|
|
216
|
-
removeSplits(names: string[]): Promise<boolean[] | void>;
|
|
217
|
-
getSplit(name: string): Promise<ISplit | null>;
|
|
218
|
-
getSplits(names: string[]): Promise<Record<string, ISplit | null>>;
|
|
219
|
-
setChangeNumber(changeNumber: number): Promise<boolean | void>;
|
|
220
|
-
getChangeNumber(): Promise<number>;
|
|
221
|
-
getAll(): Promise<ISplit[]>;
|
|
222
|
-
getSplitNames(): Promise<string[]>;
|
|
223
|
-
trafficTypeExists(trafficType: string): Promise<boolean>;
|
|
224
|
-
usesSegments(): Promise<boolean>;
|
|
225
|
-
clear(): Promise<boolean | void>;
|
|
226
|
-
checkCache(): Promise<boolean>;
|
|
227
|
-
killLocally(name: string, defaultTreatment: string, changeNumber: number): Promise<boolean>;
|
|
228
|
-
getNamesByFlagSets(flagSets: string[]): Promise<Set<string>[]>;
|
|
229
|
-
}
|
|
230
|
-
/** Segments cache */
|
|
231
|
-
export interface ISegmentsCacheBase {
|
|
232
|
-
isInSegment(name: string, key?: string): MaybeThenable<boolean>;
|
|
233
|
-
registerSegments(names: string[]): MaybeThenable<boolean | void>;
|
|
234
|
-
getRegisteredSegments(): MaybeThenable<string[]>;
|
|
235
|
-
getChangeNumber(name: string): MaybeThenable<number>;
|
|
236
|
-
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): MaybeThenable<boolean>;
|
|
237
|
-
clear(): MaybeThenable<boolean | void>;
|
|
238
|
-
}
|
|
239
|
-
export interface ISegmentsCacheSync extends ISegmentsCacheBase {
|
|
240
|
-
isInSegment(name: string, key?: string): boolean;
|
|
241
|
-
registerSegments(names: string[]): boolean;
|
|
242
|
-
getRegisteredSegments(): string[];
|
|
243
|
-
getKeysCount(): number;
|
|
244
|
-
getChangeNumber(name?: string): number;
|
|
245
|
-
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): boolean;
|
|
246
|
-
resetSegments(segmentsData: MySegmentsData | IMySegmentsResponse): boolean;
|
|
247
|
-
clear(): void;
|
|
248
|
-
}
|
|
249
|
-
export interface ISegmentsCacheAsync extends ISegmentsCacheBase {
|
|
250
|
-
isInSegment(name: string, key: string): Promise<boolean>;
|
|
251
|
-
registerSegments(names: string[]): Promise<boolean | void>;
|
|
252
|
-
getRegisteredSegments(): Promise<string[]>;
|
|
253
|
-
getChangeNumber(name: string): Promise<number>;
|
|
254
|
-
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): Promise<boolean>;
|
|
255
|
-
clear(): Promise<boolean | void>;
|
|
256
|
-
}
|
|
257
|
-
/** Recorder storages (impressions, events and telemetry) */
|
|
258
|
-
export interface IImpressionsCacheBase {
|
|
259
|
-
track(data: ImpressionDTO[]): MaybeThenable<void>;
|
|
260
|
-
}
|
|
261
|
-
export interface IEventsCacheBase {
|
|
262
|
-
track(data: SplitIO.EventData, size?: number): MaybeThenable<boolean>;
|
|
263
|
-
}
|
|
264
|
-
export interface IImpressionCountsCacheBase {
|
|
265
|
-
track(featureName: string, timeFrame: number, amount: number): void;
|
|
266
|
-
}
|
|
267
|
-
export interface IUniqueKeysCacheBase {
|
|
268
|
-
track(key: string, value: string): void;
|
|
269
|
-
}
|
|
270
|
-
/** Impressions and events cache for standalone and partial consumer modes (sync methods) */
|
|
271
|
-
export interface IRecorderCacheSync<T> {
|
|
272
|
-
isEmpty(): boolean;
|
|
273
|
-
clear(): void;
|
|
274
|
-
pop(toMerge?: T): T;
|
|
275
|
-
}
|
|
276
|
-
export interface IImpressionsCacheSync extends IImpressionsCacheBase, IRecorderCacheSync<ImpressionDTO[]> {
|
|
277
|
-
track(data: ImpressionDTO[]): void;
|
|
278
|
-
setOnFullQueueCb(cb: () => void): void;
|
|
279
|
-
}
|
|
280
|
-
export interface IEventsCacheSync extends IEventsCacheBase, IRecorderCacheSync<SplitIO.EventData[]> {
|
|
281
|
-
track(data: SplitIO.EventData, size?: number): boolean;
|
|
282
|
-
setOnFullQueueCb(cb: () => void): void;
|
|
283
|
-
}
|
|
284
|
-
export interface IImpressionCountsCacheSync extends IImpressionCountsCacheBase, IRecorderCacheSync<Record<string, number>> {
|
|
285
|
-
}
|
|
286
|
-
export interface IUniqueKeysCacheSync extends IUniqueKeysCacheBase, IRecorderCacheSync<UniqueKeysPayloadSs | UniqueKeysPayloadCs> {
|
|
287
|
-
setOnFullQueueCb(cb: () => void): void;
|
|
288
|
-
}
|
|
289
|
-
/** Impressions and events cache for consumer and producer modes (async methods) */
|
|
290
|
-
export interface IRecorderCacheAsync<T> {
|
|
291
|
-
count(): Promise<number>;
|
|
292
|
-
drop(count?: number): Promise<void>;
|
|
293
|
-
popNWithMetadata(count: number): Promise<T>;
|
|
294
|
-
}
|
|
295
|
-
export interface IImpressionsCacheAsync extends IImpressionsCacheBase, IRecorderCacheAsync<StoredImpressionWithMetadata[]> {
|
|
296
|
-
track(data: ImpressionDTO[]): Promise<void>;
|
|
297
|
-
}
|
|
298
|
-
export interface IEventsCacheAsync extends IEventsCacheBase, IRecorderCacheAsync<StoredEventWithMetadata[]> {
|
|
299
|
-
track(data: SplitIO.EventData, size?: number): Promise<boolean>;
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Telemetry storage interface for standalone and partial consumer modes.
|
|
303
|
-
* Methods are sync because data is stored in memory.
|
|
304
|
-
*/
|
|
305
|
-
export interface ITelemetryInitConsumerSync {
|
|
306
|
-
getTimeUntilReady(): number | undefined;
|
|
307
|
-
getTimeUntilReadyFromCache(): number | undefined;
|
|
308
|
-
getNonReadyUsage(): number;
|
|
309
|
-
}
|
|
310
|
-
export interface ITelemetryRuntimeConsumerSync {
|
|
311
|
-
getImpressionStats(type: ImpressionDataType): number;
|
|
312
|
-
getEventStats(type: EventDataType): number;
|
|
313
|
-
getLastSynchronization(): LastSync;
|
|
314
|
-
popHttpErrors(): HttpErrors;
|
|
315
|
-
popHttpLatencies(): HttpLatencies;
|
|
316
|
-
popAuthRejections(): number;
|
|
317
|
-
popTokenRefreshes(): number;
|
|
318
|
-
popStreamingEvents(): Array<StreamingEvent>;
|
|
319
|
-
popTags(): Array<string> | undefined;
|
|
320
|
-
getSessionLength(): number | undefined;
|
|
321
|
-
}
|
|
322
|
-
export interface ITelemetryEvaluationConsumerSync {
|
|
323
|
-
popExceptions(): MethodExceptions;
|
|
324
|
-
popLatencies(): MethodLatencies;
|
|
325
|
-
}
|
|
326
|
-
export interface ITelemetryStorageConsumerSync extends ITelemetryInitConsumerSync, ITelemetryRuntimeConsumerSync, ITelemetryEvaluationConsumerSync {
|
|
327
|
-
}
|
|
328
|
-
export interface ITelemetryInitProducerSync {
|
|
329
|
-
recordTimeUntilReady(ms: number): void;
|
|
330
|
-
recordTimeUntilReadyFromCache(ms: number): void;
|
|
331
|
-
recordNonReadyUsage(): void;
|
|
332
|
-
}
|
|
333
|
-
export interface ITelemetryRuntimeProducerSync {
|
|
334
|
-
addTag(tag: string): void;
|
|
335
|
-
recordImpressionStats(type: ImpressionDataType, count: number): void;
|
|
336
|
-
recordEventStats(type: EventDataType, count: number): void;
|
|
337
|
-
recordSuccessfulSync(resource: OperationType, timeMs: number): void;
|
|
338
|
-
recordHttpError(resource: OperationType, status: number): void;
|
|
339
|
-
recordHttpLatency(resource: OperationType, latencyMs: number): void;
|
|
340
|
-
recordAuthRejections(): void;
|
|
341
|
-
recordTokenRefreshes(): void;
|
|
342
|
-
recordStreamingEvents(streamingEvent: StreamingEvent): void;
|
|
343
|
-
recordSessionLength(ms: number): void;
|
|
344
|
-
recordUpdatesFromSSE(type: UpdatesFromSSEEnum): void;
|
|
345
|
-
}
|
|
346
|
-
export interface ITelemetryEvaluationProducerSync {
|
|
347
|
-
recordLatency(method: Method, latencyMs: number): void;
|
|
348
|
-
recordException(method: Method): void;
|
|
349
|
-
}
|
|
350
|
-
export interface ITelemetryStorageProducerSync extends ITelemetryInitProducerSync, ITelemetryRuntimeProducerSync, ITelemetryEvaluationProducerSync {
|
|
351
|
-
}
|
|
352
|
-
export interface ITelemetryCacheSync extends ITelemetryStorageConsumerSync, ITelemetryStorageProducerSync, IRecorderCacheSync<TelemetryUsageStatsPayload> {
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Telemetry storage interface for consumer mode.
|
|
356
|
-
* Methods are async because data is stored in Redis or a pluggable storage.
|
|
357
|
-
*/
|
|
358
|
-
export interface ITelemetryEvaluationConsumerAsync {
|
|
359
|
-
popLatencies(): Promise<MultiMethodLatencies>;
|
|
360
|
-
popExceptions(): Promise<MultiMethodExceptions>;
|
|
361
|
-
popConfigs(): Promise<MultiConfigs>;
|
|
362
|
-
}
|
|
363
|
-
export interface ITelemetryEvaluationProducerAsync {
|
|
364
|
-
recordLatency(method: Method, latencyMs: number): Promise<any>;
|
|
365
|
-
recordException(method: Method): Promise<any>;
|
|
366
|
-
recordConfig(): Promise<any>;
|
|
367
|
-
}
|
|
368
|
-
export interface ITelemetryCacheAsync extends ITelemetryEvaluationProducerAsync, ITelemetryEvaluationConsumerAsync {
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* Storages
|
|
372
|
-
*/
|
|
373
|
-
export interface IStorageBase<TSplitsCache extends ISplitsCacheBase, TSegmentsCache extends ISegmentsCacheBase, TImpressionsCache extends IImpressionsCacheBase, TImpressionsCountCache extends IImpressionCountsCacheBase, TEventsCache extends IEventsCacheBase, TTelemetryCache extends ITelemetryCacheSync | ITelemetryCacheAsync, TUniqueKeysCache extends IUniqueKeysCacheBase> {
|
|
374
|
-
splits: TSplitsCache;
|
|
375
|
-
segments: TSegmentsCache;
|
|
376
|
-
impressions: TImpressionsCache;
|
|
377
|
-
impressionCounts?: TImpressionsCountCache;
|
|
378
|
-
events: TEventsCache;
|
|
379
|
-
telemetry?: TTelemetryCache;
|
|
380
|
-
uniqueKeys?: TUniqueKeysCache;
|
|
381
|
-
destroy(): void | Promise<void>;
|
|
382
|
-
shared?: (matchingKey: string, onReadyCb: (error?: any) => void) => this;
|
|
383
|
-
}
|
|
384
|
-
export interface IStorageSync extends IStorageBase<ISplitsCacheSync, ISegmentsCacheSync, IImpressionsCacheSync, IImpressionCountsCacheSync, IEventsCacheSync, ITelemetryCacheSync, IUniqueKeysCacheSync> {
|
|
385
|
-
largeSegments?: ISegmentsCacheSync;
|
|
386
|
-
}
|
|
387
|
-
export interface IStorageAsync extends IStorageBase<ISplitsCacheAsync, ISegmentsCacheAsync, IImpressionsCacheAsync | IImpressionsCacheSync, IImpressionCountsCacheBase, IEventsCacheAsync | IEventsCacheSync, ITelemetryCacheAsync | ITelemetryCacheSync, IUniqueKeysCacheBase> {
|
|
388
|
-
}
|
|
389
|
-
/** StorageFactory */
|
|
390
|
-
export declare type DataLoader = (storage: IStorageSync, matchingKey: string) => void;
|
|
391
|
-
export interface IStorageFactoryParams {
|
|
392
|
-
settings: ISettings;
|
|
393
|
-
/**
|
|
394
|
-
* Error-first callback invoked when the storage is ready to be used. An error means that the storage failed to connect and shouldn't be used.
|
|
395
|
-
* It is meant for emitting SDK_READY event in consumer mode, and waiting before using the storage in the synchronizer.
|
|
396
|
-
*/
|
|
397
|
-
onReadyCb: (error?: any) => void;
|
|
398
|
-
}
|
|
399
|
-
export declare type StorageType = 'MEMORY' | 'LOCALSTORAGE' | 'REDIS' | 'PLUGGABLE';
|
|
400
|
-
export declare type IStorageSyncFactory = {
|
|
401
|
-
readonly type: StorageType;
|
|
402
|
-
(params: IStorageFactoryParams): IStorageSync;
|
|
403
|
-
};
|
|
404
|
-
export declare type IStorageAsyncFactory = {
|
|
405
|
-
type: StorageType;
|
|
406
|
-
(params: IStorageFactoryParams): IStorageAsync;
|
|
407
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IMetadata } from '../dtos/types';
|
|
2
|
-
import { Method } from '../sync/submitters/types';
|
|
3
|
-
import { ImpressionDTO, ISettings } from '../types';
|
|
4
|
-
export declare function metadataBuilder(settings: Pick<ISettings, 'version' | 'runtime'>): IMetadata;
|
|
5
|
-
export declare function impressionsToJSON(impressions: ImpressionDTO[], metadata: IMetadata): string[];
|
|
6
|
-
export declare function parseMetadata(field: string): [metadata: string] | string;
|
|
7
|
-
export declare function parseExceptionField(field: string): [metadata: string, method: Method] | string;
|
|
8
|
-
export declare function parseLatencyField(field: string): [metadata: string, method: Method, bucket: number] | string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const localhostFromObjectFactory: (params: import("../../sdkFactory/types").ISdkFactoryContextSync) => import("../types").ISyncManagerCS;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ISyncManagerCS } from '../types';
|
|
2
|
-
import { ISplitsParser } from './splitsParser/types';
|
|
3
|
-
import { ISdkFactoryContextSync } from '../../sdkFactory/types';
|
|
4
|
-
/**
|
|
5
|
-
* Offline SyncManager factory.
|
|
6
|
-
* Can be used for server-side API, and client-side API with or without multiple clients.
|
|
7
|
-
*
|
|
8
|
-
* @param splitsParser e.g., `splitsParserFromFile`, `splitsParserFromSettings`.
|
|
9
|
-
*/
|
|
10
|
-
export declare function syncManagerOfflineFactory(splitsParserFactory: () => ISplitsParser): (params: ISdkFactoryContextSync) => ISyncManagerCS;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IReadinessManager } from '../../../readiness/types';
|
|
2
|
-
import { ISplitsCacheSync } from '../../../storages/types';
|
|
3
|
-
import { ISplitsParser } from '../splitsParser/types';
|
|
4
|
-
import { ISyncTask } from '../../types';
|
|
5
|
-
import { ISettings } from '../../../types';
|
|
6
|
-
/**
|
|
7
|
-
* Offline equivalent of `splitChangesUpdaterFactory`
|
|
8
|
-
*/
|
|
9
|
-
export declare function fromObjectUpdaterFactory(splitsParser: ISplitsParser, storage: {
|
|
10
|
-
splits: ISplitsCacheSync;
|
|
11
|
-
}, readiness: IReadinessManager, settings: ISettings): () => Promise<boolean>;
|
|
12
|
-
/**
|
|
13
|
-
* PollingManager in Offline mode
|
|
14
|
-
*/
|
|
15
|
-
export declare function fromObjectSyncTaskFactory(splitsParser: ISplitsParser, storage: {
|
|
16
|
-
splits: ISplitsCacheSync;
|
|
17
|
-
}, readiness: IReadinessManager, settings: ISettings): ISyncTask<[], boolean>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IFetchMemberships } from '../../../services/types';
|
|
2
|
-
import { IMySegmentsFetcher } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Factory of MySegments fetcher.
|
|
5
|
-
* MySegments fetcher is a wrapper around `mySegments` API service that parses the response and handle errors.
|
|
6
|
-
*/
|
|
7
|
-
export declare function mySegmentsFetcherFactory(fetchMemberships: IFetchMemberships): IMySegmentsFetcher;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IFetchSegmentChanges } from '../../../services/types';
|
|
2
|
-
import { ISegmentChangesFetcher } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Factory of SegmentChanges fetcher.
|
|
5
|
-
* SegmentChanges fetcher is a wrapper around `segmentChanges` API service that parses the response and handle errors and retries.
|
|
6
|
-
*/
|
|
7
|
-
export declare function segmentChangesFetcherFactory(fetchSegmentChanges: IFetchSegmentChanges): ISegmentChangesFetcher;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IFetchSplitChanges } from '../../../services/types';
|
|
2
|
-
import { ISplitChangesFetcher } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Factory of SplitChanges fetcher.
|
|
5
|
-
* SplitChanges fetcher is a wrapper around `splitChanges` API service that parses the response and handle errors.
|
|
6
|
-
*/
|
|
7
|
-
export declare function splitChangesFetcherFactory(fetchSplitChanges: IFetchSplitChanges): ISplitChangesFetcher;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ISplitChangesResponse, ISegmentChangesResponse, IMembershipsResponse } from '../../../dtos/types';
|
|
2
|
-
import { IResponse } from '../../../services/types';
|
|
3
|
-
export declare type ISplitChangesFetcher = (since: number, noCache?: boolean, till?: number, decorator?: (promise: Promise<IResponse>) => Promise<IResponse>) => Promise<ISplitChangesResponse>;
|
|
4
|
-
export declare type ISegmentChangesFetcher = (since: number, segmentName: string, noCache?: boolean, till?: number, decorator?: (promise: Promise<ISegmentChangesResponse[]>) => Promise<ISegmentChangesResponse[]>) => Promise<ISegmentChangesResponse[]>;
|
|
5
|
-
export declare type IMySegmentsFetcher = (userMatchingKey: string, noCache?: boolean, till?: number, decorator?: (promise: Promise<IResponse>) => Promise<IResponse>) => Promise<IMembershipsResponse>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IPollingManagerCS } from './types';
|
|
2
|
-
import { ISdkFactoryContextSync } from '../../sdkFactory/types';
|
|
3
|
-
/**
|
|
4
|
-
* Expose start / stop mechanism for polling data from services.
|
|
5
|
-
* For client-side API with multiple clients.
|
|
6
|
-
*/
|
|
7
|
-
export declare function pollingManagerCSFactory(params: ISdkFactoryContextSync): IPollingManagerCS;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IPollingManager } from './types';
|
|
2
|
-
import { ISdkFactoryContextSync } from '../../sdkFactory/types';
|
|
3
|
-
/**
|
|
4
|
-
* Expose start / stop mechanism for pulling data from services.
|
|
5
|
-
*/
|
|
6
|
-
export declare function pollingManagerSSFactory(params: ISdkFactoryContextSync): IPollingManager;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IStorageSync } from '../../../storages/types';
|
|
2
|
-
import { IReadinessManager } from '../../../readiness/types';
|
|
3
|
-
import { IMySegmentsSyncTask } from '../types';
|
|
4
|
-
import { IFetchMemberships } from '../../../services/types';
|
|
5
|
-
import { ISettings } from '../../../types';
|
|
6
|
-
/**
|
|
7
|
-
* Creates a sync task that periodically executes a `mySegmentsUpdater` task
|
|
8
|
-
*/
|
|
9
|
-
export declare function mySegmentsSyncTaskFactory(fetchMemberships: IFetchMemberships, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings, matchingKey: string): IMySegmentsSyncTask;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IStorageSync } from '../../../storages/types';
|
|
2
|
-
import { IReadinessManager } from '../../../readiness/types';
|
|
3
|
-
import { ISegmentsSyncTask } from '../types';
|
|
4
|
-
import { IFetchSegmentChanges } from '../../../services/types';
|
|
5
|
-
import { ISettings } from '../../../types';
|
|
6
|
-
/**
|
|
7
|
-
* Creates a sync task that periodically executes a `segmentChangesUpdater` task
|
|
8
|
-
*/
|
|
9
|
-
export declare function segmentsSyncTaskFactory(fetchSegmentChanges: IFetchSegmentChanges, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings): ISegmentsSyncTask;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IStorageSync } from '../../../storages/types';
|
|
2
|
-
import { IReadinessManager } from '../../../readiness/types';
|
|
3
|
-
import { ISplitsSyncTask } from '../types';
|
|
4
|
-
import { IFetchSplitChanges } from '../../../services/types';
|
|
5
|
-
import { ISettings } from '../../../types';
|
|
6
|
-
/**
|
|
7
|
-
* Creates a sync task that periodically executes a `splitChangesUpdater` task
|
|
8
|
-
*/
|
|
9
|
-
export declare function splitsSyncTaskFactory(fetchSplitChanges: IFetchSplitChanges, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings, isClientSide?: boolean): ISplitsSyncTask;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ISplit } from '../../dtos/types';
|
|
2
|
-
import { IReadinessManager } from '../../readiness/types';
|
|
3
|
-
import { IStorageSync } from '../../storages/types';
|
|
4
|
-
import { MEMBERSHIPS_LS_UPDATE, MEMBERSHIPS_MS_UPDATE } from '../streaming/types';
|
|
5
|
-
import { ITask, ISyncTask } from '../types';
|
|
6
|
-
export interface ISplitsSyncTask extends ISyncTask<[noCache?: boolean, till?: number, splitUpdateNotification?: {
|
|
7
|
-
payload: ISplit;
|
|
8
|
-
changeNumber: number;
|
|
9
|
-
}], boolean> {
|
|
10
|
-
}
|
|
11
|
-
export interface ISegmentsSyncTask extends ISyncTask<[fetchOnlyNew?: boolean, segmentName?: string, noCache?: boolean, till?: number], boolean> {
|
|
12
|
-
}
|
|
13
|
-
export declare type MySegmentsData = {
|
|
14
|
-
type: MEMBERSHIPS_MS_UPDATE | MEMBERSHIPS_LS_UPDATE;
|
|
15
|
-
cn: number;
|
|
16
|
-
added: string[];
|
|
17
|
-
removed: string[];
|
|
18
|
-
};
|
|
19
|
-
export interface IMySegmentsSyncTask extends ISyncTask<[segmentsData?: MySegmentsData, noCache?: boolean, till?: number], boolean> {
|
|
20
|
-
}
|
|
21
|
-
export interface IPollingManager extends ITask {
|
|
22
|
-
syncAll(): Promise<any>;
|
|
23
|
-
splitsSyncTask: ISplitsSyncTask;
|
|
24
|
-
segmentsSyncTask: ISyncTask;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* PollingManager for client-side with support for multiple clients
|
|
28
|
-
*/
|
|
29
|
-
export interface IPollingManagerCS extends IPollingManager {
|
|
30
|
-
add(matchingKey: string, readiness: IReadinessManager, storage: IStorageSync): IMySegmentsSyncTask;
|
|
31
|
-
remove(matchingKey: string): void;
|
|
32
|
-
get(matchingKey: string): IMySegmentsSyncTask | undefined;
|
|
33
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IMySegmentsFetcher } from '../fetchers/types';
|
|
2
|
-
import { IStorageSync } from '../../../storages/types';
|
|
3
|
-
import { ISegmentsEventEmitter } from '../../../readiness/types';
|
|
4
|
-
import { ILogger } from '../../../logger/types';
|
|
5
|
-
import { MySegmentsData } from '../types';
|
|
6
|
-
declare type IMySegmentsUpdater = (segmentsData?: MySegmentsData, noCache?: boolean, till?: number) => Promise<boolean>;
|
|
7
|
-
/**
|
|
8
|
-
* factory of MySegments updater, a task that:
|
|
9
|
-
* - fetches mySegments using `mySegmentsFetcher`
|
|
10
|
-
* - updates `mySegmentsCache`
|
|
11
|
-
* - uses `segmentsEventEmitter` to emit events related to segments data updates
|
|
12
|
-
*/
|
|
13
|
-
export declare function mySegmentsUpdaterFactory(log: ILogger, mySegmentsFetcher: IMySegmentsFetcher, storage: IStorageSync, segmentsEventEmitter: ISegmentsEventEmitter, requestTimeoutBeforeReady: number, retriesOnFailureBeforeReady: number, matchingKey: string): IMySegmentsUpdater;
|
|
14
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ISegmentChangesFetcher } from '../fetchers/types';
|
|
2
|
-
import { ISegmentsCacheBase } from '../../../storages/types';
|
|
3
|
-
import { IReadinessManager } from '../../../readiness/types';
|
|
4
|
-
import { ILogger } from '../../../logger/types';
|
|
5
|
-
declare type ISegmentChangesUpdater = (fetchOnlyNew?: boolean, segmentName?: string, noCache?: boolean, till?: number) => Promise<boolean>;
|
|
6
|
-
/**
|
|
7
|
-
* Factory of SegmentChanges updater, a task that:
|
|
8
|
-
* - fetches segment changes using `segmentChangesFetcher`
|
|
9
|
-
* - updates `segmentsCache`
|
|
10
|
-
* - uses `segmentsEventEmitter` to emit events related to segments data updates
|
|
11
|
-
*
|
|
12
|
-
* @param log logger instance
|
|
13
|
-
* @param segmentChangesFetcher fetcher of `/segmentChanges`
|
|
14
|
-
* @param segments segments storage, with sync or async methods
|
|
15
|
-
* @param readiness optional readiness manager. Not required for synchronizer or producer mode.
|
|
16
|
-
*/
|
|
17
|
-
export declare function segmentChangesUpdaterFactory(log: ILogger, segmentChangesFetcher: ISegmentChangesFetcher, segments: ISegmentsCacheBase, readiness?: IReadinessManager): ISegmentChangesUpdater;
|
|
18
|
-
export {};
|