@splitsoftware/splitio-commons 2.12.0 → 3.0.0-rc.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.
Files changed (309) hide show
  1. package/CHANGES.txt +14 -1
  2. package/cjs/evaluator/condition/engineUtils.js +2 -2
  3. package/cjs/evaluator/fallbackConfigsCalculator/fallbackSanitizer/index.js +70 -0
  4. package/cjs/evaluator/fallbackConfigsCalculator/index.js +25 -0
  5. package/cjs/evaluator/fallbackTreatmentsCalculator/fallbackSanitizer/index.js +5 -8
  6. package/cjs/evaluator/fallbackTreatmentsCalculator/index.js +21 -32
  7. package/cjs/evaluator/index.js +67 -42
  8. package/cjs/evaluator/matchers/whitelist.js +1 -1
  9. package/cjs/integrations/pluggable.js +1 -1
  10. package/cjs/listeners/browser.js +4 -3
  11. package/cjs/listeners/node.js +4 -4
  12. package/cjs/logger/constants.js +14 -20
  13. package/cjs/logger/index.js +1 -1
  14. package/cjs/logger/messages/debug.js +6 -7
  15. package/cjs/logger/messages/error.js +4 -4
  16. package/cjs/logger/messages/info.js +2 -4
  17. package/cjs/logger/messages/warn.js +9 -9
  18. package/cjs/platform/browser.js +15 -0
  19. package/cjs/platform/getEventSource/browser.js +8 -0
  20. package/cjs/platform/getEventSource/eventsource.js +480 -0
  21. package/cjs/platform/getEventSource/node.js +26 -0
  22. package/cjs/platform/getFetch/browser.js +9 -0
  23. package/cjs/platform/getFetch/node.js +27 -0
  24. package/cjs/platform/getOptions/node.js +25 -0
  25. package/cjs/platform/node.js +17 -0
  26. package/cjs/readiness/constants.js +2 -1
  27. package/cjs/sdkClient/client.js +9 -35
  28. package/cjs/sdkClient/clientAttributesDecoration.js +3 -3
  29. package/cjs/sdkClient/clientInputValidation.js +38 -81
  30. package/cjs/sdkClient/identity.js +1 -1
  31. package/cjs/sdkClient/sdkClient.js +4 -49
  32. package/cjs/sdkClient/sdkLifecycle.js +70 -0
  33. package/cjs/sdkClient/trackMethod.js +56 -0
  34. package/cjs/sdkFactory/index.js +8 -45
  35. package/cjs/sdkManager/index.js +3 -3
  36. package/cjs/services/splitApi.js +18 -13
  37. package/cjs/services/splitHttpClient.js +1 -1
  38. package/cjs/storages/AbstractSplitsCacheAsync.js +1 -1
  39. package/cjs/storages/AbstractSplitsCacheSync.js +1 -1
  40. package/cjs/storages/KeyBuilder.js +12 -12
  41. package/cjs/storages/KeyBuilderCS.js +13 -13
  42. package/cjs/storages/KeyBuilderSS.js +15 -15
  43. package/cjs/storages/getRolloutPlan.js +1 -1
  44. package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +1 -1
  45. package/cjs/storages/inLocalStorage/RBSegmentsCacheInLocal.js +1 -1
  46. package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +1 -1
  47. package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +1 -1
  48. package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +1 -1
  49. package/cjs/storages/inMemory/RBSegmentsCacheInMemory.js +1 -1
  50. package/cjs/storages/inMemory/SplitsCacheInMemory.js +1 -1
  51. package/cjs/storages/inMemory/TelemetryCacheInMemory.js +2 -2
  52. package/cjs/storages/inRedis/EventsCacheInRedis.js +1 -1
  53. package/cjs/storages/inRedis/ImpressionCountsCacheInRedis.js +5 -5
  54. package/cjs/storages/inRedis/ImpressionsCacheInRedis.js +1 -1
  55. package/cjs/storages/inRedis/RBSegmentsCacheInRedis.js +1 -1
  56. package/cjs/storages/inRedis/RedisAdapter.js +8 -8
  57. package/cjs/storages/inRedis/SplitsCacheInRedis.js +6 -6
  58. package/cjs/storages/inRedis/TelemetryCacheInRedis.js +7 -7
  59. package/cjs/storages/inRedis/UniqueKeysCacheInRedis.js +3 -3
  60. package/cjs/storages/pluggable/EventsCachePluggable.js +1 -1
  61. package/cjs/storages/pluggable/ImpressionCountsCachePluggable.js +6 -6
  62. package/cjs/storages/pluggable/RBSegmentsCachePluggable.js +1 -1
  63. package/cjs/storages/pluggable/SplitsCachePluggable.js +4 -4
  64. package/cjs/storages/pluggable/TelemetryCachePluggable.js +7 -7
  65. package/cjs/storages/pluggable/UniqueKeysCachePluggable.js +2 -2
  66. package/cjs/storages/pluggable/index.js +3 -3
  67. package/cjs/storages/pluggable/wrapperAdapter.js +1 -1
  68. package/cjs/storages/setRolloutPlan.js +1 -1
  69. package/cjs/storages/utils.js +6 -6
  70. package/cjs/sync/offline/splitsParser/parseCondition.js +1 -1
  71. package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
  72. package/cjs/sync/polling/fetchers/splitChangesFetcher.js +23 -14
  73. package/cjs/sync/polling/pollingManagerCS.js +11 -11
  74. package/cjs/sync/polling/pollingManagerSS.js +13 -13
  75. package/cjs/sync/polling/syncTasks/definitionsSyncTask.js +12 -0
  76. package/cjs/sync/polling/updaters/{splitChangesUpdater.js → definitionChangesUpdater.js} +67 -59
  77. package/cjs/sync/polling/updaters/mySegmentsUpdater.js +1 -1
  78. package/cjs/sync/polling/updaters/segmentChangesUpdater.js +6 -6
  79. package/cjs/sync/streaming/SSEClient/index.js +2 -2
  80. package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +2 -2
  81. package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -2
  82. package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +4 -4
  83. package/cjs/sync/streaming/parseUtils.js +12 -12
  84. package/cjs/sync/streaming/pushManager.js +2 -2
  85. package/cjs/sync/submitters/impressionsSubmitter.js +6 -6
  86. package/cjs/sync/submitters/submitter.js +1 -1
  87. package/cjs/sync/syncManagerOnline.js +5 -2
  88. package/cjs/trackers/eventTracker.js +10 -12
  89. package/cjs/trackers/impressionObserver/buildKey.js +1 -1
  90. package/cjs/trackers/impressionsTracker.js +37 -20
  91. package/cjs/trackers/uniqueKeysTracker.js +1 -1
  92. package/cjs/utils/EventEmitter.js +391 -0
  93. package/cjs/utils/filter/bloomFilter.js +37 -0
  94. package/cjs/utils/inputValidation/apiKey.js +1 -1
  95. package/cjs/utils/inputValidation/attribute.js +2 -2
  96. package/cjs/utils/inputValidation/{split.js → definition.js} +10 -10
  97. package/cjs/utils/inputValidation/{splitExistence.js → definitionExistence.js} +6 -6
  98. package/cjs/utils/inputValidation/definitions.js +25 -0
  99. package/cjs/utils/inputValidation/eventProperties.js +1 -1
  100. package/cjs/utils/inputValidation/index.js +7 -7
  101. package/cjs/utils/inputValidation/isOperational.js +4 -4
  102. package/cjs/utils/inputValidation/target.js +22 -0
  103. package/cjs/utils/labels/index.js +3 -3
  104. package/cjs/utils/lang/index.js +1 -1
  105. package/cjs/utils/promise/timeout.js +1 -1
  106. package/cjs/utils/settingsValidation/splitFilters.js +4 -4
  107. package/cjs/utils/settingsValidation/url.js +5 -5
  108. package/esm/evaluator/condition/engineUtils.js +2 -2
  109. package/esm/evaluator/fallbackConfigsCalculator/fallbackSanitizer/index.js +64 -0
  110. package/esm/evaluator/fallbackConfigsCalculator/index.js +21 -0
  111. package/esm/evaluator/fallbackTreatmentsCalculator/fallbackSanitizer/index.js +5 -8
  112. package/esm/evaluator/fallbackTreatmentsCalculator/index.js +21 -33
  113. package/esm/evaluator/index.js +66 -42
  114. package/esm/evaluator/matchers/whitelist.js +1 -1
  115. package/esm/integrations/pluggable.js +1 -1
  116. package/esm/listeners/browser.js +4 -3
  117. package/esm/listeners/node.js +4 -4
  118. package/esm/logger/constants.js +11 -17
  119. package/esm/logger/index.js +1 -1
  120. package/esm/logger/messages/debug.js +5 -6
  121. package/esm/logger/messages/error.js +3 -3
  122. package/esm/logger/messages/info.js +1 -3
  123. package/esm/logger/messages/warn.js +8 -8
  124. package/esm/platform/browser.js +12 -0
  125. package/esm/platform/getEventSource/browser.js +4 -0
  126. package/esm/platform/getEventSource/eventsource.js +480 -0
  127. package/esm/platform/getEventSource/node.js +20 -0
  128. package/esm/platform/getFetch/browser.js +5 -0
  129. package/esm/platform/getFetch/node.js +22 -0
  130. package/esm/platform/getOptions/node.js +20 -0
  131. package/esm/platform/node.js +14 -0
  132. package/esm/readiness/constants.js +1 -0
  133. package/esm/sdkClient/client.js +10 -37
  134. package/esm/sdkClient/clientAttributesDecoration.js +3 -3
  135. package/esm/sdkClient/clientInputValidation.js +40 -83
  136. package/esm/sdkClient/identity.js +1 -1
  137. package/esm/sdkClient/sdkClient.js +4 -49
  138. package/esm/sdkClient/sdkLifecycle.js +66 -0
  139. package/esm/sdkClient/trackMethod.js +52 -0
  140. package/esm/sdkFactory/index.js +8 -45
  141. package/esm/sdkManager/index.js +4 -4
  142. package/esm/services/splitApi.js +18 -13
  143. package/esm/services/splitHttpClient.js +1 -1
  144. package/esm/storages/AbstractSplitsCacheAsync.js +1 -1
  145. package/esm/storages/AbstractSplitsCacheSync.js +1 -1
  146. package/esm/storages/KeyBuilder.js +12 -12
  147. package/esm/storages/KeyBuilderCS.js +12 -12
  148. package/esm/storages/KeyBuilderSS.js +14 -14
  149. package/esm/storages/getRolloutPlan.js +1 -1
  150. package/esm/storages/inLocalStorage/RBSegmentsCacheInLocal.js +1 -1
  151. package/esm/storages/inMemory/ImpressionCountsCacheInMemory.js +1 -1
  152. package/esm/storages/inMemory/RBSegmentsCacheInMemory.js +1 -1
  153. package/esm/storages/inMemory/TelemetryCacheInMemory.js +2 -2
  154. package/esm/storages/inRedis/EventsCacheInRedis.js +1 -1
  155. package/esm/storages/inRedis/ImpressionCountsCacheInRedis.js +4 -4
  156. package/esm/storages/inRedis/RBSegmentsCacheInRedis.js +1 -1
  157. package/esm/storages/inRedis/RedisAdapter.js +7 -7
  158. package/esm/storages/inRedis/SplitsCacheInRedis.js +4 -4
  159. package/esm/storages/inRedis/TelemetryCacheInRedis.js +7 -7
  160. package/esm/storages/inRedis/UniqueKeysCacheInRedis.js +1 -1
  161. package/esm/storages/pluggable/EventsCachePluggable.js +1 -1
  162. package/esm/storages/pluggable/ImpressionCountsCachePluggable.js +5 -5
  163. package/esm/storages/pluggable/RBSegmentsCachePluggable.js +1 -1
  164. package/esm/storages/pluggable/SplitsCachePluggable.js +2 -2
  165. package/esm/storages/pluggable/TelemetryCachePluggable.js +7 -7
  166. package/esm/storages/pluggable/UniqueKeysCachePluggable.js +1 -1
  167. package/esm/storages/pluggable/index.js +2 -2
  168. package/esm/storages/pluggable/wrapperAdapter.js +1 -1
  169. package/esm/storages/setRolloutPlan.js +1 -1
  170. package/esm/storages/utils.js +6 -6
  171. package/esm/sync/offline/splitsParser/parseCondition.js +1 -1
  172. package/esm/sync/polling/fetchers/splitChangesFetcher.js +24 -15
  173. package/esm/sync/polling/pollingManagerCS.js +11 -11
  174. package/esm/sync/polling/pollingManagerSS.js +13 -13
  175. package/esm/sync/polling/syncTasks/definitionsSyncTask.js +8 -0
  176. package/esm/sync/polling/updaters/{splitChangesUpdater.js → definitionChangesUpdater.js} +67 -59
  177. package/esm/sync/polling/updaters/mySegmentsUpdater.js +2 -2
  178. package/esm/sync/polling/updaters/segmentChangesUpdater.js +7 -7
  179. package/esm/sync/streaming/SSEClient/index.js +2 -2
  180. package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +2 -2
  181. package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -2
  182. package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +4 -4
  183. package/esm/sync/streaming/parseUtils.js +10 -10
  184. package/esm/sync/streaming/pushManager.js +3 -3
  185. package/esm/sync/submitters/impressionsSubmitter.js +6 -6
  186. package/esm/sync/submitters/submitter.js +1 -1
  187. package/esm/sync/syncManagerOnline.js +5 -2
  188. package/esm/trackers/eventTracker.js +10 -12
  189. package/esm/trackers/impressionObserver/buildKey.js +1 -1
  190. package/esm/trackers/impressionsTracker.js +38 -21
  191. package/esm/trackers/uniqueKeysTracker.js +1 -1
  192. package/esm/utils/EventEmitter.js +387 -0
  193. package/esm/utils/filter/bloomFilter.js +33 -0
  194. package/esm/utils/inputValidation/apiKey.js +1 -1
  195. package/esm/utils/inputValidation/attribute.js +2 -2
  196. package/esm/utils/inputValidation/{split.js → definition.js} +8 -8
  197. package/esm/utils/inputValidation/definitionExistence.js +15 -0
  198. package/esm/utils/inputValidation/definitions.js +21 -0
  199. package/esm/utils/inputValidation/index.js +3 -3
  200. package/esm/utils/inputValidation/isOperational.js +4 -4
  201. package/esm/utils/inputValidation/target.js +18 -0
  202. package/esm/utils/labels/index.js +2 -2
  203. package/esm/utils/promise/timeout.js +1 -1
  204. package/esm/utils/settingsValidation/splitFilters.js +4 -4
  205. package/esm/utils/settingsValidation/url.js +5 -5
  206. package/package.json +15 -6
  207. package/src/dtos/types.ts +65 -70
  208. package/src/evaluator/Engine.ts +4 -4
  209. package/src/evaluator/combiners/and.ts +3 -3
  210. package/src/evaluator/combiners/ifelseif.ts +2 -2
  211. package/src/evaluator/condition/engineUtils.ts +2 -2
  212. package/src/evaluator/condition/index.ts +3 -3
  213. package/src/evaluator/fallbackConfigsCalculator/fallbackSanitizer/index.ts +76 -0
  214. package/src/evaluator/fallbackConfigsCalculator/index.ts +24 -0
  215. package/src/evaluator/fallbackTreatmentsCalculator/fallbackSanitizer/index.ts +5 -7
  216. package/src/evaluator/fallbackTreatmentsCalculator/index.ts +27 -41
  217. package/src/evaluator/index.ts +80 -45
  218. package/src/evaluator/matchers/dependency.ts +2 -2
  219. package/src/evaluator/matchers/matcherTypes.ts +2 -2
  220. package/src/evaluator/matchers/prerequisites.ts +4 -4
  221. package/src/evaluator/matchers/rbsegment.ts +2 -2
  222. package/src/evaluator/matchers/whitelist.ts +2 -2
  223. package/src/evaluator/matchersTransform/index.ts +2 -2
  224. package/src/evaluator/matchersTransform/whitelist.ts +2 -2
  225. package/src/evaluator/parser/index.ts +4 -4
  226. package/src/evaluator/treatments/index.ts +2 -2
  227. package/src/evaluator/types.ts +6 -6
  228. package/src/evaluator/value/index.ts +1 -1
  229. package/src/integrations/pluggable.ts +1 -1
  230. package/src/listeners/browser.ts +11 -8
  231. package/src/listeners/node.ts +2 -5
  232. package/src/logger/constants.ts +11 -17
  233. package/src/logger/messages/debug.ts +5 -6
  234. package/src/logger/messages/error.ts +3 -3
  235. package/src/logger/messages/info.ts +1 -3
  236. package/src/logger/messages/warn.ts +8 -8
  237. package/src/platform/browser.ts +14 -0
  238. package/src/platform/getEventSource/browser.ts +4 -0
  239. package/src/platform/getEventSource/eventsource.js +519 -0
  240. package/src/platform/getEventSource/node.ts +23 -0
  241. package/src/platform/getFetch/browser.ts +5 -0
  242. package/src/platform/getFetch/node.ts +27 -0
  243. package/src/platform/getOptions/node.ts +24 -0
  244. package/src/platform/node.ts +16 -0
  245. package/src/readiness/constants.ts +1 -0
  246. package/src/sdkClient/client.ts +11 -41
  247. package/src/sdkClient/clientInputValidation.ts +44 -84
  248. package/src/sdkClient/sdkClient.ts +5 -54
  249. package/src/sdkClient/sdkLifecycle.ts +78 -0
  250. package/src/sdkClient/trackMethod.ts +59 -0
  251. package/src/sdkFactory/index.ts +10 -54
  252. package/src/sdkFactory/types.ts +19 -16
  253. package/src/sdkManager/index.ts +9 -9
  254. package/src/services/splitApi.ts +6 -0
  255. package/src/services/types.ts +3 -2
  256. package/src/storages/AbstractSplitsCacheAsync.ts +7 -7
  257. package/src/storages/AbstractSplitsCacheSync.ts +10 -10
  258. package/src/storages/inLocalStorage/RBSegmentsCacheInLocal.ts +2 -2
  259. package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +6 -6
  260. package/src/storages/inMemory/RBSegmentsCacheInMemory.ts +2 -2
  261. package/src/storages/inMemory/SplitsCacheInMemory.ts +5 -5
  262. package/src/storages/inMemory/TelemetryCacheInMemory.ts +2 -2
  263. package/src/storages/inRedis/RBSegmentsCacheInRedis.ts +2 -2
  264. package/src/storages/inRedis/SplitsCacheInRedis.ts +9 -9
  265. package/src/storages/pluggable/RBSegmentsCachePluggable.ts +2 -2
  266. package/src/storages/pluggable/SplitsCachePluggable.ts +9 -9
  267. package/src/storages/types.ts +21 -16
  268. package/src/sync/offline/splitsParser/parseCondition.ts +2 -2
  269. package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +3 -3
  270. package/src/sync/offline/splitsParser/types.ts +6 -3
  271. package/src/sync/offline/syncManagerOffline.ts +2 -2
  272. package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +6 -6
  273. package/src/sync/polling/fetchers/splitChangesFetcher.ts +57 -22
  274. package/src/sync/polling/fetchers/types.ts +5 -3
  275. package/src/sync/polling/pollingManagerCS.ts +12 -10
  276. package/src/sync/polling/pollingManagerSS.ts +15 -13
  277. package/src/sync/polling/syncTasks/{splitsSyncTask.ts → definitionsSyncTask.ts} +10 -11
  278. package/src/sync/polling/types.ts +3 -3
  279. package/src/sync/polling/updaters/{splitChangesUpdater.ts → definitionChangesUpdater.ts} +77 -68
  280. package/src/sync/polling/updaters/mySegmentsUpdater.ts +2 -2
  281. package/src/sync/polling/updaters/segmentChangesUpdater.ts +7 -7
  282. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +6 -6
  283. package/src/sync/streaming/parseUtils.ts +12 -12
  284. package/src/sync/streaming/pushManager.ts +3 -3
  285. package/src/sync/submitters/impressionsSubmitter.ts +9 -9
  286. package/src/sync/submitters/types.ts +3 -0
  287. package/src/sync/syncManagerOnline.ts +6 -2
  288. package/src/trackers/eventTracker.ts +7 -10
  289. package/src/trackers/impressionsTracker.ts +42 -26
  290. package/src/trackers/types.ts +3 -1
  291. package/src/utils/EventEmitter.js +444 -0
  292. package/src/utils/filter/bloomFilter.ts +38 -0
  293. package/src/utils/inputValidation/definition.ts +27 -0
  294. package/src/utils/inputValidation/definitionExistence.ts +19 -0
  295. package/src/utils/inputValidation/definitions.ts +21 -0
  296. package/src/utils/inputValidation/index.ts +3 -3
  297. package/src/utils/inputValidation/isOperational.ts +4 -4
  298. package/src/utils/inputValidation/target.ts +21 -0
  299. package/src/utils/labels/index.ts +2 -2
  300. package/src/utils/settingsValidation/splitFilters.ts +3 -3
  301. package/types/splitio.d.ts +202 -9
  302. package/cjs/sync/polling/syncTasks/splitsSyncTask.js +0 -13
  303. package/cjs/utils/inputValidation/splits.js +0 -25
  304. package/esm/sync/polling/syncTasks/splitsSyncTask.js +0 -9
  305. package/esm/utils/inputValidation/splitExistence.js +0 -15
  306. package/esm/utils/inputValidation/splits.js +0 -21
  307. package/src/utils/inputValidation/split.ts +0 -27
  308. package/src/utils/inputValidation/splitExistence.ts +0 -19
  309. package/src/utils/inputValidation/splits.ts +0 -21
@@ -21,15 +21,15 @@ export function splitApiFactory(settings, platform, telemetryTracker) {
21
21
  return {
22
22
  // @TODO throw errors if health check requests fail, to log them in the Synchronizer
23
23
  getSdkAPIHealthCheck: function () {
24
- var url = urls.sdk + "/version";
24
+ var url = "".concat(urls.sdk, "/version");
25
25
  return splitHttpClient(url).then(function () { return true; }).catch(function () { return false; });
26
26
  },
27
27
  getEventsAPIHealthCheck: function () {
28
- var url = urls.events + "/version";
28
+ var url = "".concat(urls.events, "/version");
29
29
  return splitHttpClient(url).then(function () { return true; }).catch(function () { return false; });
30
30
  },
31
31
  fetchAuth: function (userMatchingKeys) {
32
- var url = urls.auth + "/v2/auth?s=" + settings.sync.flagSpecVersion;
32
+ var url = "".concat(urls.auth, "/v2/auth?s=").concat(settings.sync.flagSpecVersion);
33
33
  if (userMatchingKeys) { // `userMatchingKeys` is undefined in server-side
34
34
  var queryParams = userMatchingKeys.map(userKeyToQueryParam).join('&');
35
35
  if (queryParams)
@@ -38,7 +38,7 @@ export function splitApiFactory(settings, platform, telemetryTracker) {
38
38
  return splitHttpClient(url, undefined, telemetryTracker.trackHttp(TOKEN));
39
39
  },
40
40
  fetchSplitChanges: function (since, noCache, till, rbSince) {
41
- var url = urls.sdk + "/splitChanges?s=" + settings.sync.flagSpecVersion + "&since=" + since + (rbSince ? '&rbSince=' + rbSince : '') + (filterQueryString || '') + (till ? '&till=' + till : '');
41
+ var url = "".concat(urls.sdk, "/splitChanges?s=").concat(settings.sync.flagSpecVersion, "&since=").concat(since).concat(rbSince ? '&rbSince=' + rbSince : '').concat(filterQueryString || '').concat(till ? '&till=' + till : '');
42
42
  return splitHttpClient(url, noCache ? noCacheHeaderOptions : undefined, telemetryTracker.trackHttp(SPLITS))
43
43
  .catch(function (err) {
44
44
  if (err.statusCode === 414)
@@ -46,8 +46,13 @@ export function splitApiFactory(settings, platform, telemetryTracker) {
46
46
  throw err;
47
47
  });
48
48
  },
49
+ // @TODO support filterQueryString and handle ERROR_TOO_MANY_SETS error
50
+ fetchConfigs: function (since, noCache, till) {
51
+ var url = "".concat(urls.sdk, "/v1/configs?since=").concat(since).concat(filterQueryString || '').concat(till ? '&till=' + till : '');
52
+ return splitHttpClient(url, noCache ? noCacheHeaderOptions : undefined);
53
+ },
49
54
  fetchSegmentChanges: function (since, segmentName, noCache, till) {
50
- var url = urls.sdk + "/segmentChanges/" + segmentName + "?since=" + since + (till ? '&till=' + till : '');
55
+ var url = "".concat(urls.sdk, "/segmentChanges/").concat(segmentName, "?since=").concat(since).concat(till ? '&till=' + till : '');
51
56
  return splitHttpClient(url, noCache ? noCacheHeaderOptions : undefined, telemetryTracker.trackHttp(SEGMENT));
52
57
  },
53
58
  fetchMemberships: function (userMatchingKey, noCache, till) {
@@ -57,7 +62,7 @@ export function splitApiFactory(settings, platform, telemetryTracker) {
57
62
  * - avoid 404 responses. E.g.: '/api/memberships/foo/bar'
58
63
  * - match user keys with special characters. E.g.: 'foo%bar', 'foo/bar'
59
64
  */
60
- var url = urls.sdk + "/memberships/" + encodeURIComponent(userMatchingKey) + (till ? '?till=' + till : '');
65
+ var url = "".concat(urls.sdk, "/memberships/").concat(encodeURIComponent(userMatchingKey)).concat(till ? '?till=' + till : '');
61
66
  return splitHttpClient(url, noCache ? noCacheHeaderOptions : undefined, telemetryTracker.trackHttp(MEMBERSHIPS));
62
67
  },
63
68
  /**
@@ -67,7 +72,7 @@ export function splitApiFactory(settings, platform, telemetryTracker) {
67
72
  * @param headers - Optionals headers to overwrite default ones. For example, it is used in producer mode to overwrite metadata headers.
68
73
  */
69
74
  postEventsBulk: function (body, headers) {
70
- var url = urls.events + "/events/bulk";
75
+ var url = "".concat(urls.events, "/events/bulk");
71
76
  return splitHttpClient(url, { method: 'POST', body: body, headers: headers }, telemetryTracker.trackHttp(EVENTS));
72
77
  },
73
78
  /**
@@ -77,7 +82,7 @@ export function splitApiFactory(settings, platform, telemetryTracker) {
77
82
  * @param headers - Optionals headers to overwrite default ones. For example, it is used in producer mode to overwrite metadata headers.
78
83
  */
79
84
  postTestImpressionsBulk: function (body, headers) {
80
- var url = urls.events + "/testImpressions/bulk";
85
+ var url = "".concat(urls.events, "/testImpressions/bulk");
81
86
  return splitHttpClient(url, {
82
87
  // Adding extra headers to send impressions in OPTIMIZED or DEBUG modes.
83
88
  method: 'POST',
@@ -92,7 +97,7 @@ export function splitApiFactory(settings, platform, telemetryTracker) {
92
97
  * @param headers - Optionals headers to overwrite default ones. For example, it is used in producer mode to overwrite metadata headers.
93
98
  */
94
99
  postTestImpressionsCount: function (body, headers) {
95
- var url = urls.events + "/testImpressions/count";
100
+ var url = "".concat(urls.events, "/testImpressions/count");
96
101
  return splitHttpClient(url, { method: 'POST', body: body, headers: headers }, telemetryTracker.trackHttp(IMPRESSIONS_COUNT));
97
102
  },
98
103
  /**
@@ -102,7 +107,7 @@ export function splitApiFactory(settings, platform, telemetryTracker) {
102
107
  * @param headers - Optionals headers to overwrite default ones. For example, it is used in producer mode to overwrite metadata headers.
103
108
  */
104
109
  postUniqueKeysBulkCs: function (body, headers) {
105
- var url = urls.telemetry + "/v1/keys/cs";
110
+ var url = "".concat(urls.telemetry, "/v1/keys/cs");
106
111
  return splitHttpClient(url, { method: 'POST', body: body, headers: headers }, telemetryTracker.trackHttp(TELEMETRY));
107
112
  },
108
113
  /**
@@ -112,15 +117,15 @@ export function splitApiFactory(settings, platform, telemetryTracker) {
112
117
  * @param headers - Optionals headers to overwrite default ones. For example, it is used in producer mode to overwrite metadata headers.
113
118
  */
114
119
  postUniqueKeysBulkSs: function (body, headers) {
115
- var url = urls.telemetry + "/v1/keys/ss";
120
+ var url = "".concat(urls.telemetry, "/v1/keys/ss");
116
121
  return splitHttpClient(url, { method: 'POST', body: body, headers: headers }, telemetryTracker.trackHttp(TELEMETRY));
117
122
  },
118
123
  postMetricsConfig: function (body, headers) {
119
- var url = urls.telemetry + "/v1/metrics/config";
124
+ var url = "".concat(urls.telemetry, "/v1/metrics/config");
120
125
  return splitHttpClient(url, { method: 'POST', body: body, headers: headers }, telemetryTracker.trackHttp(TELEMETRY), true);
121
126
  },
122
127
  postMetricsUsage: function (body, headers) {
123
- var url = urls.telemetry + "/v1/metrics/usage";
128
+ var url = "".concat(urls.telemetry, "/v1/metrics/usage");
124
129
  return splitHttpClient(url, { method: 'POST', body: body, headers: headers }, telemetryTracker.trackHttp(TELEMETRY), true);
125
130
  }
126
131
  };
@@ -21,7 +21,7 @@ export function splitHttpClientFactory(settings, _a) {
21
21
  var commonHeaders = {
22
22
  'Accept': 'application/json',
23
23
  'Content-Type': 'application/json',
24
- 'Authorization': "Bearer " + authorizationKey,
24
+ 'Authorization': "Bearer ".concat(authorizationKey),
25
25
  'SplitSDKVersion': version
26
26
  };
27
27
  if (ip)
@@ -11,7 +11,7 @@ var AbstractSplitsCacheAsync = /** @class */ (function () {
11
11
  return Promise.all([
12
12
  this.setChangeNumber(changeNumber),
13
13
  Promise.all(toAdd.map(function (addedFF) { return _this.addSplit(addedFF); })),
14
- Promise.all(toRemove.map(function (removedFF) { return _this.removeSplit(removedFF.name); }))
14
+ Promise.all(toRemove.map(function (removedFF) { return _this.removeSplit(removedFF); }))
15
15
  ]).then(function (_a) {
16
16
  var added = _a[1], removed = _a[2];
17
17
  return added.some(function (result) { return result; }) || removed.some(function (result) { return result; });
@@ -10,7 +10,7 @@ var AbstractSplitsCacheSync = /** @class */ (function () {
10
10
  AbstractSplitsCacheSync.prototype.update = function (toAdd, toRemove, changeNumber) {
11
11
  var _this = this;
12
12
  var updated = toAdd.map(function (addedFF) { return _this.addSplit(addedFF); }).some(function (result) { return result; });
13
- updated = toRemove.map(function (removedFF) { return _this.removeSplit(removedFF.name); }).some(function (result) { return result; }) || updated;
13
+ updated = toRemove.map(function (removedFF) { return _this.removeSplit(removedFF); }).some(function (result) { return result; }) || updated;
14
14
  this.setChangeNumber(changeNumber);
15
15
  return updated;
16
16
  };
@@ -10,34 +10,34 @@ var KeyBuilder = /** @class */ (function () {
10
10
  this.prefix = prefix;
11
11
  }
12
12
  KeyBuilder.prototype.buildTrafficTypeKey = function (trafficType) {
13
- return this.prefix + ".trafficType." + trafficType;
13
+ return "".concat(this.prefix, ".trafficType.").concat(trafficType);
14
14
  };
15
15
  KeyBuilder.prototype.buildFlagSetKey = function (flagSet) {
16
- return this.prefix + ".flagSet." + flagSet;
16
+ return "".concat(this.prefix, ".flagSet.").concat(flagSet);
17
17
  };
18
18
  KeyBuilder.prototype.buildSplitKey = function (splitName) {
19
- return this.prefix + ".split." + splitName;
19
+ return "".concat(this.prefix, ".split.").concat(splitName);
20
20
  };
21
21
  KeyBuilder.prototype.buildSplitsTillKey = function () {
22
- return this.prefix + ".splits.till";
22
+ return "".concat(this.prefix, ".splits.till");
23
23
  };
24
24
  KeyBuilder.prototype.buildSplitKeyPrefix = function () {
25
- return this.prefix + ".split.";
25
+ return "".concat(this.prefix, ".split.");
26
26
  };
27
27
  KeyBuilder.prototype.buildRBSegmentKey = function (rbsegmentName) {
28
- return this.prefix + ".rbsegment." + rbsegmentName;
28
+ return "".concat(this.prefix, ".rbsegment.").concat(rbsegmentName);
29
29
  };
30
30
  KeyBuilder.prototype.buildRBSegmentsTillKey = function () {
31
- return this.prefix + ".rbsegments.till";
31
+ return "".concat(this.prefix, ".rbsegments.till");
32
32
  };
33
33
  KeyBuilder.prototype.buildRBSegmentKeyPrefix = function () {
34
- return this.prefix + ".rbsegment.";
34
+ return "".concat(this.prefix, ".rbsegment.");
35
35
  };
36
36
  KeyBuilder.prototype.buildSegmentNameKey = function (segmentName) {
37
- return this.prefix + ".segment." + segmentName;
37
+ return "".concat(this.prefix, ".segment.").concat(segmentName);
38
38
  };
39
39
  KeyBuilder.prototype.buildSegmentTillKey = function (segmentName) {
40
- return this.prefix + ".segment." + segmentName + ".till";
40
+ return "".concat(this.prefix, ".segment.").concat(segmentName, ".till");
41
41
  };
42
42
  KeyBuilder.prototype.extractKey = function (builtKey) {
43
43
  var s = builtKey.match(everythingAtTheEnd);
@@ -49,7 +49,7 @@ var KeyBuilder = /** @class */ (function () {
49
49
  }
50
50
  };
51
51
  KeyBuilder.prototype.buildHashKey = function () {
52
- return this.prefix + ".hash";
52
+ return "".concat(this.prefix, ".hash");
53
53
  };
54
54
  return KeyBuilder;
55
55
  }());
@@ -59,5 +59,5 @@ export { KeyBuilder };
59
59
  * The hash is in hexadecimal format (8 characters max, 32 bits).
60
60
  */
61
61
  export function getStorageHash(settings) {
62
- return hash(settings.core.authorizationKey + "::" + settings.sync.__splitFiltersValidation.queryString + "::" + settings.sync.flagSpecVersion).toString(16);
62
+ return hash("".concat(settings.core.authorizationKey, "::").concat(settings.sync.__splitFiltersValidation.queryString, "::").concat(settings.sync.flagSpecVersion)).toString(16);
63
63
  }
@@ -6,40 +6,40 @@ var KeyBuilderCS = /** @class */ (function (_super) {
6
6
  function KeyBuilderCS(prefix, matchingKey) {
7
7
  var _this = _super.call(this, prefix) || this;
8
8
  _this.matchingKey = matchingKey;
9
- _this.regexSplitsCacheKey = new RegExp("^" + prefix + "\\.(splits?|trafficType|flagSet)\\.");
9
+ _this.regexSplitsCacheKey = new RegExp("^".concat(prefix, "\\.(splits?|trafficType|flagSet)\\."));
10
10
  return _this;
11
11
  }
12
12
  /**
13
13
  * @override
14
14
  */
15
15
  KeyBuilderCS.prototype.buildSegmentNameKey = function (segmentName) {
16
- return this.prefix + "." + this.matchingKey + ".segment." + segmentName;
16
+ return "".concat(this.prefix, ".").concat(this.matchingKey, ".segment.").concat(segmentName);
17
17
  };
18
18
  KeyBuilderCS.prototype.extractSegmentName = function (builtSegmentKeyName) {
19
- var prefix = this.prefix + "." + this.matchingKey + ".segment.";
19
+ var prefix = "".concat(this.prefix, ".").concat(this.matchingKey, ".segment.");
20
20
  if (startsWith(builtSegmentKeyName, prefix))
21
21
  return builtSegmentKeyName.slice(prefix.length);
22
22
  };
23
23
  KeyBuilderCS.prototype.buildLastUpdatedKey = function () {
24
- return this.prefix + ".splits.lastUpdated";
24
+ return "".concat(this.prefix, ".splits.lastUpdated");
25
25
  };
26
26
  KeyBuilderCS.prototype.isSplitsCacheKey = function (key) {
27
27
  return this.regexSplitsCacheKey.test(key);
28
28
  };
29
29
  KeyBuilderCS.prototype.buildTillKey = function () {
30
- return this.prefix + "." + this.matchingKey + ".segments.till";
30
+ return "".concat(this.prefix, ".").concat(this.matchingKey, ".segments.till");
31
31
  };
32
32
  KeyBuilderCS.prototype.isSplitKey = function (key) {
33
- return startsWith(key, this.prefix + ".split.");
33
+ return startsWith(key, "".concat(this.prefix, ".split."));
34
34
  };
35
35
  KeyBuilderCS.prototype.isRBSegmentKey = function (key) {
36
- return startsWith(key, this.prefix + ".rbsegment.");
36
+ return startsWith(key, "".concat(this.prefix, ".rbsegment."));
37
37
  };
38
38
  KeyBuilderCS.prototype.buildSplitsWithSegmentCountKey = function () {
39
- return this.prefix + ".splits.usingSegments";
39
+ return "".concat(this.prefix, ".splits.usingSegments");
40
40
  };
41
41
  KeyBuilderCS.prototype.buildLastClear = function () {
42
- return this.prefix + ".lastClear";
42
+ return "".concat(this.prefix, ".lastClear");
43
43
  };
44
44
  return KeyBuilderCS;
45
45
  }(KeyBuilder));
@@ -47,15 +47,15 @@ export { KeyBuilderCS };
47
47
  export function myLargeSegmentsKeyBuilder(prefix, matchingKey) {
48
48
  return {
49
49
  buildSegmentNameKey: function (segmentName) {
50
- return prefix + "." + matchingKey + ".largeSegment." + segmentName;
50
+ return "".concat(prefix, ".").concat(matchingKey, ".largeSegment.").concat(segmentName);
51
51
  },
52
52
  extractSegmentName: function (builtSegmentKeyName) {
53
- var p = prefix + "." + matchingKey + ".largeSegment.";
53
+ var p = "".concat(prefix, ".").concat(matchingKey, ".largeSegment.");
54
54
  if (startsWith(builtSegmentKeyName, p))
55
55
  return builtSegmentKeyName.slice(p.length);
56
56
  },
57
57
  buildTillKey: function () {
58
- return prefix + "." + matchingKey + ".largeSegments.till";
58
+ return "".concat(prefix, ".").concat(matchingKey, ".largeSegments.till");
59
59
  }
60
60
  };
61
61
  }
@@ -15,42 +15,42 @@ var KeyBuilderSS = /** @class */ (function (_super) {
15
15
  __extends(KeyBuilderSS, _super);
16
16
  function KeyBuilderSS(prefix, metadata) {
17
17
  var _this = _super.call(this, prefix) || this;
18
- _this.latencyPrefix = _this.prefix + ".telemetry.latencies";
19
- _this.exceptionPrefix = _this.prefix + ".telemetry.exceptions";
20
- _this.initPrefix = _this.prefix + ".telemetry.init";
21
- _this.versionablePrefix = metadata.s + "/" + metadata.n + "/" + metadata.i;
18
+ _this.latencyPrefix = "".concat(_this.prefix, ".telemetry.latencies");
19
+ _this.exceptionPrefix = "".concat(_this.prefix, ".telemetry.exceptions");
20
+ _this.initPrefix = "".concat(_this.prefix, ".telemetry.init");
21
+ _this.versionablePrefix = "".concat(metadata.s, "/").concat(metadata.n, "/").concat(metadata.i);
22
22
  return _this;
23
23
  }
24
24
  KeyBuilderSS.prototype.buildRegisteredSegmentsKey = function () {
25
- return this.prefix + ".segments.registered";
25
+ return "".concat(this.prefix, ".segments.registered");
26
26
  };
27
27
  KeyBuilderSS.prototype.buildImpressionsKey = function () {
28
- return this.prefix + ".impressions";
28
+ return "".concat(this.prefix, ".impressions");
29
29
  };
30
30
  KeyBuilderSS.prototype.buildImpressionsCountKey = function () {
31
- return this.prefix + ".impressions.count";
31
+ return "".concat(this.prefix, ".impressions.count");
32
32
  };
33
33
  KeyBuilderSS.prototype.buildUniqueKeysKey = function () {
34
- return this.prefix + ".uniquekeys";
34
+ return "".concat(this.prefix, ".uniquekeys");
35
35
  };
36
36
  KeyBuilderSS.prototype.buildEventsKey = function () {
37
- return this.prefix + ".events";
37
+ return "".concat(this.prefix, ".events");
38
38
  };
39
39
  KeyBuilderSS.prototype.searchPatternForSplitKeys = function () {
40
- return this.buildSplitKeyPrefix() + "*";
40
+ return "".concat(this.buildSplitKeyPrefix(), "*");
41
41
  };
42
42
  KeyBuilderSS.prototype.searchPatternForRBSegmentKeys = function () {
43
- return this.buildRBSegmentKeyPrefix() + "*";
43
+ return "".concat(this.buildRBSegmentKeyPrefix(), "*");
44
44
  };
45
45
  /* Telemetry keys */
46
46
  KeyBuilderSS.prototype.buildLatencyKey = function (method, bucket) {
47
- return this.latencyPrefix + "::" + this.versionablePrefix + "/" + METHOD_NAMES[method] + "/" + bucket;
47
+ return "".concat(this.latencyPrefix, "::").concat(this.versionablePrefix, "/").concat(METHOD_NAMES[method], "/").concat(bucket);
48
48
  };
49
49
  KeyBuilderSS.prototype.buildExceptionKey = function (method) {
50
- return this.exceptionPrefix + "::" + this.versionablePrefix + "/" + METHOD_NAMES[method];
50
+ return "".concat(this.exceptionPrefix, "::").concat(this.versionablePrefix, "/").concat(METHOD_NAMES[method]);
51
51
  };
52
52
  KeyBuilderSS.prototype.buildInitKey = function () {
53
- return this.initPrefix + "::" + this.versionablePrefix;
53
+ return "".concat(this.initPrefix, "::").concat(this.versionablePrefix);
54
54
  };
55
55
  return KeyBuilderSS;
56
56
  }(KeyBuilder));
@@ -7,7 +7,7 @@ export function getRolloutPlan(log, storage, options) {
7
7
  if (options === void 0) { options = {}; }
8
8
  var keys = options.keys, exposeSegments = options.exposeSegments;
9
9
  var splits = storage.splits, segments = storage.segments, rbSegments = storage.rbSegments;
10
- log.debug("storage: get feature flags" + (keys ? ", and memberships for keys: " + keys : '') + (exposeSegments ? ', and segments' : ''));
10
+ log.debug("storage: get feature flags".concat(keys ? ", and memberships for keys: ".concat(keys) : '').concat(exposeSegments ? ', and segments' : ''));
11
11
  return {
12
12
  splitChanges: {
13
13
  ff: {
@@ -16,7 +16,7 @@ var RBSegmentsCacheInLocal = /** @class */ (function () {
16
16
  RBSegmentsCacheInLocal.prototype.update = function (toAdd, toRemove, changeNumber) {
17
17
  var _this = this;
18
18
  var updated = toAdd.map(function (toAdd) { return _this.add(toAdd); }).some(function (result) { return result; });
19
- updated = toRemove.map(function (toRemove) { return _this.remove(toRemove.name); }).some(function (result) { return result; }) || updated;
19
+ updated = toRemove.map(function (toRemove) { return _this.remove(toRemove); }).some(function (result) { return result; }) || updated;
20
20
  this.setChangeNumber(changeNumber);
21
21
  return updated;
22
22
  };
@@ -12,7 +12,7 @@ var ImpressionCountsCacheInMemory = /** @class */ (function () {
12
12
  * Builds key to be stored in the cache with the featureName and the timeFrame truncated.
13
13
  */
14
14
  ImpressionCountsCacheInMemory.prototype._makeKey = function (featureName, timeFrame) {
15
- return featureName + "::" + truncateTimeFrame(timeFrame);
15
+ return "".concat(featureName, "::").concat(truncateTimeFrame(timeFrame));
16
16
  };
17
17
  /**
18
18
  * Increments the quantity of impressions with the passed featureName and timeFrame.
@@ -14,7 +14,7 @@ var RBSegmentsCacheInMemory = /** @class */ (function () {
14
14
  RBSegmentsCacheInMemory.prototype.update = function (toAdd, toRemove, changeNumber) {
15
15
  var _this = this;
16
16
  var updated = toAdd.map(function (toAdd) { return _this.add(toAdd); }).some(function (result) { return result; });
17
- updated = toRemove.map(function (toRemove) { return _this.remove(toRemove.name); }).some(function (result) { return result; }) || updated;
17
+ updated = toRemove.map(function (toRemove) { return _this.remove(toRemove); }).some(function (result) { return result; }) || updated;
18
18
  this.changeNumber = changeNumber;
19
19
  return updated;
20
20
  };
@@ -15,8 +15,8 @@ var ACCEPTANCE_RANGE = 0.001;
15
15
  * All factory instances track telemetry on server-side, and 0.1% on client-side.
16
16
  */
17
17
  export function shouldRecordTelemetry(_a) {
18
- var settings = _a.settings;
19
- return settings.mode !== LOCALHOST_MODE && (checkIfServerSide(settings) || Math.random() <= ACCEPTANCE_RANGE);
18
+ var settings = _a.settings, disableTelemetry = _a.disableTelemetry;
19
+ return !disableTelemetry && settings.mode !== LOCALHOST_MODE && (checkIfServerSide(settings) || Math.random() <= ACCEPTANCE_RANGE);
20
20
  }
21
21
  var TelemetryCacheInMemory = /** @class */ (function () {
22
22
  function TelemetryCacheInMemory(splits, segments, largeSegments) {
@@ -16,7 +16,7 @@ var EventsCacheInRedis = /** @class */ (function () {
16
16
  // We use boolean values to signal successful queueing
17
17
  .then(function () { return true; })
18
18
  .catch(function (err) {
19
- _this.log.error(LOG_PREFIX + "Error adding event to queue: " + err + ".");
19
+ _this.log.error("".concat(LOG_PREFIX, "Error adding event to queue: ").concat(err, "."));
20
20
  return false;
21
21
  });
22
22
  };
@@ -32,7 +32,7 @@ var ImpressionCountsCacheInRedis = /** @class */ (function (_super) {
32
32
  }
33
33
  })
34
34
  .catch(function (err) {
35
- _this.log.error(LOG_PREFIX + "Error in impression counts pipeline: " + err + ".");
35
+ _this.log.error("".concat(LOG_PREFIX, "Error in impression counts pipeline: ").concat(err, "."));
36
36
  return false;
37
37
  });
38
38
  };
@@ -55,17 +55,17 @@ var ImpressionCountsCacheInRedis = /** @class */ (function (_super) {
55
55
  forOwn(counts, function (count, key) {
56
56
  var nameAndTime = key.split('::');
57
57
  if (nameAndTime.length !== 2) {
58
- _this.log.error(LOG_PREFIX + "Error spliting key " + key);
58
+ _this.log.error("".concat(LOG_PREFIX, "Error spliting key ").concat(key));
59
59
  return;
60
60
  }
61
61
  var timeFrame = parseInt(nameAndTime[1]);
62
62
  if (isNaN(timeFrame)) {
63
- _this.log.error(LOG_PREFIX + "Error parsing time frame " + nameAndTime[1]);
63
+ _this.log.error("".concat(LOG_PREFIX, "Error parsing time frame ").concat(nameAndTime[1]));
64
64
  return;
65
65
  }
66
66
  var rawCount = parseInt(count);
67
67
  if (isNaN(rawCount)) {
68
- _this.log.error(LOG_PREFIX + "Error parsing raw count " + count);
68
+ _this.log.error("".concat(LOG_PREFIX, "Error parsing raw count ").concat(count));
69
69
  return;
70
70
  }
71
71
  pf.push({
@@ -31,7 +31,7 @@ var RBSegmentsCacheInRedis = /** @class */ (function () {
31
31
  return _this.redis.set(key, stringifiedNewRBSegment).then(function () { return true; });
32
32
  })),
33
33
  Promise.all(toRemove.map(function (toRemove) {
34
- var key = _this.keys.buildRBSegmentKey(toRemove.name);
34
+ var key = _this.keys.buildRBSegmentKey(toRemove);
35
35
  return _this.redis.del(key).then(function (status) { return status === 1; });
36
36
  }))
37
37
  ]).then(function (_a) {
@@ -58,9 +58,9 @@ var RedisAdapter = /** @class */ (function () {
58
58
  var _this = this;
59
59
  this.client.once('ready', function () {
60
60
  var commandsCount = _this._notReadyCommandsQueue ? _this._notReadyCommandsQueue.length : 0;
61
- _this.log.info(LOG_PREFIX + ("Redis connection established. Queued commands: " + commandsCount + "."));
61
+ _this.log.info(LOG_PREFIX + "Redis connection established. Queued commands: ".concat(commandsCount, "."));
62
62
  _this._notReadyCommandsQueue && _this._notReadyCommandsQueue.forEach(function (queued) {
63
- _this.log.info(LOG_PREFIX + ("Executing queued " + queued.name + " command."));
63
+ _this.log.info(LOG_PREFIX + "Executing queued ".concat(queued.name, " command."));
64
64
  queued.command().then(queued.resolve).catch(queued.reject);
65
65
  });
66
66
  // After the SDK is ready for the first time we'll stop queueing commands. This is just so we can keep handling BUR for them.
@@ -82,7 +82,7 @@ var RedisAdapter = /** @class */ (function () {
82
82
  params[_i] = arguments[_i];
83
83
  }
84
84
  function commandWrapper() {
85
- instance.log.debug(LOG_PREFIX + "Executing " + methodName + ".");
85
+ instance.log.debug("".concat(LOG_PREFIX, "Executing ").concat(methodName, "."));
86
86
  var result = originalMethod.apply(bindTarget, params);
87
87
  if (thenable(result)) {
88
88
  // For handling pending commands on disconnect, add to the set and remove once finished.
@@ -94,7 +94,7 @@ var RedisAdapter = /** @class */ (function () {
94
94
  // Both success and error remove from queue.
95
95
  result.then(cleanUpRunningCommandsCb, cleanUpRunningCommandsCb);
96
96
  return timeout(instance._options.operationTimeout, result).catch(function (err) {
97
- instance.log.error("" + LOG_PREFIX + methodName + " operation threw an error or exceeded configured timeout of " + instance._options.operationTimeout + "ms. Message: " + err);
97
+ instance.log.error("".concat(LOG_PREFIX).concat(methodName, " operation threw an error or exceeded configured timeout of ").concat(instance._options.operationTimeout, "ms. Message: ").concat(err));
98
98
  // Handling is not the adapter responsibility.
99
99
  throw err;
100
100
  });
@@ -132,7 +132,7 @@ var RedisAdapter = /** @class */ (function () {
132
132
  }
133
133
  var res = originalFn.apply(instance.client, args);
134
134
  var originalExec = res.exec;
135
- res.exec = wrapCommand(originalExec, methodName + ".exec", res);
135
+ res.exec = wrapCommand(originalExec, "".concat(methodName, ".exec"), res);
136
136
  return res;
137
137
  };
138
138
  });
@@ -147,14 +147,14 @@ var RedisAdapter = /** @class */ (function () {
147
147
  }
148
148
  setTimeout(function deferredDisconnect() {
149
149
  if (instance._runningCommands.size > 0) {
150
- instance.log.info(LOG_PREFIX + ("Attempting to disconnect but there are " + instance._runningCommands.size + " commands still waiting for resolution. Defering disconnection until those finish."));
150
+ instance.log.info(LOG_PREFIX + "Attempting to disconnect but there are ".concat(instance._runningCommands.size, " commands still waiting for resolution. Defering disconnection until those finish."));
151
151
  Promise.all(setToArray(instance._runningCommands))
152
152
  .then(function () {
153
153
  instance.log.debug(LOG_PREFIX + 'Pending commands finished successfully, disconnecting.');
154
154
  originalMethod.apply(instance.client, params);
155
155
  })
156
156
  .catch(function (e) {
157
- instance.log.warn(LOG_PREFIX + ("Pending commands finished with error: " + e + ". Proceeding with disconnection."));
157
+ instance.log.warn(LOG_PREFIX + "Pending commands finished with error: ".concat(e, ". Proceeding with disconnection."));
158
158
  originalMethod.apply(instance.client, params);
159
159
  });
160
160
  }
@@ -176,7 +176,7 @@ var SplitsCacheInRedis = /** @class */ (function (_super) {
176
176
  var e = _a[0], value = _a[1];
177
177
  if (e === null)
178
178
  return value;
179
- _this.log.error(LOG_PREFIX + ("Could not read result from get members of flag set " + flagSets[index] + " due to an error: " + e));
179
+ _this.log.error(LOG_PREFIX + "Could not read result from get members of flag set ".concat(flagSets[index], " due to an error: ").concat(e));
180
180
  }) : []; })
181
181
  .then(function (namesByFlagSets) { return namesByFlagSets.map(function (namesByFlagSet) { return new Set(namesByFlagSet); }); });
182
182
  };
@@ -195,13 +195,13 @@ var SplitsCacheInRedis = /** @class */ (function (_super) {
195
195
  return false; // if entry doesn't exist, means that TT doesn't exist
196
196
  ttCount = parseInt(ttCount, 10);
197
197
  if (!isFiniteNumber(ttCount) || ttCount < 0) {
198
- _this.log.info(LOG_PREFIX + ("Could not validate traffic type existence of " + trafficType + " due to data corruption of some sorts."));
198
+ _this.log.info(LOG_PREFIX + "Could not validate traffic type existence of ".concat(trafficType, " due to data corruption of some sorts."));
199
199
  return false;
200
200
  }
201
201
  return ttCount > 0;
202
202
  })
203
203
  .catch(function (e) {
204
- _this.log.error(LOG_PREFIX + ("Could not validate traffic type existence of " + trafficType + " due to an error: " + e + "."));
204
+ _this.log.error(LOG_PREFIX + "Could not validate traffic type existence of ".concat(trafficType, " due to an error: ").concat(e, "."));
205
205
  // If there is an error, bypass the validation so the event can get tracked.
206
206
  return true;
207
207
  });
@@ -231,7 +231,7 @@ var SplitsCacheInRedis = /** @class */ (function (_super) {
231
231
  return Promise.resolve(splits);
232
232
  })
233
233
  .catch(function (e) {
234
- _this.log.error(LOG_PREFIX + ("Could not grab feature flags due to an error: " + e + "."));
234
+ _this.log.error(LOG_PREFIX + "Could not grab feature flags due to an error: ".concat(e, "."));
235
235
  return Promise.reject(e);
236
236
  });
237
237
  };
@@ -42,17 +42,17 @@ var TelemetryCacheInRedis = /** @class */ (function () {
42
42
  Object.keys(latencies).forEach(function (field) {
43
43
  var parsedField = parseLatencyField(field);
44
44
  if (isString(parsedField)) {
45
- _this.log.error("Ignoring invalid latency field: " + field + ": " + parsedField);
45
+ _this.log.error("Ignoring invalid latency field: ".concat(field, ": ").concat(parsedField));
46
46
  return;
47
47
  }
48
48
  var count = parseInt(latencies[field]);
49
49
  if (isNaNNumber(count)) {
50
- _this.log.error("Ignoring latency with invalid count: " + latencies[field]);
50
+ _this.log.error("Ignoring latency with invalid count: ".concat(latencies[field]));
51
51
  return;
52
52
  }
53
53
  var metadata = parsedField[0], method = parsedField[1], bucket = parsedField[2];
54
54
  if (bucket >= MAX_LATENCY_BUCKET_COUNT) {
55
- _this.log.error("Ignoring latency with invalid bucket: " + bucket);
55
+ _this.log.error("Ignoring latency with invalid bucket: ".concat(bucket));
56
56
  return;
57
57
  }
58
58
  var methodLatencies = result.get(metadata) || {};
@@ -74,12 +74,12 @@ var TelemetryCacheInRedis = /** @class */ (function () {
74
74
  Object.keys(exceptions).forEach(function (field) {
75
75
  var parsedField = parseExceptionField(field);
76
76
  if (isString(parsedField)) {
77
- _this.log.error("Ignoring invalid exception field: " + field + ": " + parsedField);
77
+ _this.log.error("Ignoring invalid exception field: ".concat(field, ": ").concat(parsedField));
78
78
  return;
79
79
  }
80
80
  var count = parseInt(exceptions[field]);
81
81
  if (isNaNNumber(count)) {
82
- _this.log.error("Ignoring exception with invalid count: " + exceptions[field]);
82
+ _this.log.error("Ignoring exception with invalid count: ".concat(exceptions[field]));
83
83
  return;
84
84
  }
85
85
  var metadata = parsedField[0], method = parsedField[1];
@@ -101,7 +101,7 @@ var TelemetryCacheInRedis = /** @class */ (function () {
101
101
  Object.keys(configs).forEach(function (field) {
102
102
  var parsedField = parseMetadata(field);
103
103
  if (isString(parsedField)) {
104
- _this.log.error("Ignoring invalid config field: " + field + ": " + parsedField);
104
+ _this.log.error("Ignoring invalid config field: ".concat(field, ": ").concat(parsedField));
105
105
  return;
106
106
  }
107
107
  var metadata = parsedField[0];
@@ -110,7 +110,7 @@ var TelemetryCacheInRedis = /** @class */ (function () {
110
110
  result.set(metadata, config);
111
111
  }
112
112
  catch (e) {
113
- _this.log.error("Ignoring invalid config: " + configs[field]);
113
+ _this.log.error("Ignoring invalid config: ".concat(configs[field]));
114
114
  }
115
115
  });
116
116
  return _this.redis.del(_this.keys.initPrefix).then(function () { return result; });
@@ -38,7 +38,7 @@ var UniqueKeysCacheInRedis = /** @class */ (function (_super) {
38
38
  }
39
39
  })
40
40
  .catch(function (err) {
41
- _this.log.error(LOG_PREFIX + "Error in uniqueKeys pipeline: " + err + ".");
41
+ _this.log.error("".concat(LOG_PREFIX, "Error in uniqueKeys pipeline: ").concat(err, "."));
42
42
  return false;
43
43
  });
44
44
  };
@@ -18,7 +18,7 @@ var EventsCachePluggable = /** @class */ (function () {
18
18
  // We use boolean values to signal successful queueing
19
19
  .then(function () { return true; })
20
20
  .catch(function (e) {
21
- _this.log.error(LOG_PREFIX + "Error adding event to queue: " + e + ".");
21
+ _this.log.error("".concat(LOG_PREFIX, "Error adding event to queue: ").concat(e, "."));
22
22
  return false;
23
23
  });
24
24
  };