clarity-js 0.8.42 → 0.8.43

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 (114) hide show
  1. package/README.md +26 -26
  2. package/build/clarity.extended.js +1 -1
  3. package/build/clarity.insight.js +1 -1
  4. package/build/clarity.js +6043 -6030
  5. package/build/clarity.min.js +1 -1
  6. package/build/clarity.module.js +6043 -6030
  7. package/build/clarity.performance.js +1 -1
  8. package/package.json +70 -70
  9. package/rollup.config.ts +161 -161
  10. package/src/clarity.ts +65 -65
  11. package/src/core/api.ts +8 -8
  12. package/src/core/config.ts +29 -29
  13. package/src/core/copy.ts +3 -3
  14. package/src/core/dynamic.ts +13 -7
  15. package/src/core/event.ts +53 -53
  16. package/src/core/hash.ts +19 -19
  17. package/src/core/history.ts +71 -71
  18. package/src/core/index.ts +81 -81
  19. package/src/core/measure.ts +19 -19
  20. package/src/core/report.ts +28 -28
  21. package/src/core/scrub.ts +204 -202
  22. package/src/core/task.ts +181 -181
  23. package/src/core/throttle.ts +46 -46
  24. package/src/core/time.ts +26 -26
  25. package/src/core/timeout.ts +10 -10
  26. package/src/core/version.ts +2 -2
  27. package/src/data/baseline.ts +162 -162
  28. package/src/data/compress.ts +31 -31
  29. package/src/data/consent.ts +77 -77
  30. package/src/data/custom.ts +23 -23
  31. package/src/data/dimension.ts +53 -53
  32. package/src/data/encode.ts +155 -155
  33. package/src/data/envelope.ts +53 -53
  34. package/src/data/extract.ts +211 -211
  35. package/src/data/index.ts +50 -50
  36. package/src/data/limit.ts +44 -44
  37. package/src/data/metadata.ts +411 -408
  38. package/src/data/metric.ts +51 -51
  39. package/src/data/ping.ts +36 -36
  40. package/src/data/signal.ts +30 -30
  41. package/src/data/summary.ts +34 -34
  42. package/src/data/token.ts +39 -39
  43. package/src/data/upgrade.ts +44 -44
  44. package/src/data/upload.ts +333 -333
  45. package/src/data/variable.ts +83 -83
  46. package/src/diagnostic/encode.ts +40 -40
  47. package/src/diagnostic/fraud.ts +36 -36
  48. package/src/diagnostic/index.ts +13 -13
  49. package/src/diagnostic/internal.ts +28 -28
  50. package/src/diagnostic/script.ts +35 -35
  51. package/src/dynamic/agent/blank.ts +2 -2
  52. package/src/dynamic/agent/crisp.ts +40 -40
  53. package/src/dynamic/agent/encode.ts +25 -25
  54. package/src/dynamic/agent/index.ts +8 -8
  55. package/src/dynamic/agent/livechat.ts +58 -58
  56. package/src/dynamic/agent/tidio.ts +44 -44
  57. package/src/global.ts +6 -6
  58. package/src/index.ts +9 -9
  59. package/src/insight/blank.ts +14 -14
  60. package/src/insight/encode.ts +60 -60
  61. package/src/insight/snapshot.ts +114 -114
  62. package/src/interaction/change.ts +38 -38
  63. package/src/interaction/click.ts +173 -173
  64. package/src/interaction/clipboard.ts +32 -32
  65. package/src/interaction/encode.ts +210 -210
  66. package/src/interaction/index.ts +60 -60
  67. package/src/interaction/input.ts +57 -57
  68. package/src/interaction/pointer.ts +137 -137
  69. package/src/interaction/resize.ts +50 -50
  70. package/src/interaction/scroll.ts +129 -129
  71. package/src/interaction/selection.ts +66 -66
  72. package/src/interaction/submit.ts +30 -30
  73. package/src/interaction/timeline.ts +69 -69
  74. package/src/interaction/unload.ts +26 -26
  75. package/src/interaction/visibility.ts +27 -27
  76. package/src/layout/animation.ts +133 -133
  77. package/src/layout/custom.ts +42 -42
  78. package/src/layout/discover.ts +31 -31
  79. package/src/layout/document.ts +46 -46
  80. package/src/layout/dom.ts +439 -439
  81. package/src/layout/encode.ts +154 -154
  82. package/src/layout/index.ts +42 -42
  83. package/src/layout/mutation.ts +411 -411
  84. package/src/layout/node.ts +294 -294
  85. package/src/layout/offset.ts +19 -19
  86. package/src/layout/region.ts +151 -151
  87. package/src/layout/schema.ts +63 -63
  88. package/src/layout/selector.ts +82 -82
  89. package/src/layout/style.ts +159 -159
  90. package/src/layout/target.ts +32 -32
  91. package/src/layout/traverse.ts +27 -27
  92. package/src/performance/blank.ts +9 -9
  93. package/src/performance/encode.ts +31 -31
  94. package/src/performance/index.ts +12 -12
  95. package/src/performance/interaction.ts +125 -125
  96. package/src/performance/navigation.ts +31 -31
  97. package/src/performance/observer.ts +112 -112
  98. package/src/queue.ts +33 -33
  99. package/test/core.test.ts +139 -139
  100. package/test/helper.ts +162 -162
  101. package/test/html/core.html +27 -27
  102. package/test/stub.test.ts +7 -7
  103. package/test/tsconfig.test.json +5 -5
  104. package/tsconfig.json +21 -21
  105. package/tslint.json +32 -32
  106. package/types/agent.d.ts +39 -39
  107. package/types/core.d.ts +150 -150
  108. package/types/data.d.ts +572 -571
  109. package/types/diagnostic.d.ts +24 -24
  110. package/types/global.d.ts +30 -30
  111. package/types/index.d.ts +40 -40
  112. package/types/interaction.d.ts +177 -177
  113. package/types/layout.d.ts +276 -276
  114. package/types/performance.d.ts +31 -31
@@ -1,27 +1,27 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Core Tests</title>
5
- <style>input, textarea, select { margin: 10px; display: block; }</style>
6
- </head>
7
- <body>
8
- <div>
9
- <h1 id="one">Thanks for your order #2AB700GH</h1>
10
- <p id="two" class="address-details">1 Microsoft Way, Redmond, WA - 98052</p>
11
- </div>
12
- <div id="mask">
13
- <span id="child">Hello Wor1d</span>
14
- </div>
15
- <form name="login">
16
- <input type="email" id="eml" title="Email" value="random@email.test">
17
- <input type="password" id="pwd" title="Password" maxlength="16" value="passw0rd">
18
- <input type="search" id="search" title="Search" value="hello w0rld">
19
- <input type="text" id="cardnum" title="CC" value="1234">
20
- <textarea id="textarea" autocapitalize="off" role="combobox" rows="5" placeholder="" spellcheck="false">Hell0 World</textarea>
21
- <select id="select" ng-options="origin.code" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
22
- <option id="option1" label="Halifax" value="string:YHZ">Halifax</option>
23
- <option id="option2" label="Montréal" value="string:YUL" selected="selected">Montréal</option>
24
- </select>
25
- </form>
26
- </body>
27
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Core Tests</title>
5
+ <style>input, textarea, select { margin: 10px; display: block; }</style>
6
+ </head>
7
+ <body>
8
+ <div>
9
+ <h1 id="one">Thanks for your order #2AB700GH</h1>
10
+ <p id="two" class="address-details">1 Microsoft Way, Redmond, WA - 98052</p>
11
+ </div>
12
+ <div id="mask">
13
+ <span id="child">Hello Wor1d</span>
14
+ </div>
15
+ <form name="login">
16
+ <input type="email" id="eml" title="Email" value="random@email.test">
17
+ <input type="password" id="pwd" title="Password" maxlength="16" value="passw0rd">
18
+ <input type="search" id="search" title="Search" value="hello w0rld">
19
+ <input type="text" id="cardnum" title="CC" value="1234">
20
+ <textarea id="textarea" autocapitalize="off" role="combobox" rows="5" placeholder="" spellcheck="false">Hell0 World</textarea>
21
+ <select id="select" ng-options="origin.code" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
22
+ <option id="option1" label="Halifax" value="string:YHZ">Halifax</option>
23
+ <option id="option2" label="Montréal" value="string:YUL" selected="selected">Montréal</option>
24
+ </select>
25
+ </form>
26
+ </body>
27
+ </html>
package/test/stub.test.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { assert } from 'chai';
2
-
3
- describe('Stub Tests! Replace with working real tests!', () => {
4
- it('should be a successful test', () => {
5
- assert.isTrue(true);
6
- });
7
- });
1
+ import { assert } from 'chai';
2
+
3
+ describe('Stub Tests! Replace with working real tests!', () => {
4
+ it('should be a successful test', () => {
5
+ assert.isTrue(true);
6
+ });
7
+ });
@@ -1,6 +1,6 @@
1
- {
2
- "extends": "../tsconfig.json",
3
- "compilerOptions": {
4
- "module": "commonjs"
5
- }
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "commonjs"
5
+ }
6
6
  }
package/tsconfig.json CHANGED
@@ -1,21 +1,21 @@
1
- {
2
- "compilerOptions": {
3
- "module": "esnext",
4
- "target": "es5",
5
- "lib": ["es6", "dom", "es2016", "es2017"],
6
- "moduleResolution": "node",
7
- "forceConsistentCasingInFileNames": true,
8
- "noImplicitReturns": true,
9
- "noUnusedLocals": true,
10
- "noUnusedParameters": true,
11
- "resolveJsonModule": true,
12
- "esModuleInterop": true,
13
- "baseUrl": ".",
14
- "paths": {
15
- "@src/*": ["src/*"],
16
- "@clarity-types/*": ["types/*"]
17
- }
18
- },
19
- "include":["src/**/*.ts","types/**/*.d.ts", "rollup.config.ts"],
20
- "exclude": ["test", "node_modules", "build"]
21
- }
1
+ {
2
+ "compilerOptions": {
3
+ "module": "esnext",
4
+ "target": "es5",
5
+ "lib": ["es6", "dom", "es2016", "es2017"],
6
+ "moduleResolution": "node",
7
+ "forceConsistentCasingInFileNames": true,
8
+ "noImplicitReturns": true,
9
+ "noUnusedLocals": true,
10
+ "noUnusedParameters": true,
11
+ "resolveJsonModule": true,
12
+ "esModuleInterop": true,
13
+ "baseUrl": ".",
14
+ "paths": {
15
+ "@src/*": ["src/*"],
16
+ "@clarity-types/*": ["types/*"]
17
+ }
18
+ },
19
+ "include":["src/**/*.ts","types/**/*.d.ts", "rollup.config.ts"],
20
+ "exclude": ["test", "node_modules", "build"]
21
+ }
package/tslint.json CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "extends": "tslint:recommended",
3
- "rules": {
4
- "max-line-length": [
5
- true,
6
- 140
7
- ],
8
- "no-console": [
9
- false
10
- ],
11
- "no-string-literal": false,
12
- "prefer-const": false,
13
- "prefer-for-of": false,
14
- "object-literal-sort-keys": false,
15
- "one-variable-per-declaration": false,
16
- "trailing-comma": [
17
- false
18
- ],
19
- "variable-name": false,
20
- "interface-name": false,
21
- "interface-over-type-literal": false,
22
- "only-arrow-functions": false,
23
- "typedef": [
24
- true,
25
- "call-signature",
26
- "parameter",
27
- "property-declaration",
28
- "member-variable-declaration",
29
- "object-destructuring",
30
- "array-destructuring"
31
- ]
32
- }
1
+ {
2
+ "extends": "tslint:recommended",
3
+ "rules": {
4
+ "max-line-length": [
5
+ true,
6
+ 140
7
+ ],
8
+ "no-console": [
9
+ false
10
+ ],
11
+ "no-string-literal": false,
12
+ "prefer-const": false,
13
+ "prefer-for-of": false,
14
+ "object-literal-sort-keys": false,
15
+ "one-variable-per-declaration": false,
16
+ "trailing-comma": [
17
+ false
18
+ ],
19
+ "variable-name": false,
20
+ "interface-name": false,
21
+ "interface-over-type-literal": false,
22
+ "only-arrow-functions": false,
23
+ "typedef": [
24
+ true,
25
+ "call-signature",
26
+ "parameter",
27
+ "property-declaration",
28
+ "member-variable-declaration",
29
+ "object-destructuring",
30
+ "array-destructuring"
31
+ ]
32
+ }
33
33
  }
package/types/agent.d.ts CHANGED
@@ -1,39 +1,39 @@
1
- export const enum Action {
2
- AgentOnline,
3
- AgentOffline,
4
- AgentHidden,
5
- AgentMaximized,
6
- AgentMinimized,
7
- AgentMessage,
8
- HumanMessage,
9
- }
10
-
11
- export const enum AuthorType {
12
- Agent = "agent",
13
- Customer = "customer",
14
- }
15
-
16
- export const enum Visibility {
17
- Maximized = "maximized",
18
- Minimized = "minimized",
19
- Hidden = "hidden",
20
- }
21
-
22
- export const enum Availability {
23
- Online = "online",
24
- Offline = "offline",
25
- }
26
-
27
- export interface VisibilityEvent {
28
- visibility: Visibility;
29
- }
30
-
31
- export interface AvailabilityEvent {
32
- availability: Availability;
33
- }
34
-
35
- export interface NewEvent {
36
- author: {
37
- type: AuthorType;
38
- };
39
- }
1
+ export const enum Action {
2
+ AgentOnline,
3
+ AgentOffline,
4
+ AgentHidden,
5
+ AgentMaximized,
6
+ AgentMinimized,
7
+ AgentMessage,
8
+ HumanMessage,
9
+ }
10
+
11
+ export const enum AuthorType {
12
+ Agent = "agent",
13
+ Customer = "customer",
14
+ }
15
+
16
+ export const enum Visibility {
17
+ Maximized = "maximized",
18
+ Minimized = "minimized",
19
+ Hidden = "hidden",
20
+ }
21
+
22
+ export const enum Availability {
23
+ Online = "online",
24
+ Offline = "offline",
25
+ }
26
+
27
+ export interface VisibilityEvent {
28
+ visibility: Visibility;
29
+ }
30
+
31
+ export interface AvailabilityEvent {
32
+ availability: Availability;
33
+ }
34
+
35
+ export interface NewEvent {
36
+ author: {
37
+ type: AuthorType;
38
+ };
39
+ }
package/types/core.d.ts CHANGED
@@ -1,150 +1,150 @@
1
- import * as Data from "./data";
2
-
3
- type TaskFunction = () => Promise<void>;
4
- type TaskResolve = () => void;
5
- type UploadCallback = (data: string) => void;
6
- type Region = [number /* RegionId */, string /* Query Selector */];
7
- type Checksum = [number /* FraudId */, string /* Query Selector */];
8
-
9
- /* Enum */
10
-
11
- export const enum Priority {
12
- Normal = 0,
13
- High = 1
14
- }
15
-
16
- export const enum Time {
17
- Second = 1000,
18
- Minute = 60 * 1000,
19
- Hour = 60 * 60 * 1000,
20
- Day = 24 * 60 * 60 * 1000
21
- }
22
-
23
- export const enum Task {
24
- Wait = 0,
25
- Run = 1,
26
- Stop = 2
27
- }
28
-
29
- export const enum ExtractSource {
30
- Javascript = 0,
31
- Cookie = 1,
32
- Text = 2,
33
- Fragment = 3,
34
- Hash = 4
35
- }
36
-
37
- export const enum Type {
38
- Array = 1,
39
- Object = 2,
40
- Simple = 3
41
- }
42
-
43
- export type Syntax = {
44
- name: string,
45
- type: Type,
46
- condition: string
47
- }
48
-
49
- export const enum Privacy {
50
- None = 0,
51
- Sensitive = 1,
52
- Text = 2,
53
- TextImage = 3,
54
- Exclude = 4,
55
- Snapshot = 5
56
- }
57
-
58
- /* Helper Interfaces */
59
-
60
- export interface Module {
61
- start: () => void;
62
- stop: () => void;
63
- }
64
-
65
- export interface Tasks {
66
- [key: number]: TaskInfo;
67
- }
68
-
69
- export interface TaskInfo {
70
- start: number;
71
- calls: number;
72
- yield: number;
73
- }
74
-
75
- export interface Timer {
76
- id: string;
77
- cost: Data.Metric;
78
- }
79
-
80
- export interface RequestIdleCallbackOptions {
81
- timeout: number;
82
- }
83
-
84
- export interface RequestIdleCallbackDeadline {
85
- didTimeout: boolean;
86
- timeRemaining: (() => number);
87
- }
88
-
89
- export interface AsyncTask {
90
- task: TaskFunction;
91
- resolve: TaskResolve;
92
- id: string;
93
- }
94
-
95
- export interface OffsetDistance {
96
- x: number;
97
- y: number;
98
- }
99
-
100
- export interface BrowserEvent {
101
- event: string;
102
- listener: EventListener;
103
- options: {
104
- capture: boolean;
105
- passive: boolean;
106
- };
107
- }
108
-
109
- export interface Report {
110
- v: string; // Version
111
- p: string; // Project Id
112
- u: string; // User Id
113
- s: string; // Session Id
114
- n: number; // Page Number
115
- m?: string; // Message, optional
116
- e?: string; // Error Stack, optional
117
- }
118
-
119
- export interface Config {
120
- projectId?: string;
121
- delay?: number;
122
- lean?: boolean;
123
- lite?: boolean;
124
- track?: boolean;
125
- content?: boolean;
126
- drop?: string[];
127
- mask?: string[];
128
- unmask?: string[];
129
- regions?: Region[];
130
- cookies?: string[];
131
- fraud?: boolean;
132
- checksum?: Checksum[];
133
- report?: string;
134
- upload?: string | UploadCallback;
135
- fallback?: string;
136
- upgrade?: (key: string) => void;
137
- action?: (key: string) => void;
138
- dob?: number;
139
- delayDom?: boolean;
140
- throttleDom?: boolean;
141
- conversions?: boolean;
142
- includeSubdomains?: boolean;
143
- }
144
-
145
- export const enum Constant {
146
- Zone = "Zone",
147
- Symbol = "__symbol__",
148
- AddEventListener = "addEventListener",
149
- RemoveEventListener = "removeEventListener"
150
- }
1
+ import * as Data from "./data";
2
+
3
+ type TaskFunction = () => Promise<void>;
4
+ type TaskResolve = () => void;
5
+ type UploadCallback = (data: string) => void;
6
+ type Region = [number /* RegionId */, string /* Query Selector */];
7
+ type Checksum = [number /* FraudId */, string /* Query Selector */];
8
+
9
+ /* Enum */
10
+
11
+ export const enum Priority {
12
+ Normal = 0,
13
+ High = 1
14
+ }
15
+
16
+ export const enum Time {
17
+ Second = 1000,
18
+ Minute = 60 * 1000,
19
+ Hour = 60 * 60 * 1000,
20
+ Day = 24 * 60 * 60 * 1000
21
+ }
22
+
23
+ export const enum Task {
24
+ Wait = 0,
25
+ Run = 1,
26
+ Stop = 2
27
+ }
28
+
29
+ export const enum ExtractSource {
30
+ Javascript = 0,
31
+ Cookie = 1,
32
+ Text = 2,
33
+ Fragment = 3,
34
+ Hash = 4
35
+ }
36
+
37
+ export const enum Type {
38
+ Array = 1,
39
+ Object = 2,
40
+ Simple = 3
41
+ }
42
+
43
+ export type Syntax = {
44
+ name: string,
45
+ type: Type,
46
+ condition: string
47
+ }
48
+
49
+ export const enum Privacy {
50
+ None = 0,
51
+ Sensitive = 1,
52
+ Text = 2,
53
+ TextImage = 3,
54
+ Exclude = 4,
55
+ Snapshot = 5
56
+ }
57
+
58
+ /* Helper Interfaces */
59
+
60
+ export interface Module {
61
+ start: () => void;
62
+ stop: () => void;
63
+ }
64
+
65
+ export interface Tasks {
66
+ [key: number]: TaskInfo;
67
+ }
68
+
69
+ export interface TaskInfo {
70
+ start: number;
71
+ calls: number;
72
+ yield: number;
73
+ }
74
+
75
+ export interface Timer {
76
+ id: string;
77
+ cost: Data.Metric;
78
+ }
79
+
80
+ export interface RequestIdleCallbackOptions {
81
+ timeout: number;
82
+ }
83
+
84
+ export interface RequestIdleCallbackDeadline {
85
+ didTimeout: boolean;
86
+ timeRemaining: (() => number);
87
+ }
88
+
89
+ export interface AsyncTask {
90
+ task: TaskFunction;
91
+ resolve: TaskResolve;
92
+ id: string;
93
+ }
94
+
95
+ export interface OffsetDistance {
96
+ x: number;
97
+ y: number;
98
+ }
99
+
100
+ export interface BrowserEvent {
101
+ event: string;
102
+ listener: EventListener;
103
+ options: {
104
+ capture: boolean;
105
+ passive: boolean;
106
+ };
107
+ }
108
+
109
+ export interface Report {
110
+ v: string; // Version
111
+ p: string; // Project Id
112
+ u: string; // User Id
113
+ s: string; // Session Id
114
+ n: number; // Page Number
115
+ m?: string; // Message, optional
116
+ e?: string; // Error Stack, optional
117
+ }
118
+
119
+ export interface Config {
120
+ projectId?: string;
121
+ delay?: number;
122
+ lean?: boolean;
123
+ lite?: boolean;
124
+ track?: boolean;
125
+ content?: boolean;
126
+ drop?: string[];
127
+ mask?: string[];
128
+ unmask?: string[];
129
+ regions?: Region[];
130
+ cookies?: string[];
131
+ fraud?: boolean;
132
+ checksum?: Checksum[];
133
+ report?: string;
134
+ upload?: string | UploadCallback;
135
+ fallback?: string;
136
+ upgrade?: (key: string) => void;
137
+ action?: (key: string) => void;
138
+ dob?: number;
139
+ delayDom?: boolean;
140
+ throttleDom?: boolean;
141
+ conversions?: boolean;
142
+ includeSubdomains?: boolean;
143
+ }
144
+
145
+ export const enum Constant {
146
+ Zone = "Zone",
147
+ Symbol = "__symbol__",
148
+ AddEventListener = "addEventListener",
149
+ RemoveEventListener = "removeEventListener"
150
+ }