@openreplay/tracker 11.0.6 → 12.0.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/CHANGELOG.md +4 -2
- package/cjs/app/index.d.ts +84 -6
- package/cjs/app/index.js +427 -58
- package/cjs/app/logger.d.ts +7 -17
- package/cjs/app/logger.js +11 -19
- package/cjs/app/messages.gen.d.ts +2 -0
- package/cjs/app/messages.gen.js +20 -1
- package/cjs/app/observer/iframe_observer.js +4 -1
- package/cjs/app/observer/shadow_root_observer.js +4 -1
- package/cjs/app/observer/top_observer.js +7 -4
- package/cjs/common/interaction.d.ts +5 -2
- package/cjs/common/messages.gen.d.ts +17 -2
- package/cjs/index.d.ts +45 -2
- package/cjs/index.js +237 -106
- package/cjs/modules/Network/beaconProxy.js +4 -1
- package/cjs/modules/Network/fetchProxy.js +24 -1
- package/cjs/modules/Network/index.js +6 -3
- package/cjs/modules/Network/xhrProxy.js +24 -1
- package/cjs/modules/conditionsManager.d.ts +84 -0
- package/cjs/modules/conditionsManager.js +343 -0
- package/cjs/modules/exception.js +4 -1
- package/cjs/modules/featureFlags.d.ts +1 -1
- package/cjs/modules/featureFlags.js +36 -46
- package/cjs/modules/network.js +5 -2
- package/cjs/modules/tagWatcher.d.ts +21 -0
- package/cjs/modules/tagWatcher.js +77 -0
- package/cjs/modules/userTesting/index.js +30 -4
- package/cjs/modules/userTesting/recorder.js +71 -88
- package/coverage/clover.xml +577 -544
- package/coverage/coverage-final.json +8 -8
- package/coverage/lcov-report/index.html +28 -28
- package/coverage/lcov-report/main/app/canvas.ts.html +97 -46
- package/coverage/lcov-report/main/app/guards.ts.html +1 -1
- package/coverage/lcov-report/main/app/index.html +19 -19
- package/coverage/lcov-report/main/app/index.ts.html +62 -35
- package/coverage/lcov-report/main/app/logger.ts.html +1 -1
- package/coverage/lcov-report/main/app/messages.gen.ts.html +32 -5
- package/coverage/lcov-report/main/app/nodes.ts.html +17 -5
- package/coverage/lcov-report/main/app/observer/iframe_observer.ts.html +1 -1
- package/coverage/lcov-report/main/app/observer/iframe_offsets.ts.html +1 -1
- package/coverage/lcov-report/main/app/observer/index.html +1 -1
- package/coverage/lcov-report/main/app/observer/shadow_root_observer.ts.html +1 -1
- package/coverage/lcov-report/main/app/observer/top_observer.ts.html +1 -1
- package/coverage/lcov-report/main/app/sanitizer.ts.html +1 -1
- package/coverage/lcov-report/main/app/session.ts.html +1 -1
- package/coverage/lcov-report/main/app/ticker.ts.html +1 -1
- package/coverage/lcov-report/main/index.html +9 -9
- package/coverage/lcov-report/main/index.ts.html +27 -6
- package/coverage/lcov-report/main/modules/Network/beaconProxy.ts.html +1 -1
- package/coverage/lcov-report/main/modules/Network/fetchProxy.ts.html +1 -1
- package/coverage/lcov-report/main/modules/Network/index.html +1 -1
- package/coverage/lcov-report/main/modules/Network/index.ts.html +1 -1
- package/coverage/lcov-report/main/modules/Network/networkMessage.ts.html +1 -1
- package/coverage/lcov-report/main/modules/Network/utils.ts.html +1 -1
- package/coverage/lcov-report/main/modules/Network/xhrProxy.ts.html +1 -1
- package/coverage/lcov-report/main/modules/attributeSender.ts.html +1 -1
- package/coverage/lcov-report/main/modules/axiosSpy.ts.html +1 -1
- package/coverage/lcov-report/main/modules/conditionsManager.ts.html +92 -38
- package/coverage/lcov-report/main/modules/connection.ts.html +1 -1
- package/coverage/lcov-report/main/modules/console.ts.html +1 -1
- package/coverage/lcov-report/main/modules/constructedStyleSheets.ts.html +1 -1
- package/coverage/lcov-report/main/modules/cssrules.ts.html +1 -1
- package/coverage/lcov-report/main/modules/exception.ts.html +1 -1
- package/coverage/lcov-report/main/modules/featureFlags.ts.html +1 -1
- package/coverage/lcov-report/main/modules/focus.ts.html +1 -1
- package/coverage/lcov-report/main/modules/fonts.ts.html +1 -1
- package/coverage/lcov-report/main/modules/img.ts.html +1 -1
- package/coverage/lcov-report/main/modules/index.html +21 -21
- package/coverage/lcov-report/main/modules/input.ts.html +1 -1
- package/coverage/lcov-report/main/modules/mouse.ts.html +1 -1
- package/coverage/lcov-report/main/modules/network.ts.html +1 -1
- package/coverage/lcov-report/main/modules/performance.ts.html +1 -1
- package/coverage/lcov-report/main/modules/scroll.ts.html +1 -1
- package/coverage/lcov-report/main/modules/selection.ts.html +1 -1
- package/coverage/lcov-report/main/modules/tabs.ts.html +1 -1
- package/coverage/lcov-report/main/modules/tagWatcher.ts.html +54 -27
- package/coverage/lcov-report/main/modules/timing.ts.html +1 -1
- package/coverage/lcov-report/main/modules/userTesting/SignalManager.ts.html +1 -1
- package/coverage/lcov-report/main/modules/userTesting/dnd.ts.html +1 -1
- package/coverage/lcov-report/main/modules/userTesting/index.html +1 -1
- package/coverage/lcov-report/main/modules/userTesting/index.ts.html +1 -1
- package/coverage/lcov-report/main/modules/userTesting/recorder.ts.html +1 -1
- package/coverage/lcov-report/main/modules/userTesting/styles.ts.html +1 -1
- package/coverage/lcov-report/main/modules/userTesting/utils.ts.html +1 -1
- package/coverage/lcov-report/main/modules/viewport.ts.html +1 -1
- package/coverage/lcov-report/main/utils.ts.html +1 -1
- package/coverage/lcov-report/webworker/BatchWriter.ts.html +1 -1
- package/coverage/lcov-report/webworker/MessageEncoder.gen.ts.html +17 -5
- package/coverage/lcov-report/webworker/PrimitiveEncoder.ts.html +1 -1
- package/coverage/lcov-report/webworker/QueueSender.ts.html +1 -1
- package/coverage/lcov-report/webworker/index.html +7 -7
- package/coverage/lcov-report/webworker/index.ts.html +1 -1
- package/coverage/lcov.info +1100 -1033
- package/lib/app/index.d.ts +84 -6
- package/lib/app/index.js +387 -44
- package/lib/app/logger.d.ts +7 -17
- package/lib/app/logger.js +11 -19
- package/lib/app/messages.gen.d.ts +2 -0
- package/lib/app/messages.gen.js +17 -0
- package/lib/common/interaction.d.ts +5 -2
- package/lib/common/messages.gen.d.ts +17 -2
- package/lib/common/tsconfig.tsbuildinfo +1 -1
- package/lib/index.d.ts +45 -2
- package/lib/index.js +191 -86
- package/lib/modules/conditionsManager.d.ts +84 -0
- package/lib/modules/conditionsManager.js +340 -0
- package/lib/modules/featureFlags.d.ts +1 -1
- package/lib/modules/featureFlags.js +36 -46
- package/lib/modules/tagWatcher.d.ts +21 -0
- package/lib/modules/tagWatcher.js +74 -0
- package/lib/modules/userTesting/recorder.js +71 -88
- package/package.json +1 -1
- package/tsconfig-base.json +3 -2
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.Quality = void 0;
|
|
13
4
|
exports.Quality = {
|
|
@@ -22,93 +13,85 @@ class Recorder {
|
|
|
22
13
|
this.stream = null;
|
|
23
14
|
this.recStartTs = null;
|
|
24
15
|
}
|
|
25
|
-
startRecording(fps, quality, micReq, camReq) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
audio: micReq,
|
|
33
|
-
});
|
|
34
|
-
this.mediaRecorder = new MediaRecorder(this.stream, {
|
|
35
|
-
mimeType: 'video/webm;codecs=vp9',
|
|
36
|
-
});
|
|
37
|
-
this.recordedChunks = [];
|
|
38
|
-
this.mediaRecorder.ondataavailable = (event) => {
|
|
39
|
-
if (event.data.size > 0) {
|
|
40
|
-
this.recordedChunks.push(event.data);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
this.mediaRecorder.start();
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
console.error(error);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
stopRecording() {
|
|
51
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
return new Promise((resolve) => {
|
|
53
|
-
if (!this.mediaRecorder)
|
|
54
|
-
return;
|
|
55
|
-
this.mediaRecorder.onstop = () => {
|
|
56
|
-
const blob = new Blob(this.recordedChunks, {
|
|
57
|
-
type: 'video/webm',
|
|
58
|
-
});
|
|
59
|
-
resolve(blob);
|
|
60
|
-
};
|
|
61
|
-
this.mediaRecorder.stop();
|
|
16
|
+
async startRecording(fps, quality, micReq, camReq) {
|
|
17
|
+
this.recStartTs = this.app.timestamp();
|
|
18
|
+
const videoConstraints = quality;
|
|
19
|
+
try {
|
|
20
|
+
this.stream = await navigator.mediaDevices.getUserMedia({
|
|
21
|
+
video: camReq ? Object.assign(Object.assign({}, videoConstraints), { frameRate: { ideal: fps } }) : false,
|
|
22
|
+
audio: micReq,
|
|
62
23
|
});
|
|
24
|
+
this.mediaRecorder = new MediaRecorder(this.stream, {
|
|
25
|
+
mimeType: 'video/webm;codecs=vp9',
|
|
26
|
+
});
|
|
27
|
+
this.recordedChunks = [];
|
|
28
|
+
this.mediaRecorder.ondataavailable = (event) => {
|
|
29
|
+
if (event.data.size > 0) {
|
|
30
|
+
this.recordedChunks.push(event.data);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.mediaRecorder.start();
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error(error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async stopRecording() {
|
|
40
|
+
return new Promise((resolve) => {
|
|
41
|
+
if (!this.mediaRecorder)
|
|
42
|
+
return;
|
|
43
|
+
this.mediaRecorder.onstop = () => {
|
|
44
|
+
const blob = new Blob(this.recordedChunks, {
|
|
45
|
+
type: 'video/webm',
|
|
46
|
+
});
|
|
47
|
+
resolve(blob);
|
|
48
|
+
};
|
|
49
|
+
this.mediaRecorder.stop();
|
|
63
50
|
});
|
|
64
51
|
}
|
|
65
|
-
sendToAPI() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
async sendToAPI() {
|
|
53
|
+
const blob = await this.stopRecording();
|
|
54
|
+
// const formData = new FormData()
|
|
55
|
+
// formData.append('file', blob, 'record.webm')
|
|
56
|
+
// formData.append('start', this.recStartTs?.toString() ?? '')
|
|
57
|
+
return fetch(`${this.app.options.ingestPoint}/v1/web/uxt/upload-url`, {
|
|
58
|
+
headers: {
|
|
59
|
+
Authorization: `Bearer ${this.app.session.getSessionToken()}`,
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
.then((r) => {
|
|
63
|
+
if (r.ok) {
|
|
64
|
+
return r.json();
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
throw new Error('Failed to get upload url');
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
.then(({ url }) => {
|
|
71
|
+
return fetch(url, {
|
|
72
|
+
method: 'PUT',
|
|
72
73
|
headers: {
|
|
73
|
-
|
|
74
|
+
'Content-Type': 'video/webm',
|
|
74
75
|
},
|
|
75
|
-
|
|
76
|
-
.then((r) => {
|
|
77
|
-
if (r.ok) {
|
|
78
|
-
return r.json();
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
throw new Error('Failed to get upload url');
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
.then(({ url }) => {
|
|
85
|
-
return fetch(url, {
|
|
86
|
-
method: 'PUT',
|
|
87
|
-
headers: {
|
|
88
|
-
'Content-Type': 'video/webm',
|
|
89
|
-
},
|
|
90
|
-
body: blob,
|
|
91
|
-
});
|
|
92
|
-
})
|
|
93
|
-
.catch(console.error)
|
|
94
|
-
.finally(() => {
|
|
95
|
-
this.discard();
|
|
76
|
+
body: blob,
|
|
96
77
|
});
|
|
78
|
+
})
|
|
79
|
+
.catch(console.error)
|
|
80
|
+
.finally(() => {
|
|
81
|
+
this.discard();
|
|
97
82
|
});
|
|
98
83
|
}
|
|
99
|
-
saveToFile(fileName = 'recorded-video.webm') {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
document.body.removeChild(a);
|
|
111
|
-
});
|
|
84
|
+
async saveToFile(fileName = 'recorded-video.webm') {
|
|
85
|
+
const blob = await this.stopRecording();
|
|
86
|
+
const url = URL.createObjectURL(blob);
|
|
87
|
+
const a = document.createElement('a');
|
|
88
|
+
a.style.display = 'none';
|
|
89
|
+
a.href = url;
|
|
90
|
+
a.download = fileName;
|
|
91
|
+
document.body.appendChild(a);
|
|
92
|
+
a.click();
|
|
93
|
+
window.URL.revokeObjectURL(url);
|
|
94
|
+
document.body.removeChild(a);
|
|
112
95
|
}
|
|
113
96
|
discard() {
|
|
114
97
|
var _a, _b;
|