@tracelog/lib 0.0.8 → 0.2.0
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/README.md +58 -24
- package/dist/browser/tracelog.js +1934 -3226
- package/dist/cjs/api.d.ts +33 -19
- package/dist/cjs/api.js +111 -156
- package/dist/cjs/app.constants.d.ts +80 -1
- package/dist/cjs/app.constants.js +90 -3
- package/dist/cjs/app.d.ts +29 -44
- package/dist/cjs/app.js +114 -212
- package/dist/cjs/app.types.d.ts +2 -7
- package/dist/cjs/app.types.js +10 -21
- package/dist/cjs/constants/api.constants.js +11 -5
- package/dist/cjs/constants/config.constants.d.ts +75 -0
- package/dist/cjs/constants/config.constants.js +178 -0
- package/dist/cjs/constants/error.constants.d.ts +29 -0
- package/dist/cjs/constants/error.constants.js +50 -0
- package/dist/cjs/constants/index.d.ts +3 -6
- package/dist/cjs/constants/index.js +3 -6
- package/dist/cjs/constants/performance.constants.d.ts +28 -0
- package/dist/cjs/constants/performance.constants.js +43 -0
- package/dist/cjs/handlers/click.handler.d.ts +1 -0
- package/dist/cjs/handlers/click.handler.js +30 -49
- package/dist/cjs/handlers/error.handler.d.ts +11 -6
- package/dist/cjs/handlers/error.handler.js +91 -51
- package/dist/cjs/handlers/page-view.handler.js +38 -29
- package/dist/cjs/handlers/performance.handler.d.ts +3 -0
- package/dist/cjs/handlers/performance.handler.js +76 -37
- package/dist/cjs/handlers/scroll.handler.d.ts +15 -0
- package/dist/cjs/handlers/scroll.handler.js +105 -31
- package/dist/cjs/handlers/session.handler.d.ts +6 -20
- package/dist/cjs/handlers/session.handler.js +38 -326
- package/dist/cjs/integrations/google-analytics.integration.d.ts +0 -1
- package/dist/cjs/integrations/google-analytics.integration.js +27 -98
- package/dist/cjs/listeners/input-listener-managers.d.ts +18 -9
- package/dist/cjs/listeners/input-listener-managers.js +24 -33
- package/dist/cjs/listeners/touch-listener-manager.d.ts +1 -3
- package/dist/cjs/listeners/touch-listener-manager.js +1 -23
- package/dist/cjs/listeners/visibility-listener-manager.d.ts +1 -4
- package/dist/cjs/listeners/visibility-listener-manager.js +6 -42
- package/dist/cjs/managers/api.manager.d.ts +13 -3
- package/dist/cjs/managers/api.manager.js +35 -5
- package/dist/cjs/managers/config.manager.d.ts +53 -3
- package/dist/cjs/managers/config.manager.js +131 -62
- package/dist/cjs/managers/event.manager.d.ts +57 -36
- package/dist/cjs/managers/event.manager.js +266 -417
- package/dist/cjs/managers/sender.manager.d.ts +40 -22
- package/dist/cjs/managers/sender.manager.js +200 -198
- package/dist/cjs/managers/session.manager.d.ts +80 -66
- package/dist/cjs/managers/session.manager.js +267 -522
- package/dist/cjs/managers/state.manager.d.ts +33 -0
- package/dist/cjs/managers/state.manager.js +79 -6
- package/dist/cjs/managers/storage.manager.d.ts +26 -2
- package/dist/cjs/managers/storage.manager.js +67 -34
- package/dist/cjs/managers/tags.manager.d.ts +31 -7
- package/dist/cjs/managers/tags.manager.js +123 -241
- package/dist/cjs/managers/user.manager.d.ts +14 -5
- package/dist/cjs/managers/user.manager.js +17 -9
- package/dist/cjs/public-api.d.ts +10 -1
- package/dist/cjs/public-api.js +18 -24
- package/dist/cjs/test-bridge.d.ts +48 -0
- package/dist/cjs/test-bridge.js +110 -0
- package/dist/cjs/types/api.types.d.ts +21 -6
- package/dist/cjs/types/api.types.js +21 -6
- package/dist/cjs/types/config.types.d.ts +22 -84
- package/dist/cjs/types/emitter.types.d.ts +11 -0
- package/dist/cjs/types/emitter.types.js +8 -0
- package/dist/cjs/types/event.types.d.ts +8 -11
- package/dist/cjs/types/index.d.ts +3 -1
- package/dist/cjs/types/index.js +3 -1
- package/dist/cjs/types/queue.types.d.ts +1 -0
- package/dist/cjs/types/session.types.d.ts +0 -64
- package/dist/cjs/types/state.types.d.ts +1 -0
- package/dist/cjs/types/test-bridge.types.d.ts +38 -0
- package/dist/cjs/types/validation-error.types.d.ts +7 -0
- package/dist/cjs/types/validation-error.types.js +11 -1
- package/dist/cjs/types/window.types.d.ts +1 -8
- package/dist/cjs/utils/data/uuid.utils.d.ts +1 -1
- package/dist/cjs/utils/data/uuid.utils.js +7 -5
- package/dist/cjs/utils/emitter.utils.d.ts +8 -0
- package/dist/cjs/utils/emitter.utils.js +33 -0
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/logging/debug-logger.utils.d.ts +10 -51
- package/dist/cjs/utils/logging/debug-logger.utils.js +36 -127
- package/dist/cjs/utils/network/fetch-with-timeout.utils.d.ts +4 -0
- package/dist/cjs/utils/network/fetch-with-timeout.utils.js +25 -0
- package/dist/cjs/utils/network/index.d.ts +1 -0
- package/dist/cjs/utils/network/index.js +1 -0
- package/dist/cjs/utils/network/url.utils.js +2 -42
- package/dist/cjs/utils/security/sanitize.utils.d.ts +1 -8
- package/dist/cjs/utils/security/sanitize.utils.js +7 -41
- package/dist/cjs/utils/validations/config-validations.utils.d.ts +7 -0
- package/dist/cjs/utils/validations/config-validations.utils.js +77 -22
- package/dist/esm/api.d.ts +33 -19
- package/dist/esm/api.js +105 -118
- package/dist/esm/app.constants.d.ts +80 -1
- package/dist/esm/app.constants.js +89 -1
- package/dist/esm/app.d.ts +29 -44
- package/dist/esm/app.js +115 -213
- package/dist/esm/app.types.d.ts +2 -7
- package/dist/esm/app.types.js +1 -7
- package/dist/esm/constants/api.constants.js +10 -4
- package/dist/esm/constants/config.constants.d.ts +75 -0
- package/dist/esm/constants/config.constants.js +174 -0
- package/dist/esm/constants/error.constants.d.ts +29 -0
- package/dist/esm/constants/error.constants.js +47 -0
- package/dist/esm/constants/index.d.ts +3 -6
- package/dist/esm/constants/index.js +3 -6
- package/dist/esm/constants/performance.constants.d.ts +28 -0
- package/dist/esm/constants/performance.constants.js +40 -0
- package/dist/esm/handlers/click.handler.d.ts +1 -0
- package/dist/esm/handlers/click.handler.js +30 -49
- package/dist/esm/handlers/error.handler.d.ts +11 -6
- package/dist/esm/handlers/error.handler.js +91 -51
- package/dist/esm/handlers/page-view.handler.js +38 -29
- package/dist/esm/handlers/performance.handler.d.ts +3 -0
- package/dist/esm/handlers/performance.handler.js +71 -32
- package/dist/esm/handlers/scroll.handler.d.ts +15 -0
- package/dist/esm/handlers/scroll.handler.js +106 -32
- package/dist/esm/handlers/session.handler.d.ts +6 -20
- package/dist/esm/handlers/session.handler.js +38 -326
- package/dist/esm/integrations/google-analytics.integration.d.ts +0 -1
- package/dist/esm/integrations/google-analytics.integration.js +27 -98
- package/dist/esm/listeners/input-listener-managers.d.ts +18 -9
- package/dist/esm/listeners/input-listener-managers.js +23 -32
- package/dist/esm/listeners/touch-listener-manager.d.ts +1 -3
- package/dist/esm/listeners/touch-listener-manager.js +1 -23
- package/dist/esm/listeners/visibility-listener-manager.d.ts +1 -4
- package/dist/esm/listeners/visibility-listener-manager.js +6 -42
- package/dist/esm/managers/api.manager.d.ts +13 -3
- package/dist/esm/managers/api.manager.js +34 -3
- package/dist/esm/managers/config.manager.d.ts +53 -3
- package/dist/esm/managers/config.manager.js +133 -64
- package/dist/esm/managers/event.manager.d.ts +57 -36
- package/dist/esm/managers/event.manager.js +268 -419
- package/dist/esm/managers/sender.manager.d.ts +40 -22
- package/dist/esm/managers/sender.manager.js +201 -199
- package/dist/esm/managers/session.manager.d.ts +80 -66
- package/dist/esm/managers/session.manager.js +269 -524
- package/dist/esm/managers/state.manager.d.ts +33 -0
- package/dist/esm/managers/state.manager.js +78 -6
- package/dist/esm/managers/storage.manager.d.ts +26 -2
- package/dist/esm/managers/storage.manager.js +66 -33
- package/dist/esm/managers/tags.manager.d.ts +31 -7
- package/dist/esm/managers/tags.manager.js +124 -242
- package/dist/esm/managers/user.manager.d.ts +14 -5
- package/dist/esm/managers/user.manager.js +17 -9
- package/dist/esm/public-api.d.ts +10 -1
- package/dist/esm/public-api.js +14 -1
- package/dist/esm/test-bridge.d.ts +48 -0
- package/dist/esm/test-bridge.js +106 -0
- package/dist/esm/types/api.types.d.ts +21 -6
- package/dist/esm/types/api.types.js +21 -6
- package/dist/esm/types/config.types.d.ts +22 -84
- package/dist/esm/types/emitter.types.d.ts +11 -0
- package/dist/esm/types/emitter.types.js +5 -0
- package/dist/esm/types/event.types.d.ts +8 -11
- package/dist/esm/types/index.d.ts +3 -1
- package/dist/esm/types/index.js +3 -1
- package/dist/esm/types/queue.types.d.ts +1 -0
- package/dist/esm/types/session.types.d.ts +0 -64
- package/dist/esm/types/state.types.d.ts +1 -0
- package/dist/esm/types/test-bridge.types.d.ts +38 -0
- package/dist/esm/types/validation-error.types.d.ts +7 -0
- package/dist/esm/types/validation-error.types.js +9 -0
- package/dist/esm/types/window.types.d.ts +1 -8
- package/dist/esm/utils/data/uuid.utils.d.ts +1 -1
- package/dist/esm/utils/data/uuid.utils.js +7 -5
- package/dist/esm/utils/emitter.utils.d.ts +8 -0
- package/dist/esm/utils/emitter.utils.js +29 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/logging/debug-logger.utils.d.ts +10 -51
- package/dist/esm/utils/logging/debug-logger.utils.js +36 -127
- package/dist/esm/utils/network/fetch-with-timeout.utils.d.ts +4 -0
- package/dist/esm/utils/network/fetch-with-timeout.utils.js +22 -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.js +2 -42
- package/dist/esm/utils/security/sanitize.utils.d.ts +1 -8
- package/dist/esm/utils/security/sanitize.utils.js +6 -39
- package/dist/esm/utils/validations/config-validations.utils.d.ts +7 -0
- package/dist/esm/utils/validations/config-validations.utils.js +76 -22
- package/package.json +23 -16
- package/dist/browser/web-vitals-CCnqwnC8.mjs +0 -198
- package/dist/cjs/constants/browser.constants.d.ts +0 -3
- package/dist/cjs/constants/browser.constants.js +0 -41
- package/dist/cjs/constants/initialization.constants.d.ts +0 -40
- package/dist/cjs/constants/initialization.constants.js +0 -48
- package/dist/cjs/constants/limits.constants.d.ts +0 -25
- package/dist/cjs/constants/limits.constants.js +0 -40
- package/dist/cjs/constants/security.constants.d.ts +0 -1
- package/dist/cjs/constants/security.constants.js +0 -12
- package/dist/cjs/constants/timing.constants.d.ts +0 -22
- package/dist/cjs/constants/timing.constants.js +0 -34
- package/dist/cjs/constants/validation.constants.d.ts +0 -13
- package/dist/cjs/constants/validation.constants.js +0 -31
- package/dist/cjs/handlers/network.handler.d.ts +0 -16
- package/dist/cjs/handlers/network.handler.js +0 -136
- package/dist/cjs/managers/cross-tab-session.manager.d.ts +0 -170
- package/dist/cjs/managers/cross-tab-session.manager.js +0 -730
- package/dist/cjs/managers/sampling.manager.d.ts +0 -8
- package/dist/cjs/managers/sampling.manager.js +0 -53
- package/dist/cjs/managers/session-recovery.manager.d.ts +0 -65
- package/dist/cjs/managers/session-recovery.manager.js +0 -237
- package/dist/cjs/types/web-vitals.types.d.ts +0 -6
- package/dist/esm/constants/browser.constants.d.ts +0 -3
- package/dist/esm/constants/browser.constants.js +0 -38
- package/dist/esm/constants/initialization.constants.d.ts +0 -40
- package/dist/esm/constants/initialization.constants.js +0 -45
- package/dist/esm/constants/limits.constants.d.ts +0 -25
- package/dist/esm/constants/limits.constants.js +0 -37
- package/dist/esm/constants/security.constants.d.ts +0 -1
- package/dist/esm/constants/security.constants.js +0 -9
- package/dist/esm/constants/timing.constants.d.ts +0 -22
- package/dist/esm/constants/timing.constants.js +0 -31
- package/dist/esm/constants/validation.constants.d.ts +0 -13
- package/dist/esm/constants/validation.constants.js +0 -28
- package/dist/esm/handlers/network.handler.d.ts +0 -16
- package/dist/esm/handlers/network.handler.js +0 -132
- package/dist/esm/managers/cross-tab-session.manager.d.ts +0 -170
- package/dist/esm/managers/cross-tab-session.manager.js +0 -726
- package/dist/esm/managers/sampling.manager.d.ts +0 -8
- package/dist/esm/managers/sampling.manager.js +0 -49
- package/dist/esm/managers/session-recovery.manager.d.ts +0 -65
- package/dist/esm/managers/session-recovery.manager.js +0 -233
- package/dist/esm/types/web-vitals.types.d.ts +0 -6
- /package/dist/cjs/types/{web-vitals.types.js → test-bridge.types.js} +0 -0
- /package/dist/esm/types/{web-vitals.types.js → test-bridge.types.js} +0 -0
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
var P, R = -1, h = function(e) {
|
|
2
|
-
addEventListener("pageshow", function(t) {
|
|
3
|
-
t.persisted && (R = t.timeStamp, e(t));
|
|
4
|
-
}, !0);
|
|
5
|
-
}, S = function() {
|
|
6
|
-
var e = self.performance && performance.getEntriesByType && performance.getEntriesByType("navigation")[0];
|
|
7
|
-
if (e && e.responseStart > 0 && e.responseStart < performance.now()) return e;
|
|
8
|
-
}, y = function() {
|
|
9
|
-
var e = S();
|
|
10
|
-
return e && e.activationStart || 0;
|
|
11
|
-
}, d = function(e, t) {
|
|
12
|
-
var n = S(), i = "navigate";
|
|
13
|
-
return R >= 0 ? i = "back-forward-cache" : n && (document.prerendering || y() > 0 ? i = "prerender" : document.wasDiscarded ? i = "restore" : n.type && (i = n.type.replace(/_/g, "-"))), { name: e, value: t === void 0 ? -1 : t, rating: "good", delta: 0, entries: [], id: "v4-".concat(Date.now(), "-").concat(Math.floor(8999999999999 * Math.random()) + 1e12), navigationType: i };
|
|
14
|
-
}, p = function(e, t, n) {
|
|
15
|
-
try {
|
|
16
|
-
if (PerformanceObserver.supportedEntryTypes.includes(e)) {
|
|
17
|
-
var i = new PerformanceObserver(function(r) {
|
|
18
|
-
Promise.resolve().then(function() {
|
|
19
|
-
t(r.getEntries());
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
return i.observe(Object.assign({ type: e, buffered: !0 }, n || {})), i;
|
|
23
|
-
}
|
|
24
|
-
} catch {
|
|
25
|
-
}
|
|
26
|
-
}, l = function(e, t, n, i) {
|
|
27
|
-
var r, o;
|
|
28
|
-
return function(u) {
|
|
29
|
-
t.value >= 0 && (u || i) && ((o = t.value - (r || 0)) || r === void 0) && (r = t.value, t.delta = o, t.rating = function(c, a) {
|
|
30
|
-
return c > a[1] ? "poor" : c > a[0] ? "needs-improvement" : "good";
|
|
31
|
-
}(t.value, n), e(t));
|
|
32
|
-
};
|
|
33
|
-
}, A = function(e) {
|
|
34
|
-
requestAnimationFrame(function() {
|
|
35
|
-
return requestAnimationFrame(function() {
|
|
36
|
-
return e();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
}, C = function(e) {
|
|
40
|
-
document.addEventListener("visibilitychange", function() {
|
|
41
|
-
document.visibilityState === "hidden" && e();
|
|
42
|
-
});
|
|
43
|
-
}, I = function(e) {
|
|
44
|
-
var t = !1;
|
|
45
|
-
return function() {
|
|
46
|
-
t || (e(), t = !0);
|
|
47
|
-
};
|
|
48
|
-
}, v = -1, w = function() {
|
|
49
|
-
return document.visibilityState !== "hidden" || document.prerendering ? 1 / 0 : 0;
|
|
50
|
-
}, T = function(e) {
|
|
51
|
-
document.visibilityState === "hidden" && v > -1 && (v = e.type === "visibilitychange" ? e.timeStamp : 0, G());
|
|
52
|
-
}, F = function() {
|
|
53
|
-
addEventListener("visibilitychange", T, !0), addEventListener("prerenderingchange", T, !0);
|
|
54
|
-
}, G = function() {
|
|
55
|
-
removeEventListener("visibilitychange", T, !0), removeEventListener("prerenderingchange", T, !0);
|
|
56
|
-
}, q = function() {
|
|
57
|
-
return v < 0 && (v = w(), F(), h(function() {
|
|
58
|
-
setTimeout(function() {
|
|
59
|
-
v = w(), F();
|
|
60
|
-
}, 0);
|
|
61
|
-
})), { get firstHiddenTime() {
|
|
62
|
-
return v;
|
|
63
|
-
} };
|
|
64
|
-
}, E = function(e) {
|
|
65
|
-
document.prerendering ? addEventListener("prerenderingchange", function() {
|
|
66
|
-
return e();
|
|
67
|
-
}, !0) : e();
|
|
68
|
-
}, M = [1800, 3e3], J = function(e, t) {
|
|
69
|
-
t = t || {}, E(function() {
|
|
70
|
-
var n, i = q(), r = d("FCP"), o = p("paint", function(u) {
|
|
71
|
-
u.forEach(function(c) {
|
|
72
|
-
c.name === "first-contentful-paint" && (o.disconnect(), c.startTime < i.firstHiddenTime && (r.value = Math.max(c.startTime - y(), 0), r.entries.push(c), n(!0)));
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
o && (n = l(e, r, M, t.reportAllChanges), h(function(u) {
|
|
76
|
-
r = d("FCP"), n = l(e, r, M, t.reportAllChanges), A(function() {
|
|
77
|
-
r.value = performance.now() - u.timeStamp, n(!0);
|
|
78
|
-
});
|
|
79
|
-
}));
|
|
80
|
-
});
|
|
81
|
-
}, k = [0.1, 0.25], Y = function(e, t) {
|
|
82
|
-
t = t || {}, J(I(function() {
|
|
83
|
-
var n, i = d("CLS", 0), r = 0, o = [], u = function(a) {
|
|
84
|
-
a.forEach(function(s) {
|
|
85
|
-
if (!s.hadRecentInput) {
|
|
86
|
-
var _ = o[0], z = o[o.length - 1];
|
|
87
|
-
r && s.startTime - z.startTime < 1e3 && s.startTime - _.startTime < 5e3 ? (r += s.value, o.push(s)) : (r = s.value, o = [s]);
|
|
88
|
-
}
|
|
89
|
-
}), r > i.value && (i.value = r, i.entries = o, n());
|
|
90
|
-
}, c = p("layout-shift", u);
|
|
91
|
-
c && (n = l(e, i, k, t.reportAllChanges), C(function() {
|
|
92
|
-
u(c.takeRecords()), n(!0);
|
|
93
|
-
}), h(function() {
|
|
94
|
-
r = 0, i = d("CLS", 0), n = l(e, i, k, t.reportAllChanges), A(function() {
|
|
95
|
-
return n();
|
|
96
|
-
});
|
|
97
|
-
}), setTimeout(n, 0));
|
|
98
|
-
}));
|
|
99
|
-
}, H = 0, b = 1 / 0, m = 0, K = function(e) {
|
|
100
|
-
e.forEach(function(t) {
|
|
101
|
-
t.interactionId && (b = Math.min(b, t.interactionId), m = Math.max(m, t.interactionId), H = m ? (m - b) / 7 + 1 : 0);
|
|
102
|
-
});
|
|
103
|
-
}, O = function() {
|
|
104
|
-
return P ? H : performance.interactionCount || 0;
|
|
105
|
-
}, Q = function() {
|
|
106
|
-
"interactionCount" in performance || P || (P = p("event", K, { type: "event", buffered: !0, durationThreshold: 0 }));
|
|
107
|
-
}, f = [], g = /* @__PURE__ */ new Map(), D = 0, U = function() {
|
|
108
|
-
var e = Math.min(f.length - 1, Math.floor((O() - D) / 50));
|
|
109
|
-
return f[e];
|
|
110
|
-
}, V = [], W = function(e) {
|
|
111
|
-
if (V.forEach(function(r) {
|
|
112
|
-
return r(e);
|
|
113
|
-
}), e.interactionId || e.entryType === "first-input") {
|
|
114
|
-
var t = f[f.length - 1], n = g.get(e.interactionId);
|
|
115
|
-
if (n || f.length < 10 || e.duration > t.latency) {
|
|
116
|
-
if (n) e.duration > n.latency ? (n.entries = [e], n.latency = e.duration) : e.duration === n.latency && e.startTime === n.entries[0].startTime && n.entries.push(e);
|
|
117
|
-
else {
|
|
118
|
-
var i = { id: e.interactionId, latency: e.duration, entries: [e] };
|
|
119
|
-
g.set(i.id, i), f.push(i);
|
|
120
|
-
}
|
|
121
|
-
f.sort(function(r, o) {
|
|
122
|
-
return o.latency - r.latency;
|
|
123
|
-
}), f.length > 10 && f.splice(10).forEach(function(r) {
|
|
124
|
-
return g.delete(r.id);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}, j = function(e) {
|
|
129
|
-
var t = self.requestIdleCallback || self.setTimeout, n = -1;
|
|
130
|
-
return e = I(e), document.visibilityState === "hidden" ? e() : (n = t(e), C(e)), n;
|
|
131
|
-
}, B = [200, 500], Z = function(e, t) {
|
|
132
|
-
"PerformanceEventTiming" in self && "interactionId" in PerformanceEventTiming.prototype && (t = t || {}, E(function() {
|
|
133
|
-
var n;
|
|
134
|
-
Q();
|
|
135
|
-
var i, r = d("INP"), o = function(c) {
|
|
136
|
-
j(function() {
|
|
137
|
-
c.forEach(W);
|
|
138
|
-
var a = U();
|
|
139
|
-
a && a.latency !== r.value && (r.value = a.latency, r.entries = a.entries, i());
|
|
140
|
-
});
|
|
141
|
-
}, u = p("event", o, { durationThreshold: (n = t.durationThreshold) !== null && n !== void 0 ? n : 40 });
|
|
142
|
-
i = l(e, r, B, t.reportAllChanges), u && (u.observe({ type: "first-input", buffered: !0 }), C(function() {
|
|
143
|
-
o(u.takeRecords()), i(!0);
|
|
144
|
-
}), h(function() {
|
|
145
|
-
D = O(), f.length = 0, g.clear(), r = d("INP"), i = l(e, r, B, t.reportAllChanges);
|
|
146
|
-
}));
|
|
147
|
-
}));
|
|
148
|
-
}, x = [2500, 4e3], L = {}, $ = function(e, t) {
|
|
149
|
-
t = t || {}, E(function() {
|
|
150
|
-
var n, i = q(), r = d("LCP"), o = function(a) {
|
|
151
|
-
t.reportAllChanges || (a = a.slice(-1)), a.forEach(function(s) {
|
|
152
|
-
s.startTime < i.firstHiddenTime && (r.value = Math.max(s.startTime - y(), 0), r.entries = [s], n());
|
|
153
|
-
});
|
|
154
|
-
}, u = p("largest-contentful-paint", o);
|
|
155
|
-
if (u) {
|
|
156
|
-
n = l(e, r, x, t.reportAllChanges);
|
|
157
|
-
var c = I(function() {
|
|
158
|
-
L[r.id] || (o(u.takeRecords()), u.disconnect(), L[r.id] = !0, n(!0));
|
|
159
|
-
});
|
|
160
|
-
["keydown", "click"].forEach(function(a) {
|
|
161
|
-
addEventListener(a, function() {
|
|
162
|
-
return j(c);
|
|
163
|
-
}, { once: !0, capture: !0 });
|
|
164
|
-
}), C(c), h(function(a) {
|
|
165
|
-
r = d("LCP"), n = l(e, r, x, t.reportAllChanges), A(function() {
|
|
166
|
-
r.value = performance.now() - a.timeStamp, L[r.id] = !0, n(!0);
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
}, N = [800, 1800], X = function e(t) {
|
|
172
|
-
document.prerendering ? E(function() {
|
|
173
|
-
return e(t);
|
|
174
|
-
}) : document.readyState !== "complete" ? addEventListener("load", function() {
|
|
175
|
-
return e(t);
|
|
176
|
-
}, !0) : setTimeout(t, 0);
|
|
177
|
-
}, ee = function(e, t) {
|
|
178
|
-
t = t || {};
|
|
179
|
-
var n = d("TTFB"), i = l(e, n, N, t.reportAllChanges);
|
|
180
|
-
X(function() {
|
|
181
|
-
var r = S();
|
|
182
|
-
r && (n.value = Math.max(r.responseStart - y(), 0), n.entries = [r], i(!0), h(function() {
|
|
183
|
-
n = d("TTFB", 0), (i = l(e, n, N, t.reportAllChanges))(!0);
|
|
184
|
-
}));
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
export {
|
|
188
|
-
k as CLSThresholds,
|
|
189
|
-
M as FCPThresholds,
|
|
190
|
-
B as INPThresholds,
|
|
191
|
-
x as LCPThresholds,
|
|
192
|
-
N as TTFBThresholds,
|
|
193
|
-
Y as onCLS,
|
|
194
|
-
J as onFCP,
|
|
195
|
-
Z as onINP,
|
|
196
|
-
$ as onLCP,
|
|
197
|
-
ee as onTTFB
|
|
198
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const HTML_DATA_ATTR_PREFIX = "data-tl";
|
|
2
|
-
export declare const INTERACTIVE_SELECTORS: readonly ["button", "a", "input[type=\"button\"]", "input[type=\"submit\"]", "input[type=\"reset\"]", "input[type=\"checkbox\"]", "input[type=\"radio\"]", "select", "textarea", "[role=\"button\"]", "[role=\"link\"]", "[role=\"tab\"]", "[role=\"menuitem\"]", "[role=\"option\"]", "[role=\"checkbox\"]", "[role=\"radio\"]", "[role=\"switch\"]", "[routerLink]", "[ng-click]", "[data-action]", "[data-click]", "[data-navigate]", "[data-toggle]", "[onclick]", ".btn", ".button", ".clickable", ".nav-link", ".menu-item", "[data-testid]", "[tabindex=\"0\"]"];
|
|
3
|
-
export declare const UTM_PARAMS: string[];
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UTM_PARAMS = exports.INTERACTIVE_SELECTORS = exports.HTML_DATA_ATTR_PREFIX = void 0;
|
|
4
|
-
// Click tracking constants
|
|
5
|
-
exports.HTML_DATA_ATTR_PREFIX = 'data-tl';
|
|
6
|
-
// Interactive element selectors for click tracking
|
|
7
|
-
exports.INTERACTIVE_SELECTORS = [
|
|
8
|
-
'button',
|
|
9
|
-
'a',
|
|
10
|
-
'input[type="button"]',
|
|
11
|
-
'input[type="submit"]',
|
|
12
|
-
'input[type="reset"]',
|
|
13
|
-
'input[type="checkbox"]',
|
|
14
|
-
'input[type="radio"]',
|
|
15
|
-
'select',
|
|
16
|
-
'textarea',
|
|
17
|
-
'[role="button"]',
|
|
18
|
-
'[role="link"]',
|
|
19
|
-
'[role="tab"]',
|
|
20
|
-
'[role="menuitem"]',
|
|
21
|
-
'[role="option"]',
|
|
22
|
-
'[role="checkbox"]',
|
|
23
|
-
'[role="radio"]',
|
|
24
|
-
'[role="switch"]',
|
|
25
|
-
'[routerLink]',
|
|
26
|
-
'[ng-click]',
|
|
27
|
-
'[data-action]',
|
|
28
|
-
'[data-click]',
|
|
29
|
-
'[data-navigate]',
|
|
30
|
-
'[data-toggle]',
|
|
31
|
-
'[onclick]',
|
|
32
|
-
'.btn',
|
|
33
|
-
'.button',
|
|
34
|
-
'.clickable',
|
|
35
|
-
'.nav-link',
|
|
36
|
-
'.menu-item',
|
|
37
|
-
'[data-testid]',
|
|
38
|
-
'[tabindex="0"]',
|
|
39
|
-
];
|
|
40
|
-
// UTM parameters for tracking
|
|
41
|
-
exports.UTM_PARAMS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'];
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constants for initialization and reliability patterns
|
|
3
|
-
* These values control initialization behavior, retry logic, and circuit breaker patterns
|
|
4
|
-
*/
|
|
5
|
-
export declare const INITIALIZATION_CONSTANTS: {
|
|
6
|
-
/** Maximum number of retries when waiting for concurrent initialization */
|
|
7
|
-
readonly MAX_CONCURRENT_RETRIES: 20;
|
|
8
|
-
/** Delay between retries when waiting for concurrent initialization (ms) */
|
|
9
|
-
readonly CONCURRENT_RETRY_DELAY_MS: 50;
|
|
10
|
-
/** Timeout for overall initialization process (ms) */
|
|
11
|
-
readonly INITIALIZATION_TIMEOUT_MS: 10000;
|
|
12
|
-
};
|
|
13
|
-
export declare const CIRCUIT_BREAKER_CONSTANTS: {
|
|
14
|
-
/** Maximum number of consecutive failures before opening circuit */
|
|
15
|
-
readonly MAX_FAILURES: 10;
|
|
16
|
-
/** Initial backoff delay when circuit opens (ms) */
|
|
17
|
-
readonly INITIAL_BACKOFF_DELAY_MS: 1000;
|
|
18
|
-
/** Maximum backoff delay (ms) */
|
|
19
|
-
readonly MAX_BACKOFF_DELAY_MS: 30000;
|
|
20
|
-
/** Backoff multiplier for exponential backoff */
|
|
21
|
-
readonly BACKOFF_MULTIPLIER: 2;
|
|
22
|
-
/** Time-based recovery period for circuit breaker (ms) */
|
|
23
|
-
readonly RECOVERY_TIME_MS: 30000;
|
|
24
|
-
};
|
|
25
|
-
export declare const SESSION_SYNC_CONSTANTS: {
|
|
26
|
-
/** Timeout for session synchronization operations (ms) */
|
|
27
|
-
readonly SYNC_TIMEOUT_MS: 2000;
|
|
28
|
-
/** Maximum retry attempts for session operations */
|
|
29
|
-
readonly MAX_RETRY_ATTEMPTS: 3;
|
|
30
|
-
/** Delay before cleanup operations (ms) */
|
|
31
|
-
readonly CLEANUP_DELAY_MS: 100;
|
|
32
|
-
};
|
|
33
|
-
export declare const CROSS_TAB_CONSTANTS: {
|
|
34
|
-
/** Flag to prevent concurrent cross-tab manager initialization */
|
|
35
|
-
readonly INITIALIZATION_LOCK_TIMEOUT_MS: 5000;
|
|
36
|
-
};
|
|
37
|
-
export declare const SCROLL_SUPPRESSION_CONSTANTS: {
|
|
38
|
-
/** Multiplier for scroll debounce time when suppressing scroll events */
|
|
39
|
-
readonly SUPPRESS_MULTIPLIER: 2;
|
|
40
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Constants for initialization and reliability patterns
|
|
4
|
-
* These values control initialization behavior, retry logic, and circuit breaker patterns
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.SCROLL_SUPPRESSION_CONSTANTS = exports.CROSS_TAB_CONSTANTS = exports.SESSION_SYNC_CONSTANTS = exports.CIRCUIT_BREAKER_CONSTANTS = exports.INITIALIZATION_CONSTANTS = void 0;
|
|
8
|
-
// Initialization retry constants
|
|
9
|
-
exports.INITIALIZATION_CONSTANTS = {
|
|
10
|
-
/** Maximum number of retries when waiting for concurrent initialization */
|
|
11
|
-
MAX_CONCURRENT_RETRIES: 20,
|
|
12
|
-
/** Delay between retries when waiting for concurrent initialization (ms) */
|
|
13
|
-
CONCURRENT_RETRY_DELAY_MS: 50,
|
|
14
|
-
/** Timeout for overall initialization process (ms) */
|
|
15
|
-
INITIALIZATION_TIMEOUT_MS: 10000,
|
|
16
|
-
};
|
|
17
|
-
// Circuit breaker constants
|
|
18
|
-
exports.CIRCUIT_BREAKER_CONSTANTS = {
|
|
19
|
-
/** Maximum number of consecutive failures before opening circuit */
|
|
20
|
-
MAX_FAILURES: 10,
|
|
21
|
-
/** Initial backoff delay when circuit opens (ms) */
|
|
22
|
-
INITIAL_BACKOFF_DELAY_MS: 1000,
|
|
23
|
-
/** Maximum backoff delay (ms) */
|
|
24
|
-
MAX_BACKOFF_DELAY_MS: 30000,
|
|
25
|
-
/** Backoff multiplier for exponential backoff */
|
|
26
|
-
BACKOFF_MULTIPLIER: 2,
|
|
27
|
-
/** Time-based recovery period for circuit breaker (ms) */
|
|
28
|
-
RECOVERY_TIME_MS: 30000, // 30 seconds
|
|
29
|
-
};
|
|
30
|
-
// Session management constants
|
|
31
|
-
exports.SESSION_SYNC_CONSTANTS = {
|
|
32
|
-
/** Timeout for session synchronization operations (ms) */
|
|
33
|
-
SYNC_TIMEOUT_MS: 2000,
|
|
34
|
-
/** Maximum retry attempts for session operations */
|
|
35
|
-
MAX_RETRY_ATTEMPTS: 3,
|
|
36
|
-
/** Delay before cleanup operations (ms) */
|
|
37
|
-
CLEANUP_DELAY_MS: 100,
|
|
38
|
-
};
|
|
39
|
-
// Cross-tab coordination constants
|
|
40
|
-
exports.CROSS_TAB_CONSTANTS = {
|
|
41
|
-
/** Flag to prevent concurrent cross-tab manager initialization */
|
|
42
|
-
INITIALIZATION_LOCK_TIMEOUT_MS: 5000,
|
|
43
|
-
};
|
|
44
|
-
// Scroll suppression constants
|
|
45
|
-
exports.SCROLL_SUPPRESSION_CONSTANTS = {
|
|
46
|
-
/** Multiplier for scroll debounce time when suppressing scroll events */
|
|
47
|
-
SUPPRESS_MULTIPLIER: 2,
|
|
48
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_MOTION_THRESHOLD = 2;
|
|
2
|
-
export declare const SIGNIFICANT_SCROLL_DELTA = 10;
|
|
3
|
-
export declare const DEFAULT_SAMPLING_RATE = 1;
|
|
4
|
-
export declare const MIN_SAMPLING_RATE = 0;
|
|
5
|
-
export declare const MAX_SAMPLING_RATE = 1;
|
|
6
|
-
export declare const BATCH_SIZE_THRESHOLD = 50;
|
|
7
|
-
export declare const MAX_EVENTS_QUEUE_LENGTH = 500;
|
|
8
|
-
export declare const MIN_SESSION_TIMEOUT_MS = 30000;
|
|
9
|
-
export declare const MAX_SESSION_TIMEOUT_MS = 86400000;
|
|
10
|
-
export declare const MAX_CUSTOM_EVENT_NAME_LENGTH = 120;
|
|
11
|
-
export declare const MAX_CUSTOM_EVENT_STRING_SIZE: number;
|
|
12
|
-
export declare const MAX_CUSTOM_EVENT_KEYS = 10;
|
|
13
|
-
export declare const MAX_CUSTOM_EVENT_ARRAY_SIZE = 10;
|
|
14
|
-
export declare const MAX_TEXT_LENGTH = 255;
|
|
15
|
-
export declare const MAX_STRING_LENGTH = 1000;
|
|
16
|
-
export declare const MAX_ARRAY_LENGTH = 100;
|
|
17
|
-
export declare const MAX_OBJECT_DEPTH = 3;
|
|
18
|
-
export declare const PRECISION_TWO_DECIMALS: 2;
|
|
19
|
-
export declare const PRECISION_FOUR_DECIMALS: 4;
|
|
20
|
-
export declare const WEB_VITALS_SAMPLING: 0.75;
|
|
21
|
-
export declare const WEB_VITALS_LONG_TASK_SAMPLING: 0.2;
|
|
22
|
-
export declare const SYNC_XHR_TIMEOUT_MS = 2000;
|
|
23
|
-
export declare const MAX_FINGERPRINTS = 1000;
|
|
24
|
-
export declare const FINGERPRINT_CLEANUP_MULTIPLIER = 10;
|
|
25
|
-
export declare const CLICK_COORDINATE_PRECISION = 10;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CLICK_COORDINATE_PRECISION = exports.FINGERPRINT_CLEANUP_MULTIPLIER = exports.MAX_FINGERPRINTS = exports.SYNC_XHR_TIMEOUT_MS = exports.WEB_VITALS_LONG_TASK_SAMPLING = exports.WEB_VITALS_SAMPLING = exports.PRECISION_FOUR_DECIMALS = exports.PRECISION_TWO_DECIMALS = exports.MAX_OBJECT_DEPTH = exports.MAX_ARRAY_LENGTH = exports.MAX_STRING_LENGTH = exports.MAX_TEXT_LENGTH = exports.MAX_CUSTOM_EVENT_ARRAY_SIZE = exports.MAX_CUSTOM_EVENT_KEYS = exports.MAX_CUSTOM_EVENT_STRING_SIZE = exports.MAX_CUSTOM_EVENT_NAME_LENGTH = exports.MAX_SESSION_TIMEOUT_MS = exports.MIN_SESSION_TIMEOUT_MS = exports.MAX_EVENTS_QUEUE_LENGTH = exports.BATCH_SIZE_THRESHOLD = exports.MAX_SAMPLING_RATE = exports.MIN_SAMPLING_RATE = exports.DEFAULT_SAMPLING_RATE = exports.SIGNIFICANT_SCROLL_DELTA = exports.DEFAULT_MOTION_THRESHOLD = void 0;
|
|
4
|
-
// Motion and interaction thresholds
|
|
5
|
-
exports.DEFAULT_MOTION_THRESHOLD = 2;
|
|
6
|
-
exports.SIGNIFICANT_SCROLL_DELTA = 10;
|
|
7
|
-
// Sampling and rate limits
|
|
8
|
-
exports.DEFAULT_SAMPLING_RATE = 1;
|
|
9
|
-
exports.MIN_SAMPLING_RATE = 0;
|
|
10
|
-
exports.MAX_SAMPLING_RATE = 1;
|
|
11
|
-
// Queue and batch limits
|
|
12
|
-
exports.BATCH_SIZE_THRESHOLD = 50;
|
|
13
|
-
exports.MAX_EVENTS_QUEUE_LENGTH = 500;
|
|
14
|
-
// Session timeout validation limits
|
|
15
|
-
exports.MIN_SESSION_TIMEOUT_MS = 30000; // 30 seconds minimum
|
|
16
|
-
exports.MAX_SESSION_TIMEOUT_MS = 86400000; // 24 hours maximum
|
|
17
|
-
// Custom event validation limits
|
|
18
|
-
exports.MAX_CUSTOM_EVENT_NAME_LENGTH = 120;
|
|
19
|
-
exports.MAX_CUSTOM_EVENT_STRING_SIZE = 8 * 1024; // 8KB
|
|
20
|
-
exports.MAX_CUSTOM_EVENT_KEYS = 10;
|
|
21
|
-
exports.MAX_CUSTOM_EVENT_ARRAY_SIZE = 10;
|
|
22
|
-
// Text content limits
|
|
23
|
-
exports.MAX_TEXT_LENGTH = 255; // For click tracking text content
|
|
24
|
-
// Data sanitization limits
|
|
25
|
-
exports.MAX_STRING_LENGTH = 1000;
|
|
26
|
-
exports.MAX_ARRAY_LENGTH = 100;
|
|
27
|
-
exports.MAX_OBJECT_DEPTH = 3;
|
|
28
|
-
// Precision for numeric metrics
|
|
29
|
-
exports.PRECISION_TWO_DECIMALS = 2;
|
|
30
|
-
exports.PRECISION_FOUR_DECIMALS = 4;
|
|
31
|
-
// Web vitals sampling
|
|
32
|
-
exports.WEB_VITALS_SAMPLING = 0.75;
|
|
33
|
-
exports.WEB_VITALS_LONG_TASK_SAMPLING = 0.2;
|
|
34
|
-
// Sync XHR timeout
|
|
35
|
-
exports.SYNC_XHR_TIMEOUT_MS = 2000; // 2 seconds
|
|
36
|
-
// Event fingerprint management
|
|
37
|
-
exports.MAX_FINGERPRINTS = 1000; // Maximum fingerprints stored before cleanup
|
|
38
|
-
exports.FINGERPRINT_CLEANUP_MULTIPLIER = 10; // Cleanup fingerprints older than 10x threshold
|
|
39
|
-
// Click coordinate precision
|
|
40
|
-
exports.CLICK_COORDINATE_PRECISION = 10; // Round click coordinates to nearest 10px
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const XSS_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.XSS_PATTERNS = void 0;
|
|
4
|
-
// XSS protection patterns
|
|
5
|
-
exports.XSS_PATTERNS = [
|
|
6
|
-
/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
|
7
|
-
/javascript:/gi,
|
|
8
|
-
/on\w+\s*=/gi,
|
|
9
|
-
/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,
|
|
10
|
-
/<embed\b[^>]*>/gi,
|
|
11
|
-
/<object\b[^<]*(?:(?!<\/object>)<[^<]*)*<\/object>/gi,
|
|
12
|
-
];
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_SESSION_TIMEOUT_MS: number;
|
|
2
|
-
export declare const SESSION_HEARTBEAT_INTERVAL_MS = 30000;
|
|
3
|
-
export declare const DEFAULT_THROTTLE_DELAY_MS = 1000;
|
|
4
|
-
export declare const SCROLL_DEBOUNCE_TIME_MS = 250;
|
|
5
|
-
export declare const DEFAULT_VISIBILITY_TIMEOUT_MS = 2000;
|
|
6
|
-
export declare const DUPLICATE_EVENT_THRESHOLD_MS = 1000;
|
|
7
|
-
export declare const EVENT_SENT_INTERVAL_MS = 10000;
|
|
8
|
-
export declare const EVENT_SENT_INTERVAL_TEST_MS = 2500;
|
|
9
|
-
export declare const RETRY_BACKOFF_INITIAL = 1000;
|
|
10
|
-
export declare const RETRY_BACKOFF_MAX = 30000;
|
|
11
|
-
export declare const RATE_LIMIT_INTERVAL = 1000;
|
|
12
|
-
export declare const EVENT_EXPIRY_HOURS = 24;
|
|
13
|
-
export declare const EVENT_PERSISTENCE_MAX_AGE_MS: number;
|
|
14
|
-
export declare const LONG_TASK_THROTTLE_MS = 1000;
|
|
15
|
-
export declare const SESSION_END_PRIORITY_DELAY_MS = 100;
|
|
16
|
-
export declare const TAB_HEARTBEAT_INTERVAL_MS = 5000;
|
|
17
|
-
export declare const TAB_ELECTION_TIMEOUT_MS = 2000;
|
|
18
|
-
export declare const TAB_CLEANUP_DELAY_MS = 1000;
|
|
19
|
-
export declare const SESSION_RECOVERY_WINDOW_MULTIPLIER = 2;
|
|
20
|
-
export declare const MAX_SESSION_RECOVERY_ATTEMPTS = 3;
|
|
21
|
-
export declare const MAX_SESSION_RECOVERY_WINDOW_MS: number;
|
|
22
|
-
export declare const MIN_SESSION_RECOVERY_WINDOW_MS: number;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MIN_SESSION_RECOVERY_WINDOW_MS = exports.MAX_SESSION_RECOVERY_WINDOW_MS = exports.MAX_SESSION_RECOVERY_ATTEMPTS = exports.SESSION_RECOVERY_WINDOW_MULTIPLIER = exports.TAB_CLEANUP_DELAY_MS = exports.TAB_ELECTION_TIMEOUT_MS = exports.TAB_HEARTBEAT_INTERVAL_MS = exports.SESSION_END_PRIORITY_DELAY_MS = exports.LONG_TASK_THROTTLE_MS = exports.EVENT_PERSISTENCE_MAX_AGE_MS = exports.EVENT_EXPIRY_HOURS = exports.RATE_LIMIT_INTERVAL = exports.RETRY_BACKOFF_MAX = exports.RETRY_BACKOFF_INITIAL = exports.EVENT_SENT_INTERVAL_TEST_MS = exports.EVENT_SENT_INTERVAL_MS = exports.DUPLICATE_EVENT_THRESHOLD_MS = exports.DEFAULT_VISIBILITY_TIMEOUT_MS = exports.SCROLL_DEBOUNCE_TIME_MS = exports.DEFAULT_THROTTLE_DELAY_MS = exports.SESSION_HEARTBEAT_INTERVAL_MS = exports.DEFAULT_SESSION_TIMEOUT_MS = void 0;
|
|
4
|
-
// Session and timeout constants
|
|
5
|
-
exports.DEFAULT_SESSION_TIMEOUT_MS = 15 * 60 * 1000;
|
|
6
|
-
exports.SESSION_HEARTBEAT_INTERVAL_MS = 30000;
|
|
7
|
-
// Throttling and debouncing constants
|
|
8
|
-
exports.DEFAULT_THROTTLE_DELAY_MS = 1000;
|
|
9
|
-
exports.SCROLL_DEBOUNCE_TIME_MS = 250;
|
|
10
|
-
exports.DEFAULT_VISIBILITY_TIMEOUT_MS = 2000;
|
|
11
|
-
exports.DUPLICATE_EVENT_THRESHOLD_MS = 1000;
|
|
12
|
-
// Event processing intervals
|
|
13
|
-
exports.EVENT_SENT_INTERVAL_MS = 10000;
|
|
14
|
-
exports.EVENT_SENT_INTERVAL_TEST_MS = 2500;
|
|
15
|
-
// Network timing
|
|
16
|
-
exports.RETRY_BACKOFF_INITIAL = 1000; // 1 second
|
|
17
|
-
exports.RETRY_BACKOFF_MAX = 30000; // 30 seconds
|
|
18
|
-
exports.RATE_LIMIT_INTERVAL = 1000; // 1 second
|
|
19
|
-
// Event expiry
|
|
20
|
-
exports.EVENT_EXPIRY_HOURS = 24;
|
|
21
|
-
exports.EVENT_PERSISTENCE_MAX_AGE_MS = 24 * 60 * 60 * 1000; // 24 hours
|
|
22
|
-
// Performance metrics
|
|
23
|
-
exports.LONG_TASK_THROTTLE_MS = exports.DEFAULT_THROTTLE_DELAY_MS;
|
|
24
|
-
// Session end coordination
|
|
25
|
-
exports.SESSION_END_PRIORITY_DELAY_MS = 100;
|
|
26
|
-
// Cross-tab session management
|
|
27
|
-
exports.TAB_HEARTBEAT_INTERVAL_MS = 5000; // 5 seconds
|
|
28
|
-
exports.TAB_ELECTION_TIMEOUT_MS = 2000; // 2 seconds
|
|
29
|
-
exports.TAB_CLEANUP_DELAY_MS = 1000; // 1 second
|
|
30
|
-
// Session recovery
|
|
31
|
-
exports.SESSION_RECOVERY_WINDOW_MULTIPLIER = 2; // 2x session timeout
|
|
32
|
-
exports.MAX_SESSION_RECOVERY_ATTEMPTS = 3;
|
|
33
|
-
exports.MAX_SESSION_RECOVERY_WINDOW_MS = 24 * 60 * 60 * 1000; // 24 hours max
|
|
34
|
-
exports.MIN_SESSION_RECOVERY_WINDOW_MS = 2 * 60 * 1000; // 2 minutes minimum
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ApiConfig } from '../types';
|
|
2
|
-
export declare const ALLOWED_API_CONFIG_KEYS: Set<keyof ApiConfig>;
|
|
3
|
-
export declare const VALIDATION_MESSAGES: {
|
|
4
|
-
readonly MISSING_PROJECT_ID: "Project ID is required";
|
|
5
|
-
readonly PROJECT_ID_EMPTY_AFTER_TRIM: "Project ID is required";
|
|
6
|
-
readonly INVALID_SESSION_TIMEOUT: "Session timeout must be between 30000ms (30 seconds) and 86400000ms (24 hours)";
|
|
7
|
-
readonly INVALID_SAMPLING_RATE: "Sampling rate must be between 0 and 1";
|
|
8
|
-
readonly INVALID_ERROR_SAMPLING_RATE: "Error sampling must be between 0 and 1";
|
|
9
|
-
readonly INVALID_GOOGLE_ANALYTICS_ID: "Google Analytics measurement ID is required when integration is enabled";
|
|
10
|
-
readonly INVALID_SCROLL_CONTAINER_SELECTORS: "Scroll container selectors must be valid CSS selectors";
|
|
11
|
-
readonly INVALID_GLOBAL_METADATA: "Global metadata must be an object";
|
|
12
|
-
readonly INVALID_SENSITIVE_QUERY_PARAMS: "Sensitive query params must be an array of strings";
|
|
13
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VALIDATION_MESSAGES = exports.ALLOWED_API_CONFIG_KEYS = void 0;
|
|
4
|
-
const limits_constants_1 = require("./limits.constants");
|
|
5
|
-
// Allowed API config keys for runtime validation
|
|
6
|
-
exports.ALLOWED_API_CONFIG_KEYS = new Set([
|
|
7
|
-
'mode',
|
|
8
|
-
'tags',
|
|
9
|
-
'samplingRate',
|
|
10
|
-
'excludedUrlPaths',
|
|
11
|
-
'ipExcluded',
|
|
12
|
-
]);
|
|
13
|
-
// Validation error messages - standardized across all layers
|
|
14
|
-
exports.VALIDATION_MESSAGES = {
|
|
15
|
-
// Project ID validation - consistent message across all layers
|
|
16
|
-
MISSING_PROJECT_ID: 'Project ID is required',
|
|
17
|
-
PROJECT_ID_EMPTY_AFTER_TRIM: 'Project ID is required',
|
|
18
|
-
// Session timeout validation
|
|
19
|
-
INVALID_SESSION_TIMEOUT: `Session timeout must be between ${limits_constants_1.MIN_SESSION_TIMEOUT_MS}ms (30 seconds) and ${limits_constants_1.MAX_SESSION_TIMEOUT_MS}ms (24 hours)`,
|
|
20
|
-
// Sampling rate validation
|
|
21
|
-
INVALID_SAMPLING_RATE: `Sampling rate must be between ${limits_constants_1.MIN_SAMPLING_RATE} and ${limits_constants_1.MAX_SAMPLING_RATE}`,
|
|
22
|
-
INVALID_ERROR_SAMPLING_RATE: 'Error sampling must be between 0 and 1',
|
|
23
|
-
// Integration validation
|
|
24
|
-
INVALID_GOOGLE_ANALYTICS_ID: 'Google Analytics measurement ID is required when integration is enabled',
|
|
25
|
-
// UI validation
|
|
26
|
-
INVALID_SCROLL_CONTAINER_SELECTORS: 'Scroll container selectors must be valid CSS selectors',
|
|
27
|
-
// Global metadata validation
|
|
28
|
-
INVALID_GLOBAL_METADATA: 'Global metadata must be an object',
|
|
29
|
-
// Array validation
|
|
30
|
-
INVALID_SENSITIVE_QUERY_PARAMS: 'Sensitive query params must be an array of strings',
|
|
31
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EventManager } from '../managers/event.manager';
|
|
2
|
-
import { StateManager } from '../managers/state.manager';
|
|
3
|
-
export declare class NetworkHandler extends StateManager {
|
|
4
|
-
private readonly eventManager;
|
|
5
|
-
private readonly originalFetch;
|
|
6
|
-
private readonly originalXHROpen;
|
|
7
|
-
private readonly originalXHRSend;
|
|
8
|
-
constructor(eventManager: EventManager);
|
|
9
|
-
startTracking(): void;
|
|
10
|
-
stopTracking(): void;
|
|
11
|
-
private interceptFetch;
|
|
12
|
-
private interceptXHR;
|
|
13
|
-
private trackNetworkError;
|
|
14
|
-
private normalizeUrlForTracking;
|
|
15
|
-
private shouldSample;
|
|
16
|
-
}
|