@splitsoftware/splitio-browserjs 0.5.0 → 0.5.1-rc.0
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/cjs/full/splitFactory.js +2 -1
- package/cjs/settings/defaults.js +1 -1
- package/cjs/splitFactory.js +2 -1
- package/esm/full/splitFactory.js +2 -1
- package/esm/settings/defaults.js +1 -1
- package/esm/splitFactory.js +2 -1
- package/package.json +2 -2
- package/src/full/splitFactory.ts +3 -2
- package/src/settings/defaults.ts +1 -1
- package/src/splitFactory.ts +3 -2
- package/types/splitio.d.ts +26 -6
package/cjs/full/splitFactory.js
CHANGED
|
@@ -7,7 +7,8 @@ var index_1 = require("@splitsoftware/splitio-commons/cjs/sdkFactory/index");
|
|
|
7
7
|
var getFetchFull_1 = require("../platform/getFetchFull");
|
|
8
8
|
var getEventSource_1 = require("../platform/getEventSource");
|
|
9
9
|
var MinEvents_1 = require("@splitsoftware/splitio-commons/cjs/utils/MinEvents");
|
|
10
|
-
var
|
|
10
|
+
var browser_1 = require("@splitsoftware/splitio-commons/cjs/utils/timeTracker/now/browser");
|
|
11
|
+
var platform = { getFetch: getFetchFull_1.getFetch, getEventSource: getEventSource_1.getEventSource, EventEmitter: MinEvents_1.EventEmitter, now: browser_1.now };
|
|
11
12
|
/**
|
|
12
13
|
* SplitFactory with pluggable modules for Browser.
|
|
13
14
|
* Includes localhost mode and fetch polyfill out-of-the-box.
|
package/cjs/settings/defaults.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.defaults = void 0;
|
|
4
4
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/logger/index");
|
|
5
5
|
var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
|
|
6
|
-
var packageVersion = '0.5.0';
|
|
6
|
+
var packageVersion = '0.5.1-rc.0';
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
9
9
|
* Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
|
package/cjs/splitFactory.js
CHANGED
|
@@ -7,7 +7,8 @@ var index_1 = require("@splitsoftware/splitio-commons/cjs/sdkFactory/index");
|
|
|
7
7
|
var getFetchSlim_1 = require("./platform/getFetchSlim");
|
|
8
8
|
var getEventSource_1 = require("./platform/getEventSource");
|
|
9
9
|
var MinEvents_1 = require("@splitsoftware/splitio-commons/cjs/utils/MinEvents");
|
|
10
|
-
var
|
|
10
|
+
var browser_1 = require("@splitsoftware/splitio-commons/cjs/utils/timeTracker/now/browser");
|
|
11
|
+
var platform = { getFetch: getFetchSlim_1.getFetch, getEventSource: getEventSource_1.getEventSource, EventEmitter: MinEvents_1.EventEmitter, now: browser_1.now };
|
|
11
12
|
/**
|
|
12
13
|
* Slim SplitFactory with pluggable modules for Browser.
|
|
13
14
|
* Doesn't include localhost mode and fetch ponyfill out-of-the-box.
|
package/esm/full/splitFactory.js
CHANGED
|
@@ -4,7 +4,8 @@ import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory/index'
|
|
|
4
4
|
import { getFetch } from '../platform/getFetchFull';
|
|
5
5
|
import { getEventSource } from '../platform/getEventSource';
|
|
6
6
|
import { EventEmitter } from '@splitsoftware/splitio-commons/esm/utils/MinEvents';
|
|
7
|
-
|
|
7
|
+
import { now } from '@splitsoftware/splitio-commons/esm/utils/timeTracker/now/browser';
|
|
8
|
+
var platform = { getFetch: getFetch, getEventSource: getEventSource, EventEmitter: EventEmitter, now: now };
|
|
8
9
|
/**
|
|
9
10
|
* SplitFactory with pluggable modules for Browser.
|
|
10
11
|
* Includes localhost mode and fetch polyfill out-of-the-box.
|
package/esm/settings/defaults.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/esm/logger/index';
|
|
2
2
|
import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/esm/utils/constants';
|
|
3
|
-
var packageVersion = '0.5.0';
|
|
3
|
+
var packageVersion = '0.5.1-rc.0';
|
|
4
4
|
/**
|
|
5
5
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
6
6
|
* Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
|
package/esm/splitFactory.js
CHANGED
|
@@ -4,7 +4,8 @@ import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory/index'
|
|
|
4
4
|
import { getFetch } from './platform/getFetchSlim';
|
|
5
5
|
import { getEventSource } from './platform/getEventSource';
|
|
6
6
|
import { EventEmitter } from '@splitsoftware/splitio-commons/esm/utils/MinEvents';
|
|
7
|
-
|
|
7
|
+
import { now } from '@splitsoftware/splitio-commons/esm/utils/timeTracker/now/browser';
|
|
8
|
+
var platform = { getFetch: getFetch, getEventSource: getEventSource, EventEmitter: EventEmitter, now: now };
|
|
8
9
|
/**
|
|
9
10
|
* Slim SplitFactory with pluggable modules for Browser.
|
|
10
11
|
* Doesn't include localhost mode and fetch ponyfill out-of-the-box.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-browserjs",
|
|
3
|
-
"version": "0.5.0",
|
|
3
|
+
"version": "0.5.1-rc.0",
|
|
4
4
|
"description": "Split SDK for Javascript on Browser",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
|
|
62
62
|
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@splitsoftware/splitio-commons": "1.3.
|
|
64
|
+
"@splitsoftware/splitio-commons": "1.3.2-rc.6",
|
|
65
65
|
"@types/google.analytics": "0.0.40"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
package/src/full/splitFactory.ts
CHANGED
|
@@ -5,8 +5,9 @@ import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory
|
|
|
5
5
|
import { getFetch } from '../platform/getFetchFull';
|
|
6
6
|
import { getEventSource } from '../platform/getEventSource';
|
|
7
7
|
import { EventEmitter } from '@splitsoftware/splitio-commons/src/utils/MinEvents';
|
|
8
|
+
import { now } from '@splitsoftware/splitio-commons/src/utils/timeTracker/now/browser';
|
|
8
9
|
|
|
9
|
-
const platform = { getFetch, getEventSource, EventEmitter };
|
|
10
|
+
const platform = { getFetch, getEventSource, EventEmitter, now };
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* SplitFactory with pluggable modules for Browser.
|
|
@@ -17,7 +18,7 @@ const platform = { getFetch, getEventSource, EventEmitter };
|
|
|
17
18
|
* caution since, unlike `config`, this param is not validated neither considered part of the public API.
|
|
18
19
|
* @throws Will throw an error if the provided config is invalid.
|
|
19
20
|
*/
|
|
20
|
-
export function SplitFactory(config: any, __updateModules
|
|
21
|
+
export function SplitFactory(config: any, __updateModules?: (modules: ISdkFactoryParams) => void) {
|
|
21
22
|
const settings = settingsValidator(config);
|
|
22
23
|
const modules = getModules(settings, platform);
|
|
23
24
|
if (__updateModules) __updateModules(modules);
|
package/src/settings/defaults.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/
|
|
|
2
2
|
import { ConsentStatus, LogLevel } from '@splitsoftware/splitio-commons/src/types';
|
|
3
3
|
import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
4
4
|
|
|
5
|
-
const packageVersion = '0.5.0';
|
|
5
|
+
const packageVersion = '0.5.1-rc.0';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
package/src/splitFactory.ts
CHANGED
|
@@ -5,8 +5,9 @@ import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory
|
|
|
5
5
|
import { getFetch } from './platform/getFetchSlim';
|
|
6
6
|
import { getEventSource } from './platform/getEventSource';
|
|
7
7
|
import { EventEmitter } from '@splitsoftware/splitio-commons/src/utils/MinEvents';
|
|
8
|
+
import { now } from '@splitsoftware/splitio-commons/src/utils/timeTracker/now/browser';
|
|
8
9
|
|
|
9
|
-
const platform = { getFetch, getEventSource, EventEmitter };
|
|
10
|
+
const platform = { getFetch, getEventSource, EventEmitter, now };
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Slim SplitFactory with pluggable modules for Browser.
|
|
@@ -17,7 +18,7 @@ const platform = { getFetch, getEventSource, EventEmitter };
|
|
|
17
18
|
* caution since, unlike `config`, this param is not validated neither considered part of the public API.
|
|
18
19
|
* @throws Will throw an error if the provided config is invalid.
|
|
19
20
|
*/
|
|
20
|
-
export function SplitFactory(config: any, __updateModules
|
|
21
|
+
export function SplitFactory(config: any, __updateModules?: (modules: ISdkFactoryParams) => void) {
|
|
21
22
|
const settings = settingsValidator(config);
|
|
22
23
|
const modules = getModules(settings, platform);
|
|
23
24
|
if (__updateModules) __updateModules(modules);
|
package/types/splitio.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ interface ISettings {
|
|
|
59
59
|
featuresRefreshRate: number,
|
|
60
60
|
impressionsRefreshRate: number,
|
|
61
61
|
impressionsQueueSize: number,
|
|
62
|
+
telemetryRefreshRate: number,
|
|
62
63
|
segmentsRefreshRate: number,
|
|
63
64
|
offlineRefreshRate: number,
|
|
64
65
|
eventsPushRate: number,
|
|
@@ -76,7 +77,8 @@ interface ISettings {
|
|
|
76
77
|
events: string,
|
|
77
78
|
sdk: string,
|
|
78
79
|
auth: string,
|
|
79
|
-
streaming: string
|
|
80
|
+
streaming: string,
|
|
81
|
+
telemetry: string
|
|
80
82
|
},
|
|
81
83
|
readonly integrations?: SplitIO.IntegrationFactory[],
|
|
82
84
|
readonly debug: boolean | LogLevel | SplitIO.ILogger,
|
|
@@ -752,7 +754,13 @@ declare namespace SplitIO {
|
|
|
752
754
|
* @property {string} streaming
|
|
753
755
|
* @default 'https://streaming.split.io'
|
|
754
756
|
*/
|
|
755
|
-
streaming?: string
|
|
757
|
+
streaming?: string,
|
|
758
|
+
/**
|
|
759
|
+
* String property to override the base URL where the SDK will post telemetry data.
|
|
760
|
+
* @property {string} telemetry
|
|
761
|
+
* @default 'https://telemetry.split.io/api'
|
|
762
|
+
*/
|
|
763
|
+
telemetry?: string
|
|
756
764
|
};
|
|
757
765
|
|
|
758
766
|
/**
|
|
@@ -842,10 +850,10 @@ declare namespace SplitIO {
|
|
|
842
850
|
integrations?: IntegrationFactory[],
|
|
843
851
|
/**
|
|
844
852
|
* User consent status. Possible values are `'GRANTED'`, which is the default, `'DECLINED'` or `'UNKNOWN'`.
|
|
845
|
-
* - `'GRANTED'`: the user
|
|
846
|
-
* - `'DECLINED'`: the user
|
|
847
|
-
* - `'UNKNOWN'`: the user
|
|
848
|
-
* them or not if the consent status is updated to 'GRANTED' or 'DECLINED' respectively. The status can be updated at any time with the `
|
|
853
|
+
* - `'GRANTED'`: the user grants consent for tracking events and impressions. The SDK sends them to Split cloud.
|
|
854
|
+
* - `'DECLINED'`: the user declines consent for tracking events and impressions. The SDK does not send them to Split cloud.
|
|
855
|
+
* - `'UNKNOWN'`: the user neither grants nor declines consent for tracking events and impressions. The SDK tracks them in its internal storage, and eventually either sends
|
|
856
|
+
* them or not if the consent status is updated to 'GRANTED' or 'DECLINED' respectively. The status can be updated at any time with the `UserConsent.setStatus` factory method.
|
|
849
857
|
*
|
|
850
858
|
* @typedef {string} userConsent
|
|
851
859
|
* @default 'GRANTED'
|
|
@@ -941,6 +949,12 @@ declare namespace SplitIO {
|
|
|
941
949
|
* @default 30000
|
|
942
950
|
*/
|
|
943
951
|
impressionsQueueSize?: number,
|
|
952
|
+
/**
|
|
953
|
+
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
954
|
+
* @property {number} telemetryRefreshRate
|
|
955
|
+
* @default 3600
|
|
956
|
+
*/
|
|
957
|
+
telemetryRefreshRate?: number,
|
|
944
958
|
/**
|
|
945
959
|
* The SDK polls Split servers for changes to segment definitions. This parameter controls this polling period in seconds.
|
|
946
960
|
* @property {number} segmentsRefreshRate
|
|
@@ -1046,6 +1060,12 @@ declare namespace SplitIO {
|
|
|
1046
1060
|
* @default 30000
|
|
1047
1061
|
*/
|
|
1048
1062
|
impressionsQueueSize?: number,
|
|
1063
|
+
/**
|
|
1064
|
+
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
1065
|
+
* @property {number} telemetryRefreshRate
|
|
1066
|
+
* @default 3600
|
|
1067
|
+
*/
|
|
1068
|
+
telemetryRefreshRate?: number,
|
|
1049
1069
|
/**
|
|
1050
1070
|
* The SDK posts the queued events data in bulks. This parameter controls the posting rate in seconds.
|
|
1051
1071
|
*
|