@splitsoftware/splitio-commons 2.0.0-rc.3 → 2.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/package.json +3 -2
  2. package/types/index.d.ts +5 -5
  3. package/types/splitio.d.ts +2293 -0
  4. package/types/consent/index.d.ts +0 -2
  5. package/types/consent/sdkUserConsent.d.ts +0 -13
  6. package/types/dtos/types.d.ts +0 -209
  7. package/types/evaluator/Engine.d.ts +0 -15
  8. package/types/evaluator/combiners/and.d.ts +0 -4
  9. package/types/evaluator/combiners/ifelseif.d.ts +0 -3
  10. package/types/evaluator/condition/engineUtils.d.ts +0 -11
  11. package/types/evaluator/condition/index.d.ts +0 -6
  12. package/types/evaluator/convertions/index.d.ts +0 -2
  13. package/types/evaluator/index.d.ts +0 -8
  14. package/types/evaluator/matchers/all.d.ts +0 -1
  15. package/types/evaluator/matchers/between.d.ts +0 -2
  16. package/types/evaluator/matchers/boolean.d.ts +0 -1
  17. package/types/evaluator/matchers/cont_all.d.ts +0 -1
  18. package/types/evaluator/matchers/cont_any.d.ts +0 -1
  19. package/types/evaluator/matchers/cont_str.d.ts +0 -1
  20. package/types/evaluator/matchers/dependency.d.ts +0 -5
  21. package/types/evaluator/matchers/eq.d.ts +0 -1
  22. package/types/evaluator/matchers/eq_set.d.ts +0 -1
  23. package/types/evaluator/matchers/ew.d.ts +0 -1
  24. package/types/evaluator/matchers/gte.d.ts +0 -1
  25. package/types/evaluator/matchers/index.d.ts +0 -7
  26. package/types/evaluator/matchers/large_segment.d.ts +0 -5
  27. package/types/evaluator/matchers/lte.d.ts +0 -1
  28. package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
  29. package/types/evaluator/matchers/part_of.d.ts +0 -1
  30. package/types/evaluator/matchers/segment.d.ts +0 -5
  31. package/types/evaluator/matchers/semver_between.d.ts +0 -2
  32. package/types/evaluator/matchers/semver_eq.d.ts +0 -1
  33. package/types/evaluator/matchers/semver_gte.d.ts +0 -1
  34. package/types/evaluator/matchers/semver_inlist.d.ts +0 -1
  35. package/types/evaluator/matchers/semver_lte.d.ts +0 -1
  36. package/types/evaluator/matchers/string.d.ts +0 -1
  37. package/types/evaluator/matchers/sw.d.ts +0 -1
  38. package/types/evaluator/matchers/whitelist.d.ts +0 -1
  39. package/types/evaluator/matchersTransform/index.d.ts +0 -6
  40. package/types/evaluator/matchersTransform/segment.d.ts +0 -5
  41. package/types/evaluator/matchersTransform/unaryNumeric.d.ts +0 -5
  42. package/types/evaluator/matchersTransform/whitelist.d.ts +0 -5
  43. package/types/evaluator/parser/index.d.ts +0 -5
  44. package/types/evaluator/treatments/index.d.ts +0 -8
  45. package/types/evaluator/types.d.ts +0 -28
  46. package/types/evaluator/value/index.d.ts +0 -7
  47. package/types/evaluator/value/sanitize.d.ts +0 -7
  48. package/types/integrations/pluggable.d.ts +0 -11
  49. package/types/integrations/types.d.ts +0 -18
  50. package/types/listeners/browser.d.ts +0 -40
  51. package/types/listeners/node.d.ts +0 -22
  52. package/types/listeners/types.d.ts +0 -4
  53. package/types/logger/browser/DebugLogger.d.ts +0 -2
  54. package/types/logger/browser/ErrorLogger.d.ts +0 -2
  55. package/types/logger/browser/InfoLogger.d.ts +0 -2
  56. package/types/logger/browser/WarnLogger.d.ts +0 -2
  57. package/types/logger/constants.d.ts +0 -134
  58. package/types/logger/index.d.ts +0 -21
  59. package/types/logger/messages/debug.d.ts +0 -1
  60. package/types/logger/messages/error.d.ts +0 -1
  61. package/types/logger/messages/info.d.ts +0 -1
  62. package/types/logger/messages/warn.d.ts +0 -1
  63. package/types/logger/sdkLogger.d.ts +0 -8
  64. package/types/logger/types.d.ts +0 -17
  65. package/types/readiness/constants.d.ts +0 -7
  66. package/types/readiness/readinessManager.d.ts +0 -6
  67. package/types/readiness/sdkReadinessManager.d.ts +0 -10
  68. package/types/readiness/types.d.ts +0 -67
  69. package/types/sdkClient/client.d.ts +0 -6
  70. package/types/sdkClient/clientAttributesDecoration.d.ts +0 -55
  71. package/types/sdkClient/clientCS.d.ts +0 -9
  72. package/types/sdkClient/clientInputValidation.d.ts +0 -7
  73. package/types/sdkClient/identity.d.ts +0 -2
  74. package/types/sdkClient/sdkClient.d.ts +0 -6
  75. package/types/sdkClient/sdkClientMethod.d.ts +0 -6
  76. package/types/sdkClient/sdkClientMethodCS.d.ts +0 -7
  77. package/types/sdkFactory/index.d.ts +0 -6
  78. package/types/sdkFactory/types.d.ts +0 -85
  79. package/types/sdkManager/index.d.ts +0 -4
  80. package/types/services/decorateHeaders.d.ts +0 -2
  81. package/types/services/splitApi.d.ts +0 -12
  82. package/types/services/splitHttpClient.d.ts +0 -10
  83. package/types/services/types.d.ts +0 -54
  84. package/types/storages/AbstractMySegmentsCacheSync.d.ts +0 -39
  85. package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -38
  86. package/types/storages/AbstractSplitsCacheSync.d.ts +0 -43
  87. package/types/storages/KeyBuilder.d.ts +0 -22
  88. package/types/storages/KeyBuilderCS.d.ts +0 -20
  89. package/types/storages/KeyBuilderSS.d.ts +0 -20
  90. package/types/storages/dataLoader.d.ts +0 -10
  91. package/types/storages/findLatencyIndex.d.ts +0 -7
  92. package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -15
  93. package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -54
  94. package/types/storages/inLocalStorage/constants.d.ts +0 -2
  95. package/types/storages/inLocalStorage/index.d.ts +0 -8
  96. package/types/storages/inMemory/AttributesCacheInMemory.d.ts +0 -44
  97. package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
  98. package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -28
  99. package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +0 -30
  100. package/types/storages/inMemory/InMemoryStorage.d.ts +0 -10
  101. package/types/storages/inMemory/InMemoryStorageCS.d.ts +0 -10
  102. package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +0 -16
  103. package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -17
  104. package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -27
  105. package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -71
  106. package/types/storages/inMemory/UniqueKeysCacheInMemory.d.ts +0 -34
  107. package/types/storages/inMemory/UniqueKeysCacheInMemoryCS.d.ts +0 -35
  108. package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
  109. package/types/storages/inRedis/ImpressionCountsCacheInRedis.d.ts +0 -17
  110. package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -17
  111. package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
  112. package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -21
  113. package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -95
  114. package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -35
  115. package/types/storages/inRedis/UniqueKeysCacheInRedis.d.ts +0 -22
  116. package/types/storages/inRedis/constants.d.ts +0 -4
  117. package/types/storages/inRedis/index.d.ts +0 -10
  118. package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
  119. package/types/storages/pluggable/ImpressionCountsCachePluggable.d.ts +0 -16
  120. package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -34
  121. package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -42
  122. package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -98
  123. package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -34
  124. package/types/storages/pluggable/UniqueKeysCachePluggable.d.ts +0 -20
  125. package/types/storages/pluggable/constants.d.ts +0 -1
  126. package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -12
  127. package/types/storages/pluggable/index.d.ts +0 -9
  128. package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
  129. package/types/storages/types.d.ts +0 -407
  130. package/types/storages/utils.d.ts +0 -8
  131. package/types/sync/offline/LocalhostFromObject.d.ts +0 -1
  132. package/types/sync/offline/splitsParser/parseCondition.d.ts +0 -7
  133. package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +0 -3
  134. package/types/sync/offline/splitsParser/types.d.ts +0 -3
  135. package/types/sync/offline/syncManagerOffline.d.ts +0 -10
  136. package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +0 -17
  137. package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +0 -7
  138. package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +0 -7
  139. package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +0 -7
  140. package/types/sync/polling/fetchers/types.d.ts +0 -5
  141. package/types/sync/polling/pollingManagerCS.d.ts +0 -7
  142. package/types/sync/polling/pollingManagerSS.d.ts +0 -6
  143. package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +0 -9
  144. package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +0 -9
  145. package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +0 -9
  146. package/types/sync/polling/types.d.ts +0 -33
  147. package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -14
  148. package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
  149. package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -41
  150. package/types/sync/streaming/AuthClient/index.d.ts +0 -12
  151. package/types/sync/streaming/AuthClient/types.d.ts +0 -17
  152. package/types/sync/streaming/SSEClient/index.d.ts +0 -34
  153. package/types/sync/streaming/SSEClient/types.d.ts +0 -11
  154. package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +0 -14
  155. package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +0 -20
  156. package/types/sync/streaming/SSEHandler/index.d.ts +0 -11
  157. package/types/sync/streaming/SSEHandler/types.d.ts +0 -72
  158. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -9
  159. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -9
  160. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -14
  161. package/types/sync/streaming/UpdateWorkers/constants.d.ts +0 -3
  162. package/types/sync/streaming/UpdateWorkers/types.d.ts +0 -4
  163. package/types/sync/streaming/constants.d.ts +0 -34
  164. package/types/sync/streaming/parseUtils.d.ts +0 -34
  165. package/types/sync/streaming/pushManager.d.ts +0 -9
  166. package/types/sync/streaming/types.d.ts +0 -35
  167. package/types/sync/submitters/eventsSubmitter.d.ts +0 -5
  168. package/types/sync/submitters/impressionCountsSubmitter.d.ts +0 -10
  169. package/types/sync/submitters/impressionsSubmitter.d.ts +0 -11
  170. package/types/sync/submitters/submitter.d.ts +0 -12
  171. package/types/sync/submitters/submitterManager.d.ts +0 -3
  172. package/types/sync/submitters/telemetrySubmitter.d.ts +0 -17
  173. package/types/sync/submitters/types.d.ts +0 -217
  174. package/types/sync/submitters/uniqueKeysSubmitter.d.ts +0 -5
  175. package/types/sync/syncManagerOnline.d.ts +0 -13
  176. package/types/sync/syncTask.d.ts +0 -13
  177. package/types/sync/types.d.ts +0 -43
  178. package/types/trackers/eventTracker.d.ts +0 -10
  179. package/types/trackers/impressionObserver/ImpressionObserver.d.ts +0 -8
  180. package/types/trackers/impressionObserver/buildKey.d.ts +0 -2
  181. package/types/trackers/impressionObserver/impressionObserverCS.d.ts +0 -4
  182. package/types/trackers/impressionObserver/impressionObserverSS.d.ts +0 -4
  183. package/types/trackers/impressionObserver/types.d.ts +0 -4
  184. package/types/trackers/impressionsTracker.d.ts +0 -13
  185. package/types/trackers/strategy/strategyDebug.d.ts +0 -9
  186. package/types/trackers/strategy/strategyNone.d.ts +0 -10
  187. package/types/trackers/strategy/strategyOptimized.d.ts +0 -11
  188. package/types/trackers/telemetryTracker.d.ts +0 -3
  189. package/types/trackers/types.d.ts +0 -68
  190. package/types/trackers/uniqueKeysTracker.d.ts +0 -13
  191. package/types/types.d.ts +0 -1398
  192. package/types/utils/Backoff.d.ts +0 -25
  193. package/types/utils/LRUCache/LinkedList.d.ts +0 -34
  194. package/types/utils/LRUCache/index.d.ts +0 -15
  195. package/types/utils/MinEventEmitter.d.ts +0 -12
  196. package/types/utils/MinEvents.d.ts +0 -4
  197. package/types/utils/Semver.d.ts +0 -15
  198. package/types/utils/base64/index.d.ts +0 -30
  199. package/types/utils/constants/browser.d.ts +0 -1
  200. package/types/utils/constants/index.d.ts +0 -83
  201. package/types/utils/decompress/index.d.ts +0 -16
  202. package/types/utils/env/isLocalStorageAvailable.d.ts +0 -1
  203. package/types/utils/env/isNode.d.ts +0 -5
  204. package/types/utils/inputValidation/apiKey.d.ts +0 -7
  205. package/types/utils/inputValidation/attribute.d.ts +0 -2
  206. package/types/utils/inputValidation/attributes.d.ts +0 -4
  207. package/types/utils/inputValidation/event.d.ts +0 -2
  208. package/types/utils/inputValidation/eventProperties.d.ts +0 -6
  209. package/types/utils/inputValidation/eventValue.d.ts +0 -2
  210. package/types/utils/inputValidation/index.d.ts +0 -13
  211. package/types/utils/inputValidation/isOperational.d.ts +0 -4
  212. package/types/utils/inputValidation/key.d.ts +0 -3
  213. package/types/utils/inputValidation/preloadedData.d.ts +0 -3
  214. package/types/utils/inputValidation/split.d.ts +0 -2
  215. package/types/utils/inputValidation/splitExistence.d.ts +0 -7
  216. package/types/utils/inputValidation/splits.d.ts +0 -2
  217. package/types/utils/inputValidation/trafficType.d.ts +0 -2
  218. package/types/utils/inputValidation/trafficTypeExistence.d.ts +0 -9
  219. package/types/utils/jwt/index.d.ts +0 -5
  220. package/types/utils/jwt/types.d.ts +0 -5
  221. package/types/utils/key/index.d.ts +0 -8
  222. package/types/utils/labels/index.d.ts +0 -8
  223. package/types/utils/lang/binarySearch.d.ts +0 -9
  224. package/types/utils/lang/getFnName.d.ts +0 -4
  225. package/types/utils/lang/getGlobal.d.ts +0 -4
  226. package/types/utils/lang/index.d.ts +0 -105
  227. package/types/utils/lang/objectAssign.d.ts +0 -6
  228. package/types/utils/lang/sets.d.ts +0 -3
  229. package/types/utils/murmur3/common.d.ts +0 -12
  230. package/types/utils/murmur3/legacy.d.ts +0 -2
  231. package/types/utils/murmur3/murmur3.d.ts +0 -2
  232. package/types/utils/murmur3/murmur3_128.d.ts +0 -6
  233. package/types/utils/murmur3/murmur3_128_x86.d.ts +0 -7
  234. package/types/utils/murmur3/murmur3_64.d.ts +0 -10
  235. package/types/utils/murmur3/utfx.d.ts +0 -27
  236. package/types/utils/promise/thenable.d.ts +0 -1
  237. package/types/utils/promise/timeout.d.ts +0 -1
  238. package/types/utils/promise/wrapper.d.ts +0 -21
  239. package/types/utils/settingsValidation/consent.d.ts +0 -6
  240. package/types/utils/settingsValidation/impressionsMode.d.ts +0 -3
  241. package/types/utils/settingsValidation/index.d.ts +0 -50
  242. package/types/utils/settingsValidation/integrations/common.d.ts +0 -14
  243. package/types/utils/settingsValidation/integrations/configurable.d.ts +0 -13
  244. package/types/utils/settingsValidation/integrations/pluggable.d.ts +0 -13
  245. package/types/utils/settingsValidation/logger/builtinLogger.d.ts +0 -10
  246. package/types/utils/settingsValidation/logger/commons.d.ts +0 -9
  247. package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +0 -11
  248. package/types/utils/settingsValidation/mode.d.ts +0 -5
  249. package/types/utils/settingsValidation/runtime.d.ts +0 -2
  250. package/types/utils/settingsValidation/splitFilters.d.ts +0 -17
  251. package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -21
  252. package/types/utils/settingsValidation/types.d.ts +0 -30
  253. package/types/utils/settingsValidation/url.d.ts +0 -10
  254. package/types/utils/time/index.d.ts +0 -4
  255. package/types/utils/timeTracker/now/browser.d.ts +0 -1
  256. package/types/utils/timeTracker/now/node.d.ts +0 -1
  257. package/types/utils/timeTracker/timer.d.ts +0 -1
@@ -1,134 +0,0 @@
1
- /**
2
- * Message codes used to trim string log messages from commons and client-side API modules,
3
- * in order to reduce the minimal SDK size for Browser and eventually other client-side environments.
4
- *
5
- * Modules related to the server-side API (e.g., segmentsSyncTask), platform-specific components (e.g., signal listeners)
6
- * and pluggable components (e.g., pluggable integrations & storages) can use the logger with string literals.
7
- */
8
- export declare const ENGINE_COMBINER_AND = 0;
9
- export declare const ENGINE_COMBINER_IFELSEIF = 1;
10
- export declare const ENGINE_COMBINER_IFELSEIF_NO_TREATMENT = 2;
11
- export declare const ENGINE_BUCKET = 3;
12
- export declare const ENGINE_MATCHER_DEPENDENCY = 10;
13
- export declare const ENGINE_MATCHER_DEPENDENCY_PRE = 11;
14
- export declare const ENGINE_VALUE = 23;
15
- export declare const ENGINE_SANITIZE = 24;
16
- export declare const CLEANUP_REGISTERING = 25;
17
- export declare const CLEANUP_DEREGISTERING = 26;
18
- export declare const RETRIEVE_CLIENT_DEFAULT = 27;
19
- export declare const RETRIEVE_CLIENT_EXISTING = 28;
20
- export declare const RETRIEVE_MANAGER = 29;
21
- export declare const SYNC_OFFLINE_DATA = 30;
22
- export declare const SYNC_SPLITS_FETCH = 31;
23
- export declare const SYNC_SPLITS_NEW = 32;
24
- export declare const SYNC_SPLITS_REMOVED = 33;
25
- export declare const SYNC_SPLITS_SEGMENTS = 34;
26
- export declare const STREAMING_NEW_MESSAGE = 35;
27
- export declare const SYNC_TASK_START = 36;
28
- export declare const SYNC_TASK_EXECUTE = 37;
29
- export declare const SYNC_TASK_STOP = 38;
30
- export declare const SETTINGS_SPLITS_FILTER = 39;
31
- export declare const ENGINE_MATCHER_RESULT = 40;
32
- export declare const CLIENT_READY_FROM_CACHE = 100;
33
- export declare const CLIENT_READY = 101;
34
- export declare const IMPRESSION = 102;
35
- export declare const IMPRESSION_QUEUEING = 103;
36
- export declare const NEW_SHARED_CLIENT = 104;
37
- export declare const NEW_FACTORY = 105;
38
- export declare const POLLING_SMART_PAUSING = 106;
39
- export declare const POLLING_START = 107;
40
- export declare const POLLING_STOP = 108;
41
- export declare const SYNC_SPLITS_FETCH_RETRY = 109;
42
- export declare const STREAMING_REFRESH_TOKEN = 110;
43
- export declare const STREAMING_RECONNECT = 111;
44
- export declare const STREAMING_CONNECTING = 112;
45
- export declare const STREAMING_DISABLED = 113;
46
- export declare const STREAMING_DISCONNECTING = 114;
47
- export declare const SUBMITTERS_PUSH_FULL_QUEUE = 115;
48
- export declare const SUBMITTERS_PUSH = 116;
49
- export declare const SYNC_START_POLLING = 117;
50
- export declare const SYNC_CONTINUE_POLLING = 118;
51
- export declare const SYNC_STOP_POLLING = 119;
52
- export declare const EVENTS_TRACKER_SUCCESS = 120;
53
- export declare const IMPRESSIONS_TRACKER_SUCCESS = 121;
54
- export declare const USER_CONSENT_UPDATED = 122;
55
- export declare const USER_CONSENT_NOT_UPDATED = 123;
56
- export declare const USER_CONSENT_INITIAL = 124;
57
- export declare const ENGINE_VALUE_INVALID = 200;
58
- export declare const ENGINE_VALUE_NO_ATTRIBUTES = 201;
59
- export declare const CLIENT_NO_LISTENER = 202;
60
- export declare const CLIENT_NOT_READY = 203;
61
- export declare const SYNC_MYSEGMENTS_FETCH_RETRY = 204;
62
- export declare const SYNC_SPLITS_FETCH_FAILS = 205;
63
- export declare const STREAMING_PARSING_ERROR_FAILS = 206;
64
- export declare const STREAMING_PARSING_MESSAGE_FAILS = 207;
65
- export declare const STREAMING_FALLBACK = 208;
66
- export declare const SUBMITTERS_PUSH_FAILS = 209;
67
- export declare const SUBMITTERS_PUSH_RETRY = 210;
68
- export declare const WARN_SETTING_NULL = 211;
69
- export declare const WARN_TRIMMING_PROPERTIES = 212;
70
- export declare const WARN_CONVERTING = 213;
71
- export declare const WARN_TRIMMING = 214;
72
- export declare const WARN_NOT_EXISTENT_SPLIT = 215;
73
- export declare const WARN_LOWERCASE_TRAFFIC_TYPE = 216;
74
- export declare const WARN_NOT_EXISTENT_TT = 217;
75
- export declare const WARN_INTEGRATION_INVALID = 218;
76
- export declare const WARN_SPLITS_FILTER_IGNORED = 219;
77
- export declare const WARN_SPLITS_FILTER_INVALID = 220;
78
- export declare const WARN_SPLITS_FILTER_EMPTY = 221;
79
- export declare const WARN_SDK_KEY = 222;
80
- export declare const STREAMING_PARSING_MEMBERSHIPS_UPDATE = 223;
81
- export declare const STREAMING_PARSING_SPLIT_UPDATE = 224;
82
- export declare const WARN_INVALID_FLAGSET = 225;
83
- export declare const WARN_LOWERCASE_FLAGSET = 226;
84
- export declare const WARN_FLAGSET_NOT_CONFIGURED = 227;
85
- export declare const WARN_FLAGSET_WITHOUT_FLAGS = 228;
86
- export declare const ERROR_ENGINE_COMBINER_IFELSEIF = 300;
87
- export declare const ERROR_LOGLEVEL_INVALID = 301;
88
- export declare const ERROR_CLIENT_LISTENER = 302;
89
- export declare const ERROR_CLIENT_CANNOT_GET_READY = 303;
90
- export declare const ERROR_SYNC_OFFLINE_LOADING = 304;
91
- export declare const ERROR_STREAMING_SSE = 305;
92
- export declare const ERROR_STREAMING_AUTH = 306;
93
- export declare const ERROR_IMPRESSIONS_TRACKER = 307;
94
- export declare const ERROR_IMPRESSIONS_LISTENER = 308;
95
- export declare const ERROR_EVENTS_TRACKER = 309;
96
- export declare const ERROR_EVENT_TYPE_FORMAT = 310;
97
- export declare const ERROR_NOT_PLAIN_OBJECT = 311;
98
- export declare const ERROR_SIZE_EXCEEDED = 312;
99
- export declare const ERROR_NOT_FINITE = 313;
100
- export declare const ERROR_CLIENT_DESTROYED = 314;
101
- export declare const ERROR_NULL = 315;
102
- export declare const ERROR_TOO_LONG = 316;
103
- export declare const ERROR_INVALID_KEY_OBJECT = 317;
104
- export declare const ERROR_INVALID = 318;
105
- export declare const ERROR_EMPTY = 319;
106
- export declare const ERROR_EMPTY_ARRAY = 320;
107
- export declare const ERROR_INVALID_CONFIG_PARAM = 321;
108
- export declare const ERROR_HTTP = 322;
109
- export declare const ERROR_STORAGE_INVALID = 324;
110
- export declare const ERROR_NOT_BOOLEAN = 325;
111
- export declare const ERROR_MIN_CONFIG_PARAM = 326;
112
- export declare const ERROR_TOO_MANY_SETS = 327;
113
- export declare const ERROR_SETS_FILTER_EXCLUSIVE = 328;
114
- export declare const ENGINE_MATCHER_ERROR = 329;
115
- export declare const LOG_PREFIX_SETTINGS = "settings";
116
- export declare const LOG_PREFIX_INSTANTIATION = "Factory instantiation";
117
- export declare const LOG_PREFIX_CLIENT_INSTANTIATION = "Client instantiation";
118
- export declare const LOG_PREFIX_ENGINE = "engine";
119
- export declare const LOG_PREFIX_ENGINE_COMBINER: string;
120
- export declare const LOG_PREFIX_ENGINE_MATCHER: string;
121
- export declare const LOG_PREFIX_ENGINE_VALUE: string;
122
- export declare const LOG_PREFIX_SYNC = "sync";
123
- export declare const LOG_PREFIX_SYNC_MANAGER: string;
124
- export declare const LOG_PREFIX_SYNC_OFFLINE: string;
125
- export declare const LOG_PREFIX_SYNC_STREAMING: string;
126
- export declare const LOG_PREFIX_SYNC_SPLITS: string;
127
- export declare const LOG_PREFIX_SYNC_SEGMENTS: string;
128
- export declare const LOG_PREFIX_SYNC_MYSEGMENTS: string;
129
- export declare const LOG_PREFIX_SYNC_POLLING: string;
130
- export declare const LOG_PREFIX_SYNC_SUBMITTERS: string;
131
- export declare const LOG_PREFIX_IMPRESSIONS_TRACKER = "impressions-tracker: ";
132
- export declare const LOG_PREFIX_EVENTS_TRACKER = "events-tracker: ";
133
- export declare const LOG_PREFIX_UNIQUE_KEYS_TRACKER = "unique-keys-tracker: ";
134
- export declare const LOG_PREFIX_CLEANUP = "cleanup: ";
@@ -1,21 +0,0 @@
1
- import { ILoggerOptions, ILogger } from './types';
2
- import { LogLevel } from '../types';
3
- export declare const LogLevels: {
4
- [level: string]: LogLevel;
5
- };
6
- export declare function isLogLevelString(str: string): str is LogLevel;
7
- export declare function _sprintf(format?: string, args?: any[]): string;
8
- export declare class Logger implements ILogger {
9
- private options;
10
- private codes;
11
- private logLevel;
12
- constructor(options?: ILoggerOptions, codes?: Map<number, string>);
13
- setLogLevel(logLevel: LogLevel): void;
14
- debug(msg: string | number, args?: any[]): void;
15
- info(msg: string | number, args?: any[]): void;
16
- warn(msg: string | number, args?: any[]): void;
17
- error(msg: string | number, args?: any[]): void;
18
- private _log;
19
- private _generateLogMessage;
20
- private _shouldLog;
21
- }
@@ -1 +0,0 @@
1
- export declare const codesDebug: [number, string][];
@@ -1 +0,0 @@
1
- export declare const codesError: [number, string][];
@@ -1 +0,0 @@
1
- export declare const codesInfo: [number, string][];
@@ -1 +0,0 @@
1
- export declare const codesWarn: [number, string][];
@@ -1,8 +0,0 @@
1
- import { ILoggerAPI } from '../types';
2
- import { ILogger } from './types';
3
- /**
4
- * The public Logger utility API exposed via SplitFactory, used to update the log level.
5
- *
6
- * @param log the factory logger instance to handle
7
- */
8
- export declare function createLoggerAPI(log: ILogger): ILoggerAPI;
@@ -1,17 +0,0 @@
1
- import { LogLevel } from '../types';
2
- export interface ILoggerOptions {
3
- prefix?: string;
4
- logLevel?: LogLevel;
5
- showLevel?: boolean;
6
- }
7
- export interface ILogger {
8
- setLogLevel(logLevel: LogLevel): void;
9
- debug(msg: any): void;
10
- debug(msg: string | number, args?: any[]): void;
11
- info(msg: any): void;
12
- info(msg: string | number, args?: any[]): void;
13
- warn(msg: any): void;
14
- warn(msg: string | number, args?: any[]): void;
15
- error(msg: any): void;
16
- error(msg: string | number, args?: any[]): void;
17
- }
@@ -1,7 +0,0 @@
1
- export declare const SDK_SPLITS_ARRIVED = "state::splits-arrived";
2
- export declare const SDK_SPLITS_CACHE_LOADED = "state::splits-cache-loaded";
3
- export declare const SDK_SEGMENTS_ARRIVED = "state::segments-arrived";
4
- export declare const SDK_READY_TIMED_OUT = "init::timeout";
5
- export declare const SDK_READY = "init::ready";
6
- export declare const SDK_READY_FROM_CACHE = "init::cache-ready";
7
- export declare const SDK_UPDATE = "state::update";
@@ -1,6 +0,0 @@
1
- import { IEventEmitter, ISettings } from '../types';
2
- import { IReadinessManager, ISplitsEventEmitter } from './types';
3
- /**
4
- * Factory of readiness manager, which handles the ready / update event propagation.
5
- */
6
- export declare function readinessManagerFactory(EventEmitter: new () => IEventEmitter, settings: ISettings, splits?: ISplitsEventEmitter): IReadinessManager;
@@ -1,10 +0,0 @@
1
- import { ISdkReadinessManager } from './types';
2
- import { IEventEmitter, ISettings } from '../types';
3
- /**
4
- * SdkReadinessManager factory, which provides the public status API of SDK clients and manager: ready promise, readiness event emitter and constants (SDK_READY, etc).
5
- * It also updates logs related warnings and errors.
6
- *
7
- * @param readyTimeout time in millis to emit SDK_READY_TIME_OUT event
8
- * @param readinessManager optional readinessManager to use. only used internally for `shared` method
9
- */
10
- export declare function sdkReadinessManagerFactory(EventEmitter: new () => IEventEmitter, settings: ISettings, readinessManager?: import("./types").IReadinessManager): ISdkReadinessManager;
@@ -1,67 +0,0 @@
1
- import { IEventEmitter, IStatusInterface } from '../types';
2
- /** Splits data emitter */
3
- declare type SDK_SPLITS_ARRIVED = 'state::splits-arrived';
4
- declare type SDK_SPLITS_CACHE_LOADED = 'state::splits-cache-loaded';
5
- declare type ISplitsEvent = SDK_SPLITS_ARRIVED | SDK_SPLITS_CACHE_LOADED;
6
- export interface ISplitsEventEmitter extends IEventEmitter {
7
- emit(event: ISplitsEvent, ...args: any[]): boolean;
8
- on(event: ISplitsEvent, listener: (...args: any[]) => void): this;
9
- once(event: ISplitsEvent, listener: (...args: any[]) => void): this;
10
- splitsArrived: boolean;
11
- splitsCacheLoaded: boolean;
12
- initialized: boolean;
13
- initCallbacks: (() => void)[];
14
- }
15
- /** Segments data emitter */
16
- declare type SDK_SEGMENTS_ARRIVED = 'state::segments-arrived';
17
- declare type ISegmentsEvent = SDK_SEGMENTS_ARRIVED;
18
- export interface ISegmentsEventEmitter extends IEventEmitter {
19
- emit(event: ISegmentsEvent, ...args: any[]): boolean;
20
- on(event: ISegmentsEvent, listener: (...args: any[]) => void): this;
21
- once(event: ISegmentsEvent, listener: (...args: any[]) => void): this;
22
- segmentsArrived: boolean;
23
- }
24
- /** Readiness emitter */
25
- export declare type SDK_READY_TIMED_OUT = 'init::timeout';
26
- export declare type SDK_READY = 'init::ready';
27
- export declare type SDK_READY_FROM_CACHE = 'init::cache-ready';
28
- export declare type SDK_UPDATE = 'state::update';
29
- export declare type SDK_DESTROY = 'state::destroy';
30
- export declare type IReadinessEvent = SDK_READY_TIMED_OUT | SDK_READY | SDK_READY_FROM_CACHE | SDK_UPDATE | SDK_DESTROY;
31
- export interface IReadinessEventEmitter extends IEventEmitter {
32
- emit(event: IReadinessEvent, ...args: any[]): boolean;
33
- }
34
- /** Readiness manager */
35
- export interface IReadinessManager {
36
- /** Event emitters */
37
- splits: ISplitsEventEmitter;
38
- segments: ISegmentsEventEmitter;
39
- gate: IReadinessEventEmitter;
40
- /** Readiness status */
41
- isReady(): boolean;
42
- isReadyFromCache(): boolean;
43
- isTimedout(): boolean;
44
- hasTimedout(): boolean;
45
- isDestroyed(): boolean;
46
- isOperational(): boolean;
47
- lastUpdate(): number;
48
- timeout(): void;
49
- setDestroyed(): void;
50
- destroy(): void;
51
- init(): void;
52
- /** for client-side */
53
- shared(): IReadinessManager;
54
- }
55
- /** SDK readiness manager */
56
- export interface ISdkReadinessManager {
57
- readinessManager: IReadinessManager;
58
- sdkStatus: IStatusInterface;
59
- /**
60
- * Increment internalReadyCbCount, an offset value of SDK_READY listeners that are added/removed internally
61
- * by the SDK. It is required to properly log the warning 'No listeners for SDK Readiness detected'
62
- */
63
- incInternalReadyCbCount(): void;
64
- /** for client-side */
65
- shared(): ISdkReadinessManager;
66
- }
67
- export {};
@@ -1,6 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ISdkFactoryContext } from '../sdkFactory/types';
3
- /**
4
- * Creator of base client with getTreatments and track methods.
5
- */
6
- export declare function clientFactory(params: ISdkFactoryContext): SplitIO.IClient | SplitIO.IAsyncClient;
@@ -1,55 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ILogger } from '../logger/types';
3
- /**
4
- * Add in memory attributes storage methods and combine them with any attribute received from the getTreatment/s call
5
- */
6
- export declare function clientAttributesDecoration<TClient extends SplitIO.IClient | SplitIO.IAsyncClient>(log: ILogger, client: TClient): TClient & {
7
- getTreatment: (maybeKey: SplitIO.SplitKey, maybeFeatureFlagName: string, maybeAttributes?: SplitIO.Attributes | undefined) => string | SplitIO.AsyncTreatment;
8
- getTreatmentWithConfig: (maybeKey: SplitIO.SplitKey, maybeFeatureFlagName: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentWithConfig | SplitIO.AsyncTreatmentWithConfig;
9
- getTreatments: (maybeKey: SplitIO.SplitKey, maybeFeatureFlagNames: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
10
- getTreatmentsWithConfig: (maybeKey: SplitIO.SplitKey, maybeFeatureFlagNames: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
11
- getTreatmentsByFlagSets: (maybeKey: SplitIO.SplitKey, maybeFlagSets: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
12
- getTreatmentsWithConfigByFlagSets: (maybeKey: SplitIO.SplitKey, maybeFlagSets: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
13
- getTreatmentsByFlagSet: (maybeKey: SplitIO.SplitKey, maybeFlagSet: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
14
- getTreatmentsWithConfigByFlagSet: (maybeKey: SplitIO.SplitKey, maybeFlagSet: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
15
- track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) => boolean | Promise<boolean>;
16
- /**
17
- * Add an attribute to client's in memory attributes storage
18
- *
19
- * @param {string} attributeName Attrinute name
20
- * @param {string, number, boolean, list} attributeValue Attribute value
21
- * @returns {boolean} true if the attribute was stored and false otherways
22
- */
23
- setAttribute(attributeName: string, attributeValue: SplitIO.AttributeType): boolean;
24
- /**
25
- * Returns the attribute with the given name
26
- *
27
- * @param {string} attributeName Attribute name
28
- * @returns {Object} Attribute with the given name
29
- */
30
- getAttribute(attributeName: string): SplitIO.AttributeType;
31
- /**
32
- * Add to client's in memory attributes storage the attributes in 'attributes'
33
- *
34
- * @param {Object} attributes Object with attributes to store
35
- * @returns true if attributes were stored an false otherways
36
- */
37
- setAttributes(attributes: Record<string, Object>): boolean;
38
- /**
39
- * Return all the attributes stored in client's in memory attributes storage
40
- *
41
- * @returns {Object} returns all the stored attributes
42
- */
43
- getAttributes(): Record<string, SplitIO.AttributeType>;
44
- /**
45
- * Removes from client's in memory attributes storage the attribute with the given name
46
- *
47
- * @param {string} attributeName
48
- * @returns {boolean} true if attribute was removed and false otherways
49
- */
50
- removeAttribute(attributeName: string): boolean;
51
- /**
52
- * Remove all the stored attributes in the client's in memory attribute storage
53
- */
54
- clearAttributes(): boolean;
55
- };
@@ -1,9 +0,0 @@
1
- import { ILogger } from '../logger/types';
2
- import { SplitIO } from '../types';
3
- /**
4
- * Decorator that binds a key to client methods
5
- *
6
- * @param client sync client instance
7
- * @param key validated split key
8
- */
9
- export declare function clientCSDecorator(log: ILogger, client: SplitIO.IClient, key: SplitIO.SplitKey): SplitIO.ICsClient;
@@ -1,7 +0,0 @@
1
- import { IReadinessManager } from '../readiness/types';
2
- import { ISettings, SplitIO } from '../types';
3
- /**
4
- * Decorator that validates the input before actually executing the client methods.
5
- * We should "guard" the client here, while not polluting the "real" implementation of those methods.
6
- */
7
- export declare function clientInputValidationDecorator<TClient extends SplitIO.IClient | SplitIO.IAsyncClient>(settings: ISettings, client: TClient, readinessManager: IReadinessManager): TClient;
@@ -1,2 +0,0 @@
1
- import { SplitIO } from '../types';
2
- export declare function buildInstanceId(key: SplitIO.SplitKey, trafficType?: string): string;
@@ -1,6 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ISdkFactoryContext } from '../sdkFactory/types';
3
- /**
4
- * Creates an Sdk client, i.e., a base client with status and destroy interface
5
- */
6
- export declare function sdkClientFactory(params: ISdkFactoryContext, isSharedClient?: boolean): SplitIO.IClient | SplitIO.IAsyncClient;
@@ -1,6 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ISdkFactoryContext } from '../sdkFactory/types';
3
- /**
4
- * Factory of client method for server-side SDKs
5
- */
6
- export declare function sdkClientMethodFactory(params: ISdkFactoryContext): () => SplitIO.IClient | SplitIO.IAsyncClient;
@@ -1,7 +0,0 @@
1
- import { SplitIO } from '../types';
2
- import { ISdkFactoryContext } from '../sdkFactory/types';
3
- /**
4
- * Factory of client method for the client-side API variant where TT is ignored.
5
- * Therefore, clients don't have a bound TT for the track method.
6
- */
7
- export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitIO.SplitKey) => SplitIO.ICsClient;
@@ -1,6 +0,0 @@
1
- import { ISdkFactoryParams } from './types';
2
- import { SplitIO } from '../types';
3
- /**
4
- * Modular SDK factory
5
- */
6
- export declare function sdkFactory(params: ISdkFactoryParams): SplitIO.ICsSDK | SplitIO.ISDK | SplitIO.IAsyncSDK;
@@ -1,85 +0,0 @@
1
- import { IIntegrationManager, IIntegrationFactoryParams } from '../integrations/types';
2
- import { ISignalListener } from '../listeners/types';
3
- import { IReadinessManager, ISdkReadinessManager } from '../readiness/types';
4
- import type { sdkManagerFactory } from '../sdkManager';
5
- import type { splitApiFactory } from '../services/splitApi';
6
- import { IFetch, ISplitApi, IEventSourceConstructor } from '../services/types';
7
- import { IStorageAsync, IStorageSync, IStorageFactoryParams } from '../storages/types';
8
- import { ISyncManager } from '../sync/types';
9
- import { IImpressionObserver } from '../trackers/impressionObserver/types';
10
- import { IImpressionsTracker, IEventTracker, ITelemetryTracker, IFilterAdapter, IUniqueKeysTracker } from '../trackers/types';
11
- import { SplitIO, ISettings, IEventEmitter, IBasicClient } from '../types';
12
- /**
13
- * Environment related dependencies.
14
- */
15
- export interface IPlatform {
16
- /**
17
- * If provided, it is used to retrieve the Fetch API for HTTP requests. Otherwise, the global fetch is used.
18
- */
19
- getFetch?: (settings: ISettings) => (IFetch | undefined);
20
- /**
21
- * If provided, it is used to pass additional options to fetch and eventsource calls.
22
- */
23
- getOptions?: (settings: ISettings) => object;
24
- /**
25
- * If provided, it is used to retrieve the EventSource constructor for streaming support.
26
- */
27
- getEventSource?: (settings: ISettings) => (IEventSourceConstructor | undefined);
28
- /**
29
- * EventEmitter constructor, like NodeJS.EventEmitter or a polyfill.
30
- */
31
- EventEmitter: new () => IEventEmitter;
32
- /**
33
- * Function used to track latencies for telemetry.
34
- */
35
- now?: () => number;
36
- }
37
- export interface ISdkFactoryContext {
38
- platform: IPlatform;
39
- sdkReadinessManager: ISdkReadinessManager;
40
- readiness: IReadinessManager;
41
- settings: ISettings;
42
- impressionsTracker: IImpressionsTracker;
43
- eventTracker: IEventTracker;
44
- telemetryTracker: ITelemetryTracker;
45
- storage: IStorageSync | IStorageAsync;
46
- uniqueKeysTracker?: IUniqueKeysTracker;
47
- signalListener?: ISignalListener;
48
- splitApi?: ISplitApi;
49
- syncManager?: ISyncManager;
50
- clients: Record<string, IBasicClient>;
51
- }
52
- export interface ISdkFactoryContextSync extends ISdkFactoryContext {
53
- storage: IStorageSync;
54
- splitApi: ISplitApi;
55
- syncManager: ISyncManager;
56
- }
57
- export interface ISdkFactoryContextAsync extends ISdkFactoryContext {
58
- storage: IStorageAsync;
59
- splitApi: undefined;
60
- syncManager: undefined;
61
- }
62
- /**
63
- * Object parameter with the modules required to create an SDK factory instance
64
- */
65
- export interface ISdkFactoryParams {
66
- lazyInit?: boolean;
67
- settings: ISettings;
68
- platform: IPlatform;
69
- storageFactory: (params: IStorageFactoryParams) => IStorageSync | IStorageAsync;
70
- splitApiFactory?: typeof splitApiFactory;
71
- syncManagerFactory?: (params: ISdkFactoryContextSync) => ISyncManager;
72
- sdkManagerFactory: typeof sdkManagerFactory;
73
- sdkClientMethodFactory: (params: ISdkFactoryContext) => ({
74
- (): SplitIO.ICsClient;
75
- (key: SplitIO.SplitKey): SplitIO.ICsClient;
76
- } | (() => SplitIO.IClient) | (() => SplitIO.IAsyncClient));
77
- impressionsObserverFactory: () => IImpressionObserver;
78
- filterAdapterFactory?: () => IFilterAdapter;
79
- SignalListener?: new (syncManager: ISyncManager | undefined, // Used by NodeSignalListener to flush data, and by BrowserSignalListener to close streaming connection.
80
- settings: ISettings, // Used by BrowserSignalListener
81
- storage: IStorageSync | IStorageAsync, // Used by BrowserSignalListener
82
- serviceApi: ISplitApi | undefined) => ISignalListener;
83
- integrationsManagerFactory?: (params: IIntegrationFactoryParams) => IIntegrationManager | undefined;
84
- extraProps?: (params: ISdkFactoryContext) => object;
85
- }
@@ -1,4 +0,0 @@
1
- import { ISplitsCacheAsync, ISplitsCacheSync } from '../storages/types';
2
- import { ISdkReadinessManager } from '../readiness/types';
3
- import { ISettings, SplitIO } from '../types';
4
- export declare function sdkManagerFactory<TSplitCache extends ISplitsCacheSync | ISplitsCacheAsync>(settings: Pick<ISettings, 'log' | 'mode'>, splits: TSplitCache, { readinessManager, sdkStatus }: ISdkReadinessManager): TSplitCache extends ISplitsCacheAsync ? SplitIO.IAsyncManager : SplitIO.IManager;
@@ -1,2 +0,0 @@
1
- import { ISettings } from '../types';
2
- export declare function decorateHeaders(settings: ISettings, headers: Record<string, string>): Record<string, string>;
@@ -1,12 +0,0 @@
1
- import { IPlatform } from '../sdkFactory/types';
2
- import { ISettings } from '../types';
3
- import { ISplitApi } from './types';
4
- import { ITelemetryTracker } from '../trackers/types';
5
- /**
6
- * Factory of SplitApi objects, which group the collection of Split HTTP endpoints used by the SDK
7
- *
8
- * @param settings validated settings object
9
- * @param platform object containing environment-specific dependencies
10
- * @param telemetryTracker telemetry tracker
11
- */
12
- export declare function splitApiFactory(settings: ISettings, platform: Pick<IPlatform, 'getOptions' | 'getFetch'>, telemetryTracker: ITelemetryTracker): ISplitApi;
@@ -1,10 +0,0 @@
1
- import { ISplitHttpClient } from './types';
2
- import { ISettings } from '../types';
3
- import { IPlatform } from '../sdkFactory/types';
4
- /**
5
- * Factory of Split HTTP clients, which are HTTP clients with predefined headers for Split endpoints.
6
- *
7
- * @param settings SDK settings, used to access authorizationKey, logger instance and metadata (SDK version, ip and hostname) to set additional headers
8
- * @param platform object containing environment-specific dependencies
9
- */
10
- export declare function splitHttpClientFactory(settings: ISettings, { getOptions, getFetch }: Pick<IPlatform, 'getOptions' | 'getFetch'>): ISplitHttpClient;
@@ -1,54 +0,0 @@
1
- export declare type IRequestOptions = {
2
- method?: string;
3
- headers?: Record<string, string>;
4
- body?: string;
5
- };
6
- export declare type IResponse = {
7
- ok: boolean;
8
- status: number;
9
- json: () => Promise<any>;
10
- text: () => Promise<string>;
11
- };
12
- export declare type NetworkError = Error & {
13
- statusCode?: number;
14
- };
15
- export declare type IFetch = (url: string, options?: IRequestOptions) => Promise<IResponse>;
16
- export declare type IHealthCheckAPI = () => Promise<boolean>;
17
- export declare type ISplitHttpClient = (url: string, options?: IRequestOptions, latencyTracker?: (error?: NetworkError) => void, logErrorsAsInfo?: boolean) => Promise<IResponse>;
18
- export declare type IFetchAuth = (userKeys?: string[]) => Promise<IResponse>;
19
- export declare type IFetchSplitChanges = (since: number, noCache?: boolean, till?: number) => Promise<IResponse>;
20
- export declare type IFetchSegmentChanges = (since: number, segmentName: string, noCache?: boolean, till?: number) => Promise<IResponse>;
21
- export declare type IFetchMemberships = (userMatchingKey: string, noCache?: boolean, till?: number) => Promise<IResponse>;
22
- export declare type IPostEventsBulk = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
23
- export declare type IPostUniqueKeysBulkCs = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
24
- export declare type IPostUniqueKeysBulkSs = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
25
- export declare type IPostTestImpressionsBulk = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
26
- export declare type IPostTestImpressionsCount = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
27
- export declare type IPostMetricsConfig = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
28
- export declare type IPostMetricsUsage = (body: string, headers?: Record<string, string>) => Promise<IResponse>;
29
- export interface ISplitApi {
30
- getSdkAPIHealthCheck: IHealthCheckAPI;
31
- getEventsAPIHealthCheck: IHealthCheckAPI;
32
- fetchAuth: IFetchAuth;
33
- fetchSplitChanges: IFetchSplitChanges;
34
- fetchSegmentChanges: IFetchSegmentChanges;
35
- fetchMemberships: IFetchMemberships;
36
- postEventsBulk: IPostEventsBulk;
37
- postUniqueKeysBulkCs: IPostUniqueKeysBulkCs;
38
- postUniqueKeysBulkSs: IPostUniqueKeysBulkSs;
39
- postTestImpressionsBulk: IPostTestImpressionsBulk;
40
- postTestImpressionsCount: IPostTestImpressionsCount;
41
- postMetricsConfig: IPostMetricsConfig;
42
- postMetricsUsage: IPostMetricsUsage;
43
- }
44
- interface EventSourceEventMap {
45
- 'error': Event;
46
- 'message': MessageEvent;
47
- 'open': Event;
48
- }
49
- interface IEventSource {
50
- addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: IEventSource, ev: EventSourceEventMap[K]) => any): void;
51
- close(): void;
52
- }
53
- export declare type IEventSourceConstructor = new (url: string, eventSourceInitDict?: any) => IEventSource;
54
- export {};
@@ -1,39 +0,0 @@
1
- import { IMySegmentsResponse } from '../dtos/types';
2
- import { MySegmentsData } from '../sync/polling/types';
3
- import { ISegmentsCacheSync } from './types';
4
- /**
5
- * This class provides a skeletal implementation of the ISegmentsCacheSync interface
6
- * to minimize the effort required to implement this interface.
7
- */
8
- export declare abstract class AbstractMySegmentsCacheSync implements ISegmentsCacheSync {
9
- protected abstract addSegment(name: string): boolean;
10
- protected abstract removeSegment(name: string): boolean;
11
- protected abstract setChangeNumber(changeNumber?: number): boolean | void;
12
- /**
13
- * For server-side synchronizer: check if `key` is in `name` segment.
14
- * For client-side synchronizer: check if `name` segment is in the cache. `key` is undefined.
15
- */
16
- abstract isInSegment(name: string, key?: string): boolean;
17
- /**
18
- * clear the cache.
19
- */
20
- clear(): void;
21
- registerSegments(): boolean;
22
- update(): boolean;
23
- /**
24
- * For server-side synchronizer: get the list of segments to fetch changes.
25
- * Also used for the `seC` (segment count) telemetry stat.
26
- */
27
- abstract getRegisteredSegments(): string[];
28
- /**
29
- * Only used for the `skC`(segment keys count) telemetry stat: 1 for client-side, and total count of keys in server-side.
30
- * @TODO for client-side it should be the number of clients, but it requires a refactor of MySegments caches to simplify the code.
31
- */
32
- abstract getKeysCount(): number;
33
- abstract getChangeNumber(name: string): number;
34
- /**
35
- * For server-side synchronizer: the method is not used.
36
- * For client-side synchronizer: it resets or updates the cache.
37
- */
38
- resetSegments(segmentsData: MySegmentsData | IMySegmentsResponse): boolean;
39
- }