@splitsoftware/splitio-commons 1.16.1-rc.8 → 1.17.0-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 +2 -1
- package/cjs/evaluator/matchers/index.js +1 -3
- package/cjs/evaluator/matchers/matcherTypes.js +0 -1
- package/cjs/evaluator/matchersTransform/index.js +1 -1
- package/cjs/logger/constants.js +4 -3
- package/cjs/logger/messages/info.js +2 -1
- package/cjs/readiness/readinessManager.js +10 -14
- package/cjs/readiness/sdkReadinessManager.js +6 -5
- package/cjs/sdkClient/sdkClientMethodCS.js +2 -2
- package/cjs/sdkClient/sdkClientMethodCSWithTT.js +2 -2
- package/cjs/sdkFactory/index.js +1 -1
- package/cjs/services/decorateHeaders.js +43 -0
- package/cjs/services/splitApi.js +0 -4
- package/cjs/services/splitHttpClient.js +5 -4
- package/cjs/storages/AbstractSplitsCacheAsync.js +2 -2
- package/cjs/storages/AbstractSplitsCacheSync.js +6 -5
- package/cjs/storages/KeyBuilder.js +0 -3
- package/cjs/storages/KeyBuilderCS.js +5 -17
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +4 -16
- package/cjs/storages/inLocalStorage/index.js +2 -6
- package/cjs/storages/inMemory/InMemoryStorageCS.js +0 -5
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +11 -20
- package/cjs/storages/inMemory/TelemetryCacheInMemory.js +10 -7
- package/cjs/storages/pluggable/inMemoryWrapper.js +1 -1
- package/cjs/sync/polling/fetchers/mySegmentsFetcher.js +1 -5
- package/cjs/sync/polling/pollingManagerCS.js +33 -51
- package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +2 -2
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +21 -20
- package/cjs/sync/streaming/SSEClient/index.js +9 -12
- package/cjs/sync/streaming/SSEHandler/index.js +0 -1
- package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +9 -23
- package/cjs/sync/streaming/constants.js +1 -2
- package/cjs/sync/streaming/parseUtils.js +8 -3
- package/cjs/sync/streaming/pushManager.js +69 -100
- package/cjs/sync/submitters/telemetrySubmitter.js +0 -4
- package/cjs/sync/syncManagerOnline.js +14 -24
- package/cjs/utils/constants/index.js +2 -4
- package/cjs/utils/settingsValidation/index.js +2 -7
- package/esm/evaluator/matchers/index.js +1 -3
- package/esm/evaluator/matchers/matcherTypes.js +0 -1
- package/esm/evaluator/matchersTransform/index.js +1 -1
- package/esm/logger/constants.js +1 -0
- package/esm/logger/messages/info.js +2 -1
- package/esm/readiness/readinessManager.js +10 -14
- package/esm/readiness/sdkReadinessManager.js +6 -5
- package/esm/sdkClient/sdkClientMethodCS.js +2 -2
- package/esm/sdkClient/sdkClientMethodCSWithTT.js +2 -2
- package/esm/sdkFactory/index.js +1 -1
- package/esm/services/decorateHeaders.js +39 -0
- package/esm/services/splitApi.js +1 -5
- package/esm/services/splitHttpClient.js +5 -4
- package/esm/storages/AbstractSplitsCacheAsync.js +2 -2
- package/esm/storages/AbstractSplitsCacheSync.js +4 -3
- package/esm/storages/KeyBuilder.js +0 -3
- package/esm/storages/KeyBuilderCS.js +4 -15
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +5 -17
- package/esm/storages/inLocalStorage/index.js +3 -7
- package/esm/storages/inMemory/InMemoryStorageCS.js +0 -5
- package/esm/storages/inMemory/SplitsCacheInMemory.js +12 -21
- package/esm/storages/inMemory/TelemetryCacheInMemory.js +10 -7
- package/esm/storages/pluggable/inMemoryWrapper.js +1 -1
- package/esm/sync/polling/fetchers/mySegmentsFetcher.js +1 -5
- package/esm/sync/polling/pollingManagerCS.js +34 -52
- package/esm/sync/polling/syncTasks/mySegmentsSyncTask.js +2 -2
- package/esm/sync/polling/updaters/mySegmentsUpdater.js +19 -18
- package/esm/sync/streaming/SSEClient/index.js +10 -13
- package/esm/sync/streaming/SSEHandler/index.js +1 -2
- package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +9 -23
- package/esm/sync/streaming/constants.js +0 -1
- package/esm/sync/streaming/parseUtils.js +8 -3
- package/esm/sync/streaming/pushManager.js +70 -100
- package/esm/sync/submitters/telemetrySubmitter.js +0 -4
- package/esm/sync/syncManagerOnline.js +15 -25
- package/esm/utils/constants/index.js +1 -3
- package/esm/utils/settingsValidation/index.js +2 -7
- package/package.json +1 -1
- package/src/dtos/types.ts +7 -17
- package/src/evaluator/matchers/index.ts +0 -2
- package/src/evaluator/matchers/matcherTypes.ts +0 -1
- package/src/evaluator/matchersTransform/index.ts +1 -1
- package/src/logger/constants.ts +1 -0
- package/src/logger/messages/info.ts +2 -1
- package/src/readiness/readinessManager.ts +9 -13
- package/src/readiness/sdkReadinessManager.ts +7 -7
- package/src/readiness/types.ts +2 -3
- package/src/sdkClient/sdkClientMethodCS.ts +2 -2
- package/src/sdkClient/sdkClientMethodCSWithTT.ts +2 -2
- package/src/sdkFactory/index.ts +1 -1
- package/src/services/decorateHeaders.ts +41 -0
- package/src/services/splitApi.ts +2 -7
- package/src/services/splitHttpClient.ts +6 -5
- package/src/services/types.ts +0 -1
- package/src/storages/AbstractSplitsCacheAsync.ts +2 -2
- package/src/storages/AbstractSplitsCacheSync.ts +5 -4
- package/src/storages/KeyBuilder.ts +0 -3
- package/src/storages/KeyBuilderCS.ts +5 -25
- package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +3 -3
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +5 -20
- package/src/storages/inLocalStorage/index.ts +4 -8
- package/src/storages/inMemory/InMemoryStorageCS.ts +0 -5
- package/src/storages/inMemory/SplitsCacheInMemory.ts +10 -15
- package/src/storages/inMemory/TelemetryCacheInMemory.ts +11 -7
- package/src/storages/pluggable/inMemoryWrapper.ts +1 -1
- package/src/storages/types.ts +5 -7
- package/src/sync/polling/fetchers/mySegmentsFetcher.ts +2 -6
- package/src/sync/polling/pollingManagerCS.ts +29 -61
- package/src/sync/polling/syncTasks/mySegmentsSyncTask.ts +10 -10
- package/src/sync/polling/types.ts +3 -4
- package/src/sync/polling/updaters/mySegmentsUpdater.ts +20 -17
- package/src/sync/streaming/SSEClient/index.ts +14 -20
- package/src/sync/streaming/SSEHandler/index.ts +1 -2
- package/src/sync/streaming/SSEHandler/types.ts +2 -14
- package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +10 -26
- package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +1 -1
- package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +1 -1
- package/src/sync/streaming/UpdateWorkers/types.ts +2 -2
- package/src/sync/streaming/constants.ts +0 -1
- package/src/sync/streaming/parseUtils.ts +10 -6
- package/src/sync/streaming/pushManager.ts +68 -104
- package/src/sync/streaming/types.ts +3 -5
- package/src/sync/submitters/telemetrySubmitter.ts +0 -4
- package/src/sync/submitters/types.ts +4 -11
- package/src/sync/syncManagerOnline.ts +11 -19
- package/src/types.ts +9 -28
- package/src/utils/constants/index.ts +1 -3
- package/src/utils/settingsValidation/index.ts +3 -8
- package/src/utils/settingsValidation/types.ts +1 -1
- package/types/dtos/types.d.ts +6 -14
- package/types/logger/constants.d.ts +1 -0
- package/types/readiness/readinessManager.d.ts +2 -2
- package/types/readiness/sdkReadinessManager.d.ts +3 -2
- package/types/readiness/types.d.ts +2 -3
- package/types/services/decorateHeaders.d.ts +2 -0
- package/types/services/splitApi.d.ts +1 -1
- package/types/services/splitHttpClient.d.ts +1 -1
- package/types/services/types.d.ts +0 -1
- package/types/storages/AbstractSplitsCacheAsync.d.ts +1 -1
- package/types/storages/AbstractSplitsCacheSync.d.ts +3 -3
- package/types/storages/KeyBuilder.d.ts +0 -1
- package/types/storages/KeyBuilderCS.d.ts +2 -7
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +2 -2
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +1 -1
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +2 -3
- package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +6 -4
- package/types/storages/pluggable/inMemoryWrapper.d.ts +1 -1
- package/types/storages/types.d.ts +3 -4
- package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +3 -2
- package/types/sync/polling/types.d.ts +3 -10
- package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +4 -4
- package/types/sync/streaming/SSEClient/index.d.ts +2 -5
- package/types/sync/streaming/SSEHandler/types.d.ts +2 -13
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +2 -3
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +1 -2
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +2 -3
- package/types/sync/streaming/UpdateWorkers/types.d.ts +2 -2
- package/types/sync/streaming/constants.d.ts +0 -1
- package/types/sync/streaming/parseUtils.d.ts +4 -2
- package/types/sync/streaming/pushManager.d.ts +0 -2
- package/types/sync/streaming/types.d.ts +4 -5
- package/types/sync/submitters/types.d.ts +3 -10
- package/types/types.d.ts +11 -26
- package/types/utils/constants/index.d.ts +1 -3
- package/types/utils/settingsValidation/index.d.ts +0 -2
- package/types/utils/settingsValidation/types.d.ts +1 -1
- package/cjs/evaluator/matchers/large_segment.js +0 -16
- package/esm/evaluator/matchers/large_segment.js +0 -12
- package/src/evaluator/matchers/large_segment.ts +0 -18
|
@@ -24,7 +24,6 @@ export declare const MY_SEGMENTS_UPDATE_V2 = "MY_SEGMENTS_UPDATE_V2";
|
|
|
24
24
|
export declare const SEGMENT_UPDATE = "SEGMENT_UPDATE";
|
|
25
25
|
export declare const SPLIT_KILL = "SPLIT_KILL";
|
|
26
26
|
export declare const SPLIT_UPDATE = "SPLIT_UPDATE";
|
|
27
|
-
export declare const MY_LARGE_SEGMENTS_UPDATE = "MY_LARGE_SEGMENTS_UPDATE";
|
|
28
27
|
export declare const CONTROL = "CONTROL";
|
|
29
28
|
export declare const OCCUPANCY = "OCCUPANCY";
|
|
30
29
|
export declare enum ControlType {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Compression, KeyList } from './SSEHandler/types';
|
|
2
|
-
import { ISplit } from '../../dtos/types';
|
|
3
2
|
/**
|
|
4
3
|
* Decode, decompress and parse the provided 'data' into a KeyList object
|
|
5
4
|
*
|
|
@@ -29,5 +28,8 @@ export declare function parseBitmap(data: string, compression: Compression): Uin
|
|
|
29
28
|
export declare function isInBitmap(bitmap: Uint8Array, hash64hex: string): boolean;
|
|
30
29
|
/**
|
|
31
30
|
* Parse feature flags notifications for instant feature flag updates
|
|
31
|
+
*
|
|
32
|
+
* @param {ISplitUpdateData} data
|
|
33
|
+
* @returns {KeyList}
|
|
32
34
|
*/
|
|
33
|
-
export declare function parseFFUpdatePayload(compression: Compression, data: string):
|
|
35
|
+
export declare function parseFFUpdatePayload(compression: Compression, data: string): KeyList | undefined;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { IPushManager } from './types';
|
|
2
2
|
import { IPollingManager } from '../polling/types';
|
|
3
|
-
import { IMyLargeSegmentsUpdateData } from './SSEHandler/types';
|
|
4
3
|
import { ISdkFactoryContextSync } from '../../sdkFactory/types';
|
|
5
|
-
export declare function getDelay(parsedData: Pick<IMyLargeSegmentsUpdateData, 'i' | 'h' | 's'>, matchingKey: string): number;
|
|
6
4
|
/**
|
|
7
5
|
* PushManager factory:
|
|
8
6
|
* - for server-side if key is not provided in settings.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IMySegmentsUpdateData, IMySegmentsUpdateV2Data, ISegmentUpdateData, ISplitUpdateData, ISplitKillData
|
|
1
|
+
import { IMySegmentsUpdateData, IMySegmentsUpdateV2Data, ISegmentUpdateData, ISplitUpdateData, ISplitKillData } from './SSEHandler/types';
|
|
2
2
|
import { ITask } from '../types';
|
|
3
3
|
import { IMySegmentsSyncTask } from '../polling/types';
|
|
4
4
|
import { IEventEmitter } from '../../types';
|
|
@@ -12,11 +12,10 @@ export declare type MY_SEGMENTS_UPDATE_V2 = 'MY_SEGMENTS_UPDATE_V2';
|
|
|
12
12
|
export declare type SEGMENT_UPDATE = 'SEGMENT_UPDATE';
|
|
13
13
|
export declare type SPLIT_KILL = 'SPLIT_KILL';
|
|
14
14
|
export declare type SPLIT_UPDATE = 'SPLIT_UPDATE';
|
|
15
|
-
export declare type MY_LARGE_SEGMENTS_UPDATE = 'MY_LARGE_SEGMENTS_UPDATE';
|
|
16
15
|
export declare type CONTROL = 'CONTROL';
|
|
17
16
|
export declare type OCCUPANCY = 'OCCUPANCY';
|
|
18
|
-
export declare type IPushEvent = PUSH_SUBSYSTEM_UP | PUSH_SUBSYSTEM_DOWN | PUSH_NONRETRYABLE_ERROR | PUSH_RETRYABLE_ERROR | MY_SEGMENTS_UPDATE | MY_SEGMENTS_UPDATE_V2 | SEGMENT_UPDATE | SPLIT_UPDATE | SPLIT_KILL |
|
|
19
|
-
declare type IParsedData<T extends IPushEvent> = T extends MY_SEGMENTS_UPDATE ? IMySegmentsUpdateData : T extends MY_SEGMENTS_UPDATE_V2 ? IMySegmentsUpdateV2Data : T extends
|
|
17
|
+
export declare type IPushEvent = PUSH_SUBSYSTEM_UP | PUSH_SUBSYSTEM_DOWN | PUSH_NONRETRYABLE_ERROR | PUSH_RETRYABLE_ERROR | MY_SEGMENTS_UPDATE | MY_SEGMENTS_UPDATE_V2 | SEGMENT_UPDATE | SPLIT_UPDATE | SPLIT_KILL | ControlType.STREAMING_RESET;
|
|
18
|
+
declare type IParsedData<T extends IPushEvent> = T extends MY_SEGMENTS_UPDATE ? IMySegmentsUpdateData : T extends MY_SEGMENTS_UPDATE_V2 ? IMySegmentsUpdateV2Data : T extends SEGMENT_UPDATE ? ISegmentUpdateData : T extends SPLIT_UPDATE ? ISplitUpdateData : T extends SPLIT_KILL ? ISplitKillData : undefined;
|
|
20
19
|
/**
|
|
21
20
|
* EventEmitter used as Feedback Loop between the SyncManager and PushManager,
|
|
22
21
|
* where the latter pushes messages and the former consumes it
|
|
@@ -30,7 +29,7 @@ export interface IPushEventEmitter extends IEventEmitter {
|
|
|
30
29
|
* PushManager
|
|
31
30
|
*/
|
|
32
31
|
export interface IPushManager extends ITask, IPushEventEmitter {
|
|
33
|
-
add(userKey: string, mySegmentsSyncTask: IMySegmentsSyncTask
|
|
32
|
+
add(userKey: string, mySegmentsSyncTask: IMySegmentsSyncTask): void;
|
|
34
33
|
remove(userKey: string): void;
|
|
35
34
|
}
|
|
36
35
|
export {};
|
|
@@ -90,7 +90,7 @@ export declare type DROPPED = 1;
|
|
|
90
90
|
export declare type DEDUPED = 2;
|
|
91
91
|
export declare type ImpressionDataType = QUEUED | DROPPED | DEDUPED;
|
|
92
92
|
export declare type EventDataType = QUEUED | DROPPED;
|
|
93
|
-
export declare type UpdatesFromSSEEnum = SPLITS | MY_SEGMENT
|
|
93
|
+
export declare type UpdatesFromSSEEnum = SPLITS | MY_SEGMENT;
|
|
94
94
|
export declare type SPLITS = 'sp';
|
|
95
95
|
export declare type IMPRESSIONS = 'im';
|
|
96
96
|
export declare type IMPRESSIONS_COUNT = 'ic';
|
|
@@ -99,8 +99,7 @@ export declare type TELEMETRY = 'te';
|
|
|
99
99
|
export declare type TOKEN = 'to';
|
|
100
100
|
export declare type SEGMENT = 'se';
|
|
101
101
|
export declare type MY_SEGMENT = 'ms';
|
|
102
|
-
export declare type
|
|
103
|
-
export declare type OperationType = SPLITS | IMPRESSIONS | IMPRESSIONS_COUNT | EVENTS | TELEMETRY | TOKEN | SEGMENT | MY_SEGMENT | MY_LARGE_SEGMENT;
|
|
102
|
+
export declare type OperationType = SPLITS | IMPRESSIONS | IMPRESSIONS_COUNT | EVENTS | TELEMETRY | TOKEN | SEGMENT | MY_SEGMENT;
|
|
104
103
|
export declare type LastSync = Partial<Record<OperationType, number | undefined>>;
|
|
105
104
|
export declare type HttpErrors = Partial<Record<OperationType, {
|
|
106
105
|
[statusCode: string]: number;
|
|
@@ -137,9 +136,8 @@ export declare type TelemetryUsageStats = {
|
|
|
137
136
|
mE?: MethodExceptions;
|
|
138
137
|
};
|
|
139
138
|
export declare type UpdatesFromSSE = {
|
|
140
|
-
sp
|
|
139
|
+
sp: number;
|
|
141
140
|
ms?: number;
|
|
142
|
-
mls?: number;
|
|
143
141
|
};
|
|
144
142
|
export declare type TelemetryUsageStatsPayload = TelemetryUsageStats & {
|
|
145
143
|
lS: LastSync;
|
|
@@ -153,8 +151,6 @@ export declare type TelemetryUsageStatsPayload = TelemetryUsageStats & {
|
|
|
153
151
|
spC?: number;
|
|
154
152
|
seC?: number;
|
|
155
153
|
skC?: number;
|
|
156
|
-
lseC?: number;
|
|
157
|
-
lskC?: number;
|
|
158
154
|
sL?: number;
|
|
159
155
|
eQ: number;
|
|
160
156
|
eD: number;
|
|
@@ -177,7 +173,6 @@ export declare type RefreshRates = {
|
|
|
177
173
|
sp: number;
|
|
178
174
|
se?: number;
|
|
179
175
|
ms?: number;
|
|
180
|
-
mls?: number;
|
|
181
176
|
im: number;
|
|
182
177
|
ev: number;
|
|
183
178
|
te: number;
|
|
@@ -198,8 +193,6 @@ export declare type TelemetryConfigStats = {
|
|
|
198
193
|
};
|
|
199
194
|
export declare type TelemetryConfigStatsPayload = TelemetryConfigStats & {
|
|
200
195
|
sE: boolean;
|
|
201
|
-
lsE?: boolean;
|
|
202
|
-
wls?: boolean;
|
|
203
196
|
rR: RefreshRates;
|
|
204
197
|
uO: UrlOverrides;
|
|
205
198
|
iQ: number;
|
package/types/types.d.ts
CHANGED
|
@@ -80,7 +80,6 @@ export interface ISettings {
|
|
|
80
80
|
metricsRefreshRate?: number;
|
|
81
81
|
telemetryRefreshRate: number;
|
|
82
82
|
segmentsRefreshRate: number;
|
|
83
|
-
largeSegmentsRefreshRate: number;
|
|
84
83
|
offlineRefreshRate: number;
|
|
85
84
|
eventsPushRate: number;
|
|
86
85
|
eventsQueueSize: number;
|
|
@@ -91,7 +90,6 @@ export interface ISettings {
|
|
|
91
90
|
requestTimeoutBeforeReady: number;
|
|
92
91
|
retriesOnFailureBeforeReady: number;
|
|
93
92
|
eventsFirstPushWindow: number;
|
|
94
|
-
waitForLargeSegments: boolean;
|
|
95
93
|
};
|
|
96
94
|
readonly storage: IStorageSyncFactory | IStorageAsyncFactory;
|
|
97
95
|
readonly integrations: Array<{
|
|
@@ -115,8 +113,12 @@ export interface ISettings {
|
|
|
115
113
|
__splitFiltersValidation: ISplitFiltersValidation;
|
|
116
114
|
localhostMode?: SplitIO.LocalhostFactory;
|
|
117
115
|
enabled: boolean;
|
|
118
|
-
largeSegmentsEnabled: boolean;
|
|
119
116
|
flagSpecVersion: string;
|
|
117
|
+
requestOptions?: {
|
|
118
|
+
getHeaderOverrides?: (context: {
|
|
119
|
+
headers: Record<string, string>;
|
|
120
|
+
}) => Record<string, string>;
|
|
121
|
+
};
|
|
120
122
|
};
|
|
121
123
|
readonly runtime: {
|
|
122
124
|
ip: string | false;
|
|
@@ -215,7 +217,12 @@ interface ISharedSettings {
|
|
|
215
217
|
* Enables synchronization.
|
|
216
218
|
* @property {boolean} enabled
|
|
217
219
|
*/
|
|
218
|
-
enabled
|
|
220
|
+
enabled?: boolean;
|
|
221
|
+
requestOptions?: {
|
|
222
|
+
getHeaderOverrides?: (context: {
|
|
223
|
+
headers: Record<string, string>;
|
|
224
|
+
}) => Record<string, string>;
|
|
225
|
+
};
|
|
219
226
|
};
|
|
220
227
|
}
|
|
221
228
|
/**
|
|
@@ -813,13 +820,6 @@ export declare namespace SplitIO {
|
|
|
813
820
|
* @default 10
|
|
814
821
|
*/
|
|
815
822
|
eventsFirstPushWindow?: number;
|
|
816
|
-
/**
|
|
817
|
-
* Whether the SDK should wait for large segments to be ready before emitting SDK_READY event.
|
|
818
|
-
* It only applies if largeSegmentsEnabled is true.
|
|
819
|
-
* @property {number} waitForLargeSegments
|
|
820
|
-
* @default true
|
|
821
|
-
*/
|
|
822
|
-
waitForLargeSegments?: boolean;
|
|
823
823
|
};
|
|
824
824
|
/**
|
|
825
825
|
* SDK scheduler settings.
|
|
@@ -864,13 +864,6 @@ export declare namespace SplitIO {
|
|
|
864
864
|
* @default 60
|
|
865
865
|
*/
|
|
866
866
|
segmentsRefreshRate?: number;
|
|
867
|
-
/**
|
|
868
|
-
* The SDK polls Split servers for changes to large segment definitions. This parameter controls this polling period in seconds.
|
|
869
|
-
* It only applies if largeSegmentsEnabled is true.
|
|
870
|
-
* @property {number} largeSegmentsRefreshRate
|
|
871
|
-
* @default 60
|
|
872
|
-
*/
|
|
873
|
-
largeSegmentsRefreshRate?: number;
|
|
874
867
|
/**
|
|
875
868
|
* The SDK posts the queued events data in bulks. This parameter controls the posting rate in seconds.
|
|
876
869
|
* @property {number} eventsPushRate
|
|
@@ -943,14 +936,6 @@ export declare namespace SplitIO {
|
|
|
943
936
|
* @property {Object} urls
|
|
944
937
|
*/
|
|
945
938
|
urls?: UrlSettings;
|
|
946
|
-
sync?: ISharedSettings['sync'] & {
|
|
947
|
-
/**
|
|
948
|
-
* Enables synchronization of large segments.
|
|
949
|
-
* @property {boolean} largeSegmentsEnabled
|
|
950
|
-
* @default false
|
|
951
|
-
*/
|
|
952
|
-
largeSegmentsEnabled?: boolean;
|
|
953
|
-
};
|
|
954
939
|
}
|
|
955
940
|
/**
|
|
956
941
|
* Settings interface for SDK instances created on NodeJS.
|
|
@@ -53,7 +53,6 @@ export declare const TELEMETRY = "te";
|
|
|
53
53
|
export declare const TOKEN = "to";
|
|
54
54
|
export declare const SEGMENT = "se";
|
|
55
55
|
export declare const MY_SEGMENT = "ms";
|
|
56
|
-
export declare const MY_LARGE_SEGMENT = "mls";
|
|
57
56
|
export declare const TREATMENT = "t";
|
|
58
57
|
export declare const TREATMENTS = "ts";
|
|
59
58
|
export declare const TREATMENT_WITH_CONFIG = "tc";
|
|
@@ -79,6 +78,5 @@ export declare const NON_REQUESTED = 1;
|
|
|
79
78
|
export declare const DISABLED = 0;
|
|
80
79
|
export declare const ENABLED = 1;
|
|
81
80
|
export declare const PAUSED = 2;
|
|
82
|
-
export declare const FLAG_SPEC_VERSION = "1.
|
|
81
|
+
export declare const FLAG_SPEC_VERSION = "1.1";
|
|
83
82
|
export declare const IN_SEGMENT = "IN_SEGMENT";
|
|
84
|
-
export declare const IN_LARGE_SEGMENT = "IN_LARGE_SEGMENT";
|
|
@@ -12,7 +12,6 @@ export declare const base: {
|
|
|
12
12
|
scheduler: {
|
|
13
13
|
featuresRefreshRate: number;
|
|
14
14
|
segmentsRefreshRate: number;
|
|
15
|
-
largeSegmentsRefreshRate: number;
|
|
16
15
|
telemetryRefreshRate: number;
|
|
17
16
|
impressionsRefreshRate: number;
|
|
18
17
|
offlineRefreshRate: number;
|
|
@@ -40,7 +39,6 @@ export declare const base: {
|
|
|
40
39
|
localhostMode: undefined;
|
|
41
40
|
enabled: boolean;
|
|
42
41
|
flagSpecVersion: string;
|
|
43
|
-
largeSegmentsEnabled: boolean;
|
|
44
42
|
};
|
|
45
43
|
log: undefined;
|
|
46
44
|
};
|
|
@@ -28,7 +28,7 @@ export interface ISettingsValidationParams {
|
|
|
28
28
|
/** Localhost mode validator (`settings.sync.localhostMode`) */
|
|
29
29
|
localhost?: (settings: ISettings) => ISettings['sync']['localhostMode'];
|
|
30
30
|
/** User consent validator (`settings.userConsent`) */
|
|
31
|
-
consent
|
|
31
|
+
consent: (settings: ISettings) => ISettings['userConsent'];
|
|
32
32
|
/** Flag spec version validation. Configurable by the JS Synchronizer but not by the SDKs */
|
|
33
33
|
flagSpec?: (settings: ISettings) => ISettings['sync']['flagSpecVersion'];
|
|
34
34
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.largeSegmentMatcherContext = void 0;
|
|
4
|
-
var thenable_1 = require("../../utils/promise/thenable");
|
|
5
|
-
function largeSegmentMatcherContext(largeSegmentName, storage) {
|
|
6
|
-
return function largeSegmentMatcher(key) {
|
|
7
|
-
var isInLargeSegment = storage.largeSegments ? storage.largeSegments.isInSegment(largeSegmentName, key) : false;
|
|
8
|
-
if ((0, thenable_1.thenable)(isInLargeSegment)) {
|
|
9
|
-
isInLargeSegment.then(function (result) {
|
|
10
|
-
return result;
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
return isInLargeSegment;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
exports.largeSegmentMatcherContext = largeSegmentMatcherContext;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { thenable } from '../../utils/promise/thenable';
|
|
2
|
-
export function largeSegmentMatcherContext(largeSegmentName, storage) {
|
|
3
|
-
return function largeSegmentMatcher(key) {
|
|
4
|
-
var isInLargeSegment = storage.largeSegments ? storage.largeSegments.isInSegment(largeSegmentName, key) : false;
|
|
5
|
-
if (thenable(isInLargeSegment)) {
|
|
6
|
-
isInLargeSegment.then(function (result) {
|
|
7
|
-
return result;
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
return isInLargeSegment;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { MaybeThenable } from '../../dtos/types';
|
|
2
|
-
import { ISegmentsCacheBase } from '../../storages/types';
|
|
3
|
-
import { thenable } from '../../utils/promise/thenable';
|
|
4
|
-
|
|
5
|
-
export function largeSegmentMatcherContext(largeSegmentName: string, storage: { largeSegments?: ISegmentsCacheBase }) {
|
|
6
|
-
|
|
7
|
-
return function largeSegmentMatcher(key: string): MaybeThenable<boolean> {
|
|
8
|
-
const isInLargeSegment = storage.largeSegments ? storage.largeSegments.isInSegment(largeSegmentName, key) : false;
|
|
9
|
-
|
|
10
|
-
if (thenable(isInLargeSegment)) {
|
|
11
|
-
isInLargeSegment.then(result => {
|
|
12
|
-
return result;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return isInLargeSegment;
|
|
17
|
-
};
|
|
18
|
-
}
|