@splitsoftware/splitio-commons 2.0.0-rc.3 → 2.0.0-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 (527) hide show
  1. package/CHANGES.txt +1 -0
  2. package/cjs/integrations/pluggable.js +2 -2
  3. package/cjs/logger/sdkLogger.js +2 -2
  4. package/cjs/readiness/sdkReadinessManager.js +2 -21
  5. package/cjs/sdkClient/client.js +0 -1
  6. package/cjs/sdkClient/clientAttributesDecoration.js +9 -9
  7. package/cjs/sdkClient/clientCS.js +2 -2
  8. package/cjs/services/splitApi.js +13 -13
  9. package/cjs/services/splitHttpClient.js +2 -2
  10. package/cjs/storages/AbstractSplitsCacheAsync.js +1 -4
  11. package/cjs/storages/AbstractSplitsCacheSync.js +1 -4
  12. package/cjs/storages/dataLoader.js +5 -6
  13. package/cjs/storages/findLatencyIndex.js +1 -1
  14. package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +1 -6
  15. package/cjs/storages/inMemory/AttributesCacheInMemory.js +10 -10
  16. package/cjs/storages/inMemory/EventsCacheInMemory.js +1 -1
  17. package/cjs/storages/inMemory/ImpressionsCacheInMemory.js +1 -1
  18. package/cjs/storages/inMemory/InMemoryStorage.js +1 -1
  19. package/cjs/storages/inMemory/InMemoryStorageCS.js +1 -1
  20. package/cjs/storages/inMemory/UniqueKeysCacheInMemoryCS.js +1 -1
  21. package/cjs/storages/inRedis/SplitsCacheInRedis.js +1 -3
  22. package/cjs/storages/inRedis/TelemetryCacheInRedis.js +3 -3
  23. package/cjs/storages/inRedis/UniqueKeysCacheInRedis.js +1 -1
  24. package/cjs/storages/pluggable/EventsCachePluggable.js +1 -1
  25. package/cjs/storages/pluggable/ImpressionsCachePluggable.js +1 -1
  26. package/cjs/storages/pluggable/SegmentsCachePluggable.js +1 -1
  27. package/cjs/storages/pluggable/SplitsCachePluggable.js +3 -3
  28. package/cjs/storages/pluggable/TelemetryCachePluggable.js +3 -3
  29. package/cjs/storages/pluggable/UniqueKeysCachePluggable.js +1 -1
  30. package/cjs/storages/pluggable/inMemoryWrapper.js +1 -1
  31. package/cjs/storages/pluggable/index.js +1 -1
  32. package/cjs/storages/pluggable/wrapperAdapter.js +2 -2
  33. package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +1 -1
  34. package/cjs/sync/offline/syncManagerOffline.js +1 -1
  35. package/cjs/sync/polling/updaters/mySegmentsUpdater.js +3 -3
  36. package/cjs/sync/polling/updaters/segmentChangesUpdater.js +8 -8
  37. package/cjs/sync/polling/updaters/splitChangesUpdater.js +13 -13
  38. package/cjs/sync/streaming/AuthClient/index.js +2 -2
  39. package/cjs/sync/streaming/SSEClient/index.js +4 -7
  40. package/cjs/sync/streaming/SSEHandler/NotificationKeeper.js +1 -1
  41. package/cjs/sync/streaming/SSEHandler/NotificationParser.js +5 -4
  42. package/cjs/sync/streaming/SSEHandler/index.js +2 -2
  43. package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +3 -3
  44. package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -2
  45. package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +4 -4
  46. package/cjs/sync/streaming/parseUtils.js +13 -13
  47. package/cjs/sync/syncManagerOnline.js +2 -2
  48. package/cjs/sync/syncTask.js +4 -4
  49. package/cjs/trackers/eventTracker.js +2 -2
  50. package/cjs/trackers/impressionsTracker.js +5 -5
  51. package/cjs/trackers/strategy/strategyDebug.js +1 -1
  52. package/cjs/trackers/strategy/strategyNone.js +2 -2
  53. package/cjs/trackers/strategy/strategyOptimized.js +2 -2
  54. package/cjs/trackers/uniqueKeysTracker.js +3 -3
  55. package/cjs/utils/Backoff.js +0 -4
  56. package/cjs/utils/Semver.js +1 -1
  57. package/cjs/utils/base64/index.js +2 -2
  58. package/cjs/utils/decompress/index.js +4 -4
  59. package/cjs/utils/lang/binarySearch.js +2 -2
  60. package/cjs/utils/murmur3/murmur3_128.js +1 -1
  61. package/cjs/utils/murmur3/murmur3_128_x86.js +1 -1
  62. package/cjs/utils/murmur3/murmur3_64.js +1 -1
  63. package/cjs/utils/murmur3/utfx.js +10 -17
  64. package/cjs/utils/promise/wrapper.js +2 -2
  65. package/cjs/utils/settingsValidation/index.js +2 -2
  66. package/cjs/utils/settingsValidation/integrations/common.js +4 -4
  67. package/cjs/utils/settingsValidation/integrations/configurable.js +3 -3
  68. package/cjs/utils/settingsValidation/integrations/pluggable.js +2 -2
  69. package/cjs/utils/settingsValidation/logger/builtinLogger.js +1 -1
  70. package/cjs/utils/settingsValidation/logger/commons.js +1 -1
  71. package/cjs/utils/settingsValidation/logger/pluggableLogger.js +1 -1
  72. package/cjs/utils/settingsValidation/splitFilters.js +8 -11
  73. package/cjs/utils/settingsValidation/storage/storageCS.js +2 -2
  74. package/cjs/utils/settingsValidation/url.js +3 -3
  75. package/esm/integrations/pluggable.js +2 -2
  76. package/esm/logger/sdkLogger.js +2 -2
  77. package/esm/readiness/sdkReadinessManager.js +2 -21
  78. package/esm/sdkClient/client.js +0 -1
  79. package/esm/sdkClient/clientAttributesDecoration.js +9 -9
  80. package/esm/sdkClient/clientCS.js +2 -2
  81. package/esm/services/splitApi.js +13 -13
  82. package/esm/services/splitHttpClient.js +2 -2
  83. package/esm/storages/AbstractSplitsCacheAsync.js +1 -4
  84. package/esm/storages/AbstractSplitsCacheSync.js +1 -4
  85. package/esm/storages/dataLoader.js +5 -6
  86. package/esm/storages/findLatencyIndex.js +1 -1
  87. package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +1 -6
  88. package/esm/storages/inMemory/AttributesCacheInMemory.js +10 -10
  89. package/esm/storages/inMemory/EventsCacheInMemory.js +1 -1
  90. package/esm/storages/inMemory/ImpressionsCacheInMemory.js +1 -1
  91. package/esm/storages/inMemory/InMemoryStorage.js +1 -1
  92. package/esm/storages/inMemory/InMemoryStorageCS.js +1 -1
  93. package/esm/storages/inMemory/UniqueKeysCacheInMemoryCS.js +1 -1
  94. package/esm/storages/inRedis/SplitsCacheInRedis.js +1 -3
  95. package/esm/storages/inRedis/TelemetryCacheInRedis.js +3 -3
  96. package/esm/storages/inRedis/UniqueKeysCacheInRedis.js +1 -1
  97. package/esm/storages/pluggable/EventsCachePluggable.js +1 -1
  98. package/esm/storages/pluggable/ImpressionsCachePluggable.js +1 -1
  99. package/esm/storages/pluggable/SegmentsCachePluggable.js +1 -1
  100. package/esm/storages/pluggable/SplitsCachePluggable.js +3 -3
  101. package/esm/storages/pluggable/TelemetryCachePluggable.js +3 -3
  102. package/esm/storages/pluggable/UniqueKeysCachePluggable.js +1 -1
  103. package/esm/storages/pluggable/inMemoryWrapper.js +1 -1
  104. package/esm/storages/pluggable/index.js +1 -1
  105. package/esm/storages/pluggable/wrapperAdapter.js +2 -2
  106. package/esm/sync/offline/splitsParser/splitsParserFromSettings.js +1 -1
  107. package/esm/sync/offline/syncManagerOffline.js +1 -1
  108. package/esm/sync/polling/updaters/mySegmentsUpdater.js +3 -3
  109. package/esm/sync/polling/updaters/segmentChangesUpdater.js +8 -8
  110. package/esm/sync/polling/updaters/splitChangesUpdater.js +13 -13
  111. package/esm/sync/streaming/AuthClient/index.js +2 -2
  112. package/esm/sync/streaming/SSEClient/index.js +4 -7
  113. package/esm/sync/streaming/SSEHandler/NotificationKeeper.js +1 -1
  114. package/esm/sync/streaming/SSEHandler/NotificationParser.js +5 -4
  115. package/esm/sync/streaming/SSEHandler/index.js +2 -2
  116. package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +3 -3
  117. package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -2
  118. package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +4 -4
  119. package/esm/sync/streaming/parseUtils.js +13 -13
  120. package/esm/sync/syncManagerOnline.js +2 -2
  121. package/esm/sync/syncTask.js +4 -4
  122. package/esm/trackers/eventTracker.js +2 -2
  123. package/esm/trackers/impressionsTracker.js +5 -5
  124. package/esm/trackers/strategy/strategyDebug.js +1 -1
  125. package/esm/trackers/strategy/strategyNone.js +2 -2
  126. package/esm/trackers/strategy/strategyOptimized.js +2 -2
  127. package/esm/trackers/uniqueKeysTracker.js +3 -3
  128. package/esm/utils/Backoff.js +0 -4
  129. package/esm/utils/Semver.js +1 -1
  130. package/esm/utils/base64/index.js +2 -2
  131. package/esm/utils/decompress/index.js +4 -4
  132. package/esm/utils/lang/binarySearch.js +2 -2
  133. package/esm/utils/murmur3/murmur3_128.js +1 -1
  134. package/esm/utils/murmur3/murmur3_128_x86.js +1 -1
  135. package/esm/utils/murmur3/murmur3_64.js +1 -1
  136. package/esm/utils/murmur3/utfx.js +10 -17
  137. package/esm/utils/promise/wrapper.js +2 -2
  138. package/esm/utils/settingsValidation/index.js +2 -2
  139. package/esm/utils/settingsValidation/integrations/common.js +4 -4
  140. package/esm/utils/settingsValidation/integrations/configurable.js +3 -3
  141. package/esm/utils/settingsValidation/integrations/pluggable.js +2 -2
  142. package/esm/utils/settingsValidation/logger/builtinLogger.js +1 -1
  143. package/esm/utils/settingsValidation/logger/commons.js +1 -1
  144. package/esm/utils/settingsValidation/logger/pluggableLogger.js +1 -1
  145. package/esm/utils/settingsValidation/splitFilters.js +8 -11
  146. package/esm/utils/settingsValidation/storage/storageCS.js +2 -2
  147. package/esm/utils/settingsValidation/url.js +3 -3
  148. package/package.json +5 -3
  149. package/src/dtos/types.ts +1 -1
  150. package/src/evaluator/Engine.ts +1 -1
  151. package/src/evaluator/combiners/ifelseif.ts +1 -1
  152. package/src/evaluator/condition/index.ts +1 -1
  153. package/src/evaluator/index.ts +1 -1
  154. package/src/evaluator/parser/index.ts +1 -1
  155. package/src/evaluator/types.ts +1 -1
  156. package/src/evaluator/value/index.ts +1 -1
  157. package/src/evaluator/value/sanitize.ts +1 -1
  158. package/src/integrations/pluggable.ts +3 -3
  159. package/src/integrations/types.ts +3 -2
  160. package/src/listeners/browser.ts +3 -2
  161. package/src/logger/index.ts +6 -6
  162. package/src/logger/sdkLogger.ts +4 -4
  163. package/src/logger/types.ts +11 -13
  164. package/src/readiness/readinessManager.ts +5 -4
  165. package/src/readiness/sdkReadinessManager.ts +6 -23
  166. package/src/readiness/types.ts +5 -4
  167. package/src/sdkClient/client.ts +7 -8
  168. package/src/sdkClient/clientAttributesDecoration.ts +11 -11
  169. package/src/sdkClient/clientCS.ts +5 -5
  170. package/src/sdkClient/clientInputValidation.ts +3 -2
  171. package/src/sdkClient/identity.ts +1 -1
  172. package/src/sdkClient/sdkClient.ts +3 -3
  173. package/src/sdkClient/sdkClientMethod.ts +2 -2
  174. package/src/sdkClient/sdkClientMethodCS.ts +5 -5
  175. package/src/sdkFactory/index.ts +3 -3
  176. package/src/sdkFactory/types.ts +7 -6
  177. package/src/sdkManager/index.ts +2 -1
  178. package/src/services/splitApi.ts +13 -13
  179. package/src/services/splitHttpClient.ts +2 -2
  180. package/src/storages/AbstractMySegmentsCacheSync.ts +1 -1
  181. package/src/storages/AbstractSplitsCacheAsync.ts +1 -4
  182. package/src/storages/AbstractSplitsCacheSync.ts +1 -4
  183. package/src/storages/dataLoader.ts +7 -8
  184. package/src/storages/findLatencyIndex.ts +1 -1
  185. package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +1 -6
  186. package/src/storages/inMemory/AttributesCacheInMemory.ts +11 -11
  187. package/src/storages/inMemory/EventsCacheInMemory.ts +2 -2
  188. package/src/storages/inMemory/ImpressionsCacheInMemory.ts +5 -5
  189. package/src/storages/inMemory/InMemoryStorage.ts +1 -1
  190. package/src/storages/inMemory/InMemoryStorageCS.ts +1 -1
  191. package/src/storages/inMemory/UniqueKeysCacheInMemoryCS.ts +1 -1
  192. package/src/storages/inRedis/EventsCacheInRedis.ts +1 -1
  193. package/src/storages/inRedis/ImpressionsCacheInRedis.ts +2 -2
  194. package/src/storages/inRedis/SplitsCacheInRedis.ts +1 -3
  195. package/src/storages/inRedis/TelemetryCacheInRedis.ts +3 -3
  196. package/src/storages/inRedis/UniqueKeysCacheInRedis.ts +1 -1
  197. package/src/storages/pluggable/EventsCachePluggable.ts +2 -2
  198. package/src/storages/pluggable/ImpressionsCachePluggable.ts +3 -3
  199. package/src/storages/pluggable/SegmentsCachePluggable.ts +1 -1
  200. package/src/storages/pluggable/SplitsCachePluggable.ts +3 -3
  201. package/src/storages/pluggable/TelemetryCachePluggable.ts +3 -3
  202. package/src/storages/pluggable/UniqueKeysCachePluggable.ts +1 -1
  203. package/src/storages/pluggable/inMemoryWrapper.ts +1 -1
  204. package/src/storages/pluggable/index.ts +1 -1
  205. package/src/storages/pluggable/wrapperAdapter.ts +2 -2
  206. package/src/storages/types.ts +51 -68
  207. package/src/storages/utils.ts +3 -2
  208. package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +3 -3
  209. package/src/sync/offline/syncManagerOffline.ts +1 -1
  210. package/src/sync/polling/updaters/mySegmentsUpdater.ts +3 -3
  211. package/src/sync/polling/updaters/segmentChangesUpdater.ts +8 -8
  212. package/src/sync/polling/updaters/splitChangesUpdater.ts +13 -13
  213. package/src/sync/streaming/AuthClient/index.ts +2 -2
  214. package/src/sync/streaming/SSEClient/index.ts +4 -7
  215. package/src/sync/streaming/SSEHandler/NotificationKeeper.ts +1 -1
  216. package/src/sync/streaming/SSEHandler/NotificationParser.ts +5 -4
  217. package/src/sync/streaming/SSEHandler/index.ts +2 -2
  218. package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +3 -3
  219. package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +2 -2
  220. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +4 -4
  221. package/src/sync/streaming/parseUtils.ts +13 -13
  222. package/src/sync/streaming/types.ts +2 -2
  223. package/src/sync/submitters/impressionsSubmitter.ts +2 -2
  224. package/src/sync/submitters/telemetrySubmitter.ts +4 -3
  225. package/src/sync/submitters/types.ts +1 -1
  226. package/src/sync/syncManagerOnline.ts +2 -2
  227. package/src/sync/syncTask.ts +4 -4
  228. package/src/trackers/eventTracker.ts +4 -3
  229. package/src/trackers/impressionObserver/ImpressionObserver.ts +4 -4
  230. package/src/trackers/impressionObserver/buildKey.ts +2 -2
  231. package/src/trackers/impressionObserver/impressionObserverCS.ts +2 -2
  232. package/src/trackers/impressionObserver/impressionObserverSS.ts +2 -2
  233. package/src/trackers/impressionObserver/types.ts +2 -2
  234. package/src/trackers/impressionsTracker.ts +8 -7
  235. package/src/trackers/strategy/strategyDebug.ts +3 -3
  236. package/src/trackers/strategy/strategyNone.ts +4 -4
  237. package/src/trackers/strategy/strategyOptimized.ts +5 -5
  238. package/src/trackers/types.ts +5 -5
  239. package/src/trackers/uniqueKeysTracker.ts +3 -3
  240. package/src/types.ts +37 -1355
  241. package/src/utils/Backoff.ts +0 -4
  242. package/src/utils/MinEventEmitter.ts +2 -3
  243. package/src/utils/MinEvents.ts +2 -2
  244. package/src/utils/Semver.ts +1 -1
  245. package/src/utils/base64/index.ts +2 -2
  246. package/src/utils/constants/index.ts +9 -10
  247. package/src/utils/decompress/index.ts +4 -4
  248. package/src/utils/inputValidation/attributes.ts +1 -1
  249. package/src/utils/inputValidation/eventProperties.ts +1 -1
  250. package/src/utils/inputValidation/key.ts +1 -1
  251. package/src/utils/inputValidation/preloadedData.ts +1 -2
  252. package/src/utils/inputValidation/trafficTypeExistence.ts +2 -2
  253. package/src/utils/key/index.ts +1 -1
  254. package/src/utils/lang/binarySearch.ts +2 -2
  255. package/src/utils/murmur3/murmur3_128.ts +1 -1
  256. package/src/utils/murmur3/murmur3_128_x86.ts +1 -1
  257. package/src/utils/murmur3/murmur3_64.ts +1 -1
  258. package/src/utils/murmur3/utfx.ts +10 -17
  259. package/src/utils/promise/wrapper.ts +2 -2
  260. package/src/utils/settingsValidation/consent.ts +2 -2
  261. package/src/utils/settingsValidation/impressionsMode.ts +1 -1
  262. package/src/utils/settingsValidation/index.ts +2 -2
  263. package/src/utils/settingsValidation/integrations/common.ts +4 -4
  264. package/src/utils/settingsValidation/integrations/configurable.ts +3 -3
  265. package/src/utils/settingsValidation/integrations/pluggable.ts +2 -2
  266. package/src/utils/settingsValidation/logger/builtinLogger.ts +3 -3
  267. package/src/utils/settingsValidation/logger/commons.ts +3 -3
  268. package/src/utils/settingsValidation/logger/pluggableLogger.ts +3 -3
  269. package/src/utils/settingsValidation/splitFilters.ts +9 -12
  270. package/src/utils/settingsValidation/storage/storageCS.ts +5 -4
  271. package/src/utils/settingsValidation/url.ts +3 -3
  272. package/types/index.d.ts +5 -5
  273. package/types/splitio.d.ts +1941 -0
  274. package/types/consent/index.d.ts +0 -2
  275. package/types/consent/sdkUserConsent.d.ts +0 -13
  276. package/types/dtos/types.d.ts +0 -209
  277. package/types/evaluator/Engine.d.ts +0 -15
  278. package/types/evaluator/combiners/and.d.ts +0 -4
  279. package/types/evaluator/combiners/ifelseif.d.ts +0 -3
  280. package/types/evaluator/condition/engineUtils.d.ts +0 -11
  281. package/types/evaluator/condition/index.d.ts +0 -6
  282. package/types/evaluator/convertions/index.d.ts +0 -2
  283. package/types/evaluator/index.d.ts +0 -8
  284. package/types/evaluator/matchers/all.d.ts +0 -1
  285. package/types/evaluator/matchers/between.d.ts +0 -2
  286. package/types/evaluator/matchers/boolean.d.ts +0 -1
  287. package/types/evaluator/matchers/cont_all.d.ts +0 -1
  288. package/types/evaluator/matchers/cont_any.d.ts +0 -1
  289. package/types/evaluator/matchers/cont_str.d.ts +0 -1
  290. package/types/evaluator/matchers/dependency.d.ts +0 -5
  291. package/types/evaluator/matchers/eq.d.ts +0 -1
  292. package/types/evaluator/matchers/eq_set.d.ts +0 -1
  293. package/types/evaluator/matchers/ew.d.ts +0 -1
  294. package/types/evaluator/matchers/gte.d.ts +0 -1
  295. package/types/evaluator/matchers/index.d.ts +0 -7
  296. package/types/evaluator/matchers/large_segment.d.ts +0 -5
  297. package/types/evaluator/matchers/lte.d.ts +0 -1
  298. package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
  299. package/types/evaluator/matchers/part_of.d.ts +0 -1
  300. package/types/evaluator/matchers/segment.d.ts +0 -5
  301. package/types/evaluator/matchers/semver_between.d.ts +0 -2
  302. package/types/evaluator/matchers/semver_eq.d.ts +0 -1
  303. package/types/evaluator/matchers/semver_gte.d.ts +0 -1
  304. package/types/evaluator/matchers/semver_inlist.d.ts +0 -1
  305. package/types/evaluator/matchers/semver_lte.d.ts +0 -1
  306. package/types/evaluator/matchers/string.d.ts +0 -1
  307. package/types/evaluator/matchers/sw.d.ts +0 -1
  308. package/types/evaluator/matchers/whitelist.d.ts +0 -1
  309. package/types/evaluator/matchersTransform/index.d.ts +0 -6
  310. package/types/evaluator/matchersTransform/segment.d.ts +0 -5
  311. package/types/evaluator/matchersTransform/unaryNumeric.d.ts +0 -5
  312. package/types/evaluator/matchersTransform/whitelist.d.ts +0 -5
  313. package/types/evaluator/parser/index.d.ts +0 -5
  314. package/types/evaluator/treatments/index.d.ts +0 -8
  315. package/types/evaluator/types.d.ts +0 -28
  316. package/types/evaluator/value/index.d.ts +0 -7
  317. package/types/evaluator/value/sanitize.d.ts +0 -7
  318. package/types/integrations/pluggable.d.ts +0 -11
  319. package/types/integrations/types.d.ts +0 -18
  320. package/types/listeners/browser.d.ts +0 -40
  321. package/types/listeners/node.d.ts +0 -22
  322. package/types/listeners/types.d.ts +0 -4
  323. package/types/logger/browser/DebugLogger.d.ts +0 -2
  324. package/types/logger/browser/ErrorLogger.d.ts +0 -2
  325. package/types/logger/browser/InfoLogger.d.ts +0 -2
  326. package/types/logger/browser/WarnLogger.d.ts +0 -2
  327. package/types/logger/constants.d.ts +0 -134
  328. package/types/logger/index.d.ts +0 -21
  329. package/types/logger/messages/debug.d.ts +0 -1
  330. package/types/logger/messages/error.d.ts +0 -1
  331. package/types/logger/messages/info.d.ts +0 -1
  332. package/types/logger/messages/warn.d.ts +0 -1
  333. package/types/logger/sdkLogger.d.ts +0 -8
  334. package/types/logger/types.d.ts +0 -17
  335. package/types/readiness/constants.d.ts +0 -7
  336. package/types/readiness/readinessManager.d.ts +0 -6
  337. package/types/readiness/sdkReadinessManager.d.ts +0 -10
  338. package/types/readiness/types.d.ts +0 -67
  339. package/types/sdkClient/client.d.ts +0 -6
  340. package/types/sdkClient/clientAttributesDecoration.d.ts +0 -55
  341. package/types/sdkClient/clientCS.d.ts +0 -9
  342. package/types/sdkClient/clientInputValidation.d.ts +0 -7
  343. package/types/sdkClient/identity.d.ts +0 -2
  344. package/types/sdkClient/sdkClient.d.ts +0 -6
  345. package/types/sdkClient/sdkClientMethod.d.ts +0 -6
  346. package/types/sdkClient/sdkClientMethodCS.d.ts +0 -7
  347. package/types/sdkFactory/index.d.ts +0 -6
  348. package/types/sdkFactory/types.d.ts +0 -85
  349. package/types/sdkManager/index.d.ts +0 -4
  350. package/types/services/decorateHeaders.d.ts +0 -2
  351. package/types/services/splitApi.d.ts +0 -12
  352. package/types/services/splitHttpClient.d.ts +0 -10
  353. package/types/services/types.d.ts +0 -54
  354. package/types/storages/AbstractMySegmentsCacheSync.d.ts +0 -39
  355. package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -38
  356. package/types/storages/AbstractSplitsCacheSync.d.ts +0 -43
  357. package/types/storages/KeyBuilder.d.ts +0 -22
  358. package/types/storages/KeyBuilderCS.d.ts +0 -20
  359. package/types/storages/KeyBuilderSS.d.ts +0 -20
  360. package/types/storages/dataLoader.d.ts +0 -10
  361. package/types/storages/findLatencyIndex.d.ts +0 -7
  362. package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -15
  363. package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -54
  364. package/types/storages/inLocalStorage/constants.d.ts +0 -2
  365. package/types/storages/inLocalStorage/index.d.ts +0 -8
  366. package/types/storages/inMemory/AttributesCacheInMemory.d.ts +0 -44
  367. package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
  368. package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -28
  369. package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +0 -30
  370. package/types/storages/inMemory/InMemoryStorage.d.ts +0 -10
  371. package/types/storages/inMemory/InMemoryStorageCS.d.ts +0 -10
  372. package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +0 -16
  373. package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -17
  374. package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -27
  375. package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -71
  376. package/types/storages/inMemory/UniqueKeysCacheInMemory.d.ts +0 -34
  377. package/types/storages/inMemory/UniqueKeysCacheInMemoryCS.d.ts +0 -35
  378. package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
  379. package/types/storages/inRedis/ImpressionCountsCacheInRedis.d.ts +0 -17
  380. package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -17
  381. package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
  382. package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -21
  383. package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -95
  384. package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -35
  385. package/types/storages/inRedis/UniqueKeysCacheInRedis.d.ts +0 -22
  386. package/types/storages/inRedis/constants.d.ts +0 -4
  387. package/types/storages/inRedis/index.d.ts +0 -10
  388. package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
  389. package/types/storages/pluggable/ImpressionCountsCachePluggable.d.ts +0 -16
  390. package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -34
  391. package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -42
  392. package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -98
  393. package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -34
  394. package/types/storages/pluggable/UniqueKeysCachePluggable.d.ts +0 -20
  395. package/types/storages/pluggable/constants.d.ts +0 -1
  396. package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -12
  397. package/types/storages/pluggable/index.d.ts +0 -9
  398. package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
  399. package/types/storages/types.d.ts +0 -407
  400. package/types/storages/utils.d.ts +0 -8
  401. package/types/sync/offline/LocalhostFromObject.d.ts +0 -1
  402. package/types/sync/offline/splitsParser/parseCondition.d.ts +0 -7
  403. package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +0 -3
  404. package/types/sync/offline/splitsParser/types.d.ts +0 -3
  405. package/types/sync/offline/syncManagerOffline.d.ts +0 -10
  406. package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +0 -17
  407. package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +0 -7
  408. package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +0 -7
  409. package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +0 -7
  410. package/types/sync/polling/fetchers/types.d.ts +0 -5
  411. package/types/sync/polling/pollingManagerCS.d.ts +0 -7
  412. package/types/sync/polling/pollingManagerSS.d.ts +0 -6
  413. package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +0 -9
  414. package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +0 -9
  415. package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +0 -9
  416. package/types/sync/polling/types.d.ts +0 -33
  417. package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -14
  418. package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
  419. package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -41
  420. package/types/sync/streaming/AuthClient/index.d.ts +0 -12
  421. package/types/sync/streaming/AuthClient/types.d.ts +0 -17
  422. package/types/sync/streaming/SSEClient/index.d.ts +0 -34
  423. package/types/sync/streaming/SSEClient/types.d.ts +0 -11
  424. package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +0 -14
  425. package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +0 -20
  426. package/types/sync/streaming/SSEHandler/index.d.ts +0 -11
  427. package/types/sync/streaming/SSEHandler/types.d.ts +0 -72
  428. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -9
  429. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -9
  430. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -14
  431. package/types/sync/streaming/UpdateWorkers/constants.d.ts +0 -3
  432. package/types/sync/streaming/UpdateWorkers/types.d.ts +0 -4
  433. package/types/sync/streaming/constants.d.ts +0 -34
  434. package/types/sync/streaming/parseUtils.d.ts +0 -34
  435. package/types/sync/streaming/pushManager.d.ts +0 -9
  436. package/types/sync/streaming/types.d.ts +0 -35
  437. package/types/sync/submitters/eventsSubmitter.d.ts +0 -5
  438. package/types/sync/submitters/impressionCountsSubmitter.d.ts +0 -10
  439. package/types/sync/submitters/impressionsSubmitter.d.ts +0 -11
  440. package/types/sync/submitters/submitter.d.ts +0 -12
  441. package/types/sync/submitters/submitterManager.d.ts +0 -3
  442. package/types/sync/submitters/telemetrySubmitter.d.ts +0 -17
  443. package/types/sync/submitters/types.d.ts +0 -217
  444. package/types/sync/submitters/uniqueKeysSubmitter.d.ts +0 -5
  445. package/types/sync/syncManagerOnline.d.ts +0 -13
  446. package/types/sync/syncTask.d.ts +0 -13
  447. package/types/sync/types.d.ts +0 -43
  448. package/types/trackers/eventTracker.d.ts +0 -10
  449. package/types/trackers/impressionObserver/ImpressionObserver.d.ts +0 -8
  450. package/types/trackers/impressionObserver/buildKey.d.ts +0 -2
  451. package/types/trackers/impressionObserver/impressionObserverCS.d.ts +0 -4
  452. package/types/trackers/impressionObserver/impressionObserverSS.d.ts +0 -4
  453. package/types/trackers/impressionObserver/types.d.ts +0 -4
  454. package/types/trackers/impressionsTracker.d.ts +0 -13
  455. package/types/trackers/strategy/strategyDebug.d.ts +0 -9
  456. package/types/trackers/strategy/strategyNone.d.ts +0 -10
  457. package/types/trackers/strategy/strategyOptimized.d.ts +0 -11
  458. package/types/trackers/telemetryTracker.d.ts +0 -3
  459. package/types/trackers/types.d.ts +0 -68
  460. package/types/trackers/uniqueKeysTracker.d.ts +0 -13
  461. package/types/types.d.ts +0 -1398
  462. package/types/utils/Backoff.d.ts +0 -25
  463. package/types/utils/LRUCache/LinkedList.d.ts +0 -34
  464. package/types/utils/LRUCache/index.d.ts +0 -15
  465. package/types/utils/MinEventEmitter.d.ts +0 -12
  466. package/types/utils/MinEvents.d.ts +0 -4
  467. package/types/utils/Semver.d.ts +0 -15
  468. package/types/utils/base64/index.d.ts +0 -30
  469. package/types/utils/constants/browser.d.ts +0 -1
  470. package/types/utils/constants/index.d.ts +0 -83
  471. package/types/utils/decompress/index.d.ts +0 -16
  472. package/types/utils/env/isLocalStorageAvailable.d.ts +0 -1
  473. package/types/utils/env/isNode.d.ts +0 -5
  474. package/types/utils/inputValidation/apiKey.d.ts +0 -7
  475. package/types/utils/inputValidation/attribute.d.ts +0 -2
  476. package/types/utils/inputValidation/attributes.d.ts +0 -4
  477. package/types/utils/inputValidation/event.d.ts +0 -2
  478. package/types/utils/inputValidation/eventProperties.d.ts +0 -6
  479. package/types/utils/inputValidation/eventValue.d.ts +0 -2
  480. package/types/utils/inputValidation/index.d.ts +0 -13
  481. package/types/utils/inputValidation/isOperational.d.ts +0 -4
  482. package/types/utils/inputValidation/key.d.ts +0 -3
  483. package/types/utils/inputValidation/preloadedData.d.ts +0 -3
  484. package/types/utils/inputValidation/split.d.ts +0 -2
  485. package/types/utils/inputValidation/splitExistence.d.ts +0 -7
  486. package/types/utils/inputValidation/splits.d.ts +0 -2
  487. package/types/utils/inputValidation/trafficType.d.ts +0 -2
  488. package/types/utils/inputValidation/trafficTypeExistence.d.ts +0 -9
  489. package/types/utils/jwt/index.d.ts +0 -5
  490. package/types/utils/jwt/types.d.ts +0 -5
  491. package/types/utils/key/index.d.ts +0 -8
  492. package/types/utils/labels/index.d.ts +0 -8
  493. package/types/utils/lang/binarySearch.d.ts +0 -9
  494. package/types/utils/lang/getFnName.d.ts +0 -4
  495. package/types/utils/lang/getGlobal.d.ts +0 -4
  496. package/types/utils/lang/index.d.ts +0 -105
  497. package/types/utils/lang/objectAssign.d.ts +0 -6
  498. package/types/utils/lang/sets.d.ts +0 -3
  499. package/types/utils/murmur3/common.d.ts +0 -12
  500. package/types/utils/murmur3/legacy.d.ts +0 -2
  501. package/types/utils/murmur3/murmur3.d.ts +0 -2
  502. package/types/utils/murmur3/murmur3_128.d.ts +0 -6
  503. package/types/utils/murmur3/murmur3_128_x86.d.ts +0 -7
  504. package/types/utils/murmur3/murmur3_64.d.ts +0 -10
  505. package/types/utils/murmur3/utfx.d.ts +0 -27
  506. package/types/utils/promise/thenable.d.ts +0 -1
  507. package/types/utils/promise/timeout.d.ts +0 -1
  508. package/types/utils/promise/wrapper.d.ts +0 -21
  509. package/types/utils/settingsValidation/consent.d.ts +0 -6
  510. package/types/utils/settingsValidation/impressionsMode.d.ts +0 -3
  511. package/types/utils/settingsValidation/index.d.ts +0 -50
  512. package/types/utils/settingsValidation/integrations/common.d.ts +0 -14
  513. package/types/utils/settingsValidation/integrations/configurable.d.ts +0 -13
  514. package/types/utils/settingsValidation/integrations/pluggable.d.ts +0 -13
  515. package/types/utils/settingsValidation/logger/builtinLogger.d.ts +0 -10
  516. package/types/utils/settingsValidation/logger/commons.d.ts +0 -9
  517. package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +0 -11
  518. package/types/utils/settingsValidation/mode.d.ts +0 -5
  519. package/types/utils/settingsValidation/runtime.d.ts +0 -2
  520. package/types/utils/settingsValidation/splitFilters.d.ts +0 -17
  521. package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -21
  522. package/types/utils/settingsValidation/types.d.ts +0 -30
  523. package/types/utils/settingsValidation/url.d.ts +0 -10
  524. package/types/utils/time/index.d.ts +0 -4
  525. package/types/utils/timeTracker/now/browser.d.ts +0 -1
  526. package/types/utils/timeTracker/now/node.d.ts +0 -1
  527. package/types/utils/timeTracker/timer.d.ts +0 -1
@@ -15,10 +15,6 @@ export class Backoff {
15
15
 
16
16
  /**
17
17
  * Schedule function calls with exponential backoff
18
- *
19
- * @param {function} cb
20
- * @param {number} baseMillis
21
- * @param {number} maxMillis
22
18
  */
23
19
  constructor(cb: (...args: any[]) => any, baseMillis?: number, maxMillis?: number) {
24
20
  this.baseMillis = Backoff.__TEST__BASE_MILLIS || baseMillis || Backoff.DEFAULT_BASE_MILLIS;
@@ -1,5 +1,4 @@
1
-
2
- import { IEventEmitter } from '../types';
1
+ import SplitIO from '../../types/splitio';
3
2
 
4
3
  const NEW_LISTENER_EVENT = 'newListener';
5
4
  const REMOVE_LISTENER_EVENT = 'removeListener';
@@ -11,7 +10,7 @@ function checkListener(listener: unknown) {
11
10
  }
12
11
 
13
12
  // @TODO implement missing methods, check spec and add UTs
14
- export class EventEmitter implements IEventEmitter {
13
+ export class EventEmitter implements SplitIO.IEventEmitter {
15
14
 
16
15
  private listeners: Record<string, Array<[
17
16
  (...args: any[]) => void, // the event listener
@@ -30,7 +30,7 @@
30
30
  // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
31
31
  // USE OR OTHER DEALINGS IN THE SOFTWARE.
32
32
 
33
- import { IEventEmitter } from '../types';
33
+ import SplitIO from '../../types/splitio';
34
34
 
35
35
  var R = typeof Reflect === 'object' ? Reflect : null;
36
36
  var ReflectApply = R && typeof R.apply === 'function'
@@ -39,7 +39,7 @@ var ReflectApply = R && typeof R.apply === 'function'
39
39
  return Function.prototype.apply.call(target, receiver, args);
40
40
  };
41
41
 
42
- export const EventEmitter: { new(): IEventEmitter } = function EventEmitter() {
42
+ export const EventEmitter: { new(): SplitIO.IEventEmitter } = function EventEmitter() {
43
43
  EventEmitter.init.call(this);
44
44
  };
45
45
 
@@ -84,7 +84,7 @@ export class Semver {
84
84
  /**
85
85
  * Precedence comparision between 2 Semver objects.
86
86
  *
87
- * @return `0` if `this === toCompare`, `-1` if `this < toCompare`, and `1` if `this > toCompare`
87
+ * @returns `0` if `this === toCompare`, `-1` if `this < toCompare`, and `1` if `this > toCompare`
88
88
  */
89
89
  public compare(toCompare: Semver): number {
90
90
  if (this.version === toCompare.version) return 0;
@@ -22,7 +22,7 @@ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
22
22
  /**
23
23
  * Decode a given string value in Base64 format
24
24
  *
25
- * @param {string} input value to decode
25
+ * @param input - value to decode
26
26
  */
27
27
  export function decodeFromBase64(input: string): string {
28
28
  const str = (String(input)).replace(/[=]+$/, ''); // #31: ExtendScript bad parse of /=
@@ -48,7 +48,7 @@ export function decodeFromBase64(input: string): string {
48
48
  /**
49
49
  * Encode a given string value to Base64 format.
50
50
  *
51
- * @param {string} input value to encode
51
+ * @param input - value to encode
52
52
  */
53
53
  export function encodeToBase64(input: string): string {
54
54
  const str = String(input);
@@ -1,5 +1,4 @@
1
- import { StorageType } from '../../storages/types';
2
- import { SDKMode } from '../../types';
1
+ import SplitIO from '../../../types/splitio';
3
2
 
4
3
  // Special treatments
5
4
  export const CONTROL = 'control';
@@ -22,17 +21,17 @@ export const OPTIMIZED = 'OPTIMIZED';
22
21
  export const NONE = 'NONE';
23
22
 
24
23
  // SDK Modes
25
- export const LOCALHOST_MODE: SDKMode = 'localhost';
26
- export const STANDALONE_MODE: SDKMode = 'standalone';
24
+ export const LOCALHOST_MODE = 'localhost';
25
+ export const STANDALONE_MODE = 'standalone';
27
26
  export const PRODUCER_MODE = 'producer';
28
- export const CONSUMER_MODE: SDKMode = 'consumer';
29
- export const CONSUMER_PARTIAL_MODE: SDKMode = 'consumer_partial';
27
+ export const CONSUMER_MODE = 'consumer';
28
+ export const CONSUMER_PARTIAL_MODE = 'consumer_partial';
30
29
 
31
30
  // Storage types
32
- export const STORAGE_MEMORY: StorageType = 'MEMORY';
33
- export const STORAGE_LOCALSTORAGE: StorageType = 'LOCALSTORAGE';
34
- export const STORAGE_REDIS: StorageType = 'REDIS';
35
- export const STORAGE_PLUGGABLE: StorageType = 'PLUGGABLE';
31
+ export const STORAGE_MEMORY: SplitIO.StorageType = 'MEMORY';
32
+ export const STORAGE_LOCALSTORAGE: SplitIO.StorageType = 'LOCALSTORAGE';
33
+ export const STORAGE_REDIS: SplitIO.StorageType = 'REDIS';
34
+ export const STORAGE_PLUGGABLE: SplitIO.StorageType = 'PLUGGABLE';
36
35
 
37
36
  // User consent
38
37
  export const CONSENT_GRANTED = 'GRANTED'; // The user has granted consent for tracking events and impressions
@@ -409,8 +409,8 @@ export const algorithms = (function iifeDecompress() {
409
409
  return {
410
410
  /**
411
411
  * Expands GZIP data
412
- * @param data The data to decompress
413
- * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.
412
+ * @param data - The data to decompress
413
+ * @param out - Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.
414
414
  * @returns The decompressed version of the data
415
415
  */
416
416
  gunzipSync(data: Uint8Array, out?: Uint8Array): Uint8Array {
@@ -418,8 +418,8 @@ export const algorithms = (function iifeDecompress() {
418
418
  },
419
419
  /**
420
420
  * Expands Zlib data
421
- * @param data The data to decompress
422
- * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
421
+ * @param data - The data to decompress
422
+ * @param out - Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
423
423
  * @returns The decompressed version of the data
424
424
  */
425
425
  unzlibSync(data: Uint8Array, out?: Uint8Array): Uint8Array {
@@ -1,5 +1,5 @@
1
1
  import { isObject } from '../lang';
2
- import { SplitIO } from '../../types';
2
+ import SplitIO from '../../../types/splitio';
3
3
  import { ILogger } from '../../logger/types';
4
4
  import { validateAttribute } from './attribute';
5
5
  import { ERROR_NOT_PLAIN_OBJECT } from '../../logger/constants';
@@ -1,6 +1,6 @@
1
1
  import { isObject, isString, isFiniteNumber, isBoolean } from '../lang';
2
2
  import { objectAssign } from '../lang/objectAssign';
3
- import { SplitIO } from '../../types';
3
+ import SplitIO from '../../../types/splitio';
4
4
  import { ILogger } from '../../logger/types';
5
5
  import { ERROR_NOT_PLAIN_OBJECT, ERROR_SIZE_EXCEEDED, WARN_SETTING_NULL, WARN_TRIMMING_PROPERTIES } from '../../logger/constants';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { isObject, isString, isFiniteNumber, toString } from '../lang';
2
- import { SplitIO } from '../../types';
2
+ import SplitIO from '../../../types/splitio';
3
3
  import { ILogger } from '../../logger/types';
4
4
  import { ERROR_NULL, WARN_CONVERTING, ERROR_EMPTY, ERROR_TOO_LONG, ERROR_INVALID, ERROR_INVALID_KEY_OBJECT } from '../../logger/constants';
5
5
 
@@ -1,6 +1,5 @@
1
1
  import { isObject, isString, isFiniteNumber } from '../lang';
2
2
  import { validateSplit } from './split';
3
- import { SplitIO } from '../../types';
4
3
  import { ILogger } from '../../logger/types';
5
4
 
6
5
  function validateTimestampData(log: ILogger, maybeTimestamp: any, method: string, item: string) {
@@ -42,7 +41,7 @@ function validateSegmentsData(log: ILogger, maybeSegmentsData: any, method: stri
42
41
  return false;
43
42
  }
44
43
 
45
- export function validatePreloadedData(log: ILogger, maybePreloadedData: any, method: string): maybePreloadedData is SplitIO.PreloadedData {
44
+ export function validatePreloadedData(log: ILogger, maybePreloadedData: any, method: string) {
46
45
  if (!isObject(maybePreloadedData)) {
47
46
  log.error(`${method}: preloadedData must be an object.`);
48
47
  } else if (
@@ -2,7 +2,7 @@ import { thenable } from '../promise/thenable';
2
2
  import { LOCALHOST_MODE } from '../constants';
3
3
  import { ISplitsCacheBase } from '../../storages/types';
4
4
  import { IReadinessManager } from '../../readiness/types';
5
- import { SDKMode } from '../../types';
5
+ import SplitIO from '../../../types/splitio';
6
6
  import { MaybeThenable } from '../../dtos/types';
7
7
  import { ILogger } from '../../logger/types';
8
8
  import { WARN_NOT_EXISTENT_TT } from '../../logger/constants';
@@ -14,7 +14,7 @@ function logTTExistenceWarning(log: ILogger, maybeTT: string, method: string) {
14
14
  /**
15
15
  * Separated from the previous method since on some cases it'll be async.
16
16
  */
17
- export function validateTrafficTypeExistence(log: ILogger, readinessManager: IReadinessManager, splitsCache: ISplitsCacheBase, mode: SDKMode, maybeTT: string, method: string): MaybeThenable<boolean> {
17
+ export function validateTrafficTypeExistence(log: ILogger, readinessManager: IReadinessManager, splitsCache: ISplitsCacheBase, mode: SplitIO.SDKMode, maybeTT: string, method: string): MaybeThenable<boolean> {
18
18
 
19
19
  // If not ready or in localhost mode, we won't run the validation
20
20
  if (!readinessManager.isReady() || mode === LOCALHOST_MODE) return true;
@@ -1,4 +1,4 @@
1
- import { SplitIO } from '../../types';
1
+ import SplitIO from '../../../types/splitio';
2
2
  import { isObject } from '../lang';
3
3
 
4
4
  // function isSplitKeyObject(key: any): key is SplitIO.SplitKeyObject {
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Searches the index of the specified `value` inside an ordered array of `items` using the binary search algorithm.
3
3
  *
4
- * @param items the array to be searched
5
- * @param value the value to be searched for
4
+ * @param items - the array to be searched
5
+ * @param value - the value to be searched for
6
6
  * @returns integer number between 0 and `items.length`. This value is the index of the search value,
7
7
  * if it is contained in the array, or the index at which the value should be inserted to keep the array ordered.
8
8
  */
@@ -266,7 +266,7 @@ function hash128x64(key?: string, seed?: number) {
266
266
  /**
267
267
  * x64 version of Murmur3 for 128bits.
268
268
  *
269
- * @param {string} str
269
+ * @param str - The string to hash.
270
270
  */
271
271
  export function hash128(str: string, seed?: number): string {
272
272
  return hash128x64(UTF16ToUTF8(str), (seed as number) >>> 0);
@@ -181,7 +181,7 @@ function hash128x86(key?: string, seed?: number): string {
181
181
  * x86 version of Murmur3 for 128bits.
182
182
  * Used by hashImpression128 because in JS it is more efficient than the x64 version, no matter the underlying OS/CPU arch.
183
183
  *
184
- * @param {string} str
184
+ * @param str - The string to hash.
185
185
  */
186
186
  export function hash128(str: string, seed?: number): string {
187
187
  return hash128x86(UTF16ToUTF8(str), (seed as number) >>> 0);
@@ -25,7 +25,7 @@ function hex2dec(s: string): string {
25
25
  /**
26
26
  * Gets the higher 64 bits of the x64 version of Murmur3 for 128bits, as decimal and hexadecimal number strings.
27
27
  * Used for MySegments channel V2 notifications.
28
- * @param {string} str
28
+ * @param str - The string to hash
29
29
  */
30
30
  export function hash64(str: string): Hash64 {
31
31
  const hex = hash128(str).slice(0, 16);
@@ -14,10 +14,9 @@ export interface utfx {
14
14
 
15
15
  /**
16
16
  * Encodes UTF8 code points to UTF8 bytes.
17
- * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point
17
+ * @param src - Code points source, either as a function returning the next code point
18
18
  * respectively `null` if there are no more code points left or a single numeric code point.
19
- * @param {!function(number)} dst Bytes destination as a function successively called with the next byte
20
- * @expose
19
+ * @param dst - Bytes destination as a function successively called with the next byte
21
20
  */
22
21
  function encodeUTF8(src: (() => number | null) | number, dst: (cp: number) => void): void {
23
22
  var cp = null;
@@ -38,11 +37,10 @@ function encodeUTF8(src: (() => number | null) | number, dst: (cp: number) => vo
38
37
 
39
38
  /**
40
39
  * Converts UTF16 characters to UTF8 code points.
41
- * @param {!function():number|null} src Characters source as a function returning the next char code respectively
40
+ * @param src - Characters source as a function returning the next char code respectively
42
41
  * `null` if there are no more characters left.
43
- * @param {!function(number)} dst Code points destination as a function successively called with each converted code
42
+ * @param dst - Code points destination as a function successively called with each converted code
44
43
  * point.
45
- * @expose
46
44
  */
47
45
  function UTF16toUTF8(src: () => number | null, dst: (cp: number) => void): void {
48
46
  var c1, c2 = null;
@@ -65,10 +63,9 @@ function UTF16toUTF8(src: () => number | null, dst: (cp: number) => void): void
65
63
 
66
64
  /**
67
65
  * Converts and encodes UTF16 characters to UTF8 bytes.
68
- * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null`
66
+ * @param src - Characters source as a function returning the next char code respectively `null`
69
67
  * if there are no more characters left.
70
- * @param {!function(number)} dst Bytes destination as a function successively called with the next byte.
71
- * @expose
68
+ * @param dst - Bytes destination as a function successively called with the next byte.
72
69
  */
73
70
  export function encodeUTF16toUTF8(src: () => number | null, dst: (...args: number[]) => string | undefined): void {
74
71
  UTF16toUTF8(src, function (cp) {
@@ -78,18 +75,15 @@ export function encodeUTF16toUTF8(src: () => number | null, dst: (...args: numbe
78
75
 
79
76
  /**
80
77
  * String.fromCharCode reference for compile time renaming.
81
- * @type {!function(...[number]):string}
82
- * @inner
83
78
  */
84
79
  var stringFromCharCode = String.fromCharCode;
85
80
 
86
81
  /**
87
82
  * Creates a source function for a string.
88
- * @param {string} s String to read from
89
- * @returns {!function():number|null} Source function returning the next char code respectively `null` if there are
83
+ * @param s - String to read from
84
+ * @returns Source function returning the next char code respectively `null` if there are
90
85
  * no more characters left.
91
- * @throws {TypeError} If the argument is invalid
92
- * @expose
86
+ * @throws If the argument is invalid
93
87
  */
94
88
  export function stringSource(s: string): () => number | null {
95
89
  if (typeof s !== 'string')
@@ -101,9 +95,8 @@ export function stringSource(s: string): () => number | null {
101
95
 
102
96
  /**
103
97
  * Creates a destination function for a string.
104
- * @returns {function(number=):undefined|string} Destination function successively called with the next char code.
98
+ * @returns Destination function successively called with the next char code.
105
99
  * Returns the final string when called without arguments.
106
- * @expose
107
100
  */
108
101
  export function stringDestination(): (...args: number[]) => string | undefined {
109
102
  const cs: number[] = [], ps: string[] = []; return function () {
@@ -11,8 +11,8 @@
11
11
  * - If the wrapped promise is rejected when using native async/await syntax, the `defaultOnRejected` handler is invoked
12
12
  * and neither the catch block nor the remaining try block are executed.
13
13
  *
14
- * @param customPromise promise to wrap
15
- * @param defaultOnRejected default onRejected function
14
+ * @param customPromise - promise to wrap
15
+ * @param defaultOnRejected - default onRejected function
16
16
  * @returns a promise that doesn't need to be handled for rejection (except when using async/await syntax) and
17
17
  * includes a method named `hasOnFulfilled` that returns true if the promise has attached an onFulfilled handler.
18
18
  */
@@ -1,12 +1,12 @@
1
1
  import { ERROR_INVALID_CONFIG_PARAM } from '../../logger/constants';
2
2
  import { ILogger } from '../../logger/types';
3
- import { ConsentStatus } from '../../types';
3
+ import SplitIO from '../../../types/splitio';
4
4
  import { CONSENT_DECLINED, CONSENT_GRANTED, CONSENT_UNKNOWN } from '../constants';
5
5
  import { stringToUpperCase } from '../lang';
6
6
 
7
7
  const userConsentValues = [CONSENT_DECLINED, CONSENT_GRANTED, CONSENT_UNKNOWN];
8
8
 
9
- export function validateConsent({ userConsent, log }: { userConsent?: any, log: ILogger }): ConsentStatus {
9
+ export function validateConsent({ userConsent, log }: { userConsent?: any, log: ILogger }): SplitIO.ConsentStatus {
10
10
  userConsent = stringToUpperCase(userConsent);
11
11
 
12
12
  if (userConsentValues.indexOf(userConsent) > -1) return userConsent;
@@ -1,6 +1,6 @@
1
1
  import { ERROR_INVALID_CONFIG_PARAM } from '../../logger/constants';
2
2
  import { ILogger } from '../../logger/types';
3
- import { SplitIO } from '../../types';
3
+ import SplitIO from '../../../types/splitio';
4
4
  import { DEBUG, OPTIMIZED, NONE } from '../constants';
5
5
  import { stringToUpperCase } from '../lang';
6
6
 
@@ -96,8 +96,8 @@ function fromSecondsToMillis(n: number) {
96
96
  * Validates the given config and use it to build a settings object.
97
97
  * NOTE: it doesn't validate the SDK Key. Call `validateApiKey` or `validateAndTrackApiKey` for that after settings validation.
98
98
  *
99
- * @param config user defined configuration
100
- * @param validationParams defaults and fields validators used to validate and creates a settings object from a given config
99
+ * @param config - user defined configuration
100
+ * @param validationParams - defaults and fields validators used to validate and creates a settings object from a given config
101
101
  */
102
102
  export function settingsValidation(config: unknown, validationParams: ISettingsValidationParams) {
103
103
 
@@ -4,11 +4,11 @@ import { ILogger } from '../../../logger/types';
4
4
  /**
5
5
  * This function validates `settings.integrations` object
6
6
  *
7
- * @param {any} settings config object provided by the user to initialize the sdk
8
- * @param {function} integrationValidator filter used to remove invalid integration items
9
- * @param {string} extraWarning optional string used to better describe why an item might be invalid
7
+ * @param settings - config object provided by the user to initialize the sdk
8
+ * @param integrationValidator - filter used to remove invalid integration items
9
+ * @param extraWarning - optional string used to better describe why an item might be invalid
10
10
  *
11
- * @returns {Array} array of valid integration items. The array might be empty if `settings` object does not have valid integrations.
11
+ * @returns array of valid integration items. The array might be empty if `settings` object does not have valid integrations.
12
12
  */
13
13
  export function validateIntegrations(settings: { log: ILogger, integrations?: any }, integrationValidator: (integrationItem: any) => boolean, extraWarning?: string) {
14
14
  const { integrations, log } = settings;
@@ -5,10 +5,10 @@ import { ILogger } from '../../../logger/types';
5
5
  /**
6
6
  * This function validates `settings.integrations` object that consists of a list of configuration items, used by the isomorphic JS SDK.
7
7
  *
8
- * @param {any} settings config object provided by the user to initialize the sdk
9
- * @param {Array<string>} validIntegrationTypes list of integration types to filter from `settings.integrations`
8
+ * @param settings - config object provided by the user to initialize the sdk
9
+ * @param validIntegrationTypes - list of integration types to filter from `settings.integrations`
10
10
  *
11
- * @returns {Array} array of valid integration items. The array might be empty if `settings` object does not have valid integrations.
11
+ * @returns array of valid integration items. The array might be empty if `settings` object does not have valid integrations.
12
12
  */
13
13
  export function validateConfigurableIntegrations(settings: { log: ILogger, integrations?: any }, validIntegrationTypes: string[] = []) {
14
14
 
@@ -5,9 +5,9 @@ import { ILogger } from '../../../logger/types';
5
5
  /**
6
6
  * This function validates `settings.integrations` object that consists of a list of pluggable integration factories.
7
7
  *
8
- * @param {any} settings config object provided by the user to initialize the sdk
8
+ * @param settings - config object provided by the user to initialize the sdk
9
9
  *
10
- * @returns {Array} array of valid integration factories. The array might be empty if `settings` object does not have valid integrations.
10
+ * @returns array of valid integration factories. The array might be empty if `settings` object does not have valid integrations.
11
11
  */
12
12
  export function validatePluggableIntegrations(settings: { log: ILogger, integrations?: any }): ISettings['integrations'] {
13
13
 
@@ -4,7 +4,7 @@ import { isLocalStorageAvailable } from '../../env/isLocalStorageAvailable';
4
4
  import { isNode } from '../../env/isNode';
5
5
  import { codesDebug } from '../../../logger/messages/debug';
6
6
  import { getLogLevel } from './commons';
7
- import { LogLevel } from '../../../types';
7
+ import SplitIO from '../../../../types/splitio';
8
8
 
9
9
  const allCodes = new Map(codesDebug);
10
10
 
@@ -37,13 +37,13 @@ if (/^(enabled?|on)/i.test(initialState)) {
37
37
  /**
38
38
  * Validates the `debug` property at config and use it to set the log level.
39
39
  *
40
- * @param settings user config object, with an optional `debug` property of type boolean or string log level.
40
+ * @param settings - user config object, with an optional `debug` property of type boolean or string log level.
41
41
  * @returns a logger instance with the log level at `settings.debug`. If `settings.debug` is invalid or not provided, `initialLogLevel` is used.
42
42
  */
43
43
  export function validateLogger(settings: { debug: unknown }): ILogger {
44
44
  const { debug } = settings;
45
45
 
46
- const logLevel: LogLevel | undefined = debug !== undefined ? getLogLevel(debug) : initialLogLevel;
46
+ const logLevel: SplitIO.LogLevel | undefined = debug !== undefined ? getLogLevel(debug) : initialLogLevel;
47
47
 
48
48
  const log = new Logger({ logLevel: logLevel || initialLogLevel }, allCodes);
49
49
 
@@ -1,15 +1,15 @@
1
1
 
2
2
  import { LogLevels, isLogLevelString } from '../../../logger';
3
- import { LogLevel } from '../../../types';
3
+ import SplitIO from '../../../../types/splitio';
4
4
 
5
5
  /**
6
6
  * Returns the LogLevel for the given debugValue or undefined if it is invalid,
7
7
  * i.e., if the debugValue is not a boolean or LogLevel string.
8
8
  *
9
- * @param debugValue debug value at config
9
+ * @param debugValue - debug value at config
10
10
  * @returns LogLevel of the given debugValue or undefined if the provided value is invalid
11
11
  */
12
- export function getLogLevel(debugValue: unknown): LogLevel | undefined {
12
+ export function getLogLevel(debugValue: unknown): SplitIO.LogLevel | undefined {
13
13
  if (typeof debugValue === 'boolean') {
14
14
  if (debugValue) {
15
15
  return LogLevels.DEBUG;
@@ -1,6 +1,6 @@
1
1
  import { Logger, LogLevels } from '../../../logger';
2
2
  import { ILogger } from '../../../logger/types';
3
- import { LogLevel } from '../../../types';
3
+ import SplitIO from '../../../../types/splitio';
4
4
  import { getLogLevel } from './commons';
5
5
 
6
6
  function isLogger(log: any): log is ILogger {
@@ -13,13 +13,13 @@ let initialLogLevel = LogLevels.NONE;
13
13
  /**
14
14
  * Validates the `debug` property at config and use it to set the logger.
15
15
  *
16
- * @param settings user config object, with an optional `debug` property of type boolean, string log level or a Logger object.
16
+ * @param settings - user config object, with an optional `debug` property of type boolean, string log level or a Logger object.
17
17
  * @returns a logger instance, that might be: the provided logger at `settings.debug`, or one with the given `debug` log level,
18
18
  * or one with NONE log level if `debug` is not defined or invalid.
19
19
  */
20
20
  export function validateLogger(settings: { debug: unknown }): ILogger {
21
21
  const { debug } = settings;
22
- let logLevel: LogLevel | undefined = initialLogLevel;
22
+ let logLevel: SplitIO.LogLevel | undefined = initialLogLevel;
23
23
 
24
24
  if (debug !== undefined) {
25
25
  if (isLogger(debug)) return debug;
@@ -1,6 +1,6 @@
1
1
  import { validateSplits } from '../inputValidation/splits';
2
2
  import { ISplitFiltersValidation } from '../../dtos/types';
3
- import { SplitIO } from '../../types';
3
+ import SplitIO from '../../../types/splitio';
4
4
  import { ILogger } from '../../logger/types';
5
5
  import { WARN_SPLITS_FILTER_IGNORED, WARN_SPLITS_FILTER_EMPTY, WARN_SPLITS_FILTER_INVALID, SETTINGS_SPLITS_FILTER, LOG_PREFIX_SETTINGS, ERROR_SETS_FILTER_EXCLUSIVE, WARN_LOWERCASE_FLAGSET, WARN_INVALID_FLAGSET, WARN_FLAGSET_NOT_CONFIGURED } from '../../logger/constants';
6
6
  import { objectAssign } from '../lang/objectAssign';
@@ -40,9 +40,9 @@ function validateFilterType(maybeFilterType: any): maybeFilterType is SplitIO.Sp
40
40
  /**
41
41
  * Validate, deduplicate and sort a given list of filter values.
42
42
  *
43
- * @param {string} type filter type string used for log messages
44
- * @param {string[]} values list of values to validate, deduplicate and sort
45
- * @param {number} maxLength
43
+ * @param type - filter type string used for log messages
44
+ * @param values - list of values to validate, deduplicate and sort
45
+ * @param maxLength - max length allowed for the list of values
46
46
  * @returns list of valid, unique and alphabetically sorted non-empty strings. The list is empty if `values` param is not a non-empty array or all its values are invalid.
47
47
  *
48
48
  * @throws Error if the sanitized list exceeds the length indicated by `maxLength`
@@ -75,7 +75,7 @@ function validateSplitFilter(log: ILogger, type: SplitIO.SplitFilterType, values
75
75
  * - '&prefixes=<comma-separated-values>': if only `byName` filter is undefined
76
76
  * - '&names=<comma-separated-values>&prefixes=<comma-separated-values>': if no one is undefined
77
77
  *
78
- * @param {Object} groupedFilters object of filters. Each filter must be a list of valid, unique and ordered string values.
78
+ * @param groupedFilters - object of filters. Each filter must be a list of valid, unique and ordered string values.
79
79
  * @returns null or string with the `split filter query` component of the URL.
80
80
  */
81
81
  function queryStringBuilder(groupedFilters: Record<SplitIO.SplitFilterType, string[]>) {
@@ -90,15 +90,12 @@ function queryStringBuilder(groupedFilters: Record<SplitIO.SplitFilterType, stri
90
90
  /**
91
91
  * Sanitizes set names list taking into account:
92
92
  * - It should be lowercase
93
- * - Must adhere the following regular expression /^[a-z0-9][_a-z0-9]{0,49}$/ that means
93
+ * - Must adhere the following regular expression `/^[a-z0-9][_a-z0-9]{0,49}$/` that means
94
94
  * - must start with a letter or number
95
95
  * - Be in lowercase
96
96
  * - Be alphanumeric
97
97
  * - have a max length of 50 characters
98
98
  *
99
- * @param {ILogger} log
100
- * @param {string[]} flagSets
101
- * @param {string} method
102
99
  * @returns sanitized list of set names
103
100
  */
104
101
  function sanitizeFlagSets(log: ILogger, flagSets: string[], method: string) {
@@ -128,9 +125,9 @@ function configuredFilter(validFilters: SplitIO.SplitFilter[], filterType: Split
128
125
  /**
129
126
  * Validates `splitFilters` configuration object and parses it into a query string for filtering splits on `/splitChanges` fetch.
130
127
  *
131
- * @param {ILogger} log logger
132
- * @param {any} maybeSplitFilters split filters configuration param provided by the user
133
- * @param {string} mode settings mode
128
+ * @param log - logger
129
+ * @param maybeSplitFilters - split filters configuration param provided by the user
130
+ * @param mode - settings mode
134
131
  * @returns it returns an object with the following properties:
135
132
  * - `validFilters`: the validated `splitFilters` configuration object defined by the user.
136
133
  * - `queryString`: the parsed split filter query. it is null if all filters are invalid or all values in filters are invalid.
@@ -1,5 +1,6 @@
1
1
  import { InMemoryStorageCSFactory } from '../../../storages/inMemory/InMemoryStorageCS';
2
- import { ISettings, SDKMode } from '../../../types';
2
+ import { ISettings } from '../../../types';
3
+ import SplitIO from '../../../../types/splitio';
3
4
  import { ILogger } from '../../../logger/types';
4
5
  import { ERROR_STORAGE_INVALID } from '../../../logger/constants';
5
6
  import { LOCALHOST_MODE, STANDALONE_MODE, STORAGE_PLUGGABLE, STORAGE_LOCALSTORAGE, STORAGE_MEMORY } from '../../../utils/constants';
@@ -15,13 +16,13 @@ __InLocalStorageMockFactory.type = STORAGE_MEMORY;
15
16
  /**
16
17
  * This function validates `settings.storage` object
17
18
  *
18
- * @param {any} settings config object provided by the user to initialize the sdk
19
+ * @param settings - config object provided by the user to initialize the sdk
19
20
  *
20
- * @returns {Object} valid storage factory. Default to `InMemoryStorageCSFactory` if the provided storage is invalid or not compatible with the sdk mode if mode is standalone or localhost
21
+ * @returns valid storage factory. Default to `InMemoryStorageCSFactory` if the provided storage is invalid or not compatible with the sdk mode if mode is standalone or localhost
21
22
  *
22
23
  * @throws error if mode is consumer and the provided storage is not compatible
23
24
  */
24
- export function validateStorageCS(settings: { log: ILogger, storage?: any, mode: SDKMode }): ISettings['storage'] {
25
+ export function validateStorageCS(settings: { log: ILogger, storage?: any, mode: SplitIO.SDKMode }): ISettings['storage'] {
25
26
  let { storage = InMemoryStorageCSFactory, log, mode } = settings;
26
27
 
27
28
  // If an invalid storage is provided, fallback into MEMORY
@@ -9,9 +9,9 @@ const streamingEndpointMatcher = /^\/(sse|event-stream)/;
9
9
  * Get URL based on a given target (path).
10
10
  * ATM, it is only used for testing purposes.
11
11
  *
12
- * @param settings settings object
13
- * @param target url path
14
- * @return complete url
12
+ * @param settings - settings object
13
+ * @param target - url path
14
+ * @returns complete url
15
15
  */
16
16
  export function url(settings: ISettings, target: string) {
17
17
  if (telemetryEndpointMatcher.test(target)) {
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { InMemoryStorageFactory } from './storages/inMemory/InMemoryStorage';
2
- export { InMemoryStorageCSFactory } from './storages/inMemory/InMemoryStorageCS';
3
- export { InLocalStorage } from './storages/inLocalStorage';
4
- export { PluggableStorage } from './storages/pluggable';
5
- export { InRedisStorage } from './storages/inRedis';
1
+ // Declaration file for JavaScript Browser Split Software SDK
2
+ // Project: http://www.split.io/
3
+ // Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
4
+
5
+ /// <reference path="./splitio.d.ts" />