@splitsoftware/splitio-commons 1.4.2-rc.0 → 1.4.2-rc.3

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 (81) hide show
  1. package/CHANGES.txt +4 -3
  2. package/cjs/integrations/ga/GaToSplit.js +11 -12
  3. package/cjs/sync/syncManagerOnline.js +34 -19
  4. package/cjs/sync/syncTask.js +15 -10
  5. package/cjs/utils/settingsValidation/index.js +6 -1
  6. package/esm/integrations/ga/GaToSplit.js +11 -12
  7. package/esm/sync/syncManagerOnline.js +34 -19
  8. package/esm/sync/syncTask.js +15 -10
  9. package/esm/utils/settingsValidation/index.js +6 -1
  10. package/package.json +1 -1
  11. package/src/integrations/ga/GaToSplit.ts +8 -14
  12. package/src/integrations/ga/types.ts +2 -13
  13. package/src/sdkClient/clientAttributesDecoration.ts +9 -9
  14. package/src/sync/syncManagerOnline.ts +29 -16
  15. package/src/sync/syncTask.ts +17 -11
  16. package/src/types.ts +7 -1
  17. package/src/utils/settingsValidation/index.ts +7 -1
  18. package/types/integrations/ga/types.d.ts +2 -13
  19. package/types/logger/browser/{debugLogger.d.ts → DebugLogger.d.ts} +0 -0
  20. package/types/logger/browser/{errorLogger.d.ts → ErrorLogger.d.ts} +0 -0
  21. package/types/logger/browser/{infoLogger.d.ts → InfoLogger.d.ts} +0 -0
  22. package/types/logger/browser/{warnLogger.d.ts → WarnLogger.d.ts} +0 -0
  23. package/types/sync/syncTask.d.ts +2 -2
  24. package/types/types.d.ts +6 -0
  25. package/types/utils/settingsValidation/index.d.ts +1 -0
  26. package/types/utils/timeTracker/index.d.ts +70 -1
  27. package/cjs/integrations/ga/autoRequire.js +0 -34
  28. package/esm/integrations/ga/autoRequire.js +0 -30
  29. package/src/integrations/ga/autoRequire.ts +0 -35
  30. package/src/logger/.DS_Store +0 -0
  31. package/types/integrations/ga/GaToSplitPlugin.d.ts +0 -3
  32. package/types/integrations/ga/SplitToGaPlugin.d.ts +0 -4
  33. package/types/integrations/ga/autoRequire.d.ts +0 -4
  34. package/types/logger/codes.d.ts +0 -2
  35. package/types/logger/codesConstants.d.ts +0 -117
  36. package/types/logger/codesConstantsBrowser.d.ts +0 -2
  37. package/types/logger/codesConstantsNode.d.ts +0 -14
  38. package/types/logger/codesDebug.d.ts +0 -1
  39. package/types/logger/codesDebugBrowser.d.ts +0 -1
  40. package/types/logger/codesDebugNode.d.ts +0 -1
  41. package/types/logger/codesError.d.ts +0 -1
  42. package/types/logger/codesErrorNode.d.ts +0 -1
  43. package/types/logger/codesInfo.d.ts +0 -1
  44. package/types/logger/codesWarn.d.ts +0 -1
  45. package/types/logger/codesWarnNode.d.ts +0 -1
  46. package/types/logger/debugLogger.d.ts +0 -2
  47. package/types/logger/errorLogger.d.ts +0 -2
  48. package/types/logger/infoLogger.d.ts +0 -2
  49. package/types/logger/messages/debugBrowser.d.ts +0 -1
  50. package/types/logger/messages/debugNode.d.ts +0 -1
  51. package/types/logger/messages/errorNode.d.ts +0 -1
  52. package/types/logger/messages/warnNode.d.ts +0 -1
  53. package/types/logger/noopLogger.d.ts +0 -2
  54. package/types/logger/warnLogger.d.ts +0 -2
  55. package/types/sdkFactory/userConsentProps.d.ts +0 -6
  56. package/types/sdkManager/sdkManagerMethod.d.ts +0 -6
  57. package/types/storages/getRegisteredSegments.d.ts +0 -10
  58. package/types/storages/inMemory/index.d.ts +0 -10
  59. package/types/storages/parseSegments.d.ts +0 -6
  60. package/types/sync/polling/syncTasks/splitsSyncTask.copy.d.ts +0 -35
  61. package/types/sync/polling/syncTasks/splitsSyncTask.morelikeoriginal.d.ts +0 -35
  62. package/types/sync/streaming/AuthClient/indexV1.d.ts +0 -12
  63. package/types/sync/streaming/AuthClient/indexV2.d.ts +0 -8
  64. package/types/sync/streaming/pushManagerCS.d.ts +0 -1
  65. package/types/sync/streaming/pushManagerNoUsers.d.ts +0 -13
  66. package/types/sync/streaming/pushManagerSS.d.ts +0 -1
  67. package/types/sync/submitters/telemetrySyncTask.d.ts +0 -0
  68. package/types/sync/syncManagerFromFile.d.ts +0 -2
  69. package/types/sync/syncManagerFromObject.d.ts +0 -2
  70. package/types/sync/syncManagerOffline.d.ts +0 -9
  71. package/types/trackers/telemetryRecorder.d.ts +0 -0
  72. package/types/utils/EventEmitter.d.ts +0 -4
  73. package/types/utils/consent.d.ts +0 -2
  74. package/types/utils/lang/errors.d.ts +0 -10
  75. package/types/utils/murmur3/commons.d.ts +0 -12
  76. package/types/utils/settingsValidation/buildMetadata.d.ts +0 -3
  77. package/types/utils/settingsValidation/localhost/index.d.ts +0 -9
  78. package/types/utils/settingsValidation/logger.d.ts +0 -11
  79. package/types/utils/settingsValidation/runtime/browser.d.ts +0 -2
  80. package/types/utils/settingsValidation/runtime/node.d.ts +0 -2
  81. package/types/utils/settingsValidation/userConsent.d.ts +0 -5
@@ -1 +0,0 @@
1
- export declare const codesErrorNode: [number, string][];
@@ -1 +0,0 @@
1
- export declare const codesWarnNode: [number, string][];
@@ -1,2 +0,0 @@
1
- import { ILogger } from './types';
2
- export declare const noopLogger: ILogger;
@@ -1,2 +0,0 @@
1
- import { Logger } from '.';
2
- export declare const warnLogger: Logger;
@@ -1,6 +0,0 @@
1
- import { ISyncManager } from '../sync/types';
2
- import { ISettings } from '../types';
3
- export declare function userConsentProps(settings: ISettings, syncManager?: ISyncManager): {
4
- setUserConsent(consent: unknown): boolean;
5
- getUserConsent(): import("../types").ConsentStatus | undefined;
6
- };
@@ -1,6 +0,0 @@
1
- import { ISdkClientFactoryParams } from '../sdkClient/types';
2
- import { SplitIO } from '../types';
3
- /**
4
- * Factory of client method for server-side SDKs (ISDK and IAsyncSDK)
5
- */
6
- export declare function sdkManagerMethodFactory(params: ISdkClientFactoryParams): () => SplitIO.IManager | SplitIO.IAsyncManager;
@@ -1,10 +0,0 @@
1
- import { ISplit } from '../dtos/types';
2
- /**
3
- * Collect segments from a raw split definition.
4
- * Exported for testing purposes.
5
- */
6
- export declare function _parseSegments({ conditions }: ISplit): import("../utils/lang/sets").ISet<string>;
7
- /**
8
- * Computes the set of segments used by splits.
9
- */
10
- export declare function getRegisteredSegments(splitDefs: string[]): string[];
@@ -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,6 +0,0 @@
1
- import { ISplit } from '../dtos/types';
2
- import { ISet } from '../utils/lang/sets';
3
- /**
4
- * Collect segments from a list of splits.
5
- */
6
- export declare function parseSegments(splits: ISplit[]): ISet<string>;
@@ -1,35 +0,0 @@
1
- import { ISet } from '../../../utils/lang/sets';
2
- import { ISegmentsCacheSync, ISplitsCacheSync, IStorageSync } from '../../../storages/types';
3
- import { ISplitChangesFetcher } from '../fetchers/types';
4
- import { ISplit } from '../../../dtos/types';
5
- import { IReadinessManager, ISplitsEventEmitter } from '../../../readiness/types';
6
- import { ISplitsSyncTask } from '../types';
7
- import { IFetchSplitChanges } from '../../../services/types';
8
- import { ISettings } from '../../../types';
9
- declare type ISplitChangesUpdater = (noCache?: boolean) => Promise<boolean>;
10
- /**
11
- * Collect segments from a raw split definition.
12
- * Exported for testing purposes.
13
- */
14
- export declare function parseSegments({ conditions }: ISplit): ISet<string>;
15
- interface ISplitMutations {
16
- added: [string, string][];
17
- removed: string[];
18
- segments: string[];
19
- }
20
- /**
21
- * Given the list of splits from /splitChanges endpoint, it returns the mutations,
22
- * i.e., an object with added splits, removed splits and used segments.
23
- * Exported for testing purposes.
24
- */
25
- export declare function computeSplitsMutation(entries: ISplit[]): ISplitMutations;
26
- /**
27
- * factory of SplitChanges updater (a.k.a, SplitsSyncTask), a task that:
28
- * - fetches split changes using `splitChangesFetcher`
29
- * - updates `splitsCache`
30
- * - uses `splitsEventEmitter` to emit events related to split data updates
31
- * Exported for testing purposes.
32
- */
33
- export declare function splitChangesUpdaterFactory(splitChangesFetcher: ISplitChangesFetcher, splitsCache: ISplitsCacheSync, segmentsCache: ISegmentsCacheSync, splitsEventEmitter: ISplitsEventEmitter, requestTimeoutBeforeReady: number, retriesOnFailureBeforeReady: number): ISplitChangesUpdater;
34
- export default function splitsSyncTaskFactory(fetchSplitChanges: IFetchSplitChanges, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings): ISplitsSyncTask;
35
- export {};
@@ -1,35 +0,0 @@
1
- import { ISet } from '../../../utils/lang/sets';
2
- import { ISegmentsCacheSync, ISplitsCacheSync, IStorageSync } from '../../../storages/types';
3
- import { ISplitChangesFetcher } from '../fetchers/types';
4
- import { ISplit } from '../../../dtos/types';
5
- import { IReadinessManager, ISplitsEventEmitter } from '../../../readiness/types';
6
- import { ISplitsSyncTask } from '../types';
7
- import { IFetchSplitChanges } from '../../../services/types';
8
- import { ISettings } from '../../../types';
9
- declare type ISplitChangesUpdater = (noCache?: boolean) => Promise<boolean>;
10
- /**
11
- * Collect segments from a raw split definition.
12
- * Exported for testing purposes.
13
- */
14
- export declare function parseSegments({ conditions }: ISplit): ISet<string>;
15
- interface ISplitMutations {
16
- added: [string, string][];
17
- removed: string[];
18
- segments: string[];
19
- }
20
- /**
21
- * Given the list of splits from /splitChanges endpoint, it returns the mutations,
22
- * i.e., an object with added splits, removed splits and used segments.
23
- * Exported for testing purposes.
24
- */
25
- export declare function computeSplitsMutation(entries: ISplit[]): ISplitMutations;
26
- /**
27
- * factory of SplitChanges updater (a.k.a, SplitsSyncTask), a task that:
28
- * - fetches split changes using `splitChangesFetcher`
29
- * - updates `splitsCache`
30
- * - uses `splitsEventEmitter` to emit events related to split data updates
31
- * Exported for testing purposes.
32
- */
33
- export declare function splitChangesUpdaterFactory(splitChangesFetcher: ISplitChangesFetcher, splitsCache: ISplitsCacheSync, segmentsCache: ISegmentsCacheSync, splitsEventEmitter: ISplitsEventEmitter, requestTimeoutBeforeReady: number, retriesOnFailureBeforeReady: number): ISplitChangesUpdater;
34
- export default function splitsSyncTaskFactory(fetchSplitChanges: IFetchSplitChanges, storage: IStorageSync, readiness: IReadinessManager, settings: ISettings): ISplitsSyncTask;
35
- export {};
@@ -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;