@splitsoftware/splitio 10.21.2-rc.3 → 10.21.2-rc.5
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/es/factory/browser.js +1 -2
- package/es/factory/node.js +3 -2
- package/es/platform/filter/bloomFilter.js +28 -0
- package/es/settings/defaults/version.js +1 -1
- package/lib/factory/browser.js +1 -2
- package/lib/factory/node.js +3 -2
- package/lib/platform/filter/bloomFilter.js +32 -0
- package/lib/settings/defaults/version.js +1 -1
- package/package.json +4 -2
- package/src/factory/browser.js +1 -2
- package/src/factory/node.js +4 -2
- package/src/platform/filter/bloomFilter.js +33 -0
- package/src/settings/defaults/version.js +1 -1
- package/types/splitio.d.ts +1 -1
package/es/factory/browser.js
CHANGED
|
@@ -11,7 +11,6 @@ import { integrationsManagerFactory } from '@splitsoftware/splitio-commons/esm/i
|
|
|
11
11
|
import { __InLocalStorageMockFactory } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/storage/storageCS';
|
|
12
12
|
import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory';
|
|
13
13
|
import { LOCALHOST_MODE, STORAGE_LOCALSTORAGE } from '@splitsoftware/splitio-commons/esm/utils/constants';
|
|
14
|
-
import { shouldAddPt } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/utils';
|
|
15
14
|
import { createUserConsentAPI } from '@splitsoftware/splitio-commons/esm/consent/sdkUserConsent';
|
|
16
15
|
import { settingsFactory } from '../settings/browser';
|
|
17
16
|
import { platform, SignalListener } from '../platform';
|
|
@@ -38,7 +37,7 @@ function getModules(settings) {
|
|
|
38
37
|
sdkClientMethodFactory: sdkClientMethodCSFactory,
|
|
39
38
|
SignalListener: SignalListener,
|
|
40
39
|
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? integrationsManagerFactory.bind(null, settings.integrations) : undefined,
|
|
41
|
-
impressionsObserverFactory:
|
|
40
|
+
impressionsObserverFactory: impressionObserverCSFactory,
|
|
42
41
|
extraProps: function (params) {
|
|
43
42
|
return {
|
|
44
43
|
UserConsent: createUserConsentAPI(params)
|
package/es/factory/node.js
CHANGED
|
@@ -9,9 +9,9 @@ import { sdkClientMethodFactory } from '@splitsoftware/splitio-commons/esm/sdkCl
|
|
|
9
9
|
import { impressionObserverSSFactory } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/impressionObserverSS';
|
|
10
10
|
import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory';
|
|
11
11
|
import { CONSUMER_MODE, LOCALHOST_MODE } from '@splitsoftware/splitio-commons/esm/utils/constants';
|
|
12
|
-
import { shouldAddPt } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/utils';
|
|
13
12
|
import { settingsFactory } from '../settings/node';
|
|
14
13
|
import { platform, SignalListener } from '../platform';
|
|
14
|
+
import { bloomFilterFactory } from '../platform/filter/bloomFilter';
|
|
15
15
|
var syncManagerOnlineSSFactory = syncManagerOnlineFactory(pollingManagerSSFactory, pushManagerFactory);
|
|
16
16
|
function getStorage(settings) {
|
|
17
17
|
return settings.storage.type === 'REDIS' ?
|
|
@@ -32,7 +32,8 @@ function getModules(settings) {
|
|
|
32
32
|
sdkManagerFactory: sdkManagerFactory,
|
|
33
33
|
sdkClientMethodFactory: sdkClientMethodFactory,
|
|
34
34
|
SignalListener: SignalListener,
|
|
35
|
-
impressionsObserverFactory:
|
|
35
|
+
impressionsObserverFactory: impressionObserverSSFactory,
|
|
36
|
+
filterAdapterFactory: bloomFilterFactory
|
|
36
37
|
};
|
|
37
38
|
switch (settings.mode) {
|
|
38
39
|
case LOCALHOST_MODE:
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BloomFilter } from '@ably/bloomit';
|
|
2
|
+
var EXPECTED_INSERTIONS = 10000000;
|
|
3
|
+
var ERROR_RATE = 0.01;
|
|
4
|
+
var REFRESH_RATE = 24 * 60 * 60000; // 24HS
|
|
5
|
+
export function bloomFilterFactory(expectedInsertions, errorRate, refreshRate) {
|
|
6
|
+
if (expectedInsertions === void 0) { expectedInsertions = EXPECTED_INSERTIONS; }
|
|
7
|
+
if (errorRate === void 0) { errorRate = ERROR_RATE; }
|
|
8
|
+
if (refreshRate === void 0) { refreshRate = REFRESH_RATE; }
|
|
9
|
+
var filter = BloomFilter.create(expectedInsertions, errorRate);
|
|
10
|
+
return {
|
|
11
|
+
refreshRate: refreshRate,
|
|
12
|
+
add: function (key, value) {
|
|
13
|
+
var data = key + ":" + value;
|
|
14
|
+
if (filter.has(data)) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
filter.add(data);
|
|
18
|
+
return true;
|
|
19
|
+
},
|
|
20
|
+
contains: function (key, value) {
|
|
21
|
+
var data = key + ":" + value;
|
|
22
|
+
return filter.has(data);
|
|
23
|
+
},
|
|
24
|
+
clear: function () {
|
|
25
|
+
filter = BloomFilter.create(expectedInsertions, errorRate);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var packageVersion = '10.21.2-rc.
|
|
1
|
+
export var packageVersion = '10.21.2-rc.5';
|
package/lib/factory/browser.js
CHANGED
|
@@ -14,7 +14,6 @@ var browser_1 = require("@splitsoftware/splitio-commons/cjs/integrations/browser
|
|
|
14
14
|
var storageCS_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/storage/storageCS");
|
|
15
15
|
var sdkFactory_1 = require("@splitsoftware/splitio-commons/cjs/sdkFactory");
|
|
16
16
|
var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
|
|
17
|
-
var utils_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/utils");
|
|
18
17
|
var sdkUserConsent_1 = require("@splitsoftware/splitio-commons/cjs/consent/sdkUserConsent");
|
|
19
18
|
var browser_2 = require("../settings/browser");
|
|
20
19
|
var platform_1 = require("../platform");
|
|
@@ -41,7 +40,7 @@ function getModules(settings) {
|
|
|
41
40
|
sdkClientMethodFactory: sdkClientMethodCSWithTT_1.sdkClientMethodCSFactory,
|
|
42
41
|
SignalListener: platform_1.SignalListener,
|
|
43
42
|
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? browser_1.integrationsManagerFactory.bind(null, settings.integrations) : undefined,
|
|
44
|
-
impressionsObserverFactory:
|
|
43
|
+
impressionsObserverFactory: impressionObserverCS_1.impressionObserverCSFactory,
|
|
45
44
|
extraProps: function (params) {
|
|
46
45
|
return {
|
|
47
46
|
UserConsent: (0, sdkUserConsent_1.createUserConsentAPI)(params)
|
package/lib/factory/node.js
CHANGED
|
@@ -12,9 +12,9 @@ var sdkClientMethod_1 = require("@splitsoftware/splitio-commons/cjs/sdkClient/sd
|
|
|
12
12
|
var impressionObserverSS_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/impressionObserverSS");
|
|
13
13
|
var sdkFactory_1 = require("@splitsoftware/splitio-commons/cjs/sdkFactory");
|
|
14
14
|
var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
|
|
15
|
-
var utils_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/utils");
|
|
16
15
|
var node_1 = require("../settings/node");
|
|
17
16
|
var platform_1 = require("../platform");
|
|
17
|
+
var bloomFilter_1 = require("../platform/filter/bloomFilter");
|
|
18
18
|
var syncManagerOnlineSSFactory = (0, syncManagerOnline_1.syncManagerOnlineFactory)(pollingManagerSS_1.pollingManagerSSFactory, pushManager_1.pushManagerFactory);
|
|
19
19
|
function getStorage(settings) {
|
|
20
20
|
return settings.storage.type === 'REDIS' ?
|
|
@@ -35,7 +35,8 @@ function getModules(settings) {
|
|
|
35
35
|
sdkManagerFactory: sdkManager_1.sdkManagerFactory,
|
|
36
36
|
sdkClientMethodFactory: sdkClientMethod_1.sdkClientMethodFactory,
|
|
37
37
|
SignalListener: platform_1.SignalListener,
|
|
38
|
-
impressionsObserverFactory:
|
|
38
|
+
impressionsObserverFactory: impressionObserverSS_1.impressionObserverSSFactory,
|
|
39
|
+
filterAdapterFactory: bloomFilter_1.bloomFilterFactory
|
|
39
40
|
};
|
|
40
41
|
switch (settings.mode) {
|
|
41
42
|
case constants_1.LOCALHOST_MODE:
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bloomFilterFactory = void 0;
|
|
4
|
+
var bloomit_1 = require("@ably/bloomit");
|
|
5
|
+
var EXPECTED_INSERTIONS = 10000000;
|
|
6
|
+
var ERROR_RATE = 0.01;
|
|
7
|
+
var REFRESH_RATE = 24 * 60 * 60000; // 24HS
|
|
8
|
+
function bloomFilterFactory(expectedInsertions, errorRate, refreshRate) {
|
|
9
|
+
if (expectedInsertions === void 0) { expectedInsertions = EXPECTED_INSERTIONS; }
|
|
10
|
+
if (errorRate === void 0) { errorRate = ERROR_RATE; }
|
|
11
|
+
if (refreshRate === void 0) { refreshRate = REFRESH_RATE; }
|
|
12
|
+
var filter = bloomit_1.BloomFilter.create(expectedInsertions, errorRate);
|
|
13
|
+
return {
|
|
14
|
+
refreshRate: refreshRate,
|
|
15
|
+
add: function (key, value) {
|
|
16
|
+
var data = key + ":" + value;
|
|
17
|
+
if (filter.has(data)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
filter.add(data);
|
|
21
|
+
return true;
|
|
22
|
+
},
|
|
23
|
+
contains: function (key, value) {
|
|
24
|
+
var data = key + ":" + value;
|
|
25
|
+
return filter.has(data);
|
|
26
|
+
},
|
|
27
|
+
clear: function () {
|
|
28
|
+
filter = bloomit_1.BloomFilter.create(expectedInsertions, errorRate);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
exports.bloomFilterFactory = bloomFilterFactory;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio",
|
|
3
|
-
"version": "10.21.2-rc.
|
|
3
|
+
"version": "10.21.2-rc.5",
|
|
4
4
|
"description": "Split SDK",
|
|
5
5
|
"files": [
|
|
6
6
|
"README.md",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"node": ">=6"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@
|
|
36
|
+
"@ably/bloomit": "^1.4.2",
|
|
37
|
+
"@splitsoftware/splitio-commons": "1.6.2-rc.13",
|
|
37
38
|
"@types/google.analytics": "0.0.40",
|
|
38
39
|
"@types/ioredis": "^4.28.0",
|
|
39
40
|
"ioredis": "^4.28.0",
|
|
@@ -111,6 +112,7 @@
|
|
|
111
112
|
"test-ts-decls": "./scripts/ts-tests.sh",
|
|
112
113
|
"posttest-ts-decls": "npm unlink && npm install",
|
|
113
114
|
"test": "npm run test-node && npm run test-browser",
|
|
115
|
+
"all": "npm run check && npm run build && npm run test-ts-decls && npm run test",
|
|
114
116
|
"publish:rc": "npm run check && npm run build && npm publish --tag canary",
|
|
115
117
|
"publish:stable": "npm run check && npm run build && npm publish"
|
|
116
118
|
},
|
package/src/factory/browser.js
CHANGED
|
@@ -11,7 +11,6 @@ import { integrationsManagerFactory } from '@splitsoftware/splitio-commons/src/i
|
|
|
11
11
|
import { __InLocalStorageMockFactory } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/storage/storageCS';
|
|
12
12
|
import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory';
|
|
13
13
|
import { LOCALHOST_MODE, STORAGE_LOCALSTORAGE } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
14
|
-
import { shouldAddPt } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/utils';
|
|
15
14
|
import { createUserConsentAPI } from '@splitsoftware/splitio-commons/src/consent/sdkUserConsent';
|
|
16
15
|
|
|
17
16
|
import { settingsFactory } from '../settings/browser';
|
|
@@ -52,7 +51,7 @@ function getModules(settings) {
|
|
|
52
51
|
|
|
53
52
|
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? integrationsManagerFactory.bind(null, settings.integrations) : undefined,
|
|
54
53
|
|
|
55
|
-
impressionsObserverFactory:
|
|
54
|
+
impressionsObserverFactory: impressionObserverCSFactory,
|
|
56
55
|
|
|
57
56
|
extraProps: (params) => {
|
|
58
57
|
return {
|
package/src/factory/node.js
CHANGED
|
@@ -9,10 +9,10 @@ import { sdkClientMethodFactory } from '@splitsoftware/splitio-commons/src/sdkCl
|
|
|
9
9
|
import { impressionObserverSSFactory } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/impressionObserverSS';
|
|
10
10
|
import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory';
|
|
11
11
|
import { CONSUMER_MODE, LOCALHOST_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
12
|
-
import { shouldAddPt } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/utils';
|
|
13
12
|
|
|
14
13
|
import { settingsFactory } from '../settings/node';
|
|
15
14
|
import { platform, SignalListener } from '../platform';
|
|
15
|
+
import { bloomFilterFactory } from '../platform/filter/bloomFilter';
|
|
16
16
|
|
|
17
17
|
const syncManagerOnlineSSFactory = syncManagerOnlineFactory(pollingManagerSSFactory, pushManagerFactory);
|
|
18
18
|
|
|
@@ -45,7 +45,9 @@ function getModules(settings) {
|
|
|
45
45
|
|
|
46
46
|
SignalListener,
|
|
47
47
|
|
|
48
|
-
impressionsObserverFactory:
|
|
48
|
+
impressionsObserverFactory: impressionObserverSSFactory,
|
|
49
|
+
|
|
50
|
+
filterAdapterFactory: bloomFilterFactory
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
switch (settings.mode) {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BloomFilter } from '@ably/bloomit';
|
|
2
|
+
|
|
3
|
+
const EXPECTED_INSERTIONS = 10000000;
|
|
4
|
+
const ERROR_RATE = 0.01;
|
|
5
|
+
const REFRESH_RATE = 24 * 60 * 60000; // 24HS
|
|
6
|
+
|
|
7
|
+
export function bloomFilterFactory(expectedInsertions = EXPECTED_INSERTIONS, errorRate = ERROR_RATE, refreshRate = REFRESH_RATE) {
|
|
8
|
+
let filter = BloomFilter.create(expectedInsertions, errorRate);
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
|
|
12
|
+
refreshRate: refreshRate,
|
|
13
|
+
|
|
14
|
+
add(key, value) {
|
|
15
|
+
const data = `${key}:${value}`;
|
|
16
|
+
if (filter.has(data)) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
filter.add(data);
|
|
20
|
+
return true;
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
contains(key, value) {
|
|
24
|
+
const data = `${key}:${value}`;
|
|
25
|
+
return filter.has(data);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
clear() {
|
|
29
|
+
filter = BloomFilter.create(expectedInsertions, errorRate);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = '10.21.2-rc.
|
|
1
|
+
export const packageVersion = '10.21.2-rc.5';
|
package/types/splitio.d.ts
CHANGED
|
@@ -914,7 +914,7 @@ declare namespace SplitIO {
|
|
|
914
914
|
* ImpressionsMode type
|
|
915
915
|
* @typedef {string} ImpressionsMode
|
|
916
916
|
*/
|
|
917
|
-
type ImpressionsMode = 'OPTIMIZED' | 'DEBUG';
|
|
917
|
+
type ImpressionsMode = 'OPTIMIZED' | 'DEBUG' | 'NONE';
|
|
918
918
|
/**
|
|
919
919
|
* User consent status.
|
|
920
920
|
* @typedef {string} ConsentStatus
|