@splitsoftware/splitio-commons 1.6.2-rc.3 → 1.6.2-rc.6

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 (272) hide show
  1. package/cjs/evaluator/index.js +10 -11
  2. package/cjs/integrations/ga/GaToSplit.js +8 -5
  3. package/cjs/sdkFactory/index.js +2 -3
  4. package/cjs/sdkManager/index.js +3 -11
  5. package/cjs/services/splitApi.js +0 -1
  6. package/cjs/storages/AbstractSplitsCacheAsync.js +7 -9
  7. package/cjs/storages/AbstractSplitsCacheSync.js +7 -9
  8. package/cjs/storages/dataLoader.js +1 -1
  9. package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +5 -6
  10. package/cjs/storages/inMemory/SplitsCacheInMemory.js +7 -10
  11. package/cjs/storages/inRedis/SplitsCacheInRedis.js +15 -9
  12. package/cjs/storages/pluggable/SplitsCachePluggable.js +14 -9
  13. package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +2 -3
  14. package/cjs/sync/polling/updaters/splitChangesUpdater.js +1 -1
  15. package/cjs/trackers/telemetryTracker.js +6 -0
  16. package/cjs/types.js +2 -0
  17. package/cjs/utils/key/index.js +1 -1
  18. package/cjs/utils/settingsValidation/index.js +0 -1
  19. package/esm/evaluator/index.js +10 -11
  20. package/esm/integrations/ga/GaToSplit.js +8 -5
  21. package/esm/sdkFactory/index.js +2 -3
  22. package/esm/sdkManager/index.js +3 -11
  23. package/esm/services/splitApi.js +0 -1
  24. package/esm/storages/AbstractSplitsCacheAsync.js +7 -9
  25. package/esm/storages/AbstractSplitsCacheSync.js +7 -9
  26. package/esm/storages/dataLoader.js +1 -1
  27. package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +5 -6
  28. package/esm/storages/inMemory/SplitsCacheInMemory.js +7 -10
  29. package/esm/storages/inRedis/SplitsCacheInRedis.js +15 -9
  30. package/esm/storages/pluggable/SplitsCachePluggable.js +14 -9
  31. package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +2 -3
  32. package/esm/sync/polling/updaters/splitChangesUpdater.js +1 -1
  33. package/esm/trackers/telemetryTracker.js +6 -0
  34. package/esm/types.js +1 -0
  35. package/esm/utils/key/index.js +1 -1
  36. package/esm/utils/settingsValidation/index.js +0 -1
  37. package/package.json +2 -2
  38. package/src/consent/sdkUserConsent.ts +3 -4
  39. package/src/dtos/types.ts +8 -0
  40. package/src/evaluator/Engine.ts +3 -3
  41. package/src/evaluator/combiners/and.ts +1 -1
  42. package/src/evaluator/combiners/ifelseif.ts +3 -3
  43. package/src/evaluator/condition/engineUtils.ts +1 -1
  44. package/src/evaluator/condition/index.ts +6 -6
  45. package/src/evaluator/index.ts +18 -19
  46. package/src/evaluator/matchers/all.ts +1 -1
  47. package/src/evaluator/matchers/between.ts +1 -1
  48. package/src/evaluator/matchers/boolean.ts +1 -1
  49. package/src/evaluator/matchers/cont_all.ts +1 -1
  50. package/src/evaluator/matchers/cont_any.ts +1 -1
  51. package/src/evaluator/matchers/cont_str.ts +1 -1
  52. package/src/evaluator/matchers/dependency.ts +1 -1
  53. package/src/evaluator/matchers/eq.ts +1 -1
  54. package/src/evaluator/matchers/eq_set.ts +1 -1
  55. package/src/evaluator/matchers/ew.ts +1 -1
  56. package/src/evaluator/matchers/gte.ts +1 -1
  57. package/src/evaluator/matchers/index.ts +1 -1
  58. package/src/evaluator/matchers/lte.ts +1 -1
  59. package/src/evaluator/matchers/part_of.ts +1 -1
  60. package/src/evaluator/matchers/segment.ts +1 -1
  61. package/src/evaluator/matchers/string.ts +1 -1
  62. package/src/evaluator/matchers/sw.ts +1 -1
  63. package/src/evaluator/matchers/whitelist.ts +1 -1
  64. package/src/evaluator/parser/index.ts +3 -3
  65. package/src/evaluator/types.ts +6 -6
  66. package/src/evaluator/value/index.ts +4 -4
  67. package/src/evaluator/value/sanitize.ts +4 -4
  68. package/src/integrations/ga/GaToSplit.ts +15 -11
  69. package/src/integrations/ga/SplitToGa.ts +10 -10
  70. package/src/integrations/ga/types.ts +4 -4
  71. package/src/integrations/pluggable.ts +3 -3
  72. package/src/integrations/types.ts +4 -3
  73. package/src/logger/index.ts +3 -3
  74. package/src/logger/sdkLogger.ts +2 -1
  75. package/src/logger/types.ts +16 -0
  76. package/src/readiness/sdkReadinessManager.ts +1 -1
  77. package/src/readiness/types.ts +9 -2
  78. package/src/sdkClient/client.ts +13 -13
  79. package/src/sdkClient/clientAttributesDecoration.ts +9 -9
  80. package/src/sdkClient/clientCS.ts +4 -3
  81. package/src/sdkClient/clientInputValidation.ts +15 -15
  82. package/src/sdkClient/sdkClient.ts +2 -2
  83. package/src/sdkClient/sdkClientMethod.ts +2 -2
  84. package/src/sdkClient/sdkClientMethodCS.ts +9 -9
  85. package/src/sdkClient/sdkClientMethodCSWithTT.ts +9 -9
  86. package/src/sdkFactory/index.ts +4 -5
  87. package/src/sdkFactory/types.ts +4 -4
  88. package/src/sdkManager/index.ts +7 -16
  89. package/src/services/splitApi.ts +0 -1
  90. package/src/storages/AbstractSplitsCacheAsync.ts +13 -14
  91. package/src/storages/AbstractSplitsCacheSync.ts +14 -16
  92. package/src/storages/dataLoader.ts +3 -3
  93. package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +1 -1
  94. package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +10 -12
  95. package/src/storages/inLocalStorage/index.ts +2 -3
  96. package/src/storages/inMemory/EventsCacheInMemory.ts +4 -4
  97. package/src/storages/inMemory/SplitsCacheInMemory.ts +10 -14
  98. package/src/storages/inRedis/EventsCacheInRedis.ts +4 -4
  99. package/src/storages/inRedis/ImpressionsCacheInRedis.ts +1 -1
  100. package/src/storages/inRedis/RedisAdapter.ts +1 -1
  101. package/src/storages/inRedis/SegmentsCacheInRedis.ts +1 -1
  102. package/src/storages/inRedis/SplitsCacheInRedis.ts +22 -18
  103. package/src/storages/inRedis/TelemetryCacheInRedis.ts +1 -1
  104. package/src/storages/inRedis/index.ts +2 -3
  105. package/src/storages/pluggable/EventsCachePluggable.ts +4 -4
  106. package/src/storages/pluggable/ImpressionsCachePluggable.ts +1 -1
  107. package/src/storages/pluggable/SegmentsCachePluggable.ts +1 -1
  108. package/src/storages/pluggable/SplitsCachePluggable.ts +21 -18
  109. package/src/storages/pluggable/TelemetryCachePluggable.ts +1 -1
  110. package/src/storages/pluggable/index.ts +3 -3
  111. package/src/storages/pluggable/wrapperAdapter.ts +1 -1
  112. package/src/storages/types.ts +30 -54
  113. package/src/sync/offline/LocalhostFromObject.ts +4 -4
  114. package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +8 -8
  115. package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +5 -6
  116. package/src/sync/polling/updaters/mySegmentsUpdater.ts +1 -1
  117. package/src/sync/polling/updaters/segmentChangesUpdater.ts +1 -1
  118. package/src/sync/polling/updaters/splitChangesUpdater.ts +3 -3
  119. package/src/sync/streaming/SSEHandler/index.ts +1 -1
  120. package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +1 -1
  121. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +1 -1
  122. package/src/sync/submitters/submitter.ts +1 -1
  123. package/src/sync/submitters/types.ts +2 -2
  124. package/src/sync/syncTask.ts +1 -1
  125. package/src/trackers/eventTracker.ts +3 -3
  126. package/src/trackers/impressionsTracker.ts +3 -3
  127. package/src/trackers/telemetryTracker.ts +7 -2
  128. package/src/trackers/types.ts +8 -4
  129. package/src/types.ts +1263 -0
  130. package/src/utils/constants/index.ts +1 -1
  131. package/src/utils/inputValidation/apiKey.ts +1 -1
  132. package/src/utils/inputValidation/attribute.ts +1 -1
  133. package/src/utils/inputValidation/attributes.ts +3 -3
  134. package/src/utils/inputValidation/event.ts +1 -1
  135. package/src/utils/inputValidation/eventProperties.ts +3 -3
  136. package/src/utils/inputValidation/eventValue.ts +1 -1
  137. package/src/utils/inputValidation/isOperational.ts +1 -1
  138. package/src/utils/inputValidation/key.ts +3 -3
  139. package/src/utils/inputValidation/preloadedData.ts +3 -3
  140. package/src/utils/inputValidation/split.ts +1 -1
  141. package/src/utils/inputValidation/splitExistance.ts +1 -1
  142. package/src/utils/inputValidation/splits.ts +1 -1
  143. package/src/utils/inputValidation/trafficType.ts +1 -1
  144. package/src/utils/inputValidation/trafficTypeExistance.ts +1 -1
  145. package/src/utils/key/index.ts +9 -9
  146. package/src/utils/settingsValidation/consent.ts +2 -1
  147. package/src/utils/settingsValidation/impressionsMode.ts +3 -3
  148. package/src/utils/settingsValidation/index.ts +0 -1
  149. package/src/utils/settingsValidation/integrations/common.ts +1 -1
  150. package/src/utils/settingsValidation/integrations/configurable.ts +1 -1
  151. package/src/utils/settingsValidation/integrations/pluggable.ts +2 -1
  152. package/src/utils/settingsValidation/localhost/builtin.ts +2 -1
  153. package/src/utils/settingsValidation/localhost/pluggable.ts +2 -1
  154. package/src/utils/settingsValidation/logger/builtinLogger.ts +2 -1
  155. package/src/utils/settingsValidation/logger/pluggableLogger.ts +2 -1
  156. package/src/utils/settingsValidation/splitFilters.ts +9 -7
  157. package/src/utils/settingsValidation/storage/storageCS.ts +2 -1
  158. package/types/consent/sdkUserConsent.d.ts +9 -2
  159. package/types/dtos/types.d.ts +6 -0
  160. package/types/evaluator/Engine.d.ts +3 -3
  161. package/types/evaluator/combiners/and.d.ts +1 -1
  162. package/types/evaluator/combiners/ifelseif.d.ts +1 -1
  163. package/types/evaluator/condition/engineUtils.d.ts +1 -1
  164. package/types/evaluator/condition/index.d.ts +1 -1
  165. package/types/evaluator/index.d.ts +4 -4
  166. package/types/evaluator/matchers/all.d.ts +1 -1
  167. package/types/evaluator/matchers/between.d.ts +1 -1
  168. package/types/evaluator/matchers/boolean.d.ts +1 -1
  169. package/types/evaluator/matchers/cont_all.d.ts +1 -1
  170. package/types/evaluator/matchers/cont_any.d.ts +1 -1
  171. package/types/evaluator/matchers/cont_str.d.ts +1 -1
  172. package/types/evaluator/matchers/dependency.d.ts +1 -1
  173. package/types/evaluator/matchers/eq.d.ts +1 -1
  174. package/types/evaluator/matchers/eq_set.d.ts +1 -1
  175. package/types/evaluator/matchers/ew.d.ts +1 -1
  176. package/types/evaluator/matchers/gte.d.ts +1 -1
  177. package/types/evaluator/matchers/index.d.ts +1 -1
  178. package/types/evaluator/matchers/lte.d.ts +1 -1
  179. package/types/evaluator/matchers/part_of.d.ts +1 -1
  180. package/types/evaluator/matchers/segment.d.ts +1 -1
  181. package/types/evaluator/matchers/string.d.ts +1 -1
  182. package/types/evaluator/matchers/sw.d.ts +1 -1
  183. package/types/evaluator/matchers/whitelist.d.ts +1 -1
  184. package/types/evaluator/parser/index.d.ts +1 -1
  185. package/types/evaluator/types.d.ts +6 -6
  186. package/types/evaluator/value/index.d.ts +3 -3
  187. package/types/evaluator/value/sanitize.d.ts +3 -3
  188. package/types/integrations/ga/GaToSplit.d.ts +4 -4
  189. package/types/integrations/ga/SplitToGa.d.ts +4 -4
  190. package/types/integrations/ga/types.d.ts +4 -4
  191. package/types/integrations/types.d.ts +4 -3
  192. package/types/logger/index.d.ts +5 -3
  193. package/types/logger/sdkLogger.d.ts +2 -1
  194. package/types/logger/types.d.ts +11 -0
  195. package/types/readiness/sdkReadinessManager.d.ts +1 -1
  196. package/types/readiness/types.d.ts +8 -2
  197. package/types/sdkClient/client.d.ts +2 -2
  198. package/types/sdkClient/clientAttributesDecoration.d.ts +8 -8
  199. package/types/sdkClient/clientCS.d.ts +3 -2
  200. package/types/sdkClient/clientInputValidation.d.ts +2 -2
  201. package/types/sdkClient/sdkClient.d.ts +2 -2
  202. package/types/sdkClient/sdkClientMethod.d.ts +2 -2
  203. package/types/sdkClient/sdkClientMethodCS.d.ts +2 -2
  204. package/types/sdkClient/sdkClientMethodCSWithTT.d.ts +2 -2
  205. package/types/sdkFactory/index.d.ts +2 -2
  206. package/types/sdkFactory/types.d.ts +6 -6
  207. package/types/sdkManager/index.d.ts +3 -3
  208. package/types/storages/AbstractSplitsCacheAsync.d.ts +6 -5
  209. package/types/storages/AbstractSplitsCacheSync.d.ts +5 -5
  210. package/types/storages/dataLoader.d.ts +2 -2
  211. package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +1 -1
  212. package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +4 -3
  213. package/types/storages/inLocalStorage/index.d.ts +2 -2
  214. package/types/storages/inMemory/EventsCacheInMemory.d.ts +3 -3
  215. package/types/storages/inMemory/InMemoryStorage.d.ts +1 -1
  216. package/types/storages/inMemory/InMemoryStorageCS.d.ts +1 -1
  217. package/types/storages/inMemory/SplitsCacheInMemory.d.ts +3 -2
  218. package/types/storages/inRedis/EventsCacheInRedis.d.ts +3 -3
  219. package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +1 -1
  220. package/types/storages/inRedis/RedisAdapter.d.ts +1 -1
  221. package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +1 -1
  222. package/types/storages/inRedis/SplitsCacheInRedis.d.ts +7 -6
  223. package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +1 -1
  224. package/types/storages/inRedis/index.d.ts +2 -2
  225. package/types/storages/pluggable/EventsCachePluggable.d.ts +3 -3
  226. package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +1 -1
  227. package/types/storages/pluggable/SegmentsCachePluggable.d.ts +1 -1
  228. package/types/storages/pluggable/SplitsCachePluggable.d.ts +7 -6
  229. package/types/storages/pluggable/TelemetryCachePluggable.d.ts +1 -1
  230. package/types/storages/pluggable/index.d.ts +2 -3
  231. package/types/storages/pluggable/wrapperAdapter.d.ts +1 -1
  232. package/types/storages/types.d.ts +28 -54
  233. package/types/sync/offline/LocalhostFromObject.d.ts +2 -2
  234. package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +1 -1
  235. package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +1 -1
  236. package/types/sync/polling/updaters/splitChangesUpdater.d.ts +2 -2
  237. package/types/sync/streaming/SSEHandler/index.d.ts +1 -1
  238. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +1 -1
  239. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +1 -1
  240. package/types/sync/submitters/submitter.d.ts +1 -1
  241. package/types/sync/submitters/types.d.ts +2 -2
  242. package/types/sync/syncTask.d.ts +1 -1
  243. package/types/trackers/types.d.ts +8 -4
  244. package/types/types.d.ts +1261 -0
  245. package/types/utils/constants/index.d.ts +1 -1
  246. package/types/utils/inputValidation/apiKey.d.ts +1 -1
  247. package/types/utils/inputValidation/attribute.d.ts +1 -1
  248. package/types/utils/inputValidation/attributes.d.ts +3 -3
  249. package/types/utils/inputValidation/event.d.ts +1 -1
  250. package/types/utils/inputValidation/eventProperties.d.ts +3 -3
  251. package/types/utils/inputValidation/eventValue.d.ts +1 -1
  252. package/types/utils/inputValidation/isOperational.d.ts +1 -1
  253. package/types/utils/inputValidation/key.d.ts +3 -3
  254. package/types/utils/inputValidation/preloadedData.d.ts +3 -3
  255. package/types/utils/inputValidation/split.d.ts +1 -1
  256. package/types/utils/inputValidation/splitExistance.d.ts +1 -1
  257. package/types/utils/inputValidation/splits.d.ts +1 -1
  258. package/types/utils/inputValidation/trafficType.d.ts +1 -1
  259. package/types/utils/inputValidation/trafficTypeExistance.d.ts +1 -1
  260. package/types/utils/key/index.d.ts +4 -4
  261. package/types/utils/settingsValidation/consent.d.ts +2 -1
  262. package/types/utils/settingsValidation/impressionsMode.d.ts +3 -3
  263. package/types/utils/settingsValidation/integrations/common.d.ts +1 -1
  264. package/types/utils/settingsValidation/integrations/configurable.d.ts +1 -1
  265. package/types/utils/settingsValidation/integrations/pluggable.d.ts +2 -1
  266. package/types/utils/settingsValidation/localhost/builtin.d.ts +2 -1
  267. package/types/utils/settingsValidation/localhost/pluggable.d.ts +2 -1
  268. package/types/utils/settingsValidation/logger/builtinLogger.d.ts +1 -1
  269. package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +1 -1
  270. package/types/utils/settingsValidation/splitFilters.d.ts +2 -1
  271. package/types/utils/settingsValidation/storage/storageCS.d.ts +3 -2
  272. package/src/types.d.ts +0 -1646
@@ -1,11 +1,11 @@
1
1
  import { IBetweenMatcherData, IDependencyMatcherData, MaybeThenable } from '../dtos/types';
2
2
  import { IStorageAsync, IStorageSync } from '../storages/types';
3
3
  import { ISet } from '../utils/lang/sets';
4
- import { SplitKey, Attributes } from '../types';
5
- import { ILogger } from '../types';
4
+ import { SplitIO } from '../types';
5
+ import { ILogger } from '../logger/types';
6
6
  export interface IDependencyMatcherValue {
7
- key: SplitKey;
8
- attributes?: Attributes;
7
+ key: SplitIO.SplitKey;
8
+ attributes?: SplitIO.Attributes;
9
9
  }
10
10
  export interface IMatcherDto {
11
11
  type: number;
@@ -23,6 +23,6 @@ export interface IEvaluation {
23
23
  export declare type IEvaluationResult = IEvaluation & {
24
24
  treatment: string;
25
25
  };
26
- export declare type ISplitEvaluator = (log: ILogger, key: SplitKey, splitName: string, attributes: Attributes | undefined, storage: IStorageSync | IStorageAsync) => MaybeThenable<IEvaluation>;
27
- export declare type IEvaluator = (key: SplitKey, seed: number, trafficAllocation?: number, trafficAllocationSeed?: number, attributes?: Attributes, splitEvaluator?: ISplitEvaluator) => MaybeThenable<IEvaluation | undefined>;
26
+ export declare type ISplitEvaluator = (log: ILogger, key: SplitIO.SplitKey, splitName: string, attributes: SplitIO.Attributes | undefined, storage: IStorageSync | IStorageAsync) => MaybeThenable<IEvaluation>;
27
+ export declare type IEvaluator = (key: SplitIO.SplitKey, seed: number, trafficAllocation?: number, trafficAllocationSeed?: number, attributes?: SplitIO.Attributes, splitEvaluator?: ISplitEvaluator) => MaybeThenable<IEvaluation | undefined>;
28
28
  export declare type IMatcher = (...args: any) => MaybeThenable<boolean>;
@@ -1,7 +1,7 @@
1
- import { Attributes } from '../../types';
1
+ import { SplitIO } from '../../types';
2
2
  import { IMatcherDto } from '../types';
3
- import { ILogger } from '../../types';
3
+ import { ILogger } from '../../logger/types';
4
4
  /**
5
5
  * Defines value to be matched (key / attribute).
6
6
  */
7
- export declare function sanitizeValue(log: ILogger, key: string, matcherDto: IMatcherDto, attributes?: Attributes): string | number | boolean | (string | number)[] | import("../types").IDependencyMatcherValue | undefined;
7
+ export declare function sanitizeValue(log: ILogger, key: string, matcherDto: IMatcherDto, attributes?: SplitIO.Attributes): string | number | boolean | (string | number)[] | import("../types").IDependencyMatcherValue | undefined;
@@ -1,7 +1,7 @@
1
- import { Attributes } from '../../types';
1
+ import { SplitIO } from '../../types';
2
2
  import { IDependencyMatcherValue } from '../types';
3
- import { ILogger } from '../../types';
3
+ import { ILogger } from '../../logger/types';
4
4
  /**
5
5
  * Sanitize matcher value
6
6
  */
7
- export declare function sanitize(log: ILogger, matcherTypeID: number, value: string | number | boolean | Array<string | number> | undefined, dataType: string, attributes?: Attributes): string | number | boolean | (string | number)[] | IDependencyMatcherValue | undefined;
7
+ export declare function sanitize(log: ILogger, matcherTypeID: number, value: string | number | boolean | Array<string | number> | undefined, dataType: string, attributes?: SplitIO.Attributes): string | number | boolean | (string | number)[] | IDependencyMatcherValue | undefined;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="google.analytics" />
2
- import { EventData } from '../../types';
2
+ import { SplitIO } from '../../types';
3
3
  import { Identity, GoogleAnalyticsToSplitOptions } from './types';
4
- import { ILogger } from '../../types';
4
+ import { ILogger } from '../../logger/types';
5
5
  import { IIntegrationFactoryParams } from '../types';
6
- export declare const defaultMapper: (model: UniversalAnalytics.Model) => EventData;
6
+ export declare const defaultMapper: (model: UniversalAnalytics.Model) => SplitIO.EventData;
7
7
  export declare const defaultPrefix = "ga";
8
8
  /**
9
9
  * Return a new list of identities removing invalid and duplicated ones.
@@ -19,7 +19,7 @@ export declare function validateIdentities(identities?: Identity[]): Identity[];
19
19
  * @param {EventData} data event data instance to validate. Precondition: data != undefined
20
20
  * @returns {boolean} Whether the data instance is a valid EventData or not.
21
21
  */
22
- export declare function validateEventData(log: ILogger, eventData: any): eventData is EventData;
22
+ export declare function validateEventData(log: ILogger, eventData: any): eventData is SplitIO.EventData;
23
23
  /**
24
24
  * Fixes the passed string value to comply with EventTypeId format, by removing invalid characters and truncating if necessary.
25
25
  *
@@ -1,8 +1,8 @@
1
1
  /// <reference types="google.analytics" />
2
- import { IntegrationData } from '../../types';
2
+ import { SplitIO } from '../../types';
3
3
  import { IIntegration } from '../types';
4
4
  import { SplitToGoogleAnalyticsOptions } from './types';
5
- import { ILogger } from '../../types';
5
+ import { ILogger } from '../../logger/types';
6
6
  export declare class SplitToGa implements IIntegration {
7
7
  static defaultTrackerNames: string[];
8
8
  private trackerNames;
@@ -11,7 +11,7 @@ export declare class SplitToGa implements IIntegration {
11
11
  private impressions;
12
12
  private events;
13
13
  private log;
14
- static defaultMapper({ type, payload }: IntegrationData): UniversalAnalytics.FieldsObject;
14
+ static defaultMapper({ type, payload }: SplitIO.IntegrationData): UniversalAnalytics.FieldsObject;
15
15
  static getGa(): UniversalAnalytics.ga | undefined;
16
16
  /**
17
17
  * Validates if a given object is a UniversalAnalytics.FieldsObject instance, and logs a warning if not.
@@ -30,5 +30,5 @@ export declare class SplitToGa implements IIntegration {
30
30
  * @param {object} options options passed at the SDK integrations settings (isomorphic SDK) or the SplitToGoogleAnalytics plugin (pluggable browser SDK)
31
31
  */
32
32
  constructor(log: ILogger, options: SplitToGoogleAnalyticsOptions);
33
- queue(data: IntegrationData): void;
33
+ queue(data: SplitIO.IntegrationData): void;
34
34
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="google.analytics" />
2
- import { IntegrationData, EventData } from '../../types';
2
+ import { SplitIO } from '../../types';
3
3
  /**
4
4
  * A pair of user key and it's trafficType, required for tracking valid Split events.
5
5
  * @typedef {Object} Identity
@@ -40,7 +40,7 @@ export interface GoogleAnalyticsToSplitOptions {
40
40
  * return defaultMapping;
41
41
  * }`
42
42
  */
43
- mapper?: (model: UniversalAnalytics.Model, defaultMapping: EventData) => EventData;
43
+ mapper?: (model: UniversalAnalytics.Model, defaultMapping: SplitIO.EventData) => SplitIO.EventData;
44
44
  /**
45
45
  * Optional prefix for EventTypeId, to prevent any kind of data collision between events.
46
46
  * @property {string} prefix
@@ -94,7 +94,7 @@ export interface SplitToGoogleAnalyticsOptions {
94
94
  * For example, the following filter allows to track only impressions, equivalent to setting events to false:
95
95
  * `(data) => data.type === 'IMPRESSION'`
96
96
  */
97
- filter?: (data: IntegrationData) => boolean;
97
+ filter?: (data: SplitIO.IntegrationData) => boolean;
98
98
  /**
99
99
  * Optional function useful when you need to modify the GA hit before sending it.
100
100
  * This function is invoked with two arguments:
@@ -125,7 +125,7 @@ export interface SplitToGoogleAnalyticsOptions {
125
125
  * nonInteraction: true,
126
126
  * }`
127
127
  */
128
- mapper?: (data: IntegrationData, defaultMapping: UniversalAnalytics.FieldsObject) => UniversalAnalytics.FieldsObject;
128
+ mapper?: (data: SplitIO.IntegrationData, defaultMapping: UniversalAnalytics.FieldsObject) => UniversalAnalytics.FieldsObject;
129
129
  /**
130
130
  * List of tracker names to send the hit. An empty string represents the default tracker.
131
131
  * If not provided, hits are only sent to default tracker.
@@ -1,8 +1,8 @@
1
1
  import { IEventsCacheBase } from '../storages/types';
2
- import { IEventsHandler, IImpressionsHandler } from '../trackers/types';
3
- import { ISettings, IntegrationData } from '../types';
2
+ import { IEventsHandler, IImpressionsHandler, ITelemetryTracker } from '../trackers/types';
3
+ import { ISettings, SplitIO } from '../types';
4
4
  export interface IIntegration {
5
- queue(data: IntegrationData): void;
5
+ queue(data: SplitIO.IntegrationData): void;
6
6
  }
7
7
  export declare type IIntegrationManager = IEventsHandler & IImpressionsHandler;
8
8
  export interface IIntegrationFactoryParams {
@@ -10,6 +10,7 @@ export interface IIntegrationFactoryParams {
10
10
  events: IEventsCacheBase;
11
11
  };
12
12
  settings: ISettings;
13
+ telemetryTracker: ITelemetryTracker;
13
14
  }
14
15
  export declare type IntegrationFactory = {
15
16
  readonly type: string;
@@ -1,7 +1,9 @@
1
- import { ILoggerOptions } from './types';
2
- import { LogLevel, ILogger, ILoggerAPI } from '../types';
1
+ import { ILoggerOptions, ILogger } from './types';
2
+ import { LogLevel } from '../types';
3
3
  import { IMap } from '../utils/lang/maps';
4
- export declare const LogLevels: ILoggerAPI['LogLevel'];
4
+ export declare const LogLevels: {
5
+ [level: string]: LogLevel;
6
+ };
5
7
  export declare function isLogLevelString(str: string): str is LogLevel;
6
8
  export declare function _sprintf(format?: string, args?: any[]): string;
7
9
  export declare class Logger implements ILogger {
@@ -1,4 +1,5 @@
1
- import { ILoggerAPI, ILogger } from '../types';
1
+ import { ILoggerAPI } from '../types';
2
+ import { ILogger } from './types';
2
3
  /**
3
4
  * The public Logger utility API exposed via SplitFactory, used to update the log level.
4
5
  *
@@ -4,3 +4,14 @@ export interface ILoggerOptions {
4
4
  logLevel?: LogLevel;
5
5
  showLevel?: boolean;
6
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,6 +1,6 @@
1
1
  import { ISdkReadinessManager } from './types';
2
2
  import { IEventEmitter } from '../types';
3
- import { ILogger } from '../types';
3
+ import { ILogger } from '../logger/types';
4
4
  /**
5
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
6
  * It also updates logs related warnings and errors.
@@ -1,4 +1,4 @@
1
- import { IEventEmitter, IStatusInterface, Event } from '../types';
1
+ import { IEventEmitter, IStatusInterface } from '../types';
2
2
  /** Splits data emitter */
3
3
  declare type SDK_SPLITS_ARRIVED = 'state::splits-arrived';
4
4
  declare type SDK_SPLITS_CACHE_LOADED = 'state::splits-cache-loaded';
@@ -20,8 +20,14 @@ export interface ISegmentsEventEmitter extends IEventEmitter {
20
20
  segmentsArrived: boolean;
21
21
  }
22
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;
23
29
  export interface IReadinessEventEmitter extends IEventEmitter {
24
- emit(event: Event, ...args: any[]): boolean;
30
+ emit(event: IReadinessEvent, ...args: any[]): boolean;
25
31
  }
26
32
  /** Readiness manager */
27
33
  export interface IReadinessManager {
@@ -1,6 +1,6 @@
1
- import { IClientSS, IAsyncClientSS } from '../types';
1
+ import { SplitIO } from '../types';
2
2
  import { ISdkFactoryContext } from '../sdkFactory/types';
3
3
  /**
4
4
  * Creator of base client with getTreatments and track methods.
5
5
  */
6
- export declare function clientFactory(params: ISdkFactoryContext): IClientSS | IAsyncClientSS;
6
+ export declare function clientFactory(params: ISdkFactoryContext): SplitIO.IClient | SplitIO.IAsyncClient;
@@ -1,14 +1,14 @@
1
- import { Attributes, IAsyncClientSS, IClientSS, Properties, SplitKey } from '../types';
2
- import { ILogger } from '../types';
1
+ import { SplitIO } from '../types';
2
+ import { ILogger } from '../logger/types';
3
3
  /**
4
4
  * Add in memory attributes storage methods and combine them with any attribute received from the getTreatment/s call
5
5
  */
6
- export declare function clientAttributesDecoration(log: ILogger, client: IClientSS | IAsyncClientSS): (IClientSS | IAsyncClientSS) & {
7
- getTreatment: (maybeKey: SplitKey, maybeSplit: string, maybeAttributes?: Attributes | undefined) => string | import("../types").AsyncTreatment;
8
- getTreatmentWithConfig: (maybeKey: SplitKey, maybeSplit: string, maybeAttributes?: Attributes | undefined) => import("../types").TreatmentWithConfig | import("../types").AsyncTreatmentWithConfig;
9
- getTreatments: (maybeKey: SplitKey, maybeSplits: string[], maybeAttributes?: Attributes | undefined) => import("../types").Treatments | import("../types").AsyncTreatments;
10
- getTreatmentsWithConfig: (maybeKey: SplitKey, maybeSplits: string[], maybeAttributes?: Attributes | undefined) => import("../types").TreatmentsWithConfig | import("../types").AsyncTreatmentsWithConfig;
11
- track: (maybeKey: SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: Properties | undefined) => boolean | Promise<boolean>;
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
12
  /**
13
13
  * Add an attribute to client's in memory attributes storage
14
14
  *
@@ -1,4 +1,5 @@
1
- import { IClientSS, IClientWithKeyLegacy, ILogger, SplitKey } from '../types';
1
+ import { ILogger } from '../logger/types';
2
+ import { SplitIO } from '../types';
2
3
  /**
3
4
  * Decorator that binds a key and (optionally) a traffic type to client methods
4
5
  *
@@ -6,4 +7,4 @@ import { IClientSS, IClientWithKeyLegacy, ILogger, SplitKey } from '../types';
6
7
  * @param key validated split key
7
8
  * @param trafficType validated traffic type
8
9
  */
9
- export declare function clientCSDecorator(log: ILogger, client: IClientSS, key: SplitKey, trafficType?: string): IClientWithKeyLegacy;
10
+ export declare function clientCSDecorator(log: ILogger, client: SplitIO.IClient, key: SplitIO.SplitKey, trafficType?: string): SplitIO.ICsClient;
@@ -1,7 +1,7 @@
1
1
  import { IReadinessManager } from '../readiness/types';
2
- import { ISettings, IClientSS, IAsyncClientSS } from '../types';
2
+ import { ISettings, SplitIO } from '../types';
3
3
  /**
4
4
  * Decorator that validates the input before actually executing the client methods.
5
5
  * We should "guard" the client here, while not polluting the "real" implementation of those methods.
6
6
  */
7
- export declare function clientInputValidationDecorator(settings: ISettings, client: IClientSS | IAsyncClientSS, readinessManager: IReadinessManager): IClientSS | IAsyncClientSS;
7
+ export declare function clientInputValidationDecorator<TClient extends SplitIO.IClient | SplitIO.IAsyncClient>(settings: ISettings, client: TClient, readinessManager: IReadinessManager): TClient;
@@ -1,6 +1,6 @@
1
- import { IBasicClient } from '../types';
1
+ import { SplitIO } from '../types';
2
2
  import { ISdkFactoryContext } from '../sdkFactory/types';
3
3
  /**
4
4
  * Creates an Sdk client, i.e., a base client with status and destroy interface
5
5
  */
6
- export declare function sdkClientFactory(params: ISdkFactoryContext, isSharedClient?: boolean): IBasicClient;
6
+ export declare function sdkClientFactory(params: ISdkFactoryContext, isSharedClient?: boolean): SplitIO.IClient | SplitIO.IAsyncClient;
@@ -1,6 +1,6 @@
1
- import { IBasicClient } from '../types';
1
+ import { SplitIO } from '../types';
2
2
  import { ISdkFactoryContext } from '../sdkFactory/types';
3
3
  /**
4
4
  * Factory of client method for server-side SDKs (ISDK and IAsyncSDK)
5
5
  */
6
- export declare function sdkClientMethodFactory(params: ISdkFactoryContext): () => IBasicClient;
6
+ export declare function sdkClientMethodFactory(params: ISdkFactoryContext): () => SplitIO.IClient | SplitIO.IAsyncClient;
@@ -1,7 +1,7 @@
1
- import { IClientWithKey, SplitKey } from '../types';
1
+ import { SplitIO } from '../types';
2
2
  import { ISdkFactoryContext } from '../sdkFactory/types';
3
3
  /**
4
4
  * Factory of client method for the client-side API variant where TT is ignored and thus
5
5
  * clients don't have a binded TT for the track method.
6
6
  */
7
- export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitKey) => IClientWithKey;
7
+ export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitIO.SplitKey) => SplitIO.ICsClient;
@@ -1,8 +1,8 @@
1
- import { IClientWithKeyLegacy, SplitKey } from '../types';
1
+ import { SplitIO } from '../types';
2
2
  import { ISdkFactoryContext } from '../sdkFactory/types';
3
3
  /**
4
4
  * Factory of client method for the client-side (browser) variant of the Isomorphic JS SDK,
5
5
  * where clients can have a binded TT for the track method, which is provided via the settings
6
6
  * (default client) or the client method (shared clients).
7
7
  */
8
- export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitKey, trafficType?: string) => IClientWithKeyLegacy;
8
+ export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitIO.SplitKey, trafficType?: string) => SplitIO.ICsClient;
@@ -1,6 +1,6 @@
1
1
  import { ISdkFactoryParams } from './types';
2
- import { IBasicSDK } from '../types';
2
+ import { SplitIO } from '../types';
3
3
  /**
4
4
  * Modular SDK factory
5
5
  */
6
- export declare function sdkFactory(params: ISdkFactoryParams): IBasicSDK<any, any>;
6
+ export declare function sdkFactory(params: ISdkFactoryParams): SplitIO.ICsSDK | SplitIO.ISDK | SplitIO.IAsyncSDK;
@@ -1,13 +1,13 @@
1
1
  import { IIntegrationManager, IIntegrationFactoryParams } from '../integrations/types';
2
2
  import { ISignalListener } from '../listeners/types';
3
- import { IAsyncClientSS, IAsyncManager, IClientSS, IClientWithKey, ILogger, IManager, SplitKey } from '../types';
3
+ import { ILogger } from '../logger/types';
4
4
  import { IReadinessManager, ISdkReadinessManager } from '../readiness/types';
5
5
  import { IFetch, ISplitApi, IEventSourceConstructor } from '../services/types';
6
6
  import { IStorageAsync, IStorageSync, ISplitsCacheSync, ISplitsCacheAsync, IStorageFactoryParams } from '../storages/types';
7
7
  import { ISyncManager } from '../sync/types';
8
8
  import { IImpressionObserver } from '../trackers/impressionObserver/types';
9
9
  import { IImpressionsTracker, IEventTracker, ITelemetryTracker } from '../trackers/types';
10
- import { ISettings, IEventEmitter } from '../types';
10
+ import { SplitIO, ISettings, IEventEmitter } from '../types';
11
11
  /**
12
12
  * Environment related dependencies.
13
13
  */
@@ -65,11 +65,11 @@ export interface ISdkFactoryParams {
65
65
  storageFactory: (params: IStorageFactoryParams) => IStorageSync | IStorageAsync;
66
66
  splitApiFactory?: (settings: ISettings, platform: IPlatform, telemetryTracker: ITelemetryTracker) => ISplitApi;
67
67
  syncManagerFactory?: (params: ISdkFactoryContextSync) => ISyncManager;
68
- sdkManagerFactory: (log: ILogger, splits: ISplitsCacheSync | ISplitsCacheAsync, sdkReadinessManager: ISdkReadinessManager) => IManager | IAsyncManager;
68
+ sdkManagerFactory: (log: ILogger, splits: ISplitsCacheSync | ISplitsCacheAsync, sdkReadinessManager: ISdkReadinessManager) => SplitIO.IManager | SplitIO.IAsyncManager;
69
69
  sdkClientMethodFactory: (params: ISdkFactoryContext) => ({
70
- (): IClientWithKey;
71
- (key: SplitKey, trafficType?: string | undefined): IClientWithKey;
72
- } | (() => IClientSS) | (() => IAsyncClientSS));
70
+ (): SplitIO.ICsClient;
71
+ (key: SplitIO.SplitKey, trafficType?: string | undefined): SplitIO.ICsClient;
72
+ } | (() => SplitIO.IClient) | (() => SplitIO.IAsyncClient));
73
73
  SignalListener?: new (syncManager: ISyncManager | undefined, // Used by NodeSignalListener to flush data, and by BrowserSignalListener to close streaming connection.
74
74
  settings: ISettings, // Used by BrowserSignalListener
75
75
  storage: IStorageSync | IStorageAsync, // Used by BrowserSignalListener
@@ -1,5 +1,5 @@
1
1
  import { ISplitsCacheAsync, ISplitsCacheSync } from '../storages/types';
2
2
  import { ISdkReadinessManager } from '../readiness/types';
3
- import { IAsyncManager, IManager } from '../types';
4
- import { ILogger } from '../types';
5
- export declare function sdkManagerFactory<TSplitCache extends ISplitsCacheSync | ISplitsCacheAsync>(log: ILogger, splits: TSplitCache, { readinessManager, sdkStatus }: ISdkReadinessManager): TSplitCache extends ISplitsCacheAsync ? IAsyncManager : IManager;
3
+ import { SplitIO } from '../types';
4
+ import { ILogger } from '../logger/types';
5
+ export declare function sdkManagerFactory<TSplitCache extends ISplitsCacheSync | ISplitsCacheAsync>(log: ILogger, splits: TSplitCache, { readinessManager, sdkStatus }: ISdkReadinessManager): TSplitCache extends ISplitsCacheAsync ? SplitIO.IAsyncManager : SplitIO.IManager;
@@ -1,17 +1,18 @@
1
1
  import { ISplitsCacheAsync } from './types';
2
+ import { ISplit } from '../dtos/types';
2
3
  /**
3
4
  * This class provides a skeletal implementation of the ISplitsCacheAsync interface
4
5
  * to minimize the effort required to implement this interface.
5
6
  */
6
7
  export declare abstract class AbstractSplitsCacheAsync implements ISplitsCacheAsync {
7
- abstract addSplit(name: string, split: string): Promise<boolean>;
8
- abstract addSplits(entries: [string, string][]): Promise<boolean[] | void>;
8
+ abstract addSplit(name: string, split: ISplit): Promise<boolean>;
9
+ abstract addSplits(entries: [string, ISplit][]): Promise<boolean[] | void>;
9
10
  abstract removeSplits(names: string[]): Promise<boolean[] | void>;
10
- abstract getSplit(name: string): Promise<string | null>;
11
- abstract getSplits(names: string[]): Promise<Record<string, string | null>>;
11
+ abstract getSplit(name: string): Promise<ISplit | null>;
12
+ abstract getSplits(names: string[]): Promise<Record<string, ISplit | null>>;
12
13
  abstract setChangeNumber(changeNumber: number): Promise<boolean | void>;
13
14
  abstract getChangeNumber(): Promise<number>;
14
- abstract getAll(): Promise<string[]>;
15
+ abstract getAll(): Promise<ISplit[]>;
15
16
  abstract getSplitNames(): Promise<string[]>;
16
17
  abstract trafficTypeExists(trafficType: string): Promise<boolean>;
17
18
  abstract clear(): Promise<boolean | void>;
@@ -5,15 +5,15 @@ import { ISplit } from '../dtos/types';
5
5
  * to minimize the effort required to implement this interface.
6
6
  */
7
7
  export declare abstract class AbstractSplitsCacheSync implements ISplitsCacheSync {
8
- abstract addSplit(name: string, split: string): boolean;
9
- addSplits(entries: [string, string][]): boolean[];
8
+ abstract addSplit(name: string, split: ISplit): boolean;
9
+ addSplits(entries: [string, ISplit][]): boolean[];
10
10
  abstract removeSplit(name: string): boolean;
11
11
  removeSplits(names: string[]): boolean[];
12
- abstract getSplit(name: string): string | null;
13
- getSplits(names: string[]): Record<string, string | null>;
12
+ abstract getSplit(name: string): ISplit | null;
13
+ getSplits(names: string[]): Record<string, ISplit | null>;
14
14
  abstract setChangeNumber(changeNumber: number): boolean;
15
15
  abstract getChangeNumber(): number;
16
- getAll(): string[];
16
+ getAll(): ISplit[];
17
17
  abstract getSplitNames(): string[];
18
18
  abstract trafficTypeExists(trafficType: string): boolean;
19
19
  abstract usesSegments(): boolean;
@@ -1,4 +1,4 @@
1
- import { PreloadedData } from './types';
1
+ import { SplitIO } from '../types';
2
2
  import { DataLoader } from './types';
3
3
  /**
4
4
  * Factory of client-side storage loader
@@ -7,4 +7,4 @@ import { DataLoader } from './types';
7
7
  * and extended with a `mySegmentsData` property.
8
8
  * @returns function to preload the storage
9
9
  */
10
- export declare function dataLoaderFactory(preloadedData: PreloadedData): DataLoader;
10
+ export declare function dataLoaderFactory(preloadedData: SplitIO.PreloadedData): DataLoader;
@@ -1,4 +1,4 @@
1
- import { ILogger } from '../../types';
1
+ import { ILogger } from '../../logger/types';
2
2
  import { AbstractSegmentsCacheSync } from '../AbstractSegmentsCacheSync';
3
3
  import { KeyBuilderCS } from '../KeyBuilderCS';
4
4
  export declare class MySegmentsCacheInLocal extends AbstractSegmentsCacheSync {
@@ -1,6 +1,7 @@
1
+ import { ISplit, ISplitFiltersValidation } from '../../dtos/types';
1
2
  import { AbstractSplitsCacheSync } from '../AbstractSplitsCacheSync';
2
3
  import { KeyBuilderCS } from '../KeyBuilderCS';
3
- import { ILogger, ISplitFiltersValidation } from '../../types';
4
+ import { ILogger } from '../../logger/types';
4
5
  /**
5
6
  * ISplitsCacheSync implementation that stores split definitions in browser LocalStorage.
6
7
  */
@@ -25,9 +26,9 @@ export declare class SplitsCacheInLocal extends AbstractSplitsCacheSync {
25
26
  * We cannot simply call `localStorage.clear()` since that implies removing user items from the storage.
26
27
  */
27
28
  clear(): void;
28
- addSplit(name: string, split: string): boolean;
29
+ addSplit(name: string, split: ISplit): boolean;
29
30
  removeSplit(name: string): boolean;
30
- getSplit(name: string): string | null;
31
+ getSplit(name: string): any;
31
32
  setChangeNumber(changeNumber: number): boolean;
32
33
  getChangeNumber(): number;
33
34
  getSplitNames(): string[];
@@ -1,8 +1,8 @@
1
- import { StorageSyncFactory } from '../../types';
1
+ import { IStorageSyncFactory } from '../types';
2
2
  export interface InLocalStorageOptions {
3
3
  prefix?: string;
4
4
  }
5
5
  /**
6
6
  * InLocal storage factory for standalone client-side SplitFactory
7
7
  */
8
- export declare function InLocalStorage(options?: InLocalStorageOptions): StorageSyncFactory;
8
+ export declare function InLocalStorage(options?: InLocalStorageOptions): IStorageSyncFactory;
@@ -1,4 +1,4 @@
1
- import { EventData } from '../../types';
1
+ import { SplitIO } from '../../types';
2
2
  import { IEventsCacheSync } from '../types';
3
3
  export declare class EventsCacheInMemory implements IEventsCacheSync {
4
4
  private onFullQueue?;
@@ -15,7 +15,7 @@ export declare class EventsCacheInMemory implements IEventsCacheSync {
15
15
  /**
16
16
  * Add a new event object at the end of the queue.
17
17
  */
18
- track(data: EventData, size?: number): boolean;
18
+ track(data: SplitIO.EventData, size?: number): boolean;
19
19
  /**
20
20
  * Clear the data stored on the cache.
21
21
  */
@@ -23,7 +23,7 @@ export declare class EventsCacheInMemory implements IEventsCacheSync {
23
23
  /**
24
24
  * Pop the collected data, used as payload for posting.
25
25
  */
26
- pop(toMerge?: EventData[]): EventData[];
26
+ pop(toMerge?: SplitIO.EventData[]): SplitIO.EventData[];
27
27
  /**
28
28
  * Check if the cache is empty.
29
29
  */
@@ -6,5 +6,5 @@ import { IStorageFactoryParams, IStorageSync } from '../types';
6
6
  */
7
7
  export declare function InMemoryStorageFactory(params: IStorageFactoryParams): IStorageSync;
8
8
  export declare namespace InMemoryStorageFactory {
9
- var type: import("../../types").StorageType;
9
+ var type: import("../types").StorageType;
10
10
  }
@@ -6,5 +6,5 @@ import { IStorageSync, IStorageFactoryParams } from '../types';
6
6
  */
7
7
  export declare function InMemoryStorageCSFactory(params: IStorageFactoryParams): IStorageSync;
8
8
  export declare namespace InMemoryStorageCSFactory {
9
- var type: import("../../types").StorageType;
9
+ var type: import("../types").StorageType;
10
10
  }
@@ -1,3 +1,4 @@
1
+ import { ISplit } from '../../dtos/types';
1
2
  import { AbstractSplitsCacheSync } from '../AbstractSplitsCacheSync';
2
3
  /**
3
4
  * Default ISplitsCacheSync implementation that stores split definitions in memory.
@@ -9,9 +10,9 @@ export declare class SplitsCacheInMemory extends AbstractSplitsCacheSync {
9
10
  private changeNumber;
10
11
  private splitsWithSegmentsCount;
11
12
  clear(): void;
12
- addSplit(name: string, split: string): boolean;
13
+ addSplit(name: string, split: ISplit): boolean;
13
14
  removeSplit(name: string): boolean;
14
- getSplit(name: string): string | null;
15
+ getSplit(name: string): ISplit | null;
15
16
  setChangeNumber(changeNumber: number): boolean;
16
17
  getChangeNumber(): number;
17
18
  getSplitNames(): string[];
@@ -1,8 +1,8 @@
1
1
  import { IEventsCacheAsync } from '../types';
2
2
  import { IMetadata } from '../../dtos/types';
3
3
  import { Redis } from 'ioredis';
4
- import { EventData } from '../../types';
5
- import { ILogger } from '../../types';
4
+ import { SplitIO } from '../../types';
5
+ import { ILogger } from '../../logger/types';
6
6
  import { StoredEventWithMetadata } from '../../sync/submitters/types';
7
7
  export declare class EventsCacheInRedis implements IEventsCacheAsync {
8
8
  private readonly log;
@@ -14,7 +14,7 @@ export declare class EventsCacheInRedis implements IEventsCacheAsync {
14
14
  * Add a new event object into the queue.
15
15
  * Unlike `impressions::track`, result promise is never rejected.
16
16
  */
17
- track(eventData: EventData): Promise<boolean>;
17
+ track(eventData: SplitIO.EventData): Promise<boolean>;
18
18
  /**
19
19
  * Generates the JSON as we'll store it on Redis.
20
20
  */
@@ -3,7 +3,7 @@ import { IMetadata } from '../../dtos/types';
3
3
  import { ImpressionDTO } from '../../types';
4
4
  import { Redis } from 'ioredis';
5
5
  import { StoredImpressionWithMetadata } from '../../sync/submitters/types';
6
- import { ILogger } from '../../types';
6
+ import { ILogger } from '../../logger/types';
7
7
  export declare class ImpressionsCacheInRedis implements IImpressionsCacheAsync {
8
8
  private readonly log;
9
9
  private readonly key;
@@ -1,5 +1,5 @@
1
1
  import ioredis from 'ioredis';
2
- import { ILogger } from '../../types';
2
+ import { ILogger } from '../../logger/types';
3
3
  /**
4
4
  * Redis adapter on top of the library of choice (written with ioredis) for some extra control.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { Redis } from 'ioredis';
2
- import { ILogger } from '../../types';
2
+ import { ILogger } from '../../logger/types';
3
3
  import { KeyBuilderSS } from '../KeyBuilderSS';
4
4
  import { ISegmentsCacheAsync } from '../types';
5
5
  export declare class SegmentsCacheInRedis implements ISegmentsCacheAsync {