@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,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* x86 version of Murmur3 for 128bits.
|
|
3
|
-
* Used by hashImpression128 because in JS it is more efficient than the x64 version, no matter the underlying OS/CPU arch.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} str
|
|
6
|
-
*/
|
|
7
|
-
export declare function hash128(str: string, seed?: number): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare type Hash64 = {
|
|
2
|
-
hex: string;
|
|
3
|
-
dec: string;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Gets the higher 64 bits of the x64 version of Murmur3 for 128bits, as decimal and hexadecimal number strings.
|
|
7
|
-
* Used for MySegments channel V2 notifications.
|
|
8
|
-
* @param {string} str
|
|
9
|
-
*/
|
|
10
|
-
export declare function hash64(str: string): Hash64;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface utfx {
|
|
2
|
-
encodeUTF16toUTF8(src: () => number | null, dst: (...args: number[]) => string | undefined): void;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Converts and encodes UTF16 characters to UTF8 bytes.
|
|
6
|
-
* @param {!function():number|null} src Characters source as a function returning the next char code respectively `null`
|
|
7
|
-
* if there are no more characters left.
|
|
8
|
-
* @param {!function(number)} dst Bytes destination as a function successively called with the next byte.
|
|
9
|
-
* @expose
|
|
10
|
-
*/
|
|
11
|
-
export declare function encodeUTF16toUTF8(src: () => number | null, dst: (...args: number[]) => string | undefined): void;
|
|
12
|
-
/**
|
|
13
|
-
* Creates a source function for a string.
|
|
14
|
-
* @param {string} s String to read from
|
|
15
|
-
* @returns {!function():number|null} Source function returning the next char code respectively `null` if there are
|
|
16
|
-
* no more characters left.
|
|
17
|
-
* @throws {TypeError} If the argument is invalid
|
|
18
|
-
* @expose
|
|
19
|
-
*/
|
|
20
|
-
export declare function stringSource(s: string): () => number | null;
|
|
21
|
-
/**
|
|
22
|
-
* Creates a destination function for a string.
|
|
23
|
-
* @returns {function(number=):undefined|string} Destination function successively called with the next char code.
|
|
24
|
-
* Returns the final string when called without arguments.
|
|
25
|
-
* @expose
|
|
26
|
-
*/
|
|
27
|
-
export declare function stringDestination(): (...args: number[]) => string | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function thenable(o: any): o is Promise<any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function timeout<T>(ms: number, promise: Promise<T>): Promise<T>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* wraps a given promise in a new one with a default onRejected function,
|
|
3
|
-
* that handles the promise rejection if not other onRejected handler is provided.
|
|
4
|
-
*
|
|
5
|
-
* Caveats:
|
|
6
|
-
* - There are some cases where the `defaultOnRejected` handler is not invoked
|
|
7
|
-
* and the promise rejection must be handled by the user (same as the Promise spec):
|
|
8
|
-
* - using async/await syntax with a transpiler to Promises
|
|
9
|
-
* - setting an `onFinally` handler as the first handler (e.g. `promiseWrapper(Promise.reject()).finally(...)`)
|
|
10
|
-
* - setting more than one handler with at least one of them being an onRejected handler
|
|
11
|
-
* - If the wrapped promise is rejected when using native async/await syntax, the `defaultOnRejected` handler is invoked
|
|
12
|
-
* and neither the catch block nor the remaining try block are executed.
|
|
13
|
-
*
|
|
14
|
-
* @param customPromise promise to wrap
|
|
15
|
-
* @param defaultOnRejected default onRejected function
|
|
16
|
-
* @returns a promise that doesn't need to be handled for rejection (except when using async/await syntax) and
|
|
17
|
-
* includes a method named `hasOnFulfilled` that returns true if the promise has attached an onFulfilled handler.
|
|
18
|
-
*/
|
|
19
|
-
export declare function promiseWrapper<T>(customPromise: Promise<T>, defaultOnRejected: (_: any) => any): Promise<T> & {
|
|
20
|
-
hasOnFulfilled: () => boolean;
|
|
21
|
-
};
|
package/types/utils/semVer.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare class Semver {
|
|
2
|
-
private readonly _major;
|
|
3
|
-
private readonly _minor;
|
|
4
|
-
private readonly _patch;
|
|
5
|
-
private readonly _preRelease;
|
|
6
|
-
private readonly _isStable;
|
|
7
|
-
readonly version: string;
|
|
8
|
-
constructor(version: string);
|
|
9
|
-
/**
|
|
10
|
-
* Precedence comparision between 2 Semver objects.
|
|
11
|
-
*
|
|
12
|
-
* @return `0` if `this === toCompare`, `-1` if `this < toCompare`, and `1` if `this > toCompare`
|
|
13
|
-
*/
|
|
14
|
-
compare(toCompare: Semver): number;
|
|
15
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { ISettingsValidationParams } from './types';
|
|
2
|
-
import { ISettings } from '../../types';
|
|
3
|
-
export declare const base: {
|
|
4
|
-
mode: import("../../types").SDKMode;
|
|
5
|
-
core: {
|
|
6
|
-
authorizationKey: undefined;
|
|
7
|
-
key: undefined;
|
|
8
|
-
labelsEnabled: boolean;
|
|
9
|
-
IPAddressesEnabled: undefined;
|
|
10
|
-
};
|
|
11
|
-
scheduler: {
|
|
12
|
-
featuresRefreshRate: number;
|
|
13
|
-
segmentsRefreshRate: number;
|
|
14
|
-
telemetryRefreshRate: number;
|
|
15
|
-
impressionsRefreshRate: number;
|
|
16
|
-
offlineRefreshRate: number;
|
|
17
|
-
eventsPushRate: number;
|
|
18
|
-
eventsQueueSize: number;
|
|
19
|
-
impressionsQueueSize: number;
|
|
20
|
-
pushRetryBackoffBase: number;
|
|
21
|
-
};
|
|
22
|
-
urls: {
|
|
23
|
-
sdk: string;
|
|
24
|
-
events: string;
|
|
25
|
-
auth: string;
|
|
26
|
-
streaming: string;
|
|
27
|
-
telemetry: string;
|
|
28
|
-
};
|
|
29
|
-
storage: undefined;
|
|
30
|
-
debug: undefined;
|
|
31
|
-
impressionListener: undefined;
|
|
32
|
-
version: undefined;
|
|
33
|
-
integrations: undefined;
|
|
34
|
-
streamingEnabled: boolean;
|
|
35
|
-
sync: {
|
|
36
|
-
splitFilters: undefined;
|
|
37
|
-
impressionsMode: string;
|
|
38
|
-
localhostMode: undefined;
|
|
39
|
-
enabled: boolean;
|
|
40
|
-
flagSpecVersion: string;
|
|
41
|
-
};
|
|
42
|
-
log: undefined;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Validates the given config and use it to build a settings object.
|
|
46
|
-
* NOTE: it doesn't validate the SDK Key. Call `validateApiKey` or `validateAndTrackApiKey` for that after settings validation.
|
|
47
|
-
*
|
|
48
|
-
* @param config user defined configuration
|
|
49
|
-
* @param validationParams defaults and fields validators used to validate and creates a settings object from a given config
|
|
50
|
-
*/
|
|
51
|
-
export declare function settingsValidation(config: unknown, validationParams: ISettingsValidationParams): ISettings;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../../logger/types';
|
|
2
|
-
/**
|
|
3
|
-
* This function validates `settings.integrations` object
|
|
4
|
-
*
|
|
5
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
6
|
-
* @param {function} integrationValidator filter used to remove invalid integration items
|
|
7
|
-
* @param {string} extraWarning optional string used to better describe why an item might be invalid
|
|
8
|
-
*
|
|
9
|
-
* @returns {Array} array of valid integration items. The array might be empty if `settings` object does not have valid integrations.
|
|
10
|
-
*/
|
|
11
|
-
export declare function validateIntegrations(settings: {
|
|
12
|
-
log: ILogger;
|
|
13
|
-
integrations?: any;
|
|
14
|
-
}, integrationValidator: (integrationItem: any) => boolean, extraWarning?: string): any[];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../../logger/types';
|
|
2
|
-
/**
|
|
3
|
-
* This function validates `settings.integrations` object that consists of a list of configuration items, used by the isomorphic JS SDK.
|
|
4
|
-
*
|
|
5
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
6
|
-
* @param {Array<string>} validIntegrationTypes list of integration types to filter from `settings.integrations`
|
|
7
|
-
*
|
|
8
|
-
* @returns {Array} array of valid integration items. The array might be empty if `settings` object does not have valid integrations.
|
|
9
|
-
*/
|
|
10
|
-
export declare function validateConfigurableIntegrations(settings: {
|
|
11
|
-
log: ILogger;
|
|
12
|
-
integrations?: any;
|
|
13
|
-
}, validIntegrationTypes?: string[]): any[];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ISettings } from '../../../types';
|
|
2
|
-
import { ILogger } from '../../../logger/types';
|
|
3
|
-
/**
|
|
4
|
-
* This function validates `settings.integrations` object that consists of a list of pluggable integration factories.
|
|
5
|
-
*
|
|
6
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
7
|
-
*
|
|
8
|
-
* @returns {Array} array of valid integration factories. The array might be empty if `settings` object does not have valid integrations.
|
|
9
|
-
*/
|
|
10
|
-
export declare function validatePluggableIntegrations(settings: {
|
|
11
|
-
log: ILogger;
|
|
12
|
-
integrations?: any;
|
|
13
|
-
}): ISettings['integrations'];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../../logger/types';
|
|
2
|
-
import { SDKMode } from '../../../types';
|
|
3
|
-
/**
|
|
4
|
-
* This function validates `settings.sync.localhostMode` object
|
|
5
|
-
*
|
|
6
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
7
|
-
*
|
|
8
|
-
* @returns {Object} provided localhost mode module at `settings.sync.localhostMode` if valid, or a default LocalhostFromObject instance if not provided or invalid
|
|
9
|
-
*/
|
|
10
|
-
export declare function validateLocalhostWithDefault(settings: {
|
|
11
|
-
log: ILogger;
|
|
12
|
-
sync: {
|
|
13
|
-
localhostMode?: any;
|
|
14
|
-
};
|
|
15
|
-
mode: SDKMode;
|
|
16
|
-
}): any;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../../logger/types';
|
|
2
|
-
import { SDKMode } from '../../../types';
|
|
3
|
-
/**
|
|
4
|
-
* This function validates `settings.sync.localhostMode` object
|
|
5
|
-
*
|
|
6
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
7
|
-
*
|
|
8
|
-
* @returns {Object | undefined} provided localhost mode module at `settings.sync.localhostMode`, or undefined if it is not provided or invalid
|
|
9
|
-
*/
|
|
10
|
-
export declare function validateLocalhost(settings: {
|
|
11
|
-
log: ILogger;
|
|
12
|
-
sync: {
|
|
13
|
-
localhostMode?: any;
|
|
14
|
-
};
|
|
15
|
-
mode: SDKMode;
|
|
16
|
-
}): any;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../../logger/types';
|
|
2
|
-
/**
|
|
3
|
-
* Validates the `debug` property at config and use it to set the log level.
|
|
4
|
-
*
|
|
5
|
-
* @param settings user config object, with an optional `debug` property of type boolean or string log level.
|
|
6
|
-
* @returns a logger instance with the log level at `settings.debug`. If `settings.debug` is invalid or not provided, `initialLogLevel` is used.
|
|
7
|
-
*/
|
|
8
|
-
export declare function validateLogger(settings: {
|
|
9
|
-
debug: unknown;
|
|
10
|
-
}): ILogger;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { LogLevel } from '../../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Returns the LogLevel for the given debugValue or undefined if it is invalid,
|
|
4
|
-
* i.e., if the debugValue is not a boolean or LogLevel string.
|
|
5
|
-
*
|
|
6
|
-
* @param debugValue debug value at config
|
|
7
|
-
* @returns LogLevel of the given debugValue or undefined if the provided value is invalid
|
|
8
|
-
*/
|
|
9
|
-
export declare function getLogLevel(debugValue: unknown): LogLevel | undefined;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { LogLevel } from '../../../types';
|
|
2
|
-
/**
|
|
3
|
-
* The debug level can be set globally via the `localStorage.splitio_debug` item in browser, or the `SPLITIO_DEBUG` env var in NodeJS.
|
|
4
|
-
* Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
|
|
5
|
-
* Other acceptable values are 'on', 'enable' and 'enabled', which are equivalent to 'DEBUG'.
|
|
6
|
-
* Any other value, like undefined, null or an invalid string, returns `undefined` and means that the global log level is not set.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getGlobalLogLevel(): LogLevel | undefined;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../../logger/types';
|
|
2
|
-
/**
|
|
3
|
-
* Validates the `debug` property at config and use it to set the logger.
|
|
4
|
-
*
|
|
5
|
-
* @param settings user config object, with an optional `debug` property of type boolean, string log level or a Logger object.
|
|
6
|
-
* @returns a logger instance, that might be: the provided logger at `settings.debug`, or one with the given `debug` log level,
|
|
7
|
-
* or one with NONE log level if `debug` is not defined or invalid.
|
|
8
|
-
*/
|
|
9
|
-
export declare function validateLogger(settings: {
|
|
10
|
-
debug: unknown;
|
|
11
|
-
}): ILogger;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ISplitFiltersValidation } from '../../dtos/types';
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
|
-
/**
|
|
4
|
-
* Validates `splitFilters` configuration object and parses it into a query string for filtering splits on `/splitChanges` fetch.
|
|
5
|
-
*
|
|
6
|
-
* @param {ILogger} log logger
|
|
7
|
-
* @param {any} maybeSplitFilters split filters configuration param provided by the user
|
|
8
|
-
* @param {string} mode settings mode
|
|
9
|
-
* @returns it returns an object with the following properties:
|
|
10
|
-
* - `validFilters`: the validated `splitFilters` configuration object defined by the user.
|
|
11
|
-
* - `queryString`: the parsed split filter query. it is null if all filters are invalid or all values in filters are invalid.
|
|
12
|
-
* - `groupedFilters`: list of values grouped by filter type.
|
|
13
|
-
*
|
|
14
|
-
* @throws Error if the some of the grouped list of values per filter exceeds the max allowed length
|
|
15
|
-
*/
|
|
16
|
-
export declare function validateSplitFilters(log: ILogger, maybeSplitFilters: any, mode: string): ISplitFiltersValidation;
|
|
17
|
-
export declare function validateFlagSets(log: ILogger, method: string, flagSets: string[], flagSetsInConfig: string[]): string[] | false;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ISettings, SDKMode } from '../../../types';
|
|
2
|
-
import { ILogger } from '../../../logger/types';
|
|
3
|
-
import { IStorageFactoryParams, IStorageSync } from '../../../storages/types';
|
|
4
|
-
export declare function __InLocalStorageMockFactory(params: IStorageFactoryParams): IStorageSync;
|
|
5
|
-
export declare namespace __InLocalStorageMockFactory {
|
|
6
|
-
var type: import("../../../storages/types").StorageType;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* This function validates `settings.storage` object
|
|
10
|
-
*
|
|
11
|
-
* @param {any} settings config object provided by the user to initialize the sdk
|
|
12
|
-
*
|
|
13
|
-
* @returns {Object} valid storage factory. Default to `InMemoryStorageCSFactory` if the provided storage is invalid or not compatible with the sdk mode if mode is standalone or localhost
|
|
14
|
-
*
|
|
15
|
-
* @throws error if mode is consumer and the provided storage is not compatible
|
|
16
|
-
*/
|
|
17
|
-
export declare function validateStorageCS(settings: {
|
|
18
|
-
log: ILogger;
|
|
19
|
-
storage?: any;
|
|
20
|
-
mode: SDKMode;
|
|
21
|
-
}): ISettings['storage'];
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ISettings } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Parameters used to specialize the settings validation for each API variant
|
|
4
|
-
* (client-side, server-side) and environment (Node server, Browser, etc)
|
|
5
|
-
*/
|
|
6
|
-
export interface ISettingsValidationParams {
|
|
7
|
-
/**
|
|
8
|
-
* Object of values to overwrite base settings.
|
|
9
|
-
* Version and startup properties are required, because they are not defined in the base settings.
|
|
10
|
-
*/
|
|
11
|
-
defaults: Partial<ISettings> & {
|
|
12
|
-
version: string;
|
|
13
|
-
} & {
|
|
14
|
-
startup: ISettings['startup'];
|
|
15
|
-
};
|
|
16
|
-
/** If true, validates core.key */
|
|
17
|
-
acceptKey?: boolean;
|
|
18
|
-
/** Define runtime values (`settings.runtime`) */
|
|
19
|
-
runtime: (settings: ISettings) => ISettings['runtime'];
|
|
20
|
-
/** Storage validator (`settings.storage`) */
|
|
21
|
-
storage?: (settings: ISettings) => ISettings['storage'];
|
|
22
|
-
/** Integrations validator (`settings.integrations`) */
|
|
23
|
-
integrations?: (settings: ISettings) => ISettings['integrations'];
|
|
24
|
-
/** Logger validator (`settings.debug`) */
|
|
25
|
-
logger: (settings: ISettings) => ISettings['log'];
|
|
26
|
-
/** Localhost mode validator (`settings.sync.localhostMode`) */
|
|
27
|
-
localhost?: (settings: ISettings) => ISettings['sync']['localhostMode'];
|
|
28
|
-
/** User consent validator (`settings.userConsent`) */
|
|
29
|
-
consent?: (settings: ISettings) => ISettings['userConsent'];
|
|
30
|
-
/** Flag spec version validation. Configurable by the JS Synchronizer but not by the SDKs */
|
|
31
|
-
flagSpec?: (settings: ISettings) => ISettings['sync']['flagSpecVersion'];
|
|
32
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ISettings } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Get URL based on a given target (path).
|
|
4
|
-
* ATM, it is only used for testing purposes.
|
|
5
|
-
*
|
|
6
|
-
* @param settings settings object
|
|
7
|
-
* @param target url path
|
|
8
|
-
* @return complete url
|
|
9
|
-
*/
|
|
10
|
-
export declare function url(settings: ISettings, target: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const now: () => number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function now(): number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function timer(now: () => number): () => number;
|