@splitsoftware/splitio-commons 1.6.2-rc.9 → 1.7.0
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 -1
- package/cjs/consent/sdkUserConsent.js +2 -2
- package/cjs/listeners/browser.js +11 -12
- package/cjs/logger/constants.js +2 -1
- package/cjs/sdkClient/sdkClient.js +3 -1
- package/cjs/sdkFactory/index.js +26 -26
- package/cjs/services/splitApi.js +20 -0
- package/cjs/storages/AbstractSplitsCacheAsync.js +1 -1
- package/cjs/storages/AbstractSplitsCacheSync.js +1 -1
- package/cjs/storages/KeyBuilderSS.js +10 -43
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +0 -1
- package/cjs/storages/inLocalStorage/index.js +17 -9
- package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +12 -1
- package/cjs/storages/inMemory/InMemoryStorage.js +13 -6
- package/cjs/storages/inMemory/InMemoryStorageCS.js +13 -6
- package/cjs/storages/inMemory/TelemetryCacheInMemory.js +60 -35
- package/cjs/storages/inMemory/UniqueKeysCacheInMemory.js +72 -0
- package/cjs/storages/inMemory/UniqueKeysCacheInMemoryCS.js +76 -0
- package/cjs/storages/inRedis/ImpressionCountsCacheInRedis.js +85 -0
- package/cjs/storages/inRedis/ImpressionsCacheInRedis.js +2 -19
- package/cjs/storages/inRedis/TelemetryCacheInRedis.js +4 -4
- package/cjs/storages/inRedis/UniqueKeysCacheInRedis.js +71 -0
- package/cjs/storages/inRedis/constants.js +4 -1
- package/cjs/storages/inRedis/index.js +20 -3
- package/cjs/storages/pluggable/ImpressionCountsCachePluggable.js +81 -0
- package/cjs/storages/pluggable/ImpressionsCachePluggable.js +2 -19
- package/cjs/storages/pluggable/TelemetryCachePluggable.js +4 -4
- package/cjs/storages/pluggable/UniqueKeysCachePluggable.js +61 -0
- package/cjs/storages/pluggable/inMemoryWrapper.js +8 -6
- package/cjs/storages/pluggable/index.js +38 -9
- package/cjs/storages/utils.js +73 -0
- package/cjs/sync/submitters/submitterManager.js +3 -0
- package/cjs/sync/submitters/telemetrySubmitter.js +5 -40
- package/cjs/sync/submitters/uniqueKeysSubmitter.js +27 -0
- package/cjs/trackers/impressionObserver/utils.js +1 -17
- package/cjs/trackers/impressionsTracker.js +22 -41
- package/cjs/trackers/strategy/strategyDebug.js +25 -0
- package/cjs/trackers/strategy/strategyNone.js +29 -0
- package/cjs/trackers/strategy/strategyOptimized.js +35 -0
- package/cjs/trackers/uniqueKeysTracker.js +38 -0
- package/cjs/utils/constants/index.js +4 -2
- package/cjs/utils/redis/RedisMock.js +31 -0
- package/cjs/utils/settingsValidation/impressionsMode.js +2 -2
- package/cjs/utils/settingsValidation/index.js +7 -1
- package/esm/consent/sdkUserConsent.js +2 -2
- package/esm/listeners/browser.js +12 -13
- package/esm/logger/constants.js +1 -0
- package/esm/sdkClient/sdkClient.js +3 -1
- package/esm/sdkFactory/index.js +26 -26
- package/esm/services/splitApi.js +20 -0
- package/esm/storages/AbstractSplitsCacheAsync.js +1 -1
- package/esm/storages/AbstractSplitsCacheSync.js +1 -1
- package/esm/storages/KeyBuilderSS.js +7 -37
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +0 -1
- package/esm/storages/inLocalStorage/index.js +18 -10
- package/esm/storages/inMemory/ImpressionCountsCacheInMemory.js +12 -1
- package/esm/storages/inMemory/InMemoryStorage.js +14 -7
- package/esm/storages/inMemory/InMemoryStorageCS.js +14 -7
- package/esm/storages/inMemory/TelemetryCacheInMemory.js +61 -36
- package/esm/storages/inMemory/UniqueKeysCacheInMemory.js +68 -0
- package/esm/storages/inMemory/UniqueKeysCacheInMemoryCS.js +73 -0
- package/esm/storages/inRedis/ImpressionCountsCacheInRedis.js +82 -0
- package/esm/storages/inRedis/ImpressionsCacheInRedis.js +2 -19
- package/esm/storages/inRedis/TelemetryCacheInRedis.js +1 -1
- package/esm/storages/inRedis/UniqueKeysCacheInRedis.js +68 -0
- package/esm/storages/inRedis/constants.js +3 -0
- package/esm/storages/inRedis/index.js +21 -4
- package/esm/storages/pluggable/ImpressionCountsCachePluggable.js +78 -0
- package/esm/storages/pluggable/ImpressionsCachePluggable.js +2 -19
- package/esm/storages/pluggable/TelemetryCachePluggable.js +1 -1
- package/esm/storages/pluggable/UniqueKeysCachePluggable.js +58 -0
- package/esm/storages/pluggable/inMemoryWrapper.js +8 -6
- package/esm/storages/pluggable/index.js +39 -10
- package/esm/storages/utils.js +65 -0
- package/esm/sync/submitters/submitterManager.js +3 -0
- package/esm/sync/submitters/telemetrySubmitter.js +5 -39
- package/esm/sync/submitters/uniqueKeysSubmitter.js +23 -0
- package/esm/trackers/impressionObserver/utils.js +1 -15
- package/esm/trackers/impressionsTracker.js +22 -41
- package/esm/trackers/strategy/strategyDebug.js +21 -0
- package/esm/trackers/strategy/strategyNone.js +25 -0
- package/esm/trackers/strategy/strategyOptimized.js +31 -0
- package/esm/trackers/uniqueKeysTracker.js +34 -0
- package/esm/utils/constants/index.js +2 -0
- package/esm/utils/redis/RedisMock.js +28 -0
- package/esm/utils/settingsValidation/impressionsMode.js +3 -3
- package/esm/utils/settingsValidation/index.js +7 -1
- package/package.json +1 -2
- package/src/consent/sdkUserConsent.ts +2 -2
- package/src/listeners/browser.ts +12 -15
- package/src/logger/constants.ts +1 -0
- package/src/sdkClient/sdkClient.ts +3 -1
- package/src/sdkFactory/index.ts +29 -31
- package/src/sdkFactory/types.ts +7 -4
- package/src/services/splitApi.ts +22 -0
- package/src/services/types.ts +6 -0
- package/src/storages/AbstractSplitsCacheAsync.ts +1 -1
- package/src/storages/AbstractSplitsCacheSync.ts +1 -1
- package/src/storages/KeyBuilderSS.ts +9 -43
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +0 -1
- package/src/storages/inLocalStorage/index.ts +18 -10
- package/src/storages/inMemory/AttributesCacheInMemory.ts +7 -7
- package/src/storages/inMemory/ImpressionCountsCacheInMemory.ts +16 -1
- package/src/storages/inMemory/InMemoryStorage.ts +14 -7
- package/src/storages/inMemory/InMemoryStorageCS.ts +14 -7
- package/src/storages/inMemory/TelemetryCacheInMemory.ts +69 -34
- package/src/storages/inMemory/UniqueKeysCacheInMemory.ts +80 -0
- package/src/storages/inMemory/UniqueKeysCacheInMemoryCS.ts +86 -0
- package/src/storages/inRedis/ImpressionCountsCacheInRedis.ts +95 -0
- package/src/storages/inRedis/ImpressionsCacheInRedis.ts +2 -22
- package/src/storages/inRedis/TelemetryCacheInRedis.ts +3 -2
- package/src/storages/inRedis/UniqueKeysCacheInRedis.ts +77 -0
- package/src/storages/inRedis/constants.ts +3 -0
- package/src/storages/inRedis/index.ts +18 -5
- package/src/storages/pluggable/ImpressionCountsCachePluggable.ts +92 -0
- package/src/storages/pluggable/ImpressionsCachePluggable.ts +3 -23
- package/src/storages/pluggable/TelemetryCachePluggable.ts +3 -2
- package/src/storages/pluggable/UniqueKeysCachePluggable.ts +67 -0
- package/src/storages/pluggable/inMemoryWrapper.ts +6 -6
- package/src/storages/pluggable/index.ts +41 -9
- package/src/storages/types.ts +56 -55
- package/src/storages/utils.ts +78 -0
- package/src/sync/submitters/submitter.ts +2 -2
- package/src/sync/submitters/submitterManager.ts +2 -0
- package/src/sync/submitters/telemetrySubmitter.ts +8 -43
- package/src/sync/submitters/types.ts +29 -27
- package/src/sync/submitters/uniqueKeysSubmitter.ts +36 -0
- package/src/trackers/impressionObserver/utils.ts +1 -16
- package/src/trackers/impressionsTracker.ts +25 -46
- 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 +28 -0
- package/src/trackers/uniqueKeysTracker.ts +48 -0
- package/src/types.ts +1 -1
- package/src/utils/constants/index.ts +2 -0
- package/src/utils/redis/RedisMock.ts +33 -0
- package/src/utils/settingsValidation/impressionsMode.ts +3 -3
- package/src/utils/settingsValidation/index.ts +5 -1
- 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/AbstractSplitsCacheAsync.d.ts +1 -1
- package/types/storages/AbstractSplitsCacheSync.d.ts +1 -1
- package/types/storages/KeyBuilderSS.d.ts +3 -3
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -1
- package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +5 -1
- package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +20 -9
- package/types/storages/inMemory/uniqueKeysCacheInMemory.d.ts +35 -0
- package/types/storages/inMemory/uniqueKeysCacheInMemoryCS.d.ts +35 -0
- package/types/storages/inRedis/ImpressionCountsCacheInRedis.d.ts +16 -0
- package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -1
- package/types/storages/inRedis/constants.d.ts +3 -0
- package/types/storages/inRedis/uniqueKeysCacheInRedis.d.ts +21 -0
- package/types/storages/pluggable/ImpressionCountsCachePluggable.d.ts +16 -0
- package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +1 -2
- package/types/storages/pluggable/UniqueKeysCachePluggable.d.ts +20 -0
- package/types/storages/types.d.ts +39 -38
- package/types/storages/utils.d.ts +8 -0
- package/types/sync/submitters/submitter.d.ts +2 -2
- package/types/sync/submitters/telemetrySubmitter.d.ts +2 -10
- package/types/sync/submitters/types.d.ts +27 -7
- package/types/sync/submitters/uniqueKeysSubmitter.d.ts +5 -0
- package/types/trackers/impressionObserver/utils.d.ts +0 -8
- 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 +23 -0
- package/types/trackers/uniqueKeysTracker.d.ts +13 -0
- package/types/types.d.ts +1 -1
- package/types/utils/constants/index.d.ts +2 -0
- package/types/utils/redis/RedisMock.d.ts +4 -0
- package/cjs/storages/metadataBuilder.js +0 -12
- package/esm/storages/metadataBuilder.js +0 -8
- package/src/storages/metadataBuilder.ts +0 -11
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IUniqueKeysCacheBase } from '../types';
|
|
2
|
+
import { UniqueKeysPayloadCs } from '../../sync/submitters/types';
|
|
3
|
+
export declare class UniqueKeysCacheInMemoryCS implements IUniqueKeysCacheBase {
|
|
4
|
+
private onFullQueue?;
|
|
5
|
+
private readonly maxStorage;
|
|
6
|
+
private uniqueTrackerSize;
|
|
7
|
+
private uniqueKeysTracker;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param impressionsQueueSize number of queued impressions to call onFullQueueCb.
|
|
11
|
+
* Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
|
|
12
|
+
*/
|
|
13
|
+
constructor(uniqueKeysQueueSize?: number);
|
|
14
|
+
setOnFullQueueCb(cb: () => void): void;
|
|
15
|
+
/**
|
|
16
|
+
* Store unique keys per feature.
|
|
17
|
+
*/
|
|
18
|
+
track(userKey: string, featureName: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Clear the data stored on the cache.
|
|
21
|
+
*/
|
|
22
|
+
clear(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Pop the collected data, used as payload for posting.
|
|
25
|
+
*/
|
|
26
|
+
pop(): UniqueKeysPayloadCs;
|
|
27
|
+
/**
|
|
28
|
+
* Check if the cache is empty.
|
|
29
|
+
*/
|
|
30
|
+
isEmpty(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Converts `uniqueKeys` data from cache into request payload.
|
|
33
|
+
*/
|
|
34
|
+
private fromUniqueKeysCollector;
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Redis } from 'ioredis';
|
|
2
|
+
import { ILogger } from '../../logger/types';
|
|
3
|
+
import { ImpressionCountsPayload } from '../../sync/submitters/types';
|
|
4
|
+
import { ImpressionCountsCacheInMemory } from '../inMemory/ImpressionCountsCacheInMemory';
|
|
5
|
+
export declare class ImpressionCountsCacheInRedis extends ImpressionCountsCacheInMemory {
|
|
6
|
+
private readonly log;
|
|
7
|
+
private readonly key;
|
|
8
|
+
private readonly redis;
|
|
9
|
+
private readonly refreshRate;
|
|
10
|
+
private intervalId;
|
|
11
|
+
constructor(log: ILogger, key: string, redis: Redis, impressionCountsCacheSize?: number, refreshRate?: number);
|
|
12
|
+
private postImpressionCountsInRedis;
|
|
13
|
+
start(): void;
|
|
14
|
+
stop(): Promise<boolean | import("ioredis").BooleanResponse | undefined>;
|
|
15
|
+
getImpressionsCount(): Promise<ImpressionCountsPayload | undefined>;
|
|
16
|
+
}
|
|
@@ -11,7 +11,6 @@ export declare class ImpressionsCacheInRedis implements IImpressionsCacheAsync {
|
|
|
11
11
|
private readonly metadata;
|
|
12
12
|
constructor(log: ILogger, key: string, redis: Redis, metadata: IMetadata);
|
|
13
13
|
track(impressions: ImpressionDTO[]): Promise<void>;
|
|
14
|
-
private _toJSON;
|
|
15
14
|
count(): Promise<number>;
|
|
16
15
|
drop(count?: number): Promise<any>;
|
|
17
16
|
popNWithMetadata(count: number): Promise<StoredImpressionWithMetadata[]>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IUniqueKeysCacheBase } from '../types';
|
|
2
|
+
import { Redis } from 'ioredis';
|
|
3
|
+
import { UniqueKeysCacheInMemory } from '../inMemory/UniqueKeysCacheInMemory';
|
|
4
|
+
import { ILogger } from '../../logger/types';
|
|
5
|
+
import { UniqueKeysItemSs } from '../../sync/submitters/types';
|
|
6
|
+
export declare class UniqueKeysCacheInRedis extends UniqueKeysCacheInMemory implements IUniqueKeysCacheBase {
|
|
7
|
+
private readonly log;
|
|
8
|
+
private readonly key;
|
|
9
|
+
private readonly redis;
|
|
10
|
+
private readonly refreshRate;
|
|
11
|
+
private intervalId;
|
|
12
|
+
constructor(log: ILogger, key: string, redis: Redis, uniqueKeysQueueSize?: number, refreshRate?: number);
|
|
13
|
+
private postUniqueKeysInRedis;
|
|
14
|
+
start(): void;
|
|
15
|
+
stop(): Promise<boolean | import("ioredis").BooleanResponse | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* Async consumer API, used by synchronizer.
|
|
18
|
+
* @param count number of items to pop from the queue. If not provided or equal 0, all items will be popped.
|
|
19
|
+
*/
|
|
20
|
+
popNRaw(count?: number): Promise<UniqueKeysItemSs[]>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ILogger } from '../../logger/types';
|
|
2
|
+
import { ImpressionCountsPayload } from '../../sync/submitters/types';
|
|
3
|
+
import { ImpressionCountsCacheInMemory } from '../inMemory/ImpressionCountsCacheInMemory';
|
|
4
|
+
import { IPluggableStorageWrapper } from '../types';
|
|
5
|
+
export declare class ImpressionCountsCachePluggable extends ImpressionCountsCacheInMemory {
|
|
6
|
+
private readonly log;
|
|
7
|
+
private readonly key;
|
|
8
|
+
private readonly wrapper;
|
|
9
|
+
private readonly refreshRate;
|
|
10
|
+
private intervalId;
|
|
11
|
+
constructor(log: ILogger, key: string, wrapper: IPluggableStorageWrapper, impressionCountsCacheSize?: number, refreshRate?: number);
|
|
12
|
+
private storeImpressionCounts;
|
|
13
|
+
start(): void;
|
|
14
|
+
stop(): Promise<any>;
|
|
15
|
+
getImpressionsCount(): Promise<ImpressionCountsPayload | undefined>;
|
|
16
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IPluggableStorageWrapper, IImpressionsCacheAsync } from '../types';
|
|
2
2
|
import { IMetadata } from '../../dtos/types';
|
|
3
3
|
import { ImpressionDTO } from '../../types';
|
|
4
|
-
import { ILogger } from '../../logger/types';
|
|
5
4
|
import { StoredImpressionWithMetadata } from '../../sync/submitters/types';
|
|
5
|
+
import { ILogger } from '../../logger/types';
|
|
6
6
|
export declare class ImpressionsCachePluggable implements IImpressionsCacheAsync {
|
|
7
7
|
private readonly log;
|
|
8
8
|
private readonly key;
|
|
@@ -16,7 +16,6 @@ export declare class ImpressionsCachePluggable implements IImpressionsCacheAsync
|
|
|
16
16
|
* or rejected if the wrapper operation fails.
|
|
17
17
|
*/
|
|
18
18
|
track(impressions: ImpressionDTO[]): Promise<void>;
|
|
19
|
-
private _toJSON;
|
|
20
19
|
/**
|
|
21
20
|
* Returns a promise that resolves with the count of stored impressions, or 0 if there was some error.
|
|
22
21
|
* The promise will never be rejected.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IPluggableStorageWrapper, IUniqueKeysCacheBase } from '../types';
|
|
2
|
+
import { UniqueKeysCacheInMemory } from '../inMemory/UniqueKeysCacheInMemory';
|
|
3
|
+
import { ILogger } from '../../logger/types';
|
|
4
|
+
import { UniqueKeysItemSs } from '../../sync/submitters/types';
|
|
5
|
+
export declare class UniqueKeysCachePluggable extends UniqueKeysCacheInMemory implements IUniqueKeysCacheBase {
|
|
6
|
+
private readonly log;
|
|
7
|
+
private readonly key;
|
|
8
|
+
private readonly wrapper;
|
|
9
|
+
private readonly refreshRate;
|
|
10
|
+
private intervalId;
|
|
11
|
+
constructor(log: ILogger, key: string, wrapper: IPluggableStorageWrapper, uniqueKeysQueueSize?: number, refreshRate?: number);
|
|
12
|
+
storeUniqueKeys(): Promise<any>;
|
|
13
|
+
start(): void;
|
|
14
|
+
stop(): Promise<any>;
|
|
15
|
+
/**
|
|
16
|
+
* Async consumer API, used by synchronizer.
|
|
17
|
+
* @param count number of items to pop from the queue. If not provided or equal 0, all items will be popped.
|
|
18
|
+
*/
|
|
19
|
+
popNRaw(count?: number): Promise<UniqueKeysItemSs[]>;
|
|
20
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { MaybeThenable,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { SplitIO, ImpressionDTO, SDKMode } from '../types';
|
|
1
|
+
import { MaybeThenable, ISplit } from '../dtos/types';
|
|
2
|
+
import { EventDataType, HttpErrors, HttpLatencies, ImpressionDataType, LastSync, Method, MethodExceptions, MethodLatencies, MultiMethodExceptions, MultiMethodLatencies, MultiConfigs, OperationType, StoredEventWithMetadata, StoredImpressionWithMetadata, StreamingEvent, UniqueKeysPayloadCs, UniqueKeysPayloadSs, TelemetryUsageStatsPayload } from '../sync/submitters/types';
|
|
3
|
+
import { SplitIO, ImpressionDTO, ISettings } from '../types';
|
|
5
4
|
/**
|
|
6
5
|
* Interface of a pluggable storage wrapper.
|
|
7
6
|
*/
|
|
@@ -65,23 +64,25 @@ export interface IPluggableStorageWrapper {
|
|
|
65
64
|
getMany: (keys: string[]) => Promise<(string | null)[]>;
|
|
66
65
|
/** Integer operations */
|
|
67
66
|
/**
|
|
68
|
-
* Increments
|
|
67
|
+
* Increments the number stored at `key` by `increment`, or set it to `increment` if the value doesn't exist.
|
|
69
68
|
*
|
|
70
69
|
* @function incr
|
|
71
70
|
* @param {string} key Key to increment
|
|
71
|
+
* @param {number} increment Value to increment by. Defaults to 1.
|
|
72
72
|
* @returns {Promise<number>} A promise that resolves with the value of key after the increment. The promise rejects if the operation fails,
|
|
73
73
|
* for example, if there is a connection error or the key contains a string that can not be represented as integer.
|
|
74
74
|
*/
|
|
75
|
-
incr: (key: string) => Promise<number>;
|
|
75
|
+
incr: (key: string, increment?: number) => Promise<number>;
|
|
76
76
|
/**
|
|
77
|
-
* Decrements
|
|
77
|
+
* Decrements the number stored at `key` by `decrement`, or set it to minus `decrement` if the value doesn't exist.
|
|
78
78
|
*
|
|
79
79
|
* @function decr
|
|
80
80
|
* @param {string} key Key to decrement
|
|
81
|
+
* @param {number} decrement Value to decrement by. Defaults to 1.
|
|
81
82
|
* @returns {Promise<number>} A promise that resolves with the value of key after the decrement. The promise rejects if the operation fails,
|
|
82
83
|
* for example, if there is a connection error or the key contains a string that can not be represented as integer.
|
|
83
84
|
*/
|
|
84
|
-
decr: (key: string) => Promise<number>;
|
|
85
|
+
decr: (key: string, decrement?: number) => Promise<number>;
|
|
85
86
|
/** Queue operations */
|
|
86
87
|
/**
|
|
87
88
|
* Inserts given items at the tail of `key` list. If `key` does not exist, an empty list is created before pushing the items.
|
|
@@ -262,41 +263,43 @@ export interface IImpressionsCacheBase {
|
|
|
262
263
|
export interface IEventsCacheBase {
|
|
263
264
|
track(data: SplitIO.EventData, size?: number): MaybeThenable<boolean>;
|
|
264
265
|
}
|
|
265
|
-
|
|
266
|
-
|
|
266
|
+
export interface IImpressionCountsCacheBase {
|
|
267
|
+
track(featureName: string, timeFrame: number, amount: number): void;
|
|
268
|
+
}
|
|
269
|
+
export interface IUniqueKeysCacheBase {
|
|
270
|
+
track(key: string, value: string): void;
|
|
271
|
+
}
|
|
272
|
+
/** Impressions and events cache for standalone and partial consumer modes (sync methods) */
|
|
273
|
+
export interface IRecorderCacheSync<T> {
|
|
267
274
|
isEmpty(): boolean;
|
|
268
275
|
clear(): void;
|
|
269
276
|
pop(toMerge?: T): T;
|
|
270
277
|
}
|
|
271
|
-
export interface IImpressionsCacheSync extends IImpressionsCacheBase,
|
|
278
|
+
export interface IImpressionsCacheSync extends IImpressionsCacheBase, IRecorderCacheSync<ImpressionDTO[]> {
|
|
272
279
|
track(data: ImpressionDTO[]): void;
|
|
273
280
|
setOnFullQueueCb(cb: () => void): void;
|
|
274
281
|
}
|
|
275
|
-
export interface IEventsCacheSync extends IEventsCacheBase,
|
|
282
|
+
export interface IEventsCacheSync extends IEventsCacheBase, IRecorderCacheSync<SplitIO.EventData[]> {
|
|
276
283
|
track(data: SplitIO.EventData, size?: number): boolean;
|
|
277
284
|
setOnFullQueueCb(cb: () => void): void;
|
|
278
285
|
}
|
|
279
|
-
|
|
280
|
-
|
|
286
|
+
export interface IImpressionCountsCacheSync extends IImpressionCountsCacheBase, IRecorderCacheSync<Record<string, number>> {
|
|
287
|
+
}
|
|
288
|
+
export interface IUniqueKeysCacheSync extends IUniqueKeysCacheBase, IRecorderCacheSync<UniqueKeysPayloadSs | UniqueKeysPayloadCs> {
|
|
289
|
+
setOnFullQueueCb(cb: () => void): void;
|
|
290
|
+
}
|
|
291
|
+
/** Impressions and events cache for consumer and producer modes (async methods) */
|
|
292
|
+
export interface IRecorderCacheAsync<T> {
|
|
281
293
|
count(): Promise<number>;
|
|
282
294
|
drop(count?: number): Promise<void>;
|
|
283
295
|
popNWithMetadata(count: number): Promise<T>;
|
|
284
296
|
}
|
|
285
|
-
export interface IImpressionsCacheAsync extends IImpressionsCacheBase,
|
|
297
|
+
export interface IImpressionsCacheAsync extends IImpressionsCacheBase, IRecorderCacheAsync<StoredImpressionWithMetadata[]> {
|
|
286
298
|
track(data: ImpressionDTO[]): Promise<void>;
|
|
287
299
|
}
|
|
288
|
-
export interface IEventsCacheAsync extends IEventsCacheBase,
|
|
300
|
+
export interface IEventsCacheAsync extends IEventsCacheBase, IRecorderCacheAsync<StoredEventWithMetadata[]> {
|
|
289
301
|
track(data: SplitIO.EventData, size?: number): Promise<boolean>;
|
|
290
302
|
}
|
|
291
|
-
/**
|
|
292
|
-
* Impression counts cache for impressions dedup in standalone and producer mode.
|
|
293
|
-
* Only in memory. Named `ImpressionsCounter` in spec.
|
|
294
|
-
*/
|
|
295
|
-
export interface IImpressionCountsCacheSync extends IRecorderCacheProducerSync<Record<string, number>> {
|
|
296
|
-
track(featureName: string, timeFrame: number, amount: number): void;
|
|
297
|
-
isEmpty(): boolean;
|
|
298
|
-
pop(toMerge?: Record<string, number>): Record<string, number>;
|
|
299
|
-
}
|
|
300
303
|
/**
|
|
301
304
|
* Telemetry storage interface for standalone and partial consumer modes.
|
|
302
305
|
* Methods are sync because data is stored in memory.
|
|
@@ -347,7 +350,7 @@ export interface ITelemetryEvaluationProducerSync {
|
|
|
347
350
|
}
|
|
348
351
|
export interface ITelemetryStorageProducerSync extends ITelemetryInitProducerSync, ITelemetryRuntimeProducerSync, ITelemetryEvaluationProducerSync {
|
|
349
352
|
}
|
|
350
|
-
export interface ITelemetryCacheSync extends ITelemetryStorageConsumerSync, ITelemetryStorageProducerSync {
|
|
353
|
+
export interface ITelemetryCacheSync extends ITelemetryStorageConsumerSync, ITelemetryStorageProducerSync, IRecorderCacheSync<TelemetryUsageStatsPayload> {
|
|
351
354
|
}
|
|
352
355
|
/**
|
|
353
356
|
* Telemetry storage interface for consumer mode.
|
|
@@ -368,32 +371,30 @@ export interface ITelemetryCacheAsync extends ITelemetryEvaluationProducerAsync,
|
|
|
368
371
|
/**
|
|
369
372
|
* Storages
|
|
370
373
|
*/
|
|
371
|
-
export interface IStorageBase<TSplitsCache extends ISplitsCacheBase, TSegmentsCache extends ISegmentsCacheBase, TImpressionsCache extends IImpressionsCacheBase, TEventsCache extends IEventsCacheBase, TTelemetryCache extends ITelemetryCacheSync | ITelemetryCacheAsync> {
|
|
374
|
+
export interface IStorageBase<TSplitsCache extends ISplitsCacheBase, TSegmentsCache extends ISegmentsCacheBase, TImpressionsCache extends IImpressionsCacheBase, TImpressionsCountCache extends IImpressionCountsCacheBase, TEventsCache extends IEventsCacheBase, TTelemetryCache extends ITelemetryCacheSync | ITelemetryCacheAsync, TUniqueKeysCache extends IUniqueKeysCacheBase> {
|
|
372
375
|
splits: TSplitsCache;
|
|
373
376
|
segments: TSegmentsCache;
|
|
374
377
|
impressions: TImpressionsCache;
|
|
375
|
-
impressionCounts?:
|
|
378
|
+
impressionCounts?: TImpressionsCountCache;
|
|
376
379
|
events: TEventsCache;
|
|
377
380
|
telemetry?: TTelemetryCache;
|
|
381
|
+
uniqueKeys?: TUniqueKeysCache;
|
|
378
382
|
destroy(): void | Promise<void>;
|
|
379
383
|
shared?: (matchingKey: string, onReadyCb: (error?: any) => void) => this;
|
|
380
384
|
}
|
|
381
|
-
export interface IStorageSync extends IStorageBase<ISplitsCacheSync, ISegmentsCacheSync, IImpressionsCacheSync, IEventsCacheSync, ITelemetryCacheSync> {
|
|
385
|
+
export interface IStorageSync extends IStorageBase<ISplitsCacheSync, ISegmentsCacheSync, IImpressionsCacheSync, IImpressionCountsCacheSync, IEventsCacheSync, ITelemetryCacheSync, IUniqueKeysCacheSync> {
|
|
382
386
|
}
|
|
383
|
-
export interface IStorageAsync extends IStorageBase<ISplitsCacheAsync, ISegmentsCacheAsync, IImpressionsCacheAsync | IImpressionsCacheSync, IEventsCacheAsync | IEventsCacheSync, ITelemetryCacheAsync | ITelemetryCacheSync> {
|
|
387
|
+
export interface IStorageAsync extends IStorageBase<ISplitsCacheAsync, ISegmentsCacheAsync, IImpressionsCacheAsync | IImpressionsCacheSync, IImpressionCountsCacheBase, IEventsCacheAsync | IEventsCacheSync, ITelemetryCacheAsync | ITelemetryCacheSync, IUniqueKeysCacheBase> {
|
|
384
388
|
}
|
|
385
389
|
/** StorageFactory */
|
|
386
390
|
export declare type DataLoader = (storage: IStorageSync, matchingKey: string) => void;
|
|
387
391
|
export interface IStorageFactoryParams {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
matchingKey?: string;
|
|
394
|
-
splitFiltersValidation?: ISplitFiltersValidation;
|
|
392
|
+
settings: ISettings;
|
|
393
|
+
/**
|
|
394
|
+
* Error-first callback invoked when the storage is ready to be used. An error means that the storage failed to connect and shouldn't be used.
|
|
395
|
+
* It is meant for emitting SDK_READY event in consumer mode, and waiting before using the storage in the synchronizer.
|
|
396
|
+
*/
|
|
395
397
|
onReadyCb: (error?: any) => void;
|
|
396
|
-
metadata: IMetadata;
|
|
397
398
|
}
|
|
398
399
|
export declare type StorageType = 'MEMORY' | 'LOCALSTORAGE' | 'REDIS' | 'PLUGGABLE';
|
|
399
400
|
export declare type IStorageSyncFactory = {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IMetadata } from '../dtos/types';
|
|
2
|
+
import { Method } from '../sync/submitters/types';
|
|
3
|
+
import { ImpressionDTO, ISettings } from '../types';
|
|
4
|
+
export declare function metadataBuilder(settings: Pick<ISettings, 'version' | 'runtime'>): IMetadata;
|
|
5
|
+
export declare function impressionsToJSON(impressions: ImpressionDTO[], metadata: IMetadata): string[];
|
|
6
|
+
export declare function parseMetadata(field: string): [metadata: string] | string;
|
|
7
|
+
export declare function parseExceptionField(field: string): [metadata: string, method: Method] | string;
|
|
8
|
+
export declare function parseLatencyField(field: string): [metadata: string, method: Method, bucket: number] | string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ISyncTask } from '../types';
|
|
2
|
-
import {
|
|
2
|
+
import { IRecorderCacheSync } from '../../storages/types';
|
|
3
3
|
import { ILogger } from '../../logger/types';
|
|
4
4
|
import { IResponse } from '../../services/types';
|
|
5
5
|
/**
|
|
6
6
|
* Base function to create submitters, such as ImpressionsSubmitter and EventsSubmitter
|
|
7
7
|
*/
|
|
8
|
-
export declare function submitterFactory<T>(log: ILogger, postClient: (body: string) => Promise<IResponse>, sourceCache:
|
|
8
|
+
export declare function submitterFactory<T>(log: ILogger, postClient: (body: string) => Promise<IResponse>, sourceCache: IRecorderCacheSync<T>, postRate: number, dataName: string, fromCacheToPayload?: (cacheData: T) => any, maxRetries?: number, debugLogs?: boolean): ISyncTask<[], void>;
|
|
9
9
|
/**
|
|
10
10
|
* Decorates a provided submitter with a first execution window
|
|
11
11
|
*/
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ITelemetryCacheSync } from '../../storages/types';
|
|
2
|
+
import { TelemetryConfigStatsPayload, TelemetryConfigStats } from './types';
|
|
3
3
|
import { ISettings, SDKMode } from '../../types';
|
|
4
4
|
import { ISdkFactoryContextSync } from '../../sdkFactory/types';
|
|
5
|
-
/**
|
|
6
|
-
* Converts data from telemetry cache into /metrics/usage request payload.
|
|
7
|
-
*/
|
|
8
|
-
export declare function telemetryCacheStatsAdapter(telemetry: ITelemetryCacheSync, splits?: ISplitsCacheSync, segments?: ISegmentsCacheSync): {
|
|
9
|
-
isEmpty(): boolean;
|
|
10
|
-
clear(): void;
|
|
11
|
-
pop(): TelemetryUsageStatsPayload;
|
|
12
|
-
};
|
|
13
5
|
export declare function getTelemetryConfigStats(mode: SDKMode, storageType: string): TelemetryConfigStats;
|
|
14
6
|
/**
|
|
15
7
|
* Converts data from telemetry cache and settings into /metrics/config request payload.
|
|
@@ -33,6 +33,23 @@ export declare type ImpressionCountsPayload = {
|
|
|
33
33
|
rc: number;
|
|
34
34
|
}[];
|
|
35
35
|
};
|
|
36
|
+
export declare type UniqueKeysItemSs = {
|
|
37
|
+
/** Split name */
|
|
38
|
+
f: string;
|
|
39
|
+
/** keyNames */
|
|
40
|
+
ks: string[];
|
|
41
|
+
};
|
|
42
|
+
export declare type UniqueKeysPayloadSs = {
|
|
43
|
+
keys: UniqueKeysItemSs[];
|
|
44
|
+
};
|
|
45
|
+
export declare type UniqueKeysPayloadCs = {
|
|
46
|
+
keys: {
|
|
47
|
+
/** keyNames */
|
|
48
|
+
k: string;
|
|
49
|
+
/** Split name */
|
|
50
|
+
fs: string[];
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
36
53
|
export declare type StoredImpressionWithMetadata = {
|
|
37
54
|
/** Metadata */
|
|
38
55
|
m: IMetadata;
|
|
@@ -52,6 +69,8 @@ export declare type StoredImpressionWithMetadata = {
|
|
|
52
69
|
c: number;
|
|
53
70
|
/** time */
|
|
54
71
|
m: number;
|
|
72
|
+
/** previous time */
|
|
73
|
+
pt?: number;
|
|
55
74
|
};
|
|
56
75
|
};
|
|
57
76
|
export declare type StoredEventWithMetadata = {
|
|
@@ -80,19 +99,19 @@ export declare type TOKEN = 'to';
|
|
|
80
99
|
export declare type SEGMENT = 'se';
|
|
81
100
|
export declare type MY_SEGMENT = 'ms';
|
|
82
101
|
export declare type OperationType = SPLITS | IMPRESSIONS | IMPRESSIONS_COUNT | EVENTS | TELEMETRY | TOKEN | SEGMENT | MY_SEGMENT;
|
|
83
|
-
export declare type LastSync = Record<OperationType, number | undefined
|
|
84
|
-
export declare type HttpErrors = Record<OperationType, {
|
|
102
|
+
export declare type LastSync = Partial<Record<OperationType, number | undefined>>;
|
|
103
|
+
export declare type HttpErrors = Partial<Record<OperationType, {
|
|
85
104
|
[statusCode: string]: number;
|
|
86
|
-
}
|
|
87
|
-
export declare type HttpLatencies = Record<OperationType, Array<number
|
|
105
|
+
}>>;
|
|
106
|
+
export declare type HttpLatencies = Partial<Record<OperationType, Array<number>>>;
|
|
88
107
|
export declare type TREATMENT = 't';
|
|
89
108
|
export declare type TREATMENTS = 'ts';
|
|
90
109
|
export declare type TREATMENT_WITH_CONFIG = 'tc';
|
|
91
110
|
export declare type TREATMENTS_WITH_CONFIG = 'tcs';
|
|
92
111
|
export declare type TRACK = 'tr';
|
|
93
112
|
export declare type Method = TREATMENT | TREATMENTS | TREATMENT_WITH_CONFIG | TREATMENTS_WITH_CONFIG | TRACK;
|
|
94
|
-
export declare type MethodLatencies = Record<Method, Array<number
|
|
95
|
-
export declare type MethodExceptions = Record<Method, number
|
|
113
|
+
export declare type MethodLatencies = Partial<Record<Method, Array<number>>>;
|
|
114
|
+
export declare type MethodExceptions = Partial<Record<Method, number>>;
|
|
96
115
|
export declare type CONNECTION_ESTABLISHED = 0;
|
|
97
116
|
export declare type OCCUPANCY_PRI = 10;
|
|
98
117
|
export declare type OCCUPANCY_SEC = 20;
|
|
@@ -138,7 +157,8 @@ export declare type CONSUMER_PARTIAL_ENUM = 2;
|
|
|
138
157
|
export declare type OperationMode = STANDALONE_ENUM | CONSUMER_ENUM | CONSUMER_PARTIAL_ENUM;
|
|
139
158
|
export declare type OPTIMIZED_ENUM = 0;
|
|
140
159
|
export declare type DEBUG_ENUM = 1;
|
|
141
|
-
export declare type
|
|
160
|
+
export declare type NONE_ENUM = 2;
|
|
161
|
+
export declare type ImpressionsMode = OPTIMIZED_ENUM | DEBUG_ENUM | NONE_ENUM;
|
|
142
162
|
export declare type RefreshRates = {
|
|
143
163
|
sp: number;
|
|
144
164
|
se?: number;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
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
2
|
/**
|
|
11
3
|
* Storage is async if mode is consumer or partial consumer
|
|
12
4
|
*/
|
|
@@ -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 { IImpressionCountsCacheBase } 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: IImpressionCountsCacheBase, uniqueKeysTracker: IUniqueKeysTracker): IStrategy;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IImpressionCountsCacheBase } 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: IImpressionCountsCacheBase): IStrategy;
|
|
@@ -38,3 +38,26 @@ export interface ITelemetryTracker {
|
|
|
38
38
|
*/
|
|
39
39
|
addTag(tag: string): void;
|
|
40
40
|
}
|
|
41
|
+
export interface IFilterAdapter {
|
|
42
|
+
add(key: string, featureName: string): boolean;
|
|
43
|
+
contains(key: string, featureName: string): boolean;
|
|
44
|
+
clear(): void;
|
|
45
|
+
refreshRate?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface IImpressionSenderAdapter {
|
|
48
|
+
recordUniqueKeys(data: Object): void;
|
|
49
|
+
recordImpressionCounts(data: Object): void;
|
|
50
|
+
}
|
|
51
|
+
/** Unique keys tracker */
|
|
52
|
+
export interface IUniqueKeysTracker {
|
|
53
|
+
stop(): void;
|
|
54
|
+
track(key: string, featureName: string): void;
|
|
55
|
+
}
|
|
56
|
+
export interface IStrategyResult {
|
|
57
|
+
impressionsToStore: ImpressionDTO[];
|
|
58
|
+
impressionsToListener: ImpressionDTO[];
|
|
59
|
+
deduped: number;
|
|
60
|
+
}
|
|
61
|
+
export interface IStrategy {
|
|
62
|
+
process(impressions: ImpressionDTO[]): IStrategyResult;
|
|
63
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ILogger } from '../logger/types';
|
|
2
|
+
import { IUniqueKeysCacheBase } from '../storages/types';
|
|
3
|
+
import { IFilterAdapter, IUniqueKeysTracker } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Trackes uniques keys
|
|
6
|
+
* Unique Keys Tracker will be in charge of checking if the MTK was already sent to the BE in the last period
|
|
7
|
+
* or schedule to be sent; if not it will be added in an internal cache and sent in the next post.
|
|
8
|
+
*
|
|
9
|
+
* @param log Logger instance
|
|
10
|
+
* @param uniqueKeysCache cache to save unique keys
|
|
11
|
+
* @param filterAdapter filter adapter
|
|
12
|
+
*/
|
|
13
|
+
export declare function uniqueKeysTrackerFactory(log: ILogger, uniqueKeysCache: IUniqueKeysCacheBase, filterAdapter?: IFilterAdapter): IUniqueKeysTracker;
|
package/types/types.d.ts
CHANGED
|
@@ -715,7 +715,7 @@ export declare namespace SplitIO {
|
|
|
715
715
|
* ImpressionsMode type
|
|
716
716
|
* @typedef {string} ImpressionsMode
|
|
717
717
|
*/
|
|
718
|
-
type ImpressionsMode = 'OPTIMIZED' | 'DEBUG';
|
|
718
|
+
type ImpressionsMode = 'OPTIMIZED' | 'DEBUG' | 'NONE';
|
|
719
719
|
/**
|
|
720
720
|
* Defines the format of Split data to preload on the factory storage (cache).
|
|
721
721
|
*/
|
|
@@ -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";
|
|
@@ -31,6 +32,7 @@ export declare const CONSUMER_ENUM = 1;
|
|
|
31
32
|
export declare const CONSUMER_PARTIAL_ENUM = 2;
|
|
32
33
|
export declare const OPTIMIZED_ENUM = 0;
|
|
33
34
|
export declare const DEBUG_ENUM = 1;
|
|
35
|
+
export declare const NONE_ENUM = 2;
|
|
34
36
|
export declare const SPLITS = "sp";
|
|
35
37
|
export declare const IMPRESSIONS = "im";
|
|
36
38
|
export declare const IMPRESSIONS_COUNT = "ic";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.metadataBuilder = void 0;
|
|
4
|
-
var constants_1 = require("../utils/constants");
|
|
5
|
-
function metadataBuilder(settings) {
|
|
6
|
-
return {
|
|
7
|
-
s: settings.version,
|
|
8
|
-
i: settings.runtime.ip || constants_1.UNKNOWN,
|
|
9
|
-
n: settings.runtime.hostname || constants_1.UNKNOWN,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
exports.metadataBuilder = metadataBuilder;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IMetadata } from '../dtos/types';
|
|
2
|
-
import { ISettings } from '../types';
|
|
3
|
-
import { UNKNOWN } from '../utils/constants';
|
|
4
|
-
|
|
5
|
-
export function metadataBuilder(settings: Pick<ISettings, 'version' | 'runtime'>): IMetadata {
|
|
6
|
-
return {
|
|
7
|
-
s: settings.version,
|
|
8
|
-
i: settings.runtime.ip || UNKNOWN,
|
|
9
|
-
n: settings.runtime.hostname || UNKNOWN,
|
|
10
|
-
};
|
|
11
|
-
}
|