@splitsoftware/splitio 10.17.3-rc.2 → 10.17.3-rc.3
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 +41 -33
- package/es/factory/node.js +41 -36
- package/es/index.js +16 -1
- package/es/platform/EventEmitter.js +300 -326
- package/es/platform/browser.js +4 -4
- package/es/platform/getEventSource/browser.js +2 -2
- package/es/platform/getEventSource/node.js +13 -12
- package/es/platform/getFetch/browser.js +2 -2
- package/es/platform/getFetch/node.js +13 -13
- package/es/platform/node.js +5 -5
- package/es/platform/request/options/node.js +6 -21
- package/es/settings/browser.js +9 -9
- package/es/settings/defaults/browser.js +13 -13
- package/es/settings/defaults/node.js +22 -22
- package/es/settings/defaults/version.js +1 -1
- package/es/settings/integrations/browser.js +3 -3
- package/es/settings/node.js +9 -12
- package/es/settings/storage/browser.js +31 -59
- package/es/settings/storage/node.js +62 -91
- package/es/umd.js +3 -3
- package/lib/factory/browser.js +61 -70
- package/lib/factory/node.js +59 -69
- package/lib/index.js +16 -4
- package/lib/platform/EventEmitter.js +303 -330
- package/lib/platform/browser.js +10 -18
- package/lib/platform/getEventSource/browser.js +5 -6
- package/lib/platform/getEventSource/node.js +18 -19
- package/lib/platform/getFetch/browser.js +7 -10
- package/lib/platform/getFetch/node.js +17 -18
- package/lib/platform/node.js +13 -23
- package/lib/platform/request/options/node.js +12 -31
- package/lib/settings/browser.js +18 -26
- package/lib/settings/defaults/browser.js +15 -19
- package/lib/settings/defaults/node.js +24 -28
- package/lib/settings/defaults/version.js +2 -4
- package/lib/settings/integrations/browser.js +7 -12
- package/lib/settings/node.js +17 -29
- package/lib/settings/storage/browser.js +36 -68
- package/lib/settings/storage/node.js +66 -97
- package/lib/umd.js +3 -8
- package/package.json +23 -28
- package/src/factory/browser.js +10 -1
- package/src/factory/node.js +10 -1
- package/src/index.js +16 -0
- package/src/platform/request/options/node.js +0 -15
- package/src/settings/.DS_Store +0 -0
- package/src/settings/browser.js +2 -0
- package/src/settings/defaults/version.js +1 -1
- package/src/settings/integrations/browser.js +2 -2
- package/src/settings/node.js +2 -3
- package/src/settings/storage/browser.js +0 -16
- package/src/settings/storage/node.js +0 -15
- package/es/settings/integrations/node.js +0 -5
- package/es/settings/runtime/node.js +0 -35
- package/lib/settings/integrations/node.js +0 -12
- package/lib/settings/runtime/node.js +0 -45
- package/src/settings/integrations/node.js +0 -5
- package/src/settings/runtime/node.js +0 -37
package/es/factory/browser.js
CHANGED
|
@@ -15,44 +15,52 @@ import { shouldAddPt } from '@splitsoftware/splitio-commons/esm/trackers/impress
|
|
|
15
15
|
import { settingsFactory } from '../settings/browser';
|
|
16
16
|
import { platform, SignalListener } from '../platform';
|
|
17
17
|
var syncManagerOnlineCSFactory = syncManagerOnlineFactory(pollingManagerCSFactory, pushManagerFactory);
|
|
18
|
-
|
|
19
18
|
function getStorage(settings) {
|
|
20
|
-
|
|
19
|
+
return settings.storage.type === STORAGE_LOCALSTORAGE ?
|
|
20
|
+
InLocalStorage(settings.storage)
|
|
21
|
+
: settings.storage.__originalType === STORAGE_LOCALSTORAGE ?
|
|
22
|
+
__InLocalStorageMockFactory
|
|
23
|
+
: InMemoryStorageCSFactory;
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
26
|
*
|
|
24
27
|
* @param {import("@splitsoftware/splitio-commons/types/types").ISettings} settings
|
|
25
28
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
29
|
function getModules(settings) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
var modules = {
|
|
31
|
+
settings: settings,
|
|
32
|
+
platform: platform,
|
|
33
|
+
storageFactory: getStorage(settings),
|
|
34
|
+
splitApiFactory: splitApiFactory,
|
|
35
|
+
syncManagerFactory: syncManagerOnlineCSFactory,
|
|
36
|
+
sdkManagerFactory: sdkManagerFactory,
|
|
37
|
+
sdkClientMethodFactory: sdkClientMethodCSFactory,
|
|
38
|
+
SignalListener: SignalListener,
|
|
39
|
+
impressionListener: settings.impressionListener,
|
|
40
|
+
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? integrationsManagerFactory.bind(null, settings.integrations) : undefined,
|
|
41
|
+
impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined,
|
|
42
|
+
};
|
|
43
|
+
switch (settings.mode) {
|
|
44
|
+
case LOCALHOST_MODE:
|
|
45
|
+
modules.splitApiFactory = undefined;
|
|
46
|
+
modules.syncManagerFactory = settings.sync.localhostMode;
|
|
47
|
+
modules.SignalListener = undefined;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
return modules;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* SplitFactory for client-side.
|
|
54
|
+
*
|
|
55
|
+
* @param {SplitIO.IBrowserSettings} config configuration object used to instantiate the SDK
|
|
56
|
+
* @param {Function=} __updateModules optional function that lets redefine internal SDK modules. Use with
|
|
57
|
+
* caution since, unlike `config`, this param is not validated neither considered part of the public API.
|
|
58
|
+
* @throws Will throw an error if the provided config is invalid.
|
|
59
|
+
*/
|
|
60
|
+
export function SplitFactory(config, __updateModules) {
|
|
61
|
+
var settings = settingsFactory(config);
|
|
62
|
+
var modules = getModules(settings);
|
|
63
|
+
if (__updateModules)
|
|
64
|
+
__updateModules(modules);
|
|
65
|
+
return sdkFactory(modules);
|
|
52
66
|
}
|
|
53
|
-
|
|
54
|
-
export function SplitFactory(config) {
|
|
55
|
-
var settings = settingsFactory(config);
|
|
56
|
-
var modules = getModules(settings);
|
|
57
|
-
return sdkFactory(modules);
|
|
58
|
-
}
|
package/es/factory/node.js
CHANGED
|
@@ -13,47 +13,52 @@ import { shouldAddPt } from '@splitsoftware/splitio-commons/esm/trackers/impress
|
|
|
13
13
|
import { settingsFactory } from '../settings/node';
|
|
14
14
|
import { platform, SignalListener } from '../platform';
|
|
15
15
|
var syncManagerOnlineSSFactory = syncManagerOnlineFactory(pollingManagerSSFactory, pushManagerFactory);
|
|
16
|
-
|
|
17
16
|
function getStorage(settings) {
|
|
18
|
-
|
|
17
|
+
return settings.storage.type === 'REDIS' ?
|
|
18
|
+
InRedisStorage(settings.storage) :
|
|
19
|
+
InMemoryStorageFactory;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
*
|
|
22
23
|
* @param {import("@splitsoftware/splitio-commons/types/types").ISettings} settings
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
25
|
function getModules(settings) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
26
|
+
var modules = {
|
|
27
|
+
settings: settings,
|
|
28
|
+
platform: platform,
|
|
29
|
+
storageFactory: getStorage(settings),
|
|
30
|
+
splitApiFactory: splitApiFactory,
|
|
31
|
+
syncManagerFactory: syncManagerOnlineSSFactory,
|
|
32
|
+
sdkManagerFactory: sdkManagerFactory,
|
|
33
|
+
sdkClientMethodFactory: sdkClientMethodFactory,
|
|
34
|
+
SignalListener: SignalListener,
|
|
35
|
+
impressionListener: settings.impressionListener,
|
|
36
|
+
impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverSSFactory : undefined,
|
|
37
|
+
};
|
|
38
|
+
switch (settings.mode) {
|
|
39
|
+
case LOCALHOST_MODE:
|
|
40
|
+
modules.splitApiFactory = undefined;
|
|
41
|
+
modules.syncManagerFactory = settings.sync.localhostMode;
|
|
42
|
+
modules.SignalListener = undefined;
|
|
43
|
+
break;
|
|
44
|
+
case CONSUMER_MODE:
|
|
45
|
+
modules.syncManagerFactory = undefined;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
return modules;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* SplitFactory for server-side.
|
|
52
|
+
*
|
|
53
|
+
* @param {SplitIO.INodeSettings | SplitIO.INodeAsyncSettings} config configuration object used to instantiate the SDK
|
|
54
|
+
* @param {Function=} __updateModules optional function that lets redefine internal SDK modules. Use with
|
|
55
|
+
* caution since, unlike `config`, this param is not validated neither considered part of the public API.
|
|
56
|
+
* @throws Will throw an error if the provided config is invalid.
|
|
57
|
+
*/
|
|
58
|
+
export function SplitFactory(config, __updateModules) {
|
|
59
|
+
var settings = settingsFactory(config);
|
|
60
|
+
var modules = getModules(settings);
|
|
61
|
+
if (__updateModules)
|
|
62
|
+
__updateModules(modules);
|
|
63
|
+
return sdkFactory(modules);
|
|
53
64
|
}
|
|
54
|
-
|
|
55
|
-
export function SplitFactory(config) {
|
|
56
|
-
var settings = settingsFactory(config);
|
|
57
|
-
var modules = getModules(settings);
|
|
58
|
-
return sdkFactory(modules);
|
|
59
|
-
}
|
package/es/index.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
Copyright 2022 Split Software
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
**/
|
|
16
|
+
export { SplitFactory } from './factory';
|