@splitsoftware/splitio-commons 1.6.0 → 1.6.2-rc.1

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 (132) hide show
  1. package/CHANGES.txt +3 -0
  2. package/cjs/integrations/ga/GaToSplit.js +4 -2
  3. package/cjs/integrations/ga/GoogleAnalyticsToSplit.js +1 -0
  4. package/cjs/listeners/browser.js +2 -1
  5. package/cjs/logger/constants.js +2 -1
  6. package/cjs/sdkFactory/index.js +13 -5
  7. package/cjs/services/splitApi.js +20 -0
  8. package/cjs/sync/submitters/submitterManager.js +3 -0
  9. package/cjs/sync/submitters/uniqueKeysSubmitter.js +70 -0
  10. package/cjs/trackers/impressionsTracker.js +7 -28
  11. package/cjs/trackers/strategy/strategyDebug.js +25 -0
  12. package/cjs/trackers/strategy/strategyNone.js +29 -0
  13. package/cjs/trackers/strategy/strategyOptimized.js +34 -0
  14. package/cjs/trackers/uniqueKeysTracker.js +69 -0
  15. package/cjs/utils/constants/index.js +3 -2
  16. package/cjs/utils/settingsValidation/impressionsMode.js +2 -2
  17. package/cjs/utils/settingsValidation/index.js +3 -0
  18. package/esm/integrations/ga/GaToSplit.js +4 -2
  19. package/esm/integrations/ga/GoogleAnalyticsToSplit.js +1 -0
  20. package/esm/listeners/browser.js +3 -2
  21. package/esm/logger/constants.js +1 -0
  22. package/esm/sdkFactory/index.js +13 -5
  23. package/esm/services/splitApi.js +20 -0
  24. package/esm/sync/submitters/submitterManager.js +3 -0
  25. package/esm/sync/submitters/uniqueKeysSubmitter.js +64 -0
  26. package/esm/trackers/impressionsTracker.js +7 -28
  27. package/esm/trackers/strategy/strategyDebug.js +21 -0
  28. package/esm/trackers/strategy/strategyNone.js +25 -0
  29. package/esm/trackers/strategy/strategyOptimized.js +30 -0
  30. package/esm/trackers/uniqueKeysTracker.js +65 -0
  31. package/esm/utils/constants/index.js +1 -0
  32. package/esm/utils/settingsValidation/impressionsMode.js +3 -3
  33. package/esm/utils/settingsValidation/index.js +3 -0
  34. package/package.json +1 -1
  35. package/src/integrations/ga/GaToSplit.ts +3 -2
  36. package/src/integrations/ga/GoogleAnalyticsToSplit.ts +1 -1
  37. package/src/listeners/browser.ts +3 -2
  38. package/src/logger/constants.ts +1 -0
  39. package/src/sdkFactory/index.ts +15 -5
  40. package/src/sdkFactory/types.ts +7 -4
  41. package/src/services/splitApi.ts +22 -0
  42. package/src/services/types.ts +6 -0
  43. package/src/storages/types.ts +17 -4
  44. package/src/sync/submitters/submitterManager.ts +2 -0
  45. package/src/sync/submitters/types.ts +20 -1
  46. package/src/sync/submitters/uniqueKeysSubmitter.ts +79 -0
  47. package/src/trackers/impressionsTracker.ts +12 -34
  48. package/src/trackers/strategy/strategyDebug.ts +28 -0
  49. package/src/trackers/strategy/strategyNone.ts +34 -0
  50. package/src/trackers/strategy/strategyOptimized.ts +42 -0
  51. package/src/trackers/types.ts +30 -0
  52. package/src/trackers/uniqueKeysTracker.ts +80 -0
  53. package/src/types.ts +2 -1
  54. package/src/utils/constants/index.ts +1 -0
  55. package/src/utils/settingsValidation/impressionsMode.ts +3 -3
  56. package/src/utils/settingsValidation/index.ts +4 -0
  57. package/types/integrations/ga/GoogleAnalyticsToSplit.d.ts +1 -1
  58. package/types/logger/browser/{debugLogger.d.ts → DebugLogger.d.ts} +0 -0
  59. package/types/logger/browser/{errorLogger.d.ts → ErrorLogger.d.ts} +0 -0
  60. package/types/logger/browser/{infoLogger.d.ts → InfoLogger.d.ts} +0 -0
  61. package/types/logger/browser/{warnLogger.d.ts → WarnLogger.d.ts} +0 -0
  62. package/types/logger/constants.d.ts +1 -0
  63. package/types/sdkFactory/types.d.ts +4 -2
  64. package/types/services/types.d.ts +4 -0
  65. package/types/storages/types.d.ts +16 -3
  66. package/types/sync/submitters/types.d.ts +18 -1
  67. package/types/sync/submitters/uniqueKeysSubmitter.d.ts +19 -0
  68. package/types/trackers/filter/bloomFilter.d.ts +10 -0
  69. package/types/trackers/filter/dictionaryFilter.d.ts +8 -0
  70. package/types/trackers/filter/types.d.ts +5 -0
  71. package/types/trackers/impressionsTracker.d.ts +4 -6
  72. package/types/trackers/strategy/strategyDebug.d.ts +9 -0
  73. package/types/trackers/strategy/strategyNone.d.ts +10 -0
  74. package/types/trackers/strategy/strategyOptimized.d.ts +11 -0
  75. package/types/trackers/types.d.ts +29 -0
  76. package/types/trackers/uniqueKeysTracker.d.ts +13 -0
  77. package/types/types.d.ts +2 -1
  78. package/types/utils/constants/index.d.ts +1 -0
  79. package/types/utils/settingsValidation/index.d.ts +1 -0
  80. package/types/utils/timeTracker/index.d.ts +70 -1
  81. package/src/logger/.DS_Store +0 -0
  82. package/types/integrations/ga/GaToSplitPlugin.d.ts +0 -3
  83. package/types/integrations/ga/SplitToGaPlugin.d.ts +0 -4
  84. package/types/integrations/ga/autoRequire.d.ts +0 -4
  85. package/types/logger/codes.d.ts +0 -2
  86. package/types/logger/codesConstants.d.ts +0 -117
  87. package/types/logger/codesConstantsBrowser.d.ts +0 -2
  88. package/types/logger/codesConstantsNode.d.ts +0 -14
  89. package/types/logger/codesDebug.d.ts +0 -1
  90. package/types/logger/codesDebugBrowser.d.ts +0 -1
  91. package/types/logger/codesDebugNode.d.ts +0 -1
  92. package/types/logger/codesError.d.ts +0 -1
  93. package/types/logger/codesErrorNode.d.ts +0 -1
  94. package/types/logger/codesInfo.d.ts +0 -1
  95. package/types/logger/codesWarn.d.ts +0 -1
  96. package/types/logger/codesWarnNode.d.ts +0 -1
  97. package/types/logger/debugLogger.d.ts +0 -2
  98. package/types/logger/errorLogger.d.ts +0 -2
  99. package/types/logger/infoLogger.d.ts +0 -2
  100. package/types/logger/messages/debugBrowser.d.ts +0 -1
  101. package/types/logger/messages/debugNode.d.ts +0 -1
  102. package/types/logger/messages/errorNode.d.ts +0 -1
  103. package/types/logger/messages/warnNode.d.ts +0 -1
  104. package/types/logger/noopLogger.d.ts +0 -2
  105. package/types/logger/warnLogger.d.ts +0 -2
  106. package/types/sdkFactory/userConsentProps.d.ts +0 -6
  107. package/types/sdkManager/sdkManagerMethod.d.ts +0 -6
  108. package/types/storages/getRegisteredSegments.d.ts +0 -10
  109. package/types/storages/inMemory/index.d.ts +0 -10
  110. package/types/storages/parseSegments.d.ts +0 -6
  111. package/types/sync/polling/syncTasks/splitsSyncTask.copy.d.ts +0 -35
  112. package/types/sync/polling/syncTasks/splitsSyncTask.morelikeoriginal.d.ts +0 -35
  113. package/types/sync/streaming/AuthClient/indexV1.d.ts +0 -12
  114. package/types/sync/streaming/AuthClient/indexV2.d.ts +0 -8
  115. package/types/sync/streaming/pushManagerCS.d.ts +0 -1
  116. package/types/sync/streaming/pushManagerNoUsers.d.ts +0 -13
  117. package/types/sync/streaming/pushManagerSS.d.ts +0 -1
  118. package/types/sync/submitters/telemetrySyncTask.d.ts +0 -0
  119. package/types/sync/syncManagerFromFile.d.ts +0 -2
  120. package/types/sync/syncManagerFromObject.d.ts +0 -2
  121. package/types/sync/syncManagerOffline.d.ts +0 -9
  122. package/types/trackers/telemetryRecorder.d.ts +0 -0
  123. package/types/utils/EventEmitter.d.ts +0 -4
  124. package/types/utils/consent.d.ts +0 -2
  125. package/types/utils/lang/errors.d.ts +0 -10
  126. package/types/utils/murmur3/commons.d.ts +0 -12
  127. package/types/utils/settingsValidation/buildMetadata.d.ts +0 -3
  128. package/types/utils/settingsValidation/localhost/index.d.ts +0 -9
  129. package/types/utils/settingsValidation/logger.d.ts +0 -11
  130. package/types/utils/settingsValidation/runtime/browser.d.ts +0 -2
  131. package/types/utils/settingsValidation/runtime/node.d.ts +0 -2
  132. package/types/utils/settingsValidation/userConsent.d.ts +0 -5
@@ -1,12 +0,0 @@
1
- import { IFetchAuth } from '../../../services/types';
2
- import { IAuthenticate } from './types';
3
- /**
4
- * Factory of authentication function.
5
- *
6
- * @param fetchAuth `SplitAPI.fetchAuth` endpoint
7
- */
8
- export declare function authenticateFactory(fetchAuth: IFetchAuth): IAuthenticate;
9
- /**
10
- * Returns the hash of a given user key
11
- */
12
- export declare function hashUserKey(userKey: string): string;
@@ -1,8 +0,0 @@
1
- import { IFetchAuthV2 } from '../../../services/types';
2
- import { IAuthenticateV2 } from './types';
3
- /**
4
- * Factory of authentication function.
5
- *
6
- * @param fetchAuth `SplitAPI.fetchAuth` endpoint
7
- */
8
- export declare function authenticateFactory(fetchAuthV2: IFetchAuthV2): IAuthenticateV2;
@@ -1 +0,0 @@
1
- export declare const pushManagerCSFactory: (params: import("../types").ISyncManagerFactoryParams, pollingManager: import("../polling/types").IPollingManager) => import("./types").IPushManager | undefined;
@@ -1,13 +0,0 @@
1
- import { IPushManagerCS } from './types';
2
- import { IStorageSync } from '../../storages/types';
3
- import { IReadinessManager } from '../../readiness/types';
4
- import { IPollingManager } from '../polling/types';
5
- import { IFetchAuthV2 } from '../../services/types';
6
- import { ISettings } from '../../types';
7
- import { IPlatform } from '../../sdkFactory/types';
8
- /**
9
- * PushManager factory:
10
- * - for server-side if key is not provided in settings.
11
- * - for client-side, with support for multiple clients, if key is provided in settings
12
- */
13
- export default function pushManagerFactory(pollingManager: IPollingManager, storage: IStorageSync, readiness: IReadinessManager, fetchAuthV2: IFetchAuthV2, platform: IPlatform, settings: ISettings): IPushManagerCS | undefined;
@@ -1 +0,0 @@
1
- export declare const pushManagerSSFactory: (params: import("../types").ISyncManagerFactoryParams, pollingManager: import("../polling/types").IPollingManager) => import("./types").IPushManager | undefined;
File without changes
@@ -1,2 +0,0 @@
1
- import { SplitIO } from '../types';
2
- export declare function LocalhostFromFile(): SplitIO.LocalhostFactory;
@@ -1,2 +0,0 @@
1
- import { SplitIO } from '../types';
2
- export declare function LocalhostFromObject(): SplitIO.LocalhostFactory;
@@ -1,9 +0,0 @@
1
- import { ISyncManagerCS, ISyncManagerFactoryParams } from './types';
2
- import { ISplitsParser } from './offline/splitsParser/types';
3
- /**
4
- * Offline SyncManager factory.
5
- * Can be used for server-side API, and client-side API with or without multiple clients.
6
- *
7
- * @param splitsParser e.g., `splitsParserFromFile`, `splitsParserFromSettings`.
8
- */
9
- export declare function syncManagerOfflineFactory(splitsParserFactory: () => ISplitsParser): (params: ISyncManagerFactoryParams) => ISyncManagerCS;
File without changes
@@ -1,4 +0,0 @@
1
- import { IEventEmitter } from '../types';
2
- export declare const EventEmitter: {
3
- new (): IEventEmitter;
4
- };
@@ -1,2 +0,0 @@
1
- import { ISettings } from '../types';
2
- export declare function isConsentGranted(settings: ISettings): boolean;
@@ -1,10 +0,0 @@
1
- export declare class SplitError extends Error {
2
- constructor(msg?: string);
3
- }
4
- export declare class SplitTimeoutError extends SplitError {
5
- constructor(msg?: string);
6
- }
7
- export declare class SplitNetworkError extends SplitError {
8
- statusCode?: number;
9
- constructor(msg?: string, code?: number);
10
- }
@@ -1,12 +0,0 @@
1
- export declare function UTF16ToUTF8(key: string): string | undefined;
2
- /*!
3
- * +----------------------------------------------------------------------------------+
4
- * | murmurHash3.js v3.0.0 (http://github.com/karanlyons/murmurHash3.js) |
5
- * | A TypeScript/JavaScript implementation of MurmurHash3's hashing algorithms. |
6
- * |----------------------------------------------------------------------------------|
7
- * | Copyright (c) 2012-2020 Karan Lyons. Freely distributable under the MIT license. |
8
- * +----------------------------------------------------------------------------------+
9
- */
10
- export declare function x86Multiply(m: number, n: number): number;
11
- export declare function x86Rotl(m: number, n: number): number;
12
- export declare function x86Fmix(h: number): number;
@@ -1,3 +0,0 @@
1
- import { IMetadata } from '../../dtos/types';
2
- import { ISettings } from '../../types';
3
- export default function buildMetadata(settings: ISettings): IMetadata;
@@ -1,9 +0,0 @@
1
- import { ISettings } from '../../../types';
2
- /**
3
- * This function validates `settings.storage` object
4
- *
5
- * @param {any} settings config object provided by the user to initialize the sdk
6
- *
7
- * @returns {Object} valid storage factory. It might be the default `InMemoryStorageCSFactory` if the provided storage is invalid.
8
- */
9
- export declare function validateLocalhost(settings: ISettings): import("../../../types").SplitIO.LocalhostFactory | undefined;
@@ -1,11 +0,0 @@
1
- import { ILogger } from '../../logger/types';
2
- /**
3
- * Validates the `log` (logger) property at config.
4
- *
5
- * @param settings user config object
6
- * @returns the provided logger or a no-op logger if no one is provided
7
- * @throws throws an error if a logger was provided but is invalid
8
- */
9
- export default function logger(settings: {
10
- log: unknown;
11
- }): ILogger;
@@ -1,2 +0,0 @@
1
- import { ISettings } from '../../../types';
2
- export declare function validateRuntime(): ISettings['runtime'];
@@ -1,2 +0,0 @@
1
- import { ISettings } from '../../../types';
2
- export declare function validateRuntime(settings: ISettings): ISettings['runtime'];
@@ -1,5 +0,0 @@
1
- import { ILogger } from '../../logger/types';
2
- export declare function validateUserConsent({ userConsent, log }: {
3
- userConsent: any;
4
- log: ILogger;
5
- }): any;