@splitsoftware/splitio-commons 2.0.0-rc.3 → 2.0.0-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/package.json +3 -2
- package/types/index.d.ts +5 -5
- package/types/splitio.d.ts +2293 -0
- package/types/consent/index.d.ts +0 -2
- package/types/consent/sdkUserConsent.d.ts +0 -13
- package/types/dtos/types.d.ts +0 -209
- package/types/evaluator/Engine.d.ts +0 -15
- package/types/evaluator/combiners/and.d.ts +0 -4
- package/types/evaluator/combiners/ifelseif.d.ts +0 -3
- package/types/evaluator/condition/engineUtils.d.ts +0 -11
- package/types/evaluator/condition/index.d.ts +0 -6
- package/types/evaluator/convertions/index.d.ts +0 -2
- package/types/evaluator/index.d.ts +0 -8
- package/types/evaluator/matchers/all.d.ts +0 -1
- package/types/evaluator/matchers/between.d.ts +0 -2
- package/types/evaluator/matchers/boolean.d.ts +0 -1
- package/types/evaluator/matchers/cont_all.d.ts +0 -1
- package/types/evaluator/matchers/cont_any.d.ts +0 -1
- package/types/evaluator/matchers/cont_str.d.ts +0 -1
- package/types/evaluator/matchers/dependency.d.ts +0 -5
- package/types/evaluator/matchers/eq.d.ts +0 -1
- package/types/evaluator/matchers/eq_set.d.ts +0 -1
- package/types/evaluator/matchers/ew.d.ts +0 -1
- package/types/evaluator/matchers/gte.d.ts +0 -1
- package/types/evaluator/matchers/index.d.ts +0 -7
- package/types/evaluator/matchers/large_segment.d.ts +0 -5
- package/types/evaluator/matchers/lte.d.ts +0 -1
- package/types/evaluator/matchers/matcherTypes.d.ts +0 -10
- package/types/evaluator/matchers/part_of.d.ts +0 -1
- package/types/evaluator/matchers/segment.d.ts +0 -5
- package/types/evaluator/matchers/semver_between.d.ts +0 -2
- package/types/evaluator/matchers/semver_eq.d.ts +0 -1
- package/types/evaluator/matchers/semver_gte.d.ts +0 -1
- package/types/evaluator/matchers/semver_inlist.d.ts +0 -1
- package/types/evaluator/matchers/semver_lte.d.ts +0 -1
- package/types/evaluator/matchers/string.d.ts +0 -1
- package/types/evaluator/matchers/sw.d.ts +0 -1
- package/types/evaluator/matchers/whitelist.d.ts +0 -1
- package/types/evaluator/matchersTransform/index.d.ts +0 -6
- package/types/evaluator/matchersTransform/segment.d.ts +0 -5
- package/types/evaluator/matchersTransform/unaryNumeric.d.ts +0 -5
- package/types/evaluator/matchersTransform/whitelist.d.ts +0 -5
- package/types/evaluator/parser/index.d.ts +0 -5
- package/types/evaluator/treatments/index.d.ts +0 -8
- package/types/evaluator/types.d.ts +0 -28
- package/types/evaluator/value/index.d.ts +0 -7
- package/types/evaluator/value/sanitize.d.ts +0 -7
- package/types/integrations/pluggable.d.ts +0 -11
- package/types/integrations/types.d.ts +0 -18
- package/types/listeners/browser.d.ts +0 -40
- package/types/listeners/node.d.ts +0 -22
- package/types/listeners/types.d.ts +0 -4
- package/types/logger/browser/DebugLogger.d.ts +0 -2
- package/types/logger/browser/ErrorLogger.d.ts +0 -2
- package/types/logger/browser/InfoLogger.d.ts +0 -2
- package/types/logger/browser/WarnLogger.d.ts +0 -2
- package/types/logger/constants.d.ts +0 -134
- package/types/logger/index.d.ts +0 -21
- package/types/logger/messages/debug.d.ts +0 -1
- package/types/logger/messages/error.d.ts +0 -1
- package/types/logger/messages/info.d.ts +0 -1
- package/types/logger/messages/warn.d.ts +0 -1
- package/types/logger/sdkLogger.d.ts +0 -8
- package/types/logger/types.d.ts +0 -17
- package/types/readiness/constants.d.ts +0 -7
- package/types/readiness/readinessManager.d.ts +0 -6
- package/types/readiness/sdkReadinessManager.d.ts +0 -10
- package/types/readiness/types.d.ts +0 -67
- package/types/sdkClient/client.d.ts +0 -6
- package/types/sdkClient/clientAttributesDecoration.d.ts +0 -55
- package/types/sdkClient/clientCS.d.ts +0 -9
- package/types/sdkClient/clientInputValidation.d.ts +0 -7
- package/types/sdkClient/identity.d.ts +0 -2
- package/types/sdkClient/sdkClient.d.ts +0 -6
- package/types/sdkClient/sdkClientMethod.d.ts +0 -6
- package/types/sdkClient/sdkClientMethodCS.d.ts +0 -7
- package/types/sdkFactory/index.d.ts +0 -6
- package/types/sdkFactory/types.d.ts +0 -85
- package/types/sdkManager/index.d.ts +0 -4
- package/types/services/decorateHeaders.d.ts +0 -2
- package/types/services/splitApi.d.ts +0 -12
- package/types/services/splitHttpClient.d.ts +0 -10
- package/types/services/types.d.ts +0 -54
- package/types/storages/AbstractMySegmentsCacheSync.d.ts +0 -39
- package/types/storages/AbstractSplitsCacheAsync.d.ts +0 -38
- package/types/storages/AbstractSplitsCacheSync.d.ts +0 -43
- package/types/storages/KeyBuilder.d.ts +0 -22
- package/types/storages/KeyBuilderCS.d.ts +0 -20
- package/types/storages/KeyBuilderSS.d.ts +0 -20
- package/types/storages/dataLoader.d.ts +0 -10
- package/types/storages/findLatencyIndex.d.ts +0 -7
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +0 -15
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +0 -54
- package/types/storages/inLocalStorage/constants.d.ts +0 -2
- package/types/storages/inLocalStorage/index.d.ts +0 -8
- package/types/storages/inMemory/AttributesCacheInMemory.d.ts +0 -44
- package/types/storages/inMemory/EventsCacheInMemory.d.ts +0 -35
- package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +0 -28
- package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +0 -30
- package/types/storages/inMemory/InMemoryStorage.d.ts +0 -10
- package/types/storages/inMemory/InMemoryStorageCS.d.ts +0 -10
- package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +0 -16
- package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +0 -17
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -27
- package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +0 -71
- package/types/storages/inMemory/UniqueKeysCacheInMemory.d.ts +0 -34
- package/types/storages/inMemory/UniqueKeysCacheInMemoryCS.d.ts +0 -35
- package/types/storages/inRedis/EventsCacheInRedis.d.ts +0 -32
- package/types/storages/inRedis/ImpressionCountsCacheInRedis.d.ts +0 -17
- package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +0 -17
- package/types/storages/inRedis/RedisAdapter.d.ts +0 -24
- package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +0 -21
- package/types/storages/inRedis/SplitsCacheInRedis.d.ts +0 -95
- package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +0 -35
- package/types/storages/inRedis/UniqueKeysCacheInRedis.d.ts +0 -22
- package/types/storages/inRedis/constants.d.ts +0 -4
- package/types/storages/inRedis/index.d.ts +0 -10
- package/types/storages/pluggable/EventsCachePluggable.d.ts +0 -38
- package/types/storages/pluggable/ImpressionCountsCachePluggable.d.ts +0 -16
- package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +0 -34
- package/types/storages/pluggable/SegmentsCachePluggable.d.ts +0 -42
- package/types/storages/pluggable/SplitsCachePluggable.d.ts +0 -98
- package/types/storages/pluggable/TelemetryCachePluggable.d.ts +0 -34
- package/types/storages/pluggable/UniqueKeysCachePluggable.d.ts +0 -20
- package/types/storages/pluggable/constants.d.ts +0 -1
- package/types/storages/pluggable/inMemoryWrapper.d.ts +0 -12
- package/types/storages/pluggable/index.d.ts +0 -9
- package/types/storages/pluggable/wrapperAdapter.d.ts +0 -12
- package/types/storages/types.d.ts +0 -407
- package/types/storages/utils.d.ts +0 -8
- package/types/sync/offline/LocalhostFromObject.d.ts +0 -1
- package/types/sync/offline/splitsParser/parseCondition.d.ts +0 -7
- package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +0 -3
- package/types/sync/offline/splitsParser/types.d.ts +0 -3
- package/types/sync/offline/syncManagerOffline.d.ts +0 -10
- package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +0 -17
- package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +0 -7
- package/types/sync/polling/fetchers/types.d.ts +0 -5
- package/types/sync/polling/pollingManagerCS.d.ts +0 -7
- package/types/sync/polling/pollingManagerSS.d.ts +0 -6
- package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +0 -9
- package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +0 -9
- package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +0 -9
- package/types/sync/polling/types.d.ts +0 -33
- package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +0 -14
- package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +0 -18
- package/types/sync/polling/updaters/splitChangesUpdater.d.ts +0 -41
- package/types/sync/streaming/AuthClient/index.d.ts +0 -12
- package/types/sync/streaming/AuthClient/types.d.ts +0 -17
- package/types/sync/streaming/SSEClient/index.d.ts +0 -34
- package/types/sync/streaming/SSEClient/types.d.ts +0 -11
- package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +0 -14
- package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +0 -20
- package/types/sync/streaming/SSEHandler/index.d.ts +0 -11
- package/types/sync/streaming/SSEHandler/types.d.ts +0 -72
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +0 -9
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +0 -9
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +0 -14
- package/types/sync/streaming/UpdateWorkers/constants.d.ts +0 -3
- package/types/sync/streaming/UpdateWorkers/types.d.ts +0 -4
- package/types/sync/streaming/constants.d.ts +0 -34
- package/types/sync/streaming/parseUtils.d.ts +0 -34
- package/types/sync/streaming/pushManager.d.ts +0 -9
- package/types/sync/streaming/types.d.ts +0 -35
- package/types/sync/submitters/eventsSubmitter.d.ts +0 -5
- package/types/sync/submitters/impressionCountsSubmitter.d.ts +0 -10
- package/types/sync/submitters/impressionsSubmitter.d.ts +0 -11
- package/types/sync/submitters/submitter.d.ts +0 -12
- package/types/sync/submitters/submitterManager.d.ts +0 -3
- package/types/sync/submitters/telemetrySubmitter.d.ts +0 -17
- package/types/sync/submitters/types.d.ts +0 -217
- package/types/sync/submitters/uniqueKeysSubmitter.d.ts +0 -5
- package/types/sync/syncManagerOnline.d.ts +0 -13
- package/types/sync/syncTask.d.ts +0 -13
- package/types/sync/types.d.ts +0 -43
- package/types/trackers/eventTracker.d.ts +0 -10
- package/types/trackers/impressionObserver/ImpressionObserver.d.ts +0 -8
- package/types/trackers/impressionObserver/buildKey.d.ts +0 -2
- package/types/trackers/impressionObserver/impressionObserverCS.d.ts +0 -4
- package/types/trackers/impressionObserver/impressionObserverSS.d.ts +0 -4
- package/types/trackers/impressionObserver/types.d.ts +0 -4
- package/types/trackers/impressionsTracker.d.ts +0 -13
- package/types/trackers/strategy/strategyDebug.d.ts +0 -9
- package/types/trackers/strategy/strategyNone.d.ts +0 -10
- package/types/trackers/strategy/strategyOptimized.d.ts +0 -11
- package/types/trackers/telemetryTracker.d.ts +0 -3
- package/types/trackers/types.d.ts +0 -68
- package/types/trackers/uniqueKeysTracker.d.ts +0 -13
- package/types/types.d.ts +0 -1398
- package/types/utils/Backoff.d.ts +0 -25
- package/types/utils/LRUCache/LinkedList.d.ts +0 -34
- package/types/utils/LRUCache/index.d.ts +0 -15
- package/types/utils/MinEventEmitter.d.ts +0 -12
- package/types/utils/MinEvents.d.ts +0 -4
- package/types/utils/Semver.d.ts +0 -15
- package/types/utils/base64/index.d.ts +0 -30
- package/types/utils/constants/browser.d.ts +0 -1
- package/types/utils/constants/index.d.ts +0 -83
- package/types/utils/decompress/index.d.ts +0 -16
- package/types/utils/env/isLocalStorageAvailable.d.ts +0 -1
- package/types/utils/env/isNode.d.ts +0 -5
- package/types/utils/inputValidation/apiKey.d.ts +0 -7
- package/types/utils/inputValidation/attribute.d.ts +0 -2
- package/types/utils/inputValidation/attributes.d.ts +0 -4
- package/types/utils/inputValidation/event.d.ts +0 -2
- package/types/utils/inputValidation/eventProperties.d.ts +0 -6
- package/types/utils/inputValidation/eventValue.d.ts +0 -2
- package/types/utils/inputValidation/index.d.ts +0 -13
- package/types/utils/inputValidation/isOperational.d.ts +0 -4
- package/types/utils/inputValidation/key.d.ts +0 -3
- package/types/utils/inputValidation/preloadedData.d.ts +0 -3
- package/types/utils/inputValidation/split.d.ts +0 -2
- package/types/utils/inputValidation/splitExistence.d.ts +0 -7
- package/types/utils/inputValidation/splits.d.ts +0 -2
- package/types/utils/inputValidation/trafficType.d.ts +0 -2
- package/types/utils/inputValidation/trafficTypeExistence.d.ts +0 -9
- package/types/utils/jwt/index.d.ts +0 -5
- package/types/utils/jwt/types.d.ts +0 -5
- package/types/utils/key/index.d.ts +0 -8
- package/types/utils/labels/index.d.ts +0 -8
- package/types/utils/lang/binarySearch.d.ts +0 -9
- package/types/utils/lang/getFnName.d.ts +0 -4
- package/types/utils/lang/getGlobal.d.ts +0 -4
- package/types/utils/lang/index.d.ts +0 -105
- package/types/utils/lang/objectAssign.d.ts +0 -6
- package/types/utils/lang/sets.d.ts +0 -3
- package/types/utils/murmur3/common.d.ts +0 -12
- package/types/utils/murmur3/legacy.d.ts +0 -2
- package/types/utils/murmur3/murmur3.d.ts +0 -2
- package/types/utils/murmur3/murmur3_128.d.ts +0 -6
- package/types/utils/murmur3/murmur3_128_x86.d.ts +0 -7
- package/types/utils/murmur3/murmur3_64.d.ts +0 -10
- package/types/utils/murmur3/utfx.d.ts +0 -27
- package/types/utils/promise/thenable.d.ts +0 -1
- package/types/utils/promise/timeout.d.ts +0 -1
- package/types/utils/promise/wrapper.d.ts +0 -21
- package/types/utils/settingsValidation/consent.d.ts +0 -6
- package/types/utils/settingsValidation/impressionsMode.d.ts +0 -3
- package/types/utils/settingsValidation/index.d.ts +0 -50
- package/types/utils/settingsValidation/integrations/common.d.ts +0 -14
- package/types/utils/settingsValidation/integrations/configurable.d.ts +0 -13
- package/types/utils/settingsValidation/integrations/pluggable.d.ts +0 -13
- package/types/utils/settingsValidation/logger/builtinLogger.d.ts +0 -10
- package/types/utils/settingsValidation/logger/commons.d.ts +0 -9
- package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +0 -11
- package/types/utils/settingsValidation/mode.d.ts +0 -5
- package/types/utils/settingsValidation/runtime.d.ts +0 -2
- package/types/utils/settingsValidation/splitFilters.d.ts +0 -17
- package/types/utils/settingsValidation/storage/storageCS.d.ts +0 -21
- package/types/utils/settingsValidation/types.d.ts +0 -30
- package/types/utils/settingsValidation/url.d.ts +0 -10
- package/types/utils/time/index.d.ts +0 -4
- package/types/utils/timeTracker/now/browser.d.ts +0 -1
- package/types/utils/timeTracker/now/node.d.ts +0 -1
- package/types/utils/timeTracker/timer.d.ts +0 -1
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="ioredis" />
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
|
-
import { ImpressionCountsPayload } from '../../sync/submitters/types';
|
|
4
|
-
import { ImpressionCountsCacheInMemory } from '../inMemory/ImpressionCountsCacheInMemory';
|
|
5
|
-
import type { RedisAdapter } from './RedisAdapter';
|
|
6
|
-
export declare class ImpressionCountsCacheInRedis extends ImpressionCountsCacheInMemory {
|
|
7
|
-
private readonly log;
|
|
8
|
-
private readonly key;
|
|
9
|
-
private readonly redis;
|
|
10
|
-
private readonly refreshRate;
|
|
11
|
-
private intervalId;
|
|
12
|
-
constructor(log: ILogger, key: string, redis: RedisAdapter, impressionCountsCacheSize?: number, refreshRate?: number);
|
|
13
|
-
private postImpressionCountsInRedis;
|
|
14
|
-
start(): void;
|
|
15
|
-
stop(): Promise<boolean | import("ioredis").BooleanResponse | undefined>;
|
|
16
|
-
getImpressionsCount(): Promise<ImpressionCountsPayload | undefined>;
|
|
17
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IImpressionsCacheAsync } from '../types';
|
|
2
|
-
import { IMetadata } from '../../dtos/types';
|
|
3
|
-
import { ImpressionDTO } from '../../types';
|
|
4
|
-
import { StoredImpressionWithMetadata } from '../../sync/submitters/types';
|
|
5
|
-
import { ILogger } from '../../logger/types';
|
|
6
|
-
import type { RedisAdapter } from './RedisAdapter';
|
|
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: RedisAdapter, metadata: IMetadata);
|
|
13
|
-
track(impressions: ImpressionDTO[]): Promise<void>;
|
|
14
|
-
count(): Promise<number>;
|
|
15
|
-
drop(count?: number): Promise<any>;
|
|
16
|
-
popNWithMetadata(count: number): Promise<StoredImpressionWithMetadata[]>;
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import ioredis from 'ioredis';
|
|
2
|
-
import { ILogger } from '../../logger/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,21 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../logger/types';
|
|
2
|
-
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
3
|
-
import { ISegmentsCacheAsync } from '../types';
|
|
4
|
-
import type { RedisAdapter } from './RedisAdapter';
|
|
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: RedisAdapter);
|
|
10
|
-
/**
|
|
11
|
-
* Update the given segment `name` with the lists of `addedKeys`, `removedKeys` and `changeNumber`.
|
|
12
|
-
* The returned promise is resolved if the operation success, with `true` if the segment was updated (i.e., some key was added or removed),
|
|
13
|
-
* or rejected if it fails (e.g., Redis operation fails).
|
|
14
|
-
*/
|
|
15
|
-
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): Promise<boolean>;
|
|
16
|
-
isInSegment(name: string, key: string): Promise<boolean>;
|
|
17
|
-
getChangeNumber(name: string): Promise<number>;
|
|
18
|
-
registerSegments(segments: string[]): Promise<boolean>;
|
|
19
|
-
getRegisteredSegments(): Promise<string[]>;
|
|
20
|
-
clear(): Promise<void>;
|
|
21
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
2
|
-
import { ILogger } from '../../logger/types';
|
|
3
|
-
import { ISplit, ISplitFiltersValidation } from '../../dtos/types';
|
|
4
|
-
import { AbstractSplitsCacheAsync } from '../AbstractSplitsCacheAsync';
|
|
5
|
-
import type { RedisAdapter } from './RedisAdapter';
|
|
6
|
-
/**
|
|
7
|
-
* ISplitsCacheAsync implementation that stores split definitions in Redis.
|
|
8
|
-
* Supported by Node.
|
|
9
|
-
*/
|
|
10
|
-
export declare class SplitsCacheInRedis extends AbstractSplitsCacheAsync {
|
|
11
|
-
private readonly log;
|
|
12
|
-
private readonly redis;
|
|
13
|
-
private readonly keys;
|
|
14
|
-
private redisError?;
|
|
15
|
-
private readonly flagSetsFilter;
|
|
16
|
-
constructor(log: ILogger, keys: KeyBuilderSS, redis: RedisAdapter, splitFiltersValidation?: ISplitFiltersValidation);
|
|
17
|
-
private _decrementCounts;
|
|
18
|
-
private _incrementCounts;
|
|
19
|
-
private _updateFlagSets;
|
|
20
|
-
/**
|
|
21
|
-
* Add a given split.
|
|
22
|
-
* The returned promise is resolved when the operation success
|
|
23
|
-
* or rejected if it fails (e.g., redis operation fails)
|
|
24
|
-
*/
|
|
25
|
-
addSplit(name: string, split: ISplit): Promise<boolean>;
|
|
26
|
-
/**
|
|
27
|
-
* Add a list of splits.
|
|
28
|
-
* The returned promise is resolved when the operation success
|
|
29
|
-
* or rejected if it fails (e.g., redis operation fails)
|
|
30
|
-
*/
|
|
31
|
-
addSplits(entries: [string, ISplit][]): Promise<boolean[]>;
|
|
32
|
-
/**
|
|
33
|
-
* Remove a given split.
|
|
34
|
-
* The returned promise is resolved when the operation success, with 1 or 0 indicating if the split existed or not.
|
|
35
|
-
* or rejected if it fails (e.g., redis operation fails).
|
|
36
|
-
*/
|
|
37
|
-
removeSplit(name: string): Promise<number>;
|
|
38
|
-
/**
|
|
39
|
-
* Remove a list of splits.
|
|
40
|
-
* The returned promise is resolved when the operation success,
|
|
41
|
-
* or rejected if it fails (e.g., redis operation fails).
|
|
42
|
-
*/
|
|
43
|
-
removeSplits(names: string[]): Promise<any>;
|
|
44
|
-
/**
|
|
45
|
-
* Get split definition or null if it's not defined.
|
|
46
|
-
* Returned promise is rejected if redis operation fails.
|
|
47
|
-
*/
|
|
48
|
-
getSplit(name: string): Promise<ISplit | null>;
|
|
49
|
-
/**
|
|
50
|
-
* Set till number.
|
|
51
|
-
* The returned promise is resolved when the operation success,
|
|
52
|
-
* or rejected if it fails.
|
|
53
|
-
*/
|
|
54
|
-
setChangeNumber(changeNumber: number): Promise<boolean>;
|
|
55
|
-
/**
|
|
56
|
-
* Get till number or -1 if it's not defined.
|
|
57
|
-
* The returned promise is resolved with the changeNumber or -1 if it doesn't exist or a redis operation fails.
|
|
58
|
-
* The promise will never be rejected.
|
|
59
|
-
*/
|
|
60
|
-
getChangeNumber(): Promise<number>;
|
|
61
|
-
/**
|
|
62
|
-
* Get list of all split definitions.
|
|
63
|
-
* The returned promise is resolved with the list of split definitions,
|
|
64
|
-
* or rejected if redis operation fails.
|
|
65
|
-
*
|
|
66
|
-
* @TODO we need to benchmark which is the maximun number of commands we could
|
|
67
|
-
* pipeline without kill redis performance.
|
|
68
|
-
*/
|
|
69
|
-
getAll(): Promise<ISplit[]>;
|
|
70
|
-
/**
|
|
71
|
-
* Get list of split names.
|
|
72
|
-
* The returned promise is resolved with the list of split names,
|
|
73
|
-
* or rejected if redis operation fails.
|
|
74
|
-
*/
|
|
75
|
-
getSplitNames(): Promise<string[]>;
|
|
76
|
-
/**
|
|
77
|
-
* Get list of feature flag names related to a given list of flag set names.
|
|
78
|
-
* The returned promise is resolved with the list of feature flag names per flag set,
|
|
79
|
-
* or rejected if the pipelined redis operation fails (e.g., timeout).
|
|
80
|
-
*/
|
|
81
|
-
getNamesByFlagSets(flagSets: string[]): Promise<Set<string>[]>;
|
|
82
|
-
/**
|
|
83
|
-
* Check traffic type existence.
|
|
84
|
-
* The returned promise is resolved with a boolean indicating whether the TT exist or not.
|
|
85
|
-
* In case of redis operation failure, the promise resolves with a true value, assuming that the TT might exist.
|
|
86
|
-
* It will never be rejected.
|
|
87
|
-
*/
|
|
88
|
-
trafficTypeExists(trafficType: string): Promise<boolean>;
|
|
89
|
-
clear(): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Fetches multiple splits definitions.
|
|
92
|
-
* Returned promise is rejected if redis operation fails.
|
|
93
|
-
*/
|
|
94
|
-
getSplits(names: string[]): Promise<Record<string, ISplit | null>>;
|
|
95
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../logger/types';
|
|
2
|
-
import { Method, MultiConfigs, MultiMethodExceptions, MultiMethodLatencies } from '../../sync/submitters/types';
|
|
3
|
-
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
4
|
-
import { ITelemetryCacheAsync } from '../types';
|
|
5
|
-
import type { RedisAdapter } from './RedisAdapter';
|
|
6
|
-
export declare class TelemetryCacheInRedis implements ITelemetryCacheAsync {
|
|
7
|
-
private readonly log;
|
|
8
|
-
private readonly keys;
|
|
9
|
-
private readonly redis;
|
|
10
|
-
/**
|
|
11
|
-
* Create a Telemetry cache that uses Redis as storage.
|
|
12
|
-
* @param log Logger instance.
|
|
13
|
-
* @param keys Key builder.
|
|
14
|
-
* @param redis Redis client.
|
|
15
|
-
*/
|
|
16
|
-
constructor(log: ILogger, keys: KeyBuilderSS, redis: RedisAdapter);
|
|
17
|
-
recordLatency(method: Method, latencyMs: number): Promise<number | void>;
|
|
18
|
-
recordException(method: Method): Promise<number | void>;
|
|
19
|
-
recordConfig(): Promise<number | void>;
|
|
20
|
-
/**
|
|
21
|
-
* Pop telemetry latencies.
|
|
22
|
-
* The returned promise rejects if redis operations fail.
|
|
23
|
-
*/
|
|
24
|
-
popLatencies(): Promise<MultiMethodLatencies>;
|
|
25
|
-
/**
|
|
26
|
-
* Pop telemetry exceptions.
|
|
27
|
-
* The returned promise rejects if redis operations fail.
|
|
28
|
-
*/
|
|
29
|
-
popExceptions(): Promise<MultiMethodExceptions>;
|
|
30
|
-
/**
|
|
31
|
-
* Pop telemetry configs.
|
|
32
|
-
* The returned promise rejects if redis operations fail.
|
|
33
|
-
*/
|
|
34
|
-
popConfigs(): Promise<MultiConfigs>;
|
|
35
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="ioredis" />
|
|
2
|
-
import { IUniqueKeysCacheBase } from '../types';
|
|
3
|
-
import { UniqueKeysCacheInMemory } from '../inMemory/UniqueKeysCacheInMemory';
|
|
4
|
-
import { ILogger } from '../../logger/types';
|
|
5
|
-
import { UniqueKeysItemSs } from '../../sync/submitters/types';
|
|
6
|
-
import type { RedisAdapter } from './RedisAdapter';
|
|
7
|
-
export declare class UniqueKeysCacheInRedis extends UniqueKeysCacheInMemory implements IUniqueKeysCacheBase {
|
|
8
|
-
private readonly log;
|
|
9
|
-
private readonly key;
|
|
10
|
-
private readonly redis;
|
|
11
|
-
private readonly refreshRate;
|
|
12
|
-
private intervalId;
|
|
13
|
-
constructor(log: ILogger, key: string, redis: RedisAdapter, uniqueKeysQueueSize?: number, refreshRate?: number);
|
|
14
|
-
private postUniqueKeysInRedis;
|
|
15
|
-
start(): void;
|
|
16
|
-
stop(): Promise<boolean | import("ioredis").BooleanResponse | undefined>;
|
|
17
|
-
/**
|
|
18
|
-
* Async consumer API, used by synchronizer.
|
|
19
|
-
* @param count number of items to pop from the queue. If not provided or equal 0, all items will be popped.
|
|
20
|
-
*/
|
|
21
|
-
popNRaw(count?: number): Promise<UniqueKeysItemSs[]>;
|
|
22
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IStorageAsyncFactory } from '../types';
|
|
2
|
-
export interface InRedisStorageOptions {
|
|
3
|
-
prefix?: string;
|
|
4
|
-
options?: Record<string, any>;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* InRedis storage factory for consumer server-side SplitFactory, that uses `Ioredis` Redis client for Node.
|
|
8
|
-
* @see {@link https://www.npmjs.com/package/ioredis}
|
|
9
|
-
*/
|
|
10
|
-
export declare function InRedisStorage(options?: InRedisStorageOptions): IStorageAsyncFactory;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { IPluggableStorageWrapper, IEventsCacheAsync } from '../types';
|
|
2
|
-
import { IMetadata } from '../../dtos/types';
|
|
3
|
-
import { SplitIO } from '../../types';
|
|
4
|
-
import { ILogger } from '../../logger/types';
|
|
5
|
-
import { StoredEventWithMetadata } from '../../sync/submitters/types';
|
|
6
|
-
export declare class EventsCachePluggable implements IEventsCacheAsync {
|
|
7
|
-
private readonly log;
|
|
8
|
-
private readonly wrapper;
|
|
9
|
-
private readonly key;
|
|
10
|
-
private readonly metadata;
|
|
11
|
-
constructor(log: ILogger, key: string, wrapper: IPluggableStorageWrapper, metadata: IMetadata);
|
|
12
|
-
/**
|
|
13
|
-
* Push given event to the storage.
|
|
14
|
-
* @param eventData Event item to push.
|
|
15
|
-
* @returns A promise that is resolved with a boolean value indicating if the push operation succeeded or failed.
|
|
16
|
-
* Unlike `impressions::track`, The promise will never be rejected.
|
|
17
|
-
*/
|
|
18
|
-
track(eventData: SplitIO.EventData): Promise<boolean>;
|
|
19
|
-
private _toJSON;
|
|
20
|
-
/**
|
|
21
|
-
* Returns a promise that resolves with the count of stored events, or 0 if there was some error.
|
|
22
|
-
* The promise will never be rejected.
|
|
23
|
-
*/
|
|
24
|
-
count(): Promise<number>;
|
|
25
|
-
/**
|
|
26
|
-
* Removes the given number of events from the store. If a number is not provided, it deletes all items.
|
|
27
|
-
* The returned promise rejects if the wrapper operation fails.
|
|
28
|
-
*/
|
|
29
|
-
drop(count?: number): Promise<any>;
|
|
30
|
-
/**
|
|
31
|
-
* Pop the given number of events from the storage.
|
|
32
|
-
* The returned promise rejects if the wrapper operation fails.
|
|
33
|
-
*
|
|
34
|
-
* NOTE: this method doesn't take into account MAX_EVENT_SIZE or MAX_QUEUE_BYTE_SIZE limits.
|
|
35
|
-
* It is the submitter responsability to handle that.
|
|
36
|
-
*/
|
|
37
|
-
popNWithMetadata(count: number): Promise<StoredEventWithMetadata[]>;
|
|
38
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../logger/types';
|
|
2
|
-
import { ImpressionCountsPayload } from '../../sync/submitters/types';
|
|
3
|
-
import { ImpressionCountsCacheInMemory } from '../inMemory/ImpressionCountsCacheInMemory';
|
|
4
|
-
import { IPluggableStorageWrapper } from '../types';
|
|
5
|
-
export declare class ImpressionCountsCachePluggable extends ImpressionCountsCacheInMemory {
|
|
6
|
-
private readonly log;
|
|
7
|
-
private readonly key;
|
|
8
|
-
private readonly wrapper;
|
|
9
|
-
private readonly refreshRate;
|
|
10
|
-
private intervalId;
|
|
11
|
-
constructor(log: ILogger, key: string, wrapper: IPluggableStorageWrapper, impressionCountsCacheSize?: number, refreshRate?: number);
|
|
12
|
-
private storeImpressionCounts;
|
|
13
|
-
start(): void;
|
|
14
|
-
stop(): Promise<any>;
|
|
15
|
-
getImpressionsCount(): Promise<ImpressionCountsPayload | undefined>;
|
|
16
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { IPluggableStorageWrapper, IImpressionsCacheAsync } from '../types';
|
|
2
|
-
import { IMetadata } from '../../dtos/types';
|
|
3
|
-
import { ImpressionDTO } from '../../types';
|
|
4
|
-
import { StoredImpressionWithMetadata } from '../../sync/submitters/types';
|
|
5
|
-
import { ILogger } from '../../logger/types';
|
|
6
|
-
export declare class ImpressionsCachePluggable implements IImpressionsCacheAsync {
|
|
7
|
-
private readonly log;
|
|
8
|
-
private readonly key;
|
|
9
|
-
private readonly wrapper;
|
|
10
|
-
private readonly metadata;
|
|
11
|
-
constructor(log: ILogger, key: string, wrapper: IPluggableStorageWrapper, metadata: IMetadata);
|
|
12
|
-
/**
|
|
13
|
-
* Push given impressions to the storage.
|
|
14
|
-
* @param impressions List of impresions to push.
|
|
15
|
-
* @returns A promise that is resolved if the push operation succeeded
|
|
16
|
-
* or rejected if the wrapper operation fails.
|
|
17
|
-
*/
|
|
18
|
-
track(impressions: ImpressionDTO[]): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Returns a promise that resolves with the count of stored impressions, or 0 if there was some error.
|
|
21
|
-
* The promise will never be rejected.
|
|
22
|
-
*/
|
|
23
|
-
count(): Promise<number>;
|
|
24
|
-
/**
|
|
25
|
-
* Removes the given number of impressions from the store. If a number is not provided, it deletes all items.
|
|
26
|
-
* The returned promise rejects if the wrapper operation fails.
|
|
27
|
-
*/
|
|
28
|
-
drop(count?: number): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Pop the given number of impressions from the store.
|
|
31
|
-
* The returned promise rejects if the wrapper operation fails.
|
|
32
|
-
*/
|
|
33
|
-
popNWithMetadata(count: number): Promise<StoredImpressionWithMetadata[]>;
|
|
34
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
2
|
-
import { IPluggableStorageWrapper, ISegmentsCacheAsync } from '../types';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
|
-
/**
|
|
5
|
-
* ISegmentsCacheAsync implementation for pluggable storages.
|
|
6
|
-
*/
|
|
7
|
-
export declare class SegmentsCachePluggable implements ISegmentsCacheAsync {
|
|
8
|
-
private readonly log;
|
|
9
|
-
private readonly keys;
|
|
10
|
-
private readonly wrapper;
|
|
11
|
-
constructor(log: ILogger, keys: KeyBuilderSS, wrapper: IPluggableStorageWrapper);
|
|
12
|
-
/**
|
|
13
|
-
* Update the given segment `name` with the lists of `addedKeys`, `removedKeys` and `changeNumber`.
|
|
14
|
-
* The returned promise is resolved if the operation success, with `true` if the segment was updated (i.e., some key was added or removed),
|
|
15
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
16
|
-
*/
|
|
17
|
-
update(name: string, addedKeys: string[], removedKeys: string[], changeNumber: number): Promise<boolean>;
|
|
18
|
-
/**
|
|
19
|
-
* Returns a promise that resolves with a boolean value indicating if `key` is part of `name` segment.
|
|
20
|
-
* Promise can be rejected if wrapper operation fails.
|
|
21
|
-
*/
|
|
22
|
-
isInSegment(name: string, key: string): Promise<boolean>;
|
|
23
|
-
/**
|
|
24
|
-
* Get till number or -1 if it's not defined.
|
|
25
|
-
* The returned promise is resolved with the changeNumber or -1 if it doesn't exist or a wrapper operation fails.
|
|
26
|
-
* The promise will never be rejected.
|
|
27
|
-
*/
|
|
28
|
-
getChangeNumber(name: string): Promise<number>;
|
|
29
|
-
/**
|
|
30
|
-
* Add the given segment names to the set of registered segments.
|
|
31
|
-
* The returned promise is resolved when the operation success,
|
|
32
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
33
|
-
*/
|
|
34
|
-
registerSegments(segments: string[]): Promise<boolean | void>;
|
|
35
|
-
/**
|
|
36
|
-
* Returns a promise that resolves with the set of registered segments in a list,
|
|
37
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
38
|
-
*/
|
|
39
|
-
getRegisteredSegments(): Promise<string[]>;
|
|
40
|
-
/** @TODO implement if required by DataLoader or Producer mode */
|
|
41
|
-
clear(): Promise<boolean>;
|
|
42
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { KeyBuilder } from '../KeyBuilder';
|
|
2
|
-
import { IPluggableStorageWrapper } from '../types';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
|
-
import { ISplit, ISplitFiltersValidation } from '../../dtos/types';
|
|
5
|
-
import { AbstractSplitsCacheAsync } from '../AbstractSplitsCacheAsync';
|
|
6
|
-
/**
|
|
7
|
-
* ISplitsCacheAsync implementation for pluggable storages.
|
|
8
|
-
*/
|
|
9
|
-
export declare class SplitsCachePluggable extends AbstractSplitsCacheAsync {
|
|
10
|
-
private readonly log;
|
|
11
|
-
private readonly keys;
|
|
12
|
-
private readonly wrapper;
|
|
13
|
-
private readonly flagSetsFilter;
|
|
14
|
-
/**
|
|
15
|
-
* Create a SplitsCache that uses a storage wrapper.
|
|
16
|
-
* @param log Logger instance.
|
|
17
|
-
* @param keys Key builder.
|
|
18
|
-
* @param wrapper Adapted wrapper storage.
|
|
19
|
-
*/
|
|
20
|
-
constructor(log: ILogger, keys: KeyBuilder, wrapper: IPluggableStorageWrapper, splitFiltersValidation?: ISplitFiltersValidation);
|
|
21
|
-
private _decrementCounts;
|
|
22
|
-
private _incrementCounts;
|
|
23
|
-
private _updateFlagSets;
|
|
24
|
-
/**
|
|
25
|
-
* Add a given split.
|
|
26
|
-
* The returned promise is resolved when the operation success
|
|
27
|
-
* or rejected if it fails (e.g., wrapper operation fails)
|
|
28
|
-
*/
|
|
29
|
-
addSplit(name: string, split: ISplit): Promise<boolean>;
|
|
30
|
-
/**
|
|
31
|
-
* Add a list of splits.
|
|
32
|
-
* The returned promise is resolved when the operation success
|
|
33
|
-
* or rejected if it fails (e.g., wrapper operation fails)
|
|
34
|
-
*/
|
|
35
|
-
addSplits(entries: [string, ISplit][]): Promise<boolean[]>;
|
|
36
|
-
/**
|
|
37
|
-
* Remove a given split.
|
|
38
|
-
* The returned promise is resolved when the operation success, with a boolean indicating if the split existed or not.
|
|
39
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
40
|
-
*/
|
|
41
|
-
removeSplit(name: string): Promise<boolean>;
|
|
42
|
-
/**
|
|
43
|
-
* Remove a list of splits.
|
|
44
|
-
* The returned promise is resolved when the operation success, with a boolean array indicating if the splits existed or not.
|
|
45
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
46
|
-
*/
|
|
47
|
-
removeSplits(names: string[]): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Get split.
|
|
50
|
-
* The returned promise is resolved with the split definition or null if it's not defined,
|
|
51
|
-
* or rejected if wrapper operation fails.
|
|
52
|
-
*/
|
|
53
|
-
getSplit(name: string): Promise<ISplit | null>;
|
|
54
|
-
/**
|
|
55
|
-
* Get list of splits.
|
|
56
|
-
* The returned promise is resolved with a map of split names to their split definition or null if it's not defined,
|
|
57
|
-
* or rejected if wrapper operation fails.
|
|
58
|
-
*/
|
|
59
|
-
getSplits(names: string[]): Promise<Record<string, ISplit | null>>;
|
|
60
|
-
/**
|
|
61
|
-
* Get list of all split definitions.
|
|
62
|
-
* The returned promise is resolved with the list of split definitions,
|
|
63
|
-
* or rejected if wrapper operation fails.
|
|
64
|
-
*/
|
|
65
|
-
getAll(): Promise<ISplit[]>;
|
|
66
|
-
/**
|
|
67
|
-
* Get list of split names.
|
|
68
|
-
* The returned promise is resolved with the list of split names,
|
|
69
|
-
* or rejected if wrapper operation fails.
|
|
70
|
-
*/
|
|
71
|
-
getSplitNames(): Promise<string[]>;
|
|
72
|
-
/**
|
|
73
|
-
* Get list of feature flag names related to a given list of flag set names.
|
|
74
|
-
* The returned promise is resolved with the list of feature flag names per flag set.
|
|
75
|
-
* It never rejects (If there is a wrapper error for some flag set, an empty set is returned for it).
|
|
76
|
-
*/
|
|
77
|
-
getNamesByFlagSets(flagSets: string[]): Promise<Set<string>[]>;
|
|
78
|
-
/**
|
|
79
|
-
* Check traffic type existence.
|
|
80
|
-
* The returned promise is resolved with a boolean indicating whether the TT exist or not.
|
|
81
|
-
* In case of wrapper operation failures, the promise resolves with a true value, assuming that the TT might exist.
|
|
82
|
-
* It will never be rejected.
|
|
83
|
-
*/
|
|
84
|
-
trafficTypeExists(trafficType: string): Promise<boolean>;
|
|
85
|
-
/**
|
|
86
|
-
* Set till number.
|
|
87
|
-
* The returned promise is resolved when the operation success,
|
|
88
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
89
|
-
*/
|
|
90
|
-
setChangeNumber(changeNumber: number): Promise<boolean | void>;
|
|
91
|
-
/**
|
|
92
|
-
* Get till number or -1 if it's not defined.
|
|
93
|
-
* The returned promise is resolved with the changeNumber or -1 if it doesn't exist or a wrapper operation fails.
|
|
94
|
-
* The promise will never be rejected.
|
|
95
|
-
*/
|
|
96
|
-
getChangeNumber(): Promise<number>;
|
|
97
|
-
clear(): Promise<boolean>;
|
|
98
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../logger/types';
|
|
2
|
-
import { Method, MultiConfigs, MultiMethodExceptions, MultiMethodLatencies } from '../../sync/submitters/types';
|
|
3
|
-
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
4
|
-
import { IPluggableStorageWrapper, ITelemetryCacheAsync } from '../types';
|
|
5
|
-
export declare class TelemetryCachePluggable implements ITelemetryCacheAsync {
|
|
6
|
-
private readonly log;
|
|
7
|
-
private readonly keys;
|
|
8
|
-
private readonly wrapper;
|
|
9
|
-
/**
|
|
10
|
-
* Create a Telemetry cache that uses a storage wrapper.
|
|
11
|
-
* @param log Logger instance.
|
|
12
|
-
* @param keys Key builder.
|
|
13
|
-
* @param wrapper Adapted wrapper storage.
|
|
14
|
-
*/
|
|
15
|
-
constructor(log: ILogger, keys: KeyBuilderSS, wrapper: IPluggableStorageWrapper);
|
|
16
|
-
recordLatency(method: Method, latencyMs: number): Promise<number | void>;
|
|
17
|
-
recordException(method: Method): Promise<number | void>;
|
|
18
|
-
recordConfig(): Promise<boolean | void>;
|
|
19
|
-
/**
|
|
20
|
-
* Pop telemetry latencies.
|
|
21
|
-
* The returned promise rejects if wrapper operations fail.
|
|
22
|
-
*/
|
|
23
|
-
popLatencies(): Promise<MultiMethodLatencies>;
|
|
24
|
-
/**
|
|
25
|
-
* Pop telemetry exceptions.
|
|
26
|
-
* The returned promise rejects if wrapper operations fail.
|
|
27
|
-
*/
|
|
28
|
-
popExceptions(): Promise<MultiMethodExceptions>;
|
|
29
|
-
/**
|
|
30
|
-
* Pop telemetry configs.
|
|
31
|
-
* The returned promise rejects if wrapper operations fail.
|
|
32
|
-
*/
|
|
33
|
-
popConfigs(): Promise<MultiConfigs>;
|
|
34
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IPluggableStorageWrapper, IUniqueKeysCacheBase } from '../types';
|
|
2
|
-
import { UniqueKeysCacheInMemory } from '../inMemory/UniqueKeysCacheInMemory';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
|
-
import { UniqueKeysItemSs } from '../../sync/submitters/types';
|
|
5
|
-
export declare class UniqueKeysCachePluggable extends UniqueKeysCacheInMemory implements IUniqueKeysCacheBase {
|
|
6
|
-
private readonly log;
|
|
7
|
-
private readonly key;
|
|
8
|
-
private readonly wrapper;
|
|
9
|
-
private readonly refreshRate;
|
|
10
|
-
private intervalId;
|
|
11
|
-
constructor(log: ILogger, key: string, wrapper: IPluggableStorageWrapper, uniqueKeysQueueSize?: number, refreshRate?: number);
|
|
12
|
-
storeUniqueKeys(): Promise<boolean | void>;
|
|
13
|
-
start(): void;
|
|
14
|
-
stop(): Promise<boolean | void>;
|
|
15
|
-
/**
|
|
16
|
-
* Async consumer API, used by synchronizer.
|
|
17
|
-
* @param count number of items to pop from the queue. If not provided or equal 0, all items will be popped.
|
|
18
|
-
*/
|
|
19
|
-
popNRaw(count?: number): Promise<UniqueKeysItemSs[]>;
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const LOG_PREFIX = "storage:pluggable: ";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IPluggableStorageWrapper } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a IPluggableStorageWrapper implementation that stores items in memory.
|
|
4
|
-
* The `_cache` property is the object were items are stored.
|
|
5
|
-
* Intended for testing purposes.
|
|
6
|
-
*
|
|
7
|
-
* @param connDelay delay in millis for `connect` resolve. If not provided, `connect` resolves immediately.
|
|
8
|
-
*/
|
|
9
|
-
export declare function inMemoryWrapperFactory(connDelay?: number): IPluggableStorageWrapper & {
|
|
10
|
-
_cache: Record<string, string | string[] | Set<string>>;
|
|
11
|
-
_setConnDelay(connDelay: number): void;
|
|
12
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IPluggableStorageWrapper, IStorageAsyncFactory } from '../types';
|
|
2
|
-
export interface PluggableStorageOptions {
|
|
3
|
-
prefix?: string;
|
|
4
|
-
wrapper: IPluggableStorageWrapper;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Pluggable storage factory for consumer server-side & client-side SplitFactory.
|
|
8
|
-
*/
|
|
9
|
-
export declare function PluggableStorage(options: PluggableStorageOptions): IStorageAsyncFactory;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../logger/types';
|
|
2
|
-
import { IPluggableStorageWrapper } from '../types';
|
|
3
|
-
export declare const METHODS_TO_PROMISE_WRAP: string[];
|
|
4
|
-
/**
|
|
5
|
-
* Adapter of the Pluggable Storage Wrapper.
|
|
6
|
-
* Used to handle exceptions as rejected promises, in order to simplify the error handling on storages.
|
|
7
|
-
*
|
|
8
|
-
* @param log logger instance
|
|
9
|
-
* @param wrapper storage wrapper to adapt
|
|
10
|
-
* @returns an adapted version of the given storage wrapper
|
|
11
|
-
*/
|
|
12
|
-
export declare function wrapperAdapter(log: ILogger, wrapper: IPluggableStorageWrapper): IPluggableStorageWrapper;
|