@openreplay/tracker 3.6.3 → 3.6.6
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/.eslintignore +8 -0
- package/cjs/app/guards.js +1 -2
- package/cjs/app/index.d.ts +15 -13
- package/cjs/app/index.js +58 -42
- package/cjs/app/logger.js +6 -3
- package/cjs/app/observer/iframe_observer.d.ts +1 -1
- package/cjs/app/observer/iframe_observer.js +1 -1
- package/cjs/app/observer/observer.d.ts +2 -3
- package/cjs/app/observer/observer.js +38 -40
- package/cjs/app/observer/shadow_root_observer.d.ts +1 -1
- package/cjs/app/observer/shadow_root_observer.js +1 -1
- package/cjs/app/observer/top_observer.d.ts +2 -2
- package/cjs/app/observer/top_observer.js +12 -11
- package/cjs/app/sanitizer.d.ts +1 -1
- package/cjs/app/sanitizer.js +5 -5
- package/cjs/app/session.d.ts +14 -2
- package/cjs/app/session.js +19 -6
- package/cjs/app/ticker.d.ts +1 -1
- package/cjs/common/messages.d.ts +1 -1
- package/cjs/common/messages.js +69 -120
- package/cjs/common/webworker.d.ts +3 -3
- package/cjs/index.d.ts +9 -8
- package/cjs/index.js +34 -28
- package/cjs/modules/connection.d.ts +1 -1
- package/cjs/modules/console.d.ts +1 -1
- package/cjs/modules/console.js +5 -5
- package/cjs/modules/cssrules.d.ts +1 -1
- package/cjs/modules/cssrules.js +3 -3
- package/cjs/modules/exception.d.ts +2 -2
- package/cjs/modules/exception.js +7 -6
- package/cjs/modules/img.d.ts +1 -1
- package/cjs/modules/img.js +15 -12
- package/cjs/modules/input.d.ts +1 -1
- package/cjs/modules/input.js +15 -15
- package/cjs/modules/longtasks.d.ts +1 -1
- package/cjs/modules/longtasks.js +13 -5
- package/cjs/modules/mouse.d.ts +1 -1
- package/cjs/modules/mouse.js +10 -12
- package/cjs/modules/performance.d.ts +1 -1
- package/cjs/modules/scroll.d.ts +1 -1
- package/cjs/modules/timing.d.ts +1 -1
- package/cjs/modules/timing.js +12 -24
- package/cjs/modules/viewport.d.ts +1 -1
- package/cjs/utils.js +7 -7
- package/cjs/vendors/finder/finder.js +53 -48
- package/lib/app/guards.js +1 -2
- package/lib/app/index.d.ts +15 -13
- package/lib/app/index.js +67 -51
- package/lib/app/logger.js +6 -3
- package/lib/app/observer/iframe_observer.d.ts +1 -1
- package/lib/app/observer/iframe_observer.js +3 -3
- package/lib/app/observer/observer.d.ts +2 -3
- package/lib/app/observer/observer.js +40 -42
- package/lib/app/observer/shadow_root_observer.d.ts +1 -1
- package/lib/app/observer/shadow_root_observer.js +3 -3
- package/lib/app/observer/top_observer.d.ts +2 -2
- package/lib/app/observer/top_observer.js +17 -16
- package/lib/app/sanitizer.d.ts +1 -1
- package/lib/app/sanitizer.js +7 -7
- package/lib/app/session.d.ts +14 -2
- package/lib/app/session.js +19 -6
- package/lib/app/ticker.d.ts +1 -1
- package/lib/common/messages.d.ts +1 -1
- package/lib/common/messages.js +69 -120
- package/lib/common/tsconfig.tsbuildinfo +1 -1
- package/lib/common/webworker.d.ts +3 -3
- package/lib/index.d.ts +9 -8
- package/lib/index.js +49 -43
- package/lib/modules/connection.d.ts +1 -1
- package/lib/modules/connection.js +1 -1
- package/lib/modules/console.d.ts +1 -1
- package/lib/modules/console.js +8 -8
- package/lib/modules/cssrules.d.ts +1 -1
- package/lib/modules/cssrules.js +5 -5
- package/lib/modules/exception.d.ts +2 -2
- package/lib/modules/exception.js +8 -7
- package/lib/modules/img.d.ts +1 -1
- package/lib/modules/img.js +18 -15
- package/lib/modules/input.d.ts +1 -1
- package/lib/modules/input.js +18 -18
- package/lib/modules/longtasks.d.ts +1 -1
- package/lib/modules/longtasks.js +14 -6
- package/lib/modules/mouse.d.ts +1 -1
- package/lib/modules/mouse.js +14 -16
- package/lib/modules/performance.d.ts +1 -1
- package/lib/modules/performance.js +2 -2
- package/lib/modules/scroll.d.ts +1 -1
- package/lib/modules/scroll.js +2 -2
- package/lib/modules/timing.d.ts +1 -1
- package/lib/modules/timing.js +15 -27
- package/lib/modules/viewport.d.ts +1 -1
- package/lib/modules/viewport.js +1 -1
- package/lib/utils.js +7 -7
- package/lib/vendors/finder/finder.js +53 -48
- package/package.json +28 -10
package/cjs/utils.js
CHANGED
|
@@ -17,26 +17,26 @@ function isURL(s) {
|
|
|
17
17
|
return s.startsWith('https://') || s.startsWith('http://');
|
|
18
18
|
}
|
|
19
19
|
exports.isURL = isURL;
|
|
20
|
-
exports.IN_BROWSER = !(typeof window ===
|
|
20
|
+
exports.IN_BROWSER = !(typeof window === 'undefined');
|
|
21
21
|
// TODO: JOIN IT WITH LOGGER somehow (use logging decorators?); Don't forget about index.js loggin when there is no logger instance.
|
|
22
22
|
exports.DOCS_HOST = 'https://docs.openreplay.com';
|
|
23
23
|
const warnedFeatures = {};
|
|
24
|
-
function deprecationWarn(nameOfFeature, useInstead, docsPath =
|
|
24
|
+
function deprecationWarn(nameOfFeature, useInstead, docsPath = '/') {
|
|
25
25
|
if (warnedFeatures[nameOfFeature]) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
console.warn(`OpenReplay: ${nameOfFeature} is deprecated. ${useInstead ? `Please, use ${useInstead} instead.` :
|
|
28
|
+
console.warn(`OpenReplay: ${nameOfFeature} is deprecated. ${useInstead ? `Please, use ${useInstead} instead.` : ''} Visit ${exports.DOCS_HOST}${docsPath} for more information.`);
|
|
29
29
|
warnedFeatures[nameOfFeature] = true;
|
|
30
30
|
}
|
|
31
31
|
exports.deprecationWarn = deprecationWarn;
|
|
32
32
|
function getLabelAttribute(e) {
|
|
33
|
-
let value = e.getAttribute(
|
|
33
|
+
let value = e.getAttribute('data-openreplay-label');
|
|
34
34
|
if (value !== null) {
|
|
35
35
|
return value;
|
|
36
36
|
}
|
|
37
|
-
value = e.getAttribute(
|
|
37
|
+
value = e.getAttribute('data-asayer-label');
|
|
38
38
|
if (value !== null) {
|
|
39
|
-
deprecationWarn(
|
|
39
|
+
deprecationWarn('"data-asayer-label" attribute', '"data-openreplay-label" attribute', '/');
|
|
40
40
|
}
|
|
41
41
|
return value;
|
|
42
42
|
}
|
|
@@ -48,7 +48,7 @@ function hasOpenreplayAttribute(e, name) {
|
|
|
48
48
|
}
|
|
49
49
|
const oldName = `data-asayer-${name}`;
|
|
50
50
|
if (e.hasAttribute(oldName)) {
|
|
51
|
-
deprecationWarn(`"${oldName}" attribute`, `"${newName}" attribute`,
|
|
51
|
+
deprecationWarn(`"${oldName}" attribute`, `"${newName}" attribute`, '/installation/sanitize-data');
|
|
52
52
|
return true;
|
|
53
53
|
}
|
|
54
54
|
return false;
|
|
@@ -11,10 +11,10 @@ let config;
|
|
|
11
11
|
let rootDocument;
|
|
12
12
|
function finder(input, options) {
|
|
13
13
|
if (input.nodeType !== Node.ELEMENT_NODE) {
|
|
14
|
-
throw new Error(
|
|
14
|
+
throw new Error("Can't generate CSS selector for non-element node type.");
|
|
15
15
|
}
|
|
16
|
-
if (
|
|
17
|
-
return
|
|
16
|
+
if ('html' === input.tagName.toLowerCase()) {
|
|
17
|
+
return 'html';
|
|
18
18
|
}
|
|
19
19
|
const defaults = {
|
|
20
20
|
root: document.body,
|
|
@@ -38,7 +38,7 @@ function finder(input, options) {
|
|
|
38
38
|
return selector(path);
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
|
-
throw new Error(
|
|
41
|
+
throw new Error('Selector was not found.');
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
exports.finder = finder;
|
|
@@ -53,30 +53,33 @@ function findRootDocument(rootNode, defaults) {
|
|
|
53
53
|
}
|
|
54
54
|
function bottomUpSearch(input, limit, fallback) {
|
|
55
55
|
let path = null;
|
|
56
|
-
|
|
56
|
+
const stack = [];
|
|
57
57
|
let current = input;
|
|
58
58
|
let i = 0;
|
|
59
59
|
while (current && current !== config.root.parentElement) {
|
|
60
|
-
let level = maybe(id(current)) ||
|
|
60
|
+
let level = maybe(id(current)) ||
|
|
61
|
+
maybe(...attr(current)) ||
|
|
62
|
+
maybe(...classNames(current)) ||
|
|
63
|
+
maybe(tagName(current)) || [any()];
|
|
61
64
|
const nth = index(current);
|
|
62
65
|
if (limit === Limit.All) {
|
|
63
66
|
if (nth) {
|
|
64
|
-
level = level.concat(level.filter(dispensableNth).map(node => nthChild(node, nth)));
|
|
67
|
+
level = level.concat(level.filter(dispensableNth).map((node) => nthChild(node, nth)));
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
else if (limit === Limit.Two) {
|
|
68
71
|
level = level.slice(0, 1);
|
|
69
72
|
if (nth) {
|
|
70
|
-
level = level.concat(level.filter(dispensableNth).map(node => nthChild(node, nth)));
|
|
73
|
+
level = level.concat(level.filter(dispensableNth).map((node) => nthChild(node, nth)));
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
76
|
else if (limit === Limit.One) {
|
|
74
|
-
const [node] = level = level.slice(0, 1);
|
|
77
|
+
const [node] = (level = level.slice(0, 1));
|
|
75
78
|
if (nth && dispensableNth(node)) {
|
|
76
79
|
level = [nthChild(node, nth)];
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
|
-
for (
|
|
82
|
+
for (const node of level) {
|
|
80
83
|
node.level = i;
|
|
81
84
|
}
|
|
82
85
|
stack.push(level);
|
|
@@ -99,7 +102,7 @@ function findUniquePath(stack, fallback) {
|
|
|
99
102
|
if (paths.length > config.threshold) {
|
|
100
103
|
return fallback ? fallback() : null;
|
|
101
104
|
}
|
|
102
|
-
for (
|
|
105
|
+
for (const candidate of paths) {
|
|
103
106
|
if (unique(candidate)) {
|
|
104
107
|
return candidate;
|
|
105
108
|
}
|
|
@@ -122,7 +125,7 @@ function selector(path) {
|
|
|
122
125
|
return query;
|
|
123
126
|
}
|
|
124
127
|
function penalty(path) {
|
|
125
|
-
return path.map(node => node.penalty).reduce((acc, i) => acc + i, 0);
|
|
128
|
+
return path.map((node) => node.penalty).reduce((acc, i) => acc + i, 0);
|
|
126
129
|
}
|
|
127
130
|
function unique(path) {
|
|
128
131
|
switch (rootDocument.querySelectorAll(selector(path)).length) {
|
|
@@ -135,10 +138,10 @@ function unique(path) {
|
|
|
135
138
|
}
|
|
136
139
|
}
|
|
137
140
|
function id(input) {
|
|
138
|
-
const elementId = input.getAttribute(
|
|
141
|
+
const elementId = input.getAttribute('id');
|
|
139
142
|
if (elementId && config.idName(elementId)) {
|
|
140
143
|
return {
|
|
141
|
-
name:
|
|
144
|
+
name: '#' + cssesc(elementId, { isIdentifier: true }),
|
|
142
145
|
penalty: 0,
|
|
143
146
|
};
|
|
144
147
|
}
|
|
@@ -147,16 +150,15 @@ function id(input) {
|
|
|
147
150
|
function attr(input) {
|
|
148
151
|
const attrs = Array.from(input.attributes).filter((attr) => config.attr(attr.name, attr.value));
|
|
149
152
|
return attrs.map((attr) => ({
|
|
150
|
-
name:
|
|
151
|
-
penalty: 0.5
|
|
153
|
+
name: '[' + cssesc(attr.name, { isIdentifier: true }) + '="' + cssesc(attr.value) + '"]',
|
|
154
|
+
penalty: 0.5,
|
|
152
155
|
}));
|
|
153
156
|
}
|
|
154
157
|
function classNames(input) {
|
|
155
|
-
const names = Array.from(input.classList)
|
|
156
|
-
.filter(config.className);
|
|
158
|
+
const names = Array.from(input.classList).filter(config.className);
|
|
157
159
|
return names.map((name) => ({
|
|
158
|
-
name:
|
|
159
|
-
penalty: 1
|
|
160
|
+
name: '.' + cssesc(name, { isIdentifier: true }),
|
|
161
|
+
penalty: 1,
|
|
160
162
|
}));
|
|
161
163
|
}
|
|
162
164
|
function tagName(input) {
|
|
@@ -164,15 +166,15 @@ function tagName(input) {
|
|
|
164
166
|
if (config.tagName(name)) {
|
|
165
167
|
return {
|
|
166
168
|
name,
|
|
167
|
-
penalty: 2
|
|
169
|
+
penalty: 2,
|
|
168
170
|
};
|
|
169
171
|
}
|
|
170
172
|
return null;
|
|
171
173
|
}
|
|
172
174
|
function any() {
|
|
173
175
|
return {
|
|
174
|
-
name:
|
|
175
|
-
penalty: 3
|
|
176
|
+
name: '*',
|
|
177
|
+
penalty: 3,
|
|
176
178
|
};
|
|
177
179
|
}
|
|
178
180
|
function index(input) {
|
|
@@ -199,11 +201,11 @@ function index(input) {
|
|
|
199
201
|
function nthChild(node, i) {
|
|
200
202
|
return {
|
|
201
203
|
name: node.name + `:nth-child(${i})`,
|
|
202
|
-
penalty: node.penalty + 1
|
|
204
|
+
penalty: node.penalty + 1,
|
|
203
205
|
};
|
|
204
206
|
}
|
|
205
207
|
function dispensableNth(node) {
|
|
206
|
-
return node.name !==
|
|
208
|
+
return node.name !== 'html' && !node.name.startsWith('#');
|
|
207
209
|
}
|
|
208
210
|
function maybe(...level) {
|
|
209
211
|
const list = level.filter(notEmpty);
|
|
@@ -218,7 +220,7 @@ function notEmpty(value) {
|
|
|
218
220
|
function combinations(stack, path = []) {
|
|
219
221
|
const paths = [];
|
|
220
222
|
if (stack.length > 0) {
|
|
221
|
-
for (
|
|
223
|
+
for (const node of stack[0]) {
|
|
222
224
|
paths.push(...combinations(stack.slice(1, stack.length), path.concat(node)));
|
|
223
225
|
}
|
|
224
226
|
}
|
|
@@ -232,7 +234,7 @@ function sort(paths) {
|
|
|
232
234
|
}
|
|
233
235
|
function optimize(path, input, scope = {
|
|
234
236
|
counter: 0,
|
|
235
|
-
visited: new Map()
|
|
237
|
+
visited: new Map(),
|
|
236
238
|
}) {
|
|
237
239
|
const paths = [];
|
|
238
240
|
if (path.length > 2 && path.length > config.optimizedMinLength) {
|
|
@@ -263,20 +265,20 @@ const regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/;
|
|
|
263
265
|
const regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/;
|
|
264
266
|
const regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
|
|
265
267
|
const defaultOptions = {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
escapeEverything: false,
|
|
269
|
+
isIdentifier: false,
|
|
270
|
+
quotes: 'single',
|
|
271
|
+
wrap: false,
|
|
270
272
|
};
|
|
271
273
|
function cssesc(string, opt = {}) {
|
|
272
274
|
const options = Object.assign(Object.assign({}, defaultOptions), opt);
|
|
273
|
-
if (options.quotes !=
|
|
274
|
-
options.quotes =
|
|
275
|
+
if (options.quotes != 'single' && options.quotes != 'double') {
|
|
276
|
+
options.quotes = 'single';
|
|
275
277
|
}
|
|
276
|
-
const quote = options.quotes ==
|
|
278
|
+
const quote = options.quotes == 'double' ? '"' : "'";
|
|
277
279
|
const isIdentifier = options.isIdentifier;
|
|
278
280
|
const firstChar = string.charAt(0);
|
|
279
|
-
let output =
|
|
281
|
+
let output = '';
|
|
280
282
|
let counter = 0;
|
|
281
283
|
const length = string.length;
|
|
282
284
|
while (counter < length) {
|
|
@@ -284,13 +286,13 @@ function cssesc(string, opt = {}) {
|
|
|
284
286
|
let codePoint = character.charCodeAt(0);
|
|
285
287
|
let value = void 0;
|
|
286
288
|
// If it’s not a printable ASCII character…
|
|
287
|
-
if (codePoint < 0x20 || codePoint >
|
|
288
|
-
if (codePoint >=
|
|
289
|
+
if (codePoint < 0x20 || codePoint > 0x7e) {
|
|
290
|
+
if (codePoint >= 0xd800 && codePoint <= 0xdbff && counter < length) {
|
|
289
291
|
// It’s a high surrogate, and there is a next character.
|
|
290
292
|
const extra = string.charCodeAt(counter++);
|
|
291
|
-
if ((extra &
|
|
293
|
+
if ((extra & 0xfc00) == 0xdc00) {
|
|
292
294
|
// next character is low surrogate
|
|
293
|
-
codePoint = ((codePoint &
|
|
295
|
+
codePoint = ((codePoint & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;
|
|
294
296
|
}
|
|
295
297
|
else {
|
|
296
298
|
// It’s an unmatched surrogate; only append this code unit, in case
|
|
@@ -298,22 +300,25 @@ function cssesc(string, opt = {}) {
|
|
|
298
300
|
counter--;
|
|
299
301
|
}
|
|
300
302
|
}
|
|
301
|
-
value =
|
|
303
|
+
value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
|
|
302
304
|
}
|
|
303
305
|
else {
|
|
304
306
|
if (options.escapeEverything) {
|
|
305
307
|
if (regexAnySingleEscape.test(character)) {
|
|
306
|
-
value =
|
|
308
|
+
value = '\\' + character;
|
|
307
309
|
}
|
|
308
310
|
else {
|
|
309
|
-
value =
|
|
311
|
+
value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
|
|
310
312
|
}
|
|
311
313
|
}
|
|
312
314
|
else if (/[\t\n\f\r\x0B]/.test(character)) {
|
|
313
|
-
value =
|
|
315
|
+
value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
|
|
314
316
|
}
|
|
315
|
-
else if (character ==
|
|
316
|
-
|
|
317
|
+
else if (character == '\\' ||
|
|
318
|
+
(!isIdentifier &&
|
|
319
|
+
((character == '"' && quote == character) || (character == "'" && quote == character))) ||
|
|
320
|
+
(isIdentifier && regexSingleEscape.test(character))) {
|
|
321
|
+
value = '\\' + character;
|
|
317
322
|
}
|
|
318
323
|
else {
|
|
319
324
|
value = character;
|
|
@@ -323,10 +328,10 @@ function cssesc(string, opt = {}) {
|
|
|
323
328
|
}
|
|
324
329
|
if (isIdentifier) {
|
|
325
330
|
if (/^-[-\d]/.test(output)) {
|
|
326
|
-
output =
|
|
331
|
+
output = '\\-' + output.slice(1);
|
|
327
332
|
}
|
|
328
333
|
else if (/\d/.test(firstChar)) {
|
|
329
|
-
output =
|
|
334
|
+
output = '\\3' + firstChar + ' ' + output.slice(1);
|
|
330
335
|
}
|
|
331
336
|
}
|
|
332
337
|
// Remove spaces after `\HEX` escapes that are not followed by a hex digit,
|
|
@@ -338,7 +343,7 @@ function cssesc(string, opt = {}) {
|
|
|
338
343
|
return $0;
|
|
339
344
|
}
|
|
340
345
|
// Strip the space.
|
|
341
|
-
return ($1 ||
|
|
346
|
+
return ($1 || '') + $2;
|
|
342
347
|
});
|
|
343
348
|
if (!isIdentifier && options.wrap) {
|
|
344
349
|
return quote + output + quote;
|
package/lib/app/guards.js
CHANGED
|
@@ -8,8 +8,7 @@ export function isTextNode(node) {
|
|
|
8
8
|
return node.nodeType === Node.TEXT_NODE;
|
|
9
9
|
}
|
|
10
10
|
export function isRootNode(node) {
|
|
11
|
-
return node.nodeType === Node.DOCUMENT_NODE ||
|
|
12
|
-
node.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
11
|
+
return node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
13
12
|
}
|
|
14
13
|
export function hasTag(el, tagName) {
|
|
15
14
|
return el.nodeName === tagName;
|
package/lib/app/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type Message from
|
|
2
|
-
import Nodes from
|
|
3
|
-
import Sanitizer from
|
|
4
|
-
import Ticker from
|
|
5
|
-
import Logger from
|
|
6
|
-
import Session from
|
|
7
|
-
import type { Options as ObserverOptions } from
|
|
8
|
-
import type { Options as SanitizerOptions } from
|
|
9
|
-
import type { Options as LoggerOptions } from
|
|
10
|
-
import type { Options as WebworkerOptions } from
|
|
1
|
+
import type Message from '../common/messages.js';
|
|
2
|
+
import Nodes from './nodes.js';
|
|
3
|
+
import Sanitizer from './sanitizer.js';
|
|
4
|
+
import Ticker from './ticker.js';
|
|
5
|
+
import Logger from './logger.js';
|
|
6
|
+
import Session from './session.js';
|
|
7
|
+
import type { Options as ObserverOptions } from './observer/top_observer.js';
|
|
8
|
+
import type { Options as SanitizerOptions } from './sanitizer.js';
|
|
9
|
+
import type { Options as LoggerOptions } from './logger.js';
|
|
10
|
+
import type { Options as WebworkerOptions } from '../common/webworker.js';
|
|
11
11
|
export interface StartOptions {
|
|
12
12
|
userID?: string;
|
|
13
13
|
metadata?: Record<string, string>;
|
|
@@ -68,7 +68,7 @@ export default class App {
|
|
|
68
68
|
private readonly options;
|
|
69
69
|
private readonly revID;
|
|
70
70
|
private activityState;
|
|
71
|
-
private version;
|
|
71
|
+
private readonly version;
|
|
72
72
|
private readonly worker?;
|
|
73
73
|
constructor(projectKey: string, sessionToken: string | null | undefined, options: Partial<Options>);
|
|
74
74
|
private _debug;
|
|
@@ -77,7 +77,7 @@ export default class App {
|
|
|
77
77
|
safe<T extends (...args: any[]) => void>(fn: T): T;
|
|
78
78
|
attachCommitCallback(cb: CommitCallback): void;
|
|
79
79
|
attachStartCallback(cb: StartCallback): void;
|
|
80
|
-
attachStopCallback(cb:
|
|
80
|
+
attachStopCallback(cb: () => any): void;
|
|
81
81
|
attachEventListener(target: EventTarget, type: string, listener: EventListener, useSafe?: boolean, useCapture?: boolean): void;
|
|
82
82
|
checkRequiredVersion(version: string): boolean;
|
|
83
83
|
private getStartInfo;
|
|
@@ -88,12 +88,14 @@ export default class App {
|
|
|
88
88
|
timestamp: number;
|
|
89
89
|
trackerVersion: string;
|
|
90
90
|
isSnippet: boolean;
|
|
91
|
-
sessionID: string |
|
|
91
|
+
sessionID: string | undefined;
|
|
92
92
|
metadata: Record<string, string>;
|
|
93
93
|
userID: string | null;
|
|
94
|
+
projectID?: string | undefined;
|
|
94
95
|
};
|
|
95
96
|
getSessionToken(): string | undefined;
|
|
96
97
|
getSessionID(): string | undefined;
|
|
98
|
+
getSessionURL(): string | undefined;
|
|
97
99
|
getHost(): string;
|
|
98
100
|
getProjectKey(): string;
|
|
99
101
|
getBaseHref(): string;
|