@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.
- package/CHANGES.txt +4 -3
- package/cjs/integrations/ga/GaToSplit.js +11 -12
- package/cjs/sync/syncManagerOnline.js +34 -19
- package/cjs/sync/syncTask.js +15 -10
- package/cjs/utils/settingsValidation/index.js +6 -1
- package/esm/integrations/ga/GaToSplit.js +11 -12
- package/esm/sync/syncManagerOnline.js +34 -19
- package/esm/sync/syncTask.js +15 -10
- package/esm/utils/settingsValidation/index.js +6 -1
- package/package.json +1 -1
- package/src/integrations/ga/GaToSplit.ts +8 -14
- package/src/integrations/ga/types.ts +2 -13
- package/src/sdkClient/clientAttributesDecoration.ts +9 -9
- package/src/sync/syncManagerOnline.ts +29 -16
- package/src/sync/syncTask.ts +17 -11
- package/src/types.ts +7 -1
- package/src/utils/settingsValidation/index.ts +7 -1
- package/types/integrations/ga/types.d.ts +2 -13
- package/types/logger/browser/{debugLogger.d.ts → DebugLogger.d.ts} +0 -0
- package/types/logger/browser/{errorLogger.d.ts → ErrorLogger.d.ts} +0 -0
- package/types/logger/browser/{infoLogger.d.ts → InfoLogger.d.ts} +0 -0
- package/types/logger/browser/{warnLogger.d.ts → WarnLogger.d.ts} +0 -0
- package/types/sync/syncTask.d.ts +2 -2
- package/types/types.d.ts +6 -0
- package/types/utils/settingsValidation/index.d.ts +1 -0
- package/types/utils/timeTracker/index.d.ts +70 -1
- package/cjs/integrations/ga/autoRequire.js +0 -34
- package/esm/integrations/ga/autoRequire.js +0 -30
- package/src/integrations/ga/autoRequire.ts +0 -35
- package/src/logger/.DS_Store +0 -0
- package/types/integrations/ga/GaToSplitPlugin.d.ts +0 -3
- package/types/integrations/ga/SplitToGaPlugin.d.ts +0 -4
- package/types/integrations/ga/autoRequire.d.ts +0 -4
- package/types/logger/codes.d.ts +0 -2
- package/types/logger/codesConstants.d.ts +0 -117
- package/types/logger/codesConstantsBrowser.d.ts +0 -2
- package/types/logger/codesConstantsNode.d.ts +0 -14
- package/types/logger/codesDebug.d.ts +0 -1
- package/types/logger/codesDebugBrowser.d.ts +0 -1
- package/types/logger/codesDebugNode.d.ts +0 -1
- package/types/logger/codesError.d.ts +0 -1
- package/types/logger/codesErrorNode.d.ts +0 -1
- package/types/logger/codesInfo.d.ts +0 -1
- package/types/logger/codesWarn.d.ts +0 -1
- package/types/logger/codesWarnNode.d.ts +0 -1
- package/types/logger/debugLogger.d.ts +0 -2
- package/types/logger/errorLogger.d.ts +0 -2
- package/types/logger/infoLogger.d.ts +0 -2
- package/types/logger/messages/debugBrowser.d.ts +0 -1
- package/types/logger/messages/debugNode.d.ts +0 -1
- package/types/logger/messages/errorNode.d.ts +0 -1
- package/types/logger/messages/warnNode.d.ts +0 -1
- package/types/logger/noopLogger.d.ts +0 -2
- package/types/logger/warnLogger.d.ts +0 -2
- package/types/sdkFactory/userConsentProps.d.ts +0 -6
- package/types/sdkManager/sdkManagerMethod.d.ts +0 -6
- package/types/storages/getRegisteredSegments.d.ts +0 -10
- package/types/storages/inMemory/index.d.ts +0 -10
- package/types/storages/parseSegments.d.ts +0 -6
- package/types/sync/polling/syncTasks/splitsSyncTask.copy.d.ts +0 -35
- package/types/sync/polling/syncTasks/splitsSyncTask.morelikeoriginal.d.ts +0 -35
- package/types/sync/streaming/AuthClient/indexV1.d.ts +0 -12
- package/types/sync/streaming/AuthClient/indexV2.d.ts +0 -8
- package/types/sync/streaming/pushManagerCS.d.ts +0 -1
- package/types/sync/streaming/pushManagerNoUsers.d.ts +0 -13
- package/types/sync/streaming/pushManagerSS.d.ts +0 -1
- package/types/sync/submitters/telemetrySyncTask.d.ts +0 -0
- package/types/sync/syncManagerFromFile.d.ts +0 -2
- package/types/sync/syncManagerFromObject.d.ts +0 -2
- package/types/sync/syncManagerOffline.d.ts +0 -9
- package/types/trackers/telemetryRecorder.d.ts +0 -0
- package/types/utils/EventEmitter.d.ts +0 -4
- package/types/utils/consent.d.ts +0 -2
- package/types/utils/lang/errors.d.ts +0 -10
- package/types/utils/murmur3/commons.d.ts +0 -12
- package/types/utils/settingsValidation/buildMetadata.d.ts +0 -3
- package/types/utils/settingsValidation/localhost/index.d.ts +0 -9
- package/types/utils/settingsValidation/logger.d.ts +0 -11
- package/types/utils/settingsValidation/runtime/browser.d.ts +0 -2
- package/types/utils/settingsValidation/runtime/node.d.ts +0 -2
- 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,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,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,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
|
package/types/utils/consent.d.ts
DELETED
|
@@ -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,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;
|