@splitsoftware/splitio-commons 2.0.0-rc.2 → 2.0.0-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 (312) hide show
  1. package/CHANGES.txt +1 -3
  2. package/cjs/logger/constants.js +1 -2
  3. package/cjs/logger/messages/error.js +0 -1
  4. package/cjs/sdkFactory/index.js +1 -3
  5. package/cjs/storages/dataLoader.js +37 -99
  6. package/cjs/storages/inMemory/InMemoryStorageCS.js +4 -16
  7. package/cjs/sync/offline/LocalhostFromObject.js +3 -8
  8. package/cjs/utils/settingsValidation/index.js +1 -4
  9. package/esm/logger/constants.js +0 -1
  10. package/esm/logger/messages/error.js +0 -1
  11. package/esm/sdkFactory/index.js +2 -4
  12. package/esm/storages/dataLoader.js +35 -96
  13. package/esm/storages/inMemory/InMemoryStorageCS.js +4 -16
  14. package/esm/sync/offline/LocalhostFromObject.js +2 -6
  15. package/esm/utils/settingsValidation/index.js +1 -4
  16. package/package.json +3 -2
  17. package/src/logger/constants.ts +0 -1
  18. package/src/logger/messages/error.ts +0 -1
  19. package/src/sdkFactory/index.ts +3 -6
  20. package/src/storages/dataLoader.ts +38 -97
  21. package/src/storages/inMemory/InMemoryStorageCS.ts +4 -19
  22. package/src/storages/types.ts +2 -4
  23. package/src/sync/offline/LocalhostFromObject.ts +2 -8
  24. package/src/types.ts +14 -26
  25. package/src/utils/settingsValidation/index.ts +1 -4
  26. package/src/utils/settingsValidation/types.ts +0 -2
  27. package/types/index.d.ts +5 -5
  28. package/types/splitio.d.ts +2293 -0
  29. package/cjs/utils/settingsValidation/localhost/builtin.js +0 -18
  30. package/cjs/utils/settingsValidation/localhost/pluggable.js +0 -22
  31. package/esm/utils/settingsValidation/localhost/builtin.js +0 -14
  32. package/esm/utils/settingsValidation/localhost/pluggable.js +0 -18
  33. package/src/utils/settingsValidation/localhost/builtin.ts +0 -16
  34. package/src/utils/settingsValidation/localhost/pluggable.ts +0 -22
  35. package/types/consent/index.d.ts +0 -2
  36. package/types/consent/sdkUserConsent.d.ts +0 -13
  37. package/types/dtos/types.d.ts +0 -209
  38. package/types/evaluator/Engine.d.ts +0 -15
  39. package/types/evaluator/combiners/and.d.ts +0 -4
  40. package/types/evaluator/combiners/ifelseif.d.ts +0 -3
  41. package/types/evaluator/condition/engineUtils.d.ts +0 -11
  42. package/types/evaluator/condition/index.d.ts +0 -6
  43. package/types/evaluator/convertions/index.d.ts +0 -2
  44. package/types/evaluator/index.d.ts +0 -8
  45. package/types/evaluator/matchers/all.d.ts +0 -1
  46. package/types/evaluator/matchers/between.d.ts +0 -2
  47. package/types/evaluator/matchers/boolean.d.ts +0 -1
  48. package/types/evaluator/matchers/cont_all.d.ts +0 -1
  49. package/types/evaluator/matchers/cont_any.d.ts +0 -1
  50. package/types/evaluator/matchers/cont_str.d.ts +0 -1
  51. package/types/evaluator/matchers/dependency.d.ts +0 -5
  52. package/types/evaluator/matchers/eq.d.ts +0 -1
  53. package/types/evaluator/matchers/eq_set.d.ts +0 -1
  54. package/types/evaluator/matchers/ew.d.ts +0 -1
  55. package/types/evaluator/matchers/gte.d.ts +0 -1
  56. package/types/evaluator/matchers/index.d.ts +0 -7
  57. package/types/evaluator/matchers/large_segment.d.ts +0 -5
  58. package/types/evaluator/matchers/lte.d.ts +0 -1
  59. package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
  60. package/types/evaluator/matchers/part_of.d.ts +0 -1
  61. package/types/evaluator/matchers/segment.d.ts +0 -5
  62. package/types/evaluator/matchers/sember_inlist.d.ts +0 -3
  63. package/types/evaluator/matchers/semver_between.d.ts +0 -2
  64. package/types/evaluator/matchers/semver_eq.d.ts +0 -1
  65. package/types/evaluator/matchers/semver_gte.d.ts +0 -1
  66. package/types/evaluator/matchers/semver_inlist.d.ts +0 -1
  67. package/types/evaluator/matchers/semver_lte.d.ts +0 -1
  68. package/types/evaluator/matchers/string.d.ts +0 -1
  69. package/types/evaluator/matchers/sw.d.ts +0 -1
  70. package/types/evaluator/matchers/whitelist.d.ts +0 -1
  71. package/types/evaluator/matchersTransform/index.d.ts +0 -6
  72. package/types/evaluator/matchersTransform/segment.d.ts +0 -5
  73. package/types/evaluator/matchersTransform/set.d.ts +0 -5
  74. package/types/evaluator/matchersTransform/string.d.ts +0 -7
  75. package/types/evaluator/matchersTransform/unaryNumeric.d.ts +0 -5
  76. package/types/evaluator/matchersTransform/whitelist.d.ts +0 -5
  77. package/types/evaluator/parser/index.d.ts +0 -5
  78. package/types/evaluator/treatments/index.d.ts +0 -8
  79. package/types/evaluator/types.d.ts +0 -28
  80. package/types/evaluator/value/index.d.ts +0 -7
  81. package/types/evaluator/value/sanitize.d.ts +0 -7
  82. package/types/integrations/browser.d.ts +0 -12
  83. package/types/integrations/ga/GaToSplit.d.ts +0 -40
  84. package/types/integrations/ga/GoogleAnalyticsToSplit.d.ts +0 -3
  85. package/types/integrations/ga/SplitToGa.d.ts +0 -34
  86. package/types/integrations/ga/SplitToGoogleAnalytics.d.ts +0 -3
  87. package/types/integrations/ga/types.d.ts +0 -148
  88. package/types/integrations/pluggable.d.ts +0 -11
  89. package/types/integrations/types.d.ts +0 -18
  90. package/types/listeners/browser.d.ts +0 -40
  91. package/types/listeners/node.d.ts +0 -22
  92. package/types/listeners/types.d.ts +0 -4
  93. package/types/logger/browser/DebugLogger.d.ts +0 -2
  94. package/types/logger/browser/ErrorLogger.d.ts +0 -2
  95. package/types/logger/browser/InfoLogger.d.ts +0 -2
  96. package/types/logger/browser/WarnLogger.d.ts +0 -2
  97. package/types/logger/constants.d.ts +0 -135
  98. package/types/logger/index.d.ts +0 -21
  99. package/types/logger/messages/debug.d.ts +0 -1
  100. package/types/logger/messages/error.d.ts +0 -1
  101. package/types/logger/messages/info.d.ts +0 -1
  102. package/types/logger/messages/warn.d.ts +0 -1
  103. package/types/logger/sdkLogger.d.ts +0 -8
  104. package/types/logger/types.d.ts +0 -17
  105. package/types/readiness/constants.d.ts +0 -7
  106. package/types/readiness/readinessManager.d.ts +0 -6
  107. package/types/readiness/sdkReadinessManager.d.ts +0 -10
  108. package/types/readiness/types.d.ts +0 -67
  109. package/types/sdkClient/client.d.ts +0 -6
  110. package/types/sdkClient/clientAttributesDecoration.d.ts +0 -55
  111. package/types/sdkClient/clientCS.d.ts +0 -9
  112. package/types/sdkClient/clientInputValidation.d.ts +0 -7
  113. package/types/sdkClient/identity.d.ts +0 -2
  114. package/types/sdkClient/sdkClient.d.ts +0 -6
  115. package/types/sdkClient/sdkClientMethod.d.ts +0 -6
  116. package/types/sdkClient/sdkClientMethodCS.d.ts +0 -7
  117. package/types/sdkClient/sdkClientMethodCSWithTT.d.ts +0 -8
  118. package/types/sdkFactory/index.d.ts +0 -6
  119. package/types/sdkFactory/types.d.ts +0 -85
  120. package/types/sdkManager/index.d.ts +0 -4
  121. package/types/services/decorateHeaders.d.ts +0 -2
  122. package/types/services/splitApi.d.ts +0 -12
  123. package/types/services/splitHttpClient.d.ts +0 -10
  124. package/types/services/types.d.ts +0 -54
  125. package/types/storages/AbstractMySegmentsCacheSync.d.ts +0 -39
  126. package/types/storages/AbstractSegmentsCacheSync.d.ts +0 -54
  127. package/types/storages/AbstractSplitsCache.d.ts +0 -46
  128. package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -38
  129. package/types/storages/AbstractSplitsCacheSync.d.ts +0 -43
  130. package/types/storages/KeyBuilder.d.ts +0 -22
  131. package/types/storages/KeyBuilderCS.d.ts +0 -20
  132. package/types/storages/KeyBuilderSS.d.ts +0 -20
  133. package/types/storages/dataLoader.d.ts +0 -21
  134. package/types/storages/findLatencyIndex.d.ts +0 -7
  135. package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -15
  136. package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -54
  137. package/types/storages/inLocalStorage/constants.d.ts +0 -2
  138. package/types/storages/inLocalStorage/index.d.ts +0 -8
  139. package/types/storages/inMemory/AttributesCacheInMemory.d.ts +0 -44
  140. package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
  141. package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -28
  142. package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +0 -30
  143. package/types/storages/inMemory/InMemoryStorage.d.ts +0 -10
  144. package/types/storages/inMemory/InMemoryStorageCS.d.ts +0 -10
  145. package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +0 -16
  146. package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -17
  147. package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -27
  148. package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -71
  149. package/types/storages/inMemory/UniqueKeysCacheInMemory.d.ts +0 -34
  150. package/types/storages/inMemory/UniqueKeysCacheInMemoryCS.d.ts +0 -35
  151. package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
  152. package/types/storages/inRedis/ImpressionCountsCacheInRedis.d.ts +0 -17
  153. package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -17
  154. package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
  155. package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -21
  156. package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -95
  157. package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -35
  158. package/types/storages/inRedis/UniqueKeysCacheInRedis.d.ts +0 -22
  159. package/types/storages/inRedis/constants.d.ts +0 -4
  160. package/types/storages/inRedis/index.d.ts +0 -10
  161. package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
  162. package/types/storages/pluggable/ImpressionCountsCachePluggable.d.ts +0 -16
  163. package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -34
  164. package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -42
  165. package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -98
  166. package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -34
  167. package/types/storages/pluggable/UniqueKeysCachePluggable.d.ts +0 -20
  168. package/types/storages/pluggable/constants.d.ts +0 -1
  169. package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -12
  170. package/types/storages/pluggable/index.d.ts +0 -9
  171. package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
  172. package/types/storages/types.d.ts +0 -410
  173. package/types/storages/utils.d.ts +0 -8
  174. package/types/sync/offline/LocalhostFromObject.d.ts +0 -2
  175. package/types/sync/offline/splitsParser/parseCondition.d.ts +0 -7
  176. package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +0 -3
  177. package/types/sync/offline/splitsParser/types.d.ts +0 -3
  178. package/types/sync/offline/syncManagerOffline.d.ts +0 -10
  179. package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +0 -17
  180. package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +0 -7
  181. package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +0 -7
  182. package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +0 -7
  183. package/types/sync/polling/fetchers/types.d.ts +0 -5
  184. package/types/sync/polling/pollingManagerCS.d.ts +0 -7
  185. package/types/sync/polling/pollingManagerSS.d.ts +0 -6
  186. package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +0 -9
  187. package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +0 -9
  188. package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +0 -9
  189. package/types/sync/polling/types.d.ts +0 -33
  190. package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -14
  191. package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
  192. package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -41
  193. package/types/sync/streaming/AuthClient/index.d.ts +0 -12
  194. package/types/sync/streaming/AuthClient/types.d.ts +0 -17
  195. package/types/sync/streaming/SSEClient/index.d.ts +0 -34
  196. package/types/sync/streaming/SSEClient/types.d.ts +0 -11
  197. package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +0 -14
  198. package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +0 -20
  199. package/types/sync/streaming/SSEHandler/index.d.ts +0 -11
  200. package/types/sync/streaming/SSEHandler/types.d.ts +0 -72
  201. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -9
  202. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -9
  203. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -14
  204. package/types/sync/streaming/UpdateWorkers/constants.d.ts +0 -3
  205. package/types/sync/streaming/UpdateWorkers/types.d.ts +0 -4
  206. package/types/sync/streaming/constants.d.ts +0 -34
  207. package/types/sync/streaming/mySegmentsV2utils.d.ts +0 -27
  208. package/types/sync/streaming/parseUtils.d.ts +0 -34
  209. package/types/sync/streaming/pushManager.d.ts +0 -9
  210. package/types/sync/streaming/pushManagerCS_Spec1_3.d.ts +0 -9
  211. package/types/sync/streaming/pushManager_Spec1_3.d.ts +0 -9
  212. package/types/sync/streaming/types.d.ts +0 -35
  213. package/types/sync/submitters/eventsSubmitter.d.ts +0 -5
  214. package/types/sync/submitters/impressionCountsSubmitter.d.ts +0 -10
  215. package/types/sync/submitters/impressionsSubmitter.d.ts +0 -11
  216. package/types/sync/submitters/submitter.d.ts +0 -12
  217. package/types/sync/submitters/submitterManager.d.ts +0 -3
  218. package/types/sync/submitters/telemetrySubmitter.d.ts +0 -17
  219. package/types/sync/submitters/types.d.ts +0 -217
  220. package/types/sync/submitters/uniqueKeysSubmitter.d.ts +0 -5
  221. package/types/sync/syncManagerOnline.d.ts +0 -13
  222. package/types/sync/syncTask.d.ts +0 -13
  223. package/types/sync/types.d.ts +0 -43
  224. package/types/trackers/eventTracker.d.ts +0 -10
  225. package/types/trackers/impressionObserver/ImpressionObserver.d.ts +0 -8
  226. package/types/trackers/impressionObserver/buildKey.d.ts +0 -2
  227. package/types/trackers/impressionObserver/impressionObserverCS.d.ts +0 -4
  228. package/types/trackers/impressionObserver/impressionObserverSS.d.ts +0 -4
  229. package/types/trackers/impressionObserver/types.d.ts +0 -4
  230. package/types/trackers/impressionObserver/utils.d.ts +0 -5
  231. package/types/trackers/impressionsTracker.d.ts +0 -13
  232. package/types/trackers/strategy/strategyDebug.d.ts +0 -9
  233. package/types/trackers/strategy/strategyNone.d.ts +0 -10
  234. package/types/trackers/strategy/strategyOptimized.d.ts +0 -11
  235. package/types/trackers/telemetryTracker.d.ts +0 -3
  236. package/types/trackers/types.d.ts +0 -68
  237. package/types/trackers/uniqueKeysTracker.d.ts +0 -13
  238. package/types/types.d.ts +0 -1408
  239. package/types/utils/Backoff.d.ts +0 -25
  240. package/types/utils/LRUCache/LinkedList.d.ts +0 -34
  241. package/types/utils/LRUCache/index.d.ts +0 -15
  242. package/types/utils/MinEventEmitter.d.ts +0 -12
  243. package/types/utils/MinEvents.d.ts +0 -4
  244. package/types/utils/base64/index.d.ts +0 -30
  245. package/types/utils/constants/browser.d.ts +0 -1
  246. package/types/utils/constants/index.d.ts +0 -83
  247. package/types/utils/decompress/index.d.ts +0 -16
  248. package/types/utils/env/isLocalStorageAvailable.d.ts +0 -1
  249. package/types/utils/env/isNode.d.ts +0 -5
  250. package/types/utils/inputValidation/apiKey.d.ts +0 -7
  251. package/types/utils/inputValidation/attribute.d.ts +0 -2
  252. package/types/utils/inputValidation/attributes.d.ts +0 -4
  253. package/types/utils/inputValidation/event.d.ts +0 -2
  254. package/types/utils/inputValidation/eventProperties.d.ts +0 -6
  255. package/types/utils/inputValidation/eventValue.d.ts +0 -2
  256. package/types/utils/inputValidation/index.d.ts +0 -13
  257. package/types/utils/inputValidation/isOperational.d.ts +0 -4
  258. package/types/utils/inputValidation/key.d.ts +0 -3
  259. package/types/utils/inputValidation/preloadedData.d.ts +0 -3
  260. package/types/utils/inputValidation/sdkKey.d.ts +0 -7
  261. package/types/utils/inputValidation/split.d.ts +0 -2
  262. package/types/utils/inputValidation/splitExistance.d.ts +0 -7
  263. package/types/utils/inputValidation/splitExistence.d.ts +0 -7
  264. package/types/utils/inputValidation/splits.d.ts +0 -2
  265. package/types/utils/inputValidation/trafficType.d.ts +0 -2
  266. package/types/utils/inputValidation/trafficTypeExistance.d.ts +0 -9
  267. package/types/utils/inputValidation/trafficTypeExistence.d.ts +0 -9
  268. package/types/utils/jwt/index.d.ts +0 -5
  269. package/types/utils/jwt/types.d.ts +0 -5
  270. package/types/utils/key/index.d.ts +0 -8
  271. package/types/utils/labels/index.d.ts +0 -8
  272. package/types/utils/lang/binarySearch.d.ts +0 -9
  273. package/types/utils/lang/getFnName.d.ts +0 -4
  274. package/types/utils/lang/getGlobal.d.ts +0 -4
  275. package/types/utils/lang/index.d.ts +0 -105
  276. package/types/utils/lang/maps.d.ts +0 -59
  277. package/types/utils/lang/objectAssign.d.ts +0 -6
  278. package/types/utils/lang/sets.d.ts +0 -3
  279. package/types/utils/murmur3/common.d.ts +0 -12
  280. package/types/utils/murmur3/legacy.d.ts +0 -2
  281. package/types/utils/murmur3/murmur3.d.ts +0 -2
  282. package/types/utils/murmur3/murmur3_128.d.ts +0 -6
  283. package/types/utils/murmur3/murmur3_128_x86.d.ts +0 -7
  284. package/types/utils/murmur3/murmur3_64.d.ts +0 -10
  285. package/types/utils/murmur3/utfx.d.ts +0 -27
  286. package/types/utils/promise/thenable.d.ts +0 -1
  287. package/types/utils/promise/timeout.d.ts +0 -1
  288. package/types/utils/promise/wrapper.d.ts +0 -21
  289. package/types/utils/redis/RedisMock.d.ts +0 -4
  290. package/types/utils/semVer.d.ts +0 -15
  291. package/types/utils/settingsValidation/consent.d.ts +0 -6
  292. package/types/utils/settingsValidation/impressionsMode.d.ts +0 -3
  293. package/types/utils/settingsValidation/index.d.ts +0 -51
  294. package/types/utils/settingsValidation/integrations/common.d.ts +0 -14
  295. package/types/utils/settingsValidation/integrations/configurable.d.ts +0 -13
  296. package/types/utils/settingsValidation/integrations/pluggable.d.ts +0 -13
  297. package/types/utils/settingsValidation/localhost/builtin.d.ts +0 -16
  298. package/types/utils/settingsValidation/localhost/pluggable.d.ts +0 -16
  299. package/types/utils/settingsValidation/logger/builtinLogger.d.ts +0 -10
  300. package/types/utils/settingsValidation/logger/commons.d.ts +0 -9
  301. package/types/utils/settingsValidation/logger/globalLogLevel.d.ts +0 -8
  302. package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +0 -11
  303. package/types/utils/settingsValidation/mode.d.ts +0 -5
  304. package/types/utils/settingsValidation/runtime.d.ts +0 -2
  305. package/types/utils/settingsValidation/splitFilters.d.ts +0 -17
  306. package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -21
  307. package/types/utils/settingsValidation/types.d.ts +0 -32
  308. package/types/utils/settingsValidation/url.d.ts +0 -10
  309. package/types/utils/time/index.d.ts +0 -4
  310. package/types/utils/timeTracker/now/browser.d.ts +0 -1
  311. package/types/utils/timeTracker/now/node.d.ts +0 -1
  312. package/types/utils/timeTracker/timer.d.ts +0 -1
@@ -1,7 +0,0 @@
1
- /**
2
- * x86 version of Murmur3 for 128bits.
3
- * Used by hashImpression128 because in JS it is more efficient than the x64 version, no matter the underlying OS/CPU arch.
4
- *
5
- * @param {string} str
6
- */
7
- export declare function hash128(str: string, seed?: number): string;
@@ -1,10 +0,0 @@
1
- export declare type Hash64 = {
2
- hex: string;
3
- dec: string;
4
- };
5
- /**
6
- * Gets the higher 64 bits of the x64 version of Murmur3 for 128bits, as decimal and hexadecimal number strings.
7
- * Used for MySegments channel V2 notifications.
8
- * @param {string} str
9
- */
10
- export declare function hash64(str: string): Hash64;
@@ -1,27 +0,0 @@
1
- export interface utfx {
2
- encodeUTF16toUTF8(src: () => number | null, dst: (...args: number[]) => string | undefined): void;
3
- }
4
- /**
5
- * Converts and encodes UTF16 characters to UTF8 bytes.
6
- * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null`
7
- * if there are no more characters left.
8
- * @param {!function(number)} dst Bytes destination as a function successively called with the next byte.
9
- * @expose
10
- */
11
- export declare function encodeUTF16toUTF8(src: () => number | null, dst: (...args: number[]) => string | undefined): void;
12
- /**
13
- * Creates a source function for a string.
14
- * @param {string} s String to read from
15
- * @returns {!function():number|null} Source function returning the next char code respectively `null` if there are
16
- * no more characters left.
17
- * @throws {TypeError} If the argument is invalid
18
- * @expose
19
- */
20
- export declare function stringSource(s: string): () => number | null;
21
- /**
22
- * Creates a destination function for a string.
23
- * @returns {function(number=):undefined|string} Destination function successively called with the next char code.
24
- * Returns the final string when called without arguments.
25
- * @expose
26
- */
27
- export declare function stringDestination(): (...args: number[]) => string | undefined;
@@ -1 +0,0 @@
1
- export declare function thenable(o: any): o is Promise<any>;
@@ -1 +0,0 @@
1
- export declare function timeout<T>(ms: number, promise: Promise<T>): Promise<T>;
@@ -1,21 +0,0 @@
1
- /**
2
- * wraps a given promise in a new one with a default onRejected function,
3
- * that handles the promise rejection if not other onRejected handler is provided.
4
- *
5
- * Caveats:
6
- * - There are some cases where the `defaultOnRejected` handler is not invoked
7
- * and the promise rejection must be handled by the user (same as the Promise spec):
8
- * - using async/await syntax with a transpiler to Promises
9
- * - setting an `onFinally` handler as the first handler (e.g. `promiseWrapper(Promise.reject()).finally(...)`)
10
- * - setting more than one handler with at least one of them being an onRejected handler
11
- * - If the wrapped promise is rejected when using native async/await syntax, the `defaultOnRejected` handler is invoked
12
- * and neither the catch block nor the remaining try block are executed.
13
- *
14
- * @param customPromise promise to wrap
15
- * @param defaultOnRejected default onRejected function
16
- * @returns a promise that doesn't need to be handled for rejection (except when using async/await syntax) and
17
- * includes a method named `hasOnFulfilled` that returns true if the promise has attached an onFulfilled handler.
18
- */
19
- export declare function promiseWrapper<T>(customPromise: Promise<T>, defaultOnRejected: (_: any) => any): Promise<T> & {
20
- hasOnFulfilled: () => boolean;
21
- };
@@ -1,4 +0,0 @@
1
- export declare class RedisMock {
2
- private pipelineMethods;
3
- constructor();
4
- }
@@ -1,15 +0,0 @@
1
- export declare class Semver {
2
- private readonly _major;
3
- private readonly _minor;
4
- private readonly _patch;
5
- private readonly _preRelease;
6
- private readonly _isStable;
7
- readonly version: string;
8
- constructor(version: string);
9
- /**
10
- * Precedence comparision between 2 Semver objects.
11
- *
12
- * @return `0` if `this === toCompare`, `-1` if `this < toCompare`, and `1` if `this > toCompare`
13
- */
14
- compare(toCompare: Semver): number;
15
- }
@@ -1,6 +0,0 @@
1
- import { ILogger } from '../../logger/types';
2
- import { ConsentStatus } from '../../types';
3
- export declare function validateConsent({ userConsent, log }: {
4
- userConsent?: any;
5
- log: ILogger;
6
- }): ConsentStatus;
@@ -1,3 +0,0 @@
1
- import { ILogger } from '../../logger/types';
2
- import { SplitIO } from '../../types';
3
- export declare function validImpressionsMode(log: ILogger, impressionsMode: any): SplitIO.ImpressionsMode;
@@ -1,51 +0,0 @@
1
- import { ISettingsValidationParams } from './types';
2
- import { ISettings } from '../../types';
3
- export declare const base: {
4
- mode: import("../../types").SDKMode;
5
- core: {
6
- authorizationKey: undefined;
7
- key: undefined;
8
- labelsEnabled: boolean;
9
- IPAddressesEnabled: undefined;
10
- };
11
- scheduler: {
12
- featuresRefreshRate: number;
13
- segmentsRefreshRate: number;
14
- telemetryRefreshRate: number;
15
- impressionsRefreshRate: number;
16
- offlineRefreshRate: number;
17
- eventsPushRate: number;
18
- eventsQueueSize: number;
19
- impressionsQueueSize: number;
20
- pushRetryBackoffBase: number;
21
- };
22
- urls: {
23
- sdk: string;
24
- events: string;
25
- auth: string;
26
- streaming: string;
27
- telemetry: string;
28
- };
29
- storage: undefined;
30
- debug: undefined;
31
- impressionListener: undefined;
32
- version: undefined;
33
- integrations: undefined;
34
- streamingEnabled: boolean;
35
- sync: {
36
- splitFilters: undefined;
37
- impressionsMode: string;
38
- localhostMode: undefined;
39
- enabled: boolean;
40
- flagSpecVersion: string;
41
- };
42
- log: undefined;
43
- };
44
- /**
45
- * Validates the given config and use it to build a settings object.
46
- * NOTE: it doesn't validate the SDK Key. Call `validateApiKey` or `validateAndTrackApiKey` for that after settings validation.
47
- *
48
- * @param config user defined configuration
49
- * @param validationParams defaults and fields validators used to validate and creates a settings object from a given config
50
- */
51
- export declare function settingsValidation(config: unknown, validationParams: ISettingsValidationParams): ISettings;
@@ -1,14 +0,0 @@
1
- import { ILogger } from '../../../logger/types';
2
- /**
3
- * This function validates `settings.integrations` object
4
- *
5
- * @param {any} settings config object provided by the user to initialize the sdk
6
- * @param {function} integrationValidator filter used to remove invalid integration items
7
- * @param {string} extraWarning optional string used to better describe why an item might be invalid
8
- *
9
- * @returns {Array} array of valid integration items. The array might be empty if `settings` object does not have valid integrations.
10
- */
11
- export declare function validateIntegrations(settings: {
12
- log: ILogger;
13
- integrations?: any;
14
- }, integrationValidator: (integrationItem: any) => boolean, extraWarning?: string): any[];
@@ -1,13 +0,0 @@
1
- import { ILogger } from '../../../logger/types';
2
- /**
3
- * This function validates `settings.integrations` object that consists of a list of configuration items, used by the isomorphic JS SDK.
4
- *
5
- * @param {any} settings config object provided by the user to initialize the sdk
6
- * @param {Array<string>} validIntegrationTypes list of integration types to filter from `settings.integrations`
7
- *
8
- * @returns {Array} array of valid integration items. The array might be empty if `settings` object does not have valid integrations.
9
- */
10
- export declare function validateConfigurableIntegrations(settings: {
11
- log: ILogger;
12
- integrations?: any;
13
- }, validIntegrationTypes?: string[]): any[];
@@ -1,13 +0,0 @@
1
- import { ISettings } from '../../../types';
2
- import { ILogger } from '../../../logger/types';
3
- /**
4
- * This function validates `settings.integrations` object that consists of a list of pluggable integration factories.
5
- *
6
- * @param {any} settings config object provided by the user to initialize the sdk
7
- *
8
- * @returns {Array} array of valid integration factories. The array might be empty if `settings` object does not have valid integrations.
9
- */
10
- export declare function validatePluggableIntegrations(settings: {
11
- log: ILogger;
12
- integrations?: any;
13
- }): ISettings['integrations'];
@@ -1,16 +0,0 @@
1
- import { ILogger } from '../../../logger/types';
2
- import { SDKMode } from '../../../types';
3
- /**
4
- * This function validates `settings.sync.localhostMode` object
5
- *
6
- * @param {any} settings config object provided by the user to initialize the sdk
7
- *
8
- * @returns {Object} provided localhost mode module at `settings.sync.localhostMode` if valid, or a default LocalhostFromObject instance if not provided or invalid
9
- */
10
- export declare function validateLocalhostWithDefault(settings: {
11
- log: ILogger;
12
- sync: {
13
- localhostMode?: any;
14
- };
15
- mode: SDKMode;
16
- }): any;
@@ -1,16 +0,0 @@
1
- import { ILogger } from '../../../logger/types';
2
- import { SDKMode } from '../../../types';
3
- /**
4
- * This function validates `settings.sync.localhostMode` object
5
- *
6
- * @param {any} settings config object provided by the user to initialize the sdk
7
- *
8
- * @returns {Object | undefined} provided localhost mode module at `settings.sync.localhostMode`, or undefined if it is not provided or invalid
9
- */
10
- export declare function validateLocalhost(settings: {
11
- log: ILogger;
12
- sync: {
13
- localhostMode?: any;
14
- };
15
- mode: SDKMode;
16
- }): any;
@@ -1,10 +0,0 @@
1
- import { ILogger } from '../../../logger/types';
2
- /**
3
- * Validates the `debug` property at config and use it to set the log level.
4
- *
5
- * @param settings user config object, with an optional `debug` property of type boolean or string log level.
6
- * @returns a logger instance with the log level at `settings.debug`. If `settings.debug` is invalid or not provided, `initialLogLevel` is used.
7
- */
8
- export declare function validateLogger(settings: {
9
- debug: unknown;
10
- }): ILogger;
@@ -1,9 +0,0 @@
1
- import { LogLevel } from '../../../types';
2
- /**
3
- * Returns the LogLevel for the given debugValue or undefined if it is invalid,
4
- * i.e., if the debugValue is not a boolean or LogLevel string.
5
- *
6
- * @param debugValue debug value at config
7
- * @returns LogLevel of the given debugValue or undefined if the provided value is invalid
8
- */
9
- export declare function getLogLevel(debugValue: unknown): LogLevel | undefined;
@@ -1,8 +0,0 @@
1
- import { LogLevel } from '../../../types';
2
- /**
3
- * The debug level can be set globally via the `localStorage.splitio_debug` item in browser, or the `SPLITIO_DEBUG` env var in NodeJS.
4
- * Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
5
- * Other acceptable values are 'on', 'enable' and 'enabled', which are equivalent to 'DEBUG'.
6
- * Any other value, like undefined, null or an invalid string, returns `undefined` and means that the global log level is not set.
7
- */
8
- export declare function getGlobalLogLevel(): LogLevel | undefined;
@@ -1,11 +0,0 @@
1
- import { ILogger } from '../../../logger/types';
2
- /**
3
- * Validates the `debug` property at config and use it to set the logger.
4
- *
5
- * @param settings user config object, with an optional `debug` property of type boolean, string log level or a Logger object.
6
- * @returns a logger instance, that might be: the provided logger at `settings.debug`, or one with the given `debug` log level,
7
- * or one with NONE log level if `debug` is not defined or invalid.
8
- */
9
- export declare function validateLogger(settings: {
10
- debug: unknown;
11
- }): ILogger;
@@ -1,5 +0,0 @@
1
- export declare function validateMode(key: string, mode: string): string;
2
- /**
3
- * Storage is async if mode is consumer or partial consumer
4
- */
5
- export declare function isConsumerMode(mode: string): boolean;
@@ -1,2 +0,0 @@
1
- import { ISettings } from '../../types';
2
- export declare function validateRuntime(): ISettings['runtime'];
@@ -1,17 +0,0 @@
1
- import { ISplitFiltersValidation } from '../../dtos/types';
2
- import { ILogger } from '../../logger/types';
3
- /**
4
- * Validates `splitFilters` configuration object and parses it into a query string for filtering splits on `/splitChanges` fetch.
5
- *
6
- * @param {ILogger} log logger
7
- * @param {any} maybeSplitFilters split filters configuration param provided by the user
8
- * @param {string} mode settings mode
9
- * @returns it returns an object with the following properties:
10
- * - `validFilters`: the validated `splitFilters` configuration object defined by the user.
11
- * - `queryString`: the parsed split filter query. it is null if all filters are invalid or all values in filters are invalid.
12
- * - `groupedFilters`: list of values grouped by filter type.
13
- *
14
- * @throws Error if the some of the grouped list of values per filter exceeds the max allowed length
15
- */
16
- export declare function validateSplitFilters(log: ILogger, maybeSplitFilters: any, mode: string): ISplitFiltersValidation;
17
- export declare function validateFlagSets(log: ILogger, method: string, flagSets: string[], flagSetsInConfig: string[]): string[] | false;
@@ -1,21 +0,0 @@
1
- import { ISettings, SDKMode } from '../../../types';
2
- import { ILogger } from '../../../logger/types';
3
- import { IStorageFactoryParams, IStorageSync } from '../../../storages/types';
4
- export declare function __InLocalStorageMockFactory(params: IStorageFactoryParams): IStorageSync;
5
- export declare namespace __InLocalStorageMockFactory {
6
- var type: import("../../../storages/types").StorageType;
7
- }
8
- /**
9
- * This function validates `settings.storage` object
10
- *
11
- * @param {any} settings config object provided by the user to initialize the sdk
12
- *
13
- * @returns {Object} valid storage factory. Default to `InMemoryStorageCSFactory` if the provided storage is invalid or not compatible with the sdk mode if mode is standalone or localhost
14
- *
15
- * @throws error if mode is consumer and the provided storage is not compatible
16
- */
17
- export declare function validateStorageCS(settings: {
18
- log: ILogger;
19
- storage?: any;
20
- mode: SDKMode;
21
- }): ISettings['storage'];
@@ -1,32 +0,0 @@
1
- import { ISettings } from '../../types';
2
- /**
3
- * Parameters used to specialize the settings validation for each API variant
4
- * (client-side, server-side) and environment (Node server, Browser, etc)
5
- */
6
- export interface ISettingsValidationParams {
7
- /**
8
- * Object of values to overwrite base settings.
9
- * Version and startup properties are required, because they are not defined in the base settings.
10
- */
11
- defaults: Partial<ISettings> & {
12
- version: string;
13
- } & {
14
- startup: ISettings['startup'];
15
- };
16
- /** If true, validates core.key */
17
- acceptKey?: boolean;
18
- /** Define runtime values (`settings.runtime`) */
19
- runtime: (settings: ISettings) => ISettings['runtime'];
20
- /** Storage validator (`settings.storage`) */
21
- storage?: (settings: ISettings) => ISettings['storage'];
22
- /** Integrations validator (`settings.integrations`) */
23
- integrations?: (settings: ISettings) => ISettings['integrations'];
24
- /** Logger validator (`settings.debug`) */
25
- logger: (settings: ISettings) => ISettings['log'];
26
- /** Localhost mode validator (`settings.sync.localhostMode`) */
27
- localhost?: (settings: ISettings) => ISettings['sync']['localhostMode'];
28
- /** User consent validator (`settings.userConsent`) */
29
- consent?: (settings: ISettings) => ISettings['userConsent'];
30
- /** Flag spec version validation. Configurable by the JS Synchronizer but not by the SDKs */
31
- flagSpec?: (settings: ISettings) => ISettings['sync']['flagSpecVersion'];
32
- }
@@ -1,10 +0,0 @@
1
- import { ISettings } from '../../types';
2
- /**
3
- * Get URL based on a given target (path).
4
- * ATM, it is only used for testing purposes.
5
- *
6
- * @param settings settings object
7
- * @param target url path
8
- * @return complete url
9
- */
10
- export declare function url(settings: ISettings, target: string): string;
@@ -1,4 +0,0 @@
1
- /**
2
- * Truncates de time frame received with the time window.
3
- */
4
- export declare function truncateTimeFrame(timestampInMs: number): number;
@@ -1 +0,0 @@
1
- export declare const now: () => number;
@@ -1 +0,0 @@
1
- export declare function now(): number;
@@ -1 +0,0 @@
1
- export declare function timer(now: () => number): () => number;