@splitsoftware/splitio-browserjs 0.6.1-rc.1 → 0.6.1-rc.2
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/index.js +3 -1
- package/cjs/full/umd.js +1 -0
- package/cjs/index.js +3 -1
- package/cjs/settings/defaults.js +1 -1
- package/esm/full/index.js +1 -0
- package/esm/full/umd.js +2 -1
- package/esm/index.js +1 -0
- package/esm/settings/defaults.js +1 -1
- package/package.json +2 -2
- package/src/full/index.ts +1 -0
- package/src/full/umd.ts +2 -1
- package/src/index.ts +1 -0
- package/src/settings/defaults.ts +1 -1
- package/types/full/index.d.ts +5 -0
- package/types/index.d.ts +5 -0
- package/types/splitio.d.ts +66 -1
package/cjs/full/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PluggableStorage = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.SplitToGoogleAnalytics = exports.GoogleAnalyticsToSplit = exports.InLocalStorage = exports.SplitFactory = void 0;
|
|
3
|
+
exports.DataLoaderFactory = exports.PluggableStorage = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.SplitToGoogleAnalytics = exports.GoogleAnalyticsToSplit = exports.InLocalStorage = exports.SplitFactory = void 0;
|
|
4
4
|
var splitFactory_1 = require("./splitFactory");
|
|
5
5
|
Object.defineProperty(exports, "SplitFactory", { enumerable: true, get: function () { return splitFactory_1.SplitFactory; } });
|
|
6
6
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/storages/inLocalStorage/index");
|
|
@@ -19,3 +19,5 @@ var DebugLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/D
|
|
|
19
19
|
Object.defineProperty(exports, "DebugLogger", { enumerable: true, get: function () { return DebugLogger_1.DebugLogger; } });
|
|
20
20
|
var pluggable_1 = require("@splitsoftware/splitio-commons/cjs/storages/pluggable");
|
|
21
21
|
Object.defineProperty(exports, "PluggableStorage", { enumerable: true, get: function () { return pluggable_1.PluggableStorage; } });
|
|
22
|
+
var dataLoader_1 = require("@splitsoftware/splitio-commons/cjs/storages/dataLoader");
|
|
23
|
+
Object.defineProperty(exports, "DataLoaderFactory", { enumerable: true, get: function () { return dataLoader_1.DataLoaderFactory; } });
|
package/cjs/full/umd.js
CHANGED
|
@@ -11,5 +11,6 @@ index_1.SplitFactory.ErrorLogger = index_1.ErrorLogger;
|
|
|
11
11
|
index_1.SplitFactory.WarnLogger = index_1.WarnLogger;
|
|
12
12
|
index_1.SplitFactory.InfoLogger = index_1.InfoLogger;
|
|
13
13
|
index_1.SplitFactory.DebugLogger = index_1.DebugLogger;
|
|
14
|
+
index_1.SplitFactory.DataLoaderFactory = index_1.DataLoaderFactory;
|
|
14
15
|
// eslint-disable-next-line import/no-default-export
|
|
15
16
|
exports.default = index_1.SplitFactory;
|
package/cjs/index.js
CHANGED
|
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
**/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.PluggableStorage = exports.LocalhostFromObject = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.SplitToGoogleAnalytics = exports.GoogleAnalyticsToSplit = exports.InLocalStorage = exports.SplitFactory = void 0;
|
|
18
|
+
exports.DataLoaderFactory = exports.PluggableStorage = exports.LocalhostFromObject = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.SplitToGoogleAnalytics = exports.GoogleAnalyticsToSplit = exports.InLocalStorage = exports.SplitFactory = void 0;
|
|
19
19
|
var splitFactory_1 = require("./splitFactory");
|
|
20
20
|
Object.defineProperty(exports, "SplitFactory", { enumerable: true, get: function () { return splitFactory_1.SplitFactory; } });
|
|
21
21
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/storages/inLocalStorage/index");
|
|
@@ -36,3 +36,5 @@ var LocalhostFromObject_1 = require("@splitsoftware/splitio-commons/cjs/sync/off
|
|
|
36
36
|
Object.defineProperty(exports, "LocalhostFromObject", { enumerable: true, get: function () { return LocalhostFromObject_1.LocalhostFromObject; } });
|
|
37
37
|
var pluggable_1 = require("@splitsoftware/splitio-commons/cjs/storages/pluggable");
|
|
38
38
|
Object.defineProperty(exports, "PluggableStorage", { enumerable: true, get: function () { return pluggable_1.PluggableStorage; } });
|
|
39
|
+
var dataLoader_1 = require("@splitsoftware/splitio-commons/cjs/storages/dataLoader");
|
|
40
|
+
Object.defineProperty(exports, "DataLoaderFactory", { enumerable: true, get: function () { return dataLoader_1.DataLoaderFactory; } });
|
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.6.1-rc.
|
|
6
|
+
var packageVersion = '0.6.1-rc.2';
|
|
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/esm/full/index.js
CHANGED
|
@@ -7,3 +7,4 @@ export { WarnLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/Wa
|
|
|
7
7
|
export { InfoLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/InfoLogger';
|
|
8
8
|
export { DebugLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/DebugLogger';
|
|
9
9
|
export { PluggableStorage } from '@splitsoftware/splitio-commons/esm/storages/pluggable';
|
|
10
|
+
export { DataLoaderFactory } from '@splitsoftware/splitio-commons/esm/storages/dataLoader';
|
package/esm/full/umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { SplitFactory, InLocalStorage, GoogleAnalyticsToSplit, SplitToGoogleAnalytics, ErrorLogger, WarnLogger, InfoLogger, DebugLogger } from './index';
|
|
2
|
+
import { SplitFactory, InLocalStorage, GoogleAnalyticsToSplit, SplitToGoogleAnalytics, ErrorLogger, WarnLogger, InfoLogger, DebugLogger, DataLoaderFactory } from './index';
|
|
3
3
|
// Include all pluggable modules as properties to expose at the global `splitio` object
|
|
4
4
|
SplitFactory.SplitFactory = SplitFactory;
|
|
5
5
|
SplitFactory.InLocalStorage = InLocalStorage;
|
|
@@ -9,5 +9,6 @@ SplitFactory.ErrorLogger = ErrorLogger;
|
|
|
9
9
|
SplitFactory.WarnLogger = WarnLogger;
|
|
10
10
|
SplitFactory.InfoLogger = InfoLogger;
|
|
11
11
|
SplitFactory.DebugLogger = DebugLogger;
|
|
12
|
+
SplitFactory.DataLoaderFactory = DataLoaderFactory;
|
|
12
13
|
// eslint-disable-next-line import/no-default-export
|
|
13
14
|
export default SplitFactory;
|
package/esm/index.js
CHANGED
|
@@ -23,3 +23,4 @@ export { InfoLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/In
|
|
|
23
23
|
export { DebugLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/DebugLogger';
|
|
24
24
|
export { LocalhostFromObject } from '@splitsoftware/splitio-commons/esm/sync/offline/LocalhostFromObject';
|
|
25
25
|
export { PluggableStorage } from '@splitsoftware/splitio-commons/esm/storages/pluggable';
|
|
26
|
+
export { DataLoaderFactory } from '@splitsoftware/splitio-commons/esm/storages/dataLoader';
|
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.6.1-rc.
|
|
3
|
+
var packageVersion = '0.6.1-rc.2';
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-browserjs",
|
|
3
|
-
"version": "0.6.1-rc.
|
|
3
|
+
"version": "0.6.1-rc.2",
|
|
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.4.2-rc.
|
|
64
|
+
"@splitsoftware/splitio-commons": "1.4.2-rc.2",
|
|
65
65
|
"@types/google.analytics": "0.0.40"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
package/src/full/index.ts
CHANGED
|
@@ -7,3 +7,4 @@ export { WarnLogger } from '@splitsoftware/splitio-commons/src/logger/browser/Wa
|
|
|
7
7
|
export { InfoLogger } from '@splitsoftware/splitio-commons/src/logger/browser/InfoLogger';
|
|
8
8
|
export { DebugLogger } from '@splitsoftware/splitio-commons/src/logger/browser/DebugLogger';
|
|
9
9
|
export { PluggableStorage } from '@splitsoftware/splitio-commons/src/storages/pluggable';
|
|
10
|
+
export { DataLoaderFactory } from '@splitsoftware/splitio-commons/src/storages/dataLoader';
|
package/src/full/umd.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { SplitFactory, InLocalStorage, GoogleAnalyticsToSplit, SplitToGoogleAnalytics, ErrorLogger, WarnLogger, InfoLogger, DebugLogger } from './index';
|
|
2
|
+
import { SplitFactory, InLocalStorage, GoogleAnalyticsToSplit, SplitToGoogleAnalytics, ErrorLogger, WarnLogger, InfoLogger, DebugLogger, DataLoaderFactory } from './index';
|
|
3
3
|
|
|
4
4
|
// Include all pluggable modules as properties to expose at the global `splitio` object
|
|
5
5
|
SplitFactory.SplitFactory = SplitFactory;
|
|
@@ -10,6 +10,7 @@ SplitFactory.ErrorLogger = ErrorLogger;
|
|
|
10
10
|
SplitFactory.WarnLogger = WarnLogger;
|
|
11
11
|
SplitFactory.InfoLogger = InfoLogger;
|
|
12
12
|
SplitFactory.DebugLogger = DebugLogger;
|
|
13
|
+
SplitFactory.DataLoaderFactory = DataLoaderFactory;
|
|
13
14
|
|
|
14
15
|
// eslint-disable-next-line import/no-default-export
|
|
15
16
|
export default SplitFactory;
|
package/src/index.ts
CHANGED
|
@@ -24,3 +24,4 @@ export { InfoLogger } from '@splitsoftware/splitio-commons/src/logger/browser/In
|
|
|
24
24
|
export { DebugLogger } from '@splitsoftware/splitio-commons/src/logger/browser/DebugLogger';
|
|
25
25
|
export { LocalhostFromObject } from '@splitsoftware/splitio-commons/src/sync/offline/LocalhostFromObject';
|
|
26
26
|
export { PluggableStorage } from '@splitsoftware/splitio-commons/src/storages/pluggable';
|
|
27
|
+
export { DataLoaderFactory } from '@splitsoftware/splitio-commons/src/storages/dataLoader';
|
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.6.1-rc.
|
|
5
|
+
const packageVersion = '0.6.1-rc.2';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
package/types/full/index.d.ts
CHANGED
|
@@ -74,4 +74,9 @@ declare module JsSdk {
|
|
|
74
74
|
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#logging}
|
|
75
75
|
*/
|
|
76
76
|
export function ErrorLogger(): SplitIO.ILogger;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @TODO
|
|
80
|
+
*/
|
|
81
|
+
export function DataLoaderFactory(preloadedData: SplitIO.PreloadedData): SplitIO.DataLoader;
|
|
77
82
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -82,4 +82,9 @@ declare module JsSdk {
|
|
|
82
82
|
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#localhost-mode}
|
|
83
83
|
*/
|
|
84
84
|
export function LocalhostFromObject(): SplitIO.LocalhostFactory;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @TODO
|
|
88
|
+
*/
|
|
89
|
+
export function DataLoaderFactory(preloadedData: SplitIO.PreloadedData): SplitIO.DataLoader;
|
|
85
90
|
}
|
package/types/splitio.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ interface ISettings {
|
|
|
73
73
|
eventsFirstPushWindow: number
|
|
74
74
|
},
|
|
75
75
|
readonly storage?: SplitIO.StorageSyncFactory | SplitIO.StorageAsyncFactory,
|
|
76
|
+
readonly dataLoader?: SplitIO.DataLoader,
|
|
76
77
|
readonly urls: {
|
|
77
78
|
events: string,
|
|
78
79
|
sdk: string,
|
|
@@ -91,7 +92,9 @@ interface ISettings {
|
|
|
91
92
|
readonly sync: {
|
|
92
93
|
splitFilters: SplitIO.SplitFilter[],
|
|
93
94
|
impressionsMode: SplitIO.ImpressionsMode,
|
|
94
|
-
localhostMode?: SplitIO.LocalhostFactory
|
|
95
|
+
localhostMode?: SplitIO.LocalhostFactory,
|
|
96
|
+
enabled?: boolean
|
|
97
|
+
onlySubmitters?: boolean
|
|
95
98
|
},
|
|
96
99
|
readonly userConsent: SplitIO.ConsentStatus
|
|
97
100
|
}
|
|
@@ -242,6 +245,24 @@ interface ISharedSettings {
|
|
|
242
245
|
* @property {Object} localhostMode
|
|
243
246
|
*/
|
|
244
247
|
localhostMode?: SplitIO.LocalhostFactory
|
|
248
|
+
/**
|
|
249
|
+
* Controls the SDK continuous synchronization flags.
|
|
250
|
+
*
|
|
251
|
+
* When `true` a running SDK will process rollout plan updates performed on the UI (default).
|
|
252
|
+
* When false it'll just fetch all data upon init
|
|
253
|
+
*
|
|
254
|
+
* @property {boolean} enabled
|
|
255
|
+
* @default true
|
|
256
|
+
*/
|
|
257
|
+
enabled?: boolean
|
|
258
|
+
/*
|
|
259
|
+
* @TODO
|
|
260
|
+
*
|
|
261
|
+
* False by default.
|
|
262
|
+
* If true and standalone mode, it will DISABLE splits and segments synchronization (i.e., polling and streaming).
|
|
263
|
+
* In consumer and partial consumer mode, it has no effect
|
|
264
|
+
*/
|
|
265
|
+
onlySubmitters?: boolean
|
|
245
266
|
}
|
|
246
267
|
}
|
|
247
268
|
/**
|
|
@@ -532,6 +553,10 @@ declare namespace SplitIO {
|
|
|
532
553
|
*/
|
|
533
554
|
prefix?: string
|
|
534
555
|
}
|
|
556
|
+
/**
|
|
557
|
+
* @TODO
|
|
558
|
+
*/
|
|
559
|
+
type DataLoader = (storage: StorageSync, key?: string) => void
|
|
535
560
|
/**
|
|
536
561
|
* Storage for asynchronous (consumer) SDK.
|
|
537
562
|
* Its interface details are not part of the public API.
|
|
@@ -788,6 +813,42 @@ declare namespace SplitIO {
|
|
|
788
813
|
* @typedef {string} ImpressionsMode
|
|
789
814
|
*/
|
|
790
815
|
type ImpressionsMode = 'OPTIMIZED' | 'DEBUG';
|
|
816
|
+
/**
|
|
817
|
+
* Defines the format of Split data to preload on the factory storage (cache).
|
|
818
|
+
*/
|
|
819
|
+
interface PreloadedData {
|
|
820
|
+
/**
|
|
821
|
+
* Timestamp of the last moment the data was synchronized with Split servers.
|
|
822
|
+
* If this value is older than 10 days ago (expiration time policy), the data is not used to update the storage content.
|
|
823
|
+
* @TODO configurable expiration time policy?
|
|
824
|
+
*/
|
|
825
|
+
lastUpdated: number,
|
|
826
|
+
/**
|
|
827
|
+
* Change number of the preloaded data.
|
|
828
|
+
* If this value is older than the current changeNumber at the storage, the data is not used to update the storage content.
|
|
829
|
+
*/
|
|
830
|
+
since: number,
|
|
831
|
+
/**
|
|
832
|
+
* Map of splits to their serialized definitions.
|
|
833
|
+
*/
|
|
834
|
+
splitsData: {
|
|
835
|
+
[splitName: string]: string
|
|
836
|
+
},
|
|
837
|
+
/**
|
|
838
|
+
* Optional map of user keys to their list of segments.
|
|
839
|
+
* @TODO remove when releasing first version
|
|
840
|
+
*/
|
|
841
|
+
mySegmentsData?: {
|
|
842
|
+
[key: string]: string[]
|
|
843
|
+
},
|
|
844
|
+
/**
|
|
845
|
+
* Optional map of segments to their serialized definitions.
|
|
846
|
+
* This property is ignored if `mySegmentsData` was provided.
|
|
847
|
+
*/
|
|
848
|
+
segmentsData?: {
|
|
849
|
+
[segmentName: string]: string
|
|
850
|
+
},
|
|
851
|
+
}
|
|
791
852
|
/**
|
|
792
853
|
* User consent status.
|
|
793
854
|
* @typedef {string} ConsentStatus
|
|
@@ -893,6 +954,10 @@ declare namespace SplitIO {
|
|
|
893
954
|
* @property {Object} storage
|
|
894
955
|
*/
|
|
895
956
|
storage?: StorageSyncFactory,
|
|
957
|
+
/**
|
|
958
|
+
* @TODO
|
|
959
|
+
*/
|
|
960
|
+
dataLoader?: DataLoader,
|
|
896
961
|
/**
|
|
897
962
|
* SDK Startup settings for the Browser.
|
|
898
963
|
* @property {Object} startup
|