@splitsoftware/splitio-commons 1.17.1-rc.4 → 1.17.1-rc.5

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 (261) hide show
  1. package/CHANGES.txt +28 -29
  2. package/LICENSE +1 -1
  3. package/README.md +4 -3
  4. package/cjs/consent/sdkUserConsent.js +4 -2
  5. package/cjs/evaluator/matchers/index.js +1 -3
  6. package/cjs/evaluator/matchers/matcherTypes.js +0 -1
  7. package/cjs/evaluator/matchers/segment.js +0 -6
  8. package/cjs/evaluator/matchersTransform/index.js +1 -4
  9. package/cjs/evaluator/matchersTransform/segment.js +1 -3
  10. package/cjs/logger/constants.js +2 -2
  11. package/cjs/logger/messages/info.js +1 -1
  12. package/cjs/logger/messages/warn.js +1 -1
  13. package/cjs/readiness/readinessManager.js +8 -18
  14. package/cjs/readiness/sdkReadinessManager.js +6 -5
  15. package/cjs/sdkClient/sdkClient.js +5 -5
  16. package/cjs/sdkClient/sdkClientMethod.js +1 -3
  17. package/cjs/sdkClient/sdkClientMethodCS.js +15 -9
  18. package/cjs/sdkClient/sdkClientMethodCSWithTT.js +15 -9
  19. package/cjs/sdkFactory/index.js +10 -32
  20. package/cjs/services/decorateHeaders.js +6 -1
  21. package/cjs/services/splitApi.js +5 -5
  22. package/cjs/services/splitHttpClient.js +5 -2
  23. package/cjs/storages/AbstractSegmentsCacheSync.js +33 -0
  24. package/cjs/storages/AbstractSplitsCacheSync.js +1 -2
  25. package/cjs/storages/KeyBuilderCS.js +5 -23
  26. package/cjs/storages/dataLoader.js +1 -1
  27. package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +56 -33
  28. package/cjs/storages/inLocalStorage/index.js +2 -6
  29. package/cjs/storages/inMemory/InMemoryStorageCS.js +1 -6
  30. package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +44 -13
  31. package/cjs/storages/inMemory/SegmentsCacheInMemory.js +28 -14
  32. package/cjs/storages/inMemory/SplitsCacheInMemory.js +9 -8
  33. package/cjs/storages/inMemory/TelemetryCacheInMemory.js +10 -7
  34. package/cjs/storages/inRedis/SegmentsCacheInRedis.js +21 -15
  35. package/cjs/storages/inRedis/index.js +11 -5
  36. package/cjs/storages/pluggable/SegmentsCachePluggable.js +34 -13
  37. package/cjs/storages/pluggable/inMemoryWrapper.js +1 -1
  38. package/cjs/sync/offline/syncManagerOffline.js +11 -18
  39. package/cjs/sync/polling/fetchers/mySegmentsFetcher.js +8 -5
  40. package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
  41. package/cjs/sync/polling/pollingManagerCS.js +1 -1
  42. package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +2 -2
  43. package/cjs/sync/polling/updaters/mySegmentsUpdater.js +21 -15
  44. package/cjs/sync/polling/updaters/segmentChangesUpdater.js +28 -12
  45. package/cjs/sync/polling/updaters/splitChangesUpdater.js +1 -1
  46. package/cjs/sync/streaming/AuthClient/index.js +1 -1
  47. package/cjs/sync/streaming/SSEHandler/index.js +5 -3
  48. package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +48 -107
  49. package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +3 -3
  50. package/cjs/sync/streaming/constants.js +3 -3
  51. package/cjs/sync/streaming/parseUtils.js +9 -14
  52. package/cjs/sync/streaming/pushManager.js +67 -69
  53. package/cjs/sync/syncManagerOnline.js +21 -20
  54. package/cjs/sync/syncTask.js +2 -2
  55. package/cjs/trackers/eventTracker.js +10 -12
  56. package/cjs/trackers/impressionsTracker.js +14 -16
  57. package/cjs/trackers/uniqueKeysTracker.js +3 -5
  58. package/cjs/utils/constants/index.js +4 -5
  59. package/cjs/utils/settingsValidation/index.js +1 -2
  60. package/esm/consent/sdkUserConsent.js +4 -2
  61. package/esm/evaluator/matchers/index.js +1 -3
  62. package/esm/evaluator/matchers/matcherTypes.js +0 -1
  63. package/esm/evaluator/matchers/segment.js +0 -6
  64. package/esm/evaluator/matchersTransform/index.js +1 -4
  65. package/esm/evaluator/matchersTransform/segment.js +1 -3
  66. package/esm/logger/constants.js +1 -1
  67. package/esm/logger/messages/info.js +1 -1
  68. package/esm/logger/messages/warn.js +1 -1
  69. package/esm/readiness/readinessManager.js +8 -18
  70. package/esm/readiness/sdkReadinessManager.js +6 -5
  71. package/esm/sdkClient/sdkClient.js +5 -5
  72. package/esm/sdkClient/sdkClientMethod.js +1 -3
  73. package/esm/sdkClient/sdkClientMethodCS.js +13 -7
  74. package/esm/sdkClient/sdkClientMethodCSWithTT.js +13 -7
  75. package/esm/sdkFactory/index.js +10 -32
  76. package/esm/services/decorateHeaders.js +4 -0
  77. package/esm/services/splitApi.js +6 -6
  78. package/esm/services/splitHttpClient.js +6 -3
  79. package/esm/storages/AbstractSegmentsCacheSync.js +30 -0
  80. package/esm/storages/AbstractSplitsCacheSync.js +2 -3
  81. package/esm/storages/KeyBuilderCS.js +4 -21
  82. package/esm/storages/dataLoader.js +1 -1
  83. package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +56 -33
  84. package/esm/storages/inLocalStorage/index.js +3 -7
  85. package/esm/storages/inMemory/InMemoryStorageCS.js +1 -6
  86. package/esm/storages/inMemory/MySegmentsCacheInMemory.js +44 -13
  87. package/esm/storages/inMemory/SegmentsCacheInMemory.js +28 -14
  88. package/esm/storages/inMemory/SplitsCacheInMemory.js +9 -8
  89. package/esm/storages/inMemory/TelemetryCacheInMemory.js +10 -7
  90. package/esm/storages/inRedis/SegmentsCacheInRedis.js +21 -15
  91. package/esm/storages/inRedis/index.js +11 -5
  92. package/esm/storages/pluggable/SegmentsCachePluggable.js +34 -13
  93. package/esm/storages/pluggable/inMemoryWrapper.js +1 -1
  94. package/esm/sync/offline/syncManagerOffline.js +11 -18
  95. package/esm/sync/polling/fetchers/mySegmentsFetcher.js +8 -5
  96. package/esm/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
  97. package/esm/sync/polling/pollingManagerCS.js +1 -1
  98. package/esm/sync/polling/syncTasks/mySegmentsSyncTask.js +2 -2
  99. package/esm/sync/polling/updaters/mySegmentsUpdater.js +21 -15
  100. package/esm/sync/polling/updaters/segmentChangesUpdater.js +28 -12
  101. package/esm/sync/polling/updaters/splitChangesUpdater.js +1 -1
  102. package/esm/sync/streaming/AuthClient/index.js +1 -1
  103. package/esm/sync/streaming/SSEHandler/index.js +6 -4
  104. package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +49 -108
  105. package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +3 -3
  106. package/esm/sync/streaming/constants.js +2 -2
  107. package/esm/sync/streaming/parseUtils.js +8 -12
  108. package/esm/sync/streaming/pushManager.js +70 -72
  109. package/esm/sync/syncManagerOnline.js +21 -20
  110. package/esm/sync/syncTask.js +2 -2
  111. package/esm/trackers/eventTracker.js +10 -12
  112. package/esm/trackers/impressionsTracker.js +14 -16
  113. package/esm/trackers/uniqueKeysTracker.js +3 -5
  114. package/esm/utils/constants/index.js +2 -3
  115. package/esm/utils/settingsValidation/index.js +1 -2
  116. package/package.json +1 -1
  117. package/src/consent/sdkUserConsent.ts +3 -2
  118. package/src/dtos/types.ts +7 -21
  119. package/src/evaluator/matchers/index.ts +0 -2
  120. package/src/evaluator/matchers/matcherTypes.ts +0 -1
  121. package/src/evaluator/matchers/segment.ts +0 -7
  122. package/src/evaluator/matchersTransform/index.ts +1 -4
  123. package/src/evaluator/matchersTransform/segment.ts +3 -5
  124. package/src/logger/constants.ts +1 -1
  125. package/src/logger/messages/info.ts +1 -1
  126. package/src/logger/messages/warn.ts +1 -1
  127. package/src/readiness/readinessManager.ts +8 -19
  128. package/src/readiness/sdkReadinessManager.ts +7 -7
  129. package/src/readiness/types.ts +2 -5
  130. package/src/sdkClient/sdkClient.ts +5 -5
  131. package/src/sdkClient/sdkClientMethod.ts +1 -4
  132. package/src/sdkClient/sdkClientMethodCS.ts +15 -7
  133. package/src/sdkClient/sdkClientMethodCSWithTT.ts +15 -7
  134. package/src/sdkFactory/index.ts +12 -35
  135. package/src/sdkFactory/types.ts +1 -4
  136. package/src/services/decorateHeaders.ts +5 -0
  137. package/src/services/splitApi.ts +7 -7
  138. package/src/services/splitHttpClient.ts +7 -4
  139. package/src/services/types.ts +2 -2
  140. package/src/storages/AbstractSegmentsCacheSync.ts +68 -0
  141. package/src/storages/AbstractSplitsCacheSync.ts +3 -4
  142. package/src/storages/KeyBuilderCS.ts +5 -34
  143. package/src/storages/dataLoader.ts +1 -1
  144. package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +63 -33
  145. package/src/storages/inLocalStorage/index.ts +4 -8
  146. package/src/storages/inMemory/InMemoryStorageCS.ts +1 -6
  147. package/src/storages/inMemory/MySegmentsCacheInMemory.ts +47 -13
  148. package/src/storages/inMemory/SegmentsCacheInMemory.ts +27 -13
  149. package/src/storages/inMemory/SplitsCacheInMemory.ts +9 -7
  150. package/src/storages/inMemory/TelemetryCacheInMemory.ts +11 -7
  151. package/src/storages/inRedis/SegmentsCacheInRedis.ts +24 -15
  152. package/src/storages/inRedis/index.ts +12 -6
  153. package/src/storages/pluggable/SegmentsCachePluggable.ts +37 -13
  154. package/src/storages/pluggable/inMemoryWrapper.ts +1 -1
  155. package/src/storages/types.ts +17 -15
  156. package/src/sync/offline/syncManagerOffline.ts +13 -21
  157. package/src/sync/polling/fetchers/mySegmentsFetcher.ts +10 -8
  158. package/src/sync/polling/fetchers/segmentChangesFetcher.ts +1 -1
  159. package/src/sync/polling/fetchers/types.ts +2 -3
  160. package/src/sync/polling/pollingManagerCS.ts +4 -4
  161. package/src/sync/polling/syncTasks/mySegmentsSyncTask.ts +5 -4
  162. package/src/sync/polling/types.ts +6 -7
  163. package/src/sync/polling/updaters/mySegmentsUpdater.ts +22 -19
  164. package/src/sync/polling/updaters/segmentChangesUpdater.ts +29 -13
  165. package/src/sync/polling/updaters/splitChangesUpdater.ts +1 -1
  166. package/src/sync/streaming/AuthClient/index.ts +1 -1
  167. package/src/sync/streaming/SSEClient/index.ts +6 -4
  168. package/src/sync/streaming/SSEHandler/index.ts +8 -5
  169. package/src/sync/streaming/SSEHandler/types.ts +15 -15
  170. package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +49 -116
  171. package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +4 -4
  172. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +1 -1
  173. package/src/sync/streaming/UpdateWorkers/types.ts +2 -2
  174. package/src/sync/streaming/constants.ts +2 -2
  175. package/src/sync/streaming/parseUtils.ts +11 -19
  176. package/src/sync/streaming/pushManager.ts +72 -73
  177. package/src/sync/streaming/types.ts +10 -10
  178. package/src/sync/submitters/types.ts +5 -8
  179. package/src/sync/syncManagerOnline.ts +17 -17
  180. package/src/sync/syncTask.ts +2 -2
  181. package/src/sync/types.ts +1 -1
  182. package/src/trackers/eventTracker.ts +8 -11
  183. package/src/trackers/impressionsTracker.ts +10 -13
  184. package/src/trackers/types.ts +0 -1
  185. package/src/trackers/uniqueKeysTracker.ts +4 -6
  186. package/src/types.ts +1 -7
  187. package/src/utils/constants/index.ts +2 -3
  188. package/src/utils/settingsValidation/index.ts +2 -3
  189. package/src/utils/settingsValidation/types.ts +1 -1
  190. package/types/dtos/types.d.ts +7 -18
  191. package/types/evaluator/matchersTransform/segment.d.ts +2 -2
  192. package/types/logger/constants.d.ts +1 -1
  193. package/types/readiness/readinessManager.d.ts +2 -2
  194. package/types/readiness/sdkReadinessManager.d.ts +3 -2
  195. package/types/readiness/types.d.ts +2 -5
  196. package/types/sdkClient/sdkClientMethod.d.ts +1 -1
  197. package/types/sdkFactory/types.d.ts +1 -3
  198. package/types/services/decorateHeaders.d.ts +1 -0
  199. package/types/services/splitApi.d.ts +1 -1
  200. package/types/services/splitHttpClient.d.ts +1 -1
  201. package/types/services/types.d.ts +2 -2
  202. package/types/storages/AbstractSegmentsCacheSync.d.ts +11 -9
  203. package/types/storages/AbstractSplitsCacheSync.d.ts +1 -1
  204. package/types/storages/KeyBuilderCS.d.ts +2 -9
  205. package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +18 -8
  206. package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +13 -7
  207. package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +8 -6
  208. package/types/storages/inMemory/SplitsCacheInMemory.d.ts +2 -1
  209. package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +6 -4
  210. package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +4 -7
  211. package/types/storages/inRedis/index.d.ts +1 -1
  212. package/types/storages/pluggable/SegmentsCachePluggable.d.ts +17 -5
  213. package/types/storages/pluggable/inMemoryWrapper.d.ts +1 -1
  214. package/types/storages/types.d.ts +15 -11
  215. package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +2 -2
  216. package/types/sync/polling/fetchers/types.d.ts +2 -2
  217. package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +2 -2
  218. package/types/sync/polling/types.d.ts +4 -7
  219. package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +3 -4
  220. package/types/sync/streaming/SSEHandler/types.d.ts +14 -16
  221. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +2 -4
  222. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +1 -2
  223. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +2 -3
  224. package/types/sync/streaming/UpdateWorkers/types.d.ts +2 -2
  225. package/types/sync/streaming/constants.d.ts +2 -2
  226. package/types/sync/streaming/parseUtils.d.ts +5 -4
  227. package/types/sync/streaming/types.d.ts +8 -8
  228. package/types/sync/submitters/types.d.ts +4 -7
  229. package/types/sync/types.d.ts +1 -1
  230. package/types/trackers/eventTracker.d.ts +1 -1
  231. package/types/trackers/impressionsTracker.d.ts +1 -1
  232. package/types/trackers/types.d.ts +0 -1
  233. package/types/types.d.ts +1 -7
  234. package/types/utils/constants/index.d.ts +2 -3
  235. package/types/utils/settingsValidation/types.d.ts +1 -1
  236. package/cjs/evaluator/matchers/large_segment.js +0 -16
  237. package/cjs/sdkClient/identity.js +0 -7
  238. package/cjs/storages/AbstractMySegmentsCacheSync.js +0 -60
  239. package/esm/evaluator/matchers/large_segment.js +0 -12
  240. package/esm/sdkClient/identity.js +0 -3
  241. package/esm/storages/AbstractMySegmentsCacheSync.js +0 -57
  242. package/src/evaluator/matchers/large_segment.ts +0 -18
  243. package/src/sdkClient/identity.ts +0 -5
  244. package/src/storages/AbstractMySegmentsCacheSync.ts +0 -94
  245. package/types/evaluator/matchers/large_segment.d.ts +0 -5
  246. package/types/evaluator/matchers/sember_inlist.d.ts +0 -3
  247. package/types/evaluator/matchersTransform/set.d.ts +0 -5
  248. package/types/evaluator/matchersTransform/string.d.ts +0 -7
  249. package/types/sdkClient/identity.d.ts +0 -2
  250. package/types/storages/AbstractMySegmentsCacheSync.d.ts +0 -39
  251. package/types/storages/AbstractSplitsCache.d.ts +0 -46
  252. package/types/sync/streaming/mySegmentsV2utils.d.ts +0 -27
  253. package/types/sync/streaming/pushManagerCS_Spec1_3.d.ts +0 -9
  254. package/types/sync/streaming/pushManager_Spec1_3.d.ts +0 -9
  255. package/types/trackers/impressionObserver/utils.d.ts +0 -5
  256. package/types/utils/inputValidation/sdkKey.d.ts +0 -7
  257. package/types/utils/inputValidation/splitExistance.d.ts +0 -7
  258. package/types/utils/inputValidation/trafficTypeExistance.d.ts +0 -9
  259. package/types/utils/redis/RedisMock.d.ts +0 -4
  260. package/types/utils/settingsValidation/logger/globalLogLevel.d.ts +0 -8
  261. /package/types/utils/{semVer.d.ts → Semver.d.ts} +0 -0
package/CHANGES.txt CHANGED
@@ -1,12 +1,11 @@
1
- 2.0.0 (October XX, 2024)
2
- - Added support for targeting rules based on large segments.
3
- - Added `factory.destroy()` method, which invokes the `destroy` method on all SDK clients created by the factory.
4
- - Updated the handling of timers and async operations inside an `init` factory method to enable lazy initialization of the SDK in standalone mode. This update is intended for the React SDK.
5
- - Bugfixing - Fixed an issue with the server-side polling manager that caused dangling timers when the SDK was destroyed before it was ready.
6
- - BREAKING CHANGES:
7
- - Updated default flag spec version to 1.2.
8
- - Removed `/mySegments` endpoint from SplitAPI module, as it is replaced by `/memberships` endpoint.
9
- - Removed support for MY_SEGMENTS_UPDATE and MY_SEGMENTS_UPDATE_V2 notification types, as they are replaced by MEMBERSHIPS_MS_UPDATE and MEMBERSHIPS_LS_UPDATE notification types.
1
+ 1.17.1 (July 25, 2025)
2
+ - Updated the Redis storage to avoid lazy require of the `ioredis` dependency when the SDK is initialized.
3
+ - Updated some transitive dependencies for vulnerability fixes.
4
+ - Bugfix - Enhanced HTTP client module to implement timeouts for failing requests that might otherwise remain pending indefinitely on some Fetch API implementations, pausing the SDK synchronization process.
5
+ - Bugfix - Properly handle rejected promises when using targeting rules with segment matchers in consumer modes (e.g., Redis and Pluggable storages).
6
+ - Bugfix - Sanitize the `SplitSDKMachineName` header value to avoid exceptions on HTTP/S requests when it contains non ISO-8859-1 characters (Related to issue https://github.com/splitio/javascript-client/issues/847).
7
+ - Bugfix - Fixed an issue with the SDK_UPDATE event on server-side, where it was not being emitted if there was an empty segment and the SDK received a feature flag update notification.
8
+ - Bugfix - Fixed an issue with the server-side polling manager that caused dangling timers when the SDK was destroyed before it was ready.
10
9
 
11
10
  1.17.0 (September 6, 2024)
12
11
  - Added `sync.requestOptions.getHeaderOverrides` configuration option to enhance SDK HTTP request Headers for Authorization Frameworks.
@@ -16,8 +15,8 @@
16
15
  1.16.0 (June 13, 2024)
17
16
  - Added the `getOptions` method to the `IPlatform` interface to allow the SDK to pass request options to the `fetch` function and `EventSource` constructor when fetching data from the Split servers. The method is optional and, if provided, it is called twice: first for the `fetch` options and then for the `EventSource` options. Useful for advanced use cases like configuring a proxy or validating HTTPS certificates in NodeJS.
18
17
  - Updated the Redis storage to lazily import the `ioredis` dependency when the storage is created. This prevents errors when the SDK is imported or bundled in a .mjs file, as `ioredis` is a CommonJS module.
19
- - Bugfixing - Restored some input validation error logs that were removed in version 1.12.0. The logs inform the user when the `getTreatment(s)` methods are called with an invalid value as feature flag name or flag set name.
20
- - Bugfixing - Fixed localhost mode to emit SDK_UPDATE when mocked feature flags are updated in the `features` object map of the config object (Related to issue https://github.com/splitio/javascript-browser-client/issues/119).
18
+ - Bugfix - Restored some input validation error logs that were removed in version 1.12.0. The logs inform the user when the `getTreatment(s)` methods are called with an invalid value as feature flag name or flag set name.
19
+ - Bugfix - Fixed localhost mode to emit SDK_UPDATE when mocked feature flags are updated in the `features` object map of the config object (Related to issue https://github.com/splitio/javascript-browser-client/issues/119).
21
20
 
22
21
  1.15.0 (May 13, 2024)
23
22
  - Added an optional settings validation parameter to let overwrite the default flag spec version, used by the JS Synchronizer.
@@ -35,13 +34,13 @@
35
34
 
36
35
  1.12.1 (December 12, 2023)
37
36
  - Updated PluggableStorage, for producer mode, and LocalStorage, for standalone mode, to clear the storage before initiating the synchronization process if it was previously synchronized with a different SDK key (i.e., a different environment) or different Split Filter criteria.
38
- - Bugfixing - Fixed an issue when tracking telemetry latencies for the new `getTreatmentsByFlagSet(s)` methods in Redis and Pluggable storages, which was causing the SDK to not track those stats.
37
+ - Bugfix - Fixed an issue when tracking telemetry latencies for the new `getTreatmentsByFlagSet(s)` methods in Redis and Pluggable storages, which was causing the SDK to not track those stats.
39
38
 
40
39
  1.12.0 (December 4, 2023)
41
40
  - Added support for Flag Sets in "consumer" and "partial consumer" modes for Pluggable and Redis storages.
42
41
  - Updated evaluation flow to log a warning when using flag sets that don't contain cached feature flags.
43
42
  - Updated Redis adapter to handle timeouts and queueing of some missing commands: 'hincrby', 'popNRaw', and 'pipeline.exec'.
44
- - Bugfixing - Fixed manager methods in consumer modes to return results in a promise when the SDK is not operational (not ready or destroyed).
43
+ - Bugfix - Fixed manager methods in consumer modes to return results in a promise when the SDK is not operational (not ready or destroyed).
45
44
 
46
45
  1.11.0 (November 3, 2023)
47
46
  - Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation):
@@ -51,7 +50,7 @@
51
50
  - Added a new optional Split Filter configuration option. This allows the SDK and Split services to only synchronize the flags in the specified flag sets, avoiding unused or unwanted flags from being synced on the SDK instance, bringing all the benefits from a reduced payload.
52
51
  - Note: Only applicable when the SDK is in charge of the rollout data synchronization. When not applicable, the SDK will log a warning on init.
53
52
  - Added `sets` property to the `SplitView` object returned by the `split` and `splits` methods of the SDK manager to expose flag sets on flag views.
54
- - Bugfixing - Fixed SDK key validation in NodeJS to ensure the SDK_READY_TIMED_OUT event is emitted when a client-side type SDK key is provided instead of a server-side one (Related to issue https://github.com/splitio/javascript-client/issues/768).
53
+ - Bugfix - Fixed SDK key validation in NodeJS to ensure the SDK_READY_TIMED_OUT event is emitted when a client-side type SDK key is provided instead of a server-side one (Related to issue https://github.com/splitio/javascript-client/issues/768).
55
54
 
56
55
  1.10.0 (October 20, 2023)
57
56
  - Added `defaultTreatment` property to the `SplitView` object returned by the `split` and `splits` methods of the SDK manager (Related to issue https://github.com/splitio/javascript-commons/issues/225).
@@ -70,7 +69,7 @@
70
69
  1.8.3 (June 29, 2023)
71
70
  - Updated some transitive dependencies for vulnerability fixes.
72
71
  - Updated SDK_READY_TIMED_OUT event to be emitted immediately when a connection error occurs using pluggable storage (i.e., when the wrapper `connect` promise is rejected) in consumer and partial consumer modes.
73
- - Bugfixing - The `destroy` method has been updated to immediately flag the SDK client as destroyed, to prevent unexpected behaviours when `getTreatment` and `track` methods are called synchronously after `destroy` method is called.
72
+ - Bugfix - The `destroy` method has been updated to immediately flag the SDK client as destroyed, to prevent unexpected behaviours when `getTreatment` and `track` methods are called synchronously after `destroy` method is called.
74
73
 
75
74
  1.8.2 (May 15, 2023)
76
75
  - Updated terminology on the SDKs codebase to be more aligned with current standard without causing a breaking change. The core change is the term split for feature flag on things like logs and IntelliSense comments.
@@ -86,10 +85,10 @@
86
85
  1.7.3 (December 16, 2022)
87
86
  - Updated unique keys cache for Redis and Pluggable storages to optimize the usage of the underlying storage.
88
87
  - Updated some transitive dependencies for vulnerability fixes.
89
- - Bugfixing - Updated events and impressions cache in localhost mode in order to avoid memory leaks (Related to issue https://github.com/splitio/javascript-commons/issues/181).
88
+ - Bugfix - Updated events and impressions cache in localhost mode in order to avoid memory leaks (Related to issue https://github.com/splitio/javascript-commons/issues/181).
90
89
 
91
90
  1.7.2 (October 14, 2022)
92
- - Bugfixing - Handle `Navigator.sendBeacon` API exceptions in the browser, and fallback to regular Fetch/XHR transport in case of error.
91
+ - Bugfix - Handle `Navigator.sendBeacon` API exceptions in the browser, and fallback to regular Fetch/XHR transport in case of error.
93
92
 
94
93
  1.7.1 (October 5, 2022)
95
94
  - Updated default value of `scheduler.featuresRefreshRate` config parameter to 60 seconds.
@@ -107,7 +106,7 @@
107
106
  - Added `autoRequire` configuration option to the Google Analytics to Split integration, which takes care of requiring the splitTracker plugin on trackers dynamically created by Google tag managers (See https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js).
108
107
  - Updated browser listener to push remaining impressions and events on 'visibilitychange' and 'pagehide' DOM events, instead of 'unload', which is not reliable in modern mobile and desktop Web browsers.
109
108
  - Updated the synchronization flow to be more reliable in the event of an edge case generating delay in cache purge propagation, keeping the SDK cache properly synced.
110
- - Bugfixing - Removed js-yaml dependency to avoid resolution to an incompatible version on certain npm versions when installing third-party dependencies that also define js-yaml as transitive dependency (Related to issue https://github.com/splitio/javascript-client/issues/662).
109
+ - Bugfix - Removed js-yaml dependency to avoid resolution to an incompatible version on certain npm versions when installing third-party dependencies that also define js-yaml as transitive dependency (Related to issue https://github.com/splitio/javascript-client/issues/662).
111
110
 
112
111
  1.5.0 (June 29, 2022)
113
112
  - Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config `sync.enabled`. Running online, Split SDK will always pull the most recent updates upon initialization, this only affects updates fetching on a running instance. Useful when a consistent session experience is a must or to save resources when updates are not being used.
@@ -115,16 +114,16 @@
115
114
  - Updated submitters logic, to avoid duplicating the post of impressions to Split cloud when the SDK is destroyed while its periodic post of impressions is running.
116
115
 
117
116
  1.4.1 (June 13, 2022)
118
- - Bugfixing - Updated submitters logic, to avoid dropping impressions and events that are being tracked while POST request is pending.
117
+ - Bugfix - Updated submitters logic, to avoid dropping impressions and events that are being tracked while POST request is pending.
119
118
 
120
119
  1.4.0 (May 24, 2022)
121
120
  - Added `scheduler.telemetryRefreshRate` property to SDK configuration, and deprecated `scheduler.metricsRefreshRate` property.
122
121
  - Updated SDK telemetry storage, metrics and updater to be more effective and send less often.
123
- - Bugfixing - Updated default values for `scheduler.impressionsRefreshRate` config parameter: 300s for OPTIMIZED impression mode and 60s for DEBUG impression mode.
122
+ - Bugfix - Updated default values for `scheduler.impressionsRefreshRate` config parameter: 300s for OPTIMIZED impression mode and 60s for DEBUG impression mode.
124
123
 
125
124
  1.3.1 (April 19, 2022)
126
- - Bugfixing - Added peer dependencies to avoid issues when requiring some third-party dependencies used by modules of the package (Related to issue https://github.com/splitio/javascript-client/issues/662).
127
- - Bugfixing - Updated `ready` method to rejects the promise with an Error object instead of a string value (Related to issue https://github.com/splitio/javascript-client/issues/654).
125
+ - Bugfix - Added peer dependencies to avoid issues when requiring some third-party dependencies used by modules of the package (Related to issue https://github.com/splitio/javascript-client/issues/662).
126
+ - Bugfix - Updated `ready` method to rejects the promise with an Error object instead of a string value (Related to issue https://github.com/splitio/javascript-client/issues/654).
128
127
 
129
128
  1.3.0 (April 6, 2022)
130
129
  - Added user consent feature to allow delaying or disabling the data tracking from SDK until user consent is explicitly granted or declined. Read more in our docs.
@@ -133,12 +132,12 @@
133
132
  - Updated format for MySegments keys in LocalStorage, keeping backwards compatibility (issue https://github.com/splitio/javascript-client/issues/638).
134
133
  - Updated some modules due to general polishing and refactors, including updates in some log messages.
135
134
  - Updated some dependencies for vulnerability fixes.
136
- - Bugfixing - Updated internal isObject utility function, to avoid unexpected behaviors on frameworks and libraries that uses multiple VM contexts, like NuxtJS dev server.
137
- - Bugfixing - Fixed validation of `core.key` SDK configuration param, to parse it into a string and log a warning when passing a number (Related to issue https://github.com/splitio/react-native-client/issues/19).
138
- - Bugfixing - Fixed validation of `sync.impressionsMode` SDK configuration param, to avoid an exception on SplitFactory instantiation when passing a non-string value.
139
- - Bugfixing - Fixed an issue with `connectionTimeout` options params of Redis storage, that was being ignored and not passed down to the underlying ioredis client.
140
- - Bugfixing - Fixed streaming synchronization issue with multiple clients.
141
- - Bugfixing - Fixed issue with internal Map ponyfill that results in logger not working properly on IE11 browser.
135
+ - Bugfix - Updated internal isObject utility function, to avoid unexpected behaviors on frameworks and libraries that uses multiple VM contexts, like NuxtJS dev server.
136
+ - Bugfix - Fixed validation of `core.key` SDK configuration param, to parse it into a string and log a warning when passing a number (Related to issue https://github.com/splitio/react-native-client/issues/19).
137
+ - Bugfix - Fixed validation of `sync.impressionsMode` SDK configuration param, to avoid an exception on SplitFactory instantiation when passing a non-string value.
138
+ - Bugfix - Fixed an issue with `connectionTimeout` options params of Redis storage, that was being ignored and not passed down to the underlying ioredis client.
139
+ - Bugfix - Fixed streaming synchronization issue with multiple clients.
140
+ - Bugfix - Fixed issue with internal Map ponyfill that results in logger not working properly on IE11 browser.
142
141
 
143
142
  1.2.0 (January 19, 2022)
144
143
  - Added support to SDK clients on browser to optionally bind attributes to the client, keeping these loaded within the SDK along with the user ID, for easier usage when requesting flag.
@@ -148,7 +147,7 @@
148
147
  customers to implement this caching with any storage technology of choice and connect it to the SDK instance to be used instead of its default in-memory storage.
149
148
  - Updated multiple modules due to general polishing and improvements, including the replacement of default exports with named exports, to avoid runtime errors with some particular configurations of Webpack projects.
150
149
  - Updated ioredis dependency for vulnerability fixes.
151
- - Bugfixing - Fixed issue returning dynamic configs if treatment name contains a dot (".").
150
+ - Bugfix - Fixed issue returning dynamic configs if treatment name contains a dot (".").
152
151
 
153
152
  1.0.0 (October 20, 2021)
154
153
  - BREAKING CHANGE on multiple modules due to general polishing, improvements and bug fixes. In most cases the change is to use named exports. This affected mostly modules related with synchronization and storages.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright © 2024 Split Software, Inc.
1
+ Copyright © 2025 Split Software, Inc.
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -14,7 +14,7 @@ This library is compatible with JavaScript ES5 and above.
14
14
  Please see [Contributors Guide](CONTRIBUTORS-GUIDE.md) to find all you need to submit a Pull Request (PR).
15
15
 
16
16
  ## License
17
- Licensed under the Apache License, Version 2.0. See: [Apache License](http://www.apache.org/licenses/).
17
+ Licensed under the Apache License, Version 2.0. See: [Apache License](https://www.apache.org/licenses/).
18
18
 
19
19
  ## About Split
20
20
 
@@ -27,13 +27,14 @@ Split has built and maintains SDKs for:
27
27
  * .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
28
28
  * Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
29
29
  * Angular [Github](https://github.com/splitio/angular-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/6495326064397-Angular-utilities)
30
+ * Elixir thin-client [Github](https://github.com/splitio/elixir-thin-client) [Docs](https://help.split.io/hc/en-us/articles/26988707417869-Elixir-Thin-Client-SDK)
30
31
  * Flutter [Github](https://github.com/splitio/flutter-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/8096158017165-Flutter-plugin)
31
32
  * GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
32
33
  * iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
33
34
  * Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
34
35
  * JavaScript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
35
36
  * JavaScript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
36
- * Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
37
+ * Node.js [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
37
38
  * PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
38
39
  * PHP thin-client [Github](https://github.com/splitio/php-thin-client) [Docs](https://help.split.io/hc/en-us/articles/18305128673933-PHP-Thin-Client-SDK)
39
40
  * Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)
@@ -46,4 +47,4 @@ For a comprehensive list of open source projects visit our [Github page](https:/
46
47
 
47
48
  **Learn more about Split:**
48
49
 
49
- Visit [split.io/product](https://www.split.io/product) for an overview of Split, or visit our documentation at [help.split.io](http://help.split.io) for more detailed information.
50
+ Visit [split.io/product](https://www.split.io/product) for an overview of Split, or visit our documentation at [help.split.io](https://help.split.io) for more detailed information.
@@ -15,7 +15,7 @@ var ConsentStatus = {
15
15
  * The public user consent API exposed via SplitFactory, used to control if the SDK tracks and sends impressions and events or not.
16
16
  */
17
17
  function createUserConsentAPI(params) {
18
- var settings = params.settings, log = params.settings.log, syncManager = params.syncManager, _a = params.storage, events = _a.events, impressions = _a.impressions, impressionCounts = _a.impressionCounts;
18
+ var settings = params.settings, log = params.settings.log, syncManager = params.syncManager, _a = params.storage, events = _a.events, impressions = _a.impressions, impressionCounts = _a.impressionCounts, uniqueKeys = _a.uniqueKeys;
19
19
  if (!(0, index_1.isConsentGranted)(settings))
20
20
  log.info(constants_1.USER_CONSENT_INITIAL, [settings.userConsent]);
21
21
  return {
@@ -41,7 +41,9 @@ function createUserConsentAPI(params) {
41
41
  if (impressions.clear)
42
42
  impressions.clear(); // @ts-ignore
43
43
  if (impressionCounts && impressionCounts.clear)
44
- impressionCounts.clear();
44
+ impressionCounts.clear(); // @ts-ignore
45
+ if (uniqueKeys && uniqueKeys.clear)
46
+ uniqueKeys.clear();
45
47
  }
46
48
  }
47
49
  else {
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.matcherFactory = void 0;
4
4
  var all_1 = require("./all");
5
5
  var segment_1 = require("./segment");
6
- var large_segment_1 = require("./large_segment");
7
6
  var whitelist_1 = require("./whitelist");
8
7
  var eq_1 = require("./eq");
9
8
  var gte_1 = require("./gte");
@@ -47,8 +46,7 @@ var matchers = [
47
46
  semver_gte_1.greaterThanEqualToSemverMatcherContext,
48
47
  semver_lte_1.lessThanEqualToSemverMatcherContext,
49
48
  semver_between_1.betweenSemverMatcherContext,
50
- semver_inlist_1.inListSemverMatcherContext,
51
- large_segment_1.largeSegmentMatcherContext, // IN_LARGE_SEGMENT: 23
49
+ semver_inlist_1.inListSemverMatcherContext, // IN_LIST_SEMVER: 22
52
50
  ];
53
51
  /**
54
52
  * Matcher factory.
@@ -25,7 +25,6 @@ exports.matcherTypes = {
25
25
  LESS_THAN_OR_EQUAL_TO_SEMVER: 20,
26
26
  BETWEEN_SEMVER: 21,
27
27
  IN_LIST_SEMVER: 22,
28
- IN_LARGE_SEGMENT: 23,
29
28
  };
30
29
  exports.matcherDataTypes = {
31
30
  BOOLEAN: 'BOOLEAN',
@@ -1,15 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.segmentMatcherContext = void 0;
4
- var thenable_1 = require("../../utils/promise/thenable");
5
4
  function segmentMatcherContext(segmentName, storage) {
6
5
  return function segmentMatcher(key) {
7
6
  var isInSegment = storage.segments.isInSegment(segmentName, key);
8
- if ((0, thenable_1.thenable)(isInSegment)) {
9
- isInSegment.then(function (result) {
10
- return result;
11
- });
12
- }
13
7
  return isInSegment;
14
8
  };
15
9
  }
@@ -12,7 +12,7 @@ var convertions_1 = require("../convertions");
12
12
  */
13
13
  function matchersTransform(matchers) {
14
14
  var parsedMatchers = matchers.map(function (matcher) {
15
- var matcherType = matcher.matcherType, negate = matcher.negate, keySelector = matcher.keySelector, userDefinedSegmentMatcherData = matcher.userDefinedSegmentMatcherData, userDefinedLargeSegmentMatcherData = matcher.userDefinedLargeSegmentMatcherData, whitelistMatcherData = matcher.whitelistMatcherData, /* whitelistObject, provided by 'WHITELIST', 'IN_LIST_SEMVER', set and string matchers */ unaryNumericMatcherData = matcher.unaryNumericMatcherData, betweenMatcherData = matcher.betweenMatcherData, dependencyMatcherData = matcher.dependencyMatcherData, booleanMatcherData = matcher.booleanMatcherData, stringMatcherData = matcher.stringMatcherData, betweenStringMatcherData = matcher.betweenStringMatcherData;
15
+ var matcherType = matcher.matcherType, negate = matcher.negate, keySelector = matcher.keySelector, userDefinedSegmentMatcherData = matcher.userDefinedSegmentMatcherData, whitelistMatcherData = matcher.whitelistMatcherData, /* whitelistObject, provided by 'WHITELIST', 'IN_LIST_SEMVER', set and string matchers */ unaryNumericMatcherData = matcher.unaryNumericMatcherData, betweenMatcherData = matcher.betweenMatcherData, dependencyMatcherData = matcher.dependencyMatcherData, booleanMatcherData = matcher.booleanMatcherData, stringMatcherData = matcher.stringMatcherData, betweenStringMatcherData = matcher.betweenStringMatcherData;
16
16
  var attribute = keySelector && keySelector.attribute;
17
17
  var type = (0, matcherTypes_1.matcherTypesMapper)(matcherType);
18
18
  // As default input data type we use string (even for ALL_KEYS)
@@ -21,9 +21,6 @@ function matchersTransform(matchers) {
21
21
  if (type === matcherTypes_1.matcherTypes.IN_SEGMENT) {
22
22
  value = (0, segment_1.segmentTransform)(userDefinedSegmentMatcherData);
23
23
  }
24
- else if (type === matcherTypes_1.matcherTypes.IN_LARGE_SEGMENT) {
25
- value = (0, segment_1.segmentTransform)(userDefinedLargeSegmentMatcherData);
26
- }
27
24
  else if (type === matcherTypes_1.matcherTypes.EQUAL_TO) {
28
25
  value = (0, unaryNumeric_1.numericTransform)(unaryNumericMatcherData);
29
26
  dataType = matcherTypes_1.matcherDataTypes.NUMBER;
@@ -5,8 +5,6 @@ exports.segmentTransform = void 0;
5
5
  * Extract segment name as a plain string.
6
6
  */
7
7
  function segmentTransform(segment) {
8
- return segment ?
9
- segment.segmentName || segment.largeSegmentName :
10
- undefined;
8
+ return segment ? segment.segmentName : undefined;
11
9
  }
12
10
  exports.segmentTransform = segmentTransform;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ENGINE_VALUE_INVALID = exports.USER_CONSENT_INITIAL = exports.USER_CONSENT_NOT_UPDATED = exports.USER_CONSENT_UPDATED = exports.IMPRESSIONS_TRACKER_SUCCESS = exports.EVENTS_TRACKER_SUCCESS = exports.SYNC_STOP_POLLING = exports.SYNC_CONTINUE_POLLING = exports.SYNC_START_POLLING = exports.SUBMITTERS_PUSH = exports.SUBMITTERS_PUSH_FULL_QUEUE = exports.STREAMING_DISCONNECTING = exports.STREAMING_DISABLED = exports.STREAMING_CONNECTING = exports.STREAMING_RECONNECT = exports.STREAMING_REFRESH_TOKEN = exports.SYNC_SPLITS_FETCH_RETRY = exports.POLLING_STOP = exports.POLLING_START = exports.POLLING_SMART_PAUSING = exports.NEW_FACTORY = exports.NEW_SHARED_CLIENT = exports.IMPRESSION_QUEUEING = exports.IMPRESSION = exports.CLIENT_READY = exports.CLIENT_READY_FROM_CACHE = exports.ENGINE_MATCHER_RESULT = exports.SETTINGS_SPLITS_FILTER = exports.SYNC_TASK_STOP = exports.SYNC_TASK_EXECUTE = exports.SYNC_TASK_START = exports.STREAMING_NEW_MESSAGE = exports.SYNC_SPLITS_SEGMENTS = exports.SYNC_SPLITS_REMOVED = exports.SYNC_SPLITS_NEW = exports.SYNC_SPLITS_FETCH = exports.SYNC_OFFLINE_DATA = exports.RETRIEVE_MANAGER = exports.RETRIEVE_CLIENT_EXISTING = exports.RETRIEVE_CLIENT_DEFAULT = exports.CLEANUP_DEREGISTERING = exports.CLEANUP_REGISTERING = exports.ENGINE_SANITIZE = exports.ENGINE_VALUE = exports.ENGINE_MATCHER_DEPENDENCY_PRE = exports.ENGINE_MATCHER_DEPENDENCY = exports.ENGINE_BUCKET = exports.ENGINE_COMBINER_IFELSEIF_NO_TREATMENT = exports.ENGINE_COMBINER_IFELSEIF = exports.ENGINE_COMBINER_AND = void 0;
4
- exports.ERROR_INVALID_CONFIG_PARAM = exports.ERROR_EMPTY_ARRAY = exports.ERROR_EMPTY = exports.ERROR_INVALID = exports.ERROR_INVALID_KEY_OBJECT = exports.ERROR_TOO_LONG = exports.ERROR_NULL = exports.ERROR_CLIENT_DESTROYED = exports.ERROR_NOT_FINITE = exports.ERROR_SIZE_EXCEEDED = exports.ERROR_NOT_PLAIN_OBJECT = exports.ERROR_EVENT_TYPE_FORMAT = exports.ERROR_EVENTS_TRACKER = exports.ERROR_IMPRESSIONS_LISTENER = exports.ERROR_IMPRESSIONS_TRACKER = exports.ERROR_STREAMING_AUTH = exports.ERROR_STREAMING_SSE = exports.ERROR_SYNC_OFFLINE_LOADING = exports.ERROR_CLIENT_CANNOT_GET_READY = exports.ERROR_CLIENT_LISTENER = exports.ERROR_LOGLEVEL_INVALID = exports.ERROR_ENGINE_COMBINER_IFELSEIF = exports.WARN_FLAGSET_WITHOUT_FLAGS = exports.WARN_FLAGSET_NOT_CONFIGURED = exports.WARN_LOWERCASE_FLAGSET = exports.WARN_INVALID_FLAGSET = exports.STREAMING_PARSING_SPLIT_UPDATE = exports.STREAMING_PARSING_MEMBERSHIPS_UPDATE = exports.WARN_SDK_KEY = exports.WARN_SPLITS_FILTER_EMPTY = exports.WARN_SPLITS_FILTER_INVALID = exports.WARN_SPLITS_FILTER_IGNORED = exports.WARN_INTEGRATION_INVALID = exports.WARN_NOT_EXISTENT_TT = exports.WARN_LOWERCASE_TRAFFIC_TYPE = exports.WARN_NOT_EXISTENT_SPLIT = exports.WARN_TRIMMING = exports.WARN_CONVERTING = exports.WARN_TRIMMING_PROPERTIES = exports.WARN_SETTING_NULL = exports.SUBMITTERS_PUSH_RETRY = exports.SUBMITTERS_PUSH_FAILS = exports.STREAMING_FALLBACK = exports.STREAMING_PARSING_MESSAGE_FAILS = exports.STREAMING_PARSING_ERROR_FAILS = exports.SYNC_SPLITS_FETCH_FAILS = exports.SYNC_MYSEGMENTS_FETCH_RETRY = exports.CLIENT_NOT_READY = exports.CLIENT_NO_LISTENER = exports.ENGINE_VALUE_NO_ATTRIBUTES = void 0;
4
+ exports.ERROR_INVALID_CONFIG_PARAM = exports.ERROR_EMPTY_ARRAY = exports.ERROR_EMPTY = exports.ERROR_INVALID = exports.ERROR_INVALID_KEY_OBJECT = exports.ERROR_TOO_LONG = exports.ERROR_NULL = exports.ERROR_CLIENT_DESTROYED = exports.ERROR_NOT_FINITE = exports.ERROR_SIZE_EXCEEDED = exports.ERROR_NOT_PLAIN_OBJECT = exports.ERROR_EVENT_TYPE_FORMAT = exports.ERROR_EVENTS_TRACKER = exports.ERROR_IMPRESSIONS_LISTENER = exports.ERROR_IMPRESSIONS_TRACKER = exports.ERROR_STREAMING_AUTH = exports.ERROR_STREAMING_SSE = exports.ERROR_SYNC_OFFLINE_LOADING = exports.ERROR_CLIENT_CANNOT_GET_READY = exports.ERROR_CLIENT_LISTENER = exports.ERROR_LOGLEVEL_INVALID = exports.ERROR_ENGINE_COMBINER_IFELSEIF = exports.WARN_FLAGSET_WITHOUT_FLAGS = exports.WARN_FLAGSET_NOT_CONFIGURED = exports.WARN_LOWERCASE_FLAGSET = exports.WARN_INVALID_FLAGSET = exports.STREAMING_PARSING_SPLIT_UPDATE = exports.STREAMING_PARSING_MY_SEGMENTS_UPDATE_V2 = exports.WARN_SDK_KEY = exports.WARN_SPLITS_FILTER_EMPTY = exports.WARN_SPLITS_FILTER_INVALID = exports.WARN_SPLITS_FILTER_IGNORED = exports.WARN_INTEGRATION_INVALID = exports.WARN_NOT_EXISTENT_TT = exports.WARN_LOWERCASE_TRAFFIC_TYPE = exports.WARN_NOT_EXISTENT_SPLIT = exports.WARN_TRIMMING = exports.WARN_CONVERTING = exports.WARN_TRIMMING_PROPERTIES = exports.WARN_SETTING_NULL = exports.SUBMITTERS_PUSH_RETRY = exports.SUBMITTERS_PUSH_FAILS = exports.STREAMING_FALLBACK = exports.STREAMING_PARSING_MESSAGE_FAILS = exports.STREAMING_PARSING_ERROR_FAILS = exports.SYNC_SPLITS_FETCH_FAILS = exports.SYNC_MYSEGMENTS_FETCH_RETRY = exports.CLIENT_NOT_READY = exports.CLIENT_NO_LISTENER = exports.ENGINE_VALUE_NO_ATTRIBUTES = void 0;
5
5
  exports.LOG_PREFIX_CLEANUP = exports.LOG_PREFIX_UNIQUE_KEYS_TRACKER = exports.LOG_PREFIX_EVENTS_TRACKER = exports.LOG_PREFIX_IMPRESSIONS_TRACKER = exports.LOG_PREFIX_SYNC_SUBMITTERS = exports.LOG_PREFIX_SYNC_POLLING = exports.LOG_PREFIX_SYNC_MYSEGMENTS = exports.LOG_PREFIX_SYNC_SEGMENTS = exports.LOG_PREFIX_SYNC_SPLITS = exports.LOG_PREFIX_SYNC_STREAMING = exports.LOG_PREFIX_SYNC_OFFLINE = exports.LOG_PREFIX_SYNC_MANAGER = exports.LOG_PREFIX_SYNC = exports.LOG_PREFIX_ENGINE_VALUE = exports.LOG_PREFIX_ENGINE_MATCHER = exports.LOG_PREFIX_ENGINE_COMBINER = exports.LOG_PREFIX_ENGINE = exports.LOG_PREFIX_CLIENT_INSTANTIATION = exports.LOG_PREFIX_INSTANTIATION = exports.LOG_PREFIX_SETTINGS = exports.ENGINE_MATCHER_ERROR = exports.ERROR_SETS_FILTER_EXCLUSIVE = exports.ERROR_TOO_MANY_SETS = exports.ERROR_MIN_CONFIG_PARAM = exports.ERROR_NOT_BOOLEAN = exports.ERROR_STORAGE_INVALID = exports.ERROR_LOCALHOST_MODULE_REQUIRED = exports.ERROR_HTTP = void 0;
6
6
  /**
7
7
  * Message codes used to trim string log messages from commons and client-side API modules,
@@ -82,7 +82,7 @@ exports.WARN_SPLITS_FILTER_IGNORED = 219;
82
82
  exports.WARN_SPLITS_FILTER_INVALID = 220;
83
83
  exports.WARN_SPLITS_FILTER_EMPTY = 221;
84
84
  exports.WARN_SDK_KEY = 222;
85
- exports.STREAMING_PARSING_MEMBERSHIPS_UPDATE = 223;
85
+ exports.STREAMING_PARSING_MY_SEGMENTS_UPDATE_V2 = 223;
86
86
  exports.STREAMING_PARSING_SPLIT_UPDATE = 224;
87
87
  exports.WARN_INVALID_FLAGSET = 225;
88
88
  exports.WARN_LOWERCASE_FLAGSET = 226;
@@ -24,7 +24,7 @@ exports.codesInfo = warn_1.codesWarn.concat([
24
24
  [c.POLLING_START, c.LOG_PREFIX_SYNC_POLLING + 'Starting polling'],
25
25
  [c.POLLING_STOP, c.LOG_PREFIX_SYNC_POLLING + 'Stopping polling'],
26
26
  [c.SYNC_SPLITS_FETCH_RETRY, c.LOG_PREFIX_SYNC_SPLITS + 'Retrying download of feature flags #%s. Reason: %s'],
27
- [c.SUBMITTERS_PUSH_FULL_QUEUE, c.LOG_PREFIX_SYNC_SUBMITTERS + 'Flushing full %s queue and resetting timer.'],
27
+ [c.SUBMITTERS_PUSH_FULL_QUEUE, c.LOG_PREFIX_SYNC_SUBMITTERS + 'Flushing full %s queue and reseting timer.'],
28
28
  [c.SUBMITTERS_PUSH, c.LOG_PREFIX_SYNC_SUBMITTERS + 'Pushing %s.'],
29
29
  [c.STREAMING_REFRESH_TOKEN, c.LOG_PREFIX_SYNC_STREAMING + 'Refreshing streaming token in %s seconds, and connecting streaming in %s seconds.'],
30
30
  [c.STREAMING_RECONNECT, c.LOG_PREFIX_SYNC_STREAMING + 'Attempting to reconnect streaming in %s seconds.'],
@@ -34,7 +34,7 @@ exports.codesWarn = error_1.codesError.concat([
34
34
  [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 ("bySet", "byName" or "byPrefix") and a list of "values".'],
35
35
  [c.WARN_SPLITS_FILTER_EMPTY, c.LOG_PREFIX_SETTINGS + ': feature flag filter configuration must be a non-empty array of filter objects.'],
36
36
  [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'],
37
- [c.STREAMING_PARSING_MEMBERSHIPS_UPDATE, c.LOG_PREFIX_SYNC_STREAMING + 'Fetching Memberships due to an error processing %s notification: %s'],
37
+ [c.STREAMING_PARSING_MY_SEGMENTS_UPDATE_V2, c.LOG_PREFIX_SYNC_STREAMING + 'Fetching MySegments due to an error processing %s notification: %s'],
38
38
  [c.STREAMING_PARSING_SPLIT_UPDATE, c.LOG_PREFIX_SYNC_STREAMING + 'Fetching SplitChanges due to an error processing SPLIT_UPDATE notification: %s'],
39
39
  [c.WARN_INVALID_FLAGSET, '%s: you passed %s, flag set must adhere to the regular expressions %s. This means a flag set must start with a letter or number, be in lowercase, alphanumeric and have a max length of 50 characters. %s was discarded.'],
40
40
  [c.WARN_LOWERCASE_FLAGSET, '%s: flag set %s should be all lowercase - converting string to lowercase.'],
@@ -7,11 +7,9 @@ function splitsEventEmitterFactory(EventEmitter) {
7
7
  var splitsEventEmitter = (0, objectAssign_1.objectAssign)(new EventEmitter(), {
8
8
  splitsArrived: false,
9
9
  splitsCacheLoaded: false,
10
- initialized: false,
11
- initCallbacks: []
12
10
  });
13
11
  // `isSplitKill` condition avoids an edge-case of wrongly emitting SDK_READY if:
14
- // - `/memberships` fetch and SPLIT_KILL occurs before `/splitChanges` fetch, and
12
+ // - `/mySegments` fetch and SPLIT_KILL occurs before `/splitChanges` fetch, and
15
13
  // - storage has cached splits (for which case `splitsStorage.killLocally` can return true)
16
14
  splitsEventEmitter.on(constants_1.SDK_SPLITS_ARRIVED, function (isSplitKill) { if (!isSplitKill)
17
15
  splitsEventEmitter.splitsArrived = true; });
@@ -28,9 +26,9 @@ function segmentsEventEmitterFactory(EventEmitter) {
28
26
  /**
29
27
  * Factory of readiness manager, which handles the ready / update event propagation.
30
28
  */
31
- function readinessManagerFactory(EventEmitter, settings, splits) {
29
+ function readinessManagerFactory(EventEmitter, readyTimeout, splits) {
30
+ if (readyTimeout === void 0) { readyTimeout = 0; }
32
31
  if (splits === void 0) { splits = splitsEventEmitterFactory(EventEmitter); }
33
- var readyTimeout = settings.startup.readyTimeout;
34
32
  var segments = segmentsEventEmitterFactory(EventEmitter);
35
33
  var gate = new EventEmitter();
36
34
  var lastUpdate = 0;
@@ -48,7 +46,7 @@ function readinessManagerFactory(EventEmitter, settings, splits) {
48
46
  // emit SDK_READY_TIMED_OUT
49
47
  var hasTimedout = false;
50
48
  function timeout() {
51
- if (hasTimedout || isReady)
49
+ if (hasTimedout)
52
50
  return;
53
51
  hasTimedout = true;
54
52
  syncLastUpdate();
@@ -56,10 +54,7 @@ function readinessManagerFactory(EventEmitter, settings, splits) {
56
54
  }
57
55
  var readyTimeoutId;
58
56
  if (readyTimeout > 0) {
59
- if (splits.initialized)
60
- readyTimeoutId = setTimeout(timeout, readyTimeout);
61
- else
62
- splits.initCallbacks.push(function () { readyTimeoutId = setTimeout(timeout, readyTimeout); });
57
+ readyTimeoutId = setTimeout(timeout, readyTimeout);
63
58
  }
64
59
  // emit SDK_READY and SDK_UPDATE
65
60
  var isReady = false;
@@ -111,9 +106,10 @@ function readinessManagerFactory(EventEmitter, settings, splits) {
111
106
  splits: splits,
112
107
  segments: segments,
113
108
  gate: gate,
114
- shared: function () {
109
+ shared: function (readyTimeout) {
110
+ if (readyTimeout === void 0) { readyTimeout = 0; }
115
111
  refCount++;
116
- return readinessManagerFactory(EventEmitter, settings, splits);
112
+ return readinessManagerFactory(EventEmitter, readyTimeout, splits);
117
113
  },
118
114
  // @TODO review/remove next methods when non-recoverable errors are reworked
119
115
  // Called on consumer mode, when storage fails to connect
@@ -121,12 +117,6 @@ function readinessManagerFactory(EventEmitter, settings, splits) {
121
117
  // Called on 403 error (client-side SDK key on server-side), to set the SDK as destroyed for
122
118
  // tracking and evaluations, while keeping event listeners to emit SDK_READY_TIMED_OUT event
123
119
  setDestroyed: function () { isDestroyed = true; },
124
- init: function () {
125
- if (splits.initialized)
126
- return;
127
- splits.initialized = true;
128
- splits.initCallbacks.forEach(function (cb) { return cb(); });
129
- },
130
120
  destroy: function () {
131
121
  isDestroyed = true;
132
122
  syncLastUpdate();
@@ -15,9 +15,9 @@ var REMOVE_LISTENER_EVENT = 'removeListener';
15
15
  * @param readyTimeout time in millis to emit SDK_READY_TIME_OUT event
16
16
  * @param readinessManager optional readinessManager to use. only used internally for `shared` method
17
17
  */
18
- function sdkReadinessManagerFactory(EventEmitter, settings, readinessManager) {
19
- if (readinessManager === void 0) { readinessManager = (0, readinessManager_1.readinessManagerFactory)(EventEmitter, settings); }
20
- var log = settings.log;
18
+ function sdkReadinessManagerFactory(log, EventEmitter, readyTimeout, readinessManager) {
19
+ if (readyTimeout === void 0) { readyTimeout = 0; }
20
+ if (readinessManager === void 0) { readinessManager = (0, readinessManager_1.readinessManagerFactory)(EventEmitter, readyTimeout); }
21
21
  /** Ready callback warning */
22
22
  var internalReadyCbCount = 0;
23
23
  var readyCbCount = 0;
@@ -60,8 +60,9 @@ function sdkReadinessManagerFactory(EventEmitter, settings, readinessManager) {
60
60
  }
61
61
  return {
62
62
  readinessManager: readinessManager,
63
- shared: function () {
64
- return sdkReadinessManagerFactory(EventEmitter, settings, readinessManager.shared());
63
+ shared: function (readyTimeout) {
64
+ if (readyTimeout === void 0) { readyTimeout = 0; }
65
+ return sdkReadinessManagerFactory(log, EventEmitter, readyTimeout, readinessManager.shared(readyTimeout));
65
66
  },
66
67
  incInternalReadyCbCount: function () {
67
68
  internalReadyCbCount++;
@@ -53,11 +53,11 @@ function sdkClientFactory(params, isSharedClient) {
53
53
  // Stop background jobs
54
54
  syncManager && syncManager.stop();
55
55
  return __flush().then(function () {
56
- // For main client, cleanup event listeners and scheduled jobs
57
- if (!isSharedClient) {
58
- signalListener && signalListener.stop();
59
- uniqueKeysTracker && uniqueKeysTracker.stop();
60
- }
56
+ // Cleanup event listeners
57
+ signalListener && signalListener.stop();
58
+ // @TODO stop only if last client is destroyed
59
+ if (uniqueKeysTracker)
60
+ uniqueKeysTracker.stop();
61
61
  // Cleanup storage
62
62
  return storage.destroy();
63
63
  });
@@ -4,13 +4,11 @@ exports.sdkClientMethodFactory = void 0;
4
4
  var sdkClient_1 = require("./sdkClient");
5
5
  var constants_1 = require("../logger/constants");
6
6
  /**
7
- * Factory of client method for server-side SDKs
7
+ * Factory of client method for server-side SDKs (ISDK and IAsyncSDK)
8
8
  */
9
9
  function sdkClientMethodFactory(params) {
10
10
  var log = params.settings.log;
11
11
  var clientInstance = (0, sdkClient_1.sdkClientFactory)(params);
12
- // Only one client in server-side without bound key
13
- params.clients[''] = clientInstance;
14
12
  return function client() {
15
13
  if (arguments.length > 0) {
16
14
  throw new Error('Shared Client not supported by the storage mechanism. Create isolated instances instead.');
@@ -8,18 +8,22 @@ var sdkClient_1 = require("./sdkClient");
8
8
  var objectAssign_1 = require("../utils/lang/objectAssign");
9
9
  var constants_1 = require("../logger/constants");
10
10
  var constants_2 = require("../readiness/constants");
11
- var identity_1 = require("./identity");
11
+ function buildInstanceId(key) {
12
+ // @ts-ignore
13
+ return (key.matchingKey ? key.matchingKey : key) + "-" + (key.bucketingKey ? key.bucketingKey : key) + "-";
14
+ }
12
15
  /**
13
16
  * Factory of client method for the client-side API variant where TT is ignored.
14
17
  * Therefore, clients don't have a bound TT for the track method.
15
18
  */
16
19
  function sdkClientMethodCSFactory(params) {
17
- var clients = params.clients, storage = params.storage, syncManager = params.syncManager, sdkReadinessManager = params.sdkReadinessManager, _a = params.settings, key = _a.core.key, log = _a.log;
20
+ var storage = params.storage, syncManager = params.syncManager, sdkReadinessManager = params.sdkReadinessManager, _a = params.settings, key = _a.core.key, readyTimeout = _a.startup.readyTimeout, log = _a.log;
18
21
  var mainClientInstance = (0, clientCS_1.clientCSDecorator)(log, (0, sdkClient_1.sdkClientFactory)(params), key);
19
22
  var parsedDefaultKey = (0, key_2.keyParser)(key);
20
- var defaultInstanceId = (0, identity_1.buildInstanceId)(parsedDefaultKey);
23
+ var defaultInstanceId = buildInstanceId(parsedDefaultKey);
21
24
  // Cache instances created per factory.
22
- clients[defaultInstanceId] = mainClientInstance;
25
+ var clientInstances = {};
26
+ clientInstances[defaultInstanceId] = mainClientInstance;
23
27
  return function client(key) {
24
28
  if (key === undefined) {
25
29
  log.debug(constants_1.RETRIEVE_CLIENT_DEFAULT);
@@ -30,10 +34,10 @@ function sdkClientMethodCSFactory(params) {
30
34
  if (validKey === false) {
31
35
  throw new Error('Shared Client needs a valid key.');
32
36
  }
33
- var instanceId = (0, identity_1.buildInstanceId)(validKey);
34
- if (!clients[instanceId]) {
37
+ var instanceId = buildInstanceId(validKey);
38
+ if (!clientInstances[instanceId]) {
35
39
  var matchingKey = (0, key_2.getMatching)(validKey);
36
- var sharedSdkReadiness_1 = sdkReadinessManager.shared();
40
+ var sharedSdkReadiness_1 = sdkReadinessManager.shared(readyTimeout);
37
41
  var sharedStorage = storage.shared && storage.shared(matchingKey, function (err) {
38
42
  if (err) {
39
43
  sharedSdkReadiness_1.readinessManager.timeout();
@@ -50,17 +54,19 @@ function sdkClientMethodCSFactory(params) {
50
54
  var sharedSyncManager = syncManager && sharedStorage && syncManager.shared(matchingKey, sharedSdkReadiness_1.readinessManager, sharedStorage);
51
55
  // As shared clients reuse all the storage information, we don't need to check here if we
52
56
  // will use offline or online mode. We should stick with the original decision.
53
- clients[instanceId] = (0, clientCS_1.clientCSDecorator)(log, (0, sdkClient_1.sdkClientFactory)((0, objectAssign_1.objectAssign)({}, params, {
57
+ clientInstances[instanceId] = (0, clientCS_1.clientCSDecorator)(log, (0, sdkClient_1.sdkClientFactory)((0, objectAssign_1.objectAssign)({}, params, {
54
58
  sdkReadinessManager: sharedSdkReadiness_1,
55
59
  storage: sharedStorage || storage,
56
60
  syncManager: sharedSyncManager,
61
+ signalListener: undefined, // only the main client "destroy" method stops the signal listener
57
62
  }), true), validKey);
63
+ sharedSyncManager && sharedSyncManager.start();
58
64
  log.info(constants_1.NEW_SHARED_CLIENT);
59
65
  }
60
66
  else {
61
67
  log.debug(constants_1.RETRIEVE_CLIENT_EXISTING);
62
68
  }
63
- return clients[instanceId];
69
+ return clientInstances[instanceId];
64
70
  };
65
71
  }
66
72
  exports.sdkClientMethodCSFactory = sdkClientMethodCSFactory;
@@ -9,19 +9,23 @@ var sdkClient_1 = require("./sdkClient");
9
9
  var objectAssign_1 = require("../utils/lang/objectAssign");
10
10
  var constants_1 = require("../logger/constants");
11
11
  var constants_2 = require("../readiness/constants");
12
- var identity_1 = require("./identity");
12
+ function buildInstanceId(key, trafficType) {
13
+ // @ts-ignore
14
+ return (key.matchingKey ? key.matchingKey : key) + "-" + (key.bucketingKey ? key.bucketingKey : key) + "-" + (trafficType !== undefined ? trafficType : '');
15
+ }
13
16
  /**
14
17
  * Factory of client method for the client-side (browser) variant of the Isomorphic JS SDK,
15
18
  * where clients can have a bound TT for the track method, which is provided via the settings
16
19
  * (default client) or the client method (shared clients).
17
20
  */
18
21
  function sdkClientMethodCSFactory(params) {
19
- var clients = params.clients, storage = params.storage, syncManager = params.syncManager, sdkReadinessManager = params.sdkReadinessManager, _a = params.settings, _b = _a.core, key = _b.key, trafficType = _b.trafficType, log = _a.log;
22
+ var storage = params.storage, syncManager = params.syncManager, sdkReadinessManager = params.sdkReadinessManager, _a = params.settings, _b = _a.core, key = _b.key, trafficType = _b.trafficType, readyTimeout = _a.startup.readyTimeout, log = _a.log;
20
23
  var mainClientInstance = (0, clientCS_1.clientCSDecorator)(log, (0, sdkClient_1.sdkClientFactory)(params), key, trafficType);
21
24
  var parsedDefaultKey = (0, key_2.keyParser)(key);
22
- var defaultInstanceId = (0, identity_1.buildInstanceId)(parsedDefaultKey, trafficType);
25
+ var defaultInstanceId = buildInstanceId(parsedDefaultKey, trafficType);
23
26
  // Cache instances created per factory.
24
- clients[defaultInstanceId] = mainClientInstance;
27
+ var clientInstances = {};
28
+ clientInstances[defaultInstanceId] = mainClientInstance;
25
29
  return function client(key, trafficType) {
26
30
  if (key === undefined) {
27
31
  log.debug(constants_1.RETRIEVE_CLIENT_DEFAULT);
@@ -39,10 +43,10 @@ function sdkClientMethodCSFactory(params) {
39
43
  throw new Error('Shared Client needs a valid traffic type or no traffic type at all.');
40
44
  }
41
45
  }
42
- var instanceId = (0, identity_1.buildInstanceId)(validKey, validTrafficType);
43
- if (!clients[instanceId]) {
46
+ var instanceId = buildInstanceId(validKey, validTrafficType);
47
+ if (!clientInstances[instanceId]) {
44
48
  var matchingKey = (0, key_2.getMatching)(validKey);
45
- var sharedSdkReadiness_1 = sdkReadinessManager.shared();
49
+ var sharedSdkReadiness_1 = sdkReadinessManager.shared(readyTimeout);
46
50
  var sharedStorage = storage.shared && storage.shared(matchingKey, function (err) {
47
51
  if (err) {
48
52
  sharedSdkReadiness_1.readinessManager.timeout();
@@ -59,17 +63,19 @@ function sdkClientMethodCSFactory(params) {
59
63
  var sharedSyncManager = syncManager && sharedStorage && syncManager.shared(matchingKey, sharedSdkReadiness_1.readinessManager, sharedStorage);
60
64
  // As shared clients reuse all the storage information, we don't need to check here if we
61
65
  // will use offline or online mode. We should stick with the original decision.
62
- clients[instanceId] = (0, clientCS_1.clientCSDecorator)(log, (0, sdkClient_1.sdkClientFactory)((0, objectAssign_1.objectAssign)({}, params, {
66
+ clientInstances[instanceId] = (0, clientCS_1.clientCSDecorator)(log, (0, sdkClient_1.sdkClientFactory)((0, objectAssign_1.objectAssign)({}, params, {
63
67
  sdkReadinessManager: sharedSdkReadiness_1,
64
68
  storage: sharedStorage || storage,
65
69
  syncManager: sharedSyncManager,
70
+ signalListener: undefined, // only the main client "destroy" method stops the signal listener
66
71
  }), true), validKey, validTrafficType);
72
+ sharedSyncManager && sharedSyncManager.start();
67
73
  log.info(constants_1.NEW_SHARED_CLIENT);
68
74
  }
69
75
  else {
70
76
  log.debug(constants_1.RETRIEVE_CLIENT_EXISTING);
71
77
  }
72
- return clients[instanceId];
78
+ return clientInstances[instanceId];
73
79
  };
74
80
  }
75
81
  exports.sdkClientMethodCSFactory = sdkClientMethodCSFactory;