@openreplay/tracker 8.1.2-beta.3 → 8.1.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,3 +1,9 @@
1
+ # 9.0.0
2
+
3
+ - Option to disable string dictionary
4
+ - Introduced Feature flags api
5
+ - Fixed input durations recorded on programmable autofill
6
+
1
7
  # 8.1.1
2
8
 
3
9
  [collective patch]
@@ -53,6 +53,7 @@ type AppOptions = {
53
53
  localStorage: Storage | null;
54
54
  sessionStorage: Storage | null;
55
55
  forceSingleTab?: boolean;
56
+ disableStringDict?: boolean;
56
57
  onStart?: StartCallback;
57
58
  network?: NetworkOptions;
58
59
  } & WebworkerOptions & SessOptions;
package/cjs/app/index.js CHANGED
@@ -35,7 +35,7 @@ class App {
35
35
  this.stopCallbacks = [];
36
36
  this.commitCallbacks = [];
37
37
  this.activityState = ActivityState.NotActive;
38
- this.version = '8.1.2-beta.3'; // TODO: version compatability check inside each plugin.
38
+ this.version = '8.1.2'; // TODO: version compatability check inside each plugin.
39
39
  this.compressionThreshold = 24 * 1000;
40
40
  this.restartAttempts = 0;
41
41
  this.bc = null;
@@ -58,6 +58,7 @@ class App {
58
58
  __debug_report_edp: null,
59
59
  localStorage: null,
60
60
  sessionStorage: null,
61
+ disableStringDict: false,
61
62
  forceSingleTab: false,
62
63
  }, options);
63
64
  if (!this.options.forceSingleTab && globalThis && 'BroadcastChannel' in globalThis) {
@@ -74,7 +75,7 @@ class App {
74
75
  this.debug = new logger_js_1.default(this.options.__debug__);
75
76
  this.notify = new logger_js_1.default(this.options.verbose ? logger_js_1.LogLevel.Warnings : logger_js_1.LogLevel.Silent);
76
77
  this.session = new session_js_1.default(this, this.options);
77
- this.attributeSender = new attributeSender_js_1.default(this);
78
+ this.attributeSender = new attributeSender_js_1.default(this, Boolean(this.options.disableStringDict));
78
79
  this.session.attachUpdateCallback(({ userID, metadata }) => {
79
80
  if (userID != null) {
80
81
  // TODO: nullable userID
package/cjs/index.d.ts CHANGED
@@ -16,11 +16,10 @@ import type { StartPromiseReturn } from './app/index.js';
16
16
  export type Options = Partial<AppOptions & ConsoleOptions & ExceptionOptions & InputOptions & PerformanceOptions & TimingOptions> & {
17
17
  projectID?: number;
18
18
  projectKey: string;
19
- ignoreTimings?: boolean;
20
19
  sessionToken?: string;
21
20
  respectDoNotTrack?: boolean;
22
21
  autoResetOnWindowOpen?: boolean;
23
- network?: Partial<NetworkOptions>;
22
+ network?: NetworkOptions;
24
23
  mouse?: MouseHandlerOptions;
25
24
  __DISABLE_SECURE_MODE?: boolean;
26
25
  };
package/cjs/index.js CHANGED
@@ -57,7 +57,6 @@ function processOptions(obj) {
57
57
  }
58
58
  class API {
59
59
  constructor(options) {
60
- var _a;
61
60
  this.options = options;
62
61
  // public featureFlags: FeatureFlags
63
62
  this.app = null;
@@ -114,16 +113,12 @@ class API {
114
113
  (0, img_js_1.default)(app);
115
114
  (0, input_js_1.default)(app, options);
116
115
  (0, mouse_js_1.default)(app, options.mouse);
117
- if (options.ignoreTimings) {
118
- (0, timing_js_1.default)(app, options);
119
- (0, performance_js_1.default)(app, options);
120
- }
116
+ (0, timing_js_1.default)(app, options);
117
+ (0, performance_js_1.default)(app, options);
121
118
  (0, scroll_js_1.default)(app);
122
119
  (0, focus_js_1.default)(app);
123
120
  (0, fonts_js_1.default)(app);
124
- if (!((_a = options.network) === null || _a === void 0 ? void 0 : _a.ignoreNetwork)) {
125
- (0, network_js_1.default)(app, options.network);
126
- }
121
+ (0, network_js_1.default)(app, options.network);
127
122
  (0, selection_js_1.default)(app);
128
123
  (0, tabs_js_1.default)(app);
129
124
  window.__OPENREPLAY__ = this;
@@ -156,7 +151,7 @@ class API {
156
151
  // no-cors issue only with text/plain or not-set Content-Type
157
152
  // req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
158
153
  req.send(JSON.stringify({
159
- trackerVersion: '8.1.2-beta.3',
154
+ trackerVersion: '8.1.2',
160
155
  projectKey: options.projectKey,
161
156
  doNotTrack,
162
157
  // TODO: add precise reason (an exact API missing)
@@ -6,8 +6,9 @@ export declare class StringDictionary {
6
6
  }
7
7
  export default class AttributeSender {
8
8
  private readonly app;
9
+ private readonly isDictDisabled;
9
10
  private dict;
10
- constructor(app: App);
11
+ constructor(app: App, isDictDisabled: boolean);
11
12
  sendSetAttribute(id: number, name: string, value: string): void;
12
13
  private applyDict;
13
14
  clear(): void;
@@ -17,11 +17,16 @@ class StringDictionary {
17
17
  }
18
18
  exports.StringDictionary = StringDictionary;
19
19
  class AttributeSender {
20
- constructor(app) {
20
+ constructor(app, isDictDisabled) {
21
21
  this.app = app;
22
+ this.isDictDisabled = isDictDisabled;
22
23
  this.dict = new StringDictionary();
23
24
  }
24
25
  sendSetAttribute(id, name, value) {
26
+ if (this.isDictDisabled) {
27
+ const msg = [12 /* Type.SetNodeAttribute */, id, name, value];
28
+ this.app.send(msg);
29
+ }
25
30
  const message = [
26
31
  51 /* Type.SetNodeAttributeDict */,
27
32
  id,
@@ -2,6 +2,5 @@ import type App from '../app/index.js';
2
2
  export interface Options {
3
3
  consoleMethods: Array<string> | null;
4
4
  consoleThrottling: number;
5
- ignoreConsole?: boolean;
6
5
  }
7
6
  export default function (app: App, opts: Partial<Options>): void;
@@ -87,11 +87,7 @@ function default_1(app, opts) {
87
87
  const options = Object.assign({
88
88
  consoleMethods,
89
89
  consoleThrottling: 30,
90
- ignoreConsole: false,
91
90
  }, opts);
92
- if (options.ignoreConsole) {
93
- return;
94
- }
95
91
  if (!Array.isArray(options.consoleMethods) || options.consoleMethods.length === 0) {
96
92
  return;
97
93
  }
@@ -11,7 +11,6 @@ export interface Options {
11
11
  obscureInputEmails: boolean;
12
12
  defaultInputMode: InputMode;
13
13
  obscureInputDates: boolean;
14
- ignoreInputs?: boolean;
15
14
  }
16
15
  export default function (app: App, opts: Partial<Options>): void;
17
16
  export {};
@@ -80,11 +80,7 @@ function default_1(app, opts) {
80
80
  obscureInputEmails: true,
81
81
  defaultInputMode: 1 /* InputMode.Obscured */,
82
82
  obscureInputDates: false,
83
- ignoreInputs: false,
84
83
  }, opts);
85
- if (options.ignoreInputs) {
86
- return;
87
- }
88
84
  function getInputValue(id, node) {
89
85
  let value = node.value;
90
86
  let inputMode = options.defaultInputMode;
@@ -25,7 +25,6 @@ export interface Options {
25
25
  sanitizer?: Sanitizer;
26
26
  axiosInstances?: Array<AxiosInstance>;
27
27
  useProxy?: boolean;
28
- ignoreNetwork?: boolean;
29
28
  }
30
29
  export default function (app: App, opts?: Partial<Options>): void;
31
30
  export {};
@@ -25,7 +25,6 @@ function default_1(app, opts = {}) {
25
25
  captureInIframes: true,
26
26
  axiosInstances: undefined,
27
27
  useProxy: false,
28
- ignoreNetwork: false,
29
28
  }, opts);
30
29
  if (options.useProxy === false) {
31
30
  app.debug.warn('Network module is migrating to proxy api, to gradually migrate and test it set useProxy to true');
@@ -53,6 +53,7 @@ type AppOptions = {
53
53
  localStorage: Storage | null;
54
54
  sessionStorage: Storage | null;
55
55
  forceSingleTab?: boolean;
56
+ disableStringDict?: boolean;
56
57
  onStart?: StartCallback;
57
58
  network?: NetworkOptions;
58
59
  } & WebworkerOptions & SessOptions;
package/lib/app/index.js CHANGED
@@ -32,7 +32,7 @@ export default class App {
32
32
  this.stopCallbacks = [];
33
33
  this.commitCallbacks = [];
34
34
  this.activityState = ActivityState.NotActive;
35
- this.version = '8.1.2-beta.3'; // TODO: version compatability check inside each plugin.
35
+ this.version = '8.1.2'; // TODO: version compatability check inside each plugin.
36
36
  this.compressionThreshold = 24 * 1000;
37
37
  this.restartAttempts = 0;
38
38
  this.bc = null;
@@ -55,6 +55,7 @@ export default class App {
55
55
  __debug_report_edp: null,
56
56
  localStorage: null,
57
57
  sessionStorage: null,
58
+ disableStringDict: false,
58
59
  forceSingleTab: false,
59
60
  }, options);
60
61
  if (!this.options.forceSingleTab && globalThis && 'BroadcastChannel' in globalThis) {
@@ -71,7 +72,7 @@ export default class App {
71
72
  this.debug = new Logger(this.options.__debug__);
72
73
  this.notify = new Logger(this.options.verbose ? LogLevel.Warnings : LogLevel.Silent);
73
74
  this.session = new Session(this, this.options);
74
- this.attributeSender = new AttributeSender(this);
75
+ this.attributeSender = new AttributeSender(this, Boolean(this.options.disableStringDict));
75
76
  this.session.attachUpdateCallback(({ userID, metadata }) => {
76
77
  if (userID != null) {
77
78
  // TODO: nullable userID
package/lib/index.d.ts CHANGED
@@ -16,11 +16,10 @@ import type { StartPromiseReturn } from './app/index.js';
16
16
  export type Options = Partial<AppOptions & ConsoleOptions & ExceptionOptions & InputOptions & PerformanceOptions & TimingOptions> & {
17
17
  projectID?: number;
18
18
  projectKey: string;
19
- ignoreTimings?: boolean;
20
19
  sessionToken?: string;
21
20
  respectDoNotTrack?: boolean;
22
21
  autoResetOnWindowOpen?: boolean;
23
- network?: Partial<NetworkOptions>;
22
+ network?: NetworkOptions;
24
23
  mouse?: MouseHandlerOptions;
25
24
  __DISABLE_SECURE_MODE?: boolean;
26
25
  };
package/lib/index.js CHANGED
@@ -52,7 +52,6 @@ function processOptions(obj) {
52
52
  }
53
53
  export default class API {
54
54
  constructor(options) {
55
- var _a;
56
55
  this.options = options;
57
56
  // public featureFlags: FeatureFlags
58
57
  this.app = null;
@@ -109,16 +108,12 @@ export default class API {
109
108
  Img(app);
110
109
  Input(app, options);
111
110
  Mouse(app, options.mouse);
112
- if (options.ignoreTimings) {
113
- Timing(app, options);
114
- Performance(app, options);
115
- }
111
+ Timing(app, options);
112
+ Performance(app, options);
116
113
  Scroll(app);
117
114
  Focus(app);
118
115
  Fonts(app);
119
- if (!((_a = options.network) === null || _a === void 0 ? void 0 : _a.ignoreNetwork)) {
120
- Network(app, options.network);
121
- }
116
+ Network(app, options.network);
122
117
  Selection(app);
123
118
  Tabs(app);
124
119
  window.__OPENREPLAY__ = this;
@@ -151,7 +146,7 @@ export default class API {
151
146
  // no-cors issue only with text/plain or not-set Content-Type
152
147
  // req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
153
148
  req.send(JSON.stringify({
154
- trackerVersion: '8.1.2-beta.3',
149
+ trackerVersion: '8.1.2',
155
150
  projectKey: options.projectKey,
156
151
  doNotTrack,
157
152
  // TODO: add precise reason (an exact API missing)
@@ -6,8 +6,9 @@ export declare class StringDictionary {
6
6
  }
7
7
  export default class AttributeSender {
8
8
  private readonly app;
9
+ private readonly isDictDisabled;
9
10
  private dict;
10
- constructor(app: App);
11
+ constructor(app: App, isDictDisabled: boolean);
11
12
  sendSetAttribute(id: number, name: string, value: string): void;
12
13
  private applyDict;
13
14
  clear(): void;
@@ -13,11 +13,16 @@ export class StringDictionary {
13
13
  }
14
14
  }
15
15
  export default class AttributeSender {
16
- constructor(app) {
16
+ constructor(app, isDictDisabled) {
17
17
  this.app = app;
18
+ this.isDictDisabled = isDictDisabled;
18
19
  this.dict = new StringDictionary();
19
20
  }
20
21
  sendSetAttribute(id, name, value) {
22
+ if (this.isDictDisabled) {
23
+ const msg = [12 /* Type.SetNodeAttribute */, id, name, value];
24
+ this.app.send(msg);
25
+ }
21
26
  const message = [
22
27
  51 /* Type.SetNodeAttributeDict */,
23
28
  id,
@@ -2,6 +2,5 @@ import type App from '../app/index.js';
2
2
  export interface Options {
3
3
  consoleMethods: Array<string> | null;
4
4
  consoleThrottling: number;
5
- ignoreConsole?: boolean;
6
5
  }
7
6
  export default function (app: App, opts: Partial<Options>): void;
@@ -85,11 +85,7 @@ export default function (app, opts) {
85
85
  const options = Object.assign({
86
86
  consoleMethods,
87
87
  consoleThrottling: 30,
88
- ignoreConsole: false,
89
88
  }, opts);
90
- if (options.ignoreConsole) {
91
- return;
92
- }
93
89
  if (!Array.isArray(options.consoleMethods) || options.consoleMethods.length === 0) {
94
90
  return;
95
91
  }
@@ -11,7 +11,6 @@ export interface Options {
11
11
  obscureInputEmails: boolean;
12
12
  defaultInputMode: InputMode;
13
13
  obscureInputDates: boolean;
14
- ignoreInputs?: boolean;
15
14
  }
16
15
  export default function (app: App, opts: Partial<Options>): void;
17
16
  export {};
@@ -76,11 +76,7 @@ export default function (app, opts) {
76
76
  obscureInputEmails: true,
77
77
  defaultInputMode: 1 /* InputMode.Obscured */,
78
78
  obscureInputDates: false,
79
- ignoreInputs: false,
80
79
  }, opts);
81
- if (options.ignoreInputs) {
82
- return;
83
- }
84
80
  function getInputValue(id, node) {
85
81
  let value = node.value;
86
82
  let inputMode = options.defaultInputMode;
@@ -25,7 +25,6 @@ export interface Options {
25
25
  sanitizer?: Sanitizer;
26
26
  axiosInstances?: Array<AxiosInstance>;
27
27
  useProxy?: boolean;
28
- ignoreNetwork?: boolean;
29
28
  }
30
29
  export default function (app: App, opts?: Partial<Options>): void;
31
30
  export {};
@@ -23,7 +23,6 @@ export default function (app, opts = {}) {
23
23
  captureInIframes: true,
24
24
  axiosInstances: undefined,
25
25
  useProxy: false,
26
- ignoreNetwork: false,
27
26
  }, opts);
28
27
  if (options.useProxy === false) {
29
28
  app.debug.warn('Network module is migrating to proxy api, to gradually migrate and test it set useProxy to true');
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": "8.1.2-beta.3",
4
+ "version": "8.1.2",
5
5
  "keywords": [
6
6
  "logging",
7
7
  "replay"