@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,148 +0,0 @@
1
- /// <reference types="google.analytics" />
2
- import { SplitIO } from '../../types';
3
- /**
4
- * A pair of user key and it's trafficType, required for tracking valid Split events.
5
- * @typedef {Object} Identity
6
- * @property {string} key The user key.
7
- * @property {string} trafficType The key traffic type.
8
- */
9
- export declare type Identity = {
10
- key: string;
11
- trafficType: string;
12
- };
13
- /**
14
- * Options for GoogleAnalyticsToSplit integration plugin
15
- */
16
- export interface GoogleAnalyticsToSplitOptions {
17
- /**
18
- * Optional flag to filter GA hits from being tracked as Split events.
19
- * @property {boolean} hits
20
- * @default true
21
- */
22
- hits?: boolean;
23
- /**
24
- * Optional predicate used to define a custom filter for tracking GA hits as Split events.
25
- * For example, the following filter allows to track only 'event' hits:
26
- * `(model) => model.get('hitType') === 'event'`
27
- * By default, all hits are tracked as Split events.
28
- */
29
- filter?: (model: UniversalAnalytics.Model) => boolean;
30
- /**
31
- * Optional function useful when you need to modify the Split event before tracking it.
32
- * This function is invoked with two arguments:
33
- * 1. the GA model object representing the hit.
34
- * 2. the default format of the mapped Split event instance.
35
- * The return value must be a Split event, that can be the second argument or a new object.
36
- *
37
- * For example, the following mapper adds a custom property to events:
38
- * `(model, defaultMapping) => {
39
- * defaultMapping.properties.someProperty = SOME_VALUE;
40
- * return defaultMapping;
41
- * }`
42
- */
43
- mapper?: (model: UniversalAnalytics.Model, defaultMapping: SplitIO.EventData) => SplitIO.EventData;
44
- /**
45
- * Optional prefix for EventTypeId, to prevent any kind of data collision between events.
46
- * @property {string} prefix
47
- * @default 'ga'
48
- */
49
- prefix?: string;
50
- /**
51
- * List of Split identities (key & traffic type pairs) used to track events.
52
- * If not provided, events are sent using the key and traffic type provided at SDK config
53
- */
54
- identities?: Identity[];
55
- /**
56
- * Optional flag to log an error if the `auto-require` script is not detected.
57
- * The auto-require script automatically requires the `splitTracker` plugin for created trackers,
58
- * and should be placed right after your Google Analytics, Google Tag Manager or gtag.js script tag.
59
- *
60
- * @see {@link https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js}
61
- *
62
- * @property {boolean} autoRequire
63
- * @default false
64
- */
65
- autoRequire?: boolean;
66
- }
67
- /**
68
- * Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
69
- * Used by the browser variant of the isomorphic JS SDK.
70
- *
71
- * @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split}
72
- */
73
- export interface IGoogleAnalyticsToSplitConfig extends GoogleAnalyticsToSplitOptions {
74
- type: 'GOOGLE_ANALYTICS_TO_SPLIT';
75
- }
76
- /**
77
- * Options for SplitToGoogleAnalytics integration plugin
78
- */
79
- export interface SplitToGoogleAnalyticsOptions {
80
- /**
81
- * Optional flag to filter Split impressions from being tracked as GA hits.
82
- * @property {boolean} impressions
83
- * @default true
84
- */
85
- impressions?: boolean;
86
- /**
87
- * Optional flag to filter Split events from being tracked as GA hits.
88
- * @property {boolean} events
89
- * @default true
90
- */
91
- events?: boolean;
92
- /**
93
- * Optional predicate used to define a custom filter for tracking Split data (events and impressions) as GA hits.
94
- * For example, the following filter allows to track only impressions, equivalent to setting events to false:
95
- * `(data) => data.type === 'IMPRESSION'`
96
- */
97
- filter?: (data: SplitIO.IntegrationData) => boolean;
98
- /**
99
- * Optional function useful when you need to modify the GA hit before sending it.
100
- * This function is invoked with two arguments:
101
- * 1. the input data (Split event or impression).
102
- * 2. the default format of the mapped FieldsObject instance (GA hit).
103
- * The return value must be a FieldsObject, that can be the second argument or a new object.
104
- *
105
- * For example, the following mapper adds a custom dimension to hits:
106
- * `(data, defaultMapping) => {
107
- * defaultMapping.dimension1 = SOME_VALUE;
108
- * return defaultMapping;
109
- * }`
110
- *
111
- * Default FieldsObject instance for data.type === 'IMPRESSION':
112
- * `{
113
- * hitType: 'event',
114
- * eventCategory: 'split-impression',
115
- * eventAction: 'Evaluate ' + data.payload.impression.feature,
116
- * eventLabel: 'Treatment: ' + data.payload.impression.treatment + '. Targeting rule: ' + data.payload.impression.label + '.',
117
- * nonInteraction: true,
118
- * }`
119
- * Default FieldsObject instance for data.type === 'EVENT':
120
- * `{
121
- * hitType: 'event',
122
- * eventCategory: 'split-event',
123
- * eventAction: data.payload.eventTypeId,
124
- * eventValue: data.payload.value,
125
- * nonInteraction: true,
126
- * }`
127
- */
128
- mapper?: (data: SplitIO.IntegrationData, defaultMapping: UniversalAnalytics.FieldsObject) => UniversalAnalytics.FieldsObject;
129
- /**
130
- * List of tracker names to send the hit. An empty string represents the default tracker.
131
- * If not provided, hits are only sent to default tracker.
132
- */
133
- trackerNames?: string[];
134
- }
135
- /**
136
- * Enable 'Split to Google Analytics' integration, to track Split impressions and events as Google Analytics hits.
137
- * Used by the browser variant of the isomorphic JS SDK.
138
- *
139
- * @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics}
140
- */
141
- export interface ISplitToGoogleAnalyticsConfig extends SplitToGoogleAnalyticsOptions {
142
- type: 'SPLIT_TO_GOOGLE_ANALYTICS';
143
- }
144
- /**
145
- * Available integration options for the browser
146
- * Used by the browser variant of the isomorphic JS SDK.
147
- */
148
- export declare type BrowserIntegration = ISplitToGoogleAnalyticsConfig | IGoogleAnalyticsToSplitConfig;
@@ -1,11 +0,0 @@
1
- import { IIntegration, IIntegrationManager, IIntegrationFactoryParams } from './types';
2
- /**
3
- * Factory function for IntegrationsManager with pluggable integrations.
4
- * The integrations manager instantiates integration, and bypass tracked events and impressions to them.
5
- *
6
- * @param integrations validated list of integration factories
7
- * @param params information of the Sdk factory instance that integrations can access to
8
- *
9
- * @returns integration manager or undefined if `integrations` are not present in settings.
10
- */
11
- export declare function pluggableIntegrationsManagerFactory(integrations: Array<(params: IIntegrationFactoryParams) => IIntegration | void>, params: IIntegrationFactoryParams): IIntegrationManager | undefined;
@@ -1,17 +0,0 @@
1
- import { IEventsCacheBase } from '../storages/types';
2
- import { IEventsHandler, IImpressionsHandler } from '../trackers/types';
3
- import { ISettings, SplitIO } from '../types';
4
- export interface IIntegration {
5
- queue(data: SplitIO.IntegrationData): void;
6
- }
7
- export declare type IIntegrationManager = IEventsHandler & IImpressionsHandler;
8
- export interface IIntegrationFactoryParams {
9
- storage: {
10
- events: IEventsCacheBase;
11
- };
12
- settings: ISettings;
13
- }
14
- export declare type IntegrationFactory = {
15
- readonly type: string;
16
- (params: IIntegrationFactoryParams): IIntegration | void;
17
- };
@@ -1,40 +0,0 @@
1
- import { ISignalListener } from './types';
2
- import { IStorageSync } from '../storages/types';
3
- import { ISplitApi } from '../services/types';
4
- import { ISettings } from '../types';
5
- import { ISyncManager } from '../sync/types';
6
- /**
7
- * We'll listen for events over the window object.
8
- */
9
- export declare class BrowserSignalListener implements ISignalListener {
10
- private syncManager;
11
- private settings;
12
- private storage;
13
- private serviceApi;
14
- private fromImpressionsCollector;
15
- constructor(syncManager: ISyncManager | undefined, settings: ISettings, storage: IStorageSync, serviceApi: ISplitApi);
16
- /**
17
- * start method.
18
- * Called when SplitFactory is initialized, it adds event listeners to close streaming and flush impressions and events.
19
- */
20
- start(): void;
21
- /**
22
- * stop method.
23
- * Called when client is destroyed, it removes event listeners.
24
- */
25
- stop(): void;
26
- stopSync(): void;
27
- /**
28
- * flushData method.
29
- * Called when pagehide event is triggered. It flushed remaining impressions and events to the backend,
30
- * using beacon API if possible, or falling back to regular post transport.
31
- */
32
- flushData(): void;
33
- flushDataIfHidden(): void;
34
- private _flushData;
35
- /**
36
- * _sendBeacon method.
37
- * Util method that check if beacon API is available, build the payload and send it.
38
- */
39
- private _sendBeacon;
40
- }
@@ -1,22 +0,0 @@
1
- import { ISignalListener } from './types';
2
- import { ISettings } from '../types';
3
- import { ISyncManager } from '../sync/types';
4
- /**
5
- * We'll listen for SIGTERM since it's the standard signal for server shutdown.
6
- *
7
- * If you're stopping the execution yourself via the keyboard, or by calling process.exit,
8
- * you should call the cleanup logic yourself, since we cannot ensure the data is sent after
9
- * the process is already exiting.
10
- */
11
- export declare class NodeSignalListener implements ISignalListener {
12
- private handler;
13
- private settings;
14
- constructor(syncManager: ISyncManager | undefined, // private handler: () => MaybeThenable<void>,
15
- settings: ISettings);
16
- start(): void;
17
- stop(): void;
18
- /**
19
- * Call the handler, clean up listeners and emit the signal again.
20
- */
21
- private _sigtermHandler;
22
- }
@@ -1,4 +0,0 @@
1
- export interface ISignalListener {
2
- start(): any;
3
- stop(): any;
4
- }
@@ -1,2 +0,0 @@
1
- import { Logger } from '../index';
2
- export declare function DebugLogger(): Logger;
@@ -1,2 +0,0 @@
1
- import { Logger } from '../index';
2
- export declare function ErrorLogger(): Logger;
@@ -1,2 +0,0 @@
1
- import { Logger } from '../index';
2
- export declare function InfoLogger(): Logger;
@@ -1,2 +0,0 @@
1
- import { Logger } from '../index';
2
- export declare function WarnLogger(): Logger;
@@ -1,142 +0,0 @@
1
- /**
2
- * Message codes used to trim string log messages from commons and client-side API modules,
3
- * in order to reduce the minimal SDK size for Browser and eventually other client-side environments.
4
- *
5
- * Modules related to the server-side API (e.g., segmentsSyncTask), platform-specific components (e.g., signal listeners)
6
- * and pluggable components (e.g., pluggable integrations & storages) can use the logger with string literals.
7
- */
8
- export declare const ENGINE_COMBINER_AND = 0;
9
- export declare const ENGINE_COMBINER_IFELSEIF = 1;
10
- export declare const ENGINE_COMBINER_IFELSEIF_NO_TREATMENT = 2;
11
- export declare const ENGINE_BUCKET = 3;
12
- export declare const ENGINE_MATCHER_ALL = 4;
13
- export declare const ENGINE_MATCHER_BETWEEN = 5;
14
- export declare const ENGINE_MATCHER_BOOLEAN = 6;
15
- export declare const ENGINE_MATCHER_CONTAINS_ALL = 7;
16
- export declare const ENGINE_MATCHER_CONTAINS_ANY = 8;
17
- export declare const ENGINE_MATCHER_CONTAINS_STRING = 9;
18
- export declare const ENGINE_MATCHER_DEPENDENCY = 10;
19
- export declare const ENGINE_MATCHER_DEPENDENCY_PRE = 11;
20
- export declare const ENGINE_MATCHER_EQUAL = 12;
21
- export declare const ENGINE_MATCHER_EQUAL_TO_SET = 13;
22
- export declare const ENGINE_MATCHER_ENDS_WITH = 14;
23
- export declare const ENGINE_MATCHER_GREATER = 15;
24
- export declare const ENGINE_MATCHER_LESS = 16;
25
- export declare const ENGINE_MATCHER_PART_OF = 17;
26
- export declare const ENGINE_MATCHER_SEGMENT = 18;
27
- export declare const ENGINE_MATCHER_STRING = 19;
28
- export declare const ENGINE_MATCHER_STRING_INVALID = 20;
29
- export declare const ENGINE_MATCHER_STARTS_WITH = 21;
30
- export declare const ENGINE_MATCHER_WHITELIST = 22;
31
- export declare const ENGINE_VALUE = 23;
32
- export declare const ENGINE_SANITIZE = 24;
33
- export declare const CLEANUP_REGISTERING = 25;
34
- export declare const CLEANUP_DEREGISTERING = 26;
35
- export declare const RETRIEVE_CLIENT_DEFAULT = 27;
36
- export declare const RETRIEVE_CLIENT_EXISTING = 28;
37
- export declare const RETRIEVE_MANAGER = 29;
38
- export declare const SYNC_OFFLINE_DATA = 30;
39
- export declare const SYNC_SPLITS_FETCH = 31;
40
- export declare const SYNC_SPLITS_NEW = 32;
41
- export declare const SYNC_SPLITS_REMOVED = 33;
42
- export declare const SYNC_SPLITS_SEGMENTS = 34;
43
- export declare const STREAMING_NEW_MESSAGE = 35;
44
- export declare const SYNC_TASK_START = 36;
45
- export declare const SYNC_TASK_EXECUTE = 37;
46
- export declare const SYNC_TASK_STOP = 38;
47
- export declare const SETTINGS_SPLITS_FILTER = 39;
48
- export declare const CLIENT_READY_FROM_CACHE = 100;
49
- export declare const CLIENT_READY = 101;
50
- export declare const IMPRESSION = 102;
51
- export declare const IMPRESSION_QUEUEING = 103;
52
- export declare const NEW_SHARED_CLIENT = 104;
53
- export declare const NEW_FACTORY = 105;
54
- export declare const POLLING_SMART_PAUSING = 106;
55
- export declare const POLLING_START = 107;
56
- export declare const POLLING_STOP = 108;
57
- export declare const SYNC_SPLITS_FETCH_RETRY = 109;
58
- export declare const STREAMING_REFRESH_TOKEN = 110;
59
- export declare const STREAMING_RECONNECT = 111;
60
- export declare const STREAMING_CONNECTING = 112;
61
- export declare const STREAMING_DISABLED = 113;
62
- export declare const STREAMING_DISCONNECTING = 114;
63
- export declare const SUBMITTERS_PUSH_FULL_QUEUE = 115;
64
- export declare const SUBMITTERS_PUSH = 116;
65
- export declare const SYNC_START_POLLING = 117;
66
- export declare const SYNC_CONTINUE_POLLING = 118;
67
- export declare const SYNC_STOP_POLLING = 119;
68
- export declare const EVENTS_TRACKER_SUCCESS = 120;
69
- export declare const IMPRESSIONS_TRACKER_SUCCESS = 121;
70
- export declare const USER_CONSENT_UPDATED = 122;
71
- export declare const USER_CONSENT_NOT_UPDATED = 123;
72
- export declare const USER_CONSENT_INITIAL = 124;
73
- export declare const ENGINE_VALUE_INVALID = 200;
74
- export declare const ENGINE_VALUE_NO_ATTRIBUTES = 201;
75
- export declare const CLIENT_NO_LISTENER = 202;
76
- export declare const CLIENT_NOT_READY = 203;
77
- export declare const SYNC_MYSEGMENTS_FETCH_RETRY = 204;
78
- export declare const SYNC_SPLITS_FETCH_FAILS = 205;
79
- export declare const STREAMING_PARSING_ERROR_FAILS = 206;
80
- export declare const STREAMING_PARSING_MESSAGE_FAILS = 207;
81
- export declare const STREAMING_FALLBACK = 208;
82
- export declare const SUBMITTERS_PUSH_FAILS = 209;
83
- export declare const SUBMITTERS_PUSH_RETRY = 210;
84
- export declare const WARN_SETTING_NULL = 211;
85
- export declare const WARN_TRIMMING_PROPERTIES = 212;
86
- export declare const WARN_CONVERTING = 213;
87
- export declare const WARN_TRIMMING = 214;
88
- export declare const WARN_NOT_EXISTENT_SPLIT = 215;
89
- export declare const WARN_LOWERCASE_TRAFFIC_TYPE = 216;
90
- export declare const WARN_NOT_EXISTENT_TT = 217;
91
- export declare const WARN_INTEGRATION_INVALID = 218;
92
- export declare const WARN_SPLITS_FILTER_IGNORED = 219;
93
- export declare const WARN_SPLITS_FILTER_INVALID = 220;
94
- export declare const WARN_SPLITS_FILTER_EMPTY = 221;
95
- export declare const WARN_API_KEY = 222;
96
- export declare const STREAMING_PARSING_MY_SEGMENTS_UPDATE_V2 = 223;
97
- export declare const ERROR_ENGINE_COMBINER_IFELSEIF = 300;
98
- export declare const ERROR_LOGLEVEL_INVALID = 301;
99
- export declare const ERROR_CLIENT_LISTENER = 302;
100
- export declare const ERROR_CLIENT_CANNOT_GET_READY = 303;
101
- export declare const ERROR_SYNC_OFFLINE_LOADING = 304;
102
- export declare const ERROR_STREAMING_SSE = 305;
103
- export declare const ERROR_STREAMING_AUTH = 306;
104
- export declare const ERROR_IMPRESSIONS_TRACKER = 307;
105
- export declare const ERROR_IMPRESSIONS_LISTENER = 308;
106
- export declare const ERROR_EVENTS_TRACKER = 309;
107
- export declare const ERROR_EVENT_TYPE_FORMAT = 310;
108
- export declare const ERROR_NOT_PLAIN_OBJECT = 311;
109
- export declare const ERROR_SIZE_EXCEEDED = 312;
110
- export declare const ERROR_NOT_FINITE = 313;
111
- export declare const ERROR_CLIENT_DESTROYED = 314;
112
- export declare const ERROR_NULL = 315;
113
- export declare const ERROR_TOO_LONG = 316;
114
- export declare const ERROR_INVALID_KEY_OBJECT = 317;
115
- export declare const ERROR_INVALID = 318;
116
- export declare const ERROR_EMPTY = 319;
117
- export declare const ERROR_EMPTY_ARRAY = 320;
118
- export declare const ERROR_INVALID_CONFIG_PARAM = 321;
119
- export declare const ERROR_HTTP = 322;
120
- export declare const ERROR_LOCALHOST_MODULE_REQUIRED = 323;
121
- export declare const ERROR_STORAGE_INVALID = 324;
122
- export declare const ERROR_NOT_BOOLEAN = 325;
123
- export declare const ERROR_MIN_CONFIG_PARAM = 326;
124
- export declare const LOG_PREFIX_SETTINGS = "settings";
125
- export declare const LOG_PREFIX_INSTANTIATION = "Factory instantiation";
126
- export declare const LOG_PREFIX_ENGINE = "engine";
127
- export declare const LOG_PREFIX_ENGINE_COMBINER: string;
128
- export declare const LOG_PREFIX_ENGINE_MATCHER: string;
129
- export declare const LOG_PREFIX_ENGINE_VALUE: string;
130
- export declare const LOG_PREFIX_SYNC = "sync";
131
- export declare const LOG_PREFIX_SYNC_MANAGER: string;
132
- export declare const LOG_PREFIX_SYNC_OFFLINE: string;
133
- export declare const LOG_PREFIX_SYNC_STREAMING: string;
134
- export declare const LOG_PREFIX_SYNC_SPLITS: string;
135
- export declare const LOG_PREFIX_SYNC_SEGMENTS: string;
136
- export declare const LOG_PREFIX_SYNC_MYSEGMENTS: string;
137
- export declare const LOG_PREFIX_SYNC_POLLING: string;
138
- export declare const LOG_PREFIX_SYNC_SUBMITTERS: string;
139
- export declare const LOG_PREFIX_IMPRESSIONS_TRACKER = "impressions-tracker: ";
140
- export declare const LOG_PREFIX_EVENTS_TRACKER = "events-tracker: ";
141
- export declare const LOG_PREFIX_UNIQUE_KEYS_TRACKER = "unique-keys-tracker: ";
142
- export declare const LOG_PREFIX_CLEANUP = "cleanup: ";
@@ -1,22 +0,0 @@
1
- import { ILoggerOptions, ILogger } from './types';
2
- import { LogLevel } from '../types';
3
- import { IMap } from '../utils/lang/maps';
4
- export declare const LogLevels: {
5
- [level: string]: LogLevel;
6
- };
7
- export declare function isLogLevelString(str: string): str is LogLevel;
8
- export declare function _sprintf(format?: string, args?: any[]): string;
9
- export declare class Logger implements ILogger {
10
- private options;
11
- private codes;
12
- private logLevel;
13
- constructor(options?: ILoggerOptions, codes?: IMap<number, string>);
14
- setLogLevel(logLevel: LogLevel): void;
15
- debug(msg: string | number, args?: any[]): void;
16
- info(msg: string | number, args?: any[]): void;
17
- warn(msg: string | number, args?: any[]): void;
18
- error(msg: string | number, args?: any[]): void;
19
- private _log;
20
- private _generateLogMessage;
21
- private _shouldLog;
22
- }
@@ -1 +0,0 @@
1
- export declare const codesDebug: [number, string][];
@@ -1 +0,0 @@
1
- export declare const codesError: [number, string][];
@@ -1 +0,0 @@
1
- export declare const codesInfo: [number, string][];
@@ -1 +0,0 @@
1
- export declare const codesWarn: [number, string][];
@@ -1,8 +0,0 @@
1
- import { ILoggerAPI } from '../types';
2
- import { ILogger } from './types';
3
- /**
4
- * The public Logger utility API exposed via SplitFactory, used to update the log level.
5
- *
6
- * @param log the factory logger instance to handle
7
- */
8
- export declare function createLoggerAPI(log: ILogger): ILoggerAPI;
@@ -1,17 +0,0 @@
1
- import { LogLevel } from '../types';
2
- export interface ILoggerOptions {
3
- prefix?: string;
4
- logLevel?: LogLevel;
5
- showLevel?: boolean;
6
- }
7
- export interface ILogger {
8
- setLogLevel(logLevel: LogLevel): void;
9
- debug(msg: any): void;
10
- debug(msg: string | number, args?: any[]): void;
11
- info(msg: any): void;
12
- info(msg: string | number, args?: any[]): void;
13
- warn(msg: any): void;
14
- warn(msg: string | number, args?: any[]): void;
15
- error(msg: any): void;
16
- error(msg: string | number, args?: any[]): void;
17
- }
@@ -1,7 +0,0 @@
1
- export declare const SDK_SPLITS_ARRIVED = "state::splits-arrived";
2
- export declare const SDK_SPLITS_CACHE_LOADED = "state::splits-cache-loaded";
3
- export declare const SDK_SEGMENTS_ARRIVED = "state::segments-arrived";
4
- export declare const SDK_READY_TIMED_OUT = "init::timeout";
5
- export declare const SDK_READY = "init::ready";
6
- export declare const SDK_READY_FROM_CACHE = "init::cache-ready";
7
- export declare const SDK_UPDATE = "state::update";
@@ -1,6 +0,0 @@
1
- import { IEventEmitter } from '../types';
2
- import { IReadinessManager, ISplitsEventEmitter } from './types';
3
- /**
4
- * Factory of readiness manager, which handles the ready / update event propagation.
5
- */
6
- export declare function readinessManagerFactory(EventEmitter: new () => IEventEmitter, readyTimeout?: number, splits?: ISplitsEventEmitter): IReadinessManager;
@@ -1,11 +0,0 @@
1
- import { ISdkReadinessManager } from './types';
2
- import { IEventEmitter } from '../types';
3
- import { ILogger } from '../logger/types';
4
- /**
5
- * SdkReadinessManager factory, which provides the public status API of SDK clients and manager: ready promise, readiness event emitter and constants (SDK_READY, etc).
6
- * It also updates logs related warnings and errors.
7
- *
8
- * @param readyTimeout time in millis to emit SDK_READY_TIME_OUT event
9
- * @param readinessManager optional readinessManager to use. only used internally for `shared` method
10
- */
11
- export declare function sdkReadinessManagerFactory(log: ILogger, EventEmitter: new () => IEventEmitter, readyTimeout?: number, readinessManager?: import("./types").IReadinessManager): ISdkReadinessManager;
@@ -1,60 +0,0 @@
1
- import { IEventEmitter, IStatusInterface } from '../types';
2
- /** Splits data emitter */
3
- declare type SDK_SPLITS_ARRIVED = 'state::splits-arrived';
4
- declare type SDK_SPLITS_CACHE_LOADED = 'state::splits-cache-loaded';
5
- declare type ISplitsEvent = SDK_SPLITS_ARRIVED | SDK_SPLITS_CACHE_LOADED;
6
- export interface ISplitsEventEmitter extends IEventEmitter {
7
- emit(event: ISplitsEvent, ...args: any[]): boolean;
8
- on(event: ISplitsEvent, listener: (...args: any[]) => void): this;
9
- once(event: ISplitsEvent, listener: (...args: any[]) => void): this;
10
- splitsArrived: boolean;
11
- splitsCacheLoaded: boolean;
12
- }
13
- /** Segments data emitter */
14
- declare type SDK_SEGMENTS_ARRIVED = 'state::segments-arrived';
15
- declare type ISegmentsEvent = SDK_SEGMENTS_ARRIVED;
16
- export interface ISegmentsEventEmitter extends IEventEmitter {
17
- emit(event: ISegmentsEvent, ...args: any[]): boolean;
18
- on(event: ISegmentsEvent, listener: (...args: any[]) => void): this;
19
- once(event: ISegmentsEvent, listener: (...args: any[]) => void): this;
20
- segmentsArrived: boolean;
21
- }
22
- /** Readiness emitter */
23
- export declare type SDK_READY_TIMED_OUT = 'init::timeout';
24
- export declare type SDK_READY = 'init::ready';
25
- export declare type SDK_READY_FROM_CACHE = 'init::cache-ready';
26
- export declare type SDK_UPDATE = 'state::update';
27
- export declare type SDK_DESTROY = 'state::destroy';
28
- export declare type IReadinessEvent = SDK_READY_TIMED_OUT | SDK_READY | SDK_READY_FROM_CACHE | SDK_UPDATE | SDK_DESTROY;
29
- export interface IReadinessEventEmitter extends IEventEmitter {
30
- emit(event: IReadinessEvent, ...args: any[]): boolean;
31
- }
32
- /** Readiness manager */
33
- export interface IReadinessManager {
34
- /** Event emitters */
35
- splits: ISplitsEventEmitter;
36
- segments: ISegmentsEventEmitter;
37
- gate: IReadinessEventEmitter;
38
- /** Readiness status */
39
- isReady(): boolean;
40
- isReadyFromCache(): boolean;
41
- hasTimedout(): boolean;
42
- isDestroyed(): boolean;
43
- isOperational(): boolean;
44
- destroy(): void;
45
- /** for client-side */
46
- shared(readyTimeout?: number): IReadinessManager;
47
- }
48
- /** SDK readiness manager */
49
- export interface ISdkReadinessManager {
50
- readinessManager: IReadinessManager;
51
- sdkStatus: IStatusInterface;
52
- /**
53
- * Increment internalReadyCbCount, an offset value of SDK_READY listeners that are added/removed internally
54
- * by the SDK. It is required to properly log the warning 'No listeners for SDK Readiness detected'
55
- */
56
- incInternalReadyCbCount(): void;
57
- /** for client-side */
58
- shared(readyTimeout?: number): ISdkReadinessManager;
59
- }
60
- export {};
@@ -1,6 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ISdkFactoryContext } from '../sdkFactory/types';
3
- /**
4
- * Creator of base client with getTreatments and track methods.
5
- */
6
- export declare function clientFactory(params: ISdkFactoryContext): SplitIO.IClient | SplitIO.IAsyncClient;
@@ -1,51 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ILogger } from '../logger/types';
3
- /**
4
- * Add in memory attributes storage methods and combine them with any attribute received from the getTreatment/s call
5
- */
6
- export declare function clientAttributesDecoration<TClient extends SplitIO.IClient | SplitIO.IAsyncClient>(log: ILogger, client: TClient): TClient & {
7
- getTreatment: (maybeKey: SplitIO.SplitKey, maybeSplit: string, maybeAttributes?: SplitIO.Attributes | undefined) => string | SplitIO.AsyncTreatment;
8
- getTreatmentWithConfig: (maybeKey: SplitIO.SplitKey, maybeSplit: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentWithConfig | SplitIO.AsyncTreatmentWithConfig;
9
- getTreatments: (maybeKey: SplitIO.SplitKey, maybeSplits: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
10
- getTreatmentsWithConfig: (maybeKey: SplitIO.SplitKey, maybeSplits: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
11
- track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) => boolean | Promise<boolean>;
12
- /**
13
- * Add an attribute to client's in memory attributes storage
14
- *
15
- * @param {string} attributeName Attrinute name
16
- * @param {string, number, boolean, list} attributeValue Attribute value
17
- * @returns {boolean} true if the attribute was stored and false otherways
18
- */
19
- setAttribute(attributeName: string, attributeValue: Object): boolean;
20
- /**
21
- * Returns the attribute with the given key
22
- *
23
- * @param {string} attributeName Attribute name
24
- * @returns {Object} Attribute with the given key
25
- */
26
- getAttribute(attributeName: string): Object;
27
- /**
28
- * Add to client's in memory attributes storage the attributes in 'attributes'
29
- *
30
- * @param {Object} attributes Object with attributes to store
31
- * @returns true if attributes were stored an false otherways
32
- */
33
- setAttributes(attributes: Record<string, Object>): boolean;
34
- /**
35
- * Return all the attributes stored in client's in memory attributes storage
36
- *
37
- * @returns {Object} returns all the stored attributes
38
- */
39
- getAttributes(): Record<string, Object>;
40
- /**
41
- * Removes from client's in memory attributes storage the attribute with the given key
42
- *
43
- * @param {string} attributeName
44
- * @returns {boolean} true if attribute was removed and false otherways
45
- */
46
- removeAttribute(attributeName: string): boolean;
47
- /**
48
- * Remove all the stored attributes in the client's in memory attribute storage
49
- */
50
- clearAttributes(): boolean;
51
- };
@@ -1,10 +0,0 @@
1
- import { ILogger } from '../logger/types';
2
- import { SplitIO } from '../types';
3
- /**
4
- * Decorator that binds a key and (optionally) a traffic type to client methods
5
- *
6
- * @param client sync client instance
7
- * @param key validated split key
8
- * @param trafficType validated traffic type
9
- */
10
- export declare function clientCSDecorator(log: ILogger, client: SplitIO.IClient, key: SplitIO.SplitKey, trafficType?: string): SplitIO.ICsClient;
@@ -1,7 +0,0 @@
1
- import { IReadinessManager } from '../readiness/types';
2
- import { ISettings, SplitIO } from '../types';
3
- /**
4
- * Decorator that validates the input before actually executing the client methods.
5
- * We should "guard" the client here, while not polluting the "real" implementation of those methods.
6
- */
7
- export declare function clientInputValidationDecorator<TClient extends SplitIO.IClient | SplitIO.IAsyncClient>(settings: ISettings, client: TClient, readinessManager: IReadinessManager): TClient;
@@ -1,6 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ISdkFactoryContext } from '../sdkFactory/types';
3
- /**
4
- * Creates an Sdk client, i.e., a base client with status and destroy interface
5
- */
6
- export declare function sdkClientFactory(params: ISdkFactoryContext, isSharedClient?: boolean): SplitIO.IClient | SplitIO.IAsyncClient;