@openreplay/tracker 3.5.9 → 3.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/cjs/app/index.d.ts +24 -15
- package/cjs/app/index.js +25 -26
- package/cjs/app/observer/iframe_observer.js +2 -2
- package/cjs/app/observer/observer.js +13 -13
- package/cjs/app/observer/shadow_root_observer.js +2 -2
- package/cjs/app/observer/top_observer.js +2 -2
- package/cjs/app/session.js +3 -3
- package/cjs/{messages/index.d.ts → common/messages.d.ts} +2 -3
- package/cjs/{messages/index.js → common/messages.js} +0 -0
- package/cjs/common/types.d.ts +9 -0
- package/cjs/{messages/message.js → common/types.js} +0 -0
- package/cjs/common/webworker.d.ts +19 -0
- package/cjs/common/webworker.js +2 -0
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +6 -6
- package/cjs/modules/connection.js +2 -2
- package/cjs/modules/console.js +2 -2
- package/cjs/modules/cssrules.js +4 -4
- package/cjs/modules/exception.d.ts +1 -1
- package/cjs/modules/exception.js +4 -4
- package/cjs/modules/img.js +7 -7
- package/cjs/modules/input.js +5 -5
- package/cjs/modules/longtasks.js +2 -2
- package/cjs/modules/mouse.js +3 -3
- package/cjs/modules/performance.js +2 -2
- package/cjs/modules/scroll.js +3 -3
- package/cjs/modules/timing.js +15 -18
- package/cjs/modules/viewport.js +4 -4
- package/lib/app/index.d.ts +24 -15
- package/lib/app/index.js +21 -22
- package/lib/app/observer/iframe_observer.js +1 -1
- package/lib/app/observer/observer.js +1 -1
- package/lib/app/observer/shadow_root_observer.js +1 -1
- package/lib/app/observer/top_observer.js +1 -1
- package/lib/app/session.js +1 -1
- package/lib/{messages/index.d.ts → common/messages.d.ts} +2 -3
- package/lib/{messages/index.js → common/messages.js} +0 -0
- package/lib/common/tsconfig.tsbuildinfo +1 -0
- package/lib/common/types.d.ts +9 -0
- package/lib/{messages/message.js → common/types.js} +0 -0
- package/lib/common/webworker.d.ts +19 -0
- package/lib/common/webworker.js +1 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.js +3 -3
- package/lib/modules/connection.js +1 -1
- package/lib/modules/console.js +1 -1
- package/lib/modules/cssrules.js +1 -1
- package/lib/modules/exception.d.ts +1 -1
- package/lib/modules/exception.js +1 -1
- package/lib/modules/img.js +1 -1
- package/lib/modules/input.js +1 -1
- package/lib/modules/longtasks.js +1 -1
- package/lib/modules/mouse.js +1 -1
- package/lib/modules/performance.js +1 -1
- package/lib/modules/scroll.js +1 -1
- package/lib/modules/timing.js +13 -16
- package/lib/modules/viewport.js +1 -1
- package/package.json +1 -1
- package/cjs/messages/message.d.ts +0 -4
- package/cjs/messages/writer.d.ts +0 -15
- package/cjs/messages/writer.js +0 -115
- package/lib/messages/message.d.ts +0 -4
- package/lib/messages/tsconfig.tsbuildinfo +0 -1
- package/lib/messages/writer.d.ts +0 -15
- package/lib/messages/writer.js +0 -112
package/cjs/modules/img.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const utils_js_1 = require("../utils.js");
|
|
4
|
-
const
|
|
4
|
+
const messages_js_1 = require("../common/messages.js");
|
|
5
5
|
const PLACEHOLDER_SRC = "https://static.openreplay.com/tracker/placeholder.jpeg";
|
|
6
6
|
function default_1(app) {
|
|
7
7
|
function sendPlaceholder(id, node) {
|
|
8
|
-
app.send(new
|
|
8
|
+
app.send(new messages_js_1.SetNodeAttribute(id, "src", PLACEHOLDER_SRC));
|
|
9
9
|
const { width, height } = node.getBoundingClientRect();
|
|
10
10
|
if (!node.hasAttribute("width")) {
|
|
11
|
-
app.send(new
|
|
11
|
+
app.send(new messages_js_1.SetNodeAttribute(id, "width", String(width)));
|
|
12
12
|
}
|
|
13
13
|
if (!node.hasAttribute("height")) {
|
|
14
|
-
app.send(new
|
|
14
|
+
app.send(new messages_js_1.SetNodeAttribute(id, "height", String(height)));
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
const sendImgSrc = app.safe(function () {
|
|
@@ -25,14 +25,14 @@ function default_1(app) {
|
|
|
25
25
|
}
|
|
26
26
|
if (naturalWidth === 0 && naturalHeight === 0) {
|
|
27
27
|
if (src != null && (0, utils_js_1.isURL)(src)) { // TODO: How about relative urls ? Src type is null sometimes.
|
|
28
|
-
app.send(new
|
|
28
|
+
app.send(new messages_js_1.ResourceTiming((0, utils_js_1.timestamp)(), 0, 0, 0, 0, 0, src, 'img'));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
else if (src.length >= 1e5 || app.sanitizer.isMasked(id)) {
|
|
32
32
|
sendPlaceholder(id, this);
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
app.send(new
|
|
35
|
+
app.send(new messages_js_1.SetNodeAttributeURLBased(id, 'src', src, app.getBaseHref()));
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
const observer = new MutationObserver((mutations) => {
|
|
@@ -44,7 +44,7 @@ function default_1(app) {
|
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
const src = target.src;
|
|
47
|
-
app.send(new
|
|
47
|
+
app.send(new messages_js_1.SetNodeAttributeURLBased(id, 'src', src, app.getBaseHref()));
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
});
|
package/cjs/modules/input.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInputLabel = void 0;
|
|
4
4
|
const utils_js_1 = require("../utils.js");
|
|
5
|
-
const
|
|
5
|
+
const messages_js_1 = require("../common/messages.js");
|
|
6
6
|
function isTextEditable(node) {
|
|
7
7
|
if (node instanceof HTMLTextAreaElement) {
|
|
8
8
|
return true;
|
|
@@ -76,7 +76,7 @@ function default_1(app, opts) {
|
|
|
76
76
|
function sendInputTarget(id, node) {
|
|
77
77
|
const label = getInputLabel(node);
|
|
78
78
|
if (label !== '') {
|
|
79
|
-
app.send(new
|
|
79
|
+
app.send(new messages_js_1.SetInputTarget(id, label));
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
function sendInputValue(id, node) {
|
|
@@ -103,7 +103,7 @@ function default_1(app, opts) {
|
|
|
103
103
|
value = '';
|
|
104
104
|
break;
|
|
105
105
|
}
|
|
106
|
-
app.send(new
|
|
106
|
+
app.send(new messages_js_1.SetInputValue(id, value, mask));
|
|
107
107
|
}
|
|
108
108
|
const inputValues = new Map();
|
|
109
109
|
const checkableValues = new Map();
|
|
@@ -137,7 +137,7 @@ function default_1(app, opts) {
|
|
|
137
137
|
}
|
|
138
138
|
if (checked !== node.checked) {
|
|
139
139
|
checkableValues.set(id, node.checked);
|
|
140
|
-
app.send(new
|
|
140
|
+
app.send(new messages_js_1.SetInputChecked(id, node.checked));
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
});
|
|
@@ -161,7 +161,7 @@ function default_1(app, opts) {
|
|
|
161
161
|
}
|
|
162
162
|
if (isCheckable(node)) {
|
|
163
163
|
checkableValues.set(id, node.checked);
|
|
164
|
-
app.send(new
|
|
164
|
+
app.send(new messages_js_1.SetInputChecked(id, node.checked));
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
167
|
}));
|
package/cjs/modules/longtasks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const messages_js_1 = require("../common/messages.js");
|
|
4
4
|
;
|
|
5
5
|
;
|
|
6
6
|
function default_1(app) {
|
|
@@ -18,7 +18,7 @@ function default_1(app) {
|
|
|
18
18
|
id = container.containerId;
|
|
19
19
|
src = container.containerSrc;
|
|
20
20
|
}
|
|
21
|
-
app.send(new
|
|
21
|
+
app.send(new messages_js_1.LongTask(entry.startTime + performance.timing.navigationStart, entry.duration, Math.max(contexts.indexOf(entry.name), 0), Math.max(containerTypes.indexOf(type), 0), name, id, src));
|
|
22
22
|
}
|
|
23
23
|
const observer = new PerformanceObserver((list) => list.getEntries().forEach(longTask));
|
|
24
24
|
observer.observe({ entryTypes: ['longtask'] });
|
package/cjs/modules/mouse.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const utils_js_1 = require("../utils.js");
|
|
4
|
-
const
|
|
4
|
+
const messages_js_1 = require("../common/messages.js");
|
|
5
5
|
const input_js_1 = require("./input.js");
|
|
6
6
|
function _getSelector(target) {
|
|
7
7
|
let el = target;
|
|
@@ -105,7 +105,7 @@ function default_1(app) {
|
|
|
105
105
|
});
|
|
106
106
|
const sendMouseMove = () => {
|
|
107
107
|
if (mousePositionChanged) {
|
|
108
|
-
app.send(new
|
|
108
|
+
app.send(new messages_js_1.MouseMove(mousePositionX, mousePositionY));
|
|
109
109
|
mousePositionChanged = false;
|
|
110
110
|
}
|
|
111
111
|
};
|
|
@@ -133,7 +133,7 @@ function default_1(app) {
|
|
|
133
133
|
const id = app.nodes.getID(target);
|
|
134
134
|
if (id !== undefined) {
|
|
135
135
|
sendMouseMove();
|
|
136
|
-
app.send(new
|
|
136
|
+
app.send(new messages_js_1.MouseClick(id, mouseTarget === target
|
|
137
137
|
? Math.round(performance.now() - mouseTargetTime)
|
|
138
138
|
: 0, getTargetLabel(target), getSelector(id, target)), true);
|
|
139
139
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.jsHeapSizeLimit = exports.deviceMemory = void 0;
|
|
4
4
|
const utils_js_1 = require("../utils.js");
|
|
5
|
-
const
|
|
5
|
+
const messages_js_1 = require("../common/messages.js");
|
|
6
6
|
const perf = utils_js_1.IN_BROWSER && 'performance' in window && 'memory' in performance // works in Chrome only
|
|
7
7
|
? performance
|
|
8
8
|
: { memory: {} };
|
|
@@ -34,7 +34,7 @@ function default_1(app, opts) {
|
|
|
34
34
|
if (frames === undefined || ticks === undefined) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
app.send(new
|
|
37
|
+
app.send(new messages_js_1.PerformanceTrack(frames, ticks, perf.memory.totalJSHeapSize || 0, perf.memory.usedJSHeapSize || 0));
|
|
38
38
|
ticks = frames = document.hidden ? -1 : 0;
|
|
39
39
|
};
|
|
40
40
|
app.attachStartCallback(() => {
|
package/cjs/modules/scroll.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const messages_js_1 = require("../common/messages.js");
|
|
4
4
|
function default_1(app) {
|
|
5
5
|
let documentScroll = false;
|
|
6
6
|
const nodeScroll = new Map();
|
|
7
|
-
const sendSetViewportScroll = app.safe(() => app.send(new
|
|
7
|
+
const sendSetViewportScroll = app.safe(() => app.send(new messages_js_1.SetViewportScroll(window.pageXOffset ||
|
|
8
8
|
(document.documentElement && document.documentElement.scrollLeft) ||
|
|
9
9
|
(document.body && document.body.scrollLeft) ||
|
|
10
10
|
0, window.pageYOffset ||
|
|
@@ -14,7 +14,7 @@ function default_1(app) {
|
|
|
14
14
|
const sendSetNodeScroll = app.safe((s, node) => {
|
|
15
15
|
const id = app.nodes.getID(node);
|
|
16
16
|
if (id !== undefined) {
|
|
17
|
-
app.send(new
|
|
17
|
+
app.send(new messages_js_1.SetNodeScroll(id, s[0], s[1]));
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
app.attachStartCallback(sendSetViewportScroll);
|
package/cjs/modules/timing.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const utils_js_1 = require("../utils.js");
|
|
4
|
-
const
|
|
4
|
+
const messages_js_1 = require("../common/messages.js");
|
|
5
5
|
function getPaintBlocks(resources) {
|
|
6
6
|
const paintBlocks = [];
|
|
7
7
|
const elements = document.getElementsByTagName('*');
|
|
@@ -70,18 +70,6 @@ function default_1(app, opts) {
|
|
|
70
70
|
if (!options.captureResourceTimings) {
|
|
71
71
|
return;
|
|
72
72
|
} // Resources are necessary for all timings
|
|
73
|
-
const mQueue = [];
|
|
74
|
-
function sendOnStart(m) {
|
|
75
|
-
if (app.active()) {
|
|
76
|
-
app.send(m);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
mQueue.push(m);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
app.attachStartCallback(function () {
|
|
83
|
-
mQueue.forEach(m => app.send(m));
|
|
84
|
-
});
|
|
85
73
|
let resources = {};
|
|
86
74
|
function resourceTiming(entry) {
|
|
87
75
|
if (entry.duration < 0 || !(0, utils_js_1.isURL)(entry.name) || app.isServiceURL(entry.name))
|
|
@@ -89,15 +77,24 @@ function default_1(app, opts) {
|
|
|
89
77
|
if (resources !== null) {
|
|
90
78
|
resources[entry.name] = entry.startTime + entry.duration;
|
|
91
79
|
}
|
|
92
|
-
|
|
80
|
+
app.send(new messages_js_1.ResourceTiming(entry.startTime + performance.timing.navigationStart, entry.duration, entry.responseStart && entry.startTime
|
|
93
81
|
? entry.responseStart - entry.startTime
|
|
94
82
|
: 0, entry.transferSize > entry.encodedBodySize
|
|
95
83
|
? entry.transferSize - entry.encodedBodySize
|
|
96
84
|
: 0, entry.encodedBodySize || 0, entry.decodedBodySize || 0, entry.name, entry.initiatorType));
|
|
97
85
|
}
|
|
98
86
|
const observer = new PerformanceObserver((list) => list.getEntries().forEach(resourceTiming));
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
let prevSessionID;
|
|
88
|
+
app.attachStartCallback(function ({ sessionID }) {
|
|
89
|
+
if (sessionID !== prevSessionID) { // Send past page resources on a newly started session
|
|
90
|
+
performance.getEntriesByType('resource').forEach(resourceTiming);
|
|
91
|
+
prevSessionID = sessionID;
|
|
92
|
+
}
|
|
93
|
+
observer.observe({ entryTypes: ['resource'] });
|
|
94
|
+
});
|
|
95
|
+
app.attachStopCallback(function () {
|
|
96
|
+
observer.disconnect();
|
|
97
|
+
});
|
|
101
98
|
let firstPaint = 0, firstContentfulPaint = 0;
|
|
102
99
|
if (options.capturePageLoadTimings) {
|
|
103
100
|
let pageLoadTimingSent = false;
|
|
@@ -123,7 +120,7 @@ function default_1(app, opts) {
|
|
|
123
120
|
if (performance.timing.loadEventEnd || performance.now() > 30000) {
|
|
124
121
|
pageLoadTimingSent = true;
|
|
125
122
|
const { navigationStart, requestStart, responseStart, responseEnd, domContentLoadedEventStart, domContentLoadedEventEnd, loadEventStart, loadEventEnd, } = performance.timing;
|
|
126
|
-
app.send(new
|
|
123
|
+
app.send(new messages_js_1.PageLoadTiming(requestStart - navigationStart || 0, responseStart - navigationStart || 0, responseEnd - navigationStart || 0, domContentLoadedEventStart - navigationStart || 0, domContentLoadedEventEnd - navigationStart || 0, loadEventStart - navigationStart || 0, loadEventEnd - navigationStart || 0, firstPaint, firstContentfulPaint));
|
|
127
124
|
}
|
|
128
125
|
}, 30);
|
|
129
126
|
}
|
|
@@ -160,7 +157,7 @@ function default_1(app, opts) {
|
|
|
160
157
|
? Math.max(interactiveWindowStartTime, firstContentfulPaint, performance.timing.domContentLoadedEventEnd -
|
|
161
158
|
performance.timing.navigationStart || 0)
|
|
162
159
|
: 0;
|
|
163
|
-
app.send(new
|
|
160
|
+
app.send(new messages_js_1.PageRenderTiming(speedIndex, firstContentfulPaint > visuallyComplete
|
|
164
161
|
? firstContentfulPaint
|
|
165
162
|
: visuallyComplete, timeToInteractive));
|
|
166
163
|
}
|
package/cjs/modules/viewport.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const messages_js_1 = require("../common/messages.js");
|
|
4
4
|
function default_1(app) {
|
|
5
5
|
let url, width, height;
|
|
6
6
|
let navigationStart = performance.timing.navigationStart;
|
|
@@ -8,7 +8,7 @@ function default_1(app) {
|
|
|
8
8
|
const { URL } = document;
|
|
9
9
|
if (URL !== url) {
|
|
10
10
|
url = URL;
|
|
11
|
-
app.send(new
|
|
11
|
+
app.send(new messages_js_1.SetPageLocation(url, document.referrer, navigationStart));
|
|
12
12
|
navigationStart = 0;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
@@ -17,12 +17,12 @@ function default_1(app) {
|
|
|
17
17
|
if (innerWidth !== width || innerHeight !== height) {
|
|
18
18
|
width = innerWidth;
|
|
19
19
|
height = innerHeight;
|
|
20
|
-
app.send(new
|
|
20
|
+
app.send(new messages_js_1.SetViewportSize(width, height));
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const sendSetPageVisibility = document.hidden === undefined
|
|
24
24
|
? Function.prototype
|
|
25
|
-
: app.safe(() => app.send(new
|
|
25
|
+
: app.safe(() => app.send(new messages_js_1.SetPageVisibility(document.hidden)));
|
|
26
26
|
app.attachStartCallback(() => {
|
|
27
27
|
url = '';
|
|
28
28
|
width = height = -1;
|
package/lib/app/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Message from "../messages
|
|
1
|
+
import type Message from "../common/messages.js";
|
|
2
2
|
import Nodes from "./nodes.js";
|
|
3
3
|
import Sanitizer from "./sanitizer.js";
|
|
4
4
|
import Ticker from "./ticker.js";
|
|
@@ -7,17 +7,30 @@ import Session from "./session.js";
|
|
|
7
7
|
import type { Options as ObserverOptions } from "./observer/top_observer.js";
|
|
8
8
|
import type { Options as SanitizerOptions } from "./sanitizer.js";
|
|
9
9
|
import type { Options as LoggerOptions } from "./logger.js";
|
|
10
|
-
import type { Options as WebworkerOptions } from "
|
|
11
|
-
export interface OnStartInfo {
|
|
12
|
-
sessionID: string;
|
|
13
|
-
sessionToken: string;
|
|
14
|
-
userUUID: string;
|
|
15
|
-
}
|
|
10
|
+
import type { Options as WebworkerOptions } from "../common/webworker.js";
|
|
16
11
|
export interface StartOptions {
|
|
17
12
|
userID?: string;
|
|
18
13
|
metadata?: Record<string, string>;
|
|
19
14
|
forceNew?: boolean;
|
|
20
15
|
}
|
|
16
|
+
interface OnStartInfo {
|
|
17
|
+
sessionID: string;
|
|
18
|
+
sessionToken: string;
|
|
19
|
+
userUUID: string;
|
|
20
|
+
}
|
|
21
|
+
declare const CANCELED: "canceled";
|
|
22
|
+
declare type SuccessfulStart = OnStartInfo & {
|
|
23
|
+
success: true;
|
|
24
|
+
};
|
|
25
|
+
declare type UnsuccessfulStart = {
|
|
26
|
+
reason: typeof CANCELED | string;
|
|
27
|
+
success: false;
|
|
28
|
+
};
|
|
29
|
+
declare const UnsuccessfulStart: (reason: string) => UnsuccessfulStart;
|
|
30
|
+
declare const SuccessfulStart: (body: OnStartInfo) => SuccessfulStart;
|
|
31
|
+
export declare type StartPromiseReturn = SuccessfulStart | UnsuccessfulStart;
|
|
32
|
+
declare type StartCallback = (i: OnStartInfo) => void;
|
|
33
|
+
declare type CommitCallback = (messages: Array<Message>) => void;
|
|
21
34
|
declare type AppOptions = {
|
|
22
35
|
revID: string;
|
|
23
36
|
node_id: string;
|
|
@@ -31,12 +44,9 @@ declare type AppOptions = {
|
|
|
31
44
|
__is_snippet: boolean;
|
|
32
45
|
__debug_report_edp: string | null;
|
|
33
46
|
__debug__?: LoggerOptions;
|
|
34
|
-
onStart?:
|
|
47
|
+
onStart?: StartCallback;
|
|
35
48
|
} & WebworkerOptions;
|
|
36
49
|
export declare type Options = AppOptions & ObserverOptions & SanitizerOptions;
|
|
37
|
-
declare type Callback = () => void;
|
|
38
|
-
declare type CommitCallback = (messages: Array<Message>) => void;
|
|
39
|
-
export declare const CANCELED = "canceled";
|
|
40
50
|
export declare const DEFAULT_INGEST_POINT = "https://api.openreplay.com/ingest";
|
|
41
51
|
export default class App {
|
|
42
52
|
readonly nodes: Nodes;
|
|
@@ -58,13 +68,12 @@ export default class App {
|
|
|
58
68
|
private readonly worker?;
|
|
59
69
|
constructor(projectKey: string, sessionToken: string | null | undefined, options: Partial<Options>);
|
|
60
70
|
private _debug;
|
|
61
|
-
private readonly preStartMessages;
|
|
62
71
|
send(message: Message, urgent?: boolean): void;
|
|
63
72
|
private commit;
|
|
64
73
|
safe<T extends (...args: any[]) => void>(fn: T): T;
|
|
65
74
|
attachCommitCallback(cb: CommitCallback): void;
|
|
66
|
-
attachStartCallback(cb:
|
|
67
|
-
attachStopCallback(cb:
|
|
75
|
+
attachStartCallback(cb: StartCallback): void;
|
|
76
|
+
attachStopCallback(cb: Function): void;
|
|
68
77
|
attachEventListener(target: EventTarget, type: string, listener: EventListener, useSafe?: boolean, useCapture?: boolean): void;
|
|
69
78
|
checkRequiredVersion(version: string): boolean;
|
|
70
79
|
private getStartInfo;
|
|
@@ -89,7 +98,7 @@ export default class App {
|
|
|
89
98
|
active(): boolean;
|
|
90
99
|
resetNextPageSession(flag: boolean): void;
|
|
91
100
|
private _start;
|
|
92
|
-
start(options?: StartOptions): Promise<
|
|
101
|
+
start(options?: StartOptions): Promise<StartPromiseReturn>;
|
|
93
102
|
stop(): void;
|
|
94
103
|
}
|
|
95
104
|
export {};
|
package/lib/app/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Timestamp } from "../common/messages.js";
|
|
1
2
|
import { timestamp } from "../utils.js";
|
|
2
|
-
import { Timestamp } from "../messages/index.js";
|
|
3
3
|
import Nodes from "./nodes.js";
|
|
4
4
|
import Observer from "./observer/top_observer.js";
|
|
5
5
|
import Sanitizer from "./sanitizer.js";
|
|
@@ -7,13 +7,16 @@ import Ticker from "./ticker.js";
|
|
|
7
7
|
import Logger, { LogLevel } from "./logger.js";
|
|
8
8
|
import Session from "./session.js";
|
|
9
9
|
import { deviceMemory, jsHeapSizeLimit } from "../modules/performance.js";
|
|
10
|
+
const CANCELED = "canceled";
|
|
11
|
+
const START_ERROR = ":(";
|
|
12
|
+
const UnsuccessfulStart = (reason) => ({ reason, success: false });
|
|
13
|
+
const SuccessfulStart = (body) => (Object.assign(Object.assign({}, body), { success: true }));
|
|
10
14
|
var ActivityState;
|
|
11
15
|
(function (ActivityState) {
|
|
12
16
|
ActivityState[ActivityState["NotActive"] = 0] = "NotActive";
|
|
13
17
|
ActivityState[ActivityState["Starting"] = 1] = "Starting";
|
|
14
18
|
ActivityState[ActivityState["Active"] = 2] = "Active";
|
|
15
19
|
})(ActivityState || (ActivityState = {}));
|
|
16
|
-
export const CANCELED = "canceled";
|
|
17
20
|
// TODO: use backendHost only
|
|
18
21
|
export const DEFAULT_INGEST_POINT = 'https://api.openreplay.com/ingest';
|
|
19
22
|
export default class App {
|
|
@@ -26,8 +29,7 @@ export default class App {
|
|
|
26
29
|
this.stopCallbacks = [];
|
|
27
30
|
this.commitCallbacks = [];
|
|
28
31
|
this.activityState = ActivityState.NotActive;
|
|
29
|
-
this.version = '3.5.
|
|
30
|
-
this.preStartMessages = [];
|
|
32
|
+
this.version = '3.5.12'; // TODO: version compatability check inside each plugin.
|
|
31
33
|
this.projectKey = projectKey;
|
|
32
34
|
this.options = Object.assign({
|
|
33
35
|
revID: '',
|
|
@@ -100,15 +102,12 @@ export default class App {
|
|
|
100
102
|
if (this.activityState === ActivityState.NotActive) {
|
|
101
103
|
return;
|
|
102
104
|
}
|
|
103
|
-
if (this.activityState === ActivityState.Starting) {
|
|
104
|
-
this.preStartMessages.push(message);
|
|
105
|
-
}
|
|
106
|
-
if (this.preStartMessages.length) {
|
|
107
|
-
this.messages.push(...this.preStartMessages);
|
|
108
|
-
this.preStartMessages.length = 0;
|
|
109
|
-
}
|
|
110
105
|
this.messages.push(message);
|
|
111
|
-
if
|
|
106
|
+
// TODO: commit on start if there were `urgent` sends;
|
|
107
|
+
// Clearify where urgent can be used for;
|
|
108
|
+
// Clearify workflow for each type of message in case it was sent before start
|
|
109
|
+
// (like Fetch before start; maybe add an option "preCapture: boolean" or sth alike)
|
|
110
|
+
if (this.activityState === ActivityState.Active && urgent) {
|
|
112
111
|
this.commit();
|
|
113
112
|
}
|
|
114
113
|
}
|
|
@@ -226,10 +225,10 @@ export default class App {
|
|
|
226
225
|
}
|
|
227
226
|
_start(startOpts) {
|
|
228
227
|
if (!this.worker) {
|
|
229
|
-
return Promise.
|
|
228
|
+
return Promise.resolve(UnsuccessfulStart("No worker found: perhaps, CSP is not set."));
|
|
230
229
|
}
|
|
231
230
|
if (this.activityState !== ActivityState.NotActive) {
|
|
232
|
-
return Promise.
|
|
231
|
+
return Promise.resolve(UnsuccessfulStart("OpenReplay: trying to call `start()` on the instance that has been started already."));
|
|
233
232
|
}
|
|
234
233
|
this.activityState = ActivityState.Starting;
|
|
235
234
|
let pageNo = 0;
|
|
@@ -289,26 +288,26 @@ export default class App {
|
|
|
289
288
|
beaconSizeLimit
|
|
290
289
|
};
|
|
291
290
|
this.worker.postMessage(startWorkerMsg);
|
|
292
|
-
|
|
291
|
+
const onStartInfo = { sessionToken: token, userUUID, sessionID };
|
|
292
|
+
this.startCallbacks.forEach((cb) => cb(onStartInfo));
|
|
293
293
|
this.observer.observe();
|
|
294
294
|
this.ticker.start();
|
|
295
295
|
this.notify.log("OpenReplay tracking started.");
|
|
296
296
|
// TODO: get rid of onStart
|
|
297
|
-
const onStartInfo = { sessionToken: token, userUUID, sessionID };
|
|
298
297
|
if (typeof this.options.onStart === 'function') {
|
|
299
298
|
this.options.onStart(onStartInfo);
|
|
300
299
|
}
|
|
301
|
-
return onStartInfo;
|
|
300
|
+
return SuccessfulStart(onStartInfo);
|
|
302
301
|
})
|
|
303
302
|
.catch(reason => {
|
|
304
303
|
sessionStorage.removeItem(this.options.session_token_key);
|
|
305
304
|
this.stop();
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
this.notify.log("OpenReplay was unable to start. ", reason);
|
|
309
|
-
this._debug("session_start", reason);
|
|
305
|
+
if (reason === CANCELED) {
|
|
306
|
+
return UnsuccessfulStart(CANCELED);
|
|
310
307
|
}
|
|
311
|
-
|
|
308
|
+
this.notify.log("OpenReplay was unable to start. ", reason);
|
|
309
|
+
this._debug("session_start", reason);
|
|
310
|
+
return UnsuccessfulStart(START_ERROR);
|
|
312
311
|
});
|
|
313
312
|
}
|
|
314
313
|
start(options = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Observer from "./observer.js";
|
|
2
|
-
import { CreateIFrameDocument } from "../../messages
|
|
2
|
+
import { CreateIFrameDocument } from "../../common/messages.js";
|
|
3
3
|
export default class IFrameObserver extends Observer {
|
|
4
4
|
observe(iframe) {
|
|
5
5
|
const doc = iframe.contentDocument;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RemoveNodeAttribute, SetNodeAttribute, SetNodeAttributeURLBased, SetCSSDataURLBased, SetNodeData, CreateTextNode, CreateElementNode, MoveNode, RemoveNode, } from "../../messages
|
|
1
|
+
import { RemoveNodeAttribute, SetNodeAttribute, SetNodeAttributeURLBased, SetCSSDataURLBased, SetNodeData, CreateTextNode, CreateElementNode, MoveNode, RemoveNode, } from "../../common/messages.js";
|
|
2
2
|
import { isInstance, inDocument } from "../context.js";
|
|
3
3
|
function isSVGElement(node) {
|
|
4
4
|
return node.namespaceURI === 'http://www.w3.org/2000/svg';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Observer from "./observer.js";
|
|
2
|
-
import { CreateIFrameDocument } from "../../messages
|
|
2
|
+
import { CreateIFrameDocument } from "../../common/messages.js";
|
|
3
3
|
export default class ShadowRootObserver extends Observer {
|
|
4
4
|
observe(el) {
|
|
5
5
|
const shRoot = el.shadowRoot;
|
|
@@ -2,7 +2,7 @@ import Observer from "./observer.js";
|
|
|
2
2
|
import { isInstance } from "../context.js";
|
|
3
3
|
import IFrameObserver from "./iframe_observer.js";
|
|
4
4
|
import ShadowRootObserver from "./shadow_root_observer.js";
|
|
5
|
-
import { CreateDocument } from "../../messages
|
|
5
|
+
import { CreateDocument } from "../../common/messages.js";
|
|
6
6
|
import { IN_BROWSER, hasOpenreplayAttribute } from '../../utils.js';
|
|
7
7
|
const attachShadowNativeFn = IN_BROWSER ? Element.prototype.attachShadow : () => new ShadowRoot();
|
|
8
8
|
export default class TopObserver extends Observer {
|
package/lib/app/session.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Message from "./
|
|
2
|
-
|
|
1
|
+
import type { Writer, Message } from "./types.js";
|
|
2
|
+
export default Message;
|
|
3
3
|
export declare const classes: Map<number, Function>;
|
|
4
4
|
declare class _BatchMeta implements Message {
|
|
5
5
|
pageNo: number;
|
|
@@ -442,4 +442,3 @@ declare class _CreateIFrameDocument implements Message {
|
|
|
442
442
|
encode(writer: Writer): boolean;
|
|
443
443
|
}
|
|
444
444
|
export declare const CreateIFrameDocument: typeof _CreateIFrameDocument & ((frameID: number, id: number) => _CreateIFrameDocument);
|
|
445
|
-
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../src/common/types.ts","../../src/common/messages.ts","../../src/common/webworker.ts","../../node_modules/@types/eslint-visitor-keys/index.d.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/base.d.ts","../../node_modules/@types/node/ts3.2/fs.d.ts","../../node_modules/@types/node/ts3.2/util.d.ts","../../node_modules/@types/node/ts3.2/globals.d.ts","../../node_modules/@types/node/ts3.2/base.d.ts","../../node_modules/@types/node/ts3.5/globals.global.d.ts","../../node_modules/@types/node/ts3.5/wasi.d.ts","../../node_modules/@types/node/ts3.5/base.d.ts","../../node_modules/@types/node/ts3.7/assert.d.ts","../../node_modules/@types/node/ts3.7/base.d.ts","../../node_modules/@types/node/ts3.7/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/glob/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/resolve/index.d.ts"],"fileInfos":[{"version":"ca3c1cd7464b613bf148a1422cb3201fe083e08565a02dc99eaad0d2977c16a7","affectsGlobalScope":true,"impliedFormat":1},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06",{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true,"impliedFormat":1},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true,"impliedFormat":1},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true,"impliedFormat":1},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true,"impliedFormat":1},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true,"impliedFormat":1},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true,"impliedFormat":1},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true,"impliedFormat":1},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true,"impliedFormat":1},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true,"impliedFormat":1},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true,"impliedFormat":1},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true,"impliedFormat":1},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true,"impliedFormat":1},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true,"impliedFormat":1},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true,"impliedFormat":1},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true,"impliedFormat":1},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true,"impliedFormat":1},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true,"impliedFormat":1},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true,"impliedFormat":1},"8f2ce078b846e85a1e1d9608ee441d1b01babad7059966dafb3fb203c0be58b3","57f6a26ef13806a81f4fd41f0afc9745f8133850172d593bd8a873f8ac8ef8e1","7aca4d4f46ed6db51ccb2c75e628f7bef921529e89bd4b5b96bebaf66647e517","725d9be2fd48440256f4deb00649adffdbc5ecd282b09e89d4e200663792c34c","89ccbe04e737ce613f5f04990271cfa84901446350b8551b0555ddf19319723b",{"version":"2dd7dbacbd70cc156185235140b7b6682c002c1ea678dd87d7a20589d4555fc0","affectsGlobalScope":true,"impliedFormat":1},"4ed9f71ddbb5753771ee391f64297078a88f7dfd1480646dcf08c31395778682","61215c1a376bbe8f51cab4cc4ddbf3746387015113c37a84d981d4738c21b878","465150173a56b943b2f6d8918e35c89d8386ffd37aa466e486ca54db54d6cee7","123ec69e4b3a686eb49afd94ebe3292a5c84a867ecbcb6bb84bdd720a12af803","525c8fc510d9632d2a0a9de2d41c3ac1cdd79ff44d3b45c6d81cacabb683528d","90c85ddbb8de82cd19198bda062065fc51b7407c0f206f2e399e65a52e979720","d4dd0b19ee0338dd4f1603eacb41859b9d5371bfef2b2849cb870d6fd6602bcb","7ecfe97b43aa6c8b8f90caa599d5648bb559962e74e6f038f73a77320569dd78","aad3237c3f99480041cad7ca04d64307c98933996f822342b7c0ee4a78553346","4d4c83f77ac21a72252785baa5328a5612b0b6598d512f68b8cb14f7966d059e","eaa8136bb11fbea5bdaf29e06aa45a1969ddd39fbfb5fe58a01f00d7f1562cd9","e253cd3c7d10c4f600308d0528dd371d7e4165d8295b37a1f38d0ef6c0dfaf60","fb28748ff8d015f52e99daee4f454e57cec1a22141f1257c317f3630a15edeb7","9440dcf960685f7ec10856891a6cebb52a5ae8cef6a2e85daf9476dafd346cbe","5d9394b829cfd504b2fe17287aaad8ce1dcfb2a2183c962a90a85b96da2c1c90","c969bf4c7cdfe4d5dd28aa09432f99d09ad1d8d8b839959646579521d0467d1a","6c3857edaeeaaf43812f527830ebeece9266b6e8eb5271ab6d2f0008306c9947","bc6a77e750f4d34584e46b1405b771fb69a224197dd6bafe5b0392a29a70b665","46cac76114704902baa535b30fb66a26aeaf9430f3b3ab44746e329f12e85498","ed4ae81196cccc10f297d228bca8d02e31058e6d723a3c5bc4be5fb3c61c6a34","84044697c8b3e08ef24e4b32cfe6440143d07e469a5e34bda0635276d32d9f35","0b6098fedb648cab8091cca2b022a5c729b6ef18da923852033f495907cb1a45",{"version":"0e0d58f5e90c0a270dac052b9c5ad8ccdfc8271118c2105b361063218d528d6e","affectsGlobalScope":true,"impliedFormat":1},"30ec6f9c683b988c3cfaa0c4690692049c4e7ed7dc6f6e94f56194c06b86f5e1","9f633ecf3e065ff82c19eccab35c8aa1d6d5d1a49af282dc29ef5a64cca34164","6b2bb67b0942bcfce93e1d6fad5f70afd54940a2b13df7f311201fba54b2cbe9","dd3706b25d06fe23c73d16079e8c66ac775831ef419da00716bf2aee530a04a4","406a63c7e94107394341e97dbdc3312a1ecea75571d067a69eaa213786d9f154","d67e08745494b000da9410c1ae2fdc9965fc6d593fe0f381a47491f75417d457","b40652bf8ce4a18133b31349086523b219724dca8df3448c1a0742528e7ad5b9","424bc64b2794d9280c1e1f4a3518ba9d285385a16d84753a6427bb469e582eca","a77fdb357c78b70142b2fdbbfb72958d69e8f765fd2a3c69946c1018e89d4638","3c2ac350c3baa61fd2b1925844109e098f4376d0768a4643abc82754fd752748","826d48e49c905cedb906cbde6ccaf758827ff5867d4daa006b5a79e0fb489357","baa711b17f67390c60eac3c70a1391b23a8e3833cb723b2d7336d4817a22455c","289be113bad7ee27ee7fa5b1e373c964c9789a5e9ed7db5ddcb631371120b953","e4abb8eaa8a7d78236be0f8342404aab076668d20590209e32fdeb924588531e","086bfc0710b044ce1586108ee56c6e1c0d9ca2d325c153bb026cbc850169f593","f409183966a1dd93d3a9cd1d54fbeb85c73101e87cd5b19467c5e37b252f3fd8","b46af749e3574b83bccc0ec829322b15e834ae90b45760eebc75a189c28c0868","12b2608d6074167c331c9c3c6994a57819f6ff934c7fd4527e23aabf56d4c8d1","ffc1cd688606ad1ddb59a40e8f3defbde907af2a3402d1d9ddf69accb2903f07",{"version":"4926e99d2ad39c0bbd36f2d37cc8f52756bc7a5661ad7b12815df871a4b07ba1","affectsGlobalScope":true,"impliedFormat":1},"4cef33b2997388559c39b2f98c37e8319ad61e30a1f0edc55c53913f2250bade",{"version":"2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1","affectsGlobalScope":true,"impliedFormat":1},"0b3fef11ea6208c4cb3715c9aa108766ce98fc726bfba68cc23b25ce944ce9c0","255dbc5a5acef2b83b47145042aa0127ebf7fe24cd5ce6afaaaf5c8fc2c5eb96","a8b842671d535d14f533fd8dbfacebceacf5195069d720425d572d5cc5ab3dc4","9779312cffccce68e3ffbaa3a876381dc54a8240d9bdaa448f7eba222ec19392","d522314e80ed71b57e3c2939d3c9594eaae63a4adf028559e6574f6b270b0fee","1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633","64ef5112114bdd77304acb548f93777b263bbf57272776139425a58f68a10775","ecdf947a5111318568ba99f2a87b8498382d8871207f1bc6271ff3b9536a2448","2880728492d6a6baa55411d14cc42fa55714a24b1d1d27ff9a8a610abd47c761"],"options":{"composite":true,"declaration":true,"module":5,"noImplicitAny":true,"noImplicitThis":true,"outDir":"..","rootDir":"../../src","strictNullChecks":true,"target":2},"fileIdsList":[[45,68,74,75],[44,45,68,74,75,83,84],[33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,74,75],[44,45,52,61,68,74,75],[36,44,45,52,68,74,75],[40,45,53,68,74,75],[45,61,68,74,75],[42,44,45,52,68,74,75],[44,45,68,74,75],[44,46,61,67,68,74,75],[44,45,52,61,67,68,74,75],[44,45,47,52,61,64,67,68,74,75],[44,45,47,64,67,68,74,75],[45,67,68,74,75],[42,44,45,61,68,74,75],[34,45,68,74,75],[45,66,68,74,75],[44,45,61,68,74,75],[45,59,68,70,74,75],[40,42,45,52,61,68,74,75],[45,68,73,74,75,76],[45,68,75],[33,45,68,74,75],[45,68,74],[45,68,74,75,77,78,79],[45,68,74,75,80,81],[45,68,74,75,82],[45,52,68,74,75],[45,58,68,74,75],[45,74,75],[44,45,61,67,68,70,74,75],[45,68,74,75,83],[28,45,68,74,75]],"referencedMap":[[31,1],[32,1],[85,2],[86,1],[84,1],[34,1],[73,3],[35,1],[36,4],[37,5],[38,1],[39,6],[40,7],[41,8],[42,1],[43,9],[44,1],[45,10],[46,1],[33,1],[47,11],[48,12],[49,13],[50,9],[51,14],[52,15],[53,1],[54,1],[55,16],[56,17],[57,1],[58,1],[59,18],[60,19],[61,9],[62,1],[63,1],[64,20],[65,1],[77,21],[74,22],[76,23],[75,24],[80,25],[78,1],[79,1],[81,1],[82,26],[83,27],[66,28],[67,29],[68,30],[69,7],[70,1],[71,31],[72,7],[87,32],[7,1],[6,1],[2,1],[8,1],[9,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[3,1],[4,1],[19,1],[16,1],[17,1],[18,1],[20,1],[21,1],[22,1],[5,1],[23,1],[24,1],[25,1],[26,1],[1,1],[27,1],[29,33],[28,1],[30,1]],"exportedModulesMap":[[31,1],[32,1],[85,2],[86,1],[84,1],[34,1],[73,3],[35,1],[36,4],[37,5],[38,1],[39,6],[40,7],[41,8],[42,1],[43,9],[44,1],[45,10],[46,1],[33,1],[47,11],[48,12],[49,13],[50,9],[51,14],[52,15],[53,1],[54,1],[55,16],[56,17],[57,1],[58,1],[59,18],[60,19],[61,9],[62,1],[63,1],[64,20],[65,1],[77,21],[74,22],[76,23],[75,24],[80,25],[78,1],[79,1],[81,1],[82,26],[83,27],[66,28],[67,29],[68,30],[69,7],[70,1],[71,31],[72,7],[87,32],[7,1],[6,1],[2,1],[8,1],[9,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[3,1],[4,1],[19,1],[16,1],[17,1],[18,1],[20,1],[21,1],[22,1],[5,1],[23,1],[24,1],[25,1],[26,1],[1,1],[27,1],[29,33],[28,1],[30,1]],"semanticDiagnosticsPerFile":[31,32,85,86,84,34,73,35,36,37,38,39,40,41,42,43,44,45,46,33,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,77,74,76,75,80,78,79,81,82,83,66,67,68,69,70,71,72,87,7,6,2,8,9,10,11,12,13,14,15,3,4,19,16,17,18,20,21,22,5,23,24,25,26,1,27,29,28,30]},"version":"4.6.0-dev.20211126"}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Options {
|
|
2
|
+
connAttemptCount?: number;
|
|
3
|
+
connAttemptGap?: number;
|
|
4
|
+
}
|
|
5
|
+
declare type Start = {
|
|
6
|
+
type: "start";
|
|
7
|
+
ingestPoint: string;
|
|
8
|
+
pageNo: number;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
} & Options;
|
|
11
|
+
declare type Auth = {
|
|
12
|
+
type: "auth";
|
|
13
|
+
token: string;
|
|
14
|
+
beaconSizeLimit?: number;
|
|
15
|
+
};
|
|
16
|
+
export declare type WorkerMessageData = null | "stop" | Start | Auth | Array<{
|
|
17
|
+
_id: number;
|
|
18
|
+
}>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import App from "./app/index.js";
|
|
2
2
|
export { default as App } from './app/index.js';
|
|
3
|
-
import * as _Messages from "./messages
|
|
3
|
+
import * as _Messages from "./common/messages.js";
|
|
4
4
|
export declare const Messages: typeof _Messages;
|
|
5
5
|
import type { Options as AppOptions } from "./app/index.js";
|
|
6
6
|
import type { Options as ConsoleOptions } from "./modules/console.js";
|
|
@@ -9,7 +9,7 @@ import type { Options as InputOptions } from "./modules/input.js";
|
|
|
9
9
|
import type { Options as PerformanceOptions } from "./modules/performance.js";
|
|
10
10
|
import type { Options as TimingOptions } from "./modules/timing.js";
|
|
11
11
|
import type { StartOptions } from './app/index.js';
|
|
12
|
-
import type {
|
|
12
|
+
import type { StartPromiseReturn } from './app/index.js';
|
|
13
13
|
export declare type Options = Partial<AppOptions & ConsoleOptions & ExceptionOptions & InputOptions & PerformanceOptions & TimingOptions> & {
|
|
14
14
|
projectID?: number;
|
|
15
15
|
projectKey: string;
|
|
@@ -24,7 +24,7 @@ export default class API {
|
|
|
24
24
|
constructor(options: Options);
|
|
25
25
|
use<T>(fn: (app: App | null, options?: Options) => T): T;
|
|
26
26
|
isActive(): boolean;
|
|
27
|
-
start(startOpts?: Partial<StartOptions>): Promise<
|
|
27
|
+
start(startOpts?: Partial<StartOptions>): Promise<StartPromiseReturn>;
|
|
28
28
|
stop(): void;
|
|
29
29
|
getSessionToken(): string | null | undefined;
|
|
30
30
|
getSessionID(): string | null | undefined;
|