@openreplay/tracker 4.1.10 → 4.1.11

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.
Files changed (71) hide show
  1. package/.eslintignore +0 -3
  2. package/README.md +18 -22
  3. package/cjs/app/guards.d.ts +12 -11
  4. package/cjs/app/guards.js +1 -2
  5. package/cjs/app/index.d.ts +8 -11
  6. package/cjs/app/index.js +8 -27
  7. package/cjs/app/logger.d.ts +3 -3
  8. package/cjs/app/messages.d.ts +52 -0
  9. package/cjs/app/messages.gen.d.ts +6 -8
  10. package/cjs/app/messages.gen.js +94 -116
  11. package/cjs/app/messages.js +234 -0
  12. package/cjs/app/nodes.d.ts +1 -1
  13. package/cjs/app/observer/iframe_offsets.d.ts +1 -1
  14. package/cjs/app/observer/observer.js +5 -5
  15. package/cjs/app/observer/top_observer.d.ts +2 -2
  16. package/cjs/app/observer/top_observer.js +1 -1
  17. package/cjs/app/session.d.ts +2 -2
  18. package/cjs/app/ticker.d.ts +1 -1
  19. package/cjs/common/interaction.d.ts +5 -5
  20. package/cjs/common/messages.gen.d.ts +86 -104
  21. package/cjs/index.d.ts +2 -6
  22. package/cjs/index.js +5 -7
  23. package/cjs/modules/cssrules.js +1 -1
  24. package/cjs/modules/focus.js +2 -2
  25. package/cjs/modules/fonts.js +2 -2
  26. package/cjs/modules/img.js +5 -6
  27. package/cjs/modules/input.d.ts +1 -1
  28. package/cjs/modules/input.js +23 -15
  29. package/cjs/modules/mouse.js +1 -1
  30. package/cjs/modules/timing.js +3 -7
  31. package/cjs/modules/viewport.js +1 -3
  32. package/cjs/vendors/finder/finder.d.ts +1 -1
  33. package/lib/app/guards.d.ts +12 -11
  34. package/lib/app/guards.js +1 -2
  35. package/lib/app/index.d.ts +8 -11
  36. package/lib/app/index.js +9 -28
  37. package/lib/app/logger.d.ts +3 -3
  38. package/lib/app/messages.d.ts +52 -0
  39. package/lib/app/messages.gen.d.ts +6 -8
  40. package/lib/app/messages.gen.js +87 -107
  41. package/lib/app/messages.js +181 -0
  42. package/lib/app/nodes.d.ts +1 -1
  43. package/lib/app/observer/iframe_offsets.d.ts +1 -1
  44. package/lib/app/observer/observer.js +5 -5
  45. package/lib/app/observer/top_observer.d.ts +2 -2
  46. package/lib/app/observer/top_observer.js +1 -1
  47. package/lib/app/session.d.ts +2 -2
  48. package/lib/app/ticker.d.ts +1 -1
  49. package/lib/common/interaction.d.ts +5 -5
  50. package/lib/common/messages.gen.d.ts +86 -104
  51. package/lib/common/tsconfig.tsbuildinfo +1 -1
  52. package/lib/index.d.ts +2 -6
  53. package/lib/index.js +6 -8
  54. package/lib/modules/cssrules.js +1 -1
  55. package/lib/modules/focus.js +2 -2
  56. package/lib/modules/fonts.js +2 -2
  57. package/lib/modules/img.js +5 -6
  58. package/lib/modules/input.d.ts +1 -1
  59. package/lib/modules/input.js +23 -15
  60. package/lib/modules/mouse.js +1 -1
  61. package/lib/modules/timing.js +4 -8
  62. package/lib/modules/viewport.js +1 -3
  63. package/lib/vendors/finder/finder.d.ts +1 -1
  64. package/package.json +3 -8
  65. package/tsconfig-base.json +1 -2
  66. package/CHANGELOG.md +0 -19
  67. package/cjs/modules/network.d.ts +0 -28
  68. package/cjs/modules/network.js +0 -203
  69. package/jest.config.js +0 -11
  70. package/lib/modules/network.d.ts +0 -28
  71. package/lib/modules/network.js +0 -200
@@ -4,18 +4,18 @@ exports.getInputLabel = void 0;
4
4
  const utils_js_1 = require("../utils.js");
5
5
  const guards_js_1 = require("../app/guards.js");
6
6
  const messages_gen_js_1 = require("../app/messages.gen.js");
7
- const INPUT_TYPES = ['text', 'password', 'email', 'search', 'number', 'range', 'date', 'tel'];
7
+ const INPUT_TYPES = ['text', 'password', 'email', 'search', 'number', 'range', 'date'];
8
8
  function isTextEditable(node) {
9
- if ((0, guards_js_1.hasTag)(node, 'textarea')) {
9
+ if ((0, guards_js_1.hasTag)(node, 'TEXTAREA')) {
10
10
  return true;
11
11
  }
12
- if (!(0, guards_js_1.hasTag)(node, 'input')) {
12
+ if (!(0, guards_js_1.hasTag)(node, 'INPUT')) {
13
13
  return false;
14
14
  }
15
15
  return INPUT_TYPES.includes(node.type);
16
16
  }
17
17
  function isCheckable(node) {
18
- if (!(0, guards_js_1.hasTag)(node, 'input')) {
18
+ if (!(0, guards_js_1.hasTag)(node, 'INPUT')) {
19
19
  return false;
20
20
  }
21
21
  const type = node.type;
@@ -25,7 +25,7 @@ const labelElementFor = utils_js_1.IN_BROWSER && 'labels' in HTMLInputElement.pr
25
25
  ? (node) => {
26
26
  let p = node;
27
27
  while ((p = p.parentNode) !== null) {
28
- if ((0, guards_js_1.hasTag)(p, 'label')) {
28
+ if ((0, guards_js_1.hasTag)(p, 'LABEL')) {
29
29
  return p;
30
30
  }
31
31
  }
@@ -37,7 +37,7 @@ const labelElementFor = utils_js_1.IN_BROWSER && 'labels' in HTMLInputElement.pr
37
37
  : (node) => {
38
38
  let p = node;
39
39
  while ((p = p.parentNode) !== null) {
40
- if ((0, guards_js_1.hasTag)(p, 'label')) {
40
+ if ((0, guards_js_1.hasTag)(p, 'LABEL')) {
41
41
  return p;
42
42
  }
43
43
  }
@@ -68,7 +68,7 @@ function default_1(app, opts) {
68
68
  const options = Object.assign({
69
69
  obscureInputNumbers: true,
70
70
  obscureInputEmails: true,
71
- defaultInputMode: 0 /* InputMode.Plain */,
71
+ defaultInputMode: 0 /* Plain */,
72
72
  obscureInputDates: false,
73
73
  }, opts);
74
74
  function sendInputTarget(id, node) {
@@ -81,22 +81,22 @@ function default_1(app, opts) {
81
81
  let value = node.value;
82
82
  let inputMode = options.defaultInputMode;
83
83
  if (node.type === 'password' || app.sanitizer.isHidden(id)) {
84
- inputMode = 2 /* InputMode.Hidden */;
84
+ inputMode = 2 /* Hidden */;
85
85
  }
86
86
  else if (app.sanitizer.isObscured(id) ||
87
- (inputMode === 0 /* InputMode.Plain */ &&
87
+ (inputMode === 0 /* Plain */ &&
88
88
  ((options.obscureInputNumbers && node.type !== 'date' && /\d\d\d\d/.test(value)) ||
89
89
  (options.obscureInputDates && node.type === 'date') ||
90
90
  (options.obscureInputEmails && (node.type === 'email' || !!~value.indexOf('@')))))) {
91
- inputMode = 1 /* InputMode.Obscured */;
91
+ inputMode = 1 /* Obscured */;
92
92
  }
93
93
  let mask = 0;
94
94
  switch (inputMode) {
95
- case 2 /* InputMode.Hidden */:
95
+ case 2 /* Hidden */:
96
96
  mask = -1;
97
97
  value = '';
98
98
  break;
99
- case 1 /* InputMode.Obscured */:
99
+ case 1 /* Obscured */:
100
100
  mask = value.length;
101
101
  value = '';
102
102
  break;
@@ -115,7 +115,11 @@ function default_1(app, opts) {
115
115
  inputValues.forEach((value, id) => {
116
116
  const node = app.nodes.getNode(id);
117
117
  if (!node)
118
- return inputValues.delete(id);
118
+ return;
119
+ if (!isTextEditable(node)) {
120
+ inputValues.delete(id);
121
+ return;
122
+ }
119
123
  if (value !== node.value) {
120
124
  inputValues.set(id, node.value);
121
125
  if (!registeredTargets.has(id)) {
@@ -128,7 +132,11 @@ function default_1(app, opts) {
128
132
  checkableValues.forEach((checked, id) => {
129
133
  const node = app.nodes.getNode(id);
130
134
  if (!node)
131
- return checkableValues.delete(id);
135
+ return;
136
+ if (!isCheckable(node)) {
137
+ checkableValues.delete(id);
138
+ return;
139
+ }
132
140
  if (checked !== node.checked) {
133
141
  checkableValues.set(id, node.checked);
134
142
  app.send((0, messages_gen_js_1.SetInputChecked)(id, node.checked));
@@ -142,7 +150,7 @@ function default_1(app, opts) {
142
150
  return;
143
151
  }
144
152
  // TODO: support multiple select (?): use selectedOptions; Need send target?
145
- if ((0, guards_js_1.hasTag)(node, 'select')) {
153
+ if ((0, guards_js_1.hasTag)(node, 'SELECT')) {
146
154
  sendInputValue(id, node);
147
155
  app.attachEventListener(node, 'change', () => {
148
156
  sendInputValue(id, node);
@@ -80,7 +80,7 @@ function default_1(app) {
80
80
  if (dl !== null) {
81
81
  return dl;
82
82
  }
83
- if ((0, guards_js_1.hasTag)(target, 'input')) {
83
+ if ((0, guards_js_1.hasTag)(target, 'INPUT')) {
84
84
  return (0, input_js_1.getInputLabel)(target);
85
85
  }
86
86
  if (isClickable(target)) {
@@ -10,7 +10,7 @@ function getPaintBlocks(resources) {
10
10
  for (let i = 0; i < elements.length; i++) {
11
11
  const element = elements[i];
12
12
  let src = '';
13
- if ((0, guards_js_1.hasTag)(element, 'img')) {
13
+ if ((0, guards_js_1.hasTag)(element, 'IMG')) {
14
14
  src = element.currentSrc || element.src;
15
15
  }
16
16
  if (!src) {
@@ -75,7 +75,7 @@ function default_1(app, opts) {
75
75
  if (resources !== null) {
76
76
  resources[entry.name] = entry.startTime + entry.duration;
77
77
  }
78
- app.send((0, messages_gen_js_1.ResourceTiming)(entry.startTime + (0, utils_js_1.getTimeOrigin)(), entry.duration, entry.responseStart && entry.startTime ? entry.responseStart - entry.startTime : 0, entry.transferSize > entry.encodedBodySize ? entry.transferSize - entry.encodedBodySize : 0, entry.encodedBodySize || 0, entry.decodedBodySize || 0, entry.name, entry.initiatorType));
78
+ app.send((0, messages_gen_js_1.ResourceTiming)(entry.startTime + performance.timing.navigationStart, entry.duration, entry.responseStart && entry.startTime ? entry.responseStart - entry.startTime : 0, entry.transferSize > entry.encodedBodySize ? entry.transferSize - entry.encodedBodySize : 0, entry.encodedBodySize || 0, entry.decodedBodySize || 0, entry.name, entry.initiatorType));
79
79
  }
80
80
  const observer = new PerformanceObserver((list) => list.getEntries().forEach(resourceTiming));
81
81
  let prevSessionID;
@@ -112,11 +112,7 @@ function default_1(app, opts) {
112
112
  }
113
113
  if (performance.timing.loadEventEnd || performance.now() > 30000) {
114
114
  pageLoadTimingSent = true;
115
- const {
116
- // should be ok to use here, (https://github.com/mdn/content/issues/4713)
117
- // since it is compared with the values obtained on the page load (before any possible sleep state)
118
- // deprecated though
119
- navigationStart, requestStart, responseStart, responseEnd, domContentLoadedEventStart, domContentLoadedEventEnd, loadEventStart, loadEventEnd, } = performance.timing;
115
+ const { navigationStart, requestStart, responseStart, responseEnd, domContentLoadedEventStart, domContentLoadedEventEnd, loadEventStart, loadEventEnd, } = performance.timing;
120
116
  app.send((0, messages_gen_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));
121
117
  }
122
118
  }, 30);
@@ -5,14 +5,12 @@ const messages_gen_js_1 = require("../app/messages.gen.js");
5
5
  function default_1(app) {
6
6
  let url, width, height;
7
7
  let navigationStart;
8
- let referrer = document.referrer;
9
8
  const sendSetPageLocation = app.safe(() => {
10
9
  const { URL } = document;
11
10
  if (URL !== url) {
12
11
  url = URL;
13
- app.send((0, messages_gen_js_1.SetPageLocation)(url, referrer, navigationStart));
12
+ app.send((0, messages_gen_js_1.SetPageLocation)(url, document.referrer, navigationStart));
14
13
  navigationStart = 0;
15
- referrer = url;
16
14
  }
17
15
  });
18
16
  const sendSetViewportSize = app.safe(() => {
@@ -1,4 +1,4 @@
1
- export type Options = {
1
+ export declare type Options = {
2
2
  root: Element;
3
3
  idName: (name: string) => boolean;
4
4
  className: (name: string) => boolean;
@@ -4,17 +4,18 @@ export declare function isElementNode(node: Node): node is Element;
4
4
  export declare function isTextNode(node: Node): node is Text;
5
5
  export declare function isDocument(node: Node): node is Document;
6
6
  export declare function isRootNode(node: Node): node is Document | DocumentFragment;
7
- type TagTypeMap = {
8
- html: HTMLHtmlElement;
9
- body: HTMLBodyElement;
10
- img: HTMLImageElement;
11
- input: HTMLInputElement;
12
- textarea: HTMLTextAreaElement;
13
- select: HTMLSelectElement;
14
- label: HTMLLabelElement;
15
- iframe: HTMLIFrameElement;
16
- style: HTMLStyleElement | SVGStyleElement;
17
- link: HTMLLinkElement;
7
+ declare type TagTypeMap = {
8
+ HTML: HTMLHtmlElement;
9
+ BODY: HTMLBodyElement;
10
+ IMG: HTMLImageElement;
11
+ INPUT: HTMLInputElement;
12
+ TEXTAREA: HTMLTextAreaElement;
13
+ SELECT: HTMLSelectElement;
14
+ LABEL: HTMLLabelElement;
15
+ IFRAME: HTMLIFrameElement;
16
+ STYLE: HTMLStyleElement;
17
+ style: SVGStyleElement;
18
+ LINK: HTMLLinkElement;
18
19
  };
19
20
  export declare function hasTag<T extends keyof TagTypeMap>(el: Node, tagName: T): el is TagTypeMap[typeof tagName];
20
21
  export {};
package/lib/app/guards.js CHANGED
@@ -18,6 +18,5 @@ export function isRootNode(node) {
18
18
  return node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
19
19
  }
20
20
  export function hasTag(el, tagName) {
21
- // @ts-ignore
22
- return el.localName === tagName;
21
+ return el.nodeName === tagName;
23
22
  }
@@ -22,19 +22,19 @@ interface OnStartInfo {
22
22
  userUUID: string;
23
23
  }
24
24
  declare const CANCELED: "canceled";
25
- type SuccessfulStart = OnStartInfo & {
25
+ declare type SuccessfulStart = OnStartInfo & {
26
26
  success: true;
27
27
  };
28
- type UnsuccessfulStart = {
28
+ declare type UnsuccessfulStart = {
29
29
  reason: typeof CANCELED | string;
30
30
  success: false;
31
31
  };
32
32
  declare const UnsuccessfulStart: (reason: string) => UnsuccessfulStart;
33
33
  declare const SuccessfulStart: (body: OnStartInfo) => SuccessfulStart;
34
- export type StartPromiseReturn = SuccessfulStart | UnsuccessfulStart;
35
- type StartCallback = (i: OnStartInfo) => void;
36
- type CommitCallback = (messages: Array<Message>) => void;
37
- type AppOptions = {
34
+ export declare type StartPromiseReturn = SuccessfulStart | UnsuccessfulStart;
35
+ declare type StartCallback = (i: OnStartInfo) => void;
36
+ declare type CommitCallback = (messages: Array<Message>) => void;
37
+ declare type AppOptions = {
38
38
  revID: string;
39
39
  node_id: string;
40
40
  session_reset_key: string;
@@ -51,7 +51,7 @@ type AppOptions = {
51
51
  sessionStorage: Storage | null;
52
52
  onStart?: StartCallback;
53
53
  } & WebworkerOptions & SessOptions;
54
- export type Options = AppOptions & ObserverOptions & SanitizerOptions;
54
+ export declare type Options = AppOptions & ObserverOptions & SanitizerOptions;
55
55
  export declare const DEFAULT_INGEST_POINT = "https://api.openreplay.com/ingest";
56
56
  export default class App {
57
57
  readonly nodes: Nodes;
@@ -75,7 +75,6 @@ export default class App {
75
75
  private readonly worker?;
76
76
  constructor(projectKey: string, sessionToken: string | undefined, options: Partial<Options>);
77
77
  private _debug;
78
- private _usingOldFetchPlugin;
79
78
  send(message: Message, urgent?: boolean): void;
80
79
  private commit;
81
80
  private delay;
@@ -101,9 +100,7 @@ export default class App {
101
100
  };
102
101
  getSessionToken(): string | undefined;
103
102
  getSessionID(): string | undefined;
104
- getSessionURL(options?: {
105
- withCurrentTime?: boolean;
106
- }): string | undefined;
103
+ getSessionURL(): string | undefined;
107
104
  getHost(): string;
108
105
  getProjectKey(): string;
109
106
  getBaseHref(): string;
package/lib/app/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Timestamp, Metadata, UserID } from './messages.gen.js';
2
- import { now, adjustTimeOrigin, deprecationWarn } from '../utils.js';
2
+ import { now, adjustTimeOrigin } from '../utils.js';
3
3
  import Nodes from './nodes.js';
4
4
  import Observer from './observer/top_observer.js';
5
5
  import Sanitizer from './sanitizer.js';
@@ -30,8 +30,7 @@ export default class App {
30
30
  this.stopCallbacks = [];
31
31
  this.commitCallbacks = [];
32
32
  this.activityState = ActivityState.NotActive;
33
- this.version = '4.1.10'; // TODO: version compatability check inside each plugin.
34
- this._usingOldFetchPlugin = false;
33
+ this.version = '4.1.11'; // TODO: version compatability check inside each plugin.
35
34
  this.delay = 0;
36
35
  this.projectKey = projectKey;
37
36
  this.options = Object.assign({
@@ -74,7 +73,7 @@ export default class App {
74
73
  this.session.applySessionHash(sessionToken);
75
74
  }
76
75
  try {
77
- this.worker = new Worker(URL.createObjectURL(new Blob(['"use strict";class t{constructor(t,i,s,e=10,n=1e3){this.onUnauthorised=i,this.onFailure=s,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.ingestURL=t+"/v1/web/i"}authorise(t){this.token=t,this.busy||this.sendNext()}push(t){this.busy||!this.token?this.queue.push(t):this.sendBatch(t)}sendNext(){const t=this.queue.shift();t?this.sendBatch(t):this.busy=!1}retry(t){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`):(this.attemptsCount++,setTimeout(()=>this.sendBatch(t),this.ATTEMPT_TIMEOUT*this.attemptsCount))}sendBatch(t){this.busy=!0,fetch(this.ingestURL,{body:t,method:"POST",headers:{Authorization:"Bearer "+this.token},keepalive:t.length<65536}).then(i=>{if(401===i.status)return this.busy=!1,void this.onUnauthorised();i.status>=400?this.retry(t):(this.attemptsCount=0,this.sendNext())}).catch(i=>{console.warn("OpenReplay:",i),this.retry(t)})}clean(){this.queue.length=0,this.token=null}}const i="function"==typeof TextEncoder?new TextEncoder:{encode(t){const i=t.length,s=new Uint8Array(3*i);let e=-1;for(let n=0,r=0,h=0;h!==i;){if(n=t.charCodeAt(h),h+=1,n>=55296&&n<=56319){if(h===i){s[e+=1]=239,s[e+=1]=191,s[e+=1]=189;break}if(r=t.charCodeAt(h),!(r>=56320&&r<=57343)){s[e+=1]=239,s[e+=1]=191,s[e+=1]=189;continue}if(n=1024*(n-55296)+r-56320+65536,h+=1,n>65535){s[e+=1]=240|n>>>18,s[e+=1]=128|n>>>12&63,s[e+=1]=128|n>>>6&63,s[e+=1]=128|63&n;continue}}n<=127?s[e+=1]=0|n:n<=2047?(s[e+=1]=192|n>>>6,s[e+=1]=128|63&n):(s[e+=1]=224|n>>>12,s[e+=1]=128|n>>>6&63,s[e+=1]=128|63&n)}return s.subarray(0,e+1)}};class s extends class{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}checkpoint(){this.checkpointOffset=this.offset}get isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,i){this.data.set(t,i)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const s=i.encode(t),e=s.byteLength;return!(!this.uint(e)||this.offset+e>this.size)&&(this.data.set(s,this.offset),this.offset+=e,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}{encode(t){switch(t[0]){case 0:return this.uint(t[1]);case 4:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 11:return this.uint(t[1]);case 12:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 17:return this.uint(t[1])&&this.string(t[2]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 20:return this.uint(t[1])&&this.uint(t[2]);case 21:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8]);case 22:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 24:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 27:return this.string(t[1])&&this.string(t[2]);case 28:case 29:return this.string(t[1]);case 30:return this.string(t[1])&&this.string(t[2]);case 37:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3]);case 38:return this.uint(t[1])&&this.uint(t[2]);case 39:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 41:return this.string(t[1])&&this.string(t[2]);case 42:return this.string(t[1]);case 44:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 45:case 46:return this.string(t[1])&&this.string(t[2]);case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 50:return this.uint(t[1])&&this.string(t[2]);case 51:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 54:return this.uint(t[1])&&this.string(t[2]);case 55:return this.boolean(t[1]);case 57:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:return this.int(t[1]);case 59:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6])&&this.string(t[7]);case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 61:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 63:case 64:return this.string(t[1])&&this.string(t[2]);case 67:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 70:return this.uint(t[1])&&this.uint(t[2]);case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 75:case 76:case 77:return this.uint(t[1])&&this.uint(t[2]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 79:return this.string(t[1])&&this.string(t[2]);case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 82:return this.uint(t[1])&&this.uint(t[2])}}}class e{constructor(){this.idx=1,this.backDict={}}getKey(t){let i=!1;return this.backDict[t]||(i=!0,this.backDict[t]=this.idx++),[this.backDict[t],i]}}class n{constructor(t,i,n,r){this.pageNo=t,this.timestamp=i,this.url=n,this.onBatch=r,this.nextIndex=0,this.beaconSize=2e5,this.encoder=new s(this.beaconSize),this.strDict=new e,this.sizeBuffer=new Uint8Array(3),this.isEmpty=!0,this.beaconSizeLimit=1e6,this.prepare()}writeType(t){return this.encoder.uint(t[0])}writeFields(t){return this.encoder.encode(t)}writeSizeAt(t,i){for(let i=0;i<3;i++)this.sizeBuffer[i]=t>>8*i;this.encoder.set(this.sizeBuffer,i)}prepare(){if(!this.encoder.isEmpty)return;const t=[81,1,this.pageNo,this.nextIndex,this.timestamp,this.url];this.writeType(t),this.writeFields(t),this.isEmpty=!0}writeWithSize(t){const i=this.encoder;if(!this.writeType(t)||!i.skip(3))return!1;const s=i.getCurrentOffset(),e=this.writeFields(t);if(e){const e=i.getCurrentOffset()-s;if(e>16777215)return console.warn("OpenReplay: max message size overflow."),!1;this.writeSizeAt(e,s-3),i.checkpoint(),this.isEmpty=this.isEmpty&&0===t[0],this.nextIndex++}return e}setBeaconSizeLimit(t){this.beaconSizeLimit=t}applyDict(t){const[i,s]=this.strDict.getKey(t);return s&&this.writeMessage([50,i,t]),i}writeMessage(t){0===t[0]&&(this.timestamp=t[1]),4===t[0]&&(this.url=t[1]),12===t[0]&&(t=[51,t[1],this.applyDict(t[2]),this.applyDict(t[3])]),this.writeWithSize(t)||(this.finaliseBatch(),this.writeWithSize(t)||(this.encoder=new s(this.beaconSizeLimit),this.prepare(),this.writeWithSize(t)||console.warn("OpenReplay: beacon size overflow. Skipping large message.",t,this),this.encoder=new s(this.beaconSize),this.prepare()))}finaliseBatch(){this.isEmpty||(this.onBatch(this.encoder.flush()),this.prepare())}clean(){this.encoder.reset()}}var r;!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active"}(r||(r={}));let h=null,u=null;r.NotActive;let a=0;function c(){u&&u.finaliseBatch()}function o(){r.Stopping,null!==l&&(clearInterval(l),l=null),u&&(u.clean(),u=null),h&&(h.clean(),h=null),r.NotActive}function g(){postMessage("restart"),o()}let f,l=null;self.onmessage=({data:i})=>{if(null!=i){if("stop"===i)return c(),void o();if(Array.isArray(i)){if(null!==u){const t=u;i.forEach(i=>{55===i[0]&&(i[1]?f=setTimeout(()=>g(),18e5):clearTimeout(f)),t.writeMessage(i)})}u||(postMessage("not_init"),0===a&&(a+=1,g()))}else{if("start"===i.type)return r.Starting,h=new t(i.ingestPoint,()=>{g()},t=>{!function(t){postMessage({type:"failure",reason:t}),o()}(t)},i.connAttemptCount,i.connAttemptGap),u=new n(i.pageNo,i.timestamp,i.url,t=>h&&h.push(t)),null===l&&(l=setInterval(c,1e4)),r.Active;if("auth"===i.type){if(!h)throw new Error("WebWorker: sender not initialised. Received auth.");if(!u)throw new Error("WebWorker: writer not initialised. Received auth.");return h.authorise(i.token),void(i.beaconSizeLimit&&u.setBeaconSizeLimit(i.beaconSizeLimit))}}}else c()};'], { type: 'text/javascript' })));
76
+ this.worker = new Worker(URL.createObjectURL(new Blob(['"use strict";class t{constructor(t,i,s,e=10,n=1e3){this.onUnauthorised=i,this.onFailure=s,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.ingestURL=t+"/v1/web/i"}authorise(t){this.token=t}push(t){this.busy||!this.token?this.queue.push(t):this.sendBatch(t)}retry(t){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`):(this.attemptsCount++,setTimeout(()=>this.sendBatch(t),this.ATTEMPT_TIMEOUT*this.attemptsCount))}sendBatch(t){this.busy=!0,fetch(this.ingestURL,{body:t,method:"POST",headers:{Authorization:"Bearer "+this.token},keepalive:t.length<65536}).then(i=>{if(401===i.status)return this.busy=!1,void this.onUnauthorised();if(i.status>=400)return void this.retry(t);this.attemptsCount=0;const s=this.queue.shift();s?this.sendBatch(s):this.busy=!1}).catch(i=>{console.warn("OpenReplay:",i),this.retry(t)})}clean(){this.queue.length=0}}const i="function"==typeof TextEncoder?new TextEncoder:{encode(t){const i=t.length,s=new Uint8Array(3*i);let e=-1;for(let n=0,r=0,h=0;h!==i;){if(n=t.charCodeAt(h),h+=1,n>=55296&&n<=56319){if(h===i){s[e+=1]=239,s[e+=1]=191,s[e+=1]=189;break}if(r=t.charCodeAt(h),!(r>=56320&&r<=57343)){s[e+=1]=239,s[e+=1]=191,s[e+=1]=189;continue}if(n=1024*(n-55296)+r-56320+65536,h+=1,n>65535){s[e+=1]=240|n>>>18,s[e+=1]=128|n>>>12&63,s[e+=1]=128|n>>>6&63,s[e+=1]=128|63&n;continue}}n<=127?s[e+=1]=0|n:n<=2047?(s[e+=1]=192|n>>>6,s[e+=1]=128|63&n):(s[e+=1]=224|n>>>12,s[e+=1]=128|n>>>6&63,s[e+=1]=128|63&n)}return s.subarray(0,e+1)}};class s extends class{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}checkpoint(){this.checkpointOffset=this.offset}isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,i){this.data.set(t,i)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const s=i.encode(t),e=s.byteLength;return!(!this.uint(e)||this.offset+e>this.size)&&(this.data.set(s,this.offset),this.offset+=e,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}{encode(t){switch(t[0]){case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 82:return this.uint(t[1])&&this.uint(t[2]);case 0:return this.uint(t[1]);case 4:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 11:return this.uint(t[1]);case 12:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 17:return this.uint(t[1])&&this.string(t[2]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 20:return this.uint(t[1])&&this.uint(t[2]);case 22:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 24:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 25:return this.string(t[1])&&this.string(t[2])&&this.string(t[3]);case 27:return this.string(t[1])&&this.string(t[2]);case 28:case 29:return this.string(t[1]);case 30:return this.string(t[1])&&this.string(t[2]);case 37:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3]);case 38:return this.uint(t[1])&&this.uint(t[2]);case 39:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 41:return this.string(t[1])&&this.string(t[2]);case 42:return this.string(t[1]);case 44:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 45:case 46:return this.string(t[1])&&this.string(t[2]);case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 54:return this.uint(t[1])&&this.string(t[2]);case 55:return this.boolean(t[1]);case 57:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:return this.int(t[1]);case 59:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6])&&this.string(t[7]);case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 61:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 63:case 64:return this.string(t[1])&&this.string(t[2]);case 67:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 70:return this.uint(t[1])&&this.uint(t[2]);case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 75:case 76:case 77:return this.uint(t[1])&&this.uint(t[2]);case 79:return this.string(t[1])&&this.string(t[2]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])}}}class e{constructor(t,i,e,n){this.pageNo=t,this.timestamp=i,this.url=e,this.onBatch=n,this.nextIndex=0,this.beaconSize=2e5,this.encoder=new s(this.beaconSize),this.sizeBuffer=new Uint8Array(3),this.isEmpty=!0,this.beaconSizeLimit=1e6,this.prepare()}writeType(t){return this.encoder.uint(t[0])}writeFields(t){return this.encoder.encode(t)}writeSizeAt(t,i){for(let i=0;i<3;i++)this.sizeBuffer[i]=t>>8*i;this.encoder.set(this.sizeBuffer,i)}prepare(){if(!this.encoder.isEmpty())return;const t=[81,1,this.pageNo,this.nextIndex,this.timestamp,this.url];this.writeType(t),this.writeFields(t),this.isEmpty=!0}writeWithSize(t){const i=this.encoder;if(!this.writeType(t)||!i.skip(3))return!1;const s=i.getCurrentOffset(),e=this.writeFields(t);if(e){const e=i.getCurrentOffset()-s;if(e>16777215)return console.warn("OpenReplay: max message size overflow."),!1;this.writeSizeAt(e,s-3),i.checkpoint(),this.isEmpty=this.isEmpty&&0===t[0],this.nextIndex++}return e}setBeaconSizeLimit(t){this.beaconSizeLimit=t}writeMessage(t){if(0===t[0]&&(this.timestamp=t[1]),4===t[0]&&(this.url=t[1]),!this.writeWithSize(t))for(this.finaliseBatch();!this.writeWithSize(t);){if(this.beaconSize===this.beaconSizeLimit)return console.warn("OpenReplay: beacon size overflow. Skipping large message.",t,this),this.encoder.reset(),void this.prepare();this.beaconSize=Math.min(2*this.beaconSize,this.beaconSizeLimit),this.encoder=new s(this.beaconSize),this.prepare()}}finaliseBatch(){this.isEmpty||(this.onBatch(this.encoder.flush()),this.prepare())}clean(){this.encoder.reset()}}var n;!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active"}(n||(n={}));let r=null,h=null;function u(){h&&h.finaliseBatch()}function a(){n.Stopping,null!==g&&(clearInterval(g),g=null),h&&(h.clean(),h=null),r&&(r.clean(),r=null),n.NotActive}function o(){postMessage("restart"),a()}n.NotActive;let c,g=null;self.onmessage=({data:i})=>{if(null!=i){if("stop"===i)return u(),void a();if(Array.isArray(i)){if(!h)throw new Error("WebWorker: writer not initialised. Service Should be Started.");const t=h;i.forEach(i=>{55===i[0]&&(i[1]?c=setTimeout(()=>o(),18e5):clearTimeout(c)),t.writeMessage(i)})}else{if("start"===i.type)return n.Starting,r=new t(i.ingestPoint,()=>{o()},t=>{!function(t){postMessage({type:"failure",reason:t}),a()}(t)},i.connAttemptCount,i.connAttemptGap),h=new e(i.pageNo,i.timestamp,i.url,t=>r&&r.push(t)),null===g&&(g=setInterval(u,1e4)),n.Active;if("auth"===i.type){if(!r)throw new Error("WebWorker: sender not initialised. Received auth.");if(!h)throw new Error("WebWorker: writer not initialised. Received auth.");return r.authorise(i.token),void(i.beaconSizeLimit&&h.setBeaconSizeLimit(i.beaconSizeLimit))}}}else u()};'], { type: 'text/javascript' })));
78
77
  this.worker.onerror = (e) => {
79
78
  this._debug('webworker_error', e);
80
79
  };
@@ -83,9 +82,6 @@ export default class App {
83
82
  this.stop(false);
84
83
  this.start({}, true);
85
84
  }
86
- else if (data === 'not_init') {
87
- console.warn('WebWorker: writer not initialised. Restarting tracker');
88
- }
89
85
  else if (data.type === 'failure') {
90
86
  this.stop(false);
91
87
  this._debug('worker_failed', data.reason);
@@ -123,16 +119,6 @@ export default class App {
123
119
  if (this.activityState === ActivityState.NotActive) {
124
120
  return;
125
121
  }
126
- // === Back compatibility with Fetch/Axios plugins ===
127
- if (message[0] === 39 /* MType.Fetch */) {
128
- this._usingOldFetchPlugin = true;
129
- deprecationWarn('Fetch plugin', "'network' init option", '/installation/network-options');
130
- deprecationWarn('Axios plugin', "'network' init option", '/installation/network-options');
131
- }
132
- if (this._usingOldFetchPlugin && message[0] === 21 /* MType.NetworkRequest */) {
133
- return;
134
- }
135
- // ====================================================
136
122
  this.messages.push(message);
137
123
  // TODO: commit on start if there were `urgent` sends;
138
124
  // Clarify where urgent can be used for;
@@ -227,21 +213,16 @@ export default class App {
227
213
  getSessionID() {
228
214
  return this.session.getInfo().sessionID || undefined;
229
215
  }
230
- getSessionURL(options) {
231
- const { projectID, sessionID, timestamp } = this.session.getInfo();
216
+ getSessionURL() {
217
+ const { projectID, sessionID } = this.session.getInfo();
232
218
  if (!projectID || !sessionID) {
233
219
  this.debug.error('OpenReplay error: Unable to build session URL');
234
220
  return undefined;
235
221
  }
236
222
  const ingest = this.options.ingestPoint;
237
- const isSaas = /api\.openreplay\.com/.test(ingest);
238
- const projectPath = isSaas ? 'https://openreplay.com/ingest' : ingest;
239
- const url = projectPath.replace(/ingest$/, `${projectID}/session/${sessionID}`);
240
- if (options === null || options === void 0 ? void 0 : options.withCurrentTime) {
241
- const jumpTo = now() - timestamp;
242
- return `${url}?jumpto=${jumpTo}`;
243
- }
244
- return url;
223
+ const isSaas = ingest === DEFAULT_INGEST_POINT;
224
+ const projectPath = isSaas ? ingest.replace('api', 'app') : ingest;
225
+ return projectPath.replace(/ingest$/, `${projectID}/session/${sessionID}`);
245
226
  }
246
227
  getHost() {
247
228
  return new URL(this.options.ingestPoint).host;
@@ -344,7 +325,7 @@ export default class App {
344
325
  return Promise.reject('no worker found after start request (this might not happen)');
345
326
  }
346
327
  if (this.activityState === ActivityState.NotActive) {
347
- return Promise.reject('Tracker stopped during authorization');
328
+ return Promise.reject('Tracker stopped during authorisation');
348
329
  }
349
330
  const { token, userUUID, projectID, beaconSizeLimit, delay, // derived from token
350
331
  sessionID, // derived from token
@@ -5,8 +5,8 @@ export declare const LogLevel: {
5
5
  readonly Errors: 2;
6
6
  readonly Silent: 0;
7
7
  };
8
- type LogLevel = typeof LogLevel[keyof typeof LogLevel];
9
- type CustomLevel = {
8
+ declare type LogLevel = typeof LogLevel[keyof typeof LogLevel];
9
+ declare type CustomLevel = {
10
10
  error: boolean;
11
11
  warn: boolean;
12
12
  log: boolean;
@@ -15,7 +15,7 @@ interface _Options {
15
15
  level: LogLevel | CustomLevel;
16
16
  messages?: number[];
17
17
  }
18
- export type Options = true | _Options | LogLevel;
18
+ export declare type Options = true | _Options | LogLevel;
19
19
  export default class Logger {
20
20
  private readonly options;
21
21
  constructor(options?: Options);
@@ -0,0 +1,52 @@
1
+ import * as Messages from '../common/messages.gen.js';
2
+ export { default } from '../common/messages.gen.js';
3
+ export declare function BatchMetadata(version: number, pageNo: number, firstIndex: number, timestamp: number, location: string): Messages.BatchMetadata;
4
+ export declare function PartitionedMessage(partNo: number, partTotal: number): Messages.PartitionedMessage;
5
+ export declare function Timestamp(timestamp: number): Messages.Timestamp;
6
+ export declare function SetPageLocation(url: string, referrer: string, navigationStart: number): Messages.SetPageLocation;
7
+ export declare function SetViewportSize(width: number, height: number): Messages.SetViewportSize;
8
+ export declare function SetViewportScroll(x: number, y: number): Messages.SetViewportScroll;
9
+ export declare function CreateDocument(): Messages.CreateDocument;
10
+ export declare function CreateElementNode(id: number, parentID: number, index: number, tag: string, svg: boolean): Messages.CreateElementNode;
11
+ export declare function CreateTextNode(id: number, parentID: number, index: number): Messages.CreateTextNode;
12
+ export declare function MoveNode(id: number, parentID: number, index: number): Messages.MoveNode;
13
+ export declare function RemoveNode(id: number): Messages.RemoveNode;
14
+ export declare function SetNodeAttribute(id: number, name: string, value: string): Messages.SetNodeAttribute;
15
+ export declare function RemoveNodeAttribute(id: number, name: string): Messages.RemoveNodeAttribute;
16
+ export declare function SetNodeData(id: number, data: string): Messages.SetNodeData;
17
+ export declare function SetNodeScroll(id: number, x: number, y: number): Messages.SetNodeScroll;
18
+ export declare function SetInputTarget(id: number, label: string): Messages.SetInputTarget;
19
+ export declare function SetInputValue(id: number, value: string, mask: number): Messages.SetInputValue;
20
+ export declare function SetInputChecked(id: number, checked: boolean): Messages.SetInputChecked;
21
+ export declare function MouseMove(x: number, y: number): Messages.MouseMove;
22
+ export declare function ConsoleLog(level: string, value: string): Messages.ConsoleLog;
23
+ export declare function PageLoadTiming(requestStart: number, responseStart: number, responseEnd: number, domContentLoadedEventStart: number, domContentLoadedEventEnd: number, loadEventStart: number, loadEventEnd: number, firstPaint: number, firstContentfulPaint: number): Messages.PageLoadTiming;
24
+ export declare function PageRenderTiming(speedIndex: number, visuallyComplete: number, timeToInteractive: number): Messages.PageRenderTiming;
25
+ export declare function JSException(name: string, message: string, payload: string, metadata: string): Messages.JSException;
26
+ export declare function RawCustomEvent(name: string, payload: string): Messages.RawCustomEvent;
27
+ export declare function UserID(id: string): Messages.UserID;
28
+ export declare function UserAnonymousID(id: string): Messages.UserAnonymousID;
29
+ export declare function Metadata(key: string, value: string): Messages.Metadata;
30
+ export declare function CSSInsertRule(id: number, rule: string, index: number): Messages.CSSInsertRule;
31
+ export declare function CSSDeleteRule(id: number, index: number): Messages.CSSDeleteRule;
32
+ export declare function Fetch(method: string, url: string, request: string, response: string, status: number, timestamp: number, duration: number): Messages.Fetch;
33
+ export declare function Profiler(name: string, duration: number, args: string, result: string): Messages.Profiler;
34
+ export declare function OTable(key: string, value: string): Messages.OTable;
35
+ export declare function StateAction(type: string): Messages.StateAction;
36
+ export declare function Redux(action: string, state: string, duration: number): Messages.Redux;
37
+ export declare function Vuex(mutation: string, state: string): Messages.Vuex;
38
+ export declare function MobX(type: string, payload: string): Messages.MobX;
39
+ export declare function NgRx(action: string, state: string, duration: number): Messages.NgRx;
40
+ export declare function GraphQL(operationKind: string, operationName: string, variables: string, response: string): Messages.GraphQL;
41
+ export declare function PerformanceTrack(frames: number, ticks: number, totalJSHeapSize: number, usedJSHeapSize: number): Messages.PerformanceTrack;
42
+ export declare function ResourceTiming(timestamp: number, duration: number, ttfb: number, headerSize: number, encodedBodySize: number, decodedBodySize: number, url: string, initiator: string): Messages.ResourceTiming;
43
+ export declare function ConnectionInformation(downlink: number, type: string): Messages.ConnectionInformation;
44
+ export declare function SetPageVisibility(hidden: boolean): Messages.SetPageVisibility;
45
+ export declare function LongTask(timestamp: number, duration: number, context: number, containerType: number, containerSrc: string, containerId: string, containerName: string): Messages.LongTask;
46
+ export declare function SetNodeAttributeURLBased(id: number, name: string, value: string, baseURL: string): Messages.SetNodeAttributeURLBased;
47
+ export declare function SetCSSDataURLBased(id: number, data: string, baseURL: string): Messages.SetCSSDataURLBased;
48
+ export declare function TechnicalInfo(type: string, value: string): Messages.TechnicalInfo;
49
+ export declare function CustomIssue(name: string, payload: string): Messages.CustomIssue;
50
+ export declare function CSSInsertRuleURLBased(id: number, rule: string, index: number, baseURL: string): Messages.CSSInsertRuleURLBased;
51
+ export declare function MouseClick(id: number, hesitationTime: number, label: string, selector: string): Messages.MouseClick;
52
+ export declare function CreateIFrameDocument(frameID: number, id: number): Messages.CreateIFrameDocument;
@@ -1,5 +1,7 @@
1
1
  import * as Messages from '../common/messages.gen.js';
2
- export { default, Type } from '../common/messages.gen.js';
2
+ export { default } from '../common/messages.gen.js';
3
+ export declare function BatchMetadata(version: number, pageNo: number, firstIndex: number, timestamp: number, location: string): Messages.BatchMetadata;
4
+ export declare function PartitionedMessage(partNo: number, partTotal: number): Messages.PartitionedMessage;
3
5
  export declare function Timestamp(timestamp: number): Messages.Timestamp;
4
6
  export declare function SetPageLocation(url: string, referrer: string, navigationStart: number): Messages.SetPageLocation;
5
7
  export declare function SetViewportSize(width: number, height: number): Messages.SetViewportSize;
@@ -17,11 +19,11 @@ export declare function SetInputTarget(id: number, label: string): Messages.SetI
17
19
  export declare function SetInputValue(id: number, value: string, mask: number): Messages.SetInputValue;
18
20
  export declare function SetInputChecked(id: number, checked: boolean): Messages.SetInputChecked;
19
21
  export declare function MouseMove(x: number, y: number): Messages.MouseMove;
20
- export declare function NetworkRequest(type: string, method: string, url: string, request: string, response: string, status: number, timestamp: number, duration: number): Messages.NetworkRequest;
21
22
  export declare function ConsoleLog(level: string, value: string): Messages.ConsoleLog;
22
23
  export declare function PageLoadTiming(requestStart: number, responseStart: number, responseEnd: number, domContentLoadedEventStart: number, domContentLoadedEventEnd: number, loadEventStart: number, loadEventEnd: number, firstPaint: number, firstContentfulPaint: number): Messages.PageLoadTiming;
23
24
  export declare function PageRenderTiming(speedIndex: number, visuallyComplete: number, timeToInteractive: number): Messages.PageRenderTiming;
24
- export declare function CustomEvent(name: string, payload: string): Messages.CustomEvent;
25
+ export declare function JSExceptionDeprecated(name: string, message: string, payload: string): Messages.JSExceptionDeprecated;
26
+ export declare function RawCustomEvent(name: string, payload: string): Messages.RawCustomEvent;
25
27
  export declare function UserID(id: string): Messages.UserID;
26
28
  export declare function UserAnonymousID(id: string): Messages.UserAnonymousID;
27
29
  export declare function Metadata(key: string, value: string): Messages.Metadata;
@@ -37,8 +39,6 @@ export declare function MobX(type: string, payload: string): Messages.MobX;
37
39
  export declare function NgRx(action: string, state: string, duration: number): Messages.NgRx;
38
40
  export declare function GraphQL(operationKind: string, operationName: string, variables: string, response: string): Messages.GraphQL;
39
41
  export declare function PerformanceTrack(frames: number, ticks: number, totalJSHeapSize: number, usedJSHeapSize: number): Messages.PerformanceTrack;
40
- export declare function StringDict(key: number, value: string): Messages.StringDict;
41
- export declare function SetNodeAttributeDict(id: number, nameKey: number, valueKey: number): Messages.SetNodeAttributeDict;
42
42
  export declare function ResourceTiming(timestamp: number, duration: number, ttfb: number, headerSize: number, encodedBodySize: number, decodedBodySize: number, url: string, initiator: string): Messages.ResourceTiming;
43
43
  export declare function ConnectionInformation(downlink: number, type: string): Messages.ConnectionInformation;
44
44
  export declare function SetPageVisibility(hidden: boolean): Messages.SetPageVisibility;
@@ -57,7 +57,5 @@ export declare function AdoptedSSInsertRuleURLBased(sheetID: number, rule: strin
57
57
  export declare function AdoptedSSDeleteRule(sheetID: number, index: number): Messages.AdoptedSSDeleteRule;
58
58
  export declare function AdoptedSSAddOwner(sheetID: number, id: number): Messages.AdoptedSSAddOwner;
59
59
  export declare function AdoptedSSRemoveOwner(sheetID: number, id: number): Messages.AdoptedSSRemoveOwner;
60
- export declare function JSException(name: string, message: string, payload: string, metadata: string): Messages.JSException;
61
60
  export declare function Zustand(mutation: string, state: string): Messages.Zustand;
62
- export declare function BatchMetadata(version: number, pageNo: number, firstIndex: number, timestamp: number, location: string): Messages.BatchMetadata;
63
- export declare function PartitionedMessage(partNo: number, partTotal: number): Messages.PartitionedMessage;
61
+ export declare function JSException(name: string, message: string, payload: string, metadata: string): Messages.JSException;