@splitsoftware/splitio-browserjs 0.3.1-rc.0 → 0.4.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/CHANGES.txt +5 -1
- package/cjs/settings/defaults.js +1 -1
- package/esm/settings/defaults.js +1 -1
- package/package.json +2 -2
- package/src/settings/defaults.ts +1 -1
- package/types/full/index.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/splitio.d.ts +76 -28
package/CHANGES.txt
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
0.4.0 (January 19, 2022)
|
|
2
|
+
- Added support to SDK clients on browser to optionally bind attributes to the client, keeping these loaded within the SDK along with the user ID, for easier usage when requesting flag.
|
|
3
|
+
- Updated some transitive dependencies for vulnerability fixes.
|
|
4
|
+
|
|
1
5
|
0.3.0 (January 11, 2022)
|
|
2
6
|
- Added support for the SDK to run in "consumer" and "partial consumer" modes, with a pluggable implementation of it's internal storage,
|
|
3
7
|
enabling customers to implement this caching with any storage technology of choice and connect it to the SDK instance to be used instead of
|
|
4
|
-
its in-memory storage (Read more in our docs here: https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#
|
|
8
|
+
its in-memory storage (Read more in our docs here: https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage).
|
|
5
9
|
- Updated @splitsoftware/splitio-commons dependency to version 1.1.0, which includes:
|
|
6
10
|
- Updated multiple modules due to general polishing and improvements, including the replacement of default exports with named exports,
|
|
7
11
|
to avoid runtime errors with some particular configurations of Webpack projects.
|
package/cjs/settings/defaults.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
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
|
-
var packageVersion = '0.
|
|
5
|
+
var packageVersion = '0.4.0';
|
|
6
6
|
/**
|
|
7
7
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
8
8
|
* Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
|
package/esm/settings/defaults.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/esm/logger/index';
|
|
2
|
-
var packageVersion = '0.
|
|
2
|
+
var packageVersion = '0.4.0';
|
|
3
3
|
/**
|
|
4
4
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
5
5
|
* 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.
|
|
3
|
+
"version": "0.4.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.
|
|
64
|
+
"@splitsoftware/splitio-commons": "^1.2.0",
|
|
65
65
|
"@types/google.analytics": "0.0.40"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
package/src/settings/defaults.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/logger/index';
|
|
2
2
|
import { LogLevel } from '@splitsoftware/splitio-commons/src/types';
|
|
3
3
|
|
|
4
|
-
const packageVersion = '0.
|
|
4
|
+
const packageVersion = '0.4.0';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
package/types/full/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ declare module JsSdk {
|
|
|
28
28
|
/**
|
|
29
29
|
* Pluggable storage to use the SDK in consumer mode.
|
|
30
30
|
*
|
|
31
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#
|
|
31
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage}
|
|
32
32
|
*/
|
|
33
33
|
export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
|
|
34
34
|
|
package/types/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ declare module JsSdk {
|
|
|
28
28
|
/**
|
|
29
29
|
* Pluggable storage to use the SDK in consumer mode.
|
|
30
30
|
*
|
|
31
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#
|
|
31
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage}
|
|
32
32
|
*/
|
|
33
33
|
export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
|
|
34
34
|
|
package/types/splitio.d.ts
CHANGED
|
@@ -342,12 +342,17 @@ declare namespace SplitIO {
|
|
|
342
342
|
type Event = 'init::timeout' | 'init::ready' | 'init::cache-ready' | 'state::update';
|
|
343
343
|
/**
|
|
344
344
|
* Split attributes should be on object with values of type string or number (dates should be sent as millis since epoch).
|
|
345
|
-
* @typedef {Object.<
|
|
345
|
+
* @typedef {Object.<AttributeType>} Attributes
|
|
346
346
|
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#attribute-syntax}
|
|
347
347
|
*/
|
|
348
348
|
type Attributes = {
|
|
349
|
-
[attributeName: string]:
|
|
349
|
+
[attributeName: string]: AttributeType
|
|
350
350
|
};
|
|
351
|
+
/**
|
|
352
|
+
* Type of an attribute value
|
|
353
|
+
* @typedef {string | number | boolean | Array<string | number>} AttributeType
|
|
354
|
+
*/
|
|
355
|
+
type AttributeType = string | number | boolean | Array<string | number>;
|
|
351
356
|
/**
|
|
352
357
|
* Split properties should be an object with values of type string, number, boolean or null. Size limit of ~31kb.
|
|
353
358
|
* @typedef {Object.<number, string, boolean, null>} Attributes
|
|
@@ -918,7 +923,7 @@ declare namespace SplitIO {
|
|
|
918
923
|
/**
|
|
919
924
|
* The SDK mode. When using `PluggableStorage` as storage, the possible values are "consumer" and "consumer_partial".
|
|
920
925
|
*
|
|
921
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#
|
|
926
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage}
|
|
922
927
|
*
|
|
923
928
|
* @property {'consumer' | 'consumer_partial'} mode
|
|
924
929
|
*/
|
|
@@ -1200,44 +1205,46 @@ declare namespace SplitIO {
|
|
|
1200
1205
|
*/
|
|
1201
1206
|
track(trafficType: string, eventType: string, value?: number, properties?: Properties): boolean,
|
|
1202
1207
|
/**
|
|
1203
|
-
* Add an attribute to client's in memory attributes storage
|
|
1204
|
-
*
|
|
1208
|
+
* Add an attribute to client's in memory attributes storage.
|
|
1209
|
+
*
|
|
1205
1210
|
* @param {string} attributeName Attrinute name
|
|
1206
|
-
* @param {
|
|
1207
|
-
* @returns {boolean} true if the attribute was stored and false
|
|
1211
|
+
* @param {AttributeType} attributeValue Attribute value
|
|
1212
|
+
* @returns {boolean} true if the attribute was stored and false otherwise
|
|
1208
1213
|
*/
|
|
1209
|
-
setAttribute(attributeName: string, attributeValue:
|
|
1214
|
+
setAttribute(attributeName: string, attributeValue: AttributeType): boolean,
|
|
1210
1215
|
/**
|
|
1211
|
-
* Returns the attribute with the given key
|
|
1212
|
-
*
|
|
1216
|
+
* Returns the attribute with the given key.
|
|
1217
|
+
*
|
|
1213
1218
|
* @param {string} attributeName Attribute name
|
|
1214
|
-
* @returns {
|
|
1219
|
+
* @returns {AttributeType} Attribute with the given key
|
|
1215
1220
|
*/
|
|
1216
|
-
getAttribute(attributeName: string):
|
|
1221
|
+
getAttribute(attributeName: string): AttributeType,
|
|
1217
1222
|
/**
|
|
1218
|
-
*
|
|
1219
|
-
*
|
|
1220
|
-
* @param {
|
|
1221
|
-
* @returns true if
|
|
1223
|
+
* Removes from client's in memory attributes storage the attribute with the given key.
|
|
1224
|
+
*
|
|
1225
|
+
* @param {string} attributeName
|
|
1226
|
+
* @returns {boolean} true if attribute was removed and false otherwise
|
|
1222
1227
|
*/
|
|
1223
|
-
|
|
1228
|
+
removeAttribute(attributeName: string): boolean,
|
|
1224
1229
|
/**
|
|
1225
|
-
*
|
|
1226
|
-
*
|
|
1227
|
-
* @
|
|
1230
|
+
* Add to client's in memory attributes storage the attributes in 'attributes'.
|
|
1231
|
+
*
|
|
1232
|
+
* @param {Attributes} attributes Object with attributes to store
|
|
1233
|
+
* @returns true if attributes were stored an false otherwise
|
|
1228
1234
|
*/
|
|
1229
|
-
|
|
1235
|
+
setAttributes(attributes: Attributes): boolean,
|
|
1230
1236
|
/**
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
1233
|
-
* @
|
|
1234
|
-
* @returns {boolean} true if attribute was removed and false otherways
|
|
1237
|
+
* Return all the attributes stored in client's in memory attributes storage.
|
|
1238
|
+
*
|
|
1239
|
+
* @returns {Attributes} returns all the stored attributes
|
|
1235
1240
|
*/
|
|
1236
|
-
|
|
1241
|
+
getAttributes(): Attributes,
|
|
1237
1242
|
/**
|
|
1238
|
-
* Remove all the stored attributes in the client's in memory attribute storage
|
|
1243
|
+
* Remove all the stored attributes in the client's in memory attribute storage.
|
|
1244
|
+
*
|
|
1245
|
+
* @returns {boolean} true if all attribute were removed and false otherwise
|
|
1239
1246
|
*/
|
|
1240
|
-
clearAttributes():
|
|
1247
|
+
clearAttributes(): boolean
|
|
1241
1248
|
}
|
|
1242
1249
|
/**
|
|
1243
1250
|
* This represents the interface for the Client instance with asynchronous storage for client-side SDK, where each client has associated a key.
|
|
@@ -1287,6 +1294,47 @@ declare namespace SplitIO {
|
|
|
1287
1294
|
* @returns {boolean} A promise that resolves to a boolean indicating if the event was added to the queue successfully or not.
|
|
1288
1295
|
*/
|
|
1289
1296
|
track(trafficType: string, eventType: string, value?: number, properties?: Properties): Promise<boolean>,
|
|
1297
|
+
/**
|
|
1298
|
+
* Add an attribute to client's in memory attributes storage.
|
|
1299
|
+
*
|
|
1300
|
+
* @param {string} attributeName Attrinute name
|
|
1301
|
+
* @param {AttributeType} attributeValue Attribute value
|
|
1302
|
+
* @returns {boolean} true if the attribute was stored and false otherwise
|
|
1303
|
+
*/
|
|
1304
|
+
setAttribute(attributeName: string, attributeValue: AttributeType): boolean,
|
|
1305
|
+
/**
|
|
1306
|
+
* Returns the attribute with the given key.
|
|
1307
|
+
*
|
|
1308
|
+
* @param {string} attributeName Attribute name
|
|
1309
|
+
* @returns {AttributeType} Attribute with the given key
|
|
1310
|
+
*/
|
|
1311
|
+
getAttribute(attributeName: string): AttributeType,
|
|
1312
|
+
/**
|
|
1313
|
+
* Removes from client's in memory attributes storage the attribute with the given key.
|
|
1314
|
+
*
|
|
1315
|
+
* @param {string} attributeName
|
|
1316
|
+
* @returns {boolean} true if attribute was removed and false otherwise
|
|
1317
|
+
*/
|
|
1318
|
+
removeAttribute(attributeName: string): boolean,
|
|
1319
|
+
/**
|
|
1320
|
+
* Add to client's in memory attributes storage the attributes in 'attributes'.
|
|
1321
|
+
*
|
|
1322
|
+
* @param {Attributes} attributes Object with attributes to store
|
|
1323
|
+
* @returns true if attributes were stored an false otherwise
|
|
1324
|
+
*/
|
|
1325
|
+
setAttributes(attributes: Attributes): boolean,
|
|
1326
|
+
/**
|
|
1327
|
+
* Return all the attributes stored in client's in memory attributes storage.
|
|
1328
|
+
*
|
|
1329
|
+
* @returns {Attributes} returns all the stored attributes
|
|
1330
|
+
*/
|
|
1331
|
+
getAttributes(): Attributes,
|
|
1332
|
+
/**
|
|
1333
|
+
* Remove all the stored attributes in the client's in memory attribute storage.
|
|
1334
|
+
*
|
|
1335
|
+
* @returns {boolean} true if all attribute were removed and false otherwise
|
|
1336
|
+
*/
|
|
1337
|
+
clearAttributes(): boolean
|
|
1290
1338
|
}
|
|
1291
1339
|
/**
|
|
1292
1340
|
* Representation of a manager instance with synchronous storage of the SDK.
|