@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,36 +0,0 @@
1
- import { ISplitsCacheAsync } from './types';
2
- /**
3
- * This class provides a skeletal implementation of the ISplitsCacheAsync interface
4
- * to minimize the effort required to implement this interface.
5
- */
6
- export declare abstract class AbstractSplitsCacheAsync implements ISplitsCacheAsync {
7
- abstract addSplit(name: string, split: string): Promise<boolean>;
8
- abstract addSplits(entries: [string, string][]): Promise<boolean[] | void>;
9
- abstract removeSplits(names: string[]): Promise<boolean[] | void>;
10
- abstract getSplit(name: string): Promise<string | null>;
11
- abstract getSplits(names: string[]): Promise<Record<string, string | null>>;
12
- abstract setChangeNumber(changeNumber: number): Promise<boolean | void>;
13
- abstract getChangeNumber(): Promise<number>;
14
- abstract getAll(): Promise<string[]>;
15
- abstract getSplitNames(): Promise<string[]>;
16
- abstract trafficTypeExists(trafficType: string): Promise<boolean>;
17
- abstract clear(): Promise<boolean | void>;
18
- usesSegments(): Promise<boolean>;
19
- /**
20
- * Check if the splits information is already stored in cache.
21
- * Noop, just keeping the interface. This is used by client-side implementations only.
22
- */
23
- checkCache(): Promise<boolean>;
24
- /**
25
- * Kill `name` split and set `defaultTreatment` and `changeNumber`.
26
- * Used for SPLIT_KILL push notifications.
27
- *
28
- * @param {string} name
29
- * @param {string} defaultTreatment
30
- * @param {number} changeNumber
31
- * @returns {Promise} a promise that is resolved once the split kill operation is performed. The fulfillment value is a boolean: `true` if the kill success updating the split or `false` if no split is updated,
32
- * for instance, if the `changeNumber` is old, or if the split is not found (e.g., `/splitchanges` hasn't been fetched yet), or if the storage fails to apply the update.
33
- * The promise will never be rejected.
34
- */
35
- killLocally(name: string, defaultTreatment: string, changeNumber: number): Promise<boolean>;
36
- }
@@ -1,42 +0,0 @@
1
- import { ISplitsCacheSync } from './types';
2
- import { ISplit } from '../dtos/types';
3
- /**
4
- * This class provides a skeletal implementation of the ISplitsCacheSync interface
5
- * to minimize the effort required to implement this interface.
6
- */
7
- export declare abstract class AbstractSplitsCacheSync implements ISplitsCacheSync {
8
- abstract addSplit(name: string, split: string): boolean;
9
- addSplits(entries: [string, string][]): boolean[];
10
- abstract removeSplit(name: string): boolean;
11
- removeSplits(names: string[]): boolean[];
12
- abstract getSplit(name: string): string | null;
13
- getSplits(names: string[]): Record<string, string | null>;
14
- abstract setChangeNumber(changeNumber: number): boolean;
15
- abstract getChangeNumber(): number;
16
- getAll(): string[];
17
- abstract getSplitNames(): string[];
18
- abstract trafficTypeExists(trafficType: string): boolean;
19
- abstract usesSegments(): boolean;
20
- abstract clear(): void;
21
- /**
22
- * Check if the splits information is already stored in cache. This data can be preloaded.
23
- * It is used as condition to emit SDK_SPLITS_CACHE_LOADED, and then SDK_READY_FROM_CACHE.
24
- */
25
- checkCache(): boolean;
26
- /**
27
- * Kill `name` split and set `defaultTreatment` and `changeNumber`.
28
- * Used for SPLIT_KILL push notifications.
29
- *
30
- * @param {string} name
31
- * @param {string} defaultTreatment
32
- * @param {number} changeNumber
33
- * @returns {Promise} a promise that is resolved once the split kill is performed. The fulfillment value is a boolean: `true` if the kill success updating the split or `false` if no split is updated,
34
- * for instance, if the `changeNumber` is old, or if the split is not found (e.g., `/splitchanges` hasn't been fetched yet), or if the storage fails to apply the update.
35
- */
36
- killLocally(name: string, defaultTreatment: string, changeNumber: number): boolean;
37
- }
38
- /**
39
- * Given a parsed split, it returns a boolean flagging if its conditions use segments matchers (rules & whitelists).
40
- * This util is intended to simplify the implementation of `splitsCache::usesSegments` method
41
- */
42
- export declare function usesSegments(split: ISplit): boolean;
@@ -1,14 +0,0 @@
1
- export declare function validatePrefix(prefix: unknown): string;
2
- export declare class KeyBuilder {
3
- protected readonly prefix: string;
4
- constructor(prefix?: string);
5
- buildTrafficTypeKey(trafficType: string): string;
6
- buildSplitKey(splitName: string): string;
7
- buildSplitsTillKey(): string;
8
- isSplitKey(key: string): boolean;
9
- buildSplitKeyPrefix(): string;
10
- buildSplitsWithSegmentCountKey(): string;
11
- buildSegmentNameKey(segmentName: string): string;
12
- buildSegmentTillKey(segmentName: string): string;
13
- extractKey(builtKey: string): string;
14
- }
@@ -1,16 +0,0 @@
1
- import { KeyBuilder } from './KeyBuilder';
2
- export declare class KeyBuilderCS extends KeyBuilder {
3
- protected readonly regexSplitsCacheKey: RegExp;
4
- protected readonly matchingKey: string;
5
- constructor(prefix: string, matchingKey: string);
6
- /**
7
- * @override
8
- */
9
- buildSegmentNameKey(segmentName: string): string;
10
- extractSegmentName(builtSegmentKeyName: string): string | undefined;
11
- buildOldSegmentNameKey(segmentName: string): string;
12
- extractOldSegmentKey(builtSegmentKeyName: string): string | undefined;
13
- buildLastUpdatedKey(): string;
14
- isSplitsCacheKey(key: string): boolean;
15
- buildSplitsFilterQueryKey(): string;
16
- }
@@ -1,15 +0,0 @@
1
- import { KeyBuilder } from './KeyBuilder';
2
- import { IMetadata } from '../dtos/types';
3
- import { Method } from '../sync/submitters/types';
4
- export declare class KeyBuilderSS extends KeyBuilder {
5
- protected readonly metadata: IMetadata;
6
- constructor(prefix: string, metadata: IMetadata);
7
- buildRegisteredSegmentsKey(): string;
8
- buildImpressionsKey(): string;
9
- buildEventsKey(): string;
10
- searchPatternForSplitKeys(): string;
11
- buildLatencyKey(method: Method, bucket: number): string;
12
- buildExceptionKey(method: Method): string;
13
- buildInitKey(): string;
14
- private buildVersionablePrefix;
15
- }
@@ -1,10 +0,0 @@
1
- import { PreloadedData } from './types';
2
- import { DataLoader } from './types';
3
- /**
4
- * Factory of client-side storage loader
5
- *
6
- * @param preloadedData validated data following the format proposed in https://github.com/godaddy/split-javascript-data-loader
7
- * and extended with a `mySegmentsData` property.
8
- * @returns function to preload the storage
9
- */
10
- export declare function dataLoaderFactory(preloadedData: PreloadedData): DataLoader;
@@ -1,7 +0,0 @@
1
- /**
2
- * Calculates buckets from latency in milliseconds
3
- *
4
- * @param latencyInMs
5
- * @returns a bucket index from 0 to 22 inclusive
6
- */
7
- export declare function findLatencyIndex(latencyInMs: number): number;
@@ -1,25 +0,0 @@
1
- import { ILogger } from '../../types';
2
- import { AbstractSegmentsCacheSync } from '../AbstractSegmentsCacheSync';
3
- import { KeyBuilderCS } from '../KeyBuilderCS';
4
- export declare class MySegmentsCacheInLocal extends AbstractSegmentsCacheSync {
5
- private readonly keys;
6
- private readonly log;
7
- constructor(log: ILogger, keys: KeyBuilderCS);
8
- /**
9
- * Removes list of segments from localStorage
10
- * @NOTE this method is not being used at the moment.
11
- */
12
- clear(): void;
13
- addToSegment(name: string): boolean;
14
- removeFromSegment(name: string): boolean;
15
- isInSegment(name: string): boolean;
16
- /**
17
- * Reset (update) the cached list of segments with the given list, removing and adding segments if necessary.
18
- *
19
- * @param {string[]} segmentNames list of segment names
20
- * @returns boolean indicating if the cache was updated (i.e., given list was different from the cached one)
21
- */
22
- resetSegments(names: string[]): boolean;
23
- getRegisteredSegments(): string[];
24
- getKeysCount(): number;
25
- }
@@ -1,50 +0,0 @@
1
- import { AbstractSplitsCacheSync } from '../AbstractSplitsCacheSync';
2
- import { KeyBuilderCS } from '../KeyBuilderCS';
3
- import { ILogger, ISplitFiltersValidation } from '../../types';
4
- /**
5
- * ISplitsCacheSync implementation that stores split definitions in browser LocalStorage.
6
- */
7
- export declare class SplitsCacheInLocal extends AbstractSplitsCacheSync {
8
- private readonly log;
9
- private readonly keys;
10
- private readonly splitFiltersValidation;
11
- private hasSync?;
12
- private cacheReadyButNeedsToFlush;
13
- private updateNewFilter?;
14
- /**
15
- * @param {KeyBuilderCS} keys
16
- * @param {number | undefined} expirationTimestamp
17
- * @param {ISplitFiltersValidation} splitFiltersValidation
18
- */
19
- constructor(log: ILogger, keys: KeyBuilderCS, expirationTimestamp?: number, splitFiltersValidation?: ISplitFiltersValidation);
20
- private _decrementCount;
21
- private _decrementCounts;
22
- private _incrementCounts;
23
- /**
24
- * Removes all splits cache related data from localStorage (splits, counters, changeNumber and lastUpdated).
25
- * We cannot simply call `localStorage.clear()` since that implies removing user items from the storage.
26
- */
27
- clear(): void;
28
- addSplit(name: string, split: string): boolean;
29
- removeSplit(name: string): boolean;
30
- getSplit(name: string): string | null;
31
- setChangeNumber(changeNumber: number): boolean;
32
- getChangeNumber(): number;
33
- getSplitNames(): string[];
34
- trafficTypeExists(trafficType: string): boolean;
35
- usesSegments(): boolean;
36
- /**
37
- * Check if the splits information is already stored in browser LocalStorage.
38
- * In this function we could add more code to check if the data is valid.
39
- * @override
40
- */
41
- checkCache(): boolean;
42
- /**
43
- * Clean Splits cache if its `lastUpdated` timestamp is older than the given `expirationTimestamp`,
44
- * Clean operation (clear) also updates `lastUpdated` timestamp with current time.
45
- *
46
- * @param {number | undefined} expirationTimestamp if the value is not a number, data will not be cleaned
47
- */
48
- private _checkExpiration;
49
- private _checkFilterQuery;
50
- }
@@ -1,2 +0,0 @@
1
- export declare const LOG_PREFIX = "storage:localstorage: ";
2
- export declare const DEFINED = "1";
@@ -1,8 +0,0 @@
1
- import { StorageSyncFactory } from '../../types';
2
- export interface InLocalStorageOptions {
3
- prefix?: string;
4
- }
5
- /**
6
- * InLocal storage factory for standalone client-side SplitFactory
7
- */
8
- export declare function InLocalStorage(options?: InLocalStorageOptions): StorageSyncFactory;
@@ -1,43 +0,0 @@
1
- export declare class AttributesCacheInMemory {
2
- private attributesCache;
3
- /**
4
- * Create or update the value for the given attribute
5
- *
6
- * @param {string} attributeName attribute name
7
- * @param {Object} attributeValue attribute value
8
- * @returns {boolean} the attribute was stored
9
- */
10
- setAttribute(attributeName: string, attributeValue: Object): boolean;
11
- /**
12
- * Retrieves the value of a given attribute
13
- *
14
- * @param {string} attributeName attribute name
15
- * @returns {Object?} stored attribute value
16
- */
17
- getAttribute(attributeName: string): Object;
18
- /**
19
- * Create or update all the given attributes
20
- *
21
- * @param {[string, Object]} attributes attributes to create or update
22
- * @returns {boolean} attributes were stored
23
- */
24
- setAttributes(attributes: Record<string, Object>): boolean;
25
- /**
26
- * Retrieve the full attributes map
27
- *
28
- * @returns {Map<string, Object>} stored attributes
29
- */
30
- getAll(): Record<string, Object>;
31
- /**
32
- * Removes a given attribute from the map
33
- *
34
- * @param {string} attributeName attribute to remove
35
- * @returns {boolean} attribute removed
36
- */
37
- removeAttribute(attributeName: string): boolean;
38
- /**
39
- * Clears all attributes stored in the SDK
40
- *
41
- */
42
- clear(): boolean;
43
- }
@@ -1,35 +0,0 @@
1
- import { EventData } from '../../types';
2
- import { IEventsCacheSync } from '../types';
3
- export declare class EventsCacheInMemory implements IEventsCacheSync {
4
- private onFullQueue?;
5
- private readonly maxQueue;
6
- private queue;
7
- private queueByteSize;
8
- /**
9
- *
10
- * @param eventsQueueSize number of queued events to call onFullQueueCb.
11
- * Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
12
- */
13
- constructor(eventsQueueSize?: number);
14
- setOnFullQueueCb(cb: () => void): void;
15
- /**
16
- * Add a new event object at the end of the queue.
17
- */
18
- track(data: EventData, size?: number): boolean;
19
- /**
20
- * Clear the data stored on the cache.
21
- */
22
- clear(): void;
23
- /**
24
- * Pop the collected data, used as payload for posting.
25
- */
26
- pop(toMerge?: EventData[]): EventData[];
27
- /**
28
- * Check if the cache is empty.
29
- */
30
- isEmpty(): boolean;
31
- /**
32
- * Check if the cache queue is full and we need to flush it.
33
- */
34
- private _checkForFlush;
35
- }
@@ -1,24 +0,0 @@
1
- import { IImpressionCountsCacheSync } from '../types';
2
- export declare class ImpressionCountsCacheInMemory implements IImpressionCountsCacheSync {
3
- private cache;
4
- /**
5
- * Builds key to be stored in the cache with the featureName and the timeFrame truncated.
6
- */
7
- private _makeKey;
8
- /**
9
- * Increments the quantity of impressions with the passed featureName and timeFrame.
10
- */
11
- track(featureName: string, timeFrame: number, amount: number): void;
12
- /**
13
- * Pop the collected data, used as payload for posting.
14
- */
15
- pop(toMerge?: Record<string, number>): Record<string, number>;
16
- /**
17
- * Clear the data stored on the cache.
18
- */
19
- clear(): void;
20
- /**
21
- * Check if the cache is empty.
22
- */
23
- isEmpty(): boolean;
24
- }
@@ -1,30 +0,0 @@
1
- import { IImpressionsCacheSync } from '../types';
2
- import { ImpressionDTO } from '../../types';
3
- export declare class ImpressionsCacheInMemory implements IImpressionsCacheSync {
4
- private onFullQueue?;
5
- private readonly maxQueue;
6
- private queue;
7
- /**
8
- *
9
- * @param impressionsQueueSize number of queued impressions to call onFullQueueCb.
10
- * Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
11
- */
12
- constructor(impressionsQueueSize?: number);
13
- setOnFullQueueCb(cb: () => void): void;
14
- /**
15
- * Store impressions in sequential order
16
- */
17
- track(data: ImpressionDTO[]): void;
18
- /**
19
- * Clear the data stored on the cache.
20
- */
21
- clear(): void;
22
- /**
23
- * Pop the collected data, used as payload for posting.
24
- */
25
- pop(toMerge?: ImpressionDTO[]): ImpressionDTO[];
26
- /**
27
- * Check if the cache is empty.
28
- */
29
- isEmpty(): boolean;
30
- }
@@ -1,10 +0,0 @@
1
- import { IStorageFactoryParams, IStorageSync } from '../types';
2
- /**
3
- * InMemory storage factory for standalone server-side SplitFactory
4
- *
5
- * @param params parameters required by EventsCacheSync
6
- */
7
- export declare function InMemoryStorageFactory(params: IStorageFactoryParams): IStorageSync;
8
- export declare namespace InMemoryStorageFactory {
9
- var type: import("../../types").StorageType;
10
- }
@@ -1,10 +0,0 @@
1
- import { IStorageSync, IStorageFactoryParams } from '../types';
2
- /**
3
- * InMemory storage factory for standalone client-side SplitFactory
4
- *
5
- * @param params parameters required by EventsCacheSync
6
- */
7
- export declare function InMemoryStorageCSFactory(params: IStorageFactoryParams): IStorageSync;
8
- export declare namespace InMemoryStorageCSFactory {
9
- var type: import("../../types").StorageType;
10
- }
@@ -1,22 +0,0 @@
1
- import { AbstractSegmentsCacheSync } from '../AbstractSegmentsCacheSync';
2
- /**
3
- * Default MySegmentsCacheInMemory implementation that stores MySegments in memory.
4
- * Supported by all JS runtimes.
5
- */
6
- export declare class MySegmentsCacheInMemory extends AbstractSegmentsCacheSync {
7
- private segmentCache;
8
- clear(): void;
9
- addToSegment(name: string): boolean;
10
- removeFromSegment(name: string): boolean;
11
- isInSegment(name: string): boolean;
12
- /**
13
- * Reset (update) the cached list of segments with the given list, removing and adding segments if necessary.
14
- * @NOTE based on the way we use segments in the browser, this way is the best option
15
- *
16
- * @param {string[]} names list of segment names
17
- * @returns boolean indicating if the cache was updated (i.e., given list was different from the cached one)
18
- */
19
- resetSegments(names: string[]): boolean;
20
- getRegisteredSegments(): string[];
21
- getKeysCount(): number;
22
- }
@@ -1,19 +0,0 @@
1
- import { AbstractSegmentsCacheSync } from '../AbstractSegmentsCacheSync';
2
- /**
3
- * Default ISplitsCacheSync implementation that stores split definitions in memory.
4
- * Supported by all JS runtimes.
5
- */
6
- export declare class SegmentsCacheInMemory extends AbstractSegmentsCacheSync {
7
- private segmentCache;
8
- private segmentChangeNumber;
9
- addToSegment(name: string, segmentKeys: string[]): boolean;
10
- removeFromSegment(name: string, segmentKeys: string[]): boolean;
11
- isInSegment(name: string, key: string): boolean;
12
- clear(): void;
13
- private _registerSegment;
14
- registerSegments(names: string[]): boolean;
15
- getRegisteredSegments(): string[];
16
- getKeysCount(): number;
17
- setChangeNumber(name: string, changeNumber: number): boolean;
18
- getChangeNumber(name: string): number;
19
- }
@@ -1,20 +0,0 @@
1
- import { AbstractSplitsCacheSync } from '../AbstractSplitsCacheSync';
2
- /**
3
- * Default ISplitsCacheSync implementation that stores split definitions in memory.
4
- * Supported by all JS runtimes.
5
- */
6
- export declare class SplitsCacheInMemory extends AbstractSplitsCacheSync {
7
- private splitsCache;
8
- private ttCache;
9
- private changeNumber;
10
- private splitsWithSegmentsCount;
11
- clear(): void;
12
- addSplit(name: string, split: string): boolean;
13
- removeSplit(name: string): boolean;
14
- getSplit(name: string): string | null;
15
- setChangeNumber(changeNumber: number): boolean;
16
- getChangeNumber(): number;
17
- getSplitNames(): string[];
18
- trafficTypeExists(trafficType: string): boolean;
19
- usesSegments(): boolean;
20
- }
@@ -1,53 +0,0 @@
1
- import { ImpressionDataType, EventDataType, LastSync, HttpErrors, HttpLatencies, StreamingEvent, Method, OperationType, MethodExceptions, MethodLatencies } from '../../sync/submitters/types';
2
- import { ITelemetryCacheSync } from '../types';
3
- /**
4
- * Used on client-side. 0.1% of instances will track telemetry
5
- */
6
- export declare function shouldRecordTelemetry(): boolean;
7
- export declare class TelemetryCacheInMemory implements ITelemetryCacheSync {
8
- private timeUntilReady?;
9
- getTimeUntilReady(): number | undefined;
10
- recordTimeUntilReady(ms: number): void;
11
- private timeUntilReadyFromCache?;
12
- getTimeUntilReadyFromCache(): number | undefined;
13
- recordTimeUntilReadyFromCache(ms: number): void;
14
- private notReadyUsage;
15
- getNonReadyUsage(): number;
16
- recordNonReadyUsage(): void;
17
- private impressionStats;
18
- getImpressionStats(type: ImpressionDataType): number;
19
- recordImpressionStats(type: ImpressionDataType, count: number): void;
20
- private eventStats;
21
- getEventStats(type: EventDataType): number;
22
- recordEventStats(type: EventDataType, count: number): void;
23
- private lastSync;
24
- getLastSynchronization(): LastSync;
25
- recordSuccessfulSync(resource: OperationType, timeMs: number): void;
26
- private httpErrors;
27
- popHttpErrors(): HttpErrors;
28
- recordHttpError(resource: OperationType, status: number): void;
29
- private httpLatencies;
30
- popHttpLatencies(): HttpLatencies;
31
- recordHttpLatency(resource: OperationType, latencyMs: number): void;
32
- private authRejections;
33
- popAuthRejections(): number;
34
- recordAuthRejections(): void;
35
- private tokenRefreshes;
36
- popTokenRefreshes(): number;
37
- recordTokenRefreshes(): void;
38
- private streamingEvents;
39
- popStreamingEvents(): StreamingEvent[];
40
- recordStreamingEvents(streamingEvent: StreamingEvent): void;
41
- private tags;
42
- popTags(): string[];
43
- addTag(tag: string): void;
44
- private sessionLength?;
45
- getSessionLength(): number | undefined;
46
- recordSessionLength(ms: number): void;
47
- private exceptions;
48
- popExceptions(): MethodExceptions;
49
- recordException(method: Method): void;
50
- private latencies;
51
- popLatencies(): MethodLatencies;
52
- recordLatency(method: Method, latencyMs: number): void;
53
- }
@@ -1,32 +0,0 @@
1
- import { IEventsCacheAsync } from '../types';
2
- import { IMetadata } from '../../dtos/types';
3
- import { Redis } from 'ioredis';
4
- import { EventData } from '../../types';
5
- import { ILogger } from '../../types';
6
- import { StoredEventWithMetadata } from '../../sync/submitters/types';
7
- export declare class EventsCacheInRedis implements IEventsCacheAsync {
8
- private readonly log;
9
- private readonly key;
10
- private readonly redis;
11
- private readonly metadata;
12
- constructor(log: ILogger, key: string, redis: Redis, metadata: IMetadata);
13
- /**
14
- * Add a new event object into the queue.
15
- * Unlike `impressions::track`, result promise is never rejected.
16
- */
17
- track(eventData: EventData): Promise<boolean>;
18
- /**
19
- * Generates the JSON as we'll store it on Redis.
20
- */
21
- private _toJSON;
22
- count(): Promise<number>;
23
- drop(count?: number): Promise<any>;
24
- /**
25
- * Pop the given number of events from the storage.
26
- * The returned promise rejects if the wrapper operation fails.
27
- *
28
- * NOTE: this method doesn't take into account MAX_EVENT_SIZE or MAX_QUEUE_BYTE_SIZE limits.
29
- * It is the submitter responsability to handle that.
30
- */
31
- popNWithMetadata(count: number): Promise<StoredEventWithMetadata[]>;
32
- }
@@ -1,18 +0,0 @@
1
- import { IImpressionsCacheAsync } from '../types';
2
- import { IMetadata } from '../../dtos/types';
3
- import { ImpressionDTO } from '../../types';
4
- import { Redis } from 'ioredis';
5
- import { StoredImpressionWithMetadata } from '../../sync/submitters/types';
6
- import { ILogger } from '../../types';
7
- export declare class ImpressionsCacheInRedis implements IImpressionsCacheAsync {
8
- private readonly log;
9
- private readonly key;
10
- private readonly redis;
11
- private readonly metadata;
12
- constructor(log: ILogger, key: string, redis: Redis, metadata: IMetadata);
13
- track(impressions: ImpressionDTO[]): Promise<void>;
14
- private _toJSON;
15
- count(): Promise<number>;
16
- drop(count?: number): Promise<any>;
17
- popNWithMetadata(count: number): Promise<StoredImpressionWithMetadata[]>;
18
- }
@@ -1,24 +0,0 @@
1
- import ioredis from 'ioredis';
2
- import { ILogger } from '../../types';
3
- /**
4
- * Redis adapter on top of the library of choice (written with ioredis) for some extra control.
5
- */
6
- export declare class RedisAdapter extends ioredis {
7
- private readonly log;
8
- private _options;
9
- private _notReadyCommandsQueue?;
10
- private _runningCommands;
11
- constructor(log: ILogger, storageSettings: Record<string, any>);
12
- _listenToEvents(): void;
13
- _setTimeoutWrappers(): void;
14
- _setDisconnectWrapper(): void;
15
- /**
16
- * Receives the options and returns an array of parameters for the ioredis constructor.
17
- * Keeping both redis setup options for backwards compatibility.
18
- */
19
- static _defineLibrarySettings(options: Record<string, any>): any[];
20
- /**
21
- * Parses the options into what we care about.
22
- */
23
- static _defineOptions({ connectionTimeout, operationTimeout, url, host, port, db, pass, tls }: Record<string, any>): object;
24
- }
@@ -1,18 +0,0 @@
1
- import { Redis } from 'ioredis';
2
- import { ILogger } from '../../types';
3
- import { KeyBuilderSS } from '../KeyBuilderSS';
4
- import { ISegmentsCacheAsync } from '../types';
5
- export declare class SegmentsCacheInRedis implements ISegmentsCacheAsync {
6
- private readonly log;
7
- private readonly redis;
8
- private readonly keys;
9
- constructor(log: ILogger, keys: KeyBuilderSS, redis: Redis);
10
- addToSegment(name: string, segmentKeys: string[]): Promise<boolean>;
11
- removeFromSegment(name: string, segmentKeys: string[]): Promise<boolean>;
12
- isInSegment(name: string, key: string): Promise<boolean>;
13
- setChangeNumber(name: string, changeNumber: number): Promise<boolean>;
14
- getChangeNumber(name: string): Promise<number>;
15
- registerSegments(segments: string[]): Promise<boolean>;
16
- getRegisteredSegments(): Promise<string[]>;
17
- clear(): Promise<boolean>;
18
- }