@openreplay/tracker 14.0.0 → 14.0.2

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 CHANGED
@@ -1,12 +1,13 @@
1
- # 15.0.0
1
+ # 14.0.2
2
2
 
3
- - updated graphql plugin and messages
3
+ - fix logger check
4
4
 
5
- # 14.0.0
5
+ # 14.0.0 & .1
6
6
 
7
7
  - titles for tabs
8
8
  - new `MouseClick` message to introduce heatmaps instead of clickmaps
9
9
  - crossdomain iframe tracking functionality
10
+ - updated graphql plugin and messages
10
11
 
11
12
  # 13.0.2
12
13
 
package/bun.lockb CHANGED
Binary file
package/cjs/app/canvas.js CHANGED
@@ -150,6 +150,7 @@ function captureSnapshot(canvas, quality = 'medium', dummy, fixedScaling = false
150
150
  if (!ctx) {
151
151
  return '';
152
152
  }
153
+ ctx.clearRect(0, 0, dummy.width, dummy.height);
153
154
  ctx.drawImage(canvas, 0, 0, dummy.width, dummy.height);
154
155
  dummy.toBlob(onBlob, imageFormat, qualityInt[quality]);
155
156
  }
@@ -157,6 +158,16 @@ function captureSnapshot(canvas, quality = 'medium', dummy, fixedScaling = false
157
158
  canvas.toBlob(onBlob, imageFormat, qualityInt[quality]);
158
159
  }
159
160
  }
161
+ function saveImageData(imageDataBlob, name) {
162
+ const imageDataUrl = URL.createObjectURL(imageDataBlob);
163
+ const link = document.createElement('a');
164
+ link.href = imageDataUrl;
165
+ link.download = name;
166
+ link.style.display = 'none';
167
+ document.body.appendChild(link);
168
+ link.click();
169
+ document.body.removeChild(link);
170
+ }
160
171
  function dataUrlToBlob(dataUrl) {
161
172
  const [header, base64] = dataUrl.split(',');
162
173
  if (!header || !base64)
@@ -173,14 +184,4 @@ function dataUrlToBlob(dataUrl) {
173
184
  }
174
185
  return [new Blob([u8arr], { type: mime }), u8arr];
175
186
  }
176
- function saveImageData(imageDataBlob, name) {
177
- const imageDataUrl = URL.createObjectURL(imageDataBlob);
178
- const link = document.createElement('a');
179
- link.href = imageDataUrl;
180
- link.download = name;
181
- link.style.display = 'none';
182
- document.body.appendChild(link);
183
- link.click();
184
- document.body.removeChild(link);
185
- }
186
187
  exports.default = CanvasRecorder;
package/cjs/app/index.js CHANGED
@@ -94,7 +94,7 @@ class App {
94
94
  this.stopCallbacks = [];
95
95
  this.commitCallbacks = [];
96
96
  this.activityState = ActivityState.NotActive;
97
- this.version = '14.0.0'; // TODO: version compatability check inside each plugin.
97
+ this.version = '14.0.2'; // TODO: version compatability check inside each plugin.
98
98
  this.socketMode = false;
99
99
  this.compressionThreshold = 24 * 1000;
100
100
  this.bc = null;
@@ -9,8 +9,8 @@ export type ILogLevel = (typeof LogLevel)[keyof typeof LogLevel];
9
9
  export default class Logger {
10
10
  private readonly level;
11
11
  constructor(debugLevel?: ILogLevel);
12
- private shouldLog;
13
- log(...args: any[]): void;
14
- warn(...args: any[]): void;
15
- error(...args: any[]): void;
12
+ private readonly shouldLog;
13
+ log: (...args: any[]) => void;
14
+ warn: (...args: any[]) => void;
15
+ error: (...args: any[]) => void;
16
16
  }
package/cjs/app/logger.js CHANGED
@@ -10,28 +10,28 @@ exports.LogLevel = {
10
10
  };
11
11
  class Logger {
12
12
  constructor(debugLevel = exports.LogLevel.Silent) {
13
+ this.shouldLog = (level) => {
14
+ return this.level >= level;
15
+ };
16
+ this.log = (...args) => {
17
+ if (this.shouldLog(exports.LogLevel.Log)) {
18
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
19
+ console.log(...args);
20
+ }
21
+ };
22
+ this.warn = (...args) => {
23
+ if (this.shouldLog(exports.LogLevel.Warnings)) {
24
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
25
+ console.warn(...args);
26
+ }
27
+ };
28
+ this.error = (...args) => {
29
+ if (this.shouldLog(exports.LogLevel.Errors)) {
30
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
31
+ console.error(...args);
32
+ }
33
+ };
13
34
  this.level = debugLevel;
14
35
  }
15
- shouldLog(level) {
16
- return this.level >= level;
17
- }
18
- log(...args) {
19
- if (this.shouldLog(exports.LogLevel.Log)) {
20
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
21
- console.log(...args);
22
- }
23
- }
24
- warn(...args) {
25
- if (this.shouldLog(exports.LogLevel.Warnings)) {
26
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
27
- console.warn(...args);
28
- }
29
- }
30
- error(...args) {
31
- if (this.shouldLog(exports.LogLevel.Errors)) {
32
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
33
- console.error(...args);
34
- }
35
- }
36
36
  }
37
37
  exports.default = Logger;
package/cjs/index.js CHANGED
@@ -98,7 +98,7 @@ class API {
98
98
  const orig = this.options.ingestPoint || index_js_1.DEFAULT_INGEST_POINT;
99
99
  req.open('POST', orig + '/v1/web/not-started');
100
100
  req.send(JSON.stringify({
101
- trackerVersion: '14.0.0',
101
+ trackerVersion: '14.0.2',
102
102
  projectKey: this.options.projectKey,
103
103
  doNotTrack,
104
104
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,
package/lib/app/canvas.js CHANGED
@@ -148,6 +148,7 @@ function captureSnapshot(canvas, quality = 'medium', dummy, fixedScaling = false
148
148
  if (!ctx) {
149
149
  return '';
150
150
  }
151
+ ctx.clearRect(0, 0, dummy.width, dummy.height);
151
152
  ctx.drawImage(canvas, 0, 0, dummy.width, dummy.height);
152
153
  dummy.toBlob(onBlob, imageFormat, qualityInt[quality]);
153
154
  }
@@ -155,6 +156,16 @@ function captureSnapshot(canvas, quality = 'medium', dummy, fixedScaling = false
155
156
  canvas.toBlob(onBlob, imageFormat, qualityInt[quality]);
156
157
  }
157
158
  }
159
+ function saveImageData(imageDataBlob, name) {
160
+ const imageDataUrl = URL.createObjectURL(imageDataBlob);
161
+ const link = document.createElement('a');
162
+ link.href = imageDataUrl;
163
+ link.download = name;
164
+ link.style.display = 'none';
165
+ document.body.appendChild(link);
166
+ link.click();
167
+ document.body.removeChild(link);
168
+ }
158
169
  function dataUrlToBlob(dataUrl) {
159
170
  const [header, base64] = dataUrl.split(',');
160
171
  if (!header || !base64)
@@ -171,14 +182,4 @@ function dataUrlToBlob(dataUrl) {
171
182
  }
172
183
  return [new Blob([u8arr], { type: mime }), u8arr];
173
184
  }
174
- function saveImageData(imageDataBlob, name) {
175
- const imageDataUrl = URL.createObjectURL(imageDataBlob);
176
- const link = document.createElement('a');
177
- link.href = imageDataUrl;
178
- link.download = name;
179
- link.style.display = 'none';
180
- document.body.appendChild(link);
181
- link.click();
182
- document.body.removeChild(link);
183
- }
184
185
  export default CanvasRecorder;
package/lib/app/index.js CHANGED
@@ -65,7 +65,7 @@ export default class App {
65
65
  this.stopCallbacks = [];
66
66
  this.commitCallbacks = [];
67
67
  this.activityState = ActivityState.NotActive;
68
- this.version = '14.0.0'; // TODO: version compatability check inside each plugin.
68
+ this.version = '14.0.2'; // TODO: version compatability check inside each plugin.
69
69
  this.socketMode = false;
70
70
  this.compressionThreshold = 24 * 1000;
71
71
  this.bc = null;
@@ -9,8 +9,8 @@ export type ILogLevel = (typeof LogLevel)[keyof typeof LogLevel];
9
9
  export default class Logger {
10
10
  private readonly level;
11
11
  constructor(debugLevel?: ILogLevel);
12
- private shouldLog;
13
- log(...args: any[]): void;
14
- warn(...args: any[]): void;
15
- error(...args: any[]): void;
12
+ private readonly shouldLog;
13
+ log: (...args: any[]) => void;
14
+ warn: (...args: any[]) => void;
15
+ error: (...args: any[]) => void;
16
16
  }
package/lib/app/logger.js CHANGED
@@ -7,27 +7,27 @@ export const LogLevel = {
7
7
  };
8
8
  export default class Logger {
9
9
  constructor(debugLevel = LogLevel.Silent) {
10
+ this.shouldLog = (level) => {
11
+ return this.level >= level;
12
+ };
13
+ this.log = (...args) => {
14
+ if (this.shouldLog(LogLevel.Log)) {
15
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
16
+ console.log(...args);
17
+ }
18
+ };
19
+ this.warn = (...args) => {
20
+ if (this.shouldLog(LogLevel.Warnings)) {
21
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
22
+ console.warn(...args);
23
+ }
24
+ };
25
+ this.error = (...args) => {
26
+ if (this.shouldLog(LogLevel.Errors)) {
27
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
28
+ console.error(...args);
29
+ }
30
+ };
10
31
  this.level = debugLevel;
11
32
  }
12
- shouldLog(level) {
13
- return this.level >= level;
14
- }
15
- log(...args) {
16
- if (this.shouldLog(LogLevel.Log)) {
17
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
18
- console.log(...args);
19
- }
20
- }
21
- warn(...args) {
22
- if (this.shouldLog(LogLevel.Warnings)) {
23
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
24
- console.warn(...args);
25
- }
26
- }
27
- error(...args) {
28
- if (this.shouldLog(LogLevel.Errors)) {
29
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
30
- console.error(...args);
31
- }
32
- }
33
33
  }
package/lib/index.js CHANGED
@@ -67,7 +67,7 @@ export default class API {
67
67
  const orig = this.options.ingestPoint || DEFAULT_INGEST_POINT;
68
68
  req.open('POST', orig + '/v1/web/not-started');
69
69
  req.send(JSON.stringify({
70
- trackerVersion: '14.0.0',
70
+ trackerVersion: '14.0.2',
71
71
  projectKey: this.options.projectKey,
72
72
  doNotTrack,
73
73
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openreplay/tracker",
3
3
  "description": "The OpenReplay tracker main package",
4
- "version": "14.0.0",
4
+ "version": "14.0.2",
5
5
  "keywords": [
6
6
  "logging",
7
7
  "replay"
@@ -21,7 +21,6 @@
21
21
  "rollup": "rollup --config rollup.config.js",
22
22
  "compile": "node --experimental-modules --experimental-json-modules scripts/compile.cjs",
23
23
  "build": "bun run clean && bun run tscRun && bun run rollup && bun run compile",
24
- "prepare": "cd ../../ && husky install tracker/.husky/",
25
24
  "lint-front": "lint-staged",
26
25
  "test": "jest --coverage=false",
27
26
  "test:ci": "jest --coverage=true",
@@ -38,7 +37,6 @@
38
37
  "eslint": "^7.8.0",
39
38
  "eslint-config-prettier": "^9.0.0",
40
39
  "eslint-plugin-prettier": "^5.0.1",
41
- "husky": "^8.0.1",
42
40
  "jest": "^29.3.1",
43
41
  "jest-environment-jsdom": "^29.3.1",
44
42
  "lint-staged": "^13.0.3",
@@ -58,11 +56,6 @@
58
56
  "engines": {
59
57
  "node": ">=14.0"
60
58
  },
61
- "husky": {
62
- "hooks": {
63
- "pre-commit": "sh lint.sh"
64
- }
65
- },
66
59
  "lint-staged": {
67
60
  "*.{js,mjs,jsx,ts,tsx}": [
68
61
  "eslint --fix --quiet"