@splitsoftware/splitio-commons 1.4.2-rc.0 → 1.4.2-rc.3
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 +4 -3
- package/cjs/integrations/ga/GaToSplit.js +11 -12
- package/cjs/sync/syncManagerOnline.js +34 -19
- package/cjs/sync/syncTask.js +15 -10
- package/cjs/utils/settingsValidation/index.js +6 -1
- package/esm/integrations/ga/GaToSplit.js +11 -12
- package/esm/sync/syncManagerOnline.js +34 -19
- package/esm/sync/syncTask.js +15 -10
- package/esm/utils/settingsValidation/index.js +6 -1
- package/package.json +1 -1
- package/src/integrations/ga/GaToSplit.ts +8 -14
- package/src/integrations/ga/types.ts +2 -13
- package/src/sdkClient/clientAttributesDecoration.ts +9 -9
- package/src/sync/syncManagerOnline.ts +29 -16
- package/src/sync/syncTask.ts +17 -11
- package/src/types.ts +7 -1
- package/src/utils/settingsValidation/index.ts +7 -1
- package/types/integrations/ga/types.d.ts +2 -13
- package/types/logger/browser/{debugLogger.d.ts → DebugLogger.d.ts} +0 -0
- package/types/logger/browser/{errorLogger.d.ts → ErrorLogger.d.ts} +0 -0
- package/types/logger/browser/{infoLogger.d.ts → InfoLogger.d.ts} +0 -0
- package/types/logger/browser/{warnLogger.d.ts → WarnLogger.d.ts} +0 -0
- package/types/sync/syncTask.d.ts +2 -2
- package/types/types.d.ts +6 -0
- package/types/utils/settingsValidation/index.d.ts +1 -0
- package/types/utils/timeTracker/index.d.ts +70 -1
- package/cjs/integrations/ga/autoRequire.js +0 -34
- package/esm/integrations/ga/autoRequire.js +0 -30
- package/src/integrations/ga/autoRequire.ts +0 -35
- package/src/logger/.DS_Store +0 -0
- package/types/integrations/ga/GaToSplitPlugin.d.ts +0 -3
- package/types/integrations/ga/SplitToGaPlugin.d.ts +0 -4
- package/types/integrations/ga/autoRequire.d.ts +0 -4
- package/types/logger/codes.d.ts +0 -2
- package/types/logger/codesConstants.d.ts +0 -117
- package/types/logger/codesConstantsBrowser.d.ts +0 -2
- package/types/logger/codesConstantsNode.d.ts +0 -14
- package/types/logger/codesDebug.d.ts +0 -1
- package/types/logger/codesDebugBrowser.d.ts +0 -1
- package/types/logger/codesDebugNode.d.ts +0 -1
- package/types/logger/codesError.d.ts +0 -1
- package/types/logger/codesErrorNode.d.ts +0 -1
- package/types/logger/codesInfo.d.ts +0 -1
- package/types/logger/codesWarn.d.ts +0 -1
- package/types/logger/codesWarnNode.d.ts +0 -1
- package/types/logger/debugLogger.d.ts +0 -2
- package/types/logger/errorLogger.d.ts +0 -2
- package/types/logger/infoLogger.d.ts +0 -2
- package/types/logger/messages/debugBrowser.d.ts +0 -1
- package/types/logger/messages/debugNode.d.ts +0 -1
- package/types/logger/messages/errorNode.d.ts +0 -1
- package/types/logger/messages/warnNode.d.ts +0 -1
- package/types/logger/noopLogger.d.ts +0 -2
- package/types/logger/warnLogger.d.ts +0 -2
- package/types/sdkFactory/userConsentProps.d.ts +0 -6
- package/types/sdkManager/sdkManagerMethod.d.ts +0 -6
- package/types/storages/getRegisteredSegments.d.ts +0 -10
- package/types/storages/inMemory/index.d.ts +0 -10
- package/types/storages/parseSegments.d.ts +0 -6
- package/types/sync/polling/syncTasks/splitsSyncTask.copy.d.ts +0 -35
- package/types/sync/polling/syncTasks/splitsSyncTask.morelikeoriginal.d.ts +0 -35
- package/types/sync/streaming/AuthClient/indexV1.d.ts +0 -12
- package/types/sync/streaming/AuthClient/indexV2.d.ts +0 -8
- package/types/sync/streaming/pushManagerCS.d.ts +0 -1
- package/types/sync/streaming/pushManagerNoUsers.d.ts +0 -13
- package/types/sync/streaming/pushManagerSS.d.ts +0 -1
- package/types/sync/submitters/telemetrySyncTask.d.ts +0 -0
- package/types/sync/syncManagerFromFile.d.ts +0 -2
- package/types/sync/syncManagerFromObject.d.ts +0 -2
- package/types/sync/syncManagerOffline.d.ts +0 -9
- package/types/trackers/telemetryRecorder.d.ts +0 -0
- package/types/utils/EventEmitter.d.ts +0 -4
- package/types/utils/consent.d.ts +0 -2
- package/types/utils/lang/errors.d.ts +0 -10
- package/types/utils/murmur3/commons.d.ts +0 -12
- package/types/utils/settingsValidation/buildMetadata.d.ts +0 -3
- package/types/utils/settingsValidation/localhost/index.d.ts +0 -9
- package/types/utils/settingsValidation/logger.d.ts +0 -11
- package/types/utils/settingsValidation/runtime/browser.d.ts +0 -2
- package/types/utils/settingsValidation/runtime/node.d.ts +0 -2
- package/types/utils/settingsValidation/userConsent.d.ts +0 -5
|
@@ -28,13 +28,13 @@ export function syncManagerOnlineFactory(
|
|
|
28
28
|
*/
|
|
29
29
|
return function (params: ISdkFactoryContextSync): ISyncManagerCS {
|
|
30
30
|
|
|
31
|
-
const { settings, settings: { log, streamingEnabled },
|
|
31
|
+
const { settings, settings: { log, streamingEnabled, sync: { enabled: syncEnabled } }, telemetryTracker } = params;
|
|
32
32
|
|
|
33
33
|
/** Polling Manager */
|
|
34
34
|
const pollingManager = pollingManagerFactory && pollingManagerFactory(params);
|
|
35
35
|
|
|
36
36
|
/** Push Manager */
|
|
37
|
-
const pushManager = streamingEnabled && pollingManager && pushManagerFactory ?
|
|
37
|
+
const pushManager = syncEnabled && streamingEnabled && pollingManager && pushManagerFactory ?
|
|
38
38
|
pushManagerFactory(params, pollingManager) :
|
|
39
39
|
undefined;
|
|
40
40
|
|
|
@@ -89,15 +89,24 @@ export function syncManagerOnlineFactory(
|
|
|
89
89
|
|
|
90
90
|
// start syncing splits and segments
|
|
91
91
|
if (pollingManager) {
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
|
|
93
|
+
// If synchronization is disabled pushManager and pollingManager should not start
|
|
94
|
+
if (syncEnabled) {
|
|
95
|
+
if (pushManager) {
|
|
96
|
+
// Doesn't call `syncAll` when the syncManager is resuming
|
|
97
|
+
if (startFirstTime) {
|
|
98
|
+
pollingManager.syncAll();
|
|
99
|
+
startFirstTime = false;
|
|
100
|
+
}
|
|
101
|
+
pushManager.start();
|
|
102
|
+
} else {
|
|
103
|
+
pollingManager.start();
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
94
106
|
if (startFirstTime) {
|
|
95
107
|
pollingManager.syncAll();
|
|
96
108
|
startFirstTime = false;
|
|
97
109
|
}
|
|
98
|
-
pushManager.start();
|
|
99
|
-
} else {
|
|
100
|
-
pollingManager.start();
|
|
101
110
|
}
|
|
102
111
|
}
|
|
103
112
|
|
|
@@ -137,18 +146,22 @@ export function syncManagerOnlineFactory(
|
|
|
137
146
|
return {
|
|
138
147
|
isRunning: mySegmentsSyncTask.isRunning,
|
|
139
148
|
start() {
|
|
140
|
-
if (
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
|
|
149
|
+
if (syncEnabled) {
|
|
150
|
+
if (pushManager) {
|
|
151
|
+
if (pollingManager!.isRunning()) {
|
|
152
|
+
// if doing polling, we must start the periodic fetch of data
|
|
153
|
+
if (storage.splits.usesSegments()) mySegmentsSyncTask.start();
|
|
154
|
+
} else {
|
|
155
|
+
// if not polling, we must execute the sync task for the initial fetch
|
|
156
|
+
// of segments since `syncAll` was already executed when starting the main client
|
|
157
|
+
mySegmentsSyncTask.execute();
|
|
158
|
+
}
|
|
159
|
+
pushManager.add(matchingKey, mySegmentsSyncTask);
|
|
144
160
|
} else {
|
|
145
|
-
|
|
146
|
-
// of segments since `syncAll` was already executed when starting the main client
|
|
147
|
-
mySegmentsSyncTask.execute();
|
|
161
|
+
if (storage.splits.usesSegments()) mySegmentsSyncTask.start();
|
|
148
162
|
}
|
|
149
|
-
pushManager.add(matchingKey, mySegmentsSyncTask);
|
|
150
163
|
} else {
|
|
151
|
-
if (
|
|
164
|
+
if (!readinessManager.isReady()) mySegmentsSyncTask.execute();
|
|
152
165
|
}
|
|
153
166
|
},
|
|
154
167
|
stop() {
|
package/src/sync/syncTask.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { ISyncTask } from './types';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Creates a syncTask that handles the periodic execution of a given task ("start" and "stop" methods).
|
|
7
|
-
* The task can be executed
|
|
8
|
-
*
|
|
7
|
+
* The task can be also executed by calling the "execute" method. Multiple execute calls are chained to run secuentially and avoid race conditions.
|
|
8
|
+
* For example, submitters executed on SDK destroy or full queue, while periodic execution is pending.
|
|
9
9
|
*
|
|
10
10
|
* @param log Logger instance.
|
|
11
11
|
* @param task Task to execute that returns a promise that NEVER REJECTS. Otherwise, periodic execution can result in Unhandled Promise Rejections.
|
|
@@ -15,8 +15,8 @@ import { ISyncTask } from './types';
|
|
|
15
15
|
*/
|
|
16
16
|
export function syncTaskFactory<Input extends any[], Output = any>(log: ILogger, task: (...args: Input) => Promise<Output>, period: number, taskName = 'task'): ISyncTask<Input, Output> {
|
|
17
17
|
|
|
18
|
-
//
|
|
19
|
-
let
|
|
18
|
+
// Task promise while it is pending. Undefined once the promise is resolved
|
|
19
|
+
let pendingTask: Promise<Output> | undefined;
|
|
20
20
|
// flag that indicates if the task periodic execution has been started/stopped.
|
|
21
21
|
let running = false;
|
|
22
22
|
// Auxiliar counter used to avoid race condition when calling `start` & `stop` intermittently
|
|
@@ -26,14 +26,21 @@ export function syncTaskFactory<Input extends any[], Output = any>(log: ILogger,
|
|
|
26
26
|
// Id of the periodic call timeout
|
|
27
27
|
let timeoutID: any;
|
|
28
28
|
|
|
29
|
-
function execute(...args: Input) {
|
|
30
|
-
executing
|
|
29
|
+
function execute(...args: Input): Promise<Output> {
|
|
30
|
+
// If task is executing, chain the new execution
|
|
31
|
+
if (pendingTask) {
|
|
32
|
+
return pendingTask.then(() => {
|
|
33
|
+
return execute(...args);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Execute task
|
|
31
38
|
log.debug(SYNC_TASK_EXECUTE, [taskName]);
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
pendingTask = task(...args).then(result => {
|
|
40
|
+
pendingTask = undefined;
|
|
34
41
|
return result;
|
|
35
42
|
});
|
|
36
|
-
|
|
43
|
+
return pendingTask;
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
function periodicExecute(currentRunningId: number) {
|
|
@@ -46,11 +53,10 @@ export function syncTaskFactory<Input extends any[], Output = any>(log: ILogger,
|
|
|
46
53
|
}
|
|
47
54
|
|
|
48
55
|
return {
|
|
49
|
-
// @TODO check if we need to queued `execute` calls, to avoid possible race conditions on submitters and updaters with streaming.
|
|
50
56
|
execute,
|
|
51
57
|
|
|
52
58
|
isExecuting() {
|
|
53
|
-
return
|
|
59
|
+
return pendingTask !== undefined;
|
|
54
60
|
},
|
|
55
61
|
|
|
56
62
|
start(...args: Input) {
|
package/src/types.ts
CHANGED
|
@@ -117,7 +117,8 @@ export interface ISettings {
|
|
|
117
117
|
splitFilters: SplitIO.SplitFilter[],
|
|
118
118
|
impressionsMode: SplitIO.ImpressionsMode,
|
|
119
119
|
__splitFiltersValidation: ISplitFiltersValidation,
|
|
120
|
-
localhostMode?: SplitIO.LocalhostFactory
|
|
120
|
+
localhostMode?: SplitIO.LocalhostFactory,
|
|
121
|
+
enabled: boolean
|
|
121
122
|
},
|
|
122
123
|
readonly runtime: {
|
|
123
124
|
ip: string | false
|
|
@@ -214,6 +215,11 @@ interface ISharedSettings {
|
|
|
214
215
|
* @default 'OPTIMIZED'
|
|
215
216
|
*/
|
|
216
217
|
impressionsMode?: SplitIO.ImpressionsMode,
|
|
218
|
+
/**
|
|
219
|
+
* Enables synchronization.
|
|
220
|
+
* @property {boolean} enabled
|
|
221
|
+
*/
|
|
222
|
+
enabled: boolean
|
|
217
223
|
}
|
|
218
224
|
}
|
|
219
225
|
/**
|
|
@@ -83,7 +83,8 @@ export const base = {
|
|
|
83
83
|
splitFilters: undefined,
|
|
84
84
|
// impressions collection mode
|
|
85
85
|
impressionsMode: OPTIMIZED,
|
|
86
|
-
localhostMode: undefined
|
|
86
|
+
localhostMode: undefined,
|
|
87
|
+
enabled: true
|
|
87
88
|
},
|
|
88
89
|
|
|
89
90
|
// Logger
|
|
@@ -191,6 +192,11 @@ export function settingsValidation(config: unknown, validationParams: ISettingsV
|
|
|
191
192
|
scheduler.pushRetryBackoffBase = fromSecondsToMillis(scheduler.pushRetryBackoffBase);
|
|
192
193
|
}
|
|
193
194
|
|
|
195
|
+
// validate sync enabled
|
|
196
|
+
if (withDefaults.sync.enabled !== false) { // @ts-ignore, modify readonly prop
|
|
197
|
+
withDefaults.sync.enabled = true;
|
|
198
|
+
}
|
|
199
|
+
|
|
194
200
|
// validate the `splitFilters` settings and parse splits query
|
|
195
201
|
const splitFiltersValidation = validateSplitFilters(log, withDefaults.sync.splitFilters, withDefaults.mode);
|
|
196
202
|
withDefaults.sync.splitFilters = splitFiltersValidation.validFilters;
|
|
@@ -52,23 +52,12 @@ export interface GoogleAnalyticsToSplitOptions {
|
|
|
52
52
|
* If not provided, events are sent using the key and traffic type provided at SDK config
|
|
53
53
|
*/
|
|
54
54
|
identities?: Identity[];
|
|
55
|
-
/**
|
|
56
|
-
* Optional flag to log an error if the `auto-require` script is not detected.
|
|
57
|
-
* The auto-require script automatically requires the `splitTracker` plugin for created trackers,
|
|
58
|
-
* and should be placed right after your Google Analytics, GTM or gtag.js script tag.
|
|
59
|
-
*
|
|
60
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-tag-manager}
|
|
61
|
-
*
|
|
62
|
-
* @property {boolean} autoRequire
|
|
63
|
-
* @default false
|
|
64
|
-
*/
|
|
65
|
-
autoRequire?: boolean;
|
|
66
55
|
}
|
|
67
56
|
/**
|
|
68
57
|
* Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
|
|
69
58
|
* Used by the browser variant of the isomorphic JS SDK.
|
|
70
59
|
*
|
|
71
|
-
* @see {@link https://help.split.io/hc/en-us/articles/
|
|
60
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#google-analytics-to-split}
|
|
72
61
|
*/
|
|
73
62
|
export interface IGoogleAnalyticsToSplitConfig extends GoogleAnalyticsToSplitOptions {
|
|
74
63
|
type: 'GOOGLE_ANALYTICS_TO_SPLIT';
|
|
@@ -136,7 +125,7 @@ export interface SplitToGoogleAnalyticsOptions {
|
|
|
136
125
|
* Enable 'Split to Google Analytics' integration, to track Split impressions and events as Google Analytics hits.
|
|
137
126
|
* Used by the browser variant of the isomorphic JS SDK.
|
|
138
127
|
*
|
|
139
|
-
* @see {@link https://help.split.io/hc/en-us/articles/
|
|
128
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#split-to-google-analytics}
|
|
140
129
|
*/
|
|
141
130
|
export interface ISplitToGoogleAnalyticsConfig extends SplitToGoogleAnalyticsOptions {
|
|
142
131
|
type: 'SPLIT_TO_GOOGLE_ANALYTICS';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/types/sync/syncTask.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { ILogger } from '../logger/types';
|
|
|
2
2
|
import { ISyncTask } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a syncTask that handles the periodic execution of a given task ("start" and "stop" methods).
|
|
5
|
-
* The task can be executed
|
|
6
|
-
*
|
|
5
|
+
* The task can be also executed by calling the "execute" method. Multiple execute calls are chained to run secuentially and avoid race conditions.
|
|
6
|
+
* For example, submitters executed on SDK destroy or full queue, while periodic execution is pending.
|
|
7
7
|
*
|
|
8
8
|
* @param log Logger instance.
|
|
9
9
|
* @param task Task to execute that returns a promise that NEVER REJECTS. Otherwise, periodic execution can result in Unhandled Promise Rejections.
|
package/types/types.d.ts
CHANGED
|
@@ -112,6 +112,7 @@ export interface ISettings {
|
|
|
112
112
|
impressionsMode: SplitIO.ImpressionsMode;
|
|
113
113
|
__splitFiltersValidation: ISplitFiltersValidation;
|
|
114
114
|
localhostMode?: SplitIO.LocalhostFactory;
|
|
115
|
+
enabled: boolean;
|
|
115
116
|
};
|
|
116
117
|
readonly runtime: {
|
|
117
118
|
ip: string | false;
|
|
@@ -208,6 +209,11 @@ interface ISharedSettings {
|
|
|
208
209
|
* @default 'OPTIMIZED'
|
|
209
210
|
*/
|
|
210
211
|
impressionsMode?: SplitIO.ImpressionsMode;
|
|
212
|
+
/**
|
|
213
|
+
* Enables synchronization.
|
|
214
|
+
* @property {boolean} enabled
|
|
215
|
+
*/
|
|
216
|
+
enabled: boolean;
|
|
211
217
|
};
|
|
212
218
|
}
|
|
213
219
|
/**
|
|
@@ -1 +1,70 @@
|
|
|
1
|
-
|
|
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 {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.autoRequire = void 0;
|
|
4
|
-
/* eslint-disable no-undef */
|
|
5
|
-
/**
|
|
6
|
-
* Auto-require script to use with GaToSplit integration
|
|
7
|
-
*/
|
|
8
|
-
function autoRequire() {
|
|
9
|
-
(function (i, r, s) {
|
|
10
|
-
i[s] = i[s] || r;
|
|
11
|
-
i[r] = i[r] || function () { i[r].q.push(arguments); };
|
|
12
|
-
i[r].q = i[r].q || [];
|
|
13
|
-
var ts = {}; // Tracker names
|
|
14
|
-
var o = i[r].q.push;
|
|
15
|
-
i[r].q.push = function (v) {
|
|
16
|
-
var result = o.apply(this, arguments);
|
|
17
|
-
if (v && v[0] === 'create') {
|
|
18
|
-
var t = typeof v[2] === 'object' && typeof v[2].name === 'string' ?
|
|
19
|
-
v[2].name : // `ga('create', 'UA-ID', { name: 'trackerName', ... })`
|
|
20
|
-
typeof v[3] === 'object' && typeof v[3].name === 'string' ?
|
|
21
|
-
v[3].name : // `ga('create', 'UA-ID', 'auto', { name: 'trackerName', ... })`
|
|
22
|
-
typeof v[3] === 'string' ?
|
|
23
|
-
v[3] : // `ga('create', 'UA-ID', 'auto', 'trackerName')`
|
|
24
|
-
undefined; // No name tracker, e.g.: `ga('create', 'UA-ID', 'auto')`
|
|
25
|
-
if (!ts[t]) {
|
|
26
|
-
ts[t] = true;
|
|
27
|
-
i[r](t ? t + '.require' : 'require', 'splitTracker'); // Auto-require
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
})(window, 'ga', 'GoogleAnalyticsObject');
|
|
33
|
-
}
|
|
34
|
-
exports.autoRequire = autoRequire;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
/**
|
|
3
|
-
* Auto-require script to use with GaToSplit integration
|
|
4
|
-
*/
|
|
5
|
-
export function autoRequire() {
|
|
6
|
-
(function (i, r, s) {
|
|
7
|
-
i[s] = i[s] || r;
|
|
8
|
-
i[r] = i[r] || function () { i[r].q.push(arguments); };
|
|
9
|
-
i[r].q = i[r].q || [];
|
|
10
|
-
var ts = {}; // Tracker names
|
|
11
|
-
var o = i[r].q.push;
|
|
12
|
-
i[r].q.push = function (v) {
|
|
13
|
-
var result = o.apply(this, arguments);
|
|
14
|
-
if (v && v[0] === 'create') {
|
|
15
|
-
var t = typeof v[2] === 'object' && typeof v[2].name === 'string' ?
|
|
16
|
-
v[2].name : // `ga('create', 'UA-ID', { name: 'trackerName', ... })`
|
|
17
|
-
typeof v[3] === 'object' && typeof v[3].name === 'string' ?
|
|
18
|
-
v[3].name : // `ga('create', 'UA-ID', 'auto', { name: 'trackerName', ... })`
|
|
19
|
-
typeof v[3] === 'string' ?
|
|
20
|
-
v[3] : // `ga('create', 'UA-ID', 'auto', 'trackerName')`
|
|
21
|
-
undefined; // No name tracker, e.g.: `ga('create', 'UA-ID', 'auto')`
|
|
22
|
-
if (!ts[t]) {
|
|
23
|
-
ts[t] = true;
|
|
24
|
-
i[r](t ? t + '.require' : 'require', 'splitTracker'); // Auto-require
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
})(window, 'ga', 'GoogleAnalyticsObject');
|
|
30
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
/**
|
|
3
|
-
* Auto-require script to use with GaToSplit integration
|
|
4
|
-
*/
|
|
5
|
-
export function autoRequire() {
|
|
6
|
-
(function (i: any, r: string, s: string) {
|
|
7
|
-
i[s] = i[s] || r;
|
|
8
|
-
i[r] = i[r] || function () { i[r].q.push(arguments); };
|
|
9
|
-
i[r].q = i[r].q || [];
|
|
10
|
-
|
|
11
|
-
var ts: any = {}; // Tracker names
|
|
12
|
-
var o = i[r].q.push;
|
|
13
|
-
i[r].q.push = function (v: any) {
|
|
14
|
-
var result = o.apply(this, arguments);
|
|
15
|
-
|
|
16
|
-
if (v && v[0] === 'create') {
|
|
17
|
-
var t = typeof v[2] === 'object' && typeof v[2].name === 'string' ?
|
|
18
|
-
v[2].name : // `ga('create', 'UA-ID', { name: 'trackerName', ... })`
|
|
19
|
-
typeof v[3] === 'object' && typeof v[3].name === 'string' ?
|
|
20
|
-
v[3].name : // `ga('create', 'UA-ID', 'auto', { name: 'trackerName', ... })`
|
|
21
|
-
typeof v[3] === 'string' ?
|
|
22
|
-
v[3] : // `ga('create', 'UA-ID', 'auto', 'trackerName')`
|
|
23
|
-
undefined; // No name tracker, e.g.: `ga('create', 'UA-ID', 'auto')`
|
|
24
|
-
|
|
25
|
-
if (!ts[t]) {
|
|
26
|
-
ts[t] = true;
|
|
27
|
-
i[r](t ? t + '.require' : 'require', 'splitTracker'); // Auto-require
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return result;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
})(window, 'ga', 'GoogleAnalyticsObject');
|
|
35
|
-
}
|
package/src/logger/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IIntegrationFactoryParams } from '../types';
|
|
2
|
-
import SplitToGa from './SplitToGa';
|
|
3
|
-
import { SplitToGoogleAnalyticsOptions } from './types';
|
|
4
|
-
export declare function SplitToGoogleAnalytics(options?: SplitToGoogleAnalyticsOptions): (params: IIntegrationFactoryParams) => SplitToGa;
|
package/types/logger/codes.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
export declare const DEBUG_0 = 0;
|
|
2
|
-
export declare const DEBUG_1 = 1;
|
|
3
|
-
export declare const DEBUG_2 = 2;
|
|
4
|
-
export declare const DEBUG_3 = 3;
|
|
5
|
-
export declare const DEBUG_4 = 4;
|
|
6
|
-
export declare const DEBUG_5 = 5;
|
|
7
|
-
export declare const DEBUG_6 = 6;
|
|
8
|
-
export declare const DEBUG_7 = 7;
|
|
9
|
-
export declare const DEBUG_8 = 8;
|
|
10
|
-
export declare const DEBUG_9 = 9;
|
|
11
|
-
export declare const DEBUG_10 = 10;
|
|
12
|
-
export declare const DEBUG_11 = 11;
|
|
13
|
-
export declare const DEBUG_12 = 12;
|
|
14
|
-
export declare const DEBUG_13 = 13;
|
|
15
|
-
export declare const DEBUG_14 = 14;
|
|
16
|
-
export declare const DEBUG_15 = 15;
|
|
17
|
-
export declare const DEBUG_16 = 16;
|
|
18
|
-
export declare const DEBUG_17 = 17;
|
|
19
|
-
export declare const DEBUG_18 = 18;
|
|
20
|
-
export declare const DEBUG_19 = 19;
|
|
21
|
-
export declare const DEBUG_20 = 20;
|
|
22
|
-
export declare const DEBUG_21 = 21;
|
|
23
|
-
export declare const DEBUG_22 = 22;
|
|
24
|
-
export declare const DEBUG_23 = 23;
|
|
25
|
-
export declare const DEBUG_24 = 24;
|
|
26
|
-
export declare const DEBUG_25 = 25;
|
|
27
|
-
export declare const DEBUG_31 = 31;
|
|
28
|
-
export declare const DEBUG_32 = 32;
|
|
29
|
-
export declare const DEBUG_33 = 33;
|
|
30
|
-
export declare const DEBUG_36 = 36;
|
|
31
|
-
export declare const DEBUG_42 = 42;
|
|
32
|
-
export declare const DEBUG_43 = 43;
|
|
33
|
-
export declare const DEBUG_44 = 44;
|
|
34
|
-
export declare const DEBUG_45 = 45;
|
|
35
|
-
export declare const DEBUG_46 = 46;
|
|
36
|
-
export declare const DEBUG_47 = 47;
|
|
37
|
-
export declare const DEBUG_48 = 48;
|
|
38
|
-
export declare const DEBUG_49 = 49;
|
|
39
|
-
export declare const DEBUG_50 = 50;
|
|
40
|
-
export declare const DEBUG_51 = 51;
|
|
41
|
-
export declare const INFO_0 = 100;
|
|
42
|
-
export declare const INFO_1 = 101;
|
|
43
|
-
export declare const INFO_2 = 102;
|
|
44
|
-
export declare const INFO_3 = 103;
|
|
45
|
-
export declare const INFO_4 = 104;
|
|
46
|
-
export declare const INFO_5 = 105;
|
|
47
|
-
export declare const INFO_6 = 106;
|
|
48
|
-
export declare const INFO_7 = 107;
|
|
49
|
-
export declare const INFO_8 = 108;
|
|
50
|
-
export declare const INFO_9 = 109;
|
|
51
|
-
export declare const INFO_10 = 110;
|
|
52
|
-
export declare const INFO_11 = 111;
|
|
53
|
-
export declare const INFO_12 = 112;
|
|
54
|
-
export declare const INFO_13 = 113;
|
|
55
|
-
export declare const INFO_14 = 114;
|
|
56
|
-
export declare const INFO_15 = 115;
|
|
57
|
-
export declare const INFO_16 = 116;
|
|
58
|
-
export declare const INFO_17 = 117;
|
|
59
|
-
export declare const INFO_18 = 118;
|
|
60
|
-
export declare const INFO_19 = 119;
|
|
61
|
-
export declare const INFO_20 = 120;
|
|
62
|
-
export declare const INFO_21 = 121;
|
|
63
|
-
export declare const WARN_0 = 200;
|
|
64
|
-
export declare const WARN_1 = 201;
|
|
65
|
-
export declare const WARN_2 = 202;
|
|
66
|
-
export declare const WARN_4 = 204;
|
|
67
|
-
export declare const WARN_5 = 205;
|
|
68
|
-
export declare const WARN_6 = 206;
|
|
69
|
-
export declare const WARN_7 = 207;
|
|
70
|
-
export declare const WARN_8 = 208;
|
|
71
|
-
export declare const WARN_9 = 209;
|
|
72
|
-
export declare const WARN_10 = 210;
|
|
73
|
-
export declare const WARN_11 = 211;
|
|
74
|
-
export declare const WARN_12 = 212;
|
|
75
|
-
export declare const WARN_13 = 213;
|
|
76
|
-
export declare const WARN_14 = 214;
|
|
77
|
-
export declare const WARN_15 = 215;
|
|
78
|
-
export declare const WARN_17 = 217;
|
|
79
|
-
export declare const WARN_18 = 218;
|
|
80
|
-
export declare const WARN_19 = 219;
|
|
81
|
-
export declare const WARN_20 = 220;
|
|
82
|
-
export declare const WARN_21 = 221;
|
|
83
|
-
export declare const WARN_22 = 222;
|
|
84
|
-
export declare const WARN_23 = 223;
|
|
85
|
-
export declare const WARN_24 = 224;
|
|
86
|
-
export declare const WARN_25 = 225;
|
|
87
|
-
export declare const ERROR_0 = 300;
|
|
88
|
-
export declare const ERROR_2 = 302;
|
|
89
|
-
export declare const ERROR_3 = 303;
|
|
90
|
-
export declare const ERROR_4 = 304;
|
|
91
|
-
export declare const ERROR_5 = 305;
|
|
92
|
-
export declare const ERROR_7 = 307;
|
|
93
|
-
export declare const ERROR_9 = 309;
|
|
94
|
-
export declare const ERROR_10 = 310;
|
|
95
|
-
export declare const ERROR_11 = 311;
|
|
96
|
-
export declare const ERROR_12 = 312;
|
|
97
|
-
export declare const ERROR_13 = 313;
|
|
98
|
-
export declare const ERROR_14 = 314;
|
|
99
|
-
export declare const ERROR_15 = 315;
|
|
100
|
-
export declare const ERROR_16 = 316;
|
|
101
|
-
export declare const ERROR_17 = 317;
|
|
102
|
-
export declare const ERROR_18 = 318;
|
|
103
|
-
export declare const ERROR_19 = 319;
|
|
104
|
-
export declare const ERROR_20 = 320;
|
|
105
|
-
export declare const ERROR_21 = 321;
|
|
106
|
-
export declare const ERROR_22 = 322;
|
|
107
|
-
export declare const ERROR_23 = 323;
|
|
108
|
-
export declare const ERROR_24 = 324;
|
|
109
|
-
export declare const ERROR_25 = 325;
|
|
110
|
-
export declare const ERROR_26 = 326;
|
|
111
|
-
export declare const ERROR_32 = 332;
|
|
112
|
-
export declare const ERROR_33 = 333;
|
|
113
|
-
export declare const ERROR_34 = 334;
|
|
114
|
-
export declare const ERROR_35 = 335;
|
|
115
|
-
export declare const ERROR_36 = 336;
|
|
116
|
-
export declare const ERROR_37 = 337;
|
|
117
|
-
export declare const ERROR_38 = 338;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const DEBUG_28 = 28;
|
|
2
|
-
export declare const DEBUG_29 = 29;
|
|
3
|
-
export declare const DEBUG_30 = 30;
|
|
4
|
-
export declare const ERROR_1 = 301;
|
|
5
|
-
export declare const DEBUG_39 = 39;
|
|
6
|
-
export declare const DEBUG_40 = 40;
|
|
7
|
-
export declare const DEBUG_41 = 41;
|
|
8
|
-
export declare const ERROR_8 = 308;
|
|
9
|
-
export declare const DEBUG_34 = 34;
|
|
10
|
-
export declare const DEBUG_35 = 35;
|
|
11
|
-
export declare const ERROR_6 = 306;
|
|
12
|
-
export declare const WARN_3 = 203;
|
|
13
|
-
export declare const DEBUG_37 = 37;
|
|
14
|
-
export declare const DEBUG_38 = 38;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebug: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugBrowser: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesError: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesErrorNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesInfo: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesWarn: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesWarnNode: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugBrowser: [number, string][];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const codesDebugNode: [number, string][];
|