@splitsoftware/splitio-commons 1.2.1-rc.1 → 1.2.1-rc.12
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/consent/index.js +10 -0
- package/cjs/consent/sdkUserConsent.js +58 -0
- package/cjs/evaluator/Engine.js +6 -6
- package/cjs/evaluator/combiners/and.js +1 -1
- package/cjs/evaluator/combiners/ifelseif.js +2 -2
- package/cjs/evaluator/condition/engineUtils.js +2 -2
- package/cjs/evaluator/condition/index.js +4 -4
- package/cjs/evaluator/index.js +5 -5
- package/cjs/evaluator/matchers/cont_all.js +1 -1
- package/cjs/evaluator/matchers/cont_any.js +1 -1
- package/cjs/evaluator/matchers/cont_str.js +1 -1
- package/cjs/evaluator/matchers/dependency.js +1 -1
- package/cjs/evaluator/matchers/eq_set.js +1 -1
- package/cjs/evaluator/matchers/ew.js +1 -1
- package/cjs/evaluator/matchers/part_of.js +1 -1
- package/cjs/evaluator/matchers/segment.js +1 -1
- package/cjs/evaluator/matchers/sw.js +1 -1
- package/cjs/evaluator/matchers/whitelist.js +1 -1
- package/cjs/evaluator/matchersTransform/index.js +12 -12
- package/cjs/evaluator/parser/index.js +6 -6
- package/cjs/evaluator/treatments/index.js +1 -1
- package/cjs/evaluator/value/index.js +1 -1
- package/cjs/evaluator/value/sanitize.js +4 -4
- package/cjs/integrations/browser.js +3 -3
- package/cjs/integrations/ga/GaToSplit.js +14 -14
- package/cjs/integrations/ga/GoogleAnalyticsToSplit.js +5 -3
- package/cjs/integrations/ga/SplitToGa.js +1 -1
- package/cjs/integrations/ga/SplitToGoogleAnalytics.js +4 -2
- package/cjs/listeners/browser.js +15 -11
- package/cjs/listeners/node.js +1 -1
- package/cjs/logger/constants.js +9 -3
- package/cjs/logger/index.js +2 -2
- package/cjs/logger/messages/debug.js +4 -4
- package/cjs/logger/messages/error.js +5 -4
- package/cjs/logger/messages/info.js +8 -5
- package/cjs/logger/messages/warn.js +1 -1
- package/cjs/logger/sdkLogger.js +1 -1
- package/cjs/readiness/readinessManager.js +2 -2
- package/cjs/readiness/sdkReadinessManager.js +4 -4
- package/cjs/sdkClient/client.js +12 -11
- package/cjs/sdkClient/clientAttributesDecoration.js +4 -4
- package/cjs/sdkClient/clientCS.js +3 -3
- package/cjs/sdkClient/clientInputValidation.js +20 -22
- package/cjs/sdkClient/sdkClient.js +6 -9
- package/cjs/sdkClient/sdkClientMethod.js +1 -1
- package/cjs/sdkClient/sdkClientMethodCS.js +7 -13
- package/cjs/sdkClient/sdkClientMethodCSWithTT.js +8 -18
- package/cjs/sdkFactory/index.js +16 -13
- package/cjs/sdkManager/index.js +11 -11
- package/cjs/services/splitApi.js +3 -2
- package/cjs/services/splitHttpClient.js +2 -2
- package/cjs/storages/KeyBuilder.js +2 -6
- package/cjs/storages/KeyBuilderCS.js +13 -3
- package/cjs/storages/KeyBuilderSS.js +1 -1
- package/cjs/storages/findLatencyIndex.js +1 -1
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +24 -4
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +12 -12
- package/cjs/storages/inLocalStorage/index.js +4 -4
- package/cjs/storages/inMemory/AttributesCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/ImpressionsCacheInMemory.js +15 -1
- package/cjs/storages/inMemory/InMemoryStorage.js +1 -1
- package/cjs/storages/inMemory/InMemoryStorageCS.js +1 -1
- package/cjs/storages/inMemory/LatenciesCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +1 -1
- package/cjs/storages/inMemory/SegmentsCacheInMemory.js +2 -2
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +5 -5
- package/cjs/storages/inRedis/LatenciesCacheInRedis.js +1 -1
- package/cjs/storages/inRedis/RedisAdapter.js +24 -11
- package/cjs/storages/inRedis/SegmentsCacheInRedis.js +1 -1
- package/cjs/storages/inRedis/SplitsCacheInRedis.js +3 -3
- package/cjs/storages/inRedis/index.js +1 -1
- package/cjs/storages/pluggable/SegmentsCachePluggable.js +1 -1
- package/cjs/storages/pluggable/SplitsCachePluggable.js +3 -3
- package/cjs/storages/pluggable/inMemoryWrapper.js +4 -4
- package/cjs/storages/pluggable/index.js +6 -6
- package/cjs/sync/offline/LocalhostFromFile.js +1 -1
- package/cjs/sync/offline/LocalhostFromObject.js +1 -1
- package/cjs/sync/offline/splitsParser/parseCondition.js +1 -1
- package/cjs/sync/offline/splitsParser/splitsParserFromFile.js +13 -13
- package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +3 -3
- package/cjs/sync/offline/syncManagerOffline.js +1 -1
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +2 -2
- package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
- package/cjs/sync/polling/pollingManagerCS.js +6 -6
- package/cjs/sync/polling/pollingManagerSS.js +3 -3
- package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +1 -1
- package/cjs/sync/polling/syncTasks/segmentsSyncTask.js +1 -1
- package/cjs/sync/polling/syncTasks/splitsSyncTask.js +1 -1
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +1 -1
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +2 -2
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +2 -2
- package/cjs/sync/streaming/AuthClient/index.js +3 -3
- package/cjs/sync/streaming/SSEClient/index.js +2 -1
- package/cjs/sync/streaming/SSEHandler/NotificationParser.js +1 -1
- package/cjs/sync/streaming/SSEHandler/index.js +3 -3
- package/cjs/sync/streaming/mySegmentsV2utils.js +1 -1
- package/cjs/sync/streaming/pushManager.js +24 -17
- package/cjs/sync/submitters/eventsSyncTask.js +17 -5
- package/cjs/sync/submitters/impressionCountsSyncTask.js +1 -1
- package/cjs/sync/submitters/impressionsSyncTask.js +15 -3
- package/cjs/sync/submitters/metricsSyncTask.js +3 -3
- package/cjs/sync/submitters/submitterManager.js +4 -4
- package/cjs/sync/submitters/submitterSyncTask.js +1 -1
- package/cjs/sync/syncManagerOnline.js +12 -8
- package/cjs/trackers/eventTracker.js +11 -4
- package/cjs/trackers/impressionObserver/impressionObserverCS.js +1 -1
- package/cjs/trackers/impressionObserver/impressionObserverSS.js +1 -1
- package/cjs/trackers/impressionObserver/utils.js +8 -1
- package/cjs/trackers/impressionsTracker.js +9 -8
- package/cjs/utils/MinEvents.js +2 -1
- package/cjs/utils/constants/index.js +5 -1
- package/cjs/utils/inputValidation/apiKey.js +1 -1
- package/cjs/utils/inputValidation/attribute.js +4 -4
- package/cjs/utils/inputValidation/attributes.js +2 -2
- package/cjs/utils/inputValidation/event.js +1 -1
- package/cjs/utils/inputValidation/eventProperties.js +5 -5
- package/cjs/utils/inputValidation/eventValue.js +1 -1
- package/cjs/utils/inputValidation/key.js +6 -5
- package/cjs/utils/inputValidation/preloadedData.js +8 -8
- package/cjs/utils/inputValidation/split.js +1 -1
- package/cjs/utils/inputValidation/splits.js +2 -2
- package/cjs/utils/inputValidation/trafficType.js +1 -1
- package/cjs/utils/inputValidation/trafficTypeExistance.js +1 -1
- package/cjs/utils/jwt/index.js +1 -1
- package/cjs/utils/key/index.js +3 -3
- package/cjs/utils/lang/index.js +13 -4
- package/cjs/utils/lang/maps.js +16 -2
- package/cjs/utils/murmur3/common.js +1 -1
- package/cjs/utils/murmur3/murmur3.js +10 -10
- package/cjs/utils/murmur3/murmur3_128.js +1 -1
- package/cjs/utils/murmur3/murmur3_128_x86.js +37 -37
- package/cjs/utils/murmur3/murmur3_64.js +1 -1
- package/cjs/utils/settingsValidation/consent.js +16 -0
- package/cjs/utils/settingsValidation/impressionsMode.js +6 -6
- package/cjs/utils/settingsValidation/index.js +32 -14
- package/cjs/utils/settingsValidation/integrations/configurable.js +1 -1
- package/cjs/utils/settingsValidation/integrations/pluggable.js +1 -1
- package/cjs/utils/settingsValidation/localhost/builtin.js +2 -2
- package/cjs/utils/settingsValidation/logger/builtinLogger.js +3 -3
- package/cjs/utils/settingsValidation/logger/commons.js +1 -1
- package/cjs/utils/settingsValidation/logger/pluggableLogger.js +1 -1
- package/cjs/utils/settingsValidation/runtime.js +11 -0
- package/cjs/utils/settingsValidation/splitFilters.js +1 -1
- package/cjs/utils/settingsValidation/storage/storageCS.js +1 -1
- package/cjs/utils/timeTracker/index.js +3 -3
- package/esm/consent/index.js +6 -0
- package/esm/consent/sdkUserConsent.js +54 -0
- package/esm/integrations/ga/GoogleAnalyticsToSplit.js +4 -2
- package/esm/integrations/ga/SplitToGoogleAnalytics.js +4 -2
- package/esm/listeners/browser.js +14 -10
- package/esm/logger/constants.js +6 -2
- package/esm/logger/messages/debug.js +3 -3
- package/esm/logger/messages/error.js +4 -3
- package/esm/logger/messages/info.js +7 -4
- package/esm/sdkClient/client.js +3 -2
- package/esm/sdkClient/clientCS.js +1 -1
- package/esm/sdkClient/clientInputValidation.js +6 -8
- package/esm/sdkClient/sdkClient.js +4 -7
- package/esm/sdkClient/sdkClientMethodCS.js +3 -9
- package/esm/sdkClient/sdkClientMethodCSWithTT.js +3 -13
- package/esm/sdkFactory/index.js +10 -7
- package/esm/services/splitApi.js +2 -1
- package/esm/storages/KeyBuilder.js +2 -6
- package/esm/storages/KeyBuilderCS.js +11 -1
- package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +23 -3
- package/esm/storages/inLocalStorage/index.js +1 -1
- package/esm/storages/inMemory/ImpressionsCacheInMemory.js +15 -1
- package/esm/storages/inMemory/InMemoryStorage.js +1 -1
- package/esm/storages/inMemory/InMemoryStorageCS.js +1 -1
- package/esm/storages/inRedis/RedisAdapter.js +15 -2
- package/esm/storages/pluggable/index.js +2 -2
- package/esm/sync/offline/splitsParser/splitsParserFromFile.js +1 -1
- package/esm/sync/polling/fetchers/segmentChangesFetcher.js +2 -2
- package/esm/sync/streaming/SSEClient/index.js +2 -1
- package/esm/sync/streaming/pushManager.js +9 -2
- package/esm/sync/submitters/eventsSyncTask.js +18 -6
- package/esm/sync/submitters/impressionsSyncTask.js +13 -1
- package/esm/sync/syncManagerOnline.js +11 -7
- package/esm/trackers/eventTracker.js +8 -1
- package/esm/trackers/impressionObserver/utils.js +7 -1
- package/esm/trackers/impressionsTracker.js +6 -5
- package/esm/utils/constants/index.js +4 -0
- package/esm/utils/inputValidation/attributes.js +1 -1
- package/esm/utils/inputValidation/key.js +2 -1
- package/esm/utils/lang/index.js +12 -4
- package/esm/utils/lang/maps.js +14 -1
- package/esm/utils/settingsValidation/consent.js +12 -0
- package/esm/utils/settingsValidation/impressionsMode.js +7 -7
- package/esm/utils/settingsValidation/index.js +28 -10
- package/esm/utils/settingsValidation/runtime.js +7 -0
- package/package.json +8 -8
- package/src/consent/index.ts +8 -0
- package/src/consent/sdkUserConsent.ts +58 -0
- package/src/evaluator/parser/index.ts +1 -1
- package/src/evaluator/types.ts +2 -2
- package/src/evaluator/value/index.ts +2 -2
- package/src/evaluator/value/sanitize.ts +2 -2
- package/src/integrations/ga/GoogleAnalyticsToSplit.ts +7 -4
- package/src/integrations/ga/SplitToGoogleAnalytics.ts +7 -4
- package/src/integrations/pluggable.ts +2 -2
- package/src/integrations/types.ts +5 -0
- package/src/listeners/browser.ts +13 -9
- package/src/logger/constants.ts +6 -2
- package/src/logger/messages/debug.ts +3 -3
- package/src/logger/messages/error.ts +4 -3
- package/src/logger/messages/info.ts +7 -4
- package/src/logger/types.ts +4 -0
- package/src/sdkClient/client.ts +5 -5
- package/src/sdkClient/clientCS.ts +1 -1
- package/src/sdkClient/clientInputValidation.ts +8 -7
- package/src/sdkClient/sdkClient.ts +6 -9
- package/src/sdkClient/sdkClientMethod.ts +2 -2
- package/src/sdkClient/sdkClientMethodCS.ts +5 -11
- package/src/sdkClient/sdkClientMethodCSWithTT.ts +6 -16
- package/src/sdkFactory/index.ts +11 -8
- package/src/sdkFactory/types.ts +14 -3
- package/src/storages/KeyBuilder.ts +2 -6
- package/src/storages/KeyBuilderCS.ts +13 -1
- package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +23 -3
- package/src/storages/inLocalStorage/index.ts +1 -1
- package/src/storages/inMemory/ImpressionsCacheInMemory.ts +22 -1
- package/src/storages/inMemory/InMemoryStorage.ts +1 -1
- package/src/storages/inMemory/InMemoryStorageCS.ts +1 -1
- package/src/storages/inRedis/RedisAdapter.ts +8 -2
- package/src/storages/pluggable/index.ts +2 -2
- package/src/storages/types.ts +6 -2
- package/src/sync/offline/splitsParser/splitsParserFromFile.ts +1 -1
- package/src/sync/streaming/SSEClient/index.ts +2 -1
- package/src/sync/streaming/pushManager.ts +11 -2
- package/src/sync/submitters/eventsSyncTask.ts +19 -6
- package/src/sync/submitters/impressionsSyncTask.ts +16 -1
- package/src/sync/syncManagerOnline.ts +13 -7
- package/src/sync/types.ts +4 -1
- package/src/trackers/eventTracker.ts +11 -3
- package/src/trackers/impressionObserver/utils.ts +8 -1
- package/src/trackers/impressionsTracker.ts +7 -8
- package/src/types.ts +22 -1
- package/src/utils/constants/index.ts +5 -0
- package/src/utils/inputValidation/attributes.ts +1 -2
- package/src/utils/lang/index.ts +15 -4
- package/src/utils/lang/maps.ts +15 -1
- package/src/utils/settingsValidation/consent.ts +16 -0
- package/src/utils/settingsValidation/impressionsMode.ts +8 -8
- package/src/utils/settingsValidation/index.ts +29 -10
- package/src/utils/settingsValidation/runtime.ts +9 -0
- package/src/utils/settingsValidation/types.ts +12 -6
- package/types/consent/index.d.ts +2 -0
- package/types/consent/sdkUserConsent.d.ts +13 -0
- package/types/evaluator/types.d.ts +2 -2
- package/types/evaluator/value/index.d.ts +1 -1
- package/types/evaluator/value/sanitize.d.ts +1 -1
- package/types/integrations/ga/GoogleAnalyticsToSplit.d.ts +2 -2
- package/types/integrations/ga/SplitToGoogleAnalytics.d.ts +2 -3
- package/types/integrations/types.d.ts +4 -0
- package/types/logger/constants.d.ts +6 -2
- package/types/logger/types.d.ts +4 -0
- package/types/sdkClient/client.d.ts +2 -2
- package/types/sdkClient/clientAttributesDecoration.d.ts +1 -1
- package/types/sdkClient/clientInputValidation.d.ts +2 -3
- 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/types.d.ts +12 -3
- package/types/sdkFactory/userConsentProps.d.ts +6 -0
- package/types/storages/KeyBuilderCS.d.ts +2 -0
- package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +9 -0
- package/types/storages/inRedis/RedisAdapter.d.ts +1 -1
- package/types/storages/types.d.ts +3 -1
- package/types/sync/types.d.ts +3 -0
- package/types/trackers/eventTracker.d.ts +2 -2
- package/types/trackers/impressionObserver/utils.d.ts +4 -0
- package/types/trackers/impressionsTracker.d.ts +2 -3
- package/types/types.d.ts +22 -1
- package/types/utils/consent.d.ts +2 -0
- package/types/utils/constants/index.d.ts +3 -0
- package/types/utils/lang/index.d.ts +6 -1
- package/types/utils/lang/maps.d.ts +7 -0
- package/types/utils/settingsValidation/consent.d.ts +6 -0
- package/types/utils/settingsValidation/impressionsMode.d.ts +1 -1
- package/types/utils/settingsValidation/runtime/browser.d.ts +2 -0
- package/types/utils/settingsValidation/runtime/node.d.ts +2 -0
- package/types/utils/settingsValidation/runtime.d.ts +2 -0
- package/types/utils/settingsValidation/types.d.ts +12 -6
- package/types/utils/settingsValidation/userConsent.d.ts +5 -0
- package/cjs/sdkClient/types.js +0 -2
- package/esm/sdkClient/types.js +0 -1
- package/src/sdkClient/types.ts +0 -21
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntegrationFactory } from '../types';
|
|
2
2
|
import { GoogleAnalyticsToSplitOptions } from './types';
|
|
3
|
-
export declare function GoogleAnalyticsToSplit(options: GoogleAnalyticsToSplitOptions):
|
|
3
|
+
export declare function GoogleAnalyticsToSplit(options: GoogleAnalyticsToSplitOptions): IntegrationFactory;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SplitToGa } from './SplitToGa';
|
|
1
|
+
import { IntegrationFactory } from '../types';
|
|
3
2
|
import { SplitToGoogleAnalyticsOptions } from './types';
|
|
4
|
-
export declare function SplitToGoogleAnalytics(options?: SplitToGoogleAnalyticsOptions):
|
|
3
|
+
export declare function SplitToGoogleAnalytics(options?: SplitToGoogleAnalyticsOptions): IntegrationFactory;
|
|
@@ -60,13 +60,16 @@ export declare const STREAMING_RECONNECT = 111;
|
|
|
60
60
|
export declare const STREAMING_CONNECTING = 112;
|
|
61
61
|
export declare const STREAMING_DISABLED = 113;
|
|
62
62
|
export declare const STREAMING_DISCONNECTING = 114;
|
|
63
|
-
export declare const
|
|
63
|
+
export declare const SUBMITTERS_PUSH_FULL_QUEUE = 115;
|
|
64
64
|
export declare const SUBMITTERS_PUSH = 116;
|
|
65
65
|
export declare const SYNC_START_POLLING = 117;
|
|
66
66
|
export declare const SYNC_CONTINUE_POLLING = 118;
|
|
67
67
|
export declare const SYNC_STOP_POLLING = 119;
|
|
68
68
|
export declare const EVENTS_TRACKER_SUCCESS = 120;
|
|
69
69
|
export declare const IMPRESSIONS_TRACKER_SUCCESS = 121;
|
|
70
|
+
export declare const USER_CONSENT_UPDATED = 122;
|
|
71
|
+
export declare const USER_CONSENT_NOT_UPDATED = 123;
|
|
72
|
+
export declare const USER_CONSENT_INITIAL = 124;
|
|
70
73
|
export declare const ENGINE_VALUE_INVALID = 200;
|
|
71
74
|
export declare const ENGINE_VALUE_NO_ATTRIBUTES = 201;
|
|
72
75
|
export declare const CLIENT_NO_LISTENER = 202;
|
|
@@ -112,10 +115,11 @@ export declare const ERROR_INVALID_KEY_OBJECT = 317;
|
|
|
112
115
|
export declare const ERROR_INVALID = 318;
|
|
113
116
|
export declare const ERROR_EMPTY = 319;
|
|
114
117
|
export declare const ERROR_EMPTY_ARRAY = 320;
|
|
115
|
-
export declare const
|
|
118
|
+
export declare const ERROR_INVALID_CONFIG_PARAM = 321;
|
|
116
119
|
export declare const ERROR_HTTP = 322;
|
|
117
120
|
export declare const ERROR_LOCALHOST_MODULE_REQUIRED = 323;
|
|
118
121
|
export declare const ERROR_STORAGE_INVALID = 324;
|
|
122
|
+
export declare const ERROR_NOT_BOOLEAN = 325;
|
|
119
123
|
export declare const LOG_PREFIX_SETTINGS = "settings";
|
|
120
124
|
export declare const LOG_PREFIX_INSTANTIATION = "Factory instantiation";
|
|
121
125
|
export declare const LOG_PREFIX_ENGINE = "engine";
|
package/types/logger/types.d.ts
CHANGED
|
@@ -6,8 +6,12 @@ export interface ILoggerOptions {
|
|
|
6
6
|
}
|
|
7
7
|
export interface ILogger {
|
|
8
8
|
setLogLevel(logLevel: LogLevel): void;
|
|
9
|
+
debug(msg: any): void;
|
|
9
10
|
debug(msg: string | number, args?: any[]): void;
|
|
11
|
+
info(msg: any): void;
|
|
10
12
|
info(msg: string | number, args?: any[]): void;
|
|
13
|
+
warn(msg: any): void;
|
|
11
14
|
warn(msg: string | number, args?: any[]): void;
|
|
15
|
+
error(msg: any): void;
|
|
12
16
|
error(msg: string | number, args?: any[]): void;
|
|
13
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IClientFactoryParams } from './types';
|
|
2
1
|
import { SplitIO } from '../types';
|
|
2
|
+
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
3
3
|
/**
|
|
4
4
|
* Creator of base client with getTreatments and track methods.
|
|
5
5
|
*/
|
|
6
|
-
export declare function clientFactory(params:
|
|
6
|
+
export declare function clientFactory(params: ISdkFactoryContext): SplitIO.IClient | SplitIO.IAsyncClient;
|
|
@@ -8,7 +8,7 @@ export declare function clientAttributesDecoration<TClient extends SplitIO.IClie
|
|
|
8
8
|
getTreatmentWithConfig: (maybeKey: SplitIO.SplitKey, maybeSplit: string, maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentWithConfig | SplitIO.AsyncTreatmentWithConfig;
|
|
9
9
|
getTreatments: (maybeKey: SplitIO.SplitKey, maybeSplits: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.Treatments | SplitIO.AsyncTreatments;
|
|
10
10
|
getTreatmentsWithConfig: (maybeKey: SplitIO.SplitKey, maybeSplits: string[], maybeAttributes?: SplitIO.Attributes | undefined) => SplitIO.TreatmentsWithConfig | SplitIO.AsyncTreatmentsWithConfig;
|
|
11
|
-
track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) =>
|
|
11
|
+
track: (maybeKey: SplitIO.SplitKey, maybeTT: string, maybeEvent: string, maybeEventValue?: number | undefined, maybeProperties?: SplitIO.Properties | undefined) => boolean | Promise<boolean>;
|
|
12
12
|
/**
|
|
13
13
|
* Add an attribute to client's in memory attributes storage
|
|
14
14
|
*
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { IReadinessManager } from '../readiness/types';
|
|
2
|
-
import { SplitIO } from '../types';
|
|
3
|
-
import { ILogger } from '../logger/types';
|
|
2
|
+
import { ISettings, SplitIO } from '../types';
|
|
4
3
|
/**
|
|
5
4
|
* Decorator that validates the input before actually executing the client methods.
|
|
6
5
|
* We should "guard" the client here, while not polluting the "real" implementation of those methods.
|
|
7
6
|
*/
|
|
8
|
-
export declare function clientInputValidationDecorator<TClient extends SplitIO.IClient | SplitIO.IAsyncClient>(
|
|
7
|
+
export declare function clientInputValidationDecorator<TClient extends SplitIO.IClient | SplitIO.IAsyncClient>(settings: ISettings, client: TClient, readinessManager: IReadinessManager): TClient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SplitIO } from '../types';
|
|
2
|
-
import {
|
|
2
|
+
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
3
3
|
/**
|
|
4
4
|
* Creates an Sdk client, i.e., a base client with status and destroy interface
|
|
5
5
|
*/
|
|
6
|
-
export declare function sdkClientFactory(params:
|
|
6
|
+
export declare function sdkClientFactory(params: ISdkFactoryContext, isSharedClient?: boolean): SplitIO.IClient | SplitIO.IAsyncClient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ISdkClientFactoryParams } from './types';
|
|
2
1
|
import { SplitIO } from '../types';
|
|
2
|
+
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
3
3
|
/**
|
|
4
4
|
* Factory of client method for server-side SDKs (ISDK and IAsyncSDK)
|
|
5
5
|
*/
|
|
6
|
-
export declare function sdkClientMethodFactory(params:
|
|
6
|
+
export declare function sdkClientMethodFactory(params: ISdkFactoryContext): () => SplitIO.IClient | SplitIO.IAsyncClient;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ISdkClientFactoryParams } from './types';
|
|
2
1
|
import { SplitIO } from '../types';
|
|
2
|
+
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
3
3
|
/**
|
|
4
4
|
* Factory of client method for the client-side API variant where TT is ignored and thus
|
|
5
5
|
* clients don't have a binded TT for the track method.
|
|
6
6
|
*/
|
|
7
|
-
export declare function sdkClientMethodCSFactory(params:
|
|
7
|
+
export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitIO.SplitKey) => SplitIO.ICsClient;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ISdkClientFactoryParams } from './types';
|
|
2
1
|
import { SplitIO } from '../types';
|
|
2
|
+
import { ISdkFactoryContext } from '../sdkFactory/types';
|
|
3
3
|
/**
|
|
4
4
|
* Factory of client method for the client-side (browser) variant of the Isomorphic JS SDK,
|
|
5
5
|
* where clients can have a binded TT for the track method, which is provided via the settings
|
|
6
6
|
* (default client) or the client method (shared clients).
|
|
7
7
|
*/
|
|
8
|
-
export declare function sdkClientMethodCSFactory(params:
|
|
8
|
+
export declare function sdkClientMethodCSFactory(params: ISdkFactoryContext): (key?: SplitIO.SplitKey, trafficType?: string) => SplitIO.ICsClient;
|
|
@@ -2,12 +2,21 @@ import { IIntegrationManager, IIntegrationFactoryParams } from '../integrations/
|
|
|
2
2
|
import { ISignalListener } from '../listeners/types';
|
|
3
3
|
import { ILogger } from '../logger/types';
|
|
4
4
|
import { ISdkReadinessManager } from '../readiness/types';
|
|
5
|
-
import { ISdkClientFactoryParams } from '../sdkClient/types';
|
|
6
5
|
import { IFetch, ISplitApi, IEventSourceConstructor } from '../services/types';
|
|
7
6
|
import { IStorageAsync, IStorageSync, ISplitsCacheSync, ISplitsCacheAsync, IStorageFactoryParams } from '../storages/types';
|
|
8
7
|
import { ISyncManager, ISyncManagerFactoryParams } from '../sync/types';
|
|
9
8
|
import { IImpressionObserver } from '../trackers/impressionObserver/types';
|
|
9
|
+
import { IImpressionsTracker, IEventTracker } from '../trackers/types';
|
|
10
10
|
import { SplitIO, ISettings, IEventEmitter } from '../types';
|
|
11
|
+
export interface ISdkFactoryContext {
|
|
12
|
+
storage: IStorageSync | IStorageAsync;
|
|
13
|
+
sdkReadinessManager: ISdkReadinessManager;
|
|
14
|
+
settings: ISettings;
|
|
15
|
+
impressionsTracker: IImpressionsTracker;
|
|
16
|
+
eventTracker: IEventTracker;
|
|
17
|
+
signalListener?: ISignalListener;
|
|
18
|
+
syncManager?: ISyncManager;
|
|
19
|
+
}
|
|
11
20
|
/**
|
|
12
21
|
* Environment related dependencies.
|
|
13
22
|
* These getters are called a fixed number of times per factory instantiation.
|
|
@@ -28,7 +37,7 @@ export interface ISdkFactoryParams {
|
|
|
28
37
|
splitApiFactory?: (settings: ISettings, platform: IPlatform) => ISplitApi;
|
|
29
38
|
syncManagerFactory?: (params: ISyncManagerFactoryParams) => ISyncManager;
|
|
30
39
|
sdkManagerFactory: (log: ILogger, splits: ISplitsCacheSync | ISplitsCacheAsync, sdkReadinessManager: ISdkReadinessManager) => SplitIO.IManager | SplitIO.IAsyncManager;
|
|
31
|
-
sdkClientMethodFactory: (params:
|
|
40
|
+
sdkClientMethodFactory: (params: ISdkFactoryContext) => ({
|
|
32
41
|
(): SplitIO.ICsClient;
|
|
33
42
|
(key: SplitIO.SplitKey, trafficType?: string | undefined): SplitIO.ICsClient;
|
|
34
43
|
} | (() => SplitIO.IClient) | (() => SplitIO.IAsyncClient));
|
|
@@ -36,7 +45,7 @@ export interface ISdkFactoryParams {
|
|
|
36
45
|
settings: ISettings, // Used by BrowserSignalListener
|
|
37
46
|
storage: IStorageSync | IStorageAsync, // Used by BrowserSignalListener
|
|
38
47
|
serviceApi: ISplitApi | undefined) => ISignalListener;
|
|
39
|
-
impressionListener?: SplitIO.IImpressionListener;
|
|
40
48
|
integrationsManagerFactory?: (params: IIntegrationFactoryParams) => IIntegrationManager | undefined;
|
|
41
49
|
impressionsObserverFactory?: () => IImpressionObserver;
|
|
50
|
+
extraProps?: (params: ISdkFactoryContext) => object;
|
|
42
51
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ISyncManager } from '../sync/types';
|
|
2
|
+
import { ISettings } from '../types';
|
|
3
|
+
export declare function userConsentProps(settings: ISettings, syncManager?: ISyncManager): {
|
|
4
|
+
setUserConsent(consent: unknown): boolean;
|
|
5
|
+
getUserConsent(): import("../types").ConsentStatus | undefined;
|
|
6
|
+
};
|
|
@@ -8,6 +8,8 @@ export declare class KeyBuilderCS extends KeyBuilder {
|
|
|
8
8
|
*/
|
|
9
9
|
buildSegmentNameKey(segmentName: string): string;
|
|
10
10
|
extractSegmentName(builtSegmentKeyName: string): string | undefined;
|
|
11
|
+
buildOldSegmentNameKey(segmentName: string): string;
|
|
12
|
+
extractOldSegmentKey(builtSegmentKeyName: string): string | undefined;
|
|
11
13
|
buildLastUpdatedKey(): string;
|
|
12
14
|
isSplitsCacheKey(key: string): boolean;
|
|
13
15
|
buildSplitsFilterQueryKey(): string;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { IImpressionsCacheSync } from '../types';
|
|
2
2
|
import { ImpressionDTO } from '../../types';
|
|
3
3
|
export declare class ImpressionsCacheInMemory implements IImpressionsCacheSync {
|
|
4
|
+
private onFullQueue?;
|
|
5
|
+
private readonly maxQueue;
|
|
4
6
|
private queue;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param impressionsQueueSize number of queued impressions to call onFullQueueCb.
|
|
10
|
+
* Default value is 0, that means no maximum value, in case we want to avoid this being triggered.
|
|
11
|
+
*/
|
|
12
|
+
constructor(impressionsQueueSize?: number);
|
|
13
|
+
setOnFullQueueCb(cb: () => void): void;
|
|
5
14
|
/**
|
|
6
15
|
* Store impressions in sequential order
|
|
7
16
|
*/
|
|
@@ -20,5 +20,5 @@ export declare class RedisAdapter extends ioredis {
|
|
|
20
20
|
/**
|
|
21
21
|
* Parses the options into what we care about.
|
|
22
22
|
*/
|
|
23
|
-
static _defineOptions({ connectionTimeout, operationTimeout, url, host, port, db, pass }: Record<string, any>): object;
|
|
23
|
+
static _defineOptions({ connectionTimeout, operationTimeout, url, host, port, db, pass, tls }: Record<string, any>): object;
|
|
24
24
|
}
|
|
@@ -269,6 +269,7 @@ export interface IRecorderCacheProducerSync<T> {
|
|
|
269
269
|
}
|
|
270
270
|
export interface IImpressionsCacheSync extends IImpressionsCacheBase, IRecorderCacheProducerSync<ImpressionDTO[]> {
|
|
271
271
|
track(data: ImpressionDTO[]): void;
|
|
272
|
+
setOnFullQueueCb(cb: () => void): void;
|
|
272
273
|
}
|
|
273
274
|
export interface IEventsCacheSync extends IEventsCacheBase, IRecorderCacheProducerSync<SplitIO.EventData[]> {
|
|
274
275
|
track(data: SplitIO.EventData, size?: number): boolean;
|
|
@@ -335,6 +336,7 @@ export declare type IStorageAsync = IStorageBase<ISplitsCacheAsync, ISegmentsCac
|
|
|
335
336
|
export declare type DataLoader = (storage: IStorageSync, matchingKey: string) => void;
|
|
336
337
|
export interface IStorageFactoryParams {
|
|
337
338
|
log: ILogger;
|
|
339
|
+
impressionsQueueSize?: number;
|
|
338
340
|
eventsQueueSize?: number;
|
|
339
341
|
optimize?: boolean;
|
|
340
342
|
matchingKey?: string;
|
|
@@ -345,7 +347,7 @@ export interface IStorageFactoryParams {
|
|
|
345
347
|
}
|
|
346
348
|
export declare type StorageType = 'MEMORY' | 'LOCALSTORAGE' | 'REDIS' | 'PLUGGABLE';
|
|
347
349
|
export declare type IStorageSyncFactory = {
|
|
348
|
-
type: StorageType;
|
|
350
|
+
readonly type: StorageType;
|
|
349
351
|
(params: IStorageFactoryParams): IStorageSync;
|
|
350
352
|
};
|
|
351
353
|
export declare type IStorageAsyncFactory = {
|
package/types/sync/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { IPlatform } from '../sdkFactory/types';
|
|
|
3
3
|
import { ISplitApi } from '../services/types';
|
|
4
4
|
import { IStorageSync } from '../storages/types';
|
|
5
5
|
import { ISettings } from '../types';
|
|
6
|
+
import { IPollingManager } from './polling/types';
|
|
6
7
|
import { IPushManager } from './streaming/types';
|
|
7
8
|
export interface ITask<Input extends any[] = []> {
|
|
8
9
|
/**
|
|
@@ -39,6 +40,8 @@ export interface ITimeTracker {
|
|
|
39
40
|
export interface ISyncManager extends ITask {
|
|
40
41
|
flush(): Promise<any>;
|
|
41
42
|
pushManager?: IPushManager;
|
|
43
|
+
pollingManager?: IPollingManager;
|
|
44
|
+
submitter?: ISyncTask;
|
|
42
45
|
}
|
|
43
46
|
export interface ISyncManagerCS extends ISyncManager {
|
|
44
47
|
shared(matchingKey: string, readinessManager: IReadinessManager, storage: IStorageSync): ISyncManager | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IEventsCacheBase } from '../storages/types';
|
|
2
2
|
import { IEventsHandler, IEventTracker } from './types';
|
|
3
|
-
import {
|
|
3
|
+
import { ISettings } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Event tracker stores events in cache and pass them to the integrations manager if provided.
|
|
6
6
|
*
|
|
7
7
|
* @param eventsCache cache to save events
|
|
8
8
|
* @param integrationsManager optional event handler used for integrations
|
|
9
9
|
*/
|
|
10
|
-
export declare function eventTrackerFactory(
|
|
10
|
+
export declare function eventTrackerFactory(settings: ISettings, eventsCache: IEventsCacheBase, integrationsManager?: IEventsHandler): IEventTracker;
|
|
@@ -7,3 +7,7 @@ export declare function shouldAddPt(settings: ISettings): boolean;
|
|
|
7
7
|
* Checks if it should dedupe impressions or not.
|
|
8
8
|
*/
|
|
9
9
|
export declare function shouldBeOptimized(settings: ISettings): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Storage is async if mode is consumer or partial consumer
|
|
12
|
+
*/
|
|
13
|
+
export declare function isStorageSync(settings: ISettings): boolean;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { IImpressionCountsCacheSync, IImpressionsCacheBase } from '../storages/types';
|
|
2
2
|
import { IImpressionsHandler, IImpressionsTracker } from './types';
|
|
3
|
-
import {
|
|
3
|
+
import { ISettings } from '../types';
|
|
4
4
|
import { IImpressionObserver } from './impressionObserver/types';
|
|
5
|
-
import { ILogger } from '../logger/types';
|
|
6
5
|
/**
|
|
7
6
|
* Impressions tracker stores impressions in cache and pass them to the listener and integrations manager if provided.
|
|
8
7
|
*
|
|
@@ -13,4 +12,4 @@ import { ILogger } from '../logger/types';
|
|
|
13
12
|
* @param observer optional impression observer. If provided, previous time (pt property) is included in impression instances
|
|
14
13
|
* @param countsCache optional cache to save impressions count. If provided, impressions will be deduped (OPTIMIZED mode)
|
|
15
14
|
*/
|
|
16
|
-
export declare function impressionsTrackerFactory(
|
|
15
|
+
export declare function impressionsTrackerFactory(settings: ISettings, impressionsCache: IImpressionsCacheBase, integrationsManager?: IImpressionsHandler, observer?: IImpressionObserver, countsCache?: IImpressionCountsCacheSync): IImpressionsTracker;
|
package/types/types.d.ts
CHANGED
|
@@ -48,6 +48,11 @@ declare type EventConsts = {
|
|
|
48
48
|
* @typedef {string} SDKMode
|
|
49
49
|
*/
|
|
50
50
|
export declare type SDKMode = 'standalone' | 'consumer' | 'localhost' | 'consumer_partial';
|
|
51
|
+
/**
|
|
52
|
+
* User consent status.
|
|
53
|
+
* @typedef {string} ConsentStatus
|
|
54
|
+
*/
|
|
55
|
+
export declare type ConsentStatus = 'GRANTED' | 'DECLINED' | 'UNKNOWN';
|
|
51
56
|
/**
|
|
52
57
|
* Settings interface. This is a representation of the settings the SDK expose, that's why
|
|
53
58
|
* most of it's props are readonly. Only features should be rewritten when localhost mode is active.
|
|
@@ -67,6 +72,7 @@ export interface ISettings {
|
|
|
67
72
|
readonly scheduler: {
|
|
68
73
|
featuresRefreshRate: number;
|
|
69
74
|
impressionsRefreshRate: number;
|
|
75
|
+
impressionsQueueSize: number;
|
|
70
76
|
metricsRefreshRate: number;
|
|
71
77
|
segmentsRefreshRate: number;
|
|
72
78
|
offlineRefreshRate: number;
|
|
@@ -104,6 +110,7 @@ export interface ISettings {
|
|
|
104
110
|
};
|
|
105
111
|
readonly log: ILogger;
|
|
106
112
|
readonly impressionListener?: unknown;
|
|
113
|
+
readonly userConsent?: ConsentStatus;
|
|
107
114
|
}
|
|
108
115
|
/**
|
|
109
116
|
* Log levels.
|
|
@@ -249,6 +256,13 @@ interface INodeBasicSettings extends ISharedSettings {
|
|
|
249
256
|
* @default 300
|
|
250
257
|
*/
|
|
251
258
|
impressionsRefreshRate?: number;
|
|
259
|
+
/**
|
|
260
|
+
* The maximum number of impression items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
|
|
261
|
+
* If you use a 0 here, the queue will have no maximum size.
|
|
262
|
+
* @property {number} impressionsQueueSize
|
|
263
|
+
* @default 30000
|
|
264
|
+
*/
|
|
265
|
+
impressionsQueueSize?: number;
|
|
252
266
|
/**
|
|
253
267
|
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
254
268
|
* @property {number} metricsRefreshRate
|
|
@@ -375,7 +389,7 @@ interface IBasicClient extends IStatusInterface {
|
|
|
375
389
|
* @returns {Promise<void>}
|
|
376
390
|
*/
|
|
377
391
|
destroy(): Promise<void>;
|
|
378
|
-
|
|
392
|
+
isClientSide: boolean;
|
|
379
393
|
}
|
|
380
394
|
/**
|
|
381
395
|
* Common definitions between SDK instances for different environments interface.
|
|
@@ -766,6 +780,13 @@ export declare namespace SplitIO {
|
|
|
766
780
|
* @default 60
|
|
767
781
|
*/
|
|
768
782
|
impressionsRefreshRate?: number;
|
|
783
|
+
/**
|
|
784
|
+
* The maximum number of impression items we want to queue. If we queue more values, it will trigger a flush and reset the timer.
|
|
785
|
+
* If you use a 0 here, the queue will have no maximum size.
|
|
786
|
+
* @property {number} impressionsQueueSize
|
|
787
|
+
* @default 30000
|
|
788
|
+
*/
|
|
789
|
+
impressionsQueueSize?: number;
|
|
769
790
|
/**
|
|
770
791
|
* The SDK sends diagnostic metrics to Split servers. This parameters controls this metric flush period in seconds.
|
|
771
792
|
* @property {number} metricsRefreshRate
|
|
@@ -20,3 +20,6 @@ export declare const STORAGE_MEMORY: StorageType;
|
|
|
20
20
|
export declare const STORAGE_LOCALSTORAGE: StorageType;
|
|
21
21
|
export declare const STORAGE_REDIS: StorageType;
|
|
22
22
|
export declare const STORAGE_PLUGGABLE: StorageType;
|
|
23
|
+
export declare const CONSENT_GRANTED = "GRANTED";
|
|
24
|
+
export declare const CONSENT_DECLINED = "DECLINED";
|
|
25
|
+
export declare const CONSENT_UNKNOWN = "UNKNOWN";
|
|
@@ -55,13 +55,18 @@ export declare function isIntegerNumber(val: any): boolean;
|
|
|
55
55
|
*/
|
|
56
56
|
export declare function isNaNNumber(val: any): boolean;
|
|
57
57
|
/**
|
|
58
|
-
* Validates if a value is an object
|
|
58
|
+
* Validates if a value is an object created by the Object constructor (plain object).
|
|
59
|
+
* It checks `constructor.name` to avoid false negatives when validating values on a separate VM context, which has its own global built-ins.
|
|
59
60
|
*/
|
|
60
61
|
export declare function isObject(obj: any): boolean;
|
|
61
62
|
/**
|
|
62
63
|
* Checks if a given value is a string.
|
|
63
64
|
*/
|
|
64
65
|
export declare function isString(val: any): val is string;
|
|
66
|
+
/**
|
|
67
|
+
* String sanitizer. Returns the provided value converted to uppercase if it is a string.
|
|
68
|
+
*/
|
|
69
|
+
export declare function stringToUpperCase(val: any): any;
|
|
65
70
|
/**
|
|
66
71
|
* Deep copy version of Object.assign using recursion.
|
|
67
72
|
* There are some assumptions here. It's for internal use and we don't need verbose errors
|
|
@@ -44,5 +44,12 @@ interface IMapConstructor {
|
|
|
44
44
|
new <K, V>(entries?: readonly (readonly [K, V])[] | null): IMap<K, V>;
|
|
45
45
|
readonly prototype: IMap<any, any>;
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* return the Map constructor to use. If native Map is not available or it doesn't support the required features (e.g., IE11),
|
|
49
|
+
* a ponyfill with minimal features is returned instead.
|
|
50
|
+
*
|
|
51
|
+
* Exported for testing purposes only.
|
|
52
|
+
*/
|
|
53
|
+
export declare function __getMapConstructor(): IMapConstructor;
|
|
47
54
|
export declare const _Map: IMapConstructor;
|
|
48
55
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ILogger } from '../../logger/types';
|
|
2
2
|
import { SplitIO } from '../../types';
|
|
3
|
-
export declare function validImpressionsMode(log: ILogger, impressionsMode:
|
|
3
|
+
export declare function validImpressionsMode(log: ILogger, impressionsMode: any): SplitIO.ImpressionsMode;
|
|
@@ -5,22 +5,28 @@ import { ISettings } from '../../types';
|
|
|
5
5
|
*/
|
|
6
6
|
export interface ISettingsValidationParams {
|
|
7
7
|
/**
|
|
8
|
-
* Object of values to overwrite
|
|
9
|
-
* Version and startup properties are
|
|
8
|
+
* Object of values to overwrite base settings.
|
|
9
|
+
* Version and startup properties are required, because they are not defined in the base settings.
|
|
10
10
|
*/
|
|
11
11
|
defaults: Partial<ISettings> & {
|
|
12
12
|
version: string;
|
|
13
13
|
} & {
|
|
14
14
|
startup: ISettings['startup'];
|
|
15
15
|
};
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
/**
|
|
16
|
+
/** If true, validates core.key */
|
|
17
|
+
acceptKey?: boolean;
|
|
18
|
+
/** If true, validates core.trafficType */
|
|
19
|
+
acceptTT?: boolean;
|
|
20
|
+
/** Define runtime values (`settings.runtime`) */
|
|
21
|
+
runtime: (settings: ISettings) => ISettings['runtime'];
|
|
22
|
+
/** Storage validator (`settings.storage`) */
|
|
19
23
|
storage?: (settings: ISettings) => ISettings['storage'];
|
|
20
|
-
/** Integrations validator */
|
|
24
|
+
/** Integrations validator (`settings.integrations`) */
|
|
21
25
|
integrations?: (settings: ISettings) => ISettings['integrations'];
|
|
22
26
|
/** Logger validator (`settings.debug`) */
|
|
23
27
|
logger: (settings: ISettings) => ISettings['log'];
|
|
24
28
|
/** Localhost mode validator (`settings.sync.localhostMode`) */
|
|
25
29
|
localhost?: (settings: ISettings) => ISettings['sync']['localhostMode'];
|
|
30
|
+
/** User consent validator (`settings.userConsent`) */
|
|
31
|
+
consent: (settings: ISettings) => ISettings['userConsent'];
|
|
26
32
|
}
|
package/cjs/sdkClient/types.js
DELETED
package/esm/sdkClient/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/sdkClient/types.ts
DELETED
|
@@ -1,21 +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
|
-
|
|
8
|
-
export interface IClientFactoryParams {
|
|
9
|
-
storage: IStorageSync | IStorageAsync,
|
|
10
|
-
sdkReadinessManager: ISdkReadinessManager,
|
|
11
|
-
settings: ISettings
|
|
12
|
-
impressionsTracker: IImpressionsTracker,
|
|
13
|
-
eventTracker: IEventTracker,
|
|
14
|
-
// @TODO add time tracker and metricCollectors (a.k.a metricTracker)?
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface ISdkClientFactoryParams extends IClientFactoryParams {
|
|
18
|
-
signalListener?: ISignalListener
|
|
19
|
-
syncManager?: ISyncManager,
|
|
20
|
-
sharedClient?: boolean
|
|
21
|
-
}
|