@splitsoftware/splitio-commons 1.8.2-rc.0 → 1.8.2-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.
Files changed (94) hide show
  1. package/CHANGES.txt +24 -22
  2. package/README.md +1 -1
  3. package/cjs/logger/constants.js +3 -3
  4. package/cjs/logger/messages/debug.js +7 -7
  5. package/cjs/logger/messages/error.js +2 -2
  6. package/cjs/logger/messages/info.js +3 -3
  7. package/cjs/logger/messages/warn.js +7 -7
  8. package/cjs/sdkClient/client.js +20 -20
  9. package/cjs/sdkClient/clientAttributesDecoration.js +8 -8
  10. package/cjs/sdkClient/clientInputValidation.js +10 -10
  11. package/cjs/sdkClient/sdkClient.js +1 -1
  12. package/cjs/sdkFactory/index.js +1 -1
  13. package/cjs/sdkManager/index.js +10 -8
  14. package/cjs/services/splitApi.js +1 -0
  15. package/cjs/services/splitHttpClient.js +1 -1
  16. package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +6 -10
  17. package/cjs/storages/inMemory/SplitsCacheInMemory.js +8 -16
  18. package/cjs/storages/inRedis/SplitsCacheInRedis.js +20 -23
  19. package/cjs/storages/pluggable/SplitsCachePluggable.js +18 -18
  20. package/cjs/sync/polling/updaters/segmentChangesUpdater.js +1 -1
  21. package/cjs/sync/polling/updaters/splitChangesUpdater.js +5 -12
  22. package/cjs/sync/streaming/pushManager.js +1 -1
  23. package/cjs/sync/submitters/telemetrySubmitter.js +2 -2
  24. package/cjs/utils/inputValidation/apiKey.js +26 -25
  25. package/cjs/utils/inputValidation/preloadedData.js +3 -3
  26. package/cjs/utils/inputValidation/split.js +1 -1
  27. package/cjs/utils/inputValidation/splits.js +2 -2
  28. package/cjs/utils/settingsValidation/index.js +1 -1
  29. package/esm/logger/constants.js +2 -2
  30. package/esm/logger/messages/debug.js +7 -7
  31. package/esm/logger/messages/error.js +2 -2
  32. package/esm/logger/messages/info.js +3 -3
  33. package/esm/logger/messages/warn.js +7 -7
  34. package/esm/sdkClient/client.js +20 -20
  35. package/esm/sdkClient/clientAttributesDecoration.js +8 -8
  36. package/esm/sdkClient/clientInputValidation.js +10 -10
  37. package/esm/sdkClient/sdkClient.js +1 -1
  38. package/esm/sdkFactory/index.js +1 -1
  39. package/esm/sdkManager/index.js +10 -8
  40. package/esm/services/splitApi.js +1 -0
  41. package/esm/services/splitHttpClient.js +1 -1
  42. package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +6 -10
  43. package/esm/storages/inMemory/SplitsCacheInMemory.js +8 -16
  44. package/esm/storages/inRedis/SplitsCacheInRedis.js +20 -23
  45. package/esm/storages/pluggable/SplitsCachePluggable.js +18 -18
  46. package/esm/sync/polling/updaters/segmentChangesUpdater.js +1 -1
  47. package/esm/sync/polling/updaters/splitChangesUpdater.js +5 -12
  48. package/esm/sync/streaming/pushManager.js +1 -1
  49. package/esm/sync/submitters/telemetrySubmitter.js +2 -2
  50. package/esm/utils/inputValidation/apiKey.js +27 -26
  51. package/esm/utils/inputValidation/preloadedData.js +3 -3
  52. package/esm/utils/inputValidation/split.js +1 -1
  53. package/esm/utils/inputValidation/splits.js +2 -2
  54. package/esm/utils/settingsValidation/index.js +1 -1
  55. package/package.json +1 -1
  56. package/src/logger/constants.ts +2 -2
  57. package/src/logger/messages/debug.ts +7 -7
  58. package/src/logger/messages/error.ts +2 -2
  59. package/src/logger/messages/info.ts +3 -3
  60. package/src/logger/messages/warn.ts +7 -7
  61. package/src/sdkClient/client.ts +20 -20
  62. package/src/sdkClient/clientAttributesDecoration.ts +10 -10
  63. package/src/sdkClient/clientInputValidation.ts +10 -10
  64. package/src/sdkClient/sdkClient.ts +3 -3
  65. package/src/sdkFactory/index.ts +1 -1
  66. package/src/sdkManager/index.ts +11 -8
  67. package/src/services/splitApi.ts +1 -0
  68. package/src/services/splitHttpClient.ts +1 -1
  69. package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +6 -10
  70. package/src/storages/inMemory/AttributesCacheInMemory.ts +7 -6
  71. package/src/storages/inMemory/SplitsCacheInMemory.ts +6 -14
  72. package/src/storages/inRedis/SplitsCacheInRedis.ts +19 -20
  73. package/src/storages/pluggable/SplitsCachePluggable.ts +17 -18
  74. package/src/sync/polling/updaters/segmentChangesUpdater.ts +1 -1
  75. package/src/sync/polling/updaters/splitChangesUpdater.ts +6 -12
  76. package/src/sync/streaming/pushManager.ts +1 -1
  77. package/src/sync/submitters/telemetrySubmitter.ts +2 -2
  78. package/src/types.ts +147 -140
  79. package/src/utils/inputValidation/apiKey.ts +25 -24
  80. package/src/utils/inputValidation/preloadedData.ts +3 -3
  81. package/src/utils/inputValidation/split.ts +1 -1
  82. package/src/utils/inputValidation/splits.ts +1 -1
  83. package/src/utils/settingsValidation/index.ts +1 -1
  84. package/types/logger/constants.d.ts +1 -1
  85. package/types/sdkClient/clientAttributesDecoration.d.ts +7 -7
  86. package/types/storages/inMemory/AttributesCacheInMemory.d.ts +4 -3
  87. package/types/types.d.ts +142 -135
  88. package/types/utils/inputValidation/apiKey.d.ts +5 -5
  89. package/types/utils/inputValidation/sdkKey.d.ts +7 -0
  90. package/types/utils/settingsValidation/index.d.ts +1 -1
  91. package/types/storages/metadataBuilder.d.ts +0 -3
  92. /package/types/storages/inMemory/{uniqueKeysCacheInMemory.d.ts → UniqueKeysCacheInMemory.d.ts} +0 -0
  93. /package/types/storages/inMemory/{uniqueKeysCacheInMemoryCS.d.ts → UniqueKeysCacheInMemoryCS.d.ts} +0 -0
  94. /package/types/storages/inRedis/{uniqueKeysCacheInRedis.d.ts → UniqueKeysCacheInRedis.d.ts} +0 -0
@@ -38,19 +38,15 @@ var SplitsCacheInRedis = /** @class */ (function (_super) {
38
38
  }
39
39
  SplitsCacheInRedis.prototype._decrementCounts = function (split) {
40
40
  var _this = this;
41
- if (split.trafficTypeName) {
42
- var ttKey_1 = this.keys.buildTrafficTypeKey(split.trafficTypeName);
43
- return this.redis.decr(ttKey_1).then(function (count) {
44
- if (count === 0)
45
- return _this.redis.del(ttKey_1);
46
- });
47
- }
41
+ var ttKey = this.keys.buildTrafficTypeKey(split.trafficTypeName);
42
+ return this.redis.decr(ttKey).then(function (count) {
43
+ if (count === 0)
44
+ return _this.redis.del(ttKey);
45
+ });
48
46
  };
49
47
  SplitsCacheInRedis.prototype._incrementCounts = function (split) {
50
- if (split.trafficTypeName) {
51
- var ttKey = this.keys.buildTrafficTypeKey(split.trafficTypeName);
52
- return this.redis.incr(ttKey);
53
- }
48
+ var ttKey = this.keys.buildTrafficTypeKey(split.trafficTypeName);
49
+ return this.redis.incr(ttKey);
54
50
  };
55
51
  /**
56
52
  * Add a given split.
@@ -68,18 +64,19 @@ var SplitsCacheInRedis = /** @class */ (function (_super) {
68
64
  newStringifiedSplit = JSON.stringify(split);
69
65
  }
70
66
  catch (e) {
71
- throw new Error('Error parsing split definition: ' + e);
67
+ throw new Error('Error parsing feature flag definition: ' + e);
72
68
  }
73
- return Promise.all([
74
- _this.redis.set(splitKey, newStringifiedSplit),
75
- _this._incrementCounts(split),
76
- // If it's an update, we decrement the traffic type of the existing split,
77
- parsedPreviousSplit && _this._decrementCounts(parsedPreviousSplit)
78
- ]);
79
- }).then(function (_a) {
80
- var status = _a[0];
81
- return status === 'OK';
82
- });
69
+ return _this.redis.set(splitKey, newStringifiedSplit).then(function () {
70
+ // avoid unnecessary increment/decrement operations
71
+ if (parsedPreviousSplit && parsedPreviousSplit.trafficTypeName === split.trafficTypeName)
72
+ return;
73
+ // update traffic type counts
74
+ return _this._incrementCounts(split).then(function () {
75
+ if (parsedPreviousSplit)
76
+ return _this._decrementCounts(parsedPreviousSplit);
77
+ });
78
+ });
79
+ }).then(function () { return true; });
83
80
  };
84
81
  /**
85
82
  * Add a list of splits.
@@ -229,7 +226,7 @@ var SplitsCacheInRedis = /** @class */ (function (_super) {
229
226
  return Promise.resolve(splits);
230
227
  })
231
228
  .catch(function (e) {
232
- _this.log.error(constants_1.LOG_PREFIX + ("Could not grab splits due to an error: " + e + "."));
229
+ _this.log.error(constants_1.LOG_PREFIX + ("Could not grab feature flags due to an error: " + e + "."));
233
230
  return Promise.reject(e);
234
231
  });
235
232
  };
@@ -25,19 +25,15 @@ var SplitsCachePluggable = /** @class */ (function (_super) {
25
25
  }
26
26
  SplitsCachePluggable.prototype._decrementCounts = function (split) {
27
27
  var _this = this;
28
- if (split.trafficTypeName) {
29
- var ttKey_1 = this.keys.buildTrafficTypeKey(split.trafficTypeName);
30
- return this.wrapper.decr(ttKey_1).then(function (count) {
31
- if (count === 0)
32
- return _this.wrapper.del(ttKey_1);
33
- });
34
- }
28
+ var ttKey = this.keys.buildTrafficTypeKey(split.trafficTypeName);
29
+ return this.wrapper.decr(ttKey).then(function (count) {
30
+ if (count === 0)
31
+ return _this.wrapper.del(ttKey);
32
+ });
35
33
  };
36
34
  SplitsCachePluggable.prototype._incrementCounts = function (split) {
37
- if (split.trafficTypeName) {
38
- var ttKey = this.keys.buildTrafficTypeKey(split.trafficTypeName);
39
- return this.wrapper.incr(ttKey);
40
- }
35
+ var ttKey = this.keys.buildTrafficTypeKey(split.trafficTypeName);
36
+ return this.wrapper.incr(ttKey);
41
37
  };
42
38
  /**
43
39
  * Add a given split.
@@ -55,14 +51,18 @@ var SplitsCachePluggable = /** @class */ (function (_super) {
55
51
  stringifiedNewSplit = JSON.stringify(split);
56
52
  }
57
53
  catch (e) {
58
- throw new Error('Error parsing split definition: ' + e);
54
+ throw new Error('Error parsing feature flag definition: ' + e);
59
55
  }
60
- return Promise.all([
61
- _this.wrapper.set(splitKey, stringifiedNewSplit),
62
- _this._incrementCounts(split),
63
- // If it's an update, we decrement the traffic type and segment count of the existing split,
64
- parsedPreviousSplit && _this._decrementCounts(parsedPreviousSplit)
65
- ]);
56
+ return _this.wrapper.set(splitKey, stringifiedNewSplit).then(function () {
57
+ // avoid unnecessary increment/decrement operations
58
+ if (parsedPreviousSplit && parsedPreviousSplit.trafficTypeName === split.trafficTypeName)
59
+ return;
60
+ // update traffic type counts
61
+ return _this._incrementCounts(split).then(function () {
62
+ if (parsedPreviousSplit)
63
+ return _this._decrementCounts(parsedPreviousSplit);
64
+ });
65
+ });
66
66
  }).then(function () { return true; });
67
67
  };
68
68
  /**
@@ -84,7 +84,7 @@ function segmentChangesUpdaterFactory(log, segmentChangesFetcher, segments, read
84
84
  // @TODO although factory status is destroyed, synchronization is not stopped
85
85
  if (readiness)
86
86
  readiness.destroy();
87
- log.error(constants_2.LOG_PREFIX_INSTANTIATION + ": you passed a client-side type authorizationKey, please grab an Api Key from the Split web console that is of type Server-side.");
87
+ log.error(constants_2.LOG_PREFIX_INSTANTIATION + ": you passed a client-side type authorizationKey, please grab an SDK Key from the Split user interface that is of type server-side.");
88
88
  }
89
89
  else {
90
90
  log.warn(constants_2.LOG_PREFIX_SYNC_SEGMENTS + "Error while doing fetch of segments. " + error);
@@ -5,7 +5,6 @@ var sets_1 = require("../../../utils/lang/sets");
5
5
  var timeout_1 = require("../../../utils/promise/timeout");
6
6
  var constants_1 = require("../../../readiness/constants");
7
7
  var constants_2 = require("../../../logger/constants");
8
- var maps_1 = require("../../../utils/lang/maps");
9
8
  // Checks that all registered segments have been fetched (changeNumber !== -1 for every segment).
10
9
  // Returns a promise that could be rejected.
11
10
  // @TODO review together with Segments and MySegments storage APIs
@@ -39,25 +38,19 @@ exports.parseSegments = parseSegments;
39
38
  * Exported for testing purposes.
40
39
  */
41
40
  function computeSplitsMutation(entries) {
42
- var uniqueEntries = new maps_1._Map();
43
- entries.forEach(function (split) {
44
- var prevSplit = uniqueEntries.get(split.name);
45
- if (!prevSplit || prevSplit.changeNumber < split.changeNumber)
46
- uniqueEntries.set(split.name, split);
47
- });
48
41
  var segments = new sets_1._Set();
49
- var computed = { added: [], removed: [], segments: [] };
50
- uniqueEntries.forEach(function (split) {
42
+ var computed = entries.reduce(function (accum, split) {
51
43
  if (split.status === 'ACTIVE') {
52
- computed.added.push([split.name, split]);
44
+ accum.added.push([split.name, split]);
53
45
  parseSegments(split).forEach(function (segmentName) {
54
46
  segments.add(segmentName);
55
47
  });
56
48
  }
57
49
  else {
58
- computed.removed.push(split.name);
50
+ accum.removed.push(split.name);
59
51
  }
60
- });
52
+ return accum;
53
+ }, { added: [], removed: [], segments: [] });
61
54
  computed.segments = (0, sets_1.setToArray)(segments);
62
55
  return computed;
63
56
  }
@@ -113,7 +113,7 @@ function pushManagerFactory(params, pollingManager) {
113
113
  if (disconnected)
114
114
  return;
115
115
  log.error(constants_2.ERROR_STREAMING_AUTH, [error.message]);
116
- // Handle 4XX HTTP errors: 401 (invalid API Key) or 400 (using incorrect API Key, i.e., client-side API Key on server-side)
116
+ // Handle 4XX HTTP errors: 401 (invalid SDK Key) or 400 (using incorrect SDK Key, i.e., client-side SDK Key on server-side)
117
117
  if (error.statusCode >= 400 && error.statusCode < 500) {
118
118
  telemetryTracker.streamingEvent(constants_3.AUTH_REJECTION);
119
119
  pushEmitter.emit(constants_1.PUSH_NONRETRYABLE_ERROR);
@@ -28,8 +28,8 @@ function getActiveFactories() {
28
28
  return Object.keys(apiKey_1.usedKeysMap).length;
29
29
  }
30
30
  function getRedundantActiveFactories() {
31
- return Object.keys(apiKey_1.usedKeysMap).reduce(function (acum, apiKey) {
32
- return acum + apiKey_1.usedKeysMap[apiKey] - 1;
31
+ return Object.keys(apiKey_1.usedKeysMap).reduce(function (acum, sdkKey) {
32
+ return acum + apiKey_1.usedKeysMap[sdkKey] - 1;
33
33
  }, 0);
34
34
  }
35
35
  function getTelemetryConfigStats(mode, storageType) {
@@ -3,51 +3,52 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.releaseApiKey = exports.validateAndTrackApiKey = exports.usedKeysMap = exports.validateApiKey = void 0;
4
4
  var constants_1 = require("../../logger/constants");
5
5
  var lang_1 = require("../lang");
6
- var item = 'api_key';
7
- /** validates the given api key */
8
- function validateApiKey(log, maybeApiKey) {
9
- var apiKey = false;
10
- if (maybeApiKey == undefined) { // eslint-disable-line eqeqeq
6
+ var item = 'sdk_key';
7
+ // @TODO replace ApiKey with SdkKey in function names
8
+ /** validates the given SDK key */
9
+ function validateApiKey(log, maybeSdkKey) {
10
+ var sdkKey = false;
11
+ if (maybeSdkKey == undefined) { // eslint-disable-line eqeqeq
11
12
  log.error(constants_1.ERROR_NULL, [constants_1.LOG_PREFIX_INSTANTIATION, item]);
12
13
  }
13
- else if ((0, lang_1.isString)(maybeApiKey)) {
14
- if (maybeApiKey.length > 0)
15
- apiKey = maybeApiKey;
14
+ else if ((0, lang_1.isString)(maybeSdkKey)) {
15
+ if (maybeSdkKey.length > 0)
16
+ sdkKey = maybeSdkKey;
16
17
  else
17
18
  log.error(constants_1.ERROR_EMPTY, [constants_1.LOG_PREFIX_INSTANTIATION, item]);
18
19
  }
19
20
  else {
20
21
  log.error(constants_1.ERROR_INVALID, [constants_1.LOG_PREFIX_INSTANTIATION, item]);
21
22
  }
22
- return apiKey;
23
+ return sdkKey;
23
24
  }
24
25
  exports.validateApiKey = validateApiKey;
25
26
  // Exported for telemetry
26
27
  exports.usedKeysMap = {};
27
- /** validates the given api key and also warns if it is in use */
28
- function validateAndTrackApiKey(log, maybeApiKey) {
29
- var apiKey = validateApiKey(log, maybeApiKey);
30
- // If the apiKey is correct, we'll save it as the instance creation should work.
31
- if (apiKey) {
32
- if (!exports.usedKeysMap[apiKey]) {
28
+ /** validates the given SDK key and also warns if it is in use */
29
+ function validateAndTrackApiKey(log, maybeSdkKey) {
30
+ var sdkKey = validateApiKey(log, maybeSdkKey);
31
+ // If sdkKey is correct, we'll save it as the instance creation should work.
32
+ if (sdkKey) {
33
+ if (!exports.usedKeysMap[sdkKey]) {
33
34
  // If this key is not present, only warning scenarios is that we have factories for other keys.
34
- exports.usedKeysMap[apiKey] = 1;
35
+ exports.usedKeysMap[sdkKey] = 1;
35
36
  if (Object.keys(exports.usedKeysMap).length > 1) {
36
- log.warn(constants_1.WARN_API_KEY, ['an instance of the Split factory']);
37
+ log.warn(constants_1.WARN_SDK_KEY, ['an instance of the Split factory']);
37
38
  }
38
39
  }
39
40
  else {
40
- log.warn(constants_1.WARN_API_KEY, [exports.usedKeysMap[apiKey] + " factory/ies with this API Key"]);
41
- exports.usedKeysMap[apiKey]++;
41
+ log.warn(constants_1.WARN_SDK_KEY, [exports.usedKeysMap[sdkKey] + " factory/ies with this SDK Key"]);
42
+ exports.usedKeysMap[sdkKey]++;
42
43
  }
43
44
  }
44
- return apiKey;
45
+ return sdkKey;
45
46
  }
46
47
  exports.validateAndTrackApiKey = validateAndTrackApiKey;
47
- function releaseApiKey(apiKey) {
48
- if (exports.usedKeysMap[apiKey])
49
- exports.usedKeysMap[apiKey]--;
50
- if (exports.usedKeysMap[apiKey] === 0)
51
- delete exports.usedKeysMap[apiKey];
48
+ function releaseApiKey(sdkKey) {
49
+ if (exports.usedKeysMap[sdkKey])
50
+ exports.usedKeysMap[sdkKey]--;
51
+ if (exports.usedKeysMap[sdkKey] === 0)
52
+ delete exports.usedKeysMap[sdkKey];
52
53
  }
53
54
  exports.releaseApiKey = releaseApiKey;
@@ -13,12 +13,12 @@ function validateSplitsData(log, maybeSplitsData, method) {
13
13
  if ((0, lang_1.isObject)(maybeSplitsData)) {
14
14
  var splitNames = Object.keys(maybeSplitsData);
15
15
  if (splitNames.length === 0)
16
- log.warn(method + ": preloadedData.splitsData doesn't contain split definitions.");
16
+ log.warn(method + ": preloadedData.splitsData doesn't contain feature flag definitions.");
17
17
  // @TODO in the future, consider handling the possibility of having parsed definitions of splits
18
18
  if (splitNames.every(function (splitName) { return (0, split_1.validateSplit)(log, splitName, method) && (0, lang_1.isString)(maybeSplitsData[splitName]); }))
19
19
  return true;
20
20
  }
21
- log.error(method + ": preloadedData.splitsData must be a map of split names to their serialized definitions.");
21
+ log.error(method + ": preloadedData.splitsData must be a map of feature flag names to their stringified definitions.");
22
22
  return false;
23
23
  }
24
24
  function validateMySegmentsData(log, maybeMySegmentsData, method) {
@@ -40,7 +40,7 @@ function validateSegmentsData(log, maybeSegmentsData, method) {
40
40
  if (segmentNames.every(function (segmentName) { return (0, lang_1.isString)(maybeSegmentsData[segmentName]); }))
41
41
  return true;
42
42
  }
43
- log.error(method + ": preloadedData.segmentsData must be a map of segment names to their serialized definitions.");
43
+ log.error(method + ": preloadedData.segmentsData must be a map of segment names to their stringified definitions.");
44
44
  return false;
45
45
  }
46
46
  function validatePreloadedData(log, maybePreloadedData, method) {
@@ -6,7 +6,7 @@ var lang_1 = require("../lang");
6
6
  // include BOM and nbsp
7
7
  var TRIMMABLE_SPACES_REGEX = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/;
8
8
  function validateSplit(log, maybeSplit, method, item) {
9
- if (item === void 0) { item = 'split name'; }
9
+ if (item === void 0) { item = 'feature flag name'; }
10
10
  if (maybeSplit == undefined) { // eslint-disable-line eqeqeq
11
11
  log.error(constants_1.ERROR_NULL, [method, item]);
12
12
  }
@@ -5,8 +5,8 @@ var constants_1 = require("../../logger/constants");
5
5
  var lang_1 = require("../lang");
6
6
  var split_1 = require("./split");
7
7
  function validateSplits(log, maybeSplits, method, listName, item) {
8
- if (listName === void 0) { listName = 'split_names'; }
9
- if (item === void 0) { item = 'split name'; }
8
+ if (listName === void 0) { listName = 'feature flag names'; }
9
+ if (item === void 0) { item = 'feature flag name'; }
10
10
  if (Array.isArray(maybeSplits) && maybeSplits.length > 0) {
11
11
  var validatedArray_1 = [];
12
12
  // Remove invalid values
@@ -84,7 +84,7 @@ function fromSecondsToMillis(n) {
84
84
  }
85
85
  /**
86
86
  * Validates the given config and use it to build a settings object.
87
- * NOTE: it doesn't validate the Api Key. Call `validateApikey` or `validateAndTrackApiKey` for that after settings validation.
87
+ * NOTE: it doesn't validate the SDK Key. Call `validateApiKey` or `validateAndTrackApiKey` for that after settings validation.
88
88
  *
89
89
  * @param config user defined configuration
90
90
  * @param validationParams defaults and fields validators used to validate and creates a settings object from a given config
@@ -92,7 +92,7 @@ export var WARN_INTEGRATION_INVALID = 218;
92
92
  export var WARN_SPLITS_FILTER_IGNORED = 219;
93
93
  export var WARN_SPLITS_FILTER_INVALID = 220;
94
94
  export var WARN_SPLITS_FILTER_EMPTY = 221;
95
- export var WARN_API_KEY = 222;
95
+ export var WARN_SDK_KEY = 222;
96
96
  export var STREAMING_PARSING_MY_SEGMENTS_UPDATE_V2 = 223;
97
97
  export var ERROR_ENGINE_COMBINER_IFELSEIF = 300;
98
98
  export var ERROR_LOGLEVEL_INVALID = 301;
@@ -132,7 +132,7 @@ export var LOG_PREFIX_SYNC = 'sync';
132
132
  export var LOG_PREFIX_SYNC_MANAGER = LOG_PREFIX_SYNC + ':sync-manager: ';
133
133
  export var LOG_PREFIX_SYNC_OFFLINE = LOG_PREFIX_SYNC + ':offline: ';
134
134
  export var LOG_PREFIX_SYNC_STREAMING = LOG_PREFIX_SYNC + ':streaming: ';
135
- export var LOG_PREFIX_SYNC_SPLITS = LOG_PREFIX_SYNC + ':split-changes: ';
135
+ export var LOG_PREFIX_SYNC_SPLITS = LOG_PREFIX_SYNC + ':featureflag-changes: ';
136
136
  export var LOG_PREFIX_SYNC_SEGMENTS = LOG_PREFIX_SYNC + ':segment-changes: ';
137
137
  export var LOG_PREFIX_SYNC_MYSEGMENTS = LOG_PREFIX_SYNC + ':my-segments: ';
138
138
  export var LOG_PREFIX_SYNC_POLLING = LOG_PREFIX_SYNC + ':polling-manager: ';
@@ -12,8 +12,8 @@ export var codesDebug = codesInfo.concat([
12
12
  [c.ENGINE_MATCHER_CONTAINS_ALL, c.LOG_PREFIX_ENGINE_MATCHER + '[containsAllMatcher] %s contains all elements of %s? %s'],
13
13
  [c.ENGINE_MATCHER_CONTAINS_ANY, c.LOG_PREFIX_ENGINE_MATCHER + '[containsAnyMatcher] %s contains at least an element of %s? %s'],
14
14
  [c.ENGINE_MATCHER_CONTAINS_STRING, c.LOG_PREFIX_ENGINE_MATCHER + '[containsStringMatcher] %s contains %s? %s'],
15
- [c.ENGINE_MATCHER_DEPENDENCY, c.LOG_PREFIX_ENGINE_MATCHER + '[dependencyMatcher] parent split "%s" evaluated to "%s" with label "%s". %s evaluated treatment is part of [%s] ? %s.'],
16
- [c.ENGINE_MATCHER_DEPENDENCY_PRE, c.LOG_PREFIX_ENGINE_MATCHER + '[dependencyMatcher] will evaluate parent split: "%s" with key: %s %s'],
15
+ [c.ENGINE_MATCHER_DEPENDENCY, c.LOG_PREFIX_ENGINE_MATCHER + '[dependencyMatcher] parent feature flag "%s" evaluated to "%s" with label "%s". %s evaluated treatment is part of [%s] ? %s.'],
16
+ [c.ENGINE_MATCHER_DEPENDENCY_PRE, c.LOG_PREFIX_ENGINE_MATCHER + '[dependencyMatcher] will evaluate parent feature flag: "%s" with key: %s %s'],
17
17
  [c.ENGINE_MATCHER_EQUAL, c.LOG_PREFIX_ENGINE_MATCHER + '[equalToMatcher] is %s equal to %s? %s'],
18
18
  [c.ENGINE_MATCHER_EQUAL_TO_SET, c.LOG_PREFIX_ENGINE_MATCHER + '[equalToSetMatcher] is %s equal to set %s? %s'],
19
19
  [c.ENGINE_MATCHER_ENDS_WITH, c.LOG_PREFIX_ENGINE_MATCHER + '[endsWithMatcher] %s ends with %s? %s'],
@@ -34,15 +34,15 @@ export var codesDebug = codesInfo.concat([
34
34
  [c.RETRIEVE_CLIENT_EXISTING, 'Retrieving existing SDK client.'],
35
35
  [c.RETRIEVE_MANAGER, 'Retrieving manager instance.'],
36
36
  // synchronizer
37
- [c.SYNC_OFFLINE_DATA, c.LOG_PREFIX_SYNC_OFFLINE + 'Splits data: \n%s'],
38
- [c.SYNC_SPLITS_FETCH, c.LOG_PREFIX_SYNC_SPLITS + 'Spin up split update using since = %s'],
39
- [c.SYNC_SPLITS_NEW, c.LOG_PREFIX_SYNC_SPLITS + 'New splits %s'],
40
- [c.SYNC_SPLITS_REMOVED, c.LOG_PREFIX_SYNC_SPLITS + 'Removed splits %s'],
37
+ [c.SYNC_OFFLINE_DATA, c.LOG_PREFIX_SYNC_OFFLINE + 'Feature flags data: \n%s'],
38
+ [c.SYNC_SPLITS_FETCH, c.LOG_PREFIX_SYNC_SPLITS + 'Spin up feature flags update using since = %s'],
39
+ [c.SYNC_SPLITS_NEW, c.LOG_PREFIX_SYNC_SPLITS + 'New feature flags %s'],
40
+ [c.SYNC_SPLITS_REMOVED, c.LOG_PREFIX_SYNC_SPLITS + 'Removed feature flags %s'],
41
41
  [c.SYNC_SPLITS_SEGMENTS, c.LOG_PREFIX_SYNC_SPLITS + 'Segment names collected %s'],
42
42
  [c.STREAMING_NEW_MESSAGE, c.LOG_PREFIX_SYNC_STREAMING + 'New SSE message received, with data: %s.'],
43
43
  [c.SYNC_TASK_START, c.LOG_PREFIX_SYNC + ': Starting %s. Running each %s millis'],
44
44
  [c.SYNC_TASK_EXECUTE, c.LOG_PREFIX_SYNC + ': Running %s'],
45
45
  [c.SYNC_TASK_STOP, c.LOG_PREFIX_SYNC + ': Stopping %s'],
46
46
  // initialization / settings validation
47
- [c.SETTINGS_SPLITS_FILTER, c.LOG_PREFIX_SETTINGS + ': splits filtering criteria is "%s".']
47
+ [c.SETTINGS_SPLITS_FILTER, c.LOG_PREFIX_SETTINGS + ': feature flags filtering criteria is "%s".']
48
48
  ]);
@@ -1,7 +1,7 @@
1
1
  import * as c from '../constants';
2
2
  export var codesError = [
3
3
  // evaluator
4
- [c.ERROR_ENGINE_COMBINER_IFELSEIF, c.LOG_PREFIX_ENGINE_COMBINER + 'Invalid Split, no valid rules found'],
4
+ [c.ERROR_ENGINE_COMBINER_IFELSEIF, c.LOG_PREFIX_ENGINE_COMBINER + 'Invalid feature flag, no valid rules found'],
5
5
  // SDK
6
6
  [c.ERROR_LOGLEVEL_INVALID, 'logger: Invalid Log Level - No changes to the logs will be applied.'],
7
7
  [c.ERROR_CLIENT_CANNOT_GET_READY, 'The SDK will not get ready. Reason: %s'],
@@ -9,7 +9,7 @@ export var codesError = [
9
9
  [c.ERROR_IMPRESSIONS_LISTENER, c.LOG_PREFIX_IMPRESSIONS_TRACKER + 'Impression listener logImpression method threw: %s.'],
10
10
  [c.ERROR_EVENTS_TRACKER, c.LOG_PREFIX_EVENTS_TRACKER + 'Failed to queue %s'],
11
11
  // synchronizer
12
- [c.ERROR_SYNC_OFFLINE_LOADING, c.LOG_PREFIX_SYNC_OFFLINE + 'There was an issue loading the mock Splits data, no changes will be applied to the current cache. %s'],
12
+ [c.ERROR_SYNC_OFFLINE_LOADING, c.LOG_PREFIX_SYNC_OFFLINE + 'There was an issue loading the mock feature flags data. No changes will be applied to the current cache. %s'],
13
13
  [c.ERROR_STREAMING_SSE, c.LOG_PREFIX_SYNC_STREAMING + 'Failed to connect or error on streaming connection, with error message: %s'],
14
14
  [c.ERROR_STREAMING_AUTH, c.LOG_PREFIX_SYNC_STREAMING + 'Failed to authenticate for streaming. Error: %s.'],
15
15
  [c.ERROR_HTTP, 'Response status is not OK. Status: %s. URL: %s. Message: %s'],
@@ -6,7 +6,7 @@ export var codesInfo = codesWarn.concat([
6
6
  [c.CLIENT_READY_FROM_CACHE, READY_MSG + ' from cache'],
7
7
  [c.CLIENT_READY, READY_MSG],
8
8
  // SDK
9
- [c.IMPRESSION, c.LOG_PREFIX_IMPRESSIONS_TRACKER + 'Split: %s. Key: %s. Evaluation: %s. Label: %s'],
9
+ [c.IMPRESSION, c.LOG_PREFIX_IMPRESSIONS_TRACKER + 'Feature flag: %s. Key: %s. Evaluation: %s. Label: %s'],
10
10
  [c.IMPRESSION_QUEUEING, c.LOG_PREFIX_IMPRESSIONS_TRACKER + 'Queueing corresponding impression.'],
11
11
  [c.NEW_SHARED_CLIENT, 'New shared client instance created.'],
12
12
  [c.NEW_FACTORY, 'New Split SDK instance created.'],
@@ -19,13 +19,13 @@ export var codesInfo = codesWarn.concat([
19
19
  [c.POLLING_SMART_PAUSING, c.LOG_PREFIX_SYNC_POLLING + 'Turning segments data polling %s.'],
20
20
  [c.POLLING_START, c.LOG_PREFIX_SYNC_POLLING + 'Starting polling'],
21
21
  [c.POLLING_STOP, c.LOG_PREFIX_SYNC_POLLING + 'Stopping polling'],
22
- [c.SYNC_SPLITS_FETCH_RETRY, c.LOG_PREFIX_SYNC_SPLITS + 'Retrying download of splits #%s. Reason: %s'],
22
+ [c.SYNC_SPLITS_FETCH_RETRY, c.LOG_PREFIX_SYNC_SPLITS + 'Retrying download of feature flags #%s. Reason: %s'],
23
23
  [c.SUBMITTERS_PUSH_FULL_QUEUE, c.LOG_PREFIX_SYNC_SUBMITTERS + 'Flushing full %s queue and reseting timer.'],
24
24
  [c.SUBMITTERS_PUSH, c.LOG_PREFIX_SYNC_SUBMITTERS + 'Pushing %s.'],
25
25
  [c.STREAMING_REFRESH_TOKEN, c.LOG_PREFIX_SYNC_STREAMING + 'Refreshing streaming token in %s seconds, and connecting streaming in %s seconds.'],
26
26
  [c.STREAMING_RECONNECT, c.LOG_PREFIX_SYNC_STREAMING + 'Attempting to reconnect streaming in %s seconds.'],
27
27
  [c.STREAMING_CONNECTING, c.LOG_PREFIX_SYNC_STREAMING + 'Connecting streaming.'],
28
- [c.STREAMING_DISABLED, c.LOG_PREFIX_SYNC_STREAMING + 'Streaming is disabled for given Api key. Switching to polling mode.'],
28
+ [c.STREAMING_DISABLED, c.LOG_PREFIX_SYNC_STREAMING + 'Streaming is disabled for given SDK key. Switching to polling mode.'],
29
29
  [c.STREAMING_DISCONNECTING, c.LOG_PREFIX_SYNC_STREAMING + 'Disconnecting streaming.'],
30
30
  [c.SYNC_START_POLLING, c.LOG_PREFIX_SYNC_MANAGER + 'Streaming not available. Starting polling.'],
31
31
  [c.SYNC_CONTINUE_POLLING, c.LOG_PREFIX_SYNC_MANAGER + 'Streaming couldn\'t connect. Continue polling.'],
@@ -6,7 +6,7 @@ export var codesWarn = codesError.concat([
6
6
  [c.ENGINE_VALUE_NO_ATTRIBUTES, c.LOG_PREFIX_ENGINE_VALUE + 'Defined attribute [%s], no attributes received.'],
7
7
  // synchronizer
8
8
  [c.SYNC_MYSEGMENTS_FETCH_RETRY, c.LOG_PREFIX_SYNC_MYSEGMENTS + 'Retrying download of segments #%s. Reason: %s'],
9
- [c.SYNC_SPLITS_FETCH_FAILS, c.LOG_PREFIX_SYNC_SPLITS + 'Error while doing fetch of Splits. %s'],
9
+ [c.SYNC_SPLITS_FETCH_FAILS, c.LOG_PREFIX_SYNC_SPLITS + 'Error while doing fetch of feature flags. %s'],
10
10
  [c.STREAMING_PARSING_ERROR_FAILS, c.LOG_PREFIX_SYNC_STREAMING + 'Error parsing SSE error notification: %s'],
11
11
  [c.STREAMING_PARSING_MESSAGE_FAILS, c.LOG_PREFIX_SYNC_STREAMING + 'Error parsing SSE message notification: %s'],
12
12
  [c.STREAMING_FALLBACK, c.LOG_PREFIX_SYNC_STREAMING + 'Falling back to polling mode. Reason: %s'],
@@ -20,14 +20,14 @@ export var codesWarn = codesError.concat([
20
20
  [c.WARN_TRIMMING_PROPERTIES, '%s: Event has more than 300 properties. Some of them will be trimmed when processed.'],
21
21
  [c.WARN_CONVERTING, '%s: %s "%s" is not of type string, converting.'],
22
22
  [c.WARN_TRIMMING, '%s: %s "%s" has extra whitespace, trimming.'],
23
- [c.WARN_NOT_EXISTENT_SPLIT, '%s: split "%s" does not exist in this environment, please double check what splits exist in the Split web console.'],
23
+ [c.WARN_NOT_EXISTENT_SPLIT, '%s: feature flag "%s" does not exist in this environment. Please double check what feature flags exist in the Split user interface.'],
24
24
  [c.WARN_LOWERCASE_TRAFFIC_TYPE, '%s: traffic_type_name should be all lowercase - converting string to lowercase.'],
25
- [c.WARN_NOT_EXISTENT_TT, '%s: traffic type "%s" does not have any corresponding split in this environment, make sure you\'re tracking your events to a valid traffic type defined in the Split web console.'],
25
+ [c.WARN_NOT_EXISTENT_TT, '%s: traffic type "%s" does not have any corresponding feature flag in this environment, make sure you\'re tracking your events to a valid traffic type defined in the Split user interface.'],
26
26
  // initialization / settings validation
27
27
  [c.WARN_INTEGRATION_INVALID, c.LOG_PREFIX_SETTINGS + ': %s integration item(s) at settings is invalid. %s'],
28
- [c.WARN_SPLITS_FILTER_IGNORED, c.LOG_PREFIX_SETTINGS + ': split filters have been configured but will have no effect if mode is not "%s", since synchronization is being deferred to an external tool.'],
29
- [c.WARN_SPLITS_FILTER_INVALID, c.LOG_PREFIX_SETTINGS + ': split filter at position %s is invalid. It must be an object with a valid filter type ("byName" or "byPrefix") and a list of "values".'],
30
- [c.WARN_SPLITS_FILTER_EMPTY, c.LOG_PREFIX_SETTINGS + ': splitFilters configuration must be a non-empty array of filter objects.'],
31
- [c.WARN_API_KEY, c.LOG_PREFIX_SETTINGS + ': You already have %s. We recommend keeping only one instance of the factory at all times (Singleton pattern) and reusing it throughout your application'],
28
+ [c.WARN_SPLITS_FILTER_IGNORED, c.LOG_PREFIX_SETTINGS + ': feature flag filters have been configured but will have no effect if mode is not "%s", since synchronization is being deferred to an external tool.'],
29
+ [c.WARN_SPLITS_FILTER_INVALID, c.LOG_PREFIX_SETTINGS + ': feature flag filter at position %s is invalid. It must be an object with a valid filter type ("byName" or "byPrefix") and a list of "values".'],
30
+ [c.WARN_SPLITS_FILTER_EMPTY, c.LOG_PREFIX_SETTINGS + ': feature flag filter configuration must be a non-empty array of filter objects.'],
31
+ [c.WARN_SDK_KEY, c.LOG_PREFIX_SETTINGS + ': You already have %s. We recommend keeping only one instance of the factory at all times (Singleton pattern) and reusing it throughout your application'],
32
32
  [c.STREAMING_PARSING_MY_SEGMENTS_UPDATE_V2, c.LOG_PREFIX_SYNC_STREAMING + 'Fetching MySegments due to an error processing %s notification: %s'],
33
33
  ]);
@@ -8,10 +8,10 @@ import { CONTROL, TREATMENT, TREATMENTS, TREATMENT_WITH_CONFIG, TREATMENTS_WITH_
8
8
  import { IMPRESSION, IMPRESSION_QUEUEING } from '../logger/constants';
9
9
  import { isStorageSync } from '../trackers/impressionObserver/utils';
10
10
  var treatmentNotReady = { treatment: CONTROL, label: SDK_NOT_READY };
11
- function treatmentsNotReady(splitNames) {
11
+ function treatmentsNotReady(featureFlagNames) {
12
12
  var evaluations = {};
13
- splitNames.forEach(function (splitName) {
14
- evaluations[splitName] = treatmentNotReady;
13
+ featureFlagNames.forEach(function (featureFlagName) {
14
+ evaluations[featureFlagName] = treatmentNotReady;
15
15
  });
16
16
  return evaluations;
17
17
  }
@@ -21,59 +21,59 @@ function treatmentsNotReady(splitNames) {
21
21
  export function clientFactory(params) {
22
22
  var readinessManager = params.sdkReadinessManager.readinessManager, storage = params.storage, settings = params.settings, impressionsTracker = params.impressionsTracker, eventTracker = params.eventTracker, telemetryTracker = params.telemetryTracker;
23
23
  var log = settings.log, mode = settings.mode;
24
- function getTreatment(key, splitName, attributes, withConfig) {
24
+ function getTreatment(key, featureFlagName, attributes, withConfig) {
25
25
  if (withConfig === void 0) { withConfig = false; }
26
26
  var stopTelemetryTracker = telemetryTracker.trackEval(withConfig ? TREATMENT_WITH_CONFIG : TREATMENT);
27
27
  var wrapUp = function (evaluationResult) {
28
28
  var queue = [];
29
- var treatment = processEvaluation(evaluationResult, splitName, key, attributes, withConfig, "getTreatment" + (withConfig ? 'withConfig' : ''), queue);
29
+ var treatment = processEvaluation(evaluationResult, featureFlagName, key, attributes, withConfig, "getTreatment" + (withConfig ? 'withConfig' : ''), queue);
30
30
  impressionsTracker.track(queue, attributes);
31
31
  stopTelemetryTracker(queue[0] && queue[0].label);
32
32
  return treatment;
33
33
  };
34
34
  var evaluation = readinessManager.isReady() || readinessManager.isReadyFromCache() ?
35
- evaluateFeature(log, key, splitName, attributes, storage) :
35
+ evaluateFeature(log, key, featureFlagName, attributes, storage) :
36
36
  isStorageSync(settings) ? // If the SDK is not ready, treatment may be incorrect due to having splits but not segments data, or storage is not connected
37
37
  treatmentNotReady :
38
38
  Promise.resolve(treatmentNotReady); // Promisify if async
39
39
  return thenable(evaluation) ? evaluation.then(function (res) { return wrapUp(res); }) : wrapUp(evaluation);
40
40
  }
41
- function getTreatmentWithConfig(key, splitName, attributes) {
42
- return getTreatment(key, splitName, attributes, true);
41
+ function getTreatmentWithConfig(key, featureFlagName, attributes) {
42
+ return getTreatment(key, featureFlagName, attributes, true);
43
43
  }
44
- function getTreatments(key, splitNames, attributes, withConfig) {
44
+ function getTreatments(key, featureFlagNames, attributes, withConfig) {
45
45
  if (withConfig === void 0) { withConfig = false; }
46
46
  var stopTelemetryTracker = telemetryTracker.trackEval(withConfig ? TREATMENTS_WITH_CONFIG : TREATMENTS);
47
47
  var wrapUp = function (evaluationResults) {
48
48
  var queue = [];
49
49
  var treatments = {};
50
- Object.keys(evaluationResults).forEach(function (splitName) {
51
- treatments[splitName] = processEvaluation(evaluationResults[splitName], splitName, key, attributes, withConfig, "getTreatments" + (withConfig ? 'withConfig' : ''), queue);
50
+ Object.keys(evaluationResults).forEach(function (featureFlagName) {
51
+ treatments[featureFlagName] = processEvaluation(evaluationResults[featureFlagName], featureFlagName, key, attributes, withConfig, "getTreatments" + (withConfig ? 'withConfig' : ''), queue);
52
52
  });
53
53
  impressionsTracker.track(queue, attributes);
54
54
  stopTelemetryTracker(queue[0] && queue[0].label);
55
55
  return treatments;
56
56
  };
57
57
  var evaluations = readinessManager.isReady() || readinessManager.isReadyFromCache() ?
58
- evaluateFeatures(log, key, splitNames, attributes, storage) :
58
+ evaluateFeatures(log, key, featureFlagNames, attributes, storage) :
59
59
  isStorageSync(settings) ? // If the SDK is not ready, treatment may be incorrect due to having splits but not segments data, or storage is not connected
60
- treatmentsNotReady(splitNames) :
61
- Promise.resolve(treatmentsNotReady(splitNames)); // Promisify if async
60
+ treatmentsNotReady(featureFlagNames) :
61
+ Promise.resolve(treatmentsNotReady(featureFlagNames)); // Promisify if async
62
62
  return thenable(evaluations) ? evaluations.then(function (res) { return wrapUp(res); }) : wrapUp(evaluations);
63
63
  }
64
- function getTreatmentsWithConfig(key, splitNames, attributes) {
65
- return getTreatments(key, splitNames, attributes, true);
64
+ function getTreatmentsWithConfig(key, featureFlagNames, attributes) {
65
+ return getTreatments(key, featureFlagNames, attributes, true);
66
66
  }
67
67
  // Internal function
68
- function processEvaluation(evaluation, splitName, key, attributes, withConfig, invokingMethodName, queue) {
68
+ function processEvaluation(evaluation, featureFlagName, key, attributes, withConfig, invokingMethodName, queue) {
69
69
  var matchingKey = getMatching(key);
70
70
  var bucketingKey = getBucketing(key);
71
71
  var treatment = evaluation.treatment, label = evaluation.label, changeNumber = evaluation.changeNumber, _a = evaluation.config, config = _a === void 0 ? null : _a;
72
- log.info(IMPRESSION, [splitName, matchingKey, treatment, label]);
73
- if (validateSplitExistance(log, readinessManager, splitName, label, invokingMethodName)) {
72
+ log.info(IMPRESSION, [featureFlagName, matchingKey, treatment, label]);
73
+ if (validateSplitExistance(log, readinessManager, featureFlagName, label, invokingMethodName)) {
74
74
  log.info(IMPRESSION_QUEUEING);
75
75
  queue.push({
76
- feature: splitName,
76
+ feature: featureFlagName,
77
77
  keyName: matchingKey,
78
78
  treatment: treatment,
79
79
  time: Date.now(),
@@ -12,17 +12,17 @@ export function clientAttributesDecoration(log, client) {
12
12
  var clientGetTreatments = client.getTreatments;
13
13
  var clientGetTreatmentsWithConfig = client.getTreatmentsWithConfig;
14
14
  var clientTrack = client.track;
15
- function getTreatment(maybeKey, maybeSplit, maybeAttributes) {
16
- return clientGetTreatment(maybeKey, maybeSplit, combineAttributes(maybeAttributes));
15
+ function getTreatment(maybeKey, maybeFeatureFlagName, maybeAttributes) {
16
+ return clientGetTreatment(maybeKey, maybeFeatureFlagName, combineAttributes(maybeAttributes));
17
17
  }
18
- function getTreatmentWithConfig(maybeKey, maybeSplit, maybeAttributes) {
19
- return clientGetTreatmentWithConfig(maybeKey, maybeSplit, combineAttributes(maybeAttributes));
18
+ function getTreatmentWithConfig(maybeKey, maybeFeatureFlagName, maybeAttributes) {
19
+ return clientGetTreatmentWithConfig(maybeKey, maybeFeatureFlagName, combineAttributes(maybeAttributes));
20
20
  }
21
- function getTreatments(maybeKey, maybeSplits, maybeAttributes) {
22
- return clientGetTreatments(maybeKey, maybeSplits, combineAttributes(maybeAttributes));
21
+ function getTreatments(maybeKey, maybeFeatureFlagNames, maybeAttributes) {
22
+ return clientGetTreatments(maybeKey, maybeFeatureFlagNames, combineAttributes(maybeAttributes));
23
23
  }
24
- function getTreatmentsWithConfig(maybeKey, maybeSplits, maybeAttributes) {
25
- return clientGetTreatmentsWithConfig(maybeKey, maybeSplits, combineAttributes(maybeAttributes));
24
+ function getTreatmentsWithConfig(maybeKey, maybeFeatureFlagNames, maybeAttributes) {
25
+ return clientGetTreatmentsWithConfig(maybeKey, maybeFeatureFlagNames, combineAttributes(maybeAttributes));
26
26
  }
27
27
  function track(maybeKey, maybeTT, maybeEvent, maybeEventValue, maybeProperties) {
28
28
  return clientTrack(maybeKey, maybeTT, maybeEvent, maybeEventValue, maybeProperties);