@tracelog/lib 0.0.1
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/LICENSE +21 -0
- package/README.md +217 -0
- package/dist/browser/tracelog.js +4040 -0
- package/dist/browser/web-vitals-CCnqwnC8.mjs +198 -0
- package/dist/cjs/api.d.ts +46 -0
- package/dist/cjs/api.js +224 -0
- package/dist/cjs/app.constants.d.ts +1 -0
- package/dist/cjs/app.constants.js +5 -0
- package/dist/cjs/app.d.ts +59 -0
- package/dist/cjs/app.js +272 -0
- package/dist/cjs/app.types.d.ts +6 -0
- package/dist/cjs/app.types.js +22 -0
- package/dist/cjs/constants/api.constants.d.ts +4 -0
- package/dist/cjs/constants/api.constants.js +18 -0
- package/dist/cjs/constants/browser.constants.d.ts +3 -0
- package/dist/cjs/constants/browser.constants.js +41 -0
- package/dist/cjs/constants/index.d.ts +8 -0
- package/dist/cjs/constants/index.js +24 -0
- package/dist/cjs/constants/initialization.constants.d.ts +40 -0
- package/dist/cjs/constants/initialization.constants.js +48 -0
- package/dist/cjs/constants/limits.constants.d.ts +25 -0
- package/dist/cjs/constants/limits.constants.js +40 -0
- package/dist/cjs/constants/security.constants.d.ts +1 -0
- package/dist/cjs/constants/security.constants.js +12 -0
- package/dist/cjs/constants/storage.constants.d.ts +9 -0
- package/dist/cjs/constants/storage.constants.js +22 -0
- package/dist/cjs/constants/timing.constants.d.ts +22 -0
- package/dist/cjs/constants/timing.constants.js +34 -0
- package/dist/cjs/constants/validation.constants.d.ts +13 -0
- package/dist/cjs/constants/validation.constants.js +31 -0
- package/dist/cjs/handlers/click.handler.d.ts +17 -0
- package/dist/cjs/handlers/click.handler.js +199 -0
- package/dist/cjs/handlers/error.handler.d.ts +15 -0
- package/dist/cjs/handlers/error.handler.js +97 -0
- package/dist/cjs/handlers/network.handler.d.ts +16 -0
- package/dist/cjs/handlers/network.handler.js +136 -0
- package/dist/cjs/handlers/page-view.handler.d.ts +15 -0
- package/dist/cjs/handlers/page-view.handler.js +83 -0
- package/dist/cjs/handlers/performance.handler.d.ts +19 -0
- package/dist/cjs/handlers/performance.handler.js +255 -0
- package/dist/cjs/handlers/scroll.handler.d.ts +16 -0
- package/dist/cjs/handlers/scroll.handler.js +138 -0
- package/dist/cjs/handlers/session.handler.d.ts +29 -0
- package/dist/cjs/handlers/session.handler.js +357 -0
- package/dist/cjs/integrations/google-analytics.integration.d.ts +18 -0
- package/dist/cjs/integrations/google-analytics.integration.js +159 -0
- package/dist/cjs/listeners/activity-listener-manager.d.ts +8 -0
- package/dist/cjs/listeners/activity-listener-manager.js +32 -0
- package/dist/cjs/listeners/index.d.ts +6 -0
- package/dist/cjs/listeners/index.js +14 -0
- package/dist/cjs/listeners/input-listener-managers.d.ts +15 -0
- package/dist/cjs/listeners/input-listener-managers.js +58 -0
- package/dist/cjs/listeners/listeners.types.d.ts +4 -0
- package/dist/cjs/listeners/listeners.types.js +2 -0
- package/dist/cjs/listeners/touch-listener-manager.d.ts +10 -0
- package/dist/cjs/listeners/touch-listener-manager.js +56 -0
- package/dist/cjs/listeners/unload-listener-manager.d.ts +8 -0
- package/dist/cjs/listeners/unload-listener-manager.js +30 -0
- package/dist/cjs/listeners/visibility-listener-manager.d.ts +12 -0
- package/dist/cjs/listeners/visibility-listener-manager.js +83 -0
- package/dist/cjs/managers/api.manager.d.ts +3 -0
- package/dist/cjs/managers/api.manager.js +14 -0
- package/dist/cjs/managers/config.manager.d.ts +7 -0
- package/dist/cjs/managers/config.manager.js +94 -0
- package/dist/cjs/managers/cross-tab-session.manager.d.ts +170 -0
- package/dist/cjs/managers/cross-tab-session.manager.js +730 -0
- package/dist/cjs/managers/event.manager.d.ts +61 -0
- package/dist/cjs/managers/event.manager.js +508 -0
- package/dist/cjs/managers/sampling.manager.d.ts +8 -0
- package/dist/cjs/managers/sampling.manager.js +53 -0
- package/dist/cjs/managers/sender.manager.d.ts +46 -0
- package/dist/cjs/managers/sender.manager.js +304 -0
- package/dist/cjs/managers/session-recovery.manager.d.ts +65 -0
- package/dist/cjs/managers/session-recovery.manager.js +237 -0
- package/dist/cjs/managers/session.manager.d.ts +72 -0
- package/dist/cjs/managers/session.manager.js +587 -0
- package/dist/cjs/managers/state.manager.d.ts +5 -0
- package/dist/cjs/managers/state.manager.js +23 -0
- package/dist/cjs/managers/storage.manager.d.ts +10 -0
- package/dist/cjs/managers/storage.manager.js +81 -0
- package/dist/cjs/managers/tags.manager.d.ts +12 -0
- package/dist/cjs/managers/tags.manager.js +289 -0
- package/dist/cjs/managers/user.manager.d.ts +7 -0
- package/dist/cjs/managers/user.manager.js +22 -0
- package/dist/cjs/public-api.d.ts +1 -0
- package/dist/cjs/public-api.js +37 -0
- package/dist/cjs/types/api.types.d.ts +21 -0
- package/dist/cjs/types/api.types.js +25 -0
- package/dist/cjs/types/common.types.d.ts +1 -0
- package/dist/cjs/types/common.types.js +2 -0
- package/dist/cjs/types/config.types.d.ts +104 -0
- package/dist/cjs/types/config.types.js +2 -0
- package/dist/cjs/types/device.types.d.ts +6 -0
- package/dist/cjs/types/device.types.js +10 -0
- package/dist/cjs/types/event.types.d.ts +104 -0
- package/dist/cjs/types/event.types.js +25 -0
- package/dist/cjs/types/index.d.ts +13 -0
- package/dist/cjs/types/index.js +29 -0
- package/dist/cjs/types/log.types.d.ts +4 -0
- package/dist/cjs/types/log.types.js +2 -0
- package/dist/cjs/types/mode.types.d.ts +7 -0
- package/dist/cjs/types/mode.types.js +11 -0
- package/dist/cjs/types/queue.types.d.ts +23 -0
- package/dist/cjs/types/queue.types.js +2 -0
- package/dist/cjs/types/session.types.d.ts +65 -0
- package/dist/cjs/types/session.types.js +2 -0
- package/dist/cjs/types/state.types.d.ts +12 -0
- package/dist/cjs/types/state.types.js +2 -0
- package/dist/cjs/types/tag.types.d.ts +43 -0
- package/dist/cjs/types/tag.types.js +31 -0
- package/dist/cjs/types/validation-error.types.d.ts +42 -0
- package/dist/cjs/types/validation-error.types.js +68 -0
- package/dist/cjs/types/web-vitals.types.d.ts +6 -0
- package/dist/cjs/types/web-vitals.types.js +2 -0
- package/dist/cjs/types/window.types.d.ts +17 -0
- package/dist/cjs/types/window.types.js +2 -0
- package/dist/cjs/utils/browser/device-detector.utils.d.ts +6 -0
- package/dist/cjs/utils/browser/device-detector.utils.js +71 -0
- package/dist/cjs/utils/browser/index.d.ts +2 -0
- package/dist/cjs/utils/browser/index.js +18 -0
- package/dist/cjs/utils/browser/utm-params.utils.d.ts +6 -0
- package/dist/cjs/utils/browser/utm-params.utils.js +37 -0
- package/dist/cjs/utils/data/index.d.ts +1 -0
- package/dist/cjs/utils/data/index.js +17 -0
- package/dist/cjs/utils/data/uuid.utils.d.ts +5 -0
- package/dist/cjs/utils/data/uuid.utils.js +18 -0
- package/dist/cjs/utils/index.d.ts +6 -0
- package/dist/cjs/utils/index.js +22 -0
- package/dist/cjs/utils/logging/debug-logger.utils.d.ts +56 -0
- package/dist/cjs/utils/logging/debug-logger.utils.js +139 -0
- package/dist/cjs/utils/logging/index.d.ts +1 -0
- package/dist/cjs/utils/logging/index.js +5 -0
- package/dist/cjs/utils/network/index.d.ts +1 -0
- package/dist/cjs/utils/network/index.js +17 -0
- package/dist/cjs/utils/network/url.utils.d.ts +20 -0
- package/dist/cjs/utils/network/url.utils.js +172 -0
- package/dist/cjs/utils/security/index.d.ts +1 -0
- package/dist/cjs/utils/security/index.js +17 -0
- package/dist/cjs/utils/security/sanitize.utils.d.ts +32 -0
- package/dist/cjs/utils/security/sanitize.utils.js +319 -0
- package/dist/cjs/utils/validations/config-validations.utils.d.ts +42 -0
- package/dist/cjs/utils/validations/config-validations.utils.js +297 -0
- package/dist/cjs/utils/validations/event-validations.utils.d.ts +12 -0
- package/dist/cjs/utils/validations/event-validations.utils.js +30 -0
- package/dist/cjs/utils/validations/index.d.ts +5 -0
- package/dist/cjs/utils/validations/index.js +21 -0
- package/dist/cjs/utils/validations/metadata-validations.utils.d.ts +22 -0
- package/dist/cjs/utils/validations/metadata-validations.utils.js +115 -0
- package/dist/cjs/utils/validations/type-guards.utils.d.ts +6 -0
- package/dist/cjs/utils/validations/type-guards.utils.js +31 -0
- package/dist/cjs/utils/validations/url-validations.utils.d.ts +15 -0
- package/dist/cjs/utils/validations/url-validations.utils.js +47 -0
- package/dist/esm/api.d.ts +46 -0
- package/dist/esm/api.js +183 -0
- package/dist/esm/app.constants.d.ts +1 -0
- package/dist/esm/app.constants.js +1 -0
- package/dist/esm/app.d.ts +59 -0
- package/dist/esm/app.js +268 -0
- package/dist/esm/app.types.d.ts +6 -0
- package/dist/esm/app.types.js +6 -0
- package/dist/esm/constants/api.constants.d.ts +4 -0
- package/dist/esm/constants/api.constants.js +14 -0
- package/dist/esm/constants/browser.constants.d.ts +3 -0
- package/dist/esm/constants/browser.constants.js +38 -0
- package/dist/esm/constants/index.d.ts +8 -0
- package/dist/esm/constants/index.js +8 -0
- package/dist/esm/constants/initialization.constants.d.ts +40 -0
- package/dist/esm/constants/initialization.constants.js +45 -0
- package/dist/esm/constants/limits.constants.d.ts +25 -0
- package/dist/esm/constants/limits.constants.js +37 -0
- package/dist/esm/constants/security.constants.d.ts +1 -0
- package/dist/esm/constants/security.constants.js +9 -0
- package/dist/esm/constants/storage.constants.d.ts +9 -0
- package/dist/esm/constants/storage.constants.js +11 -0
- package/dist/esm/constants/timing.constants.d.ts +22 -0
- package/dist/esm/constants/timing.constants.js +31 -0
- package/dist/esm/constants/validation.constants.d.ts +13 -0
- package/dist/esm/constants/validation.constants.js +28 -0
- package/dist/esm/handlers/click.handler.d.ts +17 -0
- package/dist/esm/handlers/click.handler.js +195 -0
- package/dist/esm/handlers/error.handler.d.ts +15 -0
- package/dist/esm/handlers/error.handler.js +93 -0
- package/dist/esm/handlers/network.handler.d.ts +16 -0
- package/dist/esm/handlers/network.handler.js +132 -0
- package/dist/esm/handlers/page-view.handler.d.ts +15 -0
- package/dist/esm/handlers/page-view.handler.js +79 -0
- package/dist/esm/handlers/performance.handler.d.ts +19 -0
- package/dist/esm/handlers/performance.handler.js +218 -0
- package/dist/esm/handlers/scroll.handler.d.ts +16 -0
- package/dist/esm/handlers/scroll.handler.js +134 -0
- package/dist/esm/handlers/session.handler.d.ts +29 -0
- package/dist/esm/handlers/session.handler.js +353 -0
- package/dist/esm/integrations/google-analytics.integration.d.ts +18 -0
- package/dist/esm/integrations/google-analytics.integration.js +155 -0
- package/dist/esm/listeners/activity-listener-manager.d.ts +8 -0
- package/dist/esm/listeners/activity-listener-manager.js +28 -0
- package/dist/esm/listeners/index.d.ts +6 -0
- package/dist/esm/listeners/index.js +5 -0
- package/dist/esm/listeners/input-listener-managers.d.ts +15 -0
- package/dist/esm/listeners/input-listener-managers.js +53 -0
- package/dist/esm/listeners/listeners.types.d.ts +4 -0
- package/dist/esm/listeners/listeners.types.js +1 -0
- package/dist/esm/listeners/touch-listener-manager.d.ts +10 -0
- package/dist/esm/listeners/touch-listener-manager.js +52 -0
- package/dist/esm/listeners/unload-listener-manager.d.ts +8 -0
- package/dist/esm/listeners/unload-listener-manager.js +26 -0
- package/dist/esm/listeners/visibility-listener-manager.d.ts +12 -0
- package/dist/esm/listeners/visibility-listener-manager.js +79 -0
- package/dist/esm/managers/api.manager.d.ts +3 -0
- package/dist/esm/managers/api.manager.js +10 -0
- package/dist/esm/managers/config.manager.d.ts +7 -0
- package/dist/esm/managers/config.manager.js +90 -0
- package/dist/esm/managers/cross-tab-session.manager.d.ts +170 -0
- package/dist/esm/managers/cross-tab-session.manager.js +726 -0
- package/dist/esm/managers/event.manager.d.ts +61 -0
- package/dist/esm/managers/event.manager.js +504 -0
- package/dist/esm/managers/sampling.manager.d.ts +8 -0
- package/dist/esm/managers/sampling.manager.js +49 -0
- package/dist/esm/managers/sender.manager.d.ts +46 -0
- package/dist/esm/managers/sender.manager.js +300 -0
- package/dist/esm/managers/session-recovery.manager.d.ts +65 -0
- package/dist/esm/managers/session-recovery.manager.js +233 -0
- package/dist/esm/managers/session.manager.d.ts +72 -0
- package/dist/esm/managers/session.manager.js +583 -0
- package/dist/esm/managers/state.manager.d.ts +5 -0
- package/dist/esm/managers/state.manager.js +19 -0
- package/dist/esm/managers/storage.manager.d.ts +10 -0
- package/dist/esm/managers/storage.manager.js +77 -0
- package/dist/esm/managers/tags.manager.d.ts +12 -0
- package/dist/esm/managers/tags.manager.js +285 -0
- package/dist/esm/managers/user.manager.d.ts +7 -0
- package/dist/esm/managers/user.manager.js +18 -0
- package/dist/esm/public-api.d.ts +1 -0
- package/dist/esm/public-api.js +1 -0
- package/dist/esm/types/api.types.d.ts +21 -0
- package/dist/esm/types/api.types.js +22 -0
- package/dist/esm/types/common.types.d.ts +1 -0
- package/dist/esm/types/common.types.js +1 -0
- package/dist/esm/types/config.types.d.ts +104 -0
- package/dist/esm/types/config.types.js +1 -0
- package/dist/esm/types/device.types.d.ts +6 -0
- package/dist/esm/types/device.types.js +7 -0
- package/dist/esm/types/event.types.d.ts +104 -0
- package/dist/esm/types/event.types.js +22 -0
- package/dist/esm/types/index.d.ts +13 -0
- package/dist/esm/types/index.js +13 -0
- package/dist/esm/types/log.types.d.ts +4 -0
- package/dist/esm/types/log.types.js +1 -0
- package/dist/esm/types/mode.types.d.ts +7 -0
- package/dist/esm/types/mode.types.js +8 -0
- package/dist/esm/types/queue.types.d.ts +23 -0
- package/dist/esm/types/queue.types.js +1 -0
- package/dist/esm/types/session.types.d.ts +65 -0
- package/dist/esm/types/session.types.js +1 -0
- package/dist/esm/types/state.types.d.ts +12 -0
- package/dist/esm/types/state.types.js +1 -0
- package/dist/esm/types/tag.types.d.ts +43 -0
- package/dist/esm/types/tag.types.js +28 -0
- package/dist/esm/types/validation-error.types.d.ts +42 -0
- package/dist/esm/types/validation-error.types.js +59 -0
- package/dist/esm/types/web-vitals.types.d.ts +6 -0
- package/dist/esm/types/web-vitals.types.js +1 -0
- package/dist/esm/types/window.types.d.ts +17 -0
- package/dist/esm/types/window.types.js +1 -0
- package/dist/esm/utils/browser/device-detector.utils.d.ts +6 -0
- package/dist/esm/utils/browser/device-detector.utils.js +67 -0
- package/dist/esm/utils/browser/index.d.ts +2 -0
- package/dist/esm/utils/browser/index.js +2 -0
- package/dist/esm/utils/browser/utm-params.utils.d.ts +6 -0
- package/dist/esm/utils/browser/utm-params.utils.js +33 -0
- package/dist/esm/utils/data/index.d.ts +1 -0
- package/dist/esm/utils/data/index.js +1 -0
- package/dist/esm/utils/data/uuid.utils.d.ts +5 -0
- package/dist/esm/utils/data/uuid.utils.js +14 -0
- package/dist/esm/utils/index.d.ts +6 -0
- package/dist/esm/utils/index.js +6 -0
- package/dist/esm/utils/logging/debug-logger.utils.d.ts +56 -0
- package/dist/esm/utils/logging/debug-logger.utils.js +136 -0
- package/dist/esm/utils/logging/index.d.ts +1 -0
- package/dist/esm/utils/logging/index.js +1 -0
- package/dist/esm/utils/network/index.d.ts +1 -0
- package/dist/esm/utils/network/index.js +1 -0
- package/dist/esm/utils/network/url.utils.d.ts +20 -0
- package/dist/esm/utils/network/url.utils.js +166 -0
- package/dist/esm/utils/security/index.d.ts +1 -0
- package/dist/esm/utils/security/index.js +1 -0
- package/dist/esm/utils/security/sanitize.utils.d.ts +32 -0
- package/dist/esm/utils/security/sanitize.utils.js +311 -0
- package/dist/esm/utils/validations/config-validations.utils.d.ts +42 -0
- package/dist/esm/utils/validations/config-validations.utils.js +289 -0
- package/dist/esm/utils/validations/event-validations.utils.d.ts +12 -0
- package/dist/esm/utils/validations/event-validations.utils.js +26 -0
- package/dist/esm/utils/validations/index.d.ts +5 -0
- package/dist/esm/utils/validations/index.js +5 -0
- package/dist/esm/utils/validations/metadata-validations.utils.d.ts +22 -0
- package/dist/esm/utils/validations/metadata-validations.utils.js +110 -0
- package/dist/esm/utils/validations/type-guards.utils.d.ts +6 -0
- package/dist/esm/utils/validations/type-guards.utils.js +27 -0
- package/dist/esm/utils/validations/url-validations.utils.d.ts +15 -0
- package/dist/esm/utils/validations/url-validations.utils.js +42 -0
- package/package.json +80 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeviceType, EventData } from '../types';
|
|
2
|
+
import { StateManager } from './state.manager';
|
|
3
|
+
export declare class TagsManager extends StateManager {
|
|
4
|
+
getEventTagsIds(event: EventData, deviceType: DeviceType): string[];
|
|
5
|
+
private checkEventTypePageView;
|
|
6
|
+
private checkEventTypeClick;
|
|
7
|
+
private matchUrlMatches;
|
|
8
|
+
private matchDeviceType;
|
|
9
|
+
private matchElementSelector;
|
|
10
|
+
private matchUtmCondition;
|
|
11
|
+
private checkElementFieldEquals;
|
|
12
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { EventType, TagConditionOperator, TagConditionType, TagLogicalOperator, } from '../types';
|
|
2
|
+
import { StateManager } from './state.manager';
|
|
3
|
+
export class TagsManager extends StateManager {
|
|
4
|
+
getEventTagsIds(event, deviceType) {
|
|
5
|
+
switch (event.type) {
|
|
6
|
+
case EventType.PAGE_VIEW: {
|
|
7
|
+
return this.checkEventTypePageView(event, deviceType);
|
|
8
|
+
}
|
|
9
|
+
case EventType.CLICK: {
|
|
10
|
+
return this.checkEventTypeClick(event, deviceType);
|
|
11
|
+
}
|
|
12
|
+
default: {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
checkEventTypePageView(event, deviceType) {
|
|
18
|
+
const tags = this.get('config')?.tags?.filter((tag) => tag.triggerType === EventType.PAGE_VIEW) ?? [];
|
|
19
|
+
if (tags.length === 0) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
const matchedTagIds = [];
|
|
23
|
+
for (const tag of tags) {
|
|
24
|
+
const { id, logicalOperator, conditions } = tag;
|
|
25
|
+
const results = [];
|
|
26
|
+
for (const condition of conditions) {
|
|
27
|
+
switch (condition.type) {
|
|
28
|
+
case TagConditionType.URL_MATCHES: {
|
|
29
|
+
results.push(this.matchUrlMatches(condition, event.page_url));
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
case TagConditionType.DEVICE_TYPE: {
|
|
33
|
+
results.push(this.matchDeviceType(condition, deviceType));
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
case TagConditionType.UTM_SOURCE: {
|
|
37
|
+
results.push(this.matchUtmCondition(condition, event.utm?.source));
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
case TagConditionType.UTM_MEDIUM: {
|
|
41
|
+
results.push(this.matchUtmCondition(condition, event.utm?.medium));
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
case TagConditionType.UTM_CAMPAIGN: {
|
|
45
|
+
results.push(this.matchUtmCondition(condition, event.utm?.campaign));
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
let isMatch = false;
|
|
51
|
+
isMatch = logicalOperator === TagLogicalOperator.AND ? results.every(Boolean) : results.some(Boolean);
|
|
52
|
+
if (isMatch) {
|
|
53
|
+
matchedTagIds.push(id);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return matchedTagIds;
|
|
57
|
+
}
|
|
58
|
+
checkEventTypeClick(event, deviceType) {
|
|
59
|
+
const tags = this.get('config')?.tags?.filter((tag) => tag.triggerType === EventType.CLICK) ?? [];
|
|
60
|
+
if (tags.length === 0) {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
const matchedTagIds = [];
|
|
64
|
+
for (const tag of tags) {
|
|
65
|
+
const { id, logicalOperator, conditions } = tag;
|
|
66
|
+
const results = [];
|
|
67
|
+
for (const condition of conditions) {
|
|
68
|
+
if (!event.click_data) {
|
|
69
|
+
results.push(false);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const clickData = event.click_data;
|
|
73
|
+
switch (condition.type) {
|
|
74
|
+
case TagConditionType.ELEMENT_MATCHES: {
|
|
75
|
+
results.push(this.matchElementSelector(condition, clickData));
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
case TagConditionType.DEVICE_TYPE: {
|
|
79
|
+
results.push(this.matchDeviceType(condition, deviceType));
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case TagConditionType.URL_MATCHES: {
|
|
83
|
+
results.push(this.matchUrlMatches(condition, event.page_url));
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case TagConditionType.UTM_SOURCE: {
|
|
87
|
+
results.push(this.matchUtmCondition(condition, event.utm?.source));
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
case TagConditionType.UTM_MEDIUM: {
|
|
91
|
+
results.push(this.matchUtmCondition(condition, event.utm?.medium));
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
case TagConditionType.UTM_CAMPAIGN: {
|
|
95
|
+
results.push(this.matchUtmCondition(condition, event.utm?.campaign));
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
let isMatch = false;
|
|
101
|
+
isMatch = logicalOperator === TagLogicalOperator.AND ? results.every(Boolean) : results.some(Boolean);
|
|
102
|
+
if (isMatch) {
|
|
103
|
+
matchedTagIds.push(id);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return matchedTagIds;
|
|
107
|
+
}
|
|
108
|
+
matchUrlMatches(condition, url) {
|
|
109
|
+
if (condition.type !== TagConditionType.URL_MATCHES) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
const targetValue = condition.value.toLowerCase();
|
|
113
|
+
const targetUrl = url.toLowerCase();
|
|
114
|
+
switch (condition.operator) {
|
|
115
|
+
case TagConditionOperator.EQUALS: {
|
|
116
|
+
return targetUrl === targetValue;
|
|
117
|
+
}
|
|
118
|
+
case TagConditionOperator.CONTAINS: {
|
|
119
|
+
return targetUrl.includes(targetValue);
|
|
120
|
+
}
|
|
121
|
+
case TagConditionOperator.STARTS_WITH: {
|
|
122
|
+
return targetUrl.startsWith(targetValue);
|
|
123
|
+
}
|
|
124
|
+
case TagConditionOperator.ENDS_WITH: {
|
|
125
|
+
return targetUrl.endsWith(targetValue);
|
|
126
|
+
}
|
|
127
|
+
case TagConditionOperator.REGEX: {
|
|
128
|
+
try {
|
|
129
|
+
const regex = new RegExp(targetValue, 'gi');
|
|
130
|
+
return regex.test(targetUrl);
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
default: {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
matchDeviceType(condition, deviceType) {
|
|
142
|
+
if (condition.type !== TagConditionType.DEVICE_TYPE) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
const targetValue = condition.value.toLowerCase();
|
|
146
|
+
const targetDevice = deviceType.toLowerCase();
|
|
147
|
+
switch (condition.operator) {
|
|
148
|
+
case TagConditionOperator.EQUALS: {
|
|
149
|
+
return targetDevice === targetValue;
|
|
150
|
+
}
|
|
151
|
+
case TagConditionOperator.CONTAINS: {
|
|
152
|
+
return targetDevice.includes(targetValue);
|
|
153
|
+
}
|
|
154
|
+
case TagConditionOperator.STARTS_WITH: {
|
|
155
|
+
return targetDevice.startsWith(targetValue);
|
|
156
|
+
}
|
|
157
|
+
case TagConditionOperator.ENDS_WITH: {
|
|
158
|
+
return targetDevice.endsWith(targetValue);
|
|
159
|
+
}
|
|
160
|
+
case TagConditionOperator.REGEX: {
|
|
161
|
+
try {
|
|
162
|
+
const regex = new RegExp(targetValue, 'gi');
|
|
163
|
+
return regex.test(targetDevice);
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
default: {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
matchElementSelector(condition, clickData) {
|
|
175
|
+
if (condition.type !== TagConditionType.ELEMENT_MATCHES) {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
const elementData = [
|
|
179
|
+
clickData.id ?? '',
|
|
180
|
+
clickData.class ?? '',
|
|
181
|
+
clickData.tag ?? '',
|
|
182
|
+
clickData.text ?? '',
|
|
183
|
+
clickData.href ?? '',
|
|
184
|
+
clickData.title ?? '',
|
|
185
|
+
clickData.alt ?? '',
|
|
186
|
+
clickData.role ?? '',
|
|
187
|
+
clickData.ariaLabel ?? '',
|
|
188
|
+
...Object.values(clickData.dataAttributes ?? {}),
|
|
189
|
+
].join(' ');
|
|
190
|
+
const targetValue = condition.value.toLowerCase();
|
|
191
|
+
const targetElementData = elementData.toLowerCase();
|
|
192
|
+
switch (condition.operator) {
|
|
193
|
+
case TagConditionOperator.EQUALS: {
|
|
194
|
+
return this.checkElementFieldEquals(clickData, targetValue);
|
|
195
|
+
}
|
|
196
|
+
case TagConditionOperator.CONTAINS: {
|
|
197
|
+
return targetElementData.includes(targetValue);
|
|
198
|
+
}
|
|
199
|
+
case TagConditionOperator.STARTS_WITH: {
|
|
200
|
+
return targetElementData.startsWith(targetValue);
|
|
201
|
+
}
|
|
202
|
+
case TagConditionOperator.ENDS_WITH: {
|
|
203
|
+
return targetElementData.endsWith(targetValue);
|
|
204
|
+
}
|
|
205
|
+
case TagConditionOperator.REGEX: {
|
|
206
|
+
try {
|
|
207
|
+
const regex = new RegExp(targetValue, 'gi');
|
|
208
|
+
return regex.test(targetElementData);
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
default: {
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
matchUtmCondition(condition, utmValue) {
|
|
220
|
+
if (![TagConditionType.UTM_SOURCE, TagConditionType.UTM_MEDIUM, TagConditionType.UTM_CAMPAIGN].includes(condition.type)) {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
const value = utmValue ?? '';
|
|
224
|
+
const targetValue = condition.value.toLowerCase();
|
|
225
|
+
const targetUtmValue = value.toLowerCase();
|
|
226
|
+
switch (condition.operator) {
|
|
227
|
+
case TagConditionOperator.EQUALS: {
|
|
228
|
+
return targetUtmValue === targetValue;
|
|
229
|
+
}
|
|
230
|
+
case TagConditionOperator.CONTAINS: {
|
|
231
|
+
return targetUtmValue.includes(targetValue);
|
|
232
|
+
}
|
|
233
|
+
case TagConditionOperator.STARTS_WITH: {
|
|
234
|
+
return targetUtmValue.startsWith(targetValue);
|
|
235
|
+
}
|
|
236
|
+
case TagConditionOperator.ENDS_WITH: {
|
|
237
|
+
return targetUtmValue.endsWith(targetValue);
|
|
238
|
+
}
|
|
239
|
+
case TagConditionOperator.REGEX: {
|
|
240
|
+
try {
|
|
241
|
+
const regex = new RegExp(targetValue, 'gi');
|
|
242
|
+
return regex.test(targetUtmValue);
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
default: {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
checkElementFieldEquals(clickData, targetValue) {
|
|
254
|
+
const fields = [
|
|
255
|
+
clickData.id,
|
|
256
|
+
clickData.class,
|
|
257
|
+
clickData.tag,
|
|
258
|
+
clickData.text,
|
|
259
|
+
clickData.href,
|
|
260
|
+
clickData.title,
|
|
261
|
+
clickData.alt,
|
|
262
|
+
clickData.role,
|
|
263
|
+
clickData.ariaLabel,
|
|
264
|
+
];
|
|
265
|
+
for (const field of fields) {
|
|
266
|
+
if (field) {
|
|
267
|
+
const fieldValue = field.toLowerCase();
|
|
268
|
+
const target = targetValue.toLowerCase();
|
|
269
|
+
if (fieldValue === target) {
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (clickData.dataAttributes) {
|
|
275
|
+
for (const dataValue of Object.values(clickData.dataAttributes)) {
|
|
276
|
+
const fieldValue = dataValue.toLowerCase();
|
|
277
|
+
const target = targetValue.toLowerCase();
|
|
278
|
+
if (fieldValue === target) {
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { USER_ID_KEY } from '../constants';
|
|
2
|
+
import { generateUUID } from '../utils';
|
|
3
|
+
import { StateManager } from './state.manager';
|
|
4
|
+
export class UserManager extends StateManager {
|
|
5
|
+
constructor(storageManager) {
|
|
6
|
+
super();
|
|
7
|
+
this.storageManager = storageManager;
|
|
8
|
+
}
|
|
9
|
+
getId() {
|
|
10
|
+
const storedUserId = this.storageManager.getItem(USER_ID_KEY(this.get('config')?.id));
|
|
11
|
+
if (storedUserId) {
|
|
12
|
+
return storedUserId;
|
|
13
|
+
}
|
|
14
|
+
const newUserId = generateUUID();
|
|
15
|
+
this.storageManager.setItem(USER_ID_KEY(this.get('config')?.id), newUserId);
|
|
16
|
+
return newUserId;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as TraceLog from './api';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as TraceLog from './api';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Special project IDs for testing and development
|
|
3
|
+
*
|
|
4
|
+
* Both automatically force mode: 'debug' but differ in HTTP behavior:
|
|
5
|
+
* - HttpSkip: NO network calls (pure offline testing)
|
|
6
|
+
* - HttpLocal: Makes network calls to local server (integration testing)
|
|
7
|
+
*/
|
|
8
|
+
export declare enum SpecialProjectId {
|
|
9
|
+
/**
|
|
10
|
+
* Skips ALL HTTP calls - no config fetch, no event sending
|
|
11
|
+
* Uses default local config, forces debug mode
|
|
12
|
+
* Perfect for pure offline E2E testing
|
|
13
|
+
*/
|
|
14
|
+
HttpSkip = "http-skip",
|
|
15
|
+
/**
|
|
16
|
+
* Makes HTTP calls to window.location.origin instead of production API
|
|
17
|
+
* Fetches config and sends events to local server, forces debug mode
|
|
18
|
+
* Perfect for local development with running middleware
|
|
19
|
+
*/
|
|
20
|
+
HttpLocal = "http-local"
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Special project IDs for testing and development
|
|
3
|
+
*
|
|
4
|
+
* Both automatically force mode: 'debug' but differ in HTTP behavior:
|
|
5
|
+
* - HttpSkip: NO network calls (pure offline testing)
|
|
6
|
+
* - HttpLocal: Makes network calls to local server (integration testing)
|
|
7
|
+
*/
|
|
8
|
+
export var SpecialProjectId;
|
|
9
|
+
(function (SpecialProjectId) {
|
|
10
|
+
/**
|
|
11
|
+
* Skips ALL HTTP calls - no config fetch, no event sending
|
|
12
|
+
* Uses default local config, forces debug mode
|
|
13
|
+
* Perfect for pure offline E2E testing
|
|
14
|
+
*/
|
|
15
|
+
SpecialProjectId["HttpSkip"] = "http-skip";
|
|
16
|
+
/**
|
|
17
|
+
* Makes HTTP calls to window.location.origin instead of production API
|
|
18
|
+
* Fetches config and sends events to local server, forces debug mode
|
|
19
|
+
* Perfect for local development with running middleware
|
|
20
|
+
*/
|
|
21
|
+
SpecialProjectId["HttpLocal"] = "http-local";
|
|
22
|
+
})(SpecialProjectId || (SpecialProjectId = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type MetadataType = string | number | boolean | string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { MetadataType } from './common.types';
|
|
2
|
+
import { TagConfig } from './tag.types';
|
|
3
|
+
import { Mode } from './mode.types';
|
|
4
|
+
export type Config = ApiConfig & AppConfig;
|
|
5
|
+
export interface ApiConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Logging mode for the library.
|
|
8
|
+
* - 'qa': Shows client-facing logs only (INFO, CLIENT_WARN, CLIENT_ERROR)
|
|
9
|
+
* - 'debug': Shows all logs including internal library errors
|
|
10
|
+
*/
|
|
11
|
+
mode?: Mode;
|
|
12
|
+
/**
|
|
13
|
+
* Sampling rate as a percentage (0-1) to control how many events are sent.
|
|
14
|
+
* A value of 1 means all events are sent, while 0.5 means only half of events are sent.
|
|
15
|
+
*/
|
|
16
|
+
samplingRate?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Array of tag configurations for categorizing and filtering events.
|
|
19
|
+
* Tags help organize and segment tracking data for analysis.
|
|
20
|
+
*/
|
|
21
|
+
tags?: TagConfig[];
|
|
22
|
+
/**
|
|
23
|
+
* Array of URL path patterns to exclude from tracking.
|
|
24
|
+
* Events will not be sent for pages matching these patterns.
|
|
25
|
+
*/
|
|
26
|
+
excludedUrlPaths?: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Flag to indicate if IP addresses should be excluded from tracking.
|
|
29
|
+
* When true, IP addresses will not be collected or sent with events.
|
|
30
|
+
* This is useful for privacy compliance and reducing data exposure.
|
|
31
|
+
*/
|
|
32
|
+
ipExcluded?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface AppConfig {
|
|
35
|
+
/**
|
|
36
|
+
* Unique project identifier.
|
|
37
|
+
*/
|
|
38
|
+
id: string;
|
|
39
|
+
/**
|
|
40
|
+
* Session timeout in milliseconds. After this period of inactivity,
|
|
41
|
+
* a new session will be started for subsequent events.
|
|
42
|
+
*
|
|
43
|
+
* **Timeout Guidelines:**
|
|
44
|
+
* - **15 minutes (default)**: Recommended for most applications, aligns with security best practices
|
|
45
|
+
* - **30 minutes**: Standard for content-heavy sites (matches Google Analytics default)
|
|
46
|
+
* - **45-60 minutes**: Consider for sites with long-form content, videos, or documentation
|
|
47
|
+
* - **5-10 minutes**: Use for security-sensitive applications requiring frequent re-authentication
|
|
48
|
+
*
|
|
49
|
+
* **Impact on Analytics:**
|
|
50
|
+
* - Shorter timeouts = Higher session count, higher bounce rate, potentially lower conversion rates
|
|
51
|
+
* - Longer timeouts = Lower session count, more accurate user journey tracking, better conversion attribution
|
|
52
|
+
*
|
|
53
|
+
* **When to Adjust:**
|
|
54
|
+
* - Match your application's auto-logout timeout if applicable
|
|
55
|
+
* - Increase for content where users frequently pause (tutorials, long articles, videos)
|
|
56
|
+
* - Decrease for applications with sensitive data or frequent security requirements
|
|
57
|
+
* - Monitor bounce rates and conversion funnels when changing this value
|
|
58
|
+
*
|
|
59
|
+
* @default 900000 (15 minutes)
|
|
60
|
+
* @min 30000 (30 seconds)
|
|
61
|
+
* @max 86400000 (24 hours)
|
|
62
|
+
*/
|
|
63
|
+
sessionTimeout?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Metadata that will be automatically attached to all tracking events.
|
|
66
|
+
* These key-value pairs provide additional context for every event sent.
|
|
67
|
+
*/
|
|
68
|
+
globalMetadata?: Record<string, MetadataType>;
|
|
69
|
+
/**
|
|
70
|
+
* CSS selectors for custom scroll containers. Can be a single selector string
|
|
71
|
+
* or an array of selectors. Used to track scroll events within specific elements
|
|
72
|
+
* instead of the default window scroll.
|
|
73
|
+
*/
|
|
74
|
+
scrollContainerSelectors?: string | string[];
|
|
75
|
+
/**
|
|
76
|
+
* Allow HTTP requests to be made. This is useful for testing and development.
|
|
77
|
+
*/
|
|
78
|
+
allowHttp?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Array of query parameters to be removed from the URL.
|
|
81
|
+
*/
|
|
82
|
+
sensitiveQueryParams?: string[];
|
|
83
|
+
/**
|
|
84
|
+
* Sampling rate for error events (0-1).
|
|
85
|
+
* Controls how many error and network error events are captured.
|
|
86
|
+
* @default 0.1 for production, 1.0 for qa/debug mode
|
|
87
|
+
*/
|
|
88
|
+
errorSampling?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Optional integrations configuration.
|
|
91
|
+
*/
|
|
92
|
+
integrations?: {
|
|
93
|
+
/**
|
|
94
|
+
* Google Analytics integration configuration.
|
|
95
|
+
*/
|
|
96
|
+
googleAnalytics?: {
|
|
97
|
+
/**
|
|
98
|
+
* Google Analytics measurement ID.
|
|
99
|
+
* Required for initializing the Google Analytics integration.
|
|
100
|
+
*/
|
|
101
|
+
measurementId: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { MetadataType } from './common.types';
|
|
2
|
+
import { SessionEndReason } from './session.types';
|
|
3
|
+
export type WebVitalType = 'LCP' | 'CLS' | 'INP' | 'FCP' | 'TTFB' | 'LONG_TASK';
|
|
4
|
+
export declare enum EventType {
|
|
5
|
+
PAGE_VIEW = "page_view",
|
|
6
|
+
CLICK = "click",
|
|
7
|
+
SCROLL = "scroll",
|
|
8
|
+
SESSION_START = "session_start",
|
|
9
|
+
SESSION_END = "session_end",
|
|
10
|
+
CUSTOM = "custom",
|
|
11
|
+
WEB_VITALS = "web_vitals",
|
|
12
|
+
ERROR = "error"
|
|
13
|
+
}
|
|
14
|
+
export declare enum ScrollDirection {
|
|
15
|
+
UP = "up",
|
|
16
|
+
DOWN = "down"
|
|
17
|
+
}
|
|
18
|
+
export declare enum ErrorType {
|
|
19
|
+
JS_ERROR = "js_error",
|
|
20
|
+
PROMISE_REJECTION = "promise_rejection",
|
|
21
|
+
NETWORK_ERROR = "network_error"
|
|
22
|
+
}
|
|
23
|
+
export interface ScrollData {
|
|
24
|
+
depth: number;
|
|
25
|
+
direction: ScrollDirection;
|
|
26
|
+
}
|
|
27
|
+
export interface ClickData {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
relativeX: number;
|
|
31
|
+
relativeY: number;
|
|
32
|
+
id?: string;
|
|
33
|
+
class?: string;
|
|
34
|
+
tag?: string;
|
|
35
|
+
text?: string;
|
|
36
|
+
href?: string;
|
|
37
|
+
title?: string;
|
|
38
|
+
alt?: string;
|
|
39
|
+
role?: string;
|
|
40
|
+
ariaLabel?: string;
|
|
41
|
+
dataAttributes?: Record<string, string>;
|
|
42
|
+
}
|
|
43
|
+
export interface ClickCoordinates {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
relativeX: number;
|
|
47
|
+
relativeY: number;
|
|
48
|
+
}
|
|
49
|
+
export interface ClickTrackingElementData {
|
|
50
|
+
element: HTMLElement;
|
|
51
|
+
name: string;
|
|
52
|
+
value?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface CustomEventData {
|
|
55
|
+
name: string;
|
|
56
|
+
metadata?: Record<string, MetadataType>;
|
|
57
|
+
}
|
|
58
|
+
export interface WebVitalsData {
|
|
59
|
+
type: WebVitalType;
|
|
60
|
+
value: number;
|
|
61
|
+
}
|
|
62
|
+
export interface ErrorData {
|
|
63
|
+
type: ErrorType;
|
|
64
|
+
message: string;
|
|
65
|
+
method?: string;
|
|
66
|
+
url?: string;
|
|
67
|
+
status?: number;
|
|
68
|
+
statusText?: string;
|
|
69
|
+
duration?: number;
|
|
70
|
+
}
|
|
71
|
+
export interface UTM {
|
|
72
|
+
source?: string;
|
|
73
|
+
medium?: string;
|
|
74
|
+
campaign?: string;
|
|
75
|
+
term?: string;
|
|
76
|
+
content?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface PageViewData {
|
|
79
|
+
referrer?: string;
|
|
80
|
+
title?: string;
|
|
81
|
+
pathname?: string;
|
|
82
|
+
search?: string;
|
|
83
|
+
hash?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface EventData {
|
|
86
|
+
type: EventType;
|
|
87
|
+
page_url: string;
|
|
88
|
+
timestamp: number;
|
|
89
|
+
referrer?: string;
|
|
90
|
+
from_page_url?: string;
|
|
91
|
+
scroll_data?: ScrollData;
|
|
92
|
+
click_data?: ClickData;
|
|
93
|
+
custom_event?: CustomEventData;
|
|
94
|
+
web_vitals?: WebVitalsData;
|
|
95
|
+
page_view?: PageViewData;
|
|
96
|
+
session_start_recovered?: boolean;
|
|
97
|
+
session_end_reason?: SessionEndReason;
|
|
98
|
+
error_data?: ErrorData;
|
|
99
|
+
utm?: UTM;
|
|
100
|
+
tags?: string[] | {
|
|
101
|
+
id: string;
|
|
102
|
+
key: string;
|
|
103
|
+
}[];
|
|
104
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export var EventType;
|
|
2
|
+
(function (EventType) {
|
|
3
|
+
EventType["PAGE_VIEW"] = "page_view";
|
|
4
|
+
EventType["CLICK"] = "click";
|
|
5
|
+
EventType["SCROLL"] = "scroll";
|
|
6
|
+
EventType["SESSION_START"] = "session_start";
|
|
7
|
+
EventType["SESSION_END"] = "session_end";
|
|
8
|
+
EventType["CUSTOM"] = "custom";
|
|
9
|
+
EventType["WEB_VITALS"] = "web_vitals";
|
|
10
|
+
EventType["ERROR"] = "error";
|
|
11
|
+
})(EventType || (EventType = {}));
|
|
12
|
+
export var ScrollDirection;
|
|
13
|
+
(function (ScrollDirection) {
|
|
14
|
+
ScrollDirection["UP"] = "up";
|
|
15
|
+
ScrollDirection["DOWN"] = "down";
|
|
16
|
+
})(ScrollDirection || (ScrollDirection = {}));
|
|
17
|
+
export var ErrorType;
|
|
18
|
+
(function (ErrorType) {
|
|
19
|
+
ErrorType["JS_ERROR"] = "js_error";
|
|
20
|
+
ErrorType["PROMISE_REJECTION"] = "promise_rejection";
|
|
21
|
+
ErrorType["NETWORK_ERROR"] = "network_error";
|
|
22
|
+
})(ErrorType || (ErrorType = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './api.types';
|
|
2
|
+
export * from './common.types';
|
|
3
|
+
export * from './config.types';
|
|
4
|
+
export * from './device.types';
|
|
5
|
+
export * from './event.types';
|
|
6
|
+
export * from './log.types';
|
|
7
|
+
export * from './mode.types';
|
|
8
|
+
export * from './queue.types';
|
|
9
|
+
export * from './state.types';
|
|
10
|
+
export * from './tag.types';
|
|
11
|
+
export * from './validation-error.types';
|
|
12
|
+
export * from './web-vitals.types';
|
|
13
|
+
export * from './window.types';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './api.types';
|
|
2
|
+
export * from './common.types';
|
|
3
|
+
export * from './config.types';
|
|
4
|
+
export * from './device.types';
|
|
5
|
+
export * from './event.types';
|
|
6
|
+
export * from './log.types';
|
|
7
|
+
export * from './mode.types';
|
|
8
|
+
export * from './queue.types';
|
|
9
|
+
export * from './state.types';
|
|
10
|
+
export * from './tag.types';
|
|
11
|
+
export * from './validation-error.types';
|
|
12
|
+
export * from './web-vitals.types';
|
|
13
|
+
export * from './window.types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|