clarity-decode 0.8.12 → 0.8.15
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/build/clarity.decode.js +10 -1
- package/build/clarity.decode.min.js +1 -1
- package/build/clarity.decode.module.js +10 -1
- package/package.json +60 -60
package/build/clarity.decode.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var version$1 = "0.8.
|
|
3
|
+
var version$1 = "0.8.14";
|
|
4
4
|
var version = version$1;
|
|
5
5
|
|
|
6
6
|
function decode$5(tokens) {
|
|
@@ -102,6 +102,9 @@ function decode$5(tokens) {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
return { time: time, event: event, data: extract };
|
|
105
|
+
case 47 /* Data.Event.Consent */:
|
|
106
|
+
var consent = { source: tokens[2], ad_Storage: tokens[3], analytics_Storage: tokens[4] };
|
|
107
|
+
return { time: time, event: event, data: consent };
|
|
105
108
|
}
|
|
106
109
|
return null;
|
|
107
110
|
}
|
|
@@ -692,6 +695,12 @@ function decode(input) {
|
|
|
692
695
|
}
|
|
693
696
|
payload.extract.push(decode$5(entry));
|
|
694
697
|
break;
|
|
698
|
+
case 47 /* Data.Event.Consent */:
|
|
699
|
+
if (payload.consent === undefined) {
|
|
700
|
+
payload.consent = [];
|
|
701
|
+
}
|
|
702
|
+
payload.consent.push(decode$5(entry));
|
|
703
|
+
break;
|
|
695
704
|
default:
|
|
696
705
|
console.error("No handler for Event: ".concat(JSON.stringify(entry)));
|
|
697
706
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var e="0.8.
|
|
1
|
+
!function(){"use strict";var e="0.8.14";function t(e){var t=e[0],a=e[1];switch(a){case 25:return{time:t,event:a,data:{gap:e[2]}};case 35:return{time:t,event:a,data:{check:e[2]}};case 24:return{time:t,event:a,data:{key:e[2],value:e[3]}};case 3:return{time:t,event:a,data:{key:e[2]}};case 2:return{time:t,event:a,data:{sequence:e[2],attempts:e[3],status:e[4]}};case 0:for(var r=2,n={};r<e.length;)n[e[r++]]=e[r++];return{time:t,event:a,data:n};case 1:for(var i=2,s={};i<e.length;)s[e[i++]]=e[i++];return{time:t,event:a,data:s};case 36:for(var c=2,o={};c<e.length;){var u=e[c++],l=e[c++];o[u]=[];for(var d=0;d<l.length-1;d+=2)o[u].push([l[d],l[d+1]])}return{time:t,event:a,data:o};case 4:var v=e.length;return{time:t,event:a,data:{visible:e[2],docWidth:e[3],docHeight:e[4],screenWidth:e[5],screenHeight:e[6],scrollX:e[7],scrollY:e[8],pointerX:e[9],pointerY:e[10],activityTime:e[11],scrollTime:v>12?e[12]:null,pointerTime:v>13?e[13]:null,moveX:v>14?e[14]:null,moveY:v>15?e[15]:null,moveTime:v>16?e[16]:null,downX:v>17?e[17]:null,downY:v>18?e[18]:null,downTime:v>19?e[19]:null,upX:v>20?e[20]:null,upY:v>21?e[21]:null,upTime:v>22?e[22]:null,pointerPrevX:v>23?e[23]:null,pointerPrevY:v>24?e[24]:null,pointerPrevTime:v>25?e[25]:null}};case 34:for(var p=2,h={};p<e.length;)h[e[p++]]="string"==typeof e[p+1]?[e[p++]]:e[p++];return{time:t,event:a,data:h};case 40:for(var m=2,g={};m<e.length;)if("string"==typeof e[m+1])g[e[m++]]=e[m++];else{u=e[m++],l=e[m++];g[u]=[];for(d=0;d<l.length-1;d+=2)g[u][l[d]]=l[d+1]}return{time:t,event:a,data:g};case 47:return{time:t,event:a,data:{source:e[2],ad_Storage:e[3],analytics_Storage:e[4]}}}return null}function a(e){var t=e[0],a=e[1];switch(a){case 31:return{time:t,event:a,data:{message:e[2],line:e[3],column:e[4],stack:e[5],source:e[6]}};case 33:return{time:t,event:a,data:{code:e[2],name:e[3],message:e[4],stack:e[5],severity:e[6]}};case 41:return{time:t,event:a,data:{id:e[2],target:e[3],checksum:e[4]}}}return null}function r(e){var t=e[0],a=e[1];switch(a){case 13:case 14:case 12:case 15:case 16:case 17:case 20:case 18:case 19:return{time:t,event:a,data:{target:e[2],x:e[3],y:e[4],id:e[5]}};case 9:var r=e[12].split(".");return{time:t,event:a,data:{target:e[2],x:e[3],y:e[4],eX:e[5],eY:e[6],button:e[7],reaction:e[8],context:e[9],text:e[10],link:e[11],hash:r[0],hashBeta:r.length>0?r[1]:null,trust:e.length>13?e[13]:1,isFullText:e.length>14?e[14]:null}};case 38:return{time:t,event:a,data:{target:e[2],action:e[3]}};case 11:return{time:t,event:a,data:{width:e[2],height:e[3]}};case 27:return{time:t,event:a,data:{target:e[2],value:e[3]}};case 21:return{time:t,event:a,data:{start:e[2],startOffset:e[3],end:e[4],endOffset:e[5]}};case 42:return{time:t,event:a,data:{target:e[2],type:e[3],value:e[4],checksum:e[5]}};case 39:return{time:t,event:a,data:{target:e[2]}};case 10:return{time:t,event:a,data:{target:e[2],x:e[3],y:e[4],top:e.length>5?e[5]:null,bottom:e.length>6?e[6]:null}};case 22:var n=e[3].split(".");return{time:t,event:a,data:{type:e[2],hash:n[0],x:e[4],y:e[5],reaction:e[6],context:e[7],hashBeta:n.length>0?n[1]:null}};case 28:return{time:t,event:a,data:{visible:e[2]}};case 26:return{time:t,event:a,data:{name:e[2],persisted:e[3]}}}return null}var n=6,i=" ";function s(e){var t=e[0],a=e[1];switch(a){case 8:return{time:t,event:a,data:{width:e[2],height:e[3]}};case 7:for(var r=[],n=void 0,i=2;i<e.length;i+=n){var s=void 0;if("number"==typeof e[i+2])s={id:e[i],interaction:e[i+1],visibility:e[i+2],name:e[i+3]},n=4;else{var o=e[i+1];s={id:e[i],interaction:o>=16?o:16,visibility:o<=13?o:0,name:e[i+2]},n=3}r.push(s)}return{time:t,event:a,data:r};case 45:return{time:t,event:a,data:{id:e[2],operation:e[3],newIds:e[4]}};case 46:return{time:t,event:a,data:{id:e[2],operation:e[3],cssRules:e[4]}};case 44:return{time:t,event:a,data:{id:e[2],operation:e[3],keyFrames:e[4],timing:e[5],timeline:e[6],targetId:e[7]}};case 5:case 6:case 43:var u=null,l=[],d=0,v=[];for(i=2;i<e.length;i++){var p=e[i],h=typeof p;switch(h){case"number":h!==u&&null!==u&&(v.push(c(l,d)),l=[],d=0),l.push(p),d++;break;case"string":l.push(p);break;case"object":if("number"===typeof p[0])for(var m=0,g=p;m<g.length;m++){var b=g[m];l.push(e.length>b?e[b]:null)}}u=h}return v.push(c(l,d)),{time:t,event:a,data:v}}return null}function c(e,t){for(var a=e[t]?e[t].split("~")[0]:e[t],r={id:Math.abs(e[0]),parent:t>1?e[1]:null,previous:t>2?e[2]:null,tag:a},n=e[0]<0,i=!1,s={},c=null,l=t+1;l<e.length;l++){var d=e[l].toString(),v=d.indexOf("="),p=d[0],h=d[d.length-1];if(l===e.length-1&&"STYLE"===r.tag)c=d;else if("*T"!==r.tag&&">"===h&&-1===v);else if("*T"!==r.tag&&"#"===p&&-1===v){var m=d.substr(1).split(".");2===m.length&&(r.width=o(m[0])/100,r.height=o(m[1])/100)}else if("*T"!==r.tag&&v>0){i=!0;var g=d.substr(0,v),b=d.substr(v+1);s[g]=b}else"*T"===r.tag&&(c=n?u(d):d)}return i&&(r.attributes=s),c&&(r.value=c),r}function o(e){return e?parseInt(e,36):null}function u(e){var t=e.trim();if(t.length>0&&-1===t.indexOf(i)){var a=o(t);if(a>0){for(var r=Math.floor(a/n),s=a%n,c=Array(s+1).join("•"),u=0;u<r;u++)c+=(0===u&&0===s?"•":i)+Array(n).join("•");return c}}return e}function l(e){var t=e[0],a=e[1];return 29===a?{time:t,event:a,data:{fetchStart:e[2],connectStart:e[3],connectEnd:e[4],requestStart:e[5],responseStart:e[6],responseEnd:e[7],domInteractive:e[8],domComplete:e[9],loadEventStart:e[10],loadEventEnd:e[11],redirectCount:e[12],size:e[13],type:e[14],protocol:e[15],encodedSize:e[16],decodedSize:e[17]}}:null}function d(e){var t={major:0,minor:0,patch:0,beta:0},a=e.split(".");if(3===a.length){var r=a[2].split("-b");t.major=parseInt(a[0],10),t.minor=parseInt(a[1],10),2===r.length?(t.patch=parseInt(r[0],10),t.beta=parseInt(r[1],10)):t.patch=parseInt(a[2],10)}return t}var v=Object.freeze({__proto__:null,decode:function(n){var i,c=JSON.parse(n),o={version:(i=c.e)[0],sequence:i[1],start:i[2],duration:i[3],projectId:i[4],userId:i[5],sessionId:i[6],pageNum:i[7],upload:i[8],end:i[9],applicationPlatform:i[10],url:i[11]},u={timestamp:Date.now(),envelope:o},v=c.p?c.a.concat(c.p):c.a;v=v.sort((function(e,t){return e[0]-t[0]}));var p=d(u.envelope.version),h=d(e);if(p.major!==h.major||Math.abs(p.minor-h.minor)>1)throw new Error("Invalid version. Actual: ".concat(u.envelope.version," | Expected: ").concat(e," (+/- 1) | ").concat(n.substr(0,250)));for(var m=0,g=v;m<g.length;m++){var b=g[m];switch(b[1]){case 4:void 0===u.baseline&&(u.baseline=[]),u.baseline.push(t(b));break;case 25:void 0===u.ping&&(u.ping=[]),u.ping.push(t(b));break;case 35:void 0===u.limit&&(u.limit=[]),u.limit.push(t(b));break;case 3:void 0===u.upgrade&&(u.upgrade=[]),u.upgrade.push(t(b));break;case 0:void 0===u.metric&&(u.metric=[]);var f=t(b);f.data[2]=n.length,u.metric.push(f);break;case 1:void 0===u.dimension&&(u.dimension=[]),u.dimension.push(t(b));break;case 36:void 0===u.summary&&(u.summary=[]),u.summary.push(t(b));break;case 24:void 0===u.custom&&(u.custom=[]),u.custom.push(t(b));break;case 34:void 0===u.variable&&(u.variable=[]),u.variable.push(t(b));break;case 2:void 0===u.upload&&(u.upload=[]),u.upload.push(t(b));break;case 13:case 14:case 12:case 15:case 16:case 17:case 20:case 18:case 19:void 0===u.pointer&&(u.pointer=[]),u.pointer.push(r(b));break;case 9:void 0===u.click&&(u.click=[]);var k=r(b);u.click.push(k);break;case 38:void 0===u.clipboard&&(u.clipboard=[]);var y=r(b);u.clipboard.push(y);break;case 10:void 0===u.scroll&&(u.scroll=[]),u.scroll.push(r(b));break;case 11:void 0===u.resize&&(u.resize=[]),u.resize.push(r(b));break;case 21:void 0===u.selection&&(u.selection=[]),u.selection.push(r(b));break;case 42:void 0===u.change&&(u.change=[]);var w=r(b);u.change.push(w);break;case 39:void 0===u.submit&&(u.submit=[]);var x=r(b);u.submit.push(x);break;case 22:void 0===u.timeline&&(u.timeline=[]),u.timeline.push(r(b));break;case 27:void 0===u.input&&(u.input=[]),u.input.push(r(b));break;case 26:void 0===u.unload&&(u.unload=[]),u.unload.push(r(b));break;case 28:void 0===u.visibility&&(u.visibility=[]),u.visibility.push(r(b));break;case 37:case 30:case 32:break;case 7:void 0===u.region&&(u.region=[]),u.region.push(s(b));break;case 5:case 6:case 43:case 45:case 46:case 44:void 0===u.dom&&(u.dom=[]),u.dom.push(s(b));break;case 8:void 0===u.doc&&(u.doc=[]),u.doc.push(s(b));break;case 31:void 0===u.script&&(u.script=[]),u.script.push(a(b));break;case 33:void 0===u.log&&(u.log=[]),u.log.push(a(b));break;case 41:void 0===u.fraud&&(u.fraud=[]),u.fraud.push(a(b));break;case 29:void 0===u.navigation&&(u.navigation=[]),u.navigation.push(l(b));break;case 40:void 0===u.extract&&(u.extract=[]),u.extract.push(t(b));break;case 47:void 0===u.consent&&(u.consent=[]),u.consent.push(t(b));break;default:console.error("No handler for Event: ".concat(JSON.stringify(b)))}}return u}});"undefined"!=typeof window&&(void 0!==window.clarity&&null!==window.clarity||(window.clarity={}),window.clarity.decode=v)}();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version$1 = "0.8.
|
|
1
|
+
var version$1 = "0.8.14";
|
|
2
2
|
var version = version$1;
|
|
3
3
|
|
|
4
4
|
function decode$5(tokens) {
|
|
@@ -100,6 +100,9 @@ function decode$5(tokens) {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
return { time: time, event: event, data: extract };
|
|
103
|
+
case 47 /* Data.Event.Consent */:
|
|
104
|
+
var consent = { source: tokens[2], ad_Storage: tokens[3], analytics_Storage: tokens[4] };
|
|
105
|
+
return { time: time, event: event, data: consent };
|
|
103
106
|
}
|
|
104
107
|
return null;
|
|
105
108
|
}
|
|
@@ -690,6 +693,12 @@ function decode(input) {
|
|
|
690
693
|
}
|
|
691
694
|
payload.extract.push(decode$5(entry));
|
|
692
695
|
break;
|
|
696
|
+
case 47 /* Data.Event.Consent */:
|
|
697
|
+
if (payload.consent === undefined) {
|
|
698
|
+
payload.consent = [];
|
|
699
|
+
}
|
|
700
|
+
payload.consent.push(decode$5(entry));
|
|
701
|
+
break;
|
|
693
702
|
default:
|
|
694
703
|
console.error("No handler for Event: ".concat(JSON.stringify(entry)));
|
|
695
704
|
break;
|
package/package.json
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "clarity-decode",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "An analytics library that uses web page interactions to generate aggregated insights",
|
|
5
|
-
"author": "Microsoft Corp.",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "build/clarity.decode.js",
|
|
8
|
-
"module": "build/clarity.decode.module.js",
|
|
9
|
-
"unpkg": "build/clarity.decode.min.js",
|
|
10
|
-
"types": "types/index.d.ts",
|
|
11
|
-
"keywords": [
|
|
12
|
-
"clarity",
|
|
13
|
-
"Microsoft",
|
|
14
|
-
"interactions",
|
|
15
|
-
"cursor",
|
|
16
|
-
"pointer",
|
|
17
|
-
"instrumentation",
|
|
18
|
-
"analytics"
|
|
19
|
-
],
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "https://github.com/microsoft/clarity.git",
|
|
23
|
-
"directory": "packages/clarity-decode"
|
|
24
|
-
},
|
|
25
|
-
"bugs": {
|
|
26
|
-
"url": "https://github.com/Microsoft/clarity/issues"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"clarity-js": "^0.8.
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@rollup/plugin-commonjs": "^24.0.0",
|
|
33
|
-
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
34
|
-
"@rollup/plugin-terser": "^0.4.0",
|
|
35
|
-
"@rollup/plugin-typescript": "^11.0.0",
|
|
36
|
-
"del-cli": "^5.0.0",
|
|
37
|
-
"husky": "^8.0.0",
|
|
38
|
-
"lint-staged": "^13.1.0",
|
|
39
|
-
"rollup": "^3.0.0",
|
|
40
|
-
"ts-node": "^10.1.0",
|
|
41
|
-
"tslint": "^6.1.3",
|
|
42
|
-
"typescript": "^4.3.5"
|
|
43
|
-
},
|
|
44
|
-
"scripts": {
|
|
45
|
-
"build": "yarn build:clean && yarn build:main",
|
|
46
|
-
"build:main": "rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
47
|
-
"build:clean": "del-cli build/*",
|
|
48
|
-
"tslint": "tslint --project ./",
|
|
49
|
-
"tslint:fix": "tslint --fix --project ./ --force"
|
|
50
|
-
},
|
|
51
|
-
"husky": {
|
|
52
|
-
"hooks": {
|
|
53
|
-
"pre-commit": "lint-staged"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"lint-staged": {
|
|
57
|
-
"*.ts": [
|
|
58
|
-
"tslint --format codeFrame"
|
|
59
|
-
]
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "clarity-decode",
|
|
3
|
+
"version": "0.8.15",
|
|
4
|
+
"description": "An analytics library that uses web page interactions to generate aggregated insights",
|
|
5
|
+
"author": "Microsoft Corp.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "build/clarity.decode.js",
|
|
8
|
+
"module": "build/clarity.decode.module.js",
|
|
9
|
+
"unpkg": "build/clarity.decode.min.js",
|
|
10
|
+
"types": "types/index.d.ts",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"clarity",
|
|
13
|
+
"Microsoft",
|
|
14
|
+
"interactions",
|
|
15
|
+
"cursor",
|
|
16
|
+
"pointer",
|
|
17
|
+
"instrumentation",
|
|
18
|
+
"analytics"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/microsoft/clarity.git",
|
|
23
|
+
"directory": "packages/clarity-decode"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/Microsoft/clarity/issues"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"clarity-js": "^0.8.15"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
33
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
34
|
+
"@rollup/plugin-terser": "^0.4.0",
|
|
35
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
36
|
+
"del-cli": "^5.0.0",
|
|
37
|
+
"husky": "^8.0.0",
|
|
38
|
+
"lint-staged": "^13.1.0",
|
|
39
|
+
"rollup": "^3.0.0",
|
|
40
|
+
"ts-node": "^10.1.0",
|
|
41
|
+
"tslint": "^6.1.3",
|
|
42
|
+
"typescript": "^4.3.5"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "yarn build:clean && yarn build:main",
|
|
46
|
+
"build:main": "rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
47
|
+
"build:clean": "del-cli build/*",
|
|
48
|
+
"tslint": "tslint --project ./",
|
|
49
|
+
"tslint:fix": "tslint --fix --project ./ --force"
|
|
50
|
+
},
|
|
51
|
+
"husky": {
|
|
52
|
+
"hooks": {
|
|
53
|
+
"pre-commit": "lint-staged"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"lint-staged": {
|
|
57
|
+
"*.ts": [
|
|
58
|
+
"tslint --format codeFrame"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
61
|
}
|