@splitsoftware/splitio-commons 2.11.1-rc.2 → 2.12.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 +6 -2
- package/cjs/evaluator/condition/engineUtils.js +2 -2
- package/cjs/evaluator/fallbackTreatmentsCalculator/fallbackSanitizer/index.js +3 -3
- package/cjs/evaluator/fallbackTreatmentsCalculator/index.js +21 -32
- package/cjs/evaluator/matchers/whitelist.js +1 -1
- package/cjs/integrations/pluggable.js +1 -1
- package/cjs/listeners/node.js +2 -2
- package/cjs/logger/constants.js +3 -4
- package/cjs/logger/index.js +1 -1
- package/cjs/logger/messages/debug.js +1 -1
- package/cjs/logger/messages/error.js +1 -1
- package/cjs/logger/messages/info.js +2 -3
- package/cjs/logger/messages/warn.js +4 -4
- package/cjs/sdkClient/client.js +2 -3
- package/cjs/sdkClient/clientAttributesDecoration.js +3 -3
- package/cjs/sdkClient/clientInputValidation.js +36 -68
- package/cjs/sdkClient/identity.js +1 -1
- package/cjs/sdkClient/sdkClient.js +19 -7
- package/cjs/sdkFactory/index.js +8 -41
- package/cjs/services/splitApi.js +13 -13
- package/cjs/services/splitHttpClient.js +1 -1
- package/cjs/storages/KeyBuilder.js +12 -12
- package/cjs/storages/KeyBuilderCS.js +13 -13
- package/cjs/storages/KeyBuilderSS.js +15 -15
- package/cjs/storages/getRolloutPlan.js +1 -1
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +1 -1
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +1 -1
- package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +1 -1
- package/cjs/storages/inRedis/EventsCacheInRedis.js +1 -1
- package/cjs/storages/inRedis/ImpressionCountsCacheInRedis.js +5 -5
- package/cjs/storages/inRedis/ImpressionsCacheInRedis.js +1 -1
- package/cjs/storages/inRedis/RedisAdapter.js +8 -8
- package/cjs/storages/inRedis/SplitsCacheInRedis.js +6 -6
- package/cjs/storages/inRedis/TelemetryCacheInRedis.js +7 -7
- package/cjs/storages/inRedis/UniqueKeysCacheInRedis.js +3 -3
- package/cjs/storages/pluggable/EventsCachePluggable.js +1 -1
- package/cjs/storages/pluggable/ImpressionCountsCachePluggable.js +6 -6
- package/cjs/storages/pluggable/SplitsCachePluggable.js +4 -4
- package/cjs/storages/pluggable/TelemetryCachePluggable.js +7 -7
- package/cjs/storages/pluggable/UniqueKeysCachePluggable.js +2 -2
- package/cjs/storages/pluggable/index.js +3 -3
- package/cjs/storages/pluggable/wrapperAdapter.js +1 -1
- package/cjs/storages/setRolloutPlan.js +3 -3
- package/cjs/storages/utils.js +6 -6
- package/cjs/sync/offline/splitsParser/parseCondition.js +1 -1
- package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
- package/cjs/sync/polling/pollingManagerSS.js +2 -2
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +6 -6
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +12 -10
- package/cjs/sync/streaming/SSEClient/index.js +2 -2
- package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +2 -2
- package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -2
- package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +2 -2
- package/cjs/sync/streaming/parseUtils.js +1 -1
- package/cjs/sync/submitters/submitter.js +1 -1
- package/cjs/trackers/eventTracker.js +10 -12
- package/cjs/trackers/impressionObserver/buildKey.js +1 -1
- package/cjs/trackers/impressionsTracker.js +37 -20
- package/cjs/trackers/uniqueKeysTracker.js +1 -1
- package/cjs/utils/inputValidation/apiKey.js +1 -1
- package/cjs/utils/inputValidation/attribute.js +2 -2
- package/cjs/utils/inputValidation/eventProperties.js +1 -1
- package/cjs/utils/inputValidation/isOperational.js +1 -1
- package/cjs/utils/lang/index.js +1 -1
- package/cjs/utils/lang/sets.js +4 -4
- package/cjs/utils/promise/timeout.js +1 -1
- package/cjs/utils/settingsValidation/splitFilters.js +2 -2
- package/cjs/utils/settingsValidation/url.js +5 -5
- package/esm/evaluator/condition/engineUtils.js +2 -2
- package/esm/evaluator/fallbackTreatmentsCalculator/fallbackSanitizer/index.js +3 -3
- package/esm/evaluator/fallbackTreatmentsCalculator/index.js +21 -33
- package/esm/evaluator/matchers/whitelist.js +1 -1
- package/esm/integrations/pluggable.js +1 -1
- package/esm/listeners/node.js +2 -2
- package/esm/logger/constants.js +0 -1
- package/esm/logger/index.js +1 -1
- package/esm/logger/messages/info.js +1 -2
- package/esm/logger/messages/warn.js +3 -3
- package/esm/sdkClient/client.js +3 -4
- package/esm/sdkClient/clientAttributesDecoration.js +3 -3
- package/esm/sdkClient/clientInputValidation.js +36 -68
- package/esm/sdkClient/identity.js +1 -1
- package/esm/sdkClient/sdkClient.js +20 -8
- package/esm/sdkFactory/index.js +8 -41
- package/esm/services/splitApi.js +13 -13
- package/esm/services/splitHttpClient.js +1 -1
- package/esm/storages/KeyBuilder.js +12 -12
- package/esm/storages/KeyBuilderCS.js +12 -12
- package/esm/storages/KeyBuilderSS.js +14 -14
- package/esm/storages/getRolloutPlan.js +1 -1
- package/esm/storages/inMemory/ImpressionCountsCacheInMemory.js +1 -1
- package/esm/storages/inRedis/EventsCacheInRedis.js +1 -1
- package/esm/storages/inRedis/ImpressionCountsCacheInRedis.js +4 -4
- package/esm/storages/inRedis/RedisAdapter.js +7 -7
- package/esm/storages/inRedis/SplitsCacheInRedis.js +4 -4
- package/esm/storages/inRedis/TelemetryCacheInRedis.js +7 -7
- package/esm/storages/inRedis/UniqueKeysCacheInRedis.js +1 -1
- package/esm/storages/pluggable/EventsCachePluggable.js +1 -1
- package/esm/storages/pluggable/ImpressionCountsCachePluggable.js +5 -5
- package/esm/storages/pluggable/SplitsCachePluggable.js +2 -2
- package/esm/storages/pluggable/TelemetryCachePluggable.js +7 -7
- package/esm/storages/pluggable/UniqueKeysCachePluggable.js +1 -1
- package/esm/storages/pluggable/index.js +2 -2
- package/esm/storages/pluggable/wrapperAdapter.js +1 -1
- package/esm/storages/setRolloutPlan.js +3 -3
- package/esm/storages/utils.js +6 -6
- package/esm/sync/offline/splitsParser/parseCondition.js +1 -1
- package/esm/sync/polling/pollingManagerSS.js +2 -2
- package/esm/sync/polling/updaters/segmentChangesUpdater.js +6 -6
- package/esm/sync/polling/updaters/splitChangesUpdater.js +12 -10
- package/esm/sync/streaming/SSEClient/index.js +2 -2
- package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +2 -2
- package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -2
- package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +2 -2
- package/esm/sync/streaming/parseUtils.js +1 -1
- package/esm/sync/submitters/submitter.js +1 -1
- package/esm/trackers/eventTracker.js +10 -12
- package/esm/trackers/impressionObserver/buildKey.js +1 -1
- package/esm/trackers/impressionsTracker.js +38 -21
- package/esm/trackers/uniqueKeysTracker.js +1 -1
- package/esm/utils/inputValidation/apiKey.js +1 -1
- package/esm/utils/inputValidation/attribute.js +2 -2
- package/esm/utils/inputValidation/isOperational.js +1 -1
- package/esm/utils/lang/sets.js +4 -4
- package/esm/utils/promise/timeout.js +1 -1
- package/esm/utils/settingsValidation/splitFilters.js +2 -2
- package/esm/utils/settingsValidation/url.js +5 -5
- package/package.json +5 -5
- package/src/dtos/types.ts +15 -15
- package/src/evaluator/condition/engineUtils.ts +2 -2
- package/src/evaluator/fallbackTreatmentsCalculator/index.ts +23 -41
- package/src/evaluator/matchers/whitelist.ts +2 -2
- package/src/evaluator/types.ts +2 -2
- package/src/evaluator/value/index.ts +1 -1
- package/src/integrations/pluggable.ts +1 -1
- package/src/logger/constants.ts +0 -1
- package/src/logger/messages/info.ts +1 -2
- package/src/logger/messages/warn.ts +3 -3
- package/src/sdkClient/client.ts +3 -5
- package/src/sdkClient/clientInputValidation.ts +38 -61
- package/src/sdkClient/sdkClient.ts +20 -5
- package/src/sdkFactory/index.ts +10 -47
- package/src/sdkFactory/types.ts +6 -3
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +1 -1
- package/src/storages/inMemory/SplitsCacheInMemory.ts +1 -1
- package/src/storages/inRedis/SplitsCacheInRedis.ts +1 -1
- package/src/storages/pluggable/SplitsCachePluggable.ts +1 -1
- package/src/storages/setRolloutPlan.ts +2 -2
- package/src/sync/polling/updaters/segmentChangesUpdater.ts +1 -1
- package/src/sync/polling/updaters/splitChangesUpdater.ts +11 -9
- package/src/trackers/eventTracker.ts +7 -10
- package/src/trackers/impressionsTracker.ts +42 -26
- package/src/trackers/types.ts +3 -1
- package/src/utils/lang/sets.ts +4 -2
- package/types/splitio.d.ts +22 -18
package/src/utils/lang/sets.ts
CHANGED
|
@@ -12,6 +12,8 @@ export function returnSetsUnion<T>(set: Set<T>, set2: Set<T>): Set<T> {
|
|
|
12
12
|
return new Set(setToArray(set).concat(setToArray(set2)));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export function returnDifference<T>(
|
|
16
|
-
|
|
15
|
+
export function returnDifference<T>(list1?: T[] | null, list2?: T[] | null): T[] {
|
|
16
|
+
list1 = list1 || [];
|
|
17
|
+
list2 = list2 || [];
|
|
18
|
+
return list1.filter(item => list2!.indexOf(item) === -1);
|
|
17
19
|
}
|
package/types/splitio.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ interface ISharedSettings {
|
|
|
26
26
|
* List of feature flag filters. These filters are used to fetch a subset of the feature flag definitions in your environment, in order to reduce the delay of the SDK to be ready.
|
|
27
27
|
*
|
|
28
28
|
* NOTES:
|
|
29
|
-
* - This configuration is only meaningful when the SDK is working in `
|
|
29
|
+
* - This configuration is only meaningful when the SDK is working in `'standalone'` mode.
|
|
30
30
|
* - If `bySet` filter is provided, `byName` and `byPrefix` filters are ignored.
|
|
31
31
|
* - If both `byName` and `byPrefix` filters are provided, the intersection of the two groups of feature flags is fetched.
|
|
32
32
|
*
|
|
@@ -73,11 +73,13 @@ interface ISharedSettings {
|
|
|
73
73
|
* const factory = SplitFactory({
|
|
74
74
|
* ...
|
|
75
75
|
* sync: {
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
76
|
+
* requestOptions: {
|
|
77
|
+
* getHeaderOverrides: (context) => {
|
|
78
|
+
* return {
|
|
79
|
+
* 'Authorization': context.headers['Authorization'] + ', other-value',
|
|
80
|
+
* 'custom-header': 'custom-value'
|
|
81
|
+
* };
|
|
82
|
+
* }
|
|
81
83
|
* }
|
|
82
84
|
* }
|
|
83
85
|
* });
|
|
@@ -211,7 +213,7 @@ interface IServerSideSharedSettings {
|
|
|
211
213
|
*/
|
|
212
214
|
startup?: {
|
|
213
215
|
/**
|
|
214
|
-
*
|
|
216
|
+
* Time in seconds before emitting the `SDK_READY_TIMED_OUT` event.
|
|
215
217
|
*
|
|
216
218
|
* @defaultValue `15`
|
|
217
219
|
*/
|
|
@@ -371,7 +373,7 @@ interface IClientSideSyncSharedSettings extends IClientSideSharedSettings, ISync
|
|
|
371
373
|
*/
|
|
372
374
|
startup?: {
|
|
373
375
|
/**
|
|
374
|
-
*
|
|
376
|
+
* Time in seconds before emitting the `SDK_READY_TIMED_OUT` event.
|
|
375
377
|
*
|
|
376
378
|
* @defaultValue `10`
|
|
377
379
|
*/
|
|
@@ -501,7 +503,7 @@ declare namespace SplitIO {
|
|
|
501
503
|
*/
|
|
502
504
|
type: SdkUpdateMetadataType;
|
|
503
505
|
/**
|
|
504
|
-
* The names of the flags
|
|
506
|
+
* The names of the flags that were updated. Empty array if the update is of type 'SEGMENTS_UPDATE'.
|
|
505
507
|
*/
|
|
506
508
|
names: string[];
|
|
507
509
|
}
|
|
@@ -922,7 +924,7 @@ declare namespace SplitIO {
|
|
|
922
924
|
type AsyncTreatmentWithConfig = Promise<TreatmentWithConfig>;
|
|
923
925
|
/**
|
|
924
926
|
* An object with the treatments with configs for a bulk of feature flags, returned by getTreatmentsWithConfig.
|
|
925
|
-
* Each existing configuration is a stringified version of the JSON you defined on
|
|
927
|
+
* Each existing configuration is a stringified version of the JSON you defined on Harness FME UI. For example:
|
|
926
928
|
* ```
|
|
927
929
|
* {
|
|
928
930
|
* feature1: { treatment: 'on', config: null }
|
|
@@ -1077,7 +1079,7 @@ declare namespace SplitIO {
|
|
|
1077
1079
|
changeNumber: number;
|
|
1078
1080
|
/**
|
|
1079
1081
|
* Map of configurations per treatment.
|
|
1080
|
-
* Each existing configuration is a stringified version of the JSON you defined on
|
|
1082
|
+
* Each existing configuration is a stringified version of the JSON you defined on Harness FME UI.
|
|
1081
1083
|
*/
|
|
1082
1084
|
configs: {
|
|
1083
1085
|
[treatmentName: string]: string;
|
|
@@ -1436,9 +1438,9 @@ declare namespace SplitIO {
|
|
|
1436
1438
|
*/
|
|
1437
1439
|
startup?: {
|
|
1438
1440
|
/**
|
|
1439
|
-
*
|
|
1441
|
+
* Time in seconds before emitting the `SDK_READY_TIMED_OUT` event.
|
|
1440
1442
|
*
|
|
1441
|
-
* @defaultValue `
|
|
1443
|
+
* @defaultValue `10`
|
|
1442
1444
|
*/
|
|
1443
1445
|
readyTimeout?: number;
|
|
1444
1446
|
/**
|
|
@@ -1590,11 +1592,13 @@ declare namespace SplitIO {
|
|
|
1590
1592
|
* const factory = SplitFactory({
|
|
1591
1593
|
* ...
|
|
1592
1594
|
* sync: {
|
|
1593
|
-
*
|
|
1594
|
-
*
|
|
1595
|
-
*
|
|
1596
|
-
*
|
|
1597
|
-
*
|
|
1595
|
+
* requestOptions: {
|
|
1596
|
+
* getHeaderOverrides: (context) => {
|
|
1597
|
+
* return {
|
|
1598
|
+
* 'Authorization': context.headers['Authorization'] + ', other-value',
|
|
1599
|
+
* 'custom-header': 'custom-value'
|
|
1600
|
+
* };
|
|
1601
|
+
* }
|
|
1598
1602
|
* }
|
|
1599
1603
|
* }
|
|
1600
1604
|
* });
|