@splitsoftware/splitio-commons 1.6.2-rc.1 → 1.6.2-rc.4

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 (433) hide show
  1. package/cjs/listeners/browser.js +1 -2
  2. package/cjs/logger/constants.js +1 -2
  3. package/cjs/sdkClient/clientAttributesDecoration.js +1 -1
  4. package/cjs/sdkFactory/index.js +6 -13
  5. package/cjs/services/splitApi.js +1 -20
  6. package/cjs/storages/inMemory/AttributesCacheInMemory.js +1 -1
  7. package/cjs/sync/submitters/submitterManager.js +0 -3
  8. package/cjs/trackers/impressionsTracker.js +28 -7
  9. package/cjs/utils/constants/index.js +2 -3
  10. package/cjs/utils/key/index.js +1 -1
  11. package/cjs/utils/settingsValidation/impressionsMode.js +2 -2
  12. package/cjs/utils/settingsValidation/index.js +1 -3
  13. package/esm/listeners/browser.js +2 -3
  14. package/esm/logger/constants.js +0 -1
  15. package/esm/sdkClient/clientAttributesDecoration.js +1 -1
  16. package/esm/sdkFactory/index.js +6 -13
  17. package/esm/services/splitApi.js +1 -20
  18. package/esm/storages/inMemory/AttributesCacheInMemory.js +1 -1
  19. package/esm/sync/submitters/submitterManager.js +0 -3
  20. package/esm/trackers/impressionsTracker.js +28 -7
  21. package/esm/utils/constants/index.js +0 -1
  22. package/esm/utils/key/index.js +1 -1
  23. package/esm/utils/settingsValidation/impressionsMode.js +3 -3
  24. package/esm/utils/settingsValidation/index.js +1 -3
  25. package/package.json +4 -5
  26. package/src/consent/sdkUserConsent.ts +4 -3
  27. package/src/dtos/types.ts +0 -8
  28. package/src/evaluator/Engine.ts +3 -3
  29. package/src/evaluator/combiners/and.ts +1 -1
  30. package/src/evaluator/combiners/ifelseif.ts +3 -3
  31. package/src/evaluator/condition/engineUtils.ts +1 -1
  32. package/src/evaluator/condition/index.ts +6 -6
  33. package/src/evaluator/index.ts +10 -10
  34. package/src/evaluator/matchers/all.ts +1 -1
  35. package/src/evaluator/matchers/between.ts +1 -1
  36. package/src/evaluator/matchers/boolean.ts +1 -1
  37. package/src/evaluator/matchers/cont_all.ts +1 -1
  38. package/src/evaluator/matchers/cont_any.ts +1 -1
  39. package/src/evaluator/matchers/cont_str.ts +1 -1
  40. package/src/evaluator/matchers/dependency.ts +1 -1
  41. package/src/evaluator/matchers/eq.ts +1 -1
  42. package/src/evaluator/matchers/eq_set.ts +1 -1
  43. package/src/evaluator/matchers/ew.ts +1 -1
  44. package/src/evaluator/matchers/gte.ts +1 -1
  45. package/src/evaluator/matchers/index.ts +1 -1
  46. package/src/evaluator/matchers/lte.ts +1 -1
  47. package/src/evaluator/matchers/part_of.ts +1 -1
  48. package/src/evaluator/matchers/segment.ts +1 -1
  49. package/src/evaluator/matchers/string.ts +1 -1
  50. package/src/evaluator/matchers/sw.ts +1 -1
  51. package/src/evaluator/matchers/whitelist.ts +1 -1
  52. package/src/evaluator/parser/index.ts +3 -3
  53. package/src/evaluator/types.ts +6 -6
  54. package/src/evaluator/value/index.ts +4 -4
  55. package/src/evaluator/value/sanitize.ts +4 -4
  56. package/src/integrations/ga/GaToSplit.ts +6 -6
  57. package/src/integrations/ga/SplitToGa.ts +10 -10
  58. package/src/integrations/ga/types.ts +4 -4
  59. package/src/integrations/pluggable.ts +3 -3
  60. package/src/integrations/types.ts +2 -2
  61. package/src/listeners/browser.ts +2 -3
  62. package/src/logger/.DS_Store +0 -0
  63. package/src/logger/constants.ts +0 -1
  64. package/src/logger/index.ts +3 -3
  65. package/src/logger/sdkLogger.ts +1 -2
  66. package/src/logger/types.ts +0 -16
  67. package/src/readiness/sdkReadinessManager.ts +1 -1
  68. package/src/readiness/types.ts +2 -9
  69. package/src/sdkClient/client.ts +13 -13
  70. package/src/sdkClient/clientAttributesDecoration.ts +13 -13
  71. package/src/sdkClient/clientCS.ts +3 -4
  72. package/src/sdkClient/clientInputValidation.ts +15 -15
  73. package/src/sdkClient/sdkClient.ts +2 -2
  74. package/src/sdkClient/sdkClientMethod.ts +2 -2
  75. package/src/sdkClient/sdkClientMethodCS.ts +9 -9
  76. package/src/sdkClient/sdkClientMethodCSWithTT.ts +9 -9
  77. package/src/sdkFactory/index.ts +8 -17
  78. package/src/sdkFactory/types.ts +8 -11
  79. package/src/sdkManager/index.ts +5 -5
  80. package/src/services/splitApi.ts +1 -22
  81. package/src/services/types.ts +0 -6
  82. package/src/storages/dataLoader.ts +2 -2
  83. package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +1 -1
  84. package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +2 -2
  85. package/src/storages/inLocalStorage/index.ts +3 -2
  86. package/src/storages/inMemory/AttributesCacheInMemory.ts +13 -12
  87. package/src/storages/inMemory/EventsCacheInMemory.ts +4 -4
  88. package/src/storages/inRedis/EventsCacheInRedis.ts +4 -4
  89. package/src/storages/inRedis/ImpressionsCacheInRedis.ts +1 -1
  90. package/src/storages/inRedis/RedisAdapter.ts +1 -1
  91. package/src/storages/inRedis/SegmentsCacheInRedis.ts +1 -1
  92. package/src/storages/inRedis/SplitsCacheInRedis.ts +1 -1
  93. package/src/storages/inRedis/TelemetryCacheInRedis.ts +1 -1
  94. package/src/storages/inRedis/index.ts +3 -2
  95. package/src/storages/pluggable/EventsCachePluggable.ts +4 -4
  96. package/src/storages/pluggable/ImpressionsCachePluggable.ts +1 -1
  97. package/src/storages/pluggable/SegmentsCachePluggable.ts +1 -1
  98. package/src/storages/pluggable/SplitsCachePluggable.ts +1 -1
  99. package/src/storages/pluggable/TelemetryCachePluggable.ts +1 -1
  100. package/src/storages/pluggable/index.ts +3 -3
  101. package/src/storages/pluggable/wrapperAdapter.ts +1 -1
  102. package/src/storages/types.ts +46 -35
  103. package/src/sync/offline/LocalhostFromObject.ts +4 -4
  104. package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +8 -8
  105. package/src/sync/polling/updaters/mySegmentsUpdater.ts +1 -1
  106. package/src/sync/polling/updaters/segmentChangesUpdater.ts +1 -1
  107. package/src/sync/polling/updaters/splitChangesUpdater.ts +1 -1
  108. package/src/sync/streaming/SSEHandler/index.ts +1 -1
  109. package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +1 -1
  110. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +1 -1
  111. package/src/sync/submitters/submitter.ts +1 -1
  112. package/src/sync/submitters/submitterManager.ts +0 -2
  113. package/src/sync/submitters/types.ts +3 -22
  114. package/src/sync/syncTask.ts +1 -1
  115. package/src/trackers/eventTracker.ts +3 -3
  116. package/src/trackers/impressionsTracker.ts +37 -15
  117. package/src/trackers/types.ts +4 -34
  118. package/src/types.d.ts +1581 -0
  119. package/src/utils/constants/index.ts +1 -2
  120. package/src/utils/inputValidation/apiKey.ts +1 -1
  121. package/src/utils/inputValidation/attribute.ts +1 -1
  122. package/src/utils/inputValidation/attributes.ts +3 -3
  123. package/src/utils/inputValidation/event.ts +1 -1
  124. package/src/utils/inputValidation/eventProperties.ts +3 -3
  125. package/src/utils/inputValidation/eventValue.ts +1 -1
  126. package/src/utils/inputValidation/isOperational.ts +1 -1
  127. package/src/utils/inputValidation/key.ts +3 -3
  128. package/src/utils/inputValidation/preloadedData.ts +3 -3
  129. package/src/utils/inputValidation/split.ts +1 -1
  130. package/src/utils/inputValidation/splitExistance.ts +1 -1
  131. package/src/utils/inputValidation/splits.ts +1 -1
  132. package/src/utils/inputValidation/trafficType.ts +1 -1
  133. package/src/utils/inputValidation/trafficTypeExistance.ts +1 -1
  134. package/src/utils/key/index.ts +9 -9
  135. package/src/utils/settingsValidation/consent.ts +1 -2
  136. package/src/utils/settingsValidation/impressionsMode.ts +6 -6
  137. package/src/utils/settingsValidation/index.ts +1 -4
  138. package/src/utils/settingsValidation/integrations/common.ts +1 -1
  139. package/src/utils/settingsValidation/integrations/configurable.ts +1 -1
  140. package/src/utils/settingsValidation/integrations/pluggable.ts +1 -2
  141. package/src/utils/settingsValidation/localhost/builtin.ts +1 -2
  142. package/src/utils/settingsValidation/localhost/pluggable.ts +1 -2
  143. package/src/utils/settingsValidation/logger/builtinLogger.ts +1 -2
  144. package/src/utils/settingsValidation/logger/pluggableLogger.ts +1 -2
  145. package/src/utils/settingsValidation/splitFilters.ts +7 -9
  146. package/src/utils/settingsValidation/storage/storageCS.ts +1 -2
  147. package/cjs/sync/submitters/uniqueKeysSubmitter.js +0 -70
  148. package/cjs/trackers/strategy/strategyDebug.js +0 -25
  149. package/cjs/trackers/strategy/strategyNone.js +0 -29
  150. package/cjs/trackers/strategy/strategyOptimized.js +0 -34
  151. package/cjs/trackers/uniqueKeysTracker.js +0 -69
  152. package/cjs/types.js +0 -2
  153. package/esm/sync/submitters/uniqueKeysSubmitter.js +0 -64
  154. package/esm/trackers/strategy/strategyDebug.js +0 -21
  155. package/esm/trackers/strategy/strategyNone.js +0 -25
  156. package/esm/trackers/strategy/strategyOptimized.js +0 -30
  157. package/esm/trackers/uniqueKeysTracker.js +0 -65
  158. package/esm/types.js +0 -1
  159. package/src/sync/submitters/uniqueKeysSubmitter.ts +0 -79
  160. package/src/trackers/strategy/strategyDebug.ts +0 -28
  161. package/src/trackers/strategy/strategyNone.ts +0 -34
  162. package/src/trackers/strategy/strategyOptimized.ts +0 -42
  163. package/src/trackers/uniqueKeysTracker.ts +0 -80
  164. package/src/types.ts +0 -1264
  165. package/types/consent/index.d.ts +0 -2
  166. package/types/consent/sdkUserConsent.d.ts +0 -13
  167. package/types/dtos/types.d.ts +0 -172
  168. package/types/evaluator/Engine.d.ts +0 -15
  169. package/types/evaluator/combiners/and.d.ts +0 -4
  170. package/types/evaluator/combiners/ifelseif.d.ts +0 -3
  171. package/types/evaluator/condition/engineUtils.d.ts +0 -11
  172. package/types/evaluator/condition/index.d.ts +0 -6
  173. package/types/evaluator/convertions/index.d.ts +0 -2
  174. package/types/evaluator/index.d.ts +0 -7
  175. package/types/evaluator/matchers/all.d.ts +0 -2
  176. package/types/evaluator/matchers/between.d.ts +0 -3
  177. package/types/evaluator/matchers/boolean.d.ts +0 -2
  178. package/types/evaluator/matchers/cont_all.d.ts +0 -2
  179. package/types/evaluator/matchers/cont_any.d.ts +0 -2
  180. package/types/evaluator/matchers/cont_str.d.ts +0 -2
  181. package/types/evaluator/matchers/dependency.d.ts +0 -5
  182. package/types/evaluator/matchers/eq.d.ts +0 -2
  183. package/types/evaluator/matchers/eq_set.d.ts +0 -2
  184. package/types/evaluator/matchers/ew.d.ts +0 -2
  185. package/types/evaluator/matchers/gte.d.ts +0 -2
  186. package/types/evaluator/matchers/index.d.ts +0 -7
  187. package/types/evaluator/matchers/lte.d.ts +0 -2
  188. package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
  189. package/types/evaluator/matchers/part_of.d.ts +0 -2
  190. package/types/evaluator/matchers/segment.d.ts +0 -6
  191. package/types/evaluator/matchers/string.d.ts +0 -2
  192. package/types/evaluator/matchers/sw.d.ts +0 -2
  193. package/types/evaluator/matchers/whitelist.d.ts +0 -3
  194. package/types/evaluator/matchersTransform/index.d.ts +0 -6
  195. package/types/evaluator/matchersTransform/segment.d.ts +0 -5
  196. package/types/evaluator/matchersTransform/set.d.ts +0 -5
  197. package/types/evaluator/matchersTransform/unaryNumeric.d.ts +0 -5
  198. package/types/evaluator/matchersTransform/whitelist.d.ts +0 -5
  199. package/types/evaluator/parser/index.d.ts +0 -5
  200. package/types/evaluator/treatments/index.d.ts +0 -8
  201. package/types/evaluator/types.d.ts +0 -28
  202. package/types/evaluator/value/index.d.ts +0 -7
  203. package/types/evaluator/value/sanitize.d.ts +0 -7
  204. package/types/index.d.ts +0 -5
  205. package/types/integrations/browser.d.ts +0 -12
  206. package/types/integrations/ga/GaToSplit.d.ts +0 -40
  207. package/types/integrations/ga/GoogleAnalyticsToSplit.d.ts +0 -3
  208. package/types/integrations/ga/SplitToGa.d.ts +0 -34
  209. package/types/integrations/ga/SplitToGoogleAnalytics.d.ts +0 -3
  210. package/types/integrations/ga/types.d.ts +0 -148
  211. package/types/integrations/pluggable.d.ts +0 -11
  212. package/types/integrations/types.d.ts +0 -17
  213. package/types/listeners/browser.d.ts +0 -40
  214. package/types/listeners/node.d.ts +0 -22
  215. package/types/listeners/types.d.ts +0 -4
  216. package/types/logger/browser/DebugLogger.d.ts +0 -2
  217. package/types/logger/browser/ErrorLogger.d.ts +0 -2
  218. package/types/logger/browser/InfoLogger.d.ts +0 -2
  219. package/types/logger/browser/WarnLogger.d.ts +0 -2
  220. package/types/logger/constants.d.ts +0 -142
  221. package/types/logger/index.d.ts +0 -22
  222. package/types/logger/messages/debug.d.ts +0 -1
  223. package/types/logger/messages/error.d.ts +0 -1
  224. package/types/logger/messages/info.d.ts +0 -1
  225. package/types/logger/messages/warn.d.ts +0 -1
  226. package/types/logger/sdkLogger.d.ts +0 -8
  227. package/types/logger/types.d.ts +0 -17
  228. package/types/readiness/constants.d.ts +0 -7
  229. package/types/readiness/readinessManager.d.ts +0 -6
  230. package/types/readiness/sdkReadinessManager.d.ts +0 -11
  231. package/types/readiness/types.d.ts +0 -60
  232. package/types/sdkClient/client.d.ts +0 -6
  233. package/types/sdkClient/clientAttributesDecoration.d.ts +0 -51
  234. package/types/sdkClient/clientCS.d.ts +0 -10
  235. package/types/sdkClient/clientInputValidation.d.ts +0 -7
  236. package/types/sdkClient/sdkClient.d.ts +0 -6
  237. package/types/sdkClient/sdkClientMethod.d.ts +0 -6
  238. package/types/sdkClient/sdkClientMethodCS.d.ts +0 -7
  239. package/types/sdkClient/sdkClientMethodCSWithTT.d.ts +0 -8
  240. package/types/sdkClient/types.d.ts +0 -18
  241. package/types/sdkFactory/index.d.ts +0 -6
  242. package/types/sdkFactory/types.d.ts +0 -82
  243. package/types/sdkManager/index.d.ts +0 -5
  244. package/types/services/splitApi.d.ts +0 -11
  245. package/types/services/splitHttpClient.d.ts +0 -10
  246. package/types/services/types.d.ts +0 -54
  247. package/types/storages/AbstractSegmentsCacheSync.d.ts +0 -55
  248. package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -36
  249. package/types/storages/AbstractSplitsCacheSync.d.ts +0 -42
  250. package/types/storages/KeyBuilder.d.ts +0 -14
  251. package/types/storages/KeyBuilderCS.d.ts +0 -16
  252. package/types/storages/KeyBuilderSS.d.ts +0 -15
  253. package/types/storages/dataLoader.d.ts +0 -10
  254. package/types/storages/findLatencyIndex.d.ts +0 -7
  255. package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -25
  256. package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -51
  257. package/types/storages/inLocalStorage/constants.d.ts +0 -2
  258. package/types/storages/inLocalStorage/index.d.ts +0 -8
  259. package/types/storages/inMemory/AttributesCacheInMemory.d.ts +0 -43
  260. package/types/storages/inMemory/CountsCacheInMemory.d.ts +0 -20
  261. package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
  262. package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -24
  263. package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +0 -30
  264. package/types/storages/inMemory/InMemoryStorage.d.ts +0 -10
  265. package/types/storages/inMemory/InMemoryStorageCS.d.ts +0 -10
  266. package/types/storages/inMemory/LatenciesCacheInMemory.d.ts +0 -20
  267. package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +0 -22
  268. package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -19
  269. package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -20
  270. package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -53
  271. package/types/storages/inRedis/CountsCacheInRedis.d.ts +0 -9
  272. package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
  273. package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -18
  274. package/types/storages/inRedis/LatenciesCacheInRedis.d.ts +0 -9
  275. package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
  276. package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -18
  277. package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -91
  278. package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -20
  279. package/types/storages/inRedis/constants.d.ts +0 -1
  280. package/types/storages/inRedis/index.d.ts +0 -10
  281. package/types/storages/metadataBuilder.d.ts +0 -3
  282. package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
  283. package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -35
  284. package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -54
  285. package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -89
  286. package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -18
  287. package/types/storages/pluggable/constants.d.ts +0 -1
  288. package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -13
  289. package/types/storages/pluggable/index.d.ts +0 -9
  290. package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
  291. package/types/storages/types.d.ts +0 -417
  292. package/types/sync/offline/LocalhostFromFile.d.ts +0 -2
  293. package/types/sync/offline/LocalhostFromObject.d.ts +0 -2
  294. package/types/sync/offline/splitsParser/parseCondition.d.ts +0 -7
  295. package/types/sync/offline/splitsParser/splitsParserFromFile.d.ts +0 -2
  296. package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +0 -3
  297. package/types/sync/offline/splitsParser/types.d.ts +0 -3
  298. package/types/sync/offline/syncManagerOffline.d.ts +0 -10
  299. package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +0 -17
  300. package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +0 -7
  301. package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +0 -7
  302. package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +0 -7
  303. package/types/sync/polling/fetchers/types.d.ts +0 -5
  304. package/types/sync/polling/pollingManagerCS.d.ts +0 -7
  305. package/types/sync/polling/pollingManagerSS.d.ts +0 -6
  306. package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +0 -9
  307. package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +0 -9
  308. package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +0 -9
  309. package/types/sync/polling/types.d.ts +0 -26
  310. package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -13
  311. package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
  312. package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -39
  313. package/types/sync/streaming/AuthClient/index.d.ts +0 -12
  314. package/types/sync/streaming/AuthClient/types.d.ts +0 -17
  315. package/types/sync/streaming/SSEClient/index.d.ts +0 -34
  316. package/types/sync/streaming/SSEClient/types.d.ts +0 -11
  317. package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +0 -14
  318. package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +0 -20
  319. package/types/sync/streaming/SSEHandler/index.d.ts +0 -11
  320. package/types/sync/streaming/SSEHandler/types.d.ts +0 -67
  321. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -6
  322. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -8
  323. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -12
  324. package/types/sync/streaming/UpdateWorkers/constants.d.ts +0 -3
  325. package/types/sync/streaming/UpdateWorkers/types.d.ts +0 -4
  326. package/types/sync/streaming/constants.d.ts +0 -34
  327. package/types/sync/streaming/mySegmentsV2utils.d.ts +0 -27
  328. package/types/sync/streaming/pushManager.d.ts +0 -9
  329. package/types/sync/streaming/types.d.ts +0 -35
  330. package/types/sync/submitters/eventsSubmitter.d.ts +0 -5
  331. package/types/sync/submitters/eventsSyncTask.d.ts +0 -8
  332. package/types/sync/submitters/impressionCountsSubmitter.d.ts +0 -10
  333. package/types/sync/submitters/impressionCountsSyncTask.d.ts +0 -13
  334. package/types/sync/submitters/impressionsSubmitter.d.ts +0 -11
  335. package/types/sync/submitters/impressionsSyncTask.d.ts +0 -14
  336. package/types/sync/submitters/metricsSyncTask.d.ts +0 -12
  337. package/types/sync/submitters/submitter.d.ts +0 -12
  338. package/types/sync/submitters/submitterManager.d.ts +0 -3
  339. package/types/sync/submitters/submitterSyncTask.d.ts +0 -10
  340. package/types/sync/submitters/telemetrySubmitter.d.ts +0 -25
  341. package/types/sync/submitters/types.d.ts +0 -194
  342. package/types/sync/submitters/uniqueKeysSubmitter.d.ts +0 -19
  343. package/types/sync/syncManagerOnline.d.ts +0 -13
  344. package/types/sync/syncTask.d.ts +0 -13
  345. package/types/sync/syncTaskComposite.d.ts +0 -5
  346. package/types/sync/types.d.ts +0 -43
  347. package/types/trackers/eventTracker.d.ts +0 -10
  348. package/types/trackers/filter/bloomFilter.d.ts +0 -10
  349. package/types/trackers/filter/dictionaryFilter.d.ts +0 -8
  350. package/types/trackers/filter/types.d.ts +0 -5
  351. package/types/trackers/impressionObserver/ImpressionObserver.d.ts +0 -8
  352. package/types/trackers/impressionObserver/buildKey.d.ts +0 -2
  353. package/types/trackers/impressionObserver/impressionObserverCS.d.ts +0 -4
  354. package/types/trackers/impressionObserver/impressionObserverSS.d.ts +0 -4
  355. package/types/trackers/impressionObserver/types.d.ts +0 -4
  356. package/types/trackers/impressionObserver/utils.d.ts +0 -13
  357. package/types/trackers/impressionsTracker.d.ts +0 -13
  358. package/types/trackers/strategy/strategyDebug.d.ts +0 -9
  359. package/types/trackers/strategy/strategyNone.d.ts +0 -10
  360. package/types/trackers/strategy/strategyOptimized.d.ts +0 -11
  361. package/types/trackers/telemetryTracker.d.ts +0 -3
  362. package/types/trackers/types.d.ts +0 -65
  363. package/types/trackers/uniqueKeysTracker.d.ts +0 -13
  364. package/types/types.d.ts +0 -1262
  365. package/types/utils/Backoff.d.ts +0 -25
  366. package/types/utils/LRUCache/LinkedList.d.ts +0 -34
  367. package/types/utils/LRUCache/index.d.ts +0 -16
  368. package/types/utils/MinEventEmitter.d.ts +0 -12
  369. package/types/utils/MinEvents.d.ts +0 -4
  370. package/types/utils/base64/index.d.ts +0 -30
  371. package/types/utils/constants/browser.d.ts +0 -3
  372. package/types/utils/constants/index.d.ts +0 -63
  373. package/types/utils/decompress/index.d.ts +0 -16
  374. package/types/utils/env/isLocalStorageAvailable.d.ts +0 -1
  375. package/types/utils/env/isNode.d.ts +0 -5
  376. package/types/utils/inputValidation/apiKey.d.ts +0 -7
  377. package/types/utils/inputValidation/attribute.d.ts +0 -2
  378. package/types/utils/inputValidation/attributes.d.ts +0 -4
  379. package/types/utils/inputValidation/event.d.ts +0 -2
  380. package/types/utils/inputValidation/eventProperties.d.ts +0 -6
  381. package/types/utils/inputValidation/eventValue.d.ts +0 -2
  382. package/types/utils/inputValidation/index.d.ts +0 -13
  383. package/types/utils/inputValidation/isOperational.d.ts +0 -4
  384. package/types/utils/inputValidation/key.d.ts +0 -3
  385. package/types/utils/inputValidation/preloadedData.d.ts +0 -3
  386. package/types/utils/inputValidation/split.d.ts +0 -2
  387. package/types/utils/inputValidation/splitExistance.d.ts +0 -7
  388. package/types/utils/inputValidation/splits.d.ts +0 -2
  389. package/types/utils/inputValidation/trafficType.d.ts +0 -2
  390. package/types/utils/inputValidation/trafficTypeExistance.d.ts +0 -9
  391. package/types/utils/jwt/index.d.ts +0 -5
  392. package/types/utils/jwt/types.d.ts +0 -5
  393. package/types/utils/key/index.d.ts +0 -8
  394. package/types/utils/labels/index.d.ts +0 -7
  395. package/types/utils/lang/binarySearch.d.ts +0 -9
  396. package/types/utils/lang/getFnName.d.ts +0 -4
  397. package/types/utils/lang/getGlobal.d.ts +0 -4
  398. package/types/utils/lang/index.d.ts +0 -105
  399. package/types/utils/lang/maps.d.ts +0 -55
  400. package/types/utils/lang/objectAssign.d.ts +0 -3
  401. package/types/utils/lang/sets.d.ts +0 -60
  402. package/types/utils/murmur3/common.d.ts +0 -12
  403. package/types/utils/murmur3/legacy.d.ts +0 -2
  404. package/types/utils/murmur3/murmur3.d.ts +0 -2
  405. package/types/utils/murmur3/murmur3_128.d.ts +0 -6
  406. package/types/utils/murmur3/murmur3_128_x86.d.ts +0 -7
  407. package/types/utils/murmur3/murmur3_64.d.ts +0 -10
  408. package/types/utils/murmur3/utfx.d.ts +0 -27
  409. package/types/utils/promise/thenable.d.ts +0 -1
  410. package/types/utils/promise/timeout.d.ts +0 -1
  411. package/types/utils/promise/wrapper.d.ts +0 -21
  412. package/types/utils/settingsValidation/consent.d.ts +0 -6
  413. package/types/utils/settingsValidation/impressionsMode.d.ts +0 -3
  414. package/types/utils/settingsValidation/index.d.ts +0 -52
  415. package/types/utils/settingsValidation/integrations/common.d.ts +0 -14
  416. package/types/utils/settingsValidation/integrations/configurable.d.ts +0 -13
  417. package/types/utils/settingsValidation/integrations/pluggable.d.ts +0 -13
  418. package/types/utils/settingsValidation/localhost/builtin.d.ts +0 -16
  419. package/types/utils/settingsValidation/localhost/pluggable.d.ts +0 -16
  420. package/types/utils/settingsValidation/logger/builtinLogger.d.ts +0 -10
  421. package/types/utils/settingsValidation/logger/commons.d.ts +0 -9
  422. package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +0 -11
  423. package/types/utils/settingsValidation/mode.d.ts +0 -1
  424. package/types/utils/settingsValidation/runtime.d.ts +0 -2
  425. package/types/utils/settingsValidation/splitFilters.d.ts +0 -16
  426. package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -21
  427. package/types/utils/settingsValidation/types.d.ts +0 -32
  428. package/types/utils/settingsValidation/url.d.ts +0 -10
  429. package/types/utils/time/index.d.ts +0 -4
  430. package/types/utils/timeTracker/index.d.ts +0 -70
  431. package/types/utils/timeTracker/now/browser.d.ts +0 -1
  432. package/types/utils/timeTracker/now/node.d.ts +0 -1
  433. package/types/utils/timeTracker/timer.d.ts +0 -1
@@ -1,6 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ISdkFactoryContext } from '../sdkFactory/types';
3
- /**
4
- * Factory of client method for server-side SDKs (ISDK and IAsyncSDK)
5
- */
6
- export declare function sdkClientMethodFactory(params: ISdkFactoryContext): () => SplitIO.IClient | SplitIO.IAsyncClient;
@@ -1,7 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ISdkFactoryContext } from '../sdkFactory/types';
3
- /**
4
- * Factory of client method for the client-side API variant where TT is ignored and thus
5
- * clients don't have a binded TT for the track method.
6
- */
7
- export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitIO.SplitKey) => SplitIO.ICsClient;
@@ -1,8 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ISdkFactoryContext } from '../sdkFactory/types';
3
- /**
4
- * Factory of client method for the client-side (browser) variant of the Isomorphic JS SDK,
5
- * where clients can have a binded TT for the track method, which is provided via the settings
6
- * (default client) or the client method (shared clients).
7
- */
8
- export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitIO.SplitKey, trafficType?: string) => SplitIO.ICsClient;
@@ -1,18 +0,0 @@
1
- import { ISignalListener } from '../listeners/types';
2
- import { ISdkReadinessManager } from '../readiness/types';
3
- import { IStorageAsync, IStorageSync } from '../storages/types';
4
- import { ISyncManager } from '../sync/types';
5
- import { IEventTracker, IImpressionsTracker } from '../trackers/types';
6
- import { ISettings } from '../types';
7
- export interface IClientFactoryParams {
8
- storage: IStorageSync | IStorageAsync;
9
- sdkReadinessManager: ISdkReadinessManager;
10
- settings: ISettings;
11
- impressionsTracker: IImpressionsTracker;
12
- eventTracker: IEventTracker;
13
- }
14
- export interface ISdkClientFactoryParams extends IClientFactoryParams {
15
- signalListener?: ISignalListener;
16
- syncManager?: ISyncManager;
17
- sharedClient?: boolean;
18
- }
@@ -1,6 +0,0 @@
1
- import { ISdkFactoryParams } from './types';
2
- import { SplitIO } from '../types';
3
- /**
4
- * Modular SDK factory
5
- */
6
- export declare function sdkFactory(params: ISdkFactoryParams): SplitIO.ICsSDK | SplitIO.ISDK | SplitIO.IAsyncSDK;
@@ -1,82 +0,0 @@
1
- import { IIntegrationManager, IIntegrationFactoryParams } from '../integrations/types';
2
- import { ISignalListener } from '../listeners/types';
3
- import { ILogger } from '../logger/types';
4
- import { IReadinessManager, ISdkReadinessManager } from '../readiness/types';
5
- import { IFetch, ISplitApi, IEventSourceConstructor } from '../services/types';
6
- import { IStorageAsync, IStorageSync, ISplitsCacheSync, ISplitsCacheAsync, IStorageFactoryParams } from '../storages/types';
7
- import { ISyncManager } from '../sync/types';
8
- import { IImpressionObserver } from '../trackers/impressionObserver/types';
9
- import { IImpressionsTracker, IEventTracker, ITelemetryTracker, IFilterAdapter, IUniqueKeysTracker } from '../trackers/types';
10
- import { SplitIO, ISettings, IEventEmitter } from '../types';
11
- /**
12
- * Environment related dependencies.
13
- */
14
- export interface IPlatform {
15
- /**
16
- * If provided, it is used to retrieve the Fetch API for HTTP requests. Otherwise, the global fetch is used.
17
- */
18
- getFetch?: () => (IFetch | undefined);
19
- /**
20
- * If provided, it is used to pass additional options to fetch calls.
21
- */
22
- getOptions?: () => object;
23
- /**
24
- * If provided, it is used to retrieve the EventSource constructor for streaming support.
25
- */
26
- getEventSource?: () => (IEventSourceConstructor | undefined);
27
- /**
28
- * EventEmitter constructor, like NodeJS.EventEmitter or a polyfill.
29
- */
30
- EventEmitter: new () => IEventEmitter;
31
- /**
32
- * Function used to track latencies for telemetry.
33
- */
34
- now?: () => number;
35
- }
36
- export interface ISdkFactoryContext {
37
- platform: IPlatform;
38
- sdkReadinessManager: ISdkReadinessManager;
39
- readiness: IReadinessManager;
40
- settings: ISettings;
41
- impressionsTracker: IImpressionsTracker;
42
- eventTracker: IEventTracker;
43
- telemetryTracker: ITelemetryTracker;
44
- storage: IStorageSync | IStorageAsync;
45
- uniqueKeysTracker?: IUniqueKeysTracker;
46
- signalListener?: ISignalListener;
47
- splitApi?: ISplitApi;
48
- syncManager?: ISyncManager;
49
- }
50
- export interface ISdkFactoryContextSync extends ISdkFactoryContext {
51
- storage: IStorageSync;
52
- splitApi: ISplitApi;
53
- syncManager: ISyncManager;
54
- }
55
- export interface ISdkFactoryContextAsync extends ISdkFactoryContext {
56
- storage: IStorageAsync;
57
- splitApi: undefined;
58
- syncManager: undefined;
59
- }
60
- /**
61
- * Object parameter with the modules required to create an SDK factory instance
62
- */
63
- export interface ISdkFactoryParams {
64
- settings: ISettings;
65
- platform: IPlatform;
66
- storageFactory: (params: IStorageFactoryParams) => IStorageSync | IStorageAsync;
67
- splitApiFactory?: (settings: ISettings, platform: IPlatform, telemetryTracker: ITelemetryTracker) => ISplitApi;
68
- syncManagerFactory?: (params: ISdkFactoryContextSync) => ISyncManager;
69
- sdkManagerFactory: (log: ILogger, splits: ISplitsCacheSync | ISplitsCacheAsync, sdkReadinessManager: ISdkReadinessManager) => SplitIO.IManager | SplitIO.IAsyncManager;
70
- sdkClientMethodFactory: (params: ISdkFactoryContext) => ({
71
- (): SplitIO.ICsClient;
72
- (key: SplitIO.SplitKey, trafficType?: string | undefined): SplitIO.ICsClient;
73
- } | (() => SplitIO.IClient) | (() => SplitIO.IAsyncClient));
74
- impressionsObserverFactory: () => IImpressionObserver;
75
- filterAdapterFactory?: () => IFilterAdapter;
76
- SignalListener?: new (syncManager: ISyncManager | undefined, // Used by NodeSignalListener to flush data, and by BrowserSignalListener to close streaming connection.
77
- settings: ISettings, // Used by BrowserSignalListener
78
- storage: IStorageSync | IStorageAsync, // Used by BrowserSignalListener
79
- serviceApi: ISplitApi | undefined) => ISignalListener;
80
- integrationsManagerFactory?: (params: IIntegrationFactoryParams) => IIntegrationManager | undefined;
81
- extraProps?: (params: ISdkFactoryContext) => object;
82
- }
@@ -1,5 +0,0 @@
1
- import { ISplitsCacheAsync, ISplitsCacheSync } from '../storages/types';
2
- import { ISdkReadinessManager } from '../readiness/types';
3
- import { SplitIO } from '../types';
4
- import { ILogger } from '../logger/types';
5
- export declare function sdkManagerFactory<TSplitCache extends ISplitsCacheSync | ISplitsCacheAsync>(log: ILogger, splits: TSplitCache, { readinessManager, sdkStatus }: ISdkReadinessManager): TSplitCache extends ISplitsCacheAsync ? SplitIO.IAsyncManager : SplitIO.IManager;
@@ -1,11 +0,0 @@
1
- import { IPlatform } from '../sdkFactory/types';
2
- import { ISettings } from '../types';
3
- import { ISplitApi } from './types';
4
- import { ITelemetryTracker } from '../trackers/types';
5
- /**
6
- * Factory of SplitApi objects, which group the collection of Split HTTP endpoints used by the SDK
7
- *
8
- * @param settings validated settings object
9
- * @param platform object containing environment-specific `getFetch` and `getOptions` dependencies
10
- */
11
- export declare function splitApiFactory(settings: Pick<ISettings, 'urls' | 'sync' | 'log' | 'version' | 'runtime' | 'core'>, platform: Pick<IPlatform, 'getFetch' | 'getOptions'>, telemetryTracker: ITelemetryTracker): ISplitApi;
@@ -1,10 +0,0 @@
1
- import { IFetch, ISplitHttpClient } from './types';
2
- import { ISettings } from '../types';
3
- /**
4
- * Factory of Split HTTP clients, which are HTTP clients with predefined headers for Split endpoints.
5
- *
6
- * @param settings SDK settings, used to access authorizationKey, logger instance and metadata (SDK version, ip and hostname) to set additional headers
7
- * @param options global request options
8
- * @param fetch optional http client to use instead of the global Fetch (for environments where Fetch API is not available such as Node)
9
- */
10
- export declare function splitHttpClientFactory(settings: Pick<ISettings, 'log' | 'version' | 'runtime' | 'core'>, getFetch?: () => (IFetch | undefined), getOptions?: () => object): ISplitHttpClient;
@@ -1,54 +0,0 @@
1
- export declare type IRequestOptions = {
2
- method?: string;
3
- headers?: Record<string, string>;
4
- body?: string;
5
- };
6
- export declare type IResponse = {
7
- ok: boolean;
8
- status: number;
9
- json: () => Promise<any>;
10
- text: () => Promise<string>;
11
- };
12
- export declare type NetworkError = Error & {
13
- statusCode?: number;
14
- };
15
- export declare type IFetch = (url: string, options?: IRequestOptions) => Promise<IResponse>;
16
- export declare type IHealthCheckAPI = () => Promise<boolean>;
17
- export declare type ISplitHttpClient = (url: string, options?: IRequestOptions, latencyTracker?: (error?: NetworkError) => void, logErrorsAsInfo?: boolean) => Promise<IResponse>;
18
- export declare type IFetchAuth = (userKeys?: string[]) => Promise<IResponse>;
19
- export declare type IFetchSplitChanges = (since: number, noCache?: boolean, till?: number) => Promise<IResponse>;
20
- export declare type IFetchSegmentChanges = (since: number, segmentName: string, noCache?: boolean, till?: number) => Promise<IResponse>;
21
- export declare type IFetchMySegments = (userMatchingKey: string, noCache?: boolean) => Promise<IResponse>;
22
- export declare type IPostEventsBulk = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
23
- export declare type IPostUniqueKeysBulkCs = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
24
- export declare type IPostUniqueKeysBulkSs = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
25
- export declare type IPostTestImpressionsBulk = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
26
- export declare type IPostTestImpressionsCount = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
27
- export declare type IPostMetricsConfig = (body: string) => Promise<IResponse>;
28
- export declare type IPostMetricsUsage = (body: string) => Promise<IResponse>;
29
- export interface ISplitApi {
30
- getSdkAPIHealthCheck: IHealthCheckAPI;
31
- getEventsAPIHealthCheck: IHealthCheckAPI;
32
- fetchAuth: IFetchAuth;
33
- fetchSplitChanges: IFetchSplitChanges;
34
- fetchSegmentChanges: IFetchSegmentChanges;
35
- fetchMySegments: IFetchMySegments;
36
- postEventsBulk: IPostEventsBulk;
37
- postUniqueKeysBulkCs: IPostUniqueKeysBulkCs;
38
- postUniqueKeysBulkSs: IPostUniqueKeysBulkSs;
39
- postTestImpressionsBulk: IPostTestImpressionsBulk;
40
- postTestImpressionsCount: IPostTestImpressionsCount;
41
- postMetricsConfig: IPostMetricsConfig;
42
- postMetricsUsage: IPostMetricsUsage;
43
- }
44
- interface EventSourceEventMap {
45
- 'error': Event;
46
- 'message': MessageEvent;
47
- 'open': Event;
48
- }
49
- interface IEventSource {
50
- addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: IEventSource, ev: EventSourceEventMap[K]) => any): void;
51
- close(): void;
52
- }
53
- export declare type IEventSourceConstructor = new (url: string, eventSourceInitDict?: any) => IEventSource;
54
- export {};
@@ -1,55 +0,0 @@
1
- import { ISegmentsCacheSync } from './types';
2
- /**
3
- * This class provides a skeletal implementation of the ISegmentsCacheSync interface
4
- * to minimize the effort required to implement this interface.
5
- */
6
- export declare abstract class AbstractSegmentsCacheSync implements ISegmentsCacheSync {
7
- /**
8
- * For server-side synchronizer: add `segmentKeys` list of keys to `name` segment.
9
- * For client-side synchronizer: add `name` segment to the cache. `segmentKeys` is undefined.
10
- */
11
- abstract addToSegment(name: string, segmentKeys?: string[]): boolean;
12
- /**
13
- * For server-side synchronizer: remove `segmentKeys` list of keys from `name` segment.
14
- * For client-side synchronizer: remove `name` segment from the cache. `segmentKeys` is undefined.
15
- */
16
- abstract removeFromSegment(name: string, segmentKeys?: string[]): boolean;
17
- /**
18
- * For server-side synchronizer: check if `key` is in `name` segment.
19
- * For client-side synchronizer: check if `name` segment is in the cache. `key` is undefined.
20
- */
21
- abstract isInSegment(name: string, key?: string): boolean;
22
- /**
23
- * clear the cache.
24
- */
25
- abstract clear(): void;
26
- /**
27
- * For server-side synchronizer: add the given list of segments to the cache, with an empty list of keys. The segments that already exist are not modified.
28
- * For client-side synchronizer: the method is not used.
29
- */
30
- registerSegments(names: string[]): boolean;
31
- /**
32
- * For server-side synchronizer: get the list of segments to fetch changes.
33
- * Also used for the `seC` (segment count) telemetry stat.
34
- */
35
- abstract getRegisteredSegments(): string[];
36
- /**
37
- * Only used for the `skC`(segment keys count) telemetry stat: 1 for client-side, and total count of keys in server-side.
38
- */
39
- abstract getKeysCount(): number;
40
- /**
41
- * For server-side synchronizer: set the change number of `name` segment.
42
- * For client-side synchronizer: the method is not used.
43
- */
44
- setChangeNumber(name: string, changeNumber: number): boolean;
45
- /**
46
- * For server-side synchronizer: get the change number of `name` segment.
47
- * For client-side synchronizer: the method is not used.
48
- */
49
- getChangeNumber(name: string): number;
50
- /**
51
- * For server-side synchronizer: the method is not used.
52
- * For client-side synchronizer: reset the cache with the given list of segments.
53
- */
54
- resetSegments(names: string[]): boolean;
55
- }
@@ -1,36 +0,0 @@
1
- import { ISplitsCacheAsync } from './types';
2
- /**
3
- * This class provides a skeletal implementation of the ISplitsCacheAsync interface
4
- * to minimize the effort required to implement this interface.
5
- */
6
- export declare abstract class AbstractSplitsCacheAsync implements ISplitsCacheAsync {
7
- abstract addSplit(name: string, split: string): Promise<boolean>;
8
- abstract addSplits(entries: [string, string][]): Promise<boolean[] | void>;
9
- abstract removeSplits(names: string[]): Promise<boolean[] | void>;
10
- abstract getSplit(name: string): Promise<string | null>;
11
- abstract getSplits(names: string[]): Promise<Record<string, string | null>>;
12
- abstract setChangeNumber(changeNumber: number): Promise<boolean | void>;
13
- abstract getChangeNumber(): Promise<number>;
14
- abstract getAll(): Promise<string[]>;
15
- abstract getSplitNames(): Promise<string[]>;
16
- abstract trafficTypeExists(trafficType: string): Promise<boolean>;
17
- abstract clear(): Promise<boolean | void>;
18
- usesSegments(): Promise<boolean>;
19
- /**
20
- * Check if the splits information is already stored in cache.
21
- * Noop, just keeping the interface. This is used by client-side implementations only.
22
- */
23
- checkCache(): Promise<boolean>;
24
- /**
25
- * Kill `name` split and set `defaultTreatment` and `changeNumber`.
26
- * Used for SPLIT_KILL push notifications.
27
- *
28
- * @param {string} name
29
- * @param {string} defaultTreatment
30
- * @param {number} changeNumber
31
- * @returns {Promise} a promise that is resolved once the split kill operation is performed. The fulfillment value is a boolean: `true` if the kill success updating the split or `false` if no split is updated,
32
- * for instance, if the `changeNumber` is old, or if the split is not found (e.g., `/splitchanges` hasn't been fetched yet), or if the storage fails to apply the update.
33
- * The promise will never be rejected.
34
- */
35
- killLocally(name: string, defaultTreatment: string, changeNumber: number): Promise<boolean>;
36
- }
@@ -1,42 +0,0 @@
1
- import { ISplitsCacheSync } from './types';
2
- import { ISplit } from '../dtos/types';
3
- /**
4
- * This class provides a skeletal implementation of the ISplitsCacheSync interface
5
- * to minimize the effort required to implement this interface.
6
- */
7
- export declare abstract class AbstractSplitsCacheSync implements ISplitsCacheSync {
8
- abstract addSplit(name: string, split: string): boolean;
9
- addSplits(entries: [string, string][]): boolean[];
10
- abstract removeSplit(name: string): boolean;
11
- removeSplits(names: string[]): boolean[];
12
- abstract getSplit(name: string): string | null;
13
- getSplits(names: string[]): Record<string, string | null>;
14
- abstract setChangeNumber(changeNumber: number): boolean;
15
- abstract getChangeNumber(): number;
16
- getAll(): string[];
17
- abstract getSplitNames(): string[];
18
- abstract trafficTypeExists(trafficType: string): boolean;
19
- abstract usesSegments(): boolean;
20
- abstract clear(): void;
21
- /**
22
- * Check if the splits information is already stored in cache. This data can be preloaded.
23
- * It is used as condition to emit SDK_SPLITS_CACHE_LOADED, and then SDK_READY_FROM_CACHE.
24
- */
25
- checkCache(): boolean;
26
- /**
27
- * Kill `name` split and set `defaultTreatment` and `changeNumber`.
28
- * Used for SPLIT_KILL push notifications.
29
- *
30
- * @param {string} name
31
- * @param {string} defaultTreatment
32
- * @param {number} changeNumber
33
- * @returns {Promise} a promise that is resolved once the split kill is performed. The fulfillment value is a boolean: `true` if the kill success updating the split or `false` if no split is updated,
34
- * for instance, if the `changeNumber` is old, or if the split is not found (e.g., `/splitchanges` hasn't been fetched yet), or if the storage fails to apply the update.
35
- */
36
- killLocally(name: string, defaultTreatment: string, changeNumber: number): boolean;
37
- }
38
- /**
39
- * Given a parsed split, it returns a boolean flagging if its conditions use segments matchers (rules & whitelists).
40
- * This util is intended to simplify the implementation of `splitsCache::usesSegments` method
41
- */
42
- export declare function usesSegments(split: ISplit): boolean;
@@ -1,14 +0,0 @@
1
- export declare function validatePrefix(prefix: unknown): string;
2
- export declare class KeyBuilder {
3
- protected readonly prefix: string;
4
- constructor(prefix?: string);
5
- buildTrafficTypeKey(trafficType: string): string;
6
- buildSplitKey(splitName: string): string;
7
- buildSplitsTillKey(): string;
8
- isSplitKey(key: string): boolean;
9
- buildSplitKeyPrefix(): string;
10
- buildSplitsWithSegmentCountKey(): string;
11
- buildSegmentNameKey(segmentName: string): string;
12
- buildSegmentTillKey(segmentName: string): string;
13
- extractKey(builtKey: string): string;
14
- }
@@ -1,16 +0,0 @@
1
- import { KeyBuilder } from './KeyBuilder';
2
- export declare class KeyBuilderCS extends KeyBuilder {
3
- protected readonly regexSplitsCacheKey: RegExp;
4
- protected readonly matchingKey: string;
5
- constructor(prefix: string, matchingKey: string);
6
- /**
7
- * @override
8
- */
9
- buildSegmentNameKey(segmentName: string): string;
10
- extractSegmentName(builtSegmentKeyName: string): string | undefined;
11
- buildOldSegmentNameKey(segmentName: string): string;
12
- extractOldSegmentKey(builtSegmentKeyName: string): string | undefined;
13
- buildLastUpdatedKey(): string;
14
- isSplitsCacheKey(key: string): boolean;
15
- buildSplitsFilterQueryKey(): string;
16
- }
@@ -1,15 +0,0 @@
1
- import { KeyBuilder } from './KeyBuilder';
2
- import { IMetadata } from '../dtos/types';
3
- import { Method } from '../sync/submitters/types';
4
- export declare class KeyBuilderSS extends KeyBuilder {
5
- protected readonly metadata: IMetadata;
6
- constructor(prefix: string, metadata: IMetadata);
7
- buildRegisteredSegmentsKey(): string;
8
- buildImpressionsKey(): string;
9
- buildEventsKey(): string;
10
- searchPatternForSplitKeys(): string;
11
- buildLatencyKey(method: Method, bucket: number): string;
12
- buildExceptionKey(method: Method): string;
13
- buildInitKey(): string;
14
- private buildVersionablePrefix;
15
- }
@@ -1,10 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { DataLoader } from './types';
3
- /**
4
- * Factory of client-side storage loader
5
- *
6
- * @param preloadedData validated data following the format proposed in https://github.com/godaddy/split-javascript-data-loader
7
- * and extended with a `mySegmentsData` property.
8
- * @returns function to preload the storage
9
- */
10
- export declare function dataLoaderFactory(preloadedData: SplitIO.PreloadedData): DataLoader;
@@ -1,7 +0,0 @@
1
- /**
2
- * Calculates buckets from latency in milliseconds
3
- *
4
- * @param latencyInMs
5
- * @returns a bucket index from 0 to 22 inclusive
6
- */
7
- export declare function findLatencyIndex(latencyInMs: number): number;
@@ -1,25 +0,0 @@
1
- import { ILogger } from '../../logger/types';
2
- import { AbstractSegmentsCacheSync } from '../AbstractSegmentsCacheSync';
3
- import { KeyBuilderCS } from '../KeyBuilderCS';
4
- export declare class MySegmentsCacheInLocal extends AbstractSegmentsCacheSync {
5
- private readonly keys;
6
- private readonly log;
7
- constructor(log: ILogger, keys: KeyBuilderCS);
8
- /**
9
- * Removes list of segments from localStorage
10
- * @NOTE this method is not being used at the moment.
11
- */
12
- clear(): void;
13
- addToSegment(name: string): boolean;
14
- removeFromSegment(name: string): boolean;
15
- isInSegment(name: string): boolean;
16
- /**
17
- * Reset (update) the cached list of segments with the given list, removing and adding segments if necessary.
18
- *
19
- * @param {string[]} segmentNames list of segment names
20
- * @returns boolean indicating if the cache was updated (i.e., given list was different from the cached one)
21
- */
22
- resetSegments(names: string[]): boolean;
23
- getRegisteredSegments(): string[];
24
- getKeysCount(): number;
25
- }
@@ -1,51 +0,0 @@
1
- import { ISplitFiltersValidation } from '../../dtos/types';
2
- import { AbstractSplitsCacheSync } from '../AbstractSplitsCacheSync';
3
- import { KeyBuilderCS } from '../KeyBuilderCS';
4
- import { ILogger } from '../../logger/types';
5
- /**
6
- * ISplitsCacheSync implementation that stores split definitions in browser LocalStorage.
7
- */
8
- export declare class SplitsCacheInLocal extends AbstractSplitsCacheSync {
9
- private readonly log;
10
- private readonly keys;
11
- private readonly splitFiltersValidation;
12
- private hasSync?;
13
- private cacheReadyButNeedsToFlush;
14
- private updateNewFilter?;
15
- /**
16
- * @param {KeyBuilderCS} keys
17
- * @param {number | undefined} expirationTimestamp
18
- * @param {ISplitFiltersValidation} splitFiltersValidation
19
- */
20
- constructor(log: ILogger, keys: KeyBuilderCS, expirationTimestamp?: number, splitFiltersValidation?: ISplitFiltersValidation);
21
- private _decrementCount;
22
- private _decrementCounts;
23
- private _incrementCounts;
24
- /**
25
- * Removes all splits cache related data from localStorage (splits, counters, changeNumber and lastUpdated).
26
- * We cannot simply call `localStorage.clear()` since that implies removing user items from the storage.
27
- */
28
- clear(): void;
29
- addSplit(name: string, split: string): boolean;
30
- removeSplit(name: string): boolean;
31
- getSplit(name: string): string | null;
32
- setChangeNumber(changeNumber: number): boolean;
33
- getChangeNumber(): number;
34
- getSplitNames(): string[];
35
- trafficTypeExists(trafficType: string): boolean;
36
- usesSegments(): boolean;
37
- /**
38
- * Check if the splits information is already stored in browser LocalStorage.
39
- * In this function we could add more code to check if the data is valid.
40
- * @override
41
- */
42
- checkCache(): boolean;
43
- /**
44
- * Clean Splits cache if its `lastUpdated` timestamp is older than the given `expirationTimestamp`,
45
- * Clean operation (clear) also updates `lastUpdated` timestamp with current time.
46
- *
47
- * @param {number | undefined} expirationTimestamp if the value is not a number, data will not be cleaned
48
- */
49
- private _checkExpiration;
50
- private _checkFilterQuery;
51
- }
@@ -1,2 +0,0 @@
1
- export declare const LOG_PREFIX = "storage:localstorage: ";
2
- export declare const DEFINED = "1";
@@ -1,8 +0,0 @@
1
- import { IStorageSyncFactory } from '../types';
2
- export interface InLocalStorageOptions {
3
- prefix?: string;
4
- }
5
- /**
6
- * InLocal storage factory for standalone client-side SplitFactory
7
- */
8
- export declare function InLocalStorage(options?: InLocalStorageOptions): IStorageSyncFactory;
@@ -1,43 +0,0 @@
1
- export declare class AttributesCacheInMemory {
2
- private attributesCache;
3
- /**
4
- * Create or update the value for the given attribute
5
- *
6
- * @param {string} attributeName attribute name
7
- * @param {Object} attributeValue attribute value
8
- * @returns {boolean} the attribute was stored
9
- */
10
- setAttribute(attributeName: string, attributeValue: Object): boolean;
11
- /**
12
- * Retrieves the value of a given attribute
13
- *
14
- * @param {string} attributeName attribute name
15
- * @returns {Object?} stored attribute value
16
- */
17
- getAttribute(attributeName: string): Object;
18
- /**
19
- * Create or update all the given attributes
20
- *
21
- * @param {[string, Object]} attributes attributes to create or update
22
- * @returns {boolean} attributes were stored
23
- */
24
- setAttributes(attributes: Record<string, Object>): boolean;
25
- /**
26
- * Retrieve the full attributes map
27
- *
28
- * @returns {Map<string, Object>} stored attributes
29
- */
30
- getAll(): Record<string, Object>;
31
- /**
32
- * Removes a given attribute from the map
33
- *
34
- * @param {string} attributeName attribute to remove
35
- * @returns {boolean} attribute removed
36
- */
37
- removeAttribute(attributeName: string): boolean;
38
- /**
39
- * Clears all attributes stored in the SDK
40
- *
41
- */
42
- clear(): boolean;
43
- }
@@ -1,20 +0,0 @@
1
- import { ICountsCacheSync } from '../types';
2
- export declare class CountsCacheInMemory implements ICountsCacheSync {
3
- private counters;
4
- /**
5
- * Add counts.
6
- */
7
- track(metricName: string): boolean;
8
- /**
9
- * Clear the collector
10
- */
11
- clear(): void;
12
- /**
13
- * Get the collected data, used as payload for posting.
14
- */
15
- state(): Record<string, number>;
16
- /**
17
- * Check if the cache is empty.
18
- */
19
- isEmpty(): boolean;
20
- }
@@ -1,35 +0,0 @@
1
- import { SplitIO } from '../../types';
2
- import { IEventsCacheSync } from '../types';
3
- export declare class EventsCacheInMemory implements IEventsCacheSync {
4
- private onFullQueue?;
5
- private readonly maxQueue;
6
- private queue;
7
- private queueByteSize;
8
- /**
9
- *
10
- * @param eventsQueueSize number of queued events to call onFullQueueCb.
11
- * Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
12
- */
13
- constructor(eventsQueueSize?: number);
14
- setOnFullQueueCb(cb: () => void): void;
15
- /**
16
- * Add a new event object at the end of the queue.
17
- */
18
- track(data: SplitIO.EventData, size?: number): boolean;
19
- /**
20
- * Clear the data stored on the cache.
21
- */
22
- clear(): void;
23
- /**
24
- * Pop the collected data, used as payload for posting.
25
- */
26
- pop(toMerge?: SplitIO.EventData[]): SplitIO.EventData[];
27
- /**
28
- * Check if the cache is empty.
29
- */
30
- isEmpty(): boolean;
31
- /**
32
- * Check if the cache queue is full and we need to flush it.
33
- */
34
- private _checkForFlush;
35
- }
@@ -1,24 +0,0 @@
1
- import { IImpressionCountsCacheSync } from '../types';
2
- export declare class ImpressionCountsCacheInMemory implements IImpressionCountsCacheSync {
3
- private cache;
4
- /**
5
- * Builds key to be stored in the cache with the featureName and the timeFrame truncated.
6
- */
7
- private _makeKey;
8
- /**
9
- * Increments the quantity of impressions with the passed featureName and timeFrame.
10
- */
11
- track(featureName: string, timeFrame: number, amount: number): void;
12
- /**
13
- * Pop the collected data, used as payload for posting.
14
- */
15
- pop(toMerge?: Record<string, number>): Record<string, number>;
16
- /**
17
- * Clear the data stored on the cache.
18
- */
19
- clear(): void;
20
- /**
21
- * Check if the cache is empty.
22
- */
23
- isEmpty(): boolean;
24
- }