@splitsoftware/splitio-commons 1.6.0 → 1.6.2-rc.1
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 +3 -0
- package/cjs/integrations/ga/GaToSplit.js +4 -2
- package/cjs/integrations/ga/GoogleAnalyticsToSplit.js +1 -0
- package/cjs/listeners/browser.js +2 -1
- package/cjs/logger/constants.js +2 -1
- package/cjs/sdkFactory/index.js +13 -5
- package/cjs/services/splitApi.js +20 -0
- package/cjs/sync/submitters/submitterManager.js +3 -0
- package/cjs/sync/submitters/uniqueKeysSubmitter.js +70 -0
- package/cjs/trackers/impressionsTracker.js +7 -28
- package/cjs/trackers/strategy/strategyDebug.js +25 -0
- package/cjs/trackers/strategy/strategyNone.js +29 -0
- package/cjs/trackers/strategy/strategyOptimized.js +34 -0
- package/cjs/trackers/uniqueKeysTracker.js +69 -0
- package/cjs/utils/constants/index.js +3 -2
- package/cjs/utils/settingsValidation/impressionsMode.js +2 -2
- package/cjs/utils/settingsValidation/index.js +3 -0
- package/esm/integrations/ga/GaToSplit.js +4 -2
- package/esm/integrations/ga/GoogleAnalyticsToSplit.js +1 -0
- package/esm/listeners/browser.js +3 -2
- package/esm/logger/constants.js +1 -0
- package/esm/sdkFactory/index.js +13 -5
- package/esm/services/splitApi.js +20 -0
- package/esm/sync/submitters/submitterManager.js +3 -0
- package/esm/sync/submitters/uniqueKeysSubmitter.js +64 -0
- package/esm/trackers/impressionsTracker.js +7 -28
- package/esm/trackers/strategy/strategyDebug.js +21 -0
- package/esm/trackers/strategy/strategyNone.js +25 -0
- package/esm/trackers/strategy/strategyOptimized.js +30 -0
- package/esm/trackers/uniqueKeysTracker.js +65 -0
- package/esm/utils/constants/index.js +1 -0
- package/esm/utils/settingsValidation/impressionsMode.js +3 -3
- package/esm/utils/settingsValidation/index.js +3 -0
- package/package.json +1 -1
- package/src/integrations/ga/GaToSplit.ts +3 -2
- package/src/integrations/ga/GoogleAnalyticsToSplit.ts +1 -1
- package/src/listeners/browser.ts +3 -2
- package/src/logger/constants.ts +1 -0
- package/src/sdkFactory/index.ts +15 -5
- package/src/sdkFactory/types.ts +7 -4
- package/src/services/splitApi.ts +22 -0
- package/src/services/types.ts +6 -0
- package/src/storages/types.ts +17 -4
- package/src/sync/submitters/submitterManager.ts +2 -0
- package/src/sync/submitters/types.ts +20 -1
- package/src/sync/submitters/uniqueKeysSubmitter.ts +79 -0
- package/src/trackers/impressionsTracker.ts +12 -34
- package/src/trackers/strategy/strategyDebug.ts +28 -0
- package/src/trackers/strategy/strategyNone.ts +34 -0
- package/src/trackers/strategy/strategyOptimized.ts +42 -0
- package/src/trackers/types.ts +30 -0
- package/src/trackers/uniqueKeysTracker.ts +80 -0
- package/src/types.ts +2 -1
- package/src/utils/constants/index.ts +1 -0
- package/src/utils/settingsValidation/impressionsMode.ts +3 -3
- package/src/utils/settingsValidation/index.ts +4 -0
- package/types/integrations/ga/GoogleAnalyticsToSplit.d.ts +1 -1
- package/types/logger/browser/{debugLogger.d.ts → DebugLogger.d.ts} +0 -0
- package/types/logger/browser/{errorLogger.d.ts → ErrorLogger.d.ts} +0 -0
- package/types/logger/browser/{infoLogger.d.ts → InfoLogger.d.ts} +0 -0
- package/types/logger/browser/{warnLogger.d.ts → WarnLogger.d.ts} +0 -0
- package/types/logger/constants.d.ts +1 -0
- package/types/sdkFactory/types.d.ts +4 -2
- package/types/services/types.d.ts +4 -0
- package/types/storages/types.d.ts +16 -3
- package/types/sync/submitters/types.d.ts +18 -1
- package/types/sync/submitters/uniqueKeysSubmitter.d.ts +19 -0
- package/types/trackers/filter/bloomFilter.d.ts +10 -0
- package/types/trackers/filter/dictionaryFilter.d.ts +8 -0
- package/types/trackers/filter/types.d.ts +5 -0
- package/types/trackers/impressionsTracker.d.ts +4 -6
- package/types/trackers/strategy/strategyDebug.d.ts +9 -0
- package/types/trackers/strategy/strategyNone.d.ts +10 -0
- package/types/trackers/strategy/strategyOptimized.d.ts +11 -0
- package/types/trackers/types.d.ts +29 -0
- package/types/trackers/uniqueKeysTracker.d.ts +13 -0
- package/types/types.d.ts +2 -1
- package/types/utils/constants/index.d.ts +1 -0
- package/types/utils/settingsValidation/index.d.ts +1 -0
- package/types/utils/timeTracker/index.d.ts +70 -1
- package/src/logger/.DS_Store +0 -0
- package/types/integrations/ga/GaToSplitPlugin.d.ts +0 -3
- package/types/integrations/ga/SplitToGaPlugin.d.ts +0 -4
- package/types/integrations/ga/autoRequire.d.ts +0 -4
- package/types/logger/codes.d.ts +0 -2
- package/types/logger/codesConstants.d.ts +0 -117
- package/types/logger/codesConstantsBrowser.d.ts +0 -2
- package/types/logger/codesConstantsNode.d.ts +0 -14
- package/types/logger/codesDebug.d.ts +0 -1
- package/types/logger/codesDebugBrowser.d.ts +0 -1
- package/types/logger/codesDebugNode.d.ts +0 -1
- package/types/logger/codesError.d.ts +0 -1
- package/types/logger/codesErrorNode.d.ts +0 -1
- package/types/logger/codesInfo.d.ts +0 -1
- package/types/logger/codesWarn.d.ts +0 -1
- package/types/logger/codesWarnNode.d.ts +0 -1
- package/types/logger/debugLogger.d.ts +0 -2
- package/types/logger/errorLogger.d.ts +0 -2
- package/types/logger/infoLogger.d.ts +0 -2
- package/types/logger/messages/debugBrowser.d.ts +0 -1
- package/types/logger/messages/debugNode.d.ts +0 -1
- package/types/logger/messages/errorNode.d.ts +0 -1
- package/types/logger/messages/warnNode.d.ts +0 -1
- package/types/logger/noopLogger.d.ts +0 -2
- package/types/logger/warnLogger.d.ts +0 -2
- package/types/sdkFactory/userConsentProps.d.ts +0 -6
- package/types/sdkManager/sdkManagerMethod.d.ts +0 -6
- package/types/storages/getRegisteredSegments.d.ts +0 -10
- package/types/storages/inMemory/index.d.ts +0 -10
- package/types/storages/parseSegments.d.ts +0 -6
- package/types/sync/polling/syncTasks/splitsSyncTask.copy.d.ts +0 -35
- package/types/sync/polling/syncTasks/splitsSyncTask.morelikeoriginal.d.ts +0 -35
- package/types/sync/streaming/AuthClient/indexV1.d.ts +0 -12
- package/types/sync/streaming/AuthClient/indexV2.d.ts +0 -8
- package/types/sync/streaming/pushManagerCS.d.ts +0 -1
- package/types/sync/streaming/pushManagerNoUsers.d.ts +0 -13
- package/types/sync/streaming/pushManagerSS.d.ts +0 -1
- package/types/sync/submitters/telemetrySyncTask.d.ts +0 -0
- package/types/sync/syncManagerFromFile.d.ts +0 -2
- package/types/sync/syncManagerFromObject.d.ts +0 -2
- package/types/sync/syncManagerOffline.d.ts +0 -9
- package/types/trackers/telemetryRecorder.d.ts +0 -0
- package/types/utils/EventEmitter.d.ts +0 -4
- package/types/utils/consent.d.ts +0 -2
- package/types/utils/lang/errors.d.ts +0 -10
- package/types/utils/murmur3/commons.d.ts +0 -12
- package/types/utils/settingsValidation/buildMetadata.d.ts +0 -3
- package/types/utils/settingsValidation/localhost/index.d.ts +0 -9
- package/types/utils/settingsValidation/logger.d.ts +0 -11
- package/types/utils/settingsValidation/runtime/browser.d.ts +0 -2
- package/types/utils/settingsValidation/runtime/node.d.ts +0 -2
- package/types/utils/settingsValidation/userConsent.d.ts +0 -5
|
@@ -32,6 +32,22 @@ export declare type ImpressionCountsPayload = {
|
|
|
32
32
|
rc: number;
|
|
33
33
|
}[];
|
|
34
34
|
};
|
|
35
|
+
export declare type UniqueKeysPayloadSs = {
|
|
36
|
+
keys: {
|
|
37
|
+
/** Split name */
|
|
38
|
+
f: string;
|
|
39
|
+
/** keyNames */
|
|
40
|
+
ks: string[];
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
export declare type UniqueKeysPayloadCs = {
|
|
44
|
+
keys: {
|
|
45
|
+
/** keyNames */
|
|
46
|
+
k: string;
|
|
47
|
+
/** Split name */
|
|
48
|
+
fs: string[];
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
35
51
|
export declare type StoredImpressionWithMetadata = {
|
|
36
52
|
/** Metadata */
|
|
37
53
|
m: IMetadata;
|
|
@@ -132,7 +148,8 @@ export declare type CONSUMER_PARTIAL_ENUM = 2;
|
|
|
132
148
|
export declare type OperationMode = STANDALONE_ENUM | CONSUMER_ENUM | CONSUMER_PARTIAL_ENUM;
|
|
133
149
|
export declare type OPTIMIZED_ENUM = 0;
|
|
134
150
|
export declare type DEBUG_ENUM = 1;
|
|
135
|
-
export declare type
|
|
151
|
+
export declare type NONE_ENUM = 2;
|
|
152
|
+
export declare type ImpressionsMode = OPTIMIZED_ENUM | DEBUG_ENUM | NONE_ENUM;
|
|
136
153
|
export declare type RefreshRates = {
|
|
137
154
|
sp: number;
|
|
138
155
|
se?: number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ISdkFactoryContextSync } from '../../sdkFactory/types';
|
|
2
|
+
import { ISet } from '../../utils/lang/sets';
|
|
3
|
+
import { UniqueKeysPayloadCs, UniqueKeysPayloadSs } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Converts `uniqueKeys` data from cache into request payload for CS.
|
|
6
|
+
*/
|
|
7
|
+
export declare function fromUniqueKeysCollectorCs(uniqueKeys: {
|
|
8
|
+
[featureName: string]: ISet<string>;
|
|
9
|
+
}): UniqueKeysPayloadCs;
|
|
10
|
+
/**
|
|
11
|
+
* Converts `uniqueKeys` data from cache into request payload for SS.
|
|
12
|
+
*/
|
|
13
|
+
export declare function fromUniqueKeysCollectorSs(uniqueKeys: {
|
|
14
|
+
[featureName: string]: ISet<string>;
|
|
15
|
+
}): UniqueKeysPayloadSs;
|
|
16
|
+
/**
|
|
17
|
+
* Submitter that periodically posts impression counts
|
|
18
|
+
*/
|
|
19
|
+
export declare function uniqueKeysSubmitterFactory(params: ISdkFactoryContextSync): import("../types").ISyncTask<[], void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IFilter } from './types';
|
|
2
|
+
export declare class BloomFilterImp implements IFilter {
|
|
3
|
+
private spectedInsertions;
|
|
4
|
+
private errorRate;
|
|
5
|
+
private filter;
|
|
6
|
+
constructor(spectedInsertions: number, errorRate: number);
|
|
7
|
+
add(data: string): boolean;
|
|
8
|
+
contains(data: string): boolean;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IImpressionsHandler, IImpressionsTracker } from './types';
|
|
1
|
+
import { IImpressionsCacheBase, ITelemetryCacheSync, ITelemetryCacheAsync } from '../storages/types';
|
|
2
|
+
import { IImpressionsHandler, IImpressionsTracker, IStrategy } from './types';
|
|
3
3
|
import { ISettings } from '../types';
|
|
4
|
-
import { IImpressionObserver } from './impressionObserver/types';
|
|
5
4
|
/**
|
|
6
5
|
* Impressions tracker stores impressions in cache and pass them to the listener and integrations manager if provided.
|
|
7
6
|
*
|
|
@@ -9,7 +8,6 @@ import { IImpressionObserver } from './impressionObserver/types';
|
|
|
9
8
|
* @param metadata runtime metadata (ip, hostname and version)
|
|
10
9
|
* @param impressionListener optional impression listener
|
|
11
10
|
* @param integrationsManager optional integrations manager
|
|
12
|
-
* @param
|
|
13
|
-
* @param countsCache optional cache to save impressions count. If provided, impressions will be deduped (OPTIMIZED mode)
|
|
11
|
+
* @param strategy strategy for impressions tracking.
|
|
14
12
|
*/
|
|
15
|
-
export declare function impressionsTrackerFactory(settings: ISettings, impressionsCache: IImpressionsCacheBase,
|
|
13
|
+
export declare function impressionsTrackerFactory(settings: ISettings, impressionsCache: IImpressionsCacheBase, strategy: IStrategy, integrationsManager?: IImpressionsHandler, telemetryCache?: ITelemetryCacheSync | ITelemetryCacheAsync): IImpressionsTracker;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IImpressionObserver } from '../impressionObserver/types';
|
|
2
|
+
import { IStrategy } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Debug strategy for impressions tracker. Wraps impressions to store and adds previousTime if it corresponds
|
|
5
|
+
*
|
|
6
|
+
* @param impressionsObserver impression observer. Previous time (pt property) is included in impression instances
|
|
7
|
+
* @returns IStrategyResult
|
|
8
|
+
*/
|
|
9
|
+
export declare function strategyDebugFactory(impressionsObserver: IImpressionObserver): IStrategy;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IImpressionCountsCacheSync } from '../../storages/types';
|
|
2
|
+
import { IStrategy, IUniqueKeysTracker } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* None strategy for impressions tracker.
|
|
5
|
+
*
|
|
6
|
+
* @param impressionsCounter cache to save impressions count. impressions will be deduped (OPTIMIZED mode)
|
|
7
|
+
* @param uniqueKeysTracker unique keys tracker in charge of tracking the unique keys per split.
|
|
8
|
+
* @returns IStrategyResult
|
|
9
|
+
*/
|
|
10
|
+
export declare function strategyNoneFactory(impressionsCounter: IImpressionCountsCacheSync, uniqueKeysTracker: IUniqueKeysTracker): IStrategy;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IImpressionCountsCacheSync } from '../../storages/types';
|
|
2
|
+
import { IImpressionObserver } from '../impressionObserver/types';
|
|
3
|
+
import { IStrategy } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Optimized strategy for impressions tracker. Wraps impressions to store and adds previousTime if it corresponds
|
|
6
|
+
*
|
|
7
|
+
* @param impressionsObserver impression observer. previous time (pt property) is included in impression instances
|
|
8
|
+
* @param impressionsCounter cache to save impressions count. impressions will be deduped (OPTIMIZED mode)
|
|
9
|
+
* @returns IStrategyResult
|
|
10
|
+
*/
|
|
11
|
+
export declare function strategyOptimizedFactory(impressionsObserver: IImpressionObserver, impressionsCounter: IImpressionCountsCacheSync): IStrategy;
|
|
@@ -2,6 +2,7 @@ import { SplitIO, ImpressionDTO } from '../types';
|
|
|
2
2
|
import { StreamingEventType, Method, OperationType } from '../sync/submitters/types';
|
|
3
3
|
import { IEventsCacheBase } from '../storages/types';
|
|
4
4
|
import { NetworkError } from '../services/types';
|
|
5
|
+
import { ISet } from '../utils/lang/sets';
|
|
5
6
|
/** Events tracker */
|
|
6
7
|
export interface IEventsHandler {
|
|
7
8
|
handleEvent(eventData: SplitIO.EventData): any;
|
|
@@ -34,3 +35,31 @@ export interface ITelemetryTracker {
|
|
|
34
35
|
*/
|
|
35
36
|
streamingEvent(e: StreamingEventType | AUTH_REJECTION, d?: number): void;
|
|
36
37
|
}
|
|
38
|
+
export interface IFilterAdapter {
|
|
39
|
+
add(featureName: string, key: string): boolean;
|
|
40
|
+
contains(featureName: string, key: string): boolean;
|
|
41
|
+
clear(): void;
|
|
42
|
+
}
|
|
43
|
+
export interface IImpressionSenderAdapter {
|
|
44
|
+
recordUniqueKeys(data: Object): void;
|
|
45
|
+
recordImpressionCounts(data: Object): void;
|
|
46
|
+
}
|
|
47
|
+
/** Unique keys tracker */
|
|
48
|
+
export interface IUniqueKeysTracker {
|
|
49
|
+
track(featureName: string, key: string): void;
|
|
50
|
+
pop(toMerge?: {
|
|
51
|
+
[featureName: string]: ISet<string>;
|
|
52
|
+
}): {
|
|
53
|
+
[featureName: string]: ISet<string>;
|
|
54
|
+
};
|
|
55
|
+
clear(): void;
|
|
56
|
+
isEmpty(): boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface IStrategyResult {
|
|
59
|
+
impressionsToStore: ImpressionDTO[];
|
|
60
|
+
impressionsToListener: ImpressionDTO[];
|
|
61
|
+
deduped: number;
|
|
62
|
+
}
|
|
63
|
+
export interface IStrategy {
|
|
64
|
+
process(impressions: ImpressionDTO[]): IStrategyResult;
|
|
65
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ILogger } from '../logger/types';
|
|
2
|
+
import { IFilterAdapter, IUniqueKeysTracker } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Trackes uniques keys
|
|
5
|
+
* Unique Keys Tracker will be in charge of checking if the MTK was already sent to the BE in the last period
|
|
6
|
+
* or schedule to be sent; if not it will be added in an internal cache and sent in the next post.
|
|
7
|
+
*
|
|
8
|
+
* @param log Logger instance
|
|
9
|
+
* @param filterAdapter filter adapter
|
|
10
|
+
* @param cacheSize optional internal cache size
|
|
11
|
+
* @param maxBulkSize optional max MTKs bulk size
|
|
12
|
+
*/
|
|
13
|
+
export declare function uniqueKeysTrackerFactory(log: ILogger, filterAdapter?: IFilterAdapter, cacheSize?: number): IUniqueKeysTracker;
|
package/types/types.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export interface ISettings {
|
|
|
74
74
|
featuresRefreshRate: number;
|
|
75
75
|
impressionsRefreshRate: number;
|
|
76
76
|
impressionsQueueSize: number;
|
|
77
|
+
uniqueKeysRefreshRate: number;
|
|
77
78
|
/**
|
|
78
79
|
* @deprecated
|
|
79
80
|
*/
|
|
@@ -715,7 +716,7 @@ export declare namespace SplitIO {
|
|
|
715
716
|
* ImpressionsMode type
|
|
716
717
|
* @typedef {string} ImpressionsMode
|
|
717
718
|
*/
|
|
718
|
-
type ImpressionsMode = 'OPTIMIZED' | 'DEBUG';
|
|
719
|
+
type ImpressionsMode = 'OPTIMIZED' | 'DEBUG' | 'NONE';
|
|
719
720
|
/**
|
|
720
721
|
* Defines the format of Split data to preload on the factory storage (cache).
|
|
721
722
|
*/
|
|
@@ -11,6 +11,7 @@ export declare const SPLIT_IMPRESSION = "IMPRESSION";
|
|
|
11
11
|
export declare const SPLIT_EVENT = "EVENT";
|
|
12
12
|
export declare const DEBUG = "DEBUG";
|
|
13
13
|
export declare const OPTIMIZED = "OPTIMIZED";
|
|
14
|
+
export declare const NONE = "NONE";
|
|
14
15
|
export declare const LOCALHOST_MODE: SDKMode;
|
|
15
16
|
export declare const STANDALONE_MODE: SDKMode;
|
|
16
17
|
export declare const PRODUCER_MODE = "producer";
|
|
@@ -1 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
import { ILogger } from '../../logger/types';
|
|
2
|
+
import { IResponse } from '../../services/types';
|
|
3
|
+
interface MetricsCollector {
|
|
4
|
+
countException(): void;
|
|
5
|
+
count(status: number): void;
|
|
6
|
+
latency(ms: number): void;
|
|
7
|
+
ready(ms: number): void;
|
|
8
|
+
getTreatment(ms: number): void;
|
|
9
|
+
getTreatments(ms: number): void;
|
|
10
|
+
getTreatmentWithConfig(ms: number): void;
|
|
11
|
+
getTreatmentsWithConfig(ms: number): void;
|
|
12
|
+
[method: string]: (ms: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const TrackerAPI: {
|
|
15
|
+
/**
|
|
16
|
+
* "Private" method, used to attach count/countException and stop callbacks to a promise.
|
|
17
|
+
*
|
|
18
|
+
* @param {ILogger} log - Logger.
|
|
19
|
+
* @param {Promise} promise - The promise we want to attach the callbacks.
|
|
20
|
+
* @param {string} task - The name of the task.
|
|
21
|
+
* @param {number | string} modifier - (optional) The modifier for the task, if any.
|
|
22
|
+
*/
|
|
23
|
+
__attachToPromise(log: ILogger, promise: Promise<IResponse>, task: string, collector: false | MetricsCollector, modifier?: string | number | undefined): Promise<IResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Starts tracking the time for a given task. All tasks tracked are considered "unique" because
|
|
26
|
+
* there may be multiple SDK instances tracking a "generic" task, making any task non-generic.
|
|
27
|
+
*
|
|
28
|
+
* @param {ILogger} log - Logger.
|
|
29
|
+
* @param {string} task - The task we are starting.
|
|
30
|
+
* @param {Object} collectors - The collectors map.
|
|
31
|
+
* @param {Promise} promise - (optional) The promise we are tracking.
|
|
32
|
+
* @return {Function | Promise} The stop function for this specific task or the promise received with the callbacks registered.
|
|
33
|
+
*/
|
|
34
|
+
start(log: ILogger, task: string, collectors?: Record<string, MetricsCollector> | undefined, promise?: Promise<IResponse> | undefined, now?: (() => number) | undefined): Promise<IResponse> | (() => number);
|
|
35
|
+
/**
|
|
36
|
+
* Setup the collector for a task that reports metrics.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} task - The task name
|
|
39
|
+
* @param {number | string} taskUniqueId - The unique identifier for this task
|
|
40
|
+
* @param {Object} collectors - The collectors map.
|
|
41
|
+
*/
|
|
42
|
+
setCollectorForTask(task: string, taskUniqueId: number | string, collectors: Record<string, MetricsCollector>): void;
|
|
43
|
+
/**
|
|
44
|
+
* Stops the tracking of a given task.
|
|
45
|
+
*
|
|
46
|
+
* @param {ILogger} log - Logger.
|
|
47
|
+
* @param {string} task - The task we are starting.
|
|
48
|
+
* @param {number | string} modifier - (optional) The modifier for that specific task.
|
|
49
|
+
*/
|
|
50
|
+
stop(log: ILogger, task: string, modifier?: string | number | undefined): number | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The constants shortcut for the task names.
|
|
53
|
+
*/
|
|
54
|
+
TaskNames: {
|
|
55
|
+
SDK_READY: string;
|
|
56
|
+
SDK_GET_TREATMENT: string;
|
|
57
|
+
SDK_GET_TREATMENTS: string;
|
|
58
|
+
SDK_GET_TREATMENT_WITH_CONFIG: string;
|
|
59
|
+
SDK_GET_TREATMENTS_WITH_CONFIG: string;
|
|
60
|
+
SPLITS_READY: string;
|
|
61
|
+
SEGMENTS_READY: string;
|
|
62
|
+
METRICS_PUSH: string;
|
|
63
|
+
IMPRESSIONS_PUSH: string;
|
|
64
|
+
EVENTS_PUSH: string;
|
|
65
|
+
MY_SEGMENTS_FETCH: string;
|
|
66
|
+
SEGMENTS_FETCH: string;
|
|
67
|
+
SPLITS_FETCH: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export {};
|
package/src/logger/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IIntegrationFactoryParams } from '../types';
|
|
2
|
-
import SplitToGa from './SplitToGa';
|
|
3
|
-
import { SplitToGoogleAnalyticsOptions } from './types';
|
|
4
|
-
export declare function SplitToGoogleAnalytics(options?: SplitToGoogleAnalyticsOptions): (params: IIntegrationFactoryParams) => SplitToGa;
|
package/types/logger/codes.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
export declare const DEBUG_0 = 0;
|
|
2
|
-
export declare const DEBUG_1 = 1;
|
|
3
|
-
export declare const DEBUG_2 = 2;
|
|
4
|
-
export declare const DEBUG_3 = 3;
|
|
5
|
-
export declare const DEBUG_4 = 4;
|
|
6
|
-
export declare const DEBUG_5 = 5;
|
|
7
|
-
export declare const DEBUG_6 = 6;
|
|
8
|
-
export declare const DEBUG_7 = 7;
|
|
9
|
-
export declare const DEBUG_8 = 8;
|
|
10
|
-
export declare const DEBUG_9 = 9;
|
|
11
|
-
export declare const DEBUG_10 = 10;
|
|
12
|
-
export declare const DEBUG_11 = 11;
|
|
13
|
-
export declare const DEBUG_12 = 12;
|
|
14
|
-
export declare const DEBUG_13 = 13;
|
|
15
|
-
export declare const DEBUG_14 = 14;
|
|
16
|
-
export declare const DEBUG_15 = 15;
|
|
17
|
-
export declare const DEBUG_16 = 16;
|
|
18
|
-
export declare const DEBUG_17 = 17;
|
|
19
|
-
export declare const DEBUG_18 = 18;
|
|
20
|
-
export declare const DEBUG_19 = 19;
|
|
21
|
-
export declare const DEBUG_20 = 20;
|
|
22
|
-
export declare const DEBUG_21 = 21;
|
|
23
|
-
export declare const DEBUG_22 = 22;
|
|
24
|
-
export declare const DEBUG_23 = 23;
|
|
25
|
-
export declare const DEBUG_24 = 24;
|
|
26
|
-
export declare const DEBUG_25 = 25;
|
|
27
|
-
export declare const DEBUG_31 = 31;
|
|
28
|
-
export declare const DEBUG_32 = 32;
|
|
29
|
-
export declare const DEBUG_33 = 33;
|
|
30
|
-
export declare const DEBUG_36 = 36;
|
|
31
|
-
export declare const DEBUG_42 = 42;
|
|
32
|
-
export declare const DEBUG_43 = 43;
|
|
33
|
-
export declare const DEBUG_44 = 44;
|
|
34
|
-
export declare const DEBUG_45 = 45;
|
|
35
|
-
export declare const DEBUG_46 = 46;
|
|
36
|
-
export declare const DEBUG_47 = 47;
|
|
37
|
-
export declare const DEBUG_48 = 48;
|
|
38
|
-
export declare const DEBUG_49 = 49;
|
|
39
|
-
export declare const DEBUG_50 = 50;
|
|
40
|
-
export declare const DEBUG_51 = 51;
|
|
41
|
-
export declare const INFO_0 = 100;
|
|
42
|
-
export declare const INFO_1 = 101;
|
|
43
|
-
export declare const INFO_2 = 102;
|
|
44
|
-
export declare const INFO_3 = 103;
|
|
45
|
-
export declare const INFO_4 = 104;
|
|
46
|
-
export declare const INFO_5 = 105;
|
|
47
|
-
export declare const INFO_6 = 106;
|
|
48
|
-
export declare const INFO_7 = 107;
|
|
49
|
-
export declare const INFO_8 = 108;
|
|
50
|
-
export declare const INFO_9 = 109;
|
|
51
|
-
export declare const INFO_10 = 110;
|
|
52
|
-
export declare const INFO_11 = 111;
|
|
53
|
-
export declare const INFO_12 = 112;
|
|
54
|
-
export declare const INFO_13 = 113;
|
|
55
|
-
export declare const INFO_14 = 114;
|
|
56
|
-
export declare const INFO_15 = 115;
|
|
57
|
-
export declare const INFO_16 = 116;
|
|
58
|
-
export declare const INFO_17 = 117;
|
|
59
|
-
export declare const INFO_18 = 118;
|
|
60
|
-
export declare const INFO_19 = 119;
|
|
61
|
-
export declare const INFO_20 = 120;
|
|
62
|
-
export declare const INFO_21 = 121;
|
|
63
|
-
export declare const WARN_0 = 200;
|
|
64
|
-
export declare const WARN_1 = 201;
|
|
65
|
-
export declare const WARN_2 = 202;
|
|
66
|
-
export declare const WARN_4 = 204;
|
|
67
|
-
export declare const WARN_5 = 205;
|
|
68
|
-
export declare const WARN_6 = 206;
|
|
69
|
-
export declare const WARN_7 = 207;
|
|
70
|
-
export declare const WARN_8 = 208;
|
|
71
|
-
export declare const WARN_9 = 209;
|
|
72
|
-
export declare const WARN_10 = 210;
|
|
73
|
-
export declare const WARN_11 = 211;
|
|
74
|
-
export declare const WARN_12 = 212;
|
|
75
|
-
export declare const WARN_13 = 213;
|
|
76
|
-
export declare const WARN_14 = 214;
|
|
77
|
-
export declare const WARN_15 = 215;
|
|
78
|
-
export declare const WARN_17 = 217;
|
|
79
|
-
export declare const WARN_18 = 218;
|
|
80
|
-
export declare const WARN_19 = 219;
|
|
81
|
-
export declare const WARN_20 = 220;
|
|
82
|
-
export declare const WARN_21 = 221;
|
|
83
|
-
export declare const WARN_22 = 222;
|
|
84
|
-
export declare const WARN_23 = 223;
|
|
85
|
-
export declare const WARN_24 = 224;
|
|
86
|
-
export declare const WARN_25 = 225;
|
|
87
|
-
export declare const ERROR_0 = 300;
|
|
88
|
-
export declare const ERROR_2 = 302;
|
|
89
|
-
export declare const ERROR_3 = 303;
|
|
90
|
-
export declare const ERROR_4 = 304;
|
|
91
|
-
export declare const ERROR_5 = 305;
|
|
92
|
-
export declare const ERROR_7 = 307;
|
|
93
|
-
export declare const ERROR_9 = 309;
|
|
94
|
-
export declare const ERROR_10 = 310;
|
|
95
|
-
export declare const ERROR_11 = 311;
|
|
96
|
-
export declare const ERROR_12 = 312;
|
|
97
|
-
export declare const ERROR_13 = 313;
|
|
98
|
-
export declare const ERROR_14 = 314;
|
|
99
|
-
export declare const ERROR_15 = 315;
|
|
100
|
-
export declare const ERROR_16 = 316;
|
|
101
|
-
export declare const ERROR_17 = 317;
|
|
102
|
-
export declare const ERROR_18 = 318;
|
|
103
|
-
export declare const ERROR_19 = 319;
|
|
104
|
-
export declare const ERROR_20 = 320;
|
|
105
|
-
export declare const ERROR_21 = 321;
|
|
106
|
-
export declare const ERROR_22 = 322;
|
|
107
|
-
export declare const ERROR_23 = 323;
|
|
108
|
-
export declare const ERROR_24 = 324;
|
|
109
|
-
export declare const ERROR_25 = 325;
|
|
110
|
-
export declare const ERROR_26 = 326;
|
|
111
|
-
export declare const ERROR_32 = 332;
|
|
112
|
-
export declare const ERROR_33 = 333;
|
|
113
|
-
export declare const ERROR_34 = 334;
|
|
114
|
-
export declare const ERROR_35 = 335;
|
|
115
|
-
export declare const ERROR_36 = 336;
|
|
116
|
-
export declare const ERROR_37 = 337;
|
|
117
|
-
export declare const ERROR_38 = 338;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const DEBUG_28 = 28;
|
|
2
|
-
export declare const DEBUG_29 = 29;
|
|
3
|
-
export declare const DEBUG_30 = 30;
|
|
4
|
-
export declare const ERROR_1 = 301;
|
|
5
|
-
export declare const DEBUG_39 = 39;
|
|
6
|
-
export declare const DEBUG_40 = 40;
|
|
7
|
-
export declare const DEBUG_41 = 41;
|
|
8
|
-
export declare const ERROR_8 = 308;
|
|
9
|
-
export declare const DEBUG_34 = 34;
|
|
10
|
-
export declare const DEBUG_35 = 35;
|
|
11
|
-
export declare const ERROR_6 = 306;
|
|
12
|
-
export declare const WARN_3 = 203;
|
|
13
|
-
export declare const DEBUG_37 = 37;
|
|
14
|
-
export declare const DEBUG_38 = 38;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebug: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugBrowser: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesError: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesErrorNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesInfo: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesWarn: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesWarnNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugBrowser: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesErrorNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesWarnNode: [number, string][];
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ISyncManager } from '../sync/types';
|
|
2
|
-
import { ISettings } from '../types';
|
|
3
|
-
export declare function userConsentProps(settings: ISettings, syncManager?: ISyncManager): {
|
|
4
|
-
setUserConsent(consent: unknown): boolean;
|
|
5
|
-
getUserConsent(): import("../types").ConsentStatus | undefined;
|
|
6
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ISdkClientFactoryParams } from '../sdkClient/types';
|
|
2
|
-
import { SplitIO } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Factory of client method for server-side SDKs (ISDK and IAsyncSDK)
|
|
5
|
-
*/
|
|
6
|
-
export declare function sdkManagerMethodFactory(params: ISdkClientFactoryParams): () => SplitIO.IManager | SplitIO.IAsyncManager;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ISplit } from '../dtos/types';
|
|
2
|
-
/**
|
|
3
|
-
* Collect segments from a raw split definition.
|
|
4
|
-
* Exported for testing purposes.
|
|
5
|
-
*/
|
|
6
|
-
export declare function _parseSegments({ conditions }: ISplit): import("../utils/lang/sets").ISet<string>;
|
|
7
|
-
/**
|
|
8
|
-
* Computes the set of segments used by splits.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getRegisteredSegments(splitDefs: string[]): string[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IStorageFactoryParams, IStorageSync } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* InMemory storage factory for standalone server-side SplitFactory
|
|
4
|
-
*
|
|
5
|
-
* @param params parameters required by EventsCacheSync
|
|
6
|
-
*/
|
|
7
|
-
export declare function InMemoryStorageFactory(params: IStorageFactoryParams): IStorageSync;
|
|
8
|
-
export declare namespace InMemoryStorageFactory {
|
|
9
|
-
var type: import("../types").StorageType;
|
|
10
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ISet } from '../../../utils/lang/sets';
|
|
2
|
-
import { ISegmentsCacheSync, ISplitsCacheSync, IStorageSync } from '../../../storages/types';
|
|
3
|
-
import { ISplitChangesFetcher } from '../fetchers/types';
|
|
4
|
-
import { ISplit } from '../../../dtos/types';
|
|
5
|
-
import { IReadinessManager, ISplitsEventEmitter } from '../../../readiness/types';
|
|
6
|
-
import { ISplitsSyncTask } from '../types';
|
|
7
|
-
import { IFetchSplitChanges } from '../../../services/types';
|
|
8
|
-
import { ISettings } from '../../../types';
|
|
9
|
-
declare type ISplitChangesUpdater = (noCache?: boolean) => Promise<boolean>;
|
|
10
|
-
/**
|
|
11
|
-
* Collect segments from a raw split definition.
|
|
12
|
-
* Exported for testing purposes.
|
|
13
|
-
*/
|
|
14
|
-
export declare function parseSegments({ conditions }: ISplit): ISet<string>;
|
|
15
|
-
interface ISplitMutations {
|
|
16
|
-
added: [string, string][];
|
|
17
|
-
removed: string[];
|
|
18
|
-
segments: string[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Given the list of splits from /splitChanges endpoint, it returns the mutations,
|
|
22
|
-
* i.e., an object with added splits, removed splits and used segments.
|
|
23
|
-
* Exported for testing purposes.
|
|
24
|
-
*/
|
|
25
|
-
export declare function computeSplitsMutation(entries: ISplit[]): ISplitMutations;
|
|
26
|
-
/**
|
|
27
|
-
* factory of SplitChanges updater (a.k.a, SplitsSyncTask), a task that:
|
|
28
|
-
* - fetches split changes using `splitChangesFetcher`
|
|
29
|
-
* - updates `splitsCache`
|
|
30
|
-
* - uses `splitsEventEmitter` to emit events related to split data updates
|
|
31
|
-
* Exported for testing purposes.
|
|
32
|
-
*/
|
|
33
|
-
export declare function splitChangesUpdaterFactory(splitChangesFetcher: ISplitChangesFetcher, splitsCache: ISplitsCacheSync, segmentsCache: ISegmentsCacheSync, splitsEventEmitter: ISplitsEventEmitter, requestTimeoutBeforeReady: number, retriesOnFailureBeforeReady: number): ISplitChangesUpdater;
|
|
34
|
-
export default function splitsSyncTaskFactory(fetchSplitChanges: IFetchSplitChanges, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings): ISplitsSyncTask;
|
|
35
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ISet } from '../../../utils/lang/sets';
|
|
2
|
-
import { ISegmentsCacheSync, ISplitsCacheSync, IStorageSync } from '../../../storages/types';
|
|
3
|
-
import { ISplitChangesFetcher } from '../fetchers/types';
|
|
4
|
-
import { ISplit } from '../../../dtos/types';
|
|
5
|
-
import { IReadinessManager, ISplitsEventEmitter } from '../../../readiness/types';
|
|
6
|
-
import { ISplitsSyncTask } from '../types';
|
|
7
|
-
import { IFetchSplitChanges } from '../../../services/types';
|
|
8
|
-
import { ISettings } from '../../../types';
|
|
9
|
-
declare type ISplitChangesUpdater = (noCache?: boolean) => Promise<boolean>;
|
|
10
|
-
/**
|
|
11
|
-
* Collect segments from a raw split definition.
|
|
12
|
-
* Exported for testing purposes.
|
|
13
|
-
*/
|
|
14
|
-
export declare function parseSegments({ conditions }: ISplit): ISet<string>;
|
|
15
|
-
interface ISplitMutations {
|
|
16
|
-
added: [string, string][];
|
|
17
|
-
removed: string[];
|
|
18
|
-
segments: string[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Given the list of splits from /splitChanges endpoint, it returns the mutations,
|
|
22
|
-
* i.e., an object with added splits, removed splits and used segments.
|
|
23
|
-
* Exported for testing purposes.
|
|
24
|
-
*/
|
|
25
|
-
export declare function computeSplitsMutation(entries: ISplit[]): ISplitMutations;
|
|
26
|
-
/**
|
|
27
|
-
* factory of SplitChanges updater (a.k.a, SplitsSyncTask), a task that:
|
|
28
|
-
* - fetches split changes using `splitChangesFetcher`
|
|
29
|
-
* - updates `splitsCache`
|
|
30
|
-
* - uses `splitsEventEmitter` to emit events related to split data updates
|
|
31
|
-
* Exported for testing purposes.
|
|
32
|
-
*/
|
|
33
|
-
export declare function splitChangesUpdaterFactory(splitChangesFetcher: ISplitChangesFetcher, splitsCache: ISplitsCacheSync, segmentsCache: ISegmentsCacheSync, splitsEventEmitter: ISplitsEventEmitter, requestTimeoutBeforeReady: number, retriesOnFailureBeforeReady: number): ISplitChangesUpdater;
|
|
34
|
-
export default function splitsSyncTaskFactory(fetchSplitChanges: IFetchSplitChanges, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings): ISplitsSyncTask;
|
|
35
|
-
export {};
|