@splitsoftware/splitio-commons 1.6.2-rc.3 → 1.6.2-rc.6
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/index.js +10 -11
- package/cjs/integrations/ga/GaToSplit.js +8 -5
- package/cjs/sdkFactory/index.js +2 -3
- package/cjs/sdkManager/index.js +3 -11
- package/cjs/services/splitApi.js +0 -1
- package/cjs/storages/AbstractSplitsCacheAsync.js +7 -9
- package/cjs/storages/AbstractSplitsCacheSync.js +7 -9
- package/cjs/storages/dataLoader.js +1 -1
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +5 -6
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +7 -10
- package/cjs/storages/inRedis/SplitsCacheInRedis.js +15 -9
- package/cjs/storages/pluggable/SplitsCachePluggable.js +14 -9
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +2 -3
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +1 -1
- package/cjs/trackers/telemetryTracker.js +6 -0
- package/cjs/types.js +2 -0
- package/cjs/utils/key/index.js +1 -1
- package/cjs/utils/settingsValidation/index.js +0 -1
- package/esm/evaluator/index.js +10 -11
- package/esm/integrations/ga/GaToSplit.js +8 -5
- package/esm/sdkFactory/index.js +2 -3
- package/esm/sdkManager/index.js +3 -11
- package/esm/services/splitApi.js +0 -1
- package/esm/storages/AbstractSplitsCacheAsync.js +7 -9
- package/esm/storages/AbstractSplitsCacheSync.js +7 -9
- package/esm/storages/dataLoader.js +1 -1
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +5 -6
- package/esm/storages/inMemory/SplitsCacheInMemory.js +7 -10
- package/esm/storages/inRedis/SplitsCacheInRedis.js +15 -9
- package/esm/storages/pluggable/SplitsCachePluggable.js +14 -9
- package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +2 -3
- package/esm/sync/polling/updaters/splitChangesUpdater.js +1 -1
- package/esm/trackers/telemetryTracker.js +6 -0
- package/esm/types.js +1 -0
- package/esm/utils/key/index.js +1 -1
- package/esm/utils/settingsValidation/index.js +0 -1
- package/package.json +2 -2
- package/src/consent/sdkUserConsent.ts +3 -4
- package/src/dtos/types.ts +8 -0
- package/src/evaluator/Engine.ts +3 -3
- package/src/evaluator/combiners/and.ts +1 -1
- package/src/evaluator/combiners/ifelseif.ts +3 -3
- package/src/evaluator/condition/engineUtils.ts +1 -1
- package/src/evaluator/condition/index.ts +6 -6
- package/src/evaluator/index.ts +18 -19
- package/src/evaluator/matchers/all.ts +1 -1
- package/src/evaluator/matchers/between.ts +1 -1
- package/src/evaluator/matchers/boolean.ts +1 -1
- package/src/evaluator/matchers/cont_all.ts +1 -1
- package/src/evaluator/matchers/cont_any.ts +1 -1
- package/src/evaluator/matchers/cont_str.ts +1 -1
- package/src/evaluator/matchers/dependency.ts +1 -1
- package/src/evaluator/matchers/eq.ts +1 -1
- package/src/evaluator/matchers/eq_set.ts +1 -1
- package/src/evaluator/matchers/ew.ts +1 -1
- package/src/evaluator/matchers/gte.ts +1 -1
- package/src/evaluator/matchers/index.ts +1 -1
- package/src/evaluator/matchers/lte.ts +1 -1
- package/src/evaluator/matchers/part_of.ts +1 -1
- package/src/evaluator/matchers/segment.ts +1 -1
- package/src/evaluator/matchers/string.ts +1 -1
- package/src/evaluator/matchers/sw.ts +1 -1
- package/src/evaluator/matchers/whitelist.ts +1 -1
- package/src/evaluator/parser/index.ts +3 -3
- package/src/evaluator/types.ts +6 -6
- package/src/evaluator/value/index.ts +4 -4
- package/src/evaluator/value/sanitize.ts +4 -4
- package/src/integrations/ga/GaToSplit.ts +15 -11
- package/src/integrations/ga/SplitToGa.ts +10 -10
- package/src/integrations/ga/types.ts +4 -4
- package/src/integrations/pluggable.ts +3 -3
- package/src/integrations/types.ts +4 -3
- package/src/logger/index.ts +3 -3
- package/src/logger/sdkLogger.ts +2 -1
- package/src/logger/types.ts +16 -0
- package/src/readiness/sdkReadinessManager.ts +1 -1
- package/src/readiness/types.ts +9 -2
- package/src/sdkClient/client.ts +13 -13
- package/src/sdkClient/clientAttributesDecoration.ts +9 -9
- package/src/sdkClient/clientCS.ts +4 -3
- package/src/sdkClient/clientInputValidation.ts +15 -15
- package/src/sdkClient/sdkClient.ts +2 -2
- package/src/sdkClient/sdkClientMethod.ts +2 -2
- package/src/sdkClient/sdkClientMethodCS.ts +9 -9
- package/src/sdkClient/sdkClientMethodCSWithTT.ts +9 -9
- package/src/sdkFactory/index.ts +4 -5
- package/src/sdkFactory/types.ts +4 -4
- package/src/sdkManager/index.ts +7 -16
- package/src/services/splitApi.ts +0 -1
- package/src/storages/AbstractSplitsCacheAsync.ts +13 -14
- package/src/storages/AbstractSplitsCacheSync.ts +14 -16
- package/src/storages/dataLoader.ts +3 -3
- package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +1 -1
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +10 -12
- package/src/storages/inLocalStorage/index.ts +2 -3
- package/src/storages/inMemory/EventsCacheInMemory.ts +4 -4
- package/src/storages/inMemory/SplitsCacheInMemory.ts +10 -14
- package/src/storages/inRedis/EventsCacheInRedis.ts +4 -4
- package/src/storages/inRedis/ImpressionsCacheInRedis.ts +1 -1
- package/src/storages/inRedis/RedisAdapter.ts +1 -1
- package/src/storages/inRedis/SegmentsCacheInRedis.ts +1 -1
- package/src/storages/inRedis/SplitsCacheInRedis.ts +22 -18
- package/src/storages/inRedis/TelemetryCacheInRedis.ts +1 -1
- package/src/storages/inRedis/index.ts +2 -3
- package/src/storages/pluggable/EventsCachePluggable.ts +4 -4
- package/src/storages/pluggable/ImpressionsCachePluggable.ts +1 -1
- package/src/storages/pluggable/SegmentsCachePluggable.ts +1 -1
- package/src/storages/pluggable/SplitsCachePluggable.ts +21 -18
- package/src/storages/pluggable/TelemetryCachePluggable.ts +1 -1
- package/src/storages/pluggable/index.ts +3 -3
- package/src/storages/pluggable/wrapperAdapter.ts +1 -1
- package/src/storages/types.ts +30 -54
- package/src/sync/offline/LocalhostFromObject.ts +4 -4
- package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +8 -8
- package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +5 -6
- package/src/sync/polling/updaters/mySegmentsUpdater.ts +1 -1
- package/src/sync/polling/updaters/segmentChangesUpdater.ts +1 -1
- package/src/sync/polling/updaters/splitChangesUpdater.ts +3 -3
- package/src/sync/streaming/SSEHandler/index.ts +1 -1
- package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +1 -1
- package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +1 -1
- package/src/sync/submitters/submitter.ts +1 -1
- package/src/sync/submitters/types.ts +2 -2
- package/src/sync/syncTask.ts +1 -1
- package/src/trackers/eventTracker.ts +3 -3
- package/src/trackers/impressionsTracker.ts +3 -3
- package/src/trackers/telemetryTracker.ts +7 -2
- package/src/trackers/types.ts +8 -4
- package/src/types.ts +1263 -0
- package/src/utils/constants/index.ts +1 -1
- package/src/utils/inputValidation/apiKey.ts +1 -1
- package/src/utils/inputValidation/attribute.ts +1 -1
- package/src/utils/inputValidation/attributes.ts +3 -3
- package/src/utils/inputValidation/event.ts +1 -1
- package/src/utils/inputValidation/eventProperties.ts +3 -3
- package/src/utils/inputValidation/eventValue.ts +1 -1
- package/src/utils/inputValidation/isOperational.ts +1 -1
- package/src/utils/inputValidation/key.ts +3 -3
- package/src/utils/inputValidation/preloadedData.ts +3 -3
- package/src/utils/inputValidation/split.ts +1 -1
- package/src/utils/inputValidation/splitExistance.ts +1 -1
- package/src/utils/inputValidation/splits.ts +1 -1
- package/src/utils/inputValidation/trafficType.ts +1 -1
- package/src/utils/inputValidation/trafficTypeExistance.ts +1 -1
- package/src/utils/key/index.ts +9 -9
- package/src/utils/settingsValidation/consent.ts +2 -1
- package/src/utils/settingsValidation/impressionsMode.ts +3 -3
- package/src/utils/settingsValidation/index.ts +0 -1
- package/src/utils/settingsValidation/integrations/common.ts +1 -1
- package/src/utils/settingsValidation/integrations/configurable.ts +1 -1
- package/src/utils/settingsValidation/integrations/pluggable.ts +2 -1
- package/src/utils/settingsValidation/localhost/builtin.ts +2 -1
- package/src/utils/settingsValidation/localhost/pluggable.ts +2 -1
- package/src/utils/settingsValidation/logger/builtinLogger.ts +2 -1
- package/src/utils/settingsValidation/logger/pluggableLogger.ts +2 -1
- package/src/utils/settingsValidation/splitFilters.ts +9 -7
- package/src/utils/settingsValidation/storage/storageCS.ts +2 -1
- package/types/consent/sdkUserConsent.d.ts +9 -2
- package/types/dtos/types.d.ts +6 -0
- package/types/evaluator/Engine.d.ts +3 -3
- package/types/evaluator/combiners/and.d.ts +1 -1
- package/types/evaluator/combiners/ifelseif.d.ts +1 -1
- package/types/evaluator/condition/engineUtils.d.ts +1 -1
- package/types/evaluator/condition/index.d.ts +1 -1
- package/types/evaluator/index.d.ts +4 -4
- package/types/evaluator/matchers/all.d.ts +1 -1
- package/types/evaluator/matchers/between.d.ts +1 -1
- package/types/evaluator/matchers/boolean.d.ts +1 -1
- package/types/evaluator/matchers/cont_all.d.ts +1 -1
- package/types/evaluator/matchers/cont_any.d.ts +1 -1
- package/types/evaluator/matchers/cont_str.d.ts +1 -1
- package/types/evaluator/matchers/dependency.d.ts +1 -1
- package/types/evaluator/matchers/eq.d.ts +1 -1
- package/types/evaluator/matchers/eq_set.d.ts +1 -1
- package/types/evaluator/matchers/ew.d.ts +1 -1
- package/types/evaluator/matchers/gte.d.ts +1 -1
- package/types/evaluator/matchers/index.d.ts +1 -1
- package/types/evaluator/matchers/lte.d.ts +1 -1
- package/types/evaluator/matchers/part_of.d.ts +1 -1
- package/types/evaluator/matchers/segment.d.ts +1 -1
- package/types/evaluator/matchers/string.d.ts +1 -1
- package/types/evaluator/matchers/sw.d.ts +1 -1
- package/types/evaluator/matchers/whitelist.d.ts +1 -1
- package/types/evaluator/parser/index.d.ts +1 -1
- package/types/evaluator/types.d.ts +6 -6
- package/types/evaluator/value/index.d.ts +3 -3
- package/types/evaluator/value/sanitize.d.ts +3 -3
- package/types/integrations/ga/GaToSplit.d.ts +4 -4
- package/types/integrations/ga/SplitToGa.d.ts +4 -4
- package/types/integrations/ga/types.d.ts +4 -4
- package/types/integrations/types.d.ts +4 -3
- package/types/logger/index.d.ts +5 -3
- package/types/logger/sdkLogger.d.ts +2 -1
- package/types/logger/types.d.ts +11 -0
- package/types/readiness/sdkReadinessManager.d.ts +1 -1
- package/types/readiness/types.d.ts +8 -2
- package/types/sdkClient/client.d.ts +2 -2
- package/types/sdkClient/clientAttributesDecoration.d.ts +8 -8
- package/types/sdkClient/clientCS.d.ts +3 -2
- package/types/sdkClient/clientInputValidation.d.ts +2 -2
- package/types/sdkClient/sdkClient.d.ts +2 -2
- package/types/sdkClient/sdkClientMethod.d.ts +2 -2
- package/types/sdkClient/sdkClientMethodCS.d.ts +2 -2
- package/types/sdkClient/sdkClientMethodCSWithTT.d.ts +2 -2
- package/types/sdkFactory/index.d.ts +2 -2
- package/types/sdkFactory/types.d.ts +6 -6
- package/types/sdkManager/index.d.ts +3 -3
- package/types/storages/AbstractSplitsCacheAsync.d.ts +6 -5
- package/types/storages/AbstractSplitsCacheSync.d.ts +5 -5
- package/types/storages/dataLoader.d.ts +2 -2
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +1 -1
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +4 -3
- package/types/storages/inLocalStorage/index.d.ts +2 -2
- package/types/storages/inMemory/EventsCacheInMemory.d.ts +3 -3
- package/types/storages/inMemory/InMemoryStorage.d.ts +1 -1
- package/types/storages/inMemory/InMemoryStorageCS.d.ts +1 -1
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +3 -2
- package/types/storages/inRedis/EventsCacheInRedis.d.ts +3 -3
- package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +1 -1
- package/types/storages/inRedis/RedisAdapter.d.ts +1 -1
- package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +1 -1
- package/types/storages/inRedis/SplitsCacheInRedis.d.ts +7 -6
- package/types/storages/inRedis/TelemetryCacheInRedis.d.ts +1 -1
- package/types/storages/inRedis/index.d.ts +2 -2
- package/types/storages/pluggable/EventsCachePluggable.d.ts +3 -3
- package/types/storages/pluggable/ImpressionsCachePluggable.d.ts +1 -1
- package/types/storages/pluggable/SegmentsCachePluggable.d.ts +1 -1
- package/types/storages/pluggable/SplitsCachePluggable.d.ts +7 -6
- package/types/storages/pluggable/TelemetryCachePluggable.d.ts +1 -1
- package/types/storages/pluggable/index.d.ts +2 -3
- package/types/storages/pluggable/wrapperAdapter.d.ts +1 -1
- package/types/storages/types.d.ts +28 -54
- package/types/sync/offline/LocalhostFromObject.d.ts +2 -2
- package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +1 -1
- package/types/sync/polling/updaters/segmentChangesUpdater.d.ts +1 -1
- package/types/sync/polling/updaters/splitChangesUpdater.d.ts +2 -2
- package/types/sync/streaming/SSEHandler/index.d.ts +1 -1
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +1 -1
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +1 -1
- package/types/sync/submitters/submitter.d.ts +1 -1
- package/types/sync/submitters/types.d.ts +2 -2
- package/types/sync/syncTask.d.ts +1 -1
- package/types/trackers/types.d.ts +8 -4
- package/types/types.d.ts +1261 -0
- package/types/utils/constants/index.d.ts +1 -1
- package/types/utils/inputValidation/apiKey.d.ts +1 -1
- package/types/utils/inputValidation/attribute.d.ts +1 -1
- package/types/utils/inputValidation/attributes.d.ts +3 -3
- package/types/utils/inputValidation/event.d.ts +1 -1
- package/types/utils/inputValidation/eventProperties.d.ts +3 -3
- package/types/utils/inputValidation/eventValue.d.ts +1 -1
- package/types/utils/inputValidation/isOperational.d.ts +1 -1
- package/types/utils/inputValidation/key.d.ts +3 -3
- package/types/utils/inputValidation/preloadedData.d.ts +3 -3
- package/types/utils/inputValidation/split.d.ts +1 -1
- package/types/utils/inputValidation/splitExistance.d.ts +1 -1
- package/types/utils/inputValidation/splits.d.ts +1 -1
- package/types/utils/inputValidation/trafficType.d.ts +1 -1
- package/types/utils/inputValidation/trafficTypeExistance.d.ts +1 -1
- package/types/utils/key/index.d.ts +4 -4
- package/types/utils/settingsValidation/consent.d.ts +2 -1
- package/types/utils/settingsValidation/impressionsMode.d.ts +3 -3
- package/types/utils/settingsValidation/integrations/common.d.ts +1 -1
- package/types/utils/settingsValidation/integrations/configurable.d.ts +1 -1
- package/types/utils/settingsValidation/integrations/pluggable.d.ts +2 -1
- package/types/utils/settingsValidation/localhost/builtin.d.ts +2 -1
- package/types/utils/settingsValidation/localhost/pluggable.d.ts +2 -1
- package/types/utils/settingsValidation/logger/builtinLogger.d.ts +1 -1
- package/types/utils/settingsValidation/logger/pluggableLogger.d.ts +1 -1
- package/types/utils/settingsValidation/splitFilters.d.ts +2 -1
- package/types/utils/settingsValidation/storage/storageCS.d.ts +3 -2
- package/src/types.d.ts +0 -1646
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IPluggableStorageWrapper, IStorageAsync, IStorageFactoryParams } from '../types';
|
|
2
|
-
|
|
1
|
+
import { IPluggableStorageWrapper, IStorageAsync, IStorageAsyncFactory, IStorageFactoryParams } from '../types';
|
|
2
|
+
|
|
3
3
|
import { KeyBuilderSS } from '../KeyBuilderSS';
|
|
4
4
|
import { SplitsCachePluggable } from './SplitsCachePluggable';
|
|
5
5
|
import { SegmentsCachePluggable } from './SegmentsCachePluggable';
|
|
@@ -58,7 +58,7 @@ function promisifyEventsTrack(events: any) {
|
|
|
58
58
|
/**
|
|
59
59
|
* Pluggable storage factory for consumer server-side & client-side SplitFactory.
|
|
60
60
|
*/
|
|
61
|
-
export function PluggableStorage(options: PluggableStorageOptions):
|
|
61
|
+
export function PluggableStorage(options: PluggableStorageOptions): IStorageAsyncFactory {
|
|
62
62
|
|
|
63
63
|
validatePluggableStorageOptions(options);
|
|
64
64
|
|
package/src/storages/types.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { MaybeThenable, IMetadata } from '../dtos/types';
|
|
1
|
+
import { MaybeThenable, IMetadata, ISplitFiltersValidation, ISplit } from '../dtos/types';
|
|
2
|
+
import { ILogger } from '../logger/types';
|
|
2
3
|
import { EventDataType, HttpErrors, HttpLatencies, ImpressionDataType, LastSync, Method, MethodExceptions, MethodLatencies, OperationType, StoredEventWithMetadata, StoredImpressionWithMetadata, StreamingEvent } from '../sync/submitters/types';
|
|
3
|
-
import { ImpressionDTO, SDKMode
|
|
4
|
+
import { SplitIO, ImpressionDTO, SDKMode } from '../types';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Interface of a pluggable storage wrapper.
|
|
@@ -190,14 +191,14 @@ export interface IPluggableStorageWrapper {
|
|
|
190
191
|
/** Splits cache */
|
|
191
192
|
|
|
192
193
|
export interface ISplitsCacheBase {
|
|
193
|
-
addSplits(entries: [string,
|
|
194
|
+
addSplits(entries: [string, ISplit][]): MaybeThenable<boolean[] | void>,
|
|
194
195
|
removeSplits(names: string[]): MaybeThenable<boolean[] | void>,
|
|
195
|
-
getSplit(name: string): MaybeThenable<
|
|
196
|
-
getSplits(names: string[]): MaybeThenable<Record<string,
|
|
196
|
+
getSplit(name: string): MaybeThenable<ISplit | null>,
|
|
197
|
+
getSplits(names: string[]): MaybeThenable<Record<string, ISplit | null>>, // `fetchMany` in spec
|
|
197
198
|
setChangeNumber(changeNumber: number): MaybeThenable<boolean | void>,
|
|
198
199
|
// should never reject or throw an exception. Instead return -1 by default, assuming no splits are present in the storage.
|
|
199
200
|
getChangeNumber(): MaybeThenable<number>,
|
|
200
|
-
getAll(): MaybeThenable<
|
|
201
|
+
getAll(): MaybeThenable<ISplit[]>,
|
|
201
202
|
getSplitNames(): MaybeThenable<string[]>,
|
|
202
203
|
// should never reject or throw an exception. Instead return true by default, asssuming the TT might exist.
|
|
203
204
|
trafficTypeExists(trafficType: string): MaybeThenable<boolean>,
|
|
@@ -210,13 +211,13 @@ export interface ISplitsCacheBase {
|
|
|
210
211
|
}
|
|
211
212
|
|
|
212
213
|
export interface ISplitsCacheSync extends ISplitsCacheBase {
|
|
213
|
-
addSplits(entries: [string,
|
|
214
|
+
addSplits(entries: [string, ISplit][]): boolean[],
|
|
214
215
|
removeSplits(names: string[]): boolean[],
|
|
215
|
-
getSplit(name: string):
|
|
216
|
-
getSplits(names: string[]): Record<string,
|
|
216
|
+
getSplit(name: string): ISplit | null,
|
|
217
|
+
getSplits(names: string[]): Record<string, ISplit | null>,
|
|
217
218
|
setChangeNumber(changeNumber: number): boolean,
|
|
218
219
|
getChangeNumber(): number,
|
|
219
|
-
getAll():
|
|
220
|
+
getAll(): ISplit[],
|
|
220
221
|
getSplitNames(): string[],
|
|
221
222
|
trafficTypeExists(trafficType: string): boolean,
|
|
222
223
|
usesSegments(): boolean,
|
|
@@ -226,13 +227,13 @@ export interface ISplitsCacheSync extends ISplitsCacheBase {
|
|
|
226
227
|
}
|
|
227
228
|
|
|
228
229
|
export interface ISplitsCacheAsync extends ISplitsCacheBase {
|
|
229
|
-
addSplits(entries: [string,
|
|
230
|
+
addSplits(entries: [string, ISplit][]): Promise<boolean[] | void>,
|
|
230
231
|
removeSplits(names: string[]): Promise<boolean[] | void>,
|
|
231
|
-
getSplit(name: string): Promise<
|
|
232
|
-
getSplits(names: string[]): Promise<Record<string,
|
|
232
|
+
getSplit(name: string): Promise<ISplit | null>,
|
|
233
|
+
getSplits(names: string[]): Promise<Record<string, ISplit | null>>,
|
|
233
234
|
setChangeNumber(changeNumber: number): Promise<boolean | void>,
|
|
234
235
|
getChangeNumber(): Promise<number>,
|
|
235
|
-
getAll(): Promise<
|
|
236
|
+
getAll(): Promise<ISplit[]>,
|
|
236
237
|
getSplitNames(): Promise<string[]>,
|
|
237
238
|
trafficTypeExists(trafficType: string): Promise<boolean>,
|
|
238
239
|
usesSegments(): Promise<boolean>,
|
|
@@ -288,7 +289,7 @@ export interface IImpressionsCacheBase {
|
|
|
288
289
|
|
|
289
290
|
export interface IEventsCacheBase {
|
|
290
291
|
// Consumer API method, used by events tracker, in standalone and consumer modes, to push events into the storage.
|
|
291
|
-
track(data: EventData, size?: number): MaybeThenable<boolean>
|
|
292
|
+
track(data: SplitIO.EventData, size?: number): MaybeThenable<boolean>
|
|
292
293
|
}
|
|
293
294
|
|
|
294
295
|
/** Impressions and events cache for standalone mode (sync) */
|
|
@@ -311,8 +312,8 @@ export interface IImpressionsCacheSync extends IImpressionsCacheBase, IRecorderC
|
|
|
311
312
|
setOnFullQueueCb(cb: () => void): void
|
|
312
313
|
}
|
|
313
314
|
|
|
314
|
-
export interface IEventsCacheSync extends IEventsCacheBase, IRecorderCacheProducerSync<EventData[]> {
|
|
315
|
-
track(data: EventData, size?: number): boolean
|
|
315
|
+
export interface IEventsCacheSync extends IEventsCacheBase, IRecorderCacheProducerSync<SplitIO.EventData[]> {
|
|
316
|
+
track(data: SplitIO.EventData, size?: number): boolean
|
|
316
317
|
/* Registers callback for full queue */
|
|
317
318
|
setOnFullQueueCb(cb: () => void): void
|
|
318
319
|
}
|
|
@@ -338,7 +339,7 @@ export interface IImpressionsCacheAsync extends IImpressionsCacheBase, IRecorder
|
|
|
338
339
|
export interface IEventsCacheAsync extends IEventsCacheBase, IRecorderCacheProducerAsync<StoredEventWithMetadata[]> {
|
|
339
340
|
// Consumer API method, used by events tracker (in standalone and consumer modes) to push data into.
|
|
340
341
|
// The result promise cannot reject.
|
|
341
|
-
track(data: EventData, size?: number): Promise<boolean>
|
|
342
|
+
track(data: SplitIO.EventData, size?: number): Promise<boolean>
|
|
342
343
|
}
|
|
343
344
|
|
|
344
345
|
/**
|
|
@@ -351,7 +352,7 @@ export interface IImpressionCountsCacheSync extends IRecorderCacheProducerSync<R
|
|
|
351
352
|
|
|
352
353
|
// Used by impressions count submitter in standalone and producer mode
|
|
353
354
|
isEmpty(): boolean // check if cache is empty. Return true if the cache was just created or cleared.
|
|
354
|
-
pop(toMerge?: Record<string, number>): Record<string, number> // pop cache data
|
|
355
|
+
pop(toMerge?: Record<string, number> ): Record<string, number> // pop cache data
|
|
355
356
|
}
|
|
356
357
|
|
|
357
358
|
|
|
@@ -494,39 +495,14 @@ export interface IStorageFactoryParams {
|
|
|
494
495
|
metadata: IMetadata,
|
|
495
496
|
}
|
|
496
497
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* Change number of the preloaded data.
|
|
509
|
-
* If this value is older than the current changeNumber at the storage, the data is not used to update the storage content.
|
|
510
|
-
*/
|
|
511
|
-
since: number,
|
|
512
|
-
/**
|
|
513
|
-
* Map of splits to their serialized definitions.
|
|
514
|
-
*/
|
|
515
|
-
splitsData: {
|
|
516
|
-
[splitName: string]: string
|
|
517
|
-
},
|
|
518
|
-
/**
|
|
519
|
-
* Optional map of user keys to their list of segments.
|
|
520
|
-
* @TODO remove when releasing first version
|
|
521
|
-
*/
|
|
522
|
-
mySegmentsData?: {
|
|
523
|
-
[key: string]: string[]
|
|
524
|
-
},
|
|
525
|
-
/**
|
|
526
|
-
* Optional map of segments to their serialized definitions.
|
|
527
|
-
* This property is ignored if `mySegmentsData` was provided.
|
|
528
|
-
*/
|
|
529
|
-
segmentsData?: {
|
|
530
|
-
[segmentName: string]: string
|
|
531
|
-
},
|
|
498
|
+
export type StorageType = 'MEMORY' | 'LOCALSTORAGE' | 'REDIS' | 'PLUGGABLE';
|
|
499
|
+
|
|
500
|
+
export type IStorageSyncFactory = {
|
|
501
|
+
readonly type: StorageType,
|
|
502
|
+
(params: IStorageFactoryParams): IStorageSync
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export type IStorageAsyncFactory = {
|
|
506
|
+
type: StorageType,
|
|
507
|
+
(params: IStorageFactoryParams): IStorageAsync
|
|
532
508
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { splitsParserFromSettingsFactory } from './splitsParser/splitsParserFromSettings';
|
|
2
2
|
import { syncManagerOfflineFactory } from './syncManagerOffline';
|
|
3
|
-
import {
|
|
3
|
+
import { SplitIO } from '../../types';
|
|
4
4
|
|
|
5
5
|
// Singleton instance of the factory function for offline SyncManager from object (a.k.a. localhostFromObject)
|
|
6
6
|
// SDK instances instantiate their SyncManagers with the same factory
|
|
7
|
-
const localhostFromObject
|
|
7
|
+
const localhostFromObject = syncManagerOfflineFactory(splitsParserFromSettingsFactory) as SplitIO.LocalhostFactory;
|
|
8
8
|
localhostFromObject.type = 'LocalhostFromObject';
|
|
9
9
|
|
|
10
|
-
export function LocalhostFromObject() {
|
|
11
|
-
return localhostFromObject
|
|
10
|
+
export function LocalhostFromObject(): SplitIO.LocalhostFactory {
|
|
11
|
+
return localhostFromObject;
|
|
12
12
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { ISplitPartial } from '../../../dtos/types';
|
|
2
|
-
import { ISettings,
|
|
2
|
+
import { ISettings, SplitIO } from '../../../types';
|
|
3
3
|
import { isObject, forOwn } from '../../../utils/lang';
|
|
4
4
|
import { parseCondition } from './parseCondition';
|
|
5
5
|
|
|
6
|
-
function hasTreatmentChanged(prev: string | TreatmentWithConfig, curr: string | TreatmentWithConfig) {
|
|
6
|
+
function hasTreatmentChanged(prev: string | SplitIO.TreatmentWithConfig, curr: string | SplitIO.TreatmentWithConfig) {
|
|
7
7
|
if (typeof prev !== typeof curr) return true;
|
|
8
8
|
|
|
9
9
|
if (typeof prev === 'string') { // strings treatments, just compare
|
|
10
10
|
return prev !== curr;
|
|
11
11
|
} else { // has treatment and config, compare both
|
|
12
|
-
return prev.treatment !== (curr as TreatmentWithConfig).treatment || prev.config !== (curr as TreatmentWithConfig).config;
|
|
12
|
+
return prev.treatment !== (curr as SplitIO.TreatmentWithConfig).treatment || prev.config !== (curr as SplitIO.TreatmentWithConfig).config;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function splitsParserFromSettingsFactory() {
|
|
17
17
|
|
|
18
|
-
let previousMock: MockedFeaturesMap = { 'emptyMock': '1' };
|
|
18
|
+
let previousMock: SplitIO.MockedFeaturesMap = { 'emptyMock': '1' };
|
|
19
19
|
|
|
20
|
-
function mockUpdated(currentData: MockedFeaturesMap) {
|
|
20
|
+
function mockUpdated(currentData: SplitIO.MockedFeaturesMap) {
|
|
21
21
|
const names = Object.keys(currentData);
|
|
22
22
|
|
|
23
23
|
// Different amount of items
|
|
@@ -42,7 +42,7 @@ export function splitsParserFromSettingsFactory() {
|
|
|
42
42
|
* @param settings validated object with mocked features mapping.
|
|
43
43
|
*/
|
|
44
44
|
return function splitsParserFromSettings(settings: ISettings): false | Record<string, ISplitPartial> {
|
|
45
|
-
const features = settings.features as MockedFeaturesMap || {};
|
|
45
|
+
const features = settings.features as SplitIO.MockedFeaturesMap || {};
|
|
46
46
|
|
|
47
47
|
if (!mockUpdated(features)) return false;
|
|
48
48
|
|
|
@@ -53,8 +53,8 @@ export function splitsParserFromSettingsFactory() {
|
|
|
53
53
|
let config = null;
|
|
54
54
|
|
|
55
55
|
if (isObject(data)) {
|
|
56
|
-
treatment = (data as TreatmentWithConfig).treatment;
|
|
57
|
-
config = (data as TreatmentWithConfig).config || config;
|
|
56
|
+
treatment = (data as SplitIO.TreatmentWithConfig).treatment;
|
|
57
|
+
config = (data as SplitIO.TreatmentWithConfig).config || config;
|
|
58
58
|
}
|
|
59
59
|
const configurations: Record<string, string> = {};
|
|
60
60
|
if (config !== null) configurations[treatment as string] = config;
|
|
@@ -2,7 +2,7 @@ import { forOwn } from '../../../utils/lang';
|
|
|
2
2
|
import { IReadinessManager } from '../../../readiness/types';
|
|
3
3
|
import { ISplitsCacheSync } from '../../../storages/types';
|
|
4
4
|
import { ISplitsParser } from '../splitsParser/types';
|
|
5
|
-
import { ISplitPartial } from '../../../dtos/types';
|
|
5
|
+
import { ISplit, ISplitPartial } from '../../../dtos/types';
|
|
6
6
|
import { syncTaskFactory } from '../../syncTask';
|
|
7
7
|
import { ISyncTask } from '../../types';
|
|
8
8
|
import { ISettings } from '../../../types';
|
|
@@ -24,7 +24,7 @@ export function fromObjectUpdaterFactory(
|
|
|
24
24
|
let startingUp = true;
|
|
25
25
|
|
|
26
26
|
return function objectUpdater() {
|
|
27
|
-
const splits: [string,
|
|
27
|
+
const splits: [string, ISplit][] = [];
|
|
28
28
|
let loadError = null;
|
|
29
29
|
let splitsMock: false | Record<string, ISplitPartial> = {};
|
|
30
30
|
try {
|
|
@@ -38,9 +38,8 @@ export function fromObjectUpdaterFactory(
|
|
|
38
38
|
log.debug(SYNC_OFFLINE_DATA, [JSON.stringify(splitsMock)]);
|
|
39
39
|
|
|
40
40
|
forOwn(splitsMock, function (val, name) {
|
|
41
|
-
splits.push([
|
|
42
|
-
name,
|
|
43
|
-
JSON.stringify({
|
|
41
|
+
splits.push([ // @ts-ignore Split changeNumber and seed is undefined in localhost mode
|
|
42
|
+
name, {
|
|
44
43
|
name,
|
|
45
44
|
status: 'ACTIVE',
|
|
46
45
|
killed: false,
|
|
@@ -49,7 +48,7 @@ export function fromObjectUpdaterFactory(
|
|
|
49
48
|
conditions: val.conditions || [],
|
|
50
49
|
configurations: val.configurations,
|
|
51
50
|
trafficTypeName: val.trafficTypeName
|
|
52
|
-
}
|
|
51
|
+
}
|
|
53
52
|
]);
|
|
54
53
|
});
|
|
55
54
|
|
|
@@ -3,7 +3,7 @@ import { ISegmentsCacheSync, ISplitsCacheSync } from '../../../storages/types';
|
|
|
3
3
|
import { ISegmentsEventEmitter } from '../../../readiness/types';
|
|
4
4
|
import { timeout } from '../../../utils/promise/timeout';
|
|
5
5
|
import { SDK_SEGMENTS_ARRIVED } from '../../../readiness/constants';
|
|
6
|
-
import { ILogger } from '../../../types';
|
|
6
|
+
import { ILogger } from '../../../logger/types';
|
|
7
7
|
import { SYNC_MYSEGMENTS_FETCH_RETRY } from '../../../logger/constants';
|
|
8
8
|
import { MySegmentsData } from '../types';
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ import { IReadinessManager } from '../../../readiness/types';
|
|
|
4
4
|
import { MaybeThenable } from '../../../dtos/types';
|
|
5
5
|
import { findIndex } from '../../../utils/lang';
|
|
6
6
|
import { SDK_SEGMENTS_ARRIVED } from '../../../readiness/constants';
|
|
7
|
-
import { ILogger } from '../../../types';
|
|
7
|
+
import { ILogger } from '../../../logger/types';
|
|
8
8
|
import { LOG_PREFIX_INSTANTIATION, LOG_PREFIX_SYNC_SEGMENTS } from '../../../logger/constants';
|
|
9
9
|
import { thenable } from '../../../utils/promise/thenable';
|
|
10
10
|
|
|
@@ -5,7 +5,7 @@ import { ISplit, ISplitChangesResponse } from '../../../dtos/types';
|
|
|
5
5
|
import { ISplitsEventEmitter } from '../../../readiness/types';
|
|
6
6
|
import { timeout } from '../../../utils/promise/timeout';
|
|
7
7
|
import { SDK_SPLITS_ARRIVED, SDK_SPLITS_CACHE_LOADED } from '../../../readiness/constants';
|
|
8
|
-
import { ILogger } from '../../../types';
|
|
8
|
+
import { ILogger } from '../../../logger/types';
|
|
9
9
|
import { SYNC_SPLITS_FETCH, SYNC_SPLITS_NEW, SYNC_SPLITS_REMOVED, SYNC_SPLITS_SEGMENTS, SYNC_SPLITS_FETCH_FAILS, SYNC_SPLITS_FETCH_RETRY } from '../../../logger/constants';
|
|
10
10
|
|
|
11
11
|
type ISplitChangesUpdater = (noCache?: boolean, till?: number) => Promise<boolean>
|
|
@@ -40,7 +40,7 @@ export function parseSegments({ conditions }: ISplit): ISet<string> {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
interface ISplitMutations {
|
|
43
|
-
added: [string,
|
|
43
|
+
added: [string, ISplit][],
|
|
44
44
|
removed: string[],
|
|
45
45
|
segments: string[]
|
|
46
46
|
}
|
|
@@ -54,7 +54,7 @@ export function computeSplitsMutation(entries: ISplit[]): ISplitMutations {
|
|
|
54
54
|
const segments = new _Set<string>();
|
|
55
55
|
const computed = entries.reduce((accum, split) => {
|
|
56
56
|
if (split.status === 'ACTIVE') {
|
|
57
|
-
accum.added.push([split.name,
|
|
57
|
+
accum.added.push([split.name, split]);
|
|
58
58
|
|
|
59
59
|
parseSegments(split).forEach((segmentName: string) => {
|
|
60
60
|
segments.add(segmentName);
|
|
@@ -4,7 +4,7 @@ import { PUSH_RETRYABLE_ERROR, PUSH_NONRETRYABLE_ERROR, OCCUPANCY, CONTROL, MY_S
|
|
|
4
4
|
import { IPushEventEmitter } from '../types';
|
|
5
5
|
import { ISseEventHandler } from '../SSEClient/types';
|
|
6
6
|
import { INotificationError, INotificationMessage } from './types';
|
|
7
|
-
import { ILogger } from '../../../types';
|
|
7
|
+
import { ILogger } from '../../../logger/types';
|
|
8
8
|
import { STREAMING_PARSING_ERROR_FAILS, ERROR_STREAMING_SSE, STREAMING_PARSING_MESSAGE_FAILS, STREAMING_NEW_MESSAGE } from '../../../logger/constants';
|
|
9
9
|
import { ABLY_ERROR, NON_REQUESTED, SSE_CONNECTION_ERROR } from '../../../utils/constants';
|
|
10
10
|
import { ITelemetryTracker } from '../../../trackers/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILogger } from '../../../types';
|
|
1
|
+
import { ILogger } from '../../../logger/types';
|
|
2
2
|
import { SDK_SPLITS_ARRIVED } from '../../../readiness/constants';
|
|
3
3
|
import { ISplitsEventEmitter } from '../../../readiness/types';
|
|
4
4
|
import { ISplitsCacheSync } from '../../../storages/types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { syncTaskFactory } from '../syncTask';
|
|
2
2
|
import { ISyncTask } from '../types';
|
|
3
3
|
import { IRecorderCacheProducerSync } from '../../storages/types';
|
|
4
|
-
import { ILogger } from '../../types';
|
|
4
|
+
import { ILogger } from '../../logger/types';
|
|
5
5
|
import { SUBMITTERS_PUSH, SUBMITTERS_PUSH_FAILS, SUBMITTERS_PUSH_RETRY } from '../../logger/constants';
|
|
6
6
|
import { IResponse } from '../../services/types';
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IMetadata } from '../../dtos/types';
|
|
2
|
-
import {
|
|
2
|
+
import { SplitIO } from '../../types';
|
|
3
3
|
import { ISyncTask } from '../types';
|
|
4
4
|
|
|
5
5
|
export type ImpressionsPayload = {
|
|
@@ -61,7 +61,7 @@ export type StoredEventWithMetadata = {
|
|
|
61
61
|
/** Metadata */
|
|
62
62
|
m: IMetadata,
|
|
63
63
|
/** Stored event */
|
|
64
|
-
e: EventData
|
|
64
|
+
e: SplitIO.EventData
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
package/src/sync/syncTask.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { objectAssign } from '../utils/lang/objectAssign';
|
|
|
2
2
|
import { thenable } from '../utils/promise/thenable';
|
|
3
3
|
import { IEventsCacheBase, ITelemetryCacheAsync, ITelemetryCacheSync } from '../storages/types';
|
|
4
4
|
import { IEventsHandler, IEventTracker } from './types';
|
|
5
|
-
import { ISettings,
|
|
5
|
+
import { ISettings, SplitIO } from '../types';
|
|
6
6
|
import { EVENTS_TRACKER_SUCCESS, ERROR_EVENTS_TRACKER } from '../logger/constants';
|
|
7
7
|
import { CONSENT_DECLINED, DROPPED, QUEUED } from '../utils/constants';
|
|
8
8
|
import { isStorageSync } from './impressionObserver/utils';
|
|
@@ -23,7 +23,7 @@ export function eventTrackerFactory(
|
|
|
23
23
|
const log = settings.log;
|
|
24
24
|
const isSync = isStorageSync(settings);
|
|
25
25
|
|
|
26
|
-
function queueEventsCallback(eventData: EventData, tracked: boolean) {
|
|
26
|
+
function queueEventsCallback(eventData: SplitIO.EventData, tracked: boolean) {
|
|
27
27
|
const { eventTypeId, trafficTypeName, key, value, timestamp, properties } = eventData;
|
|
28
28
|
// Logging every prop would be too much.
|
|
29
29
|
const msg = `event of type "${eventTypeId}" for traffic type "${trafficTypeName}". Key: ${key}. Value: ${value}. Timestamp: ${timestamp}. ${properties ? 'With properties.' : 'With no properties.'}`;
|
|
@@ -48,7 +48,7 @@ export function eventTrackerFactory(
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
return {
|
|
51
|
-
track(eventData: EventData, size?: number) {
|
|
51
|
+
track(eventData: SplitIO.EventData, size?: number) {
|
|
52
52
|
if (settings.userConsent === CONSENT_DECLINED) {
|
|
53
53
|
return isSync ? false : Promise.resolve(false);
|
|
54
54
|
}
|
|
@@ -3,7 +3,7 @@ import { thenable } from '../utils/promise/thenable';
|
|
|
3
3
|
import { truncateTimeFrame } from '../utils/time';
|
|
4
4
|
import { IImpressionCountsCacheSync, IImpressionsCacheBase, ITelemetryCacheSync, ITelemetryCacheAsync } from '../storages/types';
|
|
5
5
|
import { IImpressionsHandler, IImpressionsTracker } from './types';
|
|
6
|
-
import { ImpressionDTO, ISettings
|
|
6
|
+
import { SplitIO, ImpressionDTO, ISettings } from '../types';
|
|
7
7
|
import { IImpressionObserver } from './impressionObserver/types';
|
|
8
8
|
import { IMPRESSIONS_TRACKER_SUCCESS, ERROR_IMPRESSIONS_TRACKER, ERROR_IMPRESSIONS_LISTENER } from '../logger/constants';
|
|
9
9
|
import { CONSENT_DECLINED, DEDUPED, QUEUED } from '../utils/constants';
|
|
@@ -32,7 +32,7 @@ export function impressionsTrackerFactory(
|
|
|
32
32
|
const { log, impressionListener, runtime: { ip, hostname }, version } = settings;
|
|
33
33
|
|
|
34
34
|
return {
|
|
35
|
-
track(impressions: ImpressionDTO[], attributes?: Attributes) {
|
|
35
|
+
track(impressions: ImpressionDTO[], attributes?: SplitIO.Attributes) {
|
|
36
36
|
if (settings.userConsent === CONSENT_DECLINED) return;
|
|
37
37
|
|
|
38
38
|
const impressionsCount = impressions.length;
|
|
@@ -78,7 +78,7 @@ export function impressionsTrackerFactory(
|
|
|
78
78
|
// @TODO next block might be handled by the integration manager. In that case, the metadata object doesn't need to be passed in the constructor
|
|
79
79
|
if (impressionListener || integrationsManager) {
|
|
80
80
|
for (let i = 0; i < impressionsCount; i++) {
|
|
81
|
-
const impressionData: ImpressionData = {
|
|
81
|
+
const impressionData: SplitIO.ImpressionData = {
|
|
82
82
|
// copy of impression, to avoid unexpected behaviour if modified by integrations or impressionListener
|
|
83
83
|
impression: objectAssign({}, impressions[i]),
|
|
84
84
|
attributes,
|
|
@@ -48,6 +48,10 @@ export function telemetryTrackerFactory(
|
|
|
48
48
|
});
|
|
49
49
|
if (e === TOKEN_REFRESH) (telemetryCache as ITelemetryCacheSync).recordTokenRefreshes();
|
|
50
50
|
}
|
|
51
|
+
},
|
|
52
|
+
addTag(tag: string) {
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
if (telemetryCache.addTag) telemetryCache.addTag(tag);
|
|
51
55
|
}
|
|
52
56
|
};
|
|
53
57
|
|
|
@@ -56,8 +60,9 @@ export function telemetryTrackerFactory(
|
|
|
56
60
|
return {
|
|
57
61
|
trackEval: noopTrack,
|
|
58
62
|
trackHttp: noopTrack,
|
|
59
|
-
sessionLength
|
|
60
|
-
streamingEvent
|
|
63
|
+
sessionLength() { },
|
|
64
|
+
streamingEvent() { },
|
|
65
|
+
addTag() { }
|
|
61
66
|
};
|
|
62
67
|
}
|
|
63
68
|
}
|
package/src/trackers/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SplitIO, ImpressionDTO } from '../types';
|
|
2
2
|
import { StreamingEventType, Method, OperationType } from '../sync/submitters/types';
|
|
3
3
|
import { IEventsCacheBase } from '../storages/types';
|
|
4
4
|
import { NetworkError } from '../services/types';
|
|
@@ -6,7 +6,7 @@ import { NetworkError } from '../services/types';
|
|
|
6
6
|
/** Events tracker */
|
|
7
7
|
|
|
8
8
|
export interface IEventsHandler {
|
|
9
|
-
handleEvent(eventData: EventData): any
|
|
9
|
+
handleEvent(eventData: SplitIO.EventData): any
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export type IEventTracker = IEventsCacheBase
|
|
@@ -14,11 +14,11 @@ export type IEventTracker = IEventsCacheBase
|
|
|
14
14
|
/** Impressions tracker */
|
|
15
15
|
|
|
16
16
|
export interface IImpressionsHandler {
|
|
17
|
-
handleImpression(impressionData: ImpressionData): any
|
|
17
|
+
handleImpression(impressionData: SplitIO.ImpressionData): any
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface IImpressionsTracker {
|
|
21
|
-
track(impressions: ImpressionDTO[], attributes?: Attributes): void
|
|
21
|
+
track(impressions: ImpressionDTO[], attributes?: SplitIO.Attributes): void
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** Telemetry tracker */
|
|
@@ -41,4 +41,8 @@ export interface ITelemetryTracker {
|
|
|
41
41
|
* Records streaming event
|
|
42
42
|
*/
|
|
43
43
|
streamingEvent(e: StreamingEventType | AUTH_REJECTION, d?: number): void
|
|
44
|
+
/**
|
|
45
|
+
* Records tag
|
|
46
|
+
*/
|
|
47
|
+
addTag(tag: string): void
|
|
44
48
|
}
|