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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/cjs/sdkClient/clientAttributesDecoration.js +1 -1
  2. package/cjs/storages/inMemory/AttributesCacheInMemory.js +1 -1
  3. package/esm/sdkClient/clientAttributesDecoration.js +1 -1
  4. package/esm/storages/inMemory/AttributesCacheInMemory.js +1 -1
  5. package/package.json +4 -5
  6. package/src/sdkClient/clientAttributesDecoration.ts +6 -6
  7. package/src/sdkClient/clientCS.ts +3 -3
  8. package/src/sdkClient/sdkClientMethodCSWithTT.ts +3 -3
  9. package/src/storages/inMemory/AttributesCacheInMemory.ts +13 -12
  10. package/src/types.d.ts +5 -70
  11. package/types/consent/index.d.ts +0 -2
  12. package/types/consent/sdkUserConsent.d.ts +0 -6
  13. package/types/dtos/types.d.ts +0 -166
  14. package/types/evaluator/Engine.d.ts +0 -15
  15. package/types/evaluator/combiners/and.d.ts +0 -4
  16. package/types/evaluator/combiners/ifelseif.d.ts +0 -3
  17. package/types/evaluator/condition/engineUtils.d.ts +0 -11
  18. package/types/evaluator/condition/index.d.ts +0 -6
  19. package/types/evaluator/convertions/index.d.ts +0 -2
  20. package/types/evaluator/index.d.ts +0 -7
  21. package/types/evaluator/matchers/all.d.ts +0 -2
  22. package/types/evaluator/matchers/between.d.ts +0 -3
  23. package/types/evaluator/matchers/boolean.d.ts +0 -2
  24. package/types/evaluator/matchers/cont_all.d.ts +0 -2
  25. package/types/evaluator/matchers/cont_any.d.ts +0 -2
  26. package/types/evaluator/matchers/cont_str.d.ts +0 -2
  27. package/types/evaluator/matchers/dependency.d.ts +0 -5
  28. package/types/evaluator/matchers/eq.d.ts +0 -2
  29. package/types/evaluator/matchers/eq_set.d.ts +0 -2
  30. package/types/evaluator/matchers/ew.d.ts +0 -2
  31. package/types/evaluator/matchers/gte.d.ts +0 -2
  32. package/types/evaluator/matchers/index.d.ts +0 -7
  33. package/types/evaluator/matchers/lte.d.ts +0 -2
  34. package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
  35. package/types/evaluator/matchers/part_of.d.ts +0 -2
  36. package/types/evaluator/matchers/segment.d.ts +0 -6
  37. package/types/evaluator/matchers/string.d.ts +0 -2
  38. package/types/evaluator/matchers/sw.d.ts +0 -2
  39. package/types/evaluator/matchers/whitelist.d.ts +0 -3
  40. package/types/evaluator/matchersTransform/index.d.ts +0 -6
  41. package/types/evaluator/matchersTransform/segment.d.ts +0 -5
  42. package/types/evaluator/matchersTransform/set.d.ts +0 -5
  43. package/types/evaluator/matchersTransform/unaryNumeric.d.ts +0 -5
  44. package/types/evaluator/matchersTransform/whitelist.d.ts +0 -5
  45. package/types/evaluator/parser/index.d.ts +0 -5
  46. package/types/evaluator/treatments/index.d.ts +0 -8
  47. package/types/evaluator/types.d.ts +0 -28
  48. package/types/evaluator/value/index.d.ts +0 -7
  49. package/types/evaluator/value/sanitize.d.ts +0 -7
  50. package/types/index.d.ts +0 -5
  51. package/types/integrations/browser.d.ts +0 -12
  52. package/types/integrations/ga/GaToSplit.d.ts +0 -40
  53. package/types/integrations/ga/GoogleAnalyticsToSplit.d.ts +0 -3
  54. package/types/integrations/ga/SplitToGa.d.ts +0 -34
  55. package/types/integrations/ga/SplitToGoogleAnalytics.d.ts +0 -3
  56. package/types/integrations/ga/types.d.ts +0 -148
  57. package/types/integrations/pluggable.d.ts +0 -11
  58. package/types/integrations/types.d.ts +0 -17
  59. package/types/listeners/browser.d.ts +0 -40
  60. package/types/listeners/node.d.ts +0 -22
  61. package/types/listeners/types.d.ts +0 -4
  62. package/types/logger/browser/DebugLogger.d.ts +0 -2
  63. package/types/logger/browser/ErrorLogger.d.ts +0 -2
  64. package/types/logger/browser/InfoLogger.d.ts +0 -2
  65. package/types/logger/browser/WarnLogger.d.ts +0 -2
  66. package/types/logger/constants.d.ts +0 -141
  67. package/types/logger/index.d.ts +0 -20
  68. package/types/logger/messages/debug.d.ts +0 -1
  69. package/types/logger/messages/error.d.ts +0 -1
  70. package/types/logger/messages/info.d.ts +0 -1
  71. package/types/logger/messages/warn.d.ts +0 -1
  72. package/types/logger/sdkLogger.d.ts +0 -7
  73. package/types/logger/types.d.ts +0 -6
  74. package/types/readiness/constants.d.ts +0 -7
  75. package/types/readiness/readinessManager.d.ts +0 -6
  76. package/types/readiness/sdkReadinessManager.d.ts +0 -11
  77. package/types/readiness/types.d.ts +0 -54
  78. package/types/sdkClient/client.d.ts +0 -6
  79. package/types/sdkClient/clientAttributesDecoration.d.ts +0 -51
  80. package/types/sdkClient/clientCS.d.ts +0 -9
  81. package/types/sdkClient/clientInputValidation.d.ts +0 -7
  82. package/types/sdkClient/sdkClient.d.ts +0 -6
  83. package/types/sdkClient/sdkClientMethod.d.ts +0 -6
  84. package/types/sdkClient/sdkClientMethodCS.d.ts +0 -7
  85. package/types/sdkClient/sdkClientMethodCSWithTT.d.ts +0 -8
  86. package/types/sdkFactory/index.d.ts +0 -6
  87. package/types/sdkFactory/types.d.ts +0 -80
  88. package/types/sdkManager/index.d.ts +0 -5
  89. package/types/services/splitApi.d.ts +0 -11
  90. package/types/services/splitHttpClient.d.ts +0 -10
  91. package/types/services/types.d.ts +0 -50
  92. package/types/storages/AbstractSegmentsCacheSync.d.ts +0 -55
  93. package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -36
  94. package/types/storages/AbstractSplitsCacheSync.d.ts +0 -42
  95. package/types/storages/KeyBuilder.d.ts +0 -14
  96. package/types/storages/KeyBuilderCS.d.ts +0 -16
  97. package/types/storages/KeyBuilderSS.d.ts +0 -15
  98. package/types/storages/dataLoader.d.ts +0 -10
  99. package/types/storages/findLatencyIndex.d.ts +0 -7
  100. package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -25
  101. package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -50
  102. package/types/storages/inLocalStorage/constants.d.ts +0 -2
  103. package/types/storages/inLocalStorage/index.d.ts +0 -8
  104. package/types/storages/inMemory/AttributesCacheInMemory.d.ts +0 -43
  105. package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
  106. package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -24
  107. package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +0 -30
  108. package/types/storages/inMemory/InMemoryStorage.d.ts +0 -10
  109. package/types/storages/inMemory/InMemoryStorageCS.d.ts +0 -10
  110. package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +0 -22
  111. package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -19
  112. package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -20
  113. package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -53
  114. package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
  115. package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -18
  116. package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
  117. package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -18
  118. package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -91
  119. package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -20
  120. package/types/storages/inRedis/constants.d.ts +0 -1
  121. package/types/storages/inRedis/index.d.ts +0 -10
  122. package/types/storages/metadataBuilder.d.ts +0 -3
  123. package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
  124. package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -35
  125. package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -54
  126. package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -89
  127. package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -18
  128. package/types/storages/pluggable/constants.d.ts +0 -1
  129. package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -13
  130. package/types/storages/pluggable/index.d.ts +0 -10
  131. package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
  132. package/types/storages/types.d.ts +0 -430
  133. package/types/sync/offline/LocalhostFromObject.d.ts +0 -2
  134. package/types/sync/offline/splitsParser/parseCondition.d.ts +0 -7
  135. package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +0 -3
  136. package/types/sync/offline/splitsParser/types.d.ts +0 -3
  137. package/types/sync/offline/syncManagerOffline.d.ts +0 -10
  138. package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +0 -17
  139. package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +0 -7
  140. package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +0 -7
  141. package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +0 -7
  142. package/types/sync/polling/fetchers/types.d.ts +0 -5
  143. package/types/sync/polling/pollingManagerCS.d.ts +0 -7
  144. package/types/sync/polling/pollingManagerSS.d.ts +0 -6
  145. package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +0 -9
  146. package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +0 -9
  147. package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +0 -9
  148. package/types/sync/polling/types.d.ts +0 -26
  149. package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -13
  150. package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
  151. package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -39
  152. package/types/sync/streaming/AuthClient/index.d.ts +0 -12
  153. package/types/sync/streaming/AuthClient/types.d.ts +0 -17
  154. package/types/sync/streaming/SSEClient/index.d.ts +0 -34
  155. package/types/sync/streaming/SSEClient/types.d.ts +0 -11
  156. package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +0 -14
  157. package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +0 -20
  158. package/types/sync/streaming/SSEHandler/index.d.ts +0 -11
  159. package/types/sync/streaming/SSEHandler/types.d.ts +0 -67
  160. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -6
  161. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -8
  162. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -12
  163. package/types/sync/streaming/UpdateWorkers/constants.d.ts +0 -3
  164. package/types/sync/streaming/UpdateWorkers/types.d.ts +0 -4
  165. package/types/sync/streaming/constants.d.ts +0 -34
  166. package/types/sync/streaming/mySegmentsV2utils.d.ts +0 -27
  167. package/types/sync/streaming/pushManager.d.ts +0 -9
  168. package/types/sync/streaming/types.d.ts +0 -35
  169. package/types/sync/submitters/eventsSubmitter.d.ts +0 -5
  170. package/types/sync/submitters/impressionCountsSubmitter.d.ts +0 -10
  171. package/types/sync/submitters/impressionsSubmitter.d.ts +0 -11
  172. package/types/sync/submitters/submitter.d.ts +0 -12
  173. package/types/sync/submitters/submitterManager.d.ts +0 -3
  174. package/types/sync/submitters/telemetrySubmitter.d.ts +0 -25
  175. package/types/sync/submitters/types.d.ts +0 -177
  176. package/types/sync/syncManagerOnline.d.ts +0 -13
  177. package/types/sync/syncTask.d.ts +0 -13
  178. package/types/sync/types.d.ts +0 -43
  179. package/types/trackers/eventTracker.d.ts +0 -10
  180. package/types/trackers/impressionObserver/ImpressionObserver.d.ts +0 -8
  181. package/types/trackers/impressionObserver/buildKey.d.ts +0 -2
  182. package/types/trackers/impressionObserver/impressionObserverCS.d.ts +0 -4
  183. package/types/trackers/impressionObserver/impressionObserverSS.d.ts +0 -4
  184. package/types/trackers/impressionObserver/types.d.ts +0 -4
  185. package/types/trackers/impressionObserver/utils.d.ts +0 -13
  186. package/types/trackers/impressionsTracker.d.ts +0 -15
  187. package/types/trackers/telemetryTracker.d.ts +0 -3
  188. package/types/trackers/types.d.ts +0 -36
  189. package/types/utils/Backoff.d.ts +0 -25
  190. package/types/utils/LRUCache/LinkedList.d.ts +0 -34
  191. package/types/utils/LRUCache/index.d.ts +0 -16
  192. package/types/utils/MinEventEmitter.d.ts +0 -12
  193. package/types/utils/MinEvents.d.ts +0 -4
  194. package/types/utils/base64/index.d.ts +0 -30
  195. package/types/utils/constants/browser.d.ts +0 -3
  196. package/types/utils/constants/index.d.ts +0 -62
  197. package/types/utils/decompress/index.d.ts +0 -16
  198. package/types/utils/env/isLocalStorageAvailable.d.ts +0 -1
  199. package/types/utils/env/isNode.d.ts +0 -5
  200. package/types/utils/inputValidation/apiKey.d.ts +0 -7
  201. package/types/utils/inputValidation/attribute.d.ts +0 -2
  202. package/types/utils/inputValidation/attributes.d.ts +0 -4
  203. package/types/utils/inputValidation/event.d.ts +0 -2
  204. package/types/utils/inputValidation/eventProperties.d.ts +0 -6
  205. package/types/utils/inputValidation/eventValue.d.ts +0 -2
  206. package/types/utils/inputValidation/index.d.ts +0 -13
  207. package/types/utils/inputValidation/isOperational.d.ts +0 -4
  208. package/types/utils/inputValidation/key.d.ts +0 -3
  209. package/types/utils/inputValidation/preloadedData.d.ts +0 -3
  210. package/types/utils/inputValidation/split.d.ts +0 -2
  211. package/types/utils/inputValidation/splitExistance.d.ts +0 -7
  212. package/types/utils/inputValidation/splits.d.ts +0 -2
  213. package/types/utils/inputValidation/trafficType.d.ts +0 -2
  214. package/types/utils/inputValidation/trafficTypeExistance.d.ts +0 -9
  215. package/types/utils/jwt/index.d.ts +0 -5
  216. package/types/utils/jwt/types.d.ts +0 -5
  217. package/types/utils/key/index.d.ts +0 -8
  218. package/types/utils/labels/index.d.ts +0 -7
  219. package/types/utils/lang/binarySearch.d.ts +0 -9
  220. package/types/utils/lang/getFnName.d.ts +0 -4
  221. package/types/utils/lang/getGlobal.d.ts +0 -4
  222. package/types/utils/lang/index.d.ts +0 -105
  223. package/types/utils/lang/maps.d.ts +0 -55
  224. package/types/utils/lang/objectAssign.d.ts +0 -3
  225. package/types/utils/lang/sets.d.ts +0 -60
  226. package/types/utils/murmur3/common.d.ts +0 -12
  227. package/types/utils/murmur3/legacy.d.ts +0 -2
  228. package/types/utils/murmur3/murmur3.d.ts +0 -2
  229. package/types/utils/murmur3/murmur3_128.d.ts +0 -6
  230. package/types/utils/murmur3/murmur3_128_x86.d.ts +0 -7
  231. package/types/utils/murmur3/murmur3_64.d.ts +0 -10
  232. package/types/utils/murmur3/utfx.d.ts +0 -27
  233. package/types/utils/promise/thenable.d.ts +0 -1
  234. package/types/utils/promise/timeout.d.ts +0 -1
  235. package/types/utils/promise/wrapper.d.ts +0 -21
  236. package/types/utils/settingsValidation/consent.d.ts +0 -5
  237. package/types/utils/settingsValidation/impressionsMode.d.ts +0 -3
  238. package/types/utils/settingsValidation/index.d.ts +0 -51
  239. package/types/utils/settingsValidation/integrations/common.d.ts +0 -14
  240. package/types/utils/settingsValidation/integrations/configurable.d.ts +0 -13
  241. package/types/utils/settingsValidation/integrations/pluggable.d.ts +0 -12
  242. package/types/utils/settingsValidation/localhost/builtin.d.ts +0 -15
  243. package/types/utils/settingsValidation/localhost/pluggable.d.ts +0 -15
  244. package/types/utils/settingsValidation/logger/builtinLogger.d.ts +0 -10
  245. package/types/utils/settingsValidation/logger/commons.d.ts +0 -9
  246. package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +0 -11
  247. package/types/utils/settingsValidation/mode.d.ts +0 -1
  248. package/types/utils/settingsValidation/runtime.d.ts +0 -2
  249. package/types/utils/settingsValidation/splitFilters.d.ts +0 -15
  250. package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -20
  251. package/types/utils/settingsValidation/types.d.ts +0 -32
  252. package/types/utils/settingsValidation/url.d.ts +0 -10
  253. package/types/utils/time/index.d.ts +0 -4
  254. package/types/utils/timeTracker/now/browser.d.ts +0 -1
  255. package/types/utils/timeTracker/now/node.d.ts +0 -1
  256. package/types/utils/timeTracker/timer.d.ts +0 -1
@@ -1,91 +0,0 @@
1
- import { KeyBuilderSS } from '../KeyBuilderSS';
2
- import { Redis } from 'ioredis';
3
- import { ILogger } from '../../types';
4
- import { AbstractSplitsCacheAsync } from '../AbstractSplitsCacheAsync';
5
- /**
6
- * ISplitsCacheAsync implementation that stores split definitions in Redis.
7
- * Supported by Node.
8
- */
9
- export declare class SplitsCacheInRedis extends AbstractSplitsCacheAsync {
10
- private readonly log;
11
- private readonly redis;
12
- private readonly keys;
13
- private redisError?;
14
- constructor(log: ILogger, keys: KeyBuilderSS, redis: Redis);
15
- private _decrementCounts;
16
- private _incrementCounts;
17
- /**
18
- * Add a given split.
19
- * The returned promise is resolved when the operation success
20
- * or rejected if it fails (e.g., redis operation fails)
21
- */
22
- addSplit(name: string, split: string): Promise<boolean>;
23
- /**
24
- * Add a list of splits.
25
- * The returned promise is resolved when the operation success
26
- * or rejected if it fails (e.g., redis operation fails)
27
- */
28
- addSplits(entries: [string, string][]): Promise<boolean[]>;
29
- /**
30
- * Remove a given split.
31
- * The returned promise is resolved when the operation success, with 1 or 0 indicating if the split existed or not.
32
- * or rejected if it fails (e.g., redis operation fails).
33
- */
34
- removeSplit(name: string): Promise<number>;
35
- /**
36
- * Remove a list of splits.
37
- * The returned promise is resolved when the operation success,
38
- * or rejected if it fails (e.g., redis operation fails).
39
- */
40
- removeSplits(names: string[]): Promise<any>;
41
- /**
42
- * Get split definition or null if it's not defined.
43
- * Returned promise is rejected if redis operation fails.
44
- */
45
- getSplit(name: string): Promise<string | null>;
46
- /**
47
- * Set till number.
48
- * The returned promise is resolved when the operation success,
49
- * or rejected if it fails.
50
- */
51
- setChangeNumber(changeNumber: number): Promise<boolean>;
52
- /**
53
- * Get till number or -1 if it's not defined.
54
- * The returned promise is resolved with the changeNumber or -1 if it doesn't exist or a redis operation fails.
55
- * The promise will never be rejected.
56
- */
57
- getChangeNumber(): Promise<number>;
58
- /**
59
- * Get list of all split definitions.
60
- * The returned promise is resolved with the list of split definitions,
61
- * or rejected if redis operation fails.
62
- *
63
- * @TODO we need to benchmark which is the maximun number of commands we could
64
- * pipeline without kill redis performance.
65
- */
66
- getAll(): Promise<string[]>;
67
- /**
68
- * Get list of split names.
69
- * The returned promise is resolved with the list of split names,
70
- * or rejected if redis operation fails.
71
- */
72
- getSplitNames(): Promise<string[]>;
73
- /**
74
- * Check traffic type existence.
75
- * The returned promise is resolved with a boolean indicating whether the TT exist or not.
76
- * In case of redis operation failure, the promise resolves with a true value, assuming that the TT might exist.
77
- * It will never be rejected.
78
- */
79
- trafficTypeExists(trafficType: string): Promise<boolean>;
80
- /**
81
- * Delete everything in the current database.
82
- *
83
- * @NOTE documentation says it never fails.
84
- */
85
- clear(): Promise<boolean>;
86
- /**
87
- * Fetches multiple splits definitions.
88
- * Returned promise is rejected if redis operation fails.
89
- */
90
- getSplits(names: string[]): Promise<Record<string, string | null>>;
91
- }
@@ -1,20 +0,0 @@
1
- import { ILogger } from '../../types';
2
- import { Method } from '../../sync/submitters/types';
3
- import { KeyBuilderSS } from '../KeyBuilderSS';
4
- import { ITelemetryCacheAsync } from '../types';
5
- import { Redis } from 'ioredis';
6
- export declare class TelemetryCacheInRedis implements ITelemetryCacheAsync {
7
- private readonly log;
8
- private readonly keys;
9
- private readonly redis;
10
- /**
11
- * Create a Telemetry cache that uses Redis as storage.
12
- * @param log Logger instance.
13
- * @param keys Key builder.
14
- * @param redis Redis client.
15
- */
16
- constructor(log: ILogger, keys: KeyBuilderSS, redis: Redis);
17
- recordLatency(method: Method, latencyMs: number): Promise<number | void>;
18
- recordException(method: Method): Promise<number | void>;
19
- recordConfig(): Promise<number | void>;
20
- }
@@ -1 +0,0 @@
1
- export declare const LOG_PREFIX = "storage:redis: ";
@@ -1,10 +0,0 @@
1
- import { StorageAsyncFactory } from '../../types';
2
- export interface InRedisStorageOptions {
3
- prefix?: string;
4
- options?: Record<string, any>;
5
- }
6
- /**
7
- * InRedis storage factory for consumer server-side SplitFactory, that uses `Ioredis` Redis client for Node.
8
- * @see {@link https://www.npmjs.com/package/ioredis}
9
- */
10
- export declare function InRedisStorage(options?: InRedisStorageOptions): StorageAsyncFactory;
@@ -1,3 +0,0 @@
1
- import { IMetadata } from '../dtos/types';
2
- import { ISettings } from '../types';
3
- export declare function metadataBuilder(settings: Pick<ISettings, 'version' | 'runtime'>): IMetadata;
@@ -1,38 +0,0 @@
1
- import { IPluggableStorageWrapper, IEventsCacheAsync } from '../types';
2
- import { IMetadata } from '../../dtos/types';
3
- import { EventData } from '../../types';
4
- import { ILogger } from '../../types';
5
- import { StoredEventWithMetadata } from '../../sync/submitters/types';
6
- export declare class EventsCachePluggable implements IEventsCacheAsync {
7
- private readonly log;
8
- private readonly wrapper;
9
- private readonly key;
10
- private readonly metadata;
11
- constructor(log: ILogger, key: string, wrapper: IPluggableStorageWrapper, metadata: IMetadata);
12
- /**
13
- * Push given event to the storage.
14
- * @param eventData Event item to push.
15
- * @returns A promise that is resolved with a boolean value indicating if the push operation succeeded or failed.
16
- * Unlike `impressions::track`, The promise will never be rejected.
17
- */
18
- track(eventData: EventData): Promise<boolean>;
19
- private _toJSON;
20
- /**
21
- * Returns a promise that resolves with the count of stored events, or 0 if there was some error.
22
- * The promise will never be rejected.
23
- */
24
- count(): Promise<number>;
25
- /**
26
- * Removes the given number of events from the store. If a number is not provided, it deletes all items.
27
- * The returned promise rejects if the wrapper operation fails.
28
- */
29
- drop(count?: number): Promise<any>;
30
- /**
31
- * Pop the given number of events from the storage.
32
- * The returned promise rejects if the wrapper operation fails.
33
- *
34
- * NOTE: this method doesn't take into account MAX_EVENT_SIZE or MAX_QUEUE_BYTE_SIZE limits.
35
- * It is the submitter responsability to handle that.
36
- */
37
- popNWithMetadata(count: number): Promise<StoredEventWithMetadata[]>;
38
- }
@@ -1,35 +0,0 @@
1
- import { IPluggableStorageWrapper, IImpressionsCacheAsync } from '../types';
2
- import { IMetadata } from '../../dtos/types';
3
- import { ImpressionDTO } from '../../types';
4
- import { ILogger } from '../../types';
5
- import { StoredImpressionWithMetadata } from '../../sync/submitters/types';
6
- export declare class ImpressionsCachePluggable implements IImpressionsCacheAsync {
7
- private readonly log;
8
- private readonly key;
9
- private readonly wrapper;
10
- private readonly metadata;
11
- constructor(log: ILogger, key: string, wrapper: IPluggableStorageWrapper, metadata: IMetadata);
12
- /**
13
- * Push given impressions to the storage.
14
- * @param impressions List of impresions to push.
15
- * @returns A promise that is resolved if the push operation succeeded
16
- * or rejected if the wrapper operation fails.
17
- */
18
- track(impressions: ImpressionDTO[]): Promise<void>;
19
- private _toJSON;
20
- /**
21
- * Returns a promise that resolves with the count of stored impressions, or 0 if there was some error.
22
- * The promise will never be rejected.
23
- */
24
- count(): Promise<number>;
25
- /**
26
- * Removes the given number of impressions from the store. If a number is not provided, it deletes all items.
27
- * The returned promise rejects if the wrapper operation fails.
28
- */
29
- drop(count?: number): Promise<void>;
30
- /**
31
- * Pop the given number of impressions from the store.
32
- * The returned promise rejects if the wrapper operation fails.
33
- */
34
- popNWithMetadata(count: number): Promise<StoredImpressionWithMetadata[]>;
35
- }
@@ -1,54 +0,0 @@
1
- import { KeyBuilderSS } from '../KeyBuilderSS';
2
- import { IPluggableStorageWrapper, ISegmentsCacheAsync } from '../types';
3
- import { ILogger } from '../../types';
4
- /**
5
- * ISegmentsCacheAsync implementation for pluggable storages.
6
- */
7
- export declare class SegmentsCachePluggable implements ISegmentsCacheAsync {
8
- private readonly log;
9
- private readonly keys;
10
- private readonly wrapper;
11
- constructor(log: ILogger, keys: KeyBuilderSS, wrapper: IPluggableStorageWrapper);
12
- /**
13
- * Add a list of `segmentKeys` to the given segment `name`.
14
- * The returned promise is resolved when the operation success
15
- * or rejected if wrapper operation fails.
16
- */
17
- addToSegment(name: string, segmentKeys: string[]): Promise<boolean | void>;
18
- /**
19
- * Remove a list of `segmentKeys` from the given segment `name`.
20
- * The returned promise is resolved when the operation success
21
- * or rejected if wrapper operation fails.
22
- */
23
- removeFromSegment(name: string, segmentKeys: string[]): Promise<boolean | void>;
24
- /**
25
- * Returns a promise that resolves with a boolean value indicating if `key` is part of `name` segment.
26
- * Promise can be rejected if wrapper operation fails.
27
- */
28
- isInSegment(name: string, key: string): Promise<boolean>;
29
- /**
30
- * Set till number for the given segment `name`.
31
- * The returned promise is resolved when the operation success,
32
- * or rejected if it fails (e.g., wrapper operation fails).
33
- */
34
- setChangeNumber(name: string, changeNumber: number): Promise<boolean | void>;
35
- /**
36
- * Get till number or -1 if it's not defined.
37
- * The returned promise is resolved with the changeNumber or -1 if it doesn't exist or a wrapper operation fails.
38
- * The promise will never be rejected.
39
- */
40
- getChangeNumber(name: string): Promise<number>;
41
- /**
42
- * Add the given segment names to the set of registered segments.
43
- * The returned promise is resolved when the operation success,
44
- * or rejected if it fails (e.g., wrapper operation fails).
45
- */
46
- registerSegments(segments: string[]): Promise<boolean | void>;
47
- /**
48
- * Returns a promise that resolves with the set of registered segments in a list,
49
- * or rejected if it fails (e.g., wrapper operation fails).
50
- */
51
- getRegisteredSegments(): Promise<string[]>;
52
- /** @TODO implement if required by DataLoader or Producer mode */
53
- clear(): Promise<boolean>;
54
- }
@@ -1,89 +0,0 @@
1
- import { KeyBuilder } from '../KeyBuilder';
2
- import { IPluggableStorageWrapper } from '../types';
3
- import { ILogger } from '../../types';
4
- import { AbstractSplitsCacheAsync } from '../AbstractSplitsCacheAsync';
5
- /**
6
- * ISplitsCacheAsync implementation for pluggable storages.
7
- */
8
- export declare class SplitsCachePluggable extends AbstractSplitsCacheAsync {
9
- private readonly log;
10
- private readonly keys;
11
- private readonly wrapper;
12
- /**
13
- * Create a SplitsCache that uses a storage wrapper.
14
- * @param log Logger instance.
15
- * @param keys Key builder.
16
- * @param wrapper Adapted wrapper storage.
17
- */
18
- constructor(log: ILogger, keys: KeyBuilder, wrapper: IPluggableStorageWrapper);
19
- private _decrementCounts;
20
- private _incrementCounts;
21
- /**
22
- * Add a given split.
23
- * The returned promise is resolved when the operation success
24
- * or rejected if it fails (e.g., wrapper operation fails)
25
- */
26
- addSplit(name: string, split: string): Promise<boolean>;
27
- /**
28
- * Add a list of splits.
29
- * The returned promise is resolved when the operation success
30
- * or rejected if it fails (e.g., wrapper operation fails)
31
- */
32
- addSplits(entries: [string, string][]): Promise<boolean[]>;
33
- /**
34
- * Remove a given split.
35
- * The returned promise is resolved when the operation success, with a boolean indicating if the split existed or not.
36
- * or rejected if it fails (e.g., wrapper operation fails).
37
- */
38
- removeSplit(name: string): Promise<boolean | void>;
39
- /**
40
- * Remove a list of splits.
41
- * The returned promise is resolved when the operation success, with a boolean array indicating if the splits existed or not.
42
- * or rejected if it fails (e.g., wrapper operation fails).
43
- */
44
- removeSplits(names: string[]): Promise<void>;
45
- /**
46
- * Get split.
47
- * The returned promise is resolved with the split definition or null if it's not defined,
48
- * or rejected if wrapper operation fails.
49
- */
50
- getSplit(name: string): Promise<string | null>;
51
- /**
52
- * Get list of splits.
53
- * The returned promise is resolved with a map of split names to their split definition or null if it's not defined,
54
- * or rejected if wrapper operation fails.
55
- */
56
- getSplits(names: string[]): Promise<Record<string, string | null>>;
57
- /**
58
- * Get list of all split definitions.
59
- * The returned promise is resolved with the list of split definitions,
60
- * or rejected if wrapper operation fails.
61
- */
62
- getAll(): Promise<string[]>;
63
- /**
64
- * Get list of split names.
65
- * The returned promise is resolved with the list of split names,
66
- * or rejected if wrapper operation fails.
67
- */
68
- getSplitNames(): Promise<string[]>;
69
- /**
70
- * Check traffic type existence.
71
- * The returned promise is resolved with a boolean indicating whether the TT exist or not.
72
- * In case of wrapper operation failures, the promise resolves with a true value, assuming that the TT might exist.
73
- * It will never be rejected.
74
- */
75
- trafficTypeExists(trafficType: string): Promise<boolean>;
76
- /**
77
- * Set till number.
78
- * The returned promise is resolved when the operation success,
79
- * or rejected if it fails (e.g., wrapper operation fails).
80
- */
81
- setChangeNumber(changeNumber: number): Promise<boolean | void>;
82
- /**
83
- * Get till number or -1 if it's not defined.
84
- * The returned promise is resolved with the changeNumber or -1 if it doesn't exist or a wrapper operation fails.
85
- * The promise will never be rejected.
86
- */
87
- getChangeNumber(): Promise<number>;
88
- clear(): Promise<boolean>;
89
- }
@@ -1,18 +0,0 @@
1
- import { ILogger } from '../../types';
2
- import { Method } from '../../sync/submitters/types';
3
- import { KeyBuilderSS } from '../KeyBuilderSS';
4
- import { IPluggableStorageWrapper, ITelemetryCacheAsync } from '../types';
5
- export declare class TelemetryCachePluggable implements ITelemetryCacheAsync {
6
- private readonly log;
7
- private readonly keys;
8
- private readonly wrapper;
9
- /**
10
- * Create a Telemetry cache that uses a storage wrapper.
11
- * @param log Logger instance.
12
- * @param keys Key builder.
13
- * @param wrapper Adapted wrapper storage.
14
- */
15
- constructor(log: ILogger, keys: KeyBuilderSS, wrapper: IPluggableStorageWrapper);
16
- recordLatency(method: Method, latencyMs: number): Promise<number | void>;
17
- recordException(method: Method): Promise<number | void>;
18
- }
@@ -1 +0,0 @@
1
- export declare const LOG_PREFIX = "storage:pluggable: ";
@@ -1,13 +0,0 @@
1
- import { IPluggableStorageWrapper } from '../types';
2
- import { ISet } from '../../utils/lang/sets';
3
- /**
4
- * Creates a IPluggableStorageWrapper implementation that stores items in memory.
5
- * The `_cache` property is the object were items are stored.
6
- * Intended for testing purposes.
7
- *
8
- * @param connDelay delay in millis for `connect` resolve. If not provided, `connect` resolves inmediatelly.
9
- */
10
- export declare function inMemoryWrapperFactory(connDelay?: number): IPluggableStorageWrapper & {
11
- _cache: Record<string, string | string[] | ISet<string>>;
12
- _setConnDelay(connDelay: number): void;
13
- };
@@ -1,10 +0,0 @@
1
- import { IPluggableStorageWrapper } from '../types';
2
- import { StorageAsyncFactory } from '../../types';
3
- export interface PluggableStorageOptions {
4
- prefix?: string;
5
- wrapper: IPluggableStorageWrapper;
6
- }
7
- /**
8
- * Pluggable storage factory for consumer server-side & client-side SplitFactory.
9
- */
10
- export declare function PluggableStorage(options: PluggableStorageOptions): StorageAsyncFactory;
@@ -1,12 +0,0 @@
1
- import { ILogger } from '../../types';
2
- import { IPluggableStorageWrapper } from '../types';
3
- export declare const METHODS_TO_PROMISE_WRAP: string[];
4
- /**
5
- * Adapter of the Pluggable Storage Wrapper.
6
- * Used to handle exceptions as rejected promises, in order to simplify the error handling on storages.
7
- *
8
- * @param log logger instance
9
- * @param wrapper storage wrapper to adapt
10
- * @returns an adapted version of the given storage wrapper
11
- */
12
- export declare function wrapperAdapter(log: ILogger, wrapper: IPluggableStorageWrapper): IPluggableStorageWrapper;