@splitsoftware/splitio-commons 1.6.2-rc.3 → 1.6.2-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/cjs/sdkClient/clientAttributesDecoration.js +1 -1
- package/cjs/storages/inMemory/AttributesCacheInMemory.js +1 -1
- package/esm/sdkClient/clientAttributesDecoration.js +1 -1
- package/esm/storages/inMemory/AttributesCacheInMemory.js +1 -1
- package/package.json +4 -5
- package/src/sdkClient/clientAttributesDecoration.ts +6 -6
- package/src/sdkClient/clientCS.ts +3 -3
- package/src/sdkClient/sdkClientMethodCSWithTT.ts +3 -3
- package/src/storages/inMemory/AttributesCacheInMemory.ts +13 -12
- package/src/types.d.ts +5 -70
- package/types/consent/index.d.ts +0 -2
- package/types/consent/sdkUserConsent.d.ts +0 -6
- package/types/dtos/types.d.ts +0 -166
- 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 -7
- package/types/evaluator/matchers/all.d.ts +0 -2
- package/types/evaluator/matchers/between.d.ts +0 -3
- package/types/evaluator/matchers/boolean.d.ts +0 -2
- package/types/evaluator/matchers/cont_all.d.ts +0 -2
- package/types/evaluator/matchers/cont_any.d.ts +0 -2
- package/types/evaluator/matchers/cont_str.d.ts +0 -2
- package/types/evaluator/matchers/dependency.d.ts +0 -5
- package/types/evaluator/matchers/eq.d.ts +0 -2
- package/types/evaluator/matchers/eq_set.d.ts +0 -2
- package/types/evaluator/matchers/ew.d.ts +0 -2
- package/types/evaluator/matchers/gte.d.ts +0 -2
- package/types/evaluator/matchers/index.d.ts +0 -7
- package/types/evaluator/matchers/lte.d.ts +0 -2
- package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
- package/types/evaluator/matchers/part_of.d.ts +0 -2
- package/types/evaluator/matchers/segment.d.ts +0 -6
- package/types/evaluator/matchers/string.d.ts +0 -2
- package/types/evaluator/matchers/sw.d.ts +0 -2
- package/types/evaluator/matchers/whitelist.d.ts +0 -3
- 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/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/index.d.ts +0 -5
- 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 -17
- 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 -141
- package/types/logger/index.d.ts +0 -20
- 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 -7
- package/types/logger/types.d.ts +0 -6
- package/types/readiness/constants.d.ts +0 -7
- package/types/readiness/readinessManager.d.ts +0 -6
- package/types/readiness/sdkReadinessManager.d.ts +0 -11
- package/types/readiness/types.d.ts +0 -54
- package/types/sdkClient/client.d.ts +0 -6
- package/types/sdkClient/clientAttributesDecoration.d.ts +0 -51
- package/types/sdkClient/clientCS.d.ts +0 -9
- package/types/sdkClient/clientInputValidation.d.ts +0 -7
- 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 -80
- package/types/sdkManager/index.d.ts +0 -5
- package/types/services/splitApi.d.ts +0 -11
- package/types/services/splitHttpClient.d.ts +0 -10
- package/types/services/types.d.ts +0 -50
- package/types/storages/AbstractSegmentsCacheSync.d.ts +0 -55
- package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -36
- package/types/storages/AbstractSplitsCacheSync.d.ts +0 -42
- package/types/storages/KeyBuilder.d.ts +0 -14
- package/types/storages/KeyBuilderCS.d.ts +0 -16
- package/types/storages/KeyBuilderSS.d.ts +0 -15
- package/types/storages/dataLoader.d.ts +0 -10
- package/types/storages/findLatencyIndex.d.ts +0 -7
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -25
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -50
- 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 -43
- package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
- package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -24
- 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 -22
- package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -19
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -20
- package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -53
- package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
- package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -18
- package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
- package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -18
- package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -91
- package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -20
- package/types/storages/inRedis/constants.d.ts +0 -1
- package/types/storages/inRedis/index.d.ts +0 -10
- package/types/storages/metadataBuilder.d.ts +0 -3
- package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
- package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -35
- package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -54
- package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -89
- package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -18
- package/types/storages/pluggable/constants.d.ts +0 -1
- package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -13
- package/types/storages/pluggable/index.d.ts +0 -10
- package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
- package/types/storages/types.d.ts +0 -430
- 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 -26
- package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -13
- package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
- package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -39
- 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 -67
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -6
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -8
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -12
- 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/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 -25
- package/types/sync/submitters/types.d.ts +0 -177
- 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 -13
- package/types/trackers/impressionsTracker.d.ts +0 -15
- package/types/trackers/telemetryTracker.d.ts +0 -3
- package/types/trackers/types.d.ts +0 -36
- 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 -16
- 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 -3
- package/types/utils/constants/index.d.ts +0 -62
- 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/splitExistance.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/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 -7
- 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 -55
- package/types/utils/lang/objectAssign.d.ts +0 -3
- package/types/utils/lang/sets.d.ts +0 -60
- 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 -5
- 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 -12
- package/types/utils/settingsValidation/localhost/builtin.d.ts +0 -15
- package/types/utils/settingsValidation/localhost/pluggable.d.ts +0 -15
- 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 -1
- package/types/utils/settingsValidation/runtime.d.ts +0 -2
- package/types/utils/settingsValidation/splitFilters.d.ts +0 -15
- package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -20
- 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
package/types/sync/syncTask.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../types';
|
|
2
|
-
import { ISyncTask } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Creates an object that handles the periodic execution of a given task via "start" and "stop" methods.
|
|
5
|
-
* The task can be also executed by calling the "execute" method. Multiple calls run sequentially to avoid race conditions (e.g., submitters executed on SDK destroy or full queue, while periodic execution is pending).
|
|
6
|
-
*
|
|
7
|
-
* @param log Logger instance.
|
|
8
|
-
* @param task Task to execute that returns a promise that NEVER REJECTS. Otherwise, periodic execution can result in Unhandled Promise Rejections.
|
|
9
|
-
* @param period Period in milliseconds to execute the task.
|
|
10
|
-
* @param taskName Optional task name for logging.
|
|
11
|
-
* @returns A sync task that wraps the given task.
|
|
12
|
-
*/
|
|
13
|
-
export declare function syncTaskFactory<Input extends any[], Output = any>(log: ILogger, task: (...args: Input) => Promise<Output>, period: number, taskName?: string): ISyncTask<Input, Output>;
|
package/types/sync/types.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { IReadinessManager } from '../readiness/types';
|
|
2
|
-
import { IStorageSync } from '../storages/types';
|
|
3
|
-
import { IPollingManager } from './polling/types';
|
|
4
|
-
import { IPushManager } from './streaming/types';
|
|
5
|
-
import { ISubmitterManager } from './submitters/types';
|
|
6
|
-
export interface ITask<Input extends any[] = []> {
|
|
7
|
-
/**
|
|
8
|
-
* Start periodic execution of the task
|
|
9
|
-
*/
|
|
10
|
-
start(...args: Input): any;
|
|
11
|
-
/**
|
|
12
|
-
* Stop periodic execution of the task
|
|
13
|
-
*/
|
|
14
|
-
stop(): any;
|
|
15
|
-
/**
|
|
16
|
-
* Returns true if the task periodic execution is running
|
|
17
|
-
*/
|
|
18
|
-
isRunning(): boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface ISyncTask<Input extends any[] = [], Output = any> extends ITask<Input> {
|
|
21
|
-
/**
|
|
22
|
-
* Start periodic execution of the task, and returns the promise of the first execution
|
|
23
|
-
*/
|
|
24
|
-
start(...args: Input): Promise<Output> | void;
|
|
25
|
-
/**
|
|
26
|
-
* Explicitly executes the task. It can be invoked multiple times. Returns a promise when the task is resolved
|
|
27
|
-
*/
|
|
28
|
-
execute(...args: Input): Promise<Output>;
|
|
29
|
-
/**
|
|
30
|
-
* Returns true if the task is being executed
|
|
31
|
-
*/
|
|
32
|
-
isExecuting(): boolean;
|
|
33
|
-
}
|
|
34
|
-
/** SyncManager */
|
|
35
|
-
export interface ISyncManager extends ITask {
|
|
36
|
-
flush(): Promise<any>;
|
|
37
|
-
pushManager?: IPushManager;
|
|
38
|
-
pollingManager?: IPollingManager;
|
|
39
|
-
submitterManager?: ISubmitterManager;
|
|
40
|
-
}
|
|
41
|
-
export interface ISyncManagerCS extends ISyncManager {
|
|
42
|
-
shared(matchingKey: string, readinessManager: IReadinessManager, storage: IStorageSync): ISyncManager | undefined;
|
|
43
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IEventsCacheBase, ITelemetryCacheAsync, ITelemetryCacheSync } from '../storages/types';
|
|
2
|
-
import { IEventsHandler, IEventTracker } from './types';
|
|
3
|
-
import { ISettings } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Event tracker stores events in cache and pass them to the integrations manager if provided.
|
|
6
|
-
*
|
|
7
|
-
* @param eventsCache cache to save events
|
|
8
|
-
* @param integrationsManager optional event handler used for integrations
|
|
9
|
-
*/
|
|
10
|
-
export declare function eventTrackerFactory(settings: ISettings, eventsCache: IEventsCacheBase, integrationsManager?: IEventsHandler, telemetryCache?: ITelemetryCacheSync | ITelemetryCacheAsync): IEventTracker;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ImpressionDTO } from '../../types';
|
|
2
|
-
import { IImpressionObserver } from './types';
|
|
3
|
-
export declare class ImpressionObserver<K extends string | number = string> implements IImpressionObserver {
|
|
4
|
-
private cache;
|
|
5
|
-
private hasher;
|
|
6
|
-
constructor(size: number, hasher: (impression: ImpressionDTO) => K);
|
|
7
|
-
testAndSet(impression: ImpressionDTO): number | undefined;
|
|
8
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ISettings } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if impressions previous time should be added or not.
|
|
4
|
-
*/
|
|
5
|
-
export declare function shouldAddPt(settings: ISettings): boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Checks if it should dedupe impressions or not.
|
|
8
|
-
*/
|
|
9
|
-
export declare function shouldBeOptimized(settings: ISettings): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Storage is async if mode is consumer or partial consumer
|
|
12
|
-
*/
|
|
13
|
-
export declare function isStorageSync(settings: ISettings): boolean;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IImpressionCountsCacheSync, IImpressionsCacheBase, ITelemetryCacheSync, ITelemetryCacheAsync } from '../storages/types';
|
|
2
|
-
import { IImpressionsHandler, IImpressionsTracker } from './types';
|
|
3
|
-
import { ISettings } from '../types';
|
|
4
|
-
import { IImpressionObserver } from './impressionObserver/types';
|
|
5
|
-
/**
|
|
6
|
-
* Impressions tracker stores impressions in cache and pass them to the listener and integrations manager if provided.
|
|
7
|
-
*
|
|
8
|
-
* @param impressionsCache cache to save impressions
|
|
9
|
-
* @param metadata runtime metadata (ip, hostname and version)
|
|
10
|
-
* @param impressionListener optional impression listener
|
|
11
|
-
* @param integrationsManager optional integrations manager
|
|
12
|
-
* @param observer optional impression observer. If provided, previous time (pt property) is included in impression instances
|
|
13
|
-
* @param countsCache optional cache to save impressions count. If provided, impressions will be deduped (OPTIMIZED mode)
|
|
14
|
-
*/
|
|
15
|
-
export declare function impressionsTrackerFactory(settings: ISettings, impressionsCache: IImpressionsCacheBase, integrationsManager?: IImpressionsHandler, observer?: IImpressionObserver, countsCache?: IImpressionCountsCacheSync, telemetryCache?: ITelemetryCacheSync | ITelemetryCacheAsync): IImpressionsTracker;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ITelemetryCacheSync, ITelemetryCacheAsync } from '../storages/types';
|
|
2
|
-
import { ITelemetryTracker } from './types';
|
|
3
|
-
export declare function telemetryTrackerFactory(telemetryCache?: ITelemetryCacheSync | ITelemetryCacheAsync, now?: () => number): ITelemetryTracker;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ImpressionDTO, EventData, ImpressionData, Attributes } from '../types';
|
|
2
|
-
import { StreamingEventType, Method, OperationType } from '../sync/submitters/types';
|
|
3
|
-
import { IEventsCacheBase } from '../storages/types';
|
|
4
|
-
import { NetworkError } from '../services/types';
|
|
5
|
-
/** Events tracker */
|
|
6
|
-
export interface IEventsHandler {
|
|
7
|
-
handleEvent(eventData: EventData): any;
|
|
8
|
-
}
|
|
9
|
-
export declare type IEventTracker = IEventsCacheBase;
|
|
10
|
-
/** Impressions tracker */
|
|
11
|
-
export interface IImpressionsHandler {
|
|
12
|
-
handleImpression(impressionData: ImpressionData): any;
|
|
13
|
-
}
|
|
14
|
-
export interface IImpressionsTracker {
|
|
15
|
-
track(impressions: ImpressionDTO[], attributes?: Attributes): void;
|
|
16
|
-
}
|
|
17
|
-
/** Telemetry tracker */
|
|
18
|
-
export declare type AUTH_REJECTION = 80;
|
|
19
|
-
export interface ITelemetryTracker {
|
|
20
|
-
/**
|
|
21
|
-
* Creates a telemetry evaluator tracker, to record Latencies, Exceptions and NonReadyUsage of client operations (getTreatments and track method calls)
|
|
22
|
-
*/
|
|
23
|
-
trackEval(method: Method): (label?: string) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Creates a telemetry runtime tracker, to record Latencies and Exceptions of HTTP requests
|
|
26
|
-
*/
|
|
27
|
-
trackHttp(method: OperationType): (error?: NetworkError) => void;
|
|
28
|
-
/**
|
|
29
|
-
* Records session length
|
|
30
|
-
*/
|
|
31
|
-
sessionLength(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Records streaming event
|
|
34
|
-
*/
|
|
35
|
-
streamingEvent(e: StreamingEventType | AUTH_REJECTION, d?: number): void;
|
|
36
|
-
}
|
package/types/utils/Backoff.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare class Backoff {
|
|
2
|
-
static __TEST__BASE_MILLIS?: number;
|
|
3
|
-
static __TEST__MAX_MILLIS?: number;
|
|
4
|
-
static DEFAULT_BASE_MILLIS: number;
|
|
5
|
-
static DEFAULT_MAX_MILLIS: number;
|
|
6
|
-
baseMillis: number;
|
|
7
|
-
maxMillis: number;
|
|
8
|
-
attempts: number;
|
|
9
|
-
cb: (...args: any[]) => any;
|
|
10
|
-
timeoutID: ReturnType<typeof setTimeout> | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* Schedule function calls with exponential backoff
|
|
13
|
-
*
|
|
14
|
-
* @param {function} cb
|
|
15
|
-
* @param {number} baseMillis
|
|
16
|
-
* @param {number} maxMillis
|
|
17
|
-
*/
|
|
18
|
-
constructor(cb: (...args: any[]) => any, baseMillis?: number, maxMillis?: number);
|
|
19
|
-
/**
|
|
20
|
-
* Schedule a next call to `cb`
|
|
21
|
-
* @returns scheduled delay in milliseconds
|
|
22
|
-
*/
|
|
23
|
-
scheduleCall(): number;
|
|
24
|
-
reset(): void;
|
|
25
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* yallist implementation based on isaacs/yallist (https://github.com/isaacs/yallist/yallist.js),
|
|
3
|
-
* with the minimal features used by the SDK.
|
|
4
|
-
|
|
5
|
-
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
6
|
-
|
|
7
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
-
purpose with or without fee is hereby granted, provided that the above
|
|
9
|
-
copyright notice and this permission notice appear in all copies.
|
|
10
|
-
|
|
11
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
17
|
-
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
**/
|
|
19
|
-
export declare class Node<T = any> {
|
|
20
|
-
value: T;
|
|
21
|
-
list: LinkedList<T> | null;
|
|
22
|
-
next: Node<T> | null;
|
|
23
|
-
prev: Node<T> | null;
|
|
24
|
-
constructor(value: T, prev: Node<T> | null, next: Node<T> | null, list: LinkedList<T> | null);
|
|
25
|
-
}
|
|
26
|
-
export declare class LinkedList<T = any> {
|
|
27
|
-
tail: Node<T> | null;
|
|
28
|
-
head: Node<T> | null;
|
|
29
|
-
length: number;
|
|
30
|
-
constructor();
|
|
31
|
-
removeNode(node: Node<T> | null): Node<T> | null | undefined;
|
|
32
|
-
unshiftNode(node: Node<T>): void;
|
|
33
|
-
unshift(): number;
|
|
34
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IMap } from '../lang/maps';
|
|
2
|
-
import { LinkedList, Node } from './LinkedList';
|
|
3
|
-
export declare class LRUCache<K, V> {
|
|
4
|
-
maxLen: number;
|
|
5
|
-
items: IMap<K, Node<{
|
|
6
|
-
key: K;
|
|
7
|
-
value: V;
|
|
8
|
-
}>>;
|
|
9
|
-
lru: LinkedList<{
|
|
10
|
-
key: K;
|
|
11
|
-
value: V;
|
|
12
|
-
}>;
|
|
13
|
-
constructor(maxSize?: number);
|
|
14
|
-
get(key: K): V | undefined;
|
|
15
|
-
set(key: K, value: V): boolean;
|
|
16
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IEventEmitter } from '../types';
|
|
2
|
-
export declare class EventEmitter implements IEventEmitter {
|
|
3
|
-
private listeners;
|
|
4
|
-
private registerListener;
|
|
5
|
-
addListener(type: string, listener: (...args: any[]) => void): this;
|
|
6
|
-
on(type: string, listener: (...args: any[]) => void): this;
|
|
7
|
-
once(type: string, listener: (...args: any[]) => void): this;
|
|
8
|
-
removeListener(): void;
|
|
9
|
-
off(): void;
|
|
10
|
-
emit(type: string, ...args: any[]): boolean;
|
|
11
|
-
removeAllListeners(type?: string): this;
|
|
12
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base64 utils in pure JS, for browser, node and others which don't provide globals `btoa` and `atob`.
|
|
3
|
-
* Implementation based on davidchambers/Base64 (https://github.com/davidchambers/Base64.js).
|
|
4
|
-
|
|
5
|
-
Copyright 2019 David Chambers
|
|
6
|
-
|
|
7
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
you may not use this file except in compliance with the License.
|
|
9
|
-
You may obtain a copy of the License at
|
|
10
|
-
|
|
11
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
|
|
13
|
-
Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
See the License for the specific language governing permissions and
|
|
17
|
-
limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Decode a given string value in Base64 format
|
|
21
|
-
*
|
|
22
|
-
* @param {string} input value to decode
|
|
23
|
-
*/
|
|
24
|
-
export declare function decodeFromBase64(input: string): string;
|
|
25
|
-
/**
|
|
26
|
-
* Encode a given string value to Base64 format.
|
|
27
|
-
*
|
|
28
|
-
* @param {string} input value to encode
|
|
29
|
-
*/
|
|
30
|
-
export declare function encodeToBase64(input: string): string;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { StorageType } from '../../types';
|
|
2
|
-
import { SDKMode } from '../../types';
|
|
3
|
-
export declare const CONTROL = "control";
|
|
4
|
-
export declare const CONTROL_WITH_CONFIG: {
|
|
5
|
-
treatment: string;
|
|
6
|
-
config: null;
|
|
7
|
-
};
|
|
8
|
-
export declare const UNKNOWN = "unknown";
|
|
9
|
-
export declare const NA = "NA";
|
|
10
|
-
export declare const SPLIT_IMPRESSION = "IMPRESSION";
|
|
11
|
-
export declare const SPLIT_EVENT = "EVENT";
|
|
12
|
-
export declare const DEBUG = "DEBUG";
|
|
13
|
-
export declare const OPTIMIZED = "OPTIMIZED";
|
|
14
|
-
export declare const LOCALHOST_MODE: SDKMode;
|
|
15
|
-
export declare const STANDALONE_MODE: SDKMode;
|
|
16
|
-
export declare const PRODUCER_MODE = "producer";
|
|
17
|
-
export declare const CONSUMER_MODE: SDKMode;
|
|
18
|
-
export declare const CONSUMER_PARTIAL_MODE: SDKMode;
|
|
19
|
-
export declare const STORAGE_MEMORY: StorageType;
|
|
20
|
-
export declare const STORAGE_LOCALSTORAGE: StorageType;
|
|
21
|
-
export declare const STORAGE_REDIS: StorageType;
|
|
22
|
-
export declare const STORAGE_PLUGGABLE: StorageType;
|
|
23
|
-
export declare const CONSENT_GRANTED = "GRANTED";
|
|
24
|
-
export declare const CONSENT_DECLINED = "DECLINED";
|
|
25
|
-
export declare const CONSENT_UNKNOWN = "UNKNOWN";
|
|
26
|
-
export declare const QUEUED = 0;
|
|
27
|
-
export declare const DROPPED = 1;
|
|
28
|
-
export declare const DEDUPED = 2;
|
|
29
|
-
export declare const STANDALONE_ENUM = 0;
|
|
30
|
-
export declare const CONSUMER_ENUM = 1;
|
|
31
|
-
export declare const CONSUMER_PARTIAL_ENUM = 2;
|
|
32
|
-
export declare const OPTIMIZED_ENUM = 0;
|
|
33
|
-
export declare const DEBUG_ENUM = 1;
|
|
34
|
-
export declare const SPLITS = "sp";
|
|
35
|
-
export declare const IMPRESSIONS = "im";
|
|
36
|
-
export declare const IMPRESSIONS_COUNT = "ic";
|
|
37
|
-
export declare const EVENTS = "ev";
|
|
38
|
-
export declare const TELEMETRY = "te";
|
|
39
|
-
export declare const TOKEN = "to";
|
|
40
|
-
export declare const SEGMENT = "se";
|
|
41
|
-
export declare const MY_SEGMENT = "ms";
|
|
42
|
-
export declare const TREATMENT = "t";
|
|
43
|
-
export declare const TREATMENTS = "ts";
|
|
44
|
-
export declare const TREATMENT_WITH_CONFIG = "tc";
|
|
45
|
-
export declare const TREATMENTS_WITH_CONFIG = "tcs";
|
|
46
|
-
export declare const TRACK = "tr";
|
|
47
|
-
export declare const CONNECTION_ESTABLISHED = 0;
|
|
48
|
-
export declare const OCCUPANCY_PRI = 10;
|
|
49
|
-
export declare const OCCUPANCY_SEC = 20;
|
|
50
|
-
export declare const STREAMING_STATUS = 30;
|
|
51
|
-
export declare const SSE_CONNECTION_ERROR = 40;
|
|
52
|
-
export declare const TOKEN_REFRESH = 50;
|
|
53
|
-
export declare const ABLY_ERROR = 60;
|
|
54
|
-
export declare const SYNC_MODE_UPDATE = 70;
|
|
55
|
-
export declare const AUTH_REJECTION = 80;
|
|
56
|
-
export declare const STREAMING = 0;
|
|
57
|
-
export declare const POLLING = 1;
|
|
58
|
-
export declare const REQUESTED = 0;
|
|
59
|
-
export declare const NON_REQUESTED = 1;
|
|
60
|
-
export declare const DISABLED = 0;
|
|
61
|
-
export declare const ENABLED = 1;
|
|
62
|
-
export declare const PAUSED = 2;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const algorithms: string | {
|
|
2
|
-
/**
|
|
3
|
-
* Expands GZIP data
|
|
4
|
-
* @param data The data to decompress
|
|
5
|
-
* @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.
|
|
6
|
-
* @returns The decompressed version of the data
|
|
7
|
-
*/
|
|
8
|
-
gunzipSync(data: Uint8Array, out?: Uint8Array | undefined): Uint8Array;
|
|
9
|
-
/**
|
|
10
|
-
* Expands Zlib data
|
|
11
|
-
* @param data The data to decompress
|
|
12
|
-
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
|
|
13
|
-
* @returns The decompressed version of the data
|
|
14
|
-
*/
|
|
15
|
-
unzlibSync(data: Uint8Array, out?: Uint8Array | undefined): Uint8Array;
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isLocalStorageAvailable(): boolean;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../types';
|
|
2
|
-
/** validates the given api key */
|
|
3
|
-
export declare function validateApiKey(log: ILogger, maybeApiKey: any): string | false;
|
|
4
|
-
export declare const usedKeysMap: Record<string, number>;
|
|
5
|
-
/** validates the given api key and also warns if it is in use */
|
|
6
|
-
export declare function validateAndTrackApiKey(log: ILogger, maybeApiKey: any): string | false;
|
|
7
|
-
export declare function releaseApiKey(apiKey: string): void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Attributes } from '../../types';
|
|
2
|
-
import { ILogger } from '../../types';
|
|
3
|
-
export declare function validateAttributes(log: ILogger, maybeAttrs: any, method: string): Attributes | undefined | false;
|
|
4
|
-
export declare function validateAttributesDeep(log: ILogger, maybeAttributes: Record<string, Object>, method: string): boolean;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { validateApiKey, validateAndTrackApiKey, releaseApiKey } from './apiKey';
|
|
2
|
-
export { validateAttributes } from './attributes';
|
|
3
|
-
export { validateEvent } from './event';
|
|
4
|
-
export { validateEventValue } from './eventValue';
|
|
5
|
-
export { validateEventProperties } from './eventProperties';
|
|
6
|
-
export { validateKey } from './key';
|
|
7
|
-
export { validateSplit } from './split';
|
|
8
|
-
export { validateSplits } from './splits';
|
|
9
|
-
export { validateTrafficType } from './trafficType';
|
|
10
|
-
export { validateIfNotDestroyed, validateIfOperational } from './isOperational';
|
|
11
|
-
export { validateSplitExistance } from './splitExistance';
|
|
12
|
-
export { validateTrafficTypeExistance } from './trafficTypeExistance';
|
|
13
|
-
export { validatePreloadedData } from './preloadedData';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../types';
|
|
2
|
-
import { IReadinessManager } from '../../readiness/types';
|
|
3
|
-
export declare function validateIfNotDestroyed(log: ILogger, readinessManager: IReadinessManager, method: string): boolean;
|
|
4
|
-
export declare function validateIfOperational(log: ILogger, readinessManager: IReadinessManager, method: string): boolean;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IReadinessManager } from '../../readiness/types';
|
|
2
|
-
import { ILogger } from '../../types';
|
|
3
|
-
/**
|
|
4
|
-
* This is defined here and in this format mostly because of the logger and the fact that it's considered a validation at product level.
|
|
5
|
-
* But it's not going to run on the input validation layer. In any case, the most compeling reason to use it as we do is to avoid going to Redis and get a split twice.
|
|
6
|
-
*/
|
|
7
|
-
export declare function validateSplitExistance(log: ILogger, readinessManager: IReadinessManager, splitName: string, labelOrSplitObj: any, method: string): boolean;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ISplitsCacheBase } from '../../storages/types';
|
|
2
|
-
import { IReadinessManager } from '../../readiness/types';
|
|
3
|
-
import { SDKMode } from '../../types';
|
|
4
|
-
import { MaybeThenable } from '../../dtos/types';
|
|
5
|
-
import { ILogger } from '../../types';
|
|
6
|
-
/**
|
|
7
|
-
* Separated from the previous method since on some cases it'll be async.
|
|
8
|
-
*/
|
|
9
|
-
export declare function validateTrafficTypeExistance(log: ILogger, readinessManager: IReadinessManager, splitsCache: ISplitsCacheBase, mode: SDKMode, maybeTT: string, method: string): MaybeThenable<boolean>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SplitKey, SplitKeyObject } from '../../types';
|
|
2
|
-
export declare function getMatching(key?: SplitKey): string;
|
|
3
|
-
export declare function getBucketing(key: SplitKey): string | undefined;
|
|
4
|
-
/**
|
|
5
|
-
* Verify type of key and return a valid object key used for get treatment for a
|
|
6
|
-
* specific split.
|
|
7
|
-
*/
|
|
8
|
-
export declare function keyParser(key: SplitKey): SplitKeyObject;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const SPLIT_KILLED = "killed";
|
|
2
|
-
export declare const NO_CONDITION_MATCH = "default rule";
|
|
3
|
-
export declare const SPLIT_NOT_FOUND = "definition not found";
|
|
4
|
-
export declare const SDK_NOT_READY = "not ready";
|
|
5
|
-
export declare const EXCEPTION = "exception";
|
|
6
|
-
export declare const SPLIT_ARCHIVED = "archived";
|
|
7
|
-
export declare const NOT_IN_SPLIT = "not in split";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Searches the index of the specified `value` inside an ordered array of `items` using the binary search algorithm.
|
|
3
|
-
*
|
|
4
|
-
* @param items the array to be searched
|
|
5
|
-
* @param value the value to be searched for
|
|
6
|
-
* @returns integer number between 0 and `items.length`. This value is the index of the search value,
|
|
7
|
-
* if it is contained in the array, or the index at which the value should be inserted to keep the array ordered.
|
|
8
|
-
*/
|
|
9
|
-
export declare function binarySearch(items: number[], value: number): number;
|