@splitsoftware/splitio-commons 1.10.1-rc.2 → 1.10.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/CHANGES.txt +1 -0
- package/cjs/readiness/readinessManager.js +5 -0
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +1 -1
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +2 -3
- package/esm/readiness/readinessManager.js +5 -0
- package/esm/sync/polling/updaters/segmentChangesUpdater.js +1 -1
- package/esm/sync/polling/updaters/splitChangesUpdater.js +2 -3
- package/package.json +1 -1
- package/src/readiness/readinessManager.ts +5 -0
- package/src/readiness/types.ts +1 -0
- package/src/sync/polling/updaters/segmentChangesUpdater.ts +1 -1
- package/src/sync/polling/updaters/splitChangesUpdater.ts +2 -3
- package/types/readiness/types.d.ts +1 -0
- package/types/sdkClient/identity.d.ts +6 -0
- package/types/utils/inputValidation/sdkKey.d.ts +7 -0
- package/types/myLogger.d.ts +0 -5
- package/types/sdkClient/types.d.ts +0 -18
- package/types/storages/inMemory/CountsCacheInMemory.d.ts +0 -20
- package/types/storages/inMemory/LatenciesCacheInMemory.d.ts +0 -20
- package/types/storages/inRedis/CountsCacheInRedis.d.ts +0 -9
- package/types/storages/inRedis/LatenciesCacheInRedis.d.ts +0 -9
- package/types/storages/metadataBuilder.d.ts +0 -3
- package/types/sync/offline/LocalhostFromFile.d.ts +0 -2
- package/types/sync/offline/splitsParser/splitsParserFromFile.d.ts +0 -2
- package/types/sync/offline/updaters/splitChangesUpdater.d.ts +0 -0
- package/types/sync/submitters/eventsSyncTask.d.ts +0 -8
- package/types/sync/submitters/impressionCountsSubmitterInRedis.d.ts +0 -5
- package/types/sync/submitters/impressionCountsSyncTask.d.ts +0 -13
- package/types/sync/submitters/impressionsSyncTask.d.ts +0 -14
- package/types/sync/submitters/metricsSyncTask.d.ts +0 -12
- package/types/sync/submitters/submitterSyncTask.d.ts +0 -10
- package/types/sync/submitters/uniqueKeysSubmitterInRedis.d.ts +0 -5
- package/types/sync/syncTaskComposite.d.ts +0 -5
- package/types/trackers/filter/bloomFilter.d.ts +0 -10
- package/types/trackers/filter/dictionaryFilter.d.ts +0 -8
- package/types/trackers/filter/types.d.ts +0 -5
- package/types/utils/timeTracker/index.d.ts +0 -70
- /package/types/storages/inMemory/{uniqueKeysCacheInMemory.d.ts → UniqueKeysCacheInMemory.d.ts} +0 -0
- /package/types/storages/inMemory/{uniqueKeysCacheInMemoryCS.d.ts → UniqueKeysCacheInMemoryCS.d.ts} +0 -0
- /package/types/storages/inRedis/{uniqueKeysCacheInRedis.d.ts → UniqueKeysCacheInRedis.d.ts} +0 -0
package/CHANGES.txt
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
- Added a new optional Split Filter configuration option. This allows the SDK and Split services to only synchronize the flags in the specified flag sets, avoiding unused or unwanted flags from being synced on the SDK instance, bringing all the benefits from a reduced payload.
|
|
7
7
|
- Note: Only applicable when the SDK is in charge of the rollout data synchronization. When not applicable, the SDK will log a warning on init.
|
|
8
8
|
- Added `sets` property to the `SplitView` object returned by the `split` and `splits` methods of the SDK manager to expose flag sets on flag views.
|
|
9
|
+
- Bugfixing - Fixed SDK key validation in NodeJS to ensure the SDK_READY_TIMED_OUT event is emitted when a client-side type SDK key is provided instead of a server-side one (Related to issue https://github.com/splitio/javascript-client/issues/768).
|
|
9
10
|
|
|
10
11
|
1.10.0 (October 20, 2023)
|
|
11
12
|
- Added `defaultTreatment` property to the `SplitView` object returned by the `split` and `splits` methods of the SDK manager (Related to issue https://github.com/splitio/javascript-commons/issues/225).
|
|
@@ -101,7 +101,12 @@ function readinessManagerFactory(EventEmitter, readyTimeout, splits) {
|
|
|
101
101
|
refCount++;
|
|
102
102
|
return readinessManagerFactory(EventEmitter, readyTimeout, splits);
|
|
103
103
|
},
|
|
104
|
+
// @TODO review/remove next methods when non-recoverable errors are reworked
|
|
105
|
+
// Called on consumer mode, when storage fails to connect
|
|
104
106
|
timeout: timeout,
|
|
107
|
+
// Called on 403 error (client-side SDK key on server-side), to set the SDK as destroyed for
|
|
108
|
+
// tracking and evaluations, while keeping event listeners to emit SDK_READY_TIMED_OUT event
|
|
109
|
+
setDestroyed: function () { isDestroyed = true; },
|
|
105
110
|
destroy: function () {
|
|
106
111
|
isDestroyed = true;
|
|
107
112
|
segments.removeAllListeners();
|
|
@@ -83,7 +83,7 @@ function segmentChangesUpdaterFactory(log, segmentChangesFetcher, segments, read
|
|
|
83
83
|
// If the operation is forbidden, it may be due to permissions. Destroy the SDK instance.
|
|
84
84
|
// @TODO although factory status is destroyed, synchronization is not stopped
|
|
85
85
|
if (readiness)
|
|
86
|
-
readiness.
|
|
86
|
+
readiness.setDestroyed();
|
|
87
87
|
log.error(constants_2.LOG_PREFIX_INSTANTIATION + ": you passed a client-side type authorizationKey, please grab an SDK Key from the Split user interface that is of type server-side.");
|
|
88
88
|
}
|
|
89
89
|
else {
|
|
@@ -100,7 +100,7 @@ function splitChangesUpdaterFactory(log, splitChangesFetcher, splits, segments,
|
|
|
100
100
|
return promise;
|
|
101
101
|
}
|
|
102
102
|
/** Returns true if at least one split was updated */
|
|
103
|
-
function
|
|
103
|
+
function isThereUpdate(flagsChange) {
|
|
104
104
|
var added = flagsChange[1], removed = flagsChange[2];
|
|
105
105
|
// There is at least one added or modified feature flag
|
|
106
106
|
if (added && added.some(function (update) { return update; }))
|
|
@@ -143,10 +143,9 @@ function splitChangesUpdaterFactory(log, splitChangesFetcher, splits, segments,
|
|
|
143
143
|
splits.removeSplits(mutation.removed),
|
|
144
144
|
segments.registerSegments(mutation.segments)
|
|
145
145
|
]).then(function (flagsChange) {
|
|
146
|
-
var isThereUpdate = update(flagsChange);
|
|
147
146
|
if (splitsEventEmitter) {
|
|
148
147
|
// To emit SDK_SPLITS_ARRIVED for server-side SDK, we must check that all registered segments have been fetched
|
|
149
|
-
return Promise.resolve(!splitsEventEmitter.splitsArrived || (since !== splitChanges.till && isThereUpdate && (isClientSide || checkAllSegmentsExist(segments))))
|
|
148
|
+
return Promise.resolve(!splitsEventEmitter.splitsArrived || (since !== splitChanges.till && isThereUpdate(flagsChange) && (isClientSide || checkAllSegmentsExist(segments))))
|
|
150
149
|
.catch(function () { return false; } /** noop. just to handle a possible `checkAllSegmentsExist` rejection, before emitting SDK event */)
|
|
151
150
|
.then(function (emitSplitsArrivedEvent) {
|
|
152
151
|
// emit SDK events
|
|
@@ -98,7 +98,12 @@ export function readinessManagerFactory(EventEmitter, readyTimeout, splits) {
|
|
|
98
98
|
refCount++;
|
|
99
99
|
return readinessManagerFactory(EventEmitter, readyTimeout, splits);
|
|
100
100
|
},
|
|
101
|
+
// @TODO review/remove next methods when non-recoverable errors are reworked
|
|
102
|
+
// Called on consumer mode, when storage fails to connect
|
|
101
103
|
timeout: timeout,
|
|
104
|
+
// Called on 403 error (client-side SDK key on server-side), to set the SDK as destroyed for
|
|
105
|
+
// tracking and evaluations, while keeping event listeners to emit SDK_READY_TIMED_OUT event
|
|
106
|
+
setDestroyed: function () { isDestroyed = true; },
|
|
102
107
|
destroy: function () {
|
|
103
108
|
isDestroyed = true;
|
|
104
109
|
segments.removeAllListeners();
|
|
@@ -80,7 +80,7 @@ export function segmentChangesUpdaterFactory(log, segmentChangesFetcher, segment
|
|
|
80
80
|
// If the operation is forbidden, it may be due to permissions. Destroy the SDK instance.
|
|
81
81
|
// @TODO although factory status is destroyed, synchronization is not stopped
|
|
82
82
|
if (readiness)
|
|
83
|
-
readiness.
|
|
83
|
+
readiness.setDestroyed();
|
|
84
84
|
log.error(LOG_PREFIX_INSTANTIATION + ": you passed a client-side type authorizationKey, please grab an SDK Key from the Split user interface that is of type server-side.");
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
@@ -95,7 +95,7 @@ export function splitChangesUpdaterFactory(log, splitChangesFetcher, splits, seg
|
|
|
95
95
|
return promise;
|
|
96
96
|
}
|
|
97
97
|
/** Returns true if at least one split was updated */
|
|
98
|
-
function
|
|
98
|
+
function isThereUpdate(flagsChange) {
|
|
99
99
|
var added = flagsChange[1], removed = flagsChange[2];
|
|
100
100
|
// There is at least one added or modified feature flag
|
|
101
101
|
if (added && added.some(function (update) { return update; }))
|
|
@@ -138,10 +138,9 @@ export function splitChangesUpdaterFactory(log, splitChangesFetcher, splits, seg
|
|
|
138
138
|
splits.removeSplits(mutation.removed),
|
|
139
139
|
segments.registerSegments(mutation.segments)
|
|
140
140
|
]).then(function (flagsChange) {
|
|
141
|
-
var isThereUpdate = update(flagsChange);
|
|
142
141
|
if (splitsEventEmitter) {
|
|
143
142
|
// To emit SDK_SPLITS_ARRIVED for server-side SDK, we must check that all registered segments have been fetched
|
|
144
|
-
return Promise.resolve(!splitsEventEmitter.splitsArrived || (since !== splitChanges.till && isThereUpdate && (isClientSide || checkAllSegmentsExist(segments))))
|
|
143
|
+
return Promise.resolve(!splitsEventEmitter.splitsArrived || (since !== splitChanges.till && isThereUpdate(flagsChange) && (isClientSide || checkAllSegmentsExist(segments))))
|
|
145
144
|
.catch(function () { return false; } /** noop. just to handle a possible `checkAllSegmentsExist` rejection, before emitting SDK event */)
|
|
146
145
|
.then(function (emitSplitsArrivedEvent) {
|
|
147
146
|
// emit SDK events
|
package/package.json
CHANGED
|
@@ -112,7 +112,12 @@ export function readinessManagerFactory(
|
|
|
112
112
|
return readinessManagerFactory(EventEmitter, readyTimeout, splits);
|
|
113
113
|
},
|
|
114
114
|
|
|
115
|
+
// @TODO review/remove next methods when non-recoverable errors are reworked
|
|
116
|
+
// Called on consumer mode, when storage fails to connect
|
|
115
117
|
timeout,
|
|
118
|
+
// Called on 403 error (client-side SDK key on server-side), to set the SDK as destroyed for
|
|
119
|
+
// tracking and evaluations, while keeping event listeners to emit SDK_READY_TIMED_OUT event
|
|
120
|
+
setDestroyed() { isDestroyed = true; },
|
|
116
121
|
|
|
117
122
|
destroy() {
|
|
118
123
|
isDestroyed = true;
|
package/src/readiness/types.ts
CHANGED
|
@@ -96,7 +96,7 @@ export function segmentChangesUpdaterFactory(
|
|
|
96
96
|
if (error && error.statusCode === 403) {
|
|
97
97
|
// If the operation is forbidden, it may be due to permissions. Destroy the SDK instance.
|
|
98
98
|
// @TODO although factory status is destroyed, synchronization is not stopped
|
|
99
|
-
if (readiness) readiness.
|
|
99
|
+
if (readiness) readiness.setDestroyed();
|
|
100
100
|
log.error(`${LOG_PREFIX_INSTANTIATION}: you passed a client-side type authorizationKey, please grab an SDK Key from the Split user interface that is of type server-side.`);
|
|
101
101
|
} else {
|
|
102
102
|
log.warn(`${LOG_PREFIX_SYNC_SEGMENTS}Error while doing fetch of segments. ${error}`);
|
|
@@ -128,7 +128,7 @@ export function splitChangesUpdaterFactory(
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/** Returns true if at least one split was updated */
|
|
131
|
-
function
|
|
131
|
+
function isThereUpdate(flagsChange: [boolean | void, void | boolean[], void | boolean[], boolean | void] | [any, any, any]) {
|
|
132
132
|
const [, added, removed, ] = flagsChange;
|
|
133
133
|
// There is at least one added or modified feature flag
|
|
134
134
|
if (added && added.some((update: boolean) => update)) return true;
|
|
@@ -174,10 +174,9 @@ export function splitChangesUpdaterFactory(
|
|
|
174
174
|
splits.removeSplits(mutation.removed),
|
|
175
175
|
segments.registerSegments(mutation.segments)
|
|
176
176
|
]).then((flagsChange) => {
|
|
177
|
-
const isThereUpdate = update(flagsChange);
|
|
178
177
|
if (splitsEventEmitter) {
|
|
179
178
|
// To emit SDK_SPLITS_ARRIVED for server-side SDK, we must check that all registered segments have been fetched
|
|
180
|
-
return Promise.resolve(!splitsEventEmitter.splitsArrived || (since !== splitChanges.till && isThereUpdate && (isClientSide || checkAllSegmentsExist(segments))))
|
|
179
|
+
return Promise.resolve(!splitsEventEmitter.splitsArrived || (since !== splitChanges.till && isThereUpdate(flagsChange) && (isClientSide || checkAllSegmentsExist(segments))))
|
|
181
180
|
.catch(() => false /** noop. just to handle a possible `checkAllSegmentsExist` rejection, before emitting SDK event */)
|
|
182
181
|
.then(emitSplitsArrivedEvent => {
|
|
183
182
|
// emit SDK events
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ILogger } from '../../logger/types';
|
|
2
|
+
/** validates the given SDK key */
|
|
3
|
+
export declare function validateApiKey(log: ILogger, maybeSdkKey: any): string | false;
|
|
4
|
+
export declare const usedKeysMap: Record<string, number>;
|
|
5
|
+
/** validates the given SDK key and also warns if it is in use */
|
|
6
|
+
export declare function validateAndTrackApiKey(log: ILogger, maybeSdkKey: any): string | false;
|
|
7
|
+
export declare function releaseApiKey(sdkKey: string): void;
|
package/types/myLogger.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ISignalListener } from '../listeners/types';
|
|
2
|
-
import { ISdkReadinessManager } from '../readiness/types';
|
|
3
|
-
import { IStorageAsync, IStorageSync } from '../storages/types';
|
|
4
|
-
import { ISyncManager } from '../sync/types';
|
|
5
|
-
import { IEventTracker, IImpressionsTracker } from '../trackers/types';
|
|
6
|
-
import { ISettings } from '../types';
|
|
7
|
-
export interface IClientFactoryParams {
|
|
8
|
-
storage: IStorageSync | IStorageAsync;
|
|
9
|
-
sdkReadinessManager: ISdkReadinessManager;
|
|
10
|
-
settings: ISettings;
|
|
11
|
-
impressionsTracker: IImpressionsTracker;
|
|
12
|
-
eventTracker: IEventTracker;
|
|
13
|
-
}
|
|
14
|
-
export interface ISdkClientFactoryParams extends IClientFactoryParams {
|
|
15
|
-
signalListener?: ISignalListener;
|
|
16
|
-
syncManager?: ISyncManager;
|
|
17
|
-
sharedClient?: boolean;
|
|
18
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ICountsCacheSync } from '../types';
|
|
2
|
-
export declare class CountsCacheInMemory implements ICountsCacheSync {
|
|
3
|
-
private counters;
|
|
4
|
-
/**
|
|
5
|
-
* Add counts.
|
|
6
|
-
*/
|
|
7
|
-
track(metricName: string): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Clear the collector
|
|
10
|
-
*/
|
|
11
|
-
clear(): void;
|
|
12
|
-
/**
|
|
13
|
-
* Get the collected data, used as payload for posting.
|
|
14
|
-
*/
|
|
15
|
-
state(): Record<string, number>;
|
|
16
|
-
/**
|
|
17
|
-
* Check if the cache is empty.
|
|
18
|
-
*/
|
|
19
|
-
isEmpty(): boolean;
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ILatenciesCacheSync } from '../types';
|
|
2
|
-
export declare class LatenciesCacheInMemory implements ILatenciesCacheSync {
|
|
3
|
-
private counters;
|
|
4
|
-
/**
|
|
5
|
-
* Add latencies.
|
|
6
|
-
*/
|
|
7
|
-
track(metricName: string, latency: number): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Clear the collector
|
|
10
|
-
*/
|
|
11
|
-
clear(): void;
|
|
12
|
-
/**
|
|
13
|
-
* Get the collected data, used as payload for posting.
|
|
14
|
-
*/
|
|
15
|
-
state(): Record<string, number[]>;
|
|
16
|
-
/**
|
|
17
|
-
* Check if the cache is empty.
|
|
18
|
-
*/
|
|
19
|
-
isEmpty(): boolean;
|
|
20
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ICountsCacheAsync } from '../types';
|
|
2
|
-
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
3
|
-
import { Redis } from 'ioredis';
|
|
4
|
-
export declare class CountsCacheInRedis implements ICountsCacheAsync {
|
|
5
|
-
private readonly redis;
|
|
6
|
-
private readonly keys;
|
|
7
|
-
constructor(keys: KeyBuilderSS, redis: Redis);
|
|
8
|
-
track(metricName: string): Promise<boolean>;
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ILatenciesCacheAsync } from '../types';
|
|
2
|
-
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
3
|
-
import { Redis } from 'ioredis';
|
|
4
|
-
export declare class LatenciesCacheInRedis implements ILatenciesCacheAsync {
|
|
5
|
-
private readonly redis;
|
|
6
|
-
private readonly keys;
|
|
7
|
-
constructor(keys: KeyBuilderSS, redis: Redis);
|
|
8
|
-
track(metricName: string, latency: number): Promise<boolean>;
|
|
9
|
-
}
|
|
File without changes
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IEventsCacheSync } from '../../storages/types';
|
|
2
|
-
import { IPostEventsBulk } from '../../services/types';
|
|
3
|
-
import { ISyncTask, ITimeTracker } from '../types';
|
|
4
|
-
import { ILogger } from '../../logger/types';
|
|
5
|
-
/**
|
|
6
|
-
* Sync task that periodically posts tracked events
|
|
7
|
-
*/
|
|
8
|
-
export declare function eventsSyncTaskFactory(log: ILogger, postEventsBulk: IPostEventsBulk, eventsCache: IEventsCacheSync, eventsPushRate: number, eventsFirstPushWindow: number, latencyTracker?: ITimeTracker): ISyncTask;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ISyncTask, ITimeTracker } from '../types';
|
|
2
|
-
import { IPostTestImpressionsCount } from '../../services/types';
|
|
3
|
-
import { IImpressionCountsCacheSync } from '../../storages/types';
|
|
4
|
-
import { ImpressionCountsPayload } from './types';
|
|
5
|
-
import { ILogger } from '../../logger/types';
|
|
6
|
-
/**
|
|
7
|
-
* Converts `impressionCounts` data from cache into request payload.
|
|
8
|
-
*/
|
|
9
|
-
export declare function fromImpressionCountsCollector(impressionsCount: Record<string, number>): ImpressionCountsPayload;
|
|
10
|
-
/**
|
|
11
|
-
* Sync task that periodically posts impression counts
|
|
12
|
-
*/
|
|
13
|
-
export declare function impressionCountsSyncTaskFactory(log: ILogger, postTestImpressionsCount: IPostTestImpressionsCount, impressionCountsCache: IImpressionCountsCacheSync, latencyTracker?: ITimeTracker): ISyncTask;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ISyncTask, ITimeTracker } from '../types';
|
|
2
|
-
import { IPostTestImpressionsBulk } from '../../services/types';
|
|
3
|
-
import { IImpressionsCacheSync } from '../../storages/types';
|
|
4
|
-
import { ImpressionDTO } from '../../types';
|
|
5
|
-
import { ImpressionsPayload } from './types';
|
|
6
|
-
import { ILogger } from '../../logger/types';
|
|
7
|
-
/**
|
|
8
|
-
* Converts `impressions` data from cache into request payload.
|
|
9
|
-
*/
|
|
10
|
-
export declare function fromImpressionsCollector(sendLabels: boolean, data: ImpressionDTO[]): ImpressionsPayload;
|
|
11
|
-
/**
|
|
12
|
-
* Sync task that periodically posts impressions data
|
|
13
|
-
*/
|
|
14
|
-
export declare function impressionsSyncTaskFactory(log: ILogger, postTestImpressionsBulk: IPostTestImpressionsBulk, impressionsCache: IImpressionsCacheSync, impressionsRefreshRate: number, sendLabels?: boolean, latencyTracker?: ITimeTracker): ISyncTask;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ICountsCacheSync, ILatenciesCacheSync } from '../../storages/types';
|
|
2
|
-
import { IPostMetricsCounters, IPostMetricsTimes } from '../../services/types';
|
|
3
|
-
import { ISyncTask, ITimeTracker } from '../types';
|
|
4
|
-
import { ILogger } from '../../logger/types';
|
|
5
|
-
/**
|
|
6
|
-
* Sync task that periodically posts telemetry counts
|
|
7
|
-
*/
|
|
8
|
-
export declare function countsSyncTaskFactory(log: ILogger, postMetricsCounters: IPostMetricsCounters, countsCache: ICountsCacheSync, metricsRefreshRate: number, latencyTracker?: ITimeTracker): ISyncTask;
|
|
9
|
-
/**
|
|
10
|
-
* Sync task that periodically posts telemetry latencies
|
|
11
|
-
*/
|
|
12
|
-
export declare function latenciesSyncTaskFactory(log: ILogger, postMetricsLatencies: IPostMetricsTimes, latenciesCache: ILatenciesCacheSync, metricsRefreshRate: number, latencyTracker?: ITimeTracker): ISyncTask;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ISyncTask, ITimeTracker } from '../types';
|
|
2
|
-
import { IRecorderCacheProducerSync } from '../../storages/types';
|
|
3
|
-
import { ILogger } from '../../logger/types';
|
|
4
|
-
import { IResponse } from '../../services/types';
|
|
5
|
-
/**
|
|
6
|
-
* Base function to create submitter sync tasks, such as ImpressionsSyncTask and EventsSyncTask
|
|
7
|
-
*/
|
|
8
|
-
export declare function submitterSyncTaskFactory<TState extends {
|
|
9
|
-
length?: number;
|
|
10
|
-
}>(log: ILogger, postClient: (body: string) => Promise<IResponse>, sourceCache: IRecorderCacheProducerSync<TState>, postRate: number, dataName: string, latencyTracker?: ITimeTracker, fromCacheToPayload?: (cacheData: TState) => any, maxRetries?: number, debugLogs?: boolean): ISyncTask<[], void>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IFilter } from './types';
|
|
2
|
-
export declare class BloomFilterImp implements IFilter {
|
|
3
|
-
private spectedInsertions;
|
|
4
|
-
private errorRate;
|
|
5
|
-
private filter;
|
|
6
|
-
constructor(spectedInsertions: number, errorRate: number);
|
|
7
|
-
add(data: string): boolean;
|
|
8
|
-
contains(data: string): boolean;
|
|
9
|
-
clear(): void;
|
|
10
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '../../logger/types';
|
|
2
|
-
import { IResponse } from '../../services/types';
|
|
3
|
-
interface MetricsCollector {
|
|
4
|
-
countException(): void;
|
|
5
|
-
count(status: number): void;
|
|
6
|
-
latency(ms: number): void;
|
|
7
|
-
ready(ms: number): void;
|
|
8
|
-
getTreatment(ms: number): void;
|
|
9
|
-
getTreatments(ms: number): void;
|
|
10
|
-
getTreatmentWithConfig(ms: number): void;
|
|
11
|
-
getTreatmentsWithConfig(ms: number): void;
|
|
12
|
-
[method: string]: (ms: number) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const TrackerAPI: {
|
|
15
|
-
/**
|
|
16
|
-
* "Private" method, used to attach count/countException and stop callbacks to a promise.
|
|
17
|
-
*
|
|
18
|
-
* @param {ILogger} log - Logger.
|
|
19
|
-
* @param {Promise} promise - The promise we want to attach the callbacks.
|
|
20
|
-
* @param {string} task - The name of the task.
|
|
21
|
-
* @param {number | string} modifier - (optional) The modifier for the task, if any.
|
|
22
|
-
*/
|
|
23
|
-
__attachToPromise(log: ILogger, promise: Promise<IResponse>, task: string, collector: false | MetricsCollector, modifier?: string | number | undefined): Promise<IResponse>;
|
|
24
|
-
/**
|
|
25
|
-
* Starts tracking the time for a given task. All tasks tracked are considered "unique" because
|
|
26
|
-
* there may be multiple SDK instances tracking a "generic" task, making any task non-generic.
|
|
27
|
-
*
|
|
28
|
-
* @param {ILogger} log - Logger.
|
|
29
|
-
* @param {string} task - The task we are starting.
|
|
30
|
-
* @param {Object} collectors - The collectors map.
|
|
31
|
-
* @param {Promise} promise - (optional) The promise we are tracking.
|
|
32
|
-
* @return {Function | Promise} The stop function for this specific task or the promise received with the callbacks registered.
|
|
33
|
-
*/
|
|
34
|
-
start(log: ILogger, task: string, collectors?: Record<string, MetricsCollector> | undefined, promise?: Promise<IResponse> | undefined, now?: (() => number) | undefined): Promise<IResponse> | (() => number);
|
|
35
|
-
/**
|
|
36
|
-
* Setup the collector for a task that reports metrics.
|
|
37
|
-
*
|
|
38
|
-
* @param {string} task - The task name
|
|
39
|
-
* @param {number | string} taskUniqueId - The unique identifier for this task
|
|
40
|
-
* @param {Object} collectors - The collectors map.
|
|
41
|
-
*/
|
|
42
|
-
setCollectorForTask(task: string, taskUniqueId: number | string, collectors: Record<string, MetricsCollector>): void;
|
|
43
|
-
/**
|
|
44
|
-
* Stops the tracking of a given task.
|
|
45
|
-
*
|
|
46
|
-
* @param {ILogger} log - Logger.
|
|
47
|
-
* @param {string} task - The task we are starting.
|
|
48
|
-
* @param {number | string} modifier - (optional) The modifier for that specific task.
|
|
49
|
-
*/
|
|
50
|
-
stop(log: ILogger, task: string, modifier?: string | number | undefined): number | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* The constants shortcut for the task names.
|
|
53
|
-
*/
|
|
54
|
-
TaskNames: {
|
|
55
|
-
SDK_READY: string;
|
|
56
|
-
SDK_GET_TREATMENT: string;
|
|
57
|
-
SDK_GET_TREATMENTS: string;
|
|
58
|
-
SDK_GET_TREATMENT_WITH_CONFIG: string;
|
|
59
|
-
SDK_GET_TREATMENTS_WITH_CONFIG: string;
|
|
60
|
-
SPLITS_READY: string;
|
|
61
|
-
SEGMENTS_READY: string;
|
|
62
|
-
METRICS_PUSH: string;
|
|
63
|
-
IMPRESSIONS_PUSH: string;
|
|
64
|
-
EVENTS_PUSH: string;
|
|
65
|
-
MY_SEGMENTS_FETCH: string;
|
|
66
|
-
SEGMENTS_FETCH: string;
|
|
67
|
-
SPLITS_FETCH: string;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
export {};
|
/package/types/storages/inMemory/{uniqueKeysCacheInMemory.d.ts → UniqueKeysCacheInMemory.d.ts}
RENAMED
|
File without changes
|
/package/types/storages/inMemory/{uniqueKeysCacheInMemoryCS.d.ts → UniqueKeysCacheInMemoryCS.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|