@splitsoftware/splitio-commons 1.2.1-rc.0 → 1.2.1-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.
- package/cjs/evaluator/Engine.js +6 -6
- package/cjs/evaluator/combiners/and.js +1 -1
- package/cjs/evaluator/combiners/ifelseif.js +2 -2
- package/cjs/evaluator/condition/engineUtils.js +2 -2
- package/cjs/evaluator/condition/index.js +4 -4
- package/cjs/evaluator/index.js +5 -5
- package/cjs/evaluator/matchers/cont_all.js +1 -1
- package/cjs/evaluator/matchers/cont_any.js +1 -1
- package/cjs/evaluator/matchers/cont_str.js +1 -1
- package/cjs/evaluator/matchers/dependency.js +1 -1
- package/cjs/evaluator/matchers/eq_set.js +1 -1
- package/cjs/evaluator/matchers/ew.js +3 -3
- package/cjs/evaluator/matchers/part_of.js +1 -1
- package/cjs/evaluator/matchers/segment.js +1 -1
- package/cjs/evaluator/matchers/sw.js +1 -1
- package/cjs/evaluator/matchers/whitelist.js +1 -1
- package/cjs/evaluator/matchersTransform/index.js +12 -12
- package/cjs/evaluator/parser/index.js +6 -6
- package/cjs/evaluator/treatments/index.js +1 -1
- package/cjs/evaluator/value/index.js +1 -1
- package/cjs/evaluator/value/sanitize.js +4 -4
- package/cjs/integrations/browser.js +3 -3
- package/cjs/integrations/ga/GaToSplit.js +14 -14
- package/cjs/integrations/ga/GoogleAnalyticsToSplit.js +5 -3
- package/cjs/integrations/ga/SplitToGa.js +1 -1
- package/cjs/integrations/ga/SplitToGoogleAnalytics.js +4 -2
- package/cjs/listeners/browser.js +1 -1
- package/cjs/listeners/node.js +1 -1
- package/cjs/logger/constants.js +4 -2
- package/cjs/logger/index.js +2 -2
- package/cjs/logger/messages/debug.js +1 -1
- package/cjs/logger/messages/error.js +2 -2
- package/cjs/logger/messages/info.js +3 -3
- package/cjs/logger/messages/warn.js +1 -1
- package/cjs/logger/sdkLogger.js +1 -1
- package/cjs/readiness/readinessManager.js +2 -2
- package/cjs/readiness/sdkReadinessManager.js +4 -4
- package/cjs/sdkClient/client.js +9 -9
- package/cjs/sdkClient/clientAttributesDecoration.js +4 -4
- package/cjs/sdkClient/clientCS.js +2 -2
- package/cjs/sdkClient/clientInputValidation.js +14 -14
- package/cjs/sdkClient/sdkClient.js +3 -3
- package/cjs/sdkClient/sdkClientMethod.js +1 -1
- package/cjs/sdkClient/sdkClientMethodCS.js +6 -6
- package/cjs/sdkClient/sdkClientMethodCSWithTT.js +8 -8
- package/cjs/sdkFactory/index.js +9 -8
- package/cjs/sdkManager/index.js +11 -11
- package/cjs/services/splitApi.js +3 -2
- package/cjs/services/splitHttpClient.js +2 -2
- package/cjs/storages/KeyBuilder.js +2 -2
- package/cjs/storages/KeyBuilderCS.js +2 -2
- package/cjs/storages/KeyBuilderSS.js +1 -1
- package/cjs/storages/findLatencyIndex.js +1 -1
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +1 -1
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +12 -12
- package/cjs/storages/inLocalStorage/index.js +4 -4
- package/cjs/storages/inMemory/AttributesCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/ImpressionsCacheInMemory.js +15 -1
- package/cjs/storages/inMemory/InMemoryStorage.js +1 -1
- package/cjs/storages/inMemory/InMemoryStorageCS.js +1 -1
- package/cjs/storages/inMemory/LatenciesCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/SegmentsCacheInMemory.js +2 -2
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +5 -5
- package/cjs/storages/inRedis/LatenciesCacheInRedis.js +1 -1
- package/cjs/storages/inRedis/RedisAdapter.js +16 -10
- package/cjs/storages/inRedis/SegmentsCacheInRedis.js +1 -1
- package/cjs/storages/inRedis/SplitsCacheInRedis.js +3 -3
- package/cjs/storages/inRedis/index.js +1 -1
- package/cjs/storages/pluggable/SegmentsCachePluggable.js +1 -1
- package/cjs/storages/pluggable/SplitsCachePluggable.js +3 -3
- package/cjs/storages/pluggable/inMemoryWrapper.js +4 -4
- package/cjs/storages/pluggable/index.js +6 -6
- package/cjs/sync/offline/LocalhostFromFile.js +1 -1
- package/cjs/sync/offline/LocalhostFromObject.js +1 -1
- package/cjs/sync/offline/splitsParser/parseCondition.js +1 -1
- package/cjs/sync/offline/splitsParser/splitsParserFromFile.js +13 -13
- package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +3 -3
- package/cjs/sync/offline/syncManagerOffline.js +1 -1
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +2 -2
- package/cjs/sync/polling/fetchers/mySegmentsFetcher.js +2 -2
- package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
- package/cjs/sync/polling/pollingManagerCS.js +8 -7
- package/cjs/sync/polling/pollingManagerSS.js +5 -4
- package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +1 -1
- package/cjs/sync/polling/syncTasks/segmentsSyncTask.js +1 -1
- package/cjs/sync/polling/syncTasks/splitsSyncTask.js +1 -1
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +3 -3
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +2 -2
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +2 -2
- package/cjs/sync/streaming/AuthClient/index.js +3 -3
- package/cjs/sync/streaming/SSEHandler/NotificationParser.js +1 -1
- package/cjs/sync/streaming/SSEHandler/index.js +3 -3
- package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +1 -1
- package/cjs/sync/streaming/mySegmentsV2utils.js +1 -1
- package/cjs/sync/streaming/pushManager.js +27 -19
- package/cjs/sync/submitters/eventsSyncTask.js +4 -3
- package/cjs/sync/submitters/impressionCountsSyncTask.js +1 -1
- package/cjs/sync/submitters/impressionsSyncTask.js +11 -3
- package/cjs/sync/submitters/metricsSyncTask.js +3 -3
- package/cjs/sync/submitters/submitterManager.js +6 -5
- package/cjs/sync/submitters/submitterSyncTask.js +1 -1
- package/cjs/sync/syncManagerOnline.js +8 -13
- package/cjs/trackers/eventTracker.js +3 -3
- package/cjs/trackers/impressionObserver/impressionObserverCS.js +1 -1
- package/cjs/trackers/impressionObserver/impressionObserverSS.js +1 -1
- package/cjs/trackers/impressionsTracker.js +3 -3
- package/cjs/utils/MinEvents.js +2 -1
- package/cjs/utils/inputValidation/apiKey.js +1 -1
- package/cjs/utils/inputValidation/attribute.js +4 -4
- package/cjs/utils/inputValidation/attributes.js +2 -2
- package/cjs/utils/inputValidation/event.js +1 -1
- package/cjs/utils/inputValidation/eventProperties.js +7 -5
- package/cjs/utils/inputValidation/eventValue.js +1 -1
- package/cjs/utils/inputValidation/key.js +6 -5
- package/cjs/utils/inputValidation/preloadedData.js +8 -8
- package/cjs/utils/inputValidation/split.js +1 -1
- package/cjs/utils/inputValidation/splits.js +2 -2
- package/cjs/utils/inputValidation/trafficType.js +1 -1
- package/cjs/utils/inputValidation/trafficTypeExistance.js +1 -1
- package/cjs/utils/jwt/index.js +1 -1
- package/cjs/utils/key/index.js +3 -3
- package/cjs/utils/lang/index.js +2 -14
- package/cjs/utils/murmur3/common.js +1 -1
- package/cjs/utils/murmur3/murmur3.js +10 -10
- package/cjs/utils/murmur3/murmur3_128.js +1 -1
- package/cjs/utils/murmur3/murmur3_128_x86.js +37 -37
- package/cjs/utils/murmur3/murmur3_64.js +1 -1
- package/cjs/utils/settingsValidation/index.js +7 -10
- package/cjs/utils/settingsValidation/integrations/configurable.js +1 -1
- package/cjs/utils/settingsValidation/integrations/pluggable.js +1 -1
- package/cjs/utils/settingsValidation/localhost/builtin.js +2 -2
- package/cjs/utils/settingsValidation/logger/builtinLogger.js +3 -3
- package/cjs/utils/settingsValidation/logger/commons.js +1 -1
- package/cjs/utils/settingsValidation/logger/pluggableLogger.js +1 -1
- package/cjs/utils/settingsValidation/runtime.js +11 -0
- package/cjs/utils/settingsValidation/splitFilters.js +1 -1
- package/cjs/utils/settingsValidation/storage/storageCS.js +1 -1
- package/cjs/utils/timeTracker/index.js +3 -3
- package/esm/evaluator/matchers/ew.js +4 -4
- package/esm/integrations/ga/GoogleAnalyticsToSplit.js +4 -2
- package/esm/integrations/ga/SplitToGoogleAnalytics.js +4 -2
- package/esm/logger/constants.js +1 -1
- package/esm/logger/messages/error.js +1 -1
- package/esm/logger/messages/info.js +2 -2
- package/esm/sdkFactory/index.js +1 -0
- package/esm/services/splitApi.js +2 -1
- package/esm/storages/inLocalStorage/index.js +1 -1
- package/esm/storages/inMemory/ImpressionsCacheInMemory.js +15 -1
- package/esm/storages/inMemory/InMemoryStorage.js +1 -1
- package/esm/storages/inMemory/InMemoryStorageCS.js +1 -1
- package/esm/storages/inRedis/RedisAdapter.js +7 -1
- package/esm/storages/pluggable/index.js +2 -2
- package/esm/sync/offline/splitsParser/splitsParserFromFile.js +1 -1
- package/esm/sync/polling/fetchers/mySegmentsFetcher.js +2 -2
- package/esm/sync/polling/fetchers/segmentChangesFetcher.js +2 -2
- package/esm/sync/polling/pollingManagerCS.js +2 -1
- package/esm/sync/polling/pollingManagerSS.js +2 -1
- package/esm/sync/polling/syncTasks/mySegmentsSyncTask.js +1 -1
- package/esm/sync/polling/updaters/mySegmentsUpdater.js +2 -2
- package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +1 -1
- package/esm/sync/streaming/pushManager.js +13 -5
- package/esm/sync/submitters/eventsSyncTask.js +5 -4
- package/esm/sync/submitters/impressionsSyncTask.js +9 -1
- package/esm/sync/submitters/submitterManager.js +2 -1
- package/esm/sync/syncManagerOnline.js +8 -13
- package/esm/utils/inputValidation/eventProperties.js +4 -2
- package/esm/utils/inputValidation/key.js +2 -1
- package/esm/utils/lang/index.js +2 -13
- package/esm/utils/settingsValidation/index.js +3 -6
- package/esm/utils/settingsValidation/runtime.js +7 -0
- package/package.json +6 -6
- package/src/evaluator/matchers/ew.ts +4 -4
- package/src/integrations/ga/GoogleAnalyticsToSplit.ts +7 -4
- package/src/integrations/ga/SplitToGoogleAnalytics.ts +7 -4
- package/src/integrations/types.ts +5 -0
- package/src/logger/constants.ts +1 -1
- package/src/logger/messages/error.ts +1 -1
- package/src/logger/messages/info.ts +2 -2
- package/src/logger/types.ts +4 -0
- package/src/sdkFactory/index.ts +1 -0
- package/src/storages/inLocalStorage/index.ts +1 -1
- package/src/storages/inMemory/ImpressionsCacheInMemory.ts +22 -1
- package/src/storages/inMemory/InMemoryStorage.ts +1 -1
- package/src/storages/inMemory/InMemoryStorageCS.ts +1 -1
- package/src/storages/pluggable/index.ts +2 -2
- package/src/storages/types.ts +6 -2
- package/src/sync/offline/splitsParser/splitsParserFromFile.ts +1 -1
- package/src/sync/polling/fetchers/mySegmentsFetcher.ts +2 -1
- package/src/sync/polling/fetchers/types.ts +1 -0
- package/src/sync/polling/pollingManagerCS.ts +3 -6
- package/src/sync/polling/pollingManagerSS.ts +3 -8
- package/src/sync/polling/syncTasks/mySegmentsSyncTask.ts +2 -1
- package/src/sync/polling/types.ts +0 -12
- package/src/sync/polling/updaters/mySegmentsUpdater.ts +2 -1
- package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +1 -1
- package/src/sync/streaming/pushManager.ts +19 -16
- package/src/sync/streaming/types.ts +5 -25
- package/src/sync/submitters/eventsSyncTask.ts +6 -4
- package/src/sync/submitters/impressionsSyncTask.ts +12 -1
- package/src/sync/submitters/submitterManager.ts +4 -8
- package/src/sync/syncManagerOnline.ts +14 -24
- package/src/types.ts +15 -0
- package/src/utils/inputValidation/eventProperties.ts +4 -2
- package/src/utils/lang/index.ts +0 -14
- package/src/utils/settingsValidation/index.ts +3 -6
- package/src/utils/settingsValidation/runtime.ts +9 -0
- package/src/utils/settingsValidation/types.ts +6 -6
- package/types/integrations/ga/GoogleAnalyticsToSplit.d.ts +2 -2
- package/types/integrations/ga/SplitToGoogleAnalytics.d.ts +2 -3
- package/types/integrations/types.d.ts +4 -0
- package/types/logger/constants.d.ts +1 -1
- package/types/logger/types.d.ts +4 -0
- package/types/sdkClient/clientAttributesDecoration.d.ts +1 -1
- package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +9 -0
- package/types/storages/inMemory/index.d.ts +10 -0
- package/types/storages/parseSegments.d.ts +6 -0
- package/types/storages/types.d.ts +3 -1
- package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +1 -1
- package/types/sync/polling/fetchers/types.d.ts +1 -1
- package/types/sync/polling/pollingManagerCS.d.ts +2 -5
- package/types/sync/polling/pollingManagerSS.d.ts +2 -5
- package/types/sync/polling/types.d.ts +0 -11
- package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +1 -1
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +1 -1
- package/types/sync/streaming/pushManager.d.ts +3 -7
- package/types/sync/streaming/pushManagerCS.d.ts +1 -12
- package/types/sync/streaming/pushManagerSS.d.ts +1 -11
- package/types/sync/streaming/types.d.ts +3 -23
- package/types/sync/submitters/submitterManager.d.ts +2 -4
- package/types/sync/syncManagerOnline.d.ts +3 -3
- package/types/types.d.ts +15 -0
- package/types/utils/lang/index.d.ts +0 -4
- package/types/utils/settingsValidation/runtime/browser.d.ts +2 -0
- package/types/utils/settingsValidation/runtime/node.d.ts +2 -0
- package/types/utils/settingsValidation/runtime.d.ts +2 -0
- package/types/utils/settingsValidation/types.d.ts +6 -6
|
@@ -8,7 +8,7 @@ export declare function clientAttributesDecoration<TClient extends SplitIO.IClie
|
|
|
8
8
|
getTreatmentWithConfig: (maybeKey: SplitIO.SplitKey, maybeSplit: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentWithConfig | SplitIO.AsyncTreatmentWithConfig;
|
|
9
9
|
getTreatments: (maybeKey: SplitIO.SplitKey, maybeSplits: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
|
|
10
10
|
getTreatmentsWithConfig: (maybeKey: SplitIO.SplitKey, maybeSplits: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
|
|
11
|
-
track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) =>
|
|
11
|
+
track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) => boolean | Promise<boolean>;
|
|
12
12
|
/**
|
|
13
13
|
* Add an attribute to client's in memory attributes storage
|
|
14
14
|
*
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { IImpressionsCacheSync } from '../types';
|
|
2
2
|
import { ImpressionDTO } from '../../types';
|
|
3
3
|
export declare class ImpressionsCacheInMemory implements IImpressionsCacheSync {
|
|
4
|
+
private onFullQueue?;
|
|
5
|
+
private readonly maxQueue;
|
|
4
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;
|
|
5
14
|
/**
|
|
6
15
|
* Store impressions in sequential order
|
|
7
16
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
}
|
|
@@ -269,6 +269,7 @@ export interface IRecorderCacheProducerSync<T> {
|
|
|
269
269
|
}
|
|
270
270
|
export interface IImpressionsCacheSync extends IImpressionsCacheBase, IRecorderCacheProducerSync<ImpressionDTO[]> {
|
|
271
271
|
track(data: ImpressionDTO[]): void;
|
|
272
|
+
setOnFullQueueCb(cb: () => void): void;
|
|
272
273
|
}
|
|
273
274
|
export interface IEventsCacheSync extends IEventsCacheBase, IRecorderCacheProducerSync<SplitIO.EventData[]> {
|
|
274
275
|
track(data: SplitIO.EventData, size?: number): boolean;
|
|
@@ -335,6 +336,7 @@ export declare type IStorageAsync = IStorageBase<ISplitsCacheAsync, ISegmentsCac
|
|
|
335
336
|
export declare type DataLoader = (storage: IStorageSync, matchingKey: string) => void;
|
|
336
337
|
export interface IStorageFactoryParams {
|
|
337
338
|
log: ILogger;
|
|
339
|
+
impressionsQueueSize?: number;
|
|
338
340
|
eventsQueueSize?: number;
|
|
339
341
|
optimize?: boolean;
|
|
340
342
|
matchingKey?: string;
|
|
@@ -345,7 +347,7 @@ export interface IStorageFactoryParams {
|
|
|
345
347
|
}
|
|
346
348
|
export declare type StorageType = 'MEMORY' | 'LOCALSTORAGE' | 'REDIS' | 'PLUGGABLE';
|
|
347
349
|
export declare type IStorageSyncFactory = {
|
|
348
|
-
type: StorageType;
|
|
350
|
+
readonly type: StorageType;
|
|
349
351
|
(params: IStorageFactoryParams): IStorageSync;
|
|
350
352
|
};
|
|
351
353
|
export declare type IStorageAsyncFactory = {
|
|
@@ -4,4 +4,4 @@ import { IMySegmentsFetcher } from './types';
|
|
|
4
4
|
* Factory of MySegments fetcher.
|
|
5
5
|
* MySegments fetcher is a wrapper around `mySegments` API service that parses the response and handle errors.
|
|
6
6
|
*/
|
|
7
|
-
export declare function mySegmentsFetcherFactory(fetchMySegments: IFetchMySegments
|
|
7
|
+
export declare function mySegmentsFetcherFactory(fetchMySegments: IFetchMySegments): IMySegmentsFetcher;
|
|
@@ -2,4 +2,4 @@ import { ISplitChangesResponse, ISegmentChangesResponse } from '../../../dtos/ty
|
|
|
2
2
|
import { IResponse } from '../../../services/types';
|
|
3
3
|
export declare type ISplitChangesFetcher = (since: number, noCache?: boolean, decorator?: (promise: Promise<IResponse>) => Promise<IResponse>) => Promise<ISplitChangesResponse>;
|
|
4
4
|
export declare type ISegmentChangesFetcher = (since: number, segmentName: string, noCache?: boolean, decorator?: (promise: Promise<ISegmentChangesResponse[]>) => Promise<ISegmentChangesResponse[]>) => Promise<ISegmentChangesResponse[]>;
|
|
5
|
-
export declare type IMySegmentsFetcher = (noCache?: boolean, decorator?: (promise: Promise<IResponse>) => Promise<IResponse>) => Promise<string[]>;
|
|
5
|
+
export declare type IMySegmentsFetcher = (userMatchingKey: string, noCache?: boolean, decorator?: (promise: Promise<IResponse>) => Promise<IResponse>) => Promise<string[]>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { IPollingManagerCS } from './types';
|
|
2
|
-
import {
|
|
3
|
-
import { ISplitApi } from '../../services/types';
|
|
4
|
-
import { IStorageSync } from '../../storages/types';
|
|
5
|
-
import { ISettings } from '../../types';
|
|
2
|
+
import { ISyncManagerFactoryParams } from '../types';
|
|
6
3
|
/**
|
|
7
4
|
* Expose start / stop mechanism for polling data from services.
|
|
8
5
|
* For client-side API with multiple clients.
|
|
9
6
|
*/
|
|
10
|
-
export declare function pollingManagerCSFactory(
|
|
7
|
+
export declare function pollingManagerCSFactory(params: ISyncManagerFactoryParams): IPollingManagerCS;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { IStorageSync } from '../../storages/types';
|
|
2
|
-
import { IReadinessManager } from '../../readiness/types';
|
|
3
|
-
import { ISplitApi } from '../../services/types';
|
|
4
|
-
import { ISettings } from '../../types';
|
|
5
1
|
import { IPollingManager } from './types';
|
|
2
|
+
import { ISyncManagerFactoryParams } from '../types';
|
|
6
3
|
/**
|
|
7
4
|
* Expose start / stop mechanism for pulling data from services.
|
|
8
5
|
*/
|
|
9
|
-
export declare function pollingManagerSSFactory(
|
|
6
|
+
export declare function pollingManagerSSFactory(params: ISyncManagerFactoryParams): IPollingManager;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { IReadinessManager } from '../../readiness/types';
|
|
2
|
-
import { ISplitApi } from '../../services/types';
|
|
3
2
|
import { IStorageSync } from '../../storages/types';
|
|
4
|
-
import { ISettings } from '../../types';
|
|
5
3
|
import { SegmentsData } from '../streaming/SSEHandler/types';
|
|
6
4
|
import { ITask, ISyncTask } from '../types';
|
|
7
5
|
export interface ISplitsSyncTask extends ISyncTask<[noCache?: boolean], boolean> {
|
|
@@ -21,12 +19,3 @@ export interface IPollingManagerCS extends IPollingManager {
|
|
|
21
19
|
remove(matchingKey: string): void;
|
|
22
20
|
get(matchingKey: string): ISegmentsSyncTask | undefined;
|
|
23
21
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Signature of polling manager factory/constructor
|
|
26
|
-
*/
|
|
27
|
-
export declare type IPollingManagerFactoryParams = [
|
|
28
|
-
splitApi: ISplitApi,
|
|
29
|
-
storage: IStorageSync,
|
|
30
|
-
readiness: IReadinessManager,
|
|
31
|
-
settings: ISettings
|
|
32
|
-
];
|
|
@@ -9,5 +9,5 @@ declare type IMySegmentsUpdater = (segmentList?: string[], noCache?: boolean) =>
|
|
|
9
9
|
* - updates `mySegmentsCache`
|
|
10
10
|
* - uses `segmentsEventEmitter` to emit events related to segments data updates
|
|
11
11
|
*/
|
|
12
|
-
export declare function mySegmentsUpdaterFactory(log: ILogger, mySegmentsFetcher: IMySegmentsFetcher, splitsCache: ISplitsCacheSync, mySegmentsCache: ISegmentsCacheSync, segmentsEventEmitter: ISegmentsEventEmitter, requestTimeoutBeforeReady: number, retriesOnFailureBeforeReady: number): IMySegmentsUpdater;
|
|
12
|
+
export declare function mySegmentsUpdaterFactory(log: ILogger, mySegmentsFetcher: IMySegmentsFetcher, splitsCache: ISplitsCacheSync, mySegmentsCache: ISegmentsCacheSync, segmentsEventEmitter: ISegmentsEventEmitter, requestTimeoutBeforeReady: number, retriesOnFailureBeforeReady: number, matchingKey: string): IMySegmentsUpdater;
|
|
13
13
|
export {};
|
|
@@ -16,7 +16,7 @@ export declare class SegmentsUpdateWorker implements IUpdateWorker {
|
|
|
16
16
|
* @param {Object} segmentsCache segments data cache
|
|
17
17
|
* @param {Object} segmentsSyncTask task for syncing segments data
|
|
18
18
|
*/
|
|
19
|
-
constructor(
|
|
19
|
+
constructor(segmentsSyncTask: ISegmentsSyncTask, segmentsCache: ISegmentsCacheSync);
|
|
20
20
|
__handleSegmentUpdateCall(): void;
|
|
21
21
|
/**
|
|
22
22
|
* Invoked by NotificationProcessor on SEGMENT_UPDATE event
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IStorageSync } from '../../storages/types';
|
|
3
|
-
import { IReadinessManager } from '../../readiness/types';
|
|
1
|
+
import { IPushManager } from './types';
|
|
4
2
|
import { IPollingManager } from '../polling/types';
|
|
5
|
-
import {
|
|
6
|
-
import { ISettings } from '../../types';
|
|
7
|
-
import { IPlatform } from '../../sdkFactory/types';
|
|
3
|
+
import { ISyncManagerFactoryParams } from '../types';
|
|
8
4
|
/**
|
|
9
5
|
* PushManager factory:
|
|
10
6
|
* - for server-side if key is not provided in settings.
|
|
11
7
|
* - for client-side, with support for multiple clients, if key is provided in settings
|
|
12
8
|
*/
|
|
13
|
-
export declare function pushManagerFactory(
|
|
9
|
+
export declare function pushManagerFactory(params: ISyncManagerFactoryParams, pollingManager: IPollingManager): IPushManager | undefined;
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IStorageSync } from '../../storages/types';
|
|
3
|
-
import { IReadinessManager } from '../../readiness/types';
|
|
4
|
-
import { IPollingManager } from '../polling/types';
|
|
5
|
-
import { IFetchAuth } from '../../services/types';
|
|
6
|
-
import { ISettings } from '../../types';
|
|
7
|
-
import { IPlatform } from '../../sdkFactory/types';
|
|
8
|
-
/**
|
|
9
|
-
* PushManager factory for client-side, with support for multiple clients.
|
|
10
|
-
* It assumes settings contains a key.
|
|
11
|
-
*/
|
|
12
|
-
export default function pushManagerCSFactory(pollingManager: IPollingManager, storage: IStorageSync, readiness: IReadinessManager, fetchAuth: IFetchAuth, platform: IPlatform, settings: ISettings): IPushManagerCS | undefined;
|
|
1
|
+
export declare const pushManagerCSFactory: (params: import("../types").ISyncManagerFactoryParams, pollingManager: import("../polling/types").IPollingManager) => import("./types").IPushManager | undefined;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IStorageSync } from '../../storages/types';
|
|
3
|
-
import { IPollingManager } from '../polling/types';
|
|
4
|
-
import { IReadinessManager } from '../../readiness/types';
|
|
5
|
-
import { IFetchAuth } from '../../services/types';
|
|
6
|
-
import { ISettings } from '../../types';
|
|
7
|
-
import { IPlatform } from '../../sdkFactory/types';
|
|
8
|
-
/**
|
|
9
|
-
* PushManager factory for server-side
|
|
10
|
-
*/
|
|
11
|
-
export default function pushManagerSSFactory(pollingManager: IPollingManager, storage: IStorageSync, readiness: IReadinessManager, fetchAuth: IFetchAuth, platform: IPlatform, settings: ISettings): IPushManager | undefined;
|
|
1
|
+
export declare const pushManagerSSFactory: (params: import("../types").ISyncManagerFactoryParams, pollingManager: import("../polling/types").IPollingManager) => import("./types").IPushManager | undefined;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { IMySegmentsUpdateData, IMySegmentsUpdateV2Data, ISegmentUpdateData, ISplitUpdateData, ISplitKillData } from './SSEHandler/types';
|
|
2
2
|
import { ITask } from '../types';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { IFetchAuth } from '../../services/types';
|
|
6
|
-
import { IStorageSync } from '../../storages/types';
|
|
7
|
-
import { IEventEmitter, ISettings } from '../../types';
|
|
8
|
-
import { IPlatform } from '../../sdkFactory/types';
|
|
3
|
+
import { ISegmentsSyncTask } from '../polling/types';
|
|
4
|
+
import { IEventEmitter } from '../../types';
|
|
9
5
|
import { ControlType } from './constants';
|
|
10
6
|
export declare type PUSH_SUBSYSTEM_UP = 'PUSH_SUBSYSTEM_UP';
|
|
11
7
|
export declare type PUSH_SUBSYSTEM_DOWN = 'PUSH_SUBSYSTEM_DOWN';
|
|
@@ -30,26 +26,10 @@ export interface IPushEventEmitter extends IEventEmitter {
|
|
|
30
26
|
emit<T extends IPushEvent>(event: T, parsedData?: IParsedData<T>, channel?: T extends MY_SEGMENTS_UPDATE ? string : undefined): boolean;
|
|
31
27
|
}
|
|
32
28
|
/**
|
|
33
|
-
* PushManager
|
|
29
|
+
* PushManager
|
|
34
30
|
*/
|
|
35
31
|
export interface IPushManager extends ITask, IPushEventEmitter {
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* PushManager for client-side with support for multiple clients
|
|
39
|
-
*/
|
|
40
|
-
export interface IPushManagerCS extends IPushManager {
|
|
41
32
|
add(userKey: string, mySegmentsSyncTask: ISegmentsSyncTask): void;
|
|
42
33
|
remove(userKey: string): void;
|
|
43
34
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Signature of push manager factory/constructor
|
|
46
|
-
*/
|
|
47
|
-
export declare type IPushManagerFactoryParams = [
|
|
48
|
-
pollingManager: IPollingManager,
|
|
49
|
-
storage: IStorageSync,
|
|
50
|
-
readiness: IReadinessManager,
|
|
51
|
-
fetchAuth: IFetchAuth,
|
|
52
|
-
platform: IPlatform,
|
|
53
|
-
settings: ISettings
|
|
54
|
-
];
|
|
55
35
|
export {};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { ISettings } from '../../types';
|
|
4
|
-
export declare function submitterManagerFactory(settings: ISettings, storage: IStorageSync, splitApi: ISplitApi): import("../types").ISyncTask<[], any>;
|
|
1
|
+
import { ISyncManagerFactoryParams } from '../types';
|
|
2
|
+
export declare function submitterManagerFactory(params: ISyncManagerFactoryParams): import("../types").ISyncTask<[], any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ISyncManagerCS, ISyncManagerFactoryParams } from './types';
|
|
2
|
-
import {
|
|
3
|
-
import { IPollingManager
|
|
2
|
+
import { IPushManager } from './streaming/types';
|
|
3
|
+
import { IPollingManager } from './polling/types';
|
|
4
4
|
/**
|
|
5
5
|
* Online SyncManager factory.
|
|
6
6
|
* Can be used for server-side API, and client-side API with or without multiple clients.
|
|
@@ -9,4 +9,4 @@ import { IPollingManager, IPollingManagerFactoryParams } from './polling/types';
|
|
|
9
9
|
* `pollingManagerSSFactory` or `pollingManagerCSFactory` respectively.
|
|
10
10
|
* @param pushManagerFactory optional to build a SyncManager with or without streaming support
|
|
11
11
|
*/
|
|
12
|
-
export declare function syncManagerOnlineFactory(pollingManagerFactory?: (
|
|
12
|
+
export declare function syncManagerOnlineFactory(pollingManagerFactory?: (params: ISyncManagerFactoryParams) => IPollingManager, pushManagerFactory?: (params: ISyncManagerFactoryParams, pollingManager: IPollingManager) => IPushManager | undefined): (params: ISyncManagerFactoryParams) => ISyncManagerCS;
|
package/types/types.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ export interface ISettings {
|
|
|
67
67
|
readonly scheduler: {
|
|
68
68
|
featuresRefreshRate: number;
|
|
69
69
|
impressionsRefreshRate: number;
|
|
70
|
+
impressionsQueueSize: number;
|
|
70
71
|
metricsRefreshRate: number;
|
|
71
72
|
segmentsRefreshRate: number;
|
|
72
73
|
offlineRefreshRate: number;
|
|
@@ -249,6 +250,13 @@ interface INodeBasicSettings extends ISharedSettings {
|
|
|
249
250
|
* @default 300
|
|
250
251
|
*/
|
|
251
252
|
impressionsRefreshRate?: number;
|
|
253
|
+
/**
|
|
254
|
+
* The maximum number of impression items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
|
|
255
|
+
* If you use a 0 here, the queue will have no maximum size.
|
|
256
|
+
* @property {number} impressionsQueueSize
|
|
257
|
+
* @default 30000
|
|
258
|
+
*/
|
|
259
|
+
impressionsQueueSize?: number;
|
|
252
260
|
/**
|
|
253
261
|
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
254
262
|
* @property {number} metricsRefreshRate
|
|
@@ -766,6 +774,13 @@ export declare namespace SplitIO {
|
|
|
766
774
|
* @default 60
|
|
767
775
|
*/
|
|
768
776
|
impressionsRefreshRate?: number;
|
|
777
|
+
/**
|
|
778
|
+
* The maximum number of impression items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
|
|
779
|
+
* If you use a 0 here, the queue will have no maximum size.
|
|
780
|
+
* @property {number} impressionsQueueSize
|
|
781
|
+
* @default 30000
|
|
782
|
+
*/
|
|
783
|
+
impressionsQueueSize?: number;
|
|
769
784
|
/**
|
|
770
785
|
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
771
786
|
* @property {number} metricsRefreshRate
|
|
@@ -72,10 +72,6 @@ export declare function merge(target: {
|
|
|
72
72
|
}, source: {
|
|
73
73
|
[key: string]: any;
|
|
74
74
|
}, ...rest: any[]): object;
|
|
75
|
-
/**
|
|
76
|
-
* Shallow clone an object
|
|
77
|
-
*/
|
|
78
|
-
export declare function shallowClone(obj: any): any;
|
|
79
75
|
/**
|
|
80
76
|
* Checks if the target string starts with the sub string.
|
|
81
77
|
*/
|
|
@@ -5,19 +5,19 @@ import { ISettings } from '../../types';
|
|
|
5
5
|
*/
|
|
6
6
|
export interface ISettingsValidationParams {
|
|
7
7
|
/**
|
|
8
|
-
* Object of values to overwrite
|
|
9
|
-
* Version and startup properties are
|
|
8
|
+
* Object of values to overwrite base settings.
|
|
9
|
+
* Version and startup properties are required, because they are not defined in the base settings.
|
|
10
10
|
*/
|
|
11
11
|
defaults: Partial<ISettings> & {
|
|
12
12
|
version: string;
|
|
13
13
|
} & {
|
|
14
14
|
startup: ISettings['startup'];
|
|
15
15
|
};
|
|
16
|
-
/** Function to
|
|
17
|
-
runtime
|
|
18
|
-
/** Storage validator */
|
|
16
|
+
/** Function to define runtime values (`settings.runtime`) */
|
|
17
|
+
runtime: (settings: ISettings) => ISettings['runtime'];
|
|
18
|
+
/** Storage validator (`settings.storage`) */
|
|
19
19
|
storage?: (settings: ISettings) => ISettings['storage'];
|
|
20
|
-
/** Integrations validator */
|
|
20
|
+
/** Integrations validator (`settings.integrations`) */
|
|
21
21
|
integrations?: (settings: ISettings) => ISettings['integrations'];
|
|
22
22
|
/** Logger validator (`settings.debug`) */
|
|
23
23
|
logger: (settings: ISettings) => ISettings['log'];
|