@splitsoftware/splitio 10.17.4-rc.0 → 10.17.4-rc.3

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,20 @@
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
+ - Bugfixing - Updated internal `isObject` util that was returning false negatives on some environment, like Nuxt dev server or Miniflare.
11
+ - Added TLS support for Redis
12
+ -
13
+
14
+ 10.17.3 (February 25, 2022)
15
+ - Updated format for MySegments keys in LocalStorage, keeping backwards compatibility (issue https://github.com/splitio/javascript-client/issues/638).
16
+ - Updated some dependencies for vulnerability fixes.
17
+
1
18
  10.17.2 (January 31, 2022)
2
19
  - Updated some dependencies for vulnerability fixes.
3
20
  - 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
+ acceptKey: true, acceptTT: true,
11
12
  runtime: validateRuntime,
12
13
  storage: validateStorage,
13
14
  integrations: validateIntegrations,
@@ -1 +1 @@
1
- export var packageVersion = '10.17.4-rc.0';
1
+ export var packageVersion = '10.17.4-rc.3';
@@ -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
+ acceptKey: true, acceptTT: 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.0';
4
+ exports.packageVersion = '10.17.4-rc.3';
@@ -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.0",
3
+ "version": "10.17.4-rc.3",
4
4
  "description": "Split SDK",
5
5
  "files": [
6
6
  "README.md",
@@ -32,8 +32,9 @@
32
32
  "node": ">=6"
33
33
  },
34
34
  "dependencies": {
35
- "@splitsoftware/splitio-commons": "1.2.1-rc.8",
35
+ "@splitsoftware/splitio-commons": "1.2.1-rc.10",
36
36
  "@types/google.analytics": "0.0.40",
37
+ "@types/ioredis": "^4.28.0",
37
38
  "ioredis": "^4.28.0",
38
39
  "ip": "1.1.5",
39
40
  "js-yaml": "3.13.1",
@@ -44,7 +45,6 @@
44
45
  "eventsource": "^1.0.7"
45
46
  },
46
47
  "devDependencies": {
47
- "@types/ioredis": "^4.28.0",
48
48
  "@types/node-fetch": "^2.5.12",
49
49
  "copyfiles": "^2.4.1",
50
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
+ acceptKey: true, acceptTT: true, // Client with bound key and optional TT
12
13
  runtime: validateRuntime,
13
14
  storage: validateStorage,
14
15
  integrations: validateIntegrations,
@@ -1 +1 @@
1
- export const packageVersion = '10.17.4-rc.0';
1
+ export const packageVersion = '10.17.4-rc.3';
@@ -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,
@@ -1,8 +1,9 @@
1
- // Type definitions for Javascript and Node Split Software SDK
1
+ // Type definitions for Javascript and NodeJS Split Software SDK
2
2
  // Project: http://www.split.io/
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;
@@ -97,7 +98,7 @@ interface ISettings {
97
98
  readonly debug: boolean | LogLevel,
98
99
  readonly version: string,
99
100
  /**
100
- * Mocked features map if using in browser, or mocked features file path string if using in Node.
101
+ * Mocked features map if using in browser, or mocked features file path string if using in NodeJS.
101
102
  */
102
103
  features: SplitIO.MockedFeaturesMap | SplitIO.MockedFeaturesFilePath,
103
104
  readonly streamingEnabled: boolean,
@@ -106,7 +107,7 @@ interface ISettings {
106
107
  impressionsMode: SplitIO.ImpressionsMode,
107
108
  }
108
109
  /**
109
- * User consent status if using in browser. Undefined if using in Node.
110
+ * User consent status if using in browser. Undefined if using in NodeJS.
110
111
  */
111
112
  readonly userConsent?: SplitIO.ConsentStatus
112
113
  }
@@ -325,7 +326,7 @@ interface INodeBasicSettings extends ISharedSettings {
325
326
  IPAddressesEnabled?: boolean
326
327
  },
327
328
  /**
328
- * Defines which kind of storage we should instanciate.
329
+ * Defines which kind of storage we should instantiate.
329
330
  * @property {Object} storage
330
331
  */
331
332
  storage?: {
@@ -336,7 +337,7 @@ interface INodeBasicSettings extends ISharedSettings {
336
337
  */
337
338
  type?: StorageType,
338
339
  /**
339
- * Options to be passed to the selected storage. Use it with type: 'REDIS'
340
+ * Options to be passed to the selected storage.
340
341
  * @property {Object} options
341
342
  */
342
343
  options?: Object,
@@ -985,7 +986,8 @@ declare namespace SplitIO {
985
986
  */
986
987
  features?: MockedFeaturesMap,
987
988
  /**
988
- * Defines which kind of storage we should instanciate.
989
+ * Defines which kind of storage we can instantiate on the browser.
990
+ * Possible storage types are 'MEMORY', which is the default, and 'LOCALSTORAGE'.
989
991
  * @property {Object} storage
990
992
  */
991
993
  storage?: {
@@ -1040,7 +1042,8 @@ declare namespace SplitIO {
1040
1042
  */
1041
1043
  urls?: UrlSettings,
1042
1044
  /**
1043
- * Defines which kind of storage we should instanciate.
1045
+ * Defines which kind of storage we can instantiate on NodeJS for 'standalone' mode.
1046
+ * The only possible storage type is 'MEMORY', which is the default.
1044
1047
  * @property {Object} storage
1045
1048
  */
1046
1049
  storage?: {
@@ -1074,6 +1077,11 @@ declare namespace SplitIO {
1074
1077
  * @see {@link https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK#configuration}
1075
1078
  */
1076
1079
  interface INodeAsyncSettings extends INodeBasicSettings {
1080
+ /**
1081
+ * Defines which kind of async storage we can instantiate on NodeJS for 'consumer' mode.
1082
+ * The only possible storage type is 'REDIS'.
1083
+ * @property {Object} storage
1084
+ */
1077
1085
  storage: {
1078
1086
  /**
1079
1087
  * 'REDIS' storage type to be instantiated by the SDK.
@@ -1081,10 +1089,68 @@ declare namespace SplitIO {
1081
1089
  */
1082
1090
  type: NodeAsyncStorage,
1083
1091
  /**
1084
- * Options to be passed to the selected storage. Use it with type: 'REDIS'
1092
+ * Options to be passed to the Redis storage. Use it with storage type: 'REDIS'.
1085
1093
  * @property {Object} options
1086
1094
  */
1087
- options?: Object,
1095
+ options?: {
1096
+ /**
1097
+ * Redis URL. If set, `host`, `port`, `db` and `pass` params will be ignored.
1098
+ *
1099
+ * Examples:
1100
+ * ```
1101
+ * url: 'localhost'
1102
+ * url: '127.0.0.1:6379'
1103
+ * url: 'redis://:authpassword@127.0.0.1:6379/0'
1104
+ * ```
1105
+ * @property {string=} url
1106
+ */
1107
+ url?: string,
1108
+ /**
1109
+ * Redis host.
1110
+ * @property {string=} host
1111
+ * @default 'localhost'
1112
+ */
1113
+ host?: string,
1114
+ /**
1115
+ * Redis port.
1116
+ * @property {number=} port
1117
+ * @default 6379
1118
+ */
1119
+ port?: number,
1120
+ /**
1121
+ * Redis database to be used.
1122
+ * @property {number=} db
1123
+ * @default 0
1124
+ */
1125
+ db?: number,
1126
+ /**
1127
+ * Redis password. Don't define if no password is used.
1128
+ * @property {string=} pass
1129
+ * @default undefined
1130
+ */
1131
+ pass?: string,
1132
+ /**
1133
+ * The milliseconds before a timeout occurs during the initial connection to the Redis server.
1134
+ * @property {number=} connectionTimeout
1135
+ * @default 10000
1136
+ */
1137
+ connectionTimeout?: number,
1138
+ /**
1139
+ * The milliseconds before Redis commands are timeout by the SDK.
1140
+ * Method calls that involve Redis commands, like `client.getTreatment` or `client.track` calls, are resolved when the commands success or timeout.
1141
+ * @property {number=} operationTimeout
1142
+ * @default 5000
1143
+ */
1144
+ operationTimeout?: number,
1145
+ /**
1146
+ * TLS configuration for Redis connection.
1147
+ * @see {@link https://www.npmjs.com/package/ioredis#tls-options }
1148
+ *
1149
+ * @property {Object=} tls
1150
+ * @default undefined
1151
+ */
1152
+ tls?: RedisOptions['tls'],
1153
+ },
1088
1154
  /**
1089
1155
  * Optional prefix to prevent any kind of data collision between SDK versions.
1090
1156
  * @property {string} prefix