@splitsoftware/splitio 10.17.4-rc.1 → 10.17.4-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/CHANGES.txt CHANGED
@@ -1,3 +1,19 @@
1
+ 10.18.0 (March XXX, 2022)
2
+ - Updated internal dependencies to use @splitsoftware/splitio-commons dependency, which includes:
3
+ - Added support for user consent in client-side
4
+ - Added impressionsQueueSize config parameter
5
+ - Update SplitToGa integration ...
6
+ - Update modules to simplify the usage with bundling tools ...
7
+ - Updated dependencies for vulnerability fixes
8
+ - Bugfixing - Logger settings is configurable per factory instance instead of globally.
9
+ - Bugfixing - Wrongly logging warning 'No listeners for SDK Readiness detected' in consumer mode.
10
+ - Added TLS support for Redis
11
+ -
12
+
13
+ 10.17.3 (February 25, 2022)
14
+ - Updated format for MySegments keys in LocalStorage, keeping backwards compatibility (issue https://github.com/splitio/javascript-client/issues/638).
15
+ - Updated some dependencies for vulnerability fixes.
16
+
1
17
  10.17.2 (January 31, 2022)
2
18
  - Updated some dependencies for vulnerability fixes.
3
19
  - Bugfixing - Fixed internal handling of Fetch API promise rejection, to avoid unhandled exceptions on some Web browsers (issue https://github.com/splitio/javascript-client/issues/621)
@@ -8,6 +8,7 @@ import { LocalhostFromObject } from '@splitsoftware/splitio-commons/esm/sync/off
8
8
  import { validateConsent } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/consent';
9
9
  var params = {
10
10
  defaults: defaults,
11
+ isClientSide: true,
11
12
  runtime: validateRuntime,
12
13
  storage: validateStorage,
13
14
  integrations: validateIntegrations,
@@ -1 +1 @@
1
- export var packageVersion = '10.17.4-rc.1';
1
+ export var packageVersion = '10.17.4-rc.2';
@@ -12,7 +12,7 @@ export function validateStorage(settings) {
12
12
  prefix: prefix
13
13
  };
14
14
  }
15
- var host = options.host, port = options.port, db = options.db, pass = options.pass, url = options.url, connectionTimeout = options.connectionTimeout, operationTimeout = options.operationTimeout;
15
+ var host = options.host, port = options.port, db = options.db, pass = options.pass, url = options.url, tls = options.tls, connectionTimeout = options.connectionTimeout, operationTimeout = options.operationTimeout;
16
16
  if (process.env.REDIS_HOST)
17
17
  host = process.env.REDIS_HOST;
18
18
  if (process.env.REDIS_PORT)
@@ -36,6 +36,9 @@ export function validateStorage(settings) {
36
36
  newOpts.db = db;
37
37
  newOpts.pass = pass;
38
38
  }
39
+ if (tls) {
40
+ newOpts.tls = tls;
41
+ }
39
42
  return {
40
43
  type: type,
41
44
  prefix: prefix,
@@ -11,6 +11,7 @@ var LocalhostFromObject_1 = require("@splitsoftware/splitio-commons/cjs/sync/off
11
11
  var consent_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/consent");
12
12
  var params = {
13
13
  defaults: browser_1.defaults,
14
+ isClientSide: true,
14
15
  runtime: runtime_1.validateRuntime,
15
16
  storage: browser_2.validateStorage,
16
17
  integrations: browser_3.validateIntegrations,
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.packageVersion = void 0;
4
- exports.packageVersion = '10.17.4-rc.1';
4
+ exports.packageVersion = '10.17.4-rc.2';
@@ -15,7 +15,7 @@ function validateStorage(settings) {
15
15
  prefix: prefix
16
16
  };
17
17
  }
18
- var host = options.host, port = options.port, db = options.db, pass = options.pass, url = options.url, connectionTimeout = options.connectionTimeout, operationTimeout = options.operationTimeout;
18
+ var host = options.host, port = options.port, db = options.db, pass = options.pass, url = options.url, tls = options.tls, connectionTimeout = options.connectionTimeout, operationTimeout = options.operationTimeout;
19
19
  if (process.env.REDIS_HOST)
20
20
  host = process.env.REDIS_HOST;
21
21
  if (process.env.REDIS_PORT)
@@ -39,6 +39,9 @@ function validateStorage(settings) {
39
39
  newOpts.db = db;
40
40
  newOpts.pass = pass;
41
41
  }
42
+ if (tls) {
43
+ newOpts.tls = tls;
44
+ }
42
45
  return {
43
46
  type: type,
44
47
  prefix: prefix,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio",
3
- "version": "10.17.4-rc.1",
3
+ "version": "10.17.4-rc.2",
4
4
  "description": "Split SDK",
5
5
  "files": [
6
6
  "README.md",
@@ -10,9 +10,7 @@
10
10
  "lib",
11
11
  "types",
12
12
  "es",
13
- "src",
14
- "client",
15
- "server"
13
+ "src"
16
14
  ],
17
15
  "repository": "splitio/javascript-client",
18
16
  "homepage": "https://github.com/splitio/javascript-client#readme",
@@ -34,8 +32,9 @@
34
32
  "node": ">=6"
35
33
  },
36
34
  "dependencies": {
37
- "@splitsoftware/splitio-commons": "1.2.1-rc.8",
35
+ "@splitsoftware/splitio-commons": "1.2.1-rc.9",
38
36
  "@types/google.analytics": "0.0.40",
37
+ "@types/ioredis": "^4.28.0",
39
38
  "ioredis": "^4.28.0",
40
39
  "ip": "1.1.5",
41
40
  "js-yaml": "3.13.1",
@@ -46,7 +45,6 @@
46
45
  "eventsource": "^1.0.7"
47
46
  },
48
47
  "devDependencies": {
49
- "@types/ioredis": "^4.28.0",
50
48
  "@types/node-fetch": "^2.5.12",
51
49
  "copyfiles": "^2.4.1",
52
50
  "cross-env": "^7.0.3",
@@ -9,6 +9,7 @@ import { validateConsent } from '@splitsoftware/splitio-commons/src/utils/settin
9
9
 
10
10
  const params = {
11
11
  defaults,
12
+ isClientSide: true,
12
13
  runtime: validateRuntime,
13
14
  storage: validateStorage,
14
15
  integrations: validateIntegrations,
@@ -1 +1 @@
1
- export const packageVersion = '10.17.4-rc.1';
1
+ export const packageVersion = '10.17.4-rc.2';
@@ -28,6 +28,7 @@ export function validateStorage(settings) {
28
28
  db,
29
29
  pass,
30
30
  url,
31
+ tls,
31
32
  connectionTimeout,
32
33
  operationTimeout
33
34
  } = options;
@@ -56,6 +57,10 @@ export function validateStorage(settings) {
56
57
  newOpts.pass = pass;
57
58
  }
58
59
 
60
+ if (tls) {
61
+ newOpts.tls = tls;
62
+ }
63
+
59
64
  return {
60
65
  type,
61
66
  prefix,
@@ -3,6 +3,7 @@
3
3
  // Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
4
4
 
5
5
  /// <reference types="google.analytics" />
6
+ import { RedisOptions } from "ioredis";
6
7
 
7
8
  export as namespace SplitIO;
8
9
  export = SplitIO;
@@ -337,9 +338,9 @@ interface INodeBasicSettings extends ISharedSettings {
337
338
  type?: StorageType,
338
339
  /**
339
340
  * Options to be passed to the selected storage. Use it with type: 'REDIS'
340
- * @property {Object} options
341
+ * @property {SplitIO.RedisStorageOptions} options
341
342
  */
342
- options?: Object,
343
+ options?: SplitIO.RedisStorageOptions,
343
344
  /**
344
345
  * Optional prefix to prevent any kind of data collision between SDK versions.
345
346
  * @property {string} prefix
@@ -638,6 +639,69 @@ declare namespace SplitIO {
638
639
  * @typedef {string} BrowserStorage
639
640
  */
640
641
  type BrowserStorage = 'MEMORY' | 'LOCALSTORAGE';
642
+ /**
643
+ * Options to be passed to the Redis storage. Use it with storage type: 'REDIS'.
644
+ * @typedef {Object} RedisStorageOptions
645
+ */
646
+ type RedisStorageOptions = {
647
+ /**
648
+ * Redis URL. If set, `host`, `port`, `db` and `pass` params will be ignored.
649
+ *
650
+ * Examples:
651
+ * ```
652
+ * url: 'localhost'
653
+ * url: '127.0.0.1:6379'
654
+ * url: 'redis://:authpassword@127.0.0.1:6379/0'
655
+ * ```
656
+ * @property {string=} url
657
+ */
658
+ url?: string,
659
+ /**
660
+ * Redis host.
661
+ * @property {string=} host
662
+ * @default 'localhost'
663
+ */
664
+ host?: string,
665
+ /**
666
+ * Redis port.
667
+ * @property {number=} port
668
+ * @default 6379
669
+ */
670
+ port?: number,
671
+ /**
672
+ * Redis database to be used.
673
+ * @property {number=} db
674
+ * @default 0
675
+ */
676
+ db?: number,
677
+ /**
678
+ * Redis password. Don't define if no password is used.
679
+ * @property {string=} pass
680
+ * @default undefined
681
+ */
682
+ pass?: string,
683
+ /**
684
+ * The milliseconds before a timeout occurs during the initial connection to the Redis server.
685
+ * @property {number=} connectionTimeout
686
+ * @default 10000
687
+ */
688
+ connectionTimeout?: number,
689
+ /**
690
+ * The milliseconds before Redis commands are timeout by the SDK.
691
+ * Method calls that involve Redis commands, like `client.getTreatment` or `client.track` calls, are resolved when the commands success or timeout.
692
+ * @property {number=} operationTimeout
693
+ * @default 5000
694
+ */
695
+ operationTimeout?: number,
696
+ /**
697
+ * TLS configuration for Redis connection.
698
+ * @see {@link https://www.npmjs.com/package/ioredis#tls-options }
699
+ *
700
+ * @property {Object=} tls
701
+ * @default undefined
702
+ */
703
+ tls?: RedisOptions['tls'],
704
+ }
641
705
  /**
642
706
  * Impression listener interface. This is the interface that needs to be implemented
643
707
  * by the element you provide to the SDK as impression listener.
@@ -1082,9 +1146,9 @@ declare namespace SplitIO {
1082
1146
  type: NodeAsyncStorage,
1083
1147
  /**
1084
1148
  * Options to be passed to the selected storage. Use it with type: 'REDIS'
1085
- * @property {Object} options
1149
+ * @property {SplitIO.RedisStorageOptions} options
1086
1150
  */
1087
- options?: Object,
1151
+ options?: RedisStorageOptions,
1088
1152
  /**
1089
1153
  * Optional prefix to prevent any kind of data collision between SDK versions.
1090
1154
  * @property {string} prefix
@@ -1,5 +0,0 @@
1
- {
2
- "main": "../lib/factory/browser.js",
3
- "module": "../es/factory/browser.js",
4
- "types": "../types/client/index.d.ts"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "main": "../lib/factory/node.js",
3
- "module": "../es/factory/node.js",
4
- "types": "../types/server/index.d.ts"
5
- }
@@ -1,14 +0,0 @@
1
- // Declaration file for Javascript Split Software SDK
2
- // Project: http://www.split.io/
3
-
4
- /// <reference path="../splitio.d.ts" />
5
- export = JsSdk;
6
-
7
- declare module JsSdk {
8
- /**
9
- * Split.io sdk factory function.
10
- * The settings parameter should be an object that complies with the SplitIO.IBrowserSettings.
11
- * For more information read the corresponding article: @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#configuration}
12
- */
13
- export function SplitFactory(settings: SplitIO.IBrowserSettings): SplitIO.IBrowserSDK;
14
- }
@@ -1,20 +0,0 @@
1
- // Declaration file for Javascript Split Software SDK
2
- // Project: http://www.split.io/
3
-
4
- /// <reference path="../splitio.d.ts" />
5
- export = JsSdk;
6
-
7
- declare module JsSdk {
8
- /**
9
- * Split.io sdk factory function.
10
- * The settings parameter should be an object that complies with the SplitIO.INodeAsyncSettings.
11
- * For more information read the corresponding article: @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#configuration}
12
- */
13
- export function SplitFactory(settings: SplitIO.INodeAsyncSettings): SplitIO.IAsyncSDK;
14
- /**
15
- * Split.io sdk factory function.
16
- * The settings parameter should be an object that complies with the SplitIO.INodeSettings.
17
- * For more information read the corresponding article: @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#configuration}
18
- */
19
- export function SplitFactory(settings: SplitIO.INodeSettings): SplitIO.ISDK;
20
- }