@splitsoftware/splitio-browserjs
Advanced tools
Comparing version 0.3.1-rc.0 to 0.4.0
@@ -0,5 +1,9 @@ | ||
0.4.0 (January 19, 2022) | ||
- 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. | ||
- Updated some transitive dependencies for vulnerability fixes. | ||
0.3.0 (January 11, 2022) | ||
- Added support for the SDK to run in "consumer" and "partial consumer" modes, with a pluggable implementation of it's internal storage, | ||
enabling customers to implement this caching with any storage technology of choice and connect it to the SDK instance to be used instead of | ||
its in-memory storage (Read more in our docs here: https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#advanced-consumer-mode). | ||
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). | ||
- Updated @splitsoftware/splitio-commons dependency to version 1.1.0, which includes: | ||
@@ -6,0 +10,0 @@ - Updated multiple modules due to general polishing and improvements, including the replacement of default exports with named exports, |
@@ -5,3 +5,3 @@ "use strict"; | ||
var index_1 = require("@splitsoftware/splitio-commons/cjs/logger/index"); | ||
var packageVersion = '0.3.1-rc.0'; | ||
var packageVersion = '0.4.0'; | ||
/** | ||
@@ -8,0 +8,0 @@ * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item. |
import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/esm/logger/index'; | ||
var packageVersion = '0.3.1-rc.0'; | ||
var packageVersion = '0.4.0'; | ||
/** | ||
@@ -4,0 +4,0 @@ * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item. |
{ | ||
"name": "@splitsoftware/splitio-browserjs", | ||
"version": "0.3.1-rc.0", | ||
"version": "0.4.0", | ||
"description": "Split SDK for Javascript on Browser", | ||
@@ -64,3 +64,3 @@ "main": "cjs/index.js", | ||
"dependencies": { | ||
"@splitsoftware/splitio-commons": "1.1.1-rc.0", | ||
"@splitsoftware/splitio-commons": "^1.2.0", | ||
"@types/google.analytics": "0.0.40" | ||
@@ -67,0 +67,0 @@ }, |
import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/logger/index'; | ||
import { LogLevel } from '@splitsoftware/splitio-commons/src/types'; | ||
const packageVersion = '0.3.1-rc.0'; | ||
const packageVersion = '0.4.0'; | ||
@@ -6,0 +6,0 @@ /** |
@@ -31,3 +31,3 @@ // Declaration file for Javascript Browser Split Software SDK | ||
* | ||
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#advanced-consumer-mode} | ||
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage} | ||
*/ | ||
@@ -34,0 +34,0 @@ export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory; |
@@ -31,3 +31,3 @@ // Declaration file for Javascript Browser Split Software SDK | ||
* | ||
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#advanced-consumer-mode} | ||
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage} | ||
*/ | ||
@@ -34,0 +34,0 @@ export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory; |
@@ -345,9 +345,14 @@ // Type definitions for Javascript Browser Split Software SDK | ||
* Split attributes should be on object with values of type string or number (dates should be sent as millis since epoch). | ||
* @typedef {Object.<number, string, boolean, string[], number[]>} Attributes | ||
* @typedef {Object.<AttributeType>} Attributes | ||
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#attribute-syntax} | ||
*/ | ||
type Attributes = { | ||
[attributeName: string]: string | number | boolean | Array<string | number> | ||
[attributeName: string]: AttributeType | ||
}; | ||
/** | ||
* Type of an attribute value | ||
* @typedef {string | number | boolean | Array<string | number>} AttributeType | ||
*/ | ||
type AttributeType = string | number | boolean | Array<string | number>; | ||
/** | ||
* Split properties should be an object with values of type string, number, boolean or null. Size limit of ~31kb. | ||
@@ -922,3 +927,3 @@ * @typedef {Object.<number, string, boolean, null>} Attributes | ||
* | ||
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#advanced-consumer-mode} | ||
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage} | ||
* | ||
@@ -1205,40 +1210,42 @@ * @property {'consumer' | 'consumer_partial'} mode | ||
/** | ||
* Add an attribute to client's in memory attributes storage | ||
* @function setAttribute | ||
* Add an attribute to client's in memory attributes storage. | ||
* | ||
* @param {string} attributeName Attrinute name | ||
* @param {string, number, boolean, list} attributeValue Attribute value | ||
* @returns {boolean} true if the attribute was stored and false otherways | ||
* @param {AttributeType} attributeValue Attribute value | ||
* @returns {boolean} true if the attribute was stored and false otherwise | ||
*/ | ||
setAttribute(attributeName: string, attributeValue: Object): boolean, | ||
setAttribute(attributeName: string, attributeValue: AttributeType): boolean, | ||
/** | ||
* Returns the attribute with the given key | ||
* @function getAttribute | ||
* Returns the attribute with the given key. | ||
* | ||
* @param {string} attributeName Attribute name | ||
* @returns {Object} Attribute with the given key | ||
* @returns {AttributeType} Attribute with the given key | ||
*/ | ||
getAttribute(attributeName: string): Object, | ||
getAttribute(attributeName: string): AttributeType, | ||
/** | ||
* Add to client's in memory attributes storage the attributes in 'attributes' | ||
* @function setAttributes | ||
* @param {Object} attributes Object with attributes to store | ||
* @returns true if attributes were stored an false otherways | ||
* Removes from client's in memory attributes storage the attribute with the given key. | ||
* | ||
* @param {string} attributeName | ||
* @returns {boolean} true if attribute was removed and false otherwise | ||
*/ | ||
setAttributes(attributes: Record<string, Object>): boolean, | ||
removeAttribute(attributeName: string): boolean, | ||
/** | ||
* Return all the attributes stored in client's in memory attributes storage | ||
* @function getAttributes | ||
* @returns {Object} returns all the stored attributes | ||
* Add to client's in memory attributes storage the attributes in 'attributes'. | ||
* | ||
* @param {Attributes} attributes Object with attributes to store | ||
* @returns true if attributes were stored an false otherwise | ||
*/ | ||
getAttributes(): Record<string, Object>, | ||
setAttributes(attributes: Attributes): boolean, | ||
/** | ||
* Removes from client's in memory attributes storage the attribute with the given key | ||
* @function removeAttribute | ||
* @param {string} attributeName | ||
* @returns {boolean} true if attribute was removed and false otherways | ||
* Return all the attributes stored in client's in memory attributes storage. | ||
* | ||
* @returns {Attributes} returns all the stored attributes | ||
*/ | ||
removeAttribute(attributeName: string): boolean, | ||
getAttributes(): Attributes, | ||
/** | ||
* Remove all the stored attributes in the client's in memory attribute storage | ||
* Remove all the stored attributes in the client's in memory attribute storage. | ||
* | ||
* @returns {boolean} true if all attribute were removed and false otherwise | ||
*/ | ||
clearAttributes(): any | ||
clearAttributes(): boolean | ||
} | ||
@@ -1293,2 +1300,43 @@ /** | ||
track(trafficType: string, eventType: string, value?: number, properties?: Properties): Promise<boolean>, | ||
/** | ||
* Add an attribute to client's in memory attributes storage. | ||
* | ||
* @param {string} attributeName Attrinute name | ||
* @param {AttributeType} attributeValue Attribute value | ||
* @returns {boolean} true if the attribute was stored and false otherwise | ||
*/ | ||
setAttribute(attributeName: string, attributeValue: AttributeType): boolean, | ||
/** | ||
* Returns the attribute with the given key. | ||
* | ||
* @param {string} attributeName Attribute name | ||
* @returns {AttributeType} Attribute with the given key | ||
*/ | ||
getAttribute(attributeName: string): AttributeType, | ||
/** | ||
* Removes from client's in memory attributes storage the attribute with the given key. | ||
* | ||
* @param {string} attributeName | ||
* @returns {boolean} true if attribute was removed and false otherwise | ||
*/ | ||
removeAttribute(attributeName: string): boolean, | ||
/** | ||
* Add to client's in memory attributes storage the attributes in 'attributes'. | ||
* | ||
* @param {Attributes} attributes Object with attributes to store | ||
* @returns true if attributes were stored an false otherwise | ||
*/ | ||
setAttributes(attributes: Attributes): boolean, | ||
/** | ||
* Return all the attributes stored in client's in memory attributes storage. | ||
* | ||
* @returns {Attributes} returns all the stored attributes | ||
*/ | ||
getAttributes(): Attributes, | ||
/** | ||
* Remove all the stored attributes in the client's in memory attribute storage. | ||
* | ||
* @returns {boolean} true if all attribute were removed and false otherwise | ||
*/ | ||
clearAttributes(): boolean | ||
} | ||
@@ -1295,0 +1343,0 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
117646
2157
8
+ Added@splitsoftware/splitio-commons@1.17.0(transitive)
- Removed@splitsoftware/splitio-commons@1.1.1-rc.0(transitive)