@splitsoftware/splitio-browserjs 0.14.1 → 0.15.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 -0
- package/cjs/settings/defaults.js +1 -1
- package/esm/settings/defaults.js +1 -1
- package/package.json +3 -3
- package/src/settings/defaults.ts +1 -1
- package/types/splitio.d.ts +37 -1
package/CHANGES.txt
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
0.15.0 (September 13, 2024)
|
|
2
|
+
- Updated @splitsoftware/splitio-commons package to version 1.17.0 that includes minor updates:
|
|
3
|
+
- Added `sync.requestOptions.getHeaderOverrides` configuration option to enhance SDK HTTP request Headers for Authorization Frameworks.
|
|
4
|
+
- Updated some transitive dependencies for vulnerability fixes.
|
|
5
|
+
|
|
1
6
|
0.14.1 (June 14, 2024)
|
|
2
7
|
- Updated @splitsoftware/splitio-commons package to version 1.16.0 that includes some vulnerability and bug fixes.
|
|
3
8
|
- Bugfixing - Restored some input validation error logs that were removed in version 0.12.0. The logs inform the user when the `getTreatment(s)` methods are called with an invalid value as feature flag name or flag set name.
|
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
|
+
var packageVersion = '0.15.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/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.
|
|
3
|
+
var packageVersion = '0.15.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-browserjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Split SDK for JavaScript on Browser",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
|
|
65
65
|
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@splitsoftware/splitio-commons": "1.
|
|
67
|
+
"@splitsoftware/splitio-commons": "1.17.0",
|
|
68
68
|
"@types/google.analytics": "0.0.40",
|
|
69
69
|
"tslib": "^2.3.1",
|
|
70
70
|
"unfetch": "^4.2.0"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"eslint": "^8.48.0",
|
|
82
82
|
"eslint-plugin-compat": "^4.2.0",
|
|
83
83
|
"eslint-plugin-import": "^2.25.4",
|
|
84
|
-
"fetch-mock": "^
|
|
84
|
+
"fetch-mock": "^11.1.3",
|
|
85
85
|
"jest": "^27.2.3",
|
|
86
86
|
"karma": "^6.4.1",
|
|
87
87
|
"karma-chrome-launcher": "^3.1.1",
|
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
|
+
const packageVersion = '0.15.0';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
package/types/splitio.d.ts
CHANGED
|
@@ -92,7 +92,11 @@ interface ISettings {
|
|
|
92
92
|
splitFilters: SplitIO.SplitFilter[],
|
|
93
93
|
impressionsMode: SplitIO.ImpressionsMode,
|
|
94
94
|
enabled: boolean,
|
|
95
|
-
|
|
95
|
+
flagSpecVersion: string,
|
|
96
|
+
localhostMode?: SplitIO.LocalhostFactory,
|
|
97
|
+
requestOptions?: {
|
|
98
|
+
getHeaderOverrides?: (context: { headers: Record<string, string> }) => Record<string, string>
|
|
99
|
+
},
|
|
96
100
|
},
|
|
97
101
|
readonly userConsent: SplitIO.ConsentStatus
|
|
98
102
|
}
|
|
@@ -252,6 +256,38 @@ interface ISharedSettings {
|
|
|
252
256
|
* @default true
|
|
253
257
|
*/
|
|
254
258
|
enabled?: boolean
|
|
259
|
+
/**
|
|
260
|
+
* Custom options object for HTTP(S) requests in the Browser.
|
|
261
|
+
* If provided, this object is merged with the options object passed by the SDK for EventSource and Fetch calls.
|
|
262
|
+
* This configuration has no effect in "consumer" mode, as no HTTP(S) requests are made by the SDK.
|
|
263
|
+
*/
|
|
264
|
+
requestOptions?: {
|
|
265
|
+
/**
|
|
266
|
+
* Custom function called before each request, allowing you to add or update headers in SDK HTTP requests.
|
|
267
|
+
* Some headers, such as `SplitSDKVersion`, are required by the SDK and cannot be overridden.
|
|
268
|
+
* To pass multiple headers with the same name, combine their values into a single line, separated by commas. Example: `{ 'Authorization': 'value1, value2' }`
|
|
269
|
+
* Or provide keys with different case since headers are case-insensitive. Example: `{ 'authorization': 'value1', 'Authorization': 'value2' }`
|
|
270
|
+
*
|
|
271
|
+
* NOTE: to pass custom headers to the streaming connection in Browser, you should polyfill the `window.EventSource` object with a library that supports headers,
|
|
272
|
+
* like https://www.npmjs.com/package/event-source-polyfill, since native EventSource does not support them and will be ignored.
|
|
273
|
+
*
|
|
274
|
+
* @property getHeaderOverrides
|
|
275
|
+
* @default undefined
|
|
276
|
+
*
|
|
277
|
+
* @param context - The context for the request.
|
|
278
|
+
* @param context.headers - The current headers in the request.
|
|
279
|
+
* @returns A set of headers to be merged with the current headers.
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* const getHeaderOverrides = (context) => {
|
|
283
|
+
* return {
|
|
284
|
+
* 'Authorization': context.headers['Authorization'] + ', other-value',
|
|
285
|
+
* 'custom-header': 'custom-value'
|
|
286
|
+
* };
|
|
287
|
+
* };
|
|
288
|
+
*/
|
|
289
|
+
getHeaderOverrides?: (context: { headers: Record<string, string> }) => Record<string, string>
|
|
290
|
+
},
|
|
255
291
|
}
|
|
256
292
|
}
|
|
257
293
|
/**
|