@splitsoftware/splitio-commons 1.17.1-rc.3 → 1.17.1-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.txt +4 -3
- package/cjs/readiness/readinessManager.js +13 -4
- package/cjs/sdkClient/sdkClientMethodCS.js +3 -7
- package/cjs/sdkClient/sdkClientMethodCSWithTT.js +3 -7
- package/cjs/sdkFactory/index.js +8 -13
- package/cjs/storages/{AbstractSegmentsCacheSync.js → AbstractMySegmentsCacheSync.js} +15 -17
- package/cjs/storages/AbstractSplitsCacheAsync.js +7 -0
- package/cjs/storages/AbstractSplitsCacheSync.js +7 -0
- package/cjs/storages/dataLoader.js +32 -64
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +5 -5
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +9 -1
- package/cjs/storages/inLocalStorage/index.js +1 -6
- package/cjs/storages/inMemory/InMemoryStorageCS.js +5 -17
- package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +5 -5
- package/cjs/storages/inMemory/SegmentsCacheInMemory.js +13 -27
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +0 -1
- package/cjs/storages/inRedis/RedisAdapter.js +1 -1
- package/cjs/storages/inRedis/SegmentsCacheInRedis.js +13 -19
- package/cjs/storages/pluggable/SegmentsCachePluggable.js +11 -32
- package/cjs/storages/pluggable/index.js +32 -37
- package/cjs/sync/offline/syncManagerOffline.js +18 -11
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +7 -2
- package/cjs/sync/polling/pollingManagerSS.js +3 -3
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +12 -28
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +10 -1
- package/cjs/sync/syncManagerOnline.js +20 -21
- package/cjs/trackers/eventTracker.js +1 -1
- package/cjs/trackers/impressionsTracker.js +1 -1
- package/cjs/utils/settingsValidation/storage/storageCS.js +12 -1
- package/esm/readiness/readinessManager.js +13 -4
- package/esm/sdkClient/sdkClientMethodCS.js +3 -7
- package/esm/sdkClient/sdkClientMethodCSWithTT.js +3 -7
- package/esm/sdkFactory/index.js +9 -14
- package/esm/storages/{AbstractSegmentsCacheSync.js → AbstractMySegmentsCacheSync.js} +14 -16
- package/esm/storages/AbstractSplitsCacheAsync.js +7 -0
- package/esm/storages/AbstractSplitsCacheSync.js +7 -0
- package/esm/storages/dataLoader.js +30 -61
- package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +5 -5
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +9 -1
- package/esm/storages/inLocalStorage/index.js +2 -7
- package/esm/storages/inMemory/InMemoryStorageCS.js +5 -17
- package/esm/storages/inMemory/MySegmentsCacheInMemory.js +5 -5
- package/esm/storages/inMemory/SegmentsCacheInMemory.js +13 -27
- package/esm/storages/inMemory/SplitsCacheInMemory.js +0 -1
- package/esm/storages/inRedis/RedisAdapter.js +1 -1
- package/esm/storages/inRedis/SegmentsCacheInRedis.js +13 -19
- package/esm/storages/pluggable/SegmentsCachePluggable.js +11 -32
- package/esm/storages/pluggable/index.js +32 -37
- package/esm/sync/offline/syncManagerOffline.js +18 -11
- package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +8 -3
- package/esm/sync/polling/pollingManagerSS.js +3 -3
- package/esm/sync/polling/updaters/segmentChangesUpdater.js +12 -28
- package/esm/sync/polling/updaters/splitChangesUpdater.js +11 -2
- package/esm/sync/syncManagerOnline.js +20 -21
- package/esm/trackers/eventTracker.js +1 -1
- package/esm/trackers/impressionsTracker.js +1 -1
- package/esm/utils/settingsValidation/storage/storageCS.js +10 -0
- package/package.json +1 -1
- package/src/readiness/readinessManager.ts +11 -4
- package/src/readiness/types.ts +2 -0
- package/src/sdkClient/sdkClientMethodCS.ts +1 -6
- package/src/sdkClient/sdkClientMethodCSWithTT.ts +1 -6
- package/src/sdkFactory/index.ts +9 -15
- package/src/sdkFactory/types.ts +1 -2
- package/src/storages/{AbstractSegmentsCacheSync.ts → AbstractMySegmentsCacheSync.ts} +13 -28
- package/src/storages/AbstractSplitsCacheAsync.ts +8 -0
- package/src/storages/AbstractSplitsCacheSync.ts +8 -0
- package/src/storages/dataLoader.ts +32 -62
- package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +5 -5
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +10 -1
- package/src/storages/inLocalStorage/index.ts +2 -8
- package/src/storages/inMemory/InMemoryStorageCS.ts +5 -20
- package/src/storages/inMemory/MySegmentsCacheInMemory.ts +5 -5
- package/src/storages/inMemory/SegmentsCacheInMemory.ts +12 -26
- package/src/storages/inMemory/SplitsCacheInMemory.ts +0 -1
- package/src/storages/inRedis/RedisAdapter.ts +1 -1
- package/src/storages/inRedis/SegmentsCacheInRedis.ts +13 -22
- package/src/storages/pluggable/SegmentsCachePluggable.ts +11 -35
- package/src/storages/pluggable/index.ts +33 -38
- package/src/storages/types.ts +9 -11
- package/src/sync/offline/syncManagerOffline.ts +21 -13
- package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +7 -3
- package/src/sync/polling/pollingManagerSS.ts +2 -3
- package/src/sync/polling/updaters/segmentChangesUpdater.ts +13 -29
- package/src/sync/polling/updaters/splitChangesUpdater.ts +11 -3
- package/src/sync/syncManagerOnline.ts +17 -17
- package/src/sync/types.ts +1 -1
- package/src/trackers/eventTracker.ts +1 -1
- package/src/trackers/impressionsTracker.ts +1 -1
- package/src/types.ts +8 -9
- package/src/utils/settingsValidation/storage/storageCS.ts +13 -0
- package/types/readiness/types.d.ts +2 -0
- package/types/sdkFactory/types.d.ts +1 -2
- package/types/storages/AbstractSplitsCacheAsync.d.ts +5 -0
- package/types/storages/AbstractSplitsCacheSync.d.ts +5 -0
- package/types/storages/dataLoader.d.ts +6 -17
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +5 -5
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +6 -0
- package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +5 -5
- package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +5 -7
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -1
- package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +6 -3
- package/types/storages/pluggable/SegmentsCachePluggable.d.ts +4 -16
- package/types/storages/types.d.ts +7 -11
- package/types/sync/types.d.ts +1 -1
- package/types/types.d.ts +8 -8
- package/types/utils/settingsValidation/storage/storageCS.d.ts +5 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ILogger } from '../../logger/types';
|
|
2
|
-
import {
|
|
2
|
+
import { AbstractMySegmentsCacheSync } from '../AbstractMySegmentsCacheSync';
|
|
3
3
|
import type { MySegmentsKeyBuilder } from '../KeyBuilderCS';
|
|
4
|
-
export declare class MySegmentsCacheInLocal extends
|
|
4
|
+
export declare class MySegmentsCacheInLocal extends AbstractMySegmentsCacheSync {
|
|
5
5
|
private readonly keys;
|
|
6
6
|
private readonly log;
|
|
7
7
|
constructor(log: ILogger, keys: MySegmentsKeyBuilder);
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
protected addSegment(name: string): boolean;
|
|
9
|
+
protected removeSegment(name: string): boolean;
|
|
10
10
|
isInSegment(name: string): boolean;
|
|
11
11
|
getRegisteredSegments(): string[];
|
|
12
12
|
getKeysCount(): number;
|
|
13
|
-
setChangeNumber(
|
|
13
|
+
protected setChangeNumber(changeNumber?: number): void;
|
|
14
14
|
getChangeNumber(): number;
|
|
15
15
|
}
|
|
@@ -35,6 +35,12 @@ export declare class SplitsCacheInLocal extends AbstractSplitsCacheSync {
|
|
|
35
35
|
getSplitNames(): string[];
|
|
36
36
|
trafficTypeExists(trafficType: string): boolean;
|
|
37
37
|
usesSegments(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Check if the splits information is already stored in browser LocalStorage.
|
|
40
|
+
* In this function we could add more code to check if the data is valid.
|
|
41
|
+
* @override
|
|
42
|
+
*/
|
|
43
|
+
checkCache(): boolean;
|
|
38
44
|
/**
|
|
39
45
|
* Clean Splits cache if its `lastUpdated` timestamp is older than the given `expirationTimestamp`,
|
|
40
46
|
*
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AbstractMySegmentsCacheSync } from '../AbstractMySegmentsCacheSync';
|
|
2
2
|
/**
|
|
3
3
|
* Default MySegmentsCacheInMemory implementation that stores MySegments in memory.
|
|
4
4
|
* Supported by all JS runtimes.
|
|
5
5
|
*/
|
|
6
|
-
export declare class MySegmentsCacheInMemory extends
|
|
6
|
+
export declare class MySegmentsCacheInMemory extends AbstractMySegmentsCacheSync {
|
|
7
7
|
private segmentCache;
|
|
8
8
|
private cn?;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
protected addSegment(name: string): boolean;
|
|
10
|
+
protected removeSegment(name: string): boolean;
|
|
11
11
|
isInSegment(name: string): boolean;
|
|
12
|
-
setChangeNumber(
|
|
12
|
+
protected setChangeNumber(changeNumber?: number): void;
|
|
13
13
|
getChangeNumber(): number;
|
|
14
14
|
getRegisteredSegments(): string[];
|
|
15
15
|
getKeysCount(): number;
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ISegmentsCacheSync } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Default ISplitsCacheSync implementation that stores
|
|
4
|
-
* Supported by all JS runtimes.
|
|
3
|
+
* Default ISplitsCacheSync implementation for server-side that stores segments definitions in memory.
|
|
5
4
|
*/
|
|
6
|
-
export declare class SegmentsCacheInMemory
|
|
5
|
+
export declare class SegmentsCacheInMemory implements ISegmentsCacheSync {
|
|
7
6
|
private segmentCache;
|
|
8
7
|
private segmentChangeNumber;
|
|
9
|
-
|
|
10
|
-
removeFromSegment(name: string, segmentKeys: string[]): boolean;
|
|
8
|
+
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): boolean;
|
|
11
9
|
isInSegment(name: string, key: string): boolean;
|
|
12
10
|
clear(): void;
|
|
13
11
|
private _registerSegment;
|
|
14
12
|
registerSegments(names: string[]): boolean;
|
|
15
13
|
getRegisteredSegments(): string[];
|
|
16
14
|
getKeysCount(): number;
|
|
17
|
-
setChangeNumber(name: string, changeNumber: number): boolean;
|
|
18
15
|
getChangeNumber(name: string): number;
|
|
16
|
+
resetSegments(): boolean;
|
|
19
17
|
}
|
|
@@ -3,7 +3,6 @@ import { AbstractSplitsCacheSync } from '../AbstractSplitsCacheSync';
|
|
|
3
3
|
import { ISet } from '../../utils/lang/sets';
|
|
4
4
|
/**
|
|
5
5
|
* Default ISplitsCacheSync implementation that stores split definitions in memory.
|
|
6
|
-
* Supported by all JS runtimes.
|
|
7
6
|
*/
|
|
8
7
|
export declare class SplitsCacheInMemory extends AbstractSplitsCacheSync {
|
|
9
8
|
private flagSetsFilter;
|
|
@@ -7,10 +7,13 @@ export declare class SegmentsCacheInRedis implements ISegmentsCacheAsync {
|
|
|
7
7
|
private readonly redis;
|
|
8
8
|
private readonly keys;
|
|
9
9
|
constructor(log: ILogger, keys: KeyBuilderSS, redis: RedisAdapter);
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Update the given segment `name` with the lists of `addedKeys`, `removedKeys` and `changeNumber`.
|
|
12
|
+
* The returned promise is resolved if the operation success, with `true` if the segment was updated (i.e., some key was added or removed),
|
|
13
|
+
* or rejected if it fails (e.g., Redis operation fails).
|
|
14
|
+
*/
|
|
15
|
+
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): Promise<boolean>;
|
|
12
16
|
isInSegment(name: string, key: string): Promise<boolean>;
|
|
13
|
-
setChangeNumber(name: string, changeNumber: number): Promise<boolean>;
|
|
14
17
|
getChangeNumber(name: string): Promise<number>;
|
|
15
18
|
registerSegments(segments: string[]): Promise<boolean>;
|
|
16
19
|
getRegisteredSegments(): Promise<string[]>;
|
|
@@ -10,28 +10,16 @@ export declare class SegmentsCachePluggable implements ISegmentsCacheAsync {
|
|
|
10
10
|
private readonly wrapper;
|
|
11
11
|
constructor(log: ILogger, keys: KeyBuilderSS, wrapper: IPluggableStorageWrapper);
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* The returned promise is resolved
|
|
15
|
-
* or rejected if wrapper operation fails.
|
|
16
|
-
*/
|
|
17
|
-
addToSegment(name: string, segmentKeys: string[]): Promise<boolean | void>;
|
|
18
|
-
/**
|
|
19
|
-
* Remove a list of `segmentKeys` from the given segment `name`.
|
|
20
|
-
* The returned promise is resolved when the operation success
|
|
21
|
-
* or rejected if wrapper operation fails.
|
|
13
|
+
* Update the given segment `name` with the lists of `addedKeys`, `removedKeys` and `changeNumber`.
|
|
14
|
+
* The returned promise is resolved if the operation success, with `true` if the segment was updated (i.e., some key was added or removed),
|
|
15
|
+
* or rejected if it fails (e.g., wrapper operation fails).
|
|
22
16
|
*/
|
|
23
|
-
|
|
17
|
+
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): Promise<boolean>;
|
|
24
18
|
/**
|
|
25
19
|
* Returns a promise that resolves with a boolean value indicating if `key` is part of `name` segment.
|
|
26
20
|
* Promise can be rejected if wrapper operation fails.
|
|
27
21
|
*/
|
|
28
22
|
isInSegment(name: string, key: string): Promise<boolean>;
|
|
29
|
-
/**
|
|
30
|
-
* Set till number for the given segment `name`.
|
|
31
|
-
* The returned promise is resolved when the operation success,
|
|
32
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
33
|
-
*/
|
|
34
|
-
setChangeNumber(name: string, changeNumber: number): Promise<boolean | void>;
|
|
35
23
|
/**
|
|
36
24
|
* Get till number or -1 if it's not defined.
|
|
37
25
|
* The returned promise is resolved with the changeNumber or -1 if it doesn't exist or a wrapper operation fails.
|
|
@@ -192,6 +192,7 @@ export interface ISplitsCacheBase {
|
|
|
192
192
|
trafficTypeExists(trafficType: string): MaybeThenable<boolean>;
|
|
193
193
|
usesSegments(): MaybeThenable<boolean>;
|
|
194
194
|
clear(): MaybeThenable<boolean | void>;
|
|
195
|
+
checkCache(): MaybeThenable<boolean>;
|
|
195
196
|
killLocally(name: string, defaultTreatment: string, changeNumber: number): MaybeThenable<boolean>;
|
|
196
197
|
getNamesByFlagSets(flagSets: string[]): MaybeThenable<ISet<string>[]>;
|
|
197
198
|
}
|
|
@@ -207,6 +208,7 @@ export interface ISplitsCacheSync extends ISplitsCacheBase {
|
|
|
207
208
|
trafficTypeExists(trafficType: string): boolean;
|
|
208
209
|
usesSegments(): boolean;
|
|
209
210
|
clear(): void;
|
|
211
|
+
checkCache(): boolean;
|
|
210
212
|
killLocally(name: string, defaultTreatment: string, changeNumber: number): boolean;
|
|
211
213
|
getNamesByFlagSets(flagSets: string[]): ISet<string>[];
|
|
212
214
|
}
|
|
@@ -222,40 +224,35 @@ export interface ISplitsCacheAsync extends ISplitsCacheBase {
|
|
|
222
224
|
trafficTypeExists(trafficType: string): Promise<boolean>;
|
|
223
225
|
usesSegments(): Promise<boolean>;
|
|
224
226
|
clear(): Promise<boolean | void>;
|
|
227
|
+
checkCache(): Promise<boolean>;
|
|
225
228
|
killLocally(name: string, defaultTreatment: string, changeNumber: number): Promise<boolean>;
|
|
226
229
|
getNamesByFlagSets(flagSets: string[]): Promise<ISet<string>[]>;
|
|
227
230
|
}
|
|
228
231
|
/** Segments cache */
|
|
229
232
|
export interface ISegmentsCacheBase {
|
|
230
|
-
addToSegment(name: string, segmentKeys: string[]): MaybeThenable<boolean | void>;
|
|
231
|
-
removeFromSegment(name: string, segmentKeys: string[]): MaybeThenable<boolean | void>;
|
|
232
233
|
isInSegment(name: string, key?: string): MaybeThenable<boolean>;
|
|
233
234
|
registerSegments(names: string[]): MaybeThenable<boolean | void>;
|
|
234
235
|
getRegisteredSegments(): MaybeThenable<string[]>;
|
|
235
|
-
setChangeNumber(name: string, changeNumber: number): MaybeThenable<boolean | void>;
|
|
236
236
|
getChangeNumber(name: string): MaybeThenable<number>;
|
|
237
|
+
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): MaybeThenable<boolean>;
|
|
237
238
|
clear(): MaybeThenable<boolean | void>;
|
|
238
239
|
}
|
|
239
240
|
export interface ISegmentsCacheSync extends ISegmentsCacheBase {
|
|
240
|
-
addToSegment(name: string, segmentKeys?: string[]): boolean;
|
|
241
|
-
removeFromSegment(name: string, segmentKeys?: string[]): boolean;
|
|
242
241
|
isInSegment(name: string, key?: string): boolean;
|
|
243
242
|
registerSegments(names: string[]): boolean;
|
|
244
243
|
getRegisteredSegments(): string[];
|
|
245
244
|
getKeysCount(): number;
|
|
246
|
-
setChangeNumber(name: string, changeNumber: number): boolean | void;
|
|
247
245
|
getChangeNumber(name?: string): number;
|
|
246
|
+
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): boolean;
|
|
248
247
|
resetSegments(segmentsData: MySegmentsData | IMySegmentsResponse): boolean;
|
|
249
248
|
clear(): void;
|
|
250
249
|
}
|
|
251
250
|
export interface ISegmentsCacheAsync extends ISegmentsCacheBase {
|
|
252
|
-
addToSegment(name: string, segmentKeys: string[]): Promise<boolean | void>;
|
|
253
|
-
removeFromSegment(name: string, segmentKeys: string[]): Promise<boolean | void>;
|
|
254
251
|
isInSegment(name: string, key: string): Promise<boolean>;
|
|
255
252
|
registerSegments(names: string[]): Promise<boolean | void>;
|
|
256
253
|
getRegisteredSegments(): Promise<string[]>;
|
|
257
|
-
setChangeNumber(name: string, changeNumber: number): Promise<boolean | void>;
|
|
258
254
|
getChangeNumber(name: string): Promise<number>;
|
|
255
|
+
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): Promise<boolean>;
|
|
259
256
|
clear(): Promise<boolean | void>;
|
|
260
257
|
}
|
|
261
258
|
/** Recorder storages (impressions, events and telemetry) */
|
|
@@ -382,7 +379,6 @@ export interface IStorageBase<TSplitsCache extends ISplitsCacheBase, TSegmentsCa
|
|
|
382
379
|
events: TEventsCache;
|
|
383
380
|
telemetry?: TTelemetryCache;
|
|
384
381
|
uniqueKeys?: TUniqueKeysCache;
|
|
385
|
-
init?: () => void | Promise<void>;
|
|
386
382
|
destroy(): void | Promise<void>;
|
|
387
383
|
shared?: (matchingKey: string, onReadyCb: (error?: any) => void) => this;
|
|
388
384
|
}
|
|
@@ -392,6 +388,7 @@ export interface IStorageSync extends IStorageBase<ISplitsCacheSync, ISegmentsCa
|
|
|
392
388
|
export interface IStorageAsync extends IStorageBase<ISplitsCacheAsync, ISegmentsCacheAsync, IImpressionsCacheAsync | IImpressionsCacheSync, IImpressionCountsCacheBase, IEventsCacheAsync | IEventsCacheSync, ITelemetryCacheAsync | ITelemetryCacheSync, IUniqueKeysCacheBase> {
|
|
393
389
|
}
|
|
394
390
|
/** StorageFactory */
|
|
391
|
+
export declare type DataLoader = (storage: IStorageSync, matchingKey: string) => void;
|
|
395
392
|
export interface IStorageFactoryParams {
|
|
396
393
|
settings: ISettings;
|
|
397
394
|
/**
|
|
@@ -399,7 +396,6 @@ export interface IStorageFactoryParams {
|
|
|
399
396
|
* It is meant for emitting SDK_READY event in consumer mode, and waiting before using the storage in the synchronizer.
|
|
400
397
|
*/
|
|
401
398
|
onReadyCb: (error?: any) => void;
|
|
402
|
-
onReadyFromCacheCb: (error?: any) => void;
|
|
403
399
|
}
|
|
404
400
|
export declare type StorageType = 'MEMORY' | 'LOCALSTORAGE' | 'REDIS' | 'PLUGGABLE';
|
|
405
401
|
export declare type IStorageSyncFactory = {
|
package/types/sync/types.d.ts
CHANGED
|
@@ -39,5 +39,5 @@ export interface ISyncManager extends ITask {
|
|
|
39
39
|
submitterManager?: ISubmitterManager;
|
|
40
40
|
}
|
|
41
41
|
export interface ISyncManagerCS extends ISyncManager {
|
|
42
|
-
shared(matchingKey: string, readinessManager: IReadinessManager, storage: IStorageSync): ISyncManager | undefined;
|
|
42
|
+
shared(matchingKey: string, readinessManager: IReadinessManager, storage: IStorageSync): Pick<ISyncManager, 'stop' | 'flush'> | undefined;
|
|
43
43
|
}
|
package/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ISplitFiltersValidation } from './dtos/types';
|
|
2
2
|
import { IIntegration, IIntegrationFactoryParams } from './integrations/types';
|
|
3
3
|
import { ILogger } from './logger/types';
|
|
4
4
|
import { ISdkFactoryContext } from './sdkFactory/types';
|
|
@@ -92,7 +92,6 @@ export interface ISettings {
|
|
|
92
92
|
eventsFirstPushWindow: number;
|
|
93
93
|
};
|
|
94
94
|
readonly storage: IStorageSyncFactory | IStorageAsyncFactory;
|
|
95
|
-
readonly preloadedData?: SplitIO.PreloadedData;
|
|
96
95
|
readonly integrations: Array<{
|
|
97
96
|
readonly type: string;
|
|
98
97
|
(params: IIntegrationFactoryParams): IIntegration | void;
|
|
@@ -771,19 +770,21 @@ export declare namespace SplitIO {
|
|
|
771
770
|
* If this value is older than 10 days ago (expiration time policy), the data is not used to update the storage content.
|
|
772
771
|
* @TODO configurable expiration time policy?
|
|
773
772
|
*/
|
|
773
|
+
lastUpdated: number;
|
|
774
774
|
/**
|
|
775
775
|
* Change number of the preloaded data.
|
|
776
776
|
* If this value is older than the current changeNumber at the storage, the data is not used to update the storage content.
|
|
777
777
|
*/
|
|
778
778
|
since: number;
|
|
779
779
|
/**
|
|
780
|
-
*
|
|
781
|
-
* @TODO rename to flags
|
|
780
|
+
* Map of feature flags to their stringified definitions.
|
|
782
781
|
*/
|
|
783
|
-
splitsData:
|
|
782
|
+
splitsData: {
|
|
783
|
+
[splitName: string]: string;
|
|
784
|
+
};
|
|
784
785
|
/**
|
|
785
786
|
* Optional map of user keys to their list of segments.
|
|
786
|
-
* @TODO
|
|
787
|
+
* @TODO remove when releasing first version
|
|
787
788
|
*/
|
|
788
789
|
mySegmentsData?: {
|
|
789
790
|
[key: string]: string[];
|
|
@@ -791,10 +792,9 @@ export declare namespace SplitIO {
|
|
|
791
792
|
/**
|
|
792
793
|
* Optional map of segments to their stringified definitions.
|
|
793
794
|
* This property is ignored if `mySegmentsData` was provided.
|
|
794
|
-
* @TODO rename to segments
|
|
795
795
|
*/
|
|
796
796
|
segmentsData?: {
|
|
797
|
-
[segmentName: string]: string
|
|
797
|
+
[segmentName: string]: string;
|
|
798
798
|
};
|
|
799
799
|
}
|
|
800
800
|
/**
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ISettings, SDKMode } from '../../../types';
|
|
2
2
|
import { ILogger } from '../../../logger/types';
|
|
3
|
+
import { IStorageFactoryParams, IStorageSync } from '../../../storages/types';
|
|
4
|
+
export declare function __InLocalStorageMockFactory(params: IStorageFactoryParams): IStorageSync;
|
|
5
|
+
export declare namespace __InLocalStorageMockFactory {
|
|
6
|
+
var type: import("../../../storages/types").StorageType;
|
|
7
|
+
}
|
|
3
8
|
/**
|
|
4
9
|
* This function validates `settings.storage` object
|
|
5
10
|
*
|