@splitsoftware/splitio-commons 0.1.1-canary.9 → 0.1.1-rc.18

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 (254) hide show
  1. package/cjs/evaluator/matchers/matcherTypes.js +4 -4
  2. package/cjs/evaluator/matchersTransform/index.js +11 -11
  3. package/cjs/evaluator/value/sanitize.js +6 -6
  4. package/cjs/listeners/browser.js +1 -2
  5. package/cjs/listeners/node.js +0 -3
  6. package/cjs/logger/constants.js +3 -1
  7. package/cjs/logger/messages/error.js +3 -2
  8. package/cjs/logger/messages/info.js +2 -2
  9. package/cjs/logger/messages/warn.js +2 -1
  10. package/cjs/readiness/readinessManager.js +10 -7
  11. package/cjs/sdkFactory/index.js +1 -4
  12. package/cjs/services/splitApi.js +1 -1
  13. package/cjs/services/splitHttpClient.js +5 -4
  14. package/cjs/storages/AbstractSplitsCacheSync.js +1 -1
  15. package/cjs/storages/inLocalStorage/index.js +5 -2
  16. package/cjs/storages/inMemory/InMemoryStorage.js +2 -0
  17. package/cjs/storages/inMemory/InMemoryStorageCS.js +2 -0
  18. package/cjs/storages/inRedis/SplitsCacheInRedis.js +6 -2
  19. package/cjs/storages/inRedis/index.js +5 -2
  20. package/cjs/storages/pluggable/SplitsCachePluggable.js +6 -2
  21. package/cjs/storages/pluggable/inMemoryWrapper.js +6 -7
  22. package/cjs/storages/pluggable/index.js +5 -2
  23. package/cjs/storages/pluggable/wrapperAdapter.js +0 -1
  24. package/cjs/sync/offline/splitsParser/splitsParserFromFile.js +92 -89
  25. package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +45 -42
  26. package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +14 -4
  27. package/cjs/sync/polling/updaters/mySegmentsUpdater.js +30 -10
  28. package/cjs/sync/streaming/SSEClient/index.js +0 -11
  29. package/cjs/sync/streaming/SSEHandler/NotificationKeeper.js +7 -0
  30. package/cjs/sync/streaming/SSEHandler/NotificationParser.js +4 -1
  31. package/cjs/sync/streaming/SSEHandler/index.js +8 -9
  32. package/cjs/sync/streaming/SSEHandler/types.js +14 -0
  33. package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +5 -5
  34. package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -1
  35. package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +5 -3
  36. package/cjs/sync/streaming/constants.js +3 -1
  37. package/cjs/sync/streaming/mySegmentsV2utils.js +75 -0
  38. package/cjs/sync/streaming/pushManager.js +141 -40
  39. package/cjs/sync/submitters/metricsSyncTask.js +1 -1
  40. package/cjs/sync/submitters/submitterSyncTask.js +2 -2
  41. package/cjs/sync/syncManagerFromFile.js +15 -0
  42. package/cjs/sync/syncManagerFromObject.js +14 -0
  43. package/cjs/sync/syncManagerOffline.js +3 -3
  44. package/cjs/sync/syncManagerOnline.js +5 -3
  45. package/cjs/trackers/impressionObserver/ImpressionObserver.js +0 -2
  46. package/cjs/trackers/impressionObserver/buildKey.js +3 -9
  47. package/cjs/trackers/impressionObserver/impressionObserverCS.js +2 -2
  48. package/cjs/trackers/impressionObserver/impressionObserverSS.js +3 -3
  49. package/cjs/utils/constants/index.js +4 -1
  50. package/cjs/utils/decompress/index.js +427 -0
  51. package/cjs/utils/murmur3/{commons.js → common.js} +2 -6
  52. package/cjs/utils/murmur3/murmur3.js +11 -12
  53. package/cjs/utils/murmur3/murmur3_128.js +7 -142
  54. package/cjs/utils/murmur3/murmur3_128_x86.js +154 -0
  55. package/cjs/utils/murmur3/murmur3_64.js +36 -0
  56. package/cjs/utils/murmur3/utfx.js +100 -106
  57. package/cjs/utils/promise/wrapper.js +14 -11
  58. package/cjs/utils/settingsValidation/index.js +5 -2
  59. package/cjs/utils/settingsValidation/localhost/index.js +20 -0
  60. package/cjs/utils/settingsValidation/splitFilters.js +0 -1
  61. package/cjs/utils/settingsValidation/storage/storageCS.js +18 -8
  62. package/cjs/utils/settingsValidation/url.js +1 -1
  63. package/esm/evaluator/matchers/matcherTypes.js +2 -2
  64. package/esm/evaluator/matchersTransform/index.js +12 -12
  65. package/esm/evaluator/value/sanitize.js +7 -7
  66. package/esm/listeners/browser.js +1 -2
  67. package/esm/listeners/node.js +0 -3
  68. package/esm/logger/constants.js +2 -0
  69. package/esm/logger/messages/error.js +3 -2
  70. package/esm/logger/messages/info.js +2 -2
  71. package/esm/logger/messages/warn.js +2 -1
  72. package/esm/readiness/readinessManager.js +10 -7
  73. package/esm/sdkFactory/index.js +1 -4
  74. package/esm/services/splitApi.js +1 -1
  75. package/esm/services/splitHttpClient.js +5 -4
  76. package/esm/storages/AbstractSplitsCacheSync.js +1 -1
  77. package/esm/storages/inLocalStorage/index.js +5 -2
  78. package/esm/storages/inMemory/InMemoryStorage.js +2 -0
  79. package/esm/storages/inMemory/InMemoryStorageCS.js +2 -0
  80. package/esm/storages/inRedis/SplitsCacheInRedis.js +6 -2
  81. package/esm/storages/inRedis/index.js +5 -2
  82. package/esm/storages/pluggable/SplitsCachePluggable.js +6 -2
  83. package/esm/storages/pluggable/inMemoryWrapper.js +6 -7
  84. package/esm/storages/pluggable/index.js +5 -2
  85. package/esm/storages/pluggable/wrapperAdapter.js +0 -1
  86. package/esm/sync/offline/splitsParser/splitsParserFromFile.js +90 -88
  87. package/esm/sync/offline/splitsParser/splitsParserFromSettings.js +43 -41
  88. package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +15 -5
  89. package/esm/sync/polling/updaters/mySegmentsUpdater.js +30 -10
  90. package/esm/sync/streaming/SSEClient/index.js +0 -11
  91. package/esm/sync/streaming/SSEHandler/NotificationKeeper.js +7 -0
  92. package/esm/sync/streaming/SSEHandler/NotificationParser.js +4 -1
  93. package/esm/sync/streaming/SSEHandler/index.js +9 -10
  94. package/esm/sync/streaming/SSEHandler/types.js +13 -1
  95. package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +5 -5
  96. package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -1
  97. package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +5 -3
  98. package/esm/sync/streaming/constants.js +2 -0
  99. package/esm/sync/streaming/mySegmentsV2utils.js +69 -0
  100. package/esm/sync/streaming/pushManager.js +143 -42
  101. package/esm/sync/submitters/metricsSyncTask.js +1 -1
  102. package/esm/sync/submitters/submitterSyncTask.js +2 -2
  103. package/esm/sync/syncManagerFromFile.js +11 -0
  104. package/esm/sync/syncManagerFromObject.js +10 -0
  105. package/esm/sync/syncManagerOffline.js +3 -3
  106. package/esm/sync/syncManagerOnline.js +5 -3
  107. package/esm/trackers/impressionObserver/ImpressionObserver.js +0 -2
  108. package/esm/trackers/impressionObserver/buildKey.js +2 -9
  109. package/esm/trackers/impressionObserver/impressionObserverCS.js +2 -2
  110. package/esm/trackers/impressionObserver/impressionObserverSS.js +3 -3
  111. package/esm/utils/constants/index.js +3 -0
  112. package/esm/utils/decompress/index.js +424 -0
  113. package/esm/utils/murmur3/{commons.js → common.js} +1 -4
  114. package/esm/utils/murmur3/murmur3.js +1 -2
  115. package/esm/utils/murmur3/murmur3_128.js +7 -142
  116. package/esm/utils/murmur3/murmur3_128_x86.js +150 -0
  117. package/esm/utils/murmur3/murmur3_64.js +32 -0
  118. package/esm/utils/murmur3/utfx.js +96 -106
  119. package/esm/utils/promise/wrapper.js +14 -11
  120. package/esm/utils/settingsValidation/index.js +5 -2
  121. package/esm/utils/settingsValidation/localhost/index.js +16 -0
  122. package/esm/utils/settingsValidation/splitFilters.js +0 -1
  123. package/esm/utils/settingsValidation/storage/storageCS.js +16 -7
  124. package/esm/utils/settingsValidation/url.js +1 -1
  125. package/package.json +5 -5
  126. package/src/evaluator/matchers/matcherTypes.ts +2 -2
  127. package/src/evaluator/matchersTransform/index.ts +12 -12
  128. package/src/evaluator/value/sanitize.ts +7 -7
  129. package/src/listeners/browser.ts +1 -1
  130. package/src/listeners/node.ts +1 -2
  131. package/src/logger/constants.ts +2 -0
  132. package/src/logger/messages/error.ts +3 -2
  133. package/src/logger/messages/info.ts +2 -2
  134. package/src/logger/messages/warn.ts +3 -1
  135. package/src/readiness/readinessManager.ts +9 -7
  136. package/src/sdkFactory/index.ts +1 -3
  137. package/src/sdkFactory/types.ts +3 -3
  138. package/src/services/splitApi.ts +2 -3
  139. package/src/services/splitHttpClient.ts +6 -5
  140. package/src/services/types.ts +5 -5
  141. package/src/storages/AbstractSplitsCacheSync.ts +1 -1
  142. package/src/storages/inLocalStorage/index.ts +8 -4
  143. package/src/storages/inMemory/InMemoryStorage.ts +3 -0
  144. package/src/storages/inMemory/InMemoryStorageCS.ts +3 -0
  145. package/src/storages/inRedis/SplitsCacheInRedis.ts +3 -1
  146. package/src/storages/inRedis/index.ts +8 -4
  147. package/src/storages/pluggable/SplitsCachePluggable.ts +3 -1
  148. package/src/storages/pluggable/inMemoryWrapper.ts +6 -7
  149. package/src/storages/pluggable/index.ts +8 -4
  150. package/src/storages/pluggable/wrapperAdapter.ts +0 -1
  151. package/src/storages/types.ts +18 -15
  152. package/src/sync/offline/splitsParser/splitsParserFromFile.ts +110 -105
  153. package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +45 -41
  154. package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +15 -5
  155. package/src/sync/polling/types.ts +2 -1
  156. package/src/sync/polling/updaters/mySegmentsUpdater.ts +28 -10
  157. package/src/sync/streaming/AuthClient/types.ts +3 -0
  158. package/src/sync/streaming/SSEClient/index.ts +1 -15
  159. package/src/sync/streaming/SSEClient/types.ts +0 -1
  160. package/src/sync/streaming/SSEHandler/NotificationKeeper.ts +8 -0
  161. package/src/sync/streaming/SSEHandler/NotificationParser.ts +4 -2
  162. package/src/sync/streaming/SSEHandler/index.ts +11 -20
  163. package/src/sync/streaming/SSEHandler/types.ts +37 -3
  164. package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +7 -6
  165. package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +2 -1
  166. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +4 -3
  167. package/src/sync/streaming/UpdateWorkers/types.ts +1 -1
  168. package/src/sync/streaming/constants.ts +2 -0
  169. package/src/sync/streaming/mySegmentsV2utils.ts +77 -0
  170. package/src/sync/streaming/pushManager.ts +139 -42
  171. package/src/sync/streaming/types.ts +14 -22
  172. package/src/sync/submitters/metricsSyncTask.ts +1 -1
  173. package/src/sync/submitters/submitterSyncTask.ts +2 -1
  174. package/src/sync/syncManagerFromFile.ts +13 -0
  175. package/src/sync/syncManagerFromObject.ts +12 -0
  176. package/src/sync/syncManagerOffline.ts +3 -3
  177. package/src/sync/syncManagerOnline.ts +6 -3
  178. package/src/trackers/impressionObserver/ImpressionObserver.ts +4 -6
  179. package/src/trackers/impressionObserver/buildKey.ts +2 -16
  180. package/src/trackers/impressionObserver/impressionObserverCS.ts +2 -2
  181. package/src/trackers/impressionObserver/impressionObserverSS.ts +3 -3
  182. package/src/types.ts +16 -2
  183. package/src/utils/constants/index.ts +6 -1
  184. package/src/utils/decompress/index.ts +429 -0
  185. package/src/utils/murmur3/{commons.ts → common.ts} +1 -5
  186. package/src/utils/murmur3/murmur3.ts +5 -5
  187. package/src/utils/murmur3/murmur3_128.ts +7 -180
  188. package/src/utils/murmur3/murmur3_128_x86.ts +188 -0
  189. package/src/utils/murmur3/murmur3_64.ts +36 -0
  190. package/src/utils/murmur3/utfx.ts +92 -110
  191. package/src/utils/promise/wrapper.ts +12 -9
  192. package/src/utils/settingsValidation/index.ts +8 -4
  193. package/src/utils/settingsValidation/localhost/index.ts +19 -0
  194. package/src/utils/settingsValidation/splitFilters.ts +0 -1
  195. package/src/utils/settingsValidation/storage/storageCS.ts +21 -8
  196. package/src/utils/settingsValidation/types.ts +2 -11
  197. package/src/utils/settingsValidation/url.ts +1 -1
  198. package/types/evaluator/matchers/matcherTypes.d.ts +2 -2
  199. package/types/listeners/browser.d.ts +1 -0
  200. package/types/listeners/node.d.ts +0 -1
  201. package/types/logger/constants.d.ts +2 -0
  202. package/types/sdkFactory/types.d.ts +3 -3
  203. package/types/services/types.d.ts +1 -0
  204. package/types/storages/inLocalStorage/index.d.ts +2 -2
  205. package/types/storages/inMemory/InMemoryStorage.d.ts +3 -0
  206. package/types/storages/inMemory/InMemoryStorageCS.d.ts +3 -0
  207. package/types/storages/inRedis/index.d.ts +2 -2
  208. package/types/storages/pluggable/index.d.ts +2 -2
  209. package/types/storages/types.d.ts +15 -15
  210. package/types/sync/offline/splitsParser/splitsParserFromFile.d.ts +2 -7
  211. package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +1 -5
  212. package/types/sync/polling/types.d.ts +2 -1
  213. package/types/sync/streaming/AuthClient/indexV1.d.ts +12 -0
  214. package/types/sync/streaming/AuthClient/indexV2.d.ts +8 -0
  215. package/types/sync/streaming/AuthClient/types.d.ts +2 -0
  216. package/types/sync/streaming/SSEClient/index.d.ts +1 -9
  217. package/types/sync/streaming/SSEClient/types.d.ts +0 -1
  218. package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +3 -2
  219. package/types/sync/streaming/SSEHandler/types.d.ts +30 -2
  220. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +4 -3
  221. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +2 -1
  222. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +3 -2
  223. package/types/sync/streaming/UpdateWorkers/types.d.ts +1 -1
  224. package/types/sync/streaming/constants.d.ts +3 -1
  225. package/types/sync/streaming/mySegmentsV2utils.d.ts +27 -0
  226. package/types/sync/streaming/pushManagerNoUsers.d.ts +13 -0
  227. package/types/sync/streaming/types.d.ts +9 -5
  228. package/types/sync/submitters/submitterSyncTask.d.ts +1 -1
  229. package/types/sync/syncManagerFromFile.d.ts +2 -0
  230. package/types/sync/syncManagerFromObject.d.ts +2 -0
  231. package/types/sync/syncManagerOffline.d.ts +1 -1
  232. package/types/trackers/impressionObserver/ImpressionObserver.d.ts +2 -2
  233. package/types/trackers/impressionObserver/buildKey.d.ts +1 -1
  234. package/types/trackers/impressionObserver/impressionObserverCS.d.ts +2 -2
  235. package/types/trackers/impressionObserver/impressionObserverSS.d.ts +2 -2
  236. package/types/types.d.ts +16 -2
  237. package/types/utils/constants/index.d.ts +5 -1
  238. package/types/utils/decompress/index.d.ts +16 -0
  239. package/types/utils/murmur3/common.d.ts +12 -0
  240. package/types/utils/murmur3/murmur3.d.ts +2 -2
  241. package/types/utils/murmur3/murmur3_128.d.ts +5 -0
  242. package/types/utils/murmur3/murmur3_128_x86.d.ts +7 -0
  243. package/types/utils/murmur3/murmur3_64.d.ts +10 -0
  244. package/types/utils/murmur3/utfx.d.ts +24 -6
  245. package/types/utils/settingsValidation/index.d.ts +3 -2
  246. package/types/utils/settingsValidation/localhost/index.d.ts +9 -0
  247. package/types/utils/settingsValidation/storage/storageCS.d.ts +7 -1
  248. package/types/utils/settingsValidation/types.d.ts +2 -10
  249. package/cjs/sync/streaming/pushManagerCS.js +0 -179
  250. package/cjs/sync/streaming/pushManagerSS.js +0 -128
  251. package/esm/sync/streaming/pushManagerCS.js +0 -175
  252. package/esm/sync/streaming/pushManagerSS.js +0 -124
  253. package/src/sync/streaming/pushManagerCS.ts +0 -238
  254. package/src/sync/streaming/pushManagerSS.ts +0 -177
@@ -91,6 +91,7 @@ export declare const WARN_SPLITS_FILTER_INVALID = 220;
91
91
  export declare const WARN_SPLITS_FILTER_EMPTY = 221;
92
92
  export declare const WARN_STORAGE_INVALID = 222;
93
93
  export declare const WARN_API_KEY = 223;
94
+ export declare const STREAMING_PARSING_MY_SEGMENTS_UPDATE_V2 = 224;
94
95
  export declare const ERROR_ENGINE_COMBINER_IFELSEIF = 300;
95
96
  export declare const ERROR_LOGLEVEL_INVALID = 301;
96
97
  export declare const ERROR_CLIENT_LISTENER = 302;
@@ -114,6 +115,7 @@ export declare const ERROR_EMPTY = 319;
114
115
  export declare const ERROR_EMPTY_ARRAY = 320;
115
116
  export declare const ERROR_INVALID_IMPRESSIONS_MODE = 321;
116
117
  export declare const ERROR_HTTP = 322;
118
+ export declare const ERROR_LOCALHOST_MODULE_REQUIRED = 323;
117
119
  export declare const LOG_PREFIX_SETTINGS = "settings";
118
120
  export declare const LOG_PREFIX_INSTANTIATION = "Factory instantiation";
119
121
  export declare const LOG_PREFIX_ENGINE = "engine";
@@ -8,9 +8,9 @@ import { IStorageAsync, IStorageSync, ISplitsCacheSync, ISplitsCacheAsync, IStor
8
8
  import { ISyncManager, ISyncManagerFactoryParams } from '../sync/types';
9
9
  import { IImpressionObserver } from '../trackers/impressionObserver/types';
10
10
  import { SplitIO, ISettings, IEventEmitter } from '../types';
11
- import { ISettingsInternal } from '../utils/settingsValidation/types';
12
11
  /**
13
- * Environment related dependencies
12
+ * Environment related dependencies.
13
+ * These getters are called a fixed number of times per factory instantiation.
14
14
  */
15
15
  export interface IPlatform {
16
16
  getOptions?: () => object;
@@ -22,7 +22,7 @@ export interface IPlatform {
22
22
  * Object parameter with the modules required to create an SDK factory instance
23
23
  */
24
24
  export interface ISdkFactoryParams {
25
- settings: ISettingsInternal;
25
+ settings: ISettings;
26
26
  platform: IPlatform;
27
27
  storageFactory: (params: IStorageFactoryParams) => IStorageSync | IStorageAsync;
28
28
  splitApiFactory?: (settings: ISettings, platform: IPlatform) => ISplitApi;
@@ -7,6 +7,7 @@ export declare type IResponse = {
7
7
  ok: boolean;
8
8
  status: number;
9
9
  json: () => Promise<any>;
10
+ text: () => Promise<string>;
10
11
  };
11
12
  export declare type IFetch = (url: string, options?: IRequestOptions) => Promise<IResponse>;
12
13
  export declare type IHealthCheckAPI = () => Promise<boolean>;
@@ -1,8 +1,8 @@
1
- import { IStorageFactoryParams, IStorageSyncCS } 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): (params: IStorageFactoryParams) => IStorageSyncCS;
8
+ export declare function InLocalStorage(options?: InLocalStorageOptions): IStorageSyncFactory;
@@ -5,3 +5,6 @@ import { IStorageFactoryParams, IStorageSync } from '../types';
5
5
  * @param params parameters required by EventsCacheSync
6
6
  */
7
7
  export declare function InMemoryStorageFactory(params: IStorageFactoryParams): IStorageSync;
8
+ export declare namespace InMemoryStorageFactory {
9
+ var type: import("../types").StorageType;
10
+ }
@@ -5,3 +5,6 @@ import { IStorageSyncCS, IStorageFactoryParams } from '../types';
5
5
  * @param params parameters required by EventsCacheSync
6
6
  */
7
7
  export declare function InMemoryStorageCSFactory(params: IStorageFactoryParams): IStorageSyncCS;
8
+ export declare namespace InMemoryStorageCSFactory {
9
+ var type: import("../types").StorageType;
10
+ }
@@ -1,4 +1,4 @@
1
- import { IStorageAsync, IStorageFactoryParams } from '../types';
1
+ import { IStorageAsyncFactory } from '../types';
2
2
  export interface InRedisStorageOptions {
3
3
  prefix?: string;
4
4
  options?: Record<string, any>;
@@ -7,4 +7,4 @@ export interface InRedisStorageOptions {
7
7
  * InRedis storage factory for consumer server-side SplitFactory, that uses `Ioredis` Redis client for Node.
8
8
  * @see {@link https://www.npmjs.com/package/ioredis}
9
9
  */
10
- export declare function InRedisStorage(options?: InRedisStorageOptions): ({ log, metadata, onReadyCb }: IStorageFactoryParams) => IStorageAsync;
10
+ export declare function InRedisStorage(options?: InRedisStorageOptions): IStorageAsyncFactory;
@@ -1,4 +1,4 @@
1
- import { ICustomStorageWrapper, IStorageAsync, IStorageFactoryParams } from '../types';
1
+ import { ICustomStorageWrapper, IStorageAsyncFactory } from '../types';
2
2
  export interface PluggableStorageOptions {
3
3
  prefix?: string;
4
4
  wrapper: ICustomStorageWrapper;
@@ -6,4 +6,4 @@ export interface PluggableStorageOptions {
6
6
  /**
7
7
  * Pluggable storage factory for consumer server-side & client-side SplitFactory.
8
8
  */
9
- export declare function PluggableStorage(options: PluggableStorageOptions): ({ log, metadata, onReadyCb }: IStorageFactoryParams) => IStorageAsync;
9
+ export declare function PluggableStorage(options: PluggableStorageOptions): IStorageAsyncFactory;
@@ -54,15 +54,6 @@ export interface ICustomStorageWrapper {
54
54
  * The promise rejects if the operation fails.
55
55
  */
56
56
  getKeysByPrefix: (prefix: string) => Promise<string[]>;
57
- /**
58
- * Returns all values which keys match the given prefix.
59
- *
60
- * @function getByPrefix
61
- * @param {string} prefix String prefix to match
62
- * @returns {Promise<string[]>} A promise that resolves with the list of values which keys match the given `prefix`.
63
- * The promise rejects if the operation fails.
64
- */
65
- getByPrefix: (prefix: string) => Promise<string[]>;
66
57
  /**
67
58
  * Returns the values of all given `keys`.
68
59
  *
@@ -78,19 +69,19 @@ export interface ICustomStorageWrapper {
78
69
  *
79
70
  * @function incr
80
71
  * @param {string} key Key to increment
81
- * @returns {Promise<void>} A promise that resolves if the operation success. The promise rejects if the operation fails,
72
+ * @returns {Promise<number>} A promise that resolves with the value of key after the increment. The promise rejects if the operation fails,
82
73
  * for example, if there is a connection error or the key contains a string that can not be represented as integer.
83
74
  */
84
- incr: (key: string) => Promise<void | boolean>;
75
+ incr: (key: string) => Promise<number>;
85
76
  /**
86
77
  * Decrements in 1 the given `key` value or set it in -1 if the value doesn't exist.
87
78
  *
88
79
  * @function decr
89
80
  * @param {string} key Key to decrement
90
- * @returns {Promise<void>} A promise that resolves if the operation success. The promise rejects if the operation fails,
81
+ * @returns {Promise<number>} A promise that resolves with the value of key after the decrement. The promise rejects if the operation fails,
91
82
  * for example, if there is a connection error or the key contains a string that can not be represented as integer.
92
83
  */
93
- decr: (key: string) => Promise<void | boolean>;
84
+ decr: (key: string) => Promise<number>;
94
85
  /** Queue operations */
95
86
  /**
96
87
  * Inserts given items at the tail of `key` list. If `key` does not exist, an empty list is created before pushing the items.
@@ -243,8 +234,8 @@ export interface ISegmentsCacheBase {
243
234
  clear(): MaybeThenable<boolean | void>;
244
235
  }
245
236
  export interface ISegmentsCacheSync extends ISegmentsCacheBase {
246
- addToSegment(name: string, segmentKeys: string[]): boolean;
247
- removeFromSegment(name: string, segmentKeys: string[]): boolean;
237
+ addToSegment(name: string, segmentKeys?: string[]): boolean;
238
+ removeFromSegment(name: string, segmentKeys?: string[]): boolean;
248
239
  isInSegment(name: string, key?: string): boolean;
249
240
  registerSegments(names: string[]): boolean;
250
241
  getRegisteredSegments(): string[];
@@ -353,3 +344,12 @@ export interface IStorageFactoryParams {
353
344
  onReadyCb?: (error?: any) => void;
354
345
  metadata: IMetadata;
355
346
  }
347
+ export declare type StorageType = 'MEMORY' | 'LOCALSTORAGE' | 'REDIS' | 'CUSTOM';
348
+ export declare type IStorageSyncFactory = {
349
+ type: StorageType;
350
+ (params: IStorageFactoryParams): IStorageSync;
351
+ };
352
+ export declare type IStorageAsyncFactory = {
353
+ type: StorageType;
354
+ (params: IStorageFactoryParams): IStorageAsync;
355
+ };
@@ -1,7 +1,2 @@
1
- import { ISplitPartial } from '../../../dtos/types';
2
- import { SplitIO } from '../../../types';
3
- import { ILogger } from '../../../logger/types';
4
- export default function splitsParserFromFile({ features, log }: {
5
- features?: SplitIO.MockedFeaturesFilePath;
6
- log: ILogger;
7
- }): false | Record<string, ISplitPartial>;
1
+ import { ISplitsParser } from './types';
2
+ export declare function splitsParserFromFileFactory(): ISplitsParser;
@@ -1,7 +1,3 @@
1
1
  import { ISplitPartial } from '../../../dtos/types';
2
2
  import { ISettings } from '../../../types';
3
- /**
4
- *
5
- * @param features validated object with mocked features mapping.
6
- */
7
- export default function splitsParserFromSettings(settings: ISettings): false | Record<string, ISplitPartial>;
3
+ export declare function splitsParserFromSettingsFactory(): (settings: ISettings) => false | Record<string, ISplitPartial>;
@@ -2,10 +2,11 @@ import { IReadinessManager } from '../../readiness/types';
2
2
  import { ISplitApi } from '../../services/types';
3
3
  import { IStorageSync } from '../../storages/types';
4
4
  import { ISettings } from '../../types';
5
+ import { SegmentsData } from '../streaming/SSEHandler/types';
5
6
  import { ITask, ISyncTask } from '../types';
6
7
  export interface ISplitsSyncTask extends ISyncTask<[noCache?: boolean], boolean> {
7
8
  }
8
- export interface ISegmentsSyncTask extends ISyncTask<[segmentNames?: string[], noCache?: boolean, fetchOnlyNew?: boolean], boolean> {
9
+ export interface ISegmentsSyncTask extends ISyncTask<[segmentNames?: SegmentsData, noCache?: boolean, fetchOnlyNew?: boolean], boolean> {
9
10
  }
10
11
  export interface IPollingManager extends ITask {
11
12
  syncAll(): Promise<any>;
@@ -0,0 +1,12 @@
1
+ import { IFetchAuth } from '../../../services/types';
2
+ import { IAuthenticate } from './types';
3
+ /**
4
+ * Factory of authentication function.
5
+ *
6
+ * @param fetchAuth `SplitAPI.fetchAuth` endpoint
7
+ */
8
+ export declare function authenticateFactory(fetchAuth: IFetchAuth): IAuthenticate;
9
+ /**
10
+ * Returns the hash of a given user key
11
+ */
12
+ export declare function hashUserKey(userKey: string): string;
@@ -0,0 +1,8 @@
1
+ import { IFetchAuthV2 } from '../../../services/types';
2
+ import { IAuthenticateV2 } from './types';
3
+ /**
4
+ * Factory of authentication function.
5
+ *
6
+ * @param fetchAuth `SplitAPI.fetchAuth` endpoint
7
+ */
8
+ export declare function authenticateFactory(fetchAuthV2: IFetchAuthV2): IAuthenticateV2;
@@ -6,6 +6,7 @@ export interface IAuthTokenPushEnabled {
6
6
  channels: {
7
7
  [channel: string]: string[];
8
8
  };
9
+ connDelay?: number;
9
10
  }
10
11
  export interface IAuthTokenPushDisabled {
11
12
  pushEnabled: false;
@@ -13,3 +14,4 @@ export interface IAuthTokenPushDisabled {
13
14
  }
14
15
  export declare type IAuthToken = IAuthTokenPushDisabled | IAuthTokenPushEnabled;
15
16
  export declare type IAuthenticate = (userKeys?: string[]) => Promise<IAuthToken>;
17
+ export declare type IAuthenticateV2 = (isClientSide?: boolean) => Promise<IAuthToken>;
@@ -9,7 +9,6 @@ export default class SSEClient implements ISSEClient {
9
9
  streamingUrl: string;
10
10
  connection?: InstanceType<typeof EventSource>;
11
11
  handler?: ISseEventHandler;
12
- authToken?: IAuthTokenPushEnabled;
13
12
  useHeaders?: boolean;
14
13
  headers: Record<string, string>;
15
14
  /**
@@ -20,7 +19,7 @@ export default class SSEClient implements ISSEClient {
20
19
  * @param getEventSource Function to get the EventSource constructor.
21
20
  * @throws 'EventSource API is not available. ' if EventSource is not available.
22
21
  */
23
- constructor(settings: ISettings, useHeaders?: boolean, getEventSource?: () => typeof EventSource | undefined);
22
+ constructor(settings: ISettings, useHeaders?: boolean, getEventSource?: () => (typeof EventSource | undefined));
24
23
  setEventHandler(handler: ISseEventHandler): void;
25
24
  /**
26
25
  * Open the connection with a given authToken
@@ -31,11 +30,4 @@ export default class SSEClient implements ISSEClient {
31
30
  open(authToken: IAuthTokenPushEnabled): void;
32
31
  /** Close connection */
33
32
  close(): void;
34
- /**
35
- * Re-open the connection with the last given authToken.
36
- *
37
- * @throws {TypeError} if `open` has not been previously called with an authToken
38
- * @TODO this method is not used currently and could be removed.
39
- */
40
- reopen(): void;
41
33
  }
@@ -6,7 +6,6 @@ export interface ISseEventHandler {
6
6
  }
7
7
  export interface ISSEClient {
8
8
  open(authToken: IAuthTokenPushEnabled): void;
9
- reopen(): void;
10
9
  close(): void;
11
10
  setEventHandler(handler: ISseEventHandler): void;
12
11
  }
@@ -13,7 +13,8 @@ export declare function errorParser(error: Event): INotificationError;
13
13
  * Also assigns the type OCCUPANCY, if it corresponds, so that all supported messages (e.g., SPLIT_UPDATE, CONTROL) have a type.
14
14
  *
15
15
  * @param message
16
- * @returns parsed notification message
16
+ * @returns parsed notification message or undefined if the given event data is falsy (e.g, '' or undefined).
17
+ * For example, the EventSource implementation of React-Native for iOS emits a message event with empty data for Ably keepalive comments.
17
18
  * @throws {SyntaxError} if `message.data` or `JSON.parse(message.data).data` are invalid JSON strings
18
19
  */
19
- export declare function messageParser(message: MessageEvent): INotificationMessage;
20
+ export declare function messageParser(message: MessageEvent): INotificationMessage | undefined;
@@ -1,11 +1,34 @@
1
1
  import { ControlType } from '../constants';
2
- import { MY_SEGMENTS_UPDATE, SEGMENT_UPDATE, SPLIT_UPDATE, SPLIT_KILL, CONTROL, OCCUPANCY } from '../types';
2
+ import { MY_SEGMENTS_UPDATE, MY_SEGMENTS_UPDATE_V2, SEGMENT_UPDATE, SPLIT_UPDATE, SPLIT_KILL, CONTROL, OCCUPANCY } from '../types';
3
3
  export interface IMySegmentsUpdateData {
4
4
  type: MY_SEGMENTS_UPDATE;
5
5
  changeNumber: number;
6
6
  includesPayload: boolean;
7
7
  segmentList?: string[];
8
8
  }
9
+ export declare enum Compression {
10
+ None = 0,
11
+ Gzip = 1,
12
+ Zlib = 2
13
+ }
14
+ export declare enum UpdateStrategy {
15
+ UnboundedFetchRequest = 0,
16
+ BoundedFetchRequest = 1,
17
+ KeyList = 2,
18
+ SegmentRemoval = 3
19
+ }
20
+ export interface KeyList {
21
+ a?: string[];
22
+ r?: string[];
23
+ }
24
+ export interface IMySegmentsUpdateV2Data {
25
+ type: MY_SEGMENTS_UPDATE_V2;
26
+ changeNumber: number;
27
+ segmentName: string;
28
+ c: Compression;
29
+ d: string;
30
+ u: UpdateStrategy;
31
+ }
9
32
  export interface ISegmentUpdateData {
10
33
  type: SEGMENT_UPDATE;
11
34
  changeNumber: number;
@@ -31,7 +54,7 @@ export interface IOccupancyData {
31
54
  publishers: number;
32
55
  };
33
56
  }
34
- export declare type INotificationData = IMySegmentsUpdateData | ISegmentUpdateData | ISplitUpdateData | ISplitKillData | IControlData | IOccupancyData;
57
+ export declare type INotificationData = IMySegmentsUpdateData | IMySegmentsUpdateV2Data | ISegmentUpdateData | ISplitUpdateData | ISplitKillData | IControlData | IOccupancyData;
35
58
  export declare type INotificationMessage = {
36
59
  parsedData: INotificationData;
37
60
  channel: string;
@@ -40,4 +63,9 @@ export declare type INotificationMessage = {
40
63
  };
41
64
  export declare type INotificationError = Event & {
42
65
  parsedData?: any;
66
+ message?: string;
67
+ };
68
+ export declare type SegmentsData = string[] | {
69
+ name: string;
70
+ add: boolean;
43
71
  };
@@ -1,6 +1,7 @@
1
1
  import { ISegmentsSyncTask } from '../../polling/types';
2
2
  import Backoff from '../../../utils/Backoff';
3
3
  import { IUpdateWorker } from './types';
4
+ import { SegmentsData } from '../SSEHandler/types';
4
5
  /**
5
6
  * MySegmentsUpdateWorker class
6
7
  */
@@ -8,7 +9,7 @@ export default class MySegmentsUpdateWorker implements IUpdateWorker {
8
9
  private readonly mySegmentsSyncTask;
9
10
  private maxChangeNumber;
10
11
  private handleNewEvent;
11
- private segmentList?;
12
+ private segmentsData?;
12
13
  private currentChangeNumber;
13
14
  readonly backoff: Backoff;
14
15
  /**
@@ -20,7 +21,7 @@ export default class MySegmentsUpdateWorker implements IUpdateWorker {
20
21
  * Invoked by NotificationProcessor on MY_SEGMENTS_UPDATE event
21
22
  *
22
23
  * @param {number} changeNumber change number of the MY_SEGMENTS_UPDATE notification
23
- * @param {string[] | undefined} segmentList might be undefined
24
+ * @param {SegmentsData | undefined} segmentsData might be undefined
24
25
  */
25
- put(changeNumber: number, segmentList?: string[]): void;
26
+ put(changeNumber: number, segmentsData?: SegmentsData): void;
26
27
  }
@@ -1,6 +1,7 @@
1
1
  import { ISegmentsCacheSync } from '../../../storages/types';
2
2
  import Backoff from '../../../utils/Backoff';
3
3
  import { ISegmentsSyncTask } from '../../polling/types';
4
+ import { ISegmentUpdateData } from '../SSEHandler/types';
4
5
  import { IUpdateWorker } from './types';
5
6
  /**
6
7
  * SegmentUpdateWorker class
@@ -23,5 +24,5 @@ export default class SegmentsUpdateWorker implements IUpdateWorker {
23
24
  * @param {number} changeNumber change number of the SEGMENT_UPDATE notification
24
25
  * @param {string} segmentName segment name of the SEGMENT_UPDATE notification
25
26
  */
26
- put(changeNumber: number, segmentName: string): void;
27
+ put({ changeNumber, segmentName }: ISegmentUpdateData): void;
27
28
  }
@@ -2,6 +2,7 @@ import { ISplitsEventEmitter } from '../../../readiness/types';
2
2
  import { ISplitsCacheSync } from '../../../storages/types';
3
3
  import Backoff from '../../../utils/Backoff';
4
4
  import { ISegmentsSyncTask, ISplitsSyncTask } from '../../polling/types';
5
+ import { ISplitKillData, ISplitUpdateData } from '../SSEHandler/types';
5
6
  import { IUpdateWorker } from './types';
6
7
  /**
7
8
  * SplitsUpdateWorker class
@@ -26,7 +27,7 @@ export default class SplitsUpdateWorker implements IUpdateWorker {
26
27
  *
27
28
  * @param {number} changeNumber change number of the SPLIT_UPDATE notification
28
29
  */
29
- put(changeNumber: number): void;
30
+ put({ changeNumber }: Pick<ISplitUpdateData, 'changeNumber'>): void;
30
31
  /**
31
32
  * Invoked by NotificationProcessor on SPLIT_KILL event
32
33
  *
@@ -34,5 +35,5 @@ export default class SplitsUpdateWorker implements IUpdateWorker {
34
35
  * @param {string} splitName name of split to kill
35
36
  * @param {string} defaultTreatment default treatment value
36
37
  */
37
- killSplit(changeNumber: number, splitName: string, defaultTreatment: string): void;
38
+ killSplit({ changeNumber, splitName, defaultTreatment }: ISplitKillData): void;
38
39
  }
@@ -1,5 +1,5 @@
1
1
  import Backoff from '../../../utils/Backoff';
2
2
  export interface IUpdateWorker {
3
3
  readonly backoff: Backoff;
4
- put(changeNumber: number, ...args: any[]): void;
4
+ put(...args: any[]): void;
5
5
  }
@@ -20,6 +20,7 @@ export declare const PUSH_SUBSYSTEM_UP = "PUSH_SUBSYSTEM_UP";
20
20
  */
21
21
  export declare const PUSH_SUBSYSTEM_DOWN = "PUSH_SUBSYSTEM_DOWN";
22
22
  export declare const MY_SEGMENTS_UPDATE = "MY_SEGMENTS_UPDATE";
23
+ export declare const MY_SEGMENTS_UPDATE_V2 = "MY_SEGMENTS_UPDATE_V2";
23
24
  export declare const SEGMENT_UPDATE = "SEGMENT_UPDATE";
24
25
  export declare const SPLIT_KILL = "SPLIT_KILL";
25
26
  export declare const SPLIT_UPDATE = "SPLIT_UPDATE";
@@ -28,5 +29,6 @@ export declare const OCCUPANCY = "OCCUPANCY";
28
29
  export declare enum ControlType {
29
30
  STREAMING_DISABLED = "STREAMING_DISABLED",
30
31
  STREAMING_PAUSED = "STREAMING_PAUSED",
31
- STREAMING_RESUMED = "STREAMING_RESUMED"
32
+ STREAMING_RESUMED = "STREAMING_RESUMED",
33
+ STREAMING_RESET = "STREAMING_RESET"
32
34
  }
@@ -0,0 +1,27 @@
1
+ import { Compression, KeyList } from './SSEHandler/types';
2
+ /**
3
+ * Decode, decompress and parse the provided 'data' into a KeyList object
4
+ *
5
+ * @param {string} data
6
+ * @param {number} compression
7
+ * @returns {{a?: string[], r?: string[] }}
8
+ * @throws if data string cannot be decoded, decompressed or parsed
9
+ */
10
+ export declare function parseKeyList(data: string, compression: Compression): KeyList;
11
+ /**
12
+ * Decode, decompress and parse the provided 'data' into a Bitmap object
13
+ *
14
+ * @param {string} data
15
+ * @param {number} compression
16
+ * @returns {Uint8Array}
17
+ * @throws if data string cannot be decoded or decompressed
18
+ */
19
+ export declare function parseBitmap(data: string, compression: Compression): Uint8Array;
20
+ /**
21
+ * Check if the 'bitmap' bit at 'hash64hex' position is 1
22
+ *
23
+ * @param {Uint8Array} bitmap
24
+ * @param {string} hash64hex 16-chars string, representing a number in hexa
25
+ * @returns {boolean}
26
+ */
27
+ export declare function isInBitmap(bitmap: Uint8Array, hash64hex: string): boolean;
@@ -0,0 +1,13 @@
1
+ import { IPushManagerCS } from './types';
2
+ import { IStorageSync } from '../../storages/types';
3
+ import { IReadinessManager } from '../../readiness/types';
4
+ import { IPollingManager } from '../polling/types';
5
+ import { IFetchAuthV2 } from '../../services/types';
6
+ import { ISettings } from '../../types';
7
+ import { IPlatform } from '../../sdkFactory/types';
8
+ /**
9
+ * PushManager factory:
10
+ * - for server-side if key is not provided in settings.
11
+ * - for client-side, with support for multiple clients, if key is provided in settings
12
+ */
13
+ export default function pushManagerFactory(pollingManager: IPollingManager, storage: IStorageSync, readiness: IReadinessManager, fetchAuthV2: IFetchAuthV2, platform: IPlatform, settings: ISettings): IPushManagerCS | undefined;
@@ -1,4 +1,4 @@
1
- import { IMySegmentsUpdateData } from './SSEHandler/types';
1
+ import { IMySegmentsUpdateData, IMySegmentsUpdateV2Data, ISegmentUpdateData, ISplitUpdateData, ISplitKillData } from './SSEHandler/types';
2
2
  import { ITask } from '../types';
3
3
  import { IPollingManager, ISegmentsSyncTask } from '../polling/types';
4
4
  import { IReadinessManager } from '../../readiness/types';
@@ -6,25 +6,28 @@ import { IFetchAuth } from '../../services/types';
6
6
  import { IStorageSync } from '../../storages/types';
7
7
  import { IEventEmitter, ISettings } from '../../types';
8
8
  import { IPlatform } from '../../sdkFactory/types';
9
+ import { ControlType } from './constants';
9
10
  export declare type PUSH_SUBSYSTEM_UP = 'PUSH_SUBSYSTEM_UP';
10
11
  export declare type PUSH_SUBSYSTEM_DOWN = 'PUSH_SUBSYSTEM_DOWN';
11
12
  export declare type PUSH_NONRETRYABLE_ERROR = 'PUSH_NONRETRYABLE_ERROR';
12
13
  export declare type PUSH_RETRYABLE_ERROR = 'PUSH_RETRYABLE_ERROR';
13
14
  export declare type MY_SEGMENTS_UPDATE = 'MY_SEGMENTS_UPDATE';
15
+ export declare type MY_SEGMENTS_UPDATE_V2 = 'MY_SEGMENTS_UPDATE_V2';
14
16
  export declare type SEGMENT_UPDATE = 'SEGMENT_UPDATE';
15
17
  export declare type SPLIT_KILL = 'SPLIT_KILL';
16
18
  export declare type SPLIT_UPDATE = 'SPLIT_UPDATE';
17
19
  export declare type CONTROL = 'CONTROL';
18
20
  export declare type OCCUPANCY = 'OCCUPANCY';
19
- export declare type IPushEvent = PUSH_SUBSYSTEM_UP | PUSH_SUBSYSTEM_DOWN | PUSH_NONRETRYABLE_ERROR | PUSH_RETRYABLE_ERROR | MY_SEGMENTS_UPDATE | SEGMENT_UPDATE | SPLIT_UPDATE | SPLIT_KILL;
21
+ export declare type IPushEvent = PUSH_SUBSYSTEM_UP | PUSH_SUBSYSTEM_DOWN | PUSH_NONRETRYABLE_ERROR | PUSH_RETRYABLE_ERROR | MY_SEGMENTS_UPDATE | MY_SEGMENTS_UPDATE_V2 | SEGMENT_UPDATE | SPLIT_UPDATE | SPLIT_KILL | ControlType.STREAMING_RESET;
22
+ declare type IParsedData<T extends IPushEvent> = T extends MY_SEGMENTS_UPDATE ? IMySegmentsUpdateData : T extends MY_SEGMENTS_UPDATE_V2 ? IMySegmentsUpdateV2Data : T extends SEGMENT_UPDATE ? ISegmentUpdateData : T extends SPLIT_UPDATE ? ISplitUpdateData : T extends SPLIT_KILL ? ISplitKillData : undefined;
20
23
  /**
21
24
  * EventEmitter used as Feedback Loop between the SyncManager and PushManager,
22
25
  * where the latter pushes messages and the former consumes it
23
26
  */
24
27
  export interface IPushEventEmitter extends IEventEmitter {
25
- once<T extends IPushEvent>(event: T, listener: (...args: T extends MY_SEGMENTS_UPDATE ? [parsedData: IMySegmentsUpdateData, channel: string] : T extends SEGMENT_UPDATE ? [changeNumber: number, segmentName: string] : T extends SPLIT_UPDATE ? [changeNumber: number] : T extends SPLIT_KILL ? [changeNumber: number, splitName: string, defaultTreatment: string] : any[]) => void): this;
26
- on<T extends IPushEvent>(event: T, listener: (...args: T extends MY_SEGMENTS_UPDATE ? [parsedData: IMySegmentsUpdateData, channel: string] : T extends SEGMENT_UPDATE ? [changeNumber: number, segmentName: string] : T extends SPLIT_UPDATE ? [changeNumber: number] : T extends SPLIT_KILL ? [changeNumber: number, splitName: string, defaultTreatment: string] : any[]) => void): this;
27
- emit<T extends IPushEvent>(event: T, ...args: T extends MY_SEGMENTS_UPDATE ? [parsedData: IMySegmentsUpdateData, channel: string] : T extends SEGMENT_UPDATE ? [changeNumber: number, segmentName: string] : T extends SPLIT_UPDATE ? [changeNumber: number] : T extends SPLIT_KILL ? [changeNumber: number, splitName: string, defaultTreatment: string] : any[]): boolean;
28
+ once<T extends IPushEvent>(event: T, listener: (parsedData: IParsedData<T>, channel: T extends MY_SEGMENTS_UPDATE ? string : undefined) => void): this;
29
+ on<T extends IPushEvent>(event: T, listener: (parsedData: IParsedData<T>, channel: T extends MY_SEGMENTS_UPDATE ? string : undefined) => void): this;
30
+ emit<T extends IPushEvent>(event: T, parsedData?: IParsedData<T>, channel?: T extends MY_SEGMENTS_UPDATE ? string : undefined): boolean;
28
31
  }
29
32
  /**
30
33
  * PushManager for server-side
@@ -49,3 +52,4 @@ export declare type IPushManagerFactoryParams = [
49
52
  platform: IPlatform,
50
53
  settings: ISettings
51
54
  ];
55
+ export {};
@@ -7,4 +7,4 @@ import { IResponse } from '../../services/types';
7
7
  */
8
8
  export declare function submitterSyncTaskFactory<TState extends {
9
9
  length?: number;
10
- }>(log: ILogger, postClient: (body: string) => Promise<IResponse>, sourceCache: IRecorderCacheProducerSync<TState>, postRate: number, dataName: string, latencyTracker?: ITimeTracker, fromCacheToPayload?: (cacheData: TState) => any, maxRetries?: number): ISyncTask<[], void>;
10
+ }>(log: ILogger, postClient: (body: string) => Promise<IResponse>, sourceCache: IRecorderCacheProducerSync<TState>, postRate: number, dataName: string, latencyTracker?: ITimeTracker, fromCacheToPayload?: (cacheData: TState) => any, maxRetries?: number, debugLogs?: boolean): ISyncTask<[], void>;
@@ -0,0 +1,2 @@
1
+ import { SplitIO } from '../types';
2
+ export declare function LocalhostFromFile(): SplitIO.LocalhostFactory;
@@ -0,0 +1,2 @@
1
+ import { SplitIO } from '../types';
2
+ export declare function LocalhostFromObject(): SplitIO.LocalhostFactory;
@@ -6,4 +6,4 @@ import { ISplitsParser } from './offline/splitsParser/types';
6
6
  *
7
7
  * @param splitsParser e.g., `splitsParserFromFile`, `splitsParserFromSettings`.
8
8
  */
9
- export declare function syncManagerOfflineFactory(splitsParser: ISplitsParser): (params: ISyncManagerFactoryParams) => ISyncManagerCS;
9
+ export declare function syncManagerOfflineFactory(splitsParserFactory: () => ISplitsParser): (params: ISyncManagerFactoryParams) => ISyncManagerCS;
@@ -1,8 +1,8 @@
1
1
  import { ImpressionDTO } from '../../types';
2
2
  import { IImpressionObserver } from './types';
3
- export default class ImpressionObserver implements IImpressionObserver {
3
+ export default class ImpressionObserver<K extends string | number> implements IImpressionObserver {
4
4
  private cache;
5
5
  private hasher;
6
- constructor(size: number, hasher: (impression: ImpressionDTO) => string | null);
6
+ constructor(size: number, hasher: (impression: ImpressionDTO) => K);
7
7
  testAndSet(impression: ImpressionDTO): number | undefined;
8
8
  }
@@ -1,2 +1,2 @@
1
1
  import { ImpressionDTO } from '../../types';
2
- export default function buildKey(impression: ImpressionDTO): string;
2
+ export declare function buildKey(impression: ImpressionDTO): string;
@@ -1,4 +1,4 @@
1
1
  import ImpressionObserver from './ImpressionObserver';
2
2
  import { ImpressionDTO } from '../../types';
3
- export declare function hashImpression32(impression: ImpressionDTO): string | null;
4
- export declare function impressionObserverCSFactory(): ImpressionObserver;
3
+ export declare function hashImpression32(impression: ImpressionDTO): number;
4
+ export declare function impressionObserverCSFactory(): ImpressionObserver<number>;
@@ -1,4 +1,4 @@
1
1
  import ImpressionObserver from './ImpressionObserver';
2
2
  import { ImpressionDTO } from '../../types';
3
- export declare function hashImpression128(impression: ImpressionDTO): string | null;
4
- export declare function impressionObserverSSFactory(): ImpressionObserver;
3
+ export declare function hashImpression128(impression: ImpressionDTO): string;
4
+ export declare function impressionObserverSSFactory(): ImpressionObserver<string>;